@charcoal-ui/react 3.13.1 → 3.14.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 (30) hide show
  1. package/dist/components/Switch/index.d.ts.map +1 -1
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js.map +1 -1
  4. package/package.json +8 -8
  5. package/src/README.mdx +68 -0
  6. package/src/SSR.mdx +67 -0
  7. package/src/_lib/index.ts +1 -1
  8. package/src/components/Button/__snapshots__/index.story.storyshot +9 -9
  9. package/src/components/Checkbox/__snapshots__/index.story.storyshot +6 -6
  10. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
  11. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +1 -1
  12. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +23 -23
  13. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +1 -1
  14. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +14 -14
  15. package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
  16. package/src/components/IconButton/__snapshots__/index.story.storyshot +3 -3
  17. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +4 -4
  18. package/src/components/Modal/index.story.tsx +5 -0
  19. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +4 -4
  20. package/src/components/MultiSelect/index.test.tsx +6 -5
  21. package/src/components/Radio/__snapshots__/index.story.storyshot +5 -5
  22. package/src/components/Radio/index.test.tsx +4 -3
  23. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
  24. package/src/components/Switch/__snapshots__/index.story.storyshot +4 -4
  25. package/src/components/Switch/index.tsx +0 -1
  26. package/src/components/TagItem/__snapshots__/index.story.storyshot +8 -8
  27. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +11 -11
  28. package/src/components/TextField/__snapshots__/TextField.story.storyshot +13 -13
  29. package/src/components/Modal/__snapshots__/index.story.storyshot +0 -4091
  30. package/src/components/a11y.test.tsx +0 -99
@@ -2,6 +2,7 @@ import { fireEvent, render, screen } from '@testing-library/react'
2
2
  import { ThemeProvider } from 'styled-components'
3
3
  import { default as MultiSelect, MultiSelectGroup } from '.'
4
4
  import { light } from '@charcoal-ui/theme'
5
+ import { vi } from 'vitest'
5
6
 
6
7
  describe('MultiSelect', () => {
7
8
  describe('in development mode', () => {
@@ -12,7 +13,7 @@ describe('MultiSelect', () => {
12
13
  describe('when `<MultiSelect />` is used without `<MultiSelectGroup />`', () => {
13
14
  beforeEach(() => {
14
15
  // eslint-disable-next-line no-console
15
- console.error = jest.fn()
16
+ console.error = vi.fn()
16
17
 
17
18
  render(
18
19
  <ThemeProvider theme={light}>
@@ -38,8 +39,8 @@ describe('MultiSelect', () => {
38
39
  let option3: HTMLInputElement
39
40
  let allOptions: HTMLInputElement[]
40
41
  let parent: HTMLDivElement
41
- const childOnChange = jest.fn()
42
- const parentOnChange = jest.fn()
42
+ const childOnChange = vi.fn()
43
+ const parentOnChange = vi.fn()
43
44
 
44
45
  beforeEach(() => {
45
46
  render(
@@ -89,8 +90,8 @@ describe('MultiSelect', () => {
89
90
  let option1: HTMLInputElement
90
91
  let option2: HTMLInputElement
91
92
  let option3: HTMLInputElement
92
- const childOnChange = jest.fn()
93
- const parentOnChange = jest.fn()
93
+ const childOnChange = vi.fn()
94
+ const parentOnChange = vi.fn()
94
95
 
95
96
  beforeEach(() => {
96
97
  render(
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storybook Tests react/Radio Default 1`] = `
3
+ exports[`Storybook Tests > react/Radio > Default 1`] = `
4
4
  .c2 {
5
5
  display: grid;
6
6
  grid-template-columns: auto 1fr;
@@ -236,7 +236,7 @@ exports[`Storybook Tests react/Radio Default 1`] = `
236
236
  </div>
237
237
  `;
238
238
 
239
- exports[`Storybook Tests react/Radio Disabled 1`] = `
239
+ exports[`Storybook Tests > react/Radio > Disabled 1`] = `
240
240
  .c2 {
241
241
  display: grid;
242
242
  grid-template-columns: auto 1fr;
@@ -472,7 +472,7 @@ exports[`Storybook Tests react/Radio Disabled 1`] = `
472
472
  </div>
473
473
  `;
474
474
 
475
- exports[`Storybook Tests react/Radio Invalid 1`] = `
475
+ exports[`Storybook Tests > react/Radio > Invalid 1`] = `
476
476
  .c2 {
477
477
  display: grid;
478
478
  grid-template-columns: auto 1fr;
@@ -709,7 +709,7 @@ exports[`Storybook Tests react/Radio Invalid 1`] = `
709
709
  </div>
710
710
  `;
711
711
 
712
- exports[`Storybook Tests react/Radio PartialDisabled 1`] = `
712
+ exports[`Storybook Tests > react/Radio > PartialDisabled 1`] = `
713
713
  .c2 {
714
714
  display: grid;
715
715
  grid-template-columns: auto 1fr;
@@ -945,7 +945,7 @@ exports[`Storybook Tests react/Radio PartialDisabled 1`] = `
945
945
  </div>
946
946
  `;
947
947
 
948
- exports[`Storybook Tests react/Radio Readonly 1`] = `
948
+ exports[`Storybook Tests > react/Radio > Readonly 1`] = `
949
949
  .c2 {
950
950
  display: grid;
951
951
  grid-template-columns: auto 1fr;
@@ -2,6 +2,7 @@ import { fireEvent, render, screen } from '@testing-library/react'
2
2
  import { ThemeProvider } from 'styled-components'
3
3
  import Radio, { RadioGroup } from '.'
4
4
  import { light } from '@charcoal-ui/theme'
5
+ import { vi } from 'vitest'
5
6
 
6
7
  describe('Radio', () => {
7
8
  describe('development mode', () => {
@@ -12,7 +13,7 @@ describe('Radio', () => {
12
13
  describe('<Radio> is not surrounded by <RadioGroup>', () => {
13
14
  beforeEach(() => {
14
15
  // eslint-disable-next-line no-console
15
- console.error = jest.fn()
16
+ console.error = vi.fn()
16
17
 
17
18
  render(
18
19
  <ThemeProvider theme={light}>
@@ -33,7 +34,7 @@ describe('Radio', () => {
33
34
  describe('value is the first option', () => {
34
35
  let option1: HTMLInputElement
35
36
  let option2: HTMLInputElement
36
- const handleChange = jest.fn()
37
+ const handleChange = vi.fn()
37
38
 
38
39
  beforeEach(() => {
39
40
  render(<TestComponent value="option1" onChange={handleChange} />)
@@ -108,7 +109,7 @@ describe('Radio', () => {
108
109
 
109
110
  function TestComponent({
110
111
  value,
111
- onChange = jest.fn(),
112
+ onChange = vi.fn(),
112
113
  radioGroupDisabled = false,
113
114
  readonly = false,
114
115
  invalid = false,
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storybook Tests react/SegmentedControl ObjectSegments 1`] = `
3
+ exports[`Storybook Tests > react/SegmentedControl > ObjectSegments 1`] = `
4
4
  .c0 {
5
5
  display: -webkit-inline-box;
6
6
  display: -webkit-inline-flex;
@@ -259,7 +259,7 @@ exports[`Storybook Tests react/SegmentedControl ObjectSegments 1`] = `
259
259
  </div>
260
260
  `;
261
261
 
262
- exports[`Storybook Tests react/SegmentedControl StringSegments 1`] = `
262
+ exports[`Storybook Tests > react/SegmentedControl > StringSegments 1`] = `
263
263
  .c0 {
264
264
  display: -webkit-inline-box;
265
265
  display: -webkit-inline-flex;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storybook Tests react/Switch Checked 1`] = `
3
+ exports[`Storybook Tests > react/Switch > Checked 1`] = `
4
4
  .c0 {
5
5
  display: inline-grid;
6
6
  grid-template-columns: auto 1fr;
@@ -144,7 +144,7 @@ exports[`Storybook Tests react/Switch Checked 1`] = `
144
144
  </div>
145
145
  `;
146
146
 
147
- exports[`Storybook Tests react/Switch Default 1`] = `
147
+ exports[`Storybook Tests > react/Switch > Default 1`] = `
148
148
  .c0 {
149
149
  display: inline-grid;
150
150
  grid-template-columns: auto 1fr;
@@ -287,7 +287,7 @@ exports[`Storybook Tests react/Switch Default 1`] = `
287
287
  </div>
288
288
  `;
289
289
 
290
- exports[`Storybook Tests react/Switch Disabled 1`] = `
290
+ exports[`Storybook Tests > react/Switch > Disabled 1`] = `
291
291
  .c0 {
292
292
  display: inline-grid;
293
293
  grid-template-columns: auto 1fr;
@@ -443,7 +443,7 @@ exports[`Storybook Tests react/Switch Disabled 1`] = `
443
443
  </div>
444
444
  `;
445
445
 
446
- exports[`Storybook Tests react/Switch Label 1`] = `
446
+ exports[`Storybook Tests > react/Switch > Label 1`] = `
447
447
  .c0 {
448
448
  display: inline-grid;
449
449
  grid-template-columns: auto 1fr;
@@ -50,7 +50,6 @@ const SwitchCheckbox = forwardRef<HTMLInputElement, SwitchProps>(
50
50
  <Label className={className} aria-disabled={disabled}>
51
51
  <SwitchInput {...rest} ref={ref} />
52
52
  {'children' in props ? (
53
- // eslint-disable-next-line react/destructuring-assignment
54
53
  <LabelInner>{props.children}</LabelInner>
55
54
  ) : undefined}
56
55
  </Label>
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storybook Tests react/TagItem Active 1`] = `
3
+ exports[`Storybook Tests > react/TagItem > Active 1`] = `
4
4
  .c0 {
5
5
  isolation: isolate;
6
6
  position: relative;
@@ -151,7 +151,7 @@ exports[`Storybook Tests react/TagItem Active 1`] = `
151
151
  </div>
152
152
  `;
153
153
 
154
- exports[`Storybook Tests react/TagItem BGColor 1`] = `
154
+ exports[`Storybook Tests > react/TagItem > BGColor 1`] = `
155
155
  .c0 {
156
156
  isolation: isolate;
157
157
  position: relative;
@@ -299,7 +299,7 @@ exports[`Storybook Tests react/TagItem BGColor 1`] = `
299
299
  </div>
300
300
  `;
301
301
 
302
- exports[`Storybook Tests react/TagItem BGImage 1`] = `
302
+ exports[`Storybook Tests > react/TagItem > BGImage 1`] = `
303
303
  .c0 {
304
304
  isolation: isolate;
305
305
  position: relative;
@@ -461,7 +461,7 @@ exports[`Storybook Tests react/TagItem BGImage 1`] = `
461
461
  </div>
462
462
  `;
463
463
 
464
- exports[`Storybook Tests react/TagItem Default 1`] = `
464
+ exports[`Storybook Tests > react/TagItem > Default 1`] = `
465
465
  .c0 {
466
466
  isolation: isolate;
467
467
  position: relative;
@@ -609,7 +609,7 @@ exports[`Storybook Tests react/TagItem Default 1`] = `
609
609
  </div>
610
610
  `;
611
611
 
612
- exports[`Storybook Tests react/TagItem Disabled 1`] = `
612
+ exports[`Storybook Tests > react/TagItem > Disabled 1`] = `
613
613
  .c0 {
614
614
  isolation: isolate;
615
615
  position: relative;
@@ -757,7 +757,7 @@ exports[`Storybook Tests react/TagItem Disabled 1`] = `
757
757
  </div>
758
758
  `;
759
759
 
760
- exports[`Storybook Tests react/TagItem InActive 1`] = `
760
+ exports[`Storybook Tests > react/TagItem > InActive 1`] = `
761
761
  .c0 {
762
762
  isolation: isolate;
763
763
  position: relative;
@@ -906,7 +906,7 @@ exports[`Storybook Tests react/TagItem InActive 1`] = `
906
906
  </div>
907
907
  `;
908
908
 
909
- exports[`Storybook Tests react/TagItem Small 1`] = `
909
+ exports[`Storybook Tests > react/TagItem > Small 1`] = `
910
910
  .c0 {
911
911
  isolation: isolate;
912
912
  position: relative;
@@ -1054,7 +1054,7 @@ exports[`Storybook Tests react/TagItem Small 1`] = `
1054
1054
  </div>
1055
1055
  `;
1056
1056
 
1057
- exports[`Storybook Tests react/TagItem TranslatedLabel 1`] = `
1057
+ exports[`Storybook Tests > react/TagItem > TranslatedLabel 1`] = `
1058
1058
  .c0 {
1059
1059
  isolation: isolate;
1060
1060
  position: relative;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storybook Tests react/TextArea AssistiveText 1`] = `
3
+ exports[`Storybook Tests > react/TextArea > AssistiveText 1`] = `
4
4
  .c3 {
5
5
  font-size: 14px;
6
6
  line-height: 22px;
@@ -229,7 +229,7 @@ exports[`Storybook Tests react/TextArea AssistiveText 1`] = `
229
229
  </div>
230
230
  `;
231
231
 
232
- exports[`Storybook Tests react/TextArea AutoHeight 1`] = `
232
+ exports[`Storybook Tests > react/TextArea > AutoHeight 1`] = `
233
233
  .c3 {
234
234
  font-size: 14px;
235
235
  line-height: 22px;
@@ -445,7 +445,7 @@ exports[`Storybook Tests react/TextArea AutoHeight 1`] = `
445
445
  </div>
446
446
  `;
447
447
 
448
- exports[`Storybook Tests react/TextArea Default 1`] = `
448
+ exports[`Storybook Tests > react/TextArea > Default 1`] = `
449
449
  .c6 {
450
450
  cursor: pointer;
451
451
  -webkit-appearance: none;
@@ -707,7 +707,7 @@ exports[`Storybook Tests react/TextArea Default 1`] = `
707
707
  </div>
708
708
  `;
709
709
 
710
- exports[`Storybook Tests react/TextArea Disabled 1`] = `
710
+ exports[`Storybook Tests > react/TextArea > Disabled 1`] = `
711
711
  .c3 {
712
712
  font-size: 14px;
713
713
  line-height: 22px;
@@ -925,7 +925,7 @@ exports[`Storybook Tests react/TextArea Disabled 1`] = `
925
925
  </div>
926
926
  `;
927
927
 
928
- exports[`Storybook Tests react/TextArea Invalid 1`] = `
928
+ exports[`Storybook Tests > react/TextArea > Invalid 1`] = `
929
929
  .c3 {
930
930
  font-size: 14px;
931
931
  line-height: 22px;
@@ -1156,7 +1156,7 @@ exports[`Storybook Tests react/TextArea Invalid 1`] = `
1156
1156
  </div>
1157
1157
  `;
1158
1158
 
1159
- exports[`Storybook Tests react/TextArea Label 1`] = `
1159
+ exports[`Storybook Tests > react/TextArea > Label 1`] = `
1160
1160
  .c3 {
1161
1161
  font-size: 14px;
1162
1162
  line-height: 22px;
@@ -1358,7 +1358,7 @@ exports[`Storybook Tests react/TextArea Label 1`] = `
1358
1358
  </div>
1359
1359
  `;
1360
1360
 
1361
- exports[`Storybook Tests react/TextArea Placeholder 1`] = `
1361
+ exports[`Storybook Tests > react/TextArea > Placeholder 1`] = `
1362
1362
  .c3 {
1363
1363
  font-size: 14px;
1364
1364
  line-height: 22px;
@@ -1575,7 +1575,7 @@ exports[`Storybook Tests react/TextArea Placeholder 1`] = `
1575
1575
  </div>
1576
1576
  `;
1577
1577
 
1578
- exports[`Storybook Tests react/TextArea ReadOnly 1`] = `
1578
+ exports[`Storybook Tests > react/TextArea > ReadOnly 1`] = `
1579
1579
  .c3 {
1580
1580
  font-size: 14px;
1581
1581
  line-height: 22px;
@@ -1791,7 +1791,7 @@ exports[`Storybook Tests react/TextArea ReadOnly 1`] = `
1791
1791
  </div>
1792
1792
  `;
1793
1793
 
1794
- exports[`Storybook Tests react/TextArea Required 1`] = `
1794
+ exports[`Storybook Tests > react/TextArea > Required 1`] = `
1795
1795
  .c3 {
1796
1796
  font-size: 14px;
1797
1797
  line-height: 22px;
@@ -2040,7 +2040,7 @@ exports[`Storybook Tests react/TextArea Required 1`] = `
2040
2040
  </div>
2041
2041
  `;
2042
2042
 
2043
- exports[`Storybook Tests react/TextArea ShowCount 1`] = `
2043
+ exports[`Storybook Tests > react/TextArea > ShowCount 1`] = `
2044
2044
  .c3 {
2045
2045
  font-size: 14px;
2046
2046
  line-height: 22px;
@@ -2271,7 +2271,7 @@ exports[`Storybook Tests react/TextArea ShowCount 1`] = `
2271
2271
  </div>
2272
2272
  `;
2273
2273
 
2274
- exports[`Storybook Tests react/TextArea SubLabel 1`] = `
2274
+ exports[`Storybook Tests > react/TextArea > SubLabel 1`] = `
2275
2275
  .c6 {
2276
2276
  cursor: pointer;
2277
2277
  -webkit-appearance: none;
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storybook Tests react/TextField Affix 1`] = `
3
+ exports[`Storybook Tests > react/TextField > Affix 1`] = `
4
4
  .c3 {
5
5
  font-size: 14px;
6
6
  line-height: 22px;
@@ -253,7 +253,7 @@ exports[`Storybook Tests react/TextField Affix 1`] = `
253
253
  </div>
254
254
  `;
255
255
 
256
- exports[`Storybook Tests react/TextField AssistiveText 1`] = `
256
+ exports[`Storybook Tests > react/TextField > AssistiveText 1`] = `
257
257
  .c3 {
258
258
  font-size: 14px;
259
259
  line-height: 22px;
@@ -486,7 +486,7 @@ exports[`Storybook Tests react/TextField AssistiveText 1`] = `
486
486
  </div>
487
487
  `;
488
488
 
489
- exports[`Storybook Tests react/TextField Default 1`] = `
489
+ exports[`Storybook Tests > react/TextField > Default 1`] = `
490
490
  .c6 {
491
491
  cursor: pointer;
492
492
  -webkit-appearance: none;
@@ -751,7 +751,7 @@ exports[`Storybook Tests react/TextField Default 1`] = `
751
751
  </div>
752
752
  `;
753
753
 
754
- exports[`Storybook Tests react/TextField Disabled 1`] = `
754
+ exports[`Storybook Tests > react/TextField > Disabled 1`] = `
755
755
  .c3 {
756
756
  font-size: 14px;
757
757
  line-height: 22px;
@@ -973,7 +973,7 @@ exports[`Storybook Tests react/TextField Disabled 1`] = `
973
973
  </div>
974
974
  `;
975
975
 
976
- exports[`Storybook Tests react/TextField Invalid 1`] = `
976
+ exports[`Storybook Tests > react/TextField > Invalid 1`] = `
977
977
  .c3 {
978
978
  font-size: 14px;
979
979
  line-height: 22px;
@@ -1208,7 +1208,7 @@ exports[`Storybook Tests react/TextField Invalid 1`] = `
1208
1208
  </div>
1209
1209
  `;
1210
1210
 
1211
- exports[`Storybook Tests react/TextField Label 1`] = `
1211
+ exports[`Storybook Tests > react/TextField > Label 1`] = `
1212
1212
  .c3 {
1213
1213
  font-size: 14px;
1214
1214
  line-height: 22px;
@@ -1414,7 +1414,7 @@ exports[`Storybook Tests react/TextField Label 1`] = `
1414
1414
  </div>
1415
1415
  `;
1416
1416
 
1417
- exports[`Storybook Tests react/TextField Number 1`] = `
1417
+ exports[`Storybook Tests > react/TextField > Number 1`] = `
1418
1418
  .c3 {
1419
1419
  font-size: 14px;
1420
1420
  line-height: 22px;
@@ -1630,7 +1630,7 @@ exports[`Storybook Tests react/TextField Number 1`] = `
1630
1630
  </div>
1631
1631
  `;
1632
1632
 
1633
- exports[`Storybook Tests react/TextField Placeholder 1`] = `
1633
+ exports[`Storybook Tests > react/TextField > Placeholder 1`] = `
1634
1634
  .c3 {
1635
1635
  font-size: 14px;
1636
1636
  line-height: 22px;
@@ -1851,7 +1851,7 @@ exports[`Storybook Tests react/TextField Placeholder 1`] = `
1851
1851
  </div>
1852
1852
  `;
1853
1853
 
1854
- exports[`Storybook Tests react/TextField Prefix 1`] = `
1854
+ exports[`Storybook Tests > react/TextField > Prefix 1`] = `
1855
1855
  .c3 {
1856
1856
  font-size: 14px;
1857
1857
  line-height: 22px;
@@ -2105,7 +2105,7 @@ exports[`Storybook Tests react/TextField Prefix 1`] = `
2105
2105
  </div>
2106
2106
  `;
2107
2107
 
2108
- exports[`Storybook Tests react/TextField ReadOnly 1`] = `
2108
+ exports[`Storybook Tests > react/TextField > ReadOnly 1`] = `
2109
2109
  .c3 {
2110
2110
  font-size: 14px;
2111
2111
  line-height: 22px;
@@ -2325,7 +2325,7 @@ exports[`Storybook Tests react/TextField ReadOnly 1`] = `
2325
2325
  </div>
2326
2326
  `;
2327
2327
 
2328
- exports[`Storybook Tests react/TextField RequiredText 1`] = `
2328
+ exports[`Storybook Tests > react/TextField > RequiredText 1`] = `
2329
2329
  .c3 {
2330
2330
  font-size: 14px;
2331
2331
  line-height: 22px;
@@ -2564,7 +2564,7 @@ exports[`Storybook Tests react/TextField RequiredText 1`] = `
2564
2564
  </div>
2565
2565
  `;
2566
2566
 
2567
- exports[`Storybook Tests react/TextField ShowCount 1`] = `
2567
+ exports[`Storybook Tests > react/TextField > ShowCount 1`] = `
2568
2568
  .c3 {
2569
2569
  font-size: 14px;
2570
2570
  line-height: 22px;
@@ -2812,7 +2812,7 @@ exports[`Storybook Tests react/TextField ShowCount 1`] = `
2812
2812
  </div>
2813
2813
  `;
2814
2814
 
2815
- exports[`Storybook Tests react/TextField SubLabel 1`] = `
2815
+ exports[`Storybook Tests > react/TextField > SubLabel 1`] = `
2816
2816
  .c6 {
2817
2817
  cursor: pointer;
2818
2818
  -webkit-appearance: none;