Skip to content

Commit

Permalink
PANGOLIN-3258 / SHIELD-960: Add Text tone: Tertiary for: text.capti…
Browse files Browse the repository at this point in the history
…on, text.detail. text.body and text.subheadline (#2643)

* feat(text): add tertiary tone

* chore(changelog): add updates to changeset

* test(text): add tertiary tone to text.visualroute.jsx

* chore(readme): add caption draft to readme

* chore(readme): add final instructions to caption readme

* fix(readme): adjust table pt2

* Update .changeset/shiny-files-dress.md

Co-authored-by: Carlos Cortizas <[email protected]>

---------

Co-authored-by: Carlos Cortizas <[email protected]>
  • Loading branch information
valoriecarli and CarlosCortizasCT authored Nov 14, 2023
1 parent 6e53b7a commit 0a5594d
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-files-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-uikit/text': minor
---

Add a new option (**tertiary**) for the `tone` property of `Text.Caption`, `Text.Detail`, `Text.Body` and `Text.Subheadline` component
119 changes: 79 additions & 40 deletions packages/components/text/README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/components/text/src/text.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ storiesOf('Basics|Typography/Text', module)
primary: 'primary',
information: 'information',
secondary: 'secondary',
tertiary: 'tertiary',
positive: 'positive',
negative: 'negative',
})}
Expand Down Expand Up @@ -81,6 +82,7 @@ storiesOf('Basics|Typography/Text', module)
primary: 'primary',
information: 'information',
secondary: 'secondary',
tertiary: 'tertiary',
positive: 'positive',
negative: 'negative',
inverted: 'inverted',
Expand Down Expand Up @@ -113,6 +115,7 @@ storiesOf('Basics|Typography/Text', module)
primary: 'primary',
information: 'information',
secondary: 'secondary',
tertiary: 'tertiary',
positive: 'positive',
negative: 'negative',
inverted: 'inverted',
Expand Down Expand Up @@ -141,6 +144,7 @@ storiesOf('Basics|Typography/Text', module)
primary: 'primary',
information: 'information',
secondary: 'secondary',
tertiary: 'tertiary',
positive: 'positive',
negative: 'negative',
inverted: 'inverted',
Expand Down
2 changes: 2 additions & 0 deletions packages/components/text/src/text.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const getTone = (tone: string) => {
return `color: ${designTokens.colorWarning};`;
case 'critical':
return `color: ${designTokens.colorError40};`;
case 'tertiary':
return `color: ${designTokens.colorNeutral60};`;
case 'inherit':
return 'color: inherit;';
default:
Expand Down
1 change: 1 addition & 0 deletions packages/components/text/src/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
export type TTone =
| 'primary'
| 'secondary'
| 'tertiary'
| 'information'
| 'positive'
| 'negative'
Expand Down
14 changes: 14 additions & 0 deletions packages/components/text/src/text.visualroute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export const component = () => (
{'Subheadline tone secondary'}
</Text.Subheadline>
</Spec>
<Spec label="Subheadline - tone - tertiary">
<Text.Subheadline tone="tertiary" as="h4">
{'Subheadline tone tertiary'}
</Text.Subheadline>
</Spec>
<Spec label="Subheadline - tone - information">
<Text.Subheadline tone="information" as="h4">
{'Subheadline tone information'}
Expand Down Expand Up @@ -120,6 +125,9 @@ export const component = () => (
<Spec label="Body - tone - secondary">
<Text.Body tone="secondary">Body text secondary</Text.Body>
</Spec>
<Spec label="Body - tone - tertiary">
<Text.Body tone="tertiary">Body text tertiary</Text.Body>
</Spec>
<Spec label="Body - tone - information">
<Text.Body tone="information">Body text information</Text.Body>
</Spec>
Expand Down Expand Up @@ -173,6 +181,9 @@ export const component = () => (
<Spec label="Detail - tone - secondary">
<Text.Detail tone="secondary">Detail text secondary</Text.Detail>
</Spec>
<Spec label="Detail - tone - tertiary">
<Text.Detail tone="tertiary">Detail text tertiary</Text.Detail>
</Spec>
<Spec label="Detail - tone - information">
<Text.Detail tone="information">Detail text information</Text.Detail>
</Spec>
Expand Down Expand Up @@ -222,6 +233,9 @@ export const component = () => (
<Spec label="Caption - tone - secondary">
<Text.Caption tone="secondary">Caption text secondary</Text.Caption>
</Spec>
<Spec label="Caption - tone - tertiary">
<Text.Caption tone="tertiary">Caption text tertiary</Text.Caption>
</Spec>
<Spec label="Caption - tone - information">
<Text.Caption tone="information">Caption text information</Text.Caption>
</Spec>
Expand Down

1 comment on commit 0a5594d

@vercel
Copy link

@vercel vercel bot commented on 0a5594d Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.