@charcoal-ui/react 3.5.0 → 3.6.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.
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.story.d.ts +1 -0
- package/dist/components/Checkbox/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/DropdownMenuItem.d.ts.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/FieldLabel/index.d.ts.map +1 -1
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
- package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.story.d.ts +1 -0
- package/dist/components/Modal/index.story.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.story.d.ts +2 -0
- package/dist/components/MultiSelect/index.story.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TextField/TextField.story.d.ts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/index.cjs.js +741 -317
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +728 -304
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +4 -4
- package/package.json +9 -9
- package/src/components/Button/__snapshots__/index.story.storyshot +312 -592
- package/src/components/Button/index.tsx +50 -14
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +209 -40
- package/src/components/Checkbox/__snapshots__/snapshot.test.tsx.snap +410 -80
- package/src/components/Checkbox/index.story.tsx +24 -0
- package/src/components/Checkbox/index.tsx +47 -17
- package/src/components/Clickable/__snapshots__/index.story.storyshot +4 -0
- package/src/components/Clickable/index.tsx +1 -0
- package/src/components/DropdownSelector/DropdownMenuItem.tsx +19 -3
- package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +3 -10
- package/src/components/DropdownSelector/ListItem/index.tsx +6 -4
- package/src/components/DropdownSelector/MenuItemGroup/index.tsx +1 -1
- package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +4 -13
- package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +20 -37
- package/src/components/DropdownSelector/Popover/index.tsx +5 -8
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +60 -191
- package/src/components/DropdownSelector/index.tsx +70 -20
- package/src/components/FieldLabel/index.tsx +77 -12
- package/src/components/IconButton/__snapshots__/index.story.storyshot +30 -54
- package/src/components/IconButton/index.tsx +51 -26
- package/src/components/LoadingSpinner/index.tsx +3 -6
- package/src/components/Modal/Dialog/index.tsx +1 -1
- package/src/components/Modal/ModalPlumbing.tsx +26 -5
- package/src/components/Modal/__snapshots__/index.story.storyshot +2454 -108
- package/src/components/Modal/index.story.tsx +27 -0
- package/src/components/Modal/index.tsx +19 -4
- package/src/components/MultiSelect/__snapshots__/index.story.storyshot +528 -25
- package/src/components/MultiSelect/index.story.tsx +60 -0
- package/src/components/MultiSelect/index.tsx +82 -22
- package/src/components/Radio/__snapshots__/index.story.storyshot +32 -49
- package/src/components/Radio/index.tsx +71 -23
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +18 -19
- package/src/components/SegmentedControl/index.tsx +35 -15
- package/src/components/Switch/__snapshots__/index.story.storyshot +6 -18
- package/src/components/Switch/index.tsx +10 -15
- package/src/components/TagItem/__snapshots__/index.story.storyshot +39 -158
- package/src/components/TagItem/index.tsx +84 -19
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +38 -76
- package/src/components/TextField/TextField.story.tsx +35 -18
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +71 -128
- package/src/components/TextField/index.tsx +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`using dark theme storiesOf(index.story.tsx).add(
|
|
3
|
+
exports[`using dark theme storiesOf(index.story.tsx).add(Invalid) snapshot 1`] = `
|
|
4
4
|
.c0 {
|
|
5
5
|
position: relative;
|
|
6
6
|
display: -webkit-box;
|
|
@@ -17,7 +17,7 @@ exports[`using dark theme storiesOf(index.story.tsx).add(Labelled) snapshot 1`]
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.c0:disabled,
|
|
20
|
-
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
20
|
+
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
21
21
|
opacity: 0.32;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -35,55 +35,219 @@ exports[`using dark theme storiesOf(index.story.tsx).add(Labelled) snapshot 1`]
|
|
|
35
35
|
width: 20px;
|
|
36
36
|
height: 20px;
|
|
37
37
|
border-radius: 4px;
|
|
38
|
-
-webkit-transition: 0.2s box-shadow;
|
|
39
|
-
transition: 0.2s box-shadow;
|
|
40
|
-
-webkit-transition: all 0.2s !important;
|
|
41
|
-
transition: all 0.2s !important;
|
|
38
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
39
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
.c2[type='checkbox']:checked {
|
|
45
43
|
background-color: var(--charcoal-brand);
|
|
46
|
-
-webkit-transition: 0.2s background-color;
|
|
47
|
-
transition: 0.2s background-color;
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
.c2[type='checkbox']:checked:
|
|
51
|
-
.c2[type='checkbox']:checked
|
|
46
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
|
|
47
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:hover {
|
|
52
48
|
background-color: var(--charcoal-brand-hover);
|
|
53
49
|
}
|
|
54
50
|
|
|
55
|
-
.c2[type='checkbox']:checked:
|
|
56
|
-
.c2[type='checkbox']:checked
|
|
51
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
|
|
52
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:active {
|
|
57
53
|
background-color: var(--charcoal-brand-press);
|
|
58
54
|
}
|
|
59
55
|
|
|
56
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
|
|
57
|
+
.c2[type='checkbox'][aria-disabled='false']:focus,
|
|
58
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active,
|
|
59
|
+
.c2[type='checkbox'][aria-disabled='false']:active {
|
|
60
|
+
outline: none;
|
|
61
|
+
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
|
|
65
|
+
.c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible),
|
|
66
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
|
|
67
|
+
.c2[type='checkbox'][aria-disabled='false']:active:not(:focus-visible) {
|
|
68
|
+
outline: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
|
|
72
|
+
.c2[type='checkbox'][aria-disabled='false']:focus-visible {
|
|
73
|
+
outline: none;
|
|
74
|
+
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
|
|
78
|
+
.c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
|
|
79
|
+
box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
|
|
80
|
+
}
|
|
81
|
+
|
|
60
82
|
.c2[type='checkbox']:not(:checked) {
|
|
61
83
|
border-width: 2px;
|
|
62
84
|
border-style: solid;
|
|
63
|
-
border-color:
|
|
85
|
+
border-color: var(--charcoal-text4);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.c3 {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: -2px;
|
|
91
|
+
left: -2px;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
display: -webkit-box;
|
|
94
|
+
display: -webkit-flex;
|
|
95
|
+
display: -ms-flexbox;
|
|
96
|
+
display: flex;
|
|
97
|
+
-webkit-align-items: center;
|
|
98
|
+
-webkit-box-align: center;
|
|
99
|
+
-ms-flex-align: center;
|
|
100
|
+
align-items: center;
|
|
101
|
+
-webkit-box-pack: center;
|
|
102
|
+
-webkit-justify-content: center;
|
|
103
|
+
-ms-flex-pack: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
width: 24px;
|
|
106
|
+
height: 24px;
|
|
107
|
+
color: var(--charcoal-text5);
|
|
108
|
+
visibility: hidden;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.c4 {
|
|
112
|
+
color: var(--charcoal-text2);
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
line-height: 20px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
<label
|
|
118
|
+
aria-disabled={false}
|
|
119
|
+
className="c0"
|
|
120
|
+
>
|
|
121
|
+
<div
|
|
122
|
+
className="c1"
|
|
123
|
+
>
|
|
124
|
+
<input
|
|
125
|
+
aria-invalid={true}
|
|
126
|
+
checked={false}
|
|
127
|
+
className="c2"
|
|
128
|
+
disabled={false}
|
|
129
|
+
name="labelled"
|
|
130
|
+
onBlur={[Function]}
|
|
131
|
+
onChange={[Function]}
|
|
132
|
+
onClick={[Function]}
|
|
133
|
+
onDragStart={[Function]}
|
|
134
|
+
onFocus={[Function]}
|
|
135
|
+
onKeyDown={[Function]}
|
|
136
|
+
onKeyUp={[Function]}
|
|
137
|
+
onMouseDown={[Function]}
|
|
138
|
+
onMouseEnter={[Function]}
|
|
139
|
+
onMouseLeave={[Function]}
|
|
140
|
+
onMouseUp={[Function]}
|
|
141
|
+
onTouchCancel={[Function]}
|
|
142
|
+
onTouchEnd={[Function]}
|
|
143
|
+
onTouchMove={[Function]}
|
|
144
|
+
onTouchStart={[Function]}
|
|
145
|
+
type="checkbox"
|
|
146
|
+
/>
|
|
147
|
+
<div
|
|
148
|
+
aria-hidden={true}
|
|
149
|
+
checked={false}
|
|
150
|
+
className="c3"
|
|
151
|
+
>
|
|
152
|
+
<pixiv-icon
|
|
153
|
+
name="24/Check"
|
|
154
|
+
unsafe-non-guideline-scale={0.6666666666666666}
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
<div
|
|
159
|
+
className="c4"
|
|
160
|
+
>
|
|
161
|
+
同意する
|
|
162
|
+
</div>
|
|
163
|
+
</label>
|
|
164
|
+
`;
|
|
165
|
+
|
|
166
|
+
exports[`using dark theme storiesOf(index.story.tsx).add(Labelled) snapshot 1`] = `
|
|
167
|
+
.c0 {
|
|
168
|
+
position: relative;
|
|
169
|
+
display: -webkit-box;
|
|
170
|
+
display: -webkit-flex;
|
|
171
|
+
display: -ms-flexbox;
|
|
172
|
+
display: flex;
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
gap: 4px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.c0:disabled,
|
|
178
|
+
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
179
|
+
cursor: default;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.c0:disabled,
|
|
183
|
+
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
184
|
+
opacity: 0.32;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.c1 {
|
|
188
|
+
position: relative;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.c2[type='checkbox'] {
|
|
192
|
+
-webkit-appearance: none;
|
|
193
|
+
-moz-appearance: none;
|
|
194
|
+
appearance: none;
|
|
195
|
+
display: block;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
margin: 0;
|
|
198
|
+
width: 20px;
|
|
199
|
+
height: 20px;
|
|
200
|
+
border-radius: 4px;
|
|
201
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
202
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.c2[type='checkbox']:checked {
|
|
206
|
+
background-color: var(--charcoal-brand);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
|
|
210
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:hover {
|
|
211
|
+
background-color: var(--charcoal-brand-hover);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
|
|
215
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:active {
|
|
216
|
+
background-color: var(--charcoal-brand-press);
|
|
64
217
|
}
|
|
65
218
|
|
|
66
219
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
|
|
67
|
-
.c2[type='checkbox'][aria-disabled=false]:focus,
|
|
220
|
+
.c2[type='checkbox'][aria-disabled='false']:focus,
|
|
68
221
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active,
|
|
69
|
-
.c2[type='checkbox'][aria-disabled=false]:active {
|
|
222
|
+
.c2[type='checkbox'][aria-disabled='false']:active {
|
|
70
223
|
outline: none;
|
|
71
224
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
72
225
|
}
|
|
73
226
|
|
|
74
227
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
|
|
75
|
-
.c2[type='checkbox'][aria-disabled=false]:focus:not(:focus-visible),
|
|
228
|
+
.c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible),
|
|
76
229
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
|
|
77
|
-
.c2[type='checkbox'][aria-disabled=false]:active:not(:focus-visible) {
|
|
230
|
+
.c2[type='checkbox'][aria-disabled='false']:active:not(:focus-visible) {
|
|
78
231
|
outline: none;
|
|
79
232
|
}
|
|
80
233
|
|
|
81
234
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
|
|
82
|
-
.c2[type='checkbox'][aria-disabled=false]:focus-visible {
|
|
235
|
+
.c2[type='checkbox'][aria-disabled='false']:focus-visible {
|
|
83
236
|
outline: none;
|
|
84
237
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
85
238
|
}
|
|
86
239
|
|
|
240
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
|
|
241
|
+
.c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
|
|
242
|
+
box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.c2[type='checkbox']:not(:checked) {
|
|
246
|
+
border-width: 2px;
|
|
247
|
+
border-style: solid;
|
|
248
|
+
border-color: var(--charcoal-text4);
|
|
249
|
+
}
|
|
250
|
+
|
|
87
251
|
.c3 {
|
|
88
252
|
position: absolute;
|
|
89
253
|
top: -2px;
|
|
@@ -245,7 +409,7 @@ exports[`using dark theme storiesOf(index.story.tsx).add(Unlabelled) snapshot 1`
|
|
|
245
409
|
}
|
|
246
410
|
|
|
247
411
|
.c0:disabled,
|
|
248
|
-
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
412
|
+
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
249
413
|
opacity: 0.32;
|
|
250
414
|
}
|
|
251
415
|
|
|
@@ -263,55 +427,56 @@ exports[`using dark theme storiesOf(index.story.tsx).add(Unlabelled) snapshot 1`
|
|
|
263
427
|
width: 20px;
|
|
264
428
|
height: 20px;
|
|
265
429
|
border-radius: 4px;
|
|
266
|
-
-webkit-transition: 0.2s box-shadow;
|
|
267
|
-
transition: 0.2s box-shadow;
|
|
268
|
-
-webkit-transition: all 0.2s !important;
|
|
269
|
-
transition: all 0.2s !important;
|
|
430
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
431
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
270
432
|
}
|
|
271
433
|
|
|
272
434
|
.c2[type='checkbox']:checked {
|
|
273
435
|
background-color: var(--charcoal-brand);
|
|
274
|
-
-webkit-transition: 0.2s background-color;
|
|
275
|
-
transition: 0.2s background-color;
|
|
276
436
|
}
|
|
277
437
|
|
|
278
|
-
.c2[type='checkbox']:checked:
|
|
279
|
-
.c2[type='checkbox']:checked
|
|
438
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
|
|
439
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:hover {
|
|
280
440
|
background-color: var(--charcoal-brand-hover);
|
|
281
441
|
}
|
|
282
442
|
|
|
283
|
-
.c2[type='checkbox']:checked:
|
|
284
|
-
.c2[type='checkbox']:checked
|
|
443
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
|
|
444
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:active {
|
|
285
445
|
background-color: var(--charcoal-brand-press);
|
|
286
446
|
}
|
|
287
447
|
|
|
288
|
-
.c2[type='checkbox']:not(:checked) {
|
|
289
|
-
border-width: 2px;
|
|
290
|
-
border-style: solid;
|
|
291
|
-
border-color: #5c5c5c;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
448
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
|
|
295
|
-
.c2[type='checkbox'][aria-disabled=false]:focus,
|
|
449
|
+
.c2[type='checkbox'][aria-disabled='false']:focus,
|
|
296
450
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active,
|
|
297
|
-
.c2[type='checkbox'][aria-disabled=false]:active {
|
|
451
|
+
.c2[type='checkbox'][aria-disabled='false']:active {
|
|
298
452
|
outline: none;
|
|
299
453
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
300
454
|
}
|
|
301
455
|
|
|
302
456
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
|
|
303
|
-
.c2[type='checkbox'][aria-disabled=false]:focus:not(:focus-visible),
|
|
457
|
+
.c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible),
|
|
304
458
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
|
|
305
|
-
.c2[type='checkbox'][aria-disabled=false]:active:not(:focus-visible) {
|
|
459
|
+
.c2[type='checkbox'][aria-disabled='false']:active:not(:focus-visible) {
|
|
306
460
|
outline: none;
|
|
307
461
|
}
|
|
308
462
|
|
|
309
463
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
|
|
310
|
-
.c2[type='checkbox'][aria-disabled=false]:focus-visible {
|
|
464
|
+
.c2[type='checkbox'][aria-disabled='false']:focus-visible {
|
|
311
465
|
outline: none;
|
|
312
466
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
313
467
|
}
|
|
314
468
|
|
|
469
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
|
|
470
|
+
.c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
|
|
471
|
+
box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.c2[type='checkbox']:not(:checked) {
|
|
475
|
+
border-width: 2px;
|
|
476
|
+
border-style: solid;
|
|
477
|
+
border-color: var(--charcoal-text4);
|
|
478
|
+
}
|
|
479
|
+
|
|
315
480
|
.c3 {
|
|
316
481
|
position: absolute;
|
|
317
482
|
top: -2px;
|
|
@@ -381,7 +546,7 @@ exports[`using dark theme storiesOf(index.story.tsx).add(Unlabelled) snapshot 1`
|
|
|
381
546
|
</div>
|
|
382
547
|
`;
|
|
383
548
|
|
|
384
|
-
exports[`using light theme storiesOf(index.story.tsx).add(
|
|
549
|
+
exports[`using light theme storiesOf(index.story.tsx).add(Invalid) snapshot 1`] = `
|
|
385
550
|
.c0 {
|
|
386
551
|
position: relative;
|
|
387
552
|
display: -webkit-box;
|
|
@@ -398,7 +563,7 @@ exports[`using light theme storiesOf(index.story.tsx).add(Labelled) snapshot 1`]
|
|
|
398
563
|
}
|
|
399
564
|
|
|
400
565
|
.c0:disabled,
|
|
401
|
-
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
566
|
+
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
402
567
|
opacity: 0.32;
|
|
403
568
|
}
|
|
404
569
|
|
|
@@ -416,55 +581,219 @@ exports[`using light theme storiesOf(index.story.tsx).add(Labelled) snapshot 1`]
|
|
|
416
581
|
width: 20px;
|
|
417
582
|
height: 20px;
|
|
418
583
|
border-radius: 4px;
|
|
419
|
-
-webkit-transition: 0.2s box-shadow;
|
|
420
|
-
transition: 0.2s box-shadow;
|
|
421
|
-
-webkit-transition: all 0.2s !important;
|
|
422
|
-
transition: all 0.2s !important;
|
|
584
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
585
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
423
586
|
}
|
|
424
587
|
|
|
425
588
|
.c2[type='checkbox']:checked {
|
|
426
589
|
background-color: var(--charcoal-brand);
|
|
427
|
-
-webkit-transition: 0.2s background-color;
|
|
428
|
-
transition: 0.2s background-color;
|
|
429
590
|
}
|
|
430
591
|
|
|
431
|
-
.c2[type='checkbox']:checked:
|
|
432
|
-
.c2[type='checkbox']:checked
|
|
592
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
|
|
593
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:hover {
|
|
433
594
|
background-color: var(--charcoal-brand-hover);
|
|
434
595
|
}
|
|
435
596
|
|
|
436
|
-
.c2[type='checkbox']:checked:
|
|
437
|
-
.c2[type='checkbox']:checked
|
|
597
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
|
|
598
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:active {
|
|
438
599
|
background-color: var(--charcoal-brand-press);
|
|
439
600
|
}
|
|
440
601
|
|
|
602
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
|
|
603
|
+
.c2[type='checkbox'][aria-disabled='false']:focus,
|
|
604
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active,
|
|
605
|
+
.c2[type='checkbox'][aria-disabled='false']:active {
|
|
606
|
+
outline: none;
|
|
607
|
+
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
|
|
611
|
+
.c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible),
|
|
612
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
|
|
613
|
+
.c2[type='checkbox'][aria-disabled='false']:active:not(:focus-visible) {
|
|
614
|
+
outline: none;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
|
|
618
|
+
.c2[type='checkbox'][aria-disabled='false']:focus-visible {
|
|
619
|
+
outline: none;
|
|
620
|
+
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
|
|
624
|
+
.c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
|
|
625
|
+
box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
|
|
626
|
+
}
|
|
627
|
+
|
|
441
628
|
.c2[type='checkbox']:not(:checked) {
|
|
442
629
|
border-width: 2px;
|
|
443
630
|
border-style: solid;
|
|
444
|
-
border-color:
|
|
631
|
+
border-color: var(--charcoal-text4);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.c3 {
|
|
635
|
+
position: absolute;
|
|
636
|
+
top: -2px;
|
|
637
|
+
left: -2px;
|
|
638
|
+
box-sizing: border-box;
|
|
639
|
+
display: -webkit-box;
|
|
640
|
+
display: -webkit-flex;
|
|
641
|
+
display: -ms-flexbox;
|
|
642
|
+
display: flex;
|
|
643
|
+
-webkit-align-items: center;
|
|
644
|
+
-webkit-box-align: center;
|
|
645
|
+
-ms-flex-align: center;
|
|
646
|
+
align-items: center;
|
|
647
|
+
-webkit-box-pack: center;
|
|
648
|
+
-webkit-justify-content: center;
|
|
649
|
+
-ms-flex-pack: center;
|
|
650
|
+
justify-content: center;
|
|
651
|
+
width: 24px;
|
|
652
|
+
height: 24px;
|
|
653
|
+
color: var(--charcoal-text5);
|
|
654
|
+
visibility: hidden;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.c4 {
|
|
658
|
+
color: var(--charcoal-text2);
|
|
659
|
+
font-size: 14px;
|
|
660
|
+
line-height: 20px;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
<label
|
|
664
|
+
aria-disabled={false}
|
|
665
|
+
className="c0"
|
|
666
|
+
>
|
|
667
|
+
<div
|
|
668
|
+
className="c1"
|
|
669
|
+
>
|
|
670
|
+
<input
|
|
671
|
+
aria-invalid={true}
|
|
672
|
+
checked={false}
|
|
673
|
+
className="c2"
|
|
674
|
+
disabled={false}
|
|
675
|
+
name="labelled"
|
|
676
|
+
onBlur={[Function]}
|
|
677
|
+
onChange={[Function]}
|
|
678
|
+
onClick={[Function]}
|
|
679
|
+
onDragStart={[Function]}
|
|
680
|
+
onFocus={[Function]}
|
|
681
|
+
onKeyDown={[Function]}
|
|
682
|
+
onKeyUp={[Function]}
|
|
683
|
+
onMouseDown={[Function]}
|
|
684
|
+
onMouseEnter={[Function]}
|
|
685
|
+
onMouseLeave={[Function]}
|
|
686
|
+
onMouseUp={[Function]}
|
|
687
|
+
onTouchCancel={[Function]}
|
|
688
|
+
onTouchEnd={[Function]}
|
|
689
|
+
onTouchMove={[Function]}
|
|
690
|
+
onTouchStart={[Function]}
|
|
691
|
+
type="checkbox"
|
|
692
|
+
/>
|
|
693
|
+
<div
|
|
694
|
+
aria-hidden={true}
|
|
695
|
+
checked={false}
|
|
696
|
+
className="c3"
|
|
697
|
+
>
|
|
698
|
+
<pixiv-icon
|
|
699
|
+
name="24/Check"
|
|
700
|
+
unsafe-non-guideline-scale={0.6666666666666666}
|
|
701
|
+
/>
|
|
702
|
+
</div>
|
|
703
|
+
</div>
|
|
704
|
+
<div
|
|
705
|
+
className="c4"
|
|
706
|
+
>
|
|
707
|
+
同意する
|
|
708
|
+
</div>
|
|
709
|
+
</label>
|
|
710
|
+
`;
|
|
711
|
+
|
|
712
|
+
exports[`using light theme storiesOf(index.story.tsx).add(Labelled) snapshot 1`] = `
|
|
713
|
+
.c0 {
|
|
714
|
+
position: relative;
|
|
715
|
+
display: -webkit-box;
|
|
716
|
+
display: -webkit-flex;
|
|
717
|
+
display: -ms-flexbox;
|
|
718
|
+
display: flex;
|
|
719
|
+
cursor: pointer;
|
|
720
|
+
gap: 4px;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
.c0:disabled,
|
|
724
|
+
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
725
|
+
cursor: default;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.c0:disabled,
|
|
729
|
+
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
730
|
+
opacity: 0.32;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.c1 {
|
|
734
|
+
position: relative;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.c2[type='checkbox'] {
|
|
738
|
+
-webkit-appearance: none;
|
|
739
|
+
-moz-appearance: none;
|
|
740
|
+
appearance: none;
|
|
741
|
+
display: block;
|
|
742
|
+
cursor: pointer;
|
|
743
|
+
margin: 0;
|
|
744
|
+
width: 20px;
|
|
745
|
+
height: 20px;
|
|
746
|
+
border-radius: 4px;
|
|
747
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
748
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.c2[type='checkbox']:checked {
|
|
752
|
+
background-color: var(--charcoal-brand);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
|
|
756
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:hover {
|
|
757
|
+
background-color: var(--charcoal-brand-hover);
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
|
|
761
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:active {
|
|
762
|
+
background-color: var(--charcoal-brand-press);
|
|
445
763
|
}
|
|
446
764
|
|
|
447
765
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
|
|
448
|
-
.c2[type='checkbox'][aria-disabled=false]:focus,
|
|
766
|
+
.c2[type='checkbox'][aria-disabled='false']:focus,
|
|
449
767
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active,
|
|
450
|
-
.c2[type='checkbox'][aria-disabled=false]:active {
|
|
768
|
+
.c2[type='checkbox'][aria-disabled='false']:active {
|
|
451
769
|
outline: none;
|
|
452
770
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
453
771
|
}
|
|
454
772
|
|
|
455
773
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
|
|
456
|
-
.c2[type='checkbox'][aria-disabled=false]:focus:not(:focus-visible),
|
|
774
|
+
.c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible),
|
|
457
775
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
|
|
458
|
-
.c2[type='checkbox'][aria-disabled=false]:active:not(:focus-visible) {
|
|
776
|
+
.c2[type='checkbox'][aria-disabled='false']:active:not(:focus-visible) {
|
|
459
777
|
outline: none;
|
|
460
778
|
}
|
|
461
779
|
|
|
462
780
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
|
|
463
|
-
.c2[type='checkbox'][aria-disabled=false]:focus-visible {
|
|
781
|
+
.c2[type='checkbox'][aria-disabled='false']:focus-visible {
|
|
464
782
|
outline: none;
|
|
465
783
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
466
784
|
}
|
|
467
785
|
|
|
786
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
|
|
787
|
+
.c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
|
|
788
|
+
box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.c2[type='checkbox']:not(:checked) {
|
|
792
|
+
border-width: 2px;
|
|
793
|
+
border-style: solid;
|
|
794
|
+
border-color: var(--charcoal-text4);
|
|
795
|
+
}
|
|
796
|
+
|
|
468
797
|
.c3 {
|
|
469
798
|
position: absolute;
|
|
470
799
|
top: -2px;
|
|
@@ -626,7 +955,7 @@ exports[`using light theme storiesOf(index.story.tsx).add(Unlabelled) snapshot 1
|
|
|
626
955
|
}
|
|
627
956
|
|
|
628
957
|
.c0:disabled,
|
|
629
|
-
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
958
|
+
.c0[aria-disabled]:not([aria-disabled='false']) {
|
|
630
959
|
opacity: 0.32;
|
|
631
960
|
}
|
|
632
961
|
|
|
@@ -644,55 +973,56 @@ exports[`using light theme storiesOf(index.story.tsx).add(Unlabelled) snapshot 1
|
|
|
644
973
|
width: 20px;
|
|
645
974
|
height: 20px;
|
|
646
975
|
border-radius: 4px;
|
|
647
|
-
-webkit-transition: 0.2s box-shadow;
|
|
648
|
-
transition: 0.2s box-shadow;
|
|
649
|
-
-webkit-transition: all 0.2s !important;
|
|
650
|
-
transition: all 0.2s !important;
|
|
976
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
977
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
651
978
|
}
|
|
652
979
|
|
|
653
980
|
.c2[type='checkbox']:checked {
|
|
654
981
|
background-color: var(--charcoal-brand);
|
|
655
|
-
-webkit-transition: 0.2s background-color;
|
|
656
|
-
transition: 0.2s background-color;
|
|
657
982
|
}
|
|
658
983
|
|
|
659
|
-
.c2[type='checkbox']:checked:
|
|
660
|
-
.c2[type='checkbox']:checked
|
|
984
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):hover,
|
|
985
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:hover {
|
|
661
986
|
background-color: var(--charcoal-brand-hover);
|
|
662
987
|
}
|
|
663
988
|
|
|
664
|
-
.c2[type='checkbox']:checked:
|
|
665
|
-
.c2[type='checkbox']:checked
|
|
989
|
+
.c2[type='checkbox']:checked:not(:disabled):not([aria-disabled]):active,
|
|
990
|
+
.c2[type='checkbox']:checked[aria-disabled='false']:active {
|
|
666
991
|
background-color: var(--charcoal-brand-press);
|
|
667
992
|
}
|
|
668
993
|
|
|
669
|
-
.c2[type='checkbox']:not(:checked) {
|
|
670
|
-
border-width: 2px;
|
|
671
|
-
border-style: solid;
|
|
672
|
-
border-color: #adadad;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
994
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus,
|
|
676
|
-
.c2[type='checkbox'][aria-disabled=false]:focus,
|
|
995
|
+
.c2[type='checkbox'][aria-disabled='false']:focus,
|
|
677
996
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active,
|
|
678
|
-
.c2[type='checkbox'][aria-disabled=false]:active {
|
|
997
|
+
.c2[type='checkbox'][aria-disabled='false']:active {
|
|
679
998
|
outline: none;
|
|
680
999
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
681
1000
|
}
|
|
682
1001
|
|
|
683
1002
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus:not(:focus-visible),
|
|
684
|
-
.c2[type='checkbox'][aria-disabled=false]:focus:not(:focus-visible),
|
|
1003
|
+
.c2[type='checkbox'][aria-disabled='false']:focus:not(:focus-visible),
|
|
685
1004
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):active:not(:focus-visible),
|
|
686
|
-
.c2[type='checkbox'][aria-disabled=false]:active:not(:focus-visible) {
|
|
1005
|
+
.c2[type='checkbox'][aria-disabled='false']:active:not(:focus-visible) {
|
|
687
1006
|
outline: none;
|
|
688
1007
|
}
|
|
689
1008
|
|
|
690
1009
|
.c2[type='checkbox']:not(:disabled):not([aria-disabled]):focus-visible,
|
|
691
|
-
.c2[type='checkbox'][aria-disabled=false]:focus-visible {
|
|
1010
|
+
.c2[type='checkbox'][aria-disabled='false']:focus-visible {
|
|
692
1011
|
outline: none;
|
|
693
1012
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
694
1013
|
}
|
|
695
1014
|
|
|
1015
|
+
.c2[type='checkbox']:not(:disabled):not([aria-disabled])[aria-invalid='true'],
|
|
1016
|
+
.c2[type='checkbox'][aria-disabled='false'][aria-invalid='true'] {
|
|
1017
|
+
box-shadow: 0 0 0 4px rgba(255,43,0,0.32);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
.c2[type='checkbox']:not(:checked) {
|
|
1021
|
+
border-width: 2px;
|
|
1022
|
+
border-style: solid;
|
|
1023
|
+
border-color: var(--charcoal-text4);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
696
1026
|
.c3 {
|
|
697
1027
|
position: absolute;
|
|
698
1028
|
top: -2px;
|
|
@@ -60,6 +60,30 @@ Labelled.args = {
|
|
|
60
60
|
invalid: false,
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
export const Invalid: Story<Omit<Props, 'invalid'>> = (props) => {
|
|
64
|
+
return (
|
|
65
|
+
<Checkbox
|
|
66
|
+
{...props}
|
|
67
|
+
name="labelled"
|
|
68
|
+
label="label"
|
|
69
|
+
invalid
|
|
70
|
+
onBlur={action('blur')}
|
|
71
|
+
onClick={action('click')}
|
|
72
|
+
onChange={action('change')}
|
|
73
|
+
onFocus={action('focus')}
|
|
74
|
+
>
|
|
75
|
+
同意する
|
|
76
|
+
</Checkbox>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Invalid.args = {
|
|
81
|
+
checked: false,
|
|
82
|
+
defaultChecked: false,
|
|
83
|
+
disabled: false,
|
|
84
|
+
readonly: false,
|
|
85
|
+
}
|
|
86
|
+
|
|
63
87
|
export const Unlabelled: Story<Props> = (props) => {
|
|
64
88
|
return (
|
|
65
89
|
<div>
|