@charcoal-ui/react 3.8.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) 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/useCustomModalOverlay.d.ts +12 -0
  4. package/dist/components/Modal/useCustomModalOverlay.d.ts.map +1 -0
  5. package/dist/components/Radio/index.d.ts.map +1 -1
  6. package/dist/components/TextArea/index.d.ts.map +1 -1
  7. package/dist/components/TextField/TextField.story.d.ts +1 -0
  8. package/dist/components/TextField/TextField.story.d.ts.map +1 -1
  9. package/dist/components/TextField/index.d.ts.map +1 -1
  10. package/dist/index.cjs.js +996 -2224
  11. package/dist/index.cjs.js.map +1 -1
  12. package/dist/index.esm.js +990 -2224
  13. package/dist/index.esm.js.map +1 -1
  14. package/package.json +7 -6
  15. package/src/components/Checkbox/__snapshots__/index.story.storyshot +43 -15
  16. package/src/components/Checkbox/index.tsx +13 -5
  17. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +3 -0
  18. package/src/components/IconButton/__snapshots__/index.story.storyshot +5 -0
  19. package/src/components/IconButton/index.tsx +4 -1
  20. package/src/components/Modal/__snapshots__/index.story.storyshot +12 -0
  21. package/src/components/Modal/index.tsx +15 -20
  22. package/src/components/Modal/useCustomModalOverlay.tsx +42 -0
  23. package/src/components/Radio/__snapshots__/index.story.storyshot +25 -5
  24. package/src/components/Radio/index.tsx +5 -1
  25. package/src/components/TextArea/index.tsx +22 -14
  26. package/src/components/TextField/TextField.story.tsx +20 -0
  27. package/src/components/TextField/__snapshots__/TextField.story.storyshot +277 -0
  28. 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,48 @@ 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.useOverlayFocusContain)();
954
+ React9.useEffect(() => {
955
+ if (state.isOpen && ref.current) {
956
+ return (0, import_overlays2.ariaHideOutside)([ref.current]);
957
+ }
958
+ }, [state.isOpen, ref]);
959
+ return {
960
+ modalProps: overlayProps,
961
+ underlayProps
962
+ };
963
+ }
1671
964
 
1672
965
  // src/components/Modal/index.tsx
1673
966
  var import_jsx_runtime14 = require("react/jsx-runtime");
1674
967
  var DEFAULT_Z_INDEX = 10;
1675
- var Modal = (0, import_react12.forwardRef)(function ModalInner({ children, zIndex = DEFAULT_Z_INDEX, portalContainer, ...props }, external) {
968
+ var Modal = (0, import_react12.forwardRef)(function ModalInner({
969
+ children,
970
+ zIndex = DEFAULT_Z_INDEX,
971
+ portalContainer,
972
+ ...props
973
+ }, external) {
1676
974
  const {
1677
975
  title,
1678
976
  size = "M",
@@ -1682,26 +980,19 @@ var Modal = (0, import_react12.forwardRef)(function ModalInner({ children, zInde
1682
980
  className,
1683
981
  isOpen = false
1684
982
  } = 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
- );
983
+ const ref = (0, import_utils8.useObjectRef)(external);
984
+ const {
985
+ modalProps,
986
+ underlayProps
987
+ } = useCharcoalModalOverlay({
988
+ ...props,
989
+ isKeyboardDismissDisabled: isDismissable === void 0 || isDismissable === false
990
+ }, {
991
+ onClose,
992
+ isOpen
993
+ }, ref);
1703
994
  const theme = (0, import_styled_components12.useTheme)();
1704
- const isMobile = (0, import_styled7.useMedia)((0, import_utils5.maxWidth)(theme.breakpoint.screen1)) ?? false;
995
+ const isMobile = (0, import_styled7.useMedia)((0, import_utils7.maxWidth)(theme.breakpoint.screen1)) ?? false;
1705
996
  const transitionEnabled = isMobile && bottomSheet !== false;
1706
997
  const showDismiss = !isMobile || bottomSheet !== true;
1707
998
  const transition = (0, import_react_spring2.useTransition)(isOpen, {
@@ -1722,256 +1013,149 @@ var Modal = (0, import_react12.forwardRef)(function ModalInner({ children, zInde
1722
1013
  backgroundColor: "rgba(0, 0, 0, 0)",
1723
1014
  overflow: "hidden"
1724
1015
  },
1725
- config: transitionEnabled ? { duration: 400, easing: import_react_spring2.easings.easeOutQuart } : { duration: 0 }
1016
+ config: transitionEnabled ? {
1017
+ duration: 400,
1018
+ easing: import_react_spring2.easings.easeOutQuart
1019
+ } : {
1020
+ duration: 0
1021
+ }
1726
1022
  });
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
- );
1023
+ const bgRef = React10.useRef(null);
1024
+ const handleClick = React10.useCallback((e) => {
1025
+ if (e.currentTarget === e.target) {
1026
+ onClose();
1027
+ }
1028
+ }, [onClose]);
1029
+ return transition(({
1030
+ backgroundColor,
1031
+ overflow,
1032
+ transform
1033
+ }, 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 ? {
1034
+ backgroundColor,
1035
+ overflow
1036
+ } : {}, $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 ? {
1037
+ transform
1038
+ } : {}, size, bottomSheet, className, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(ModalContext.Provider, { value: {
1039
+ titleProps: {},
1040
+ title,
1041
+ close: onClose,
1042
+ showDismiss,
1043
+ bottomSheet
1044
+ }, children: [
1045
+ children,
1046
+ isDismissable === true && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalCrossButton, { size: "S", icon: "24/Close", onClick: onClose })
1047
+ ] }) }) }) }) }));
1774
1048
  });
1775
1049
  var Modal_default = (0, import_react12.memo)(Modal);
1776
- var ModalContext = React9.createContext({
1050
+ var ModalContext = React10.createContext({
1777
1051
  titleProps: {},
1778
1052
  title: "",
1779
1053
  close: void 0,
1780
1054
  showDismiss: true,
1781
1055
  bottomSheet: false
1782
1056
  });
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
- `;
1057
+ var ModalBackground = (0, import_react_spring2.animated)(import_styled_components12.default.div.withConfig({
1058
+ componentId: "ccl__sc-h2bc55-0"
1059
+ })(["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 ", "{", "}"], ({
1060
+ zIndex
1061
+ }) => zIndex, ({
1062
+ theme
1063
+ }) => (0, import_utils7.maxWidth)(theme.breakpoint.screen1), (p) => p.$bottomSheet !== false && (0, import_styled_components12.css)(["padding:0;"])));
1064
+ var ModalCrossButton = (0, import_styled_components12.default)(IconButton_default).withConfig({
1065
+ componentId: "ccl__sc-h2bc55-1"
1066
+ })(["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
1067
  function ModalTitle(props) {
1824
- const { titleProps, title } = (0, import_react12.useContext)(ModalContext);
1068
+ const {
1069
+ titleProps,
1070
+ title
1071
+ } = (0, import_react12.useContext)(ModalContext);
1825
1072
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ModalHeading, { ...titleProps, ...props, children: title });
1826
1073
  }
1827
- var ModalHeading = import_styled_components12.default.h3`
1828
- margin: 0;
1829
- font-weight: inherit;
1830
- font-size: inherit;
1831
- `;
1074
+ var ModalHeading = import_styled_components12.default.h3.withConfig({
1075
+ componentId: "ccl__sc-h2bc55-2"
1076
+ })(["margin:0;font-weight:inherit;font-size:inherit;"]);
1832
1077
 
1833
1078
  // src/components/Modal/ModalPlumbing.tsx
1834
1079
  var import_styled_components13 = __toESM(require("styled-components"));
1835
1080
  var import_react13 = require("react");
1836
- var import_utils7 = require("@charcoal-ui/utils");
1081
+ var import_utils9 = require("@charcoal-ui/utils");
1837
1082
  var import_jsx_runtime15 = require("react/jsx-runtime");
1838
1083
  function ModalHeader() {
1839
1084
  const modalCtx = (0, import_react13.useContext)(ModalContext);
1840
1085
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ModalHeaderRoot, { $bottomSheet: modalCtx.bottomSheet, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StyledModalTitle, {}) });
1841
1086
  }
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
- `;
1087
+ var ModalHeaderRoot = import_styled_components13.default.div.withConfig({
1088
+ componentId: "ccl__sc-1k33wze-0"
1089
+ })(["height:64px;display:grid;align-content:center;justify-content:center;@media ", "{", "}"], ({
1090
+ theme
1091
+ }) => (0, import_utils9.maxWidth)(theme.breakpoint.screen1), (p) => p.$bottomSheet !== false && (0, import_styled_components13.css)(["height:48px;"]));
1092
+ var StyledModalTitle = (0, import_styled_components13.default)(ModalTitle).withConfig({
1093
+ componentId: "ccl__sc-1k33wze-1"
1094
+ })(["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;}"]);
1095
+ var ModalAlign = import_styled_components13.default.div.withConfig({
1096
+ componentId: "ccl__sc-1k33wze-2"
1097
+ })(["padding-left:16px;padding-right:16px;"]);
1098
+ var ModalBody = import_styled_components13.default.div.withConfig({
1099
+ componentId: "ccl__sc-1k33wze-3"
1100
+ })(["padding-bottom:40px;"]);
1101
+ var ModalButtons = import_styled_components13.default.div.withConfig({
1102
+ componentId: "ccl__sc-1k33wze-4"
1103
+ })(["display:grid;grid-auto-flow:row;grid-row-gap:8px;padding-top:16px;padding-left:16px;padding-right:16px;"]);
1891
1104
 
1892
1105
  // src/components/LoadingSpinner/index.tsx
1893
1106
  var import_react14 = require("react");
1894
1107
  var import_styled_components14 = __toESM(require("styled-components"));
1895
1108
  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
- );
1109
+ var LoadingSpinner = (0, import_react14.forwardRef)(function LoadingSpinnerInner({
1110
+ size = 48,
1111
+ padding = 16,
1112
+ transparent = false,
1113
+ className
1114
+ }, ref) {
1115
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerRoot, { size, padding, transparent, className, ref, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingSpinnerIcon, {}) });
1116
+ });
1911
1117
  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;
1118
+ var LoadingSpinnerRoot = import_styled_components14.default.div.attrs({
1119
+ role: "progressbar"
1120
+ }).withConfig({
1121
+ componentId: "ccl__sc-1id6yz4-0"
1122
+ })(["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, ({
1123
+ transparent
1124
+ }) => `var(--charcoal-${transparent ? "transparent" : "background1"})`);
1125
+ var scaleOut = (0, import_styled_components14.keyframes)(["from{transform:scale(0);opacity:1;}to{transform:scale(1);opacity:0;}"]);
1126
+ var Icon2 = import_styled_components14.default.div.attrs({
1127
+ role: "presentation"
1128
+ }).withConfig({
1129
+ componentId: "ccl__sc-1id6yz4-1"
1130
+ })(["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");
1131
+ var LoadingSpinnerIcon = (0, import_react14.forwardRef)(function LoadingSpinnerIcon2({
1132
+ once = false
1133
+ }, ref) {
1134
+ const iconRef = (0, import_react14.useRef)(null);
1135
+ (0, import_react14.useImperativeHandle)(ref, () => ({
1136
+ restart: () => {
1137
+ if (!iconRef.current) {
1138
+ return;
1958
1139
  }
1959
- }));
1960
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon2, { ref: iconRef, once });
1961
- }
1962
- );
1140
+ iconRef.current.dataset.resetAnimation = "true";
1141
+ void iconRef.current.offsetWidth;
1142
+ delete iconRef.current.dataset.resetAnimation;
1143
+ }
1144
+ }));
1145
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon2, { ref: iconRef, once });
1146
+ });
1963
1147
 
1964
1148
  // src/components/DropdownSelector/index.tsx
1965
1149
  var import_react20 = require("react");
1966
1150
  var import_styled_components17 = __toESM(require("styled-components"));
1967
- var import_utils8 = require("@charcoal-ui/utils");
1151
+ var import_utils10 = require("@charcoal-ui/utils");
1968
1152
 
1969
1153
  // src/components/DropdownSelector/DropdownPopover.tsx
1970
1154
  var import_react17 = require("react");
1971
1155
 
1972
1156
  // src/components/DropdownSelector/Popover/index.tsx
1973
1157
  var import_react16 = require("react");
1974
- var import_overlays3 = require("@react-aria/overlays");
1158
+ var import_overlays4 = require("@react-aria/overlays");
1975
1159
  var import_styled_components15 = __toESM(require("styled-components"));
1976
1160
 
1977
1161
  // src/components/DropdownSelector/Popover/usePreventScroll.tsx
@@ -1997,58 +1181,47 @@ var _empty = () => null;
1997
1181
  function Popover(props) {
1998
1182
  const defaultPopoverRef = (0, import_react16.useRef)(null);
1999
1183
  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
- );
1184
+ const {
1185
+ popoverProps,
1186
+ underlayProps
1187
+ } = (0, import_overlays4.usePopover)({
1188
+ triggerRef: props.triggerRef,
1189
+ popoverRef: finalPopoverRef,
1190
+ containerPadding: 16
1191
+ }, {
1192
+ close: props.onClose,
1193
+ isOpen: props.isOpen,
1194
+ open: _empty,
1195
+ setOpen: _empty,
1196
+ toggle: _empty
1197
+ });
2014
1198
  const modalBackground = (0, import_react16.useContext)(ModalBackgroundContext);
2015
1199
  usePreventScroll(modalBackground, props.isOpen);
2016
1200
  if (!props.isOpen)
2017
1201
  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
- ),
1202
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_overlays4.Overlay, { portalContainer: document.body, children: [
1203
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ...underlayProps, style: {
1204
+ position: "fixed",
1205
+ zIndex: typeof popoverProps.style?.zIndex === "number" ? popoverProps.style.zIndex - 1 : 99999,
1206
+ inset: 0
1207
+ } }),
2030
1208
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(DropdownPopoverDiv, { ...popoverProps, ref: finalPopoverRef, children: [
2031
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays3.DismissButton, { onDismiss: () => props.onClose() }),
1209
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays4.DismissButton, { onDismiss: () => props.onClose() }),
2032
1210
  props.children,
2033
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays3.DismissButton, { onDismiss: () => props.onClose() })
1211
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays4.DismissButton, { onDismiss: () => props.onClose() })
2034
1212
  ] })
2035
1213
  ] });
2036
1214
  }
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
- `;
1215
+ var DropdownPopoverDiv = import_styled_components15.default.div.withConfig({
1216
+ componentId: "ccl__sc-jwnoy6-0"
1217
+ })(["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
1218
 
2049
1219
  // src/components/DropdownSelector/DropdownPopover.tsx
2050
1220
  var import_jsx_runtime18 = require("react/jsx-runtime");
2051
- function DropdownPopover({ children, ...props }) {
1221
+ function DropdownPopover({
1222
+ children,
1223
+ ...props
1224
+ }) {
2052
1225
  const ref = (0, import_react17.useRef)(null);
2053
1226
  (0, import_react17.useEffect)(() => {
2054
1227
  if (props.isOpen && ref.current && props.triggerRef.current) {
@@ -2059,32 +1232,21 @@ function DropdownPopover({ children, ...props }) {
2059
1232
  if (props.isOpen && props.value !== void 0) {
2060
1233
  const windowScrollY = window.scrollY;
2061
1234
  const windowScrollX = window.scrollX;
2062
- const selectedElement = document.querySelector(
2063
- `[data-key="${props.value.toString()}"]`
2064
- );
1235
+ const selectedElement = document.querySelector(`[data-key="${props.value.toString()}"]`);
2065
1236
  selectedElement?.focus();
2066
1237
  window.scrollTo(windowScrollX, windowScrollY);
2067
1238
  }
2068
1239
  }, [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
- );
1240
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Popover, { isOpen: props.isOpen, onClose: props.onClose, popoverRef: ref, triggerRef: props.triggerRef, children });
2079
1241
  }
2080
1242
 
2081
1243
  // src/components/DropdownSelector/utils/findPreviewRecursive.tsx
2082
- var React10 = __toESM(require("react"));
1244
+ var React11 = __toESM(require("react"));
2083
1245
  function findPreviewRecursive(children, value) {
2084
- const childArray = React10.Children.toArray(children);
1246
+ const childArray = React11.Children.toArray(children);
2085
1247
  for (let i = 0; i < childArray.length; i++) {
2086
1248
  const child = childArray[i];
2087
- if (React10.isValidElement(child)) {
1249
+ if (React11.isValidElement(child)) {
2088
1250
  if ("value" in child.props) {
2089
1251
  const childValue = child.props.value;
2090
1252
  if (childValue === value && "children" in child.props) {
@@ -2093,10 +1255,7 @@ function findPreviewRecursive(children, value) {
2093
1255
  }
2094
1256
  }
2095
1257
  if ("children" in child.props) {
2096
- const children2 = findPreviewRecursive(
2097
- child.props.children,
2098
- value
2099
- );
1258
+ const children2 = findPreviewRecursive(child.props.children, value);
2100
1259
  if (children2 !== void 0) {
2101
1260
  return children2;
2102
1261
  }
@@ -2120,12 +1279,12 @@ var MenuListContext = (0, import_react18.createContext)({
2120
1279
  });
2121
1280
 
2122
1281
  // src/components/DropdownSelector/MenuList/internals/getValuesRecursive.tsx
2123
- var React11 = __toESM(require("react"));
1282
+ var React12 = __toESM(require("react"));
2124
1283
  function getValuesRecursive(children, values = []) {
2125
- const childArray = React11.Children.toArray(children);
1284
+ const childArray = React12.Children.toArray(children);
2126
1285
  for (let i = 0; i < childArray.length; i++) {
2127
1286
  const child = childArray[i];
2128
- if (React11.isValidElement(child)) {
1287
+ if (React12.isValidElement(child)) {
2129
1288
  const props = child.props;
2130
1289
  if ("value" in props && typeof props.value === "string") {
2131
1290
  const childValue = props.value;
@@ -2144,25 +1303,18 @@ function MenuList(props) {
2144
1303
  const root = (0, import_react19.useRef)(null);
2145
1304
  const values = [];
2146
1305
  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
1306
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StyledUl, { ref: root, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MenuListContext.Provider, { value: {
1307
+ value: props.value ?? "",
1308
+ root,
1309
+ values,
1310
+ setValue: (v) => {
1311
+ props.onChange?.(v);
2159
1312
  }
2160
- ) });
1313
+ }, children: props.children }) });
2161
1314
  }
2162
- var StyledUl = import_styled_components16.default.ul`
2163
- padding: 0;
2164
- margin: 0;
2165
- `;
1315
+ var StyledUl = import_styled_components16.default.ul.withConfig({
1316
+ componentId: "ccl__sc-1y72v02-0"
1317
+ })(["padding:0;margin:0;"]);
2166
1318
 
2167
1319
  // src/components/DropdownSelector/index.tsx
2168
1320
  var import_styled8 = require("@charcoal-ui/styled");
@@ -2173,153 +1325,46 @@ function DropdownSelector(props) {
2173
1325
  const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
2174
1326
  const preview = findPreviewRecursive(props.children, props.value);
2175
1327
  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
- ),
1328
+ props.showLabel === true && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownFieldLabel, { label: props.label, required: props.required, requiredText: props.requiredText ?? defaultRequiredText, subLabel: props.subLabel }),
1329
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DropdownButton, { invalid: props.invalid, disabled: props.disabled, onClick: () => {
1330
+ if (props.disabled === true)
1331
+ return;
1332
+ setIsOpen(true);
1333
+ }, ref: triggerRef, type: "button", $active: isOpen, children: [
1334
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownButtonText, { children: props.placeholder !== void 0 && preview === void 0 ? props.placeholder : preview }),
1335
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DropdownButtonIcon, { name: "16/Menu" })
1336
+ ] }),
1337
+ 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) => {
1338
+ props.onChange(v);
1339
+ setIsOpen(false);
1340
+ }, children: props.children }) }),
2224
1341
  props.assistiveText !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
2225
1342
  ] });
2226
1343
  }
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
- `;
1344
+ var DropdownSelectorRoot = import_styled_components17.default.div.withConfig({
1345
+ componentId: "ccl__sc-1vnxmc8-0"
1346
+ })(["display:inline-block;width:100%;", "{cursor:default;opacity:0.32;}"], import_utils10.disabledSelector);
1347
+ var DropdownFieldLabel = (0, import_styled_components17.default)(FieldLabel_default).withConfig({
1348
+ componentId: "ccl__sc-1vnxmc8-1"
1349
+ })(["width:100%;margin-bottom:8px;"]);
1350
+ var DropdownButton = import_styled_components17.default.button.withConfig({
1351
+ componentId: "ccl__sc-1vnxmc8-2"
1352
+ })(["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, ({
1353
+ $active
1354
+ }) => $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);}"]), ({
1355
+ invalid
1356
+ }) => 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);}"]));
1357
+ var DropdownButtonText = import_styled_components17.default.span.withConfig({
1358
+ componentId: "ccl__sc-1vnxmc8-3"
1359
+ })(["text-align:left;font-size:14px;line-height:22px;display:flow-root;color:var(--charcoal-text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
1360
+ var DropdownButtonIcon = (0, import_styled_components17.default)(Icon_default).withConfig({
1361
+ componentId: "ccl__sc-1vnxmc8-4"
1362
+ })(["color:var(--charcoal-text2);"]);
1363
+ var AssertiveText = import_styled_components17.default.div.withConfig({
1364
+ componentId: "ccl__sc-1vnxmc8-5"
1365
+ })(["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;}", ""], ({
1366
+ invalid
1367
+ }) => invalid === true && (0, import_styled_components17.css)(["color:var(--charcoal-assertive);"]));
2323
1368
 
2324
1369
  // src/components/DropdownSelector/DropdownMenuItem.tsx
2325
1370
  var import_styled_components19 = __toESM(require("styled-components"));
@@ -2328,34 +1373,18 @@ var import_styled_components19 = __toESM(require("styled-components"));
2328
1373
  var import_styled_components18 = __toESM(require("styled-components"));
2329
1374
  var import_jsx_runtime21 = require("react/jsx-runtime");
2330
1375
  function ListItem(props) {
2331
- const { children, ...rest } = props;
1376
+ const {
1377
+ children,
1378
+ ...rest
1379
+ } = props;
2332
1380
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(StyledLi, { role: "option", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ItemDiv, { ...rest, children: props.children }) });
2333
1381
  }
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
- `;
1382
+ var StyledLi = import_styled_components18.default.li.withConfig({
1383
+ componentId: "ccl__sc-p1vs75-0"
1384
+ })(["list-style:none;"]);
1385
+ var ItemDiv = import_styled_components18.default.div.withConfig({
1386
+ componentId: "ccl__sc-p1vs75-1"
1387
+ })(["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
1388
 
2360
1389
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
2361
1390
  var import_react21 = require("react");
@@ -2391,84 +1420,77 @@ function scrollIfNeeded(element) {
2391
1420
 
2392
1421
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
2393
1422
  function useMenuItemHandleKeyDown(value) {
2394
- const { setValue, root, values } = (0, import_react21.useContext)(MenuListContext);
1423
+ const {
1424
+ setValue,
1425
+ root,
1426
+ values
1427
+ } = (0, import_react21.useContext)(MenuListContext);
2395
1428
  const setContextValue = (0, import_react21.useCallback)(() => {
2396
1429
  if (value !== void 0)
2397
1430
  setValue(value);
2398
1431
  }, [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
- }
1432
+ const handleKeyDown = (0, import_react21.useCallback)((e) => {
1433
+ if (e.key === "Enter") {
1434
+ setContextValue();
1435
+ } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
1436
+ e.preventDefault();
1437
+ if (!values || value === void 0)
1438
+ return;
1439
+ const index = values.indexOf(value);
1440
+ if (index === -1)
1441
+ return;
1442
+ const focusValue = e.key === "ArrowUp" ? index - 1 < 0 ? values[values.length - 1] : values[index - 1] : index + 1 >= values.length ? values[0] : values[index + 1];
1443
+ const next = root?.current?.querySelector(`[data-key='${focusValue}']`);
1444
+ if (next instanceof HTMLElement) {
1445
+ next.focus({
1446
+ preventScroll: true
1447
+ });
1448
+ if (root?.current?.parentElement) {
1449
+ handleFocusByKeyBoard(next, root.current.parentElement);
2417
1450
  }
2418
1451
  }
2419
- },
2420
- [setContextValue, value, root, values]
2421
- );
1452
+ }
1453
+ }, [setContextValue, value, root, values]);
2422
1454
  return [handleKeyDown, setContextValue];
2423
1455
  }
2424
1456
 
2425
1457
  // src/components/DropdownSelector/MenuItem/index.tsx
2426
1458
  var import_jsx_runtime22 = require("react/jsx-runtime");
2427
1459
  function MenuItem(props) {
2428
- const { children, as, ...rest } = props;
1460
+ const {
1461
+ children,
1462
+ as,
1463
+ ...rest
1464
+ } = props;
2429
1465
  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
- );
1466
+ 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
1467
  }
2444
1468
 
2445
1469
  // src/components/DropdownSelector/DropdownMenuItem.tsx
2446
1470
  var import_react22 = require("react");
2447
1471
  var import_jsx_runtime23 = require("react/jsx-runtime");
2448
1472
  function DropdownMenuItem(props) {
2449
- const { value: ctxValue } = (0, import_react22.useContext)(MenuListContext);
1473
+ const {
1474
+ value: ctxValue
1475
+ } = (0, import_react22.useContext)(MenuListContext);
2450
1476
  const isSelected = props.value === ctxValue;
2451
- const { children, ...rest } = props;
1477
+ const {
1478
+ children,
1479
+ ...rest
1480
+ } = props;
2452
1481
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(MenuItem, { ...rest, children: [
2453
1482
  isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text2ColorIcon, { name: "16/Check" }),
2454
1483
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StyledSpan, { isSelected, children: props.children })
2455
1484
  ] });
2456
1485
  }
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
- `;
1486
+ var StyledSpan = import_styled_components19.default.span.withConfig({
1487
+ componentId: "ccl__sc-108wg2j-0"
1488
+ })(["font-size:14px;line-height:22px;color:var(--charcoal-text2);padding:9px 0;display:flex;align-items:center;width:100%;margin-left:", "px;"], ({
1489
+ isSelected
1490
+ }) => isSelected === true ? 0 : 20);
1491
+ var Text2ColorIcon = (0, import_styled_components19.default)(Icon_default).withConfig({
1492
+ componentId: "ccl__sc-108wg2j-1"
1493
+ })(["color:var(--charcoal-text2);padding-right:4px;"]);
2472
1494
 
2473
1495
  // src/components/DropdownSelector/MenuItemGroup/index.tsx
2474
1496
  var import_styled_components20 = __toESM(require("styled-components"));
@@ -2479,23 +1501,15 @@ function MenuItemGroup(props) {
2479
1501
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StyledUl2, { role: "group", children: props.children })
2480
1502
  ] });
2481
1503
  }
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
- `;
1504
+ var TextSpan = import_styled_components20.default.span.withConfig({
1505
+ componentId: "ccl__sc-1ubjfz7-0"
1506
+ })(["display:block;color:var(--charcoal-text3);font-size:12px;font-weight:bold;padding:12px 0 8px 16px;"]);
1507
+ var StyledUl2 = import_styled_components20.default.ul.withConfig({
1508
+ componentId: "ccl__sc-1ubjfz7-1"
1509
+ })(["padding-left:0;margin:0;box-sizing:border-box;list-style:none;overflow:hidden;"]);
1510
+ var StyledLi2 = import_styled_components20.default.li.withConfig({
1511
+ componentId: "ccl__sc-1ubjfz7-2"
1512
+ })(["display:block;"]);
2499
1513
 
2500
1514
  // src/components/SegmentedControl/index.tsx
2501
1515
  var import_react27 = require("react");
@@ -2529,7 +1543,13 @@ var $e5be200c675c3b3a$export$571b5131b7e65c11 = (0, import_react23.createContext
2529
1543
  var $e5be200c675c3b3a$export$a763b9476acd3eb = "__formValidationState" + Date.now();
2530
1544
  function $e5be200c675c3b3a$export$fc1a364ae1f3ff10(props) {
2531
1545
  if (props[$e5be200c675c3b3a$export$a763b9476acd3eb]) {
2532
- let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$e5be200c675c3b3a$export$a763b9476acd3eb];
1546
+ let {
1547
+ realtimeValidation,
1548
+ displayValidation,
1549
+ updateValidation,
1550
+ resetValidation,
1551
+ commitValidation
1552
+ } = props[$e5be200c675c3b3a$export$a763b9476acd3eb];
2533
1553
  return {
2534
1554
  realtimeValidation,
2535
1555
  displayValidation,
@@ -2541,7 +1561,15 @@ function $e5be200c675c3b3a$export$fc1a364ae1f3ff10(props) {
2541
1561
  return $e5be200c675c3b3a$var$useFormValidationStateImpl(props);
2542
1562
  }
2543
1563
  function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2544
- let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
1564
+ let {
1565
+ isInvalid,
1566
+ validationState,
1567
+ name,
1568
+ value,
1569
+ builtinValidation,
1570
+ validate,
1571
+ validationBehavior = "aria"
1572
+ } = props;
2545
1573
  if (validationState)
2546
1574
  isInvalid || (isInvalid = validationState === "invalid");
2547
1575
  let controlledError = isInvalid ? {
@@ -2549,10 +1577,7 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2549
1577
  validationErrors: [],
2550
1578
  validationDetails: $e5be200c675c3b3a$var$CUSTOM_VALIDITY_STATE
2551
1579
  } : null;
2552
- let clientError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult($e5be200c675c3b3a$var$runValidate(validate, value)), [
2553
- validate,
2554
- value
2555
- ]);
1580
+ let clientError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult($e5be200c675c3b3a$var$runValidate(validate, value)), [validate, value]);
2556
1581
  if (builtinValidation === null || builtinValidation === void 0 ? void 0 : builtinValidation.validationDetails.valid)
2557
1582
  builtinValidation = null;
2558
1583
  let serverErrors = (0, import_react23.useContext)($e5be200c675c3b3a$export$571b5131b7e65c11);
@@ -2560,20 +1585,14 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2560
1585
  if (name)
2561
1586
  return Array.isArray(name) ? name.flatMap((name2) => $e5be200c675c3b3a$var$asArray(serverErrors[name2])) : $e5be200c675c3b3a$var$asArray(serverErrors[name]);
2562
1587
  return [];
2563
- }, [
2564
- serverErrors,
2565
- name
2566
- ]);
1588
+ }, [serverErrors, name]);
2567
1589
  let [lastServerErrors, setLastServerErrors] = (0, import_react23.useState)(serverErrors);
2568
1590
  let [isServerErrorCleared, setServerErrorCleared] = (0, import_react23.useState)(false);
2569
1591
  if (serverErrors !== lastServerErrors) {
2570
1592
  setLastServerErrors(serverErrors);
2571
1593
  setServerErrorCleared(false);
2572
1594
  }
2573
- let serverError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [
2574
- isServerErrorCleared,
2575
- serverErrorMessages
2576
- ]);
1595
+ let serverError = (0, import_react23.useMemo)(() => $e5be200c675c3b3a$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [isServerErrorCleared, serverErrorMessages]);
2577
1596
  let nextValidation = (0, import_react23.useRef)($e5be200c675c3b3a$export$dad6ae84456c676a);
2578
1597
  let [currentValidity, setCurrentValidity] = (0, import_react23.useState)($e5be200c675c3b3a$export$dad6ae84456c676a);
2579
1598
  let lastError = (0, import_react23.useRef)($e5be200c675c3b3a$export$dad6ae84456c676a);
@@ -2620,9 +1639,7 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
2620
1639
  function $e5be200c675c3b3a$var$asArray(v) {
2621
1640
  if (!v)
2622
1641
  return [];
2623
- return Array.isArray(v) ? v : [
2624
- v
2625
- ];
1642
+ return Array.isArray(v) ? v : [v];
2626
1643
  }
2627
1644
  function $e5be200c675c3b3a$var$runValidate(validate, value) {
2628
1645
  if (typeof validate === "function") {
@@ -2656,9 +1673,7 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
2656
1673
  if (wasControlled !== isControlled)
2657
1674
  console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
2658
1675
  isControlledRef.current = isControlled;
2659
- }, [
2660
- isControlled
2661
- ]);
1676
+ }, [isControlled]);
2662
1677
  let currentValue = isControlled ? value : stateValue;
2663
1678
  let setValue = (0, import_react24.useCallback)((value2, ...args) => {
2664
1679
  let onChangeCaller = (value3, ...onChangeArgs) => {
@@ -2684,15 +1699,8 @@ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange
2684
1699
  setStateValue(value2);
2685
1700
  onChangeCaller(value2, ...args);
2686
1701
  }
2687
- }, [
2688
- isControlled,
2689
- currentValue,
2690
- onChange
2691
- ]);
2692
- return [
2693
- currentValue,
2694
- setValue
2695
- ];
1702
+ }, [isControlled, currentValue, onChange]);
1703
+ return [currentValue, setValue];
2696
1704
  }
2697
1705
 
2698
1706
  // ../../node_modules/@react-stately/radio/dist/import.mjs
@@ -2700,9 +1708,7 @@ var import_react25 = require("react");
2700
1708
  var $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 1e10);
2701
1709
  var $a54cdc5c1942b639$var$i = 0;
2702
1710
  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
- ]);
1711
+ let name = (0, import_react25.useMemo)(() => props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [props.name]);
2706
1712
  var _props_defaultValue;
2707
1713
  let [selectedValue, setSelected] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : null, props.onChange);
2708
1714
  let [lastFocusedValue, setLastFocusedValue] = (0, import_react25.useState)(null);
@@ -2755,267 +1761,123 @@ var useRadioContext = () => {
2755
1761
 
2756
1762
  // src/components/SegmentedControl/index.tsx
2757
1763
  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
- );
1764
+ var SegmentedControl = (0, import_react27.forwardRef)(function SegmentedControlInner(props, ref) {
1765
+ const ariaRadioGroupProps = (0, import_react27.useMemo)(() => ({
1766
+ ...props,
1767
+ isDisabled: props.disabled,
1768
+ isReadOnly: props.readonly,
1769
+ isRequired: props.required,
1770
+ "aria-label": props.name
1771
+ }), [props]);
1772
+ const state = $a54cdc5c1942b639$export$bca9d026f8e704eb(ariaRadioGroupProps);
1773
+ const {
1774
+ radioGroupProps
1775
+ } = (0, import_radio2.useRadioGroup)(ariaRadioGroupProps, state);
1776
+ const segmentedControlItems = (0, import_react27.useMemo)(() => {
1777
+ return props.data.map((d) => typeof d === "string" ? {
1778
+ value: d,
1779
+ label: d
1780
+ } : d);
1781
+ }, [props.data]);
1782
+ 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)) }) });
1783
+ });
2796
1784
  var SegmentedControl_default = (0, import_react27.memo)(SegmentedControl);
2797
1785
  var Segmented = (props) => {
2798
1786
  const state = useRadioContext();
2799
1787
  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
- );
1788
+ const ariaRadioProps = (0, import_react27.useMemo)(() => ({
1789
+ value: props.value,
1790
+ isDisabled: props.disabled,
1791
+ children: props.children
1792
+ }), [props]);
1793
+ const {
1794
+ inputProps,
1795
+ isDisabled,
1796
+ isSelected
1797
+ } = (0, import_radio2.useRadio)(ariaRadioProps, state, ref);
1798
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(SegmentedRoot, { "aria-disabled": isDisabled || state.isReadOnly, checked: isSelected, children: [
1799
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SegmentedInput, { ...inputProps, ref }),
1800
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadioLabel2, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SegmentedLabelInner, { children: props.children }) })
1801
+ ] });
2824
1802
  };
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
- `;
1803
+ var SegmentedControlRoot = import_styled_components21.default.div.withConfig({
1804
+ componentId: "ccl__sc-1xmkkqt-0"
1805
+ })(["display:inline-flex;align-items:center;background-color:var(--charcoal-surface3);border-radius:16px;"]);
1806
+ var SegmentedRoot = import_styled_components21.default.label.withConfig({
1807
+ componentId: "ccl__sc-1xmkkqt-1"
1808
+ })(["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);", ""], ({
1809
+ checked = false
1810
+ }) => checked && (0, import_styled_components21.css)(["background-color:var(--charcoal-brand);color:var(--charcoal-text5);"]));
1811
+ var SegmentedInput = import_styled_components21.default.input.withConfig({
1812
+ componentId: "ccl__sc-1xmkkqt-2"
1813
+ })(["position:absolute;height:0px;width:0px;padding:0;margin:0;appearance:none;box-sizing:border-box;overflow:hidden;white-space:nowrap;opacity:0;"]);
1814
+ var RadioLabel2 = import_styled_components21.default.div.withConfig({
1815
+ componentId: "ccl__sc-1xmkkqt-3"
1816
+ })(["background:transparent;display:flex;align-items:center;height:22px;"]);
1817
+ var SegmentedLabelInner = import_styled_components21.default.div.withConfig({
1818
+ componentId: "ccl__sc-1xmkkqt-4"
1819
+ })(["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
1820
 
2895
1821
  // src/components/Checkbox/index.tsx
2896
1822
  var import_react28 = require("react");
2897
1823
  var import_styled_components22 = __toESM(require("styled-components"));
2898
1824
  var import_checkbox = require("@react-aria/checkbox");
2899
- var import_utils10 = require("@react-aria/utils");
1825
+ var import_utils12 = require("@react-aria/utils");
2900
1826
  var import_react_stately2 = require("react-stately");
2901
- var import_utils11 = require("@charcoal-ui/utils");
2902
1827
  var import_styled9 = require("@charcoal-ui/styled");
2903
1828
  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
- );
1829
+ var Checkbox = (0, import_react28.forwardRef)(function CheckboxInner({
1830
+ invalid = false,
1831
+ ...props
1832
+ }, ref) {
1833
+ const ariaCheckboxProps = (0, import_react28.useMemo)(() => ({
1834
+ ...props,
1835
+ isInValid: invalid,
1836
+ isSelected: props.checked,
1837
+ defaultSelected: props.defaultChecked,
1838
+ validationState: invalid ? "invalid" : "valid",
1839
+ "aria-label": "children" in props ? void 0 : props.label,
1840
+ isDisabled: props.disabled
1841
+ }), [invalid, props]);
1842
+ const state = (0, import_react_stately2.useToggleState)(ariaCheckboxProps);
1843
+ const objectRef = (0, import_utils12.useObjectRef)(ref);
1844
+ const {
1845
+ inputProps
1846
+ } = (0, import_checkbox.useCheckbox)(ariaCheckboxProps, state, objectRef);
1847
+ const isDisabled = (props.disabled ?? false) || (props.readonly ?? false);
1848
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
1849
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(CheckboxRoot, { children: [
1850
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CheckboxInput, { type: "checkbox", ...inputProps, readOnly: props.readonly }),
1851
+ /* @__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 }) })
1852
+ ] }),
1853
+ "children" in props && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InputLabel, { children: props.children })
1854
+ ] });
1855
+ });
2931
1856
  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
- `;
1857
+ var hiddenCss = (0, import_styled_components22.css)(["visibility:hidden;"]);
1858
+ var InputRoot = import_styled_components22.default.label.withConfig({
1859
+ componentId: "ccl__sc-wrdmwj-0"
1860
+ })(["position:relative;display:flex;cursor:pointer;gap:4px;&:disabled,&[aria-disabled]:not([aria-disabled='false']){cursor:default;opacity:0.32;}"]);
1861
+ var CheckboxRoot = import_styled_components22.default.div.withConfig({
1862
+ componentId: "ccl__sc-wrdmwj-1"
1863
+ })(["position:relative;"]);
1864
+ var CheckboxInput = import_styled_components22.default.input.withConfig({
1865
+ componentId: "ccl__sc-wrdmwj-2"
1866
+ })(["&[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);
1867
+ var CheckboxInputOverlay = import_styled_components22.default.div.withConfig({
1868
+ componentId: "ccl__sc-wrdmwj-3"
1869
+ })(["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);", ";"], ({
1870
+ checked
1871
+ }) => checked !== true && hiddenCss);
1872
+ var InputLabel = import_styled_components22.default.div.withConfig({
1873
+ componentId: "ccl__sc-wrdmwj-4"
1874
+ })(["color:var(--charcoal-text2);font-size:14px;line-height:20px;"]);
3013
1875
 
3014
1876
  // src/components/TagItem/index.tsx
3015
1877
  var import_react29 = require("react");
3016
- var import_utils12 = require("@react-aria/utils");
1878
+ var import_utils13 = require("@react-aria/utils");
3017
1879
  var import_styled_components23 = __toESM(require("styled-components"));
3018
- var import_utils13 = require("@charcoal-ui/utils");
1880
+ var import_utils14 = require("@charcoal-ui/utils");
3019
1881
  var import_button = require("@react-aria/button");
3020
1882
  var import_styled10 = require("@charcoal-ui/styled");
3021
1883
  var import_jsx_runtime28 = require("react/jsx-runtime");
@@ -3023,188 +1885,98 @@ var sizeMap = {
3023
1885
  S: 32,
3024
1886
  M: 40
3025
1887
  };
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,
1888
+ var TagItem = (0, import_react29.forwardRef)(function TagItemInner({
1889
+ label,
1890
+ translatedLabel,
1891
+ bgColor = "#7ACCB1",
1892
+ bgImage,
1893
+ size = "M",
1894
+ disabled,
1895
+ status = "default",
1896
+ className,
1897
+ ...props
1898
+ }, _ref) {
1899
+ const ref = (0, import_utils13.useObjectRef)(_ref);
1900
+ const ariaButtonProps = (0, import_react29.useMemo)(() => ({
1901
+ elementType: "a",
1902
+ isDisabled: disabled,
3036
1903
  ...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
- );
1904
+ }), [disabled, props]);
1905
+ const {
1906
+ buttonProps
1907
+ } = (0, import_button.useButton)(ariaButtonProps, ref);
1908
+ const hasTranslatedLabel = translatedLabel !== void 0 && translatedLabel.length > 0;
1909
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TagItemRoot, { ref, size: hasTranslatedLabel ? "M" : size, status, ...buttonProps, className, children: [
1910
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Background, { bgColor, bgImage, status }),
1911
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Inner, { children: [
1912
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(LabelWrapper, { isTranslate: hasTranslatedLabel, children: [
1913
+ hasTranslatedLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TranslatedLabel, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Label3, { children: translatedLabel }) }),
1914
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Label3, { children: label })
1915
+ ] }),
1916
+ status === "active" && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "16/Remove" })
1917
+ ] })
1918
+ ] });
1919
+ });
3071
1920
  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
- `;
1921
+ var horizontalPadding = ({
1922
+ left,
1923
+ right
1924
+ }) => (0, import_styled_components23.css)(["padding-right:", ";padding-left:", ";"], (0, import_utils14.px)(right), (0, import_utils14.px)(left));
3076
1925
  var tagItemRootSize = (size) => {
3077
1926
  switch (size) {
3078
1927
  case "M":
3079
- return horizontalPadding({ left: 24, right: 24 });
1928
+ return horizontalPadding({
1929
+ left: 24,
1930
+ right: 24
1931
+ });
3080
1932
  case "S":
3081
- return horizontalPadding({ left: 16, right: 16 });
1933
+ return horizontalPadding({
1934
+ left: 16,
1935
+ right: 16
1936
+ });
3082
1937
  }
3083
1938
  };
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
- `;
1939
+ var activeTagItemRoot = horizontalPadding({
1940
+ left: 16,
1941
+ right: 8
1942
+ });
1943
+ var TagItemRoot = import_styled_components23.default.a.withConfig({
1944
+ componentId: "ccl__sc-11j9pu2-0"
1945
+ })(["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;}"], ({
1946
+ size
1947
+ }) => sizeMap[size], ({
1948
+ size,
1949
+ status
1950
+ }) => status !== "active" && tagItemRootSize(size), ({
1951
+ status
1952
+ }) => status === "active" && activeTagItemRoot, ({
1953
+ status
1954
+ }) => status === "inactive" ? "var(--charcoal-text2)" : "var(--charcoal-text5)", import_styled10.focusVisibleFocusRingCss);
1955
+ var Background = import_styled_components23.default.div.withConfig({
1956
+ componentId: "ccl__sc-11j9pu2-1"
1957
+ })(["position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background-color:", ";", " ", ""], ({
1958
+ bgColor
1959
+ }) => bgColor, ({
1960
+ status
1961
+ }) => status === "inactive" && (0, import_styled_components23.css)(["background-color:var(--charcoal-surface3);"]), ({
1962
+ bgImage
1963
+ }) => 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));
1964
+ var Inner = import_styled_components23.default.div.withConfig({
1965
+ componentId: "ccl__sc-11j9pu2-2"
1966
+ })(["display:inline-flex;gap:8px;align-items:center;z-index:2;"]);
1967
+ 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;}"]);
1968
+ var translateLabelCSS = (0, import_styled_components23.css)(["display:flex;align-items:center;flex-direction:column;font-size:10px;"]);
1969
+ var LabelWrapper = import_styled_components23.default.div.withConfig({
1970
+ componentId: "ccl__sc-11j9pu2-3"
1971
+ })(["", ""], ({
1972
+ isTranslate
1973
+ }) => isTranslate ?? false ? translateLabelCSS : labelCSS);
1974
+ var Label3 = import_styled_components23.default.span.withConfig({
1975
+ componentId: "ccl__sc-11j9pu2-4"
1976
+ })(["max-width:152px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:inherit;color:inherit;line-height:inherit;"]);
1977
+ var TranslatedLabel = import_styled_components23.default.div.withConfig({
1978
+ componentId: "ccl__sc-11j9pu2-5"
1979
+ })(["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
1980
  // Annotate the CommonJS export names for ESM import in node:
3209
1981
  0 && (module.exports = {
3210
1982
  Button,