@charcoal-ui/react 3.5.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.d.ts.map +1 -1
- package/dist/components/Checkbox/index.story.d.ts +6 -15
- 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/DropdownMenuItem.d.ts.map +1 -1
- package/dist/components/DropdownSelector/ListItem/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.d.ts.map +1 -1
- package/dist/components/DropdownSelector/index.story.d.ts +1 -0
- package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
- package/dist/components/FieldLabel/index.d.ts.map +1 -1
- package/dist/components/Icon/index.story.d.ts +1 -1
- package/dist/components/IconButton/index.d.ts.map +1 -1
- package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
- package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.story.d.ts +1 -0
- package/dist/components/Modal/index.story.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.story.d.ts +2 -0
- package/dist/components/MultiSelect/index.story.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts +1 -1
- package/dist/components/SegmentedControl/RadioGroupContext.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/TagItem/index.d.ts.map +1 -1
- package/dist/components/TextField/TextField.story.d.ts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/index.cjs.js +1026 -384
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +991 -349
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +4 -4
- package/package.json +18 -21
- package/src/_lib/compat.ts +8 -0
- package/src/components/Button/StyledButton.tsx +66 -0
- package/src/components/Button/__snapshots__/index.story.storyshot +312 -592
- package/src/components/Button/index.tsx +14 -70
- package/src/components/Button/lib/variantToBackground.tsx +19 -0
- package/src/components/Button/lib/variantToFont.tsx +19 -0
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +209 -40
- package/src/components/Checkbox/index.story.tsx +82 -64
- package/src/components/Checkbox/index.tsx +47 -17
- package/src/components/Clickable/__snapshots__/index.story.storyshot +4 -0
- package/src/components/Clickable/index.story.tsx +12 -9
- package/src/components/Clickable/index.tsx +1 -0
- package/src/components/DropdownSelector/DropdownMenuItem.tsx +6 -3
- package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +3 -10
- package/src/components/DropdownSelector/ListItem/index.tsx +6 -4
- package/src/components/DropdownSelector/MenuItemGroup/index.tsx +1 -1
- package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +4 -13
- package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +20 -37
- package/src/components/DropdownSelector/Popover/index.tsx +5 -8
- package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +227 -294
- package/src/components/DropdownSelector/index.story.tsx +33 -0
- package/src/components/DropdownSelector/index.tsx +63 -20
- package/src/components/FieldLabel/index.tsx +77 -12
- package/src/components/IconButton/__snapshots__/index.story.storyshot +30 -54
- package/src/components/IconButton/index.tsx +51 -26
- package/src/components/LoadingSpinner/index.tsx +3 -6
- package/src/components/Modal/Dialog/index.tsx +1 -1
- package/src/components/Modal/ModalPlumbing.tsx +26 -5
- package/src/components/Modal/__snapshots__/index.story.storyshot +2450 -108
- package/src/components/Modal/index.story.tsx +27 -0
- package/src/components/Modal/index.tsx +19 -4
- package/src/components/MultiSelect/__snapshots__/index.story.storyshot +528 -25
- package/src/components/MultiSelect/index.story.tsx +60 -0
- package/src/components/MultiSelect/index.tsx +82 -22
- package/src/components/Radio/__snapshots__/index.story.storyshot +32 -49
- package/src/components/Radio/index.tsx +71 -23
- package/src/components/SegmentedControl/RadioGroupContext.tsx +1 -1
- package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +9 -10
- package/src/components/SegmentedControl/index.tsx +36 -16
- package/src/components/Switch/__snapshots__/index.story.storyshot +6 -18
- package/src/components/Switch/index.tsx +10 -15
- package/src/components/TagItem/__snapshots__/index.story.storyshot +39 -158
- package/src/components/TagItem/index.tsx +84 -19
- package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +55 -91
- package/src/components/TextField/TextField.story.tsx +35 -18
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +92 -148
- package/src/components/TextField/index.tsx +0 -1
- 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 -763
- package/src/components/Checkbox/performance.test.tsx +0 -30
- package/src/components/Checkbox/snapshot.test.tsx +0 -66
package/dist/index.esm.js
CHANGED
|
@@ -50,7 +50,6 @@ function CharcoalProvider({
|
|
|
50
50
|
|
|
51
51
|
// src/components/Button/index.tsx
|
|
52
52
|
import { forwardRef as forwardRef3 } from "react";
|
|
53
|
-
import styled3 from "styled-components";
|
|
54
53
|
|
|
55
54
|
// src/_lib/index.ts
|
|
56
55
|
function unreachable(value) {
|
|
@@ -74,14 +73,48 @@ function countCodePointsInString(string) {
|
|
|
74
73
|
return Array.from(string).length;
|
|
75
74
|
}
|
|
76
75
|
|
|
77
|
-
// src/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
// src/components/Button/lib/variantToFont.tsx
|
|
77
|
+
function variantToFont(variant) {
|
|
78
|
+
switch (variant) {
|
|
79
|
+
case "Overlay":
|
|
80
|
+
return "text5";
|
|
81
|
+
case "Default":
|
|
82
|
+
return "text2";
|
|
83
|
+
case "Primary":
|
|
84
|
+
return "text5";
|
|
85
|
+
case "Navigation":
|
|
86
|
+
return "text5";
|
|
87
|
+
case "Danger":
|
|
88
|
+
return "text5";
|
|
89
|
+
default:
|
|
90
|
+
return unreachable(variant);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// src/components/Button/lib/variantToBackground.tsx
|
|
95
|
+
function variantToBackground(variant) {
|
|
96
|
+
switch (variant) {
|
|
97
|
+
case "Overlay":
|
|
98
|
+
return "surface4";
|
|
99
|
+
case "Default":
|
|
100
|
+
return "surface3";
|
|
101
|
+
case "Primary":
|
|
102
|
+
return "brand";
|
|
103
|
+
case "Navigation":
|
|
104
|
+
return "surface6";
|
|
105
|
+
case "Danger":
|
|
106
|
+
return "assertive";
|
|
107
|
+
default:
|
|
108
|
+
return unreachable(variant);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/components/Button/StyledButton.tsx
|
|
113
|
+
import styled2, { css } from "styled-components";
|
|
81
114
|
|
|
82
115
|
// src/components/Clickable/index.tsx
|
|
83
116
|
import * as React2 from "react";
|
|
84
|
-
import
|
|
117
|
+
import styled from "styled-components";
|
|
85
118
|
import { disabledSelector } from "@charcoal-ui/utils";
|
|
86
119
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
87
120
|
var Clickable = React2.forwardRef(
|
|
@@ -107,7 +140,7 @@ var Clickable = React2.forwardRef(
|
|
|
107
140
|
}
|
|
108
141
|
);
|
|
109
142
|
var Clickable_default = Clickable;
|
|
110
|
-
var StyledClickableDiv =
|
|
143
|
+
var StyledClickableDiv = styled.div`
|
|
111
144
|
cursor: pointer;
|
|
112
145
|
|
|
113
146
|
${disabledSelector} {
|
|
@@ -124,6 +157,7 @@ var StyledClickableDiv = styled2.div`
|
|
|
124
157
|
text-rendering: inherit;
|
|
125
158
|
letter-spacing: inherit;
|
|
126
159
|
word-spacing: inherit;
|
|
160
|
+
text-decoration: none;
|
|
127
161
|
|
|
128
162
|
&:focus {
|
|
129
163
|
outline: none;
|
|
@@ -148,6 +182,59 @@ var StyledClickableDiv = styled2.div`
|
|
|
148
182
|
}
|
|
149
183
|
`;
|
|
150
184
|
|
|
185
|
+
// src/components/Button/StyledButton.tsx
|
|
186
|
+
var horizontalPaddingSmall = css`
|
|
187
|
+
padding-right: 16px;
|
|
188
|
+
padding-left: 16px;
|
|
189
|
+
`;
|
|
190
|
+
var horizontalPaddingMedium = css`
|
|
191
|
+
padding-right: 24px;
|
|
192
|
+
padding-left: 24px;
|
|
193
|
+
`;
|
|
194
|
+
var StyledButton = styled2(Clickable_default)`
|
|
195
|
+
width: ${(p) => p.$fullWidth ? "stretch" : "min-content"};
|
|
196
|
+
display: inline-grid;
|
|
197
|
+
align-items: center;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
user-select: none;
|
|
201
|
+
white-space: nowrap;
|
|
202
|
+
border-radius: 999999px;
|
|
203
|
+
font-size: 14px;
|
|
204
|
+
line-height: 22px;
|
|
205
|
+
font-weight: bold;
|
|
206
|
+
|
|
207
|
+
${(p) => p.$size === "M" ? horizontalPaddingMedium : horizontalPaddingSmall}
|
|
208
|
+
color: var(--charcoal-${(p) => p.$color});
|
|
209
|
+
background-color: var(--charcoal-${(p) => p.$background});
|
|
210
|
+
transition: 0.2s color, 0.2s background-color, 0.2s box-shadow;
|
|
211
|
+
|
|
212
|
+
&:not(:disabled):not([aria-disabled]),
|
|
213
|
+
&[aria-disabled='false'] {
|
|
214
|
+
&:active,
|
|
215
|
+
&:focus,
|
|
216
|
+
&:focus-visible {
|
|
217
|
+
outline: none;
|
|
218
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&:hover {
|
|
222
|
+
color: var(--charcoal-${(p) => p.$color}-hover);
|
|
223
|
+
background-color: var(--charcoal-${(p) => p.$background}-hover);
|
|
224
|
+
}
|
|
225
|
+
&:active {
|
|
226
|
+
color: var(--charcoal-${(p) => p.$color}-press);
|
|
227
|
+
background-color: var(--charcoal-${(p) => p.$background}-press);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&:disabled,
|
|
232
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
233
|
+
opacity: 0.32;
|
|
234
|
+
}
|
|
235
|
+
height: ${(p) => p.$size === "M" ? 40 : 32}px;
|
|
236
|
+
`;
|
|
237
|
+
|
|
151
238
|
// src/components/Button/index.tsx
|
|
152
239
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
153
240
|
var Button = forwardRef3(function Button2({
|
|
@@ -163,7 +250,8 @@ var Button = forwardRef3(function Button2({
|
|
|
163
250
|
{
|
|
164
251
|
...rest,
|
|
165
252
|
disabled,
|
|
166
|
-
$
|
|
253
|
+
$background: variantToBackground(variant),
|
|
254
|
+
$color: variantToFont(variant),
|
|
167
255
|
$size: size,
|
|
168
256
|
$fullWidth: fixed,
|
|
169
257
|
ref,
|
|
@@ -172,120 +260,86 @@ var Button = forwardRef3(function Button2({
|
|
|
172
260
|
);
|
|
173
261
|
});
|
|
174
262
|
var Button_default = Button;
|
|
175
|
-
var StyledButton = styled3(Clickable_default)`
|
|
176
|
-
width: ${(p) => p.$fullWidth ? "stretch" : "min-content"};
|
|
177
|
-
display: inline-grid;
|
|
178
|
-
align-items: center;
|
|
179
|
-
justify-content: center;
|
|
180
|
-
cursor: pointer;
|
|
181
|
-
user-select: none;
|
|
182
|
-
white-space: nowrap;
|
|
183
|
-
|
|
184
|
-
${(p) => theme((o) => [
|
|
185
|
-
o.font[variantToFont(p.$variant)].hover.press,
|
|
186
|
-
o.bg[variantToBackground(p.$variant)].hover.press,
|
|
187
|
-
o.typography(14).bold.preserveHalfLeading,
|
|
188
|
-
o.padding.horizontal(p.$size === "M" ? 24 : 16),
|
|
189
|
-
o.disabled,
|
|
190
|
-
o.borderRadius("oval"),
|
|
191
|
-
o.outline.default.focus
|
|
192
|
-
])}
|
|
193
|
-
|
|
194
|
-
/* よく考えたらheight=32って定義が存在しないな... */
|
|
195
|
-
height: ${(p) => p.$size === "M" ? 40 : 32}px;
|
|
196
|
-
`;
|
|
197
|
-
function variantToBackground(variant) {
|
|
198
|
-
switch (variant) {
|
|
199
|
-
case "Overlay":
|
|
200
|
-
return "surface4";
|
|
201
|
-
case "Default":
|
|
202
|
-
return "surface3";
|
|
203
|
-
case "Primary":
|
|
204
|
-
return "brand";
|
|
205
|
-
case "Navigation":
|
|
206
|
-
return "surface6";
|
|
207
|
-
case "Danger":
|
|
208
|
-
return "assertive";
|
|
209
|
-
default:
|
|
210
|
-
return unreachable(variant);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function variantToFont(variant) {
|
|
214
|
-
switch (variant) {
|
|
215
|
-
case "Overlay":
|
|
216
|
-
return "text5";
|
|
217
|
-
case "Default":
|
|
218
|
-
return "text2";
|
|
219
|
-
case "Primary":
|
|
220
|
-
return "text5";
|
|
221
|
-
case "Navigation":
|
|
222
|
-
return "text5";
|
|
223
|
-
case "Danger":
|
|
224
|
-
return "text5";
|
|
225
|
-
default:
|
|
226
|
-
return unreachable(variant);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
263
|
|
|
230
264
|
// src/components/IconButton/index.tsx
|
|
231
265
|
import { forwardRef as forwardRef4 } from "react";
|
|
232
|
-
import
|
|
266
|
+
import styled3 from "styled-components";
|
|
233
267
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
234
268
|
var IconButton = forwardRef4(
|
|
235
269
|
function IconButtonInner({ variant = "Default", size = "M", icon, ...rest }, ref) {
|
|
236
270
|
validateIconSize(size, icon);
|
|
237
|
-
return /* @__PURE__ */ jsx5(StyledIconButton, { ...rest, ref,
|
|
271
|
+
return /* @__PURE__ */ jsx5(StyledIconButton, { ...rest, ref, $size: size, $variant: variant, children: /* @__PURE__ */ jsx5("pixiv-icon", { name: icon }) });
|
|
238
272
|
}
|
|
239
273
|
);
|
|
240
274
|
var IconButton_default = IconButton;
|
|
241
|
-
var StyledIconButton =
|
|
275
|
+
var StyledIconButton = styled3(Clickable_default).attrs(styledProps)`
|
|
242
276
|
user-select: none;
|
|
243
277
|
|
|
244
|
-
width: ${(p) => p
|
|
245
|
-
height: ${(p) => p
|
|
278
|
+
width: ${(p) => p.$width}px;
|
|
279
|
+
height: ${(p) => p.$height}px;
|
|
246
280
|
display: flex;
|
|
247
281
|
align-items: center;
|
|
248
282
|
justify-content: center;
|
|
283
|
+
color: var(${({ $font }) => `--charcoal-${$font}`});
|
|
284
|
+
background-color: var(${({ $background }) => `--charcoal-${$background}`});
|
|
285
|
+
border-radius: 999999px;
|
|
286
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
287
|
+
|
|
288
|
+
&:not(:disabled):not([aria-disabled]),
|
|
289
|
+
&[aria-disabled='false'] {
|
|
290
|
+
&:hover {
|
|
291
|
+
background-color: var(
|
|
292
|
+
${({ $background }) => `--charcoal-${$background}-hover`}
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
&:active {
|
|
296
|
+
background-color: var(
|
|
297
|
+
${({ $background }) => `--charcoal-${$background}-press`}
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
&:focus,
|
|
301
|
+
&:active,
|
|
302
|
+
&:focus-visible {
|
|
303
|
+
outline: none;
|
|
304
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
249
307
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
o.borderRadius("oval"),
|
|
255
|
-
o.outline.default.focus
|
|
256
|
-
])}
|
|
308
|
+
&:disabled,
|
|
309
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
310
|
+
opacity: 0.32;
|
|
311
|
+
}
|
|
257
312
|
`;
|
|
258
|
-
function styledProps(
|
|
313
|
+
function styledProps({ $size, $variant }) {
|
|
259
314
|
return {
|
|
260
|
-
...
|
|
261
|
-
...
|
|
262
|
-
...sizeToProps(props.size)
|
|
315
|
+
...variantToProps($variant),
|
|
316
|
+
...sizeToProps($size)
|
|
263
317
|
};
|
|
264
318
|
}
|
|
265
319
|
function variantToProps(variant) {
|
|
266
320
|
switch (variant) {
|
|
267
321
|
case "Default":
|
|
268
|
-
return { font: "text3", background: "transparent" };
|
|
322
|
+
return { $font: "text3", $background: "transparent" };
|
|
269
323
|
case "Overlay":
|
|
270
|
-
return { font: "text5", background: "surface4" };
|
|
324
|
+
return { $font: "text5", $background: "surface4" };
|
|
271
325
|
}
|
|
272
326
|
}
|
|
273
327
|
function sizeToProps(size) {
|
|
274
328
|
switch (size) {
|
|
275
329
|
case "XS":
|
|
276
330
|
return {
|
|
277
|
-
width: 20,
|
|
278
|
-
height: 20
|
|
331
|
+
$width: 20,
|
|
332
|
+
$height: 20
|
|
279
333
|
};
|
|
280
334
|
case "S":
|
|
281
335
|
return {
|
|
282
|
-
width: 32,
|
|
283
|
-
height: 32
|
|
336
|
+
$width: 32,
|
|
337
|
+
$height: 32
|
|
284
338
|
};
|
|
285
339
|
case "M":
|
|
286
340
|
return {
|
|
287
|
-
width: 40,
|
|
288
|
-
height: 40
|
|
341
|
+
$width: 40,
|
|
342
|
+
$height: 40
|
|
289
343
|
};
|
|
290
344
|
}
|
|
291
345
|
}
|
|
@@ -315,9 +369,8 @@ function validateIconSize(size, icon) {
|
|
|
315
369
|
// src/components/Radio/index.tsx
|
|
316
370
|
import { memo, forwardRef as forwardRef5, useCallback, useContext as useContext2 } from "react";
|
|
317
371
|
import * as React3 from "react";
|
|
318
|
-
import
|
|
372
|
+
import styled4, { css as css2 } from "styled-components";
|
|
319
373
|
import warning from "warning";
|
|
320
|
-
import { px } from "@charcoal-ui/utils";
|
|
321
374
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
322
375
|
var Radio = forwardRef5(function RadioInner({ value, disabled = false, children, className }, ref) {
|
|
323
376
|
const {
|
|
@@ -358,16 +411,19 @@ var Radio = forwardRef5(function RadioInner({ value, disabled = false, children,
|
|
|
358
411
|
] });
|
|
359
412
|
});
|
|
360
413
|
var Radio_default = memo(Radio);
|
|
361
|
-
var RadioRoot =
|
|
414
|
+
var RadioRoot = styled4.label`
|
|
362
415
|
display: grid;
|
|
363
416
|
grid-template-columns: auto 1fr;
|
|
364
|
-
grid-gap:
|
|
417
|
+
grid-gap: 4px;
|
|
365
418
|
align-items: center;
|
|
366
419
|
cursor: pointer;
|
|
367
420
|
|
|
368
|
-
|
|
421
|
+
&:disabled,
|
|
422
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
423
|
+
opacity: 0.32;
|
|
424
|
+
}
|
|
369
425
|
`;
|
|
370
|
-
var RadioInput =
|
|
426
|
+
var RadioInput = styled4.input.attrs({ type: "radio" })`
|
|
371
427
|
/** Make prior to browser default style */
|
|
372
428
|
&[type='radio'] {
|
|
373
429
|
appearance: none;
|
|
@@ -380,46 +436,92 @@ var RadioInput = styled5.input.attrs({ type: "radio" })`
|
|
|
380
436
|
width: 20px;
|
|
381
437
|
height: 20px;
|
|
382
438
|
cursor: pointer;
|
|
439
|
+
border-radius: 999999px;
|
|
440
|
+
background-color: var(--charcoal-surface1);
|
|
441
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
442
|
+
|
|
443
|
+
&:not(:disabled):not([aria-disabled]),
|
|
444
|
+
&[aria-disabled='false'] {
|
|
445
|
+
${({ invalid = false }) => invalid && css2`
|
|
446
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
447
|
+
`}
|
|
383
448
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
449
|
+
&:hover {
|
|
450
|
+
background-color: var(--charcoal-surface1-hover);
|
|
451
|
+
}
|
|
452
|
+
&:active {
|
|
453
|
+
background-color: var(--charcoal-surface1-press);
|
|
454
|
+
}
|
|
455
|
+
&:focus,
|
|
456
|
+
&:active,
|
|
457
|
+
&:focus-visible {
|
|
458
|
+
outline: none;
|
|
459
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
389
462
|
|
|
390
463
|
&:not(:checked) {
|
|
391
464
|
border-width: 2px;
|
|
392
465
|
border-style: solid;
|
|
393
|
-
border-color:
|
|
466
|
+
border-color: var(--charcoal-text3);
|
|
394
467
|
}
|
|
395
468
|
|
|
396
469
|
&:checked {
|
|
397
|
-
|
|
398
|
-
|
|
470
|
+
background-color: var(--charcoal-brand);
|
|
399
471
|
&::after {
|
|
400
472
|
content: '';
|
|
401
473
|
display: block;
|
|
402
474
|
width: 8px;
|
|
403
475
|
height: 8px;
|
|
404
476
|
pointer-events: none;
|
|
477
|
+
background-color: var(--charcoal-text5);
|
|
478
|
+
border-radius: 999999px;
|
|
479
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
480
|
+
}
|
|
405
481
|
|
|
406
|
-
|
|
482
|
+
&:not(:disabled):not([aria-disabled]),
|
|
483
|
+
&[aria-disabled='false'] {
|
|
484
|
+
&:hover {
|
|
485
|
+
background-color: var(--charcoal-brand-hover);
|
|
486
|
+
&::after {
|
|
487
|
+
background-color: var(--charcoal-text5-hover);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
&:active {
|
|
491
|
+
background-color: var(--charcoal-brand-press);
|
|
492
|
+
&::after {
|
|
493
|
+
background-color: var(--charcoal-text5-press);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
407
496
|
}
|
|
408
497
|
}
|
|
409
|
-
|
|
410
|
-
${theme((o) => o.outline.default.focus)}
|
|
411
|
-
|
|
412
|
-
/* FIXME: o.outline.default.focus の transition に o.bg.brand の transition が打ち消されてしまう */
|
|
413
|
-
transition: all 0.2s !important;
|
|
414
498
|
}
|
|
415
499
|
`;
|
|
416
|
-
var RadioLabel =
|
|
417
|
-
|
|
500
|
+
var RadioLabel = styled4.div`
|
|
501
|
+
font-size: 14px;
|
|
502
|
+
line-height: 22px;
|
|
503
|
+
display: flow-root;
|
|
504
|
+
color: var(--charcoal-text2);
|
|
505
|
+
|
|
506
|
+
&::before {
|
|
507
|
+
display: block;
|
|
508
|
+
width: 0;
|
|
509
|
+
height: 0;
|
|
510
|
+
content: '';
|
|
511
|
+
margin-top: -4px;
|
|
512
|
+
}
|
|
513
|
+
&::after {
|
|
514
|
+
display: block;
|
|
515
|
+
width: 0;
|
|
516
|
+
height: 0;
|
|
517
|
+
content: '';
|
|
518
|
+
margin-bottom: -4px;
|
|
519
|
+
}
|
|
418
520
|
`;
|
|
419
|
-
var StyledRadioGroup =
|
|
521
|
+
var StyledRadioGroup = styled4.div`
|
|
420
522
|
display: grid;
|
|
421
523
|
grid-template-columns: 1fr;
|
|
422
|
-
grid-gap:
|
|
524
|
+
grid-gap: 8px;
|
|
423
525
|
`;
|
|
424
526
|
var RadioGroupContext = React3.createContext({
|
|
425
527
|
name: void 0,
|
|
@@ -478,9 +580,9 @@ function RadioGroup({
|
|
|
478
580
|
|
|
479
581
|
// src/components/MultiSelect/index.tsx
|
|
480
582
|
import { useCallback as useCallback2, useContext as useContext3, forwardRef as forwardRef6, memo as memo2 } from "react";
|
|
481
|
-
import
|
|
583
|
+
import styled5, { css as css3 } from "styled-components";
|
|
482
584
|
import warning2 from "warning";
|
|
483
|
-
import {
|
|
585
|
+
import { px } from "@charcoal-ui/utils";
|
|
484
586
|
|
|
485
587
|
// src/components/MultiSelect/context.ts
|
|
486
588
|
import { createContext as createContext3 } from "react";
|
|
@@ -564,44 +666,96 @@ var MultiSelect = forwardRef6(
|
|
|
564
666
|
}
|
|
565
667
|
);
|
|
566
668
|
var MultiSelect_default = memo2(MultiSelect);
|
|
567
|
-
var MultiSelectRoot =
|
|
669
|
+
var MultiSelectRoot = styled5.label`
|
|
568
670
|
display: grid;
|
|
569
671
|
grid-template-columns: auto 1fr;
|
|
570
672
|
align-items: center;
|
|
571
673
|
position: relative;
|
|
572
674
|
cursor: pointer;
|
|
573
|
-
${
|
|
675
|
+
gap: ${({ theme }) => px(theme.spacing[4])};
|
|
676
|
+
&:disabled,
|
|
677
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
678
|
+
opacity: 0.32;
|
|
574
679
|
cursor: default;
|
|
575
680
|
}
|
|
576
|
-
gap: ${({ theme: theme3 }) => px2(theme3.spacing[4])};
|
|
577
|
-
${theme((o) => o.disabled)}
|
|
578
681
|
`;
|
|
579
|
-
var MultiSelectLabel =
|
|
682
|
+
var MultiSelectLabel = styled5.div`
|
|
580
683
|
display: flex;
|
|
581
684
|
align-items: center;
|
|
582
|
-
|
|
685
|
+
font-size: 14px;
|
|
686
|
+
line-height: 22px;
|
|
687
|
+
display: flow-root;
|
|
688
|
+
color: var(--charcoal-text2);
|
|
689
|
+
|
|
690
|
+
&::before {
|
|
691
|
+
display: block;
|
|
692
|
+
width: 0;
|
|
693
|
+
height: 0;
|
|
694
|
+
content: '';
|
|
695
|
+
margin-top: -4px;
|
|
696
|
+
}
|
|
697
|
+
&::after {
|
|
698
|
+
display: block;
|
|
699
|
+
width: 0;
|
|
700
|
+
height: 0;
|
|
701
|
+
content: '';
|
|
702
|
+
margin-bottom: -4px;
|
|
703
|
+
}
|
|
583
704
|
`;
|
|
584
|
-
var MultiSelectInput =
|
|
705
|
+
var MultiSelectInput = styled5.input.attrs({ type: "checkbox" })`
|
|
585
706
|
&[type='checkbox'] {
|
|
586
707
|
appearance: none;
|
|
587
708
|
display: block;
|
|
588
709
|
width: 20px;
|
|
589
710
|
height: 20px;
|
|
590
711
|
margin: 0;
|
|
712
|
+
background-color: var(--charcoal-text3);
|
|
713
|
+
border-radius: 999999px;
|
|
714
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
591
715
|
|
|
592
716
|
&:checked {
|
|
593
|
-
|
|
717
|
+
background-color: var(--charcoal-brand);
|
|
718
|
+
&:hover {
|
|
719
|
+
&:not(:disabled):not([aria-disabled]),
|
|
720
|
+
&[aria-disabled='false'] {
|
|
721
|
+
background-color: var(--charcoal-brand-hover);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
&:active {
|
|
726
|
+
&:not(:disabled):not([aria-disabled]),
|
|
727
|
+
&[aria-disabled='false'] {
|
|
728
|
+
background-color: var(--charcoal-brand-press);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
&:hover {
|
|
734
|
+
&:not(:disabled):not([aria-disabled]),
|
|
735
|
+
&[aria-disabled='false'] {
|
|
736
|
+
background-color: var(--charcoal-text3-hover);
|
|
737
|
+
}
|
|
594
738
|
}
|
|
595
739
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
740
|
+
&:active {
|
|
741
|
+
&:not(:disabled):not([aria-disabled]),
|
|
742
|
+
&[aria-disabled='false'] {
|
|
743
|
+
background-color: var(--charcoal-text3-press);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
${({ invalid, overlay }) => invalid && !overlay && css3`
|
|
748
|
+
&:not(:disabled):not([aria-disabled]),
|
|
749
|
+
&[aria-disabled='false'] {
|
|
750
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
751
|
+
}
|
|
752
|
+
`}
|
|
753
|
+
${({ overlay }) => overlay && css3`
|
|
754
|
+
background-color: var(--charcoal-surface4);
|
|
755
|
+
`}
|
|
602
756
|
}
|
|
603
757
|
`;
|
|
604
|
-
var MultiSelectInputOverlay =
|
|
758
|
+
var MultiSelectInputOverlay = styled5.div`
|
|
605
759
|
position: absolute;
|
|
606
760
|
top: -2px;
|
|
607
761
|
left: -2px;
|
|
@@ -609,17 +763,20 @@ var MultiSelectInputOverlay = styled6.div`
|
|
|
609
763
|
display: flex;
|
|
610
764
|
align-items: center;
|
|
611
765
|
justify-content: center;
|
|
766
|
+
width: 24px;
|
|
767
|
+
height: 24px;
|
|
768
|
+
border-radius: 999999px;
|
|
769
|
+
color: var(--charcoal-text5);
|
|
770
|
+
transition: 0.2s box-shadow;
|
|
771
|
+
${({ invalid, overlay }) => invalid && overlay && css3`
|
|
772
|
+
&:not(:disabled):not([aria-disabled]),
|
|
773
|
+
&[aria-disabled='false'] {
|
|
774
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
775
|
+
}
|
|
776
|
+
`}
|
|
612
777
|
|
|
613
|
-
${({
|
|
614
|
-
|
|
615
|
-
o.height.px(24),
|
|
616
|
-
o.borderRadius("oval"),
|
|
617
|
-
o.font.text5,
|
|
618
|
-
invalid && overlay && o.outline.assertive
|
|
619
|
-
])}
|
|
620
|
-
|
|
621
|
-
${({ overlay }) => overlay && css`
|
|
622
|
-
border-color: ${({ theme: theme3 }) => theme3.color.text5};
|
|
778
|
+
${({ overlay }) => overlay && css3`
|
|
779
|
+
border-color: var(--charcoal-text5);
|
|
623
780
|
border-width: 2px;
|
|
624
781
|
border-style: solid;
|
|
625
782
|
`}
|
|
@@ -670,8 +827,7 @@ function MultiSelectGroup({
|
|
|
670
827
|
import { useSwitch } from "@react-aria/switch";
|
|
671
828
|
import { useMemo, memo as memo3, forwardRef as forwardRef7 } from "react";
|
|
672
829
|
import { useToggleState } from "react-stately";
|
|
673
|
-
import
|
|
674
|
-
import { disabledSelector as disabledSelector3 } from "@charcoal-ui/utils";
|
|
830
|
+
import styled6 from "styled-components";
|
|
675
831
|
import { useObjectRef } from "@react-aria/utils";
|
|
676
832
|
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
677
833
|
var SwitchCheckbox = forwardRef7(
|
|
@@ -698,33 +854,30 @@ var SwitchCheckbox = forwardRef7(
|
|
|
698
854
|
}
|
|
699
855
|
);
|
|
700
856
|
var Switch_default = memo3(SwitchCheckbox);
|
|
701
|
-
var Label =
|
|
857
|
+
var Label = styled6.label`
|
|
702
858
|
display: inline-grid;
|
|
703
859
|
grid-template-columns: auto 1fr;
|
|
704
860
|
align-items: center;
|
|
705
861
|
cursor: pointer;
|
|
706
862
|
outline: 0;
|
|
707
863
|
|
|
708
|
-
|
|
864
|
+
&:disabled,
|
|
865
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
866
|
+
opacity: 0.32;
|
|
867
|
+
cursor: default;
|
|
868
|
+
}
|
|
709
869
|
|
|
710
870
|
:active > input {
|
|
711
871
|
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
712
872
|
}
|
|
713
|
-
|
|
714
|
-
${disabledSelector3} {
|
|
715
|
-
cursor: default;
|
|
716
|
-
}
|
|
717
873
|
`;
|
|
718
|
-
var LabelInner =
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
])}
|
|
874
|
+
var LabelInner = styled6.div`
|
|
875
|
+
font-size: 14px;
|
|
876
|
+
line-height: 22px;
|
|
877
|
+
color: var(--charcoal-text2);
|
|
878
|
+
margin-left: 4px;
|
|
724
879
|
`;
|
|
725
|
-
var SwitchInput =
|
|
726
|
-
type: "checkbox"
|
|
727
|
-
})`
|
|
880
|
+
var SwitchInput = styled6.input.attrs({ type: "checkbox" })`
|
|
728
881
|
appearance: none;
|
|
729
882
|
display: inline-flex;
|
|
730
883
|
position: relative;
|
|
@@ -791,12 +944,11 @@ import { useTextField } from "@react-aria/textfield";
|
|
|
791
944
|
import { useVisuallyHidden } from "@react-aria/visually-hidden";
|
|
792
945
|
import { useCallback as useCallback3, useEffect as useEffect2, useRef, useState } from "react";
|
|
793
946
|
import * as React5 from "react";
|
|
794
|
-
import
|
|
947
|
+
import styled8, { css as css4 } from "styled-components";
|
|
795
948
|
|
|
796
949
|
// src/components/FieldLabel/index.tsx
|
|
797
950
|
import * as React4 from "react";
|
|
798
|
-
import
|
|
799
|
-
import { createTheme as createTheme2 } from "@charcoal-ui/styled";
|
|
951
|
+
import styled7 from "styled-components";
|
|
800
952
|
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
801
953
|
var FieldLabel = React4.forwardRef(
|
|
802
954
|
function FieldLabel2({
|
|
@@ -816,30 +968,97 @@ var FieldLabel = React4.forwardRef(
|
|
|
816
968
|
}
|
|
817
969
|
);
|
|
818
970
|
var FieldLabel_default = FieldLabel;
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
971
|
+
var Label2 = styled7.label`
|
|
972
|
+
font-size: 14px;
|
|
973
|
+
line-height: 22px;
|
|
974
|
+
font-weight: bold;
|
|
975
|
+
display: flow-root;
|
|
976
|
+
color: var(--charcoal-text1);
|
|
977
|
+
|
|
978
|
+
&::before {
|
|
979
|
+
display: block;
|
|
980
|
+
width: 0;
|
|
981
|
+
height: 0;
|
|
982
|
+
content: '';
|
|
983
|
+
margin-top: -4px;
|
|
984
|
+
}
|
|
985
|
+
&::after {
|
|
986
|
+
display: block;
|
|
987
|
+
width: 0;
|
|
988
|
+
height: 0;
|
|
989
|
+
content: '';
|
|
990
|
+
margin-bottom: -4px;
|
|
991
|
+
}
|
|
822
992
|
`;
|
|
823
|
-
var RequiredText =
|
|
824
|
-
|
|
993
|
+
var RequiredText = styled7.span`
|
|
994
|
+
font-size: 14px;
|
|
995
|
+
line-height: 22px;
|
|
996
|
+
display: flow-root;
|
|
997
|
+
color: var(--charcoal-text2);
|
|
998
|
+
|
|
999
|
+
&::before {
|
|
1000
|
+
display: block;
|
|
1001
|
+
width: 0;
|
|
1002
|
+
height: 0;
|
|
1003
|
+
content: '';
|
|
1004
|
+
margin-top: -4px;
|
|
1005
|
+
}
|
|
1006
|
+
&::after {
|
|
1007
|
+
display: block;
|
|
1008
|
+
width: 0;
|
|
1009
|
+
height: 0;
|
|
1010
|
+
content: '';
|
|
1011
|
+
margin-bottom: -4px;
|
|
1012
|
+
}
|
|
825
1013
|
`;
|
|
826
|
-
var SubLabelClickable =
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
1014
|
+
var SubLabelClickable = styled7.div`
|
|
1015
|
+
font-size: 14px;
|
|
1016
|
+
line-height: 22px;
|
|
1017
|
+
display: flow-root;
|
|
1018
|
+
color: var(--charcoal-text3);
|
|
1019
|
+
transition: 0.2s color, 0.2s box-shadow;
|
|
1020
|
+
|
|
1021
|
+
&::before {
|
|
1022
|
+
display: block;
|
|
1023
|
+
width: 0;
|
|
1024
|
+
height: 0;
|
|
1025
|
+
content: '';
|
|
1026
|
+
margin-top: -4px;
|
|
1027
|
+
}
|
|
1028
|
+
&::after {
|
|
1029
|
+
display: block;
|
|
1030
|
+
width: 0;
|
|
1031
|
+
height: 0;
|
|
1032
|
+
content: '';
|
|
1033
|
+
margin-bottom: -4px;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
&:not(:disabled):not([aria-disabled]),
|
|
1037
|
+
&[aria-disabled='false'] {
|
|
1038
|
+
&:hover {
|
|
1039
|
+
color: var(--charcoal-text3-hover);
|
|
1040
|
+
}
|
|
1041
|
+
&:active {
|
|
1042
|
+
color: var(--charcoal-text3-press);
|
|
1043
|
+
}
|
|
1044
|
+
&:active,
|
|
1045
|
+
&:focus,
|
|
1046
|
+
&:focus-visible {
|
|
1047
|
+
outline: none;
|
|
1048
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
832
1051
|
`;
|
|
833
|
-
var FieldLabelWrapper =
|
|
1052
|
+
var FieldLabelWrapper = styled7.div`
|
|
834
1053
|
display: inline-flex;
|
|
835
1054
|
align-items: center;
|
|
836
1055
|
|
|
837
1056
|
> ${RequiredText} {
|
|
838
|
-
|
|
1057
|
+
margin-left: 4px;
|
|
839
1058
|
}
|
|
840
1059
|
|
|
841
1060
|
> ${SubLabelClickable} {
|
|
842
|
-
|
|
1061
|
+
margin-left: auto;
|
|
843
1062
|
}
|
|
844
1063
|
`;
|
|
845
1064
|
|
|
@@ -967,16 +1186,16 @@ var TextField = React5.forwardRef(
|
|
|
967
1186
|
}
|
|
968
1187
|
);
|
|
969
1188
|
var TextField_default = TextField;
|
|
970
|
-
var TextFieldRoot =
|
|
1189
|
+
var TextFieldRoot = styled8.div`
|
|
971
1190
|
display: flex;
|
|
972
1191
|
flex-direction: column;
|
|
973
1192
|
|
|
974
1193
|
${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
|
|
975
1194
|
`;
|
|
976
|
-
var TextFieldLabel =
|
|
1195
|
+
var TextFieldLabel = styled8(FieldLabel_default)`
|
|
977
1196
|
margin-bottom: 8px;
|
|
978
1197
|
`;
|
|
979
|
-
var StyledInputContainer =
|
|
1198
|
+
var StyledInputContainer = styled8.div`
|
|
980
1199
|
display: grid;
|
|
981
1200
|
grid-template-columns: ${(p) => [p.hasPrefix && "auto", "1fr", p.hasSuffix && "auto"].filter(Boolean).join(" ")};
|
|
982
1201
|
height: 40px;
|
|
@@ -1007,21 +1226,20 @@ var StyledInputContainer = styled9.div`
|
|
|
1007
1226
|
${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
|
|
1008
1227
|
}
|
|
1009
1228
|
|
|
1010
|
-
${(p) => p.invalid &&
|
|
1229
|
+
${(p) => p.invalid && css4`
|
|
1011
1230
|
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
1012
1231
|
`}
|
|
1013
1232
|
`;
|
|
1014
|
-
var PrefixContainer =
|
|
1233
|
+
var PrefixContainer = styled8.div`
|
|
1015
1234
|
display: flex;
|
|
1016
|
-
padding-left: 8px;
|
|
1017
1235
|
align-items: center;
|
|
1018
1236
|
`;
|
|
1019
|
-
var SuffixContainer =
|
|
1237
|
+
var SuffixContainer = styled8.span`
|
|
1020
1238
|
display: flex;
|
|
1021
1239
|
align-items: center;
|
|
1022
1240
|
gap: 8px;
|
|
1023
1241
|
`;
|
|
1024
|
-
var StyledInput =
|
|
1242
|
+
var StyledInput = styled8.input`
|
|
1025
1243
|
border: none;
|
|
1026
1244
|
box-sizing: border-box;
|
|
1027
1245
|
outline: none;
|
|
@@ -1047,12 +1265,12 @@ var StyledInput = styled9.input`
|
|
|
1047
1265
|
color: var(--charcoal-text3);
|
|
1048
1266
|
}
|
|
1049
1267
|
`;
|
|
1050
|
-
var SingleLineCounter =
|
|
1268
|
+
var SingleLineCounter = styled8.span`
|
|
1051
1269
|
line-height: 22px;
|
|
1052
1270
|
font-size: 14px;
|
|
1053
1271
|
color: var(--charcoal-text3);
|
|
1054
1272
|
`;
|
|
1055
|
-
var AssistiveText =
|
|
1273
|
+
var AssistiveText = styled8.p`
|
|
1056
1274
|
font-size: 14px;
|
|
1057
1275
|
line-height: 22px;
|
|
1058
1276
|
margin-top: 4px;
|
|
@@ -1064,7 +1282,7 @@ var AssistiveText = styled9.p`
|
|
|
1064
1282
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
1065
1283
|
import { useVisuallyHidden as useVisuallyHidden2 } from "@react-aria/visually-hidden";
|
|
1066
1284
|
import { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
|
|
1067
|
-
import
|
|
1285
|
+
import styled9, { css as css5 } from "styled-components";
|
|
1068
1286
|
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1069
1287
|
var TextArea = forwardRef10(
|
|
1070
1288
|
function TextAreaInner({ onChange, ...props }, forwardRef18) {
|
|
@@ -1183,13 +1401,13 @@ var TextArea = forwardRef10(
|
|
|
1183
1401
|
}
|
|
1184
1402
|
);
|
|
1185
1403
|
var TextArea_default = TextArea;
|
|
1186
|
-
var TextFieldRoot2 =
|
|
1404
|
+
var TextFieldRoot2 = styled9.div`
|
|
1187
1405
|
display: flex;
|
|
1188
1406
|
flex-direction: column;
|
|
1189
1407
|
|
|
1190
1408
|
${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
|
|
1191
1409
|
`;
|
|
1192
|
-
var StyledTextareaContainer =
|
|
1410
|
+
var StyledTextareaContainer = styled9.div`
|
|
1193
1411
|
position: relative;
|
|
1194
1412
|
overflow: hidden;
|
|
1195
1413
|
|
|
@@ -1198,7 +1416,7 @@ var StyledTextareaContainer = styled10.div`
|
|
|
1198
1416
|
border-radius: 4px;
|
|
1199
1417
|
transition: 0.2s background-color, 0.2s box-shadow;
|
|
1200
1418
|
|
|
1201
|
-
${({ rows }) =>
|
|
1419
|
+
${({ rows }) => css5`
|
|
1202
1420
|
height: calc(22px * ${rows} + 18px);
|
|
1203
1421
|
`};
|
|
1204
1422
|
|
|
@@ -1212,11 +1430,11 @@ var StyledTextareaContainer = styled10.div`
|
|
|
1212
1430
|
${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
|
|
1213
1431
|
}
|
|
1214
1432
|
|
|
1215
|
-
${(p) => p.invalid &&
|
|
1433
|
+
${(p) => p.invalid && css5`
|
|
1216
1434
|
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
1217
1435
|
`}
|
|
1218
1436
|
`;
|
|
1219
|
-
var StyledTextarea =
|
|
1437
|
+
var StyledTextarea = styled9.textarea`
|
|
1220
1438
|
border: none;
|
|
1221
1439
|
outline: none;
|
|
1222
1440
|
resize: none;
|
|
@@ -1233,7 +1451,7 @@ var StyledTextarea = styled10.textarea`
|
|
|
1233
1451
|
padding: calc(9px / 0.875) calc(8px / 0.875)
|
|
1234
1452
|
${(p) => p.noBottomPadding ? 0 : ""};
|
|
1235
1453
|
|
|
1236
|
-
${({ rows = 1, noBottomPadding }) =>
|
|
1454
|
+
${({ rows = 1, noBottomPadding }) => css5`
|
|
1237
1455
|
height: calc(22px / 0.875 * ${rows} + ${noBottomPadding ? 9 : 20}px);
|
|
1238
1456
|
`};
|
|
1239
1457
|
|
|
@@ -1246,7 +1464,7 @@ var StyledTextarea = styled10.textarea`
|
|
|
1246
1464
|
color: var(--charcoal-text3);
|
|
1247
1465
|
}
|
|
1248
1466
|
`;
|
|
1249
|
-
var MultiLineCounter =
|
|
1467
|
+
var MultiLineCounter = styled9.span`
|
|
1250
1468
|
position: absolute;
|
|
1251
1469
|
bottom: 9px;
|
|
1252
1470
|
right: 8px;
|
|
@@ -1282,7 +1500,7 @@ import {
|
|
|
1282
1500
|
Overlay,
|
|
1283
1501
|
useModalOverlay
|
|
1284
1502
|
} from "@react-aria/overlays";
|
|
1285
|
-
import
|
|
1503
|
+
import styled11, { css as css7, useTheme } from "styled-components";
|
|
1286
1504
|
import { maxWidth as maxWidth2 } from "@charcoal-ui/utils";
|
|
1287
1505
|
import { useMedia } from "@charcoal-ui/styled";
|
|
1288
1506
|
import { animated as animated2, useTransition, easings } from "react-spring";
|
|
@@ -1290,7 +1508,7 @@ import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
|
1290
1508
|
|
|
1291
1509
|
// src/components/Modal/Dialog/index.tsx
|
|
1292
1510
|
import { forwardRef as forwardRef12 } from "react";
|
|
1293
|
-
import
|
|
1511
|
+
import styled10, { css as css6 } from "styled-components";
|
|
1294
1512
|
import { useDialog } from "@react-aria/dialog";
|
|
1295
1513
|
|
|
1296
1514
|
// ../foundation/src/grid.ts
|
|
@@ -1342,7 +1560,7 @@ var Dialog = forwardRef12(function Dialog2(props, forwardRef18) {
|
|
|
1342
1560
|
}
|
|
1343
1561
|
);
|
|
1344
1562
|
});
|
|
1345
|
-
var AnimatedStyledDialogDiv = animated(
|
|
1563
|
+
var AnimatedStyledDialogDiv = animated(styled10.div`
|
|
1346
1564
|
margin: auto;
|
|
1347
1565
|
position: relative;
|
|
1348
1566
|
height: fit-content;
|
|
@@ -1363,18 +1581,18 @@ var AnimatedStyledDialogDiv = animated(styled11.div`
|
|
|
1363
1581
|
}
|
|
1364
1582
|
}}px;
|
|
1365
1583
|
|
|
1366
|
-
background-color:
|
|
1584
|
+
background-color: var(--charcoal-surface1);
|
|
1367
1585
|
border-radius: 24px;
|
|
1368
1586
|
|
|
1369
|
-
@media ${({ theme
|
|
1587
|
+
@media ${({ theme }) => maxWidth(theme.breakpoint.screen1)} {
|
|
1370
1588
|
max-width: 440px;
|
|
1371
1589
|
width: calc(100% - 48px);
|
|
1372
|
-
${(p) => p.bottomSheet !== false &&
|
|
1590
|
+
${(p) => p.bottomSheet !== false && css6`
|
|
1373
1591
|
max-width: unset;
|
|
1374
1592
|
width: 100%;
|
|
1375
1593
|
border-radius: 0;
|
|
1376
1594
|
margin: auto 0 0 0;
|
|
1377
|
-
${p.bottomSheet === "full" &&
|
|
1595
|
+
${p.bottomSheet === "full" && css6`
|
|
1378
1596
|
min-height: 100%;
|
|
1379
1597
|
`}
|
|
1380
1598
|
`}
|
|
@@ -1405,7 +1623,10 @@ var Modal = forwardRef13(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
|
|
|
1405
1623
|
} = props;
|
|
1406
1624
|
const ref = useObjectRef2(external);
|
|
1407
1625
|
const { modalProps, underlayProps } = useModalOverlay(
|
|
1408
|
-
|
|
1626
|
+
{
|
|
1627
|
+
...props,
|
|
1628
|
+
isKeyboardDismissDisabled: isDismissable === void 0 || isDismissable === false
|
|
1629
|
+
},
|
|
1409
1630
|
{
|
|
1410
1631
|
close: onClose,
|
|
1411
1632
|
isOpen,
|
|
@@ -1418,8 +1639,8 @@ var Modal = forwardRef13(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
|
|
|
1418
1639
|
},
|
|
1419
1640
|
ref
|
|
1420
1641
|
);
|
|
1421
|
-
const
|
|
1422
|
-
const isMobile = useMedia(maxWidth2(
|
|
1642
|
+
const theme = useTheme();
|
|
1643
|
+
const isMobile = useMedia(maxWidth2(theme.breakpoint.screen1)) ?? false;
|
|
1423
1644
|
const transitionEnabled = isMobile && bottomSheet !== false;
|
|
1424
1645
|
const showDismiss = !isMobile || bottomSheet !== true;
|
|
1425
1646
|
const transition = useTransition(isOpen, {
|
|
@@ -1498,7 +1719,7 @@ var ModalContext = React9.createContext({
|
|
|
1498
1719
|
showDismiss: true,
|
|
1499
1720
|
bottomSheet: false
|
|
1500
1721
|
});
|
|
1501
|
-
var ModalBackground = animated2(
|
|
1722
|
+
var ModalBackground = animated2(styled11.div`
|
|
1502
1723
|
z-index: ${({ zIndex }) => zIndex};
|
|
1503
1724
|
overflow: auto;
|
|
1504
1725
|
display: flex;
|
|
@@ -1512,33 +1733,44 @@ var ModalBackground = animated2(styled12.div`
|
|
|
1512
1733
|
padding: 40px 0;
|
|
1513
1734
|
box-sizing: border-box;
|
|
1514
1735
|
|
|
1515
|
-
background-color:
|
|
1736
|
+
background-color: var(--charcoal-surface4);
|
|
1516
1737
|
|
|
1517
|
-
@media ${({ theme
|
|
1518
|
-
${(p) => p.$bottomSheet !== false &&
|
|
1738
|
+
@media ${({ theme }) => maxWidth2(theme.breakpoint.screen1)} {
|
|
1739
|
+
${(p) => p.$bottomSheet !== false && css7`
|
|
1519
1740
|
padding: 0;
|
|
1520
1741
|
`}
|
|
1521
1742
|
}
|
|
1522
1743
|
`);
|
|
1523
|
-
var ModalCrossButton =
|
|
1744
|
+
var ModalCrossButton = styled11(IconButton_default)`
|
|
1524
1745
|
position: absolute;
|
|
1525
1746
|
top: 8px;
|
|
1526
1747
|
right: 8px;
|
|
1527
1748
|
|
|
1528
|
-
|
|
1749
|
+
color: var(--charcoal-text3);
|
|
1750
|
+
transition: 0.2s color;
|
|
1751
|
+
|
|
1752
|
+
&:not(:disabled):not([aria-disabled]),
|
|
1753
|
+
&[aria-disabled='false'] {
|
|
1754
|
+
&:hover {
|
|
1755
|
+
color: var(--charcoal-text3-hover);
|
|
1756
|
+
}
|
|
1757
|
+
&:active {
|
|
1758
|
+
color: var(--charcoal-text3-press);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1529
1761
|
`;
|
|
1530
1762
|
function ModalTitle(props) {
|
|
1531
1763
|
const { titleProps, title } = useContext4(ModalContext);
|
|
1532
1764
|
return /* @__PURE__ */ jsx14(ModalHeading, { ...titleProps, ...props, children: title });
|
|
1533
1765
|
}
|
|
1534
|
-
var ModalHeading =
|
|
1766
|
+
var ModalHeading = styled11.h3`
|
|
1535
1767
|
margin: 0;
|
|
1536
1768
|
font-weight: inherit;
|
|
1537
1769
|
font-size: inherit;
|
|
1538
1770
|
`;
|
|
1539
1771
|
|
|
1540
1772
|
// src/components/Modal/ModalPlumbing.tsx
|
|
1541
|
-
import
|
|
1773
|
+
import styled12, { css as css8 } from "styled-components";
|
|
1542
1774
|
import { useContext as useContext5 } from "react";
|
|
1543
1775
|
import { maxWidth as maxWidth3 } from "@charcoal-ui/utils";
|
|
1544
1776
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
@@ -1546,37 +1778,59 @@ function ModalHeader() {
|
|
|
1546
1778
|
const modalCtx = useContext5(ModalContext);
|
|
1547
1779
|
return /* @__PURE__ */ jsx15(ModalHeaderRoot, { $bottomSheet: modalCtx.bottomSheet, children: /* @__PURE__ */ jsx15(StyledModalTitle, {}) });
|
|
1548
1780
|
}
|
|
1549
|
-
var ModalHeaderRoot =
|
|
1781
|
+
var ModalHeaderRoot = styled12.div`
|
|
1550
1782
|
height: 64px;
|
|
1551
1783
|
display: grid;
|
|
1552
1784
|
align-content: center;
|
|
1553
1785
|
justify-content: center;
|
|
1554
|
-
@media ${({ theme
|
|
1555
|
-
${(p) => p.$bottomSheet !== false &&
|
|
1786
|
+
@media ${({ theme }) => maxWidth3(theme.breakpoint.screen1)} {
|
|
1787
|
+
${(p) => p.$bottomSheet !== false && css8`
|
|
1556
1788
|
height: 48px;
|
|
1557
1789
|
`}
|
|
1558
1790
|
}
|
|
1559
1791
|
`;
|
|
1560
|
-
var StyledModalTitle =
|
|
1561
|
-
|
|
1792
|
+
var StyledModalTitle = styled12(ModalTitle)`
|
|
1793
|
+
color: var(--charcoal-text1);
|
|
1794
|
+
font-size: 16px;
|
|
1795
|
+
line-height: 24px;
|
|
1796
|
+
font-weight: bold;
|
|
1797
|
+
display: flow-root;
|
|
1798
|
+
|
|
1799
|
+
&::before {
|
|
1800
|
+
display: block;
|
|
1801
|
+
width: 0;
|
|
1802
|
+
height: 0;
|
|
1803
|
+
content: '';
|
|
1804
|
+
margin-top: -4px;
|
|
1805
|
+
}
|
|
1806
|
+
&::after {
|
|
1807
|
+
display: block;
|
|
1808
|
+
width: 0;
|
|
1809
|
+
height: 0;
|
|
1810
|
+
content: '';
|
|
1811
|
+
margin-bottom: -4px;
|
|
1812
|
+
}
|
|
1562
1813
|
`;
|
|
1563
|
-
var ModalAlign =
|
|
1564
|
-
|
|
1814
|
+
var ModalAlign = styled12.div`
|
|
1815
|
+
padding-left: 16px;
|
|
1816
|
+
padding-right: 16px;
|
|
1565
1817
|
`;
|
|
1566
|
-
var ModalBody =
|
|
1567
|
-
|
|
1818
|
+
var ModalBody = styled12.div`
|
|
1819
|
+
padding-bottom: 40px;
|
|
1568
1820
|
`;
|
|
1569
|
-
var ModalButtons =
|
|
1821
|
+
var ModalButtons = styled12.div`
|
|
1570
1822
|
display: grid;
|
|
1571
1823
|
grid-auto-flow: row;
|
|
1572
1824
|
grid-row-gap: 8px;
|
|
1573
1825
|
|
|
1574
|
-
|
|
1826
|
+
padding-top: 16px;
|
|
1827
|
+
padding-left: 16px;
|
|
1828
|
+
padding-right: 16px;
|
|
1575
1829
|
`;
|
|
1576
1830
|
|
|
1577
1831
|
// src/components/LoadingSpinner/index.tsx
|
|
1578
1832
|
import { forwardRef as forwardRef14, useImperativeHandle, useRef as useRef5, memo as memo5 } from "react";
|
|
1579
|
-
import
|
|
1833
|
+
import styled13, { keyframes } from "styled-components";
|
|
1580
1834
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1581
1835
|
var LoadingSpinner = forwardRef14(
|
|
1582
1836
|
function LoadingSpinnerInner({ size = 48, padding = 16, transparent = false, className }, ref) {
|
|
@@ -1594,7 +1848,7 @@ var LoadingSpinner = forwardRef14(
|
|
|
1594
1848
|
}
|
|
1595
1849
|
);
|
|
1596
1850
|
var LoadingSpinner_default = memo5(LoadingSpinner);
|
|
1597
|
-
var LoadingSpinnerRoot =
|
|
1851
|
+
var LoadingSpinnerRoot = styled13.div.attrs({ role: "progressbar" })`
|
|
1598
1852
|
box-sizing: content-box;
|
|
1599
1853
|
margin: auto;
|
|
1600
1854
|
padding: ${(props) => props.padding}px;
|
|
@@ -1603,10 +1857,8 @@ var LoadingSpinnerRoot = styled14.div.attrs({ role: "progressbar" })`
|
|
|
1603
1857
|
width: ${(props) => props.size}px;
|
|
1604
1858
|
height: ${(props) => props.size}px;
|
|
1605
1859
|
opacity: 0.84;
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
transparent ? o.bg.transparent : o.bg.background1
|
|
1609
|
-
])}
|
|
1860
|
+
color: var(--charcoal-text4);
|
|
1861
|
+
background-color: ${({ transparent }) => `var(--charcoal-${transparent ? "transparent" : "background1"})`};
|
|
1610
1862
|
`;
|
|
1611
1863
|
var scaleOut = keyframes`
|
|
1612
1864
|
from {
|
|
@@ -1619,7 +1871,7 @@ var scaleOut = keyframes`
|
|
|
1619
1871
|
opacity: 0;
|
|
1620
1872
|
}
|
|
1621
1873
|
`;
|
|
1622
|
-
var Icon2 =
|
|
1874
|
+
var Icon2 = styled13.div.attrs({ role: "presentation" })`
|
|
1623
1875
|
width: 1em;
|
|
1624
1876
|
height: 1em;
|
|
1625
1877
|
border-radius: 1em;
|
|
@@ -1650,8 +1902,8 @@ var LoadingSpinnerIcon = forwardRef14(
|
|
|
1650
1902
|
|
|
1651
1903
|
// src/components/DropdownSelector/index.tsx
|
|
1652
1904
|
import { useState as useState3, useRef as useRef9 } from "react";
|
|
1653
|
-
import
|
|
1654
|
-
import { disabledSelector as
|
|
1905
|
+
import styled16, { css as css9 } from "styled-components";
|
|
1906
|
+
import { disabledSelector as disabledSelector2 } from "@charcoal-ui/utils";
|
|
1655
1907
|
|
|
1656
1908
|
// src/components/DropdownSelector/DropdownPopover.tsx
|
|
1657
1909
|
import { useEffect as useEffect6, useRef as useRef7 } from "react";
|
|
@@ -1659,7 +1911,7 @@ import { useEffect as useEffect6, useRef as useRef7 } from "react";
|
|
|
1659
1911
|
// src/components/DropdownSelector/Popover/index.tsx
|
|
1660
1912
|
import { useContext as useContext6, useRef as useRef6 } from "react";
|
|
1661
1913
|
import { DismissButton, Overlay as Overlay2, usePopover } from "@react-aria/overlays";
|
|
1662
|
-
import
|
|
1914
|
+
import styled14 from "styled-components";
|
|
1663
1915
|
|
|
1664
1916
|
// src/components/DropdownSelector/Popover/usePreventScroll.tsx
|
|
1665
1917
|
import { useEffect as useEffect5 } from "react";
|
|
@@ -1721,18 +1973,16 @@ function Popover(props) {
|
|
|
1721
1973
|
] })
|
|
1722
1974
|
] });
|
|
1723
1975
|
}
|
|
1724
|
-
var DropdownPopoverDiv =
|
|
1976
|
+
var DropdownPopoverDiv = styled14.div`
|
|
1725
1977
|
margin: 4px 0;
|
|
1726
1978
|
list-style: none;
|
|
1727
1979
|
overflow: auto;
|
|
1728
1980
|
max-height: inherit;
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
o.padding.vertical(8)
|
|
1735
|
-
])}
|
|
1981
|
+
background-color: var(--charcoal-background1);
|
|
1982
|
+
border: solid 1px var(--charcoal-border-default);
|
|
1983
|
+
border-radius: 8px;
|
|
1984
|
+
padding-top: 8px;
|
|
1985
|
+
padding-bottom: 8px;
|
|
1736
1986
|
`;
|
|
1737
1987
|
|
|
1738
1988
|
// src/components/DropdownSelector/DropdownPopover.tsx
|
|
@@ -1796,7 +2046,7 @@ function findPreviewRecursive(children, value) {
|
|
|
1796
2046
|
|
|
1797
2047
|
// src/components/DropdownSelector/MenuList/index.tsx
|
|
1798
2048
|
import { useRef as useRef8 } from "react";
|
|
1799
|
-
import
|
|
2049
|
+
import styled15 from "styled-components";
|
|
1800
2050
|
|
|
1801
2051
|
// src/components/DropdownSelector/MenuList/MenuListContext.ts
|
|
1802
2052
|
import { createContext as createContext6 } from "react";
|
|
@@ -1848,7 +2098,7 @@ function MenuList(props) {
|
|
|
1848
2098
|
}
|
|
1849
2099
|
) });
|
|
1850
2100
|
}
|
|
1851
|
-
var StyledUl =
|
|
2101
|
+
var StyledUl = styled15.ul`
|
|
1852
2102
|
padding: 0;
|
|
1853
2103
|
margin: 0;
|
|
1854
2104
|
`;
|
|
@@ -1911,21 +2161,20 @@ function DropdownSelector(props) {
|
|
|
1911
2161
|
props.assistiveText !== void 0 && /* @__PURE__ */ jsx20(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
|
|
1912
2162
|
] });
|
|
1913
2163
|
}
|
|
1914
|
-
var DropdownSelectorRoot =
|
|
2164
|
+
var DropdownSelectorRoot = styled16.div`
|
|
1915
2165
|
display: inline-block;
|
|
1916
2166
|
width: 100%;
|
|
1917
2167
|
|
|
1918
|
-
${
|
|
2168
|
+
${disabledSelector2} {
|
|
1919
2169
|
cursor: default;
|
|
1920
|
-
|
|
2170
|
+
opacity: 0.32;
|
|
1921
2171
|
}
|
|
1922
2172
|
`;
|
|
1923
|
-
var DropdownFieldLabel =
|
|
2173
|
+
var DropdownFieldLabel = styled16(FieldLabel_default)`
|
|
1924
2174
|
width: 100%;
|
|
1925
|
-
|
|
1926
|
-
${theme((o) => o.margin.bottom(8))}
|
|
2175
|
+
margin-bottom: 8px;
|
|
1927
2176
|
`;
|
|
1928
|
-
var DropdownButton =
|
|
2177
|
+
var DropdownButton = styled16.button`
|
|
1929
2178
|
display: flex;
|
|
1930
2179
|
justify-content: space-between;
|
|
1931
2180
|
align-items: center;
|
|
@@ -1935,65 +2184,111 @@ var DropdownButton = styled17.button`
|
|
|
1935
2184
|
box-sizing: border-box;
|
|
1936
2185
|
border: none;
|
|
1937
2186
|
cursor: pointer;
|
|
2187
|
+
gap: 4px;
|
|
1938
2188
|
|
|
1939
|
-
${
|
|
2189
|
+
${disabledSelector2} {
|
|
1940
2190
|
cursor: default;
|
|
1941
2191
|
}
|
|
1942
2192
|
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
2193
|
+
padding-right: 8px;
|
|
2194
|
+
padding-left: 8px;
|
|
2195
|
+
background-color: var(--charcoal-surface3);
|
|
2196
|
+
border-radius: 4px;
|
|
2197
|
+
|
|
2198
|
+
transition: 0.2s box-shadow, 0.2s background-color;
|
|
2199
|
+
|
|
2200
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2201
|
+
&[aria-disabled='false'] {
|
|
2202
|
+
&:focus,
|
|
2203
|
+
&:active,
|
|
2204
|
+
&:focus-visible {
|
|
2205
|
+
outline: none;
|
|
2206
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
2207
|
+
}
|
|
2208
|
+
&:hover {
|
|
2209
|
+
background-color: var(--charcoal-surface3-hover);
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
${({ invalid }) => invalid === true && css9`
|
|
2214
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2215
|
+
&[aria-disabled='false'] {
|
|
2216
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
2217
|
+
}
|
|
2218
|
+
`}
|
|
1950
2219
|
`;
|
|
1951
|
-
var DropdownButtonText =
|
|
2220
|
+
var DropdownButtonText = styled16.span`
|
|
1952
2221
|
text-align: left;
|
|
1953
|
-
|
|
1954
|
-
|
|
2222
|
+
font-size: 14px;
|
|
2223
|
+
line-height: 22px;
|
|
2224
|
+
display: flow-root;
|
|
2225
|
+
color: var(--charcoal-text2);
|
|
2226
|
+
overflow: hidden;
|
|
2227
|
+
text-overflow: ellipsis;
|
|
2228
|
+
white-space: nowrap;
|
|
1955
2229
|
`;
|
|
1956
|
-
var DropdownButtonIcon =
|
|
1957
|
-
|
|
2230
|
+
var DropdownButtonIcon = styled16(Icon_default)`
|
|
2231
|
+
color: var(--charcoal-text2);
|
|
1958
2232
|
`;
|
|
1959
|
-
var AssertiveText =
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2233
|
+
var AssertiveText = styled16.div`
|
|
2234
|
+
margin-top: 8px;
|
|
2235
|
+
font-size: 14px;
|
|
2236
|
+
color: var(--charcoal-text2);
|
|
2237
|
+
line-height: 22px;
|
|
2238
|
+
display: flow-root;
|
|
2239
|
+
&::before {
|
|
2240
|
+
display: block;
|
|
2241
|
+
width: 0;
|
|
2242
|
+
height: 0;
|
|
2243
|
+
content: '';
|
|
2244
|
+
margin-top: -4px;
|
|
2245
|
+
}
|
|
2246
|
+
&::after {
|
|
2247
|
+
display: block;
|
|
2248
|
+
width: 0;
|
|
2249
|
+
height: 0;
|
|
2250
|
+
content: '';
|
|
2251
|
+
margin-bottom: -4px;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
${({ invalid }) => invalid === true && css9`
|
|
2255
|
+
color: var(--charcoal-assertive);
|
|
2256
|
+
`}
|
|
1965
2257
|
`;
|
|
1966
2258
|
|
|
1967
2259
|
// src/components/DropdownSelector/DropdownMenuItem.tsx
|
|
1968
|
-
import
|
|
2260
|
+
import styled18 from "styled-components";
|
|
1969
2261
|
|
|
1970
2262
|
// src/components/DropdownSelector/ListItem/index.tsx
|
|
1971
|
-
import
|
|
2263
|
+
import styled17 from "styled-components";
|
|
1972
2264
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1973
2265
|
function ListItem(props) {
|
|
1974
2266
|
const { children, ...rest } = props;
|
|
1975
2267
|
return /* @__PURE__ */ jsx21(StyledLi, { role: "option", children: /* @__PURE__ */ jsx21(ItemDiv, { ...rest, children: props.children }) });
|
|
1976
2268
|
}
|
|
1977
|
-
var StyledLi =
|
|
2269
|
+
var StyledLi = styled17.li`
|
|
1978
2270
|
list-style: none;
|
|
1979
2271
|
`;
|
|
1980
|
-
var ItemDiv =
|
|
2272
|
+
var ItemDiv = styled17.div`
|
|
1981
2273
|
display: flex;
|
|
1982
2274
|
align-items: center;
|
|
1983
2275
|
min-height: 40px;
|
|
1984
2276
|
cursor: pointer;
|
|
1985
2277
|
outline: none;
|
|
1986
2278
|
|
|
1987
|
-
|
|
2279
|
+
padding-right: 16px;
|
|
2280
|
+
padding-left: 16px;
|
|
1988
2281
|
|
|
1989
|
-
|
|
2282
|
+
&:disabled,
|
|
2283
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
2284
|
+
opacity: 0.32;
|
|
1990
2285
|
cursor: default;
|
|
1991
2286
|
}
|
|
1992
2287
|
|
|
1993
2288
|
:hover,
|
|
1994
2289
|
:focus,
|
|
1995
2290
|
:focus-within {
|
|
1996
|
-
|
|
2291
|
+
background-color: var(--charcoal-surface3);
|
|
1997
2292
|
}
|
|
1998
2293
|
`;
|
|
1999
2294
|
|
|
@@ -2094,20 +2389,24 @@ function DropdownMenuItem(props) {
|
|
|
2094
2389
|
/* @__PURE__ */ jsx23(StyledSpan, { isSelected, children: props.children })
|
|
2095
2390
|
] });
|
|
2096
2391
|
}
|
|
2097
|
-
var StyledSpan =
|
|
2098
|
-
|
|
2392
|
+
var StyledSpan = styled18.span`
|
|
2393
|
+
font-size: 14px;
|
|
2394
|
+
line-height: 22px;
|
|
2395
|
+
color: var(--charcoal-text2);
|
|
2396
|
+
padding: 9px 0;
|
|
2397
|
+
|
|
2099
2398
|
display: flex;
|
|
2100
2399
|
align-items: center;
|
|
2101
2400
|
width: 100%;
|
|
2102
2401
|
margin-left: ${({ isSelected }) => isSelected === true ? 0 : 20}px;
|
|
2103
2402
|
`;
|
|
2104
|
-
var Text2ColorIcon =
|
|
2105
|
-
|
|
2403
|
+
var Text2ColorIcon = styled18(Icon_default)`
|
|
2404
|
+
color: var(--charcoal-text2);
|
|
2106
2405
|
padding-right: 4px;
|
|
2107
2406
|
`;
|
|
2108
2407
|
|
|
2109
2408
|
// src/components/DropdownSelector/MenuItemGroup/index.tsx
|
|
2110
|
-
import
|
|
2409
|
+
import styled19 from "styled-components";
|
|
2111
2410
|
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2112
2411
|
function MenuItemGroup(props) {
|
|
2113
2412
|
return /* @__PURE__ */ jsxs12(StyledLi2, { role: "presentation", children: [
|
|
@@ -2115,33 +2414,265 @@ function MenuItemGroup(props) {
|
|
|
2115
2414
|
/* @__PURE__ */ jsx24(StyledUl2, { role: "group", children: props.children })
|
|
2116
2415
|
] });
|
|
2117
2416
|
}
|
|
2118
|
-
var TextSpan =
|
|
2417
|
+
var TextSpan = styled19.span`
|
|
2119
2418
|
display: block;
|
|
2120
|
-
color:
|
|
2419
|
+
color: var(--charcoal-text3);
|
|
2121
2420
|
font-size: 12px;
|
|
2122
2421
|
font-weight: bold;
|
|
2123
2422
|
padding: 12px 0 8px 16px;
|
|
2124
2423
|
`;
|
|
2125
|
-
var StyledUl2 =
|
|
2424
|
+
var StyledUl2 = styled19.ul`
|
|
2126
2425
|
padding-left: 0;
|
|
2127
2426
|
margin: 0;
|
|
2128
2427
|
box-sizing: border-box;
|
|
2129
2428
|
list-style: none;
|
|
2130
2429
|
overflow: hidden;
|
|
2131
2430
|
`;
|
|
2132
|
-
var StyledLi2 =
|
|
2431
|
+
var StyledLi2 = styled19.li`
|
|
2133
2432
|
display: block;
|
|
2134
2433
|
`;
|
|
2135
2434
|
|
|
2136
2435
|
// src/components/SegmentedControl/index.tsx
|
|
2137
2436
|
import { forwardRef as forwardRef15, memo as memo6, useMemo as useMemo2, useRef as useRef10 } from "react";
|
|
2138
|
-
|
|
2437
|
+
|
|
2438
|
+
// ../../node_modules/@react-stately/form/dist/import.mjs
|
|
2439
|
+
import { createContext as $jcIOw$createContext, useMemo as $jcIOw$useMemo, useContext as $jcIOw$useContext, useState as $jcIOw$useState, useRef as $jcIOw$useRef, useEffect as $jcIOw$useEffect } from "react";
|
|
2440
|
+
var $e5be200c675c3b3a$export$aca958c65c314e6c = {
|
|
2441
|
+
badInput: false,
|
|
2442
|
+
customError: false,
|
|
2443
|
+
patternMismatch: false,
|
|
2444
|
+
rangeOverflow: false,
|
|
2445
|
+
rangeUnderflow: false,
|
|
2446
|
+
stepMismatch: false,
|
|
2447
|
+
tooLong: false,
|
|
2448
|
+
tooShort: false,
|
|
2449
|
+
typeMismatch: false,
|
|
2450
|
+
valueMissing: false,
|
|
2451
|
+
valid: true
|
|
2452
|
+
};
|
|
2453
|
+
var $e5be200c675c3b3a$var$CUSTOM_VALIDITY_STATE = {
|
|
2454
|
+
...$e5be200c675c3b3a$export$aca958c65c314e6c,
|
|
2455
|
+
customError: true,
|
|
2456
|
+
valid: false
|
|
2457
|
+
};
|
|
2458
|
+
var $e5be200c675c3b3a$export$dad6ae84456c676a = {
|
|
2459
|
+
isInvalid: false,
|
|
2460
|
+
validationDetails: $e5be200c675c3b3a$export$aca958c65c314e6c,
|
|
2461
|
+
validationErrors: []
|
|
2462
|
+
};
|
|
2463
|
+
var $e5be200c675c3b3a$export$571b5131b7e65c11 = (0, $jcIOw$createContext)({});
|
|
2464
|
+
var $e5be200c675c3b3a$export$a763b9476acd3eb = "__formValidationState" + Date.now();
|
|
2465
|
+
function $e5be200c675c3b3a$export$fc1a364ae1f3ff10(props) {
|
|
2466
|
+
if (props[$e5be200c675c3b3a$export$a763b9476acd3eb]) {
|
|
2467
|
+
let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$e5be200c675c3b3a$export$a763b9476acd3eb];
|
|
2468
|
+
return {
|
|
2469
|
+
realtimeValidation,
|
|
2470
|
+
displayValidation,
|
|
2471
|
+
updateValidation,
|
|
2472
|
+
resetValidation,
|
|
2473
|
+
commitValidation
|
|
2474
|
+
};
|
|
2475
|
+
}
|
|
2476
|
+
return $e5be200c675c3b3a$var$useFormValidationStateImpl(props);
|
|
2477
|
+
}
|
|
2478
|
+
function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
|
|
2479
|
+
let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
|
|
2480
|
+
if (validationState)
|
|
2481
|
+
isInvalid || (isInvalid = validationState === "invalid");
|
|
2482
|
+
let controlledError = isInvalid ? {
|
|
2483
|
+
isInvalid: true,
|
|
2484
|
+
validationErrors: [],
|
|
2485
|
+
validationDetails: $e5be200c675c3b3a$var$CUSTOM_VALIDITY_STATE
|
|
2486
|
+
} : null;
|
|
2487
|
+
let clientError = (0, $jcIOw$useMemo)(() => $e5be200c675c3b3a$var$getValidationResult($e5be200c675c3b3a$var$runValidate(validate, value)), [
|
|
2488
|
+
validate,
|
|
2489
|
+
value
|
|
2490
|
+
]);
|
|
2491
|
+
if (builtinValidation === null || builtinValidation === void 0 ? void 0 : builtinValidation.validationDetails.valid)
|
|
2492
|
+
builtinValidation = null;
|
|
2493
|
+
let serverErrors = (0, $jcIOw$useContext)($e5be200c675c3b3a$export$571b5131b7e65c11);
|
|
2494
|
+
let serverErrorMessages = (0, $jcIOw$useMemo)(() => {
|
|
2495
|
+
if (name)
|
|
2496
|
+
return Array.isArray(name) ? name.flatMap((name2) => $e5be200c675c3b3a$var$asArray(serverErrors[name2])) : $e5be200c675c3b3a$var$asArray(serverErrors[name]);
|
|
2497
|
+
return [];
|
|
2498
|
+
}, [
|
|
2499
|
+
serverErrors,
|
|
2500
|
+
name
|
|
2501
|
+
]);
|
|
2502
|
+
let [lastServerErrors, setLastServerErrors] = (0, $jcIOw$useState)(serverErrors);
|
|
2503
|
+
let [isServerErrorCleared, setServerErrorCleared] = (0, $jcIOw$useState)(false);
|
|
2504
|
+
if (serverErrors !== lastServerErrors) {
|
|
2505
|
+
setLastServerErrors(serverErrors);
|
|
2506
|
+
setServerErrorCleared(false);
|
|
2507
|
+
}
|
|
2508
|
+
let serverError = (0, $jcIOw$useMemo)(() => $e5be200c675c3b3a$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [
|
|
2509
|
+
isServerErrorCleared,
|
|
2510
|
+
serverErrorMessages
|
|
2511
|
+
]);
|
|
2512
|
+
let nextValidation = (0, $jcIOw$useRef)($e5be200c675c3b3a$export$dad6ae84456c676a);
|
|
2513
|
+
let [currentValidity, setCurrentValidity] = (0, $jcIOw$useState)($e5be200c675c3b3a$export$dad6ae84456c676a);
|
|
2514
|
+
let lastError = (0, $jcIOw$useRef)($e5be200c675c3b3a$export$dad6ae84456c676a);
|
|
2515
|
+
let commitValidation = () => {
|
|
2516
|
+
if (!commitQueued)
|
|
2517
|
+
return;
|
|
2518
|
+
setCommitQueued(false);
|
|
2519
|
+
let error = clientError || builtinValidation || nextValidation.current;
|
|
2520
|
+
if (!$e5be200c675c3b3a$var$isEqualValidation(error, lastError.current)) {
|
|
2521
|
+
lastError.current = error;
|
|
2522
|
+
setCurrentValidity(error);
|
|
2523
|
+
}
|
|
2524
|
+
};
|
|
2525
|
+
let [commitQueued, setCommitQueued] = (0, $jcIOw$useState)(false);
|
|
2526
|
+
(0, $jcIOw$useEffect)(commitValidation);
|
|
2527
|
+
let realtimeValidation = controlledError || serverError || clientError || builtinValidation || $e5be200c675c3b3a$export$dad6ae84456c676a;
|
|
2528
|
+
let displayValidation = validationBehavior === "native" ? controlledError || serverError || currentValidity : controlledError || serverError || clientError || builtinValidation || currentValidity;
|
|
2529
|
+
return {
|
|
2530
|
+
realtimeValidation,
|
|
2531
|
+
displayValidation,
|
|
2532
|
+
updateValidation(value2) {
|
|
2533
|
+
if (validationBehavior === "aria" && !$e5be200c675c3b3a$var$isEqualValidation(currentValidity, value2))
|
|
2534
|
+
setCurrentValidity(value2);
|
|
2535
|
+
else
|
|
2536
|
+
nextValidation.current = value2;
|
|
2537
|
+
},
|
|
2538
|
+
resetValidation() {
|
|
2539
|
+
let error = $e5be200c675c3b3a$export$dad6ae84456c676a;
|
|
2540
|
+
if (!$e5be200c675c3b3a$var$isEqualValidation(error, lastError.current)) {
|
|
2541
|
+
lastError.current = error;
|
|
2542
|
+
setCurrentValidity(error);
|
|
2543
|
+
}
|
|
2544
|
+
if (validationBehavior === "native")
|
|
2545
|
+
setCommitQueued(false);
|
|
2546
|
+
setServerErrorCleared(true);
|
|
2547
|
+
},
|
|
2548
|
+
commitValidation() {
|
|
2549
|
+
if (validationBehavior === "native")
|
|
2550
|
+
setCommitQueued(true);
|
|
2551
|
+
setServerErrorCleared(true);
|
|
2552
|
+
}
|
|
2553
|
+
};
|
|
2554
|
+
}
|
|
2555
|
+
function $e5be200c675c3b3a$var$asArray(v) {
|
|
2556
|
+
if (!v)
|
|
2557
|
+
return [];
|
|
2558
|
+
return Array.isArray(v) ? v : [
|
|
2559
|
+
v
|
|
2560
|
+
];
|
|
2561
|
+
}
|
|
2562
|
+
function $e5be200c675c3b3a$var$runValidate(validate, value) {
|
|
2563
|
+
if (typeof validate === "function") {
|
|
2564
|
+
let e = validate(value);
|
|
2565
|
+
if (e && typeof e !== "boolean")
|
|
2566
|
+
return $e5be200c675c3b3a$var$asArray(e);
|
|
2567
|
+
}
|
|
2568
|
+
return [];
|
|
2569
|
+
}
|
|
2570
|
+
function $e5be200c675c3b3a$var$getValidationResult(errors) {
|
|
2571
|
+
return errors.length ? {
|
|
2572
|
+
isInvalid: true,
|
|
2573
|
+
validationErrors: errors,
|
|
2574
|
+
validationDetails: $e5be200c675c3b3a$var$CUSTOM_VALIDITY_STATE
|
|
2575
|
+
} : null;
|
|
2576
|
+
}
|
|
2577
|
+
function $e5be200c675c3b3a$var$isEqualValidation(a, b) {
|
|
2578
|
+
if (a === b)
|
|
2579
|
+
return true;
|
|
2580
|
+
return a && b && a.isInvalid === b.isInvalid && a.validationErrors.length === b.validationErrors.length && a.validationErrors.every((a2, i) => a2 === b.validationErrors[i]) && Object.entries(a.validationDetails).every(([k, v]) => b.validationDetails[k] === v);
|
|
2581
|
+
}
|
|
2582
|
+
|
|
2583
|
+
// ../../node_modules/@react-stately/utils/dist/import.mjs
|
|
2584
|
+
import { useState as $6imuh$useState, useRef as $6imuh$useRef, useEffect as $6imuh$useEffect, useCallback as $6imuh$useCallback } from "react";
|
|
2585
|
+
function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
|
|
2586
|
+
let [stateValue, setStateValue] = (0, $6imuh$useState)(value || defaultValue);
|
|
2587
|
+
let isControlledRef = (0, $6imuh$useRef)(value !== void 0);
|
|
2588
|
+
let isControlled = value !== void 0;
|
|
2589
|
+
(0, $6imuh$useEffect)(() => {
|
|
2590
|
+
let wasControlled = isControlledRef.current;
|
|
2591
|
+
if (wasControlled !== isControlled)
|
|
2592
|
+
console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
|
|
2593
|
+
isControlledRef.current = isControlled;
|
|
2594
|
+
}, [
|
|
2595
|
+
isControlled
|
|
2596
|
+
]);
|
|
2597
|
+
let currentValue = isControlled ? value : stateValue;
|
|
2598
|
+
let setValue = (0, $6imuh$useCallback)((value2, ...args) => {
|
|
2599
|
+
let onChangeCaller = (value3, ...onChangeArgs) => {
|
|
2600
|
+
if (onChange) {
|
|
2601
|
+
if (!Object.is(currentValue, value3))
|
|
2602
|
+
onChange(value3, ...onChangeArgs);
|
|
2603
|
+
}
|
|
2604
|
+
if (!isControlled)
|
|
2605
|
+
currentValue = value3;
|
|
2606
|
+
};
|
|
2607
|
+
if (typeof value2 === "function") {
|
|
2608
|
+
console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320");
|
|
2609
|
+
let updateFunction = (oldValue, ...functionArgs) => {
|
|
2610
|
+
let interceptedValue = value2(isControlled ? currentValue : oldValue, ...functionArgs);
|
|
2611
|
+
onChangeCaller(interceptedValue, ...args);
|
|
2612
|
+
if (!isControlled)
|
|
2613
|
+
return interceptedValue;
|
|
2614
|
+
return oldValue;
|
|
2615
|
+
};
|
|
2616
|
+
setStateValue(updateFunction);
|
|
2617
|
+
} else {
|
|
2618
|
+
if (!isControlled)
|
|
2619
|
+
setStateValue(value2);
|
|
2620
|
+
onChangeCaller(value2, ...args);
|
|
2621
|
+
}
|
|
2622
|
+
}, [
|
|
2623
|
+
isControlled,
|
|
2624
|
+
currentValue,
|
|
2625
|
+
onChange
|
|
2626
|
+
]);
|
|
2627
|
+
return [
|
|
2628
|
+
currentValue,
|
|
2629
|
+
setValue
|
|
2630
|
+
];
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
// ../../node_modules/@react-stately/radio/dist/import.mjs
|
|
2634
|
+
import { useMemo as $fQ2SF$useMemo, useState as $fQ2SF$useState } from "react";
|
|
2635
|
+
var $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 1e10);
|
|
2636
|
+
var $a54cdc5c1942b639$var$i = 0;
|
|
2637
|
+
function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
|
|
2638
|
+
let name = (0, $fQ2SF$useMemo)(() => props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [
|
|
2639
|
+
props.name
|
|
2640
|
+
]);
|
|
2641
|
+
var _props_defaultValue;
|
|
2642
|
+
let [selectedValue, setSelected] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);
|
|
2643
|
+
let [lastFocusedValue, setLastFocusedValue] = (0, $fQ2SF$useState)(null);
|
|
2644
|
+
let validation = (0, $e5be200c675c3b3a$export$fc1a364ae1f3ff10)({
|
|
2645
|
+
...props,
|
|
2646
|
+
value: selectedValue
|
|
2647
|
+
});
|
|
2648
|
+
let setSelectedValue = (value) => {
|
|
2649
|
+
if (!props.isReadOnly && !props.isDisabled) {
|
|
2650
|
+
setSelected(value);
|
|
2651
|
+
validation.commitValidation();
|
|
2652
|
+
}
|
|
2653
|
+
};
|
|
2654
|
+
let isInvalid = validation.displayValidation.isInvalid;
|
|
2655
|
+
return {
|
|
2656
|
+
...validation,
|
|
2657
|
+
name,
|
|
2658
|
+
selectedValue,
|
|
2659
|
+
setSelectedValue,
|
|
2660
|
+
lastFocusedValue,
|
|
2661
|
+
setLastFocusedValue,
|
|
2662
|
+
isDisabled: props.isDisabled || false,
|
|
2663
|
+
isReadOnly: props.isReadOnly || false,
|
|
2664
|
+
isRequired: props.isRequired || false,
|
|
2665
|
+
validationState: props.validationState || (isInvalid ? "invalid" : null),
|
|
2666
|
+
isInvalid
|
|
2667
|
+
};
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
// src/components/SegmentedControl/index.tsx
|
|
2139
2671
|
import {
|
|
2140
2672
|
useRadio,
|
|
2141
2673
|
useRadioGroup
|
|
2142
2674
|
} from "@react-aria/radio";
|
|
2143
|
-
import
|
|
2144
|
-
import { disabledSelector as disabledSelector5 } from "@charcoal-ui/utils";
|
|
2675
|
+
import styled20, { css as css10 } from "styled-components";
|
|
2145
2676
|
|
|
2146
2677
|
// src/components/SegmentedControl/RadioGroupContext.tsx
|
|
2147
2678
|
import { createContext as createContext7, useContext as useContext9 } from "react";
|
|
@@ -2174,7 +2705,7 @@ var SegmentedControl = forwardRef15(
|
|
|
2174
2705
|
}),
|
|
2175
2706
|
[props]
|
|
2176
2707
|
);
|
|
2177
|
-
const state =
|
|
2708
|
+
const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(ariaRadioGroupProps);
|
|
2178
2709
|
const { radioGroupProps } = useRadioGroup(ariaRadioGroupProps, state);
|
|
2179
2710
|
const segmentedControlItems = useMemo2(() => {
|
|
2180
2711
|
return props.data.map(
|
|
@@ -2229,32 +2760,36 @@ var Segmented = (props) => {
|
|
|
2229
2760
|
}
|
|
2230
2761
|
);
|
|
2231
2762
|
};
|
|
2232
|
-
var SegmentedControlRoot =
|
|
2763
|
+
var SegmentedControlRoot = styled20.div`
|
|
2233
2764
|
display: inline-flex;
|
|
2234
2765
|
align-items: center;
|
|
2235
2766
|
|
|
2236
|
-
|
|
2767
|
+
background-color: var(--charcoal-surface3);
|
|
2768
|
+
border-radius: 16px;
|
|
2237
2769
|
`;
|
|
2238
|
-
var SegmentedRoot =
|
|
2770
|
+
var SegmentedRoot = styled20.label`
|
|
2239
2771
|
position: relative;
|
|
2240
2772
|
display: flex;
|
|
2241
2773
|
align-items: center;
|
|
2242
2774
|
cursor: pointer;
|
|
2243
2775
|
height: 32px;
|
|
2244
2776
|
|
|
2245
|
-
|
|
2777
|
+
padding-right: 16px;
|
|
2778
|
+
padding-left: 16px;
|
|
2779
|
+
border-radius: 16px;
|
|
2780
|
+
&:disabled,
|
|
2781
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
2246
2782
|
cursor: default;
|
|
2783
|
+
opacity: 0.32;
|
|
2247
2784
|
}
|
|
2785
|
+
color: var(--charcoal-text2);
|
|
2248
2786
|
|
|
2249
|
-
${({ checked }) =>
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
checked === true && o.bg.brand,
|
|
2254
|
-
checked === true ? o.font.text5 : o.font.text2
|
|
2255
|
-
])}
|
|
2787
|
+
${({ checked = false }) => checked && css10`
|
|
2788
|
+
background-color: var(--charcoal-brand);
|
|
2789
|
+
color: var(--charcoal-text5);
|
|
2790
|
+
`}
|
|
2256
2791
|
`;
|
|
2257
|
-
var SegmentedInput =
|
|
2792
|
+
var SegmentedInput = styled20.input`
|
|
2258
2793
|
position: absolute;
|
|
2259
2794
|
|
|
2260
2795
|
height: 0px;
|
|
@@ -2268,29 +2803,47 @@ var SegmentedInput = styled21.input`
|
|
|
2268
2803
|
white-space: nowrap;
|
|
2269
2804
|
opacity: 0;
|
|
2270
2805
|
`;
|
|
2271
|
-
var RadioLabel2 =
|
|
2806
|
+
var RadioLabel2 = styled20.div`
|
|
2272
2807
|
background: transparent;
|
|
2273
2808
|
display: flex;
|
|
2274
2809
|
align-items: center;
|
|
2275
2810
|
height: 22px;
|
|
2276
2811
|
`;
|
|
2277
|
-
var SegmentedLabelInner =
|
|
2278
|
-
|
|
2812
|
+
var SegmentedLabelInner = styled20.div`
|
|
2813
|
+
font-size: 14px;
|
|
2814
|
+
line-height: 22px;
|
|
2815
|
+
display: flow-root;
|
|
2816
|
+
|
|
2817
|
+
&::before {
|
|
2818
|
+
display: block;
|
|
2819
|
+
width: 0;
|
|
2820
|
+
height: 0;
|
|
2821
|
+
content: '';
|
|
2822
|
+
margin-top: -4px;
|
|
2823
|
+
}
|
|
2824
|
+
&::after {
|
|
2825
|
+
display: block;
|
|
2826
|
+
width: 0;
|
|
2827
|
+
height: 0;
|
|
2828
|
+
content: '';
|
|
2829
|
+
margin-bottom: -4px;
|
|
2830
|
+
}
|
|
2279
2831
|
`;
|
|
2280
2832
|
|
|
2281
2833
|
// src/components/Checkbox/index.tsx
|
|
2282
2834
|
import { forwardRef as forwardRef16, memo as memo7, useMemo as useMemo3 } from "react";
|
|
2283
|
-
import
|
|
2835
|
+
import styled21, { css as css11 } from "styled-components";
|
|
2284
2836
|
import { useCheckbox } from "@react-aria/checkbox";
|
|
2285
2837
|
import { useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
2286
2838
|
import { useToggleState as useToggleState2 } from "react-stately";
|
|
2287
|
-
import { disabledSelector as
|
|
2839
|
+
import { disabledSelector as disabledSelector3 } from "@charcoal-ui/utils";
|
|
2288
2840
|
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2289
2841
|
var Checkbox = forwardRef16(
|
|
2290
2842
|
function CheckboxInner({ invalid = false, ...props }, ref) {
|
|
2291
2843
|
const ariaCheckboxProps = useMemo3(
|
|
2292
2844
|
() => ({
|
|
2293
2845
|
...props,
|
|
2846
|
+
isInValid: invalid,
|
|
2294
2847
|
isSelected: props.checked,
|
|
2295
2848
|
defaultSelected: props.defaultChecked,
|
|
2296
2849
|
validationState: invalid ? "invalid" : "valid",
|
|
@@ -2305,7 +2858,7 @@ var Checkbox = forwardRef16(
|
|
|
2305
2858
|
const isDisabled = (props.disabled ?? false) || (props.readonly ?? false);
|
|
2306
2859
|
return /* @__PURE__ */ jsxs14(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
|
|
2307
2860
|
/* @__PURE__ */ jsxs14(CheckboxRoot, { children: [
|
|
2308
|
-
/* @__PURE__ */ jsx27(CheckboxInput, { type: "checkbox", ...inputProps
|
|
2861
|
+
/* @__PURE__ */ jsx27(CheckboxInput, { type: "checkbox", ...inputProps }),
|
|
2309
2862
|
/* @__PURE__ */ jsx27(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ jsx27(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
|
|
2310
2863
|
] }),
|
|
2311
2864
|
"children" in props && /* @__PURE__ */ jsx27(InputLabel, { children: props.children })
|
|
@@ -2313,25 +2866,28 @@ var Checkbox = forwardRef16(
|
|
|
2313
2866
|
}
|
|
2314
2867
|
);
|
|
2315
2868
|
var Checkbox_default = memo7(Checkbox);
|
|
2316
|
-
var hiddenCss =
|
|
2869
|
+
var hiddenCss = css11`
|
|
2317
2870
|
visibility: hidden;
|
|
2318
2871
|
`;
|
|
2319
|
-
var InputRoot =
|
|
2872
|
+
var InputRoot = styled21.label`
|
|
2320
2873
|
position: relative;
|
|
2321
2874
|
display: flex;
|
|
2322
2875
|
|
|
2323
2876
|
cursor: pointer;
|
|
2324
|
-
${
|
|
2877
|
+
${disabledSelector3} {
|
|
2325
2878
|
cursor: default;
|
|
2326
2879
|
}
|
|
2327
2880
|
|
|
2328
|
-
gap:
|
|
2329
|
-
|
|
2881
|
+
gap: 4px;
|
|
2882
|
+
&:disabled,
|
|
2883
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
2884
|
+
opacity: 0.32;
|
|
2885
|
+
}
|
|
2330
2886
|
`;
|
|
2331
|
-
var CheckboxRoot =
|
|
2887
|
+
var CheckboxRoot = styled21.div`
|
|
2332
2888
|
position: relative;
|
|
2333
2889
|
`;
|
|
2334
|
-
var CheckboxInput =
|
|
2890
|
+
var CheckboxInput = styled21.input`
|
|
2335
2891
|
&[type='checkbox'] {
|
|
2336
2892
|
appearance: none;
|
|
2337
2893
|
display: block;
|
|
@@ -2339,23 +2895,50 @@ var CheckboxInput = styled22.input`
|
|
|
2339
2895
|
margin: 0;
|
|
2340
2896
|
width: 20px;
|
|
2341
2897
|
height: 20px;
|
|
2898
|
+
border-radius: 4px;
|
|
2899
|
+
transition: 0.2s box-shadow, 0.2s background-color;
|
|
2342
2900
|
|
|
2343
2901
|
&:checked {
|
|
2344
|
-
|
|
2902
|
+
background-color: var(--charcoal-brand);
|
|
2903
|
+
|
|
2904
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2905
|
+
&[aria-disabled='false'] {
|
|
2906
|
+
&:hover {
|
|
2907
|
+
background-color: var(--charcoal-brand-hover);
|
|
2908
|
+
}
|
|
2909
|
+
&:active {
|
|
2910
|
+
background-color: var(--charcoal-brand-press);
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2345
2913
|
}
|
|
2914
|
+
|
|
2915
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2916
|
+
&[aria-disabled='false'] {
|
|
2917
|
+
&:focus,
|
|
2918
|
+
&:active {
|
|
2919
|
+
outline: none;
|
|
2920
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
2921
|
+
&:not(:focus-visible) {
|
|
2922
|
+
outline: none;
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
&:focus-visible {
|
|
2926
|
+
outline: none;
|
|
2927
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
2928
|
+
}
|
|
2929
|
+
&[aria-invalid='true'] {
|
|
2930
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2346
2934
|
&:not(:checked) {
|
|
2347
2935
|
border-width: 2px;
|
|
2348
2936
|
border-style: solid;
|
|
2349
|
-
border-color:
|
|
2937
|
+
border-color: var(--charcoal-text4);
|
|
2350
2938
|
}
|
|
2351
|
-
${theme((o) => [o.outline.default.focus, o.borderRadius(4)])}
|
|
2352
|
-
${(p) => p.invalid && theme((o) => [o.outline.assertive])}
|
|
2353
|
-
|
|
2354
|
-
/* FIXME: o.outline.default.focus の transition に o.bg.brand の transition が打ち消されてしまう */
|
|
2355
|
-
transition: all 0.2s !important;
|
|
2356
2939
|
}
|
|
2357
2940
|
`;
|
|
2358
|
-
var CheckboxInputOverlay =
|
|
2941
|
+
var CheckboxInputOverlay = styled21.div`
|
|
2359
2942
|
position: absolute;
|
|
2360
2943
|
top: -2px;
|
|
2361
2944
|
left: -2px;
|
|
@@ -2363,14 +2946,14 @@ var CheckboxInputOverlay = styled22.div`
|
|
|
2363
2946
|
display: flex;
|
|
2364
2947
|
align-items: center;
|
|
2365
2948
|
justify-content: center;
|
|
2366
|
-
|
|
2367
|
-
|
|
2949
|
+
width: 24px;
|
|
2950
|
+
height: 24px;
|
|
2951
|
+
color: var(--charcoal-text5);
|
|
2368
2952
|
|
|
2369
2953
|
${({ checked }) => checked !== true && hiddenCss};
|
|
2370
2954
|
`;
|
|
2371
|
-
var InputLabel =
|
|
2372
|
-
|
|
2373
|
-
|
|
2955
|
+
var InputLabel = styled21.div`
|
|
2956
|
+
color: var(--charcoal-text2);
|
|
2374
2957
|
font-size: 14px;
|
|
2375
2958
|
/** checkbox の height が 20px なのでcheckbox と text が揃っているように見せるために行ボックスの高さを 20px にしている */
|
|
2376
2959
|
line-height: 20px;
|
|
@@ -2379,8 +2962,8 @@ var InputLabel = styled22.div`
|
|
|
2379
2962
|
// src/components/TagItem/index.tsx
|
|
2380
2963
|
import { forwardRef as forwardRef17, memo as memo8, useMemo as useMemo4 } from "react";
|
|
2381
2964
|
import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
2382
|
-
import
|
|
2383
|
-
import {
|
|
2965
|
+
import styled22, { css as css12 } from "styled-components";
|
|
2966
|
+
import { px as px2 } from "@charcoal-ui/utils";
|
|
2384
2967
|
import { useButton } from "@react-aria/button";
|
|
2385
2968
|
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2386
2969
|
var sizeMap = {
|
|
@@ -2433,7 +3016,20 @@ var TagItem = forwardRef17(
|
|
|
2433
3016
|
}
|
|
2434
3017
|
);
|
|
2435
3018
|
var TagItem_default = memo8(TagItem);
|
|
2436
|
-
var
|
|
3019
|
+
var horizontalPadding = ({ left, right }) => css12`
|
|
3020
|
+
padding-right: ${px2(right)};
|
|
3021
|
+
padding-left: ${px2(left)};
|
|
3022
|
+
`;
|
|
3023
|
+
var tagItemRootSize = (size) => {
|
|
3024
|
+
switch (size) {
|
|
3025
|
+
case "M":
|
|
3026
|
+
return horizontalPadding({ left: 24, right: 24 });
|
|
3027
|
+
case "S":
|
|
3028
|
+
return horizontalPadding({ left: 16, right: 16 });
|
|
3029
|
+
}
|
|
3030
|
+
};
|
|
3031
|
+
var activeTagItemRoot = horizontalPadding({ left: 16, right: 8 });
|
|
3032
|
+
var TagItemRoot = styled22.a`
|
|
2437
3033
|
isolation: isolate;
|
|
2438
3034
|
position: relative;
|
|
2439
3035
|
height: ${({ size }) => sizeMap[size]}px;
|
|
@@ -2443,22 +3039,30 @@ var TagItemRoot = styled23.a`
|
|
|
2443
3039
|
text-decoration: none;
|
|
2444
3040
|
cursor: pointer;
|
|
2445
3041
|
overflow: hidden;
|
|
3042
|
+
border-radius: 4px;
|
|
3043
|
+
${({ size, status }) => status !== "active" && tagItemRootSize(size)}
|
|
3044
|
+
${({ status }) => status === "active" && activeTagItemRoot}
|
|
3045
|
+
color: ${({ status }) => status === "inactive" ? "var(--charcoal-text2)" : "var(--charcoal-text5)"};
|
|
3046
|
+
|
|
3047
|
+
transition: 0.2s box-shadow;
|
|
3048
|
+
|
|
3049
|
+
&:not(:disabled):not([aria-disabled]),
|
|
3050
|
+
&[aria-disabled='false'] {
|
|
3051
|
+
&:focus,
|
|
3052
|
+
&:active,
|
|
3053
|
+
&:focus-visible {
|
|
3054
|
+
outline: none;
|
|
3055
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
2446
3058
|
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
status !== "active" && size === "M" && o.padding.horizontal(24),
|
|
2451
|
-
status !== "active" && size === "S" && o.padding.horizontal(16),
|
|
2452
|
-
status === "inactive" ? o.font.text2 : o.font.text5,
|
|
2453
|
-
...status === "active" ? [o.padding.left(16), o.padding.right(8)] : []
|
|
2454
|
-
])}
|
|
2455
|
-
|
|
2456
|
-
${disabledSelector7} {
|
|
2457
|
-
${theme((o) => [o.disabled])}
|
|
3059
|
+
&:disabled,
|
|
3060
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
3061
|
+
opacity: 0.32;
|
|
2458
3062
|
cursor: default;
|
|
2459
3063
|
}
|
|
2460
3064
|
`;
|
|
2461
|
-
var Background =
|
|
3065
|
+
var Background = styled22.div`
|
|
2462
3066
|
position: absolute;
|
|
2463
3067
|
z-index: 1;
|
|
2464
3068
|
top: 0;
|
|
@@ -2467,10 +3071,13 @@ var Background = styled23.div`
|
|
|
2467
3071
|
height: 100%;
|
|
2468
3072
|
|
|
2469
3073
|
background-color: ${({ bgColor }) => bgColor};
|
|
2470
|
-
${({ status }) => status === "inactive" &&
|
|
3074
|
+
${({ status }) => status === "inactive" && css12`
|
|
3075
|
+
background-color: var(--charcoal-surface3);
|
|
3076
|
+
`}
|
|
3077
|
+
|
|
3078
|
+
${({ bgImage }) => bgImage !== void 0 && css12`
|
|
3079
|
+
background-color: var(--charcoal-surface4);
|
|
2471
3080
|
|
|
2472
|
-
${({ bgImage }) => bgImage !== void 0 && css8`
|
|
2473
|
-
${theme((o) => [o.bg.surface4])}
|
|
2474
3081
|
&::before {
|
|
2475
3082
|
content: '';
|
|
2476
3083
|
position: absolute;
|
|
@@ -2485,25 +3092,43 @@ var Background = styled23.div`
|
|
|
2485
3092
|
}
|
|
2486
3093
|
`}
|
|
2487
3094
|
`;
|
|
2488
|
-
var Inner =
|
|
3095
|
+
var Inner = styled22.div`
|
|
2489
3096
|
display: inline-flex;
|
|
2490
|
-
gap:
|
|
3097
|
+
gap: 8px;
|
|
2491
3098
|
align-items: center;
|
|
2492
3099
|
z-index: 2;
|
|
2493
3100
|
`;
|
|
2494
|
-
var labelCSS =
|
|
2495
|
-
|
|
3101
|
+
var labelCSS = css12`
|
|
3102
|
+
font-size: 14px;
|
|
3103
|
+
line-height: 22px;
|
|
3104
|
+
font-weight: bold;
|
|
3105
|
+
display: flow-root;
|
|
3106
|
+
|
|
3107
|
+
&::before {
|
|
3108
|
+
display: block;
|
|
3109
|
+
width: 0;
|
|
3110
|
+
height: 0;
|
|
3111
|
+
content: '';
|
|
3112
|
+
margin-top: -4px;
|
|
3113
|
+
}
|
|
3114
|
+
&::after {
|
|
3115
|
+
display: block;
|
|
3116
|
+
width: 0;
|
|
3117
|
+
height: 0;
|
|
3118
|
+
content: '';
|
|
3119
|
+
margin-bottom: -4px;
|
|
3120
|
+
}
|
|
2496
3121
|
`;
|
|
2497
|
-
var translateLabelCSS =
|
|
3122
|
+
var translateLabelCSS = css12`
|
|
2498
3123
|
display: flex;
|
|
2499
3124
|
align-items: center;
|
|
2500
3125
|
flex-direction: column;
|
|
2501
3126
|
font-size: 10px;
|
|
2502
3127
|
`;
|
|
2503
|
-
var LabelWrapper =
|
|
3128
|
+
var LabelWrapper = styled22.div`
|
|
2504
3129
|
${({ isTranslate }) => isTranslate ?? false ? translateLabelCSS : labelCSS}
|
|
2505
3130
|
`;
|
|
2506
|
-
var Label3 =
|
|
3131
|
+
var Label3 = styled22.span`
|
|
2507
3132
|
max-width: 152px;
|
|
2508
3133
|
overflow: hidden;
|
|
2509
3134
|
text-overflow: ellipsis;
|
|
@@ -2512,8 +3137,25 @@ var Label3 = styled23.span`
|
|
|
2512
3137
|
color: inherit;
|
|
2513
3138
|
line-height: inherit;
|
|
2514
3139
|
`;
|
|
2515
|
-
var TranslatedLabel =
|
|
2516
|
-
|
|
3140
|
+
var TranslatedLabel = styled22.div`
|
|
3141
|
+
font-size: 12px;
|
|
3142
|
+
line-height: 20px;
|
|
3143
|
+
font-weight: bold;
|
|
3144
|
+
display: flow-root;
|
|
3145
|
+
&::before {
|
|
3146
|
+
display: block;
|
|
3147
|
+
width: 0;
|
|
3148
|
+
height: 0;
|
|
3149
|
+
content: '';
|
|
3150
|
+
margin-top: -4px;
|
|
3151
|
+
}
|
|
3152
|
+
&::after {
|
|
3153
|
+
display: block;
|
|
3154
|
+
width: 0;
|
|
3155
|
+
height: 0;
|
|
3156
|
+
content: '';
|
|
3157
|
+
margin-bottom: -4px;
|
|
3158
|
+
}
|
|
2517
3159
|
`;
|
|
2518
3160
|
export {
|
|
2519
3161
|
Button_default as Button,
|