@charcoal-ui/react 3.6.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_lib/compat.d.ts +1 -0
- package/dist/_lib/compat.d.ts.map +1 -1
- package/dist/components/Button/StyledButton.d.ts +12 -0
- package/dist/components/Button/StyledButton.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/lib/variantToBackground.d.ts +3 -0
- package/dist/components/Button/lib/variantToBackground.d.ts.map +1 -0
- package/dist/components/Button/lib/variantToFont.d.ts +3 -0
- package/dist/components/Button/lib/variantToFont.d.ts.map +1 -0
- package/dist/components/Checkbox/index.story.d.ts +6 -16
- package/dist/components/Checkbox/index.story.d.ts.map +1 -1
- package/dist/components/Clickable/index.story.d.ts +4 -6
- package/dist/components/Clickable/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.story.d.ts +1 -0
- package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
- package/dist/components/Icon/index.story.d.ts +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts.map +1 -1
- package/dist/index.cjs.js +341 -123
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +310 -92
- package/dist/index.esm.js.map +1 -1
- package/package.json +17 -20
- package/src/_lib/compat.ts +8 -0
- package/src/components/Button/StyledButton.tsx +66 -0
- package/src/components/Button/index.tsx +12 -104
- package/src/components/Button/lib/variantToBackground.tsx +19 -0
- package/src/components/Button/lib/variantToFont.tsx +19 -0
- package/src/components/Checkbox/index.story.tsx +82 -88
- package/src/components/Clickable/index.story.tsx +12 -9
- package/src/components/DropdownSelector/DropdownMenuItem.tsx +1 -14
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +173 -109
- package/src/components/DropdownSelector/index.story.tsx +33 -0
- package/src/components/DropdownSelector/index.tsx +8 -15
- package/src/components/Modal/__snapshots__/index.story.storyshot +19 -23
- package/src/components/SegmentedControl/RadioGroupContext.tsx +1 -1
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +9 -9
- package/src/components/SegmentedControl/index.tsx +1 -1
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +17 -15
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +21 -20
- package/dist/components/Checkbox/performance.test.d.ts +0 -4
- package/dist/components/Checkbox/performance.test.d.ts.map +0 -1
- package/dist/components/Checkbox/snapshot.test.d.ts +0 -2
- package/dist/components/Checkbox/snapshot.test.d.ts.map +0 -1
- package/src/components/Checkbox/__snapshots__/snapshot.test.tsx.snap +0 -1093
- package/src/components/Checkbox/performance.test.tsx +0 -30
- package/src/components/Checkbox/snapshot.test.tsx +0 -66
|
@@ -30,12 +30,13 @@ exports[`Storyshots DropdownSelector Basic 1`] = `
|
|
|
30
30
|
box-sizing: border-box;
|
|
31
31
|
border: none;
|
|
32
32
|
cursor: pointer;
|
|
33
|
+
gap: 4px;
|
|
33
34
|
padding-right: 8px;
|
|
34
35
|
padding-left: 8px;
|
|
35
36
|
background-color: var(--charcoal-surface3);
|
|
36
37
|
border-radius: 4px;
|
|
37
|
-
-webkit-transition: 0.2s box-shadow;
|
|
38
|
-
transition: 0.2s box-shadow;
|
|
38
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
39
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
.c1:disabled,
|
|
@@ -53,28 +54,20 @@ exports[`Storyshots DropdownSelector Basic 1`] = `
|
|
|
53
54
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
.c1:not(:disabled):not([aria-disabled]):hover,
|
|
58
|
+
.c1[aria-disabled='false']:hover {
|
|
59
|
+
background-color: var(--charcoal-surface3-hover);
|
|
60
|
+
}
|
|
61
|
+
|
|
56
62
|
.c2 {
|
|
57
63
|
text-align: left;
|
|
58
64
|
font-size: 14px;
|
|
59
65
|
line-height: 22px;
|
|
60
66
|
display: flow-root;
|
|
61
67
|
color: var(--charcoal-text2);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
display: block;
|
|
66
|
-
width: 0;
|
|
67
|
-
height: 0;
|
|
68
|
-
content: '';
|
|
69
|
-
margin-top: -4px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.c2::after {
|
|
73
|
-
display: block;
|
|
74
|
-
width: 0;
|
|
75
|
-
height: 0;
|
|
76
|
-
content: '';
|
|
77
|
-
margin-bottom: -4px;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
text-overflow: ellipsis;
|
|
70
|
+
white-space: nowrap;
|
|
78
71
|
}
|
|
79
72
|
|
|
80
73
|
.c3 {
|
|
@@ -144,12 +137,13 @@ exports[`Storyshots DropdownSelector Custom Children 1`] = `
|
|
|
144
137
|
box-sizing: border-box;
|
|
145
138
|
border: none;
|
|
146
139
|
cursor: pointer;
|
|
140
|
+
gap: 4px;
|
|
147
141
|
padding-right: 8px;
|
|
148
142
|
padding-left: 8px;
|
|
149
143
|
background-color: var(--charcoal-surface3);
|
|
150
144
|
border-radius: 4px;
|
|
151
|
-
-webkit-transition: 0.2s box-shadow;
|
|
152
|
-
transition: 0.2s box-shadow;
|
|
145
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
146
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
153
147
|
}
|
|
154
148
|
|
|
155
149
|
.c1:disabled,
|
|
@@ -167,28 +161,20 @@ exports[`Storyshots DropdownSelector Custom Children 1`] = `
|
|
|
167
161
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
168
162
|
}
|
|
169
163
|
|
|
164
|
+
.c1:not(:disabled):not([aria-disabled]):hover,
|
|
165
|
+
.c1[aria-disabled='false']:hover {
|
|
166
|
+
background-color: var(--charcoal-surface3-hover);
|
|
167
|
+
}
|
|
168
|
+
|
|
170
169
|
.c2 {
|
|
171
170
|
text-align: left;
|
|
172
171
|
font-size: 14px;
|
|
173
172
|
line-height: 22px;
|
|
174
173
|
display: flow-root;
|
|
175
174
|
color: var(--charcoal-text2);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
display: block;
|
|
180
|
-
width: 0;
|
|
181
|
-
height: 0;
|
|
182
|
-
content: '';
|
|
183
|
-
margin-top: -4px;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.c2::after {
|
|
187
|
-
display: block;
|
|
188
|
-
width: 0;
|
|
189
|
-
height: 0;
|
|
190
|
-
content: '';
|
|
191
|
-
margin-bottom: -4px;
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
text-overflow: ellipsis;
|
|
177
|
+
white-space: nowrap;
|
|
192
178
|
}
|
|
193
179
|
|
|
194
180
|
.c3 {
|
|
@@ -267,12 +253,13 @@ exports[`Storyshots DropdownSelector In Form Tag 1`] = `
|
|
|
267
253
|
box-sizing: border-box;
|
|
268
254
|
border: none;
|
|
269
255
|
cursor: pointer;
|
|
256
|
+
gap: 4px;
|
|
270
257
|
padding-right: 8px;
|
|
271
258
|
padding-left: 8px;
|
|
272
259
|
background-color: var(--charcoal-surface3);
|
|
273
260
|
border-radius: 4px;
|
|
274
|
-
-webkit-transition: 0.2s box-shadow;
|
|
275
|
-
transition: 0.2s box-shadow;
|
|
261
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
262
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
276
263
|
}
|
|
277
264
|
|
|
278
265
|
.c1:disabled,
|
|
@@ -290,28 +277,20 @@ exports[`Storyshots DropdownSelector In Form Tag 1`] = `
|
|
|
290
277
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
291
278
|
}
|
|
292
279
|
|
|
280
|
+
.c1:not(:disabled):not([aria-disabled]):hover,
|
|
281
|
+
.c1[aria-disabled='false']:hover {
|
|
282
|
+
background-color: var(--charcoal-surface3-hover);
|
|
283
|
+
}
|
|
284
|
+
|
|
293
285
|
.c2 {
|
|
294
286
|
text-align: left;
|
|
295
287
|
font-size: 14px;
|
|
296
288
|
line-height: 22px;
|
|
297
289
|
display: flow-root;
|
|
298
290
|
color: var(--charcoal-text2);
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
display: block;
|
|
303
|
-
width: 0;
|
|
304
|
-
height: 0;
|
|
305
|
-
content: '';
|
|
306
|
-
margin-top: -4px;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.c2::after {
|
|
310
|
-
display: block;
|
|
311
|
-
width: 0;
|
|
312
|
-
height: 0;
|
|
313
|
-
content: '';
|
|
314
|
-
margin-bottom: -4px;
|
|
291
|
+
overflow: hidden;
|
|
292
|
+
text-overflow: ellipsis;
|
|
293
|
+
white-space: nowrap;
|
|
315
294
|
}
|
|
316
295
|
|
|
317
296
|
.c3 {
|
|
@@ -417,12 +396,13 @@ exports[`Storyshots DropdownSelector In Modal 1`] = `
|
|
|
417
396
|
box-sizing: border-box;
|
|
418
397
|
border: none;
|
|
419
398
|
cursor: pointer;
|
|
399
|
+
gap: 4px;
|
|
420
400
|
padding-right: 8px;
|
|
421
401
|
padding-left: 8px;
|
|
422
402
|
background-color: var(--charcoal-surface3);
|
|
423
403
|
border-radius: 4px;
|
|
424
|
-
-webkit-transition: 0.2s box-shadow;
|
|
425
|
-
transition: 0.2s box-shadow;
|
|
404
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
405
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
426
406
|
}
|
|
427
407
|
|
|
428
408
|
.c8:disabled,
|
|
@@ -440,28 +420,20 @@ exports[`Storyshots DropdownSelector In Modal 1`] = `
|
|
|
440
420
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
441
421
|
}
|
|
442
422
|
|
|
423
|
+
.c8:not(:disabled):not([aria-disabled]):hover,
|
|
424
|
+
.c8[aria-disabled='false']:hover {
|
|
425
|
+
background-color: var(--charcoal-surface3-hover);
|
|
426
|
+
}
|
|
427
|
+
|
|
443
428
|
.c9 {
|
|
444
429
|
text-align: left;
|
|
445
430
|
font-size: 14px;
|
|
446
431
|
line-height: 22px;
|
|
447
432
|
display: flow-root;
|
|
448
433
|
color: var(--charcoal-text2);
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
display: block;
|
|
453
|
-
width: 0;
|
|
454
|
-
height: 0;
|
|
455
|
-
content: '';
|
|
456
|
-
margin-top: -4px;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.c9::after {
|
|
460
|
-
display: block;
|
|
461
|
-
width: 0;
|
|
462
|
-
height: 0;
|
|
463
|
-
content: '';
|
|
464
|
-
margin-bottom: -4px;
|
|
434
|
+
overflow: hidden;
|
|
435
|
+
text-overflow: ellipsis;
|
|
436
|
+
white-space: nowrap;
|
|
465
437
|
}
|
|
466
438
|
|
|
467
439
|
.c10 {
|
|
@@ -685,7 +657,6 @@ exports[`Storyshots DropdownSelector In Modal 1`] = `
|
|
|
685
657
|
<div
|
|
686
658
|
className="c1"
|
|
687
659
|
onBlur={[Function]}
|
|
688
|
-
onFocus={null}
|
|
689
660
|
onKeyDown={[Function]}
|
|
690
661
|
role="dialog"
|
|
691
662
|
size="M"
|
|
@@ -780,6 +751,113 @@ exports[`Storyshots DropdownSelector In Modal 1`] = `
|
|
|
780
751
|
</div>
|
|
781
752
|
`;
|
|
782
753
|
|
|
754
|
+
exports[`Storyshots DropdownSelector Long Names 1`] = `
|
|
755
|
+
.c0 {
|
|
756
|
+
display: inline-block;
|
|
757
|
+
width: 100%;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.c0:disabled,
|
|
761
|
+
.c0[aria-disabled]:not([aria-disabled=false]) {
|
|
762
|
+
cursor: default;
|
|
763
|
+
opacity: 0.32;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
.c1 {
|
|
767
|
+
display: -webkit-box;
|
|
768
|
+
display: -webkit-flex;
|
|
769
|
+
display: -ms-flexbox;
|
|
770
|
+
display: flex;
|
|
771
|
+
-webkit-box-pack: justify;
|
|
772
|
+
-webkit-justify-content: space-between;
|
|
773
|
+
-ms-flex-pack: justify;
|
|
774
|
+
justify-content: space-between;
|
|
775
|
+
-webkit-align-items: center;
|
|
776
|
+
-webkit-box-align: center;
|
|
777
|
+
-ms-flex-align: center;
|
|
778
|
+
align-items: center;
|
|
779
|
+
height: 40px;
|
|
780
|
+
width: 100%;
|
|
781
|
+
box-sizing: border-box;
|
|
782
|
+
border: none;
|
|
783
|
+
cursor: pointer;
|
|
784
|
+
gap: 4px;
|
|
785
|
+
padding-right: 8px;
|
|
786
|
+
padding-left: 8px;
|
|
787
|
+
background-color: var(--charcoal-surface3);
|
|
788
|
+
border-radius: 4px;
|
|
789
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
790
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.c1:disabled,
|
|
794
|
+
.c1[aria-disabled]:not([aria-disabled=false]) {
|
|
795
|
+
cursor: default;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.c1:not(:disabled):not([aria-disabled]):focus,
|
|
799
|
+
.c1[aria-disabled='false']:focus,
|
|
800
|
+
.c1:not(:disabled):not([aria-disabled]):active,
|
|
801
|
+
.c1[aria-disabled='false']:active,
|
|
802
|
+
.c1:not(:disabled):not([aria-disabled]):focus-visible,
|
|
803
|
+
.c1[aria-disabled='false']:focus-visible {
|
|
804
|
+
outline: none;
|
|
805
|
+
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.c1:not(:disabled):not([aria-disabled]):hover,
|
|
809
|
+
.c1[aria-disabled='false']:hover {
|
|
810
|
+
background-color: var(--charcoal-surface3-hover);
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.c2 {
|
|
814
|
+
text-align: left;
|
|
815
|
+
font-size: 14px;
|
|
816
|
+
line-height: 22px;
|
|
817
|
+
display: flow-root;
|
|
818
|
+
color: var(--charcoal-text2);
|
|
819
|
+
overflow: hidden;
|
|
820
|
+
text-overflow: ellipsis;
|
|
821
|
+
white-space: nowrap;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
.c3 {
|
|
825
|
+
color: var(--charcoal-text2);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
<div
|
|
829
|
+
data-dark={false}
|
|
830
|
+
>
|
|
831
|
+
<div
|
|
832
|
+
style={
|
|
833
|
+
Object {
|
|
834
|
+
"width": 288,
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
>
|
|
838
|
+
<div
|
|
839
|
+
className="c0"
|
|
840
|
+
>
|
|
841
|
+
<button
|
|
842
|
+
className="c1"
|
|
843
|
+
onClick={[Function]}
|
|
844
|
+
type="button"
|
|
845
|
+
>
|
|
846
|
+
<span
|
|
847
|
+
className="c2"
|
|
848
|
+
>
|
|
849
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
|
|
850
|
+
</span>
|
|
851
|
+
<pixiv-icon
|
|
852
|
+
class="c3"
|
|
853
|
+
name="16/Menu"
|
|
854
|
+
/>
|
|
855
|
+
</button>
|
|
856
|
+
</div>
|
|
857
|
+
</div>
|
|
858
|
+
</div>
|
|
859
|
+
`;
|
|
860
|
+
|
|
783
861
|
exports[`Storyshots DropdownSelector Playground 1`] = `
|
|
784
862
|
.c0 {
|
|
785
863
|
cursor: pointer;
|
|
@@ -907,12 +985,13 @@ exports[`Storyshots DropdownSelector Playground 1`] = `
|
|
|
907
985
|
box-sizing: border-box;
|
|
908
986
|
border: none;
|
|
909
987
|
cursor: pointer;
|
|
988
|
+
gap: 4px;
|
|
910
989
|
padding-right: 8px;
|
|
911
990
|
padding-left: 8px;
|
|
912
991
|
background-color: var(--charcoal-surface3);
|
|
913
992
|
border-radius: 4px;
|
|
914
|
-
-webkit-transition: 0.2s box-shadow;
|
|
915
|
-
transition: 0.2s box-shadow;
|
|
993
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
994
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
916
995
|
}
|
|
917
996
|
|
|
918
997
|
.c3:disabled,
|
|
@@ -930,28 +1009,20 @@ exports[`Storyshots DropdownSelector Playground 1`] = `
|
|
|
930
1009
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
931
1010
|
}
|
|
932
1011
|
|
|
1012
|
+
.c3:not(:disabled):not([aria-disabled]):hover,
|
|
1013
|
+
.c3[aria-disabled='false']:hover {
|
|
1014
|
+
background-color: var(--charcoal-surface3-hover);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
933
1017
|
.c4 {
|
|
934
1018
|
text-align: left;
|
|
935
1019
|
font-size: 14px;
|
|
936
1020
|
line-height: 22px;
|
|
937
1021
|
display: flow-root;
|
|
938
1022
|
color: var(--charcoal-text2);
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
display: block;
|
|
943
|
-
width: 0;
|
|
944
|
-
height: 0;
|
|
945
|
-
content: '';
|
|
946
|
-
margin-top: -4px;
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
.c4::after {
|
|
950
|
-
display: block;
|
|
951
|
-
width: 0;
|
|
952
|
-
height: 0;
|
|
953
|
-
content: '';
|
|
954
|
-
margin-bottom: -4px;
|
|
1023
|
+
overflow: hidden;
|
|
1024
|
+
text-overflow: ellipsis;
|
|
1025
|
+
white-space: nowrap;
|
|
955
1026
|
}
|
|
956
1027
|
|
|
957
1028
|
.c5 {
|
|
@@ -1025,12 +1096,13 @@ exports[`Storyshots DropdownSelector Section List 1`] = `
|
|
|
1025
1096
|
box-sizing: border-box;
|
|
1026
1097
|
border: none;
|
|
1027
1098
|
cursor: pointer;
|
|
1099
|
+
gap: 4px;
|
|
1028
1100
|
padding-right: 8px;
|
|
1029
1101
|
padding-left: 8px;
|
|
1030
1102
|
background-color: var(--charcoal-surface3);
|
|
1031
1103
|
border-radius: 4px;
|
|
1032
|
-
-webkit-transition: 0.2s box-shadow;
|
|
1033
|
-
transition: 0.2s box-shadow;
|
|
1104
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
1105
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
1034
1106
|
}
|
|
1035
1107
|
|
|
1036
1108
|
.c1:disabled,
|
|
@@ -1048,28 +1120,20 @@ exports[`Storyshots DropdownSelector Section List 1`] = `
|
|
|
1048
1120
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
1049
1121
|
}
|
|
1050
1122
|
|
|
1123
|
+
.c1:not(:disabled):not([aria-disabled]):hover,
|
|
1124
|
+
.c1[aria-disabled='false']:hover {
|
|
1125
|
+
background-color: var(--charcoal-surface3-hover);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1051
1128
|
.c2 {
|
|
1052
1129
|
text-align: left;
|
|
1053
1130
|
font-size: 14px;
|
|
1054
1131
|
line-height: 22px;
|
|
1055
1132
|
display: flow-root;
|
|
1056
1133
|
color: var(--charcoal-text2);
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
display: block;
|
|
1061
|
-
width: 0;
|
|
1062
|
-
height: 0;
|
|
1063
|
-
content: '';
|
|
1064
|
-
margin-top: -4px;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
.c2::after {
|
|
1068
|
-
display: block;
|
|
1069
|
-
width: 0;
|
|
1070
|
-
height: 0;
|
|
1071
|
-
content: '';
|
|
1072
|
-
margin-bottom: -4px;
|
|
1134
|
+
overflow: hidden;
|
|
1135
|
+
text-overflow: ellipsis;
|
|
1136
|
+
white-space: nowrap;
|
|
1073
1137
|
}
|
|
1074
1138
|
|
|
1075
1139
|
.c3 {
|
|
@@ -65,6 +65,39 @@ export const Basic: Story<DropdownSelectorProps> = (
|
|
|
65
65
|
|
|
66
66
|
Basic.args = { ...baseProps }
|
|
67
67
|
|
|
68
|
+
export const LongNames: Story<DropdownSelectorProps> = (
|
|
69
|
+
props: DropdownSelectorProps
|
|
70
|
+
) => {
|
|
71
|
+
const [selected, setSelected] = useState('10')
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
style={{
|
|
75
|
+
width: 288,
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<DropdownSelector
|
|
79
|
+
{...props}
|
|
80
|
+
onChange={(value) => {
|
|
81
|
+
setSelected(value)
|
|
82
|
+
}}
|
|
83
|
+
value={selected}
|
|
84
|
+
label="label"
|
|
85
|
+
>
|
|
86
|
+
<DropdownMenuItem value={'10'}>
|
|
87
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
|
|
88
|
+
</DropdownMenuItem>
|
|
89
|
+
<DropdownMenuItem value={'20'}>
|
|
90
|
+
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
91
|
+
</DropdownMenuItem>
|
|
92
|
+
<DropdownMenuItem value={'30'}>
|
|
93
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
94
|
+
nisi ut aliquip ex ea commodo consequat.
|
|
95
|
+
</DropdownMenuItem>
|
|
96
|
+
</DropdownSelector>
|
|
97
|
+
</div>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
68
101
|
function PlaygroundDropdownSelector(props: Partial<DropdownSelectorProps>) {
|
|
69
102
|
const [selected, setSelected] = useState('10')
|
|
70
103
|
return (
|
|
@@ -108,6 +108,7 @@ const DropdownButton = styled.button<{ invalid?: boolean }>`
|
|
|
108
108
|
box-sizing: border-box;
|
|
109
109
|
border: none;
|
|
110
110
|
cursor: pointer;
|
|
111
|
+
gap: 4px;
|
|
111
112
|
|
|
112
113
|
${disabledSelector} {
|
|
113
114
|
cursor: default;
|
|
@@ -118,7 +119,7 @@ const DropdownButton = styled.button<{ invalid?: boolean }>`
|
|
|
118
119
|
background-color: var(--charcoal-surface3);
|
|
119
120
|
border-radius: 4px;
|
|
120
121
|
|
|
121
|
-
transition: 0.2s box-shadow;
|
|
122
|
+
transition: 0.2s box-shadow, 0.2s background-color;
|
|
122
123
|
|
|
123
124
|
&:not(:disabled):not([aria-disabled]),
|
|
124
125
|
&[aria-disabled='false'] {
|
|
@@ -128,6 +129,9 @@ const DropdownButton = styled.button<{ invalid?: boolean }>`
|
|
|
128
129
|
outline: none;
|
|
129
130
|
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
130
131
|
}
|
|
132
|
+
&:hover {
|
|
133
|
+
background-color: var(--charcoal-surface3-hover);
|
|
134
|
+
}
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
${({ invalid }) =>
|
|
@@ -146,20 +150,9 @@ const DropdownButtonText = styled.span`
|
|
|
146
150
|
line-height: 22px;
|
|
147
151
|
display: flow-root;
|
|
148
152
|
color: var(--charcoal-text2);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
height: 0;
|
|
153
|
-
content: '';
|
|
154
|
-
margin-top: -4px;
|
|
155
|
-
}
|
|
156
|
-
&::after {
|
|
157
|
-
display: block;
|
|
158
|
-
width: 0;
|
|
159
|
-
height: 0;
|
|
160
|
-
content: '';
|
|
161
|
-
margin-bottom: -4px;
|
|
162
|
-
}
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
white-space: nowrap;
|
|
163
156
|
`
|
|
164
157
|
|
|
165
158
|
const DropdownButtonIcon = styled(Icon)`
|
|
@@ -456,7 +456,6 @@ exports[`Storyshots Modal Bottom Sheet 1`] = `
|
|
|
456
456
|
<div
|
|
457
457
|
className="c3"
|
|
458
458
|
onBlur={[Function]}
|
|
459
|
-
onFocus={null}
|
|
460
459
|
onKeyDown={[Function]}
|
|
461
460
|
role="dialog"
|
|
462
461
|
size="M"
|
|
@@ -851,12 +850,13 @@ exports[`Storyshots Modal Default 1`] = `
|
|
|
851
850
|
box-sizing: border-box;
|
|
852
851
|
border: none;
|
|
853
852
|
cursor: pointer;
|
|
853
|
+
gap: 4px;
|
|
854
854
|
padding-right: 8px;
|
|
855
855
|
padding-left: 8px;
|
|
856
856
|
background-color: var(--charcoal-surface3);
|
|
857
857
|
border-radius: 4px;
|
|
858
|
-
-webkit-transition: 0.2s box-shadow;
|
|
859
|
-
transition: 0.2s box-shadow;
|
|
858
|
+
-webkit-transition: 0.2s box-shadow,0.2s background-color;
|
|
859
|
+
transition: 0.2s box-shadow,0.2s background-color;
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
.c21:disabled,
|
|
@@ -874,28 +874,20 @@ exports[`Storyshots Modal Default 1`] = `
|
|
|
874
874
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
875
875
|
}
|
|
876
876
|
|
|
877
|
+
.c21:not(:disabled):not([aria-disabled]):hover,
|
|
878
|
+
.c21[aria-disabled='false']:hover {
|
|
879
|
+
background-color: var(--charcoal-surface3-hover);
|
|
880
|
+
}
|
|
881
|
+
|
|
877
882
|
.c22 {
|
|
878
883
|
text-align: left;
|
|
879
884
|
font-size: 14px;
|
|
880
885
|
line-height: 22px;
|
|
881
886
|
display: flow-root;
|
|
882
887
|
color: var(--charcoal-text2);
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
display: block;
|
|
887
|
-
width: 0;
|
|
888
|
-
height: 0;
|
|
889
|
-
content: '';
|
|
890
|
-
margin-top: -4px;
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
.c22::after {
|
|
894
|
-
display: block;
|
|
895
|
-
width: 0;
|
|
896
|
-
height: 0;
|
|
897
|
-
content: '';
|
|
898
|
-
margin-bottom: -4px;
|
|
888
|
+
overflow: hidden;
|
|
889
|
+
text-overflow: ellipsis;
|
|
890
|
+
white-space: nowrap;
|
|
899
891
|
}
|
|
900
892
|
|
|
901
893
|
.c23 {
|
|
@@ -1220,7 +1212,6 @@ exports[`Storyshots Modal Default 1`] = `
|
|
|
1220
1212
|
<div
|
|
1221
1213
|
className="c3"
|
|
1222
1214
|
onBlur={[Function]}
|
|
1223
|
-
onFocus={null}
|
|
1224
1215
|
onKeyDown={[Function]}
|
|
1225
1216
|
role="dialog"
|
|
1226
1217
|
size="M"
|
|
@@ -1280,7 +1271,9 @@ exports[`Storyshots Modal Default 1`] = `
|
|
|
1280
1271
|
onChange={[Function]}
|
|
1281
1272
|
placeholder="Nagisa"
|
|
1282
1273
|
readOnly={false}
|
|
1274
|
+
required={false}
|
|
1283
1275
|
type="text"
|
|
1276
|
+
value=""
|
|
1284
1277
|
/>
|
|
1285
1278
|
</div>
|
|
1286
1279
|
</div>
|
|
@@ -1318,7 +1311,9 @@ exports[`Storyshots Modal Default 1`] = `
|
|
|
1318
1311
|
onChange={[Function]}
|
|
1319
1312
|
placeholder="Tokyo"
|
|
1320
1313
|
readOnly={false}
|
|
1314
|
+
required={false}
|
|
1321
1315
|
type="text"
|
|
1316
|
+
value=""
|
|
1322
1317
|
/>
|
|
1323
1318
|
</div>
|
|
1324
1319
|
</div>
|
|
@@ -2021,7 +2016,6 @@ exports[`Storyshots Modal Full Bottom Sheet 1`] = `
|
|
|
2021
2016
|
<div
|
|
2022
2017
|
className="c3"
|
|
2023
2018
|
onBlur={[Function]}
|
|
2024
|
-
onFocus={null}
|
|
2025
2019
|
onKeyDown={[Function]}
|
|
2026
2020
|
role="dialog"
|
|
2027
2021
|
size="M"
|
|
@@ -2081,7 +2075,9 @@ exports[`Storyshots Modal Full Bottom Sheet 1`] = `
|
|
|
2081
2075
|
onChange={[Function]}
|
|
2082
2076
|
placeholder="Nagisa"
|
|
2083
2077
|
readOnly={false}
|
|
2078
|
+
required={false}
|
|
2084
2079
|
type="text"
|
|
2080
|
+
value=""
|
|
2085
2081
|
/>
|
|
2086
2082
|
</div>
|
|
2087
2083
|
</div>
|
|
@@ -2119,7 +2115,9 @@ exports[`Storyshots Modal Full Bottom Sheet 1`] = `
|
|
|
2119
2115
|
onChange={[Function]}
|
|
2120
2116
|
placeholder="Tokyo"
|
|
2121
2117
|
readOnly={false}
|
|
2118
|
+
required={false}
|
|
2122
2119
|
type="text"
|
|
2120
|
+
value=""
|
|
2123
2121
|
/>
|
|
2124
2122
|
</div>
|
|
2125
2123
|
</div>
|
|
@@ -2464,7 +2462,6 @@ exports[`Storyshots Modal Internal Scroll 1`] = `
|
|
|
2464
2462
|
<div
|
|
2465
2463
|
className="c3"
|
|
2466
2464
|
onBlur={[Function]}
|
|
2467
|
-
onFocus={null}
|
|
2468
2465
|
onKeyDown={[Function]}
|
|
2469
2466
|
role="dialog"
|
|
2470
2467
|
size="M"
|
|
@@ -2832,7 +2829,6 @@ exports[`Storyshots Modal Not Dismmissable Story 1`] = `
|
|
|
2832
2829
|
<div
|
|
2833
2830
|
className="c3"
|
|
2834
2831
|
onBlur={[Function]}
|
|
2835
|
-
onFocus={null}
|
|
2836
2832
|
onKeyDown={[Function]}
|
|
2837
2833
|
role="dialog"
|
|
2838
2834
|
size="M"
|