@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
|
@@ -108,6 +108,17 @@ export const PageRange5: StoryObj<typeof Pagination> = {
|
|
|
108
108
|
},
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
export const TokenV2: StoryObj<typeof Pagination> = {
|
|
112
|
+
parameters: {
|
|
113
|
+
tokenVersion: 'v2',
|
|
114
|
+
},
|
|
115
|
+
args: {
|
|
116
|
+
page: 50,
|
|
117
|
+
pageCount: 103,
|
|
118
|
+
pageRangeDisplayed: 5,
|
|
119
|
+
},
|
|
120
|
+
}
|
|
121
|
+
|
|
111
122
|
export const LinkPaginationStory: StoryObj<typeof Pagination> = {
|
|
112
123
|
args: {
|
|
113
124
|
page: 5,
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
*/
|
|
40
40
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
41
41
|
-webkit-transform: translateZ(0);
|
|
42
|
-
color: var(--charcoal-
|
|
43
|
-
background-color: var(--charcoal-
|
|
42
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
43
|
+
background-color: var(--charcoal-color-container-default-a);
|
|
44
44
|
border-radius: 20px;
|
|
45
45
|
transition: 0.2s background-color,
|
|
46
46
|
0.2s box-shadow;
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.charcoal-pagination-button:not(:disabled):not([aria-disabled]):hover, .charcoal-pagination-button[aria-disabled='false']:hover {
|
|
64
|
-
color: var(--charcoal-
|
|
65
|
-
background-color: var(--charcoal-
|
|
64
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
65
|
+
background-color: var(--charcoal-color-container-secondary-default);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.charcoal-pagination-button:not(:disabled):not([aria-disabled]):active, .charcoal-pagination-button[aria-disabled='false']:active {
|
|
69
|
-
color: var(--charcoal-
|
|
70
|
-
background-color: var(--charcoal-
|
|
69
|
+
color: var(--charcoal-color-text-tertiary-press);
|
|
70
|
+
background-color: var(--charcoal-color-container-tertiary-press);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.charcoal-pagination-button:not(:disabled):not([aria-disabled]):focus, .charcoal-pagination-button[aria-disabled='false']:focus {
|
|
@@ -85,26 +85,23 @@
|
|
|
85
85
|
|
|
86
86
|
.charcoal-pagination-button[aria-current] {
|
|
87
87
|
cursor: default;
|
|
88
|
-
background-color: var(--charcoal-
|
|
89
|
-
color: var(--charcoal-
|
|
88
|
+
background-color: var(--charcoal-color-container-hud-default);
|
|
89
|
+
color: var(--charcoal-color-text-on-hud-default);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.charcoal-pagination-button[aria-current]:not(:disabled):not([aria-disabled]):hover, .charcoal-pagination-button[aria-current]:not(:disabled):not([aria-disabled]):active {
|
|
93
|
-
background-color: var(--charcoal-
|
|
94
|
-
color: var(--charcoal-
|
|
93
|
+
background-color: var(--charcoal-color-container-hud-default);
|
|
94
|
+
color: var(--charcoal-color-text-on-hud-default);
|
|
95
95
|
}
|
|
96
96
|
/* stylelint-enable no-descending-specificity */
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.charcoal-pagination-nav-button[hidden] {
|
|
98
|
+
.charcoal-pagination-nav-button[data-hidden] {
|
|
101
99
|
visibility: hidden;
|
|
102
|
-
display: block;
|
|
103
100
|
}
|
|
104
101
|
|
|
105
102
|
.charcoal-pagination-spacer, .charcoal-pagination-spacer:hover, .charcoal-pagination-spacer:active {
|
|
106
103
|
cursor: default;
|
|
107
|
-
color: var(--charcoal-
|
|
104
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
108
105
|
background: none;
|
|
109
106
|
}
|
|
110
107
|
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
41
41
|
-webkit-transform: translateZ(0);
|
|
42
42
|
|
|
43
|
-
color: var(--charcoal-
|
|
44
|
-
background-color: var(--charcoal-
|
|
43
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
44
|
+
background-color: var(--charcoal-color-container-default-a);
|
|
45
45
|
border-radius: 20px;
|
|
46
46
|
transition:
|
|
47
47
|
0.2s background-color,
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
|
|
64
64
|
&:not(:disabled):not([aria-disabled]):hover,
|
|
65
65
|
&[aria-disabled='false']:hover {
|
|
66
|
-
color: var(--charcoal-
|
|
67
|
-
background-color: var(--charcoal-
|
|
66
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
67
|
+
background-color: var(--charcoal-color-container-secondary-default);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&:not(:disabled):not([aria-disabled]):active,
|
|
71
71
|
&[aria-disabled='false']:active {
|
|
72
|
-
color: var(--charcoal-
|
|
73
|
-
background-color: var(--charcoal-
|
|
72
|
+
color: var(--charcoal-color-text-tertiary-press);
|
|
73
|
+
background-color: var(--charcoal-color-container-tertiary-press);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
&:not(:disabled):not([aria-disabled]):focus,
|
|
@@ -91,22 +91,20 @@
|
|
|
91
91
|
|
|
92
92
|
&[aria-current] {
|
|
93
93
|
cursor: default;
|
|
94
|
-
background-color: var(--charcoal-
|
|
95
|
-
color: var(--charcoal-
|
|
94
|
+
background-color: var(--charcoal-color-container-hud-default);
|
|
95
|
+
color: var(--charcoal-color-text-on-hud-default);
|
|
96
96
|
|
|
97
97
|
&:not(:disabled):not([aria-disabled]):hover,
|
|
98
98
|
&:not(:disabled):not([aria-disabled]):active {
|
|
99
|
-
background-color: var(--charcoal-
|
|
100
|
-
color: var(--charcoal-
|
|
99
|
+
background-color: var(--charcoal-color-container-hud-default);
|
|
100
|
+
color: var(--charcoal-color-text-on-hud-default);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
/* stylelint-enable no-descending-specificity */
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
.charcoal-pagination-nav-button[hidden] {
|
|
106
|
+
.charcoal-pagination-nav-button[data-hidden] {
|
|
108
107
|
visibility: hidden;
|
|
109
|
-
display: block;
|
|
110
108
|
}
|
|
111
109
|
|
|
112
110
|
.charcoal-pagination-spacer {
|
|
@@ -114,7 +112,7 @@
|
|
|
114
112
|
&:hover,
|
|
115
113
|
&:active {
|
|
116
114
|
cursor: default;
|
|
117
|
-
color: var(--charcoal-
|
|
115
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
118
116
|
background: none;
|
|
119
117
|
}
|
|
120
118
|
|
|
@@ -44,7 +44,8 @@ function NavButton({ direction, ariaLabel }: NavButtonProps) {
|
|
|
44
44
|
<IconButton
|
|
45
45
|
icon={isPrev ? '24/Prev' : '24/Next'}
|
|
46
46
|
size={size}
|
|
47
|
-
hidden
|
|
47
|
+
/* Use data-hidden, not [hidden]: Tailwind preflight's `[hidden] { display: none !important }` would clobber `visibility: hidden` and collapse the layout space. */
|
|
48
|
+
data-hidden={disabled || undefined}
|
|
48
49
|
aria-label={ariaLabel}
|
|
49
50
|
{...(isLinkMode && makeUrl
|
|
50
51
|
? {
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
height: 20px;
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
border-radius: 999999px;
|
|
13
|
-
background-color: var(--charcoal-
|
|
13
|
+
background-color: var(--charcoal-color-container-default);
|
|
14
14
|
transition:
|
|
15
15
|
0.2s background-color,
|
|
16
16
|
0.2s box-shadow;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.charcoal-radio-input:checked {
|
|
20
|
-
background-color: var(--charcoal-
|
|
20
|
+
background-color: var(--charcoal-color-container-primary-default);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.charcoal-radio-input:checked::after {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
width: 8px;
|
|
27
27
|
height: 8px;
|
|
28
28
|
pointer-events: none;
|
|
29
|
-
background-color: var(--charcoal-
|
|
29
|
+
background-color: var(--charcoal-color-icon-on-primary-default);
|
|
30
30
|
border-radius: 999999px;
|
|
31
31
|
transition:
|
|
32
32
|
0.2s background-color,
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
.charcoal-radio-input:not(:checked) {
|
|
37
37
|
border-width: 2px;
|
|
38
38
|
border-style: solid;
|
|
39
|
-
border-color: var(--charcoal-
|
|
39
|
+
border-color: var(--charcoal-color-border-default);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.charcoal-radio-input:disabled {
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.charcoal-radio-input:not(:disabled):hover {
|
|
47
|
-
background-color: var(--charcoal-
|
|
47
|
+
background-color: var(--charcoal-color-container-hover);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.charcoal-radio-input:not(:disabled):active {
|
|
51
|
-
background-color: var(--charcoal-
|
|
51
|
+
background-color: var(--charcoal-color-container-press);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.charcoal-radio-input:not(:disabled):focus {
|
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.charcoal-radio-input:checked:not(:disabled):hover {
|
|
73
|
-
background-color: var(--charcoal-
|
|
73
|
+
background-color: var(--charcoal-color-container-primary-hover);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.charcoal-radio-input:checked:not(:disabled):hover::after {
|
|
77
|
-
background-color: var(--charcoal-
|
|
77
|
+
background-color: var(--charcoal-color-icon-on-primary-hover);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.charcoal-radio-input:checked:not(:disabled):active {
|
|
81
|
-
background-color: var(--charcoal-
|
|
81
|
+
background-color: var(--charcoal-color-container-primary-press);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.charcoal-radio-input:checked:not(:disabled):active::after {
|
|
85
|
-
background-color: var(--charcoal-
|
|
85
|
+
background-color: var(--charcoal-color-icon-on-primary-press);
|
|
86
86
|
}
|
|
@@ -146,3 +146,43 @@ export const Invalid: StoryObj<typeof Radio> = {
|
|
|
146
146
|
)
|
|
147
147
|
},
|
|
148
148
|
}
|
|
149
|
+
|
|
150
|
+
export const TokenV2: StoryObj<typeof Radio> = {
|
|
151
|
+
parameters: {
|
|
152
|
+
tokenVersion: 'v2',
|
|
153
|
+
},
|
|
154
|
+
render: function Render() {
|
|
155
|
+
const [defaultValue, setDefaultValue] = useState<Option>(options[0])
|
|
156
|
+
const [invalidValue, setInvalidValue] = useState<Option>(options[1])
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<LayoutDiv>
|
|
160
|
+
<RadioGroup<Option>
|
|
161
|
+
name="token_v2_default_story"
|
|
162
|
+
label="default"
|
|
163
|
+
value={defaultValue}
|
|
164
|
+
onChange={setDefaultValue}
|
|
165
|
+
>
|
|
166
|
+
{options.map((option) => (
|
|
167
|
+
<Radio key={option} value={option} disabled={option === '3'}>
|
|
168
|
+
Value {option}
|
|
169
|
+
</Radio>
|
|
170
|
+
))}
|
|
171
|
+
</RadioGroup>
|
|
172
|
+
<RadioGroup<Option>
|
|
173
|
+
name="token_v2_invalid_story"
|
|
174
|
+
label="invalid"
|
|
175
|
+
value={invalidValue}
|
|
176
|
+
onChange={setInvalidValue}
|
|
177
|
+
invalid
|
|
178
|
+
>
|
|
179
|
+
{options.map((option) => (
|
|
180
|
+
<Radio key={option} value={option}>
|
|
181
|
+
Value {option}
|
|
182
|
+
</Radio>
|
|
183
|
+
))}
|
|
184
|
+
</RadioGroup>
|
|
185
|
+
</LayoutDiv>
|
|
186
|
+
)
|
|
187
|
+
},
|
|
188
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.charcoal-segmented-control {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
background-color: var(--charcoal-
|
|
4
|
+
background-color: var(--charcoal-color-container-secondary-default-a);
|
|
5
5
|
border-radius: 16px;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
padding-right: 16px;
|
|
27
27
|
padding-left: 16px;
|
|
28
28
|
border-radius: 16px;
|
|
29
|
-
color: var(--charcoal-
|
|
29
|
+
color: var(--charcoal-color-text-secondary-default);
|
|
30
30
|
font-size: 14px;
|
|
31
31
|
line-height: 22px;
|
|
32
32
|
}
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.charcoal-segmented-control-radio__label[data-checked='true'] {
|
|
40
|
-
background-color: var(--charcoal-
|
|
41
|
-
color: var(--charcoal-
|
|
40
|
+
background-color: var(--charcoal-color-container-primary-default);
|
|
41
|
+
color: var(--charcoal-color-text-on-primary-default);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.charcoal-segmented-control-radio__label[data-uniform-segment-width='true'], .charcoal-segmented-control-radio__label[data-full-width='true'] {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
|
|
5
|
-
background-color: var(--charcoal-
|
|
5
|
+
background-color: var(--charcoal-color-container-secondary-default-a);
|
|
6
6
|
border-radius: 16px;
|
|
7
7
|
|
|
8
8
|
&[data-uniform-segment-width='true'],
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
padding-right: 16px;
|
|
30
30
|
padding-left: 16px;
|
|
31
31
|
border-radius: 16px;
|
|
32
|
-
color: var(--charcoal-
|
|
32
|
+
color: var(--charcoal-color-text-secondary-default);
|
|
33
33
|
|
|
34
34
|
font-size: 14px;
|
|
35
35
|
line-height: 22px;
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
&[data-checked='true'] {
|
|
43
|
-
background-color: var(--charcoal-
|
|
44
|
-
color: var(--charcoal-
|
|
43
|
+
background-color: var(--charcoal-color-container-primary-default);
|
|
44
|
+
color: var(--charcoal-color-text-on-primary-default);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&[data-uniform-segment-width='true'],
|
|
@@ -118,3 +118,23 @@ export const UniformWidthAndFullWidthSegments: StoryObj<
|
|
|
118
118
|
fullWidth: true,
|
|
119
119
|
},
|
|
120
120
|
}
|
|
121
|
+
|
|
122
|
+
export const TokenV2: StoryObj<typeof SegmentedControl> = {
|
|
123
|
+
parameters: {
|
|
124
|
+
tokenVersion: 'v2',
|
|
125
|
+
},
|
|
126
|
+
args: {
|
|
127
|
+
name: 'token-v2',
|
|
128
|
+
data: [
|
|
129
|
+
{ label: '選択肢1', value: 'option1' },
|
|
130
|
+
{ label: '選択肢2', value: 'option2' },
|
|
131
|
+
{ label: '選択肢3', value: 'option3' },
|
|
132
|
+
{ label: 'Disabled', value: 'option4', disabled: true },
|
|
133
|
+
],
|
|
134
|
+
disabled: false,
|
|
135
|
+
readonly: false,
|
|
136
|
+
required: false,
|
|
137
|
+
uniformSegmentWidth: true,
|
|
138
|
+
fullWidth: false,
|
|
139
|
+
},
|
|
140
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
border-radius: 16px;
|
|
15
15
|
height: 16px;
|
|
16
16
|
margin: 0;
|
|
17
|
-
background-color: var(--charcoal-
|
|
17
|
+
background-color: var(--charcoal-color-container-neutral-default);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.charcoal-switch-input:disabled,
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
transform: translateX(0);
|
|
35
35
|
transition: transform 0.2s;
|
|
36
36
|
border-radius: 1024px;
|
|
37
|
-
background-color: var(--charcoal-
|
|
37
|
+
background-color: var(--charcoal-color-icon-on-primary-default);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.charcoal-switch-input:checked::after {
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.charcoal-switch-input:checked {
|
|
46
|
-
background-color: var(--charcoal-
|
|
46
|
+
background-color: var(--charcoal-color-container-primary-default);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.charcoal-switch-input:not(:disabled):hover {
|
|
50
|
-
background-color: var(--charcoal-
|
|
50
|
+
background-color: var(--charcoal-color-container-neutral-hover);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.charcoal-switch-input:not(:disabled):active {
|
|
54
|
-
background-color: var(--charcoal-
|
|
54
|
+
background-color: var(--charcoal-color-container-neutral-press);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.charcoal-switch-input:not(:disabled):focus {
|
|
@@ -66,17 +66,17 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.charcoal-switch-input:not(:disabled)::after:hover {
|
|
69
|
-
background-color: var(--charcoal-
|
|
69
|
+
background-color: var(--charcoal-color-icon-on-primary-hover);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.charcoal-switch-input:not(:disabled)::after:active {
|
|
73
|
-
background-color: var(--charcoal-
|
|
73
|
+
background-color: var(--charcoal-color-icon-on-primary-press);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.charcoal-switch-input:not(:disabled):checked:hover {
|
|
77
|
-
background-color: var(--charcoal-
|
|
77
|
+
background-color: var(--charcoal-color-container-primary-hover);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.charcoal-switch-input:not(:disabled):checked:active {
|
|
81
|
-
background-color: var(--charcoal-
|
|
81
|
+
background-color: var(--charcoal-color-container-primary-press);
|
|
82
82
|
}
|
|
@@ -81,3 +81,22 @@ export const Disabled: StoryObj<typeof Switch> = {
|
|
|
81
81
|
)
|
|
82
82
|
},
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
export const TokenV2: StoryObj<typeof Switch> = {
|
|
86
|
+
parameters: {
|
|
87
|
+
tokenVersion: 'v2',
|
|
88
|
+
},
|
|
89
|
+
render: function Render() {
|
|
90
|
+
const [checked, setChecked] = useState(true)
|
|
91
|
+
return (
|
|
92
|
+
<div style={{ display: 'grid', gap: 16 }}>
|
|
93
|
+
<Switch name="token-v2-default" checked={checked} onChange={setChecked}>
|
|
94
|
+
Label
|
|
95
|
+
</Switch>
|
|
96
|
+
<Switch name="token-v2-disabled" checked disabled>
|
|
97
|
+
Disabled
|
|
98
|
+
</Switch>
|
|
99
|
+
</div>
|
|
100
|
+
)
|
|
101
|
+
},
|
|
102
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
.charcoal-tag-item {
|
|
2
|
-
--charcoal-tag-item-color: var(--charcoal-
|
|
2
|
+
--charcoal-tag-item-color: var(--charcoal-color-text-on-primary-default);
|
|
3
3
|
--charcoal-tag-item-size: 40px;
|
|
4
4
|
--charcoal-tag-item-padding-left: 24px;
|
|
5
5
|
--charcoal-tag-item-padding-right: 24px;
|
|
6
|
+
--charcoal-tag-item-bg: ;
|
|
6
7
|
isolation: isolate;
|
|
7
8
|
position: relative;
|
|
8
9
|
appearance: none;
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
.charcoal-tag-item[data-state='inactive'] {
|
|
42
|
-
--charcoal-tag-item-color: var(--charcoal-
|
|
43
|
+
--charcoal-tag-item-color: var(--charcoal-color-text-secondary-default);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
.charcoal-tag-item[data-state='active'] {
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
.charcoal-tag-item__bg[data-bg-variant='image'] {
|
|
74
|
-
background-color: var(--charcoal-
|
|
75
|
+
background-color: var(--charcoal-color-container-on-img-default);
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
.charcoal-tag-item__bg[data-bg-variant='image']::before {
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
.charcoal-tag-item__bg[data-state='inactive'] {
|
|
92
|
-
background-color: var(--charcoal-
|
|
93
|
+
background-color: var(--charcoal-color-container-secondary-default);
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
.charcoal-tag-item__label {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
.charcoal-tag-item {
|
|
2
|
-
--charcoal-tag-item-color: var(--charcoal-
|
|
2
|
+
--charcoal-tag-item-color: var(--charcoal-color-text-on-primary-default);
|
|
3
3
|
--charcoal-tag-item-size: 40px;
|
|
4
4
|
--charcoal-tag-item-padding-left: 24px;
|
|
5
5
|
--charcoal-tag-item-padding-right: 24px;
|
|
6
|
+
--charcoal-tag-item-bg: ;
|
|
6
7
|
|
|
7
8
|
isolation: isolate;
|
|
8
9
|
position: relative;
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
&[data-state='inactive'] {
|
|
47
|
-
--charcoal-tag-item-color: var(--charcoal-
|
|
48
|
+
--charcoal-tag-item-color: var(--charcoal-color-text-secondary-default);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
&[data-state='active'] {
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
background-color: var(--charcoal-tag-item-bg);
|
|
81
82
|
|
|
82
83
|
&[data-bg-variant='image'] {
|
|
83
|
-
background-color: var(--charcoal-
|
|
84
|
+
background-color: var(--charcoal-color-container-on-img-default);
|
|
84
85
|
|
|
85
86
|
&::before {
|
|
86
87
|
content: '';
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
&[data-state='inactive'] {
|
|
101
|
-
background-color: var(--charcoal-
|
|
102
|
+
background-color: var(--charcoal-color-container-secondary-default);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -64,3 +64,20 @@ export const Disabled: StoryObj<typeof TagItem> = {
|
|
|
64
64
|
return <TagItem label="#女の子" disabled />
|
|
65
65
|
},
|
|
66
66
|
}
|
|
67
|
+
|
|
68
|
+
export const TokenV2: StoryObj<typeof TagItem> = {
|
|
69
|
+
parameters: {
|
|
70
|
+
tokenVersion: 'v2',
|
|
71
|
+
},
|
|
72
|
+
render: function Render() {
|
|
73
|
+
return (
|
|
74
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
|
|
75
|
+
<TagItem label="#女の子" translatedLabel="girl" />
|
|
76
|
+
<TagItem label="#女の子" status="active" />
|
|
77
|
+
<TagItem label="#女の子" status="inactive" />
|
|
78
|
+
<TagItem label="#女の子" disabled />
|
|
79
|
+
<TagItem label="女の子" bgColor="var(--charcoal-brand)" />
|
|
80
|
+
</div>
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
}
|
|
@@ -84,6 +84,36 @@ export const Invalid: StoryObj<typeof TextArea> = {
|
|
|
84
84
|
},
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
export const TokenV2: StoryObj<typeof TextArea> = {
|
|
88
|
+
parameters: {
|
|
89
|
+
tokenVersion: 'v2',
|
|
90
|
+
},
|
|
91
|
+
render() {
|
|
92
|
+
return (
|
|
93
|
+
<div style={{ display: 'grid', gap: 24, width: 320 }}>
|
|
94
|
+
<TextArea
|
|
95
|
+
label="Label"
|
|
96
|
+
showLabel
|
|
97
|
+
required
|
|
98
|
+
requiredText="*必須"
|
|
99
|
+
subLabel={<Clickable>Text Link</Clickable>}
|
|
100
|
+
placeholder="Placeholder"
|
|
101
|
+
assistiveText="説明が入ります"
|
|
102
|
+
showCount
|
|
103
|
+
maxLength={100}
|
|
104
|
+
/>
|
|
105
|
+
<TextArea
|
|
106
|
+
label="Invalid"
|
|
107
|
+
invalid
|
|
108
|
+
placeholder="Placeholder"
|
|
109
|
+
assistiveText="エラーメッセージ"
|
|
110
|
+
/>
|
|
111
|
+
<TextArea label="Disabled" disabled value="Disabled value" />
|
|
112
|
+
</div>
|
|
113
|
+
)
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
|
|
87
117
|
export const ReadOnly: StoryObj<typeof TextArea> = {
|
|
88
118
|
render() {
|
|
89
119
|
return <TextArea label="Label" readOnly value="読み取り専用" />
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.charcoal-text-area-container {
|
|
12
|
+
/* Runtime variable overridden by the React component. */
|
|
13
|
+
--charcoal-text-area-rows: 4;
|
|
12
14
|
position: relative;
|
|
13
15
|
overflow: hidden;
|
|
14
|
-
color: var(--charcoal-
|
|
15
|
-
background-color: var(--charcoal-
|
|
16
|
+
color: var(--charcoal-color-text-secondary-default);
|
|
17
|
+
background-color: var(--charcoal-color-container-secondary-default-a);
|
|
16
18
|
border-radius: 4px;
|
|
17
19
|
transition: 0.2s background-color,
|
|
18
20
|
0.2s box-shadow;
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
.charcoal-text-area-container:not([aria-disabled='true']):hover {
|
|
32
|
-
background-color: var(--charcoal-
|
|
34
|
+
background-color: var(--charcoal-color-container-secondary-hover-a);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
.charcoal-text-area-container[aria-invalid='true']:focus-within {
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
.charcoal-text-area-textarea::placeholder {
|
|
67
|
-
color: var(--charcoal-
|
|
69
|
+
color: var(--charcoal-color-text-placeholder-default);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
.charcoal-text-area-counter {
|
|
@@ -73,6 +75,6 @@
|
|
|
73
75
|
right: 8px;
|
|
74
76
|
line-height: 22px;
|
|
75
77
|
font-size: 14px;
|
|
76
|
-
color: var(--charcoal-
|
|
78
|
+
color: var(--charcoal-color-text-tertiary-default);
|
|
77
79
|
}
|
|
78
80
|
|