@charcoal-ui/react 3.3.0 → 3.4.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 (59) hide show
  1. package/dist/_lib/useForwardedRef.d.ts +3 -0
  2. package/dist/_lib/useForwardedRef.d.ts.map +1 -0
  3. package/dist/components/Clickable/index.d.ts.map +1 -1
  4. package/dist/components/DropdownSelector/DropdownPopover.d.ts.map +1 -1
  5. package/dist/components/DropdownSelector/Popover/index.d.ts.map +1 -1
  6. package/dist/components/DropdownSelector/Popover/usePreventScroll.d.ts +2 -0
  7. package/dist/components/DropdownSelector/Popover/usePreventScroll.d.ts.map +1 -0
  8. package/dist/components/DropdownSelector/index.story.d.ts +1 -0
  9. package/dist/components/DropdownSelector/index.story.d.ts.map +1 -1
  10. package/dist/components/Icon/index.story.d.ts +1 -1
  11. package/dist/components/Modal/Dialog/index.d.ts +26 -0
  12. package/dist/components/Modal/Dialog/index.d.ts.map +1 -0
  13. package/dist/components/Modal/ModalBackgroundContext.d.ts +6 -0
  14. package/dist/components/Modal/ModalBackgroundContext.d.ts.map +1 -0
  15. package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
  16. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts +4 -0
  17. package/dist/components/Modal/__stories__/InternalScrollStory.d.ts.map +1 -0
  18. package/dist/components/Modal/index.d.ts +12 -2
  19. package/dist/components/Modal/index.d.ts.map +1 -1
  20. package/dist/components/Modal/index.story.d.ts +3 -2
  21. package/dist/components/Modal/index.story.d.ts.map +1 -1
  22. package/dist/index.cjs.js +388 -299
  23. package/dist/index.cjs.js.map +1 -1
  24. package/dist/index.esm.js +350 -262
  25. package/dist/index.esm.js.map +1 -1
  26. package/package.json +6 -6
  27. package/src/_lib/useForwardedRef.tsx +16 -0
  28. package/src/components/Button/__snapshots__/index.story.storyshot +1971 -0
  29. package/src/components/Checkbox/__snapshots__/index.story.storyshot +390 -0
  30. package/src/components/Clickable/__snapshots__/index.story.storyshot +100 -0
  31. package/src/components/Clickable/index.tsx +17 -35
  32. package/src/components/DropdownSelector/DropdownPopover.tsx +0 -1
  33. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +245 -0
  34. package/src/components/DropdownSelector/MenuList/__snapshots__/index.story.storyshot +555 -0
  35. package/src/components/DropdownSelector/Popover/__snapshots__/index.story.storyshot +174 -0
  36. package/src/components/DropdownSelector/Popover/index.tsx +17 -2
  37. package/src/components/DropdownSelector/Popover/usePreventScroll.tsx +18 -0
  38. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +1241 -0
  39. package/src/components/DropdownSelector/index.story.tsx +69 -13
  40. package/src/components/Icon/__snapshots__/index.story.storyshot +12 -0
  41. package/src/components/{Button/__snapshots__/index.test.tsx.snap → IconButton/__snapshots__/index.story.storyshot} +94 -91
  42. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +81 -0
  43. package/src/components/Modal/Dialog/index.tsx +82 -0
  44. package/src/components/Modal/ModalBackgroundContext.tsx +8 -0
  45. package/src/components/Modal/ModalPlumbing.tsx +16 -4
  46. package/src/components/Modal/__snapshots__/index.story.storyshot +533 -0
  47. package/src/components/Modal/__stories__/InternalScrollStory.tsx +75 -0
  48. package/src/components/Modal/index.story.tsx +57 -38
  49. package/src/components/Modal/index.tsx +63 -94
  50. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +511 -0
  51. package/src/components/Radio/__snapshots__/index.story.storyshot +319 -0
  52. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +483 -0
  53. package/src/components/Switch/__snapshots__/index.story.storyshot +454 -0
  54. package/src/components/TagItem/__snapshots__/index.story.storyshot +1181 -0
  55. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +1271 -0
  56. package/src/components/TextField/__snapshots__/TextField.story.storyshot +1800 -0
  57. package/dist/components/Button/index.test.d.ts +0 -4
  58. package/dist/components/Button/index.test.d.ts.map +0 -1
  59. package/src/components/Button/index.test.tsx +0 -24
package/dist/index.esm.js CHANGED
@@ -81,39 +81,39 @@ var theme = createTheme(styled);
81
81
 
82
82
  // src/components/Clickable/index.tsx
83
83
  import * as React2 from "react";
84
- import styled2, { css } from "styled-components";
84
+ import styled2 from "styled-components";
85
85
  import { disabledSelector } from "@charcoal-ui/utils";
86
86
  import { jsx as jsx3 } from "react/jsx-runtime";
87
87
  var Clickable = React2.forwardRef(
88
88
  function Clickable2(props, ref) {
89
89
  const { Link } = useComponentAbstraction();
90
- if ("to" in props) {
91
- const { onClick, disabled = false, ...rest } = props;
92
- return /* @__PURE__ */ jsx3(
93
- A,
94
- {
95
- ...rest,
96
- as: disabled ? void 0 : Link,
97
- onClick: disabled ? void 0 : onClick,
98
- "aria-disabled": disabled,
99
- ref
100
- }
101
- );
102
- } else {
103
- return /* @__PURE__ */ jsx3(Button, { ...props, ref });
90
+ const isLink = "to" in props;
91
+ const as = isLink ? Link : "button";
92
+ const ariaDisabled = isLink && props.disabled === true ? true : void 0;
93
+ let rest = props;
94
+ if (isLink) {
95
+ const { disabled, ..._rest } = props;
96
+ rest = _rest;
104
97
  }
98
+ return /* @__PURE__ */ jsx3(
99
+ StyledClickableDiv,
100
+ {
101
+ ...rest,
102
+ ref,
103
+ as,
104
+ "aria-disabled": ariaDisabled
105
+ }
106
+ );
105
107
  }
106
108
  );
107
109
  var Clickable_default = Clickable;
108
- var clickableCss = css`
109
- /* Clickable style */
110
+ var StyledClickableDiv = styled2.div`
110
111
  cursor: pointer;
111
112
 
112
113
  ${disabledSelector} {
113
114
  cursor: default;
114
115
  }
115
- `;
116
- var Button = styled2.button`
116
+
117
117
  /* Reset button appearance */
118
118
  appearance: none;
119
119
  background: transparent;
@@ -146,27 +146,11 @@ var Button = styled2.button`
146
146
  border-style: none;
147
147
  padding: 0;
148
148
  }
149
-
150
- ${clickableCss}
151
- `;
152
- var A = styled2.span`
153
- /* Reset a-tag appearance */
154
- color: inherit;
155
-
156
- &:focus {
157
- outline: none;
158
- }
159
-
160
- .text {
161
- top: calc(1em + 2em);
162
- }
163
-
164
- ${clickableCss}
165
149
  `;
166
150
 
167
151
  // src/components/Button/index.tsx
168
152
  import { jsx as jsx4 } from "react/jsx-runtime";
169
- var Button2 = forwardRef3(function Button3({
153
+ var Button = forwardRef3(function Button2({
170
154
  children,
171
155
  variant = "Default",
172
156
  size = "M",
@@ -187,7 +171,7 @@ var Button2 = forwardRef3(function Button3({
187
171
  }
188
172
  );
189
173
  });
190
- var Button_default = Button2;
174
+ var Button_default = Button;
191
175
  var StyledButton = styled3(Clickable_default)`
192
176
  width: ${(p) => p.$fullWidth ? "stretch" : "min-content"};
193
177
  display: inline-grid;
@@ -494,7 +478,7 @@ function RadioGroup({
494
478
 
495
479
  // src/components/MultiSelect/index.tsx
496
480
  import { useCallback as useCallback2, useContext as useContext3, forwardRef as forwardRef6, memo as memo2 } from "react";
497
- import styled6, { css as css2 } from "styled-components";
481
+ import styled6, { css } from "styled-components";
498
482
  import warning2 from "warning";
499
483
  import { disabledSelector as disabledSelector2, px as px2 } from "@charcoal-ui/utils";
500
484
 
@@ -634,7 +618,7 @@ var MultiSelectInputOverlay = styled6.div`
634
618
  invalid && overlay && o.outline.assertive
635
619
  ])}
636
620
 
637
- ${({ overlay }) => overlay && css2`
621
+ ${({ overlay }) => overlay && css`
638
622
  border-color: ${({ theme: theme3 }) => theme3.color.text5};
639
623
  border-width: 2px;
640
624
  border-style: solid;
@@ -862,7 +846,7 @@ var FieldLabelWrapper = styled8.div`
862
846
  // src/components/TextField/index.tsx
863
847
  import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
864
848
  var TextField = React5.forwardRef(
865
- function SingleLineTextFieldInner({ onChange, ...props }, forwardRef17) {
849
+ function SingleLineTextFieldInner({ onChange, ...props }, forwardRef18) {
866
850
  const {
867
851
  className,
868
852
  showLabel = false,
@@ -952,7 +936,7 @@ var TextField = React5.forwardRef(
952
936
  /* @__PURE__ */ jsx10(
953
937
  StyledInput,
954
938
  {
955
- ref: mergeRefs(forwardRef17, ariaRef),
939
+ ref: mergeRefs(forwardRef18, ariaRef),
956
940
  invalid,
957
941
  extraLeftPadding: prefixWidth,
958
942
  extraRightPadding: suffixWidth,
@@ -1058,10 +1042,10 @@ var AssistiveText = styled9.p`
1058
1042
  import { useTextField as useTextField2 } from "@react-aria/textfield";
1059
1043
  import { useVisuallyHidden as useVisuallyHidden2 } from "@react-aria/visually-hidden";
1060
1044
  import { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
1061
- import styled10, { css as css3 } from "styled-components";
1045
+ import styled10, { css as css2 } from "styled-components";
1062
1046
  import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
1063
1047
  var TextArea = forwardRef10(
1064
- function TextAreaInner({ onChange, ...props }, forwardRef17) {
1048
+ function TextAreaInner({ onChange, ...props }, forwardRef18) {
1065
1049
  const {
1066
1050
  className,
1067
1051
  showCount = false,
@@ -1151,7 +1135,7 @@ var TextArea = forwardRef10(
1151
1135
  /* @__PURE__ */ jsx11(
1152
1136
  StyledTextarea,
1153
1137
  {
1154
- ref: mergeRefs(textareaRef, forwardRef17, ariaRef),
1138
+ ref: mergeRefs(textareaRef, forwardRef18, ariaRef),
1155
1139
  rows,
1156
1140
  noBottomPadding: showCount,
1157
1141
  ...inputProps
@@ -1199,7 +1183,7 @@ var StyledTextareaContainer = styled10.div`
1199
1183
  ${(p) => theme((o) => p.invalid ? o.outline.assertive : o.outline.default)}
1200
1184
  }
1201
1185
 
1202
- ${({ rows }) => css3`
1186
+ ${({ rows }) => css2`
1203
1187
  height: calc(22px * ${rows} + 18px);
1204
1188
  `};
1205
1189
  `;
@@ -1218,7 +1202,7 @@ var StyledTextarea = styled10.textarea`
1218
1202
  line-height: calc(22px / 0.875);
1219
1203
  padding: calc(9px / 0.875) 0 ${(p) => p.noBottomPadding ? 0 : ""};
1220
1204
 
1221
- ${({ rows = 1 }) => css3`
1205
+ ${({ rows = 1 }) => css2`
1222
1206
  height: calc(22px / 0.875 * ${rows});
1223
1207
  `};
1224
1208
 
@@ -1275,15 +1259,21 @@ var Icon = React6.forwardRef(function IconInner({ name, scale, unsafeNonGuidelin
1275
1259
  var Icon_default = Icon;
1276
1260
 
1277
1261
  // src/components/Modal/index.tsx
1278
- import { useContext as useContext4, forwardRef as forwardRef12, memo as memo4 } from "react";
1279
- import * as React7 from "react";
1262
+ import { useContext as useContext4, forwardRef as forwardRef13, memo as memo4 } from "react";
1263
+ import * as React9 from "react";
1280
1264
  import {
1281
1265
  Overlay,
1282
- useModalOverlay,
1283
- useOverlay
1266
+ useModalOverlay
1284
1267
  } from "@react-aria/overlays";
1285
- import styled11, { css as css4, useTheme } from "styled-components";
1286
- import { FocusScope } from "@react-aria/focus";
1268
+ import styled12, { css as css4, useTheme } from "styled-components";
1269
+ import { maxWidth as maxWidth2 } from "@charcoal-ui/utils";
1270
+ import { useMedia } from "@charcoal-ui/styled";
1271
+ import { animated as animated2, useTransition, easings } from "react-spring";
1272
+ import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
1273
+
1274
+ // src/components/Modal/Dialog/index.tsx
1275
+ import { forwardRef as forwardRef12 } from "react";
1276
+ import styled11, { css as css3 } from "styled-components";
1287
1277
  import { useDialog } from "@react-aria/dialog";
1288
1278
 
1289
1279
  // ../foundation/src/grid.ts
@@ -1293,14 +1283,100 @@ function columnSystem(span, column, gutter) {
1293
1283
  return span * column + (span - 1) * gutter;
1294
1284
  }
1295
1285
 
1296
- // src/components/Modal/index.tsx
1286
+ // src/components/Modal/Dialog/index.tsx
1297
1287
  import { maxWidth } from "@charcoal-ui/utils";
1298
- import { useMedia } from "@charcoal-ui/styled";
1299
- import { animated, useTransition, easings } from "react-spring";
1300
- import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
1301
- import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
1288
+ import { animated } from "react-spring";
1289
+
1290
+ // src/_lib/useForwardedRef.tsx
1291
+ import * as React7 from "react";
1292
+ function useForwardedRef(ref) {
1293
+ const innerRef = React7.useRef(null);
1294
+ React7.useEffect(() => {
1295
+ if (!ref)
1296
+ return;
1297
+ if (typeof ref === "function") {
1298
+ ref(innerRef.current);
1299
+ } else {
1300
+ ref.current = innerRef.current;
1301
+ }
1302
+ });
1303
+ return innerRef;
1304
+ }
1305
+
1306
+ // src/components/Modal/Dialog/index.tsx
1307
+ import { jsx as jsx13 } from "react/jsx-runtime";
1308
+ var Dialog = forwardRef12(function Dialog2(props, forwardRef18) {
1309
+ const ref = useForwardedRef(forwardRef18);
1310
+ const { dialogProps } = useDialog(
1311
+ {
1312
+ role: "dialog"
1313
+ },
1314
+ ref
1315
+ );
1316
+ return /* @__PURE__ */ jsx13(
1317
+ AnimatedStyledDialogDiv,
1318
+ {
1319
+ ...props,
1320
+ role: dialogProps.role,
1321
+ tabIndex: dialogProps.tabIndex,
1322
+ "aria-labelledby": dialogProps["aria-labelledby"],
1323
+ onBlur: dialogProps.onBlur,
1324
+ ref
1325
+ }
1326
+ );
1327
+ });
1328
+ var AnimatedStyledDialogDiv = animated(styled11.div`
1329
+ margin: auto;
1330
+ position: relative;
1331
+ height: fit-content;
1332
+ width: ${(p) => {
1333
+ switch (p.size) {
1334
+ case "S": {
1335
+ return columnSystem(3, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1336
+ }
1337
+ case "M": {
1338
+ return columnSystem(4, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1339
+ }
1340
+ case "L": {
1341
+ return columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1342
+ }
1343
+ default: {
1344
+ return unreachable(p.size);
1345
+ }
1346
+ }
1347
+ }}px;
1348
+
1349
+ background-color: ${({ theme: theme3 }) => theme3.color.background1};
1350
+ border-radius: 24px;
1351
+
1352
+ @media ${({ theme: theme3 }) => maxWidth(theme3.breakpoint.screen1)} {
1353
+ max-width: 440px;
1354
+ width: calc(100% - 48px);
1355
+ ${(p) => p.bottomSheet !== false && css3`
1356
+ max-width: unset;
1357
+ width: 100%;
1358
+ border-radius: 0;
1359
+ margin: auto 0 0 0;
1360
+ ${p.bottomSheet === "full" && css3`
1361
+ min-height: 100%;
1362
+ `}
1363
+ `}
1364
+ }
1365
+ :focus {
1366
+ outline: none;
1367
+ }
1368
+ `);
1369
+
1370
+ // src/components/Modal/ModalBackgroundContext.tsx
1371
+ import * as React8 from "react";
1372
+ var ModalBackgroundContext = React8.createContext(
1373
+ null
1374
+ );
1375
+
1376
+ // src/components/Modal/index.tsx
1377
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
1302
1378
  var DEFAULT_Z_INDEX = 10;
1303
- var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDEX, portalContainer, ...props }, external) {
1379
+ var Modal = forwardRef13(function ModalInner({ children, zIndex = DEFAULT_Z_INDEX, portalContainer, ...props }, external) {
1304
1380
  const {
1305
1381
  title,
1306
1382
  size = "M",
@@ -1311,8 +1387,7 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1311
1387
  isOpen = false
1312
1388
  } = props;
1313
1389
  const ref = useObjectRef2(external);
1314
- const { overlayProps, underlayProps } = useOverlay(props, ref);
1315
- const { modalProps } = useModalOverlay(
1390
+ const { modalProps, underlayProps } = useModalOverlay(
1316
1391
  props,
1317
1392
  {
1318
1393
  close: onClose,
@@ -1326,40 +1401,45 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1326
1401
  },
1327
1402
  ref
1328
1403
  );
1329
- const { dialogProps, titleProps } = useDialog(props, ref);
1330
1404
  const theme3 = useTheme();
1331
- const isMobile = useMedia(maxWidth(theme3.breakpoint.screen1)) ?? false;
1405
+ const isMobile = useMedia(maxWidth2(theme3.breakpoint.screen1)) ?? false;
1332
1406
  const transitionEnabled = isMobile && bottomSheet !== false;
1407
+ const showDismiss = !isMobile || bottomSheet !== true;
1333
1408
  const transition = useTransition(isOpen, {
1334
1409
  from: {
1335
1410
  transform: "translateY(100%)",
1336
- backgroundColor: "rgba(0, 0, 0, 0)"
1411
+ backgroundColor: "rgba(0, 0, 0, 0)",
1412
+ overflow: "hidden"
1337
1413
  },
1338
1414
  enter: {
1339
1415
  transform: "translateY(0%)",
1340
1416
  backgroundColor: "rgba(0, 0, 0, 0.4)"
1341
1417
  },
1418
+ update: {
1419
+ overflow: "auto"
1420
+ },
1342
1421
  leave: {
1343
1422
  transform: "translateY(100%)",
1344
- backgroundColor: "rgba(0, 0, 0, 0)"
1423
+ backgroundColor: "rgba(0, 0, 0, 0)",
1424
+ overflow: "hidden"
1345
1425
  },
1346
1426
  config: transitionEnabled ? { duration: 400, easing: easings.easeOutQuart } : { duration: 0 }
1347
1427
  });
1348
- const showDismiss = !isMobile || bottomSheet !== true;
1428
+ const bgRef = React9.useRef(null);
1349
1429
  return transition(
1350
- ({ backgroundColor, transform }, item) => item && /* @__PURE__ */ jsx13(Overlay, { portalContainer, children: /* @__PURE__ */ jsx13(
1430
+ ({ backgroundColor, overflow, transform }, item) => item && /* @__PURE__ */ jsx14(Overlay, { portalContainer, children: /* @__PURE__ */ jsx14(
1351
1431
  ModalBackground,
1352
1432
  {
1433
+ ref: bgRef,
1353
1434
  zIndex,
1354
1435
  ...underlayProps,
1355
- style: transitionEnabled ? { backgroundColor } : {},
1356
- children: /* @__PURE__ */ jsx13(FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: /* @__PURE__ */ jsx13(DialogContainer, { bottomSheet, size, children: /* @__PURE__ */ jsx13(
1357
- ModalDialog,
1436
+ style: transitionEnabled ? { backgroundColor, overflow } : {},
1437
+ $bottomSheet: bottomSheet,
1438
+ children: /* @__PURE__ */ jsx14(ModalBackgroundContext.Provider, { value: bgRef.current, children: /* @__PURE__ */ jsx14(
1439
+ Dialog,
1358
1440
  {
1359
1441
  ref,
1360
- ...overlayProps,
1361
1442
  ...modalProps,
1362
- ...dialogProps,
1363
1443
  style: transitionEnabled ? { transform } : {},
1364
1444
  size,
1365
1445
  bottomSheet,
@@ -1367,10 +1447,16 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1367
1447
  children: /* @__PURE__ */ jsxs8(
1368
1448
  ModalContext.Provider,
1369
1449
  {
1370
- value: { titleProps, title, close: onClose, showDismiss },
1450
+ value: {
1451
+ titleProps: {},
1452
+ title,
1453
+ close: onClose,
1454
+ showDismiss,
1455
+ bottomSheet
1456
+ },
1371
1457
  children: [
1372
1458
  children,
1373
- isDismissable === true && /* @__PURE__ */ jsx13(
1459
+ isDismissable === true && /* @__PURE__ */ jsx14(
1374
1460
  ModalCrossButton,
1375
1461
  {
1376
1462
  size: "S",
@@ -1382,78 +1468,42 @@ var Modal = forwardRef12(function ModalInner({ children, zIndex = DEFAULT_Z_INDE
1382
1468
  }
1383
1469
  )
1384
1470
  }
1385
- ) }) })
1471
+ ) })
1386
1472
  }
1387
1473
  ) })
1388
1474
  );
1389
1475
  });
1390
1476
  var Modal_default = memo4(Modal);
1391
- var ModalContext = React7.createContext({
1477
+ var ModalContext = React9.createContext({
1392
1478
  titleProps: {},
1393
1479
  title: "",
1394
1480
  close: void 0,
1395
- showDismiss: true
1481
+ showDismiss: true,
1482
+ bottomSheet: false
1396
1483
  });
1397
- var ModalBackground = animated(styled11.div`
1484
+ var ModalBackground = animated2(styled12.div`
1398
1485
  z-index: ${({ zIndex }) => zIndex};
1399
1486
  overflow: auto;
1400
1487
  display: flex;
1401
1488
  position: fixed;
1402
1489
  top: 0;
1403
1490
  left: 0;
1404
- width: 100%;
1491
+ width: -webkit-fill-available;
1492
+ width: -moz-available;
1405
1493
  height: 100%;
1494
+ justify-content: center;
1495
+ padding: 40px 0;
1496
+ box-sizing: border-box;
1406
1497
 
1407
- ${theme((o) => [o.bg.surface4])}
1408
- `);
1409
- var DialogContainer = styled11.div`
1410
- position: relative;
1411
- margin: auto;
1412
- padding: 24px 0;
1413
- width: ${(p) => {
1414
- switch (p.size) {
1415
- case "S": {
1416
- return columnSystem(3, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1417
- }
1418
- case "M": {
1419
- return columnSystem(4, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1420
- }
1421
- case "L": {
1422
- return columnSystem(6, COLUMN_UNIT, GUTTER_UNIT) + GUTTER_UNIT * 2;
1423
- }
1424
- default: {
1425
- return unreachable(p.size);
1426
- }
1427
- }
1428
- }}px;
1498
+ background-color: ${({ theme: theme3 }) => theme3.color.surface4};
1429
1499
 
1430
- @media ${({ theme: theme3 }) => maxWidth(theme3.breakpoint.screen1)} {
1431
- width: calc(100% - 48px);
1432
- ${(p) => p.bottomSheet !== false && css4`
1433
- margin: 0;
1500
+ @media ${({ theme: theme3 }) => maxWidth2(theme3.breakpoint.screen1)} {
1501
+ ${(p) => p.$bottomSheet !== false && css4`
1434
1502
  padding: 0;
1435
- bottom: 0;
1436
- position: absolute;
1437
- width: 100%;
1438
- ${p.bottomSheet === "full" ? "height: 100%" : ""};
1439
- `}
1440
- }
1441
- `;
1442
- var ModalDialog = animated(styled11.div`
1443
- position: relative;
1444
- margin: auto;
1445
-
1446
- ${theme((o) => [o.bg.background1, o.borderRadius(24)])}
1447
- @media ${({ theme: theme3 }) => maxWidth(theme3.breakpoint.screen1)} {
1448
- ${(p) => p.bottomSheet !== false && css4`
1449
- border-radius: 0;
1450
- ${p.bottomSheet === "full" && css4`
1451
- height: 100%;
1452
- `}
1453
1503
  `}
1454
1504
  }
1455
1505
  `);
1456
- var ModalCrossButton = styled11(IconButton_default)`
1506
+ var ModalCrossButton = styled12(IconButton_default)`
1457
1507
  position: absolute;
1458
1508
  top: 8px;
1459
1509
  right: 8px;
@@ -1462,36 +1512,44 @@ var ModalCrossButton = styled11(IconButton_default)`
1462
1512
  `;
1463
1513
  function ModalTitle(props) {
1464
1514
  const { titleProps, title } = useContext4(ModalContext);
1465
- return /* @__PURE__ */ jsx13(ModalHeading, { ...titleProps, ...props, children: title });
1515
+ return /* @__PURE__ */ jsx14(ModalHeading, { ...titleProps, ...props, children: title });
1466
1516
  }
1467
- var ModalHeading = styled11.h3`
1517
+ var ModalHeading = styled12.h3`
1468
1518
  margin: 0;
1469
1519
  font-weight: inherit;
1470
1520
  font-size: inherit;
1471
1521
  `;
1472
1522
 
1473
1523
  // src/components/Modal/ModalPlumbing.tsx
1474
- import styled12 from "styled-components";
1475
- import { jsx as jsx14 } from "react/jsx-runtime";
1524
+ import styled13, { css as css5 } from "styled-components";
1525
+ import { useContext as useContext5 } from "react";
1526
+ import { maxWidth as maxWidth3 } from "@charcoal-ui/utils";
1527
+ import { jsx as jsx15 } from "react/jsx-runtime";
1476
1528
  function ModalHeader() {
1477
- return /* @__PURE__ */ jsx14(ModalHeaderRoot, { children: /* @__PURE__ */ jsx14(StyledModalTitle, {}) });
1529
+ const modalCtx = useContext5(ModalContext);
1530
+ return /* @__PURE__ */ jsx15(ModalHeaderRoot, { $bottomSheet: modalCtx.bottomSheet, children: /* @__PURE__ */ jsx15(StyledModalTitle, {}) });
1478
1531
  }
1479
- var ModalHeaderRoot = styled12.div`
1532
+ var ModalHeaderRoot = styled13.div`
1480
1533
  height: 64px;
1481
1534
  display: grid;
1482
1535
  align-content: center;
1483
1536
  justify-content: center;
1537
+ @media ${({ theme: theme3 }) => maxWidth3(theme3.breakpoint.screen1)} {
1538
+ ${(p) => p.$bottomSheet !== false && css5`
1539
+ height: 48px;
1540
+ `}
1541
+ }
1484
1542
  `;
1485
- var StyledModalTitle = styled12(ModalTitle)`
1543
+ var StyledModalTitle = styled13(ModalTitle)`
1486
1544
  ${theme((o) => [o.font.text1, o.typography(16).bold])}
1487
1545
  `;
1488
- var ModalAlign = styled12.div`
1546
+ var ModalAlign = styled13.div`
1489
1547
  ${theme((o) => [o.padding.horizontal(16)])}
1490
1548
  `;
1491
- var ModalBody = styled12.div`
1549
+ var ModalBody = styled13.div`
1492
1550
  ${theme((o) => [o.padding.bottom(40)])}
1493
1551
  `;
1494
- var ModalButtons = styled12.div`
1552
+ var ModalButtons = styled13.div`
1495
1553
  display: grid;
1496
1554
  grid-auto-flow: row;
1497
1555
  grid-row-gap: 8px;
@@ -1500,12 +1558,12 @@ var ModalButtons = styled12.div`
1500
1558
  `;
1501
1559
 
1502
1560
  // src/components/LoadingSpinner/index.tsx
1503
- import { forwardRef as forwardRef13, useImperativeHandle, useRef as useRef3, memo as memo5 } from "react";
1504
- import styled13, { keyframes } from "styled-components";
1505
- import { jsx as jsx15 } from "react/jsx-runtime";
1506
- var LoadingSpinner = forwardRef13(
1561
+ import { forwardRef as forwardRef14, useImperativeHandle, useRef as useRef5, memo as memo5 } from "react";
1562
+ import styled14, { keyframes } from "styled-components";
1563
+ import { jsx as jsx16 } from "react/jsx-runtime";
1564
+ var LoadingSpinner = forwardRef14(
1507
1565
  function LoadingSpinnerInner({ size = 48, padding = 16, transparent = false, className }, ref) {
1508
- return /* @__PURE__ */ jsx15(
1566
+ return /* @__PURE__ */ jsx16(
1509
1567
  LoadingSpinnerRoot,
1510
1568
  {
1511
1569
  size,
@@ -1513,13 +1571,13 @@ var LoadingSpinner = forwardRef13(
1513
1571
  transparent,
1514
1572
  className,
1515
1573
  ref,
1516
- children: /* @__PURE__ */ jsx15(LoadingSpinnerIcon, {})
1574
+ children: /* @__PURE__ */ jsx16(LoadingSpinnerIcon, {})
1517
1575
  }
1518
1576
  );
1519
1577
  }
1520
1578
  );
1521
1579
  var LoadingSpinner_default = memo5(LoadingSpinner);
1522
- var LoadingSpinnerRoot = styled13.div.attrs({ role: "progressbar" })`
1580
+ var LoadingSpinnerRoot = styled14.div.attrs({ role: "progressbar" })`
1523
1581
  box-sizing: content-box;
1524
1582
  margin: auto;
1525
1583
  padding: ${(props) => props.padding}px;
@@ -1544,7 +1602,7 @@ var scaleOut = keyframes`
1544
1602
  opacity: 0;
1545
1603
  }
1546
1604
  `;
1547
- var Icon2 = styled13.div.attrs({ role: "presentation" })`
1605
+ var Icon2 = styled14.div.attrs({ role: "presentation" })`
1548
1606
  width: 1em;
1549
1607
  height: 1em;
1550
1608
  border-radius: 1em;
@@ -1556,9 +1614,9 @@ var Icon2 = styled13.div.attrs({ role: "presentation" })`
1556
1614
  animation: none;
1557
1615
  }
1558
1616
  `;
1559
- var LoadingSpinnerIcon = forwardRef13(
1617
+ var LoadingSpinnerIcon = forwardRef14(
1560
1618
  function LoadingSpinnerIcon2({ once = false }, ref) {
1561
- const iconRef = useRef3(null);
1619
+ const iconRef = useRef5(null);
1562
1620
  useImperativeHandle(ref, () => ({
1563
1621
  restart: () => {
1564
1622
  if (!iconRef.current) {
@@ -1569,26 +1627,45 @@ var LoadingSpinnerIcon = forwardRef13(
1569
1627
  delete iconRef.current.dataset.resetAnimation;
1570
1628
  }
1571
1629
  }));
1572
- return /* @__PURE__ */ jsx15(Icon2, { ref: iconRef, once });
1630
+ return /* @__PURE__ */ jsx16(Icon2, { ref: iconRef, once });
1573
1631
  }
1574
1632
  );
1575
1633
 
1576
1634
  // src/components/DropdownSelector/index.tsx
1577
- import { useState as useState3, useRef as useRef7 } from "react";
1578
- import styled16 from "styled-components";
1635
+ import { useState as useState3, useRef as useRef9 } from "react";
1636
+ import styled17 from "styled-components";
1579
1637
  import { disabledSelector as disabledSelector4 } from "@charcoal-ui/utils";
1580
1638
 
1581
1639
  // src/components/DropdownSelector/DropdownPopover.tsx
1582
- import { useEffect as useEffect3, useRef as useRef5 } from "react";
1640
+ import { useEffect as useEffect5, useRef as useRef7 } from "react";
1583
1641
 
1584
1642
  // src/components/DropdownSelector/Popover/index.tsx
1585
- import { useRef as useRef4 } from "react";
1643
+ import { useContext as useContext6, useRef as useRef6 } from "react";
1586
1644
  import { DismissButton, Overlay as Overlay2, usePopover } from "@react-aria/overlays";
1587
- import styled14 from "styled-components";
1588
- import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
1645
+ import styled15 from "styled-components";
1646
+
1647
+ // src/components/DropdownSelector/Popover/usePreventScroll.tsx
1648
+ import { useEffect as useEffect4 } from "react";
1649
+ function usePreventScroll(element, isOpen) {
1650
+ useEffect4(() => {
1651
+ if (isOpen && element) {
1652
+ const defaultPaddingRight = element.style.paddingRight;
1653
+ const defaultOverflow = element.style.overflow;
1654
+ element.style.paddingRight = `${window.innerWidth - element.clientWidth}px`;
1655
+ element.style.overflow = "hidden";
1656
+ return () => {
1657
+ element.style.paddingRight = defaultPaddingRight;
1658
+ element.style.overflow = defaultOverflow;
1659
+ };
1660
+ }
1661
+ }, [element, isOpen]);
1662
+ }
1663
+
1664
+ // src/components/DropdownSelector/Popover/index.tsx
1665
+ import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
1589
1666
  var _empty = () => null;
1590
1667
  function Popover(props) {
1591
- const defaultPopoverRef = useRef4(null);
1668
+ const defaultPopoverRef = useRef6(null);
1592
1669
  const finalPopoverRef = props.popoverRef === void 0 ? defaultPopoverRef : props.popoverRef;
1593
1670
  const { popoverProps, underlayProps } = usePopover(
1594
1671
  {
@@ -1604,18 +1681,30 @@ function Popover(props) {
1604
1681
  toggle: _empty
1605
1682
  }
1606
1683
  );
1684
+ const modalBackground = useContext6(ModalBackgroundContext);
1685
+ usePreventScroll(modalBackground, props.isOpen);
1607
1686
  if (!props.isOpen)
1608
1687
  return null;
1609
1688
  return /* @__PURE__ */ jsxs9(Overlay2, { portalContainer: document.body, children: [
1610
- /* @__PURE__ */ jsx16("div", { ...underlayProps, style: { position: "fixed", inset: 0 } }),
1689
+ /* @__PURE__ */ jsx17(
1690
+ "div",
1691
+ {
1692
+ ...underlayProps,
1693
+ style: {
1694
+ position: "fixed",
1695
+ zIndex: typeof popoverProps.style?.zIndex === "number" ? popoverProps.style.zIndex - 1 : 99999,
1696
+ inset: 0
1697
+ }
1698
+ }
1699
+ ),
1611
1700
  /* @__PURE__ */ jsxs9(DropdownPopoverDiv, { ...popoverProps, ref: finalPopoverRef, children: [
1612
- /* @__PURE__ */ jsx16(DismissButton, { onDismiss: () => props.onClose() }),
1701
+ /* @__PURE__ */ jsx17(DismissButton, { onDismiss: () => props.onClose() }),
1613
1702
  props.children,
1614
- /* @__PURE__ */ jsx16(DismissButton, { onDismiss: () => props.onClose() })
1703
+ /* @__PURE__ */ jsx17(DismissButton, { onDismiss: () => props.onClose() })
1615
1704
  ] })
1616
1705
  ] });
1617
1706
  }
1618
- var DropdownPopoverDiv = styled14.div`
1707
+ var DropdownPopoverDiv = styled15.div`
1619
1708
  margin: 4px 0;
1620
1709
  list-style: none;
1621
1710
  overflow: auto;
@@ -1630,27 +1719,26 @@ var DropdownPopoverDiv = styled14.div`
1630
1719
  `;
1631
1720
 
1632
1721
  // src/components/DropdownSelector/DropdownPopover.tsx
1633
- import { jsx as jsx17 } from "react/jsx-runtime";
1722
+ import { jsx as jsx18 } from "react/jsx-runtime";
1634
1723
  function DropdownPopover({ children, ...props }) {
1635
- const ref = useRef5(null);
1636
- useEffect3(() => {
1724
+ const ref = useRef7(null);
1725
+ useEffect5(() => {
1637
1726
  if (props.isOpen && ref.current && props.triggerRef.current) {
1638
1727
  ref.current.style.width = `${props.triggerRef.current.clientWidth}px`;
1639
1728
  }
1640
1729
  }, [props.triggerRef, props.isOpen]);
1641
- useEffect3(() => {
1730
+ useEffect5(() => {
1642
1731
  if (props.isOpen && props.value !== void 0) {
1643
1732
  const windowScrollY = window.scrollY;
1644
1733
  const windowScrollX = window.scrollX;
1645
1734
  const selectedElement = document.querySelector(
1646
1735
  `[data-key="${props.value.toString()}"]`
1647
1736
  );
1648
- selectedElement?.scrollIntoView({ block: "center" });
1649
1737
  selectedElement?.focus();
1650
1738
  window.scrollTo(windowScrollX, windowScrollY);
1651
1739
  }
1652
1740
  }, [props.value, props.isOpen]);
1653
- return /* @__PURE__ */ jsx17(
1741
+ return /* @__PURE__ */ jsx18(
1654
1742
  Popover,
1655
1743
  {
1656
1744
  isOpen: props.isOpen,
@@ -1663,12 +1751,12 @@ function DropdownPopover({ children, ...props }) {
1663
1751
  }
1664
1752
 
1665
1753
  // src/components/DropdownSelector/utils/findPreviewRecursive.tsx
1666
- import * as React8 from "react";
1754
+ import * as React10 from "react";
1667
1755
  function findPreviewRecursive(children, value) {
1668
- const childArray = React8.Children.toArray(children);
1756
+ const childArray = React10.Children.toArray(children);
1669
1757
  for (let i = 0; i < childArray.length; i++) {
1670
1758
  const child = childArray[i];
1671
- if (React8.isValidElement(child)) {
1759
+ if (React10.isValidElement(child)) {
1672
1760
  if ("value" in child.props) {
1673
1761
  const childValue = child.props.value;
1674
1762
  if (childValue === value && "children" in child.props) {
@@ -1690,12 +1778,12 @@ function findPreviewRecursive(children, value) {
1690
1778
  }
1691
1779
 
1692
1780
  // src/components/DropdownSelector/MenuList/index.tsx
1693
- import { useRef as useRef6 } from "react";
1694
- import styled15 from "styled-components";
1781
+ import { useRef as useRef8 } from "react";
1782
+ import styled16 from "styled-components";
1695
1783
 
1696
1784
  // src/components/DropdownSelector/MenuList/MenuListContext.ts
1697
- import { createContext as createContext5 } from "react";
1698
- var MenuListContext = createContext5({
1785
+ import { createContext as createContext6 } from "react";
1786
+ var MenuListContext = createContext6({
1699
1787
  root: void 0,
1700
1788
  value: "",
1701
1789
  values: [],
@@ -1704,12 +1792,12 @@ var MenuListContext = createContext5({
1704
1792
  });
1705
1793
 
1706
1794
  // src/components/DropdownSelector/MenuList/internals/getValuesRecursive.tsx
1707
- import * as React9 from "react";
1795
+ import * as React11 from "react";
1708
1796
  function getValuesRecursive(children, values = []) {
1709
- const childArray = React9.Children.toArray(children);
1797
+ const childArray = React11.Children.toArray(children);
1710
1798
  for (let i = 0; i < childArray.length; i++) {
1711
1799
  const child = childArray[i];
1712
- if (React9.isValidElement(child)) {
1800
+ if (React11.isValidElement(child)) {
1713
1801
  const props = child.props;
1714
1802
  if ("value" in props && typeof props.value === "string") {
1715
1803
  const childValue = props.value;
@@ -1723,12 +1811,12 @@ function getValuesRecursive(children, values = []) {
1723
1811
  }
1724
1812
 
1725
1813
  // src/components/DropdownSelector/MenuList/index.tsx
1726
- import { jsx as jsx18 } from "react/jsx-runtime";
1814
+ import { jsx as jsx19 } from "react/jsx-runtime";
1727
1815
  function MenuList(props) {
1728
- const root = useRef6(null);
1816
+ const root = useRef8(null);
1729
1817
  const values = [];
1730
1818
  getValuesRecursive(props.children, values);
1731
- return /* @__PURE__ */ jsx18(StyledUl, { ref: root, children: /* @__PURE__ */ jsx18(
1819
+ return /* @__PURE__ */ jsx19(StyledUl, { ref: root, children: /* @__PURE__ */ jsx19(
1732
1820
  MenuListContext.Provider,
1733
1821
  {
1734
1822
  value: {
@@ -1743,20 +1831,20 @@ function MenuList(props) {
1743
1831
  }
1744
1832
  ) });
1745
1833
  }
1746
- var StyledUl = styled15.ul`
1834
+ var StyledUl = styled16.ul`
1747
1835
  padding: 0;
1748
1836
  margin: 0;
1749
1837
  `;
1750
1838
 
1751
1839
  // src/components/DropdownSelector/index.tsx
1752
- import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
1840
+ import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
1753
1841
  var defaultRequiredText = "*\u5FC5\u9808";
1754
1842
  function DropdownSelector(props) {
1755
- const triggerRef = useRef7(null);
1843
+ const triggerRef = useRef9(null);
1756
1844
  const [isOpen, setIsOpen] = useState3(false);
1757
1845
  const preview = findPreviewRecursive(props.children, props.value);
1758
1846
  return /* @__PURE__ */ jsxs10(DropdownSelectorRoot, { "aria-disabled": props.disabled, children: [
1759
- props.showLabel === true && /* @__PURE__ */ jsx19(
1847
+ props.showLabel === true && /* @__PURE__ */ jsx20(
1760
1848
  DropdownFieldLabel,
1761
1849
  {
1762
1850
  label: props.label,
@@ -1778,19 +1866,19 @@ function DropdownSelector(props) {
1778
1866
  ref: triggerRef,
1779
1867
  type: "button",
1780
1868
  children: [
1781
- /* @__PURE__ */ jsx19(DropdownButtonText, { children: props.placeholder !== void 0 && preview === void 0 ? props.placeholder : preview }),
1782
- /* @__PURE__ */ jsx19(DropdownButtonIcon, { name: "16/Menu" })
1869
+ /* @__PURE__ */ jsx20(DropdownButtonText, { children: props.placeholder !== void 0 && preview === void 0 ? props.placeholder : preview }),
1870
+ /* @__PURE__ */ jsx20(DropdownButtonIcon, { name: "16/Menu" })
1783
1871
  ]
1784
1872
  }
1785
1873
  ),
1786
- isOpen && /* @__PURE__ */ jsx19(
1874
+ isOpen && /* @__PURE__ */ jsx20(
1787
1875
  DropdownPopover,
1788
1876
  {
1789
1877
  isOpen,
1790
1878
  onClose: () => setIsOpen(false),
1791
1879
  triggerRef,
1792
1880
  value: props.value,
1793
- children: /* @__PURE__ */ jsx19(
1881
+ children: /* @__PURE__ */ jsx20(
1794
1882
  MenuList,
1795
1883
  {
1796
1884
  value: props.value,
@@ -1803,10 +1891,10 @@ function DropdownSelector(props) {
1803
1891
  )
1804
1892
  }
1805
1893
  ),
1806
- props.assistiveText !== void 0 && /* @__PURE__ */ jsx19(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
1894
+ props.assistiveText !== void 0 && /* @__PURE__ */ jsx20(AssertiveText, { invalid: props.invalid, children: props.assistiveText })
1807
1895
  ] });
1808
1896
  }
1809
- var DropdownSelectorRoot = styled16.div`
1897
+ var DropdownSelectorRoot = styled17.div`
1810
1898
  display: inline-block;
1811
1899
  width: 100%;
1812
1900
 
@@ -1815,12 +1903,12 @@ var DropdownSelectorRoot = styled16.div`
1815
1903
  ${theme((o) => o.disabled)}
1816
1904
  }
1817
1905
  `;
1818
- var DropdownFieldLabel = styled16(FieldLabel_default)`
1906
+ var DropdownFieldLabel = styled17(FieldLabel_default)`
1819
1907
  width: 100%;
1820
1908
 
1821
1909
  ${theme((o) => o.margin.bottom(8))}
1822
1910
  `;
1823
- var DropdownButton = styled16.button`
1911
+ var DropdownButton = styled17.button`
1824
1912
  display: flex;
1825
1913
  justify-content: space-between;
1826
1914
  align-items: center;
@@ -1843,15 +1931,15 @@ var DropdownButton = styled16.button`
1843
1931
  invalid === true && o.outline.assertive
1844
1932
  ])}
1845
1933
  `;
1846
- var DropdownButtonText = styled16.span`
1934
+ var DropdownButtonText = styled17.span`
1847
1935
  text-align: left;
1848
1936
 
1849
1937
  ${theme((o) => [o.typography(14), o.font.text2])}
1850
1938
  `;
1851
- var DropdownButtonIcon = styled16(Icon_default)`
1939
+ var DropdownButtonIcon = styled17(Icon_default)`
1852
1940
  ${theme((o) => [o.font.text2])}
1853
1941
  `;
1854
- var AssertiveText = styled16.div`
1942
+ var AssertiveText = styled17.div`
1855
1943
  ${({ invalid }) => theme((o) => [
1856
1944
  o.typography(14),
1857
1945
  o.margin.top(8),
@@ -1860,19 +1948,19 @@ var AssertiveText = styled16.div`
1860
1948
  `;
1861
1949
 
1862
1950
  // src/components/DropdownSelector/DropdownMenuItem.tsx
1863
- import styled18 from "styled-components";
1951
+ import styled19 from "styled-components";
1864
1952
 
1865
1953
  // src/components/DropdownSelector/ListItem/index.tsx
1866
- import styled17 from "styled-components";
1867
- import { jsx as jsx20 } from "react/jsx-runtime";
1954
+ import styled18 from "styled-components";
1955
+ import { jsx as jsx21 } from "react/jsx-runtime";
1868
1956
  function ListItem(props) {
1869
1957
  const { children, ...rest } = props;
1870
- return /* @__PURE__ */ jsx20(StyledLi, { role: "option", children: /* @__PURE__ */ jsx20(ItemDiv, { ...rest, children: props.children }) });
1958
+ return /* @__PURE__ */ jsx21(StyledLi, { role: "option", children: /* @__PURE__ */ jsx21(ItemDiv, { ...rest, children: props.children }) });
1871
1959
  }
1872
- var StyledLi = styled17.li`
1960
+ var StyledLi = styled18.li`
1873
1961
  list-style: none;
1874
1962
  `;
1875
- var ItemDiv = styled17.div`
1963
+ var ItemDiv = styled18.div`
1876
1964
  display: flex;
1877
1965
  align-items: center;
1878
1966
  min-height: 40px;
@@ -1893,7 +1981,7 @@ var ItemDiv = styled17.div`
1893
1981
  `;
1894
1982
 
1895
1983
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
1896
- import { useCallback as useCallback5, useContext as useContext5 } from "react";
1984
+ import { useCallback as useCallback5, useContext as useContext7 } from "react";
1897
1985
 
1898
1986
  // src/components/DropdownSelector/MenuItem/internals/handleFocusByKeyBoard.tsx
1899
1987
  function handleFocusByKeyBoard(element, parent) {
@@ -1926,7 +2014,7 @@ function scrollIfNeeded(element) {
1926
2014
 
1927
2015
  // src/components/DropdownSelector/MenuItem/internals/useMenuItemHandleKeyDown.tsx
1928
2016
  function useMenuItemHandleKeyDown(value) {
1929
- const { setValue, root, values } = useContext5(MenuListContext);
2017
+ const { setValue, root, values } = useContext7(MenuListContext);
1930
2018
  const setContextValue = useCallback5(() => {
1931
2019
  if (value !== void 0)
1932
2020
  setValue(value);
@@ -1958,11 +2046,11 @@ function useMenuItemHandleKeyDown(value) {
1958
2046
  }
1959
2047
 
1960
2048
  // src/components/DropdownSelector/MenuItem/index.tsx
1961
- import { jsx as jsx21 } from "react/jsx-runtime";
2049
+ import { jsx as jsx22 } from "react/jsx-runtime";
1962
2050
  function MenuItem(props) {
1963
2051
  const { children, as, ...rest } = props;
1964
2052
  const [handleKeyDown, setContextValue] = useMenuItemHandleKeyDown(props.value);
1965
- return /* @__PURE__ */ jsx21(
2053
+ return /* @__PURE__ */ jsx22(
1966
2054
  ListItem,
1967
2055
  {
1968
2056
  ...rest,
@@ -1978,86 +2066,86 @@ function MenuItem(props) {
1978
2066
  }
1979
2067
 
1980
2068
  // src/components/DropdownSelector/DropdownMenuItem.tsx
1981
- import { useContext as useContext6 } from "react";
1982
- import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
2069
+ import { useContext as useContext8 } from "react";
2070
+ import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
1983
2071
  function DropdownMenuItem(props) {
1984
- const { value: ctxValue } = useContext6(MenuListContext);
2072
+ const { value: ctxValue } = useContext8(MenuListContext);
1985
2073
  const isSelected = props.value === ctxValue;
1986
2074
  const { children, ...rest } = props;
1987
2075
  return /* @__PURE__ */ jsxs11(MenuItem, { ...rest, children: [
1988
- isSelected && /* @__PURE__ */ jsx22(Text2ColorIcon, { name: "16/Check" }),
1989
- /* @__PURE__ */ jsx22(StyledSpan, { isSelected, children: props.children })
2076
+ isSelected && /* @__PURE__ */ jsx23(Text2ColorIcon, { name: "16/Check" }),
2077
+ /* @__PURE__ */ jsx23(StyledSpan, { isSelected, children: props.children })
1990
2078
  ] });
1991
2079
  }
1992
- var StyledSpan = styled18.span`
2080
+ var StyledSpan = styled19.span`
1993
2081
  ${theme((o) => [o.typography(14), o.font.text2])};
1994
2082
  display: flex;
1995
2083
  align-items: center;
1996
2084
  width: 100%;
1997
2085
  margin-left: ${({ isSelected }) => isSelected === true ? 0 : 20}px;
1998
2086
  `;
1999
- var Text2ColorIcon = styled18(Icon_default)`
2087
+ var Text2ColorIcon = styled19(Icon_default)`
2000
2088
  ${theme((o) => [o.font.text2])}
2001
2089
  padding-right: 4px;
2002
2090
  `;
2003
2091
 
2004
2092
  // src/components/DropdownSelector/MenuItemGroup/index.tsx
2005
- import styled19 from "styled-components";
2006
- import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
2093
+ import styled20 from "styled-components";
2094
+ import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
2007
2095
  function MenuItemGroup(props) {
2008
2096
  return /* @__PURE__ */ jsxs12(StyledLi2, { role: "presentation", children: [
2009
- /* @__PURE__ */ jsx23(TextSpan, { children: props.text }),
2010
- /* @__PURE__ */ jsx23(StyledUl2, { role: "group", children: props.children })
2097
+ /* @__PURE__ */ jsx24(TextSpan, { children: props.text }),
2098
+ /* @__PURE__ */ jsx24(StyledUl2, { role: "group", children: props.children })
2011
2099
  ] });
2012
2100
  }
2013
- var TextSpan = styled19.span`
2101
+ var TextSpan = styled20.span`
2014
2102
  display: block;
2015
2103
  color: ${({ theme: theme3 }) => theme3.color.text3};
2016
2104
  font-size: 12px;
2017
2105
  font-weight: bold;
2018
2106
  padding: 12px 0 8px 16px;
2019
2107
  `;
2020
- var StyledUl2 = styled19.ul`
2108
+ var StyledUl2 = styled20.ul`
2021
2109
  padding-left: 0;
2022
2110
  margin: 0;
2023
2111
  box-sizing: border-box;
2024
2112
  list-style: none;
2025
2113
  overflow: hidden;
2026
2114
  `;
2027
- var StyledLi2 = styled19.li`
2115
+ var StyledLi2 = styled20.li`
2028
2116
  display: block;
2029
2117
  `;
2030
2118
 
2031
2119
  // src/components/SegmentedControl/index.tsx
2032
- import { forwardRef as forwardRef14, memo as memo6, useMemo as useMemo2, useRef as useRef8 } from "react";
2120
+ import { forwardRef as forwardRef15, memo as memo6, useMemo as useMemo2, useRef as useRef10 } from "react";
2033
2121
  import { useRadioGroupState } from "react-stately";
2034
2122
  import {
2035
2123
  useRadio,
2036
2124
  useRadioGroup
2037
2125
  } from "@react-aria/radio";
2038
- import styled20 from "styled-components";
2126
+ import styled21 from "styled-components";
2039
2127
  import { disabledSelector as disabledSelector5 } from "@charcoal-ui/utils";
2040
2128
 
2041
2129
  // src/components/SegmentedControl/RadioGroupContext.tsx
2042
- import { createContext as createContext6, useContext as useContext7 } from "react";
2043
- import { jsx as jsx24 } from "react/jsx-runtime";
2044
- var RadioContext = createContext6(null);
2130
+ import { createContext as createContext7, useContext as useContext9 } from "react";
2131
+ import { jsx as jsx25 } from "react/jsx-runtime";
2132
+ var RadioContext = createContext7(null);
2045
2133
  var RadioProvider = ({
2046
2134
  value,
2047
2135
  children
2048
2136
  }) => {
2049
- return /* @__PURE__ */ jsx24(RadioContext.Provider, { value, children });
2137
+ return /* @__PURE__ */ jsx25(RadioContext.Provider, { value, children });
2050
2138
  };
2051
2139
  var useRadioContext = () => {
2052
- const state = useContext7(RadioContext);
2140
+ const state = useContext9(RadioContext);
2053
2141
  if (state === null)
2054
2142
  throw new Error("`<RadioProvider>` is not likely mounted.");
2055
2143
  return state;
2056
2144
  };
2057
2145
 
2058
2146
  // src/components/SegmentedControl/index.tsx
2059
- import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
2060
- var SegmentedControl = forwardRef14(
2147
+ import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
2148
+ var SegmentedControl = forwardRef15(
2061
2149
  function SegmentedControlInner(props, ref) {
2062
2150
  const ariaRadioGroupProps = useMemo2(
2063
2151
  () => ({
@@ -2076,13 +2164,13 @@ var SegmentedControl = forwardRef14(
2076
2164
  (d) => typeof d === "string" ? { value: d, label: d } : d
2077
2165
  );
2078
2166
  }, [props.data]);
2079
- return /* @__PURE__ */ jsx25(
2167
+ return /* @__PURE__ */ jsx26(
2080
2168
  SegmentedControlRoot,
2081
2169
  {
2082
2170
  ref,
2083
2171
  ...radioGroupProps,
2084
2172
  className: props.className,
2085
- children: /* @__PURE__ */ jsx25(RadioProvider, { value: state, children: segmentedControlItems.map((item) => /* @__PURE__ */ jsx25(
2173
+ children: /* @__PURE__ */ jsx26(RadioProvider, { value: state, children: segmentedControlItems.map((item) => /* @__PURE__ */ jsx26(
2086
2174
  Segmented,
2087
2175
  {
2088
2176
  value: item.value,
@@ -2098,7 +2186,7 @@ var SegmentedControl = forwardRef14(
2098
2186
  var SegmentedControl_default = memo6(SegmentedControl);
2099
2187
  var Segmented = (props) => {
2100
2188
  const state = useRadioContext();
2101
- const ref = useRef8(null);
2189
+ const ref = useRef10(null);
2102
2190
  const ariaRadioProps = useMemo2(
2103
2191
  () => ({
2104
2192
  value: props.value,
@@ -2118,19 +2206,19 @@ var Segmented = (props) => {
2118
2206
  "aria-disabled": isDisabled || state.isReadOnly,
2119
2207
  checked: isSelected,
2120
2208
  children: [
2121
- /* @__PURE__ */ jsx25(SegmentedInput, { ...inputProps, ref }),
2122
- /* @__PURE__ */ jsx25(RadioLabel2, { children: /* @__PURE__ */ jsx25(SegmentedLabelInner, { children: props.children }) })
2209
+ /* @__PURE__ */ jsx26(SegmentedInput, { ...inputProps, ref }),
2210
+ /* @__PURE__ */ jsx26(RadioLabel2, { children: /* @__PURE__ */ jsx26(SegmentedLabelInner, { children: props.children }) })
2123
2211
  ]
2124
2212
  }
2125
2213
  );
2126
2214
  };
2127
- var SegmentedControlRoot = styled20.div`
2215
+ var SegmentedControlRoot = styled21.div`
2128
2216
  display: inline-flex;
2129
2217
  align-items: center;
2130
2218
 
2131
2219
  ${theme((o) => [o.bg.surface3, o.borderRadius(16)])}
2132
2220
  `;
2133
- var SegmentedRoot = styled20.label`
2221
+ var SegmentedRoot = styled21.label`
2134
2222
  position: relative;
2135
2223
  display: flex;
2136
2224
  align-items: center;
@@ -2149,7 +2237,7 @@ var SegmentedRoot = styled20.label`
2149
2237
  checked === true ? o.font.text5 : o.font.text2
2150
2238
  ])}
2151
2239
  `;
2152
- var SegmentedInput = styled20.input`
2240
+ var SegmentedInput = styled21.input`
2153
2241
  position: absolute;
2154
2242
 
2155
2243
  height: 0px;
@@ -2163,25 +2251,25 @@ var SegmentedInput = styled20.input`
2163
2251
  white-space: nowrap;
2164
2252
  opacity: 0;
2165
2253
  `;
2166
- var RadioLabel2 = styled20.div`
2254
+ var RadioLabel2 = styled21.div`
2167
2255
  background: transparent;
2168
2256
  display: flex;
2169
2257
  align-items: center;
2170
2258
  height: 22px;
2171
2259
  `;
2172
- var SegmentedLabelInner = styled20.div`
2260
+ var SegmentedLabelInner = styled21.div`
2173
2261
  ${theme((o) => [o.typography(14)])}
2174
2262
  `;
2175
2263
 
2176
2264
  // src/components/Checkbox/index.tsx
2177
- import { forwardRef as forwardRef15, memo as memo7, useMemo as useMemo3 } from "react";
2178
- import styled21, { css as css5 } from "styled-components";
2265
+ import { forwardRef as forwardRef16, memo as memo7, useMemo as useMemo3 } from "react";
2266
+ import styled22, { css as css6 } from "styled-components";
2179
2267
  import { useCheckbox } from "@react-aria/checkbox";
2180
2268
  import { useObjectRef as useObjectRef3 } from "@react-aria/utils";
2181
2269
  import { useToggleState as useToggleState2 } from "react-stately";
2182
2270
  import { disabledSelector as disabledSelector6, px as px3 } from "@charcoal-ui/utils";
2183
- import { jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
2184
- var Checkbox = forwardRef15(
2271
+ import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
2272
+ var Checkbox = forwardRef16(
2185
2273
  function CheckboxInner({ invalid = false, ...props }, ref) {
2186
2274
  const ariaCheckboxProps = useMemo3(
2187
2275
  () => ({
@@ -2200,18 +2288,18 @@ var Checkbox = forwardRef15(
2200
2288
  const isDisabled = (props.disabled ?? false) || (props.readonly ?? false);
2201
2289
  return /* @__PURE__ */ jsxs14(InputRoot, { "aria-disabled": isDisabled, className: props.className, children: [
2202
2290
  /* @__PURE__ */ jsxs14(CheckboxRoot, { children: [
2203
- /* @__PURE__ */ jsx26(CheckboxInput, { type: "checkbox", ...inputProps, invalid }),
2204
- /* @__PURE__ */ jsx26(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ jsx26(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
2291
+ /* @__PURE__ */ jsx27(CheckboxInput, { type: "checkbox", ...inputProps, invalid }),
2292
+ /* @__PURE__ */ jsx27(CheckboxInputOverlay, { "aria-hidden": true, checked: inputProps.checked, children: /* @__PURE__ */ jsx27(Icon_default, { name: "24/Check", unsafeNonGuidelineScale: 2 / 3 }) })
2205
2293
  ] }),
2206
- "children" in props && /* @__PURE__ */ jsx26(InputLabel, { children: props.children })
2294
+ "children" in props && /* @__PURE__ */ jsx27(InputLabel, { children: props.children })
2207
2295
  ] });
2208
2296
  }
2209
2297
  );
2210
2298
  var Checkbox_default = memo7(Checkbox);
2211
- var hiddenCss = css5`
2299
+ var hiddenCss = css6`
2212
2300
  visibility: hidden;
2213
2301
  `;
2214
- var InputRoot = styled21.label`
2302
+ var InputRoot = styled22.label`
2215
2303
  position: relative;
2216
2304
  display: flex;
2217
2305
 
@@ -2223,10 +2311,10 @@ var InputRoot = styled21.label`
2223
2311
  gap: ${({ theme: theme3 }) => px3(theme3.spacing[4])};
2224
2312
  ${theme((o) => [o.disabled])}
2225
2313
  `;
2226
- var CheckboxRoot = styled21.div`
2314
+ var CheckboxRoot = styled22.div`
2227
2315
  position: relative;
2228
2316
  `;
2229
- var CheckboxInput = styled21.input`
2317
+ var CheckboxInput = styled22.input`
2230
2318
  &[type='checkbox'] {
2231
2319
  appearance: none;
2232
2320
  display: block;
@@ -2250,7 +2338,7 @@ var CheckboxInput = styled21.input`
2250
2338
  transition: all 0.2s !important;
2251
2339
  }
2252
2340
  `;
2253
- var CheckboxInputOverlay = styled21.div`
2341
+ var CheckboxInputOverlay = styled22.div`
2254
2342
  position: absolute;
2255
2343
  top: -2px;
2256
2344
  left: -2px;
@@ -2263,7 +2351,7 @@ var CheckboxInputOverlay = styled21.div`
2263
2351
 
2264
2352
  ${({ checked }) => checked !== true && hiddenCss};
2265
2353
  `;
2266
- var InputLabel = styled21.div`
2354
+ var InputLabel = styled22.div`
2267
2355
  ${theme((o) => [o.font.text2])}
2268
2356
 
2269
2357
  font-size: 14px;
@@ -2272,17 +2360,17 @@ var InputLabel = styled21.div`
2272
2360
  `;
2273
2361
 
2274
2362
  // src/components/TagItem/index.tsx
2275
- import { forwardRef as forwardRef16, memo as memo8, useMemo as useMemo4 } from "react";
2363
+ import { forwardRef as forwardRef17, memo as memo8, useMemo as useMemo4 } from "react";
2276
2364
  import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
2277
- import styled22, { css as css6 } from "styled-components";
2365
+ import styled23, { css as css7 } from "styled-components";
2278
2366
  import { disabledSelector as disabledSelector7, px as px4 } from "@charcoal-ui/utils";
2279
2367
  import { useButton } from "@react-aria/button";
2280
- import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
2368
+ import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
2281
2369
  var sizeMap = {
2282
2370
  S: 32,
2283
2371
  M: 40
2284
2372
  };
2285
- var TagItem = forwardRef16(
2373
+ var TagItem = forwardRef17(
2286
2374
  function TagItemInner({
2287
2375
  label,
2288
2376
  translatedLabel,
@@ -2314,13 +2402,13 @@ var TagItem = forwardRef16(
2314
2402
  ...buttonProps,
2315
2403
  className,
2316
2404
  children: [
2317
- /* @__PURE__ */ jsx27(Background, { bgColor, bgImage, status }),
2405
+ /* @__PURE__ */ jsx28(Background, { bgColor, bgImage, status }),
2318
2406
  /* @__PURE__ */ jsxs15(Inner, { children: [
2319
2407
  /* @__PURE__ */ jsxs15(LabelWrapper, { isTranslate: hasTranslatedLabel, children: [
2320
- hasTranslatedLabel && /* @__PURE__ */ jsx27(TranslatedLabel, { children: /* @__PURE__ */ jsx27(Label3, { children: translatedLabel }) }),
2321
- /* @__PURE__ */ jsx27(Label3, { children: label })
2408
+ hasTranslatedLabel && /* @__PURE__ */ jsx28(TranslatedLabel, { children: /* @__PURE__ */ jsx28(Label3, { children: translatedLabel }) }),
2409
+ /* @__PURE__ */ jsx28(Label3, { children: label })
2322
2410
  ] }),
2323
- status === "active" && /* @__PURE__ */ jsx27(Icon_default, { name: "16/Remove" })
2411
+ status === "active" && /* @__PURE__ */ jsx28(Icon_default, { name: "16/Remove" })
2324
2412
  ] })
2325
2413
  ]
2326
2414
  }
@@ -2328,7 +2416,7 @@ var TagItem = forwardRef16(
2328
2416
  }
2329
2417
  );
2330
2418
  var TagItem_default = memo8(TagItem);
2331
- var TagItemRoot = styled22.a`
2419
+ var TagItemRoot = styled23.a`
2332
2420
  isolation: isolate;
2333
2421
  position: relative;
2334
2422
  height: ${({ size }) => sizeMap[size]}px;
@@ -2353,7 +2441,7 @@ var TagItemRoot = styled22.a`
2353
2441
  cursor: default;
2354
2442
  }
2355
2443
  `;
2356
- var Background = styled22.div`
2444
+ var Background = styled23.div`
2357
2445
  position: absolute;
2358
2446
  z-index: 1;
2359
2447
  top: 0;
@@ -2364,7 +2452,7 @@ var Background = styled22.div`
2364
2452
  background-color: ${({ bgColor }) => bgColor};
2365
2453
  ${({ status }) => status === "inactive" && theme((o) => o.bg.surface3)}
2366
2454
 
2367
- ${({ bgImage }) => bgImage !== void 0 && css6`
2455
+ ${({ bgImage }) => bgImage !== void 0 && css7`
2368
2456
  ${theme((o) => [o.bg.surface4])}
2369
2457
  &::before {
2370
2458
  content: '';
@@ -2380,25 +2468,25 @@ var Background = styled22.div`
2380
2468
  }
2381
2469
  `}
2382
2470
  `;
2383
- var Inner = styled22.div`
2471
+ var Inner = styled23.div`
2384
2472
  display: inline-flex;
2385
2473
  gap: ${({ theme: theme3 }) => px4(theme3.spacing[8])};
2386
2474
  align-items: center;
2387
2475
  z-index: 2;
2388
2476
  `;
2389
- var labelCSS = css6`
2477
+ var labelCSS = css7`
2390
2478
  ${theme((o) => [o.typography(14).bold])}
2391
2479
  `;
2392
- var translateLabelCSS = css6`
2480
+ var translateLabelCSS = css7`
2393
2481
  display: flex;
2394
2482
  align-items: center;
2395
2483
  flex-direction: column;
2396
2484
  font-size: 10px;
2397
2485
  `;
2398
- var LabelWrapper = styled22.div`
2486
+ var LabelWrapper = styled23.div`
2399
2487
  ${({ isTranslate }) => isTranslate ?? false ? translateLabelCSS : labelCSS}
2400
2488
  `;
2401
- var Label3 = styled22.span`
2489
+ var Label3 = styled23.span`
2402
2490
  max-width: 152px;
2403
2491
  overflow: hidden;
2404
2492
  text-overflow: ellipsis;
@@ -2407,7 +2495,7 @@ var Label3 = styled22.span`
2407
2495
  color: inherit;
2408
2496
  line-height: inherit;
2409
2497
  `;
2410
- var TranslatedLabel = styled22.div`
2498
+ var TranslatedLabel = styled23.div`
2411
2499
  ${theme((o) => [o.typography(12).bold])}
2412
2500
  `;
2413
2501
  export {