@charcoal-ui/react 3.7.0 → 3.8.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/StyledButton.d.ts +1 -0
- package/dist/components/Button/StyledButton.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.story.d.ts +16 -32
- package/dist/components/Button/index.story.d.ts.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index.story.d.ts +7 -7
- package/dist/components/DropdownSelector/ListItem/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/MenuList/index.story.d.ts +6 -9
- package/dist/components/DropdownSelector/MenuList/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.story.d.ts +3 -7
- package/dist/components/DropdownSelector/Popover/index.story.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.story.d.ts +9 -12
- package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
- package/dist/components/Icon/index.story.d.ts +4 -26
- package/dist/components/Icon/index.story.d.ts.map +1 -1
- package/dist/components/IconButton/index.d.ts +1 -0
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/IconButton/index.story.d.ts +6 -25
- package/dist/components/IconButton/index.story.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts +8 -0
- package/dist/components/LoadingSpinner/LoadingSpinnerIcon.story.d.ts.map +1 -0
- package/dist/components/LoadingSpinner/index.d.ts +2 -2
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/index.story.d.ts +4 -7
- package/dist/components/LoadingSpinner/index.story.d.ts.map +1 -1
- package/dist/components/Modal/index.story.d.ts +16 -41
- package/dist/components/Modal/index.story.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts +0 -2
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Radio/index.story.d.ts +12 -23
- package/dist/components/Radio/index.story.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.story.d.ts +5 -8
- package/dist/components/SegmentedControl/index.story.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.story.d.ts +7 -12
- package/dist/components/Switch/index.story.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TagItem/index.story.d.ts +14 -24
- package/dist/components/TagItem/index.story.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.story.d.ts +7 -25
- package/dist/components/TextArea/TextArea.story.d.ts.map +1 -1
- package/dist/components/TextField/TextField.story.d.ts +13 -20
- 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 +80 -86
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +80 -86
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +4 -4
- package/package.json +6 -6
- package/src/components/Button/StyledButton.tsx +19 -14
- package/src/components/Button/__snapshots__/index.story.storyshot +314 -118
- package/src/components/Button/index.story.tsx +141 -138
- package/src/components/Button/index.tsx +3 -0
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +12 -27
- package/src/components/Checkbox/index.tsx +2 -12
- package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -2
- package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +42 -37
- package/src/components/DropdownSelector/ListItem/index.story.tsx +8 -4
- package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +38 -38
- package/src/components/DropdownSelector/MenuList/index.story.tsx +33 -27
- package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +11 -5
- package/src/components/DropdownSelector/Popover/index.story.tsx +6 -6
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +145 -47
- package/src/components/DropdownSelector/index.story.tsx +207 -204
- package/src/components/DropdownSelector/index.tsx +17 -10
- package/src/components/Icon/__snapshots__/index.story.storyshot +1 -1
- package/src/components/Icon/index.story.tsx +8 -12
- package/src/components/IconButton/__snapshots__/index.story.storyshot +130 -13
- package/src/components/IconButton/index.story.tsx +30 -23
- package/src/components/IconButton/index.tsx +32 -20
- package/src/components/LoadingSpinner/LoadingSpinnerIcon.story.tsx +12 -0
- package/src/components/LoadingSpinner/__snapshots__/LoadingSpinnerIcon.story.storyshot +28 -0
- package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +1 -35
- package/src/components/LoadingSpinner/index.story.tsx +11 -54
- package/src/components/LoadingSpinner/index.tsx +1 -1
- package/src/components/Modal/__snapshots__/index.story.storyshot +212 -171
- package/src/components/Modal/index.story.tsx +139 -133
- package/src/components/MultiSelect/__snapshots__/index.story.storyshot +56 -4
- package/src/components/MultiSelect/index.tsx +3 -0
- package/src/components/Radio/__snapshots__/index.story.storyshot +981 -121
- package/src/components/Radio/index.story.tsx +128 -63
- package/src/components/Radio/index.tsx +10 -16
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +2 -2
- package/src/components/SegmentedControl/index.story.tsx +24 -29
- package/src/components/Switch/__snapshots__/index.story.storyshot +184 -26
- package/src/components/Switch/index.story.tsx +72 -48
- package/src/components/Switch/index.tsx +2 -7
- package/src/components/TagItem/__snapshots__/index.story.storyshot +72 -33
- package/src/components/TagItem/index.story.tsx +154 -159
- package/src/components/TagItem/index.tsx +2 -6
- package/src/components/TextArea/TextArea.story.tsx +29 -32
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +127 -73
- package/src/components/TextField/TextField.story.tsx +67 -66
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +182 -147
- package/src/components/TextField/index.tsx +0 -7
|
@@ -1,7 +1,45 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
4
|
-
.
|
|
3
|
+
exports[`Storybook Tests TextArea AutoHeight 1`] = `
|
|
4
|
+
.c7 {
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
-webkit-appearance: none;
|
|
7
|
+
-moz-appearance: none;
|
|
8
|
+
appearance: none;
|
|
9
|
+
background: transparent;
|
|
10
|
+
padding: 0;
|
|
11
|
+
border-style: none;
|
|
12
|
+
outline: none;
|
|
13
|
+
color: inherit;
|
|
14
|
+
text-rendering: inherit;
|
|
15
|
+
-webkit-letter-spacing: inherit;
|
|
16
|
+
-moz-letter-spacing: inherit;
|
|
17
|
+
-ms-letter-spacing: inherit;
|
|
18
|
+
letter-spacing: inherit;
|
|
19
|
+
word-spacing: inherit;
|
|
20
|
+
-webkit-text-decoration: none;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
font: inherit;
|
|
23
|
+
margin: 0;
|
|
24
|
+
overflow: visible;
|
|
25
|
+
text-transform: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.c7:disabled,
|
|
29
|
+
.c7[aria-disabled]:not([aria-disabled=false]) {
|
|
30
|
+
cursor: default;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.c7:focus {
|
|
34
|
+
outline: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.c7::-moz-focus-inner {
|
|
38
|
+
border-style: none;
|
|
39
|
+
padding: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.c4 {
|
|
5
43
|
font-size: 14px;
|
|
6
44
|
line-height: 22px;
|
|
7
45
|
font-weight: bold;
|
|
@@ -9,7 +47,7 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
9
47
|
color: var(--charcoal-text1);
|
|
10
48
|
}
|
|
11
49
|
|
|
12
|
-
.
|
|
50
|
+
.c4::before {
|
|
13
51
|
display: block;
|
|
14
52
|
width: 0;
|
|
15
53
|
height: 0;
|
|
@@ -17,7 +55,7 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
17
55
|
margin-top: -4px;
|
|
18
56
|
}
|
|
19
57
|
|
|
20
|
-
.
|
|
58
|
+
.c4::after {
|
|
21
59
|
display: block;
|
|
22
60
|
width: 0;
|
|
23
61
|
height: 0;
|
|
@@ -25,7 +63,7 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
25
63
|
margin-bottom: -4px;
|
|
26
64
|
}
|
|
27
65
|
|
|
28
|
-
.
|
|
66
|
+
.c6 {
|
|
29
67
|
font-size: 14px;
|
|
30
68
|
line-height: 22px;
|
|
31
69
|
display: flow-root;
|
|
@@ -34,7 +72,7 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
34
72
|
transition: 0.2s color,0.2s box-shadow;
|
|
35
73
|
}
|
|
36
74
|
|
|
37
|
-
.
|
|
75
|
+
.c6::before {
|
|
38
76
|
display: block;
|
|
39
77
|
width: 0;
|
|
40
78
|
height: 0;
|
|
@@ -42,7 +80,7 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
42
80
|
margin-top: -4px;
|
|
43
81
|
}
|
|
44
82
|
|
|
45
|
-
.
|
|
83
|
+
.c6::after {
|
|
46
84
|
display: block;
|
|
47
85
|
width: 0;
|
|
48
86
|
height: 0;
|
|
@@ -50,27 +88,27 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
50
88
|
margin-bottom: -4px;
|
|
51
89
|
}
|
|
52
90
|
|
|
53
|
-
.
|
|
54
|
-
.
|
|
91
|
+
.c6:not(:disabled):not([aria-disabled]):hover,
|
|
92
|
+
.c6[aria-disabled='false']:hover {
|
|
55
93
|
color: var(--charcoal-text3-hover);
|
|
56
94
|
}
|
|
57
95
|
|
|
58
|
-
.
|
|
59
|
-
.
|
|
96
|
+
.c6:not(:disabled):not([aria-disabled]):active,
|
|
97
|
+
.c6[aria-disabled='false']:active {
|
|
60
98
|
color: var(--charcoal-text3-press);
|
|
61
99
|
}
|
|
62
100
|
|
|
63
|
-
.
|
|
64
|
-
.
|
|
65
|
-
.
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
.
|
|
101
|
+
.c6:not(:disabled):not([aria-disabled]):active,
|
|
102
|
+
.c6[aria-disabled='false']:active,
|
|
103
|
+
.c6:not(:disabled):not([aria-disabled]):focus,
|
|
104
|
+
.c6[aria-disabled='false']:focus,
|
|
105
|
+
.c6:not(:disabled):not([aria-disabled]):focus-visible,
|
|
106
|
+
.c6[aria-disabled='false']:focus-visible {
|
|
69
107
|
outline: none;
|
|
70
108
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
71
109
|
}
|
|
72
110
|
|
|
73
|
-
.
|
|
111
|
+
.c2 {
|
|
74
112
|
display: -webkit-inline-box;
|
|
75
113
|
display: -webkit-inline-flex;
|
|
76
114
|
display: -ms-inline-flexbox;
|
|
@@ -81,15 +119,15 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
81
119
|
align-items: center;
|
|
82
120
|
}
|
|
83
121
|
|
|
84
|
-
.
|
|
122
|
+
.c2 > .c5 {
|
|
85
123
|
margin-left: auto;
|
|
86
124
|
}
|
|
87
125
|
|
|
88
|
-
.
|
|
126
|
+
.c3 {
|
|
89
127
|
margin-bottom: 8px;
|
|
90
128
|
}
|
|
91
129
|
|
|
92
|
-
.
|
|
130
|
+
.c1 {
|
|
93
131
|
display: -webkit-box;
|
|
94
132
|
display: -webkit-flex;
|
|
95
133
|
display: -ms-flexbox;
|
|
@@ -99,7 +137,7 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
99
137
|
flex-direction: column;
|
|
100
138
|
}
|
|
101
139
|
|
|
102
|
-
.
|
|
140
|
+
.c8 {
|
|
103
141
|
position: relative;
|
|
104
142
|
overflow: hidden;
|
|
105
143
|
color: var(--charcoal-text2);
|
|
@@ -110,17 +148,17 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
110
148
|
height: calc(22px * 4 + 18px);
|
|
111
149
|
}
|
|
112
150
|
|
|
113
|
-
.
|
|
114
|
-
.
|
|
151
|
+
.c8:not([aria-disabled]):hover,
|
|
152
|
+
.c8 [aria-disabled='false']:hover {
|
|
115
153
|
background-color: var(--charcoal-surface3-hover);
|
|
116
154
|
}
|
|
117
155
|
|
|
118
|
-
.
|
|
156
|
+
.c8:focus-within {
|
|
119
157
|
outline: none;
|
|
120
158
|
box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
|
|
121
159
|
}
|
|
122
160
|
|
|
123
|
-
.
|
|
161
|
+
.c9 {
|
|
124
162
|
border: none;
|
|
125
163
|
outline: none;
|
|
126
164
|
resize: none;
|
|
@@ -144,22 +182,27 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
144
182
|
background: none;
|
|
145
183
|
}
|
|
146
184
|
|
|
147
|
-
.
|
|
185
|
+
.c9::-webkit-input-placeholder {
|
|
148
186
|
color: var(--charcoal-text3);
|
|
149
187
|
}
|
|
150
188
|
|
|
151
|
-
.
|
|
189
|
+
.c9::-moz-placeholder {
|
|
152
190
|
color: var(--charcoal-text3);
|
|
153
191
|
}
|
|
154
192
|
|
|
155
|
-
.
|
|
193
|
+
.c9:-ms-input-placeholder {
|
|
156
194
|
color: var(--charcoal-text3);
|
|
157
195
|
}
|
|
158
196
|
|
|
159
|
-
.
|
|
197
|
+
.c9::placeholder {
|
|
160
198
|
color: var(--charcoal-text3);
|
|
161
199
|
}
|
|
162
200
|
|
|
201
|
+
.c0 {
|
|
202
|
+
display: grid;
|
|
203
|
+
gap: 24px;
|
|
204
|
+
}
|
|
205
|
+
|
|
163
206
|
<div
|
|
164
207
|
data-dark={false}
|
|
165
208
|
>
|
|
@@ -167,57 +210,68 @@ exports[`Storyshots TextArea Auto Height 1`] = `
|
|
|
167
210
|
className="c0"
|
|
168
211
|
>
|
|
169
212
|
<div
|
|
170
|
-
className="c1
|
|
171
|
-
style={
|
|
172
|
-
Object {
|
|
173
|
-
"border": 0,
|
|
174
|
-
"clip": "rect(0 0 0 0)",
|
|
175
|
-
"clipPath": "inset(50%)",
|
|
176
|
-
"height": "1px",
|
|
177
|
-
"margin": "-1px",
|
|
178
|
-
"overflow": "hidden",
|
|
179
|
-
"padding": 0,
|
|
180
|
-
"position": "absolute",
|
|
181
|
-
"whiteSpace": "nowrap",
|
|
182
|
-
"width": "1px",
|
|
183
|
-
}
|
|
184
|
-
}
|
|
213
|
+
className="c1"
|
|
185
214
|
>
|
|
186
|
-
<label
|
|
187
|
-
className="c3"
|
|
188
|
-
htmlFor="test-id"
|
|
189
|
-
id="test-id"
|
|
190
|
-
>
|
|
191
|
-
Label
|
|
192
|
-
</label>
|
|
193
215
|
<div
|
|
194
|
-
className="
|
|
216
|
+
className="c2 c3"
|
|
217
|
+
style={
|
|
218
|
+
Object {
|
|
219
|
+
"border": 0,
|
|
220
|
+
"clip": "rect(0 0 0 0)",
|
|
221
|
+
"clipPath": "inset(50%)",
|
|
222
|
+
"height": "1px",
|
|
223
|
+
"margin": "-1px",
|
|
224
|
+
"overflow": "hidden",
|
|
225
|
+
"padding": 0,
|
|
226
|
+
"position": "absolute",
|
|
227
|
+
"whiteSpace": "nowrap",
|
|
228
|
+
"width": "1px",
|
|
229
|
+
}
|
|
230
|
+
}
|
|
195
231
|
>
|
|
196
|
-
<
|
|
232
|
+
<label
|
|
233
|
+
className="c4"
|
|
234
|
+
htmlFor="test-id"
|
|
235
|
+
id="test-id"
|
|
236
|
+
>
|
|
237
|
+
Label
|
|
238
|
+
</label>
|
|
239
|
+
<div
|
|
240
|
+
className="c5 c6"
|
|
241
|
+
>
|
|
242
|
+
<span>
|
|
243
|
+
<button
|
|
244
|
+
className="c7"
|
|
245
|
+
onClick={[Function]}
|
|
246
|
+
>
|
|
247
|
+
Text Link
|
|
248
|
+
</button>
|
|
249
|
+
</span>
|
|
250
|
+
</div>
|
|
197
251
|
</div>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
className="c6"
|
|
201
|
-
rows={4}
|
|
202
|
-
>
|
|
203
|
-
<textarea
|
|
204
|
-
aria-labelledby="test-id"
|
|
205
|
-
className="c7"
|
|
206
|
-
disabled={false}
|
|
207
|
-
id="test-id"
|
|
208
|
-
onChange={[Function]}
|
|
209
|
-
placeholder="TextArea"
|
|
210
|
-
readOnly={false}
|
|
211
|
-
required={false}
|
|
252
|
+
<div
|
|
253
|
+
className="c8"
|
|
212
254
|
rows={4}
|
|
213
|
-
|
|
214
|
-
|
|
255
|
+
>
|
|
256
|
+
<textarea
|
|
257
|
+
aria-labelledby="test-id"
|
|
258
|
+
className="c9"
|
|
259
|
+
disabled={false}
|
|
260
|
+
id="test-id"
|
|
261
|
+
onChange={[Function]}
|
|
262
|
+
placeholder="Text Area"
|
|
263
|
+
readOnly={false}
|
|
264
|
+
required={false}
|
|
265
|
+
rows={4}
|
|
266
|
+
value=""
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
215
269
|
</div>
|
|
216
270
|
</div>
|
|
217
271
|
</div>
|
|
218
272
|
`;
|
|
219
273
|
|
|
220
|
-
exports[`
|
|
274
|
+
exports[`Storybook Tests TextArea Default 1`] = `
|
|
221
275
|
.c7 {
|
|
222
276
|
cursor: pointer;
|
|
223
277
|
-webkit-appearance: none;
|
|
@@ -488,7 +542,7 @@ exports[`Storyshots TextArea Default 1`] = `
|
|
|
488
542
|
</div>
|
|
489
543
|
`;
|
|
490
544
|
|
|
491
|
-
exports[`
|
|
545
|
+
exports[`Storybook Tests TextArea HasCount 1`] = `
|
|
492
546
|
.c7 {
|
|
493
547
|
cursor: pointer;
|
|
494
548
|
-webkit-appearance: none;
|
|
@@ -774,7 +828,7 @@ exports[`Storyshots TextArea Has Count 1`] = `
|
|
|
774
828
|
</div>
|
|
775
829
|
`;
|
|
776
830
|
|
|
777
|
-
exports[`
|
|
831
|
+
exports[`Storybook Tests TextArea HasLabel 1`] = `
|
|
778
832
|
.c9 {
|
|
779
833
|
cursor: pointer;
|
|
780
834
|
-webkit-appearance: none;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components'
|
|
2
|
-
import { Story } from '../../_lib/compat'
|
|
3
2
|
import Clickable from '../Clickable'
|
|
4
|
-
import TextField
|
|
3
|
+
import TextField from '.'
|
|
5
4
|
import { px } from '@charcoal-ui/utils'
|
|
6
5
|
import IconButton from '../IconButton'
|
|
7
6
|
import { useCallback, useState } from 'react'
|
|
7
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
10
|
title: 'TextField',
|
|
@@ -12,86 +12,53 @@ export default {
|
|
|
12
12
|
argTypes: {},
|
|
13
13
|
args: {
|
|
14
14
|
showLabel: false,
|
|
15
|
-
label: 'Label',
|
|
16
15
|
assistiveText: '',
|
|
17
16
|
disabled: false,
|
|
18
17
|
required: false,
|
|
19
18
|
invalid: false,
|
|
19
|
+
label: 'Label',
|
|
20
|
+
requiredText: '*必須',
|
|
21
|
+
subLabel: <Clickable>Text Link</Clickable>,
|
|
22
|
+
placeholder: 'TextField',
|
|
20
23
|
},
|
|
21
|
-
|
|
24
|
+
render: function Render(args) {
|
|
25
|
+
return (
|
|
26
|
+
<Container>
|
|
27
|
+
<TextField {...args} />
|
|
28
|
+
</Container>
|
|
29
|
+
)
|
|
30
|
+
},
|
|
31
|
+
} as Meta<typeof TextField>
|
|
22
32
|
|
|
23
33
|
const Container = styled.div`
|
|
24
34
|
display: grid;
|
|
25
35
|
gap: ${({ theme }) => px(theme.spacing[24])};
|
|
26
36
|
`
|
|
27
37
|
|
|
28
|
-
const
|
|
29
|
-
<Container>
|
|
30
|
-
<TextField
|
|
31
|
-
label="Label"
|
|
32
|
-
requiredText="*必須"
|
|
33
|
-
subLabel={<Clickable>Text Link</Clickable>}
|
|
34
|
-
placeholder="TextField"
|
|
35
|
-
{...args}
|
|
36
|
-
/>
|
|
37
|
-
</Container>
|
|
38
|
-
)
|
|
38
|
+
export const Default = {}
|
|
39
39
|
|
|
40
|
-
export const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
required: true,
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const HasCount = Template.bind({})
|
|
50
|
-
HasCount.args = {
|
|
51
|
-
showCount: true,
|
|
52
|
-
maxLength: 100,
|
|
40
|
+
export const HasLabel = {
|
|
41
|
+
args: {
|
|
42
|
+
showLabel: true,
|
|
43
|
+
assistiveText: 'Assistive text',
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
53
46
|
}
|
|
54
47
|
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
maxLength: 200,
|
|
61
|
-
prefix: '/home/john/',
|
|
62
|
-
suffix: '.png',
|
|
48
|
+
export const HasCount = {
|
|
49
|
+
args: {
|
|
50
|
+
showCount: true,
|
|
51
|
+
maxLength: 100,
|
|
52
|
+
},
|
|
63
53
|
}
|
|
64
54
|
|
|
65
|
-
export const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, [])
|
|
73
|
-
return (
|
|
74
|
-
<TextField
|
|
75
|
-
{...args}
|
|
76
|
-
label="Label"
|
|
77
|
-
placeholder="作品を検索"
|
|
78
|
-
value={value}
|
|
79
|
-
onChange={handleChange}
|
|
80
|
-
prefix={
|
|
81
|
-
<PrefixIconWrap>
|
|
82
|
-
<pixiv-icon name="16/Search" />
|
|
83
|
-
</PrefixIconWrap>
|
|
84
|
-
}
|
|
85
|
-
suffix={
|
|
86
|
-
<IconButton
|
|
87
|
-
variant="Overlay"
|
|
88
|
-
icon={'16/Remove'}
|
|
89
|
-
size="XS"
|
|
90
|
-
onClick={handleClear}
|
|
91
|
-
/>
|
|
92
|
-
}
|
|
93
|
-
/>
|
|
94
|
-
)
|
|
55
|
+
export const HasAffix: StoryObj<typeof TextField> = {
|
|
56
|
+
args: {
|
|
57
|
+
showCount: true,
|
|
58
|
+
maxLength: 200,
|
|
59
|
+
prefix: '/home/john/',
|
|
60
|
+
suffix: '.png',
|
|
61
|
+
},
|
|
95
62
|
}
|
|
96
63
|
|
|
97
64
|
const PrefixIconWrap = styled.div`
|
|
@@ -99,3 +66,37 @@ const PrefixIconWrap = styled.div`
|
|
|
99
66
|
align-items: center;
|
|
100
67
|
color: ${({ theme }) => theme.color.text3};
|
|
101
68
|
`
|
|
69
|
+
|
|
70
|
+
export const PrefixIcon: StoryObj<typeof TextField> = {
|
|
71
|
+
render: function Render(args) {
|
|
72
|
+
const [value, setValue] = useState('')
|
|
73
|
+
const handleChange = useCallback((value: string) => {
|
|
74
|
+
setValue(value)
|
|
75
|
+
}, [])
|
|
76
|
+
const handleClear = useCallback(() => {
|
|
77
|
+
setValue('')
|
|
78
|
+
}, [])
|
|
79
|
+
return (
|
|
80
|
+
<TextField
|
|
81
|
+
{...args}
|
|
82
|
+
label="Label"
|
|
83
|
+
placeholder="作品を検索"
|
|
84
|
+
value={value}
|
|
85
|
+
onChange={handleChange}
|
|
86
|
+
prefix={
|
|
87
|
+
<PrefixIconWrap>
|
|
88
|
+
<pixiv-icon name="16/Search" />
|
|
89
|
+
</PrefixIconWrap>
|
|
90
|
+
}
|
|
91
|
+
suffix={
|
|
92
|
+
<IconButton
|
|
93
|
+
variant="Overlay"
|
|
94
|
+
icon={'16/Remove'}
|
|
95
|
+
size="XS"
|
|
96
|
+
onClick={handleClear}
|
|
97
|
+
/>
|
|
98
|
+
}
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
},
|
|
102
|
+
}
|