@charcoal-ui/react 4.0.0-beta.3 → 4.0.0-beta.4

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 (103) hide show
  1. package/dist/components/Checkbox/index.d.ts +9 -20
  2. package/dist/components/Checkbox/index.d.ts.map +1 -1
  3. package/dist/components/CheckboxInput/index.d.ts +9 -0
  4. package/dist/components/CheckboxInput/index.d.ts.map +1 -0
  5. package/dist/components/DropdownSelector/Popover/index.d.ts +1 -2
  6. package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
  7. package/dist/components/Modal/index.d.ts +1 -1
  8. package/dist/components/Modal/index.d.ts.map +1 -1
  9. package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -1
  10. package/dist/components/MultiSelect/index.d.ts.map +1 -1
  11. package/dist/components/Radio/index.d.ts +4 -4
  12. package/dist/components/Radio/index.d.ts.map +1 -1
  13. package/dist/components/TextArea/index.d.ts.map +1 -1
  14. package/dist/components/TextField/index.d.ts.map +1 -1
  15. package/dist/core/CharcoalProvider.d.ts +1 -1
  16. package/dist/core/CharcoalProvider.d.ts.map +1 -1
  17. package/dist/index.cjs.js +177 -414
  18. package/dist/index.cjs.js.map +1 -1
  19. package/dist/index.css +86 -0
  20. package/dist/index.css.map +1 -1
  21. package/dist/index.esm.js +152 -389
  22. package/dist/index.esm.js.map +1 -1
  23. package/package.json +14 -17
  24. package/src/components/Checkbox/__snapshots__/index.story.storyshot +163 -517
  25. package/src/components/Checkbox/index.css +21 -0
  26. package/src/components/Checkbox/index.story.tsx +44 -79
  27. package/src/components/Checkbox/index.tsx +19 -157
  28. package/src/components/CheckboxInput/__snapshots__/index.story.storyshot +109 -0
  29. package/src/components/CheckboxInput/index.css +77 -0
  30. package/src/components/CheckboxInput/index.story.tsx +35 -0
  31. package/src/components/CheckboxInput/index.tsx +53 -0
  32. package/src/components/DropdownSelector/Popover/index.tsx +1 -2
  33. package/src/components/IconButton/__snapshots__/index.story.storyshot +6 -8
  34. package/src/components/IconButton/index.story.tsx +14 -37
  35. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +139 -1
  36. package/src/components/LoadingSpinner/index.story.tsx +18 -7
  37. package/src/components/Modal/index.tsx +1 -1
  38. package/src/components/Modal/useCustomModalOverlay.tsx +5 -4
  39. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +32 -44
  40. package/src/components/MultiSelect/index.story.tsx +88 -192
  41. package/src/components/MultiSelect/index.tsx +2 -1
  42. package/src/components/Radio/__snapshots__/index.story.storyshot +1 -1
  43. package/src/components/Radio/index.story.tsx +20 -21
  44. package/src/components/Radio/index.tsx +14 -13
  45. package/src/components/Switch/__snapshots__/index.story.storyshot +8 -9
  46. package/src/components/Switch/index.story.tsx +10 -18
  47. package/src/components/TagItem/__snapshots__/index.story.storyshot +791 -665
  48. package/src/components/TagItem/index.story.tsx +44 -161
  49. package/src/components/TextArea/TextArea.story.tsx +62 -24
  50. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +1858 -472
  51. package/src/components/TextArea/index.tsx +2 -0
  52. package/src/components/TextField/TextField.story.tsx +77 -67
  53. package/src/components/TextField/__snapshots__/TextField.story.storyshot +2004 -786
  54. package/src/components/TextField/index.tsx +2 -0
  55. package/src/components/a11y.test.tsx +1 -1
  56. package/src/core/CharcoalProvider.tsx +1 -1
  57. package/dist/components/Button/index.story.d.ts +0 -22
  58. package/dist/components/Button/index.story.d.ts.map +0 -1
  59. package/dist/components/Button/index.test.d.ts +0 -2
  60. package/dist/components/Button/index.test.d.ts.map +0 -1
  61. package/dist/components/Checkbox/index.story.d.ts +0 -8
  62. package/dist/components/Checkbox/index.story.d.ts.map +0 -1
  63. package/dist/components/Clickable/index.story.d.ts +0 -6
  64. package/dist/components/Clickable/index.story.d.ts.map +0 -1
  65. package/dist/components/DropdownSelector/ListItem/index.story.d.ts +0 -9
  66. package/dist/components/DropdownSelector/ListItem/index.story.d.ts.map +0 -1
  67. package/dist/components/DropdownSelector/MenuList/index.story.d.ts +0 -8
  68. package/dist/components/DropdownSelector/MenuList/index.story.d.ts.map +0 -1
  69. package/dist/components/DropdownSelector/Popover/index.story.d.ts +0 -5
  70. package/dist/components/DropdownSelector/Popover/index.story.d.ts.map +0 -1
  71. package/dist/components/DropdownSelector/index.story.d.ts +0 -19
  72. package/dist/components/DropdownSelector/index.story.d.ts.map +0 -1
  73. package/dist/components/Icon/index.story.d.ts +0 -6
  74. package/dist/components/Icon/index.story.d.ts.map +0 -1
  75. package/dist/components/IconButton/index.story.d.ts +0 -9
  76. package/dist/components/IconButton/index.story.d.ts.map +0 -1
  77. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts +0 -8
  78. package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts.map +0 -1
  79. package/dist/components/LoadingSpinner/index.story.d.ts +0 -6
  80. package/dist/components/LoadingSpinner/index.story.d.ts.map +0 -1
  81. package/dist/components/Modal/index.story.d.ts +0 -21
  82. package/dist/components/Modal/index.story.d.ts.map +0 -1
  83. package/dist/components/MultiSelect/index.story.d.ts +0 -82
  84. package/dist/components/MultiSelect/index.story.d.ts.map +0 -1
  85. package/dist/components/MultiSelect/index.test.d.ts +0 -2
  86. package/dist/components/MultiSelect/index.test.d.ts.map +0 -1
  87. package/dist/components/Radio/index.story.d.ts +0 -26
  88. package/dist/components/Radio/index.story.d.ts.map +0 -1
  89. package/dist/components/Radio/index.test.d.ts +0 -2
  90. package/dist/components/Radio/index.test.d.ts.map +0 -1
  91. package/dist/components/SegmentedControl/index.story.d.ts +0 -7
  92. package/dist/components/SegmentedControl/index.story.d.ts.map +0 -1
  93. package/dist/components/Switch/index.story.d.ts +0 -9
  94. package/dist/components/Switch/index.story.d.ts.map +0 -1
  95. package/dist/components/TagItem/index.story.d.ts +0 -16
  96. package/dist/components/TagItem/index.story.d.ts.map +0 -1
  97. package/dist/components/TextArea/TextArea.story.d.ts +0 -9
  98. package/dist/components/TextArea/TextArea.story.d.ts.map +0 -1
  99. package/dist/components/TextField/TextField.story.d.ts +0 -22
  100. package/dist/components/TextField/TextField.story.d.ts.map +0 -1
  101. package/dist/components/a11y.test.d.ts +0 -2
  102. package/dist/components/a11y.test.d.ts.map +0 -1
  103. package/src/components/LoadingSpinner/LoadingSpinnerIcon.story.tsx +0 -13
@@ -1,160 +1,132 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Storybook Tests Checkbox Invalid 1`] = `
4
- .c0 {
5
- position: relative;
6
- display: -webkit-box;
7
- display: -webkit-flex;
8
- display: -ms-flexbox;
9
- display: flex;
10
- cursor: pointer;
11
- gap: 4px;
12
- }
13
-
14
- .c0:disabled,
15
- .c0[aria-disabled]:not([aria-disabled='false']) {
16
- cursor: default;
17
- opacity: 0.32;
18
- }
19
-
20
- .c1 {
21
- position: relative;
22
- }
23
-
24
- .c2[type='checkbox'] {
25
- -webkit-appearance: none;
26
- -moz-appearance: none;
27
- appearance: none;
28
- display: block;
29
- cursor: pointer;
30
- margin: 0;
31
- width: 20px;
32
- height: 20px;
33
- border-radius: 4px;
34
- -webkit-transition: 0.2s box-shadow,0.2s background-color;
35
- transition: 0.2s box-shadow,0.2s background-color;
36
- }
37
-
38
- .c2[type='checkbox']:disabled {
39
- cursor: default;
40
- }
41
-
42
- .c2[type='checkbox']:-moz-read-only {
43
- cursor: default;
44
- }
45
-
46
- .c2[type='checkbox']:read-only {
47
- cursor: default;
48
- }
49
-
50
- .c2[type='checkbox']:checked {
51
- background-color: var(--charcoal-brand);
52
- }
53
-
54
- .c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
55
- .c2[type='checkbox']:checked[aria-disabled='false']:hover {
56
- background-color: var(--charcoal-brand-hover);
57
- }
58
-
59
- .c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
60
- .c2[type='checkbox']:checked[aria-disabled='false']:active {
61
- background-color: var(--charcoal-brand-press);
62
- }
63
-
64
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
65
- .c2[type='checkbox'][aria-disabled='false']:focus {
66
- outline: none;
67
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
68
- }
69
-
70
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
71
- .c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible) {
72
- box-shadow: none;
73
- }
74
-
75
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
76
- .c2[type='checkbox'][aria-disabled='false']:focus-visible {
77
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
78
- }
79
-
80
- .c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
81
- .c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
82
- box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
83
- }
84
-
85
- .c2[type='checkbox']:not(:checked) {
86
- border-width: 2px;
87
- border-style: solid;
88
- border-color: var(--charcoal-text4);
89
- }
3
+ exports[`Storybook Tests Checkbox Checked 1`] = `
4
+ <div
5
+ data-dark={false}
6
+ >
7
+ <label
8
+ className="charcoal-checkbox__label"
9
+ htmlFor="test-id"
10
+ >
11
+ <div
12
+ className="charcoal-checkbox-input__root"
13
+ >
14
+ <input
15
+ checked={true}
16
+ className="charcoal-checkbox-input__input"
17
+ id="test-id"
18
+ onChange={[Function]}
19
+ type="checkbox"
20
+ />
21
+ <div
22
+ aria-hidden={true}
23
+ className="charcoal-checkbox-input__overlay"
24
+ data-checked={true}
25
+ >
26
+ <pixiv-icon
27
+ name="24/Check"
28
+ unsafe-non-guideline-scale={0.6666666666666666}
29
+ />
30
+ </div>
31
+ </div>
32
+ <div
33
+ className="charcoal-checkbox__text"
34
+ >
35
+ Accelerate creativity.
36
+ </div>
37
+ </label>
38
+ </div>
39
+ `;
90
40
 
91
- .c3 {
92
- position: absolute;
93
- top: -2px;
94
- left: -2px;
95
- box-sizing: border-box;
96
- display: -webkit-box;
97
- display: -webkit-flex;
98
- display: -ms-flexbox;
99
- display: flex;
100
- -webkit-align-items: center;
101
- -webkit-box-align: center;
102
- -ms-flex-align: center;
103
- align-items: center;
104
- -webkit-box-pack: center;
105
- -webkit-justify-content: center;
106
- -ms-flex-pack: center;
107
- justify-content: center;
108
- width: 24px;
109
- height: 24px;
110
- color: var(--charcoal-text5);
111
- visibility: hidden;
112
- }
41
+ exports[`Storybook Tests Checkbox Default 1`] = `
42
+ <div
43
+ data-dark={false}
44
+ >
45
+ <div
46
+ className="charcoal-checkbox-input__root"
47
+ >
48
+ <input
49
+ className="charcoal-checkbox-input__input"
50
+ id="test-id"
51
+ onBlur={[Function]}
52
+ onChange={[Function]}
53
+ onClick={[Function]}
54
+ onFocus={[Function]}
55
+ type="checkbox"
56
+ />
57
+ <div
58
+ aria-hidden={true}
59
+ className="charcoal-checkbox-input__overlay"
60
+ >
61
+ <pixiv-icon
62
+ name="24/Check"
63
+ unsafe-non-guideline-scale={0.6666666666666666}
64
+ />
65
+ </div>
66
+ </div>
67
+ </div>
68
+ `;
113
69
 
114
- .c4 {
115
- color: var(--charcoal-text2);
116
- font-size: 14px;
117
- line-height: 20px;
118
- }
70
+ exports[`Storybook Tests Checkbox Disabled 1`] = `
71
+ <div
72
+ data-dark={false}
73
+ >
74
+ <label
75
+ aria-disabled={true}
76
+ className="charcoal-checkbox__label"
77
+ htmlFor="test-id"
78
+ >
79
+ <div
80
+ className="charcoal-checkbox-input__root"
81
+ >
82
+ <input
83
+ className="charcoal-checkbox-input__input"
84
+ disabled={true}
85
+ id="test-id"
86
+ onChange={[Function]}
87
+ type="checkbox"
88
+ />
89
+ <div
90
+ aria-hidden={true}
91
+ className="charcoal-checkbox-input__overlay"
92
+ >
93
+ <pixiv-icon
94
+ name="24/Check"
95
+ unsafe-non-guideline-scale={0.6666666666666666}
96
+ />
97
+ </div>
98
+ </div>
99
+ <div
100
+ className="charcoal-checkbox__text"
101
+ >
102
+ Accelerate creativity.
103
+ </div>
104
+ </label>
105
+ </div>
106
+ `;
119
107
 
108
+ exports[`Storybook Tests Checkbox Invalid 1`] = `
120
109
  <div
121
110
  data-dark={false}
122
111
  >
123
112
  <label
124
- aria-disabled={false}
125
- className="c0"
113
+ className="charcoal-checkbox__label"
114
+ htmlFor="test-id"
126
115
  >
127
116
  <div
128
- className="c1"
117
+ className="charcoal-checkbox-input__root"
129
118
  >
130
119
  <input
131
120
  aria-invalid={true}
132
- checked={false}
133
- className="c2"
134
- disabled={false}
121
+ className="charcoal-checkbox-input__input"
122
+ id="test-id"
135
123
  name="labelled"
136
- onBlur={[Function]}
137
124
  onChange={[Function]}
138
- onClick={[Function]}
139
- onDragStart={[Function]}
140
- onFocus={[Function]}
141
- onKeyDown={[Function]}
142
- onKeyUp={[Function]}
143
- onMouseDown={[Function]}
144
- onMouseEnter={[Function]}
145
- onMouseLeave={[Function]}
146
- onMouseUp={[Function]}
147
- onTouchCancel={[Function]}
148
- onTouchEnd={[Function]}
149
- onTouchMove={[Function]}
150
- onTouchStart={[Function]}
151
- readOnly={false}
152
125
  type="checkbox"
153
126
  />
154
127
  <div
155
128
  aria-hidden={true}
156
- checked={false}
157
- className="c3"
129
+ className="charcoal-checkbox-input__overlay"
158
130
  >
159
131
  <pixiv-icon
160
132
  name="24/Check"
@@ -163,410 +135,84 @@ exports[`Storybook Tests Checkbox Invalid 1`] = `
163
135
  </div>
164
136
  </div>
165
137
  <div
166
- className="c4"
138
+ className="charcoal-checkbox__text"
167
139
  >
168
- 同意する
140
+ Accelerate creativity.
169
141
  </div>
170
142
  </label>
171
143
  </div>
172
144
  `;
173
145
 
174
- exports[`Storybook Tests Checkbox Labelled 1`] = `
175
- .c0 {
176
- position: relative;
177
- display: -webkit-box;
178
- display: -webkit-flex;
179
- display: -ms-flexbox;
180
- display: flex;
181
- cursor: pointer;
182
- gap: 4px;
183
- }
184
-
185
- .c0:disabled,
186
- .c0[aria-disabled]:not([aria-disabled='false']) {
187
- cursor: default;
188
- opacity: 0.32;
189
- }
190
-
191
- .c1 {
192
- position: relative;
193
- }
194
-
195
- .c2[type='checkbox'] {
196
- -webkit-appearance: none;
197
- -moz-appearance: none;
198
- appearance: none;
199
- display: block;
200
- cursor: pointer;
201
- margin: 0;
202
- width: 20px;
203
- height: 20px;
204
- border-radius: 4px;
205
- -webkit-transition: 0.2s box-shadow,0.2s background-color;
206
- transition: 0.2s box-shadow,0.2s background-color;
207
- }
208
-
209
- .c2[type='checkbox']:disabled {
210
- cursor: default;
211
- }
212
-
213
- .c2[type='checkbox']:-moz-read-only {
214
- cursor: default;
215
- }
216
-
217
- .c2[type='checkbox']:read-only {
218
- cursor: default;
219
- }
220
-
221
- .c2[type='checkbox']:checked {
222
- background-color: var(--charcoal-brand);
223
- }
224
-
225
- .c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
226
- .c2[type='checkbox']:checked[aria-disabled='false']:hover {
227
- background-color: var(--charcoal-brand-hover);
228
- }
229
-
230
- .c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
231
- .c2[type='checkbox']:checked[aria-disabled='false']:active {
232
- background-color: var(--charcoal-brand-press);
233
- }
234
-
235
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
236
- .c2[type='checkbox'][aria-disabled='false']:focus {
237
- outline: none;
238
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
239
- }
240
-
241
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
242
- .c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible) {
243
- box-shadow: none;
244
- }
245
-
246
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
247
- .c2[type='checkbox'][aria-disabled='false']:focus-visible {
248
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
249
- }
250
-
251
- .c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
252
- .c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
253
- box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
254
- }
255
-
256
- .c2[type='checkbox']:not(:checked) {
257
- border-width: 2px;
258
- border-style: solid;
259
- border-color: var(--charcoal-text4);
260
- }
261
-
262
- .c3 {
263
- position: absolute;
264
- top: -2px;
265
- left: -2px;
266
- box-sizing: border-box;
267
- display: -webkit-box;
268
- display: -webkit-flex;
269
- display: -ms-flexbox;
270
- display: flex;
271
- -webkit-align-items: center;
272
- -webkit-box-align: center;
273
- -ms-flex-align: center;
274
- align-items: center;
275
- -webkit-box-pack: center;
276
- -webkit-justify-content: center;
277
- -ms-flex-pack: center;
278
- justify-content: center;
279
- width: 24px;
280
- height: 24px;
281
- color: var(--charcoal-text5);
282
- visibility: hidden;
283
- }
284
-
285
- .c4 {
286
- color: var(--charcoal-text2);
287
- font-size: 14px;
288
- line-height: 20px;
289
- }
290
-
146
+ exports[`Storybook Tests Checkbox Label 1`] = `
291
147
  <div
292
148
  data-dark={false}
293
149
  >
294
- <div>
150
+ <label
151
+ className="charcoal-checkbox__label"
152
+ htmlFor="test-id"
153
+ >
295
154
  <div
296
- style={
297
- Object {
298
- "marginBottom": "1em",
299
- }
300
- }
155
+ className="charcoal-checkbox-input__root"
301
156
  >
302
- <label
303
- aria-disabled={false}
304
- className="c0"
157
+ <input
158
+ className="charcoal-checkbox-input__input"
159
+ id="test-id"
160
+ onChange={[Function]}
161
+ type="checkbox"
162
+ />
163
+ <div
164
+ aria-hidden={true}
165
+ className="charcoal-checkbox-input__overlay"
305
166
  >
306
- <div
307
- className="c1"
308
- >
309
- <input
310
- checked={false}
311
- className="c2"
312
- disabled={false}
313
- name="labelled"
314
- onBlur={[Function]}
315
- onChange={[Function]}
316
- onClick={[Function]}
317
- onDragStart={[Function]}
318
- onFocus={[Function]}
319
- onKeyDown={[Function]}
320
- onKeyUp={[Function]}
321
- onMouseDown={[Function]}
322
- onMouseEnter={[Function]}
323
- onMouseLeave={[Function]}
324
- onMouseUp={[Function]}
325
- onTouchCancel={[Function]}
326
- onTouchEnd={[Function]}
327
- onTouchMove={[Function]}
328
- onTouchStart={[Function]}
329
- readOnly={false}
330
- type="checkbox"
331
- />
332
- <div
333
- aria-hidden={true}
334
- checked={false}
335
- className="c3"
336
- >
337
- <pixiv-icon
338
- name="24/Check"
339
- unsafe-non-guideline-scale={0.6666666666666666}
340
- />
341
- </div>
342
- </div>
343
- <div
344
- className="c4"
345
- >
346
- 同意する
347
- </div>
348
- </label>
167
+ <pixiv-icon
168
+ name="24/Check"
169
+ unsafe-non-guideline-scale={0.6666666666666666}
170
+ />
171
+ </div>
349
172
  </div>
350
- <div>
351
- <label
352
- aria-disabled={false}
353
- className="c0"
354
- >
355
- <div
356
- className="c1"
357
- >
358
- <input
359
- checked={false}
360
- className="c2"
361
- disabled={false}
362
- name="labelled"
363
- onBlur={[Function]}
364
- onChange={[Function]}
365
- onClick={[Function]}
366
- onDragStart={[Function]}
367
- onFocus={[Function]}
368
- onKeyDown={[Function]}
369
- onKeyUp={[Function]}
370
- onMouseDown={[Function]}
371
- onMouseEnter={[Function]}
372
- onMouseLeave={[Function]}
373
- onMouseUp={[Function]}
374
- onTouchCancel={[Function]}
375
- onTouchEnd={[Function]}
376
- onTouchMove={[Function]}
377
- onTouchStart={[Function]}
378
- readOnly={false}
379
- type="checkbox"
380
- />
381
- <div
382
- aria-hidden={true}
383
- checked={false}
384
- className="c3"
385
- >
386
- <pixiv-icon
387
- name="24/Check"
388
- unsafe-non-guideline-scale={0.6666666666666666}
389
- />
390
- </div>
391
- </div>
392
- <div
393
- className="c4"
394
- >
395
- <span
396
- style={
397
- Object {
398
- "display": "block",
399
- "width": 200,
400
- }
401
- }
402
- >
403
- 同意する同意する同意する同意する同意する同意する同意する同意する同意する同意する同意する同意する同意する
404
- </span>
405
- </div>
406
- </label>
173
+ <div
174
+ className="charcoal-checkbox__text"
175
+ >
176
+ Accelerate creativity.
407
177
  </div>
408
- </div>
178
+ </label>
409
179
  </div>
410
180
  `;
411
181
 
412
- exports[`Storybook Tests Checkbox Unlabelled 1`] = `
413
- .c0 {
414
- position: relative;
415
- display: -webkit-box;
416
- display: -webkit-flex;
417
- display: -ms-flexbox;
418
- display: flex;
419
- cursor: pointer;
420
- gap: 4px;
421
- }
422
-
423
- .c0:disabled,
424
- .c0[aria-disabled]:not([aria-disabled='false']) {
425
- cursor: default;
426
- opacity: 0.32;
427
- }
428
-
429
- .c1 {
430
- position: relative;
431
- }
432
-
433
- .c2[type='checkbox'] {
434
- -webkit-appearance: none;
435
- -moz-appearance: none;
436
- appearance: none;
437
- display: block;
438
- cursor: pointer;
439
- margin: 0;
440
- width: 20px;
441
- height: 20px;
442
- border-radius: 4px;
443
- -webkit-transition: 0.2s box-shadow,0.2s background-color;
444
- transition: 0.2s box-shadow,0.2s background-color;
445
- }
446
-
447
- .c2[type='checkbox']:disabled {
448
- cursor: default;
449
- }
450
-
451
- .c2[type='checkbox']:-moz-read-only {
452
- cursor: default;
453
- }
454
-
455
- .c2[type='checkbox']:read-only {
456
- cursor: default;
457
- }
458
-
459
- .c2[type='checkbox']:checked {
460
- background-color: var(--charcoal-brand);
461
- }
462
-
463
- .c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
464
- .c2[type='checkbox']:checked[aria-disabled='false']:hover {
465
- background-color: var(--charcoal-brand-hover);
466
- }
467
-
468
- .c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
469
- .c2[type='checkbox']:checked[aria-disabled='false']:active {
470
- background-color: var(--charcoal-brand-press);
471
- }
472
-
473
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
474
- .c2[type='checkbox'][aria-disabled='false']:focus {
475
- outline: none;
476
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
477
- }
478
-
479
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
480
- .c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible) {
481
- box-shadow: none;
482
- }
483
-
484
- .c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
485
- .c2[type='checkbox'][aria-disabled='false']:focus-visible {
486
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
487
- }
488
-
489
- .c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
490
- .c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
491
- box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
492
- }
493
-
494
- .c2[type='checkbox']:not(:checked) {
495
- border-width: 2px;
496
- border-style: solid;
497
- border-color: var(--charcoal-text4);
498
- }
499
-
500
- .c3 {
501
- position: absolute;
502
- top: -2px;
503
- left: -2px;
504
- box-sizing: border-box;
505
- display: -webkit-box;
506
- display: -webkit-flex;
507
- display: -ms-flexbox;
508
- display: flex;
509
- -webkit-align-items: center;
510
- -webkit-box-align: center;
511
- -ms-flex-align: center;
512
- align-items: center;
513
- -webkit-box-pack: center;
514
- -webkit-justify-content: center;
515
- -ms-flex-pack: center;
516
- justify-content: center;
517
- width: 24px;
518
- height: 24px;
519
- color: var(--charcoal-text5);
520
- visibility: hidden;
521
- }
522
-
182
+ exports[`Storybook Tests Checkbox ReadOnly 1`] = `
523
183
  <div
524
184
  data-dark={false}
525
185
  >
526
- <div>
527
- <label
528
- aria-disabled={false}
529
- className="c0"
186
+ <label
187
+ className="charcoal-checkbox__label"
188
+ htmlFor="test-id"
189
+ >
190
+ <div
191
+ className="charcoal-checkbox-input__root"
530
192
  >
193
+ <input
194
+ className="charcoal-checkbox-input__input"
195
+ id="test-id"
196
+ name="labelled"
197
+ onChange={[Function]}
198
+ readOnly={true}
199
+ type="checkbox"
200
+ />
531
201
  <div
532
- className="c1"
202
+ aria-hidden={true}
203
+ className="charcoal-checkbox-input__overlay"
533
204
  >
534
- <input
535
- aria-label="label"
536
- checked={false}
537
- className="c2"
538
- disabled={false}
539
- name="unlabelled"
540
- onBlur={[Function]}
541
- onChange={[Function]}
542
- onClick={[Function]}
543
- onDragStart={[Function]}
544
- onFocus={[Function]}
545
- onKeyDown={[Function]}
546
- onKeyUp={[Function]}
547
- onMouseDown={[Function]}
548
- onMouseEnter={[Function]}
549
- onMouseLeave={[Function]}
550
- onMouseUp={[Function]}
551
- onTouchCancel={[Function]}
552
- onTouchEnd={[Function]}
553
- onTouchMove={[Function]}
554
- onTouchStart={[Function]}
555
- readOnly={false}
556
- type="checkbox"
205
+ <pixiv-icon
206
+ name="24/Check"
207
+ unsafe-non-guideline-scale={0.6666666666666666}
557
208
  />
558
- <div
559
- aria-hidden={true}
560
- checked={false}
561
- className="c3"
562
- >
563
- <pixiv-icon
564
- name="24/Check"
565
- unsafe-non-guideline-scale={0.6666666666666666}
566
- />
567
- </div>
568
209
  </div>
569
- </label>
570
- </div>
210
+ </div>
211
+ <div
212
+ className="charcoal-checkbox__text"
213
+ >
214
+ Accelerate creativity.
215
+ </div>
216
+ </label>
571
217
  </div>
572
218
  `;