@charcoal-ui/react 3.7.0 → 3.9.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 (107) hide show
  1. package/dist/components/Button/StyledButton.d.ts +1 -0
  2. package/dist/components/Button/StyledButton.d.ts.map +1 -1
  3. package/dist/components/Button/index.d.ts +1 -0
  4. package/dist/components/Button/index.d.ts.map +1 -1
  5. package/dist/components/Button/index.story.d.ts +16 -32
  6. package/dist/components/Button/index.story.d.ts.map +1 -1
  7. package/dist/components/Checkbox/index.d.ts.map +1 -1
  8. package/dist/components/DropdownSelector/ListItem/index.story.d.ts +7 -7
  9. package/dist/components/DropdownSelector/ListItem/index.story.d.ts.map +1 -1
  10. package/dist/components/DropdownSelector/MenuList/index.story.d.ts +6 -9
  11. package/dist/components/DropdownSelector/MenuList/index.story.d.ts.map +1 -1
  12. package/dist/components/DropdownSelector/Popover/index.story.d.ts +3 -7
  13. package/dist/components/DropdownSelector/Popover/index.story.d.ts.map +1 -1
  14. package/dist/components/DropdownSelector/index.d.ts.map +1 -1
  15. package/dist/components/DropdownSelector/index.story.d.ts +9 -12
  16. package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
  17. package/dist/components/Icon/index.story.d.ts +4 -26
  18. package/dist/components/Icon/index.story.d.ts.map +1 -1
  19. package/dist/components/IconButton/index.d.ts +1 -0
  20. package/dist/components/IconButton/index.d.ts.map +1 -1
  21. package/dist/components/IconButton/index.story.d.ts +6 -25
  22. package/dist/components/IconButton/index.story.d.ts.map +1 -1
  23. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts +8 -0
  24. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts.map +1 -0
  25. package/dist/components/LoadingSpinner/index.d.ts +2 -2
  26. package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
  27. package/dist/components/LoadingSpinner/index.story.d.ts +4 -7
  28. package/dist/components/LoadingSpinner/index.story.d.ts.map +1 -1
  29. package/dist/components/Modal/index.d.ts.map +1 -1
  30. package/dist/components/Modal/index.story.d.ts +16 -41
  31. package/dist/components/Modal/index.story.d.ts.map +1 -1
  32. package/dist/components/Modal/useCustomModalOverlay.d.ts +12 -0
  33. package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -0
  34. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  35. package/dist/components/Radio/index.d.ts +0 -2
  36. package/dist/components/Radio/index.d.ts.map +1 -1
  37. package/dist/components/Radio/index.story.d.ts +12 -23
  38. package/dist/components/Radio/index.story.d.ts.map +1 -1
  39. package/dist/components/SegmentedControl/index.story.d.ts +5 -8
  40. package/dist/components/SegmentedControl/index.story.d.ts.map +1 -1
  41. package/dist/components/Switch/index.d.ts.map +1 -1
  42. package/dist/components/Switch/index.story.d.ts +7 -12
  43. package/dist/components/Switch/index.story.d.ts.map +1 -1
  44. package/dist/components/TagItem/index.d.ts.map +1 -1
  45. package/dist/components/TagItem/index.story.d.ts +14 -24
  46. package/dist/components/TagItem/index.story.d.ts.map +1 -1
  47. package/dist/components/TextArea/TextArea.story.d.ts +7 -25
  48. package/dist/components/TextArea/TextArea.story.d.ts.map +1 -1
  49. package/dist/components/TextArea/index.d.ts.map +1 -1
  50. package/dist/components/TextField/TextField.story.d.ts +14 -20
  51. package/dist/components/TextField/TextField.story.d.ts.map +1 -1
  52. package/dist/components/TextField/index.d.ts.map +1 -1
  53. package/dist/index.cjs.js +1006 -2240
  54. package/dist/index.cjs.js.map +1 -1
  55. package/dist/index.esm.js +1001 -2241
  56. package/dist/index.esm.js.map +1 -1
  57. package/dist/styled.d.ts +4 -4
  58. package/package.json +7 -6
  59. package/src/components/Button/StyledButton.tsx +19 -14
  60. package/src/components/Button/__snapshots__/index.story.storyshot +314 -118
  61. package/src/components/Button/index.story.tsx +141 -138
  62. package/src/components/Button/index.tsx +3 -0
  63. package/src/components/Checkbox/__snapshots__/index.story.storyshot +55 -42
  64. package/src/components/Checkbox/index.tsx +15 -17
  65. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
  66. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +42 -37
  67. package/src/components/DropdownSelector/ListItem/index.story.tsx +8 -4
  68. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +38 -38
  69. package/src/components/DropdownSelector/MenuList/index.story.tsx +33 -27
  70. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +11 -5
  71. package/src/components/DropdownSelector/Popover/index.story.tsx +6 -6
  72. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +148 -47
  73. package/src/components/DropdownSelector/index.story.tsx +207 -204
  74. package/src/components/DropdownSelector/index.tsx +17 -10
  75. package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
  76. package/src/components/Icon/index.story.tsx +8 -12
  77. package/src/components/IconButton/__snapshots__/index.story.storyshot +135 -13
  78. package/src/components/IconButton/index.story.tsx +30 -23
  79. package/src/components/IconButton/index.tsx +35 -20
  80. package/src/components/LoadingSpinner/LoadingSpinnerIcon.story.tsx +12 -0
  81. package/src/components/LoadingSpinner/__snapshots__/LoadingSpinnerIcon.story.storyshot +28 -0
  82. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +1 -35
  83. package/src/components/LoadingSpinner/index.story.tsx +11 -54
  84. package/src/components/LoadingSpinner/index.tsx +1 -1
  85. package/src/components/Modal/__snapshots__/index.story.storyshot +224 -171
  86. package/src/components/Modal/index.story.tsx +139 -133
  87. package/src/components/Modal/index.tsx +15 -20
  88. package/src/components/Modal/useCustomModalOverlay.tsx +42 -0
  89. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +56 -4
  90. package/src/components/MultiSelect/index.tsx +3 -0
  91. package/src/components/Radio/__snapshots__/index.story.storyshot +1001 -121
  92. package/src/components/Radio/index.story.tsx +128 -63
  93. package/src/components/Radio/index.tsx +15 -17
  94. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
  95. package/src/components/SegmentedControl/index.story.tsx +24 -29
  96. package/src/components/Switch/__snapshots__/index.story.storyshot +184 -26
  97. package/src/components/Switch/index.story.tsx +72 -48
  98. package/src/components/Switch/index.tsx +2 -7
  99. package/src/components/TagItem/__snapshots__/index.story.storyshot +72 -33
  100. package/src/components/TagItem/index.story.tsx +154 -159
  101. package/src/components/TagItem/index.tsx +2 -6
  102. package/src/components/TextArea/TextArea.story.tsx +29 -32
  103. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +127 -73
  104. package/src/components/TextArea/index.tsx +22 -14
  105. package/src/components/TextField/TextField.story.tsx +85 -64
  106. package/src/components/TextField/__snapshots__/TextField.story.storyshot +479 -167
  107. package/src/components/TextField/index.tsx +22 -21
@@ -1,6 +1,38 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storyshots DropdownSelector/ListItem Basic 1`] = `
3
+ exports[`Storybook Tests DropdownSelector/ListItem Basic 1`] = `
4
+ .c0 {
5
+ list-style: none;
6
+ }
7
+
8
+ .c1 {
9
+ display: -webkit-box;
10
+ display: -webkit-flex;
11
+ display: -ms-flexbox;
12
+ display: flex;
13
+ -webkit-align-items: center;
14
+ -webkit-box-align: center;
15
+ -ms-flex-align: center;
16
+ align-items: center;
17
+ min-height: 40px;
18
+ cursor: pointer;
19
+ outline: none;
20
+ padding-right: 16px;
21
+ padding-left: 16px;
22
+ }
23
+
24
+ .c1:disabled,
25
+ .c1[aria-disabled]:not([aria-disabled='false']) {
26
+ opacity: 0.32;
27
+ cursor: default;
28
+ }
29
+
30
+ .c1:hover,
31
+ .c1:focus,
32
+ .c1:focus-within {
33
+ background-color: var(--charcoal-surface3);
34
+ }
35
+
4
36
  .c3 {
5
37
  display: inline-grid;
6
38
  grid-template-columns: auto 1fr;
@@ -18,10 +50,6 @@ exports[`Storyshots DropdownSelector/ListItem Basic 1`] = `
18
50
  cursor: default;
19
51
  }
20
52
 
21
- .c3:active > input {
22
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
23
- }
24
-
25
53
  .c4 {
26
54
  -webkit-appearance: none;
27
55
  -moz-appearance: none;
@@ -55,6 +83,15 @@ exports[`Storyshots DropdownSelector/ListItem Basic 1`] = `
55
83
  }
56
84
 
57
85
  .c4:focus {
86
+ outline: none;
87
+ box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
88
+ }
89
+
90
+ .c4:focus:not(:focus-visible) {
91
+ box-shadow: none;
92
+ }
93
+
94
+ .c4:focus-visible {
58
95
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
59
96
  }
60
97
 
@@ -105,38 +142,6 @@ exports[`Storyshots DropdownSelector/ListItem Basic 1`] = `
105
142
  transition: transform 0.2s;
106
143
  }
107
144
 
108
- .c0 {
109
- list-style: none;
110
- }
111
-
112
- .c1 {
113
- display: -webkit-box;
114
- display: -webkit-flex;
115
- display: -ms-flexbox;
116
- display: flex;
117
- -webkit-align-items: center;
118
- -webkit-box-align: center;
119
- -ms-flex-align: center;
120
- align-items: center;
121
- min-height: 40px;
122
- cursor: pointer;
123
- outline: none;
124
- padding-right: 16px;
125
- padding-left: 16px;
126
- }
127
-
128
- .c1:disabled,
129
- .c1[aria-disabled]:not([aria-disabled='false']) {
130
- opacity: 0.32;
131
- cursor: default;
132
- }
133
-
134
- .c1:hover,
135
- .c1:focus,
136
- .c1:focus-within {
137
- background-color: var(--charcoal-surface3);
138
- }
139
-
140
145
  .c2 {
141
146
  color: red;
142
147
  }
@@ -1,20 +1,20 @@
1
1
  import { useState } from 'react'
2
- import { Story } from '../../../_lib/compat'
3
2
  import Icon from '../../Icon'
4
3
  import Switch from '../../Switch'
5
- import ListItem, { ListItemProps } from '.'
4
+ import ListItem from '.'
6
5
  import styled from 'styled-components'
6
+ import { Meta, StoryObj } from '@storybook/react'
7
7
 
8
8
  export default {
9
9
  title: 'DropdownSelector/ListItem',
10
10
  component: ListItem,
11
- }
11
+ } as Meta<typeof ListItem>
12
12
 
13
13
  const CustomLink = styled.a`
14
14
  color: red;
15
15
  `
16
16
 
17
- export const Basic: Story<ListItemProps> = () => {
17
+ const BasicRender = () => {
18
18
  const [checked, setChecked] = useState(false)
19
19
  const handleCheck = () => {
20
20
  setChecked((v) => !v)
@@ -49,3 +49,7 @@ export const Basic: Story<ListItemProps> = () => {
49
49
  </>
50
50
  )
51
51
  }
52
+
53
+ export const Basic: StoryObj<typeof ListItem> = {
54
+ render: BasicRender,
55
+ }
@@ -1,6 +1,11 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storyshots DropdownSelector/MenuList Basic 1`] = `
3
+ exports[`Storybook Tests DropdownSelector/MenuList Basic 1`] = `
4
+ .c0 {
5
+ padding: 0;
6
+ margin: 0;
7
+ }
8
+
4
9
  .c1 {
5
10
  list-style: none;
6
11
  }
@@ -33,11 +38,6 @@ exports[`Storyshots DropdownSelector/MenuList Basic 1`] = `
33
38
  background-color: var(--charcoal-surface3);
34
39
  }
35
40
 
36
- .c0 {
37
- padding: 0;
38
- margin: 0;
39
- }
40
-
41
41
  <div
42
42
  data-dark={false}
43
43
  >
@@ -208,7 +208,12 @@ exports[`Storyshots DropdownSelector/MenuList Basic 1`] = `
208
208
  </div>
209
209
  `;
210
210
 
211
- exports[`Storyshots DropdownSelector/MenuList Disabled 1`] = `
211
+ exports[`Storybook Tests DropdownSelector/MenuList Disabled 1`] = `
212
+ .c0 {
213
+ padding: 0;
214
+ margin: 0;
215
+ }
216
+
212
217
  .c1 {
213
218
  list-style: none;
214
219
  }
@@ -241,11 +246,6 @@ exports[`Storyshots DropdownSelector/MenuList Disabled 1`] = `
241
246
  background-color: var(--charcoal-surface3);
242
247
  }
243
248
 
244
- .c0 {
245
- padding: 0;
246
- margin: 0;
247
- }
248
-
249
249
  <div
250
250
  data-dark={false}
251
251
  >
@@ -287,7 +287,32 @@ exports[`Storyshots DropdownSelector/MenuList Disabled 1`] = `
287
287
  </div>
288
288
  `;
289
289
 
290
- exports[`Storyshots DropdownSelector/MenuList Group 1`] = `
290
+ exports[`Storybook Tests DropdownSelector/MenuList Group 1`] = `
291
+ .c0 {
292
+ padding: 0;
293
+ margin: 0;
294
+ }
295
+
296
+ .c2 {
297
+ display: block;
298
+ color: var(--charcoal-text3);
299
+ font-size: 12px;
300
+ font-weight: bold;
301
+ padding: 12px 0 8px 16px;
302
+ }
303
+
304
+ .c3 {
305
+ padding-left: 0;
306
+ margin: 0;
307
+ box-sizing: border-box;
308
+ list-style: none;
309
+ overflow: hidden;
310
+ }
311
+
312
+ .c1 {
313
+ display: block;
314
+ }
315
+
291
316
  .c4 {
292
317
  list-style: none;
293
318
  }
@@ -320,31 +345,6 @@ exports[`Storyshots DropdownSelector/MenuList Group 1`] = `
320
345
  background-color: var(--charcoal-surface3);
321
346
  }
322
347
 
323
- .c0 {
324
- padding: 0;
325
- margin: 0;
326
- }
327
-
328
- .c2 {
329
- display: block;
330
- color: var(--charcoal-text3);
331
- font-size: 12px;
332
- font-weight: bold;
333
- padding: 12px 0 8px 16px;
334
- }
335
-
336
- .c3 {
337
- padding-left: 0;
338
- margin: 0;
339
- box-sizing: border-box;
340
- list-style: none;
341
- overflow: hidden;
342
- }
343
-
344
- .c1 {
345
- display: block;
346
- }
347
-
348
348
  <div
349
349
  data-dark={false}
350
350
  >
@@ -1,13 +1,13 @@
1
1
  import { action } from '@storybook/addon-actions'
2
- import { Story } from '../../../_lib/compat'
3
- import MenuList, { MenuListProps } from '.'
2
+ import MenuList from '.'
4
3
  import MenuItem from '../MenuItem'
5
4
  import MenuItemGroup from '../MenuItemGroup'
5
+ import { Meta, StoryObj } from '@storybook/react'
6
6
 
7
7
  export default {
8
8
  title: 'DropdownSelector/MenuList',
9
9
  component: MenuList,
10
- }
10
+ } as Meta<typeof MenuList>
11
11
 
12
12
  function makeList(n: number, offset = 0) {
13
13
  return [...(Array(n) as undefined[])].map((_, i) => {
@@ -20,32 +20,38 @@ function makeList(n: number, offset = 0) {
20
20
  })
21
21
  }
22
22
 
23
- export const Basic: Story<MenuListProps> = () => {
24
- return (
25
- <>
26
- <MenuList onChange={action('onChange')}>{makeList(10)}</MenuList>
27
- </>
28
- )
23
+ export const Basic: StoryObj<typeof MenuList> = {
24
+ render: () => {
25
+ return (
26
+ <>
27
+ <MenuList onChange={action('onChange')}>{makeList(10)}</MenuList>
28
+ </>
29
+ )
30
+ },
29
31
  }
30
32
 
31
- export const Disabled: Story<MenuListProps> = () => {
32
- return (
33
- <>
34
- <MenuList onChange={action('onChange')}>
35
- <MenuItem value="1">MenuItem</MenuItem>
36
- <MenuItem value="2" disabled>
37
- Disabled MenuItem
38
- </MenuItem>
39
- </MenuList>
40
- </>
41
- )
33
+ export const Disabled: StoryObj<typeof MenuList> = {
34
+ render: () => {
35
+ return (
36
+ <>
37
+ <MenuList onChange={action('onChange')}>
38
+ <MenuItem value="1">MenuItem</MenuItem>
39
+ <MenuItem value="2" disabled>
40
+ Disabled MenuItem
41
+ </MenuItem>
42
+ </MenuList>
43
+ </>
44
+ )
45
+ },
42
46
  }
43
47
 
44
- export const Group: Story<MenuListProps> = () => {
45
- return (
46
- <MenuList onChange={action('onChange')} value="1">
47
- <MenuItemGroup text="Section1">{makeList(5)}</MenuItemGroup>
48
- <MenuItemGroup text="Section2">{makeList(5, 5)}</MenuItemGroup>
49
- </MenuList>
50
- )
48
+ export const Group: StoryObj<typeof MenuList> = {
49
+ render: () => {
50
+ return (
51
+ <MenuList onChange={action('onChange')} value="1">
52
+ <MenuItemGroup text="Section1">{makeList(5)}</MenuItemGroup>
53
+ <MenuItemGroup text="Section2">{makeList(5, 5)}</MenuItemGroup>
54
+ </MenuList>
55
+ )
56
+ },
51
57
  }
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storyshots DropdownSelector/Popover Basic 1`] = `
3
+ exports[`Storybook Tests DropdownSelector/Popover Basic 1`] = `
4
4
  .c0 {
5
5
  cursor: pointer;
6
6
  -webkit-appearance: none;
@@ -71,13 +71,19 @@ exports[`Storyshots DropdownSelector/Popover Basic 1`] = `
71
71
  height: 40px;
72
72
  }
73
73
 
74
- .c1:not(:disabled):not([aria-disabled]):active,
75
- .c1[aria-disabled='false']:active,
76
74
  .c1:not(:disabled):not([aria-disabled]):focus,
77
- .c1[aria-disabled='false']:focus,
75
+ .c1[aria-disabled='false']:focus {
76
+ outline: none;
77
+ box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
78
+ }
79
+
80
+ .c1:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
81
+ .c1[aria-disabled='false']:focus:not(:focus-visible) {
82
+ box-shadow: none;
83
+ }
84
+
78
85
  .c1:not(:disabled):not([aria-disabled]):focus-visible,
79
86
  .c1[aria-disabled='false']:focus-visible {
80
- outline: none;
81
87
  box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
82
88
  }
83
89
 
@@ -1,12 +1,12 @@
1
1
  import { useRef, CSSProperties, useState } from 'react'
2
- import { Story } from '../../../_lib/compat'
3
- import Popover, { PopoverProps } from '.'
2
+ import Popover from '.'
4
3
  import Button from '../../Button'
4
+ import { Meta, StoryObj } from '@storybook/react'
5
5
 
6
6
  export default {
7
7
  title: 'DropdownSelector/Popover',
8
8
  component: Popover,
9
- }
9
+ } as Meta<typeof Popover>
10
10
 
11
11
  function Base(props: { style?: CSSProperties }) {
12
12
  const [isOpen, setIsOpen] = useState(false)
@@ -33,8 +33,8 @@ function Base(props: { style?: CSSProperties }) {
33
33
  )
34
34
  }
35
35
 
36
- export const Basic: Story<PopoverProps> = () => {
37
- return (
36
+ export const Basic: StoryObj = {
37
+ render: () => (
38
38
  <>
39
39
  <Base
40
40
  style={{
@@ -61,5 +61,5 @@ export const Basic: Story<PopoverProps> = () => {
61
61
  }}
62
62
  />
63
63
  </>
64
- )
64
+ ),
65
65
  }