Skip to content

Commit ec4fad8

Browse files
authored
[LG-5748] chore: Add Text and Border Color Variants (#3321)
* [LG-5748] chore: Add Text and Border Color Variants * updated changset
1 parent d816392 commit ec4fad8

File tree

5 files changed

+49
-12
lines changed

5 files changed

+49
-12
lines changed

.changeset/moody-clouds-lead.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@leafygreen-ui/tokens': minor
3+
---
4+
5+
Updated existing success and error border color variants, added tertiary border color variant, added text Success and SuccessLink color variants

packages/tokens/src/Tokens.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ const generateTable = (theme: Theme) => {
325325
width: 100px;
326326
`}
327327
>
328-
<code>{type}</code>
328+
<code style={{ textTransform: 'capitalize' }}>{type}</code>
329329
</th>
330330
<th
331331
className={css`

packages/tokens/src/color/color.types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ const Variant = {
1717
Placeholder: 'placeholder',
1818
Primary: 'primary',
1919
Secondary: 'secondary',
20+
Tertiary: 'tertiary',
2021
InversePrimary: 'inversePrimary',
2122
InverseSecondary: 'inverseSecondary',
2223
Info: 'info',
2324
Warning: 'warning',
2425
Error: 'error',
2526
Success: 'success',
27+
SuccessLink: 'successLink',
2628
Link: 'link',
2729
} as const;
2830
type Variant = (typeof Variant)[keyof typeof Variant];

packages/tokens/src/color/darkModeColors.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,19 @@ const darkModeBorderColors = {
6363
[InteractionState.Hover]: gray.dark2,
6464
[InteractionState.Focus]: blue.light1,
6565
},
66+
[Variant.Tertiary]: {
67+
[InteractionState.Default]: gray.dark1,
68+
[InteractionState.Hover]: gray.dark1,
69+
[InteractionState.Focus]: blue.light1,
70+
},
6671
[Variant.Success]: {
67-
[InteractionState.Default]: green.dark1,
68-
[InteractionState.Hover]: green.dark1,
72+
[InteractionState.Default]: green.dark2,
73+
[InteractionState.Hover]: green.dark2,
6974
[InteractionState.Focus]: blue.light1,
7075
},
7176
[Variant.Error]: {
72-
[InteractionState.Default]: red.light1,
73-
[InteractionState.Hover]: red.light1,
77+
[InteractionState.Default]: red.dark2,
78+
[InteractionState.Hover]: red.dark2,
7479
[InteractionState.Focus]: blue.light1,
7580
},
7681
[Variant.Disabled]: {
@@ -149,6 +154,11 @@ const darkModeTextColors = {
149154
[InteractionState.Hover]: black,
150155
[InteractionState.Focus]: blue.dark2,
151156
},
157+
[Variant.Success]: {
158+
[InteractionState.Default]: green.light1,
159+
[InteractionState.Hover]: green.light1,
160+
[InteractionState.Focus]: green.light1,
161+
},
152162
[Variant.Error]: {
153163
[InteractionState.Default]: red.light1,
154164
[InteractionState.Hover]: red.light1,
@@ -159,6 +169,11 @@ const darkModeTextColors = {
159169
[InteractionState.Hover]: gray.dark1,
160170
[InteractionState.Focus]: gray.dark1,
161171
},
172+
[Variant.SuccessLink]: {
173+
[InteractionState.Default]: green.light3,
174+
[InteractionState.Hover]: green.light3,
175+
[InteractionState.Focus]: green.light3,
176+
},
162177
[Variant.Link]: {
163178
[InteractionState.Default]: blue.light1,
164179
[InteractionState.Hover]: blue.light1,

packages/tokens/src/color/lightModeColors.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,19 @@ const lightModeBorderColors = {
6363
[InteractionState.Hover]: gray.light2,
6464
[InteractionState.Focus]: blue.light1,
6565
},
66+
[Variant.Tertiary]: {
67+
[InteractionState.Default]: gray.light1,
68+
[InteractionState.Hover]: gray.light1,
69+
[InteractionState.Focus]: blue.light1,
70+
},
6671
[Variant.Success]: {
67-
[InteractionState.Default]: green.dark1,
68-
[InteractionState.Hover]: green.dark1,
72+
[InteractionState.Default]: green.light2,
73+
[InteractionState.Hover]: green.light2,
6974
[InteractionState.Focus]: blue.light1,
7075
},
7176
[Variant.Error]: {
72-
[InteractionState.Default]: red.base,
73-
[InteractionState.Hover]: red.base,
77+
[InteractionState.Default]: red.light2,
78+
[InteractionState.Hover]: red.light2,
7479
[InteractionState.Focus]: blue.light1,
7580
},
7681
[Variant.Disabled]: {
@@ -144,10 +149,15 @@ const lightModeTextColors = {
144149
[InteractionState.Hover]: white,
145150
[InteractionState.Focus]: blue.light2,
146151
},
152+
[Variant.Success]: {
153+
[InteractionState.Default]: green.dark2,
154+
[InteractionState.Hover]: green.dark2,
155+
[InteractionState.Focus]: green.dark2,
156+
},
147157
[Variant.Error]: {
148-
[InteractionState.Default]: red.base,
149-
[InteractionState.Hover]: red.base,
150-
[InteractionState.Focus]: red.base,
158+
[InteractionState.Default]: red.dark2,
159+
[InteractionState.Hover]: red.dark2,
160+
[InteractionState.Focus]: red.dark2,
151161
},
152162
[Variant.Disabled]: {
153163
[InteractionState.Default]: gray.base,
@@ -159,6 +169,11 @@ const lightModeTextColors = {
159169
[InteractionState.Hover]: gray.base,
160170
[InteractionState.Focus]: gray.base,
161171
},
172+
[Variant.SuccessLink]: {
173+
[InteractionState.Default]: green.dark3,
174+
[InteractionState.Hover]: green.dark3,
175+
[InteractionState.Focus]: green.dark3,
176+
},
162177
[Variant.Link]: {
163178
[InteractionState.Default]: blue.base,
164179
[InteractionState.Hover]: blue.base,

0 commit comments

Comments
 (0)