@charcoal-ui/react 3.8.0 → 3.9.1

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.
Files changed (31) hide show
  1. package/dist/components/Checkbox/index.d.ts.map +1 -1
  2. package/dist/components/Modal/index.d.ts.map +1 -1
  3. package/dist/components/Modal/index.story.d.ts +1 -0
  4. package/dist/components/Modal/index.story.d.ts.map +1 -1
  5. package/dist/components/Modal/useCustomModalOverlay.d.ts +12 -0
  6. package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -0
  7. package/dist/components/Radio/index.d.ts.map +1 -1
  8. package/dist/components/TextArea/index.d.ts.map +1 -1
  9. package/dist/components/TextField/TextField.story.d.ts +1 -0
  10. package/dist/components/TextField/TextField.story.d.ts.map +1 -1
  11. package/dist/components/TextField/index.d.ts.map +1 -1
  12. package/dist/index.cjs.js +1001 -2226
  13. package/dist/index.cjs.js.map +1 -1
  14. package/dist/index.esm.js +995 -2226
  15. package/dist/index.esm.js.map +1 -1
  16. package/package.json +7 -6
  17. package/src/components/Checkbox/__snapshots__/index.story.storyshot +43 -15
  18. package/src/components/Checkbox/index.tsx +13 -5
  19. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +3 -0
  20. package/src/components/IconButton/__snapshots__/index.story.storyshot +5 -0
  21. package/src/components/IconButton/index.tsx +4 -1
  22. package/src/components/Modal/__snapshots__/index.story.storyshot +926 -0
  23. package/src/components/Modal/index.story.tsx +23 -0
  24. package/src/components/Modal/index.tsx +15 -20
  25. package/src/components/Modal/useCustomModalOverlay.tsx +47 -0
  26. package/src/components/Radio/__snapshots__/index.story.storyshot +25 -5
  27. package/src/components/Radio/index.tsx +5 -1
  28. package/src/components/TextArea/index.tsx +22 -14
  29. package/src/components/TextField/TextField.story.tsx +20 -0
  30. package/src/components/TextField/__snapshots__/TextField.story.storyshot +277 -0
  31. package/src/components/TextField/index.tsx +22 -14
package/dist/index.cjs.js CHANGED
@@ -62,23 +62,25 @@ module.exports = __toCommonJS(src_exports);
62
62
  var import_react = require("react");
63
63
  var React = __toESM(require("react"));
64
64
  var import_jsx_runtime = require("react/jsx-runtime");
65
- var DefaultLink = React.forwardRef(
66
- function DefaultLink2({ to, children, ...rest }, ref) {
67
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { href: to, ref, ...rest, children });
68
- }
69
- );
65
+ var DefaultLink = React.forwardRef(function DefaultLink2({
66
+ to,
67
+ children,
68
+ ...rest
69
+ }, ref) {
70
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { href: to, ref, ...rest, children });
71
+ });
70
72
  var DefaultValue = {
71
73
  Link: DefaultLink
72
74
  };
73
75
  var ComponentAbstractionContext = React.createContext(DefaultValue);
74
- function ComponentAbstraction({ children, components }) {
75
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
- ComponentAbstractionContext.Provider,
77
- {
78
- value: { ...DefaultValue, ...components },
79
- children
80
- }
81
- );
76
+ function ComponentAbstraction({
77
+ children,
78
+ components
79
+ }) {
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComponentAbstractionContext.Provider, { value: {
81
+ ...DefaultValue,
82
+ ...components
83
+ }, children });
82
84
  }
83
85
  function useComponentAbstraction() {
84
86
  return (0, import_react.useContext)(ComponentAbstractionContext);
@@ -113,9 +115,7 @@ var import_react2 = require("react");
113
115
 
114
116
  // src/_lib/index.ts
115
117
  function unreachable(value) {
116
- throw new Error(
117
- arguments.length === 0 ? "unreachable" : `unreachable (${JSON.stringify(value)})`
118
- );
118
+ throw new Error(arguments.length === 0 ? "unreachable" : `unreachable (${JSON.stringify(value)})`);
119
119
  }
120
120
  function mergeRefs(...refs) {
121
121
  return (value) => {
@@ -177,124 +177,39 @@ var React2 = __toESM(require("react"));
177
177
  var import_styled_components2 = __toESM(require("styled-components"));
178
178
  var import_utils = require("@charcoal-ui/utils");
179
179
  var import_jsx_runtime3 = require("react/jsx-runtime");
180
- var Clickable = React2.forwardRef(
181
- function Clickable2(props, ref) {
182
- const { Link } = useComponentAbstraction();
183
- const isLink = "to" in props;
184
- const as = isLink ? Link : "button";
185
- const ariaDisabled = isLink && props.disabled === true ? true : void 0;
186
- let rest = props;
187
- if (isLink) {
188
- const { disabled, ..._rest } = props;
189
- rest = _rest;
190
- }
191
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
192
- StyledClickableDiv,
193
- {
194
- ...rest,
195
- ref,
196
- as,
197
- "aria-disabled": ariaDisabled
198
- }
199
- );
180
+ var Clickable = React2.forwardRef(function Clickable2(props, ref) {
181
+ const {
182
+ Link
183
+ } = useComponentAbstraction();
184
+ const isLink = "to" in props;
185
+ const as = isLink ? Link : "button";
186
+ const ariaDisabled = isLink && props.disabled === true ? true : void 0;
187
+ let rest = props;
188
+ if (isLink) {
189
+ const {
190
+ disabled,
191
+ ..._rest
192
+ } = props;
193
+ rest = _rest;
200
194
  }
201
- );
195
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledClickableDiv, { ...rest, ref, as, "aria-disabled": ariaDisabled });
196
+ });
202
197
  var Clickable_default = Clickable;
203
- var StyledClickableDiv = import_styled_components2.default.div`
204
- cursor: pointer;
205
-
206
- ${import_utils.disabledSelector} {
207
- cursor: default;
208
- }
209
-
210
- /* Reset button appearance */
211
- appearance: none;
212
- background: transparent;
213
- padding: 0;
214
- border-style: none;
215
- outline: none;
216
- color: inherit;
217
- text-rendering: inherit;
218
- letter-spacing: inherit;
219
- word-spacing: inherit;
220
- text-decoration: none;
221
-
222
- &:focus {
223
- outline: none;
224
- }
225
-
226
- /* Change the font styles in all browsers. */
227
- font: inherit;
228
-
229
- /* Remove the margin in Firefox and Safari. */
230
- margin: 0;
231
-
232
- /* Show the overflow in Edge. */
233
- overflow: visible;
234
-
235
- /* Remove the inheritance of text transform in Firefox. */
236
- text-transform: none;
237
-
238
- /* Remove the inner border and padding in Firefox. */
239
- &::-moz-focus-inner {
240
- border-style: none;
241
- padding: 0;
242
- }
243
- `;
198
+ var StyledClickableDiv = import_styled_components2.default.div.withConfig({
199
+ componentId: "ccl__sc-1lxyknw-0"
200
+ })(["cursor:pointer;", "{cursor:default;}appearance:none;background:transparent;padding:0;border-style:none;outline:none;color:inherit;text-rendering:inherit;letter-spacing:inherit;word-spacing:inherit;text-decoration:none;&:focus{outline:none;}font:inherit;margin:0;overflow:visible;text-transform:none;&::-moz-focus-inner{border-style:none;padding:0;}"], import_utils.disabledSelector);
244
201
 
245
202
  // src/components/Button/StyledButton.tsx
246
203
  var import_styled2 = require("@charcoal-ui/styled");
247
- var horizontalPaddingSmall = import_styled_components3.css`
248
- padding-right: 16px;
249
- padding-left: 16px;
250
- `;
251
- var horizontalPaddingMedium = import_styled_components3.css`
252
- padding-right: 24px;
253
- padding-left: 24px;
254
- `;
255
- var StyledButton = (0, import_styled_components3.default)(Clickable_default)`
256
- width: ${(p) => p.$fullWidth ? "stretch" : "min-content"};
257
- display: inline-grid;
258
- align-items: center;
259
- justify-content: center;
260
- cursor: pointer;
261
- user-select: none;
262
- white-space: nowrap;
263
- border-radius: 999999px;
264
- font-size: 14px;
265
- line-height: 22px;
266
- font-weight: bold;
267
-
268
- ${(p) => p.$size === "M" ? horizontalPaddingMedium : horizontalPaddingSmall}
269
- color: var(--charcoal-${(p) => p.$color});
270
- background-color: var(--charcoal-${(p) => p.$background});
271
- transition: 0.2s color, 0.2s background-color, 0.2s box-shadow;
272
-
273
- &:not(:disabled):not([aria-disabled]),
274
- &[aria-disabled='false'] {
275
- ${import_styled2.focusVisibleFocusRingCss}
276
-
277
- ${({ $isActive: $active, $color, $background }) => $active ? import_styled_components3.css`
278
- color: var(--charcoal-${$color}-press);
279
- background-color: var(--charcoal-${$background}-press);
280
- ` : import_styled_components3.css`
281
- &:hover {
282
- color: var(--charcoal-${$color}-hover);
283
- background-color: var(--charcoal-${$background}-hover);
284
- }
285
- &:active {
286
- color: var(--charcoal-${$color}-press);
287
- background-color: var(--charcoal-${$background}-press);
288
- }
289
- `}
290
- }
291
-
292
- &:disabled,
293
- &[aria-disabled]:not([aria-disabled='false']) {
294
- opacity: 0.32;
295
- }
296
- height: ${(p) => p.$size === "M" ? 40 : 32}px;
297
- `;
204
+ var horizontalPaddingSmall = (0, import_styled_components3.css)(["padding-right:16px;padding-left:16px;"]);
205
+ var horizontalPaddingMedium = (0, import_styled_components3.css)(["padding-right:24px;padding-left:24px;"]);
206
+ var StyledButton = (0, import_styled_components3.default)(Clickable_default).withConfig({
207
+ componentId: "ccl__sc-19qkngs-0"
208
+ })(["width:", ";display:inline-grid;align-items:center;justify-content:center;cursor:pointer;user-select:none;white-space:nowrap;border-radius:999999px;font-size:14px;line-height:22px;font-weight:bold;", " color:var(--charcoal-", ");background-color:var(--charcoal-", ");transition:0.2s color,0.2s background-color,0.2s box-shadow;&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{", " ", "}&:disabled,&[aria-disabled]:not([aria-disabled='false']){opacity:0.32;}height:", "px;"], (p) => p.$fullWidth ? "stretch" : "min-content", (p) => p.$size === "M" ? horizontalPaddingMedium : horizontalPaddingSmall, (p) => p.$color, (p) => p.$background, import_styled2.focusVisibleFocusRingCss, ({
209
+ $isActive: $active,
210
+ $color,
211
+ $background
212
+ }) => $active ? (0, import_styled_components3.css)(["color:var(--charcoal-", "-press);background-color:var(--charcoal-", "-press);"], $color, $background) : (0, import_styled_components3.css)(["&:hover{color:var(--charcoal-", "-hover);background-color:var(--charcoal-", "-hover);}&:active{color:var(--charcoal-", "-press);background-color:var(--charcoal-", "-press);}"], $color, $background, $color, $background), (p) => p.$size === "M" ? 40 : 32);
298
213
 
299
214
  // src/components/Button/index.tsx
300
215
  var import_jsx_runtime4 = require("react/jsx-runtime");
@@ -307,20 +222,7 @@ var Button = (0, import_react2.forwardRef)(function Button2({
307
222
  isActive = false,
308
223
  ...rest
309
224
  }, ref) {
310
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
311
- StyledButton,
312
- {
313
- ...rest,
314
- disabled,
315
- $background: variantToBackground(variant),
316
- $color: variantToFont(variant),
317
- $size: size,
318
- $fullWidth: fixed,
319
- $isActive: isActive,
320
- ref,
321
- children
322
- }
323
- );
225
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledButton, { ...rest, disabled, $background: variantToBackground(variant), $color: variantToFont(variant), $size: size, $fullWidth: fixed, $isActive: isActive, ref, children });
324
226
  });
325
227
  var Button_default = Button;
326
228
 
@@ -329,63 +231,32 @@ var import_react3 = require("react");
329
231
  var import_styled_components4 = __toESM(require("styled-components"));
330
232
  var import_styled3 = require("@charcoal-ui/styled");
331
233
  var import_jsx_runtime5 = require("react/jsx-runtime");
332
- var IconButton = (0, import_react3.forwardRef)(
333
- function IconButtonInner({
334
- variant = "Default",
335
- size = "M",
336
- icon,
337
- isActive = false,
338
- ...rest
339
- }, ref) {
340
- validateIconSize(size, icon);
341
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
342
- StyledIconButton,
343
- {
344
- ...rest,
345
- ref,
346
- $size: size,
347
- $variant: variant,
348
- $isActive: isActive,
349
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pixiv-icon", { name: icon })
350
- }
351
- );
352
- }
353
- );
234
+ var IconButton = (0, import_react3.forwardRef)(function IconButtonInner({
235
+ variant = "Default",
236
+ size = "M",
237
+ icon,
238
+ isActive = false,
239
+ ...rest
240
+ }, ref) {
241
+ validateIconSize(size, icon);
242
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledIconButton, { ...rest, ref, $size: size, $variant: variant, $isActive: isActive, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("pixiv-icon", { name: icon }) });
243
+ });
354
244
  var IconButton_default = IconButton;
355
- var StyledIconButton = (0, import_styled_components4.default)(Clickable_default).attrs(styledProps)`
356
- user-select: none;
357
-
358
- width: ${(p) => p.$width}px;
359
- height: ${(p) => p.$height}px;
360
- display: flex;
361
- align-items: center;
362
- justify-content: center;
363
- color: var(${({ $font }) => `--charcoal-${$font}`});
364
- background-color: var(${({ $background }) => `--charcoal-${$background}`});
365
- border-radius: 999999px;
366
- transition: 0.2s background-color, 0.2s box-shadow;
367
-
368
- &:not(:disabled):not([aria-disabled]),
369
- &[aria-disabled='false'] {
370
- ${({ $isActive, $background }) => $isActive ? import_styled_components4.css`
371
- background-color: var(--charcoal-${$background}-press);
372
- ` : import_styled_components4.css`
373
- &:hover {
374
- background-color: var(--charcoal-${$background}-hover);
375
- }
376
- &:active {
377
- background-color: var(--charcoal-${$background}-press);
378
- }
379
- `}
380
- ${import_styled3.focusVisibleFocusRingCss}
381
- }
382
-
383
- &:disabled,
384
- &[aria-disabled]:not([aria-disabled='false']) {
385
- opacity: 0.32;
386
- }
387
- `;
388
- function styledProps({ $size, $variant }) {
245
+ var StyledIconButton = (0, import_styled_components4.default)(Clickable_default).attrs(styledProps).withConfig({
246
+ componentId: "ccl__sc-zssehl-0"
247
+ })(["user-select:none;width:", "px;height:", "px;display:flex;align-items:center;justify-content:center;color:var(", ");background-color:var(", ");border-radius:999999px;transition:0.2s background-color,0.2s box-shadow;&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{", " ", "}&:disabled,&[aria-disabled]:not([aria-disabled='false']){opacity:0.32;}"], (p) => p.$width, (p) => p.$height, ({
248
+ $font
249
+ }) => `--charcoal-${$font}`, ({
250
+ $background
251
+ }) => `--charcoal-${$background}`, ({
252
+ $isActive,
253
+ $background,
254
+ $font
255
+ }) => $isActive ? (0, import_styled_components4.css)(["color:var(--charcoal-", "-press);background-color:var(--charcoal-", "-press);"], $font, $background) : (0, import_styled_components4.css)(["&:hover{color:var(--charcoal-", "-hover);background-color:var(--charcoal-", "-hover);}&:active{color:var(--charcoal-", "-press);background-color:var(--charcoal-", "-press);}"], $font, $background, $font, $background), import_styled3.focusVisibleFocusRingCss);
256
+ function styledProps({
257
+ $size,
258
+ $variant
259
+ }) {
389
260
  return {
390
261
  ...variantToProps($variant),
391
262
  ...sizeToProps($size)
@@ -394,9 +265,15 @@ function styledProps({ $size, $variant }) {
394
265
  function variantToProps(variant) {
395
266
  switch (variant) {
396
267
  case "Default":
397
- return { $font: "text3", $background: "transparent" };
268
+ return {
269
+ $font: "text3",
270
+ $background: "transparent"
271
+ };
398
272
  case "Overlay":
399
- return { $font: "text5", $background: "surface4" };
273
+ return {
274
+ $font: "text5",
275
+ $background: "surface4"
276
+ };
400
277
  }
401
278
  }
402
279
  function sizeToProps(size) {
@@ -435,9 +312,7 @@ function validateIconSize(size, icon) {
435
312
  }
436
313
  const [iconSize] = result;
437
314
  if (iconSize !== requiredIconSize) {
438
- console.warn(
439
- `IconButton with size "${size}" expect icon size "${requiredIconSize}, but got "${iconSize}"`
440
- );
315
+ console.warn(`IconButton with size "${size}" expect icon size "${requiredIconSize}, but got "${iconSize}"`);
441
316
  }
442
317
  }
443
318
 
@@ -448,7 +323,12 @@ var import_styled_components5 = __toESM(require("styled-components"));
448
323
  var import_warning = __toESM(require("warning"));
449
324
  var import_styled4 = require("@charcoal-ui/styled");
450
325
  var import_jsx_runtime6 = require("react/jsx-runtime");
451
- var Radio = (0, import_react4.forwardRef)(function RadioInner({ value, disabled = false, children, className }, ref) {
326
+ var Radio = (0, import_react4.forwardRef)(function RadioInner({
327
+ value,
328
+ disabled = false,
329
+ children,
330
+ className
331
+ }, ref) {
452
332
  const {
453
333
  name,
454
334
  selected,
@@ -464,138 +344,29 @@ var Radio = (0, import_react4.forwardRef)(function RadioInner({ value, disabled
464
344
  const isSelected = value === selected;
465
345
  const isDisabled = disabled || isParentDisabled;
466
346
  const isReadonly = readonly && !isSelected;
467
- const handleChange = (0, import_react4.useCallback)(
468
- (e) => {
469
- onChange(e.currentTarget.value);
470
- },
471
- [onChange]
472
- );
347
+ const handleChange = (0, import_react4.useCallback)((e) => {
348
+ onChange(e.currentTarget.value);
349
+ }, [onChange]);
473
350
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(RadioRoot, { "aria-disabled": isDisabled || isReadonly, className, children: [
474
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
475
- RadioInput,
476
- {
477
- name,
478
- value,
479
- checked: isSelected,
480
- "aria-invalid": invalid,
481
- onChange: handleChange,
482
- disabled: isDisabled || isReadonly,
483
- ref
484
- }
485
- ),
351
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadioInput, { name, value, checked: isSelected, "aria-invalid": invalid, onChange: handleChange, disabled: isDisabled || isReadonly, ref }),
486
352
  children != null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadioLabel, { children })
487
353
  ] });
488
354
  });
489
355
  var Radio_default = (0, import_react4.memo)(Radio);
490
- var RadioRoot = import_styled_components5.default.label`
491
- display: grid;
492
- grid-template-columns: auto 1fr;
493
- grid-gap: 4px;
494
- align-items: center;
495
- cursor: pointer;
496
-
497
- &:disabled,
498
- &[aria-disabled]:not([aria-disabled='false']) {
499
- opacity: 0.32;
500
- }
501
- `;
502
- var RadioInput = import_styled_components5.default.input.attrs({ type: "radio" })`
503
- /** Make prior to browser default style */
504
- &[type='radio'] {
505
- appearance: none;
506
- display: block;
507
- box-sizing: border-box;
508
-
509
- margin: 0;
510
- padding: 6px;
511
-
512
- width: 20px;
513
- height: 20px;
514
- cursor: pointer;
515
- border-radius: 999999px;
516
- background-color: var(--charcoal-surface1);
517
- transition: 0.2s background-color, 0.2s box-shadow;
518
-
519
- &:not(:disabled):not([aria-disabled]),
520
- &[aria-disabled='false'] {
521
- &:hover {
522
- background-color: var(--charcoal-surface1-hover);
523
- }
524
- &:active {
525
- background-color: var(--charcoal-surface1-press);
526
- }
527
- ${import_styled4.focusVisibleFocusRingCss}
528
- &[aria-invalid='true'] {
529
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
530
- &:focus {
531
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
532
- }
533
- }
534
- }
535
-
536
- &:not(:checked) {
537
- border-width: 2px;
538
- border-style: solid;
539
- border-color: var(--charcoal-text3);
540
- }
541
-
542
- &:checked {
543
- background-color: var(--charcoal-brand);
544
- &::after {
545
- content: '';
546
- display: block;
547
- width: 8px;
548
- height: 8px;
549
- pointer-events: none;
550
- background-color: var(--charcoal-text5);
551
- border-radius: 999999px;
552
- transition: 0.2s background-color, 0.2s box-shadow;
553
- }
554
-
555
- &:not(:disabled):not([aria-disabled]),
556
- &[aria-disabled='false'] {
557
- &:hover {
558
- background-color: var(--charcoal-brand-hover);
559
- &::after {
560
- background-color: var(--charcoal-text5-hover);
561
- }
562
- }
563
- &:active {
564
- background-color: var(--charcoal-brand-press);
565
- &::after {
566
- background-color: var(--charcoal-text5-press);
567
- }
568
- }
569
- }
570
- }
571
- }
572
- `;
573
- var RadioLabel = import_styled_components5.default.div`
574
- font-size: 14px;
575
- line-height: 22px;
576
- display: flow-root;
577
- color: var(--charcoal-text2);
578
-
579
- &::before {
580
- display: block;
581
- width: 0;
582
- height: 0;
583
- content: '';
584
- margin-top: -4px;
585
- }
586
- &::after {
587
- display: block;
588
- width: 0;
589
- height: 0;
590
- content: '';
591
- margin-bottom: -4px;
592
- }
593
- `;
594
- var StyledRadioGroup = import_styled_components5.default.div`
595
- display: grid;
596
- grid-template-columns: 1fr;
597
- grid-gap: 8px;
598
- `;
356
+ var RadioRoot = import_styled_components5.default.label.withConfig({
357
+ componentId: "ccl__sc-1hitkzn-0"
358
+ })(["display:grid;grid-template-columns:auto 1fr;grid-gap:4px;align-items:center;cursor:pointer;&[aria-disabled]:not([aria-disabled='false']){opacity:0.32;cursor:default;}"]);
359
+ var RadioInput = import_styled_components5.default.input.attrs({
360
+ type: "radio"
361
+ }).withConfig({
362
+ componentId: "ccl__sc-1hitkzn-1"
363
+ })(["&[type='radio']{appearance:none;display:block;box-sizing:border-box;margin:0;padding:6px;width:20px;height:20px;cursor:pointer;border-radius:999999px;background-color:var(--charcoal-surface1);transition:0.2s background-color,0.2s box-shadow;:disabled{cursor:default;}&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{&:hover{background-color:var(--charcoal-surface1-hover);}&:active{background-color:var(--charcoal-surface1-press);}", " &[aria-invalid='true']{box-shadow:0 0 0 4px rgba(255,43,0,0.32);&:focus{box-shadow:0 0 0 4px rgba(255,43,0,0.32);}}}&:not(:checked){border-width:2px;border-style:solid;border-color:var(--charcoal-text3);}&:checked{background-color:var(--charcoal-brand);&::after{content:'';display:block;width:8px;height:8px;pointer-events:none;background-color:var(--charcoal-text5);border-radius:999999px;transition:0.2s background-color,0.2s box-shadow;}&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{&:hover{background-color:var(--charcoal-brand-hover);&::after{background-color:var(--charcoal-text5-hover);}}&:active{background-color:var(--charcoal-brand-press);&::after{background-color:var(--charcoal-text5-press);}}}}}"], import_styled4.focusVisibleFocusRingCss);
364
+ var RadioLabel = import_styled_components5.default.div.withConfig({
365
+ componentId: "ccl__sc-1hitkzn-2"
366
+ })(["font-size:14px;line-height:22px;display:flow-root;color:var(--charcoal-text2);&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
367
+ var StyledRadioGroup = import_styled_components5.default.div.withConfig({
368
+ componentId: "ccl__sc-1hitkzn-3"
369
+ })(["display:grid;grid-template-columns:1fr;grid-gap:8px;"]);
599
370
  var RadioGroupContext = React3.createContext({
600
371
  name: void 0,
601
372
  selected: void 0,
@@ -603,9 +374,7 @@ var RadioGroupContext = React3.createContext({
603
374
  readonly: false,
604
375
  invalid: false,
605
376
  onChange() {
606
- throw new Error(
607
- "Cannot find onChange() handler. Perhaps you forgot to wrap with <RadioGroup> ?"
608
- );
377
+ throw new Error("Cannot find onChange() handler. Perhaps you forgot to wrap with <RadioGroup> ?");
609
378
  }
610
379
  });
611
380
  function RadioGroup({
@@ -619,36 +388,17 @@ function RadioGroup({
619
388
  invalid,
620
389
  children
621
390
  }) {
622
- const handleChange = (0, import_react4.useCallback)(
623
- (next) => {
624
- onChange(next);
625
- },
626
- [onChange]
627
- );
628
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
629
- RadioGroupContext.Provider,
630
- {
631
- value: {
632
- name,
633
- selected: value,
634
- disabled: disabled ?? false,
635
- readonly: readonly ?? false,
636
- invalid: invalid ?? false,
637
- onChange: handleChange
638
- },
639
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
640
- StyledRadioGroup,
641
- {
642
- role: "radiogroup",
643
- "aria-orientation": "vertical",
644
- "aria-label": label,
645
- "aria-invalid": invalid,
646
- className,
647
- children
648
- }
649
- )
650
- }
651
- );
391
+ const handleChange = (0, import_react4.useCallback)((next) => {
392
+ onChange(next);
393
+ }, [onChange]);
394
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadioGroupContext.Provider, { value: {
395
+ name,
396
+ selected: value,
397
+ disabled: disabled ?? false,
398
+ readonly: readonly ?? false,
399
+ invalid: invalid ?? false,
400
+ onChange: handleChange
401
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(StyledRadioGroup, { role: "radiogroup", "aria-orientation": "vertical", "aria-label": label, "aria-invalid": invalid, className, children }) });
652
402
  }
653
403
 
654
404
  // src/components/MultiSelect/index.tsx
@@ -666,197 +416,86 @@ var MultiSelectGroupContext = (0, import_react5.createContext)({
666
416
  readonly: false,
667
417
  invalid: false,
668
418
  onChange() {
669
- throw new Error(
670
- "Cannot find `onChange()` handler. Perhaps you forgot to wrap it with `<MultiSelectGroup />` ?"
671
- );
419
+ throw new Error("Cannot find `onChange()` handler. Perhaps you forgot to wrap it with `<MultiSelectGroup />` ?");
672
420
  }
673
421
  });
674
422
 
675
423
  // src/components/MultiSelect/index.tsx
676
424
  var import_styled5 = require("@charcoal-ui/styled");
677
425
  var import_jsx_runtime7 = require("react/jsx-runtime");
678
- var MultiSelect = (0, import_react6.forwardRef)(
679
- function MultiSelectInner({
680
- value,
681
- disabled = false,
682
- onChange,
683
- variant = "default",
684
- className,
685
- children
686
- }, ref) {
687
- const {
426
+ var MultiSelect = (0, import_react6.forwardRef)(function MultiSelectInner({
427
+ value,
428
+ disabled = false,
429
+ onChange,
430
+ variant = "default",
431
+ className,
432
+ children
433
+ }, ref) {
434
+ const {
435
+ name,
436
+ selected,
437
+ disabled: parentDisabled,
438
+ readonly,
439
+ invalid,
440
+ onChange: parentOnChange
441
+ } = (0, import_react6.useContext)(MultiSelectGroupContext);
442
+ (0, import_warning2.default)(
443
+ name !== void 0,
444
+ `"name" is not Provided for <MultiSelect>. Perhaps you forgot to wrap with <MultiSelectGroup> ?`
445
+ );
446
+ const isSelected = selected.includes(value);
447
+ const isDisabled = disabled || parentDisabled || readonly;
448
+ const handleChange = (0, import_react6.useCallback)((event) => {
449
+ if (!(event.currentTarget instanceof HTMLInputElement)) {
450
+ return;
451
+ }
452
+ if (onChange)
453
+ onChange({
454
+ value,
455
+ selected: event.currentTarget.checked
456
+ });
457
+ parentOnChange({
458
+ value,
459
+ selected: event.currentTarget.checked
460
+ });
461
+ }, [onChange, parentOnChange, value]);
462
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(MultiSelectRoot, { "aria-disabled": isDisabled, className, children: [
463
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MultiSelectInput, { ...{
688
464
  name,
689
- selected,
690
- disabled: parentDisabled,
691
- readonly,
692
- invalid,
693
- onChange: parentOnChange
694
- } = (0, import_react6.useContext)(MultiSelectGroupContext);
695
- (0, import_warning2.default)(
696
- name !== void 0,
697
- `"name" is not Provided for <MultiSelect>. Perhaps you forgot to wrap with <MultiSelectGroup> ?`
698
- );
699
- const isSelected = selected.includes(value);
700
- const isDisabled = disabled || parentDisabled || readonly;
701
- const handleChange = (0, import_react6.useCallback)(
702
- (event) => {
703
- if (!(event.currentTarget instanceof HTMLInputElement)) {
704
- return;
705
- }
706
- if (onChange)
707
- onChange({ value, selected: event.currentTarget.checked });
708
- parentOnChange({ value, selected: event.currentTarget.checked });
709
- },
710
- [onChange, parentOnChange, value]
711
- );
712
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(MultiSelectRoot, { "aria-disabled": isDisabled, className, children: [
713
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
714
- MultiSelectInput,
715
- {
716
- ...{
717
- name,
718
- value,
719
- invalid
720
- },
721
- checked: isSelected,
722
- disabled: isDisabled,
723
- onChange: handleChange,
724
- overlay: variant === "overlay",
725
- "aria-invalid": invalid,
726
- ref
727
- }
728
- ),
729
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
730
- MultiSelectInputOverlay,
731
- {
732
- overlay: variant === "overlay",
733
- invalid,
734
- "aria-hidden": true,
735
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pixiv-icon", { name: "24/Check", "unsafe-non-guideline-scale": 16 / 24 })
736
- }
737
- ),
738
- Boolean(children) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MultiSelectLabel, { children })
739
- ] });
740
- }
741
- );
465
+ value,
466
+ invalid
467
+ }, checked: isSelected, disabled: isDisabled, onChange: handleChange, overlay: variant === "overlay", "aria-invalid": invalid, ref }),
468
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MultiSelectInputOverlay, { overlay: variant === "overlay", invalid, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pixiv-icon", { name: "24/Check", "unsafe-non-guideline-scale": 16 / 24 }) }),
469
+ Boolean(children) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MultiSelectLabel, { children })
470
+ ] });
471
+ });
742
472
  var MultiSelect_default = (0, import_react6.memo)(MultiSelect);
743
- var MultiSelectRoot = import_styled_components6.default.label`
744
- display: grid;
745
- grid-template-columns: auto 1fr;
746
- align-items: center;
747
- position: relative;
748
- cursor: pointer;
749
- gap: ${({ theme }) => (0, import_utils2.px)(theme.spacing[4])};
750
- &:disabled,
751
- &[aria-disabled]:not([aria-disabled='false']) {
752
- opacity: 0.32;
753
- cursor: default;
754
- }
755
- `;
756
- var MultiSelectLabel = import_styled_components6.default.div`
757
- display: flex;
758
- align-items: center;
759
- font-size: 14px;
760
- line-height: 22px;
761
- display: flow-root;
762
- color: var(--charcoal-text2);
763
-
764
- &::before {
765
- display: block;
766
- width: 0;
767
- height: 0;
768
- content: '';
769
- margin-top: -4px;
770
- }
771
- &::after {
772
- display: block;
773
- width: 0;
774
- height: 0;
775
- content: '';
776
- margin-bottom: -4px;
777
- }
778
- `;
779
- var MultiSelectInput = import_styled_components6.default.input.attrs({ type: "checkbox" })`
780
- &[type='checkbox'] {
781
- appearance: none;
782
- display: block;
783
- width: 20px;
784
- height: 20px;
785
- margin: 0;
786
- background-color: var(--charcoal-text3);
787
- border-radius: 999999px;
788
- transition: 0.2s background-color, 0.2s box-shadow;
789
-
790
- &:checked {
791
- background-color: var(--charcoal-brand);
792
- &:hover {
793
- &:not(:disabled):not([aria-disabled]),
794
- &[aria-disabled='false'] {
795
- background-color: var(--charcoal-brand-hover);
796
- }
797
- }
798
-
799
- &:active {
800
- &:not(:disabled):not([aria-disabled]),
801
- &[aria-disabled='false'] {
802
- background-color: var(--charcoal-brand-press);
803
- }
804
- }
805
- }
806
-
807
- &:hover {
808
- &:not(:disabled):not([aria-disabled]),
809
- &[aria-disabled='false'] {
810
- background-color: var(--charcoal-text3-hover);
811
- }
812
- }
813
-
814
- &:active {
815
- &:not(:disabled):not([aria-disabled]),
816
- &[aria-disabled='false'] {
817
- background-color: var(--charcoal-text3-press);
818
- }
819
- }
820
-
821
- ${import_styled5.focusVisibleFocusRingCss}
822
-
823
- ${({ invalid, overlay }) => invalid && !overlay && import_styled_components6.css`
824
- &:not(:disabled):not([aria-disabled]),
825
- &[aria-disabled='false'] {
826
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
827
- }
828
- `}
829
- ${({ overlay }) => overlay && import_styled_components6.css`
830
- background-color: var(--charcoal-surface4);
831
- `}
832
- }
833
- `;
834
- var MultiSelectInputOverlay = import_styled_components6.default.div`
835
- position: absolute;
836
- top: -2px;
837
- left: -2px;
838
- box-sizing: border-box;
839
- display: flex;
840
- align-items: center;
841
- justify-content: center;
842
- width: 24px;
843
- height: 24px;
844
- border-radius: 999999px;
845
- color: var(--charcoal-text5);
846
- transition: 0.2s box-shadow;
847
- ${({ invalid, overlay }) => invalid && overlay && import_styled_components6.css`
848
- &:not(:disabled):not([aria-disabled]),
849
- &[aria-disabled='false'] {
850
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
851
- }
852
- `}
853
-
854
- ${({ overlay }) => overlay && import_styled_components6.css`
855
- border-color: var(--charcoal-text5);
856
- border-width: 2px;
857
- border-style: solid;
858
- `}
859
- `;
473
+ var MultiSelectRoot = import_styled_components6.default.label.withConfig({
474
+ componentId: "ccl__sc-wpr5y9-0"
475
+ })(["display:grid;grid-template-columns:auto 1fr;align-items:center;position:relative;cursor:pointer;gap:", ";&:disabled,&[aria-disabled]:not([aria-disabled='false']){opacity:0.32;cursor:default;}"], ({
476
+ theme
477
+ }) => (0, import_utils2.px)(theme.spacing[4]));
478
+ var MultiSelectLabel = import_styled_components6.default.div.withConfig({
479
+ componentId: "ccl__sc-wpr5y9-1"
480
+ })(["display:flex;align-items:center;font-size:14px;line-height:22px;display:flow-root;color:var(--charcoal-text2);&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
481
+ var MultiSelectInput = import_styled_components6.default.input.attrs({
482
+ type: "checkbox"
483
+ }).withConfig({
484
+ componentId: "ccl__sc-wpr5y9-2"
485
+ })(["&[type='checkbox']{appearance:none;display:block;width:20px;height:20px;margin:0;background-color:var(--charcoal-text3);border-radius:999999px;transition:0.2s background-color,0.2s box-shadow;&:checked{background-color:var(--charcoal-brand);&:hover{&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{background-color:var(--charcoal-brand-hover);}}&:active{&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{background-color:var(--charcoal-brand-press);}}}&:hover{&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{background-color:var(--charcoal-text3-hover);}}&:active{&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{background-color:var(--charcoal-text3-press);}}", " ", " ", "}"], import_styled5.focusVisibleFocusRingCss, ({
486
+ invalid,
487
+ overlay
488
+ }) => invalid && !overlay && (0, import_styled_components6.css)(["&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{box-shadow:0 0 0 4px rgba(255,43,0,0.32);}"]), ({
489
+ overlay
490
+ }) => overlay && (0, import_styled_components6.css)(["background-color:var(--charcoal-surface4);"]));
491
+ var MultiSelectInputOverlay = import_styled_components6.default.div.withConfig({
492
+ componentId: "ccl__sc-wpr5y9-3"
493
+ })(["position:absolute;top:-2px;left:-2px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:999999px;color:var(--charcoal-text5);transition:0.2s box-shadow;", " ", ""], ({
494
+ invalid,
495
+ overlay
496
+ }) => invalid && overlay && (0, import_styled_components6.css)(["&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{box-shadow:0 0 0 4px rgba(255,43,0,0.32);}"]), ({
497
+ overlay
498
+ }) => overlay && (0, import_styled_components6.css)(["border-color:var(--charcoal-text5);border-width:2px;border-style:solid;"]));
860
499
  function MultiSelectGroup({
861
500
  className,
862
501
  name,
@@ -868,35 +507,26 @@ function MultiSelectGroup({
868
507
  invalid = false,
869
508
  children
870
509
  }) {
871
- const handleChange = (0, import_react6.useCallback)(
872
- (payload) => {
873
- const index = selected.indexOf(payload.value);
874
- if (payload.selected) {
875
- if (index < 0) {
876
- onChange([...selected, payload.value]);
877
- }
878
- } else {
879
- if (index >= 0) {
880
- onChange([...selected.slice(0, index), ...selected.slice(index + 1)]);
881
- }
510
+ const handleChange = (0, import_react6.useCallback)((payload) => {
511
+ const index = selected.indexOf(payload.value);
512
+ if (payload.selected) {
513
+ if (index < 0) {
514
+ onChange([...selected, payload.value]);
515
+ }
516
+ } else {
517
+ if (index >= 0) {
518
+ onChange([...selected.slice(0, index), ...selected.slice(index + 1)]);
882
519
  }
883
- },
884
- [onChange, selected]
885
- );
886
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
887
- MultiSelectGroupContext.Provider,
888
- {
889
- value: {
890
- name,
891
- selected: Array.from(new Set(selected)),
892
- disabled,
893
- readonly,
894
- invalid,
895
- onChange: handleChange
896
- },
897
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className, "aria-label": label, "data-testid": "SelectGroup", children })
898
520
  }
899
- );
521
+ }, [onChange, selected]);
522
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MultiSelectGroupContext.Provider, { value: {
523
+ name,
524
+ selected: Array.from(new Set(selected)),
525
+ disabled,
526
+ readonly,
527
+ invalid,
528
+ onChange: handleChange
529
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className, "aria-label": label, "data-testid": "SelectGroup", children }) });
900
530
  }
901
531
 
902
532
  // src/components/Switch/index.tsx
@@ -907,108 +537,43 @@ var import_styled_components7 = __toESM(require("styled-components"));
907
537
  var import_utils3 = require("@react-aria/utils");
908
538
  var import_styled6 = require("@charcoal-ui/styled");
909
539
  var import_jsx_runtime8 = require("react/jsx-runtime");
910
- var SwitchCheckbox = (0, import_react7.forwardRef)(
911
- function SwitchCheckboxInner(props, external) {
912
- const { disabled, className } = props;
913
- const ariaSwitchProps = (0, import_react7.useMemo)(
914
- () => ({
915
- ...props,
916
- "aria-label": "children" in props ? void 0 : props.label,
917
- isDisabled: props.disabled,
918
- isSelected: props.checked
919
- }),
920
- [props]
921
- );
922
- const state = (0, import_react_stately.useToggleState)(ariaSwitchProps);
923
- const ref = (0, import_utils3.useObjectRef)(external);
924
- const {
925
- inputProps: { className: _className, type: _type, ...rest }
926
- } = (0, import_switch.useSwitch)(ariaSwitchProps, state, ref);
927
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Label, { className, "aria-disabled": disabled, children: [
928
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SwitchInput, { ...rest, ref }),
929
- "children" in props ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LabelInner, { children: props.children }) : void 0
930
- ] });
931
- }
932
- );
933
- var Switch_default = (0, import_react7.memo)(SwitchCheckbox);
934
- var Label = import_styled_components7.default.label`
935
- display: inline-grid;
936
- grid-template-columns: auto 1fr;
937
- align-items: center;
938
- cursor: pointer;
939
- outline: 0;
940
-
941
- &:disabled,
942
- &[aria-disabled]:not([aria-disabled='false']) {
943
- opacity: 0.32;
944
- cursor: default;
945
- }
946
- `;
947
- var LabelInner = import_styled_components7.default.div`
948
- font-size: 14px;
949
- line-height: 22px;
950
- color: var(--charcoal-text2);
951
- margin-left: 4px;
952
- `;
953
- var SwitchInput = import_styled_components7.default.input.attrs({ type: "checkbox" })`
954
- appearance: none;
955
- display: inline-flex;
956
- position: relative;
957
- box-sizing: border-box;
958
- width: 28px;
959
- border: 2px solid transparent;
960
-
961
- transition-property: background-color, box-shadow;
962
- transition-duration: 0.2s;
963
- cursor: inherit;
964
-
965
- outline: none;
966
- border-radius: 16px;
967
- height: 16px;
968
- margin: 0;
969
- background-color: var(--charcoal-text4);
970
- :hover {
971
- background-color: var(--charcoal-text4-hover);
972
- }
973
- :active {
974
- background-color: var(--charcoal-text4-press);
975
- }
976
- ${import_styled6.focusVisibleFocusRingCss}
977
-
978
- &::after {
979
- content: '';
980
- position: absolute;
981
- display: block;
982
- top: 0;
983
- left: 0;
984
- width: 12px;
985
- height: 12px;
986
- transform: translateX(0);
987
- transition: transform 0.2s;
988
- border-radius: 1024px;
989
- background-color: var(--charcoal-text5);
990
- :hover {
991
- background-color: var(--charcoal-text5-hover);
992
- }
993
- :active {
994
- background-color: var(--charcoal-text5-press);
995
- }
996
- }
997
-
998
- &:checked {
999
- background-color: var(--charcoal-brand);
1000
- :hover {
1001
- background-color: var(--charcoal-brand-hover);
1002
- }
1003
- :active {
1004
- background-color: var(--charcoal-brand-press);
1005
- }
1006
- &::after {
1007
- transform: translateX(12px);
1008
- transition: transform 0.2s;
540
+ var SwitchCheckbox = (0, import_react7.forwardRef)(function SwitchCheckboxInner(props, external) {
541
+ const {
542
+ disabled,
543
+ className
544
+ } = props;
545
+ const ariaSwitchProps = (0, import_react7.useMemo)(() => ({
546
+ ...props,
547
+ "aria-label": "children" in props ? void 0 : props.label,
548
+ isDisabled: props.disabled,
549
+ isSelected: props.checked
550
+ }), [props]);
551
+ const state = (0, import_react_stately.useToggleState)(ariaSwitchProps);
552
+ const ref = (0, import_utils3.useObjectRef)(external);
553
+ const {
554
+ inputProps: {
555
+ className: _className,
556
+ type: _type,
557
+ ...rest
1009
558
  }
1010
- }
1011
- `;
559
+ } = (0, import_switch.useSwitch)(ariaSwitchProps, state, ref);
560
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Label, { className, "aria-disabled": disabled, children: [
561
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SwitchInput, { ...rest, ref }),
562
+ "children" in props ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LabelInner, { children: props.children }) : void 0
563
+ ] });
564
+ });
565
+ var Switch_default = (0, import_react7.memo)(SwitchCheckbox);
566
+ var Label = import_styled_components7.default.label.withConfig({
567
+ componentId: "ccl__sc-1wy6z5h-0"
568
+ })(["display:inline-grid;grid-template-columns:auto 1fr;align-items:center;cursor:pointer;outline:0;&:disabled,&[aria-disabled]:not([aria-disabled='false']){opacity:0.32;cursor:default;}"]);
569
+ var LabelInner = import_styled_components7.default.div.withConfig({
570
+ componentId: "ccl__sc-1wy6z5h-1"
571
+ })(["font-size:14px;line-height:22px;color:var(--charcoal-text2);margin-left:4px;"]);
572
+ var SwitchInput = import_styled_components7.default.input.attrs({
573
+ type: "checkbox"
574
+ }).withConfig({
575
+ componentId: "ccl__sc-1wy6z5h-2"
576
+ })(["appearance:none;display:inline-flex;position:relative;box-sizing:border-box;width:28px;border:2px solid transparent;transition-property:background-color,box-shadow;transition-duration:0.2s;cursor:inherit;outline:none;border-radius:16px;height:16px;margin:0;background-color:var(--charcoal-text4);:hover{background-color:var(--charcoal-text4-hover);}:active{background-color:var(--charcoal-text4-press);}", " &::after{content:'';position:absolute;display:block;top:0;left:0;width:12px;height:12px;transform:translateX(0);transition:transform 0.2s;border-radius:1024px;background-color:var(--charcoal-text5);:hover{background-color:var(--charcoal-text5-hover);}:active{background-color:var(--charcoal-text5-press);}}&:checked{background-color:var(--charcoal-brand);:hover{background-color:var(--charcoal-brand-hover);}:active{background-color:var(--charcoal-brand-press);}&::after{transform:translateX(12px);transition:transform 0.2s;}}"], import_styled6.focusVisibleFocusRingCss);
1012
577
 
1013
578
  // src/components/TextField/index.tsx
1014
579
  var import_textfield = require("@react-aria/textfield");
@@ -1021,117 +586,34 @@ var import_styled_components9 = __toESM(require("styled-components"));
1021
586
  var React4 = __toESM(require("react"));
1022
587
  var import_styled_components8 = __toESM(require("styled-components"));
1023
588
  var import_jsx_runtime9 = require("react/jsx-runtime");
1024
- var FieldLabel = React4.forwardRef(
1025
- function FieldLabel2({
1026
- style,
1027
- className,
1028
- label,
1029
- required = false,
1030
- requiredText,
1031
- subLabel,
1032
- ...labelProps
1033
- }, ref) {
1034
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FieldLabelWrapper, { style, className, children: [
1035
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label2, { ref, ...labelProps, children: label }),
1036
- required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RequiredText, { children: requiredText }),
1037
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SubLabelClickable, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: subLabel }) })
1038
- ] });
1039
- }
1040
- );
589
+ var FieldLabel = React4.forwardRef(function FieldLabel2({
590
+ style,
591
+ className,
592
+ label,
593
+ required = false,
594
+ requiredText,
595
+ subLabel,
596
+ ...labelProps
597
+ }, ref) {
598
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FieldLabelWrapper, { style, className, children: [
599
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label2, { ref, ...labelProps, children: label }),
600
+ required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RequiredText, { children: requiredText }),
601
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SubLabelClickable, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: subLabel }) })
602
+ ] });
603
+ });
1041
604
  var FieldLabel_default = FieldLabel;
1042
- var Label2 = import_styled_components8.default.label`
1043
- font-size: 14px;
1044
- line-height: 22px;
1045
- font-weight: bold;
1046
- display: flow-root;
1047
- color: var(--charcoal-text1);
1048
-
1049
- &::before {
1050
- display: block;
1051
- width: 0;
1052
- height: 0;
1053
- content: '';
1054
- margin-top: -4px;
1055
- }
1056
- &::after {
1057
- display: block;
1058
- width: 0;
1059
- height: 0;
1060
- content: '';
1061
- margin-bottom: -4px;
1062
- }
1063
- `;
1064
- var RequiredText = import_styled_components8.default.span`
1065
- font-size: 14px;
1066
- line-height: 22px;
1067
- display: flow-root;
1068
- color: var(--charcoal-text2);
1069
-
1070
- &::before {
1071
- display: block;
1072
- width: 0;
1073
- height: 0;
1074
- content: '';
1075
- margin-top: -4px;
1076
- }
1077
- &::after {
1078
- display: block;
1079
- width: 0;
1080
- height: 0;
1081
- content: '';
1082
- margin-bottom: -4px;
1083
- }
1084
- `;
1085
- var SubLabelClickable = import_styled_components8.default.div`
1086
- font-size: 14px;
1087
- line-height: 22px;
1088
- display: flow-root;
1089
- color: var(--charcoal-text3);
1090
- transition: 0.2s color, 0.2s box-shadow;
1091
-
1092
- &::before {
1093
- display: block;
1094
- width: 0;
1095
- height: 0;
1096
- content: '';
1097
- margin-top: -4px;
1098
- }
1099
- &::after {
1100
- display: block;
1101
- width: 0;
1102
- height: 0;
1103
- content: '';
1104
- margin-bottom: -4px;
1105
- }
1106
-
1107
- &:not(:disabled):not([aria-disabled]),
1108
- &[aria-disabled='false'] {
1109
- &:hover {
1110
- color: var(--charcoal-text3-hover);
1111
- }
1112
- &:active {
1113
- color: var(--charcoal-text3-press);
1114
- }
1115
- &:active,
1116
- &:focus,
1117
- &:focus-visible {
1118
- outline: none;
1119
- box-shadow: 0 0 0 4px rgba(0, 150, 250, 0.32);
1120
- }
1121
- }
1122
- `;
1123
- var FieldLabelWrapper = import_styled_components8.default.div`
1124
- display: inline-flex;
1125
- align-items: center;
1126
-
1127
- > ${RequiredText} {
1128
- margin-left: 4px;
1129
- }
1130
-
1131
- > ${SubLabelClickable} {
1132
- margin-left: auto;
1133
- }
1134
- `;
605
+ var Label2 = import_styled_components8.default.label.withConfig({
606
+ componentId: "ccl__sc-1iotshb-0"
607
+ })(["font-size:14px;line-height:22px;font-weight:bold;display:flow-root;color:var(--charcoal-text1);&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
608
+ var RequiredText = import_styled_components8.default.span.withConfig({
609
+ componentId: "ccl__sc-1iotshb-1"
610
+ })(["font-size:14px;line-height:22px;display:flow-root;color:var(--charcoal-text2);&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
611
+ var SubLabelClickable = import_styled_components8.default.div.withConfig({
612
+ componentId: "ccl__sc-1iotshb-2"
613
+ })(["font-size:14px;line-height:22px;display:flow-root;color:var(--charcoal-text3);transition:0.2s color,0.2s box-shadow;&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{&:hover{color:var(--charcoal-text3-hover);}&:active{color:var(--charcoal-text3-press);}&:active,&:focus,&:focus-visible{outline:none;box-shadow:0 0 0 4px rgba(0,150,250,0.32);}}"]);
614
+ var FieldLabelWrapper = import_styled_components8.default.div.withConfig({
615
+ componentId: "ccl__sc-1iotshb-3"
616
+ })(["display:inline-flex;align-items:center;> ", "{margin-left:4px;}> ", "{margin-left:auto;}"], RequiredText, SubLabelClickable);
1135
617
 
1136
618
  // src/components/TextField/useFocusWithClick.tsx
1137
619
  var import_react8 = require("react");
@@ -1153,419 +635,239 @@ function useFocusWithClick(containerRef, inputRef) {
1153
635
  }
1154
636
 
1155
637
  // src/components/TextField/index.tsx
638
+ var import_utils4 = require("@react-aria/utils");
1156
639
  var import_jsx_runtime10 = require("react/jsx-runtime");
1157
- var TextField = React5.forwardRef(
1158
- function SingleLineTextFieldInner({ onChange, ...props }, forwardRef18) {
1159
- const {
1160
- className,
1161
- showLabel = false,
1162
- showCount = false,
1163
- label,
1164
- requiredText,
1165
- subLabel,
1166
- disabled = false,
1167
- required,
1168
- invalid = false,
1169
- assistiveText,
1170
- maxLength,
1171
- prefix = null,
1172
- suffix = null
1173
- } = props;
1174
- const { visuallyHiddenProps } = (0, import_visually_hidden.useVisuallyHidden)();
1175
- const ariaRef = (0, import_react9.useRef)(null);
1176
- const [count, setCount] = (0, import_react9.useState)(
1177
- countCodePointsInString(props.value ?? "")
1178
- );
1179
- const nonControlled = props.value === void 0;
1180
- const handleChange = (0, import_react9.useCallback)(
1181
- (value) => {
1182
- const count2 = countCodePointsInString(value);
1183
- if (maxLength !== void 0 && count2 > maxLength) {
1184
- return;
1185
- }
1186
- if (nonControlled) {
1187
- setCount(count2);
1188
- }
1189
- onChange?.(value);
1190
- },
1191
- [maxLength, nonControlled, onChange]
1192
- );
1193
- (0, import_react9.useEffect)(() => {
1194
- setCount(countCodePointsInString(props.value ?? ""));
1195
- }, [props.value]);
1196
- const { inputProps, labelProps, descriptionProps, errorMessageProps } = (0, import_textfield.useTextField)(
1197
- {
1198
- inputElementType: "input",
1199
- isDisabled: disabled,
1200
- isRequired: required,
1201
- validationState: invalid ? "invalid" : "valid",
1202
- description: !invalid && assistiveText,
1203
- errorMessage: invalid && assistiveText,
1204
- onChange: handleChange,
1205
- ...props
1206
- },
1207
- ariaRef
1208
- );
1209
- const containerRef = (0, import_react9.useRef)(null);
1210
- useFocusWithClick(containerRef, ariaRef);
1211
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(TextFieldRoot, { className, isDisabled: disabled, children: [
1212
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1213
- TextFieldLabel,
1214
- {
1215
- label,
1216
- requiredText,
1217
- required,
1218
- subLabel,
1219
- ...labelProps,
1220
- ...!showLabel ? visuallyHiddenProps : {}
1221
- }
1222
- ),
1223
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1224
- StyledInputContainer,
1225
- {
1226
- ref: containerRef,
1227
- invalid,
1228
- "aria-disabled": disabled === true ? true : void 0,
1229
- hasPrefix: prefix != null,
1230
- hasSuffix: suffix != null || showCount,
1231
- children: [
1232
- prefix && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PrefixContainer, { children: prefix }),
1233
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1234
- StyledInput,
1235
- {
1236
- ref: mergeRefs(forwardRef18, ariaRef),
1237
- invalid,
1238
- ...inputProps
1239
- }
1240
- ),
1241
- (suffix || showCount) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(SuffixContainer, { children: [
1242
- suffix,
1243
- showCount && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SingleLineCounter, { children: maxLength !== void 0 ? `${count}/${maxLength}` : count })
1244
- ] })
1245
- ]
1246
- }
1247
- ),
1248
- assistiveText != null && assistiveText.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1249
- AssistiveText,
1250
- {
1251
- invalid,
1252
- ...invalid ? errorMessageProps : descriptionProps,
1253
- children: assistiveText
1254
- }
1255
- )
1256
- ] });
1257
- }
1258
- );
640
+ var TextField = React5.forwardRef(function SingleLineTextFieldInner({
641
+ onChange,
642
+ ...props
643
+ }, forwardRef18) {
644
+ const {
645
+ className,
646
+ showLabel = false,
647
+ showCount = false,
648
+ label,
649
+ requiredText,
650
+ subLabel,
651
+ disabled = false,
652
+ required,
653
+ invalid = false,
654
+ assistiveText,
655
+ maxLength,
656
+ prefix = null,
657
+ suffix = null,
658
+ ...restProps
659
+ } = props;
660
+ const {
661
+ visuallyHiddenProps
662
+ } = (0, import_visually_hidden.useVisuallyHidden)();
663
+ const ariaRef = (0, import_react9.useRef)(null);
664
+ const [count, setCount] = (0, import_react9.useState)(countCodePointsInString(props.value ?? ""));
665
+ const nonControlled = props.value === void 0;
666
+ const handleChange = (0, import_react9.useCallback)((value) => {
667
+ const count2 = countCodePointsInString(value);
668
+ if (maxLength !== void 0 && count2 > maxLength) {
669
+ return;
670
+ }
671
+ if (nonControlled) {
672
+ setCount(count2);
673
+ }
674
+ onChange?.(value);
675
+ }, [maxLength, nonControlled, onChange]);
676
+ (0, import_react9.useEffect)(() => {
677
+ setCount(countCodePointsInString(props.value ?? ""));
678
+ }, [props.value]);
679
+ const {
680
+ inputProps: ariaInputProps,
681
+ labelProps,
682
+ descriptionProps,
683
+ errorMessageProps
684
+ } = (0, import_textfield.useTextField)({
685
+ inputElementType: "input",
686
+ isDisabled: disabled,
687
+ isRequired: required,
688
+ validationState: invalid ? "invalid" : "valid",
689
+ description: !invalid && assistiveText,
690
+ errorMessage: invalid && assistiveText,
691
+ onChange: handleChange,
692
+ ...props
693
+ }, ariaRef);
694
+ const containerRef = (0, import_react9.useRef)(null);
695
+ useFocusWithClick(containerRef, ariaRef);
696
+ const inputProps = (0, import_utils4.mergeProps)(restProps, ariaInputProps);
697
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(TextFieldRoot, { className, isDisabled: disabled, children: [
698
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TextFieldLabel, { label, requiredText, required, subLabel, ...labelProps, ...!showLabel ? visuallyHiddenProps : {} }),
699
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(StyledInputContainer, { ref: containerRef, invalid, "aria-disabled": disabled === true ? true : void 0, hasPrefix: prefix != null, hasSuffix: suffix != null || showCount, children: [
700
+ prefix && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PrefixContainer, { children: prefix }),
701
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StyledInput, { ref: mergeRefs(forwardRef18, ariaRef), invalid, ...inputProps }),
702
+ (suffix || showCount) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(SuffixContainer, { children: [
703
+ suffix,
704
+ showCount && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SingleLineCounter, { children: maxLength !== void 0 ? `${count}/${maxLength}` : count })
705
+ ] })
706
+ ] }),
707
+ assistiveText != null && assistiveText.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AssistiveText, { invalid, ...invalid ? errorMessageProps : descriptionProps, children: assistiveText })
708
+ ] });
709
+ });
1259
710
  var TextField_default = TextField;
1260
- var TextFieldRoot = import_styled_components9.default.div`
1261
- display: flex;
1262
- flex-direction: column;
1263
-
1264
- ${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
1265
- `;
1266
- var TextFieldLabel = (0, import_styled_components9.default)(FieldLabel_default)`
1267
- margin-bottom: 8px;
1268
- `;
1269
- var StyledInputContainer = import_styled_components9.default.div`
1270
- display: grid;
1271
- grid-template-columns: ${(p) => [p.hasPrefix && "auto", "1fr", p.hasSuffix && "auto"].filter(Boolean).join(" ")};
1272
- height: 40px;
1273
- transition: 0.2s background-color, 0.2s box-shadow;
1274
- color: var(--charcoal-text2);
1275
- background-color: var(--charcoal-surface3);
1276
- border-radius: 4px;
1277
- gap: 4px;
1278
- padding: 0 8px;
1279
- line-height: 22px;
1280
- font-size: 14px;
1281
-
1282
- :not(:disabled):not([aria-disabled]):hover,
1283
- [aria-disabled='false']:hover {
1284
- background-color: var(--charcoal-surface3-hover);
1285
- }
1286
-
1287
- :focus-within {
1288
- outline: none;
1289
- box-shadow: 0 0 0 4px
1290
- ${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
1291
- }
1292
-
1293
- ${(p) => p.invalid && import_styled_components9.css`
1294
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
1295
- `}
1296
- `;
1297
- var PrefixContainer = import_styled_components9.default.div`
1298
- display: flex;
1299
- align-items: center;
1300
- `;
1301
- var SuffixContainer = import_styled_components9.default.span`
1302
- display: flex;
1303
- align-items: center;
1304
- gap: 8px;
1305
- `;
1306
- var StyledInput = import_styled_components9.default.input`
1307
- border: none;
1308
- box-sizing: border-box;
1309
- outline: none;
1310
- font-family: inherit;
1311
-
1312
- /* Prevent zooming for iOS Safari */
1313
- transform-origin: top left;
1314
- transform: scale(0.875);
1315
- width: calc(100% / 0.875);
1316
- height: calc(100% / 0.875);
1317
- font-size: calc(14px / 0.875);
1318
- line-height: calc(22px / 0.875);
1319
- padding-left: 0;
1320
- padding-right: 0;
1321
- border-radius: calc(4px / 0.875);
1322
-
1323
- /* Display box-shadow for iOS Safari */
1324
- appearance: none;
1325
- background: transparent;
1326
-
1327
- color: var(--charcoal-text2);
1328
- &::placeholder {
1329
- color: var(--charcoal-text3);
1330
- }
1331
- `;
1332
- var SingleLineCounter = import_styled_components9.default.span`
1333
- line-height: 22px;
1334
- font-size: 14px;
1335
- color: var(--charcoal-text3);
1336
- `;
1337
- var AssistiveText = import_styled_components9.default.p`
1338
- font-size: 14px;
1339
- line-height: 22px;
1340
- margin-top: 4px;
1341
- margin-bottom: -4px;
1342
- color: ${(p) => `var(--charcoal-${p.invalid ? `assertive` : `text2`})`};
1343
- `;
711
+ var TextFieldRoot = import_styled_components9.default.div.withConfig({
712
+ componentId: "ccl__sc-3dd0tt-0"
713
+ })(["display:flex;flex-direction:column;", ""], (p) => p.isDisabled && {
714
+ opacity: p.theme.elementEffect.disabled.opacity
715
+ });
716
+ var TextFieldLabel = (0, import_styled_components9.default)(FieldLabel_default).withConfig({
717
+ componentId: "ccl__sc-3dd0tt-1"
718
+ })(["margin-bottom:8px;"]);
719
+ var StyledInputContainer = import_styled_components9.default.div.withConfig({
720
+ componentId: "ccl__sc-3dd0tt-2"
721
+ })(["display:grid;grid-template-columns:", ";height:40px;transition:0.2s background-color,0.2s box-shadow;color:var(--charcoal-text2);background-color:var(--charcoal-surface3);border-radius:4px;gap:4px;padding:0 8px;line-height:22px;font-size:14px;:not(:disabled):not([aria-disabled]):hover,[aria-disabled='false']:hover{background-color:var(--charcoal-surface3-hover);}:focus-within{outline:none;box-shadow:0 0 0 4px ", ";}", ""], (p) => [p.hasPrefix && "auto", "1fr", p.hasSuffix && "auto"].filter(Boolean).join(" "), (p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`, (p) => p.invalid && (0, import_styled_components9.css)(["box-shadow:0 0 0 4px rgba(255,43,0,0.32);"]));
722
+ var PrefixContainer = import_styled_components9.default.div.withConfig({
723
+ componentId: "ccl__sc-3dd0tt-3"
724
+ })(["display:flex;align-items:center;"]);
725
+ var SuffixContainer = import_styled_components9.default.span.withConfig({
726
+ componentId: "ccl__sc-3dd0tt-4"
727
+ })(["display:flex;align-items:center;gap:8px;"]);
728
+ var StyledInput = import_styled_components9.default.input.withConfig({
729
+ componentId: "ccl__sc-3dd0tt-5"
730
+ })(["border:none;box-sizing:border-box;outline:none;font-family:inherit;transform-origin:top left;transform:scale(0.875);width:calc(100% / 0.875);height:calc(100% / 0.875);font-size:calc(14px / 0.875);line-height:calc(22px / 0.875);padding-left:0;padding-right:0;border-radius:calc(4px / 0.875);appearance:none;background:transparent;color:var(--charcoal-text2);&::placeholder{color:var(--charcoal-text3);}"]);
731
+ var SingleLineCounter = import_styled_components9.default.span.withConfig({
732
+ componentId: "ccl__sc-3dd0tt-6"
733
+ })(["line-height:22px;font-size:14px;color:var(--charcoal-text3);"]);
734
+ var AssistiveText = import_styled_components9.default.p.withConfig({
735
+ componentId: "ccl__sc-3dd0tt-7"
736
+ })(["font-size:14px;line-height:22px;margin-top:4px;margin-bottom:-4px;color:", ";"], (p) => `var(--charcoal-${p.invalid ? `assertive` : `text2`})`);
1344
737
 
1345
738
  // src/components/TextArea/index.tsx
1346
739
  var import_textfield2 = require("@react-aria/textfield");
1347
740
  var import_visually_hidden2 = require("@react-aria/visually-hidden");
1348
741
  var import_react10 = require("react");
1349
742
  var import_styled_components10 = __toESM(require("styled-components"));
743
+ var import_utils5 = require("@react-aria/utils");
1350
744
  var import_jsx_runtime11 = require("react/jsx-runtime");
1351
- var TextArea = (0, import_react10.forwardRef)(
1352
- function TextAreaInner({ onChange, ...props }, forwardRef18) {
1353
- const {
1354
- className,
1355
- showCount = false,
1356
- showLabel = false,
1357
- label,
1358
- requiredText,
1359
- subLabel,
1360
- disabled = false,
1361
- required,
1362
- invalid = false,
1363
- assistiveText,
1364
- maxLength,
1365
- autoHeight = false,
1366
- rows: initialRows = 4
1367
- } = props;
1368
- const { visuallyHiddenProps } = (0, import_visually_hidden2.useVisuallyHidden)();
1369
- const textareaRef = (0, import_react10.useRef)(null);
1370
- const ariaRef = (0, import_react10.useRef)(null);
1371
- const [count, setCount] = (0, import_react10.useState)(
1372
- countCodePointsInString(props.value ?? "")
1373
- );
1374
- const [rows, setRows] = (0, import_react10.useState)(initialRows);
1375
- const syncHeight = (0, import_react10.useCallback)(
1376
- (textarea) => {
1377
- const rows2 = (`${textarea.value}
745
+ var TextArea = (0, import_react10.forwardRef)(function TextAreaInner({
746
+ onChange,
747
+ ...props
748
+ }, forwardRef18) {
749
+ const {
750
+ className,
751
+ showCount = false,
752
+ showLabel = false,
753
+ label,
754
+ requiredText,
755
+ subLabel,
756
+ disabled = false,
757
+ required,
758
+ invalid = false,
759
+ assistiveText,
760
+ maxLength,
761
+ autoHeight = false,
762
+ rows: initialRows = 4,
763
+ ...restProps
764
+ } = props;
765
+ const {
766
+ visuallyHiddenProps
767
+ } = (0, import_visually_hidden2.useVisuallyHidden)();
768
+ const textareaRef = (0, import_react10.useRef)(null);
769
+ const ariaRef = (0, import_react10.useRef)(null);
770
+ const [count, setCount] = (0, import_react10.useState)(countCodePointsInString(props.value ?? ""));
771
+ const [rows, setRows] = (0, import_react10.useState)(initialRows);
772
+ const syncHeight = (0, import_react10.useCallback)((textarea) => {
773
+ const rows2 = (`${textarea.value}
1378
774
  `.match(/\n/gu)?.length ?? 0) || 1;
1379
- setRows(initialRows <= rows2 ? rows2 : initialRows);
1380
- },
1381
- [initialRows]
1382
- );
1383
- const nonControlled = props.value === void 0;
1384
- const handleChange = (0, import_react10.useCallback)(
1385
- (value) => {
1386
- const count2 = countCodePointsInString(value);
1387
- if (maxLength !== void 0 && count2 > maxLength) {
1388
- return;
1389
- }
1390
- if (nonControlled) {
1391
- setCount(count2);
1392
- }
1393
- if (autoHeight && textareaRef.current !== null) {
1394
- syncHeight(textareaRef.current);
1395
- }
1396
- onChange?.(value);
1397
- },
1398
- [autoHeight, maxLength, nonControlled, onChange, syncHeight]
1399
- );
1400
- (0, import_react10.useEffect)(() => {
1401
- setCount(countCodePointsInString(props.value ?? ""));
1402
- }, [props.value]);
1403
- const { inputProps, labelProps, descriptionProps, errorMessageProps } = (0, import_textfield2.useTextField)(
1404
- {
1405
- inputElementType: "textarea",
1406
- isDisabled: disabled,
1407
- isRequired: required,
1408
- validationState: invalid ? "invalid" : "valid",
1409
- description: !invalid && assistiveText,
1410
- errorMessage: invalid && assistiveText,
1411
- onChange: handleChange,
1412
- ...props
1413
- },
1414
- ariaRef
1415
- );
1416
- (0, import_react10.useEffect)(() => {
1417
- if (autoHeight && textareaRef.current !== null) {
1418
- syncHeight(textareaRef.current);
1419
- }
1420
- }, [autoHeight, syncHeight]);
1421
- const containerRef = (0, import_react10.useRef)(null);
1422
- useFocusWithClick(containerRef, ariaRef);
1423
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(TextFieldRoot2, { className, isDisabled: disabled, children: [
1424
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1425
- TextFieldLabel,
1426
- {
1427
- label,
1428
- requiredText,
1429
- required,
1430
- subLabel,
1431
- ...labelProps,
1432
- ...!showLabel ? visuallyHiddenProps : {}
1433
- }
1434
- ),
1435
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1436
- StyledTextareaContainer,
1437
- {
1438
- ref: containerRef,
1439
- invalid,
1440
- rows: showCount ? rows + 1 : rows,
1441
- "aria-disabled": disabled === true ? "true" : void 0,
1442
- children: [
1443
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1444
- StyledTextarea,
1445
- {
1446
- ref: mergeRefs(textareaRef, forwardRef18, ariaRef),
1447
- rows,
1448
- noBottomPadding: showCount,
1449
- ...inputProps
1450
- }
1451
- ),
1452
- showCount && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MultiLineCounter, { children: maxLength !== void 0 ? `${count}/${maxLength}` : count })
1453
- ]
1454
- }
1455
- ),
1456
- assistiveText != null && assistiveText.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1457
- AssistiveText,
1458
- {
1459
- invalid,
1460
- ...invalid ? errorMessageProps : descriptionProps,
1461
- children: assistiveText
1462
- }
1463
- )
1464
- ] });
1465
- }
1466
- );
775
+ setRows(initialRows <= rows2 ? rows2 : initialRows);
776
+ }, [initialRows]);
777
+ const nonControlled = props.value === void 0;
778
+ const handleChange = (0, import_react10.useCallback)((value) => {
779
+ const count2 = countCodePointsInString(value);
780
+ if (maxLength !== void 0 && count2 > maxLength) {
781
+ return;
782
+ }
783
+ if (nonControlled) {
784
+ setCount(count2);
785
+ }
786
+ if (autoHeight && textareaRef.current !== null) {
787
+ syncHeight(textareaRef.current);
788
+ }
789
+ onChange?.(value);
790
+ }, [autoHeight, maxLength, nonControlled, onChange, syncHeight]);
791
+ (0, import_react10.useEffect)(() => {
792
+ setCount(countCodePointsInString(props.value ?? ""));
793
+ }, [props.value]);
794
+ const {
795
+ inputProps: ariaInputProps,
796
+ labelProps,
797
+ descriptionProps,
798
+ errorMessageProps
799
+ } = (0, import_textfield2.useTextField)({
800
+ inputElementType: "textarea",
801
+ isDisabled: disabled,
802
+ isRequired: required,
803
+ validationState: invalid ? "invalid" : "valid",
804
+ description: !invalid && assistiveText,
805
+ errorMessage: invalid && assistiveText,
806
+ onChange: handleChange,
807
+ ...props
808
+ }, ariaRef);
809
+ (0, import_react10.useEffect)(() => {
810
+ if (autoHeight && textareaRef.current !== null) {
811
+ syncHeight(textareaRef.current);
812
+ }
813
+ }, [autoHeight, syncHeight]);
814
+ const containerRef = (0, import_react10.useRef)(null);
815
+ useFocusWithClick(containerRef, ariaRef);
816
+ const inputProps = (0, import_utils5.mergeProps)(restProps, ariaInputProps);
817
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(TextFieldRoot2, { className, isDisabled: disabled, children: [
818
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TextFieldLabel, { label, requiredText, required, subLabel, ...labelProps, ...!showLabel ? visuallyHiddenProps : {} }),
819
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(StyledTextareaContainer, { ref: containerRef, invalid, rows: showCount ? rows + 1 : rows, "aria-disabled": disabled === true ? "true" : void 0, children: [
820
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(StyledTextarea, { ref: mergeRefs(textareaRef, forwardRef18, ariaRef), rows, noBottomPadding: showCount, ...inputProps }),
821
+ showCount && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MultiLineCounter, { children: maxLength !== void 0 ? `${count}/${maxLength}` : count })
822
+ ] }),
823
+ assistiveText != null && assistiveText.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AssistiveText, { invalid, ...invalid ? errorMessageProps : descriptionProps, children: assistiveText })
824
+ ] });
825
+ });
1467
826
  var TextArea_default = TextArea;
1468
- var TextFieldRoot2 = import_styled_components10.default.div`
1469
- display: flex;
1470
- flex-direction: column;
1471
-
1472
- ${(p) => p.isDisabled && { opacity: p.theme.elementEffect.disabled.opacity }}
1473
- `;
1474
- var StyledTextareaContainer = import_styled_components10.default.div`
1475
- position: relative;
1476
- overflow: hidden;
1477
-
1478
- color: var(--charcoal-text2);
1479
- background-color: var(--charcoal-surface3);
1480
- border-radius: 4px;
1481
- transition: 0.2s background-color, 0.2s box-shadow;
1482
-
1483
- ${({ rows }) => import_styled_components10.css`
1484
- height: calc(22px * ${rows} + 18px);
1485
- `};
1486
-
1487
- :not([aria-disabled]):hover,
1488
- [aria-disabled='false']:hover {
1489
- background-color: var(--charcoal-surface3-hover);
1490
- }
1491
- :focus-within {
1492
- outline: none;
1493
- box-shadow: 0 0 0 4px
1494
- ${(p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`};
1495
- }
1496
-
1497
- ${(p) => p.invalid && import_styled_components10.css`
1498
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
1499
- `}
1500
- `;
1501
- var StyledTextarea = import_styled_components10.default.textarea`
1502
- border: none;
1503
- outline: none;
1504
- resize: none;
1505
- font-family: inherit;
1506
- color: inherit;
1507
- box-sizing: border-box;
1508
-
1509
- /* Prevent zooming for iOS Safari */
1510
- transform-origin: top left;
1511
- transform: scale(0.875);
1512
- width: calc(100% / 0.875);
1513
- font-size: calc(14px / 0.875);
1514
- line-height: calc(22px / 0.875);
1515
- padding: calc(9px / 0.875) calc(8px / 0.875)
1516
- ${(p) => p.noBottomPadding ? 0 : ""};
1517
-
1518
- ${({ rows = 1, noBottomPadding }) => import_styled_components10.css`
1519
- height: calc(22px / 0.875 * ${rows} + ${noBottomPadding ? 9 : 20}px);
1520
- `};
1521
-
1522
- /* Display box-shadow for iOS Safari */
1523
- appearance: none;
1524
-
1525
- background: none;
1526
-
1527
- &::placeholder {
1528
- color: var(--charcoal-text3);
1529
- }
1530
- `;
1531
- var MultiLineCounter = import_styled_components10.default.span`
1532
- position: absolute;
1533
- bottom: 9px;
1534
- right: 8px;
1535
-
1536
- line-height: 22px;
1537
- font-size: 14px;
1538
- color: var(--charcoal-text3);
1539
- `;
827
+ var TextFieldRoot2 = import_styled_components10.default.div.withConfig({
828
+ componentId: "ccl__sc-58waht-0"
829
+ })(["display:flex;flex-direction:column;", ""], (p) => p.isDisabled && {
830
+ opacity: p.theme.elementEffect.disabled.opacity
831
+ });
832
+ var StyledTextareaContainer = import_styled_components10.default.div.withConfig({
833
+ componentId: "ccl__sc-58waht-1"
834
+ })(["position:relative;overflow:hidden;color:var(--charcoal-text2);background-color:var(--charcoal-surface3);border-radius:4px;transition:0.2s background-color,0.2s box-shadow;", ";:not([aria-disabled]):hover,[aria-disabled='false']:hover{background-color:var(--charcoal-surface3-hover);}:focus-within{outline:none;box-shadow:0 0 0 4px ", ";}", ""], ({
835
+ rows
836
+ }) => (0, import_styled_components10.css)(["height:calc(22px * ", " + 18px);"], rows), (p) => p.invalid ? `rgba(255,43,0,0.32)` : `rgba(0, 150, 250, 0.32);`, (p) => p.invalid && (0, import_styled_components10.css)(["box-shadow:0 0 0 4px rgba(255,43,0,0.32);"]));
837
+ var StyledTextarea = import_styled_components10.default.textarea.withConfig({
838
+ componentId: "ccl__sc-58waht-2"
839
+ })(["border:none;outline:none;resize:none;font-family:inherit;color:inherit;box-sizing:border-box;transform-origin:top left;transform:scale(0.875);width:calc(100% / 0.875);font-size:calc(14px / 0.875);line-height:calc(22px / 0.875);padding:calc(9px / 0.875) calc(8px / 0.875) ", ";", ";appearance:none;background:none;&::placeholder{color:var(--charcoal-text3);}"], (p) => p.noBottomPadding ? 0 : "", ({
840
+ rows = 1,
841
+ noBottomPadding
842
+ }) => (0, import_styled_components10.css)(["height:calc(22px / 0.875 * ", " + ", "px);"], rows, noBottomPadding ? 9 : 20));
843
+ var MultiLineCounter = import_styled_components10.default.span.withConfig({
844
+ componentId: "ccl__sc-58waht-3"
845
+ })(["position:absolute;bottom:9px;right:8px;line-height:22px;font-size:14px;color:var(--charcoal-text3);"]);
1540
846
 
1541
847
  // src/components/Icon/index.tsx
1542
848
  var React6 = __toESM(require("react"));
1543
849
  var import_icons = require("@charcoal-ui/icons");
1544
850
  var import_jsx_runtime12 = require("react/jsx-runtime");
1545
- var Icon = React6.forwardRef(function IconInner({ name, scale, unsafeNonGuidelineScale, className, ...rest }, ref) {
1546
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1547
- "pixiv-icon",
1548
- {
1549
- ref,
1550
- name,
1551
- scale,
1552
- "unsafe-non-guideline-scale": unsafeNonGuidelineScale,
1553
- class: className,
1554
- ...rest
1555
- }
1556
- );
851
+ var Icon = React6.forwardRef(function IconInner({
852
+ name,
853
+ scale,
854
+ unsafeNonGuidelineScale,
855
+ className,
856
+ ...rest
857
+ }, ref) {
858
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("pixiv-icon", { ref, name, scale, "unsafe-non-guideline-scale": unsafeNonGuidelineScale, class: className, ...rest });
1557
859
  });
1558
860
  var Icon_default = Icon;
1559
861
 
1560
862
  // src/components/Modal/index.tsx
1561
863
  var import_react12 = require("react");
1562
- var React9 = __toESM(require("react"));
1563
- var import_overlays2 = require("@react-aria/overlays");
864
+ var React10 = __toESM(require("react"));
865
+ var import_overlays3 = require("@react-aria/overlays");
1564
866
  var import_styled_components12 = __toESM(require("styled-components"));
1565
- var import_utils5 = require("@charcoal-ui/utils");
867
+ var import_utils7 = require("@charcoal-ui/utils");
1566
868
  var import_styled7 = require("@charcoal-ui/styled");
1567
869
  var import_react_spring2 = require("react-spring");
1568
- var import_utils6 = require("@react-aria/utils");
870
+ var import_utils8 = require("@react-aria/utils");
1569
871
 
1570
872
  // src/components/Modal/Dialog/index.tsx
1571
873
  var import_react11 = require("react");
@@ -1580,7 +882,7 @@ function columnSystem(span, column, gutter) {
1580
882
  }
1581
883
 
1582
884
  // src/components/Modal/Dialog/index.tsx
1583
- var import_utils4 = require("@charcoal-ui/utils");
885
+ var import_utils6 = require("@charcoal-ui/utils");
1584
886
  var import_react_spring = require("react-spring");
1585
887
 
1586
888
  // src/_lib/useForwardedRef.tsx
@@ -1603,29 +905,16 @@ function useForwardedRef(ref) {
1603
905
  var import_jsx_runtime13 = require("react/jsx-runtime");
1604
906
  var Dialog = (0, import_react11.forwardRef)(function Dialog2(props, forwardRef18) {
1605
907
  const ref = useForwardedRef(forwardRef18);
1606
- const { dialogProps } = (0, import_dialog.useDialog)(
1607
- {
1608
- role: "dialog"
1609
- },
1610
- ref
1611
- );
1612
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1613
- AnimatedStyledDialogDiv,
1614
- {
1615
- ...props,
1616
- role: dialogProps.role,
1617
- tabIndex: dialogProps.tabIndex,
1618
- "aria-labelledby": dialogProps["aria-labelledby"],
1619
- onBlur: dialogProps.onBlur,
1620
- ref
1621
- }
1622
- );
908
+ const {
909
+ dialogProps
910
+ } = (0, import_dialog.useDialog)({
911
+ role: "dialog"
912
+ }, ref);
913
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AnimatedStyledDialogDiv, { ...props, role: dialogProps.role, tabIndex: dialogProps.tabIndex, "aria-labelledby": dialogProps["aria-labelledby"], onBlur: dialogProps.onBlur, ref });
1623
914
  });
1624
- var AnimatedStyledDialogDiv = (0, import_react_spring.animated)(import_styled_components11.default.div`
1625
- margin: auto;
1626
- position: relative;
1627
- height: fit-content;
1628
- width: ${(p) => {
915
+ var AnimatedStyledDialogDiv = (0, import_react_spring.animated)(import_styled_components11.default.div.withConfig({
916
+ componentId: "ccl__sc-1ep4f6v-0"
917
+ })(["margin:auto;position:relative;height:fit-content;width:", "px;background-color:var(--charcoal-surface1);border-radius:24px;@media ", "{max-width:440px;width:calc(100% - 48px);", "}:focus{outline:none;}"], (p) => {
1629
918
  switch (p.size) {
1630
919
  case "S": {
1631
920
  return columnSystem(3, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
@@ -1640,39 +929,51 @@ var AnimatedStyledDialogDiv = (0, import_react_spring.animated)(import_styled_co
1640
929
  return unreachable(p.size);
1641
930
  }
1642
931
  }
1643
- }}px;
1644
-
1645
- background-color: var(--charcoal-surface1);
1646
- border-radius: 24px;
1647
-
1648
- @media ${({ theme }) => (0, import_utils4.maxWidth)(theme.breakpoint.screen1)} {
1649
- max-width: 440px;
1650
- width: calc(100% - 48px);
1651
- ${(p) => p.bottomSheet !== false && import_styled_components11.css`
1652
- max-width: unset;
1653
- width: 100%;
1654
- border-radius: 0;
1655
- margin: auto 0 0 0;
1656
- ${p.bottomSheet === "full" && import_styled_components11.css`
1657
- min-height: 100%;
1658
- `}
1659
- `}
1660
- }
1661
- :focus {
1662
- outline: none;
1663
- }
1664
- `);
932
+ }, ({
933
+ theme
934
+ }) => (0, import_utils6.maxWidth)(theme.breakpoint.screen1), (p) => p.bottomSheet !== false && (0, import_styled_components11.css)(["max-width:unset;width:100%;border-radius:0;margin:auto 0 0 0;", ""], p.bottomSheet === "full" && (0, import_styled_components11.css)(["min-height:100%;"]))));
1665
935
 
1666
936
  // src/components/Modal/ModalBackgroundContext.tsx
1667
937
  var React8 = __toESM(require("react"));
1668
- var ModalBackgroundContext = React8.createContext(
1669
- null
1670
- );
938
+ var ModalBackgroundContext = React8.createContext(null);
939
+
940
+ // src/components/Modal/useCustomModalOverlay.tsx
941
+ var React9 = __toESM(require("react"));
942
+ var import_overlays2 = require("@react-aria/overlays");
943
+ function useCharcoalModalOverlay(props, state, ref) {
944
+ const {
945
+ overlayProps,
946
+ underlayProps
947
+ } = (0, import_overlays2.useOverlay)({
948
+ ...props,
949
+ isOpen: state.isOpen,
950
+ onClose: state.onClose,
951
+ shouldCloseOnInteractOutside: () => false
952
+ }, ref);
953
+ (0, import_overlays2.usePreventScroll)({
954
+ isDisabled: !state.isOpen
955
+ });
956
+ (0, import_overlays2.useOverlayFocusContain)();
957
+ React9.useEffect(() => {
958
+ if (state.isOpen && ref.current) {
959
+ return (0, import_overlays2.ariaHideOutside)([ref.current]);
960
+ }
961
+ }, [state.isOpen, ref]);
962
+ return {
963
+ modalProps: overlayProps,
964
+ underlayProps
965
+ };
966
+ }
1671
967
 
1672
968
  // src/components/Modal/index.tsx
1673
969
  var import_jsx_runtime14 = require("react/jsx-runtime");
1674
970
  var DEFAULT_Z_INDEX = 10;
1675
- var Modal = (0, import_react12.forwardRef)(function ModalInner({ children, zIndex = DEFAULT_Z_INDEX, portalContainer, ...props }, external) {
971
+ var Modal = (0, import_react12.forwardRef)(function ModalInner({
972
+ children,
973
+ zIndex = DEFAULT_Z_INDEX,
974
+ portalContainer,
975
+ ...props
976
+ }, external) {
1676
977
  const {
1677
978
  title,
1678
979
  size = "M",
@@ -1682,26 +983,19 @@ var Modal = (0, import_react12.forwardRef)(function ModalInner({ children, zInde
1682
983
  className,
1683
984
  isOpen = false
1684
985
  } = props;
1685
- const ref = (0, import_utils6.useObjectRef)(external);
1686
- const { modalProps, underlayProps } = (0, import_overlays2.useModalOverlay)(
1687
- {
1688
- ...props,
1689
- isKeyboardDismissDisabled: isDismissable === void 0 || isDismissable === false
1690
- },
1691
- {
1692
- close: onClose,
1693
- isOpen,
1694
- open: () => {
1695
- },
1696
- setOpen: () => {
1697
- },
1698
- toggle: () => {
1699
- }
1700
- },
1701
- ref
1702
- );
986
+ const ref = (0, import_utils8.useObjectRef)(external);
987
+ const {
988
+ modalProps,
989
+ underlayProps
990
+ } = useCharcoalModalOverlay({
991
+ ...props,
992
+ isKeyboardDismissDisabled: isDismissable === void 0 || isDismissable === false
993
+ }, {
994
+ onClose,
995
+ isOpen
996
+ }, ref);
1703
997
  const theme = (0, import_styled_components12.useTheme)();
1704
- const isMobile = (0, import_styled7.useMedia)((0, import_utils5.maxWidth)(theme.breakpoint.screen1)) ?? false;
998
+ const isMobile = (0, import_styled7.useMedia)((0, import_utils7.maxWidth)(theme.breakpoint.screen1)) ?? false;
1705
999
  const transitionEnabled = isMobile && bottomSheet !== false;
1706
1000
  const showDismiss = !isMobile || bottomSheet !== true;
1707
1001
  const transition = (0, import_react_spring2.useTransition)(isOpen, {
@@ -1722,261 +1016,154 @@ var Modal = (0, import_react12.forwardRef)(function ModalInner({ children, zInde
1722
1016
  backgroundColor: "rgba(0, 0, 0, 0)",
1723
1017
  overflow: "hidden"
1724
1018
  },
1725
- config: transitionEnabled ? { duration: 400, easing: import_react_spring2.easings.easeOutQuart } : { duration: 0 }
1019
+ config: transitionEnabled ? {
1020
+ duration: 400,
1021
+ easing: import_react_spring2.easings.easeOutQuart
1022
+ } : {
1023
+ duration: 0
1024
+ }
1726
1025
  });
1727
- const bgRef = React9.useRef(null);
1728
- return transition(
1729
- ({ backgroundColor, overflow, transform }, item) => item && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_overlays2.Overlay, { portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1730
- ModalBackground,
1731
- {
1732
- ref: bgRef,
1733
- zIndex,
1734
- ...underlayProps,
1735
- style: transitionEnabled ? { backgroundColor, overflow } : {},
1736
- $bottomSheet: bottomSheet,
1737
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalBackgroundContext.Provider, { value: bgRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1738
- Dialog,
1739
- {
1740
- ref,
1741
- ...modalProps,
1742
- style: transitionEnabled ? { transform } : {},
1743
- size,
1744
- bottomSheet,
1745
- className,
1746
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1747
- ModalContext.Provider,
1748
- {
1749
- value: {
1750
- titleProps: {},
1751
- title,
1752
- close: onClose,
1753
- showDismiss,
1754
- bottomSheet
1755
- },
1756
- children: [
1757
- children,
1758
- isDismissable === true && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1759
- ModalCrossButton,
1760
- {
1761
- size: "S",
1762
- icon: "24/Close",
1763
- onClick: onClose
1764
- }
1765
- )
1766
- ]
1767
- }
1768
- )
1769
- }
1770
- ) })
1771
- }
1772
- ) })
1773
- );
1026
+ const bgRef = React10.useRef(null);
1027
+ const handleClick = React10.useCallback((e) => {
1028
+ if (e.currentTarget === e.target) {
1029
+ onClose();
1030
+ }
1031
+ }, [onClose]);
1032
+ return transition(({
1033
+ backgroundColor,
1034
+ overflow,
1035
+ transform
1036
+ }, item) => item && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_overlays3.Overlay, { portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalBackground, { ref: bgRef, zIndex, ...underlayProps, style: transitionEnabled ? {
1037
+ backgroundColor,
1038
+ overflow
1039
+ } : {}, $bottomSheet: bottomSheet, onClick: handleClick, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalBackgroundContext.Provider, { value: bgRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Dialog, { ref, ...modalProps, style: transitionEnabled ? {
1040
+ transform
1041
+ } : {}, size, bottomSheet, className, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(ModalContext.Provider, { value: {
1042
+ titleProps: {},
1043
+ title,
1044
+ close: onClose,
1045
+ showDismiss,
1046
+ bottomSheet
1047
+ }, children: [
1048
+ children,
1049
+ isDismissable === true && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalCrossButton, { size: "S", icon: "24/Close", onClick: onClose })
1050
+ ] }) }) }) }) }));
1774
1051
  });
1775
1052
  var Modal_default = (0, import_react12.memo)(Modal);
1776
- var ModalContext = React9.createContext({
1053
+ var ModalContext = React10.createContext({
1777
1054
  titleProps: {},
1778
1055
  title: "",
1779
1056
  close: void 0,
1780
1057
  showDismiss: true,
1781
1058
  bottomSheet: false
1782
1059
  });
1783
- var ModalBackground = (0, import_react_spring2.animated)(import_styled_components12.default.div`
1784
- z-index: ${({ zIndex }) => zIndex};
1785
- overflow: auto;
1786
- display: flex;
1787
- position: fixed;
1788
- top: 0;
1789
- left: 0;
1790
- width: -webkit-fill-available;
1791
- width: -moz-available;
1792
- height: 100%;
1793
- justify-content: center;
1794
- padding: 40px 0;
1795
- box-sizing: border-box;
1796
-
1797
- background-color: var(--charcoal-surface4);
1798
-
1799
- @media ${({ theme }) => (0, import_utils5.maxWidth)(theme.breakpoint.screen1)} {
1800
- ${(p) => p.$bottomSheet !== false && import_styled_components12.css`
1801
- padding: 0;
1802
- `}
1803
- }
1804
- `);
1805
- var ModalCrossButton = (0, import_styled_components12.default)(IconButton_default)`
1806
- position: absolute;
1807
- top: 8px;
1808
- right: 8px;
1809
-
1810
- color: var(--charcoal-text3);
1811
- transition: 0.2s color;
1812
-
1813
- &:not(:disabled):not([aria-disabled]),
1814
- &[aria-disabled='false'] {
1815
- &:hover {
1816
- color: var(--charcoal-text3-hover);
1817
- }
1818
- &:active {
1819
- color: var(--charcoal-text3-press);
1820
- }
1821
- }
1822
- `;
1060
+ var ModalBackground = (0, import_react_spring2.animated)(import_styled_components12.default.div.withConfig({
1061
+ componentId: "ccl__sc-h2bc55-0"
1062
+ })(["z-index:", ";overflow:auto;display:flex;position:fixed;top:0;left:0;width:-webkit-fill-available;width:-moz-available;height:100%;justify-content:center;padding:40px 0;box-sizing:border-box;background-color:var(--charcoal-surface4);@media ", "{", "}"], ({
1063
+ zIndex
1064
+ }) => zIndex, ({
1065
+ theme
1066
+ }) => (0, import_utils7.maxWidth)(theme.breakpoint.screen1), (p) => p.$bottomSheet !== false && (0, import_styled_components12.css)(["padding:0;"])));
1067
+ var ModalCrossButton = (0, import_styled_components12.default)(IconButton_default).withConfig({
1068
+ componentId: "ccl__sc-h2bc55-1"
1069
+ })(["position:absolute;top:8px;right:8px;color:var(--charcoal-text3);transition:0.2s color;&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{&:hover{color:var(--charcoal-text3-hover);}&:active{color:var(--charcoal-text3-press);}}"]);
1823
1070
  function ModalTitle(props) {
1824
- const { titleProps, title } = (0, import_react12.useContext)(ModalContext);
1071
+ const {
1072
+ titleProps,
1073
+ title
1074
+ } = (0, import_react12.useContext)(ModalContext);
1825
1075
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalHeading, { ...titleProps, ...props, children: title });
1826
1076
  }
1827
- var ModalHeading = import_styled_components12.default.h3`
1828
- margin: 0;
1829
- font-weight: inherit;
1830
- font-size: inherit;
1831
- `;
1077
+ var ModalHeading = import_styled_components12.default.h3.withConfig({
1078
+ componentId: "ccl__sc-h2bc55-2"
1079
+ })(["margin:0;font-weight:inherit;font-size:inherit;"]);
1832
1080
 
1833
1081
  // src/components/Modal/ModalPlumbing.tsx
1834
1082
  var import_styled_components13 = __toESM(require("styled-components"));
1835
1083
  var import_react13 = require("react");
1836
- var import_utils7 = require("@charcoal-ui/utils");
1084
+ var import_utils9 = require("@charcoal-ui/utils");
1837
1085
  var import_jsx_runtime15 = require("react/jsx-runtime");
1838
1086
  function ModalHeader() {
1839
1087
  const modalCtx = (0, import_react13.useContext)(ModalContext);
1840
1088
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ModalHeaderRoot, { $bottomSheet: modalCtx.bottomSheet, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StyledModalTitle, {}) });
1841
1089
  }
1842
- var ModalHeaderRoot = import_styled_components13.default.div`
1843
- height: 64px;
1844
- display: grid;
1845
- align-content: center;
1846
- justify-content: center;
1847
- @media ${({ theme }) => (0, import_utils7.maxWidth)(theme.breakpoint.screen1)} {
1848
- ${(p) => p.$bottomSheet !== false && import_styled_components13.css`
1849
- height: 48px;
1850
- `}
1851
- }
1852
- `;
1853
- var StyledModalTitle = (0, import_styled_components13.default)(ModalTitle)`
1854
- color: var(--charcoal-text1);
1855
- font-size: 16px;
1856
- line-height: 24px;
1857
- font-weight: bold;
1858
- display: flow-root;
1859
-
1860
- &::before {
1861
- display: block;
1862
- width: 0;
1863
- height: 0;
1864
- content: '';
1865
- margin-top: -4px;
1866
- }
1867
- &::after {
1868
- display: block;
1869
- width: 0;
1870
- height: 0;
1871
- content: '';
1872
- margin-bottom: -4px;
1873
- }
1874
- `;
1875
- var ModalAlign = import_styled_components13.default.div`
1876
- padding-left: 16px;
1877
- padding-right: 16px;
1878
- `;
1879
- var ModalBody = import_styled_components13.default.div`
1880
- padding-bottom: 40px;
1881
- `;
1882
- var ModalButtons = import_styled_components13.default.div`
1883
- display: grid;
1884
- grid-auto-flow: row;
1885
- grid-row-gap: 8px;
1886
-
1887
- padding-top: 16px;
1888
- padding-left: 16px;
1889
- padding-right: 16px;
1890
- `;
1090
+ var ModalHeaderRoot = import_styled_components13.default.div.withConfig({
1091
+ componentId: "ccl__sc-1k33wze-0"
1092
+ })(["height:64px;display:grid;align-content:center;justify-content:center;@media ", "{", "}"], ({
1093
+ theme
1094
+ }) => (0, import_utils9.maxWidth)(theme.breakpoint.screen1), (p) => p.$bottomSheet !== false && (0, import_styled_components13.css)(["height:48px;"]));
1095
+ var StyledModalTitle = (0, import_styled_components13.default)(ModalTitle).withConfig({
1096
+ componentId: "ccl__sc-1k33wze-1"
1097
+ })(["color:var(--charcoal-text1);font-size:16px;line-height:24px;font-weight:bold;display:flow-root;&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
1098
+ var ModalAlign = import_styled_components13.default.div.withConfig({
1099
+ componentId: "ccl__sc-1k33wze-2"
1100
+ })(["padding-left:16px;padding-right:16px;"]);
1101
+ var ModalBody = import_styled_components13.default.div.withConfig({
1102
+ componentId: "ccl__sc-1k33wze-3"
1103
+ })(["padding-bottom:40px;"]);
1104
+ var ModalButtons = import_styled_components13.default.div.withConfig({
1105
+ componentId: "ccl__sc-1k33wze-4"
1106
+ })(["display:grid;grid-auto-flow:row;grid-row-gap:8px;padding-top:16px;padding-left:16px;padding-right:16px;"]);
1891
1107
 
1892
1108
  // src/components/LoadingSpinner/index.tsx
1893
1109
  var import_react14 = require("react");
1894
1110
  var import_styled_components14 = __toESM(require("styled-components"));
1895
1111
  var import_jsx_runtime16 = require("react/jsx-runtime");
1896
- var LoadingSpinner = (0, import_react14.forwardRef)(
1897
- function LoadingSpinnerInner({ size = 48, padding = 16, transparent = false, className }, ref) {
1898
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1899
- LoadingSpinnerRoot,
1900
- {
1901
- size,
1902
- padding,
1903
- transparent,
1904
- className,
1905
- ref,
1906
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerIcon, {})
1907
- }
1908
- );
1909
- }
1910
- );
1112
+ var LoadingSpinner = (0, import_react14.forwardRef)(function LoadingSpinnerInner({
1113
+ size = 48,
1114
+ padding = 16,
1115
+ transparent = false,
1116
+ className
1117
+ }, ref) {
1118
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerRoot, { size, padding, transparent, className, ref, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerIcon, {}) });
1119
+ });
1911
1120
  var LoadingSpinner_default = (0, import_react14.memo)(LoadingSpinner);
1912
- var LoadingSpinnerRoot = import_styled_components14.default.div.attrs({ role: "progressbar" })`
1913
- box-sizing: content-box;
1914
- margin: auto;
1915
- padding: ${(props) => props.padding}px;
1916
- border-radius: 8px;
1917
- font-size: ${(props) => props.size}px;
1918
- width: ${(props) => props.size}px;
1919
- height: ${(props) => props.size}px;
1920
- opacity: 0.84;
1921
- color: var(--charcoal-text4);
1922
- background-color: ${({ transparent }) => `var(--charcoal-${transparent ? "transparent" : "background1"})`};
1923
- `;
1924
- var scaleOut = import_styled_components14.keyframes`
1925
- from {
1926
- transform: scale(0);
1927
- opacity: 1;
1928
- }
1929
-
1930
- to {
1931
- transform: scale(1);
1932
- opacity: 0;
1933
- }
1934
- `;
1935
- var Icon2 = import_styled_components14.default.div.attrs({ role: "presentation" })`
1936
- width: 1em;
1937
- height: 1em;
1938
- border-radius: 1em;
1939
- background-color: currentColor;
1940
- animation: ${scaleOut} 1s both ease-out;
1941
- animation-iteration-count: ${(p) => p.once ? 1 : "infinite"};
1942
-
1943
- &[data-reset-animation] {
1944
- animation: none;
1945
- }
1946
- `;
1947
- var LoadingSpinnerIcon = (0, import_react14.forwardRef)(
1948
- function LoadingSpinnerIcon2({ once = false }, ref) {
1949
- const iconRef = (0, import_react14.useRef)(null);
1950
- (0, import_react14.useImperativeHandle)(ref, () => ({
1951
- restart: () => {
1952
- if (!iconRef.current) {
1953
- return;
1954
- }
1955
- iconRef.current.dataset.resetAnimation = "true";
1956
- void iconRef.current.offsetWidth;
1957
- delete iconRef.current.dataset.resetAnimation;
1121
+ var LoadingSpinnerRoot = import_styled_components14.default.div.attrs({
1122
+ role: "progressbar"
1123
+ }).withConfig({
1124
+ componentId: "ccl__sc-1id6yz4-0"
1125
+ })(["box-sizing:content-box;margin:auto;padding:", "px;border-radius:8px;font-size:", "px;width:", "px;height:", "px;opacity:0.84;color:var(--charcoal-text4);background-color:", ";"], (props) => props.padding, (props) => props.size, (props) => props.size, (props) => props.size, ({
1126
+ transparent
1127
+ }) => `var(--charcoal-${transparent ? "transparent" : "background1"})`);
1128
+ var scaleOut = (0, import_styled_components14.keyframes)(["from{transform:scale(0);opacity:1;}to{transform:scale(1);opacity:0;}"]);
1129
+ var Icon2 = import_styled_components14.default.div.attrs({
1130
+ role: "presentation"
1131
+ }).withConfig({
1132
+ componentId: "ccl__sc-1id6yz4-1"
1133
+ })(["width:1em;height:1em;border-radius:1em;background-color:currentColor;animation:", " 1s both ease-out;animation-iteration-count:", ";&[data-reset-animation]{animation:none;}"], scaleOut, (p) => p.once ? 1 : "infinite");
1134
+ var LoadingSpinnerIcon = (0, import_react14.forwardRef)(function LoadingSpinnerIcon2({
1135
+ once = false
1136
+ }, ref) {
1137
+ const iconRef = (0, import_react14.useRef)(null);
1138
+ (0, import_react14.useImperativeHandle)(ref, () => ({
1139
+ restart: () => {
1140
+ if (!iconRef.current) {
1141
+ return;
1958
1142
  }
1959
- }));
1960
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon2, { ref: iconRef, once });
1961
- }
1962
- );
1143
+ iconRef.current.dataset.resetAnimation = "true";
1144
+ void iconRef.current.offsetWidth;
1145
+ delete iconRef.current.dataset.resetAnimation;
1146
+ }
1147
+ }));
1148
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon2, { ref: iconRef, once });
1149
+ });
1963
1150
 
1964
1151
  // src/components/DropdownSelector/index.tsx
1965
1152
  var import_react20 = require("react");
1966
1153
  var import_styled_components17 = __toESM(require("styled-components"));
1967
- var import_utils8 = require("@charcoal-ui/utils");
1154
+ var import_utils10 = require("@charcoal-ui/utils");
1968
1155
 
1969
1156
  // src/components/DropdownSelector/DropdownPopover.tsx
1970
1157
  var import_react17 = require("react");
1971
1158
 
1972
1159
  // src/components/DropdownSelector/Popover/index.tsx
1973
1160
  var import_react16 = require("react");
1974
- var import_overlays3 = require("@react-aria/overlays");
1161
+ var import_overlays4 = require("@react-aria/overlays");
1975
1162
  var import_styled_components15 = __toESM(require("styled-components"));
1976
1163
 
1977
1164
  // src/components/DropdownSelector/Popover/usePreventScroll.tsx
1978
1165
  var import_react15 = require("react");
1979
- function usePreventScroll(element, isOpen) {
1166
+ function usePreventScroll2(element, isOpen) {
1980
1167
  (0, import_react15.useEffect)(() => {
1981
1168
  if (isOpen && element) {
1982
1169
  const defaultPaddingRight = element.style.paddingRight;
@@ -1997,58 +1184,47 @@ var _empty = () => null;
1997
1184
  function Popover(props) {
1998
1185
  const defaultPopoverRef = (0, import_react16.useRef)(null);
1999
1186
  const finalPopoverRef = props.popoverRef === void 0 ? defaultPopoverRef : props.popoverRef;
2000
- const { popoverProps, underlayProps } = (0, import_overlays3.usePopover)(
2001
- {
2002
- triggerRef: props.triggerRef,
2003
- popoverRef: finalPopoverRef,
2004
- containerPadding: 16
2005
- },
2006
- {
2007
- close: props.onClose,
2008
- isOpen: props.isOpen,
2009
- open: _empty,
2010
- setOpen: _empty,
2011
- toggle: _empty
2012
- }
2013
- );
1187
+ const {
1188
+ popoverProps,
1189
+ underlayProps
1190
+ } = (0, import_overlays4.usePopover)({
1191
+ triggerRef: props.triggerRef,
1192
+ popoverRef: finalPopoverRef,
1193
+ containerPadding: 16
1194
+ }, {
1195
+ close: props.onClose,
1196
+ isOpen: props.isOpen,
1197
+ open: _empty,
1198
+ setOpen: _empty,
1199
+ toggle: _empty
1200
+ });
2014
1201
  const modalBackground = (0, import_react16.useContext)(ModalBackgroundContext);
2015
- usePreventScroll(modalBackground, props.isOpen);
1202
+ usePreventScroll2(modalBackground, props.isOpen);
2016
1203
  if (!props.isOpen)
2017
1204
  return null;
2018
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_overlays3.Overlay, { portalContainer: document.body, children: [
2019
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2020
- "div",
2021
- {
2022
- ...underlayProps,
2023
- style: {
2024
- position: "fixed",
2025
- zIndex: typeof popoverProps.style?.zIndex === "number" ? popoverProps.style.zIndex - 1 : 99999,
2026
- inset: 0
2027
- }
2028
- }
2029
- ),
1205
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_overlays4.Overlay, { portalContainer: document.body, children: [
1206
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ...underlayProps, style: {
1207
+ position: "fixed",
1208
+ zIndex: typeof popoverProps.style?.zIndex === "number" ? popoverProps.style.zIndex - 1 : 99999,
1209
+ inset: 0
1210
+ } }),
2030
1211
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownPopoverDiv, { ...popoverProps, ref: finalPopoverRef, children: [
2031
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays3.DismissButton, { onDismiss: () => props.onClose() }),
1212
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays4.DismissButton, { onDismiss: () => props.onClose() }),
2032
1213
  props.children,
2033
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays3.DismissButton, { onDismiss: () => props.onClose() })
1214
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays4.DismissButton, { onDismiss: () => props.onClose() })
2034
1215
  ] })
2035
1216
  ] });
2036
1217
  }
2037
- var DropdownPopoverDiv = import_styled_components15.default.div`
2038
- margin: 4px 0;
2039
- list-style: none;
2040
- overflow: auto;
2041
- max-height: inherit;
2042
- background-color: var(--charcoal-background1);
2043
- border: solid 1px var(--charcoal-border-default);
2044
- border-radius: 8px;
2045
- padding-top: 8px;
2046
- padding-bottom: 8px;
2047
- `;
1218
+ var DropdownPopoverDiv = import_styled_components15.default.div.withConfig({
1219
+ componentId: "ccl__sc-jwnoy6-0"
1220
+ })(["margin:4px 0;list-style:none;overflow:auto;max-height:inherit;background-color:var(--charcoal-background1);border:solid 1px var(--charcoal-border-default);border-radius:8px;padding-top:8px;padding-bottom:8px;"]);
2048
1221
 
2049
1222
  // src/components/DropdownSelector/DropdownPopover.tsx
2050
1223
  var import_jsx_runtime18 = require("react/jsx-runtime");
2051
- function DropdownPopover({ children, ...props }) {
1224
+ function DropdownPopover({
1225
+ children,
1226
+ ...props
1227
+ }) {
2052
1228
  const ref = (0, import_react17.useRef)(null);
2053
1229
  (0, import_react17.useEffect)(() => {
2054
1230
  if (props.isOpen && ref.current && props.triggerRef.current) {
@@ -2059,32 +1235,21 @@ function DropdownPopover({ children, ...props }) {
2059
1235
  if (props.isOpen && props.value !== void 0) {
2060
1236
  const windowScrollY = window.scrollY;
2061
1237
  const windowScrollX = window.scrollX;
2062
- const selectedElement = document.querySelector(
2063
- `[data-key="${props.value.toString()}"]`
2064
- );
1238
+ const selectedElement = document.querySelector(`[data-key="${props.value.toString()}"]`);
2065
1239
  selectedElement?.focus();
2066
1240
  window.scrollTo(windowScrollX, windowScrollY);
2067
1241
  }
2068
1242
  }, [props.value, props.isOpen]);
2069
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2070
- Popover,
2071
- {
2072
- isOpen: props.isOpen,
2073
- onClose: props.onClose,
2074
- popoverRef: ref,
2075
- triggerRef: props.triggerRef,
2076
- children
2077
- }
2078
- );
1243
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Popover, { isOpen: props.isOpen, onClose: props.onClose, popoverRef: ref, triggerRef: props.triggerRef, children });
2079
1244
  }
2080
1245
 
2081
1246
  // src/components/DropdownSelector/utils/findPreviewRecursive.tsx
2082
- var React10 = __toESM(require("react"));
1247
+ var React11 = __toESM(require("react"));
2083
1248
  function findPreviewRecursive(children, value) {
2084
- const childArray = React10.Children.toArray(children);
1249
+ const childArray = React11.Children.toArray(children);
2085
1250
  for (let i = 0; i < childArray.length; i++) {
2086
1251
  const child = childArray[i];
2087
- if (React10.isValidElement(child)) {
1252
+ if (React11.isValidElement(child)) {
2088
1253
  if ("value" in child.props) {
2089
1254
  const childValue = child.props.value;
2090
1255
  if (childValue === value && "children" in child.props) {
@@ -2093,10 +1258,7 @@ function findPreviewRecursive(children, value) {
2093
1258
  }
2094
1259
  }
2095
1260
  if ("children" in child.props) {
2096
- const children2 = findPreviewRecursive(
2097
- child.props.children,
2098
- value
2099
- );
1261
+ const children2 = findPreviewRecursive(child.props.children, value);
2100
1262
  if (children2 !== void 0) {
2101
1263
  return children2;
2102
1264
  }
@@ -2120,12 +1282,12 @@ var MenuListContext = (0, import_react18.createContext)({
2120
1282
  });
2121
1283
 
2122
1284
  // src/components/DropdownSelector/MenuList/internals/getValuesRecursive.tsx
2123
- var React11 = __toESM(require("react"));
1285
+ var React12 = __toESM(require("react"));
2124
1286
  function getValuesRecursive(children, values = []) {
2125
- const childArray = React11.Children.toArray(children);
1287
+ const childArray = React12.Children.toArray(children);
2126
1288
  for (let i = 0; i < childArray.length; i++) {
2127
1289
  const child = childArray[i];
2128
- if (React11.isValidElement(child)) {
1290
+ if (React12.isValidElement(child)) {
2129
1291
  const props = child.props;
2130
1292
  if ("value" in props && typeof props.value === "string") {
2131
1293
  const childValue = props.value;
@@ -2144,25 +1306,18 @@ function MenuList(props) {
2144
1306
  const root = (0, import_react19.useRef)(null);
2145
1307
  const values = [];
2146
1308
  getValuesRecursive(props.children, values);
2147
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StyledUl, { ref: root, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2148
- MenuListContext.Provider,
2149
- {
2150
- value: {
2151
- value: props.value ?? "",
2152
- root,
2153
- values,
2154
- setValue: (v) => {
2155
- props.onChange?.(v);
2156
- }
2157
- },
2158
- children: props.children
1309
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StyledUl, { ref: root, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MenuListContext.Provider, { value: {
1310
+ value: props.value ?? "",
1311
+ root,
1312
+ values,
1313
+ setValue: (v) => {
1314
+ props.onChange?.(v);
2159
1315
  }
2160
- ) });
1316
+ }, children: props.children }) });
2161
1317
  }
2162
- var StyledUl = import_styled_components16.default.ul`
2163
- padding: 0;
2164
- margin: 0;
2165
- `;
1318
+ var StyledUl = import_styled_components16.default.ul.withConfig({
1319
+ componentId: "ccl__sc-1y72v02-0"
1320
+ })(["padding:0;margin:0;"]);
2166
1321
 
2167
1322
  // src/components/DropdownSelector/index.tsx
2168
1323
  var import_styled8 = require("@charcoal-ui/styled");
@@ -2173,153 +1328,46 @@ function DropdownSelector(props) {
2173
1328
  const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
2174
1329
  const preview = findPreviewRecursive(props.children, props.value);
2175
1330
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownSelectorRoot, { "aria-disabled": props.disabled, children: [
2176
- props.showLabel === true && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2177
- DropdownFieldLabel,
2178
- {
2179
- label: props.label,
2180
- required: props.required,
2181
- requiredText: props.requiredText ?? defaultRequiredText,
2182
- subLabel: props.subLabel
2183
- }
2184
- ),
2185
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2186
- DropdownButton,
2187
- {
2188
- invalid: props.invalid,
2189
- disabled: props.disabled,
2190
- onClick: () => {
2191
- if (props.disabled === true)
2192
- return;
2193
- setIsOpen(true);
2194
- },
2195
- ref: triggerRef,
2196
- type: "button",
2197
- $active: isOpen,
2198
- children: [
2199
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownButtonText, { children: props.placeholder !== void 0 && preview === void 0 ? props.placeholder : preview }),
2200
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownButtonIcon, { name: "16/Menu" })
2201
- ]
2202
- }
2203
- ),
2204
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2205
- DropdownPopover,
2206
- {
2207
- isOpen,
2208
- onClose: () => setIsOpen(false),
2209
- triggerRef,
2210
- value: props.value,
2211
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2212
- MenuList,
2213
- {
2214
- value: props.value,
2215
- onChange: (v) => {
2216
- props.onChange(v);
2217
- setIsOpen(false);
2218
- },
2219
- children: props.children
2220
- }
2221
- )
2222
- }
2223
- ),
1331
+ props.showLabel === true && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownFieldLabel, { label: props.label, required: props.required, requiredText: props.requiredText ?? defaultRequiredText, subLabel: props.subLabel }),
1332
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownButton, { invalid: props.invalid, disabled: props.disabled, onClick: () => {
1333
+ if (props.disabled === true)
1334
+ return;
1335
+ setIsOpen(true);
1336
+ }, ref: triggerRef, type: "button", $active: isOpen, children: [
1337
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownButtonText, { children: props.placeholder !== void 0 && preview === void 0 ? props.placeholder : preview }),
1338
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownButtonIcon, { name: "16/Menu" })
1339
+ ] }),
1340
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownPopover, { isOpen, onClose: () => setIsOpen(false), triggerRef, value: props.value, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuList, { value: props.value, onChange: (v) => {
1341
+ props.onChange(v);
1342
+ setIsOpen(false);
1343
+ }, children: props.children }) }),
2224
1344
  props.assistiveText !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
2225
1345
  ] });
2226
1346
  }
2227
- var DropdownSelectorRoot = import_styled_components17.default.div`
2228
- display: inline-block;
2229
- width: 100%;
2230
-
2231
- ${import_utils8.disabledSelector} {
2232
- cursor: default;
2233
- opacity: 0.32;
2234
- }
2235
- `;
2236
- var DropdownFieldLabel = (0, import_styled_components17.default)(FieldLabel_default)`
2237
- width: 100%;
2238
- margin-bottom: 8px;
2239
- `;
2240
- var DropdownButton = import_styled_components17.default.button`
2241
- display: flex;
2242
- justify-content: space-between;
2243
- align-items: center;
2244
-
2245
- height: 40px;
2246
- width: 100%;
2247
- box-sizing: border-box;
2248
- border: none;
2249
- cursor: pointer;
2250
- gap: 4px;
2251
-
2252
- ${import_utils8.disabledSelector} {
2253
- cursor: default;
2254
- }
2255
-
2256
- padding-right: 8px;
2257
- padding-left: 8px;
2258
- background-color: var(--charcoal-surface3);
2259
- border-radius: 4px;
2260
-
2261
- transition: 0.2s box-shadow, 0.2s background-color;
2262
-
2263
- &:not(:disabled):not([aria-disabled]),
2264
- &[aria-disabled='false'] {
2265
- ${import_styled8.focusVisibleFocusRingCss}
2266
- ${({ $active }) => $active === true ? import_styled_components17.css`
2267
- background-color: var(--charcoal-surface3-press);
2268
- ` : import_styled_components17.css`
2269
- &:hover {
2270
- background-color: var(--charcoal-surface3-hover);
2271
- }
2272
- &:active {
2273
- background-color: var(--charcoal-surface3-press);
2274
- }
2275
- `}
2276
- }
2277
-
2278
- ${({ invalid }) => invalid === true && import_styled_components17.css`
2279
- &:not(:disabled):not([aria-disabled]),
2280
- &[aria-disabled='false'] {
2281
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
2282
- }
2283
- `}
2284
- `;
2285
- var DropdownButtonText = import_styled_components17.default.span`
2286
- text-align: left;
2287
- font-size: 14px;
2288
- line-height: 22px;
2289
- display: flow-root;
2290
- color: var(--charcoal-text2);
2291
- overflow: hidden;
2292
- text-overflow: ellipsis;
2293
- white-space: nowrap;
2294
- `;
2295
- var DropdownButtonIcon = (0, import_styled_components17.default)(Icon_default)`
2296
- color: var(--charcoal-text2);
2297
- `;
2298
- var AssertiveText = import_styled_components17.default.div`
2299
- margin-top: 8px;
2300
- font-size: 14px;
2301
- color: var(--charcoal-text2);
2302
- line-height: 22px;
2303
- display: flow-root;
2304
- &::before {
2305
- display: block;
2306
- width: 0;
2307
- height: 0;
2308
- content: '';
2309
- margin-top: -4px;
2310
- }
2311
- &::after {
2312
- display: block;
2313
- width: 0;
2314
- height: 0;
2315
- content: '';
2316
- margin-bottom: -4px;
2317
- }
2318
-
2319
- ${({ invalid }) => invalid === true && import_styled_components17.css`
2320
- color: var(--charcoal-assertive);
2321
- `}
2322
- `;
1347
+ var DropdownSelectorRoot = import_styled_components17.default.div.withConfig({
1348
+ componentId: "ccl__sc-1vnxmc8-0"
1349
+ })(["display:inline-block;width:100%;", "{cursor:default;opacity:0.32;}"], import_utils10.disabledSelector);
1350
+ var DropdownFieldLabel = (0, import_styled_components17.default)(FieldLabel_default).withConfig({
1351
+ componentId: "ccl__sc-1vnxmc8-1"
1352
+ })(["width:100%;margin-bottom:8px;"]);
1353
+ var DropdownButton = import_styled_components17.default.button.withConfig({
1354
+ componentId: "ccl__sc-1vnxmc8-2"
1355
+ })(["display:flex;justify-content:space-between;align-items:center;height:40px;width:100%;box-sizing:border-box;border:none;cursor:pointer;gap:4px;", "{cursor:default;}padding-right:8px;padding-left:8px;background-color:var(--charcoal-surface3);border-radius:4px;transition:0.2s box-shadow,0.2s background-color;&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{", " ", "}", ""], import_utils10.disabledSelector, import_styled8.focusVisibleFocusRingCss, ({
1356
+ $active
1357
+ }) => $active === true ? (0, import_styled_components17.css)(["background-color:var(--charcoal-surface3-press);"]) : (0, import_styled_components17.css)(["&:hover{background-color:var(--charcoal-surface3-hover);}&:active{background-color:var(--charcoal-surface3-press);}"]), ({
1358
+ invalid
1359
+ }) => invalid === true && (0, import_styled_components17.css)(["&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{box-shadow:0 0 0 4px rgba(255,43,0,0.32);}"]));
1360
+ var DropdownButtonText = import_styled_components17.default.span.withConfig({
1361
+ componentId: "ccl__sc-1vnxmc8-3"
1362
+ })(["text-align:left;font-size:14px;line-height:22px;display:flow-root;color:var(--charcoal-text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
1363
+ var DropdownButtonIcon = (0, import_styled_components17.default)(Icon_default).withConfig({
1364
+ componentId: "ccl__sc-1vnxmc8-4"
1365
+ })(["color:var(--charcoal-text2);"]);
1366
+ var AssertiveText = import_styled_components17.default.div.withConfig({
1367
+ componentId: "ccl__sc-1vnxmc8-5"
1368
+ })(["margin-top:8px;font-size:14px;color:var(--charcoal-text2);line-height:22px;display:flow-root;&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}", ""], ({
1369
+ invalid
1370
+ }) => invalid === true && (0, import_styled_components17.css)(["color:var(--charcoal-assertive);"]));
2323
1371
 
2324
1372
  // src/components/DropdownSelector/DropdownMenuItem.tsx
2325
1373
  var import_styled_components19 = __toESM(require("styled-components"));
@@ -2328,34 +1376,18 @@ var import_styled_components19 = __toESM(require("styled-components"));
2328
1376
  var import_styled_components18 = __toESM(require("styled-components"));
2329
1377
  var import_jsx_runtime21 = require("react/jsx-runtime");
2330
1378
  function ListItem(props) {
2331
- const { children, ...rest } = props;
1379
+ const {
1380
+ children,
1381
+ ...rest
1382
+ } = props;
2332
1383
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyledLi, { role: "option", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemDiv, { ...rest, children: props.children }) });
2333
1384
  }
2334
- var StyledLi = import_styled_components18.default.li`
2335
- list-style: none;
2336
- `;
2337
- var ItemDiv = import_styled_components18.default.div`
2338
- display: flex;
2339
- align-items: center;
2340
- min-height: 40px;
2341
- cursor: pointer;
2342
- outline: none;
2343
-
2344
- padding-right: 16px;
2345
- padding-left: 16px;
2346
-
2347
- &:disabled,
2348
- &[aria-disabled]:not([aria-disabled='false']) {
2349
- opacity: 0.32;
2350
- cursor: default;
2351
- }
2352
-
2353
- :hover,
2354
- :focus,
2355
- :focus-within {
2356
- background-color: var(--charcoal-surface3);
2357
- }
2358
- `;
1385
+ var StyledLi = import_styled_components18.default.li.withConfig({
1386
+ componentId: "ccl__sc-p1vs75-0"
1387
+ })(["list-style:none;"]);
1388
+ var ItemDiv = import_styled_components18.default.div.withConfig({
1389
+ componentId: "ccl__sc-p1vs75-1"
1390
+ })(["display:flex;align-items:center;min-height:40px;cursor:pointer;outline:none;padding-right:16px;padding-left:16px;&:disabled,&[aria-disabled]:not([aria-disabled='false']){opacity:0.32;cursor:default;}:hover,:focus,:focus-within{background-color:var(--charcoal-surface3);}"]);
2359
1391
 
2360
1392
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
2361
1393
  var import_react21 = require("react");
@@ -2391,84 +1423,77 @@ function scrollIfNeeded(element) {
2391
1423
 
2392
1424
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
2393
1425
  function useMenuItemHandleKeyDown(value) {
2394
- const { setValue, root, values } = (0, import_react21.useContext)(MenuListContext);
1426
+ const {
1427
+ setValue,
1428
+ root,
1429
+ values
1430
+ } = (0, import_react21.useContext)(MenuListContext);
2395
1431
  const setContextValue = (0, import_react21.useCallback)(() => {
2396
1432
  if (value !== void 0)
2397
1433
  setValue(value);
2398
1434
  }, [value, setValue]);
2399
- const handleKeyDown = (0, import_react21.useCallback)(
2400
- (e) => {
2401
- if (e.key === "Enter") {
2402
- setContextValue();
2403
- } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2404
- e.preventDefault();
2405
- if (!values || value === void 0)
2406
- return;
2407
- const index = values.indexOf(value);
2408
- if (index === -1)
2409
- return;
2410
- const focusValue = e.key === "ArrowUp" ? index - 1 < 0 ? values[values.length - 1] : values[index - 1] : index + 1 >= values.length ? values[0] : values[index + 1];
2411
- const next = root?.current?.querySelector(`[data-key='${focusValue}']`);
2412
- if (next instanceof HTMLElement) {
2413
- next.focus({ preventScroll: true });
2414
- if (root?.current?.parentElement) {
2415
- handleFocusByKeyBoard(next, root.current.parentElement);
2416
- }
1435
+ const handleKeyDown = (0, import_react21.useCallback)((e) => {
1436
+ if (e.key === "Enter") {
1437
+ setContextValue();
1438
+ } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
1439
+ e.preventDefault();
1440
+ if (!values || value === void 0)
1441
+ return;
1442
+ const index = values.indexOf(value);
1443
+ if (index === -1)
1444
+ return;
1445
+ const focusValue = e.key === "ArrowUp" ? index - 1 < 0 ? values[values.length - 1] : values[index - 1] : index + 1 >= values.length ? values[0] : values[index + 1];
1446
+ const next = root?.current?.querySelector(`[data-key='${focusValue}']`);
1447
+ if (next instanceof HTMLElement) {
1448
+ next.focus({
1449
+ preventScroll: true
1450
+ });
1451
+ if (root?.current?.parentElement) {
1452
+ handleFocusByKeyBoard(next, root.current.parentElement);
2417
1453
  }
2418
1454
  }
2419
- },
2420
- [setContextValue, value, root, values]
2421
- );
1455
+ }
1456
+ }, [setContextValue, value, root, values]);
2422
1457
  return [handleKeyDown, setContextValue];
2423
1458
  }
2424
1459
 
2425
1460
  // src/components/DropdownSelector/MenuItem/index.tsx
2426
1461
  var import_jsx_runtime22 = require("react/jsx-runtime");
2427
1462
  function MenuItem(props) {
2428
- const { children, as, ...rest } = props;
1463
+ const {
1464
+ children,
1465
+ as,
1466
+ ...rest
1467
+ } = props;
2429
1468
  const [handleKeyDown, setContextValue] = useMenuItemHandleKeyDown(props.value);
2430
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2431
- ListItem,
2432
- {
2433
- ...rest,
2434
- as,
2435
- "data-key": props.value,
2436
- onKeyDown: handleKeyDown,
2437
- onClick: props.disabled === true ? void 0 : setContextValue,
2438
- tabIndex: -1,
2439
- "aria-disabled": props.disabled,
2440
- children: props.children
2441
- }
2442
- );
1469
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ListItem, { ...rest, as, "data-key": props.value, onKeyDown: handleKeyDown, onClick: props.disabled === true ? void 0 : setContextValue, tabIndex: -1, "aria-disabled": props.disabled, children: props.children });
2443
1470
  }
2444
1471
 
2445
1472
  // src/components/DropdownSelector/DropdownMenuItem.tsx
2446
1473
  var import_react22 = require("react");
2447
1474
  var import_jsx_runtime23 = require("react/jsx-runtime");
2448
1475
  function DropdownMenuItem(props) {
2449
- const { value: ctxValue } = (0, import_react22.useContext)(MenuListContext);
1476
+ const {
1477
+ value: ctxValue
1478
+ } = (0, import_react22.useContext)(MenuListContext);
2450
1479
  const isSelected = props.value === ctxValue;
2451
- const { children, ...rest } = props;
1480
+ const {
1481
+ children,
1482
+ ...rest
1483
+ } = props;
2452
1484
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(MenuItem, { ...rest, children: [
2453
1485
  isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text2ColorIcon, { name: "16/Check" }),
2454
1486
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledSpan, { isSelected, children: props.children })
2455
1487
  ] });
2456
1488
  }
2457
- var StyledSpan = import_styled_components19.default.span`
2458
- font-size: 14px;
2459
- line-height: 22px;
2460
- color: var(--charcoal-text2);
2461
- padding: 9px 0;
2462
-
2463
- display: flex;
2464
- align-items: center;
2465
- width: 100%;
2466
- margin-left: ${({ isSelected }) => isSelected === true ? 0 : 20}px;
2467
- `;
2468
- var Text2ColorIcon = (0, import_styled_components19.default)(Icon_default)`
2469
- color: var(--charcoal-text2);
2470
- padding-right: 4px;
2471
- `;
1489
+ var StyledSpan = import_styled_components19.default.span.withConfig({
1490
+ componentId: "ccl__sc-108wg2j-0"
1491
+ })(["font-size:14px;line-height:22px;color:var(--charcoal-text2);padding:9px 0;display:flex;align-items:center;width:100%;margin-left:", "px;"], ({
1492
+ isSelected
1493
+ }) => isSelected === true ? 0 : 20);
1494
+ var Text2ColorIcon = (0, import_styled_components19.default)(Icon_default).withConfig({
1495
+ componentId: "ccl__sc-108wg2j-1"
1496
+ })(["color:var(--charcoal-text2);padding-right:4px;"]);
2472
1497
 
2473
1498
  // src/components/DropdownSelector/MenuItemGroup/index.tsx
2474
1499
  var import_styled_components20 = __toESM(require("styled-components"));
@@ -2479,23 +1504,15 @@ function MenuItemGroup(props) {
2479
1504
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StyledUl2, { role: "group", children: props.children })
2480
1505
  ] });
2481
1506
  }
2482
- var TextSpan = import_styled_components20.default.span`
2483
- display: block;
2484
- color: var(--charcoal-text3);
2485
- font-size: 12px;
2486
- font-weight: bold;
2487
- padding: 12px 0 8px 16px;
2488
- `;
2489
- var StyledUl2 = import_styled_components20.default.ul`
2490
- padding-left: 0;
2491
- margin: 0;
2492
- box-sizing: border-box;
2493
- list-style: none;
2494
- overflow: hidden;
2495
- `;
2496
- var StyledLi2 = import_styled_components20.default.li`
2497
- display: block;
2498
- `;
1507
+ var TextSpan = import_styled_components20.default.span.withConfig({
1508
+ componentId: "ccl__sc-1ubjfz7-0"
1509
+ })(["display:block;color:var(--charcoal-text3);font-size:12px;font-weight:bold;padding:12px 0 8px 16px;"]);
1510
+ var StyledUl2 = import_styled_components20.default.ul.withConfig({
1511
+ componentId: "ccl__sc-1ubjfz7-1"
1512
+ })(["padding-left:0;margin:0;box-sizing:border-box;list-style:none;overflow:hidden;"]);
1513
+ var StyledLi2 = import_styled_components20.default.li.withConfig({
1514
+ componentId: "ccl__sc-1ubjfz7-2"
1515
+ })(["display:block;"]);
2499
1516
 
2500
1517
  // src/components/SegmentedControl/index.tsx
2501
1518
  var import_react27 = require("react");
@@ -2529,7 +1546,13 @@ var $e5be200c675c3b3a$export$571b5131b7e65c11 = (0, import_react23.createContext
2529
1546
  var $e5be200c675c3b3a$export$a763b9476acd3eb = "__formValidationState" + Date.now();
2530
1547
  function $e5be200c675c3b3a$export$fc1a364ae1f3ff10(props) {
2531
1548
  if (props[$e5be200c675c3b3a$export$a763b9476acd3eb]) {
2532
- let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$e5be200c675c3b3a$export$a763b9476acd3eb];
1549
+ let {
1550
+ realtimeValidation,
1551
+ displayValidation,
1552
+ updateValidation,
1553
+ resetValidation,
1554
+ commitValidation
1555
+ } = props[$e5be200c675c3b3a$export$a763b9476acd3eb];
2533
1556
  return {
2534
1557
  realtimeValidation,
2535
1558
  displayValidation,
@@ -2541,7 +1564,15 @@ function $e5be200c675c3b3a$export$fc1a364ae1f3ff10(props) {
2541
1564
  return $e5be200c675c3b3a$var$useFormValidationStateImpl(props);
2542
1565
  }
2543
1566
  function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2544
- let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
1567
+ let {
1568
+ isInvalid,
1569
+ validationState,
1570
+ name,
1571
+ value,
1572
+ builtinValidation,
1573
+ validate,
1574
+ validationBehavior = "aria"
1575
+ } = props;
2545
1576
  if (validationState)
2546
1577
  isInvalid || (isInvalid = validationState === "invalid");
2547
1578
  let controlledError = isInvalid ? {
@@ -2549,10 +1580,7 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2549
1580
  validationErrors: [],
2550
1581
  validationDetails: $e5be200c675c3b3a$var$CUSTOM_VALIDITY_STATE
2551
1582
  } : null;
2552
- let clientError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult($e5be200c675c3b3a$var$runValidate(validate, value)), [
2553
- validate,
2554
- value
2555
- ]);
1583
+ let clientError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult($e5be200c675c3b3a$var$runValidate(validate, value)), [validate, value]);
2556
1584
  if (builtinValidation === null || builtinValidation === void 0 ? void 0 : builtinValidation.validationDetails.valid)
2557
1585
  builtinValidation = null;
2558
1586
  let serverErrors = (0, import_react23.useContext)($e5be200c675c3b3a$export$571b5131b7e65c11);
@@ -2560,20 +1588,14 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2560
1588
  if (name)
2561
1589
  return Array.isArray(name) ? name.flatMap((name2) => $e5be200c675c3b3a$var$asArray(serverErrors[name2])) : $e5be200c675c3b3a$var$asArray(serverErrors[name]);
2562
1590
  return [];
2563
- }, [
2564
- serverErrors,
2565
- name
2566
- ]);
1591
+ }, [serverErrors, name]);
2567
1592
  let [lastServerErrors, setLastServerErrors] = (0, import_react23.useState)(serverErrors);
2568
1593
  let [isServerErrorCleared, setServerErrorCleared] = (0, import_react23.useState)(false);
2569
1594
  if (serverErrors !== lastServerErrors) {
2570
1595
  setLastServerErrors(serverErrors);
2571
1596
  setServerErrorCleared(false);
2572
1597
  }
2573
- let serverError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [
2574
- isServerErrorCleared,
2575
- serverErrorMessages
2576
- ]);
1598
+ let serverError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [isServerErrorCleared, serverErrorMessages]);
2577
1599
  let nextValidation = (0, import_react23.useRef)($e5be200c675c3b3a$export$dad6ae84456c676a);
2578
1600
  let [currentValidity, setCurrentValidity] = (0, import_react23.useState)($e5be200c675c3b3a$export$dad6ae84456c676a);
2579
1601
  let lastError = (0, import_react23.useRef)($e5be200c675c3b3a$export$dad6ae84456c676a);
@@ -2620,9 +1642,7 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2620
1642
  function $e5be200c675c3b3a$var$asArray(v) {
2621
1643
  if (!v)
2622
1644
  return [];
2623
- return Array.isArray(v) ? v : [
2624
- v
2625
- ];
1645
+ return Array.isArray(v) ? v : [v];
2626
1646
  }
2627
1647
  function $e5be200c675c3b3a$var$runValidate(validate, value) {
2628
1648
  if (typeof validate === "function") {
@@ -2656,9 +1676,7 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
2656
1676
  if (wasControlled !== isControlled)
2657
1677
  console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
2658
1678
  isControlledRef.current = isControlled;
2659
- }, [
2660
- isControlled
2661
- ]);
1679
+ }, [isControlled]);
2662
1680
  let currentValue = isControlled ? value : stateValue;
2663
1681
  let setValue = (0, import_react24.useCallback)((value2, ...args) => {
2664
1682
  let onChangeCaller = (value3, ...onChangeArgs) => {
@@ -2684,15 +1702,8 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
2684
1702
  setStateValue(value2);
2685
1703
  onChangeCaller(value2, ...args);
2686
1704
  }
2687
- }, [
2688
- isControlled,
2689
- currentValue,
2690
- onChange
2691
- ]);
2692
- return [
2693
- currentValue,
2694
- setValue
2695
- ];
1705
+ }, [isControlled, currentValue, onChange]);
1706
+ return [currentValue, setValue];
2696
1707
  }
2697
1708
 
2698
1709
  // ../../node_modules/@react-stately/radio/dist/import.mjs
@@ -2700,9 +1711,7 @@ var import_react25 = require("react");
2700
1711
  var $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 1e10);
2701
1712
  var $a54cdc5c1942b639$var$i = 0;
2702
1713
  function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
2703
- let name = (0, import_react25.useMemo)(() => props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [
2704
- props.name
2705
- ]);
1714
+ let name = (0, import_react25.useMemo)(() => props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [props.name]);
2706
1715
  var _props_defaultValue;
2707
1716
  let [selectedValue, setSelected] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);
2708
1717
  let [lastFocusedValue, setLastFocusedValue] = (0, import_react25.useState)(null);
@@ -2755,267 +1764,123 @@ var useRadioContext = () => {
2755
1764
 
2756
1765
  // src/components/SegmentedControl/index.tsx
2757
1766
  var import_jsx_runtime26 = require("react/jsx-runtime");
2758
- var SegmentedControl = (0, import_react27.forwardRef)(
2759
- function SegmentedControlInner(props, ref) {
2760
- const ariaRadioGroupProps = (0, import_react27.useMemo)(
2761
- () => ({
2762
- ...props,
2763
- isDisabled: props.disabled,
2764
- isReadOnly: props.readonly,
2765
- isRequired: props.required,
2766
- "aria-label": props.name
2767
- }),
2768
- [props]
2769
- );
2770
- const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(ariaRadioGroupProps);
2771
- const { radioGroupProps } = (0, import_radio2.useRadioGroup)(ariaRadioGroupProps, state);
2772
- const segmentedControlItems = (0, import_react27.useMemo)(() => {
2773
- return props.data.map(
2774
- (d) => typeof d === "string" ? { value: d, label: d } : d
2775
- );
2776
- }, [props.data]);
2777
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2778
- SegmentedControlRoot,
2779
- {
2780
- ref,
2781
- ...radioGroupProps,
2782
- className: props.className,
2783
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioProvider, { value: state, children: segmentedControlItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2784
- Segmented,
2785
- {
2786
- value: item.value,
2787
- disabled: item.disabled,
2788
- children: item.label
2789
- },
2790
- item.value
2791
- )) })
2792
- }
2793
- );
2794
- }
2795
- );
1767
+ var SegmentedControl = (0, import_react27.forwardRef)(function SegmentedControlInner(props, ref) {
1768
+ const ariaRadioGroupProps = (0, import_react27.useMemo)(() => ({
1769
+ ...props,
1770
+ isDisabled: props.disabled,
1771
+ isReadOnly: props.readonly,
1772
+ isRequired: props.required,
1773
+ "aria-label": props.name
1774
+ }), [props]);
1775
+ const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(ariaRadioGroupProps);
1776
+ const {
1777
+ radioGroupProps
1778
+ } = (0, import_radio2.useRadioGroup)(ariaRadioGroupProps, state);
1779
+ const segmentedControlItems = (0, import_react27.useMemo)(() => {
1780
+ return props.data.map((d) => typeof d === "string" ? {
1781
+ value: d,
1782
+ label: d
1783
+ } : d);
1784
+ }, [props.data]);
1785
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SegmentedControlRoot, { ref, ...radioGroupProps, className: props.className, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioProvider, { value: state, children: segmentedControlItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Segmented, { value: item.value, disabled: item.disabled, children: item.label }, item.value)) }) });
1786
+ });
2796
1787
  var SegmentedControl_default = (0, import_react27.memo)(SegmentedControl);
2797
1788
  var Segmented = (props) => {
2798
1789
  const state = useRadioContext();
2799
1790
  const ref = (0, import_react27.useRef)(null);
2800
- const ariaRadioProps = (0, import_react27.useMemo)(
2801
- () => ({
2802
- value: props.value,
2803
- isDisabled: props.disabled,
2804
- children: props.children
2805
- }),
2806
- [props]
2807
- );
2808
- const { inputProps, isDisabled, isSelected } = (0, import_radio2.useRadio)(
2809
- ariaRadioProps,
2810
- state,
2811
- ref
2812
- );
2813
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2814
- SegmentedRoot,
2815
- {
2816
- "aria-disabled": isDisabled || state.isReadOnly,
2817
- checked: isSelected,
2818
- children: [
2819
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SegmentedInput, { ...inputProps, ref }),
2820
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioLabel2, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SegmentedLabelInner, { children: props.children }) })
2821
- ]
2822
- }
2823
- );
1791
+ const ariaRadioProps = (0, import_react27.useMemo)(() => ({
1792
+ value: props.value,
1793
+ isDisabled: props.disabled,
1794
+ children: props.children
1795
+ }), [props]);
1796
+ const {
1797
+ inputProps,
1798
+ isDisabled,
1799
+ isSelected
1800
+ } = (0, import_radio2.useRadio)(ariaRadioProps, state, ref);
1801
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(SegmentedRoot, { "aria-disabled": isDisabled || state.isReadOnly, checked: isSelected, children: [
1802
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SegmentedInput, { ...inputProps, ref }),
1803
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioLabel2, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SegmentedLabelInner, { children: props.children }) })
1804
+ ] });
2824
1805
  };
2825
- var SegmentedControlRoot = import_styled_components21.default.div`
2826
- display: inline-flex;
2827
- align-items: center;
2828
-
2829
- background-color: var(--charcoal-surface3);
2830
- border-radius: 16px;
2831
- `;
2832
- var SegmentedRoot = import_styled_components21.default.label`
2833
- position: relative;
2834
- display: flex;
2835
- align-items: center;
2836
- cursor: pointer;
2837
- height: 32px;
2838
-
2839
- padding-right: 16px;
2840
- padding-left: 16px;
2841
- border-radius: 16px;
2842
- &:disabled,
2843
- &[aria-disabled]:not([aria-disabled='false']) {
2844
- cursor: default;
2845
- opacity: 0.32;
2846
- }
2847
- color: var(--charcoal-text2);
2848
-
2849
- ${({ checked = false }) => checked && import_styled_components21.css`
2850
- background-color: var(--charcoal-brand);
2851
- color: var(--charcoal-text5);
2852
- `}
2853
- `;
2854
- var SegmentedInput = import_styled_components21.default.input`
2855
- position: absolute;
2856
-
2857
- height: 0px;
2858
- width: 0px;
2859
- padding: 0;
2860
- margin: 0;
2861
-
2862
- appearance: none;
2863
- box-sizing: border-box;
2864
- overflow: hidden;
2865
- white-space: nowrap;
2866
- opacity: 0;
2867
- `;
2868
- var RadioLabel2 = import_styled_components21.default.div`
2869
- background: transparent;
2870
- display: flex;
2871
- align-items: center;
2872
- height: 22px;
2873
- `;
2874
- var SegmentedLabelInner = import_styled_components21.default.div`
2875
- font-size: 14px;
2876
- line-height: 22px;
2877
- display: flow-root;
2878
-
2879
- &::before {
2880
- display: block;
2881
- width: 0;
2882
- height: 0;
2883
- content: '';
2884
- margin-top: -4px;
2885
- }
2886
- &::after {
2887
- display: block;
2888
- width: 0;
2889
- height: 0;
2890
- content: '';
2891
- margin-bottom: -4px;
2892
- }
2893
- `;
1806
+ var SegmentedControlRoot = import_styled_components21.default.div.withConfig({
1807
+ componentId: "ccl__sc-1xmkkqt-0"
1808
+ })(["display:inline-flex;align-items:center;background-color:var(--charcoal-surface3);border-radius:16px;"]);
1809
+ var SegmentedRoot = import_styled_components21.default.label.withConfig({
1810
+ componentId: "ccl__sc-1xmkkqt-1"
1811
+ })(["position:relative;display:flex;align-items:center;cursor:pointer;height:32px;padding-right:16px;padding-left:16px;border-radius:16px;&:disabled,&[aria-disabled]:not([aria-disabled='false']){cursor:default;opacity:0.32;}color:var(--charcoal-text2);", ""], ({
1812
+ checked = false
1813
+ }) => checked && (0, import_styled_components21.css)(["background-color:var(--charcoal-brand);color:var(--charcoal-text5);"]));
1814
+ var SegmentedInput = import_styled_components21.default.input.withConfig({
1815
+ componentId: "ccl__sc-1xmkkqt-2"
1816
+ })(["position:absolute;height:0px;width:0px;padding:0;margin:0;appearance:none;box-sizing:border-box;overflow:hidden;white-space:nowrap;opacity:0;"]);
1817
+ var RadioLabel2 = import_styled_components21.default.div.withConfig({
1818
+ componentId: "ccl__sc-1xmkkqt-3"
1819
+ })(["background:transparent;display:flex;align-items:center;height:22px;"]);
1820
+ var SegmentedLabelInner = import_styled_components21.default.div.withConfig({
1821
+ componentId: "ccl__sc-1xmkkqt-4"
1822
+ })(["font-size:14px;line-height:22px;display:flow-root;&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
2894
1823
 
2895
1824
  // src/components/Checkbox/index.tsx
2896
1825
  var import_react28 = require("react");
2897
1826
  var import_styled_components22 = __toESM(require("styled-components"));
2898
1827
  var import_checkbox = require("@react-aria/checkbox");
2899
- var import_utils10 = require("@react-aria/utils");
1828
+ var import_utils12 = require("@react-aria/utils");
2900
1829
  var import_react_stately2 = require("react-stately");
2901
- var import_utils11 = require("@charcoal-ui/utils");
2902
1830
  var import_styled9 = require("@charcoal-ui/styled");
2903
1831
  var import_jsx_runtime27 = require("react/jsx-runtime");
2904
- var Checkbox = (0, import_react28.forwardRef)(
2905
- function CheckboxInner({ invalid = false, ...props }, ref) {
2906
- const ariaCheckboxProps = (0, import_react28.useMemo)(
2907
- () => ({
2908
- ...props,
2909
- isInValid: invalid,
2910
- isSelected: props.checked,
2911
- defaultSelected: props.defaultChecked,
2912
- validationState: invalid ? "invalid" : "valid",
2913
- "aria-label": "children" in props ? void 0 : props.label,
2914
- isDisabled: props.disabled
2915
- }),
2916
- [invalid, props]
2917
- );
2918
- const state = (0, import_react_stately2.useToggleState)(ariaCheckboxProps);
2919
- const objectRef = (0, import_utils10.useObjectRef)(ref);
2920
- const { inputProps } = (0, import_checkbox.useCheckbox)(ariaCheckboxProps, state, objectRef);
2921
- const isDisabled = (props.disabled ?? false) || (props.readonly ?? false);
2922
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
2923
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CheckboxRoot, { children: [
2924
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxInput, { type: "checkbox", ...inputProps }),
2925
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
2926
- ] }),
2927
- "children" in props && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InputLabel, { children: props.children })
2928
- ] });
2929
- }
2930
- );
1832
+ var Checkbox = (0, import_react28.forwardRef)(function CheckboxInner({
1833
+ invalid = false,
1834
+ ...props
1835
+ }, ref) {
1836
+ const ariaCheckboxProps = (0, import_react28.useMemo)(() => ({
1837
+ ...props,
1838
+ isInValid: invalid,
1839
+ isSelected: props.checked,
1840
+ defaultSelected: props.defaultChecked,
1841
+ validationState: invalid ? "invalid" : "valid",
1842
+ "aria-label": "children" in props ? void 0 : props.label,
1843
+ isDisabled: props.disabled
1844
+ }), [invalid, props]);
1845
+ const state = (0, import_react_stately2.useToggleState)(ariaCheckboxProps);
1846
+ const objectRef = (0, import_utils12.useObjectRef)(ref);
1847
+ const {
1848
+ inputProps
1849
+ } = (0, import_checkbox.useCheckbox)(ariaCheckboxProps, state, objectRef);
1850
+ const isDisabled = (props.disabled ?? false) || (props.readonly ?? false);
1851
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
1852
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CheckboxRoot, { children: [
1853
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxInput, { type: "checkbox", ...inputProps, readOnly: props.readonly }),
1854
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
1855
+ ] }),
1856
+ "children" in props && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InputLabel, { children: props.children })
1857
+ ] });
1858
+ });
2931
1859
  var Checkbox_default = (0, import_react28.memo)(Checkbox);
2932
- var hiddenCss = import_styled_components22.css`
2933
- visibility: hidden;
2934
- `;
2935
- var InputRoot = import_styled_components22.default.label`
2936
- position: relative;
2937
- display: flex;
2938
-
2939
- cursor: pointer;
2940
- ${import_utils11.disabledSelector} {
2941
- cursor: default;
2942
- }
2943
-
2944
- gap: 4px;
2945
- &:disabled,
2946
- &[aria-disabled]:not([aria-disabled='false']) {
2947
- opacity: 0.32;
2948
- }
2949
- `;
2950
- var CheckboxRoot = import_styled_components22.default.div`
2951
- position: relative;
2952
- `;
2953
- var CheckboxInput = import_styled_components22.default.input`
2954
- &[type='checkbox'] {
2955
- appearance: none;
2956
- display: block;
2957
- cursor: pointer;
2958
- margin: 0;
2959
- width: 20px;
2960
- height: 20px;
2961
- border-radius: 4px;
2962
- transition: 0.2s box-shadow, 0.2s background-color;
2963
-
2964
- &:checked {
2965
- background-color: var(--charcoal-brand);
2966
-
2967
- &:not(:disabled):not([aria-disabled]),
2968
- &[aria-disabled='false'] {
2969
- &:hover {
2970
- background-color: var(--charcoal-brand-hover);
2971
- }
2972
- &:active {
2973
- background-color: var(--charcoal-brand-press);
2974
- }
2975
- }
2976
- }
2977
-
2978
- &:not(:disabled):not([aria-disabled]),
2979
- &[aria-disabled='false'] {
2980
- ${import_styled9.focusVisibleFocusRingCss}
2981
- &[aria-invalid='true'] {
2982
- box-shadow: 0 0 0 4px rgba(255, 43, 0, 0.32);
2983
- }
2984
- }
2985
-
2986
- &:not(:checked) {
2987
- border-width: 2px;
2988
- border-style: solid;
2989
- border-color: var(--charcoal-text4);
2990
- }
2991
- }
2992
- `;
2993
- var CheckboxInputOverlay = import_styled_components22.default.div`
2994
- position: absolute;
2995
- top: -2px;
2996
- left: -2px;
2997
- box-sizing: border-box;
2998
- display: flex;
2999
- align-items: center;
3000
- justify-content: center;
3001
- width: 24px;
3002
- height: 24px;
3003
- color: var(--charcoal-text5);
3004
-
3005
- ${({ checked }) => checked !== true && hiddenCss};
3006
- `;
3007
- var InputLabel = import_styled_components22.default.div`
3008
- color: var(--charcoal-text2);
3009
- font-size: 14px;
3010
- /** checkbox の height が 20px なのでcheckbox と text が揃っているように見せるために行ボックスの高さを 20px にしている */
3011
- line-height: 20px;
3012
- `;
1860
+ var hiddenCss = (0, import_styled_components22.css)(["visibility:hidden;"]);
1861
+ var InputRoot = import_styled_components22.default.label.withConfig({
1862
+ componentId: "ccl__sc-wrdmwj-0"
1863
+ })(["position:relative;display:flex;cursor:pointer;gap:4px;&:disabled,&[aria-disabled]:not([aria-disabled='false']){cursor:default;opacity:0.32;}"]);
1864
+ var CheckboxRoot = import_styled_components22.default.div.withConfig({
1865
+ componentId: "ccl__sc-wrdmwj-1"
1866
+ })(["position:relative;"]);
1867
+ var CheckboxInput = import_styled_components22.default.input.withConfig({
1868
+ componentId: "ccl__sc-wrdmwj-2"
1869
+ })(["&[type='checkbox']{appearance:none;display:block;cursor:pointer;margin:0;width:20px;height:20px;border-radius:4px;transition:0.2s box-shadow,0.2s background-color;&:disabled{cursor:default;}&:read-only{cursor:default;}&:checked{background-color:var(--charcoal-brand);&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{&:hover{background-color:var(--charcoal-brand-hover);}&:active{background-color:var(--charcoal-brand-press);}}}&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{", " &[aria-invalid='true']{box-shadow:0 0 0 4px rgba(255,43,0,0.32);}}&:not(:checked){border-width:2px;border-style:solid;border-color:var(--charcoal-text4);}}"], import_styled9.focusVisibleFocusRingCss);
1870
+ var CheckboxInputOverlay = import_styled_components22.default.div.withConfig({
1871
+ componentId: "ccl__sc-wrdmwj-3"
1872
+ })(["position:absolute;top:-2px;left:-2px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--charcoal-text5);", ";"], ({
1873
+ checked
1874
+ }) => checked !== true && hiddenCss);
1875
+ var InputLabel = import_styled_components22.default.div.withConfig({
1876
+ componentId: "ccl__sc-wrdmwj-4"
1877
+ })(["color:var(--charcoal-text2);font-size:14px;line-height:20px;"]);
3013
1878
 
3014
1879
  // src/components/TagItem/index.tsx
3015
1880
  var import_react29 = require("react");
3016
- var import_utils12 = require("@react-aria/utils");
1881
+ var import_utils13 = require("@react-aria/utils");
3017
1882
  var import_styled_components23 = __toESM(require("styled-components"));
3018
- var import_utils13 = require("@charcoal-ui/utils");
1883
+ var import_utils14 = require("@charcoal-ui/utils");
3019
1884
  var import_button = require("@react-aria/button");
3020
1885
  var import_styled10 = require("@charcoal-ui/styled");
3021
1886
  var import_jsx_runtime28 = require("react/jsx-runtime");
@@ -3023,188 +1888,98 @@ var sizeMap = {
3023
1888
  S: 32,
3024
1889
  M: 40
3025
1890
  };
3026
- var TagItem = (0, import_react29.forwardRef)(
3027
- function TagItemInner({
3028
- label,
3029
- translatedLabel,
3030
- bgColor = "#7ACCB1",
3031
- bgImage,
3032
- size = "M",
3033
- disabled,
3034
- status = "default",
3035
- className,
1891
+ var TagItem = (0, import_react29.forwardRef)(function TagItemInner({
1892
+ label,
1893
+ translatedLabel,
1894
+ bgColor = "#7ACCB1",
1895
+ bgImage,
1896
+ size = "M",
1897
+ disabled,
1898
+ status = "default",
1899
+ className,
1900
+ ...props
1901
+ }, _ref) {
1902
+ const ref = (0, import_utils13.useObjectRef)(_ref);
1903
+ const ariaButtonProps = (0, import_react29.useMemo)(() => ({
1904
+ elementType: "a",
1905
+ isDisabled: disabled,
3036
1906
  ...props
3037
- }, _ref) {
3038
- const ref = (0, import_utils12.useObjectRef)(_ref);
3039
- const ariaButtonProps = (0, import_react29.useMemo)(
3040
- () => ({
3041
- elementType: "a",
3042
- isDisabled: disabled,
3043
- ...props
3044
- }),
3045
- [disabled, props]
3046
- );
3047
- const { buttonProps } = (0, import_button.useButton)(ariaButtonProps, ref);
3048
- const hasTranslatedLabel = translatedLabel !== void 0 && translatedLabel.length > 0;
3049
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3050
- TagItemRoot,
3051
- {
3052
- ref,
3053
- size: hasTranslatedLabel ? "M" : size,
3054
- status,
3055
- ...buttonProps,
3056
- className,
3057
- children: [
3058
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Background, { bgColor, bgImage, status }),
3059
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Inner, { children: [
3060
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(LabelWrapper, { isTranslate: hasTranslatedLabel, children: [
3061
- hasTranslatedLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslatedLabel, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Label3, { children: translatedLabel }) }),
3062
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Label3, { children: label })
3063
- ] }),
3064
- status === "active" && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "16/Remove" })
3065
- ] })
3066
- ]
3067
- }
3068
- );
3069
- }
3070
- );
1907
+ }), [disabled, props]);
1908
+ const {
1909
+ buttonProps
1910
+ } = (0, import_button.useButton)(ariaButtonProps, ref);
1911
+ const hasTranslatedLabel = translatedLabel !== void 0 && translatedLabel.length > 0;
1912
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TagItemRoot, { ref, size: hasTranslatedLabel ? "M" : size, status, ...buttonProps, className, children: [
1913
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Background, { bgColor, bgImage, status }),
1914
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Inner, { children: [
1915
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(LabelWrapper, { isTranslate: hasTranslatedLabel, children: [
1916
+ hasTranslatedLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslatedLabel, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Label3, { children: translatedLabel }) }),
1917
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Label3, { children: label })
1918
+ ] }),
1919
+ status === "active" && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "16/Remove" })
1920
+ ] })
1921
+ ] });
1922
+ });
3071
1923
  var TagItem_default = (0, import_react29.memo)(TagItem);
3072
- var horizontalPadding = ({ left, right }) => import_styled_components23.css`
3073
- padding-right: ${(0, import_utils13.px)(right)};
3074
- padding-left: ${(0, import_utils13.px)(left)};
3075
- `;
1924
+ var horizontalPadding = ({
1925
+ left,
1926
+ right
1927
+ }) => (0, import_styled_components23.css)(["padding-right:", ";padding-left:", ";"], (0, import_utils14.px)(right), (0, import_utils14.px)(left));
3076
1928
  var tagItemRootSize = (size) => {
3077
1929
  switch (size) {
3078
1930
  case "M":
3079
- return horizontalPadding({ left: 24, right: 24 });
1931
+ return horizontalPadding({
1932
+ left: 24,
1933
+ right: 24
1934
+ });
3080
1935
  case "S":
3081
- return horizontalPadding({ left: 16, right: 16 });
1936
+ return horizontalPadding({
1937
+ left: 16,
1938
+ right: 16
1939
+ });
3082
1940
  }
3083
1941
  };
3084
- var activeTagItemRoot = horizontalPadding({ left: 16, right: 8 });
3085
- var TagItemRoot = import_styled_components23.default.a`
3086
- isolation: isolate;
3087
- position: relative;
3088
- height: ${({ size }) => sizeMap[size]}px;
3089
- display: inline-flex;
3090
- align-items: center;
3091
- justify-content: center;
3092
- text-decoration: none;
3093
- cursor: pointer;
3094
- overflow: hidden;
3095
- border-radius: 4px;
3096
- ${({ size, status }) => status !== "active" && tagItemRootSize(size)}
3097
- ${({ status }) => status === "active" && activeTagItemRoot}
3098
- color: ${({ status }) => status === "inactive" ? "var(--charcoal-text2)" : "var(--charcoal-text5)"};
3099
-
3100
- transition: 0.2s box-shadow;
3101
-
3102
- &:not(:disabled):not([aria-disabled]),
3103
- &[aria-disabled='false'] {
3104
- ${import_styled10.focusVisibleFocusRingCss}
3105
- }
3106
-
3107
- &:disabled,
3108
- &[aria-disabled]:not([aria-disabled='false']) {
3109
- opacity: 0.32;
3110
- cursor: default;
3111
- }
3112
- `;
3113
- var Background = import_styled_components23.default.div`
3114
- position: absolute;
3115
- z-index: 1;
3116
- top: 0;
3117
- left: 0;
3118
- width: 100%;
3119
- height: 100%;
3120
-
3121
- background-color: ${({ bgColor }) => bgColor};
3122
- ${({ status }) => status === "inactive" && import_styled_components23.css`
3123
- background-color: var(--charcoal-surface3);
3124
- `}
3125
-
3126
- ${({ bgImage }) => bgImage !== void 0 && import_styled_components23.css`
3127
- background-color: var(--charcoal-surface4);
3128
-
3129
- &::before {
3130
- content: '';
3131
- position: absolute;
3132
- top: 0;
3133
- left: 0;
3134
- width: 100%;
3135
- height: 100%;
3136
- background-position: center;
3137
- background-size: cover;
3138
- background-image: url(${bgImage});
3139
- mix-blend-mode: overlay;
3140
- }
3141
- `}
3142
- `;
3143
- var Inner = import_styled_components23.default.div`
3144
- display: inline-flex;
3145
- gap: 8px;
3146
- align-items: center;
3147
- z-index: 2;
3148
- `;
3149
- var labelCSS = import_styled_components23.css`
3150
- font-size: 14px;
3151
- line-height: 22px;
3152
- font-weight: bold;
3153
- display: flow-root;
3154
-
3155
- &::before {
3156
- display: block;
3157
- width: 0;
3158
- height: 0;
3159
- content: '';
3160
- margin-top: -4px;
3161
- }
3162
- &::after {
3163
- display: block;
3164
- width: 0;
3165
- height: 0;
3166
- content: '';
3167
- margin-bottom: -4px;
3168
- }
3169
- `;
3170
- var translateLabelCSS = import_styled_components23.css`
3171
- display: flex;
3172
- align-items: center;
3173
- flex-direction: column;
3174
- font-size: 10px;
3175
- `;
3176
- var LabelWrapper = import_styled_components23.default.div`
3177
- ${({ isTranslate }) => isTranslate ?? false ? translateLabelCSS : labelCSS}
3178
- `;
3179
- var Label3 = import_styled_components23.default.span`
3180
- max-width: 152px;
3181
- overflow: hidden;
3182
- text-overflow: ellipsis;
3183
- white-space: nowrap;
3184
- font-size: inherit;
3185
- color: inherit;
3186
- line-height: inherit;
3187
- `;
3188
- var TranslatedLabel = import_styled_components23.default.div`
3189
- font-size: 12px;
3190
- line-height: 20px;
3191
- font-weight: bold;
3192
- display: flow-root;
3193
- &::before {
3194
- display: block;
3195
- width: 0;
3196
- height: 0;
3197
- content: '';
3198
- margin-top: -4px;
3199
- }
3200
- &::after {
3201
- display: block;
3202
- width: 0;
3203
- height: 0;
3204
- content: '';
3205
- margin-bottom: -4px;
3206
- }
3207
- `;
1942
+ var activeTagItemRoot = horizontalPadding({
1943
+ left: 16,
1944
+ right: 8
1945
+ });
1946
+ var TagItemRoot = import_styled_components23.default.a.withConfig({
1947
+ componentId: "ccl__sc-11j9pu2-0"
1948
+ })(["isolation:isolate;position:relative;height:", "px;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;cursor:pointer;overflow:hidden;border-radius:4px;", " ", " color:", ";transition:0.2s box-shadow;&:not(:disabled):not([aria-disabled]),&[aria-disabled='false']{", "}&:disabled,&[aria-disabled]:not([aria-disabled='false']){opacity:0.32;cursor:default;}"], ({
1949
+ size
1950
+ }) => sizeMap[size], ({
1951
+ size,
1952
+ status
1953
+ }) => status !== "active" && tagItemRootSize(size), ({
1954
+ status
1955
+ }) => status === "active" && activeTagItemRoot, ({
1956
+ status
1957
+ }) => status === "inactive" ? "var(--charcoal-text2)" : "var(--charcoal-text5)", import_styled10.focusVisibleFocusRingCss);
1958
+ var Background = import_styled_components23.default.div.withConfig({
1959
+ componentId: "ccl__sc-11j9pu2-1"
1960
+ })(["position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background-color:", ";", " ", ""], ({
1961
+ bgColor
1962
+ }) => bgColor, ({
1963
+ status
1964
+ }) => status === "inactive" && (0, import_styled_components23.css)(["background-color:var(--charcoal-surface3);"]), ({
1965
+ bgImage
1966
+ }) => bgImage !== void 0 && (0, import_styled_components23.css)(["background-color:var(--charcoal-surface4);&::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-size:cover;background-image:url(", ");mix-blend-mode:overlay;}"], bgImage));
1967
+ var Inner = import_styled_components23.default.div.withConfig({
1968
+ componentId: "ccl__sc-11j9pu2-2"
1969
+ })(["display:inline-flex;gap:8px;align-items:center;z-index:2;"]);
1970
+ var labelCSS = (0, import_styled_components23.css)(["font-size:14px;line-height:22px;font-weight:bold;display:flow-root;&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
1971
+ var translateLabelCSS = (0, import_styled_components23.css)(["display:flex;align-items:center;flex-direction:column;font-size:10px;"]);
1972
+ var LabelWrapper = import_styled_components23.default.div.withConfig({
1973
+ componentId: "ccl__sc-11j9pu2-3"
1974
+ })(["", ""], ({
1975
+ isTranslate
1976
+ }) => isTranslate ?? false ? translateLabelCSS : labelCSS);
1977
+ var Label3 = import_styled_components23.default.span.withConfig({
1978
+ componentId: "ccl__sc-11j9pu2-4"
1979
+ })(["max-width:152px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:inherit;color:inherit;line-height:inherit;"]);
1980
+ var TranslatedLabel = import_styled_components23.default.div.withConfig({
1981
+ componentId: "ccl__sc-11j9pu2-5"
1982
+ })(["font-size:12px;line-height:20px;font-weight:bold;display:flow-root;&::before{display:block;width:0;height:0;content:'';margin-top:-4px;}&::after{display:block;width:0;height:0;content:'';margin-bottom:-4px;}"]);
3208
1983
  // Annotate the CommonJS export names for ESM import in node:
3209
1984
  0 && (module.exports = {
3210
1985
  Button,