baseui 14.0.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/accordion/accordion.js +4 -4
  2. package/accordion/panel.d.ts +1 -1
  3. package/accordion/styled-components.js +1 -1
  4. package/accordion/types.d.ts +1 -1
  5. package/app-nav-bar/mobile-menu.js +3 -1
  6. package/banner/banner.js +3 -1
  7. package/banner/types.d.ts +2 -1
  8. package/bottom-navigation/bottom-navigation.js +3 -1
  9. package/bottom-navigation/selector.js +1 -1
  10. package/bottom-navigation/styled-components.js +1 -1
  11. package/button/button.d.ts +1 -3
  12. package/button/button.js +6 -2
  13. package/button/styled-components.d.ts +1 -0
  14. package/button/styled-components.js +61 -4
  15. package/button/types.d.ts +15 -3
  16. package/button-timed/button-timed.js +4 -5
  17. package/button-timed/styled-components.js +5 -3
  18. package/button-timed/types.d.ts +1 -1
  19. package/data-table/column-categorical.js +2 -2
  20. package/data-table/locale.d.ts +2 -0
  21. package/data-table/locale.js +2 -1
  22. package/data-table/stateful-container.js +1 -1
  23. package/data-table/stateful-data-table.js +7 -3
  24. package/data-table/types.d.ts +2 -0
  25. package/datepicker/day.js +2 -4
  26. package/datepicker/utils/date-helpers.d.ts +1 -0
  27. package/datepicker/utils/date-helpers.js +3 -0
  28. package/dialog/dialog.d.ts +1 -1
  29. package/dialog/dialog.js +38 -56
  30. package/dialog/styled-components.d.ts +2 -2
  31. package/dialog/styled-components.js +56 -24
  32. package/dialog/types.d.ts +5 -2
  33. package/file-uploader/constants.d.ts +16 -0
  34. package/file-uploader/constants.js +30 -0
  35. package/file-uploader/file-uploader.d.ts +2 -2
  36. package/file-uploader/file-uploader.js +387 -117
  37. package/file-uploader/index.d.ts +1 -1
  38. package/file-uploader/index.js +67 -18
  39. package/file-uploader/locale.d.ts +10 -10
  40. package/file-uploader/locale.js +5 -5
  41. package/file-uploader/styled-components.d.ts +13 -6
  42. package/file-uploader/styled-components.js +261 -64
  43. package/file-uploader/types.d.ts +47 -32
  44. package/file-uploader/utils.d.ts +5 -0
  45. package/file-uploader/utils.js +45 -0
  46. package/file-uploader-basic/file-uploader-basic.d.ts +10 -0
  47. package/file-uploader-basic/file-uploader-basic.js +175 -0
  48. package/file-uploader-basic/index.d.ts +4 -0
  49. package/file-uploader-basic/index.js +71 -0
  50. package/file-uploader-basic/locale.d.ts +15 -0
  51. package/file-uploader-basic/locale.js +21 -0
  52. package/file-uploader-basic/styled-components.d.ts +7 -0
  53. package/file-uploader-basic/styled-components.js +83 -0
  54. package/file-uploader-basic/types.d.ts +41 -0
  55. package/form-control/form-control.js +38 -3
  56. package/form-control/styled-components.d.ts +2 -0
  57. package/form-control/styled-components.js +22 -2
  58. package/form-control/types.d.ts +4 -0
  59. package/icon/circle-check-filled.d.ts +9 -0
  60. package/icon/circle-check-filled.js +50 -0
  61. package/icon/circle-exclamation-point-filled.d.ts +9 -0
  62. package/icon/circle-exclamation-point-filled.js +50 -0
  63. package/icon/hide.js +1 -1
  64. package/icon/icon-exports.d.ts +4 -0
  65. package/icon/icon-exports.js +28 -0
  66. package/icon/paperclip-filled.d.ts +9 -0
  67. package/icon/paperclip-filled.js +50 -0
  68. package/icon/show.js +1 -1
  69. package/icon/trash-can-filled.d.ts +9 -0
  70. package/{button-docked/button-docked.js → icon/trash-can-filled.js} +35 -16
  71. package/locale/en_US.js +14 -12
  72. package/locale/es_AR.js +9 -1
  73. package/locale/index.d.ts +3 -0
  74. package/locale/index.js +2 -0
  75. package/locale/tr_TR.js +9 -1
  76. package/locale/types.d.ts +2 -0
  77. package/message-card/message-card.js +2 -2
  78. package/message-card/utils.js +8 -3
  79. package/modal/modal-button.d.ts +1 -3
  80. package/package.json +5 -3
  81. package/payment-card/custom-cards.config.d.ts +1 -11
  82. package/payment-card/payment-card.js +1 -3
  83. package/phone-input/base-country-picker.js +2 -2
  84. package/phone-input/country-picker.js +0 -10
  85. package/progress-bar/progressbar-rounded.js +1 -1
  86. package/progress-bar/styled-components.js +8 -6
  87. package/rating/styled-components.js +3 -2
  88. package/rating/svg-icons.d.ts +5 -5
  89. package/rating/svg-icons.js +20 -20
  90. package/select/multi-value.js +1 -1
  91. package/snackbar/index.d.ts +1 -0
  92. package/snackbar/snackbar-context.d.ts +1 -2
  93. package/snackbar/snackbar-context.js +27 -21
  94. package/spinner/index.d.ts +4 -2
  95. package/stepper/stepper.js +28 -27
  96. package/styles/__mocks__/styled.js +0 -2
  97. package/styles/as-primary-export-hoc.js +0 -2
  98. package/styles/styled.js +0 -2
  99. package/styles/types.d.ts +7 -3
  100. package/tabs-motion/tabs.js +2 -2
  101. package/tag/constants.d.ts +5 -4
  102. package/tag/constants.js +7 -6
  103. package/tag/index.d.ts +1 -1
  104. package/tag/index.js +7 -7
  105. package/tag/styled-components.d.ts +1 -1
  106. package/tag/styled-components.js +137 -124
  107. package/tag/tag.js +2 -2
  108. package/tag/types.d.ts +9 -8
  109. package/tag/types.js +2 -2
  110. package/themes/dark-theme/color-component-tokens.d.ts +2 -2
  111. package/themes/dark-theme/color-component-tokens.js +279 -275
  112. package/themes/dark-theme/color-foundation-tokens.d.ts +3 -0
  113. package/themes/dark-theme/{color-tokens.js → color-foundation-tokens.js} +11 -14
  114. package/themes/dark-theme/color-semantic-tokens.d.ts +2 -2
  115. package/themes/dark-theme/color-semantic-tokens.js +52 -58
  116. package/themes/dark-theme/create-dark-theme.d.ts +1 -1
  117. package/themes/dark-theme/create-dark-theme.js +12 -32
  118. package/themes/dark-theme/dark-theme.js +4 -4
  119. package/themes/dark-theme/primitives.js +2 -2
  120. package/themes/light-theme/color-component-tokens.d.ts +2 -2
  121. package/themes/light-theme/color-component-tokens.js +287 -282
  122. package/themes/light-theme/color-foundation-tokens.d.ts +3 -0
  123. package/themes/light-theme/{color-tokens.js → color-foundation-tokens.js} +10 -13
  124. package/themes/light-theme/color-semantic-tokens.d.ts +2 -2
  125. package/themes/light-theme/color-semantic-tokens.js +50 -53
  126. package/themes/light-theme/create-light-theme.d.ts +1 -1
  127. package/themes/light-theme/create-light-theme.js +12 -32
  128. package/themes/light-theme/light-theme.js +4 -4
  129. package/themes/light-theme/primitives.js +2 -2
  130. package/themes/types.d.ts +74 -13
  131. package/themes/utils.d.ts +1 -1
  132. package/themes/utils.js +4 -4
  133. package/tile/tile-group.js +2 -2
  134. package/timezonepicker/update-tzdata.js +0 -1
  135. package/tokens/color-primitive-tokens.d.ts +5 -0
  136. package/tokens/color-primitive-tokens.js +301 -0
  137. package/tokens/index.d.ts +5 -4
  138. package/tokens/index.js +25 -3
  139. package/tokens/types.d.ts +170 -1
  140. package/button-docked/button-docked.d.ts +0 -4
  141. package/button-docked/index.d.ts +0 -3
  142. package/button-docked/index.js +0 -40
  143. package/button-docked/styled-components.d.ts +0 -5
  144. package/button-docked/styled-components.js +0 -55
  145. package/button-docked/types.d.ts +0 -14
  146. package/themes/dark-theme/color-tokens.d.ts +0 -3
  147. package/themes/light-theme/color-tokens.d.ts +0 -3
  148. package/tokens/colors.d.ts +0 -3
  149. package/tokens/colors.js +0 -125
  150. /package/{button-docked → file-uploader-basic}/types.js +0 -0
@@ -18,34 +18,30 @@ LICENSE file in the root directory of this source tree.
18
18
  */
19
19
 
20
20
  function customOnRamp(color, unit) {
21
+ // This is a temporary fix to prevent the tag from crashing when the color is not defined
22
+ if (!color && !(unit === '0' || unit === '1000')) {
23
+ return undefined;
24
+ }
21
25
  switch (unit) {
22
26
  case '0':
23
27
  return 'white';
24
28
  case '50':
25
- // @ts-ignore
26
29
  return (0, _tint.default)(0.8, color);
27
30
  case '100':
28
- // @ts-ignore
29
31
  return (0, _tint.default)(0.6, color);
30
32
  case '200':
31
- // @ts-ignore
32
33
  return (0, _tint.default)(0.4, color);
33
34
  case '300':
34
- // @ts-ignore
35
35
  return (0, _tint.default)(0.2, color);
36
36
  case '400':
37
37
  return color;
38
38
  case '500':
39
- // @ts-ignore
40
39
  return (0, _shade.default)(0.2, color);
41
40
  case '600':
42
- // @ts-ignore
43
41
  return (0, _shade.default)(0.4, color);
44
42
  case '700':
45
- // @ts-ignore
46
43
  return (0, _shade.default)(0.6, color);
47
44
  case '800':
48
- // @ts-ignore
49
45
  return (0, _shade.default)(0.8, color);
50
46
  case '1000':
51
47
  return 'black';
@@ -55,8 +51,8 @@ function customOnRamp(color, unit) {
55
51
  }
56
52
  const COLOR_STATE = {
57
53
  disabled: 'disabled',
58
- solid: 'solid',
59
- outline: 'outline'
54
+ primary: 'primary',
55
+ secondary: 'secondary'
60
56
  };
61
57
 
62
58
  // Probably best to bake this into the theme once we hit our next major.
@@ -67,25 +63,22 @@ const neutralColorStates = {
67
63
  // @ts-ignore
68
64
  [COLOR_STATE.disabled]: (theme, color) => ({
69
65
  color: theme.colors.tagNeutralFontDisabled,
70
- // @ts-ignore
71
- backgroundColor: null,
72
- borderColor: theme.colors.tagNeutralOutlinedDisabled
66
+ backgroundColor: pick(theme, theme.colors.gray50, theme.colors.gray100Dark),
67
+ borderColor: null
73
68
  }),
74
69
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
75
70
  // @ts-ignore
76
- [COLOR_STATE.solid]: (theme, color) => ({
71
+ [COLOR_STATE.primary]: (theme, color) => ({
77
72
  color: theme.colors.tagNeutralSolidFont,
78
73
  backgroundColor: theme.colors.tagNeutralSolidBackground,
79
- // @ts-ignore
80
74
  borderColor: null
81
75
  }),
82
76
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
83
77
  // @ts-ignore
84
- [COLOR_STATE.outline]: (theme, color) => ({
78
+ [COLOR_STATE.secondary]: (theme, color) => ({
85
79
  color: theme.colors.tagNeutralOutlinedFont,
86
- // @ts-ignore
87
- backgroundColor: null,
88
- borderColor: theme.colors.tagNeutralOutlinedBackground
80
+ backgroundColor: theme.colors.tagNeutralOutlinedBackground,
81
+ borderColor: null
89
82
  })
90
83
  };
91
84
  const primaryColorStates = {
@@ -93,228 +86,247 @@ const primaryColorStates = {
93
86
  // @ts-ignore
94
87
  [COLOR_STATE.disabled]: (theme, color) => ({
95
88
  color: theme.colors.tagPrimaryFontDisabled,
96
- // @ts-ignore
97
- backgroundColor: null,
98
- borderColor: theme.colors.tagPrimaryOutlinedDisabled
89
+ backgroundColor: pick(theme, theme.colors.gray50, theme.colors.gray100Dark),
90
+ borderColor: null
99
91
  }),
100
92
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
101
93
  // @ts-ignore
102
- [COLOR_STATE.solid]: (theme, color) => ({
94
+ [COLOR_STATE.primary]: (theme, color) => ({
103
95
  color: theme.colors.tagPrimarySolidFont,
104
96
  backgroundColor: theme.colors.tagPrimarySolidBackground,
105
- // @ts-ignore
106
97
  borderColor: null
107
98
  }),
108
99
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
109
100
  // @ts-ignore
110
- [COLOR_STATE.outline]: (theme, color) => ({
101
+ [COLOR_STATE.secondary]: (theme, color) => ({
111
102
  color: theme.colors.tagPrimaryOutlinedFont,
112
- // @ts-ignore
113
- backgroundColor: null,
114
- borderColor: theme.colors.tagPrimaryOutlinedBackground
103
+ backgroundColor: theme.colors.tagPrimaryOutlinedBackground,
104
+ borderColor: null
115
105
  })
116
106
  };
117
- const accentColorStates = {
107
+ const blueColorStates = {
118
108
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
119
109
  // @ts-ignore
120
110
  [COLOR_STATE.disabled]: (theme, color) => ({
121
111
  color: theme.colors.tagAccentFontDisabled,
122
- // @ts-ignore
123
- backgroundColor: null,
124
- borderColor: theme.colors.tagAccentOutlinedDisabled
112
+ backgroundColor: pick(theme, theme.colors.blue50, theme.colors.blue100Dark),
113
+ borderColor: null
125
114
  }),
126
115
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
127
116
  // @ts-ignore
128
- [COLOR_STATE.solid]: (theme, color) => ({
117
+ [COLOR_STATE.primary]: (theme, color) => ({
129
118
  color: theme.colors.tagAccentSolidFont,
130
119
  backgroundColor: theme.colors.tagAccentSolidBackground,
131
- // @ts-ignore
132
120
  borderColor: null
133
121
  }),
134
122
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
135
123
  // @ts-ignore
136
- [COLOR_STATE.outline]: (theme, color) => ({
124
+ [COLOR_STATE.secondary]: (theme, color) => ({
137
125
  color: theme.colors.tagAccentOutlinedFont,
138
- // @ts-ignore
139
- backgroundColor: null,
140
- borderColor: theme.colors.tagAccentOutlinedBackground
126
+ backgroundColor: theme.colors.tagAccentOutlinedBackground,
127
+ borderColor: null
141
128
  })
142
129
  };
143
- const positiveColorStates = {
130
+ const greenColorStates = {
144
131
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
145
132
  // @ts-ignore
146
133
  [COLOR_STATE.disabled]: (theme, color) => ({
147
134
  color: theme.colors.tagPositiveFontDisabled,
148
- // @ts-ignore
149
- backgroundColor: null,
150
- borderColor: theme.colors.tagPositiveOutlinedDisabled
135
+ backgroundColor: pick(theme, theme.colors.green50, theme.colors.green100Dark),
136
+ borderColor: null
151
137
  }),
152
138
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
153
139
  // @ts-ignore
154
- [COLOR_STATE.solid]: (theme, color) => ({
140
+ [COLOR_STATE.primary]: (theme, color) => ({
155
141
  color: theme.colors.tagPositiveSolidFont,
156
142
  backgroundColor: theme.colors.tagPositiveSolidBackground,
157
- // @ts-ignore
158
143
  borderColor: null
159
144
  }),
160
145
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
161
146
  // @ts-ignore
162
- [COLOR_STATE.outline]: (theme, color) => ({
147
+ [COLOR_STATE.secondary]: (theme, color) => ({
163
148
  color: theme.colors.tagPositiveOutlinedFont,
164
- // @ts-ignore
165
- backgroundColor: null,
166
- borderColor: theme.colors.tagPositiveOutlinedBackground
149
+ backgroundColor: theme.colors.tagPositiveOutlinedBackground,
150
+ borderColor: null
167
151
  })
168
152
  };
169
- const warningColorStates = {
153
+ const yellowColorStates = {
170
154
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
171
155
  // @ts-ignore
172
156
  [COLOR_STATE.disabled]: (theme, color) => ({
173
157
  color: theme.colors.tagWarningFontDisabled,
174
- // @ts-ignore
175
- backgroundColor: null,
176
- borderColor: theme.colors.tagWarningOutlinedDisabled
158
+ backgroundColor: pick(theme, theme.colors.yellow50, theme.colors.yellow100Dark),
159
+ borderColor: null
177
160
  }),
178
161
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
179
162
  // @ts-ignore
180
- [COLOR_STATE.solid]: (theme, color) => ({
163
+ [COLOR_STATE.primary]: (theme, color) => ({
181
164
  color: theme.colors.tagWarningSolidFont,
182
165
  backgroundColor: theme.colors.tagWarningSolidBackground,
183
- // @ts-ignore
184
166
  borderColor: null
185
167
  }),
186
168
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
187
169
  // @ts-ignore
188
- [COLOR_STATE.outline]: (theme, color) => ({
170
+ [COLOR_STATE.secondary]: (theme, color) => ({
189
171
  color: theme.colors.tagWarningOutlinedFont,
190
- // @ts-ignore
191
- backgroundColor: null,
192
- borderColor: theme.colors.tagWarningOutlinedBackground
172
+ backgroundColor: theme.colors.tagWarningOutlinedBackground,
173
+ borderColor: null
193
174
  })
194
175
  };
195
- const negativeColorStates = {
176
+ const redColorStates = {
196
177
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
197
178
  // @ts-ignore
198
179
  [COLOR_STATE.disabled]: (theme, color) => ({
199
180
  color: theme.colors.tagNegativeFontDisabled,
200
- // @ts-ignore
201
- backgroundColor: null,
202
- borderColor: theme.colors.tagNegativeOutlinedDisabled
181
+ backgroundColor: pick(theme, theme.colors.red50, theme.colors.red100Dark),
182
+ borderColor: null
203
183
  }),
204
184
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
205
185
  // @ts-ignore
206
- [COLOR_STATE.solid]: (theme, color) => ({
186
+ [COLOR_STATE.primary]: (theme, color) => ({
207
187
  color: theme.colors.tagNegativeSolidFont,
208
188
  backgroundColor: theme.colors.tagNegativeSolidBackground,
209
- // @ts-ignore
210
189
  borderColor: null
211
190
  }),
212
191
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
213
192
  // @ts-ignore
214
- [COLOR_STATE.outline]: (theme, color) => ({
193
+ [COLOR_STATE.secondary]: (theme, color) => ({
215
194
  color: theme.colors.tagNegativeOutlinedFont,
216
- // @ts-ignore
217
- backgroundColor: null,
218
- borderColor: theme.colors.tagNegativeOutlinedBackground
195
+ backgroundColor: theme.colors.tagNegativeOutlinedBackground,
196
+ borderColor: null
197
+ })
198
+ };
199
+ const limeColorStates = {
200
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
201
+ // @ts-ignore
202
+ [COLOR_STATE.disabled]: (theme, color) => ({
203
+ color: pick(theme, theme.colors.lime300, theme.colors.lime400Dark),
204
+ backgroundColor: pick(theme, theme.colors.lime50, theme.colors.lime100Dark),
205
+ borderColor: null
206
+ }),
207
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
208
+ // @ts-ignore
209
+ [COLOR_STATE.primary]: (theme, color) => ({
210
+ color: pick(theme, theme.colors.white, theme.colors.lime900Dark),
211
+ backgroundColor: pick(theme, theme.colors.lime600, theme.colors.lime400Dark),
212
+ borderColor: null
213
+ }),
214
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
215
+ // @ts-ignore
216
+ [COLOR_STATE.secondary]: (theme, color) => ({
217
+ color: pick(theme, theme.colors.lime700, theme.colors.lime700Dark),
218
+ backgroundColor: pick(theme, theme.colors.lime50, theme.colors.lime100Dark),
219
+ borderColor: null
220
+ })
221
+ };
222
+ const tealColorStates = {
223
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
224
+ // @ts-ignore
225
+ [COLOR_STATE.disabled]: (theme, color) => ({
226
+ color: pick(theme, theme.colors.teal300, theme.colors.teal400Dark),
227
+ backgroundColor: pick(theme, theme.colors.teal50, theme.colors.teal100Dark),
228
+ borderColor: null
229
+ }),
230
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
231
+ // @ts-ignore
232
+ [COLOR_STATE.primary]: (theme, color) => ({
233
+ color: pick(theme, theme.colors.white, theme.colors.teal900Dark),
234
+ backgroundColor: pick(theme, theme.colors.teal600, theme.colors.teal400Dark),
235
+ borderColor: null
236
+ }),
237
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
238
+ // @ts-ignore
239
+ [COLOR_STATE.secondary]: (theme, color) => ({
240
+ color: pick(theme, theme.colors.teal700, theme.colors.teal700Dark),
241
+ backgroundColor: pick(theme, theme.colors.teal50, theme.colors.teal100Dark),
242
+ borderColor: null
219
243
  })
220
244
  };
221
245
  const orangeColorStates = {
222
246
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
223
247
  // @ts-ignore
224
248
  [COLOR_STATE.disabled]: (theme, color) => ({
225
- color: pick(theme, theme.colors.orange200, theme.colors.orange600),
226
- // @ts-ignore
227
- backgroundColor: null,
228
- borderColor: pick(theme, theme.colors.orange200, theme.colors.orange700)
249
+ color: pick(theme, theme.colors.orange300, theme.colors.orange400Dark),
250
+ backgroundColor: pick(theme, theme.colors.orange50, theme.colors.orange100Dark),
251
+ borderColor: null
229
252
  }),
230
253
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
231
254
  // @ts-ignore
232
- [COLOR_STATE.solid]: (theme, color) => ({
233
- color: theme.colors.white,
234
- backgroundColor: pick(theme, theme.colors.orange400, theme.colors.orange500),
235
- // @ts-ignore
255
+ [COLOR_STATE.primary]: (theme, color) => ({
256
+ color: pick(theme, theme.colors.white, theme.colors.orange900Dark),
257
+ backgroundColor: pick(theme, theme.colors.orange600, theme.colors.orange400Dark),
236
258
  borderColor: null
237
259
  }),
238
260
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
239
261
  // @ts-ignore
240
- [COLOR_STATE.outline]: (theme, color) => ({
241
- color: pick(theme, theme.colors.orange400, theme.colors.orange300),
242
- // @ts-ignore
243
- backgroundColor: null,
244
- borderColor: pick(theme, theme.colors.orange200, theme.colors.orange500)
262
+ [COLOR_STATE.secondary]: (theme, color) => ({
263
+ color: pick(theme, theme.colors.orange700, theme.colors.orange700Dark),
264
+ backgroundColor: pick(theme, theme.colors.orange50, theme.colors.orange100Dark),
265
+ borderColor: null
245
266
  })
246
267
  };
247
268
  const purpleColorStates = {
248
269
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
249
270
  // @ts-ignore
250
271
  [COLOR_STATE.disabled]: (theme, color) => ({
251
- color: pick(theme, theme.colors.purple200, theme.colors.purple600),
252
- // @ts-ignore
253
- backgroundColor: null,
254
- borderColor: pick(theme, theme.colors.purple200, theme.colors.purple700)
272
+ color: pick(theme, theme.colors.purple300, theme.colors.purple400Dark),
273
+ backgroundColor: pick(theme, theme.colors.purple50, theme.colors.purple100Dark),
274
+ borderColor: null
255
275
  }),
256
276
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
257
277
  // @ts-ignore
258
- [COLOR_STATE.solid]: (theme, color) => ({
259
- color: theme.colors.white,
260
- backgroundColor: pick(theme, theme.colors.purple400, theme.colors.purple500),
261
- // @ts-ignore
278
+ [COLOR_STATE.primary]: (theme, color) => ({
279
+ color: pick(theme, theme.colors.white, theme.colors.purple900Dark),
280
+ backgroundColor: pick(theme, theme.colors.purple600, theme.colors.purple400Dark),
262
281
  borderColor: null
263
282
  }),
264
283
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
265
284
  // @ts-ignore
266
- [COLOR_STATE.outline]: (theme, color) => ({
267
- color: pick(theme, theme.colors.purple400, theme.colors.purple300),
268
- // @ts-ignore
269
- backgroundColor: null,
270
- borderColor: pick(theme, theme.colors.purple200, theme.colors.purple500)
285
+ [COLOR_STATE.secondary]: (theme, color) => ({
286
+ color: pick(theme, theme.colors.purple700, theme.colors.purple700Dark),
287
+ backgroundColor: pick(theme, theme.colors.purple50, theme.colors.purple100Dark),
288
+ borderColor: null
271
289
  })
272
290
  };
273
291
  const brownColorStates = {
274
292
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
275
293
  // @ts-ignore
276
294
  [COLOR_STATE.disabled]: (theme, color) => ({
277
- color: pick(theme, theme.colors.brown200, theme.colors.brown600),
278
- // @ts-ignore
295
+ color: pick(theme, theme.colors.amber200, theme.colors.amber400Dark),
279
296
  backgroundColor: null,
280
- borderColor: pick(theme, theme.colors.brown200, theme.colors.brown700)
297
+ borderColor: pick(theme, theme.colors.amber200, theme.colors.amber400Dark)
281
298
  }),
282
299
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
283
300
  // @ts-ignore
284
- [COLOR_STATE.solid]: (theme, color) => ({
285
- color: theme.colors.white,
286
- backgroundColor: pick(theme, theme.colors.brown400, theme.colors.brown500),
287
- // @ts-ignore
301
+ [COLOR_STATE.primary]: (theme, color) => ({
302
+ color: pick(theme, theme.colors.white, theme.colors.gray900Dark),
303
+ backgroundColor: pick(theme, theme.colors.amber600, theme.colors.amber400Dark),
288
304
  borderColor: null
289
305
  }),
290
306
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
291
307
  // @ts-ignore
292
- [COLOR_STATE.outline]: (theme, color) => ({
293
- color: pick(theme, theme.colors.brown400, theme.colors.brown300),
294
- // @ts-ignore
308
+ [COLOR_STATE.secondary]: (theme, color) => ({
309
+ color: pick(theme, theme.colors.amber600, theme.colors.amber600Dark),
295
310
  backgroundColor: null,
296
- borderColor: pick(theme, theme.colors.brown200, theme.colors.brown500)
311
+ borderColor: pick(theme, theme.colors.amber600, theme.colors.amber600Dark)
297
312
  })
298
313
  };
299
314
  const customColorStates = {
300
315
  // @ts-ignore
301
316
  [COLOR_STATE.disabled]: (theme, color) => ({
302
317
  color: customOnRamp(color, theme.colors.tagFontDisabledRampUnit),
303
- // @ts-ignore
304
318
  backgroundColor: null,
305
319
  borderColor: customOnRamp(color, theme.colors.tagSolidDisabledRampUnit)
306
320
  }),
307
321
  // @ts-ignore
308
- [COLOR_STATE.solid]: (theme, color) => ({
322
+ [COLOR_STATE.primary]: (theme, color) => ({
309
323
  color: customOnRamp(color, theme.colors.tagSolidFontRampUnit),
310
324
  backgroundColor: customOnRamp(color, theme.colors.tagSolidRampUnit),
311
- // @ts-ignore
312
325
  borderColor: null
313
326
  }),
314
327
  // @ts-ignore
315
- [COLOR_STATE.outline]: (theme, color) => ({
328
+ [COLOR_STATE.secondary]: (theme, color) => ({
316
329
  color: customOnRamp(color, theme.colors.tagOutlinedFontRampUnit),
317
- // @ts-ignore
318
330
  backgroundColor: null,
319
331
  borderColor: customOnRamp(color, theme.colors.tagOutlinedRampUnit)
320
332
  })
@@ -322,26 +334,28 @@ const customColorStates = {
322
334
  const colorMap = {
323
335
  [_constants.KIND.neutral]: neutralColorStates,
324
336
  [_constants.KIND.primary]: primaryColorStates,
325
- [_constants.KIND.accent]: accentColorStates,
326
- [_constants.KIND.positive]: positiveColorStates,
327
- [_constants.KIND.warning]: warningColorStates,
328
- [_constants.KIND.negative]: negativeColorStates,
337
+ [_constants.KIND.accent]: blueColorStates,
338
+ [_constants.KIND.positive]: greenColorStates,
339
+ [_constants.KIND.warning]: yellowColorStates,
340
+ [_constants.KIND.negative]: redColorStates,
329
341
  [_constants.KIND.black]: primaryColorStates,
330
- [_constants.KIND.blue]: accentColorStates,
331
- [_constants.KIND.green]: positiveColorStates,
332
- [_constants.KIND.red]: negativeColorStates,
333
- [_constants.KIND.yellow]: warningColorStates,
342
+ [_constants.KIND.blue]: blueColorStates,
343
+ [_constants.KIND.green]: greenColorStates,
344
+ [_constants.KIND.red]: redColorStates,
345
+ [_constants.KIND.yellow]: yellowColorStates,
334
346
  [_constants.KIND.orange]: orangeColorStates,
335
347
  [_constants.KIND.purple]: purpleColorStates,
336
348
  [_constants.KIND.brown]: brownColorStates,
349
+ [_constants.KIND.lime]: limeColorStates,
350
+ [_constants.KIND.teal]: tealColorStates,
337
351
  [_constants.KIND.custom]: customColorStates
338
352
  };
339
353
 
340
354
  // @ts-ignore
341
355
  const getColorStateFromProps = props => {
342
356
  if (props.$disabled) return COLOR_STATE.disabled;
343
- if (props.$variant === _constants.VARIANT.solid) return COLOR_STATE.solid;
344
- return COLOR_STATE.outline;
357
+ if (props.$hierarchy === _constants.HIERARCHY.primary) return COLOR_STATE.primary;
358
+ return COLOR_STATE.secondary;
345
359
  };
346
360
  const Action = exports.Action = (0, _styles.styled)('span', props => {
347
361
  const {
@@ -410,7 +424,7 @@ const Root = exports.Root = (0, _styles.styled)('span', props => {
410
424
  $theme,
411
425
  $kind = _constants.KIND.primary,
412
426
  $clickable,
413
- $variant,
427
+ $hierarchy,
414
428
  $disabled,
415
429
  $closeable,
416
430
  $isFocusVisible,
@@ -418,14 +432,13 @@ const Root = exports.Root = (0, _styles.styled)('span', props => {
418
432
  $size = _constants.SIZE.small,
419
433
  $contentMaxWidth
420
434
  } = props;
421
- const borderRadius = $theme.borders.tagBorderRadius;
435
+ const borderRadius = $size === _constants.SIZE.small ? $theme.borders.radius200 : $theme.borders.radius300;
422
436
  const paddingMagnitude = {
423
437
  [_constants.SIZE.small]: $theme.sizing.scale300,
424
438
  [_constants.SIZE.medium]: $theme.sizing.scale500,
425
439
  [_constants.SIZE.large]: $theme.sizing.scale600
426
440
  }[$size];
427
- const borderWidth = !$disabled && $variant === _constants.VARIANT.solid ? 0 : '2px';
428
- // @ts-ignore
441
+ const borderWidth = !$disabled && $hierarchy === _constants.HIERARCHY.primary || $kind !== _constants.KIND.custom ? 0 : '2px';
429
442
  const {
430
443
  color,
431
444
  backgroundColor,
package/tag/tag.js CHANGED
@@ -46,7 +46,7 @@ const Tag = /*#__PURE__*/React.forwardRef((props, ref) => {
46
46
  overrides = {},
47
47
  startEnhancer,
48
48
  title,
49
- variant = _constants.VARIANT.light
49
+ hierarchy = _constants.HIERARCHY.secondary
50
50
  } = props;
51
51
  const [focusVisible, setFocusVisible] = React.useState(false);
52
52
  function handleFocus(event) {
@@ -103,7 +103,7 @@ const Tag = /*#__PURE__*/React.forwardRef((props, ref) => {
103
103
  $isFocused: isFocused,
104
104
  $isHovered: isHovered,
105
105
  $kind: kind,
106
- $variant: variant,
106
+ $hierarchy: hierarchy,
107
107
  $isFocusVisible: focusVisible,
108
108
  $size: size
109
109
  };
package/tag/types.d.ts CHANGED
@@ -16,11 +16,12 @@ export declare const TagKind: Readonly<{
16
16
  readonly orange: "orange";
17
17
  readonly purple: "purple";
18
18
  readonly brown: "brown";
19
+ readonly teal: "teal";
20
+ readonly lime: "lime";
19
21
  }>;
20
- export declare const TagVariant: Readonly<Readonly<{
21
- readonly solid: "solid";
22
- readonly light: "light";
23
- readonly outlined: "outlined";
22
+ export declare const TagHierarchy: Readonly<Readonly<{
23
+ readonly primary: "primary";
24
+ readonly secondary: "secondary";
24
25
  }>>;
25
26
  export declare const TagSize: Readonly<{
26
27
  readonly small: "small";
@@ -28,7 +29,7 @@ export declare const TagSize: Readonly<{
28
29
  readonly large: "large";
29
30
  }>;
30
31
  export type TagKind = keyof typeof TagKind;
31
- export type TagVariant = (typeof TagVariant)[keyof typeof TagVariant];
32
+ export type TagHierarchy = (typeof TagHierarchy)[keyof typeof TagHierarchy];
32
33
  export type TagSize = keyof typeof TagSize;
33
34
  export type TagOverrides = {
34
35
  Root?: Override;
@@ -49,8 +50,8 @@ export type TagProps = {
49
50
  isHovered?: boolean;
50
51
  /** Defines tags look by purpose. Set it to one of KIND[key] values. Defaults to KIND.primary */
51
52
  kind?: TagKind;
52
- /** Defines tags look. Set it to one of VARIANT[key] values. Defaults to VARIANT.light */
53
- variant?: TagVariant;
53
+ /** Defines tags look. Set it to one of HIERARCHY[key] values. Defaults to HIERARCHY.secondary */
54
+ hierarchy?: TagHierarchy;
54
55
  /** Component or String value for label of tag. Default is empty string. */
55
56
  children?: React.ReactNode;
56
57
  /** The color theme to be applied to a Tag. Default is `KIND.primary`. */
@@ -79,7 +80,7 @@ export type SharedPropsArg = {
79
80
  $isFocused?: boolean;
80
81
  $isHovered?: boolean;
81
82
  $kind?: string;
82
- $variant?: string;
83
+ $hierarchy?: string;
83
84
  $isFocusVisible?: boolean;
84
85
  $size?: string;
85
86
  $contentMaxWidth?: string | null;
package/tag/types.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TagVariant = exports.TagSize = exports.TagKind = void 0;
6
+ exports.TagSize = exports.TagKind = exports.TagHierarchy = void 0;
7
7
  var _constants = require("./constants");
8
8
  /*
9
9
  Copyright (c) Uber Technologies, Inc.
@@ -13,5 +13,5 @@ LICENSE file in the root directory of this source tree.
13
13
  */
14
14
 
15
15
  const TagKind = exports.TagKind = Object.freeze(_constants.KIND);
16
- const TagVariant = exports.TagVariant = Object.freeze(_constants.VARIANT);
16
+ const TagHierarchy = exports.TagHierarchy = Object.freeze(_constants.HIERARCHY);
17
17
  const TagSize = exports.TagSize = Object.freeze(_constants.SIZE);
@@ -1,3 +1,3 @@
1
- import type { FoundationColorTokens, ComponentColorTokens } from '../types';
2
- declare const _default: (themePrimitives?: FoundationColorTokens) => ComponentColorTokens;
1
+ import type { SemanticColors, ComponentColors } from '../types';
2
+ declare const _default: (semanticColors?: SemanticColors) => ComponentColors;
3
3
  export default _default;