@charcoal-ui/react 3.5.0 → 3.7.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 (100) hide show
  1. package/dist/_lib/compat.d.ts +1 -0
  2. package/dist/_lib/compat.d.ts.map +1 -1
  3. package/dist/components/Button/StyledButton.d.ts +12 -0
  4. package/dist/components/Button/StyledButton.d.ts.map +1 -0
  5. package/dist/components/Button/index.d.ts +2 -2
  6. package/dist/components/Button/index.d.ts.map +1 -1
  7. package/dist/components/Button/lib/variantToBackground.d.ts +3 -0
  8. package/dist/components/Button/lib/variantToBackground.d.ts.map +1 -0
  9. package/dist/components/Button/lib/variantToFont.d.ts +3 -0
  10. package/dist/components/Button/lib/variantToFont.d.ts.map +1 -0
  11. package/dist/components/Checkbox/index.d.ts.map +1 -1
  12. package/dist/components/Checkbox/index.story.d.ts +6 -15
  13. package/dist/components/Checkbox/index.story.d.ts.map +1 -1
  14. package/dist/components/Clickable/index.story.d.ts +4 -6
  15. package/dist/components/Clickable/index.story.d.ts.map +1 -1
  16. package/dist/components/DropdownSelector/DropdownMenuItem.d.ts.map +1 -1
  17. package/dist/components/DropdownSelector/ListItem/index.d.ts.map +1 -1
  18. package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
  19. package/dist/components/DropdownSelector/index.d.ts.map +1 -1
  20. package/dist/components/DropdownSelector/index.story.d.ts +1 -0
  21. package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
  22. package/dist/components/FieldLabel/index.d.ts.map +1 -1
  23. package/dist/components/Icon/index.story.d.ts +1 -1
  24. package/dist/components/IconButton/index.d.ts.map +1 -1
  25. package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
  26. package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
  27. package/dist/components/Modal/index.d.ts.map +1 -1
  28. package/dist/components/Modal/index.story.d.ts +1 -0
  29. package/dist/components/Modal/index.story.d.ts.map +1 -1
  30. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  31. package/dist/components/MultiSelect/index.story.d.ts +2 -0
  32. package/dist/components/MultiSelect/index.story.d.ts.map +1 -1
  33. package/dist/components/Radio/index.d.ts.map +1 -1
  34. package/dist/components/SegmentedControl/RadioGroupContext.d.ts +1 -1
  35. package/dist/components/SegmentedControl/RadioGroupContext.d.ts.map +1 -1
  36. package/dist/components/SegmentedControl/index.d.ts.map +1 -1
  37. package/dist/components/Switch/index.d.ts.map +1 -1
  38. package/dist/components/TagItem/index.d.ts.map +1 -1
  39. package/dist/components/TextField/TextField.story.d.ts.map +1 -1
  40. package/dist/components/TextField/index.d.ts.map +1 -1
  41. package/dist/index.cjs.js +1026 -384
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.esm.js +991 -349
  44. package/dist/index.esm.js.map +1 -1
  45. package/dist/styled.d.ts +4 -4
  46. package/package.json +18 -21
  47. package/src/_lib/compat.ts +8 -0
  48. package/src/components/Button/StyledButton.tsx +66 -0
  49. package/src/components/Button/__snapshots__/index.story.storyshot +312 -592
  50. package/src/components/Button/index.tsx +14 -70
  51. package/src/components/Button/lib/variantToBackground.tsx +19 -0
  52. package/src/components/Button/lib/variantToFont.tsx +19 -0
  53. package/src/components/Checkbox/__snapshots__/index.story.storyshot +209 -40
  54. package/src/components/Checkbox/index.story.tsx +82 -64
  55. package/src/components/Checkbox/index.tsx +47 -17
  56. package/src/components/Clickable/__snapshots__/index.story.storyshot +4 -0
  57. package/src/components/Clickable/index.story.tsx +12 -9
  58. package/src/components/Clickable/index.tsx +1 -0
  59. package/src/components/DropdownSelector/DropdownMenuItem.tsx +6 -3
  60. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +3 -10
  61. package/src/components/DropdownSelector/ListItem/index.tsx +6 -4
  62. package/src/components/DropdownSelector/MenuItemGroup/index.tsx +1 -1
  63. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +4 -13
  64. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +20 -37
  65. package/src/components/DropdownSelector/Popover/index.tsx +5 -8
  66. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +227 -294
  67. package/src/components/DropdownSelector/index.story.tsx +33 -0
  68. package/src/components/DropdownSelector/index.tsx +63 -20
  69. package/src/components/FieldLabel/index.tsx +77 -12
  70. package/src/components/IconButton/__snapshots__/index.story.storyshot +30 -54
  71. package/src/components/IconButton/index.tsx +51 -26
  72. package/src/components/LoadingSpinner/index.tsx +3 -6
  73. package/src/components/Modal/Dialog/index.tsx +1 -1
  74. package/src/components/Modal/ModalPlumbing.tsx +26 -5
  75. package/src/components/Modal/__snapshots__/index.story.storyshot +2450 -108
  76. package/src/components/Modal/index.story.tsx +27 -0
  77. package/src/components/Modal/index.tsx +19 -4
  78. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +528 -25
  79. package/src/components/MultiSelect/index.story.tsx +60 -0
  80. package/src/components/MultiSelect/index.tsx +82 -22
  81. package/src/components/Radio/__snapshots__/index.story.storyshot +32 -49
  82. package/src/components/Radio/index.tsx +71 -23
  83. package/src/components/SegmentedControl/RadioGroupContext.tsx +1 -1
  84. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +9 -10
  85. package/src/components/SegmentedControl/index.tsx +36 -16
  86. package/src/components/Switch/__snapshots__/index.story.storyshot +6 -18
  87. package/src/components/Switch/index.tsx +10 -15
  88. package/src/components/TagItem/__snapshots__/index.story.storyshot +39 -158
  89. package/src/components/TagItem/index.tsx +84 -19
  90. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +55 -91
  91. package/src/components/TextField/TextField.story.tsx +35 -18
  92. package/src/components/TextField/__snapshots__/TextField.story.storyshot +92 -148
  93. package/src/components/TextField/index.tsx +0 -1
  94. package/dist/components/Checkbox/performance.test.d.ts +0 -4
  95. package/dist/components/Checkbox/performance.test.d.ts.map +0 -1
  96. package/dist/components/Checkbox/snapshot.test.d.ts +0 -2
  97. package/dist/components/Checkbox/snapshot.test.d.ts.map +0 -1
  98. package/src/components/Checkbox/__snapshots__/snapshot.test.tsx.snap +0 -763
  99. package/src/components/Checkbox/performance.test.tsx +0 -30
  100. package/src/components/Checkbox/snapshot.test.tsx +0 -66
@@ -13,19 +13,15 @@ exports[`Storyshots Switch Labelled 1`] = `
13
13
  }
14
14
 
15
15
  .c0:disabled,
16
- .c0[aria-disabled]:not([aria-disabled=false]) {
16
+ .c0[aria-disabled]:not([aria-disabled='false']) {
17
17
  opacity: 0.32;
18
+ cursor: default;
18
19
  }
19
20
 
20
21
  .c0:active > input {
21
22
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
22
23
  }
23
24
 
24
- .c0:disabled,
25
- .c0[aria-disabled]:not([aria-disabled=false]) {
26
- cursor: default;
27
- }
28
-
29
25
  .c2 {
30
26
  font-size: 14px;
31
27
  line-height: 22px;
@@ -168,19 +164,15 @@ exports[`Storyshots Switch Playground 1`] = `
168
164
  }
169
165
 
170
166
  .c0:disabled,
171
- .c0[aria-disabled]:not([aria-disabled=false]) {
167
+ .c0[aria-disabled]:not([aria-disabled='false']) {
172
168
  opacity: 0.32;
169
+ cursor: default;
173
170
  }
174
171
 
175
172
  .c0:active > input {
176
173
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
177
174
  }
178
175
 
179
- .c0:disabled,
180
- .c0[aria-disabled]:not([aria-disabled=false]) {
181
- cursor: default;
182
- }
183
-
184
176
  .c2 {
185
177
  font-size: 14px;
186
178
  line-height: 22px;
@@ -322,19 +314,15 @@ exports[`Storyshots Switch Unlabelled 1`] = `
322
314
  }
323
315
 
324
316
  .c0:disabled,
325
- .c0[aria-disabled]:not([aria-disabled=false]) {
317
+ .c0[aria-disabled]:not([aria-disabled='false']) {
326
318
  opacity: 0.32;
319
+ cursor: default;
327
320
  }
328
321
 
329
322
  .c0:active > input {
330
323
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
331
324
  }
332
325
 
333
- .c0:disabled,
334
- .c0[aria-disabled]:not([aria-disabled=false]) {
335
- cursor: default;
336
- }
337
-
338
326
  .c1 {
339
327
  -webkit-appearance: none;
340
328
  -moz-appearance: none;
@@ -4,8 +4,6 @@ import { useMemo, memo, forwardRef } from 'react'
4
4
  import * as React from 'react'
5
5
  import { useToggleState } from 'react-stately'
6
6
  import styled from 'styled-components'
7
- import { theme } from '../../styled'
8
- import { disabledSelector } from '@charcoal-ui/utils'
9
7
  import { useObjectRef } from '@react-aria/utils'
10
8
 
11
9
  export type SwitchProps = {
@@ -68,28 +66,25 @@ const Label = styled.label`
68
66
  cursor: pointer;
69
67
  outline: 0;
70
68
 
71
- ${theme((o) => o.disabled)}
69
+ &:disabled,
70
+ &[aria-disabled]:not([aria-disabled='false']) {
71
+ opacity: 0.32;
72
+ cursor: default;
73
+ }
72
74
 
73
75
  :active > input {
74
76
  box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
75
77
  }
76
-
77
- ${disabledSelector} {
78
- cursor: default;
79
- }
80
78
  `
81
79
 
82
80
  const LabelInner = styled.div`
83
- ${theme((o) => [
84
- o.typography(14).preserveHalfLeading,
85
- o.font.text2,
86
- o.margin.left(4),
87
- ])}
81
+ font-size: 14px;
82
+ line-height: 22px;
83
+ color: var(--charcoal-text2);
84
+ margin-left: 4px;
88
85
  `
89
86
 
90
- const SwitchInput = styled.input.attrs({
91
- type: 'checkbox',
92
- })`
87
+ const SwitchInput = styled.input.attrs({ type: 'checkbox' })`
93
88
  appearance: none;
94
89
  display: inline-flex;
95
90
  position: relative;
@@ -30,36 +30,19 @@ exports[`Storyshots TagItem Default 1`] = `
30
30
  }
31
31
 
32
32
  .c0:not(:disabled):not([aria-disabled]):focus,
33
- .c0[aria-disabled=false]:focus,
33
+ .c0[aria-disabled='false']:focus,
34
34
  .c0:not(:disabled):not([aria-disabled]):active,
35
- .c0[aria-disabled=false]:active {
36
- outline: none;
37
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
38
- }
39
-
40
- .c0:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
41
- .c0[aria-disabled=false]:focus:not(:focus-visible),
42
- .c0:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
43
- .c0[aria-disabled=false]:active:not(:focus-visible) {
44
- outline: none;
45
- }
46
-
35
+ .c0[aria-disabled='false']:active,
47
36
  .c0:not(:disabled):not([aria-disabled]):focus-visible,
48
- .c0[aria-disabled=false]:focus-visible {
37
+ .c0[aria-disabled='false']:focus-visible {
49
38
  outline: none;
50
39
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
51
40
  }
52
41
 
53
42
  .c0:disabled,
54
- .c0[aria-disabled]:not([aria-disabled=false]) {
55
- cursor: default;
56
- }
57
-
58
- .c0:disabled:disabled,
59
- .c0[aria-disabled]:not([aria-disabled=false]):disabled,
60
- .c0:disabled[aria-disabled]:not([aria-disabled=false]),
61
- .c0[aria-disabled]:not([aria-disabled=false])[aria-disabled]:not([aria-disabled=false]) {
43
+ .c0[aria-disabled]:not([aria-disabled='false']) {
62
44
  opacity: 0.32;
45
+ cursor: default;
63
46
  }
64
47
 
65
48
  .c1 {
@@ -192,36 +175,19 @@ exports[`Storyshots TagItem Playground 1`] = `
192
175
  }
193
176
 
194
177
  .c1:not(:disabled):not([aria-disabled]):focus,
195
- .c1[aria-disabled=false]:focus,
178
+ .c1[aria-disabled='false']:focus,
196
179
  .c1:not(:disabled):not([aria-disabled]):active,
197
- .c1[aria-disabled=false]:active {
198
- outline: none;
199
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
200
- }
201
-
202
- .c1:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
203
- .c1[aria-disabled=false]:focus:not(:focus-visible),
204
- .c1:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
205
- .c1[aria-disabled=false]:active:not(:focus-visible) {
206
- outline: none;
207
- }
208
-
180
+ .c1[aria-disabled='false']:active,
209
181
  .c1:not(:disabled):not([aria-disabled]):focus-visible,
210
- .c1[aria-disabled=false]:focus-visible {
182
+ .c1[aria-disabled='false']:focus-visible {
211
183
  outline: none;
212
184
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
213
185
  }
214
186
 
215
187
  .c1:disabled,
216
- .c1[aria-disabled]:not([aria-disabled=false]) {
217
- cursor: default;
218
- }
219
-
220
- .c1:disabled:disabled,
221
- .c1[aria-disabled]:not([aria-disabled=false]):disabled,
222
- .c1:disabled[aria-disabled]:not([aria-disabled=false]),
223
- .c1[aria-disabled]:not([aria-disabled=false])[aria-disabled]:not([aria-disabled=false]) {
188
+ .c1[aria-disabled]:not([aria-disabled='false']) {
224
189
  opacity: 0.32;
190
+ cursor: default;
225
191
  }
226
192
 
227
193
  .c8 {
@@ -245,44 +211,27 @@ exports[`Storyshots TagItem Playground 1`] = `
245
211
  cursor: pointer;
246
212
  overflow: hidden;
247
213
  border-radius: 4px;
248
- color: var(--charcoal-text5);
249
- padding-left: 16px;
250
214
  padding-right: 8px;
215
+ padding-left: 16px;
216
+ color: var(--charcoal-text5);
251
217
  -webkit-transition: 0.2s box-shadow;
252
218
  transition: 0.2s box-shadow;
253
219
  }
254
220
 
255
221
  .c8:not(:disabled):not([aria-disabled]):focus,
256
- .c8[aria-disabled=false]:focus,
222
+ .c8[aria-disabled='false']:focus,
257
223
  .c8:not(:disabled):not([aria-disabled]):active,
258
- .c8[aria-disabled=false]:active {
259
- outline: none;
260
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
261
- }
262
-
263
- .c8:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
264
- .c8[aria-disabled=false]:focus:not(:focus-visible),
265
- .c8:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
266
- .c8[aria-disabled=false]:active:not(:focus-visible) {
267
- outline: none;
268
- }
269
-
224
+ .c8[aria-disabled='false']:active,
270
225
  .c8:not(:disabled):not([aria-disabled]):focus-visible,
271
- .c8[aria-disabled=false]:focus-visible {
226
+ .c8[aria-disabled='false']:focus-visible {
272
227
  outline: none;
273
228
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
274
229
  }
275
230
 
276
231
  .c8:disabled,
277
- .c8[aria-disabled]:not([aria-disabled=false]) {
278
- cursor: default;
279
- }
280
-
281
- .c8:disabled:disabled,
282
- .c8[aria-disabled]:not([aria-disabled=false]):disabled,
283
- .c8:disabled[aria-disabled]:not([aria-disabled=false]),
284
- .c8[aria-disabled]:not([aria-disabled=false])[aria-disabled]:not([aria-disabled=false]) {
232
+ .c8[aria-disabled]:not([aria-disabled='false']) {
285
233
  opacity: 0.32;
234
+ cursor: default;
286
235
  }
287
236
 
288
237
  .c9 {
@@ -314,36 +263,19 @@ exports[`Storyshots TagItem Playground 1`] = `
314
263
  }
315
264
 
316
265
  .c9:not(:disabled):not([aria-disabled]):focus,
317
- .c9[aria-disabled=false]:focus,
266
+ .c9[aria-disabled='false']:focus,
318
267
  .c9:not(:disabled):not([aria-disabled]):active,
319
- .c9[aria-disabled=false]:active {
320
- outline: none;
321
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
322
- }
323
-
324
- .c9:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
325
- .c9[aria-disabled=false]:focus:not(:focus-visible),
326
- .c9:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
327
- .c9[aria-disabled=false]:active:not(:focus-visible) {
328
- outline: none;
329
- }
330
-
268
+ .c9[aria-disabled='false']:active,
331
269
  .c9:not(:disabled):not([aria-disabled]):focus-visible,
332
- .c9[aria-disabled=false]:focus-visible {
270
+ .c9[aria-disabled='false']:focus-visible {
333
271
  outline: none;
334
272
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
335
273
  }
336
274
 
337
275
  .c9:disabled,
338
- .c9[aria-disabled]:not([aria-disabled=false]) {
339
- cursor: default;
340
- }
341
-
342
- .c9:disabled:disabled,
343
- .c9[aria-disabled]:not([aria-disabled=false]):disabled,
344
- .c9:disabled[aria-disabled]:not([aria-disabled=false]),
345
- .c9[aria-disabled]:not([aria-disabled=false])[aria-disabled]:not([aria-disabled=false]) {
276
+ .c9[aria-disabled]:not([aria-disabled='false']) {
346
277
  opacity: 0.32;
278
+ cursor: default;
347
279
  }
348
280
 
349
281
  .c11 {
@@ -375,36 +307,19 @@ exports[`Storyshots TagItem Playground 1`] = `
375
307
  }
376
308
 
377
309
  .c11:not(:disabled):not([aria-disabled]):focus,
378
- .c11[aria-disabled=false]:focus,
310
+ .c11[aria-disabled='false']:focus,
379
311
  .c11:not(:disabled):not([aria-disabled]):active,
380
- .c11[aria-disabled=false]:active {
381
- outline: none;
382
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
383
- }
384
-
385
- .c11:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
386
- .c11[aria-disabled=false]:focus:not(:focus-visible),
387
- .c11:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
388
- .c11[aria-disabled=false]:active:not(:focus-visible) {
389
- outline: none;
390
- }
391
-
312
+ .c11[aria-disabled='false']:active,
392
313
  .c11:not(:disabled):not([aria-disabled]):focus-visible,
393
- .c11[aria-disabled=false]:focus-visible {
314
+ .c11[aria-disabled='false']:focus-visible {
394
315
  outline: none;
395
316
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
396
317
  }
397
318
 
398
319
  .c11:disabled,
399
- .c11[aria-disabled]:not([aria-disabled=false]) {
400
- cursor: default;
401
- }
402
-
403
- .c11:disabled:disabled,
404
- .c11[aria-disabled]:not([aria-disabled=false]):disabled,
405
- .c11:disabled[aria-disabled]:not([aria-disabled=false]),
406
- .c11[aria-disabled]:not([aria-disabled=false])[aria-disabled]:not([aria-disabled=false]) {
320
+ .c11[aria-disabled]:not([aria-disabled='false']) {
407
321
  opacity: 0.32;
322
+ cursor: default;
408
323
  }
409
324
 
410
325
  .c12 {
@@ -428,44 +343,27 @@ exports[`Storyshots TagItem Playground 1`] = `
428
343
  cursor: pointer;
429
344
  overflow: hidden;
430
345
  border-radius: 4px;
431
- color: var(--charcoal-text5);
432
- padding-left: 16px;
433
346
  padding-right: 8px;
347
+ padding-left: 16px;
348
+ color: var(--charcoal-text5);
434
349
  -webkit-transition: 0.2s box-shadow;
435
350
  transition: 0.2s box-shadow;
436
351
  }
437
352
 
438
353
  .c12:not(:disabled):not([aria-disabled]):focus,
439
- .c12[aria-disabled=false]:focus,
354
+ .c12[aria-disabled='false']:focus,
440
355
  .c12:not(:disabled):not([aria-disabled]):active,
441
- .c12[aria-disabled=false]:active {
442
- outline: none;
443
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
444
- }
445
-
446
- .c12:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
447
- .c12[aria-disabled=false]:focus:not(:focus-visible),
448
- .c12:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
449
- .c12[aria-disabled=false]:active:not(:focus-visible) {
450
- outline: none;
451
- }
452
-
356
+ .c12[aria-disabled='false']:active,
453
357
  .c12:not(:disabled):not([aria-disabled]):focus-visible,
454
- .c12[aria-disabled=false]:focus-visible {
358
+ .c12[aria-disabled='false']:focus-visible {
455
359
  outline: none;
456
360
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
457
361
  }
458
362
 
459
363
  .c12:disabled,
460
- .c12[aria-disabled]:not([aria-disabled=false]) {
461
- cursor: default;
462
- }
463
-
464
- .c12:disabled:disabled,
465
- .c12[aria-disabled]:not([aria-disabled=false]):disabled,
466
- .c12:disabled[aria-disabled]:not([aria-disabled=false]),
467
- .c12[aria-disabled]:not([aria-disabled=false])[aria-disabled]:not([aria-disabled=false]) {
364
+ .c12[aria-disabled]:not([aria-disabled='false']) {
468
365
  opacity: 0.32;
366
+ cursor: default;
469
367
  }
470
368
 
471
369
  .c13 {
@@ -497,36 +395,19 @@ exports[`Storyshots TagItem Playground 1`] = `
497
395
  }
498
396
 
499
397
  .c13:not(:disabled):not([aria-disabled]):focus,
500
- .c13[aria-disabled=false]:focus,
398
+ .c13[aria-disabled='false']:focus,
501
399
  .c13:not(:disabled):not([aria-disabled]):active,
502
- .c13[aria-disabled=false]:active {
503
- outline: none;
504
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
505
- }
506
-
507
- .c13:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
508
- .c13[aria-disabled=false]:focus:not(:focus-visible),
509
- .c13:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
510
- .c13[aria-disabled=false]:active:not(:focus-visible) {
511
- outline: none;
512
- }
513
-
400
+ .c13[aria-disabled='false']:active,
514
401
  .c13:not(:disabled):not([aria-disabled]):focus-visible,
515
- .c13[aria-disabled=false]:focus-visible {
402
+ .c13[aria-disabled='false']:focus-visible {
516
403
  outline: none;
517
404
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
518
405
  }
519
406
 
520
407
  .c13:disabled,
521
- .c13[aria-disabled]:not([aria-disabled=false]) {
522
- cursor: default;
523
- }
524
-
525
- .c13:disabled:disabled,
526
- .c13[aria-disabled]:not([aria-disabled=false]):disabled,
527
- .c13:disabled[aria-disabled]:not([aria-disabled=false]),
528
- .c13[aria-disabled]:not([aria-disabled=false])[aria-disabled]:not([aria-disabled=false]) {
408
+ .c13[aria-disabled]:not([aria-disabled='false']) {
529
409
  opacity: 0.32;
410
+ cursor: default;
530
411
  }
531
412
 
532
413
  .c2 {
@@ -1,8 +1,7 @@
1
1
  import { forwardRef, memo, useMemo, ComponentPropsWithoutRef } from 'react'
2
2
  import { useObjectRef } from '@react-aria/utils'
3
3
  import styled, { css } from 'styled-components'
4
- import { theme } from '../../styled'
5
- import { disabledSelector, px } from '@charcoal-ui/utils'
4
+ import { px } from '@charcoal-ui/utils'
6
5
  import { AriaButtonProps, useButton } from '@react-aria/button'
7
6
  import Icon from '../Icon'
8
7
 
@@ -82,6 +81,24 @@ export default memo(TagItem)
82
81
  type TagItemRootProps = Pick<TagItemProps, 'status'> &
83
82
  Required<Pick<TagItemProps, 'size'>>
84
83
 
84
+ type Horizontal = {
85
+ left: number
86
+ right: number
87
+ }
88
+ const horizontalPadding = ({ left, right }: Horizontal) => css`
89
+ padding-right: ${px(right)};
90
+ padding-left: ${px(left)};
91
+ `
92
+ const tagItemRootSize = (size: TagItemProps['size']) => {
93
+ switch (size) {
94
+ case 'M':
95
+ return horizontalPadding({ left: 24, right: 24 })
96
+ case 'S':
97
+ return horizontalPadding({ left: 16, right: 16 })
98
+ }
99
+ }
100
+ const activeTagItemRoot = horizontalPadding({ left: 16, right: 8 })
101
+
85
102
  const TagItemRoot = styled.a<TagItemRootProps>`
86
103
  isolation: isolate;
87
104
  position: relative;
@@ -92,19 +109,27 @@ const TagItemRoot = styled.a<TagItemRootProps>`
92
109
  text-decoration: none;
93
110
  cursor: pointer;
94
111
  overflow: hidden;
112
+ border-radius: 4px;
113
+ ${({ size, status }) => status !== 'active' && tagItemRootSize(size)}
114
+ ${({ status }) => status === 'active' && activeTagItemRoot}
115
+ color: ${({ status }) =>
116
+ status === 'inactive' ? 'var(--charcoal-text2)' : 'var(--charcoal-text5)'};
117
+
118
+ transition: 0.2s box-shadow;
119
+
120
+ &:not(:disabled):not([aria-disabled]),
121
+ &[aria-disabled='false'] {
122
+ &:focus,
123
+ &:active,
124
+ &:focus-visible {
125
+ outline: none;
126
+ box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
127
+ }
128
+ }
95
129
 
96
- ${({ size, status }) =>
97
- theme((o) => [
98
- o.outline.default.focus,
99
- o.borderRadius(4),
100
- status !== 'active' && size === 'M' && o.padding.horizontal(24),
101
- status !== 'active' && size === 'S' && o.padding.horizontal(16),
102
- status === 'inactive' ? o.font.text2 : o.font.text5,
103
- ...(status === 'active' ? [o.padding.left(16), o.padding.right(8)] : []),
104
- ])}
105
-
106
- ${disabledSelector} {
107
- ${theme((o) => [o.disabled])}
130
+ &:disabled,
131
+ &[aria-disabled]:not([aria-disabled='false']) {
132
+ opacity: 0.32;
108
133
  cursor: default;
109
134
  }
110
135
  `
@@ -120,12 +145,17 @@ const Background = styled.div<
120
145
  height: 100%;
121
146
 
122
147
  background-color: ${({ bgColor }) => bgColor};
123
- ${({ status }) => status === 'inactive' && theme((o) => o.bg.surface3)}
148
+ ${({ status }) =>
149
+ status === 'inactive' &&
150
+ css`
151
+ background-color: var(--charcoal-surface3);
152
+ `}
124
153
 
125
154
  ${({ bgImage }) =>
126
155
  bgImage !== undefined &&
127
156
  css`
128
- ${theme((o) => [o.bg.surface4])}
157
+ background-color: var(--charcoal-surface4);
158
+
129
159
  &::before {
130
160
  content: '';
131
161
  position: absolute;
@@ -143,13 +173,31 @@ const Background = styled.div<
143
173
 
144
174
  const Inner = styled.div`
145
175
  display: inline-flex;
146
- gap: ${({ theme }) => px(theme.spacing[8])};
176
+ gap: 8px;
147
177
  align-items: center;
148
178
  z-index: 2;
149
179
  `
150
180
 
151
181
  const labelCSS = css`
152
- ${theme((o) => [o.typography(14).bold])}
182
+ font-size: 14px;
183
+ line-height: 22px;
184
+ font-weight: bold;
185
+ display: flow-root;
186
+
187
+ &::before {
188
+ display: block;
189
+ width: 0;
190
+ height: 0;
191
+ content: '';
192
+ margin-top: -4px;
193
+ }
194
+ &::after {
195
+ display: block;
196
+ width: 0;
197
+ height: 0;
198
+ content: '';
199
+ margin-bottom: -4px;
200
+ }
153
201
  `
154
202
  const translateLabelCSS = css`
155
203
  display: flex;
@@ -172,5 +220,22 @@ const Label = styled.span`
172
220
  `
173
221
 
174
222
  const TranslatedLabel = styled.div`
175
- ${theme((o) => [o.typography(12).bold])}
223
+ font-size: 12px;
224
+ line-height: 20px;
225
+ font-weight: bold;
226
+ display: flow-root;
227
+ &::before {
228
+ display: block;
229
+ width: 0;
230
+ height: 0;
231
+ content: '';
232
+ margin-top: -4px;
233
+ }
234
+ &::after {
235
+ display: block;
236
+ width: 0;
237
+ height: 0;
238
+ content: '';
239
+ margin-bottom: -4px;
240
+ }
176
241
  `