@charcoal-ui/react 6.0.0-beta.1 → 6.0.0-rc.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/Icon/index.d.ts +14 -1
- package/dist/components/Icon/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +161 -155
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/layered.css +161 -155
- package/dist/layered.css.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/css-output.test.ts +1 -2
- package/src/__tests__/css-variables.test.ts +66 -0
- package/src/components/Button/__snapshots__/index.css.snap +30 -30
- package/src/components/Button/index.css +30 -30
- package/src/components/Button/index.story.tsx +18 -0
- package/src/components/Checkbox/CheckboxInput/index.css +10 -10
- package/src/components/Checkbox/__snapshots__/index.css.snap +1 -1
- package/src/components/Checkbox/index.css +1 -1
- package/src/components/Checkbox/index.story.tsx +18 -0
- package/src/components/Clickable/index.story.tsx +14 -0
- package/src/components/DropdownSelector/DropdownMenuItem/index.css +3 -3
- package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +2 -0
- package/src/components/DropdownSelector/ListItem/index.css +1 -1
- package/src/components/DropdownSelector/MenuItemGroup/index.css +1 -1
- package/src/components/DropdownSelector/Popover/index.css +2 -2
- package/src/components/DropdownSelector/__snapshots__/index.css.snap +6 -6
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +26 -13
- package/src/components/DropdownSelector/index.css +6 -6
- package/src/components/DropdownSelector/index.story.tsx +49 -0
- package/src/components/FieldLabel/__snapshots__/index.css.snap +3 -3
- package/src/components/FieldLabel/index.css +3 -3
- package/src/components/HintText/__snapshots__/index.css.snap +3 -3
- package/src/components/HintText/__snapshots__/index.story.storyshot +4 -0
- package/src/components/HintText/index.css +3 -3
- package/src/components/HintText/index.story.tsx +12 -0
- package/src/components/Icon/__snapshots__/index.story.storyshot +2 -0
- package/src/components/Icon/index.browser.test.tsx +280 -0
- package/src/components/Icon/index.test.tsx +94 -0
- package/src/components/Icon/index.tsx +49 -4
- package/src/components/IconButton/__snapshots__/index.css.snap +16 -16
- package/src/components/IconButton/__snapshots__/index.story.storyshot +6 -0
- package/src/components/IconButton/index.css +16 -16
- package/src/components/IconButton/index.story.tsx +15 -0
- package/src/components/LoadingSpinner/__snapshots__/index.css.snap +7 -7
- package/src/components/LoadingSpinner/index.css +7 -7
- package/src/components/LoadingSpinner/index.story.tsx +13 -0
- package/src/components/Modal/Dialog/index.css +1 -1
- package/src/components/Modal/ModalPlumbing.css +1 -1
- package/src/components/Modal/__snapshots__/index.css.snap +2 -2
- package/src/components/Modal/__snapshots__/index.story.storyshot +12 -2
- package/src/components/Modal/index.css +2 -2
- package/src/components/Modal/index.story.tsx +20 -0
- package/src/components/MultiSelect/__snapshots__/index.css.snap +10 -10
- package/src/components/MultiSelect/__snapshots__/index.story.storyshot +32 -0
- package/src/components/MultiSelect/index.css +10 -10
- package/src/components/MultiSelect/index.story.tsx +50 -0
- package/src/components/MultiSelect/index.tsx +1 -1
- package/src/components/Pagination/Pagination.story.tsx +11 -0
- package/src/components/Pagination/__snapshots__/index.css.snap +12 -15
- package/src/components/Pagination/index.css +12 -14
- package/src/components/Pagination/index.tsx +2 -1
- package/src/components/Radio/RadioInput/index.css +10 -10
- package/src/components/Radio/__snapshots__/index.css.snap +1 -1
- package/src/components/Radio/index.css +1 -1
- package/src/components/Radio/index.story.tsx +40 -0
- package/src/components/SegmentedControl/__snapshots__/index.css.snap +4 -4
- package/src/components/SegmentedControl/index.css +4 -4
- package/src/components/SegmentedControl/index.story.tsx +20 -0
- package/src/components/Switch/SwitchInput/index.css +9 -9
- package/src/components/Switch/__snapshots__/index.css.snap +1 -1
- package/src/components/Switch/index.css +1 -1
- package/src/components/Switch/index.story.tsx +19 -0
- package/src/components/TagItem/__snapshots__/index.css.snap +5 -4
- package/src/components/TagItem/__snapshots__/index.story.storyshot +2 -0
- package/src/components/TagItem/index.css +5 -4
- package/src/components/TagItem/index.story.tsx +17 -0
- package/src/components/TextArea/TextArea.story.tsx +30 -0
- package/src/components/TextArea/__snapshots__/index.css.snap +7 -5
- package/src/components/TextArea/index.css +8 -5
- package/src/components/TextEllipsis/__snapshots__/index.css.snap +3 -0
- package/src/components/TextEllipsis/index.css +4 -0
- package/src/components/TextField/AssistiveText/index.css +2 -2
- package/src/components/TextField/TextField.story.tsx +30 -0
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +2 -0
- package/src/components/TextField/__snapshots__/index.css.snap +6 -6
- package/src/components/TextField/index.css +6 -6
|
@@ -55,48 +55,48 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
&[data-variant='Default'] {
|
|
58
|
-
color: var(--charcoal-
|
|
59
|
-
background-color: var(--charcoal-
|
|
58
|
+
color: var(--charcoal-color-icon-tertiary-default);
|
|
59
|
+
background-color: var(--charcoal-color-container-default-a);
|
|
60
60
|
|
|
61
61
|
&[data-active='true']:not(:disabled):not([aria-disabled]),
|
|
62
62
|
&[data-active='true'][aria-disabled='false'] {
|
|
63
|
-
color: var(--charcoal-
|
|
64
|
-
background-color: var(--charcoal-
|
|
63
|
+
color: var(--charcoal-color-icon-tertiary-press);
|
|
64
|
+
background-color: var(--charcoal-color-container-press-a);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
&[data-active='false']:not(:disabled):not([aria-disabled]):hover,
|
|
68
68
|
&[data-active='false'][aria-disabled='false']:hover {
|
|
69
|
-
color: var(--charcoal-
|
|
70
|
-
background-color: var(--charcoal-
|
|
69
|
+
color: var(--charcoal-color-icon-tertiary-hover);
|
|
70
|
+
background-color: var(--charcoal-color-container-hover-a);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
&[data-active='false']:not(:disabled):not([aria-disabled]):active,
|
|
74
74
|
&[data-active='false'][aria-disabled='false']:active {
|
|
75
|
-
color: var(--charcoal-
|
|
76
|
-
background-color: var(--charcoal-
|
|
75
|
+
color: var(--charcoal-color-icon-tertiary-press);
|
|
76
|
+
background-color: var(--charcoal-color-container-press-a);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
&[data-variant='Overlay'] {
|
|
81
|
-
color: var(--charcoal-
|
|
82
|
-
background-color: var(--charcoal-
|
|
81
|
+
color: var(--charcoal-color-icon-on-on-img-default);
|
|
82
|
+
background-color: var(--charcoal-color-container-on-img-default);
|
|
83
83
|
|
|
84
84
|
&[data-active='true']:not(:disabled):not([aria-disabled]),
|
|
85
85
|
&[data-active='true'][aria-disabled='false'] {
|
|
86
|
-
color: var(--charcoal-
|
|
87
|
-
background-color: var(--charcoal-
|
|
86
|
+
color: var(--charcoal-color-icon-on-on-img-press);
|
|
87
|
+
background-color: var(--charcoal-color-container-on-img-press);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
&[data-active='false']:not(:disabled):not([aria-disabled]):hover,
|
|
91
91
|
&[data-active='false'][aria-disabled='false']:hover {
|
|
92
|
-
color: var(--charcoal-
|
|
93
|
-
background-color: var(--charcoal-
|
|
92
|
+
color: var(--charcoal-color-icon-on-on-img-hover);
|
|
93
|
+
background-color: var(--charcoal-color-container-on-img-hover);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
&[data-active='false']:not(:disabled):not([aria-disabled]):active,
|
|
97
97
|
&[data-active='false'][aria-disabled='false']:active {
|
|
98
|
-
color: var(--charcoal-
|
|
99
|
-
background-color: var(--charcoal-
|
|
98
|
+
color: var(--charcoal-color-icon-on-on-img-press);
|
|
99
|
+
background-color: var(--charcoal-color-container-on-img-press);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -32,3 +32,18 @@ export const Overlay: StoryObj<typeof IconButton> = {
|
|
|
32
32
|
return <IconButton icon="16/Add" variant="Overlay" />
|
|
33
33
|
},
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
export const TokenV2: StoryObj<typeof IconButton> = {
|
|
37
|
+
parameters: {
|
|
38
|
+
tokenVersion: 'v2',
|
|
39
|
+
},
|
|
40
|
+
render: () => {
|
|
41
|
+
return (
|
|
42
|
+
<div style={{ display: 'flex', gap: 8 }}>
|
|
43
|
+
<IconButton icon="16/Add" title="add" />
|
|
44
|
+
<IconButton icon="16/Add" title="active" isActive />
|
|
45
|
+
<IconButton icon="16/Add" title="overlay" variant="Overlay" />
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
},
|
|
49
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
.charcoal-loading-spinner {
|
|
2
2
|
box-sizing: content-box;
|
|
3
3
|
margin: auto;
|
|
4
|
-
padding:
|
|
4
|
+
padding: 16px;
|
|
5
5
|
border-radius: 8px;
|
|
6
|
-
font-size:
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
6
|
+
font-size: 48px;
|
|
7
|
+
width: 48px;
|
|
8
|
+
height: 48px;
|
|
9
9
|
opacity: 0.84;
|
|
10
|
-
color: var(--charcoal-
|
|
11
|
-
background-color: var(--charcoal-
|
|
10
|
+
color: var(--charcoal-color-icon-tertiary-default);
|
|
11
|
+
background-color: var(--charcoal-color-background-default);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.charcoal-loading-spinner[data-transparent='true'] {
|
|
15
|
-
background-color: var(--charcoal-
|
|
15
|
+
background-color: var(--charcoal-color-container-default-a);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
@keyframes charcoal-loading-spinner-icon-scale-out {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
.charcoal-loading-spinner {
|
|
2
2
|
box-sizing: content-box;
|
|
3
3
|
margin: auto;
|
|
4
|
-
padding:
|
|
4
|
+
padding: 16px;
|
|
5
5
|
border-radius: 8px;
|
|
6
|
-
font-size:
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
6
|
+
font-size: 48px;
|
|
7
|
+
width: 48px;
|
|
8
|
+
height: 48px;
|
|
9
9
|
opacity: 0.84;
|
|
10
|
-
color: var(--charcoal-
|
|
11
|
-
background-color: var(--charcoal-
|
|
10
|
+
color: var(--charcoal-color-icon-tertiary-default);
|
|
11
|
+
background-color: var(--charcoal-color-background-default);
|
|
12
12
|
|
|
13
13
|
&[data-transparent='true'] {
|
|
14
|
-
background-color: var(--charcoal-
|
|
14
|
+
background-color: var(--charcoal-color-container-default-a);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -25,3 +25,16 @@ export const Size: StoryObj<typeof LoadingSpinner> = {
|
|
|
25
25
|
export const Padding: StoryObj<typeof LoadingSpinner> = {
|
|
26
26
|
render: () => <LoadingSpinner padding={24} />,
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
export const TokenV2: StoryObj<typeof LoadingSpinner> = {
|
|
30
|
+
parameters: {
|
|
31
|
+
tokenVersion: 'v2',
|
|
32
|
+
},
|
|
33
|
+
render: () => (
|
|
34
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 24 }}>
|
|
35
|
+
<LoadingSpinner />
|
|
36
|
+
<LoadingSpinner transparent />
|
|
37
|
+
<LoadingSpinner size={48} />
|
|
38
|
+
</div>
|
|
39
|
+
),
|
|
40
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
justify-content: center;
|
|
10
10
|
padding: 40px 0;
|
|
11
11
|
box-sizing: border-box;
|
|
12
|
-
background-color: var(--charcoal-
|
|
12
|
+
background-color: var(--charcoal-color-container-neutral-default);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@media (max-width: 743px) {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
position: absolute;
|
|
24
24
|
top: 8px;
|
|
25
25
|
right: 8px;
|
|
26
|
-
color: var(--charcoal-
|
|
26
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
27
27
|
transition: 0.2s color;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -187,8 +187,9 @@ exports[`Storybook Tests > react/Modal > BackgroundScroll 1`] = `
|
|
|
187
187
|
Apple
|
|
188
188
|
</span>
|
|
189
189
|
<pixiv-icon
|
|
190
|
-
class="charcoal-ui-dropdown-selector-icon"
|
|
190
|
+
class="charcoal-icon charcoal-ui-dropdown-selector-icon"
|
|
191
191
|
name="16/Menu"
|
|
192
|
+
style="--charcoal-icon-size: 16px;"
|
|
192
193
|
/>
|
|
193
194
|
</button>
|
|
194
195
|
</div>
|
|
@@ -221,7 +222,9 @@ exports[`Storybook Tests > react/Modal > BackgroundScroll 1`] = `
|
|
|
221
222
|
type="button"
|
|
222
223
|
>
|
|
223
224
|
<pixiv-icon
|
|
225
|
+
class="charcoal-icon"
|
|
224
226
|
name="24/Close"
|
|
227
|
+
style="--charcoal-icon-size: 24px;"
|
|
225
228
|
/>
|
|
226
229
|
</button>
|
|
227
230
|
</div>
|
|
@@ -322,7 +325,9 @@ exports[`Storybook Tests > react/Modal > BottomSheet 1`] = `
|
|
|
322
325
|
type="button"
|
|
323
326
|
>
|
|
324
327
|
<pixiv-icon
|
|
328
|
+
class="charcoal-icon"
|
|
325
329
|
name="24/Close"
|
|
330
|
+
style="--charcoal-icon-size: 24px;"
|
|
326
331
|
/>
|
|
327
332
|
</button>
|
|
328
333
|
</div>
|
|
@@ -515,8 +520,9 @@ exports[`Storybook Tests > react/Modal > Default 1`] = `
|
|
|
515
520
|
Apple
|
|
516
521
|
</span>
|
|
517
522
|
<pixiv-icon
|
|
518
|
-
class="charcoal-ui-dropdown-selector-icon"
|
|
523
|
+
class="charcoal-icon charcoal-ui-dropdown-selector-icon"
|
|
519
524
|
name="16/Menu"
|
|
525
|
+
style="--charcoal-icon-size: 16px;"
|
|
520
526
|
/>
|
|
521
527
|
</button>
|
|
522
528
|
</div>
|
|
@@ -549,7 +555,9 @@ exports[`Storybook Tests > react/Modal > Default 1`] = `
|
|
|
549
555
|
type="button"
|
|
550
556
|
>
|
|
551
557
|
<pixiv-icon
|
|
558
|
+
class="charcoal-icon"
|
|
552
559
|
name="24/Close"
|
|
560
|
+
style="--charcoal-icon-size: 24px;"
|
|
553
561
|
/>
|
|
554
562
|
</button>
|
|
555
563
|
</div>
|
|
@@ -712,7 +720,9 @@ exports[`Storybook Tests > react/Modal > FullBottomSheet 1`] = `
|
|
|
712
720
|
type="button"
|
|
713
721
|
>
|
|
714
722
|
<pixiv-icon
|
|
723
|
+
class="charcoal-icon"
|
|
715
724
|
name="24/Close"
|
|
725
|
+
style="--charcoal-icon-size: 24px;"
|
|
716
726
|
/>
|
|
717
727
|
</button>
|
|
718
728
|
</div>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
padding: 40px 0;
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
|
|
13
|
-
background-color: var(--charcoal-
|
|
13
|
+
background-color: var(--charcoal-color-container-neutral-default);
|
|
14
14
|
|
|
15
15
|
@media (max-width: 743px) {
|
|
16
16
|
&[data-bottom-sheet='true'],
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
top: 8px;
|
|
26
26
|
right: 8px;
|
|
27
27
|
|
|
28
|
-
color: var(--charcoal-
|
|
28
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
29
29
|
transition: 0.2s color;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -135,6 +135,26 @@ const StyledModalText = (props: Omit<React.ComponentProps<'div'>, 'style'>) => {
|
|
|
135
135
|
|
|
136
136
|
export const Default: StoryObj<typeof Modal> = {}
|
|
137
137
|
|
|
138
|
+
export const TokenV2: StoryObj<typeof Modal> = {
|
|
139
|
+
parameters: {
|
|
140
|
+
tokenVersion: 'v2',
|
|
141
|
+
},
|
|
142
|
+
render: function Render(args) {
|
|
143
|
+
const state = useOverlayTriggerState({ defaultOpen: true })
|
|
144
|
+
return (
|
|
145
|
+
<OverlayProvider>
|
|
146
|
+
<Button onClick={() => state.open()}>Open Modal</Button>
|
|
147
|
+
<M
|
|
148
|
+
{...args}
|
|
149
|
+
isDismissable
|
|
150
|
+
isOpen={state.isOpen}
|
|
151
|
+
onClose={() => state.close()}
|
|
152
|
+
/>
|
|
153
|
+
</OverlayProvider>
|
|
154
|
+
)
|
|
155
|
+
},
|
|
156
|
+
}
|
|
157
|
+
|
|
138
158
|
export const FullBottomSheet: StoryObj<typeof Modal> = {
|
|
139
159
|
args: {
|
|
140
160
|
bottomSheet: 'full',
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
align-items: center;
|
|
18
18
|
font-size: 14px;
|
|
19
19
|
line-height: 22px;
|
|
20
|
-
color: var(--charcoal-
|
|
20
|
+
color: var(--charcoal-color-text-default);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.charcoal-multi-select-label::before {
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
width: 20px;
|
|
43
43
|
height: 20px;
|
|
44
44
|
margin: 0;
|
|
45
|
-
background-color: var(--charcoal-
|
|
45
|
+
background-color: var(--charcoal-color-container-neutral-default);
|
|
46
46
|
border-radius: 999999px;
|
|
47
47
|
transition: 0.2s background-color,
|
|
48
48
|
0.2s box-shadow;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.charcoal-multi-select-input[type='checkbox']:checked {
|
|
52
|
-
background-color: var(--charcoal-
|
|
52
|
+
background-color: var(--charcoal-color-container-primary-default);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.charcoal-multi-select-input[type='checkbox']:focus {
|
|
@@ -66,19 +66,19 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.charcoal-multi-select-input[type='checkbox']:hover:not(:disabled):not([aria-disabled]), .charcoal-multi-select-input[type='checkbox']:hover[aria-disabled='false'] {
|
|
69
|
-
background-color: var(--charcoal-
|
|
69
|
+
background-color: var(--charcoal-color-container-neutral-hover);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.charcoal-multi-select-input[type='checkbox']:active:not(:disabled):not([aria-disabled]), .charcoal-multi-select-input[type='checkbox']:active[aria-disabled='false'] {
|
|
73
|
-
background-color: var(--charcoal-
|
|
73
|
+
background-color: var(--charcoal-color-container-neutral-press);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.charcoal-multi-select-input[type='checkbox']:checked:hover:not(:disabled):not([aria-disabled]), .charcoal-multi-select-input[type='checkbox']:checked:hover[aria-disabled='false'] {
|
|
77
|
-
background-color: var(--charcoal-
|
|
77
|
+
background-color: var(--charcoal-color-container-primary-hover);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.charcoal-multi-select-input[type='checkbox']:checked:active:not(:disabled):not([aria-disabled]), .charcoal-multi-select-input[type='checkbox']:checked:active[aria-disabled='false'] {
|
|
81
|
-
background-color: var(--charcoal-
|
|
81
|
+
background-color: var(--charcoal-color-container-primary-press);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.charcoal-multi-select-input[type='checkbox'][aria-invalid='true'][data-overlay='false']:not(:disabled):not([aria-disabled]) {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.charcoal-multi-select-input[type='checkbox'][data-overlay='true'] {
|
|
93
|
-
background-color: var(--charcoal-
|
|
93
|
+
background-color: var(--charcoal-color-container-on-img-default);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.charcoal-multi-select-overlay {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
width: 24px;
|
|
105
105
|
height: 24px;
|
|
106
106
|
border-radius: 999999px;
|
|
107
|
-
color: var(--charcoal-
|
|
107
|
+
color: var(--charcoal-color-icon-on-primary-default);
|
|
108
108
|
transition: 0.2s box-shadow;
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.charcoal-multi-select-overlay[data-overlay='true'] {
|
|
120
|
-
border-color: var(--charcoal-
|
|
120
|
+
border-color: var(--charcoal-color-border-hud);
|
|
121
121
|
border-width: 2px;
|
|
122
122
|
border-style: solid;
|
|
123
123
|
}
|
|
@@ -30,7 +30,9 @@ exports[`Storybook Tests > react/MultiSelect > Basic 1`] = `
|
|
|
30
30
|
data-overlay="false"
|
|
31
31
|
>
|
|
32
32
|
<pixiv-icon
|
|
33
|
+
class="charcoal-icon"
|
|
33
34
|
name="24/Check"
|
|
35
|
+
style="--charcoal-icon-size: 16px;"
|
|
34
36
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
35
37
|
/>
|
|
36
38
|
</div>
|
|
@@ -59,7 +61,9 @@ exports[`Storybook Tests > react/MultiSelect > Basic 1`] = `
|
|
|
59
61
|
data-overlay="false"
|
|
60
62
|
>
|
|
61
63
|
<pixiv-icon
|
|
64
|
+
class="charcoal-icon"
|
|
62
65
|
name="24/Check"
|
|
66
|
+
style="--charcoal-icon-size: 16px;"
|
|
63
67
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
64
68
|
/>
|
|
65
69
|
</div>
|
|
@@ -89,7 +93,9 @@ exports[`Storybook Tests > react/MultiSelect > Basic 1`] = `
|
|
|
89
93
|
data-overlay="false"
|
|
90
94
|
>
|
|
91
95
|
<pixiv-icon
|
|
96
|
+
class="charcoal-icon"
|
|
92
97
|
name="24/Check"
|
|
98
|
+
style="--charcoal-icon-size: 16px;"
|
|
93
99
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
94
100
|
/>
|
|
95
101
|
</div>
|
|
@@ -118,7 +124,9 @@ exports[`Storybook Tests > react/MultiSelect > Basic 1`] = `
|
|
|
118
124
|
data-overlay="false"
|
|
119
125
|
>
|
|
120
126
|
<pixiv-icon
|
|
127
|
+
class="charcoal-icon"
|
|
121
128
|
name="24/Check"
|
|
129
|
+
style="--charcoal-icon-size: 16px;"
|
|
122
130
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
123
131
|
/>
|
|
124
132
|
</div>
|
|
@@ -162,7 +170,9 @@ exports[`Storybook Tests > react/MultiSelect > Invalid 1`] = `
|
|
|
162
170
|
data-overlay="false"
|
|
163
171
|
>
|
|
164
172
|
<pixiv-icon
|
|
173
|
+
class="charcoal-icon"
|
|
165
174
|
name="24/Check"
|
|
175
|
+
style="--charcoal-icon-size: 16px;"
|
|
166
176
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
167
177
|
/>
|
|
168
178
|
</div>
|
|
@@ -191,7 +201,9 @@ exports[`Storybook Tests > react/MultiSelect > Invalid 1`] = `
|
|
|
191
201
|
data-overlay="false"
|
|
192
202
|
>
|
|
193
203
|
<pixiv-icon
|
|
204
|
+
class="charcoal-icon"
|
|
194
205
|
name="24/Check"
|
|
206
|
+
style="--charcoal-icon-size: 16px;"
|
|
195
207
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
196
208
|
/>
|
|
197
209
|
</div>
|
|
@@ -220,7 +232,9 @@ exports[`Storybook Tests > react/MultiSelect > Invalid 1`] = `
|
|
|
220
232
|
data-overlay="false"
|
|
221
233
|
>
|
|
222
234
|
<pixiv-icon
|
|
235
|
+
class="charcoal-icon"
|
|
223
236
|
name="24/Check"
|
|
237
|
+
style="--charcoal-icon-size: 16px;"
|
|
224
238
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
225
239
|
/>
|
|
226
240
|
</div>
|
|
@@ -249,7 +263,9 @@ exports[`Storybook Tests > react/MultiSelect > Invalid 1`] = `
|
|
|
249
263
|
data-overlay="false"
|
|
250
264
|
>
|
|
251
265
|
<pixiv-icon
|
|
266
|
+
class="charcoal-icon"
|
|
252
267
|
name="24/Check"
|
|
268
|
+
style="--charcoal-icon-size: 16px;"
|
|
253
269
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
254
270
|
/>
|
|
255
271
|
</div>
|
|
@@ -293,7 +309,9 @@ exports[`Storybook Tests > react/MultiSelect > Overlay 1`] = `
|
|
|
293
309
|
data-overlay="true"
|
|
294
310
|
>
|
|
295
311
|
<pixiv-icon
|
|
312
|
+
class="charcoal-icon"
|
|
296
313
|
name="24/Check"
|
|
314
|
+
style="--charcoal-icon-size: 16px;"
|
|
297
315
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
298
316
|
/>
|
|
299
317
|
</div>
|
|
@@ -322,7 +340,9 @@ exports[`Storybook Tests > react/MultiSelect > Overlay 1`] = `
|
|
|
322
340
|
data-overlay="true"
|
|
323
341
|
>
|
|
324
342
|
<pixiv-icon
|
|
343
|
+
class="charcoal-icon"
|
|
325
344
|
name="24/Check"
|
|
345
|
+
style="--charcoal-icon-size: 16px;"
|
|
326
346
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
327
347
|
/>
|
|
328
348
|
</div>
|
|
@@ -351,7 +371,9 @@ exports[`Storybook Tests > react/MultiSelect > Overlay 1`] = `
|
|
|
351
371
|
data-overlay="true"
|
|
352
372
|
>
|
|
353
373
|
<pixiv-icon
|
|
374
|
+
class="charcoal-icon"
|
|
354
375
|
name="24/Check"
|
|
376
|
+
style="--charcoal-icon-size: 16px;"
|
|
355
377
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
356
378
|
/>
|
|
357
379
|
</div>
|
|
@@ -380,7 +402,9 @@ exports[`Storybook Tests > react/MultiSelect > Overlay 1`] = `
|
|
|
380
402
|
data-overlay="true"
|
|
381
403
|
>
|
|
382
404
|
<pixiv-icon
|
|
405
|
+
class="charcoal-icon"
|
|
383
406
|
name="24/Check"
|
|
407
|
+
style="--charcoal-icon-size: 16px;"
|
|
384
408
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
385
409
|
/>
|
|
386
410
|
</div>
|
|
@@ -424,7 +448,9 @@ exports[`Storybook Tests > react/MultiSelect > Playground 1`] = `
|
|
|
424
448
|
data-overlay="false"
|
|
425
449
|
>
|
|
426
450
|
<pixiv-icon
|
|
451
|
+
class="charcoal-icon"
|
|
427
452
|
name="24/Check"
|
|
453
|
+
style="--charcoal-icon-size: 16px;"
|
|
428
454
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
429
455
|
/>
|
|
430
456
|
</div>
|
|
@@ -454,7 +480,9 @@ exports[`Storybook Tests > react/MultiSelect > Playground 1`] = `
|
|
|
454
480
|
data-overlay="false"
|
|
455
481
|
>
|
|
456
482
|
<pixiv-icon
|
|
483
|
+
class="charcoal-icon"
|
|
457
484
|
name="24/Check"
|
|
485
|
+
style="--charcoal-icon-size: 16px;"
|
|
458
486
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
459
487
|
/>
|
|
460
488
|
</div>
|
|
@@ -484,7 +512,9 @@ exports[`Storybook Tests > react/MultiSelect > Playground 1`] = `
|
|
|
484
512
|
data-overlay="false"
|
|
485
513
|
>
|
|
486
514
|
<pixiv-icon
|
|
515
|
+
class="charcoal-icon"
|
|
487
516
|
name="24/Check"
|
|
517
|
+
style="--charcoal-icon-size: 16px;"
|
|
488
518
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
489
519
|
/>
|
|
490
520
|
</div>
|
|
@@ -514,7 +544,9 @@ exports[`Storybook Tests > react/MultiSelect > Playground 1`] = `
|
|
|
514
544
|
data-overlay="false"
|
|
515
545
|
>
|
|
516
546
|
<pixiv-icon
|
|
547
|
+
class="charcoal-icon"
|
|
517
548
|
name="24/Check"
|
|
549
|
+
style="--charcoal-icon-size: 16px;"
|
|
518
550
|
unsafe-non-guideline-scale="0.6666666666666666"
|
|
519
551
|
/>
|
|
520
552
|
</div>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
align-items: center;
|
|
19
19
|
font-size: 14px;
|
|
20
20
|
line-height: 22px;
|
|
21
|
-
color: var(--charcoal-
|
|
21
|
+
color: var(--charcoal-color-text-default);
|
|
22
22
|
|
|
23
23
|
&::before {
|
|
24
24
|
display: block;
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
width: 20px;
|
|
44
44
|
height: 20px;
|
|
45
45
|
margin: 0;
|
|
46
|
-
background-color: var(--charcoal-
|
|
46
|
+
background-color: var(--charcoal-color-container-neutral-default);
|
|
47
47
|
border-radius: 999999px;
|
|
48
48
|
transition:
|
|
49
49
|
0.2s background-color,
|
|
50
50
|
0.2s box-shadow;
|
|
51
51
|
|
|
52
52
|
&:checked {
|
|
53
|
-
background-color: var(--charcoal-
|
|
53
|
+
background-color: var(--charcoal-color-container-primary-default);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
&:focus {
|
|
@@ -68,22 +68,22 @@
|
|
|
68
68
|
|
|
69
69
|
&:hover:not(:disabled):not([aria-disabled]),
|
|
70
70
|
&:hover[aria-disabled='false'] {
|
|
71
|
-
background-color: var(--charcoal-
|
|
71
|
+
background-color: var(--charcoal-color-container-neutral-hover);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
&:active:not(:disabled):not([aria-disabled]),
|
|
75
75
|
&:active[aria-disabled='false'] {
|
|
76
|
-
background-color: var(--charcoal-
|
|
76
|
+
background-color: var(--charcoal-color-container-neutral-press);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
&:checked:hover:not(:disabled):not([aria-disabled]),
|
|
80
80
|
&:checked:hover[aria-disabled='false'] {
|
|
81
|
-
background-color: var(--charcoal-
|
|
81
|
+
background-color: var(--charcoal-color-container-primary-hover);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
&:checked:active:not(:disabled):not([aria-disabled]),
|
|
85
85
|
&:checked:active[aria-disabled='false'] {
|
|
86
|
-
background-color: var(--charcoal-
|
|
86
|
+
background-color: var(--charcoal-color-container-primary-press);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
&[aria-invalid='true'][data-overlay='false']:not(:disabled):not(
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
&[data-overlay='true'] {
|
|
100
|
-
background-color: var(--charcoal-
|
|
100
|
+
background-color: var(--charcoal-color-container-on-img-default);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
width: 24px;
|
|
113
113
|
height: 24px;
|
|
114
114
|
border-radius: 999999px;
|
|
115
|
-
color: var(--charcoal-
|
|
115
|
+
color: var(--charcoal-color-icon-on-primary-default);
|
|
116
116
|
transition: 0.2s box-shadow;
|
|
117
117
|
|
|
118
118
|
&[aria-invalid='true'][data-overlay='true']:not(:disabled):not(
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
&[data-overlay='true'] {
|
|
129
|
-
border-color: var(--charcoal-
|
|
129
|
+
border-color: var(--charcoal-color-border-hud);
|
|
130
130
|
border-width: 2px;
|
|
131
131
|
border-style: solid;
|
|
132
132
|
}
|
|
@@ -96,6 +96,56 @@ export const Overlay: StoryObj<typeof MultiSelect> = {
|
|
|
96
96
|
},
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
export const TokenV2: StoryObj<typeof MultiSelect> = {
|
|
100
|
+
parameters: {
|
|
101
|
+
tokenVersion: 'v2',
|
|
102
|
+
},
|
|
103
|
+
render: function Render() {
|
|
104
|
+
const options = ['選択肢1', '選択肢2', '選択肢3', '選択肢4']
|
|
105
|
+
return (
|
|
106
|
+
<div style={{ display: 'grid', gap: 24 }}>
|
|
107
|
+
<StyledMultiSelectGroup
|
|
108
|
+
name="token-v2-default"
|
|
109
|
+
label="default"
|
|
110
|
+
onChange={action('click')}
|
|
111
|
+
selected={['選択肢1', '選択肢3']}
|
|
112
|
+
>
|
|
113
|
+
{options.map((option) => (
|
|
114
|
+
<MultiSelect value={option} key={option}>
|
|
115
|
+
{option}
|
|
116
|
+
</MultiSelect>
|
|
117
|
+
))}
|
|
118
|
+
</StyledMultiSelectGroup>
|
|
119
|
+
<StyledMultiSelectGroup
|
|
120
|
+
name="token-v2-invalid"
|
|
121
|
+
label="invalid"
|
|
122
|
+
onChange={action('click')}
|
|
123
|
+
selected={[]}
|
|
124
|
+
invalid
|
|
125
|
+
>
|
|
126
|
+
{options.map((option) => (
|
|
127
|
+
<MultiSelect value={option} key={option}>
|
|
128
|
+
{option}
|
|
129
|
+
</MultiSelect>
|
|
130
|
+
))}
|
|
131
|
+
</StyledMultiSelectGroup>
|
|
132
|
+
<StyledMultiSelectGroup
|
|
133
|
+
name="token-v2-overlay"
|
|
134
|
+
label="overlay"
|
|
135
|
+
onChange={action('click')}
|
|
136
|
+
selected={['選択肢2']}
|
|
137
|
+
>
|
|
138
|
+
{options.map((option) => (
|
|
139
|
+
<MultiSelect variant="overlay" value={option} key={option}>
|
|
140
|
+
{option}
|
|
141
|
+
</MultiSelect>
|
|
142
|
+
))}
|
|
143
|
+
</StyledMultiSelectGroup>
|
|
144
|
+
</div>
|
|
145
|
+
)
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
|
|
99
149
|
export const Playground: StoryObj<typeof MultiSelect> = {
|
|
100
150
|
render: function Render(args) {
|
|
101
151
|
const [selected, setSelected] = useState<string[]>([])
|
|
@@ -76,7 +76,7 @@ const MultiSelect = forwardRef<HTMLInputElement, MultiSelectProps>(
|
|
|
76
76
|
aria-invalid={invalid}
|
|
77
77
|
aria-hidden
|
|
78
78
|
>
|
|
79
|
-
<Icon name="24/Check"
|
|
79
|
+
<Icon name="24/Check" fixedSize={16} />
|
|
80
80
|
</div>
|
|
81
81
|
{Boolean(children) && (
|
|
82
82
|
<div className="charcoal-multi-select-label">{children}</div>
|