@charcoal-ui/react 3.5.0 → 3.6.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/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.d.ts.map +1 -1
- package/dist/components/Checkbox/index.story.d.ts +1 -0
- package/dist/components/Checkbox/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/FieldLabel/index.d.ts.map +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/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 +741 -317
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +728 -304
- package/dist/index.esm.js.map +1 -1
- package/dist/styled.d.ts +4 -4
- package/package.json +9 -9
- package/src/components/Button/__snapshots__/index.story.storyshot +312 -592
- package/src/components/Button/index.tsx +50 -14
- package/src/components/Checkbox/__snapshots__/index.story.storyshot +209 -40
- package/src/components/Checkbox/__snapshots__/snapshot.test.tsx.snap +410 -80
- package/src/components/Checkbox/index.story.tsx +24 -0
- package/src/components/Checkbox/index.tsx +47 -17
- package/src/components/Clickable/__snapshots__/index.story.storyshot +4 -0
- package/src/components/Clickable/index.tsx +1 -0
- package/src/components/DropdownSelector/DropdownMenuItem.tsx +19 -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 +60 -191
- package/src/components/DropdownSelector/index.tsx +70 -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 +2454 -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/__snapshots__/index.story.storyshot +18 -19
- package/src/components/SegmentedControl/index.tsx +35 -15
- 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 +38 -76
- package/src/components/TextField/TextField.story.tsx +35 -18
- package/src/components/TextField/__snapshots__/TextField.story.storyshot +71 -128
- package/src/components/TextField/index.tsx +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -50,7 +50,7 @@ function CharcoalProvider({
|
|
|
50
50
|
|
|
51
51
|
// src/components/Button/index.tsx
|
|
52
52
|
import { forwardRef as forwardRef3 } from "react";
|
|
53
|
-
import
|
|
53
|
+
import styled2, { css } from "styled-components";
|
|
54
54
|
|
|
55
55
|
// src/_lib/index.ts
|
|
56
56
|
function unreachable(value) {
|
|
@@ -74,14 +74,9 @@ function countCodePointsInString(string) {
|
|
|
74
74
|
return Array.from(string).length;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
// src/styled.ts
|
|
78
|
-
import styled from "styled-components";
|
|
79
|
-
import { createTheme } from "@charcoal-ui/styled";
|
|
80
|
-
var theme = createTheme(styled);
|
|
81
|
-
|
|
82
77
|
// src/components/Clickable/index.tsx
|
|
83
78
|
import * as React2 from "react";
|
|
84
|
-
import
|
|
79
|
+
import styled from "styled-components";
|
|
85
80
|
import { disabledSelector } from "@charcoal-ui/utils";
|
|
86
81
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
87
82
|
var Clickable = React2.forwardRef(
|
|
@@ -107,7 +102,7 @@ var Clickable = React2.forwardRef(
|
|
|
107
102
|
}
|
|
108
103
|
);
|
|
109
104
|
var Clickable_default = Clickable;
|
|
110
|
-
var StyledClickableDiv =
|
|
105
|
+
var StyledClickableDiv = styled.div`
|
|
111
106
|
cursor: pointer;
|
|
112
107
|
|
|
113
108
|
${disabledSelector} {
|
|
@@ -124,6 +119,7 @@ var StyledClickableDiv = styled2.div`
|
|
|
124
119
|
text-rendering: inherit;
|
|
125
120
|
letter-spacing: inherit;
|
|
126
121
|
word-spacing: inherit;
|
|
122
|
+
text-decoration: none;
|
|
127
123
|
|
|
128
124
|
&:focus {
|
|
129
125
|
outline: none;
|
|
@@ -163,7 +159,8 @@ var Button = forwardRef3(function Button2({
|
|
|
163
159
|
{
|
|
164
160
|
...rest,
|
|
165
161
|
disabled,
|
|
166
|
-
$
|
|
162
|
+
$background: variantToBackground(variant),
|
|
163
|
+
$color: variantToFont(variant),
|
|
167
164
|
$size: size,
|
|
168
165
|
$fullWidth: fixed,
|
|
169
166
|
ref,
|
|
@@ -172,7 +169,15 @@ var Button = forwardRef3(function Button2({
|
|
|
172
169
|
);
|
|
173
170
|
});
|
|
174
171
|
var Button_default = Button;
|
|
175
|
-
var
|
|
172
|
+
var horizontalPaddingSmall = css`
|
|
173
|
+
padding-right: 16px;
|
|
174
|
+
padding-left: 16px;
|
|
175
|
+
`;
|
|
176
|
+
var horizontalPaddingMedium = css`
|
|
177
|
+
padding-right: 24px;
|
|
178
|
+
padding-left: 24px;
|
|
179
|
+
`;
|
|
180
|
+
var StyledButton = styled2(Clickable_default)`
|
|
176
181
|
width: ${(p) => p.$fullWidth ? "stretch" : "min-content"};
|
|
177
182
|
display: inline-grid;
|
|
178
183
|
align-items: center;
|
|
@@ -180,16 +185,40 @@ var StyledButton = styled3(Clickable_default)`
|
|
|
180
185
|
cursor: pointer;
|
|
181
186
|
user-select: none;
|
|
182
187
|
white-space: nowrap;
|
|
188
|
+
border-radius: 999999px;
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
line-height: 22px;
|
|
191
|
+
font-weight: bold;
|
|
192
|
+
|
|
193
|
+
${(p) => p.$size === "M" ? horizontalPaddingMedium : horizontalPaddingSmall}
|
|
194
|
+
|
|
195
|
+
color: var(--charcoal-${(p) => p.$color});
|
|
196
|
+
background-color: var(--charcoal-${(p) => p.$background});
|
|
197
|
+
transition: 0.2s color, 0.2s background-color, 0.2s box-shadow;
|
|
198
|
+
|
|
199
|
+
&:not(:disabled):not([aria-disabled]),
|
|
200
|
+
&[aria-disabled='false'] {
|
|
201
|
+
&:active,
|
|
202
|
+
&:focus,
|
|
203
|
+
&:focus-visible {
|
|
204
|
+
outline: none;
|
|
205
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&:hover {
|
|
209
|
+
color: var(--charcoal-${(p) => p.$color}-hover);
|
|
210
|
+
background-color: var(--charcoal-${(p) => p.$background}-hover);
|
|
211
|
+
}
|
|
212
|
+
&:active {
|
|
213
|
+
color: var(--charcoal-${(p) => p.$color}-press);
|
|
214
|
+
background-color: var(--charcoal-${(p) => p.$background}-press);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
183
217
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
o.padding.horizontal(p.$size === "M" ? 24 : 16),
|
|
189
|
-
o.disabled,
|
|
190
|
-
o.borderRadius("oval"),
|
|
191
|
-
o.outline.default.focus
|
|
192
|
-
])}
|
|
218
|
+
&:disabled,
|
|
219
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
220
|
+
opacity: 0.32;
|
|
221
|
+
}
|
|
193
222
|
|
|
194
223
|
/* よく考えたらheight=32って定義が存在しないな... */
|
|
195
224
|
height: ${(p) => p.$size === "M" ? 40 : 32}px;
|
|
@@ -229,63 +258,83 @@ function variantToFont(variant) {
|
|
|
229
258
|
|
|
230
259
|
// src/components/IconButton/index.tsx
|
|
231
260
|
import { forwardRef as forwardRef4 } from "react";
|
|
232
|
-
import
|
|
261
|
+
import styled3 from "styled-components";
|
|
233
262
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
234
263
|
var IconButton = forwardRef4(
|
|
235
264
|
function IconButtonInner({ variant = "Default", size = "M", icon, ...rest }, ref) {
|
|
236
265
|
validateIconSize(size, icon);
|
|
237
|
-
return /* @__PURE__ */ jsx5(StyledIconButton, { ...rest, ref,
|
|
266
|
+
return /* @__PURE__ */ jsx5(StyledIconButton, { ...rest, ref, $size: size, $variant: variant, children: /* @__PURE__ */ jsx5("pixiv-icon", { name: icon }) });
|
|
238
267
|
}
|
|
239
268
|
);
|
|
240
269
|
var IconButton_default = IconButton;
|
|
241
|
-
var StyledIconButton =
|
|
270
|
+
var StyledIconButton = styled3(Clickable_default).attrs(styledProps)`
|
|
242
271
|
user-select: none;
|
|
243
272
|
|
|
244
|
-
width: ${(p) => p
|
|
245
|
-
height: ${(p) => p
|
|
273
|
+
width: ${(p) => p.$width}px;
|
|
274
|
+
height: ${(p) => p.$height}px;
|
|
246
275
|
display: flex;
|
|
247
276
|
align-items: center;
|
|
248
277
|
justify-content: center;
|
|
278
|
+
color: var(${({ $font }) => `--charcoal-${$font}`});
|
|
279
|
+
background-color: var(${({ $background }) => `--charcoal-${$background}`});
|
|
280
|
+
border-radius: 999999px;
|
|
281
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
282
|
+
|
|
283
|
+
&:not(:disabled):not([aria-disabled]),
|
|
284
|
+
&[aria-disabled='false'] {
|
|
285
|
+
&:hover {
|
|
286
|
+
background-color: var(
|
|
287
|
+
${({ $background }) => `--charcoal-${$background}-hover`}
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
&:active {
|
|
291
|
+
background-color: var(
|
|
292
|
+
${({ $background }) => `--charcoal-${$background}-press`}
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
&:focus,
|
|
296
|
+
&:active,
|
|
297
|
+
&:focus-visible {
|
|
298
|
+
outline: none;
|
|
299
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
249
302
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
o.borderRadius("oval"),
|
|
255
|
-
o.outline.default.focus
|
|
256
|
-
])}
|
|
303
|
+
&:disabled,
|
|
304
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
305
|
+
opacity: 0.32;
|
|
306
|
+
}
|
|
257
307
|
`;
|
|
258
|
-
function styledProps(
|
|
308
|
+
function styledProps({ $size, $variant }) {
|
|
259
309
|
return {
|
|
260
|
-
...
|
|
261
|
-
...
|
|
262
|
-
...sizeToProps(props.size)
|
|
310
|
+
...variantToProps($variant),
|
|
311
|
+
...sizeToProps($size)
|
|
263
312
|
};
|
|
264
313
|
}
|
|
265
314
|
function variantToProps(variant) {
|
|
266
315
|
switch (variant) {
|
|
267
316
|
case "Default":
|
|
268
|
-
return { font: "text3", background: "transparent" };
|
|
317
|
+
return { $font: "text3", $background: "transparent" };
|
|
269
318
|
case "Overlay":
|
|
270
|
-
return { font: "text5", background: "surface4" };
|
|
319
|
+
return { $font: "text5", $background: "surface4" };
|
|
271
320
|
}
|
|
272
321
|
}
|
|
273
322
|
function sizeToProps(size) {
|
|
274
323
|
switch (size) {
|
|
275
324
|
case "XS":
|
|
276
325
|
return {
|
|
277
|
-
width: 20,
|
|
278
|
-
height: 20
|
|
326
|
+
$width: 20,
|
|
327
|
+
$height: 20
|
|
279
328
|
};
|
|
280
329
|
case "S":
|
|
281
330
|
return {
|
|
282
|
-
width: 32,
|
|
283
|
-
height: 32
|
|
331
|
+
$width: 32,
|
|
332
|
+
$height: 32
|
|
284
333
|
};
|
|
285
334
|
case "M":
|
|
286
335
|
return {
|
|
287
|
-
width: 40,
|
|
288
|
-
height: 40
|
|
336
|
+
$width: 40,
|
|
337
|
+
$height: 40
|
|
289
338
|
};
|
|
290
339
|
}
|
|
291
340
|
}
|
|
@@ -315,9 +364,8 @@ function validateIconSize(size, icon) {
|
|
|
315
364
|
// src/components/Radio/index.tsx
|
|
316
365
|
import { memo, forwardRef as forwardRef5, useCallback, useContext as useContext2 } from "react";
|
|
317
366
|
import * as React3 from "react";
|
|
318
|
-
import
|
|
367
|
+
import styled4, { css as css2 } from "styled-components";
|
|
319
368
|
import warning from "warning";
|
|
320
|
-
import { px } from "@charcoal-ui/utils";
|
|
321
369
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
322
370
|
var Radio = forwardRef5(function RadioInner({ value, disabled = false, children, className }, ref) {
|
|
323
371
|
const {
|
|
@@ -358,16 +406,19 @@ var Radio = forwardRef5(function RadioInner({ value, disabled = false, children,
|
|
|
358
406
|
] });
|
|
359
407
|
});
|
|
360
408
|
var Radio_default = memo(Radio);
|
|
361
|
-
var RadioRoot =
|
|
409
|
+
var RadioRoot = styled4.label`
|
|
362
410
|
display: grid;
|
|
363
411
|
grid-template-columns: auto 1fr;
|
|
364
|
-
grid-gap:
|
|
412
|
+
grid-gap: 4px;
|
|
365
413
|
align-items: center;
|
|
366
414
|
cursor: pointer;
|
|
367
415
|
|
|
368
|
-
|
|
416
|
+
&:disabled,
|
|
417
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
418
|
+
opacity: 0.32;
|
|
419
|
+
}
|
|
369
420
|
`;
|
|
370
|
-
var RadioInput =
|
|
421
|
+
var RadioInput = styled4.input.attrs({ type: "radio" })`
|
|
371
422
|
/** Make prior to browser default style */
|
|
372
423
|
&[type='radio'] {
|
|
373
424
|
appearance: none;
|
|
@@ -380,46 +431,92 @@ var RadioInput = styled5.input.attrs({ type: "radio" })`
|
|
|
380
431
|
width: 20px;
|
|
381
432
|
height: 20px;
|
|
382
433
|
cursor: pointer;
|
|
434
|
+
border-radius: 999999px;
|
|
435
|
+
background-color: var(--charcoal-surface1);
|
|
436
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
437
|
+
|
|
438
|
+
&:not(:disabled):not([aria-disabled]),
|
|
439
|
+
&[aria-disabled='false'] {
|
|
440
|
+
${({ invalid = false }) => invalid && css2`
|
|
441
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
442
|
+
`}
|
|
383
443
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
444
|
+
&:hover {
|
|
445
|
+
background-color: var(--charcoal-surface1-hover);
|
|
446
|
+
}
|
|
447
|
+
&:active {
|
|
448
|
+
background-color: var(--charcoal-surface1-press);
|
|
449
|
+
}
|
|
450
|
+
&:focus,
|
|
451
|
+
&:active,
|
|
452
|
+
&:focus-visible {
|
|
453
|
+
outline: none;
|
|
454
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
389
457
|
|
|
390
458
|
&:not(:checked) {
|
|
391
459
|
border-width: 2px;
|
|
392
460
|
border-style: solid;
|
|
393
|
-
border-color:
|
|
461
|
+
border-color: var(--charcoal-text3);
|
|
394
462
|
}
|
|
395
463
|
|
|
396
464
|
&:checked {
|
|
397
|
-
|
|
398
|
-
|
|
465
|
+
background-color: var(--charcoal-brand);
|
|
399
466
|
&::after {
|
|
400
467
|
content: '';
|
|
401
468
|
display: block;
|
|
402
469
|
width: 8px;
|
|
403
470
|
height: 8px;
|
|
404
471
|
pointer-events: none;
|
|
472
|
+
background-color: var(--charcoal-text5);
|
|
473
|
+
border-radius: 999999px;
|
|
474
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
475
|
+
}
|
|
405
476
|
|
|
406
|
-
|
|
477
|
+
&:not(:disabled):not([aria-disabled]),
|
|
478
|
+
&[aria-disabled='false'] {
|
|
479
|
+
&:hover {
|
|
480
|
+
background-color: var(--charcoal-brand-hover);
|
|
481
|
+
&::after {
|
|
482
|
+
background-color: var(--charcoal-text5-hover);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
&:active {
|
|
486
|
+
background-color: var(--charcoal-brand-press);
|
|
487
|
+
&::after {
|
|
488
|
+
background-color: var(--charcoal-text5-press);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
407
491
|
}
|
|
408
492
|
}
|
|
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
493
|
}
|
|
415
494
|
`;
|
|
416
|
-
var RadioLabel =
|
|
417
|
-
|
|
495
|
+
var RadioLabel = styled4.div`
|
|
496
|
+
font-size: 14px;
|
|
497
|
+
line-height: 22px;
|
|
498
|
+
display: flow-root;
|
|
499
|
+
color: var(--charcoal-text2);
|
|
500
|
+
|
|
501
|
+
&::before {
|
|
502
|
+
display: block;
|
|
503
|
+
width: 0;
|
|
504
|
+
height: 0;
|
|
505
|
+
content: '';
|
|
506
|
+
margin-top: -4px;
|
|
507
|
+
}
|
|
508
|
+
&::after {
|
|
509
|
+
display: block;
|
|
510
|
+
width: 0;
|
|
511
|
+
height: 0;
|
|
512
|
+
content: '';
|
|
513
|
+
margin-bottom: -4px;
|
|
514
|
+
}
|
|
418
515
|
`;
|
|
419
|
-
var StyledRadioGroup =
|
|
516
|
+
var StyledRadioGroup = styled4.div`
|
|
420
517
|
display: grid;
|
|
421
518
|
grid-template-columns: 1fr;
|
|
422
|
-
grid-gap:
|
|
519
|
+
grid-gap: 8px;
|
|
423
520
|
`;
|
|
424
521
|
var RadioGroupContext = React3.createContext({
|
|
425
522
|
name: void 0,
|
|
@@ -478,9 +575,9 @@ function RadioGroup({
|
|
|
478
575
|
|
|
479
576
|
// src/components/MultiSelect/index.tsx
|
|
480
577
|
import { useCallback as useCallback2, useContext as useContext3, forwardRef as forwardRef6, memo as memo2 } from "react";
|
|
481
|
-
import
|
|
578
|
+
import styled5, { css as css3 } from "styled-components";
|
|
482
579
|
import warning2 from "warning";
|
|
483
|
-
import {
|
|
580
|
+
import { px } from "@charcoal-ui/utils";
|
|
484
581
|
|
|
485
582
|
// src/components/MultiSelect/context.ts
|
|
486
583
|
import { createContext as createContext3 } from "react";
|
|
@@ -564,44 +661,96 @@ var MultiSelect = forwardRef6(
|
|
|
564
661
|
}
|
|
565
662
|
);
|
|
566
663
|
var MultiSelect_default = memo2(MultiSelect);
|
|
567
|
-
var MultiSelectRoot =
|
|
664
|
+
var MultiSelectRoot = styled5.label`
|
|
568
665
|
display: grid;
|
|
569
666
|
grid-template-columns: auto 1fr;
|
|
570
667
|
align-items: center;
|
|
571
668
|
position: relative;
|
|
572
669
|
cursor: pointer;
|
|
573
|
-
${
|
|
670
|
+
gap: ${({ theme }) => px(theme.spacing[4])};
|
|
671
|
+
&:disabled,
|
|
672
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
673
|
+
opacity: 0.32;
|
|
574
674
|
cursor: default;
|
|
575
675
|
}
|
|
576
|
-
gap: ${({ theme: theme3 }) => px2(theme3.spacing[4])};
|
|
577
|
-
${theme((o) => o.disabled)}
|
|
578
676
|
`;
|
|
579
|
-
var MultiSelectLabel =
|
|
677
|
+
var MultiSelectLabel = styled5.div`
|
|
580
678
|
display: flex;
|
|
581
679
|
align-items: center;
|
|
582
|
-
|
|
680
|
+
font-size: 14px;
|
|
681
|
+
line-height: 22px;
|
|
682
|
+
display: flow-root;
|
|
683
|
+
color: var(--charcoal-text2);
|
|
684
|
+
|
|
685
|
+
&::before {
|
|
686
|
+
display: block;
|
|
687
|
+
width: 0;
|
|
688
|
+
height: 0;
|
|
689
|
+
content: '';
|
|
690
|
+
margin-top: -4px;
|
|
691
|
+
}
|
|
692
|
+
&::after {
|
|
693
|
+
display: block;
|
|
694
|
+
width: 0;
|
|
695
|
+
height: 0;
|
|
696
|
+
content: '';
|
|
697
|
+
margin-bottom: -4px;
|
|
698
|
+
}
|
|
583
699
|
`;
|
|
584
|
-
var MultiSelectInput =
|
|
700
|
+
var MultiSelectInput = styled5.input.attrs({ type: "checkbox" })`
|
|
585
701
|
&[type='checkbox'] {
|
|
586
702
|
appearance: none;
|
|
587
703
|
display: block;
|
|
588
704
|
width: 20px;
|
|
589
705
|
height: 20px;
|
|
590
706
|
margin: 0;
|
|
707
|
+
background-color: var(--charcoal-text3);
|
|
708
|
+
border-radius: 999999px;
|
|
709
|
+
transition: 0.2s background-color, 0.2s box-shadow;
|
|
591
710
|
|
|
592
711
|
&:checked {
|
|
593
|
-
|
|
712
|
+
background-color: var(--charcoal-brand);
|
|
713
|
+
&:hover {
|
|
714
|
+
&:not(:disabled):not([aria-disabled]),
|
|
715
|
+
&[aria-disabled='false'] {
|
|
716
|
+
background-color: var(--charcoal-brand-hover);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
&:active {
|
|
721
|
+
&:not(:disabled):not([aria-disabled]),
|
|
722
|
+
&[aria-disabled='false'] {
|
|
723
|
+
background-color: var(--charcoal-brand-press);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
&:hover {
|
|
729
|
+
&:not(:disabled):not([aria-disabled]),
|
|
730
|
+
&[aria-disabled='false'] {
|
|
731
|
+
background-color: var(--charcoal-text3-hover);
|
|
732
|
+
}
|
|
594
733
|
}
|
|
595
734
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
735
|
+
&:active {
|
|
736
|
+
&:not(:disabled):not([aria-disabled]),
|
|
737
|
+
&[aria-disabled='false'] {
|
|
738
|
+
background-color: var(--charcoal-text3-press);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
${({ invalid, overlay }) => invalid && !overlay && css3`
|
|
743
|
+
&:not(:disabled):not([aria-disabled]),
|
|
744
|
+
&[aria-disabled='false'] {
|
|
745
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
746
|
+
}
|
|
747
|
+
`}
|
|
748
|
+
${({ overlay }) => overlay && css3`
|
|
749
|
+
background-color: var(--charcoal-surface4);
|
|
750
|
+
`}
|
|
602
751
|
}
|
|
603
752
|
`;
|
|
604
|
-
var MultiSelectInputOverlay =
|
|
753
|
+
var MultiSelectInputOverlay = styled5.div`
|
|
605
754
|
position: absolute;
|
|
606
755
|
top: -2px;
|
|
607
756
|
left: -2px;
|
|
@@ -609,17 +758,20 @@ var MultiSelectInputOverlay = styled6.div`
|
|
|
609
758
|
display: flex;
|
|
610
759
|
align-items: center;
|
|
611
760
|
justify-content: center;
|
|
761
|
+
width: 24px;
|
|
762
|
+
height: 24px;
|
|
763
|
+
border-radius: 999999px;
|
|
764
|
+
color: var(--charcoal-text5);
|
|
765
|
+
transition: 0.2s box-shadow;
|
|
766
|
+
${({ invalid, overlay }) => invalid && overlay && css3`
|
|
767
|
+
&:not(:disabled):not([aria-disabled]),
|
|
768
|
+
&[aria-disabled='false'] {
|
|
769
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
770
|
+
}
|
|
771
|
+
`}
|
|
612
772
|
|
|
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};
|
|
773
|
+
${({ overlay }) => overlay && css3`
|
|
774
|
+
border-color: var(--charcoal-text5);
|
|
623
775
|
border-width: 2px;
|
|
624
776
|
border-style: solid;
|
|
625
777
|
`}
|
|
@@ -670,8 +822,7 @@ function MultiSelectGroup({
|
|
|
670
822
|
import { useSwitch } from "@react-aria/switch";
|
|
671
823
|
import { useMemo, memo as memo3, forwardRef as forwardRef7 } from "react";
|
|
672
824
|
import { useToggleState } from "react-stately";
|
|
673
|
-
import
|
|
674
|
-
import { disabledSelector as disabledSelector3 } from "@charcoal-ui/utils";
|
|
825
|
+
import styled6 from "styled-components";
|
|
675
826
|
import { useObjectRef } from "@react-aria/utils";
|
|
676
827
|
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
677
828
|
var SwitchCheckbox = forwardRef7(
|
|
@@ -698,33 +849,30 @@ var SwitchCheckbox = forwardRef7(
|
|
|
698
849
|
}
|
|
699
850
|
);
|
|
700
851
|
var Switch_default = memo3(SwitchCheckbox);
|
|
701
|
-
var Label =
|
|
852
|
+
var Label = styled6.label`
|
|
702
853
|
display: inline-grid;
|
|
703
854
|
grid-template-columns: auto 1fr;
|
|
704
855
|
align-items: center;
|
|
705
856
|
cursor: pointer;
|
|
706
857
|
outline: 0;
|
|
707
858
|
|
|
708
|
-
|
|
859
|
+
&:disabled,
|
|
860
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
861
|
+
opacity: 0.32;
|
|
862
|
+
cursor: default;
|
|
863
|
+
}
|
|
709
864
|
|
|
710
865
|
:active > input {
|
|
711
866
|
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
712
867
|
}
|
|
713
|
-
|
|
714
|
-
${disabledSelector3} {
|
|
715
|
-
cursor: default;
|
|
716
|
-
}
|
|
717
868
|
`;
|
|
718
|
-
var LabelInner =
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
])}
|
|
869
|
+
var LabelInner = styled6.div`
|
|
870
|
+
font-size: 14px;
|
|
871
|
+
line-height: 22px;
|
|
872
|
+
color: var(--charcoal-text2);
|
|
873
|
+
margin-left: 4px;
|
|
724
874
|
`;
|
|
725
|
-
var SwitchInput =
|
|
726
|
-
type: "checkbox"
|
|
727
|
-
})`
|
|
875
|
+
var SwitchInput = styled6.input.attrs({ type: "checkbox" })`
|
|
728
876
|
appearance: none;
|
|
729
877
|
display: inline-flex;
|
|
730
878
|
position: relative;
|
|
@@ -791,12 +939,11 @@ import { useTextField } from "@react-aria/textfield";
|
|
|
791
939
|
import { useVisuallyHidden } from "@react-aria/visually-hidden";
|
|
792
940
|
import { useCallback as useCallback3, useEffect as useEffect2, useRef, useState } from "react";
|
|
793
941
|
import * as React5 from "react";
|
|
794
|
-
import
|
|
942
|
+
import styled8, { css as css4 } from "styled-components";
|
|
795
943
|
|
|
796
944
|
// src/components/FieldLabel/index.tsx
|
|
797
945
|
import * as React4 from "react";
|
|
798
|
-
import
|
|
799
|
-
import { createTheme as createTheme2 } from "@charcoal-ui/styled";
|
|
946
|
+
import styled7 from "styled-components";
|
|
800
947
|
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
801
948
|
var FieldLabel = React4.forwardRef(
|
|
802
949
|
function FieldLabel2({
|
|
@@ -816,30 +963,97 @@ var FieldLabel = React4.forwardRef(
|
|
|
816
963
|
}
|
|
817
964
|
);
|
|
818
965
|
var FieldLabel_default = FieldLabel;
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
966
|
+
var Label2 = styled7.label`
|
|
967
|
+
font-size: 14px;
|
|
968
|
+
line-height: 22px;
|
|
969
|
+
font-weight: bold;
|
|
970
|
+
display: flow-root;
|
|
971
|
+
color: var(--charcoal-text1);
|
|
972
|
+
|
|
973
|
+
&::before {
|
|
974
|
+
display: block;
|
|
975
|
+
width: 0;
|
|
976
|
+
height: 0;
|
|
977
|
+
content: '';
|
|
978
|
+
margin-top: -4px;
|
|
979
|
+
}
|
|
980
|
+
&::after {
|
|
981
|
+
display: block;
|
|
982
|
+
width: 0;
|
|
983
|
+
height: 0;
|
|
984
|
+
content: '';
|
|
985
|
+
margin-bottom: -4px;
|
|
986
|
+
}
|
|
822
987
|
`;
|
|
823
|
-
var RequiredText =
|
|
824
|
-
|
|
988
|
+
var RequiredText = styled7.span`
|
|
989
|
+
font-size: 14px;
|
|
990
|
+
line-height: 22px;
|
|
991
|
+
display: flow-root;
|
|
992
|
+
color: var(--charcoal-text2);
|
|
993
|
+
|
|
994
|
+
&::before {
|
|
995
|
+
display: block;
|
|
996
|
+
width: 0;
|
|
997
|
+
height: 0;
|
|
998
|
+
content: '';
|
|
999
|
+
margin-top: -4px;
|
|
1000
|
+
}
|
|
1001
|
+
&::after {
|
|
1002
|
+
display: block;
|
|
1003
|
+
width: 0;
|
|
1004
|
+
height: 0;
|
|
1005
|
+
content: '';
|
|
1006
|
+
margin-bottom: -4px;
|
|
1007
|
+
}
|
|
825
1008
|
`;
|
|
826
|
-
var SubLabelClickable =
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
1009
|
+
var SubLabelClickable = styled7.div`
|
|
1010
|
+
font-size: 14px;
|
|
1011
|
+
line-height: 22px;
|
|
1012
|
+
display: flow-root;
|
|
1013
|
+
color: var(--charcoal-text3);
|
|
1014
|
+
transition: 0.2s color, 0.2s box-shadow;
|
|
1015
|
+
|
|
1016
|
+
&::before {
|
|
1017
|
+
display: block;
|
|
1018
|
+
width: 0;
|
|
1019
|
+
height: 0;
|
|
1020
|
+
content: '';
|
|
1021
|
+
margin-top: -4px;
|
|
1022
|
+
}
|
|
1023
|
+
&::after {
|
|
1024
|
+
display: block;
|
|
1025
|
+
width: 0;
|
|
1026
|
+
height: 0;
|
|
1027
|
+
content: '';
|
|
1028
|
+
margin-bottom: -4px;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
&:not(:disabled):not([aria-disabled]),
|
|
1032
|
+
&[aria-disabled='false'] {
|
|
1033
|
+
&:hover {
|
|
1034
|
+
color: var(--charcoal-text3-hover);
|
|
1035
|
+
}
|
|
1036
|
+
&:active {
|
|
1037
|
+
color: var(--charcoal-text3-press);
|
|
1038
|
+
}
|
|
1039
|
+
&:active,
|
|
1040
|
+
&:focus,
|
|
1041
|
+
&:focus-visible {
|
|
1042
|
+
outline: none;
|
|
1043
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
832
1046
|
`;
|
|
833
|
-
var FieldLabelWrapper =
|
|
1047
|
+
var FieldLabelWrapper = styled7.div`
|
|
834
1048
|
display: inline-flex;
|
|
835
1049
|
align-items: center;
|
|
836
1050
|
|
|
837
1051
|
> ${RequiredText} {
|
|
838
|
-
|
|
1052
|
+
margin-left: 4px;
|
|
839
1053
|
}
|
|
840
1054
|
|
|
841
1055
|
> ${SubLabelClickable} {
|
|
842
|
-
|
|
1056
|
+
margin-left: auto;
|
|
843
1057
|
}
|
|
844
1058
|
`;
|
|
845
1059
|
|
|
@@ -967,16 +1181,16 @@ var TextField = React5.forwardRef(
|
|
|
967
1181
|
}
|
|
968
1182
|
);
|
|
969
1183
|
var TextField_default = TextField;
|
|
970
|
-
var TextFieldRoot =
|
|
1184
|
+
var TextFieldRoot = styled8.div`
|
|
971
1185
|
display: flex;
|
|
972
1186
|
flex-direction: column;
|
|
973
1187
|
|
|
974
1188
|
${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
|
|
975
1189
|
`;
|
|
976
|
-
var TextFieldLabel =
|
|
1190
|
+
var TextFieldLabel = styled8(FieldLabel_default)`
|
|
977
1191
|
margin-bottom: 8px;
|
|
978
1192
|
`;
|
|
979
|
-
var StyledInputContainer =
|
|
1193
|
+
var StyledInputContainer = styled8.div`
|
|
980
1194
|
display: grid;
|
|
981
1195
|
grid-template-columns: ${(p) => [p.hasPrefix && "auto", "1fr", p.hasSuffix && "auto"].filter(Boolean).join(" ")};
|
|
982
1196
|
height: 40px;
|
|
@@ -1007,21 +1221,20 @@ var StyledInputContainer = styled9.div`
|
|
|
1007
1221
|
${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
|
|
1008
1222
|
}
|
|
1009
1223
|
|
|
1010
|
-
${(p) => p.invalid &&
|
|
1224
|
+
${(p) => p.invalid && css4`
|
|
1011
1225
|
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
1012
1226
|
`}
|
|
1013
1227
|
`;
|
|
1014
|
-
var PrefixContainer =
|
|
1228
|
+
var PrefixContainer = styled8.div`
|
|
1015
1229
|
display: flex;
|
|
1016
|
-
padding-left: 8px;
|
|
1017
1230
|
align-items: center;
|
|
1018
1231
|
`;
|
|
1019
|
-
var SuffixContainer =
|
|
1232
|
+
var SuffixContainer = styled8.span`
|
|
1020
1233
|
display: flex;
|
|
1021
1234
|
align-items: center;
|
|
1022
1235
|
gap: 8px;
|
|
1023
1236
|
`;
|
|
1024
|
-
var StyledInput =
|
|
1237
|
+
var StyledInput = styled8.input`
|
|
1025
1238
|
border: none;
|
|
1026
1239
|
box-sizing: border-box;
|
|
1027
1240
|
outline: none;
|
|
@@ -1047,12 +1260,12 @@ var StyledInput = styled9.input`
|
|
|
1047
1260
|
color: var(--charcoal-text3);
|
|
1048
1261
|
}
|
|
1049
1262
|
`;
|
|
1050
|
-
var SingleLineCounter =
|
|
1263
|
+
var SingleLineCounter = styled8.span`
|
|
1051
1264
|
line-height: 22px;
|
|
1052
1265
|
font-size: 14px;
|
|
1053
1266
|
color: var(--charcoal-text3);
|
|
1054
1267
|
`;
|
|
1055
|
-
var AssistiveText =
|
|
1268
|
+
var AssistiveText = styled8.p`
|
|
1056
1269
|
font-size: 14px;
|
|
1057
1270
|
line-height: 22px;
|
|
1058
1271
|
margin-top: 4px;
|
|
@@ -1064,7 +1277,7 @@ var AssistiveText = styled9.p`
|
|
|
1064
1277
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
1065
1278
|
import { useVisuallyHidden as useVisuallyHidden2 } from "@react-aria/visually-hidden";
|
|
1066
1279
|
import { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
|
|
1067
|
-
import
|
|
1280
|
+
import styled9, { css as css5 } from "styled-components";
|
|
1068
1281
|
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1069
1282
|
var TextArea = forwardRef10(
|
|
1070
1283
|
function TextAreaInner({ onChange, ...props }, forwardRef18) {
|
|
@@ -1183,13 +1396,13 @@ var TextArea = forwardRef10(
|
|
|
1183
1396
|
}
|
|
1184
1397
|
);
|
|
1185
1398
|
var TextArea_default = TextArea;
|
|
1186
|
-
var TextFieldRoot2 =
|
|
1399
|
+
var TextFieldRoot2 = styled9.div`
|
|
1187
1400
|
display: flex;
|
|
1188
1401
|
flex-direction: column;
|
|
1189
1402
|
|
|
1190
1403
|
${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
|
|
1191
1404
|
`;
|
|
1192
|
-
var StyledTextareaContainer =
|
|
1405
|
+
var StyledTextareaContainer = styled9.div`
|
|
1193
1406
|
position: relative;
|
|
1194
1407
|
overflow: hidden;
|
|
1195
1408
|
|
|
@@ -1198,7 +1411,7 @@ var StyledTextareaContainer = styled10.div`
|
|
|
1198
1411
|
border-radius: 4px;
|
|
1199
1412
|
transition: 0.2s background-color, 0.2s box-shadow;
|
|
1200
1413
|
|
|
1201
|
-
${({ rows }) =>
|
|
1414
|
+
${({ rows }) => css5`
|
|
1202
1415
|
height: calc(22px * ${rows} + 18px);
|
|
1203
1416
|
`};
|
|
1204
1417
|
|
|
@@ -1212,11 +1425,11 @@ var StyledTextareaContainer = styled10.div`
|
|
|
1212
1425
|
${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
|
|
1213
1426
|
}
|
|
1214
1427
|
|
|
1215
|
-
${(p) => p.invalid &&
|
|
1428
|
+
${(p) => p.invalid && css5`
|
|
1216
1429
|
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
1217
1430
|
`}
|
|
1218
1431
|
`;
|
|
1219
|
-
var StyledTextarea =
|
|
1432
|
+
var StyledTextarea = styled9.textarea`
|
|
1220
1433
|
border: none;
|
|
1221
1434
|
outline: none;
|
|
1222
1435
|
resize: none;
|
|
@@ -1233,7 +1446,7 @@ var StyledTextarea = styled10.textarea`
|
|
|
1233
1446
|
padding: calc(9px / 0.875) calc(8px / 0.875)
|
|
1234
1447
|
${(p) => p.noBottomPadding ? 0 : ""};
|
|
1235
1448
|
|
|
1236
|
-
${({ rows = 1, noBottomPadding }) =>
|
|
1449
|
+
${({ rows = 1, noBottomPadding }) => css5`
|
|
1237
1450
|
height: calc(22px / 0.875 * ${rows} + ${noBottomPadding ? 9 : 20}px);
|
|
1238
1451
|
`};
|
|
1239
1452
|
|
|
@@ -1246,7 +1459,7 @@ var StyledTextarea = styled10.textarea`
|
|
|
1246
1459
|
color: var(--charcoal-text3);
|
|
1247
1460
|
}
|
|
1248
1461
|
`;
|
|
1249
|
-
var MultiLineCounter =
|
|
1462
|
+
var MultiLineCounter = styled9.span`
|
|
1250
1463
|
position: absolute;
|
|
1251
1464
|
bottom: 9px;
|
|
1252
1465
|
right: 8px;
|
|
@@ -1282,7 +1495,7 @@ import {
|
|
|
1282
1495
|
Overlay,
|
|
1283
1496
|
useModalOverlay
|
|
1284
1497
|
} from "@react-aria/overlays";
|
|
1285
|
-
import
|
|
1498
|
+
import styled11, { css as css7, useTheme } from "styled-components";
|
|
1286
1499
|
import { maxWidth as maxWidth2 } from "@charcoal-ui/utils";
|
|
1287
1500
|
import { useMedia } from "@charcoal-ui/styled";
|
|
1288
1501
|
import { animated as animated2, useTransition, easings } from "react-spring";
|
|
@@ -1290,7 +1503,7 @@ import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
|
1290
1503
|
|
|
1291
1504
|
// src/components/Modal/Dialog/index.tsx
|
|
1292
1505
|
import { forwardRef as forwardRef12 } from "react";
|
|
1293
|
-
import
|
|
1506
|
+
import styled10, { css as css6 } from "styled-components";
|
|
1294
1507
|
import { useDialog } from "@react-aria/dialog";
|
|
1295
1508
|
|
|
1296
1509
|
// ../foundation/src/grid.ts
|
|
@@ -1342,7 +1555,7 @@ var Dialog = forwardRef12(function Dialog2(props, forwardRef18) {
|
|
|
1342
1555
|
}
|
|
1343
1556
|
);
|
|
1344
1557
|
});
|
|
1345
|
-
var AnimatedStyledDialogDiv = animated(
|
|
1558
|
+
var AnimatedStyledDialogDiv = animated(styled10.div`
|
|
1346
1559
|
margin: auto;
|
|
1347
1560
|
position: relative;
|
|
1348
1561
|
height: fit-content;
|
|
@@ -1363,18 +1576,18 @@ var AnimatedStyledDialogDiv = animated(styled11.div`
|
|
|
1363
1576
|
}
|
|
1364
1577
|
}}px;
|
|
1365
1578
|
|
|
1366
|
-
background-color:
|
|
1579
|
+
background-color: var(--charcoal-surface1);
|
|
1367
1580
|
border-radius: 24px;
|
|
1368
1581
|
|
|
1369
|
-
@media ${({ theme
|
|
1582
|
+
@media ${({ theme }) => maxWidth(theme.breakpoint.screen1)} {
|
|
1370
1583
|
max-width: 440px;
|
|
1371
1584
|
width: calc(100% - 48px);
|
|
1372
|
-
${(p) => p.bottomSheet !== false &&
|
|
1585
|
+
${(p) => p.bottomSheet !== false && css6`
|
|
1373
1586
|
max-width: unset;
|
|
1374
1587
|
width: 100%;
|
|
1375
1588
|
border-radius: 0;
|
|
1376
1589
|
margin: auto 0 0 0;
|
|
1377
|
-
${p.bottomSheet === "full" &&
|
|
1590
|
+
${p.bottomSheet === "full" && css6`
|
|
1378
1591
|
min-height: 100%;
|
|
1379
1592
|
`}
|
|
1380
1593
|
`}
|
|
@@ -1405,7 +1618,10 @@ var Modal = forwardRef13(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
|
|
|
1405
1618
|
} = props;
|
|
1406
1619
|
const ref = useObjectRef2(external);
|
|
1407
1620
|
const { modalProps, underlayProps } = useModalOverlay(
|
|
1408
|
-
|
|
1621
|
+
{
|
|
1622
|
+
...props,
|
|
1623
|
+
isKeyboardDismissDisabled: isDismissable === void 0 || isDismissable === false
|
|
1624
|
+
},
|
|
1409
1625
|
{
|
|
1410
1626
|
close: onClose,
|
|
1411
1627
|
isOpen,
|
|
@@ -1418,8 +1634,8 @@ var Modal = forwardRef13(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
|
|
|
1418
1634
|
},
|
|
1419
1635
|
ref
|
|
1420
1636
|
);
|
|
1421
|
-
const
|
|
1422
|
-
const isMobile = useMedia(maxWidth2(
|
|
1637
|
+
const theme = useTheme();
|
|
1638
|
+
const isMobile = useMedia(maxWidth2(theme.breakpoint.screen1)) ?? false;
|
|
1423
1639
|
const transitionEnabled = isMobile && bottomSheet !== false;
|
|
1424
1640
|
const showDismiss = !isMobile || bottomSheet !== true;
|
|
1425
1641
|
const transition = useTransition(isOpen, {
|
|
@@ -1498,7 +1714,7 @@ var ModalContext = React9.createContext({
|
|
|
1498
1714
|
showDismiss: true,
|
|
1499
1715
|
bottomSheet: false
|
|
1500
1716
|
});
|
|
1501
|
-
var ModalBackground = animated2(
|
|
1717
|
+
var ModalBackground = animated2(styled11.div`
|
|
1502
1718
|
z-index: ${({ zIndex }) => zIndex};
|
|
1503
1719
|
overflow: auto;
|
|
1504
1720
|
display: flex;
|
|
@@ -1512,33 +1728,44 @@ var ModalBackground = animated2(styled12.div`
|
|
|
1512
1728
|
padding: 40px 0;
|
|
1513
1729
|
box-sizing: border-box;
|
|
1514
1730
|
|
|
1515
|
-
background-color:
|
|
1731
|
+
background-color: var(--charcoal-surface4);
|
|
1516
1732
|
|
|
1517
|
-
@media ${({ theme
|
|
1518
|
-
${(p) => p.$bottomSheet !== false &&
|
|
1733
|
+
@media ${({ theme }) => maxWidth2(theme.breakpoint.screen1)} {
|
|
1734
|
+
${(p) => p.$bottomSheet !== false && css7`
|
|
1519
1735
|
padding: 0;
|
|
1520
1736
|
`}
|
|
1521
1737
|
}
|
|
1522
1738
|
`);
|
|
1523
|
-
var ModalCrossButton =
|
|
1739
|
+
var ModalCrossButton = styled11(IconButton_default)`
|
|
1524
1740
|
position: absolute;
|
|
1525
1741
|
top: 8px;
|
|
1526
1742
|
right: 8px;
|
|
1527
1743
|
|
|
1528
|
-
|
|
1744
|
+
color: var(--charcoal-text3);
|
|
1745
|
+
transition: 0.2s color;
|
|
1746
|
+
|
|
1747
|
+
&:not(:disabled):not([aria-disabled]),
|
|
1748
|
+
&[aria-disabled='false'] {
|
|
1749
|
+
&:hover {
|
|
1750
|
+
color: var(--charcoal-text3-hover);
|
|
1751
|
+
}
|
|
1752
|
+
&:active {
|
|
1753
|
+
color: var(--charcoal-text3-press);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1529
1756
|
`;
|
|
1530
1757
|
function ModalTitle(props) {
|
|
1531
1758
|
const { titleProps, title } = useContext4(ModalContext);
|
|
1532
1759
|
return /* @__PURE__ */ jsx14(ModalHeading, { ...titleProps, ...props, children: title });
|
|
1533
1760
|
}
|
|
1534
|
-
var ModalHeading =
|
|
1761
|
+
var ModalHeading = styled11.h3`
|
|
1535
1762
|
margin: 0;
|
|
1536
1763
|
font-weight: inherit;
|
|
1537
1764
|
font-size: inherit;
|
|
1538
1765
|
`;
|
|
1539
1766
|
|
|
1540
1767
|
// src/components/Modal/ModalPlumbing.tsx
|
|
1541
|
-
import
|
|
1768
|
+
import styled12, { css as css8 } from "styled-components";
|
|
1542
1769
|
import { useContext as useContext5 } from "react";
|
|
1543
1770
|
import { maxWidth as maxWidth3 } from "@charcoal-ui/utils";
|
|
1544
1771
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
@@ -1546,37 +1773,59 @@ function ModalHeader() {
|
|
|
1546
1773
|
const modalCtx = useContext5(ModalContext);
|
|
1547
1774
|
return /* @__PURE__ */ jsx15(ModalHeaderRoot, { $bottomSheet: modalCtx.bottomSheet, children: /* @__PURE__ */ jsx15(StyledModalTitle, {}) });
|
|
1548
1775
|
}
|
|
1549
|
-
var ModalHeaderRoot =
|
|
1776
|
+
var ModalHeaderRoot = styled12.div`
|
|
1550
1777
|
height: 64px;
|
|
1551
1778
|
display: grid;
|
|
1552
1779
|
align-content: center;
|
|
1553
1780
|
justify-content: center;
|
|
1554
|
-
@media ${({ theme
|
|
1555
|
-
${(p) => p.$bottomSheet !== false &&
|
|
1781
|
+
@media ${({ theme }) => maxWidth3(theme.breakpoint.screen1)} {
|
|
1782
|
+
${(p) => p.$bottomSheet !== false && css8`
|
|
1556
1783
|
height: 48px;
|
|
1557
1784
|
`}
|
|
1558
1785
|
}
|
|
1559
1786
|
`;
|
|
1560
|
-
var StyledModalTitle =
|
|
1561
|
-
|
|
1787
|
+
var StyledModalTitle = styled12(ModalTitle)`
|
|
1788
|
+
color: var(--charcoal-text1);
|
|
1789
|
+
font-size: 16px;
|
|
1790
|
+
line-height: 24px;
|
|
1791
|
+
font-weight: bold;
|
|
1792
|
+
display: flow-root;
|
|
1793
|
+
|
|
1794
|
+
&::before {
|
|
1795
|
+
display: block;
|
|
1796
|
+
width: 0;
|
|
1797
|
+
height: 0;
|
|
1798
|
+
content: '';
|
|
1799
|
+
margin-top: -4px;
|
|
1800
|
+
}
|
|
1801
|
+
&::after {
|
|
1802
|
+
display: block;
|
|
1803
|
+
width: 0;
|
|
1804
|
+
height: 0;
|
|
1805
|
+
content: '';
|
|
1806
|
+
margin-bottom: -4px;
|
|
1807
|
+
}
|
|
1562
1808
|
`;
|
|
1563
|
-
var ModalAlign =
|
|
1564
|
-
|
|
1809
|
+
var ModalAlign = styled12.div`
|
|
1810
|
+
padding-left: 16px;
|
|
1811
|
+
padding-right: 16px;
|
|
1565
1812
|
`;
|
|
1566
|
-
var ModalBody =
|
|
1567
|
-
|
|
1813
|
+
var ModalBody = styled12.div`
|
|
1814
|
+
padding-bottom: 40px;
|
|
1568
1815
|
`;
|
|
1569
|
-
var ModalButtons =
|
|
1816
|
+
var ModalButtons = styled12.div`
|
|
1570
1817
|
display: grid;
|
|
1571
1818
|
grid-auto-flow: row;
|
|
1572
1819
|
grid-row-gap: 8px;
|
|
1573
1820
|
|
|
1574
|
-
|
|
1821
|
+
padding-top: 16px;
|
|
1822
|
+
padding-left: 16px;
|
|
1823
|
+
padding-right: 16px;
|
|
1575
1824
|
`;
|
|
1576
1825
|
|
|
1577
1826
|
// src/components/LoadingSpinner/index.tsx
|
|
1578
1827
|
import { forwardRef as forwardRef14, useImperativeHandle, useRef as useRef5, memo as memo5 } from "react";
|
|
1579
|
-
import
|
|
1828
|
+
import styled13, { keyframes } from "styled-components";
|
|
1580
1829
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1581
1830
|
var LoadingSpinner = forwardRef14(
|
|
1582
1831
|
function LoadingSpinnerInner({ size = 48, padding = 16, transparent = false, className }, ref) {
|
|
@@ -1594,7 +1843,7 @@ var LoadingSpinner = forwardRef14(
|
|
|
1594
1843
|
}
|
|
1595
1844
|
);
|
|
1596
1845
|
var LoadingSpinner_default = memo5(LoadingSpinner);
|
|
1597
|
-
var LoadingSpinnerRoot =
|
|
1846
|
+
var LoadingSpinnerRoot = styled13.div.attrs({ role: "progressbar" })`
|
|
1598
1847
|
box-sizing: content-box;
|
|
1599
1848
|
margin: auto;
|
|
1600
1849
|
padding: ${(props) => props.padding}px;
|
|
@@ -1603,10 +1852,8 @@ var LoadingSpinnerRoot = styled14.div.attrs({ role: "progressbar" })`
|
|
|
1603
1852
|
width: ${(props) => props.size}px;
|
|
1604
1853
|
height: ${(props) => props.size}px;
|
|
1605
1854
|
opacity: 0.84;
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
transparent ? o.bg.transparent : o.bg.background1
|
|
1609
|
-
])}
|
|
1855
|
+
color: var(--charcoal-text4);
|
|
1856
|
+
background-color: ${({ transparent }) => `var(--charcoal-${transparent ? "transparent" : "background1"})`};
|
|
1610
1857
|
`;
|
|
1611
1858
|
var scaleOut = keyframes`
|
|
1612
1859
|
from {
|
|
@@ -1619,7 +1866,7 @@ var scaleOut = keyframes`
|
|
|
1619
1866
|
opacity: 0;
|
|
1620
1867
|
}
|
|
1621
1868
|
`;
|
|
1622
|
-
var Icon2 =
|
|
1869
|
+
var Icon2 = styled13.div.attrs({ role: "presentation" })`
|
|
1623
1870
|
width: 1em;
|
|
1624
1871
|
height: 1em;
|
|
1625
1872
|
border-radius: 1em;
|
|
@@ -1650,8 +1897,8 @@ var LoadingSpinnerIcon = forwardRef14(
|
|
|
1650
1897
|
|
|
1651
1898
|
// src/components/DropdownSelector/index.tsx
|
|
1652
1899
|
import { useState as useState3, useRef as useRef9 } from "react";
|
|
1653
|
-
import
|
|
1654
|
-
import { disabledSelector as
|
|
1900
|
+
import styled16, { css as css9 } from "styled-components";
|
|
1901
|
+
import { disabledSelector as disabledSelector2 } from "@charcoal-ui/utils";
|
|
1655
1902
|
|
|
1656
1903
|
// src/components/DropdownSelector/DropdownPopover.tsx
|
|
1657
1904
|
import { useEffect as useEffect6, useRef as useRef7 } from "react";
|
|
@@ -1659,7 +1906,7 @@ import { useEffect as useEffect6, useRef as useRef7 } from "react";
|
|
|
1659
1906
|
// src/components/DropdownSelector/Popover/index.tsx
|
|
1660
1907
|
import { useContext as useContext6, useRef as useRef6 } from "react";
|
|
1661
1908
|
import { DismissButton, Overlay as Overlay2, usePopover } from "@react-aria/overlays";
|
|
1662
|
-
import
|
|
1909
|
+
import styled14 from "styled-components";
|
|
1663
1910
|
|
|
1664
1911
|
// src/components/DropdownSelector/Popover/usePreventScroll.tsx
|
|
1665
1912
|
import { useEffect as useEffect5 } from "react";
|
|
@@ -1721,18 +1968,16 @@ function Popover(props) {
|
|
|
1721
1968
|
] })
|
|
1722
1969
|
] });
|
|
1723
1970
|
}
|
|
1724
|
-
var DropdownPopoverDiv =
|
|
1971
|
+
var DropdownPopoverDiv = styled14.div`
|
|
1725
1972
|
margin: 4px 0;
|
|
1726
1973
|
list-style: none;
|
|
1727
1974
|
overflow: auto;
|
|
1728
1975
|
max-height: inherit;
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
o.padding.vertical(8)
|
|
1735
|
-
])}
|
|
1976
|
+
background-color: var(--charcoal-background1);
|
|
1977
|
+
border: solid 1px var(--charcoal-border-default);
|
|
1978
|
+
border-radius: 8px;
|
|
1979
|
+
padding-top: 8px;
|
|
1980
|
+
padding-bottom: 8px;
|
|
1736
1981
|
`;
|
|
1737
1982
|
|
|
1738
1983
|
// src/components/DropdownSelector/DropdownPopover.tsx
|
|
@@ -1796,7 +2041,7 @@ function findPreviewRecursive(children, value) {
|
|
|
1796
2041
|
|
|
1797
2042
|
// src/components/DropdownSelector/MenuList/index.tsx
|
|
1798
2043
|
import { useRef as useRef8 } from "react";
|
|
1799
|
-
import
|
|
2044
|
+
import styled15 from "styled-components";
|
|
1800
2045
|
|
|
1801
2046
|
// src/components/DropdownSelector/MenuList/MenuListContext.ts
|
|
1802
2047
|
import { createContext as createContext6 } from "react";
|
|
@@ -1848,7 +2093,7 @@ function MenuList(props) {
|
|
|
1848
2093
|
}
|
|
1849
2094
|
) });
|
|
1850
2095
|
}
|
|
1851
|
-
var StyledUl =
|
|
2096
|
+
var StyledUl = styled15.ul`
|
|
1852
2097
|
padding: 0;
|
|
1853
2098
|
margin: 0;
|
|
1854
2099
|
`;
|
|
@@ -1911,21 +2156,20 @@ function DropdownSelector(props) {
|
|
|
1911
2156
|
props.assistiveText !== void 0 && /* @__PURE__ */ jsx20(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
|
|
1912
2157
|
] });
|
|
1913
2158
|
}
|
|
1914
|
-
var DropdownSelectorRoot =
|
|
2159
|
+
var DropdownSelectorRoot = styled16.div`
|
|
1915
2160
|
display: inline-block;
|
|
1916
2161
|
width: 100%;
|
|
1917
2162
|
|
|
1918
|
-
${
|
|
2163
|
+
${disabledSelector2} {
|
|
1919
2164
|
cursor: default;
|
|
1920
|
-
|
|
2165
|
+
opacity: 0.32;
|
|
1921
2166
|
}
|
|
1922
2167
|
`;
|
|
1923
|
-
var DropdownFieldLabel =
|
|
2168
|
+
var DropdownFieldLabel = styled16(FieldLabel_default)`
|
|
1924
2169
|
width: 100%;
|
|
1925
|
-
|
|
1926
|
-
${theme((o) => o.margin.bottom(8))}
|
|
2170
|
+
margin-bottom: 8px;
|
|
1927
2171
|
`;
|
|
1928
|
-
var DropdownButton =
|
|
2172
|
+
var DropdownButton = styled16.button`
|
|
1929
2173
|
display: flex;
|
|
1930
2174
|
justify-content: space-between;
|
|
1931
2175
|
align-items: center;
|
|
@@ -1936,64 +2180,117 @@ var DropdownButton = styled17.button`
|
|
|
1936
2180
|
border: none;
|
|
1937
2181
|
cursor: pointer;
|
|
1938
2182
|
|
|
1939
|
-
${
|
|
2183
|
+
${disabledSelector2} {
|
|
1940
2184
|
cursor: default;
|
|
1941
2185
|
}
|
|
1942
2186
|
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
2187
|
+
padding-right: 8px;
|
|
2188
|
+
padding-left: 8px;
|
|
2189
|
+
background-color: var(--charcoal-surface3);
|
|
2190
|
+
border-radius: 4px;
|
|
2191
|
+
|
|
2192
|
+
transition: 0.2s box-shadow;
|
|
2193
|
+
|
|
2194
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2195
|
+
&[aria-disabled='false'] {
|
|
2196
|
+
&:focus,
|
|
2197
|
+
&:active,
|
|
2198
|
+
&:focus-visible {
|
|
2199
|
+
outline: none;
|
|
2200
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
${({ invalid }) => invalid === true && css9`
|
|
2205
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2206
|
+
&[aria-disabled='false'] {
|
|
2207
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
2208
|
+
}
|
|
2209
|
+
`}
|
|
1950
2210
|
`;
|
|
1951
|
-
var DropdownButtonText =
|
|
2211
|
+
var DropdownButtonText = styled16.span`
|
|
1952
2212
|
text-align: left;
|
|
1953
|
-
|
|
1954
|
-
|
|
2213
|
+
font-size: 14px;
|
|
2214
|
+
line-height: 22px;
|
|
2215
|
+
display: flow-root;
|
|
2216
|
+
color: var(--charcoal-text2);
|
|
2217
|
+
&::before {
|
|
2218
|
+
display: block;
|
|
2219
|
+
width: 0;
|
|
2220
|
+
height: 0;
|
|
2221
|
+
content: '';
|
|
2222
|
+
margin-top: -4px;
|
|
2223
|
+
}
|
|
2224
|
+
&::after {
|
|
2225
|
+
display: block;
|
|
2226
|
+
width: 0;
|
|
2227
|
+
height: 0;
|
|
2228
|
+
content: '';
|
|
2229
|
+
margin-bottom: -4px;
|
|
2230
|
+
}
|
|
1955
2231
|
`;
|
|
1956
|
-
var DropdownButtonIcon =
|
|
1957
|
-
|
|
2232
|
+
var DropdownButtonIcon = styled16(Icon_default)`
|
|
2233
|
+
color: var(--charcoal-text2);
|
|
1958
2234
|
`;
|
|
1959
|
-
var AssertiveText =
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2235
|
+
var AssertiveText = styled16.div`
|
|
2236
|
+
margin-top: 8px;
|
|
2237
|
+
font-size: 14px;
|
|
2238
|
+
color: var(--charcoal-text2);
|
|
2239
|
+
line-height: 22px;
|
|
2240
|
+
display: flow-root;
|
|
2241
|
+
&::before {
|
|
2242
|
+
display: block;
|
|
2243
|
+
width: 0;
|
|
2244
|
+
height: 0;
|
|
2245
|
+
content: '';
|
|
2246
|
+
margin-top: -4px;
|
|
2247
|
+
}
|
|
2248
|
+
&::after {
|
|
2249
|
+
display: block;
|
|
2250
|
+
width: 0;
|
|
2251
|
+
height: 0;
|
|
2252
|
+
content: '';
|
|
2253
|
+
margin-bottom: -4px;
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
${({ invalid }) => invalid === true && css9`
|
|
2257
|
+
color: var(--charcoal-assertive);
|
|
2258
|
+
`}
|
|
1965
2259
|
`;
|
|
1966
2260
|
|
|
1967
2261
|
// src/components/DropdownSelector/DropdownMenuItem.tsx
|
|
1968
|
-
import
|
|
2262
|
+
import styled18 from "styled-components";
|
|
1969
2263
|
|
|
1970
2264
|
// src/components/DropdownSelector/ListItem/index.tsx
|
|
1971
|
-
import
|
|
2265
|
+
import styled17 from "styled-components";
|
|
1972
2266
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1973
2267
|
function ListItem(props) {
|
|
1974
2268
|
const { children, ...rest } = props;
|
|
1975
2269
|
return /* @__PURE__ */ jsx21(StyledLi, { role: "option", children: /* @__PURE__ */ jsx21(ItemDiv, { ...rest, children: props.children }) });
|
|
1976
2270
|
}
|
|
1977
|
-
var StyledLi =
|
|
2271
|
+
var StyledLi = styled17.li`
|
|
1978
2272
|
list-style: none;
|
|
1979
2273
|
`;
|
|
1980
|
-
var ItemDiv =
|
|
2274
|
+
var ItemDiv = styled17.div`
|
|
1981
2275
|
display: flex;
|
|
1982
2276
|
align-items: center;
|
|
1983
2277
|
min-height: 40px;
|
|
1984
2278
|
cursor: pointer;
|
|
1985
2279
|
outline: none;
|
|
1986
2280
|
|
|
1987
|
-
|
|
2281
|
+
padding-right: 16px;
|
|
2282
|
+
padding-left: 16px;
|
|
1988
2283
|
|
|
1989
|
-
|
|
2284
|
+
&:disabled,
|
|
2285
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
2286
|
+
opacity: 0.32;
|
|
1990
2287
|
cursor: default;
|
|
1991
2288
|
}
|
|
1992
2289
|
|
|
1993
2290
|
:hover,
|
|
1994
2291
|
:focus,
|
|
1995
2292
|
:focus-within {
|
|
1996
|
-
|
|
2293
|
+
background-color: var(--charcoal-surface3);
|
|
1997
2294
|
}
|
|
1998
2295
|
`;
|
|
1999
2296
|
|
|
@@ -2094,20 +2391,37 @@ function DropdownMenuItem(props) {
|
|
|
2094
2391
|
/* @__PURE__ */ jsx23(StyledSpan, { isSelected, children: props.children })
|
|
2095
2392
|
] });
|
|
2096
2393
|
}
|
|
2097
|
-
var StyledSpan =
|
|
2098
|
-
|
|
2394
|
+
var StyledSpan = styled18.span`
|
|
2395
|
+
font-size: 14px;
|
|
2396
|
+
line-height: 22px;
|
|
2397
|
+
color: var(--charcoal-text2);
|
|
2398
|
+
&::before {
|
|
2399
|
+
display: block;
|
|
2400
|
+
width: 0;
|
|
2401
|
+
height: 0;
|
|
2402
|
+
content: '';
|
|
2403
|
+
margin-top: -4px;
|
|
2404
|
+
}
|
|
2405
|
+
&::after {
|
|
2406
|
+
display: block;
|
|
2407
|
+
width: 0;
|
|
2408
|
+
height: 0;
|
|
2409
|
+
content: '';
|
|
2410
|
+
margin-bottom: -4px;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2099
2413
|
display: flex;
|
|
2100
2414
|
align-items: center;
|
|
2101
2415
|
width: 100%;
|
|
2102
2416
|
margin-left: ${({ isSelected }) => isSelected === true ? 0 : 20}px;
|
|
2103
2417
|
`;
|
|
2104
|
-
var Text2ColorIcon =
|
|
2105
|
-
|
|
2418
|
+
var Text2ColorIcon = styled18(Icon_default)`
|
|
2419
|
+
color: var(--charcoal-text2);
|
|
2106
2420
|
padding-right: 4px;
|
|
2107
2421
|
`;
|
|
2108
2422
|
|
|
2109
2423
|
// src/components/DropdownSelector/MenuItemGroup/index.tsx
|
|
2110
|
-
import
|
|
2424
|
+
import styled19 from "styled-components";
|
|
2111
2425
|
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2112
2426
|
function MenuItemGroup(props) {
|
|
2113
2427
|
return /* @__PURE__ */ jsxs12(StyledLi2, { role: "presentation", children: [
|
|
@@ -2115,21 +2429,21 @@ function MenuItemGroup(props) {
|
|
|
2115
2429
|
/* @__PURE__ */ jsx24(StyledUl2, { role: "group", children: props.children })
|
|
2116
2430
|
] });
|
|
2117
2431
|
}
|
|
2118
|
-
var TextSpan =
|
|
2432
|
+
var TextSpan = styled19.span`
|
|
2119
2433
|
display: block;
|
|
2120
|
-
color:
|
|
2434
|
+
color: var(--charcoal-text3);
|
|
2121
2435
|
font-size: 12px;
|
|
2122
2436
|
font-weight: bold;
|
|
2123
2437
|
padding: 12px 0 8px 16px;
|
|
2124
2438
|
`;
|
|
2125
|
-
var StyledUl2 =
|
|
2439
|
+
var StyledUl2 = styled19.ul`
|
|
2126
2440
|
padding-left: 0;
|
|
2127
2441
|
margin: 0;
|
|
2128
2442
|
box-sizing: border-box;
|
|
2129
2443
|
list-style: none;
|
|
2130
2444
|
overflow: hidden;
|
|
2131
2445
|
`;
|
|
2132
|
-
var StyledLi2 =
|
|
2446
|
+
var StyledLi2 = styled19.li`
|
|
2133
2447
|
display: block;
|
|
2134
2448
|
`;
|
|
2135
2449
|
|
|
@@ -2140,8 +2454,7 @@ import {
|
|
|
2140
2454
|
useRadio,
|
|
2141
2455
|
useRadioGroup
|
|
2142
2456
|
} from "@react-aria/radio";
|
|
2143
|
-
import
|
|
2144
|
-
import { disabledSelector as disabledSelector5 } from "@charcoal-ui/utils";
|
|
2457
|
+
import styled20, { css as css10 } from "styled-components";
|
|
2145
2458
|
|
|
2146
2459
|
// src/components/SegmentedControl/RadioGroupContext.tsx
|
|
2147
2460
|
import { createContext as createContext7, useContext as useContext9 } from "react";
|
|
@@ -2229,32 +2542,36 @@ var Segmented = (props) => {
|
|
|
2229
2542
|
}
|
|
2230
2543
|
);
|
|
2231
2544
|
};
|
|
2232
|
-
var SegmentedControlRoot =
|
|
2545
|
+
var SegmentedControlRoot = styled20.div`
|
|
2233
2546
|
display: inline-flex;
|
|
2234
2547
|
align-items: center;
|
|
2235
2548
|
|
|
2236
|
-
|
|
2549
|
+
background-color: var(--charcoal-surface3);
|
|
2550
|
+
border-radius: 16px;
|
|
2237
2551
|
`;
|
|
2238
|
-
var SegmentedRoot =
|
|
2552
|
+
var SegmentedRoot = styled20.label`
|
|
2239
2553
|
position: relative;
|
|
2240
2554
|
display: flex;
|
|
2241
2555
|
align-items: center;
|
|
2242
2556
|
cursor: pointer;
|
|
2243
2557
|
height: 32px;
|
|
2244
2558
|
|
|
2245
|
-
|
|
2559
|
+
padding-right: 16px;
|
|
2560
|
+
padding-left: 16px;
|
|
2561
|
+
border-radius: 16px;
|
|
2562
|
+
&:disabled,
|
|
2563
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
2246
2564
|
cursor: default;
|
|
2565
|
+
opacity: 0.32;
|
|
2247
2566
|
}
|
|
2567
|
+
color: var(--charcoal-text2);
|
|
2248
2568
|
|
|
2249
|
-
${({ checked }) =>
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
checked === true && o.bg.brand,
|
|
2254
|
-
checked === true ? o.font.text5 : o.font.text2
|
|
2255
|
-
])}
|
|
2569
|
+
${({ checked = false }) => checked && css10`
|
|
2570
|
+
background-color: var(--charcoal-brand);
|
|
2571
|
+
color: var(--charcoal-text5);
|
|
2572
|
+
`}
|
|
2256
2573
|
`;
|
|
2257
|
-
var SegmentedInput =
|
|
2574
|
+
var SegmentedInput = styled20.input`
|
|
2258
2575
|
position: absolute;
|
|
2259
2576
|
|
|
2260
2577
|
height: 0px;
|
|
@@ -2268,29 +2585,47 @@ var SegmentedInput = styled21.input`
|
|
|
2268
2585
|
white-space: nowrap;
|
|
2269
2586
|
opacity: 0;
|
|
2270
2587
|
`;
|
|
2271
|
-
var RadioLabel2 =
|
|
2588
|
+
var RadioLabel2 = styled20.div`
|
|
2272
2589
|
background: transparent;
|
|
2273
2590
|
display: flex;
|
|
2274
2591
|
align-items: center;
|
|
2275
2592
|
height: 22px;
|
|
2276
2593
|
`;
|
|
2277
|
-
var SegmentedLabelInner =
|
|
2278
|
-
|
|
2594
|
+
var SegmentedLabelInner = styled20.div`
|
|
2595
|
+
font-size: 14px;
|
|
2596
|
+
line-height: 22px;
|
|
2597
|
+
display: flow-root;
|
|
2598
|
+
|
|
2599
|
+
&::before {
|
|
2600
|
+
display: block;
|
|
2601
|
+
width: 0;
|
|
2602
|
+
height: 0;
|
|
2603
|
+
content: '';
|
|
2604
|
+
margin-top: -4px;
|
|
2605
|
+
}
|
|
2606
|
+
&::after {
|
|
2607
|
+
display: block;
|
|
2608
|
+
width: 0;
|
|
2609
|
+
height: 0;
|
|
2610
|
+
content: '';
|
|
2611
|
+
margin-bottom: -4px;
|
|
2612
|
+
}
|
|
2279
2613
|
`;
|
|
2280
2614
|
|
|
2281
2615
|
// src/components/Checkbox/index.tsx
|
|
2282
2616
|
import { forwardRef as forwardRef16, memo as memo7, useMemo as useMemo3 } from "react";
|
|
2283
|
-
import
|
|
2617
|
+
import styled21, { css as css11 } from "styled-components";
|
|
2284
2618
|
import { useCheckbox } from "@react-aria/checkbox";
|
|
2285
2619
|
import { useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
2286
2620
|
import { useToggleState as useToggleState2 } from "react-stately";
|
|
2287
|
-
import { disabledSelector as
|
|
2621
|
+
import { disabledSelector as disabledSelector3 } from "@charcoal-ui/utils";
|
|
2288
2622
|
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2289
2623
|
var Checkbox = forwardRef16(
|
|
2290
2624
|
function CheckboxInner({ invalid = false, ...props }, ref) {
|
|
2291
2625
|
const ariaCheckboxProps = useMemo3(
|
|
2292
2626
|
() => ({
|
|
2293
2627
|
...props,
|
|
2628
|
+
isInValid: invalid,
|
|
2294
2629
|
isSelected: props.checked,
|
|
2295
2630
|
defaultSelected: props.defaultChecked,
|
|
2296
2631
|
validationState: invalid ? "invalid" : "valid",
|
|
@@ -2305,7 +2640,7 @@ var Checkbox = forwardRef16(
|
|
|
2305
2640
|
const isDisabled = (props.disabled ?? false) || (props.readonly ?? false);
|
|
2306
2641
|
return /* @__PURE__ */ jsxs14(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
|
|
2307
2642
|
/* @__PURE__ */ jsxs14(CheckboxRoot, { children: [
|
|
2308
|
-
/* @__PURE__ */ jsx27(CheckboxInput, { type: "checkbox", ...inputProps
|
|
2643
|
+
/* @__PURE__ */ jsx27(CheckboxInput, { type: "checkbox", ...inputProps }),
|
|
2309
2644
|
/* @__PURE__ */ jsx27(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ jsx27(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
|
|
2310
2645
|
] }),
|
|
2311
2646
|
"children" in props && /* @__PURE__ */ jsx27(InputLabel, { children: props.children })
|
|
@@ -2313,25 +2648,28 @@ var Checkbox = forwardRef16(
|
|
|
2313
2648
|
}
|
|
2314
2649
|
);
|
|
2315
2650
|
var Checkbox_default = memo7(Checkbox);
|
|
2316
|
-
var hiddenCss =
|
|
2651
|
+
var hiddenCss = css11`
|
|
2317
2652
|
visibility: hidden;
|
|
2318
2653
|
`;
|
|
2319
|
-
var InputRoot =
|
|
2654
|
+
var InputRoot = styled21.label`
|
|
2320
2655
|
position: relative;
|
|
2321
2656
|
display: flex;
|
|
2322
2657
|
|
|
2323
2658
|
cursor: pointer;
|
|
2324
|
-
${
|
|
2659
|
+
${disabledSelector3} {
|
|
2325
2660
|
cursor: default;
|
|
2326
2661
|
}
|
|
2327
2662
|
|
|
2328
|
-
gap:
|
|
2329
|
-
|
|
2663
|
+
gap: 4px;
|
|
2664
|
+
&:disabled,
|
|
2665
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
2666
|
+
opacity: 0.32;
|
|
2667
|
+
}
|
|
2330
2668
|
`;
|
|
2331
|
-
var CheckboxRoot =
|
|
2669
|
+
var CheckboxRoot = styled21.div`
|
|
2332
2670
|
position: relative;
|
|
2333
2671
|
`;
|
|
2334
|
-
var CheckboxInput =
|
|
2672
|
+
var CheckboxInput = styled21.input`
|
|
2335
2673
|
&[type='checkbox'] {
|
|
2336
2674
|
appearance: none;
|
|
2337
2675
|
display: block;
|
|
@@ -2339,23 +2677,50 @@ var CheckboxInput = styled22.input`
|
|
|
2339
2677
|
margin: 0;
|
|
2340
2678
|
width: 20px;
|
|
2341
2679
|
height: 20px;
|
|
2680
|
+
border-radius: 4px;
|
|
2681
|
+
transition: 0.2s box-shadow, 0.2s background-color;
|
|
2342
2682
|
|
|
2343
2683
|
&:checked {
|
|
2344
|
-
|
|
2684
|
+
background-color: var(--charcoal-brand);
|
|
2685
|
+
|
|
2686
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2687
|
+
&[aria-disabled='false'] {
|
|
2688
|
+
&:hover {
|
|
2689
|
+
background-color: var(--charcoal-brand-hover);
|
|
2690
|
+
}
|
|
2691
|
+
&:active {
|
|
2692
|
+
background-color: var(--charcoal-brand-press);
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2345
2695
|
}
|
|
2696
|
+
|
|
2697
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2698
|
+
&[aria-disabled='false'] {
|
|
2699
|
+
&:focus,
|
|
2700
|
+
&:active {
|
|
2701
|
+
outline: none;
|
|
2702
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
2703
|
+
&:not(:focus-visible) {
|
|
2704
|
+
outline: none;
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
&:focus-visible {
|
|
2708
|
+
outline: none;
|
|
2709
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
2710
|
+
}
|
|
2711
|
+
&[aria-invalid='true'] {
|
|
2712
|
+
box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2346
2716
|
&:not(:checked) {
|
|
2347
2717
|
border-width: 2px;
|
|
2348
2718
|
border-style: solid;
|
|
2349
|
-
border-color:
|
|
2719
|
+
border-color: var(--charcoal-text4);
|
|
2350
2720
|
}
|
|
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
2721
|
}
|
|
2357
2722
|
`;
|
|
2358
|
-
var CheckboxInputOverlay =
|
|
2723
|
+
var CheckboxInputOverlay = styled21.div`
|
|
2359
2724
|
position: absolute;
|
|
2360
2725
|
top: -2px;
|
|
2361
2726
|
left: -2px;
|
|
@@ -2363,14 +2728,14 @@ var CheckboxInputOverlay = styled22.div`
|
|
|
2363
2728
|
display: flex;
|
|
2364
2729
|
align-items: center;
|
|
2365
2730
|
justify-content: center;
|
|
2366
|
-
|
|
2367
|
-
|
|
2731
|
+
width: 24px;
|
|
2732
|
+
height: 24px;
|
|
2733
|
+
color: var(--charcoal-text5);
|
|
2368
2734
|
|
|
2369
2735
|
${({ checked }) => checked !== true && hiddenCss};
|
|
2370
2736
|
`;
|
|
2371
|
-
var InputLabel =
|
|
2372
|
-
|
|
2373
|
-
|
|
2737
|
+
var InputLabel = styled21.div`
|
|
2738
|
+
color: var(--charcoal-text2);
|
|
2374
2739
|
font-size: 14px;
|
|
2375
2740
|
/** checkbox の height が 20px なのでcheckbox と text が揃っているように見せるために行ボックスの高さを 20px にしている */
|
|
2376
2741
|
line-height: 20px;
|
|
@@ -2379,8 +2744,8 @@ var InputLabel = styled22.div`
|
|
|
2379
2744
|
// src/components/TagItem/index.tsx
|
|
2380
2745
|
import { forwardRef as forwardRef17, memo as memo8, useMemo as useMemo4 } from "react";
|
|
2381
2746
|
import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
2382
|
-
import
|
|
2383
|
-
import {
|
|
2747
|
+
import styled22, { css as css12 } from "styled-components";
|
|
2748
|
+
import { px as px2 } from "@charcoal-ui/utils";
|
|
2384
2749
|
import { useButton } from "@react-aria/button";
|
|
2385
2750
|
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2386
2751
|
var sizeMap = {
|
|
@@ -2433,7 +2798,20 @@ var TagItem = forwardRef17(
|
|
|
2433
2798
|
}
|
|
2434
2799
|
);
|
|
2435
2800
|
var TagItem_default = memo8(TagItem);
|
|
2436
|
-
var
|
|
2801
|
+
var horizontalPadding = ({ left, right }) => css12`
|
|
2802
|
+
padding-right: ${px2(right)};
|
|
2803
|
+
padding-left: ${px2(left)};
|
|
2804
|
+
`;
|
|
2805
|
+
var tagItemRootSize = (size) => {
|
|
2806
|
+
switch (size) {
|
|
2807
|
+
case "M":
|
|
2808
|
+
return horizontalPadding({ left: 24, right: 24 });
|
|
2809
|
+
case "S":
|
|
2810
|
+
return horizontalPadding({ left: 16, right: 16 });
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
var activeTagItemRoot = horizontalPadding({ left: 16, right: 8 });
|
|
2814
|
+
var TagItemRoot = styled22.a`
|
|
2437
2815
|
isolation: isolate;
|
|
2438
2816
|
position: relative;
|
|
2439
2817
|
height: ${({ size }) => sizeMap[size]}px;
|
|
@@ -2443,22 +2821,30 @@ var TagItemRoot = styled23.a`
|
|
|
2443
2821
|
text-decoration: none;
|
|
2444
2822
|
cursor: pointer;
|
|
2445
2823
|
overflow: hidden;
|
|
2824
|
+
border-radius: 4px;
|
|
2825
|
+
${({ size, status }) => status !== "active" && tagItemRootSize(size)}
|
|
2826
|
+
${({ status }) => status === "active" && activeTagItemRoot}
|
|
2827
|
+
color: ${({ status }) => status === "inactive" ? "var(--charcoal-text2)" : "var(--charcoal-text5)"};
|
|
2828
|
+
|
|
2829
|
+
transition: 0.2s box-shadow;
|
|
2830
|
+
|
|
2831
|
+
&:not(:disabled):not([aria-disabled]),
|
|
2832
|
+
&[aria-disabled='false'] {
|
|
2833
|
+
&:focus,
|
|
2834
|
+
&:active,
|
|
2835
|
+
&:focus-visible {
|
|
2836
|
+
outline: none;
|
|
2837
|
+
box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2446
2840
|
|
|
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])}
|
|
2841
|
+
&:disabled,
|
|
2842
|
+
&[aria-disabled]:not([aria-disabled='false']) {
|
|
2843
|
+
opacity: 0.32;
|
|
2458
2844
|
cursor: default;
|
|
2459
2845
|
}
|
|
2460
2846
|
`;
|
|
2461
|
-
var Background =
|
|
2847
|
+
var Background = styled22.div`
|
|
2462
2848
|
position: absolute;
|
|
2463
2849
|
z-index: 1;
|
|
2464
2850
|
top: 0;
|
|
@@ -2467,10 +2853,13 @@ var Background = styled23.div`
|
|
|
2467
2853
|
height: 100%;
|
|
2468
2854
|
|
|
2469
2855
|
background-color: ${({ bgColor }) => bgColor};
|
|
2470
|
-
${({ status }) => status === "inactive" &&
|
|
2856
|
+
${({ status }) => status === "inactive" && css12`
|
|
2857
|
+
background-color: var(--charcoal-surface3);
|
|
2858
|
+
`}
|
|
2859
|
+
|
|
2860
|
+
${({ bgImage }) => bgImage !== void 0 && css12`
|
|
2861
|
+
background-color: var(--charcoal-surface4);
|
|
2471
2862
|
|
|
2472
|
-
${({ bgImage }) => bgImage !== void 0 && css8`
|
|
2473
|
-
${theme((o) => [o.bg.surface4])}
|
|
2474
2863
|
&::before {
|
|
2475
2864
|
content: '';
|
|
2476
2865
|
position: absolute;
|
|
@@ -2485,25 +2874,43 @@ var Background = styled23.div`
|
|
|
2485
2874
|
}
|
|
2486
2875
|
`}
|
|
2487
2876
|
`;
|
|
2488
|
-
var Inner =
|
|
2877
|
+
var Inner = styled22.div`
|
|
2489
2878
|
display: inline-flex;
|
|
2490
|
-
gap:
|
|
2879
|
+
gap: 8px;
|
|
2491
2880
|
align-items: center;
|
|
2492
2881
|
z-index: 2;
|
|
2493
2882
|
`;
|
|
2494
|
-
var labelCSS =
|
|
2495
|
-
|
|
2883
|
+
var labelCSS = css12`
|
|
2884
|
+
font-size: 14px;
|
|
2885
|
+
line-height: 22px;
|
|
2886
|
+
font-weight: bold;
|
|
2887
|
+
display: flow-root;
|
|
2888
|
+
|
|
2889
|
+
&::before {
|
|
2890
|
+
display: block;
|
|
2891
|
+
width: 0;
|
|
2892
|
+
height: 0;
|
|
2893
|
+
content: '';
|
|
2894
|
+
margin-top: -4px;
|
|
2895
|
+
}
|
|
2896
|
+
&::after {
|
|
2897
|
+
display: block;
|
|
2898
|
+
width: 0;
|
|
2899
|
+
height: 0;
|
|
2900
|
+
content: '';
|
|
2901
|
+
margin-bottom: -4px;
|
|
2902
|
+
}
|
|
2496
2903
|
`;
|
|
2497
|
-
var translateLabelCSS =
|
|
2904
|
+
var translateLabelCSS = css12`
|
|
2498
2905
|
display: flex;
|
|
2499
2906
|
align-items: center;
|
|
2500
2907
|
flex-direction: column;
|
|
2501
2908
|
font-size: 10px;
|
|
2502
2909
|
`;
|
|
2503
|
-
var LabelWrapper =
|
|
2910
|
+
var LabelWrapper = styled22.div`
|
|
2504
2911
|
${({ isTranslate }) => isTranslate ?? false ? translateLabelCSS : labelCSS}
|
|
2505
2912
|
`;
|
|
2506
|
-
var Label3 =
|
|
2913
|
+
var Label3 = styled22.span`
|
|
2507
2914
|
max-width: 152px;
|
|
2508
2915
|
overflow: hidden;
|
|
2509
2916
|
text-overflow: ellipsis;
|
|
@@ -2512,8 +2919,25 @@ var Label3 = styled23.span`
|
|
|
2512
2919
|
color: inherit;
|
|
2513
2920
|
line-height: inherit;
|
|
2514
2921
|
`;
|
|
2515
|
-
var TranslatedLabel =
|
|
2516
|
-
|
|
2922
|
+
var TranslatedLabel = styled22.div`
|
|
2923
|
+
font-size: 12px;
|
|
2924
|
+
line-height: 20px;
|
|
2925
|
+
font-weight: bold;
|
|
2926
|
+
display: flow-root;
|
|
2927
|
+
&::before {
|
|
2928
|
+
display: block;
|
|
2929
|
+
width: 0;
|
|
2930
|
+
height: 0;
|
|
2931
|
+
content: '';
|
|
2932
|
+
margin-top: -4px;
|
|
2933
|
+
}
|
|
2934
|
+
&::after {
|
|
2935
|
+
display: block;
|
|
2936
|
+
width: 0;
|
|
2937
|
+
height: 0;
|
|
2938
|
+
content: '';
|
|
2939
|
+
margin-bottom: -4px;
|
|
2940
|
+
}
|
|
2517
2941
|
`;
|
|
2518
2942
|
export {
|
|
2519
2943
|
Button_default as Button,
|