@strapi/design-system 2.0.0-beta.4 → 2.0.0-beta.6

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 (168) hide show
  1. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  2. package/dist/components/Avatar/Avatar.d.ts +19 -15
  3. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  4. package/dist/components/Avatar/index.d.ts +1 -2
  5. package/dist/components/Avatar/index.d.ts.map +1 -1
  6. package/dist/components/Box/Box.d.ts +2 -2
  7. package/dist/components/Box/Box.d.ts.map +1 -1
  8. package/dist/components/Button/Button.d.ts.map +1 -1
  9. package/dist/components/Card/CardCheckbox.d.ts +6 -3
  10. package/dist/components/Card/CardCheckbox.d.ts.map +1 -1
  11. package/dist/components/Card/CardTitle.d.ts +1 -1
  12. package/dist/components/Card/CardTitle.d.ts.map +1 -1
  13. package/dist/components/Checkbox/Checkbox.d.ts +8 -7
  14. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  15. package/dist/components/Combobox/Combobox.d.ts +4 -0
  16. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  17. package/dist/components/DatePicker/DatePicker.d.ts +5 -1
  18. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  19. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  20. package/dist/components/Dialog/Dialog.d.ts +45 -7
  21. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  22. package/dist/components/Dialog/index.d.ts +1 -3
  23. package/dist/components/Dialog/index.d.ts.map +1 -1
  24. package/dist/components/Divider/Divider.d.ts +6 -2
  25. package/dist/components/Divider/Divider.d.ts.map +1 -1
  26. package/dist/components/Field/Field.d.ts +5 -1
  27. package/dist/components/Field/Field.d.ts.map +1 -1
  28. package/dist/components/Grid/Grid.d.ts +14 -5
  29. package/dist/components/Grid/Grid.d.ts.map +1 -1
  30. package/dist/components/Grid/index.d.ts +1 -2
  31. package/dist/components/Grid/index.d.ts.map +1 -1
  32. package/dist/components/IconButton/IconButton.d.ts +2 -2
  33. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  34. package/dist/components/Link/Link.d.ts +1 -1
  35. package/dist/components/Modal/Modal.d.ts +46 -0
  36. package/dist/components/Modal/Modal.d.ts.map +1 -0
  37. package/dist/components/Modal/index.d.ts +2 -0
  38. package/dist/components/Modal/index.d.ts.map +1 -0
  39. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  40. package/dist/components/Popover/Popover.d.ts +16 -16
  41. package/dist/components/Popover/Popover.d.ts.map +1 -1
  42. package/dist/components/Popover/index.d.ts +1 -3
  43. package/dist/components/Popover/index.d.ts.map +1 -1
  44. package/dist/components/ProgressBar/ProgressBar.d.ts +8 -10
  45. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  46. package/dist/components/Radio/Radio.d.ts +11 -5
  47. package/dist/components/Radio/Radio.d.ts.map +1 -1
  48. package/dist/components/Radio/index.d.ts +1 -2
  49. package/dist/components/Radio/index.d.ts.map +1 -1
  50. package/dist/components/RawTable/RawCell.d.ts.map +1 -1
  51. package/dist/components/Select/MultiSelect.d.ts +2 -2
  52. package/dist/components/Select/MultiSelect.d.ts.map +1 -1
  53. package/dist/components/Select/SelectParts.d.ts +11 -5
  54. package/dist/components/Select/SelectParts.d.ts.map +1 -1
  55. package/dist/components/Select/SingleSelect.d.ts +2 -2
  56. package/dist/components/Select/SingleSelect.d.ts.map +1 -1
  57. package/dist/components/SimpleMenu/Menu.d.ts +2 -3
  58. package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
  59. package/dist/components/SubNav/SubNavLink.d.ts.map +1 -1
  60. package/dist/components/Switch/Switch.d.ts +4 -6
  61. package/dist/components/Switch/Switch.d.ts.map +1 -1
  62. package/dist/components/Tabs/Tabs.d.ts +36 -14
  63. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  64. package/dist/components/Tabs/index.d.ts +1 -3
  65. package/dist/components/Tabs/index.d.ts.map +1 -1
  66. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  67. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  68. package/dist/components/Typography/Typography.d.ts +4 -4
  69. package/dist/components/Typography/Typography.d.ts.map +1 -1
  70. package/dist/components/index.d.ts +2 -7
  71. package/dist/components/index.d.ts.map +1 -1
  72. package/dist/hooks/useControllableState.d.ts +9 -16
  73. package/dist/hooks/useControllableState.d.ts.map +1 -1
  74. package/dist/hooks/useId.d.ts.map +1 -1
  75. package/dist/hooks/useIntersection.d.ts +3 -0
  76. package/dist/hooks/useIntersection.d.ts.map +1 -1
  77. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +12 -0
  78. package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  79. package/dist/hooks/useMeasure.d.ts +7 -0
  80. package/dist/hooks/useMeasure.d.ts.map +1 -0
  81. package/dist/index.d.ts +9 -0
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +1565 -1379
  84. package/dist/index.js.map +1 -1
  85. package/dist/index.mjs +1553 -1377
  86. package/dist/index.mjs.map +1 -1
  87. package/dist/styles/motion.d.ts +55 -0
  88. package/dist/styles/motion.d.ts.map +1 -0
  89. package/dist/themes/common-theme.d.ts +6 -2
  90. package/dist/themes/common-theme.d.ts.map +1 -1
  91. package/dist/utilities/DesignSystemProvider.d.ts.map +1 -1
  92. package/dist/utilities/DismissibleLayer/index.d.ts.map +1 -0
  93. package/dist/utilities/FocusTrap/FocusTrap.d.ts.map +1 -0
  94. package/dist/utilities/FocusTrap/index.d.ts.map +1 -0
  95. package/dist/{components → utilities}/KeyboardNavigable/KeyboardNavigable.d.ts +1 -1
  96. package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts.map +1 -0
  97. package/dist/utilities/KeyboardNavigable/index.d.ts.map +1 -0
  98. package/dist/utilities/Portal/Portal.d.ts +13 -0
  99. package/dist/utilities/Portal/Portal.d.ts.map +1 -0
  100. package/dist/utilities/Portal/index.d.ts.map +1 -0
  101. package/dist/utilities/ScrollArea/ScrollArea.d.ts +15 -0
  102. package/dist/utilities/ScrollArea/ScrollArea.d.ts.map +1 -0
  103. package/dist/utilities/ScrollArea/index.d.ts +2 -0
  104. package/dist/utilities/ScrollArea/index.d.ts.map +1 -0
  105. package/package.json +27 -18
  106. package/dist/components/Avatar/AvatarGroup.d.ts +0 -6
  107. package/dist/components/Avatar/AvatarGroup.d.ts.map +0 -1
  108. package/dist/components/Avatar/constants.d.ts +0 -3
  109. package/dist/components/Avatar/constants.d.ts.map +0 -1
  110. package/dist/components/BaseCheckbox/BaseCheckbox.d.ts +0 -22
  111. package/dist/components/BaseCheckbox/BaseCheckbox.d.ts.map +0 -1
  112. package/dist/components/BaseCheckbox/index.d.ts +0 -2
  113. package/dist/components/BaseCheckbox/index.d.ts.map +0 -1
  114. package/dist/components/BaseRadio/BaseRadio.d.ts +0 -9
  115. package/dist/components/BaseRadio/BaseRadio.d.ts.map +0 -1
  116. package/dist/components/BaseRadio/RadioGroup.d.ts +0 -18
  117. package/dist/components/BaseRadio/RadioGroup.d.ts.map +0 -1
  118. package/dist/components/BaseRadio/index.d.ts +0 -3
  119. package/dist/components/BaseRadio/index.d.ts.map +0 -1
  120. package/dist/components/Dialog/DialogBody.d.ts +0 -7
  121. package/dist/components/Dialog/DialogBody.d.ts.map +0 -1
  122. package/dist/components/Dialog/DialogFooter.d.ts +0 -7
  123. package/dist/components/Dialog/DialogFooter.d.ts.map +0 -1
  124. package/dist/components/DismissibleLayer/index.d.ts.map +0 -1
  125. package/dist/components/EmptyStateLayout/story-assets/Illo.d.ts +0 -2
  126. package/dist/components/EmptyStateLayout/story-assets/Illo.d.ts.map +0 -1
  127. package/dist/components/FocusTrap/FocusTrap.d.ts.map +0 -1
  128. package/dist/components/FocusTrap/index.d.ts.map +0 -1
  129. package/dist/components/Grid/GridItem.d.ts +0 -9
  130. package/dist/components/Grid/GridItem.d.ts.map +0 -1
  131. package/dist/components/KeyboardNavigable/KeyboardNavigable.d.ts.map +0 -1
  132. package/dist/components/KeyboardNavigable/index.d.ts.map +0 -1
  133. package/dist/components/ModalLayout/ModalBody.d.ts +0 -3
  134. package/dist/components/ModalLayout/ModalBody.d.ts.map +0 -1
  135. package/dist/components/ModalLayout/ModalContext.d.ts +0 -4
  136. package/dist/components/ModalLayout/ModalContext.d.ts.map +0 -1
  137. package/dist/components/ModalLayout/ModalFooter.d.ts +0 -7
  138. package/dist/components/ModalLayout/ModalFooter.d.ts.map +0 -1
  139. package/dist/components/ModalLayout/ModalHeader.d.ts +0 -8
  140. package/dist/components/ModalLayout/ModalHeader.d.ts.map +0 -1
  141. package/dist/components/ModalLayout/ModalLayout.d.ts +0 -7
  142. package/dist/components/ModalLayout/ModalLayout.d.ts.map +0 -1
  143. package/dist/components/ModalLayout/index.d.ts +0 -5
  144. package/dist/components/ModalLayout/index.d.ts.map +0 -1
  145. package/dist/components/Popover/primitives.d.ts +0 -4
  146. package/dist/components/Popover/primitives.d.ts.map +0 -1
  147. package/dist/components/Portal/Portal.d.ts +0 -7
  148. package/dist/components/Portal/Portal.d.ts.map +0 -1
  149. package/dist/components/Portal/index.d.ts.map +0 -1
  150. package/dist/components/Tabs/TabGroup.d.ts +0 -15
  151. package/dist/components/Tabs/TabGroup.d.ts.map +0 -1
  152. package/dist/components/Tabs/TabPanels.d.ts +0 -10
  153. package/dist/components/Tabs/TabPanels.d.ts.map +0 -1
  154. package/dist/components/Tabs/TabsContext.d.ts +0 -12
  155. package/dist/components/Tabs/TabsContext.d.ts.map +0 -1
  156. package/dist/components/Tabs/components.d.ts +0 -23
  157. package/dist/components/Tabs/components.d.ts.map +0 -1
  158. package/dist/hooks/useLockScroll.d.ts +0 -3
  159. package/dist/hooks/useLockScroll.d.ts.map +0 -1
  160. package/dist/hooks/usePrevious.d.ts +0 -2
  161. package/dist/hooks/usePrevious.d.ts.map +0 -1
  162. package/dist/styles/easings.d.ts +0 -29
  163. package/dist/styles/easings.d.ts.map +0 -1
  164. /package/dist/{components → utilities}/DismissibleLayer/index.d.ts +0 -0
  165. /package/dist/{components → utilities}/FocusTrap/FocusTrap.d.ts +0 -0
  166. /package/dist/{components → utilities}/FocusTrap/index.d.ts +0 -0
  167. /package/dist/{components → utilities}/KeyboardNavigable/index.d.ts +0 -0
  168. /package/dist/{components → utilities}/Portal/index.d.ts +0 -0
package/dist/index.js CHANGED
@@ -5,22 +5,30 @@ const date = require("@internationalized/date");
5
5
  const jsxRuntime = require("react/jsx-runtime");
6
6
  const Tooltip = require("@radix-ui/react-tooltip");
7
7
  const styledComponents = require("styled-components");
8
+ const DismissibleLayerPrimitive = require("@radix-ui/react-dismissable-layer");
8
9
  const uiPrimitives = require("@strapi/ui-primitives");
9
10
  const RadixAccordion = require("@radix-ui/react-accordion");
10
11
  const icons = require("@strapi/icons");
12
+ const Avatar$1 = require("@radix-ui/react-avatar");
11
13
  const DropdownMenu = require("@radix-ui/react-dropdown-menu");
12
- const reactUseControllableState = require("@radix-ui/react-use-controllable-state");
13
- const DismissibleLayerPrimitive = require("@radix-ui/react-dismissable-layer");
14
- const reactDom = require("react-dom");
14
+ const Checkbox = require("@radix-ui/react-checkbox");
15
+ const AlertDialog = require("@radix-ui/react-alert-dialog");
15
16
  const reactDom$1 = require("@floating-ui/react-dom");
16
17
  const reactFocusScope = require("@radix-ui/react-focus-scope");
18
+ const reactDom = require("react-dom");
17
19
  const reactRemoveScroll = require("react-remove-scroll");
18
20
  const langJson = require("@codemirror/lang-json");
19
21
  const reactCodemirror = require("@uiw/react-codemirror");
20
22
  const state = require("@codemirror/state");
21
23
  const view = require("@codemirror/view");
24
+ const Dialog$1 = require("@radix-ui/react-dialog");
25
+ const ScrollArea = require("@radix-ui/react-scroll-area");
22
26
  const number = require("@internationalized/number");
23
- const ariaHidden = require("aria-hidden");
27
+ const Popover$1 = require("@radix-ui/react-popover");
28
+ const Progress = require("@radix-ui/react-progress");
29
+ const RadioGroup = require("@radix-ui/react-radio-group");
30
+ const Switch = require("@radix-ui/react-switch");
31
+ const Tabs$1 = require("@radix-ui/react-tabs");
24
32
  function _interopNamespace(e) {
25
33
  if (e && e.__esModule)
26
34
  return e;
@@ -41,9 +49,19 @@ function _interopNamespace(e) {
41
49
  }
42
50
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
43
51
  const Tooltip__namespace = /* @__PURE__ */ _interopNamespace(Tooltip);
52
+ const DismissibleLayerPrimitive__namespace = /* @__PURE__ */ _interopNamespace(DismissibleLayerPrimitive);
44
53
  const RadixAccordion__namespace = /* @__PURE__ */ _interopNamespace(RadixAccordion);
54
+ const Avatar__namespace = /* @__PURE__ */ _interopNamespace(Avatar$1);
45
55
  const DropdownMenu__namespace = /* @__PURE__ */ _interopNamespace(DropdownMenu);
46
- const DismissibleLayerPrimitive__namespace = /* @__PURE__ */ _interopNamespace(DismissibleLayerPrimitive);
56
+ const Checkbox__namespace = /* @__PURE__ */ _interopNamespace(Checkbox);
57
+ const AlertDialog__namespace = /* @__PURE__ */ _interopNamespace(AlertDialog);
58
+ const Dialog__namespace = /* @__PURE__ */ _interopNamespace(Dialog$1);
59
+ const ScrollArea__namespace = /* @__PURE__ */ _interopNamespace(ScrollArea);
60
+ const Popover__namespace = /* @__PURE__ */ _interopNamespace(Popover$1);
61
+ const Progress__namespace = /* @__PURE__ */ _interopNamespace(Progress);
62
+ const RadioGroup__namespace = /* @__PURE__ */ _interopNamespace(RadioGroup);
63
+ const Switch__namespace = /* @__PURE__ */ _interopNamespace(Switch);
64
+ const Tabs__namespace = /* @__PURE__ */ _interopNamespace(Tabs$1);
47
65
  const createContext = (rootComponentName, defaultContext) => {
48
66
  const Context = React__namespace.createContext(defaultContext);
49
67
  const Provider2 = (props) => {
@@ -426,7 +444,7 @@ const StyledTypography = styledComponents.styled(Box)`
426
444
  text-transform: ${({ $textTransform }) => $textTransform};
427
445
  `;
428
446
  const [AccordionProvider, useAccordion] = createContext("Accordion");
429
- const Root$3 = React__namespace.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
447
+ const Root$8 = React__namespace.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
430
448
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionRoot, { ref: forwardedRef, $size: size, collapsible: true, ...props, type: "single", children: /* @__PURE__ */ jsxRuntime.jsx(AccordionProvider, { size, children }) });
431
449
  });
432
450
  const AccordionRoot = styledComponents.styled(RadixAccordion__namespace.Root)`
@@ -443,7 +461,7 @@ const AccordionRoot = styledComponents.styled(RadixAccordion__namespace.Root)`
443
461
  }
444
462
  }}
445
463
  `;
446
- const Item$2 = React__namespace.forwardRef((props, forwardedRef) => {
464
+ const Item$5 = React__namespace.forwardRef((props, forwardedRef) => {
447
465
  const { size } = useAccordion("Item");
448
466
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionItem, { $size: size, ref: forwardedRef, ...props });
449
467
  });
@@ -471,7 +489,7 @@ const AccordionItem = styledComponents.styled(RadixAccordion__namespace.Item)`
471
489
  box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
472
490
  }
473
491
  `;
474
- const Trigger$3 = React__namespace.forwardRef(
492
+ const Trigger$7 = React__namespace.forwardRef(
475
493
  ({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
476
494
  const { size } = useAccordion("Trigger");
477
495
  return /* @__PURE__ */ jsxRuntime.jsxs(AccordionTrigger, { $caretPosition: caretPosition, $size: size, ref: forwardedRef, ...restProps, children: [
@@ -499,7 +517,7 @@ const IconBox$4 = styledComponents.styled(Box)`
499
517
  color: ${(props) => props.theme.colors.neutral500};
500
518
 
501
519
  @media (prefers-reduced-motion: no-preference) {
502
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
520
+ transition: ${(props) => props.theme.transitions.color};
503
521
  }
504
522
  `;
505
523
  const TriggerIcon = styledComponents.styled(Flex).attrs((props) => ({
@@ -515,8 +533,8 @@ const TriggerIcon = styledComponents.styled(Flex).attrs((props) => ({
515
533
 
516
534
  @media (prefers-reduced-motion: no-preference) {
517
535
  transition:
518
- transform 300ms ${(props) => props.theme.easings.authenticMotion},
519
- background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
536
+ transform ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.authenticMotion},
537
+ ${(props) => props.theme.transitions.backgroundColor};
520
538
  }
521
539
  `;
522
540
  const AccordionTrigger = styledComponents.styled(RadixAccordion__namespace.Trigger)`
@@ -545,7 +563,7 @@ const AccordionTrigger = styledComponents.styled(RadixAccordion__namespace.Trigg
545
563
  }
546
564
 
547
565
  @media (prefers-reduced-motion: no-preference) {
548
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
566
+ transition: ${(props) => props.theme.transitions.color};
549
567
  }
550
568
  `;
551
569
  const Actions = React__namespace.forwardRef((props, forwardedRef) => {
@@ -566,11 +584,11 @@ const ActionWrapper = styledComponents.styled(Flex).attrs((props) => ({
566
584
  color: ${(props) => props.theme.colors.neutral600};
567
585
 
568
586
  @media (prefers-reduced-motion: no-preference) {
569
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
587
+ transition: ${(props) => props.theme.transitions.color};
570
588
  }
571
589
  }
572
590
  `;
573
- const Header = React__namespace.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
591
+ const Header$2 = React__namespace.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
574
592
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionHeader, { $variant: variant2, ref: forwardedRef, ...props });
575
593
  });
576
594
  const AccordionHeader = styledComponents.styled(RadixAccordion__namespace.Header)`
@@ -606,10 +624,10 @@ const AccordionHeader = styledComponents.styled(RadixAccordion__namespace.Header
606
624
  }
607
625
 
608
626
  @media (prefers-reduced-motion: no-preference) {
609
- transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
627
+ transition: ${(props) => props.theme.transitions.backgroundColor};
610
628
  }
611
629
  `;
612
- const Content$4 = React__namespace.forwardRef((props, forwardedRef) => {
630
+ const Content$7 = React__namespace.forwardRef((props, forwardedRef) => {
613
631
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { ref: forwardedRef, ...props });
614
632
  });
615
633
  const slideDown = styledComponents.keyframes`
@@ -633,22 +651,24 @@ const AccordionContent = styledComponents.styled(RadixAccordion__namespace.Conte
633
651
 
634
652
  @media (prefers-reduced-motion: no-preference) {
635
653
  &[data-state='open'] {
636
- animation: ${slideDown} 0.3s ${(props) => props.theme.easings.authenticMotion};
654
+ animation: ${slideDown} ${(props) => props.theme.motion.timings["320"]}
655
+ ${(props) => props.theme.motion.easings.authenticMotion};
637
656
  }
638
657
 
639
658
  &[data-state='closed'] {
640
- animation: ${slideUp} 0.3s ${(props) => props.theme.easings.authenticMotion};
659
+ animation: ${slideUp} ${(props) => props.theme.motion.timings["320"]}
660
+ ${(props) => props.theme.motion.easings.authenticMotion};
641
661
  }
642
662
  }
643
663
  `;
644
664
  const Accordion = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
645
665
  __proto__: null,
646
666
  Actions,
647
- Content: Content$4,
648
- Header,
649
- Item: Item$2,
650
- Root: Root$3,
651
- Trigger: Trigger$3
667
+ Content: Content$7,
668
+ Header: Header$2,
669
+ Item: Item$5,
670
+ Root: Root$8,
671
+ Trigger: Trigger$7
652
672
  }, Symbol.toStringTag, { value: "Module" }));
653
673
  const focus = styledComponents.css`
654
674
  position: relative;
@@ -824,88 +844,291 @@ const Alert = ({
824
844
  }
825
845
  );
826
846
  };
827
- const avatarSize = 32;
828
- const previewSize = 64;
829
- const AvatarImg = styledComponents.styled.img`
847
+ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
848
+ const callbackRef = React.useRef(callback);
849
+ React.useEffect(() => {
850
+ callbackRef.current = callback;
851
+ });
852
+ return React.useMemo(
853
+ () => (...args) => {
854
+ var _callbackRef$current;
855
+ return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
856
+ },
857
+ []
858
+ );
859
+ }
860
+ function useControllableState$1({ prop, defaultProp, onChange = () => {
861
+ } }) {
862
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
863
+ const isControlled = prop !== void 0;
864
+ const value = isControlled ? prop : uncontrolledProp;
865
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
866
+ const setValue = React__namespace.useCallback(
867
+ (nextValue) => {
868
+ if (isControlled) {
869
+ const setter = nextValue;
870
+ const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
871
+ if (value2 !== prop)
872
+ handleChange(value2);
873
+ } else {
874
+ setUncontrolledProp(nextValue);
875
+ }
876
+ },
877
+ [isControlled, prop, setUncontrolledProp, handleChange]
878
+ );
879
+ return [value, setValue];
880
+ }
881
+ function useUncontrolledState({ defaultProp, onChange }) {
882
+ const uncontrolledState = React__namespace.useState(defaultProp);
883
+ const [value] = uncontrolledState;
884
+ const prevValueRef = React__namespace.useRef(value);
885
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
886
+ React__namespace.useEffect(() => {
887
+ if (prevValueRef.current !== value) {
888
+ handleChange(value);
889
+ prevValueRef.current = value;
890
+ }
891
+ }, [value, prevValueRef, handleChange]);
892
+ return uncontrolledState;
893
+ }
894
+ const EASINGS = {
895
+ easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
896
+ easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
897
+ easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
898
+ easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
899
+ easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
900
+ easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
901
+ easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
902
+ easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
903
+ easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
904
+ easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
905
+ easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
906
+ easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
907
+ easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
908
+ easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
909
+ easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
910
+ easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
911
+ easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
912
+ easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
913
+ easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
914
+ easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
915
+ easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
916
+ easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
917
+ easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
918
+ easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
919
+ easeInOutFast: "cubic-bezier(1,0,0,1)",
920
+ authenticMotion: "cubic-bezier(.4,0,.2,1)"
921
+ };
922
+ const TIMINGS = {
923
+ "320": "320ms",
924
+ "200": "200ms",
925
+ "120": "120ms"
926
+ };
927
+ const TRANSITIONS = {
928
+ color: `color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`,
929
+ backgroundColor: `background-color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`
930
+ };
931
+ const ANIMATIONS = {
932
+ overlayFadeIn: styledComponents.keyframes`
933
+ from {
934
+ opacity: 0;
935
+ }
936
+ to {
937
+ opacity: 0.2;
938
+ }
939
+ `,
940
+ modalPopIn: styledComponents.keyframes`
941
+ from {
942
+ transform:translate(-50%, -50%) scale(0.8);
943
+ opacity: 0;
944
+ }
945
+ to {
946
+ transform: translate(-50%, -50%) scale(1);
947
+ opacity: 1;
948
+ }
949
+ `,
950
+ modalPopOut: styledComponents.keyframes`
951
+ from {
952
+ transform: translate(-50%, -50%) scale(1);
953
+ opacity: 1;
954
+ }
955
+ to {
956
+ transform:translate(-50%, -50%) scale(0.8);
957
+ opacity: 0;
958
+ }
959
+ `,
960
+ popIn: styledComponents.keyframes`
961
+ from {
962
+ transform: scale(0.8);
963
+ opacity: 0;
964
+ }
965
+ to {
966
+ transform: scale(1);
967
+ opacity: 1;
968
+ }
969
+ `,
970
+ popOut: styledComponents.keyframes`
971
+ from {
972
+ transform: scale(1);
973
+ opacity: 1;
974
+ }
975
+ to {
976
+ transform: scale(0.8);
977
+ opacity: 0;
978
+ }
979
+ `,
980
+ slideDownIn: styledComponents.keyframes`
981
+ from {
982
+ opacity: 0;
983
+ transform: translateY(-10px);
984
+ }
985
+ to {
986
+ opacity: 1;
987
+ transform: translateY(0);
988
+ }
989
+ `,
990
+ slideDownOut: styledComponents.keyframes`
991
+ from {
992
+ opacity: 1;
993
+ transform: translateY(0);
994
+ }
995
+ to {
996
+ opacity: 0;
997
+ transform: translateY(-10px);
998
+ }
999
+ `,
1000
+ slideUpIn: styledComponents.keyframes`
1001
+ from {
1002
+ opacity: 0;
1003
+ transform: translateY(10px);
1004
+ }
1005
+ to {
1006
+ opacity: 1;
1007
+ transform: translateY(0);
1008
+ }
1009
+ `,
1010
+ slideUpOut: styledComponents.keyframes`
1011
+ from {
1012
+ opacity: 1;
1013
+ transform: translateY(0);
1014
+ }
1015
+ to {
1016
+ opacity: 0;
1017
+ transform: translateY(10px);
1018
+ }
1019
+ `,
1020
+ fadeIn: styledComponents.keyframes`
1021
+ from {
1022
+ opacity: 0;
1023
+ }
1024
+ to {
1025
+ opacity: 1;
1026
+ }
1027
+ `,
1028
+ fadeOut: styledComponents.keyframes`
1029
+ from {
1030
+ opacity: 1;
1031
+ }
1032
+ to {
1033
+ opacity: 0;
1034
+ }
1035
+ `
1036
+ };
1037
+ const SIZE = 32;
1038
+ const PREVIEW_SCALE = 2;
1039
+ const Item$4 = React__namespace.forwardRef(
1040
+ ({ onLoadingStatusChange, delayMs = 600, src, alt, fallback, preview = false, ...restProps }, forwardedRef) => {
1041
+ const [loadingStatus, setLoadingStatus] = useControllableState$1({
1042
+ onChange: onLoadingStatusChange
1043
+ });
1044
+ const [tooltipOpen, setTooltipOpen] = React__namespace.useState(false);
1045
+ const hasPreview = preview && loadingStatus === "loaded";
1046
+ const handleTooltipOpen = (isOpen) => {
1047
+ if (hasPreview) {
1048
+ setTooltipOpen(isOpen);
1049
+ }
1050
+ };
1051
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip__namespace.Root, { onOpenChange: handleTooltipOpen, children: [
1052
+ /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(AvatarRoot, { ref: forwardedRef, ...restProps, children: [
1053
+ hasPreview ? /* @__PURE__ */ jsxRuntime.jsx(
1054
+ AvatarOverlay,
1055
+ {
1056
+ width: "100%",
1057
+ height: "100%",
1058
+ position: "absolute",
1059
+ background: "neutral0",
1060
+ zIndex: "overlay",
1061
+ style: { opacity: tooltipOpen ? 0.4 : 0 }
1062
+ }
1063
+ ) : null,
1064
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src, alt, onLoadingStatusChange: setLoadingStatus }),
1065
+ /* @__PURE__ */ jsxRuntime.jsx(Avatar__namespace.Fallback, { delayMs, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { fontWeight: "bold", textTransform: "uppercase", children: fallback }) })
1066
+ ] }) }),
1067
+ hasPreview ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(PreviewContent, { side: "top", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(PreviewImg, { src, alt }) }) }) : null
1068
+ ] });
1069
+ }
1070
+ );
1071
+ const avatarStyles = styledComponents.css`
1072
+ display: inline-flex;
1073
+ align-items: center;
1074
+ justify-content: center;
1075
+ vertical-align: middle;
1076
+ overflow: hidden;
1077
+ user-select: none;
1078
+ overflow: hidden;
830
1079
  border-radius: 50%;
1080
+ `;
1081
+ const imgStyles = styledComponents.css`
1082
+ width: 100%;
1083
+ height: 100%;
831
1084
  object-fit: cover;
832
- display: block;
1085
+ border-radius: inherit;
1086
+ `;
1087
+ const AvatarRoot = styledComponents.styled(Avatar__namespace.Root)`
833
1088
  position: relative;
1089
+ z-index: 0;
1090
+ ${avatarStyles}
1091
+ width: ${SIZE / 10}rem;
1092
+ height: ${SIZE / 10}rem;
1093
+ /* TODO: we should get the user email & hash it to turn it into a hex-value so different emails can consistently get a different background */
1094
+ background-color: ${(p) => p.theme.colors.primary600};
1095
+ color: ${(p) => p.theme.colors.neutral0};
1096
+ `;
1097
+ const AvatarOverlay = styledComponents.styled(Box)`
1098
+ @media (prefers-reduced-motion: no-preference) {
1099
+ transition: opacity ${(props) => props.theme.motion.timings["200"]}
1100
+ ${(props) => props.theme.motion.easings.authenticMotion};
1101
+ }
834
1102
  `;
835
- const PreviewContainer = styledComponents.styled.img`
836
- border-radius: 50%;
837
- object-fit: cover;
838
- position: absolute;
839
- transform: translate(-${(previewSize - avatarSize) / 2}px, -100%);
840
- margin-top: -${({ theme }) => theme.spaces[1]};
841
- `;
842
- const Overlay = styledComponents.styled(Box)`
843
- opacity: 0.4;
844
- `;
845
- const Avatar = ({ src, alt, preview }) => {
846
- const [previewVisible, setPreviewVisible] = React__namespace.useState(false);
847
- const isHovering = Boolean(preview && previewVisible);
848
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
849
- isHovering ? /* @__PURE__ */ jsxRuntime.jsx(
850
- PreviewContainer,
851
- {
852
- "aria-hidden": true,
853
- alt: "",
854
- width: `${previewSize}px`,
855
- height: `${previewSize}px`,
856
- src: preview === true ? src : typeof preview === "string" ? preview : ""
857
- }
858
- ) : null,
859
- /* @__PURE__ */ jsxRuntime.jsxs(
860
- Box,
861
- {
862
- zIndex: isHovering ? 1 : void 0,
863
- position: "relative",
864
- onMouseEnter: () => setPreviewVisible(true),
865
- onMouseLeave: () => setPreviewVisible(false),
866
- width: `${avatarSize}px`,
867
- height: `${avatarSize}px`,
868
- children: [
869
- isHovering ? /* @__PURE__ */ jsxRuntime.jsx(
870
- Overlay,
871
- {
872
- background: "neutral0",
873
- borderRadius: "50%",
874
- position: "absolute",
875
- width: `${avatarSize}px`,
876
- height: `${avatarSize}px`,
877
- zIndex: 1
878
- }
879
- ) : null,
880
- /* @__PURE__ */ jsxRuntime.jsx(AvatarImg, { src, alt, width: `${avatarSize}px`, height: `${avatarSize}px` })
881
- ]
882
- }
883
- )
884
- ] });
885
- };
886
- const InitialsWrapper = styledComponents.styled(Flex)`
887
- span {
888
- line-height: 0;
1103
+ const AvatarImage = styledComponents.styled(Avatar__namespace.Image)`
1104
+ ${imgStyles}
1105
+ `;
1106
+ const PreviewContent = styledComponents.styled(Tooltip__namespace.Content)`
1107
+ ${avatarStyles}
1108
+ width: ${SIZE * PREVIEW_SCALE / 10}rem;
1109
+ height: ${SIZE * PREVIEW_SCALE / 10}rem;
1110
+
1111
+ @media (prefers-reduced-motion: no-preference) {
1112
+ animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
1113
+ ${(props) => props.theme.motion.easings.authenticMotion};
889
1114
  }
890
1115
  `;
891
- const Initials = ({ children, background = "primary600", textColor = "buttonNeutral0" }) => {
892
- return /* @__PURE__ */ jsxRuntime.jsx(
893
- InitialsWrapper,
894
- {
895
- background,
896
- borderRadius: "50%",
897
- width: `${avatarSize}px`,
898
- height: `${avatarSize}px`,
899
- justifyContent: "center",
900
- children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { fontSize: 0, fontWeight: "bold", textColor, textTransform: "uppercase", children })
901
- }
902
- );
903
- };
904
- const AvatarGroup = styledComponents.styled(Flex)`
905
- & > * + * {
906
- margin-left: -${avatarSize / 2}px;
1116
+ const PreviewImg = styledComponents.styled.img`
1117
+ ${imgStyles}
1118
+ `;
1119
+ const Group$2 = React__namespace.forwardRef((props, forwarededRef) => {
1120
+ return /* @__PURE__ */ jsxRuntime.jsx(GroupFlex, { ...props, ref: forwarededRef, tag: "div" });
1121
+ });
1122
+ const GroupFlex = styledComponents.styled(Flex)`
1123
+ & > ${AvatarRoot} + ${AvatarRoot} {
1124
+ margin-left: -${SIZE / 10 / 2}rem;
907
1125
  }
908
1126
  `;
1127
+ const Avatar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1128
+ __proto__: null,
1129
+ Group: Group$2,
1130
+ Item: Item$4
1131
+ }, Symbol.toStringTag, { value: "Module" }));
909
1132
  const Badge = ({
910
1133
  active = false,
911
1134
  size = "M",
@@ -975,113 +1198,6 @@ const BaseButtonWrapper = styledComponents.styled(Flex)`
975
1198
 
976
1199
  ${focus}
977
1200
  `;
978
- function setRef(ref, value) {
979
- if (typeof ref === "function") {
980
- ref(value);
981
- } else if (ref !== null && ref !== void 0) {
982
- ref.current = value;
983
- }
984
- }
985
- function composeRefs(...refs) {
986
- return (node) => refs.forEach((ref) => setRef(ref, node));
987
- }
988
- function useComposedRefs(...refs) {
989
- return React__namespace.useCallback(composeRefs(...refs), refs);
990
- }
991
- const checkmarkIconDisabled = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='%238E8EA9'%20/%3e%3c/svg%3e";
992
- const checkmarkIcon = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='white'%20/%3e%3c/svg%3e";
993
- const BaseCheckbox = React__namespace.forwardRef(
994
- ({ indeterminate = false, name, value = false, onValueChange, ...inputProps }, forwardedRef) => {
995
- const checkboxRef = React__namespace.useRef(null);
996
- const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
997
- React__namespace.useEffect(() => {
998
- if (checkboxRef.current && indeterminate) {
999
- checkboxRef.current.indeterminate = indeterminate;
1000
- } else {
1001
- checkboxRef.current.indeterminate = false;
1002
- }
1003
- }, [indeterminate]);
1004
- const handleValueChange = () => {
1005
- if (onValueChange) {
1006
- onValueChange(!value);
1007
- }
1008
- };
1009
- return /* @__PURE__ */ jsxRuntime.jsx(
1010
- CheckboxInput,
1011
- {
1012
- checked: value,
1013
- onChange: handleValueChange,
1014
- type: "checkbox",
1015
- ref: composedRefs,
1016
- name,
1017
- ...inputProps
1018
- }
1019
- );
1020
- }
1021
- );
1022
- BaseCheckbox.displayName = "BaseCheckbox";
1023
- const CheckboxInput = styledComponents.styled.input`
1024
- min-width: 1.8rem;
1025
- height: 1.8rem;
1026
- margin: 0;
1027
- appearance: none;
1028
- border-radius: ${({ theme }) => theme.borderRadius};
1029
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1030
- background-color: ${({ theme }) => theme.colors.neutral0};
1031
- cursor: pointer;
1032
-
1033
- &:checked {
1034
- background-color: ${({ theme }) => theme.colors.primary600};
1035
- border: 1px solid ${({ theme }) => theme.colors.primary600};
1036
-
1037
- &:after {
1038
- content: '';
1039
- display: block;
1040
- position: relative;
1041
- background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
1042
- width: 1rem;
1043
- height: 1rem;
1044
- left: 50%;
1045
- top: 50%;
1046
- transform: translateX(-50%) translateY(-50%);
1047
- }
1048
-
1049
- &:disabled:after {
1050
- background: ${() => `url("${checkmarkIconDisabled}") no-repeat no-repeat center center`};
1051
- }
1052
- }
1053
-
1054
- &:disabled {
1055
- background-color: ${({ theme }) => theme.colors.neutral200};
1056
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1057
- }
1058
-
1059
- &:indeterminate {
1060
- background-color: ${({ theme }) => theme.colors.primary600};
1061
- border: 1px solid ${({ theme }) => theme.colors.primary600};
1062
-
1063
- &:after {
1064
- content: '';
1065
- display: block;
1066
- position: relative;
1067
- color: white;
1068
- height: 2px;
1069
- width: 10px;
1070
- background-color: ${({ theme }) => theme.colors.neutral0};
1071
- left: 50%;
1072
- top: 50%;
1073
- transform: translateX(-50%) translateY(-50%);
1074
- }
1075
-
1076
- &:disabled {
1077
- background-color: ${({ theme }) => theme.colors.neutral200};
1078
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1079
- &:after {
1080
- background-color: ${({ theme }) => theme.colors.neutral500};
1081
- }
1082
- }
1083
- }
1084
- `;
1085
1201
  const BaseLink = forwardRef(
1086
1202
  ({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
1087
1203
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1099,88 +1215,6 @@ const BaseLink = forwardRef(
1099
1215
  );
1100
1216
  }
1101
1217
  );
1102
- const useReactId = React__namespace["useId".toString()] || (() => void 0);
1103
- let count = 0;
1104
- const useId = (initialId) => {
1105
- const [id, setId] = React__namespace.useState(useReactId());
1106
- React__namespace.useLayoutEffect(() => {
1107
- if (!initialId)
1108
- setId((reactId) => reactId ?? String(count++));
1109
- }, [initialId]);
1110
- return initialId?.toString() ?? (id || "");
1111
- };
1112
- const setTabIndexOnFirstItem = (node, selector) => {
1113
- const list = node.querySelectorAll(selector);
1114
- if (list && list.length > 0) {
1115
- list.item(0).setAttribute("tabindex", "0");
1116
- }
1117
- };
1118
- const [RadioProvider, useRadioGroup] = createContext("RadioGroup", {
1119
- onChange: void 0,
1120
- name: "",
1121
- selected: ""
1122
- });
1123
- const RadioGroup = ({ children, labelledBy, onChange, value = "", name, ...props }) => {
1124
- const radioGroupRef = React__namespace.useRef(null);
1125
- React__namespace.useLayoutEffect(() => {
1126
- if (!value) {
1127
- setTabIndexOnFirstItem(radioGroupRef.current, `[name="${name}"]`);
1128
- }
1129
- }, [value, name]);
1130
- return /* @__PURE__ */ jsxRuntime.jsx(RadioProvider, { onChange, selected: value, name, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: radioGroupRef, role: "radiogroup", "aria-labelledby": labelledBy, ...props, children }) });
1131
- };
1132
- const BaseRadio = React__namespace.forwardRef(({ value, disabled = false, ...props }, ref) => {
1133
- const generatedId = useId();
1134
- const { onChange, selected, name } = useRadioGroup("BaseRadio");
1135
- const isSelected = selected === value;
1136
- return /* @__PURE__ */ jsxRuntime.jsx(
1137
- RadioInput,
1138
- {
1139
- ref,
1140
- type: "radio",
1141
- name,
1142
- value,
1143
- tabIndex: isSelected ? 0 : -1,
1144
- "aria-checked": isSelected,
1145
- checked: isSelected,
1146
- disabled,
1147
- id: generatedId,
1148
- onChange,
1149
- ...props
1150
- }
1151
- );
1152
- });
1153
- BaseRadio.displayName = "Radio";
1154
- const RadioInput = styledComponents.styled.input`
1155
- margin: 0;
1156
- padding: 0;
1157
- background-color: ${({ theme }) => theme.colors.neutral0};
1158
- border: 1px solid ${({ theme }) => theme.colors.primary600};
1159
- border-radius: 50%;
1160
- height: 1.8rem;
1161
- width: 1.8rem;
1162
-
1163
- &:after {
1164
- border-radius: 50%;
1165
- content: '';
1166
- position: relative;
1167
- z-index: 1;
1168
- display: block;
1169
- height: 1rem;
1170
- width: 1rem;
1171
- left: 0.3rem;
1172
- top: 0.3rem;
1173
- }
1174
-
1175
- &:checked:after {
1176
- background: ${({ theme }) => theme.colors.primary600};
1177
- }
1178
-
1179
- &:disabled {
1180
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1181
- background: ${({ theme }) => theme.colors.neutral200};
1182
- }
1183
- `;
1184
1218
  const Divider$1 = () => {
1185
1219
  return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
1186
1220
  };
@@ -1234,6 +1268,18 @@ const StyledLink = styledComponents.styled(BaseLink)`
1234
1268
  const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ...props, children });
1235
1269
  CrumbLink.displayName = "CrumbLink";
1236
1270
  const stripReactIdOfColon = (str) => str.replaceAll(":", "");
1271
+ const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
1272
+ const useIsomorphicLayoutEffect = isSSR() ? React.useEffect : React.useLayoutEffect;
1273
+ const useReactId = React__namespace["useId".toString()] || (() => void 0);
1274
+ let count = 0;
1275
+ const useId = (initialId) => {
1276
+ const [id, setId] = React__namespace.useState(useReactId());
1277
+ useIsomorphicLayoutEffect(() => {
1278
+ if (!initialId)
1279
+ setId((reactId) => reactId ?? String(count++));
1280
+ }, [initialId]);
1281
+ return initialId?.toString() ?? (id || "");
1282
+ };
1237
1283
  const useIntersection = (scrollableAreaRef, callback, { selectorToWatch, skipWhen = false }) => {
1238
1284
  const handleIntersection = uiPrimitives.useCallbackRef(callback);
1239
1285
  React__namespace.useEffect(() => {
@@ -1464,9 +1510,16 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
1464
1510
  }
1465
1511
 
1466
1512
  ${getVariantStyle}
1513
+
1514
+ @media (prefers-reduced-motion: no-preference) {
1515
+ transition:
1516
+ ${(props) => props.theme.transitions.backgroundColor},
1517
+ ${(props) => props.theme.transitions.color},
1518
+ border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
1519
+ }
1467
1520
  `;
1468
1521
  const Link = forwardRef(
1469
- ({ children, href, disabled = false, startIcon, endIcon, isExternal = true, ...props }, ref) => {
1522
+ ({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
1470
1523
  return /* @__PURE__ */ jsxRuntime.jsxs(LinkWrapper$2, { ref, href, disabled, isExternal, ...props, children: [
1471
1524
  startIcon,
1472
1525
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
@@ -1651,24 +1704,24 @@ const MenuSubContent = React__namespace.forwardRef((props, ref) => {
1651
1704
  }
1652
1705
  ) }) });
1653
1706
  });
1654
- const Root$2 = MenuRoot;
1655
- const Trigger$2 = MenuTrigger;
1656
- const Content$3 = MenuContent;
1657
- const Item$1 = MenuItem$1;
1707
+ const Root$7 = MenuRoot;
1708
+ const Trigger$6 = MenuTrigger;
1709
+ const Content$6 = MenuContent;
1710
+ const Item$3 = MenuItem$1;
1658
1711
  const Label$1 = MenuLabel;
1659
1712
  const SubRoot = MenuSubRoot;
1660
1713
  const SubTrigger = MenuSubTrigger;
1661
1714
  const SubContent = MenuSubContent;
1662
1715
  const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1663
1716
  __proto__: null,
1664
- Content: Content$3,
1665
- Item: Item$1,
1717
+ Content: Content$6,
1718
+ Item: Item$3,
1666
1719
  Label: Label$1,
1667
- Root: Root$2,
1720
+ Root: Root$7,
1668
1721
  SubContent,
1669
1722
  SubRoot,
1670
1723
  SubTrigger,
1671
- Trigger: Trigger$2
1724
+ Trigger: Trigger$6
1672
1725
  }, Symbol.toStringTag, { value: "Module" }));
1673
1726
  const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }) => {
1674
1727
  const contentRef = React__namespace.useRef(null);
@@ -1696,12 +1749,12 @@ const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, .
1696
1749
  */
1697
1750
  skipWhen: !internalIsOpen
1698
1751
  });
1699
- return /* @__PURE__ */ jsxRuntime.jsxs(Root$2, { onOpenChange: handleOpenChange, children: [
1700
- /* @__PURE__ */ jsxRuntime.jsx(Trigger$2, { ...props, children: props.label }),
1701
- /* @__PURE__ */ jsxRuntime.jsx(Content$3, { intersectionId, popoverPlacement, children })
1752
+ return /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
1753
+ /* @__PURE__ */ jsxRuntime.jsx(Trigger$6, { ...props, children: props.label }),
1754
+ /* @__PURE__ */ jsxRuntime.jsx(Content$6, { intersectionId, popoverPlacement, children })
1702
1755
  ] });
1703
1756
  };
1704
- const MenuItem = Item$1;
1757
+ const MenuItem = Item$3;
1705
1758
  const StyledButton = styledComponents.styled(SimpleMenu)`
1706
1759
  padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
1707
1760
  height: unset;
@@ -1788,12 +1841,107 @@ const CardBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(CardBadgeWrapper, {
1788
1841
  const CardBody = (props) => {
1789
1842
  return /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { ...props, alignItems: "flex-start" }) });
1790
1843
  };
1791
- const CardCheckbox = (props) => {
1792
- const { id } = useCard();
1793
- return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(BaseCheckbox, { "aria-labelledby": `${id}-title`, ...props }) });
1844
+ function setRef(ref, value) {
1845
+ if (typeof ref === "function") {
1846
+ ref(value);
1847
+ } else if (ref !== null && ref !== void 0) {
1848
+ ref.current = value;
1849
+ }
1850
+ }
1851
+ function composeRefs(...refs) {
1852
+ return (node) => refs.forEach((ref) => setRef(ref, node));
1853
+ }
1854
+ function useComposedRefs(...refs) {
1855
+ return React__namespace.useCallback(composeRefs(...refs), refs);
1856
+ }
1857
+ const CheckIcon = ({ fill, ...props }) => {
1858
+ const { colors } = styledComponents.useTheme();
1859
+ return /* @__PURE__ */ jsxRuntime.jsx(
1860
+ Box,
1861
+ {
1862
+ tag: "svg",
1863
+ viewBox: "0 0 10 8",
1864
+ xmlns: "http://www.w3.org/2000/svg",
1865
+ fill: fill ? colors[fill] : void 0,
1866
+ ...props,
1867
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.55323 0.396973C8.63135 0.316355 8.76051 0.315811 8.83931 0.395768L9.86256 1.43407C9.93893 1.51157 9.93935 1.6359 9.86349 1.7139L4.06401 7.67724C3.9859 7.75755 3.85707 7.75805 3.77834 7.67834L0.13866 3.99333C0.0617798 3.91549 0.0617102 3.79032 0.138504 3.7124L1.16213 2.67372C1.24038 2.59432 1.36843 2.59422 1.4468 2.67348L3.92174 5.17647L8.55323 0.396973Z" })
1868
+ }
1869
+ );
1794
1870
  };
1795
- const BreakBox = styledComponents.styled(Box)`
1796
- word-break: break-all;
1871
+ const CheckboxEl = React__namespace.forwardRef(
1872
+ ({ defaultChecked, checked: checkedProp, onCheckedChange, ...props }, forwardedRef) => {
1873
+ const checkboxRef = React__namespace.useRef(null);
1874
+ const [checked, setChecked] = useControllableState$1({
1875
+ defaultProp: defaultChecked,
1876
+ prop: checkedProp,
1877
+ onChange: onCheckedChange
1878
+ });
1879
+ const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
1880
+ return /* @__PURE__ */ jsxRuntime.jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Checkbox__namespace.Indicator, { children: [
1881
+ checked === true ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { width: "1rem", fill: "neutral0" }) : null,
1882
+ checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(Box, { height: "2px", width: "1rem", background: "neutral0", borderRadius: "1px" }) : null
1883
+ ] }) });
1884
+ }
1885
+ );
1886
+ const CheckboxRoot = styledComponents.styled(Checkbox__namespace.Root)`
1887
+ background: ${(props) => props.theme.colors.neutral0};
1888
+ width: 2rem;
1889
+ height: 2rem;
1890
+ border-radius: ${(props) => props.theme.borderRadius};
1891
+ border: 1px solid ${(props) => props.theme.colors.neutral300};
1892
+ position: relative;
1893
+ z-index: 0;
1894
+ display: flex;
1895
+ justify-content: center;
1896
+ align-items: center;
1897
+ // this ensures the checkbox is always a square even in flex-containers.
1898
+ flex: 0 0 2rem;
1899
+
1900
+ @media (prefers-reduced-motion: no-preference) {
1901
+ transition:
1902
+ border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
1903
+ ${(props) => props.theme.transitions.backgroundColor};
1904
+ }
1905
+
1906
+ &[data-state='checked'],
1907
+ &[data-state='indeterminate'] {
1908
+ border: 1px solid ${(props) => props.theme.colors.primary600};
1909
+ background-color: ${(props) => props.theme.colors.primary600};
1910
+ }
1911
+
1912
+ &[data-disabled] {
1913
+ background-color: ${(props) => props.theme.colors.neutral200};
1914
+ }
1915
+
1916
+ /* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
1917
+ &::before {
1918
+ content: '';
1919
+ position: absolute;
1920
+ top: 50%;
1921
+ left: 50%;
1922
+ transform: translate(-50%, -50%);
1923
+ width: 100%;
1924
+ height: 100%;
1925
+ min-width: 44px;
1926
+ min-height: 44px;
1927
+ }
1928
+ `;
1929
+ const CheckboxImpl = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
1930
+ const labelId = useId(restProps.id);
1931
+ if (!children) {
1932
+ return /* @__PURE__ */ jsxRuntime.jsx(CheckboxEl, { ref: forwardedRef, ...restProps });
1933
+ }
1934
+ return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
1935
+ /* @__PURE__ */ jsxRuntime.jsx(CheckboxEl, { id: labelId, ...restProps }),
1936
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
1937
+ ] });
1938
+ });
1939
+ const CardCheckbox = (props) => {
1940
+ const { id } = useCard();
1941
+ return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
1942
+ };
1943
+ const BreakBox = styledComponents.styled(Box)`
1944
+ word-break: break-all;
1797
1945
  `;
1798
1946
  const CardContent = ({ children, ...props }) => {
1799
1947
  return /* @__PURE__ */ jsxRuntime.jsx(BreakBox, { ...props, children });
@@ -1871,14 +2019,6 @@ const TooltipImpl = React__namespace.forwardRef(
1871
2019
  );
1872
2020
  }
1873
2021
  );
1874
- const fadeIn = styledComponents.keyframes`
1875
- from {
1876
- opacity: 0;
1877
- }
1878
- to {
1879
- opacity: 1;
1880
- }
1881
- `;
1882
2022
  const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
1883
2023
  background-color: ${(props) => props.theme.colors.neutral900};
1884
2024
  color: ${(props) => props.theme.colors.neutral0};
@@ -1890,7 +2030,8 @@ const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
1890
2030
  transform-origin: var(--radix-tooltip-content-transform-origin);
1891
2031
 
1892
2032
  @media (prefers-reduced-motion: no-preference) {
1893
- animation: ${fadeIn} 200ms ${(props) => props.theme.easings.authenticMotion};
2033
+ animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
2034
+ ${(props) => props.theme.motion.easings.authenticMotion};
1894
2035
  }
1895
2036
  `;
1896
2037
  const CarouselGrid = styledComponents.styled(Box)`
@@ -1963,34 +2104,6 @@ const Carousel = React__namespace.forwardRef(
1963
2104
  ] }) });
1964
2105
  }
1965
2106
  );
1966
- const EASINGS = {
1967
- easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
1968
- easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
1969
- easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
1970
- easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
1971
- easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
1972
- easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
1973
- easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
1974
- easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
1975
- easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
1976
- easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
1977
- easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
1978
- easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
1979
- easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
1980
- easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
1981
- easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
1982
- easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
1983
- easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
1984
- easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
1985
- easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
1986
- easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
1987
- easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
1988
- easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
1989
- easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
1990
- easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
1991
- easeInOutFast: "cubic-bezier(1,0,0,1)",
1992
- authenticMotion: "cubic-bezier(.4,0,.2,1)"
1993
- };
1994
2107
  const sizes = {
1995
2108
  accordions: {
1996
2109
  S: `4.8rem`,
@@ -2026,7 +2139,11 @@ const commonTheme = {
2026
2139
  semiBold: 500,
2027
2140
  bold: 600
2028
2141
  },
2029
- easings: EASINGS
2142
+ transitions: TRANSITIONS,
2143
+ motion: {
2144
+ easings: EASINGS,
2145
+ timings: TIMINGS
2146
+ }
2030
2147
  };
2031
2148
  const lightColorTokenObject = {
2032
2149
  color: {
@@ -2854,7 +2971,7 @@ lodash.exports;
2854
2971
  }
2855
2972
  var runInContext = function runInContext2(context) {
2856
2973
  context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
2857
- var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
2974
+ var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
2858
2975
  var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
2859
2976
  var coreJsData = context["__core-js_shared__"];
2860
2977
  var funcToString = funcProto.toString;
@@ -2880,7 +2997,7 @@ lodash.exports;
2880
2997
  }
2881
2998
  }();
2882
2999
  var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
2883
- var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
3000
+ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse;
2884
3001
  var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
2885
3002
  var metaMap = WeakMap && new WeakMap();
2886
3003
  var realNames = {};
@@ -4626,7 +4743,7 @@ lodash.exports;
4626
4743
  return setWrapToString(result2, func, bitmask);
4627
4744
  }
4628
4745
  function createRound(methodName) {
4629
- var func = Math2[methodName];
4746
+ var func = Math[methodName];
4630
4747
  return function(number2, precision) {
4631
4748
  number2 = toNumber(number2);
4632
4749
  precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
@@ -7681,7 +7798,7 @@ const getThemeSize = (type) => {
7681
7798
  };
7682
7799
  const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) => styledComponents.css`
7683
7800
  outline: none;
7684
- box-shadow: 0;
7801
+ box-shadow: none;
7685
7802
  transition-property: border-color, box-shadow, fill;
7686
7803
  transition-duration: 0.2s;
7687
7804
 
@@ -7691,7 +7808,7 @@ const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) =>
7691
7808
  }
7692
7809
  `;
7693
7810
  const [FieldProvider, useField] = createContext("Field", {});
7694
- const Root$1 = React__namespace.forwardRef(
7811
+ const Root$6 = React__namespace.forwardRef(
7695
7812
  ({ children, name, error = false, hint, id, required = false, ...props }, ref) => {
7696
7813
  const generatedId = useId(id);
7697
7814
  const [labelNode, setLabelNode] = React__namespace.useState();
@@ -7721,7 +7838,6 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
7721
7838
  {
7722
7839
  ref: composedRefs,
7723
7840
  display: "flex",
7724
- alignItems: "center",
7725
7841
  variant: "pi",
7726
7842
  textColor: "neutral800",
7727
7843
  fontWeight: "bold",
@@ -7750,6 +7866,7 @@ const Input$2 = React__namespace.forwardRef(
7750
7866
  hasError: hasErrorProp,
7751
7867
  required: requiredProp,
7752
7868
  className,
7869
+ size = "M",
7753
7870
  ...props
7754
7871
  }, ref) => {
7755
7872
  const { id, error, hint, name, required } = useField("Input");
@@ -7768,10 +7885,6 @@ const Input$2 = React__namespace.forwardRef(
7768
7885
  return /* @__PURE__ */ jsxRuntime.jsxs(
7769
7886
  InputWrapper,
7770
7887
  {
7771
- paddingLeft: 3,
7772
- paddingRight: 3,
7773
- paddingTop: 2,
7774
- paddingBottom: 2,
7775
7888
  gap: 2,
7776
7889
  justifyContent: "space-between",
7777
7890
  $hasError: hasError || hasErrorProp,
@@ -7785,13 +7898,14 @@ const Input$2 = React__namespace.forwardRef(
7785
7898
  id,
7786
7899
  name,
7787
7900
  ref,
7901
+ $hasLeftAction: Boolean(startAction),
7902
+ $hasRightAction: Boolean(endAction),
7903
+ $size: size,
7788
7904
  "aria-describedby": ariaDescription,
7789
7905
  "aria-invalid": hasError || hasErrorProp,
7790
7906
  "aria-disabled": disabled,
7791
7907
  disabled,
7792
7908
  "data-disabled": disabled ? "" : void 0,
7793
- $hasLeftAction: Boolean(startAction),
7794
- $hasRightAction: Boolean(endAction),
7795
7909
  onChange: handleChange,
7796
7910
  "aria-required": required || requiredProp,
7797
7911
  ...props
@@ -7816,6 +7930,23 @@ const InputElement = styledComponents.styled.input`
7816
7930
  width: 100%;
7817
7931
  background: inherit;
7818
7932
 
7933
+ ${(props) => {
7934
+ switch (props.$size) {
7935
+ case "S":
7936
+ return styledComponents.css`
7937
+ padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7938
+ padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7939
+ padding-block: ${props.theme.spaces[1]};
7940
+ `;
7941
+ default:
7942
+ return styledComponents.css`
7943
+ padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7944
+ padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
7945
+ padding-block: ${props.theme.spaces[2]};
7946
+ `;
7947
+ }
7948
+ }};
7949
+
7819
7950
  ::placeholder {
7820
7951
  color: ${({ theme }) => theme.colors.neutral500};
7821
7952
  opacity: 1;
@@ -7856,7 +7987,7 @@ const Error$1 = () => {
7856
7987
  }
7857
7988
  return /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", tag: "p", id: `${id}-error`, textColor: "danger600", "data-strapi-field-error": true, children: error });
7858
7989
  };
7859
- const Action = React__namespace.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7990
+ const Action$1 = React__namespace.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7860
7991
  FieldActionWrapper,
7861
7992
  {
7862
7993
  justifyContent: "unset",
@@ -7875,12 +8006,12 @@ const FieldActionWrapper = styledComponents.styled(Flex)`
7875
8006
  `;
7876
8007
  const Field = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7877
8008
  __proto__: null,
7878
- Action,
8009
+ Action: Action$1,
7879
8010
  Error: Error$1,
7880
8011
  Hint,
7881
8012
  Input: Input$2,
7882
8013
  Label,
7883
- Root: Root$1,
8014
+ Root: Root$6,
7884
8015
  useField
7885
8016
  }, Symbol.toStringTag, { value: "Module" }));
7886
8017
  const CarouselInput = React__namespace.forwardRef(
@@ -7902,7 +8033,7 @@ const CarouselInput = React__namespace.forwardRef(
7902
8033
  ...props
7903
8034
  }, forwardedRef) => {
7904
8035
  const generatedId = useId(id);
7905
- return /* @__PURE__ */ jsxRuntime.jsx(Root$1, { hint, error, id: generatedId, required, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
8036
+ return /* @__PURE__ */ jsxRuntime.jsx(Root$6, { hint, error, id: generatedId, required, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
7906
8037
  label && /* @__PURE__ */ jsxRuntime.jsx(Label, { action: labelAction, children: label }),
7907
8038
  /* @__PURE__ */ jsxRuntime.jsx(
7908
8039
  Carousel,
@@ -7966,21 +8097,6 @@ const CarouselSlide = ({ label, children, selected = false, ...props }) => /* @_
7966
8097
  children
7967
8098
  }
7968
8099
  );
7969
- const Checkbox = React__namespace.forwardRef(
7970
- ({ children, disabled = false, ...props }, forwardedRef) => {
7971
- return /* @__PURE__ */ jsxRuntime.jsxs(CheckboxLabel, { tag: "label", textColor: "neutral800", $disabled: disabled, children: [
7972
- /* @__PURE__ */ jsxRuntime.jsx(BaseCheckbox, { ref: forwardedRef, disabled, ...props }),
7973
- /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 2, children })
7974
- ] });
7975
- }
7976
- );
7977
- const CheckboxLabel = styledComponents.styled(Typography)`
7978
- display: flex;
7979
- align-items: flex-start;
7980
- * {
7981
- cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
7982
- }
7983
- `;
7984
8100
  const loaderSvg = "data:image/svg+xml,%3csvg%20width='63'%20height='63'%20viewBox='0%200%2063%2063'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.5563%2011.9816C39.484%2010.3071%2035.8575%209.29097%2032.3354%209.13521C28.6443%208.92888%2024.8295%209.72318%2021.3336%2011.4129C20.9123%2011.5901%2020.5376%2011.8101%2020.1722%2012.0249L20.0108%2012.1179C19.8774%2012.1951%2019.7441%2012.2724%2019.608%2012.3536C19.3253%2012.5146%2019.0492%2012.6744%2018.7544%2012.8792C18.5463%2013.0329%2018.3395%2013.1759%2018.1301%2013.323C17.5658%2013.7208%2016.9868%2014.1317%2016.4983%2014.5979C14.8476%2015.9524%2013.5571%2017.6075%2012.6071%2018.9214C10.4365%2022.1566%209.08622%2025.9567%208.80702%2029.6143L8.7764%2030.1588C8.73328%2030.9196%208.68476%2031.7057%208.75353%2032.4555C8.76648%2032.6084%208.7661%2032.7638%208.77506%2032.914C8.78895%2033.229%208.80152%2033.5373%208.846%2033.8672L9.07396%2035.4221C9.09756%2035.5764%209.1198%2035.7413%209.1633%2035.9263L9.65919%2037.9272L10.138%2039.2823C10.2729%2039.6673%2010.4158%2040.0751%2010.6%2040.43C12.0292%2043.637%2014.1425%2046.4578%2016.7063%2048.585C19.0508%2050.5296%2021.824%2052.0023%2024.7491%2052.8452L26.2371%2053.2376C26.3781%2053.2693%2026.4926%2053.2889%2026.6031%2053.3058L26.7775%2053.3311C27.0052%2053.3636%2027.2195%2053.3986%2027.4445%2053.435C27.8598%2053.5076%2028.2672%2053.5748%2028.7079%2053.6183L30.5641%2053.7229C30.9516%2053.7249%2031.3352%2053.7068%2031.7081%2053.6874C31.9039%2053.681%2032.0984%2053.6681%2032.3288%2053.662C34.5253%2053.4772%2036.5106%2053.0634%2038.0516%2052.4652C38.1769%2052.4171%2038.3008%2052.3796%2038.4234%2052.3355C38.6727%2052.2499%2038.9259%2052.167%2039.1432%2052.0599L40.8591%2051.2626L42.5702%2050.266C42.9009%2050.0682%2043.0205%2049.6414%2042.8282%2049.2984C42.632%2048.9526%2042.2034%2048.8308%2041.8634%2049.0166L40.1792%2049.9218L38.4995%2050.6224C38.3169%2050.6953%2038.121%2050.7534%2037.9224%2050.8155C37.7838%2050.8489%2037.6518%2050.8983%2037.5012%2050.9408C36.0711%2051.435%2034.2445%2051.7425%2032.244%2051.8346C32.0442%2051.8383%2031.8471%2051.8379%2031.654%2051.8403C31.3051%2051.8414%2030.9602%2051.8451%2030.6392%2051.8305L28.9177%2051.6725C28.5476%2051.619%2028.1695%2051.5427%2027.7848%2051.4678C27.5639%2051.4167%2027.3376%2051.3737%2027.1299%2051.3374L26.9529%2051.2987C26.8704%2051.2834%2026.7772%2051.2667%2026.7333%2051.2543L25.3466%2050.8322C22.7651%2049.9789%2020.33%2048.5729%2018.2942%2046.7557C16.1056%2044.7951%2014.3339%2042.2335%2013.1742%2039.3582C12.0276%2036.6013%2011.5988%2033.2792%2011.9716%2030.0076C12.3145%2027.0213%2013.3948%2024.1635%2015.1858%2021.5083C15.3034%2021.3339%2015.421%2021.1596%2015.5212%2021.0196C16.4309%2019.8688%2017.5408%2018.5589%2018.9483%2017.496C19.3367%2017.1525%2019.7862%2016.856%2020.2611%2016.5478C20.4878%2016.4009%2020.7079%2016.2553%2020.8907%2016.1306C21.0974%2016.0048%2021.3188%2015.8831%2021.5348%2015.7694C21.6761%2015.6975%2021.8162%2015.619%2021.9388%2015.5576L22.1002%2015.4646C22.4002%2015.3037%2022.6749%2015.1546%2022.9908%2015.039L24.1186%2014.5715C24.3399%2014.4844%2024.5718%2014.4159%2024.7997%2014.3447C24.953%2014.2982%2025.0982%2014.2635%2025.2635%2014.2078C25.786%2014.0182%2026.3283%2013.9112%2026.9105%2013.7965C27.117%2013.7571%2027.3302%2013.7163%2027.5608%2013.6585C27.7553%2013.611%2027.9737%2013.5969%2028.2082%2013.5762C28.364%2013.5603%2028.5172%2013.5483%2028.6318%2013.5333C28.7876%2013.5173%2028.9342%2013.5066%2029.0927%2013.4867C29.3285%2013.4555%2029.5456%2013.4347%2029.7494%2013.4337C30.0237%2013.44%2030.2994%2013.4357%2030.5777%2013.4274C31.0811%2013.421%2031.5579%2013.4197%2032.0318%2013.4914C34.9664%2013.7352%2037.7144%2014.6085%2040.2052%2016.0868C42.3489%2017.3655%2044.2716%2019.1525%2045.7607%2021.264C47.0255%2023.0628%2047.9756%2025.0528%2048.4928%2027.0393C48.572%2027.3176%2048.6299%2027.5931%2048.6839%2027.8659C48.7154%2028.0428%2048.7563%2028.2145%2048.7892%2028.3636C48.8037%2028.4541%2048.8208%2028.5406%2048.8445%2028.6258C48.8749%2028.7443%2048.8986%2028.864%2048.9116%2028.9651L48.9793%2029.6047C48.9922%2029.7748%2049.0132%2029.9331%2049.0301%2030.0887C49.0668%2030.3268%2049.0889%2030.5608%2049.0964%2030.7561L49.1083%2031.9001C49.1312%2032.3307%2049.089%2032.7116%2049.0522%2033.0673C49.0384%2033.2598%2049.0126%2033.4443%2049.0123%2033.5824C48.9961%2033.6926%2048.9918%2033.7935%2048.9836%2033.8917C48.9753%2034.0072%2048.9724%2034.1148%2048.9414%2034.2554L48.5449%2036.3059C48.3134%2037.8623%2049.3793%2039.3365%2050.9488%2039.5822C52.0417%2039.7601%2053.1536%2039.2819%2053.7711%2038.3664C54.0063%2038.0176%2054.1604%2037.6257%2054.2227%2037.2064L54.5217%2035.2574C54.5514%2035.0756%2054.572%2034.83%2054.5846%2034.5791L54.6028%2034.2338C54.6098%2034.0598%2054.6223%2033.8779%2054.6347%2033.6788C54.6734%2033.1052%2054.7163%2032.4479%2054.6619%2031.8058L54.5867%2030.4289C54.5622%2030.0952%2054.5097%2029.76%2054.4559%2029.4181C54.431%2029.2572%2054.4048%2029.0896%2054.3826%2028.9074L54.2687%2028.104C54.2332%2027.9244%2054.1804%2027.7273%2054.1329%2027.5396L54.0643%2027.2454C54.0195%2027.071%2053.9773%2026.8927%2053.9338%2026.7076C53.8455%2026.3309%2053.7479%2025.9422%2053.613%2025.5571C52.84%2023.0292%2051.5383%2020.5194%2049.8338%2018.2799C47.8544%2015.682%2045.3333%2013.5087%2042.5563%2011.9816Z'%20fill='%234945FF'/%3e%3c/svg%3e";
7985
8101
  const Loader = React__namespace.forwardRef(({ children, small = false, ...props }, ref) => {
7986
8102
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "alert", "aria-live": "assertive", ref, ...props, children: [
@@ -8034,22 +8150,23 @@ const Combobox = React__namespace.forwardRef(
8034
8150
  onLoadMore,
8035
8151
  placeholder = "Select or enter a value",
8036
8152
  required: requiredProp = false,
8153
+ size = "M",
8037
8154
  startIcon,
8038
8155
  textValue,
8039
8156
  value,
8040
8157
  ...restProps
8041
8158
  }, forwardedRef) => {
8042
- const [internalIsOpen, setInternalIsOpen] = reactUseControllableState.useControllableState({
8159
+ const [internalIsOpen, setInternalIsOpen] = useControllableState$1({
8043
8160
  prop: open,
8044
8161
  defaultProp: defaultOpen,
8045
8162
  onChange: onOpenChange
8046
8163
  });
8047
- const [internalTextValue, setInternalTextValue] = reactUseControllableState.useControllableState({
8164
+ const [internalTextValue, setInternalTextValue] = useControllableState$1({
8048
8165
  prop: textValue,
8049
8166
  defaultProp: allowCustomValue && !defaultTextValue ? value : defaultTextValue,
8050
8167
  onChange: onTextValueChange
8051
8168
  });
8052
- const [internalFilterValue, setInternalFilterValue] = reactUseControllableState.useControllableState({
8169
+ const [internalFilterValue, setInternalFilterValue] = useControllableState$1({
8053
8170
  prop: filterValue,
8054
8171
  defaultProp: defaultFilterValue,
8055
8172
  onChange: onFilterValueChange
@@ -8133,9 +8250,9 @@ const Combobox = React__namespace.forwardRef(
8133
8250
  onFilterValueChange: handleFilterValueChange,
8134
8251
  isPrintableCharacter: isPrintableCharacter2,
8135
8252
  children: [
8136
- /* @__PURE__ */ jsxRuntime.jsxs(Trigger$1, { $hasError: hasError, className, children: [
8253
+ /* @__PURE__ */ jsxRuntime.jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
8137
8254
  /* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
8138
- startIcon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }) : null,
8255
+ startIcon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
8139
8256
  /* @__PURE__ */ jsxRuntime.jsx(
8140
8257
  TextInput$1,
8141
8258
  {
@@ -8172,7 +8289,7 @@ const Combobox = React__namespace.forwardRef(
8172
8289
  /* @__PURE__ */ jsxRuntime.jsx(DownIcon$1, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}) })
8173
8290
  ] })
8174
8291
  ] }),
8175
- /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$2, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport$1, { ref: viewportRef, children: [
8292
+ /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport$1, { ref: viewportRef, children: [
8176
8293
  children,
8177
8294
  creatable ? /* @__PURE__ */ jsxRuntime.jsx(
8178
8295
  uiPrimitives.Combobox.CreateItem,
@@ -8195,13 +8312,9 @@ const Combobox = React__namespace.forwardRef(
8195
8312
  const IconBox$3 = styledComponents.styled(Box)`
8196
8313
  padding: 0;
8197
8314
  `;
8198
- const Trigger$1 = styledComponents.styled(uiPrimitives.Combobox.Trigger)`
8315
+ const Trigger$5 = styledComponents.styled(uiPrimitives.Combobox.Trigger)`
8199
8316
  position: relative;
8200
8317
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
8201
- padding-right: ${({ theme }) => theme.spaces[3]};
8202
- padding-left: ${({ theme }) => theme.spaces[3]};
8203
- padding-top: ${({ theme }) => theme.spaces[2]};
8204
- padding-bottom: ${({ theme }) => theme.spaces[2]};
8205
8318
  border-radius: ${({ theme }) => theme.borderRadius};
8206
8319
  background: ${({ theme }) => theme.colors.neutral0};
8207
8320
  overflow: hidden;
@@ -8210,6 +8323,23 @@ const Trigger$1 = styledComponents.styled(uiPrimitives.Combobox.Trigger)`
8210
8323
  justify-content: space-between;
8211
8324
  gap: ${({ theme }) => theme.spaces[4]};
8212
8325
 
8326
+ ${(props) => {
8327
+ switch (props.$size) {
8328
+ case "S":
8329
+ return styledComponents.css`
8330
+ padding-inline-start: ${({ theme }) => theme.spaces[4]};
8331
+ padding-inline-end: ${({ theme }) => theme.spaces[3]};
8332
+ padding-block: ${({ theme }) => theme.spaces[1]};
8333
+ `;
8334
+ default:
8335
+ return styledComponents.css`
8336
+ padding-inline-start: ${({ theme }) => theme.spaces[4]};
8337
+ padding-inline-end: ${({ theme }) => theme.spaces[3]};
8338
+ padding-block: ${({ theme }) => theme.spaces[2]};
8339
+ `;
8340
+ }
8341
+ }}
8342
+
8213
8343
  &[data-disabled] {
8214
8344
  color: ${({ theme }) => theme.colors.neutral600};
8215
8345
  background: ${({ theme }) => theme.colors.neutral150};
@@ -8250,7 +8380,7 @@ const DownIcon$1 = styledComponents.styled(uiPrimitives.Combobox.Icon)`
8250
8380
  cursor: inherit;
8251
8381
  }
8252
8382
  `;
8253
- const Content$2 = styledComponents.styled(uiPrimitives.Combobox.Content)`
8383
+ const Content$5 = styledComponents.styled(uiPrimitives.Combobox.Content)`
8254
8384
  background: ${({ theme }) => theme.colors.neutral0};
8255
8385
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
8256
8386
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
@@ -8259,6 +8389,23 @@ const Content$2 = styledComponents.styled(uiPrimitives.Combobox.Content)`
8259
8389
  /* This is from the design-system figma file. */
8260
8390
  max-height: 15rem;
8261
8391
  z-index: ${({ theme }) => theme.zIndices.popover};
8392
+
8393
+ @media (prefers-reduced-motion: no-preference) {
8394
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
8395
+
8396
+ /* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
8397
+ &[data-state='open'] {
8398
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
8399
+
8400
+ &[data-side='top'] {
8401
+ animation-name: ${ANIMATIONS.slideDownIn};
8402
+ }
8403
+
8404
+ &[data-side='bottom'] {
8405
+ animation-name: ${ANIMATIONS.slideUpIn};
8406
+ }
8407
+ }
8408
+ }
8262
8409
  `;
8263
8410
  const Viewport$1 = styledComponents.styled(uiPrimitives.Combobox.Viewport)`
8264
8411
  padding: ${({ theme }) => theme.spaces[1]};
@@ -8295,170 +8442,137 @@ const OptionBox = styledComponents.styled.div`
8295
8442
  font-weight: bold;
8296
8443
  }
8297
8444
  `;
8298
- const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
8299
- const useLockScroll = (lockScroll) => {
8300
- React__namespace.useEffect(() => {
8301
- if (lockScroll) {
8302
- document.body.classList.add("lock-body-scroll");
8303
- }
8304
- return () => {
8305
- document.body.classList.remove("lock-body-scroll");
8306
- };
8307
- }, [lockScroll]);
8308
- };
8309
- const DismissibleLayer = DismissibleLayerPrimitive__namespace.Root;
8310
- const getFocusableNodes = (node, includeNegativeTabIndex) => {
8311
- const nodes = [
8312
- ...node.querySelectorAll(
8313
- 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
8314
- )
8315
- ];
8316
- const focusables = nodes.filter((node2) => {
8317
- if (node2.hasAttribute("disabled"))
8318
- return false;
8319
- if (includeNegativeTabIndex)
8320
- return true;
8321
- return node2.getAttribute("tabindex") !== "-1";
8322
- });
8323
- return focusables;
8324
- };
8325
- const getFocusableNodesWithKeyboardNav = (nodes) => {
8326
- return nodes.filter((node) => {
8327
- if (node.tagName === "INPUT") {
8328
- return node.type !== "checkbox" && node.type !== "radio";
8329
- }
8330
- return false;
8331
- });
8332
- };
8333
- const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
8334
- const trappedRef = React__namespace.useRef(null);
8335
- React__namespace.useEffect(() => {
8336
- let currentFocus = null;
8337
- if (restoreFocus) {
8338
- currentFocus = document.activeElement;
8339
- }
8340
- return () => {
8341
- if (currentFocus) {
8342
- currentFocus.focus();
8343
- }
8344
- };
8345
- }, [restoreFocus]);
8346
- React__namespace.useEffect(() => {
8347
- if (!trappedRef.current || skipAutoFocus)
8348
- return;
8349
- const focusableChildren = getFocusableNodes(trappedRef.current);
8350
- if (focusableChildren.length > 0) {
8351
- const firstElement = focusableChildren[0];
8352
- firstElement.focus();
8353
- } else {
8354
- console.warn(
8355
- "[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
8356
- );
8357
- }
8358
- }, [skipAutoFocus]);
8359
- const handleKeyDown = (e) => {
8360
- if (e.key === KeyboardKeys.ESCAPE && onEscape) {
8361
- onEscape();
8362
- return;
8363
- }
8364
- if (e.key !== KeyboardKeys.TAB)
8365
- return;
8366
- const focusableChildren = getFocusableNodes(trappedRef.current);
8367
- if (focusableChildren.length > 0) {
8368
- const firstElement = focusableChildren[0];
8369
- const lastElement = focusableChildren[focusableChildren.length - 1];
8370
- if (e.shiftKey) {
8371
- if (firstElement === document.activeElement) {
8372
- e.preventDefault();
8373
- lastElement.focus();
8374
- }
8375
- } else if (lastElement === document.activeElement) {
8376
- e.preventDefault();
8377
- firstElement.focus();
8378
- }
8379
- }
8380
- };
8381
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
8382
- };
8383
- const Portal$1 = React__namespace.forwardRef(
8384
- ({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
8385
- return container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
8386
- }
8387
- );
8388
- Portal$1.displayName = "Portal";
8389
- const DialogWrapper = styledComponents.styled(Box)`
8445
+ const Root$5 = AlertDialog__namespace.Root;
8446
+ const Trigger$4 = React__namespace.forwardRef((props, forwardedRef) => {
8447
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
8448
+ });
8449
+ const Content$4 = React__namespace.forwardRef((props, forwardedRef) => {
8450
+ return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialog__namespace.Portal, { children: [
8451
+ /* @__PURE__ */ jsxRuntime.jsx(Overlay$1, {}),
8452
+ /* @__PURE__ */ jsxRuntime.jsx(ContentImpl$1, { ref: forwardedRef, ...props })
8453
+ ] });
8454
+ });
8455
+ const Overlay$1 = styledComponents.styled(AlertDialog__namespace.Overlay)`
8456
+ background-color: ${(props) => props.theme.colors.neutral800};
8457
+ position: fixed;
8390
8458
  inset: 0;
8391
- background: ${({ theme }) => setOpacity(theme.colors.neutral800, 0.2)};
8459
+ z-index: ${(props) => props.theme.zIndices.overlay};
8460
+ opacity: 0.2;
8461
+
8462
+ @media (prefers-reduced-motion: no-preference) {
8463
+ animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
8464
+ ${(props) => props.theme.motion.easings.authenticMotion};
8465
+ }
8392
8466
  `;
8393
- const DialogContainer = styledComponents.styled(Box)`
8394
- max-width: 41.2rem;
8395
- margin: 0 auto;
8467
+ const ContentImpl$1 = styledComponents.styled(AlertDialog__namespace.Content)`
8468
+ max-width: 42rem;
8469
+ height: min-content;
8470
+ width: 100%;
8396
8471
  overflow: hidden;
8397
- margin-top: 10%;
8398
- `;
8399
- const DialogHeader = styledComponents.styled(Flex)`
8400
- border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
8401
- `;
8402
- const Dialog = ({ onClose, title, as = "h2", isOpen, id, zIndex = "dialog", ...props }) => {
8403
- const generatedId = useId(id);
8404
- useLockScroll(isOpen);
8405
- if (!isOpen) {
8406
- return null;
8407
- }
8408
- const labelledBy = `${generatedId}-label`;
8409
- return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogWrapper, { padding: 8, position: "fixed", zIndex, children: /* @__PURE__ */ jsxRuntime.jsx(FocusTrap, { children: /* @__PURE__ */ jsxRuntime.jsx(DismissibleLayer, { onEscapeKeyDown: onClose, onPointerDownOutside: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
8410
- DialogContainer,
8411
- {
8412
- "aria-labelledby": labelledBy,
8413
- "aria-modal": true,
8414
- background: "neutral0",
8415
- hasRadius: true,
8416
- shadow: "popupShadow",
8417
- role: "dialog",
8418
- children: [
8419
- /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { padding: 6, justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "beta", as, id: labelledBy, children: title }) }),
8420
- /* @__PURE__ */ jsxRuntime.jsx(Box, { ...props })
8421
- ]
8472
+ margin: 0 auto;
8473
+ display: flex;
8474
+ flex-direction: column;
8475
+
8476
+ position: fixed;
8477
+ top: 50%;
8478
+ left: 50%;
8479
+ transform: translate(-50%, -50%);
8480
+
8481
+ border-radius: ${(props) => props.theme.borderRadius};
8482
+ background-color: ${(props) => props.theme.colors.neutral0};
8483
+ box-shadow: ${(props) => props.theme.shadows.popupShadow};
8484
+ z-index: ${(props) => props.theme.zIndices.modal};
8485
+
8486
+ @media (prefers-reduced-motion: no-preference) {
8487
+ &[data-state='open'] {
8488
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
8489
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
8490
+ animation-name: ${ANIMATIONS.modalPopIn};
8422
8491
  }
8423
- ) }) }) }) });
8424
- };
8425
- const IconContainer = styledComponents.styled(Box)`
8426
- svg {
8427
- width: ${({ theme }) => theme.spaces[6]};
8428
- height: ${({ theme }) => theme.spaces[6]};
8429
8492
 
8430
- path {
8431
- fill: ${({ theme }) => theme.colors.danger600};
8493
+ &[data-state='closed'] {
8494
+ animation-duration: ${(props) => props.theme.motion.timings["120"]};
8495
+ animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
8496
+ animation-name: ${ANIMATIONS.modalPopOut};
8432
8497
  }
8433
8498
  }
8434
8499
  `;
8435
- const DialogBody = ({ children, icon }) => {
8436
- return /* @__PURE__ */ jsxRuntime.jsxs(Box, { paddingTop: 8, paddingBottom: 8, paddingLeft: 6, paddingRight: 6, children: [
8437
- icon && /* @__PURE__ */ jsxRuntime.jsx(IconContainer, { paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { justifyContent: "center", children: icon }) }),
8438
- children
8439
- ] });
8440
- };
8441
- const FooterWrapper = styledComponents.styled(Box)`
8442
- border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
8443
-
8444
- button {
8445
- width: 100%;
8446
- display: inline-flex;
8447
- justify-content: center;
8448
- }
8500
+ const Header$1 = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
8501
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
8502
+ Title$1,
8503
+ {
8504
+ tag: "h2",
8505
+ ref: forwardedRef,
8506
+ padding: 6,
8507
+ justifyContent: "center",
8508
+ variant: "h2",
8509
+ fontWeight: "bold",
8510
+ ...restProps,
8511
+ children
8512
+ }
8513
+ ) });
8514
+ });
8515
+ const Title$1 = styledComponents.styled(Typography)`
8516
+ display: flex;
8517
+ justify-content: center;
8518
+ border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
8449
8519
  `;
8450
- const DialogFooter = ({ startAction, endAction }) => {
8451
- return /* @__PURE__ */ jsxRuntime.jsx(FooterWrapper, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
8452
- startAction,
8453
- endAction
8454
- ] }) });
8455
- };
8456
- let $3db38b7d1fb3fe6a$var$count = 0;
8457
- function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
8458
- React.useEffect(() => {
8459
- var _edgeGuards$, _edgeGuards$2;
8460
- const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
8461
- document.body.insertAdjacentElement("afterbegin", (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
8520
+ const Body$1 = React__namespace.forwardRef(({ children, icon, ...restProps }, forwardedRef) => {
8521
+ return /* @__PURE__ */ jsxRuntime.jsx(
8522
+ Flex,
8523
+ {
8524
+ ref: forwardedRef,
8525
+ gap: 2,
8526
+ direction: "column",
8527
+ paddingTop: 8,
8528
+ paddingBottom: 8,
8529
+ paddingLeft: 6,
8530
+ paddingRight: 6,
8531
+ ...restProps,
8532
+ children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8533
+ icon ? React__namespace.cloneElement(icon, {
8534
+ width: 24,
8535
+ height: 24
8536
+ }) : null,
8537
+ /* @__PURE__ */ jsxRuntime.jsx(Description, { children })
8538
+ ] }) : children
8539
+ }
8540
+ );
8541
+ });
8542
+ const Description = React__namespace.forwardRef((props, forwardedRef) => {
8543
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { ref: forwardedRef, variant: "omega", ...props, tag: "p" }) });
8544
+ });
8545
+ const Footer$1 = React__namespace.forwardRef((props, forwardedRef) => {
8546
+ return /* @__PURE__ */ jsxRuntime.jsx(Foot$1, { ref: forwardedRef, gap: 2, padding: 4, justifyContent: "space-between", ...props, tag: "footer" });
8547
+ });
8548
+ const Foot$1 = styledComponents.styled(Flex)`
8549
+ border-top: solid 1px ${(props) => props.theme.colors.neutral150};
8550
+ flex: 1;
8551
+ `;
8552
+ const Cancel = React__namespace.forwardRef((props, forwardedRef) => {
8553
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Cancel, { ...props, asChild: true, ref: forwardedRef });
8554
+ });
8555
+ const Action = React__namespace.forwardRef((props, forwardedRef) => {
8556
+ return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Action, { ...props, asChild: true, ref: forwardedRef });
8557
+ });
8558
+ const Dialog = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8559
+ __proto__: null,
8560
+ Action,
8561
+ Body: Body$1,
8562
+ Cancel,
8563
+ Content: Content$4,
8564
+ Description,
8565
+ Footer: Footer$1,
8566
+ Header: Header$1,
8567
+ Root: Root$5,
8568
+ Trigger: Trigger$4
8569
+ }, Symbol.toStringTag, { value: "Module" }));
8570
+ let $3db38b7d1fb3fe6a$var$count = 0;
8571
+ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
8572
+ React.useEffect(() => {
8573
+ var _edgeGuards$, _edgeGuards$2;
8574
+ const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
8575
+ document.body.insertAdjacentElement("afterbegin", (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
8462
8576
  document.body.insertAdjacentElement("beforeend", (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
8463
8577
  $3db38b7d1fb3fe6a$var$count++;
8464
8578
  return () => {
@@ -8477,47 +8591,6 @@ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
8477
8591
  element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
8478
8592
  return element;
8479
8593
  }
8480
- function useControllableState({
8481
- prop,
8482
- defaultProp,
8483
- onChange = () => {
8484
- }
8485
- }) {
8486
- const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
8487
- const isControlled = prop !== void 0;
8488
- const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
8489
- const value = isControlled ? propValue : uncontrolledProp;
8490
- const handleChange = uiPrimitives.useCallbackRef(onChange);
8491
- const setValue = React__namespace.useCallback(
8492
- (nextValue) => {
8493
- if (isControlled) {
8494
- const setter = nextValue;
8495
- const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
8496
- if (value2 !== propValue) {
8497
- handleChange(value2);
8498
- setUncontrolledProp(nextValue);
8499
- }
8500
- } else {
8501
- setUncontrolledProp(nextValue);
8502
- }
8503
- },
8504
- [isControlled, propValue, setUncontrolledProp, handleChange]
8505
- );
8506
- return [value, setValue];
8507
- }
8508
- function useUncontrolledState({ defaultProp, onChange }) {
8509
- const uncontrolledState = React__namespace.useState(defaultProp);
8510
- const [value] = uncontrolledState;
8511
- const prevValueRef = React__namespace.useRef(value);
8512
- const handleChange = uiPrimitives.useCallbackRef(onChange);
8513
- React__namespace.useEffect(() => {
8514
- if (prevValueRef.current !== value) {
8515
- handleChange(value);
8516
- prevValueRef.current = value;
8517
- }
8518
- }, [value, prevValueRef, handleChange]);
8519
- return uncontrolledState;
8520
- }
8521
8594
  function useDateFormatter(locale, options) {
8522
8595
  const lastOptions = React__namespace.useRef(null);
8523
8596
  if (options && lastOptions.current && isEqual(options, lastOptions.current)) {
@@ -8694,14 +8767,40 @@ const DesignSystemProvider = ({
8694
8767
  theme = lightTheme,
8695
8768
  tooltipConfig
8696
8769
  }) => {
8770
+ useIsomorphicLayoutEffect(() => {
8771
+ const css = document.createElement("style");
8772
+ css.type = "text/css";
8773
+ css.appendChild(
8774
+ document.createTextNode(`
8775
+ * {
8776
+ -webkit-transition: none !important;
8777
+ -moz-transition: none !important;
8778
+ -o-transition: none !important;
8779
+ -ms-transition: none !important;
8780
+ transition: none !important;
8781
+ animation: none !important;
8782
+ }
8783
+ `)
8784
+ );
8785
+ document.head.appendChild(css);
8786
+ window.getComputedStyle(css).opacity;
8787
+ document.head.removeChild(css);
8788
+ }, [theme]);
8697
8789
  return /* @__PURE__ */ jsxRuntime.jsx(Provider, { locale, children: /* @__PURE__ */ jsxRuntime.jsxs(styledComponents.ThemeProvider, { theme, children: [
8698
8790
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Provider, { ...tooltipConfig, children }),
8699
8791
  /* @__PURE__ */ jsxRuntime.jsx(LiveRegions, {}),
8700
8792
  /* @__PURE__ */ jsxRuntime.jsx(GlobalStyle, {})
8701
8793
  ] }) });
8702
8794
  };
8795
+ const DismissibleLayer = DismissibleLayerPrimitive__namespace.Root;
8796
+ const Portal$1 = React__namespace.forwardRef(
8797
+ ({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
8798
+ return container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
8799
+ }
8800
+ );
8801
+ Portal$1.displayName = "Portal";
8703
8802
  const SelectTrigger = React__namespace.forwardRef(
8704
- ({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, ...restProps }, ref) => {
8803
+ ({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, size = "M", withTags, ...restProps }, ref) => {
8705
8804
  const triggerRef = React__namespace.useRef(null);
8706
8805
  const handleClearClick = (e) => {
8707
8806
  if (onClear && !disabled) {
@@ -8723,13 +8822,11 @@ const SelectTrigger = React__namespace.forwardRef(
8723
8822
  overflow: "hidden",
8724
8823
  hasRadius: true,
8725
8824
  background: disabled ? "neutral150" : "neutral0",
8726
- paddingLeft: 3,
8727
- paddingRight: 3,
8728
- paddingTop: 2,
8729
- paddingBottom: 2,
8730
8825
  gap: 4,
8731
8826
  cursor: "default",
8732
8827
  "aria-labelledby": labelNode ? `${id}-label` : void 0,
8828
+ $size: size,
8829
+ $withTags: withTags,
8733
8830
  ...restProps,
8734
8831
  children: [
8735
8832
  /* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
@@ -8774,6 +8871,22 @@ const IconBox$2 = styledComponents.styled(Box)`
8774
8871
  `;
8775
8872
  const StyledTrigger = styledComponents.styled(Flex)`
8776
8873
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
8874
+ ${(props) => {
8875
+ switch (props.$size) {
8876
+ case "S":
8877
+ return styledComponents.css`
8878
+ padding-block: ${props.theme.spaces[1]};
8879
+ padding-inline-start: ${props.$withTags ? props.theme.spaces[1] : props.theme.spaces[4]};
8880
+ padding-inline-end: ${props.theme.spaces[3]};
8881
+ `;
8882
+ default:
8883
+ return styledComponents.css`
8884
+ padding-block: ${props.$withTags ? "0.3rem" : props.theme.spaces[2]};
8885
+ padding-inline-start: ${props.$withTags ? props.theme.spaces[1] : props.theme.spaces[4]};
8886
+ padding-inline-end: ${props.theme.spaces[3]};
8887
+ `;
8888
+ }
8889
+ }}
8777
8890
 
8778
8891
  &[aria-disabled='true'] {
8779
8892
  color: ${(props) => props.theme.colors.neutral600};
@@ -8811,6 +8924,23 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
8811
8924
  /* This is from the design-system figma file. */
8812
8925
  max-height: 15rem;
8813
8926
  z-index: ${({ theme }) => theme.zIndices.popover};
8927
+
8928
+ @media (prefers-reduced-motion: no-preference) {
8929
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
8930
+
8931
+ /* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
8932
+ &[data-state='open'] {
8933
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
8934
+
8935
+ &[data-side='top'] {
8936
+ animation-name: ${ANIMATIONS.slideDownIn};
8937
+ }
8938
+
8939
+ &[data-side='bottom'] {
8940
+ animation-name: ${ANIMATIONS.slideUpIn};
8941
+ }
8942
+ }
8943
+ }
8814
8944
  `;
8815
8945
  const SelectViewport = styledComponents.styled(uiPrimitives.Select.Viewport)`
8816
8946
  padding: ${({ theme }) => theme.spaces[1]};
@@ -8830,6 +8960,7 @@ const itemStyles = styledComponents.css`
8830
8960
  gap: ${({ theme }) => theme.spaces[2]};
8831
8961
  white-space: nowrap;
8832
8962
  user-select: none;
8963
+ color: ${({ theme }) => theme.colors.neutral800};
8833
8964
 
8834
8965
  &:focus-visible {
8835
8966
  outline: none;
@@ -8845,19 +8976,21 @@ const StyledSelectItem = styledComponents.styled(uiPrimitives.Select.Item)`
8845
8976
 
8846
8977
  &[data-state='checked'] {
8847
8978
  font-weight: bold;
8979
+ background-color: ${({ theme }) => theme.colors.primary100};
8848
8980
  color: ${({ theme }) => theme.colors.primary600};
8981
+ font-weight: bold;
8849
8982
  }
8850
8983
  `;
8851
- const Root = uiPrimitives.Select.Root;
8852
- const Trigger = SelectTrigger;
8984
+ const Root$4 = uiPrimitives.Select.Root;
8985
+ const Trigger$3 = SelectTrigger;
8853
8986
  const Value = SelectValue;
8854
8987
  const Portal = uiPrimitives.Select.Portal;
8855
- const Content$1 = SelectContent;
8988
+ const Content$3 = SelectContent;
8856
8989
  const Viewport = SelectViewport;
8857
- const Item = SelectItem;
8990
+ const Item$2 = SelectItem;
8858
8991
  const ItemIndicator = uiPrimitives.Select.ItemIndicator;
8859
8992
  const ItemText = uiPrimitives.Select.ItemText;
8860
- const Group = uiPrimitives.Select.Group;
8993
+ const Group$1 = uiPrimitives.Select.Group;
8861
8994
  const SingleSelect = React__namespace.forwardRef(
8862
8995
  ({
8863
8996
  children,
@@ -8873,6 +9006,7 @@ const SingleSelect = React__namespace.forwardRef(
8873
9006
  onReachEnd,
8874
9007
  placeholder,
8875
9008
  required: requiredProp,
9009
+ size,
8876
9010
  startIcon,
8877
9011
  value: passedValue,
8878
9012
  ...restProps
@@ -8926,7 +9060,7 @@ const SingleSelect = React__namespace.forwardRef(
8926
9060
  }
8927
9061
  const value = (typeof passedValue !== "undefined" && passedValue !== null ? passedValue.toString() : internalValue) ?? "";
8928
9062
  return /* @__PURE__ */ jsxRuntime.jsxs(
8929
- Root,
9063
+ Root$4,
8930
9064
  {
8931
9065
  onOpenChange: handleOpenChange,
8932
9066
  disabled,
@@ -8936,7 +9070,7 @@ const SingleSelect = React__namespace.forwardRef(
8936
9070
  ...restProps,
8937
9071
  children: [
8938
9072
  /* @__PURE__ */ jsxRuntime.jsx(
8939
- Trigger,
9073
+ Trigger$3,
8940
9074
  {
8941
9075
  ref: forwardedRef,
8942
9076
  id,
@@ -8948,10 +9082,11 @@ const SingleSelect = React__namespace.forwardRef(
8948
9082
  onClear: value && onClear ? handleOnClear : void 0,
8949
9083
  "aria-label": restProps["aria-label"],
8950
9084
  "aria-describedby": ariaDescription ?? restProps["aria-describedby"],
9085
+ size,
8951
9086
  children: /* @__PURE__ */ jsxRuntime.jsx(Value, { placeholder, textColor: value ? "neutral800" : "neutral600", children: value && customizeContent ? customizeContent(value) : void 0 })
8952
9087
  }
8953
9088
  ),
8954
- /* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$1, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport, { ref: viewportRef, children: [
9089
+ /* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport, { ref: viewportRef, children: [
8955
9090
  children,
8956
9091
  /* @__PURE__ */ jsxRuntime.jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
8957
9092
  ] }) }) })
@@ -8962,9 +9097,9 @@ const SingleSelect = React__namespace.forwardRef(
8962
9097
  );
8963
9098
  const SingleSelectOption = React__namespace.forwardRef(
8964
9099
  ({ value, startIcon, children, ...restProps }, ref) => {
8965
- return /* @__PURE__ */ jsxRuntime.jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
9100
+ return /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
8966
9101
  startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
8967
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
9102
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
8968
9103
  ] });
8969
9104
  }
8970
9105
  );
@@ -8996,6 +9131,7 @@ const DatePicker$1 = React__namespace.forwardRef(
8996
9131
  required: requiredProp = false,
8997
9132
  onClear,
8998
9133
  clearLabel = "Clear",
9134
+ size = "M",
8999
9135
  ...restProps
9000
9136
  }, ref) => {
9001
9137
  const timeZone = date.getLocalTimeZone();
@@ -9011,7 +9147,7 @@ const DatePicker$1 = React__namespace.forwardRef(
9011
9147
  const [textInput, setTextInput] = React__namespace.useState(null);
9012
9148
  const [content, setContent] = React__namespace.useState(null);
9013
9149
  const [textValue, setTextValue] = React__namespace.useState();
9014
- const [value, setValue] = useControllableState({
9150
+ const [value, setValue] = useControllableState$1({
9015
9151
  defaultProp: initialDate ? convertUTCDateToCalendarDate(initialDate) : void 0,
9016
9152
  prop: valueProp ? convertUTCDateToCalendarDate(valueProp) : void 0,
9017
9153
  onChange(date2) {
@@ -9055,7 +9191,7 @@ const DatePicker$1 = React__namespace.forwardRef(
9055
9191
  },
9056
9192
  [value]
9057
9193
  );
9058
- React__namespace.useLayoutEffect(() => {
9194
+ useIsomorphicLayoutEffect(() => {
9059
9195
  if (valueProp) {
9060
9196
  const date2 = convertUTCDateToCalendarDate(valueProp);
9061
9197
  setTextValue(formatter.format(date2.toDate(timeZone)));
@@ -9064,7 +9200,7 @@ const DatePicker$1 = React__namespace.forwardRef(
9064
9200
  setTextValue("");
9065
9201
  }
9066
9202
  }, [valueProp, formatter, timeZone]);
9067
- React__namespace.useLayoutEffect(() => {
9203
+ useIsomorphicLayoutEffect(() => {
9068
9204
  if (initialDate && textValue === void 0) {
9069
9205
  const date2 = convertUTCDateToCalendarDate(initialDate);
9070
9206
  setTextValue(formatter.format(date2.toDate(timeZone)));
@@ -9106,7 +9242,7 @@ const DatePicker$1 = React__namespace.forwardRef(
9106
9242
  trigger,
9107
9243
  value,
9108
9244
  children: [
9109
- /* @__PURE__ */ jsxRuntime.jsxs(DatePickerTrigger, { className, hasError, children: [
9245
+ /* @__PURE__ */ jsxRuntime.jsxs(DatePickerTrigger, { className, hasError, size, children: [
9110
9246
  /* @__PURE__ */ jsxRuntime.jsx(icons.Calendar, { fill: "neutral500", "aria-hidden": true }),
9111
9247
  /* @__PURE__ */ jsxRuntime.jsx(DatePickerTextInput, { ref, "aria-describedby": ariaDescription, id, name, ...restProps }),
9112
9248
  textValue && onClear ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -9152,7 +9288,7 @@ const makeInitialCalendarDate = ({ currentValue, minDate, maxDate }) => {
9152
9288
  };
9153
9289
  const DATE_PICKER_TRIGGER_NAME = "DatePickerTrigger";
9154
9290
  const DatePickerTrigger = React__namespace.forwardRef(
9155
- ({ hasError, ...restProps }, forwardedRef) => {
9291
+ ({ hasError, size, ...restProps }, forwardedRef) => {
9156
9292
  const context = useDatePickerContext(DATE_PICKER_TRIGGER_NAME);
9157
9293
  const composedRefs = useComposedRefs(forwardedRef, (node) => context.onTriggerChange(node));
9158
9294
  const handleOpenChange = () => {
@@ -9177,9 +9313,8 @@ const DatePickerTrigger = React__namespace.forwardRef(
9177
9313
  {
9178
9314
  ref: composedRefs,
9179
9315
  $hasError: hasError,
9316
+ $size: size,
9180
9317
  ...restProps,
9181
- paddingLeft: 3,
9182
- paddingRight: 3,
9183
9318
  hasRadius: true,
9184
9319
  gap: 3,
9185
9320
  overflow: "hidden",
@@ -9209,7 +9344,20 @@ const DatePickerTrigger = React__namespace.forwardRef(
9209
9344
  );
9210
9345
  const TriggerElement = styledComponents.styled(Flex)`
9211
9346
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
9212
- padding-block: ${({ theme }) => theme.spaces[2]};
9347
+ ${(props) => {
9348
+ switch (props.$size) {
9349
+ case "S":
9350
+ return styledComponents.css`
9351
+ padding-block: ${props.theme.spaces[1]};
9352
+ padding-inline: ${props.theme.spaces[3]};
9353
+ `;
9354
+ default:
9355
+ return styledComponents.css`
9356
+ padding-block: ${props.theme.spaces[2]};
9357
+ padding-inline: ${props.theme.spaces[3]};
9358
+ `;
9359
+ }
9360
+ }}
9213
9361
 
9214
9362
  & > svg {
9215
9363
  flex: 1 0 auto;
@@ -9433,7 +9581,7 @@ const CONTENT_NAME = "DatePickerContent";
9433
9581
  const DatePickerContent = React__namespace.forwardRef((props, forwardedRef) => {
9434
9582
  const [fragment, setFragment] = React__namespace.useState();
9435
9583
  const context = useDatePickerContext(CONTENT_NAME);
9436
- React__namespace.useLayoutEffect(() => {
9584
+ useIsomorphicLayoutEffect(() => {
9437
9585
  setFragment(new DocumentFragment());
9438
9586
  }, []);
9439
9587
  if (!context.open) {
@@ -9562,7 +9710,7 @@ const DatePickerCalendar = React__namespace.forwardRef(
9562
9710
  const getDatesInWeek = makeGetDatesInWeek(startDate, locale);
9563
9711
  return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { ref, direction: "column", alignItems: "stretch", padding: 4, ...restProps, children: [
9564
9712
  /* @__PURE__ */ jsxRuntime.jsxs(ToolbarFlex, { justifyContent: "flex-start", paddingBottom: 4, paddingLeft: 2, paddingRight: 2, gap: 2, children: [
9565
- /* @__PURE__ */ jsxRuntime.jsx(Root$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
9713
+ /* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(
9566
9714
  SingleSelect,
9567
9715
  {
9568
9716
  "aria-label": monthSelectLabel,
@@ -9571,7 +9719,7 @@ const DatePickerCalendar = React__namespace.forwardRef(
9571
9719
  children: months.map((month) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: month, children: month }, month))
9572
9720
  }
9573
9721
  ) }),
9574
- /* @__PURE__ */ jsxRuntime.jsx(Root$1, { children: /* @__PURE__ */ jsxRuntime.jsx(SingleSelect, { value: calendarDate.year.toString(), "aria-label": yearSelectLabel, onChange: handleYearChange, children: years.map((year) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: year, children: year }, year)) }) })
9722
+ /* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(SingleSelect, { value: calendarDate.year.toString(), "aria-label": yearSelectLabel, onChange: handleYearChange, children: years.map((year) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: year, children: year }, year)) }) })
9575
9723
  ] }),
9576
9724
  /* @__PURE__ */ jsxRuntime.jsxs("table", { role: "grid", children: [
9577
9725
  /* @__PURE__ */ jsxRuntime.jsx("thead", { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-rowindex": 0, children: weekDays.map((day, index) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerHeaderCell, { "aria-colindex": index, children: day }, day)) }) }),
@@ -9724,7 +9872,7 @@ const TimePicker$1 = React__namespace.forwardRef(
9724
9872
  ({ step = 15, value: valueProp, defaultValue, onChange, ...restProps }, forwardedRef) => {
9725
9873
  const context = useDesignSystem("TimePicker");
9726
9874
  const [textValue, setTextValue] = React__namespace.useState("");
9727
- const [value, setValue] = reactUseControllableState.useControllableState({
9875
+ const [value, setValue] = useControllableState$1({
9728
9876
  prop: valueProp,
9729
9877
  defaultProp: defaultValue,
9730
9878
  onChange
@@ -9794,7 +9942,7 @@ const TimePicker$1 = React__namespace.forwardRef(
9794
9942
  allowCustomValue: true,
9795
9943
  placeholder: `--${separator}--`,
9796
9944
  autocomplete: "none",
9797
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(StyledClock, {}),
9945
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Clock, { fill: "neutral500" }),
9798
9946
  inputMode: "numeric",
9799
9947
  pattern: `\\d{2}\\${separator}\\d{2}`,
9800
9948
  textValue,
@@ -9805,14 +9953,6 @@ const TimePicker$1 = React__namespace.forwardRef(
9805
9953
  );
9806
9954
  }
9807
9955
  );
9808
- const StyledClock = styledComponents.styled(icons.Clock)`
9809
- height: 1rem;
9810
- width: 1rem;
9811
-
9812
- & > path {
9813
- fill: ${({ theme }) => theme.colors.neutral500};
9814
- }
9815
- `;
9816
9956
  const DatePicker = styledComponents.styled(DatePicker$1)`
9817
9957
  flex: 1 1 70%;
9818
9958
  min-width: 120px;
@@ -9834,10 +9974,11 @@ const DateTimePicker = React__namespace.forwardRef(
9834
9974
  step,
9835
9975
  value,
9836
9976
  initialDate,
9977
+ size,
9837
9978
  ...props
9838
9979
  }, forwardedRef) => {
9839
9980
  const DatePickerElement2 = React__namespace.useRef(null);
9840
- const [dateValue, setDateValue] = useControllableState({
9981
+ const [dateValue, setDateValue] = useControllableState$1({
9841
9982
  defaultProp: initialDate ? convertUTCDateToCalendarDateTime(initialDate, false) : void 0,
9842
9983
  prop: value ? convertUTCDateToCalendarDateTime(value, false) : value ?? void 0,
9843
9984
  onChange(date$1) {
@@ -9889,10 +10030,11 @@ const DateTimePicker = React__namespace.forwardRef(
9889
10030
  const { error, id, labelNode } = useField("DateTimePicker");
9890
10031
  const hasError = Boolean(error) || hasErrorProp;
9891
10032
  return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { "aria-labelledby": labelNode ? `${id}-label` : void 0, role: "group", flex: "1", gap: 1, children: [
9892
- /* @__PURE__ */ jsxRuntime.jsx(Root$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
10033
+ /* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(
9893
10034
  DatePicker,
9894
10035
  {
9895
10036
  ...props,
10037
+ size,
9896
10038
  value: dateValue?.toDate("UTC"),
9897
10039
  onChange: handleDateChange,
9898
10040
  required,
@@ -9903,9 +10045,10 @@ const DateTimePicker = React__namespace.forwardRef(
9903
10045
  "aria-label": dateLabel
9904
10046
  }
9905
10047
  ) }),
9906
- /* @__PURE__ */ jsxRuntime.jsx(Root$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
10048
+ /* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(
9907
10049
  TimePicker,
9908
10050
  {
10051
+ size,
9909
10052
  hasError,
9910
10053
  value: timeValue,
9911
10054
  onChange: handleTimeChange,
@@ -9928,15 +10071,25 @@ const convertUTCDateToCalendarDateTime = (date$1, resetTime = true) => {
9928
10071
  }
9929
10072
  return date.toCalendarDateTime(zonedDateTime);
9930
10073
  };
9931
- const DividerWrapper = styledComponents.styled(Box)`
10074
+ const Divider = React__namespace.forwardRef((props, forwardedRef) => {
10075
+ return /* @__PURE__ */ jsxRuntime.jsx(
10076
+ DividerImpl,
10077
+ {
10078
+ ref: forwardedRef,
10079
+ background: "neutral150",
10080
+ ...props,
10081
+ "data-orientation": "horizontal",
10082
+ role: "separator",
10083
+ tag: "div"
10084
+ }
10085
+ );
10086
+ });
10087
+ const DividerImpl = styledComponents.styled(Box)`
9932
10088
  height: 1px;
9933
10089
  border: none;
9934
10090
  /* If contained in a Flex parent we want to prevent the Divider to shink */
9935
10091
  flex-shrink: 0;
9936
10092
  `;
9937
- const Divider = (props) => {
9938
- return /* @__PURE__ */ jsxRuntime.jsx(DividerWrapper, { ...props, background: "neutral150", tag: "hr" });
9939
- };
9940
10093
  const EmptyStateIconWrapper = styledComponents.styled(Box)`
9941
10094
  svg {
9942
10095
  height: 8.8rem;
@@ -9966,17 +10119,92 @@ const EmptyStateLayout = ({
9966
10119
  }
9967
10120
  );
9968
10121
  };
9969
- const Grid = (props) => {
9970
- const { gap = 0, gridCols = 12, ...rest } = props;
9971
- return /* @__PURE__ */ jsxRuntime.jsx(GridWrapper, { $gap: gap, $gridCols: gridCols, ...rest });
10122
+ const getFocusableNodes = (node, includeNegativeTabIndex) => {
10123
+ const nodes = [
10124
+ ...node.querySelectorAll(
10125
+ 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
10126
+ )
10127
+ ];
10128
+ const focusables = nodes.filter((node2) => {
10129
+ if (node2.hasAttribute("disabled"))
10130
+ return false;
10131
+ if (includeNegativeTabIndex)
10132
+ return true;
10133
+ return node2.getAttribute("tabindex") !== "-1";
10134
+ });
10135
+ return focusables;
10136
+ };
10137
+ const getFocusableNodesWithKeyboardNav = (nodes) => {
10138
+ return nodes.filter((node) => {
10139
+ if (node.tagName === "INPUT") {
10140
+ return node.type !== "checkbox" && node.type !== "radio";
10141
+ }
10142
+ return false;
10143
+ });
10144
+ };
10145
+ const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
10146
+ const trappedRef = React__namespace.useRef(null);
10147
+ React__namespace.useEffect(() => {
10148
+ let currentFocus = null;
10149
+ if (restoreFocus) {
10150
+ currentFocus = document.activeElement;
10151
+ }
10152
+ return () => {
10153
+ if (currentFocus) {
10154
+ currentFocus.focus();
10155
+ }
10156
+ };
10157
+ }, [restoreFocus]);
10158
+ React__namespace.useEffect(() => {
10159
+ if (!trappedRef.current || skipAutoFocus)
10160
+ return;
10161
+ const focusableChildren = getFocusableNodes(trappedRef.current);
10162
+ if (focusableChildren.length > 0) {
10163
+ const firstElement = focusableChildren[0];
10164
+ firstElement.focus();
10165
+ } else {
10166
+ console.warn(
10167
+ "[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
10168
+ );
10169
+ }
10170
+ }, [skipAutoFocus]);
10171
+ const handleKeyDown = (e) => {
10172
+ if (e.key === KeyboardKeys.ESCAPE && onEscape) {
10173
+ onEscape();
10174
+ return;
10175
+ }
10176
+ if (e.key !== KeyboardKeys.TAB)
10177
+ return;
10178
+ const focusableChildren = getFocusableNodes(trappedRef.current);
10179
+ if (focusableChildren.length > 0) {
10180
+ const firstElement = focusableChildren[0];
10181
+ const lastElement = focusableChildren[focusableChildren.length - 1];
10182
+ if (e.shiftKey) {
10183
+ if (firstElement === document.activeElement) {
10184
+ e.preventDefault();
10185
+ lastElement.focus();
10186
+ }
10187
+ } else if (lastElement === document.activeElement) {
10188
+ e.preventDefault();
10189
+ firstElement.focus();
10190
+ }
10191
+ }
10192
+ };
10193
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
9972
10194
  };
9973
- const GridWrapper = styledComponents.styled(Box)`
10195
+ const Root$3 = forwardRef((props, forwardedRef) => {
10196
+ const { gap = 0, gridCols = 12, ...rest } = props;
10197
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
10198
+ });
10199
+ const Wrapper$1 = styledComponents.styled(Box)`
9974
10200
  display: grid;
9975
10201
  grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
9976
10202
  ${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
9977
10203
  `;
9978
- const GridItemImpl = ({ col, s, xs, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(GridItem, { $col: col, $s: s, $xs: xs, ...props });
9979
- const GridItem = styledComponents.styled(Box)`
10204
+ const ItemImpl = forwardRef(
10205
+ ({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
10206
+ );
10207
+ const Item$1 = styledComponents.styled(Box)`
9980
10208
  grid-column: span ${({ $col }) => $col ?? 1};
9981
10209
  max-width: 100%;
9982
10210
 
@@ -9988,6 +10216,11 @@ const GridItem = styledComponents.styled(Box)`
9988
10216
  grid-column: span ${({ $xs }) => $xs};
9989
10217
  }
9990
10218
  `;
10219
+ const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10220
+ __proto__: null,
10221
+ Item: ItemImpl,
10222
+ Root: Root$3
10223
+ }, Symbol.toStringTag, { value: "Module" }));
9991
10224
  const VARIANT_DEFAULT = "tertiary";
9992
10225
  const VARIANT_SECONDARY = "secondary";
9993
10226
  const SIZES = ["S", "M", "L"];
@@ -10063,20 +10296,22 @@ const IconButtonWrapper = styledComponents.styled(BaseButton)`
10063
10296
  }
10064
10297
  `;
10065
10298
  const IconButtonGroup = styledComponents.styled(Flex)`
10066
- & span:first-child button {
10067
- border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
10299
+ & ${IconButtonWrapper}:first-child {
10068
10300
  border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
10069
10301
  }
10070
10302
 
10071
- & span:last-child button {
10303
+ & ${IconButtonWrapper}:last-child {
10072
10304
  border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
10073
10305
  }
10074
10306
 
10075
10307
  & ${IconButtonWrapper} {
10076
10308
  border-radius: 0;
10077
- border-left: none;
10078
10309
  color: ${({ theme }) => theme.colors.neutral700};
10079
10310
 
10311
+ & + ${IconButtonWrapper} {
10312
+ border-left: none;
10313
+ }
10314
+
10080
10315
  &:hover {
10081
10316
  background-color: ${({ theme }) => theme.colors.neutral100};
10082
10317
  color: ${({ theme }) => theme.colors.neutral800};
@@ -10268,96 +10503,31 @@ const JSONInputContainer = styledComponents.styled(Flex)`
10268
10503
  background-color: #4a4a6a;
10269
10504
  }
10270
10505
  `;
10271
- const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
10272
- const isValidFocusedElement = () => {
10273
- const focused = document.activeElement;
10274
- if (!focused) {
10275
- return false;
10276
- }
10277
- if (tagName) {
10278
- return focused.tagName.toLowerCase() === tagName;
10279
- }
10280
- return focused.hasAttribute(attributeName);
10281
- };
10282
- const queryElement = (parentEl) => {
10283
- if (tagName) {
10284
- return parentEl.querySelectorAll(tagName);
10285
- }
10286
- return parentEl.querySelectorAll(`[${attributeName}]`);
10287
- };
10288
- const handleKeyDown = (e) => {
10289
- switch (e.key) {
10290
- case KeyboardKeys.RIGHT:
10291
- case KeyboardKeys.DOWN: {
10292
- if (isValidFocusedElement()) {
10293
- e.preventDefault();
10294
- const focused = document.activeElement;
10295
- const allElements = [...queryElement(e.currentTarget)];
10296
- const focusedIndex = allElements.findIndex((node) => node === focused);
10297
- const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
10298
- allElements[nextIndex].focus();
10299
- }
10300
- break;
10301
- }
10302
- case KeyboardKeys.LEFT:
10303
- case KeyboardKeys.UP: {
10304
- if (isValidFocusedElement()) {
10305
- e.preventDefault();
10306
- const focused = document.activeElement;
10307
- const allElements = [...queryElement(e.currentTarget)];
10308
- const focusedIndex = allElements.findIndex((node) => node === focused);
10309
- const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
10310
- allElements[nextIndex].focus();
10311
- }
10312
- break;
10313
- }
10314
- case KeyboardKeys.HOME: {
10315
- if (isValidFocusedElement()) {
10316
- e.preventDefault();
10317
- const allElements = queryElement(e.currentTarget);
10318
- const focusElement = allElements.item(0);
10319
- focusElement.focus();
10320
- }
10321
- break;
10322
- }
10323
- case KeyboardKeys.END: {
10324
- if (isValidFocusedElement()) {
10325
- e.preventDefault();
10326
- const allElements = queryElement(e.currentTarget);
10327
- const focusElement = allElements.item(allElements.length - 1);
10328
- focusElement.focus();
10329
- }
10330
- break;
10331
- }
10332
- }
10333
- };
10334
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { onKeyDown: handleKeyDown, ...props });
10335
- };
10336
- const LinkButton = forwardRef(
10337
- ({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
10338
- const paddingX = size === "S" ? 2 : "10px";
10339
- const paddingY = 4;
10340
- return /* @__PURE__ */ jsxRuntime.jsxs(
10341
- LinkWrapper$1,
10342
- {
10343
- ref,
10344
- "aria-disabled": disabled,
10345
- $variant: variant2,
10346
- background: "buttonPrimary600",
10347
- borderColor: "buttonPrimary600",
10348
- hasRadius: true,
10349
- display: "inline-flex",
10350
- paddingBottom: paddingX,
10351
- paddingLeft: paddingY,
10352
- paddingRight: paddingY,
10353
- paddingTop: paddingX,
10354
- pointerEvents: disabled ? "none" : void 0,
10355
- ...props,
10356
- children: [
10357
- startIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: startIcon }),
10358
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", textColor: "buttonNeutral0", children }),
10359
- endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: endIcon })
10360
- ]
10506
+ const LinkButton = forwardRef(
10507
+ ({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
10508
+ const paddingX = size === "S" ? 2 : "10px";
10509
+ const paddingY = 4;
10510
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10511
+ LinkWrapper$1,
10512
+ {
10513
+ ref,
10514
+ "aria-disabled": disabled,
10515
+ $variant: variant2,
10516
+ background: "buttonPrimary600",
10517
+ borderColor: "buttonPrimary600",
10518
+ hasRadius: true,
10519
+ display: "inline-flex",
10520
+ paddingBottom: paddingX,
10521
+ paddingLeft: paddingY,
10522
+ paddingRight: paddingY,
10523
+ paddingTop: paddingX,
10524
+ pointerEvents: disabled ? "none" : void 0,
10525
+ ...props,
10526
+ children: [
10527
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: startIcon }),
10528
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
10529
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx(Flex, { "aria-hidden": true, children: endIcon })
10530
+ ]
10361
10531
  }
10362
10532
  );
10363
10533
  }
@@ -10425,58 +10595,191 @@ const SkipToContent = ({ children }) => {
10425
10595
  }
10426
10596
  );
10427
10597
  };
10428
- const ModalContext = React__namespace.createContext(() => {
10598
+ const ScrollAreaImpl$1 = React__namespace.forwardRef(
10599
+ ({ children, viewportRef, ...restProps }, forwardedRef) => {
10600
+ return /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
10601
+ /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaViewport, { ref: viewportRef, children }),
10602
+ /* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) }),
10603
+ /* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) })
10604
+ ] });
10605
+ }
10606
+ );
10607
+ const ScrollAreaRoot = styledComponents.styled(ScrollArea__namespace.Root)`
10608
+ width: 100%;
10609
+ height: 100%;
10610
+ overflow: hidden;
10611
+ display: flex;
10612
+ `;
10613
+ const ScrollAreaViewport = styledComponents.styled(ScrollArea__namespace.Viewport)`
10614
+ min-width: 100%;
10615
+ padding-inline: 4px;
10616
+ `;
10617
+ const Scrollbar = styledComponents.styled(ScrollArea__namespace.Scrollbar)`
10618
+ display: flex;
10619
+ /* ensures no selection */
10620
+ user-select: none;
10621
+ /* disable browser handling of all panning and zooming gestures on touch devices */
10622
+ touch-action: none;
10623
+
10624
+ &[data-orientation='vertical'] {
10625
+ width: 0.4rem;
10626
+ }
10627
+
10628
+ &[data-orientation='horizontal'] {
10629
+ flex-direction: column;
10630
+ height: 0.4rem;
10631
+ }
10632
+ `;
10633
+ const Thumb = styledComponents.styled(ScrollArea__namespace.Thumb)`
10634
+ position: relative;
10635
+ flex: 1;
10636
+ background-color: ${(props) => props.theme.colors.neutral150};
10637
+ border-radius: var(--scrollbar-size);
10638
+
10639
+ /* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
10640
+ &::before {
10641
+ content: '';
10642
+ position: absolute;
10643
+ top: 50%;
10644
+ left: 50%;
10645
+ transform: translate(-50%, -50%);
10646
+ width: 100%;
10647
+ height: 100%;
10648
+ min-width: 44px;
10649
+ min-height: 44px;
10650
+ }
10651
+ `;
10652
+ const Root$2 = Dialog__namespace.Root;
10653
+ const Trigger$2 = React__namespace.forwardRef((props, forwardedRef) => {
10654
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
10655
+ });
10656
+ const Content$2 = React__namespace.forwardRef((props, forwardedRef) => {
10657
+ return /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { children: [
10658
+ /* @__PURE__ */ jsxRuntime.jsx(Overlay, {}),
10659
+ /* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref: forwardedRef, ...props })
10660
+ ] });
10429
10661
  });
10430
- const useModal = () => React__namespace.useContext(ModalContext);
10431
- const ModalWrapper = styledComponents.styled(Flex)`
10432
- background: ${({ theme }) => `${theme.colors.neutral800}1F`};
10662
+ const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
10663
+ background-color: ${(props) => props.theme.colors.neutral800};
10664
+ position: fixed;
10433
10665
  inset: 0;
10666
+ z-index: ${(props) => props.theme.zIndices.overlay};
10667
+ opacity: 0.2;
10668
+
10669
+ @media (prefers-reduced-motion: no-preference) {
10670
+ animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
10671
+ ${(props) => props.theme.motion.easings.authenticMotion};
10672
+ }
10434
10673
  `;
10435
- const ModalLayout = ({ onClose, labelledBy, ...props }) => {
10436
- useLockScroll(true);
10437
- return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(ModalWrapper, { justifyContent: "center", paddingLeft: 8, paddingRight: 8, position: "fixed", zIndex: "modal", children: /* @__PURE__ */ jsxRuntime.jsx(FocusTrap, { children: /* @__PURE__ */ jsxRuntime.jsx(DismissibleLayer, { onEscapeKeyDown: onClose, onPointerDownOutside: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
10438
- Box,
10439
- {
10440
- "aria-labelledby": labelledBy,
10441
- "aria-modal": true,
10442
- onClick: (e) => e.stopPropagation(),
10443
- background: "neutral0",
10444
- hasRadius: true,
10445
- role: "dialog",
10446
- shadow: "popupShadow",
10447
- width: "83rem",
10448
- ...props
10674
+ const ContentImpl = styledComponents.styled(Dialog__namespace.Content)`
10675
+ max-width: 83rem;
10676
+ max-height: 80vh;
10677
+ height: min-content;
10678
+ width: 60%;
10679
+ overflow: hidden;
10680
+ margin: 0 auto;
10681
+ display: flex;
10682
+ flex-direction: column;
10683
+
10684
+ position: fixed;
10685
+ top: 50%;
10686
+ left: 50%;
10687
+ transform: translate(-50%, -50%);
10688
+
10689
+ border-radius: ${(props) => props.theme.borderRadius};
10690
+ background-color: ${(props) => props.theme.colors.neutral0};
10691
+ box-shadow: ${(props) => props.theme.shadows.popupShadow};
10692
+ z-index: ${(props) => props.theme.zIndices.modal};
10693
+
10694
+ @media (prefers-reduced-motion: no-preference) {
10695
+ &[data-state='open'] {
10696
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
10697
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
10698
+ animation-name: ${ANIMATIONS.modalPopIn};
10449
10699
  }
10450
- ) }) }) }) }) });
10451
- };
10452
- const ModalHeaderWrapper = styledComponents.styled(Box)`
10453
- border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
10454
- border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
10700
+
10701
+ &[data-state='closed'] {
10702
+ animation-duration: ${(props) => props.theme.motion.timings["120"]};
10703
+ animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
10704
+ animation-name: ${ANIMATIONS.modalPopOut};
10705
+ }
10706
+ }
10455
10707
  `;
10456
- const ModalHeader = ({ children, closeLabel = "Close the modal" }) => {
10457
- const onClose = useModal();
10458
- return /* @__PURE__ */ jsxRuntime.jsx(ModalHeaderWrapper, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", children: [
10459
- children,
10460
- /* @__PURE__ */ jsxRuntime.jsx(IconButton, { onClick: onClose, label: closeLabel, withTooltip: false, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) })
10461
- ] }) });
10462
- };
10463
- const ModalFooterWrapper = styledComponents.styled(Box)`
10464
- border-radius: 0 0 ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius};
10465
- border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
10708
+ const Close = React__namespace.forwardRef((props, forwardedRef) => {
10709
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Close, { ...props, asChild: true, ref: forwardedRef });
10710
+ });
10711
+ const Header = React__namespace.forwardRef(
10712
+ ({ children, closeLabel = "Close modal", ...restProps }, forwardedRef) => {
10713
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10714
+ Head,
10715
+ {
10716
+ ref: forwardedRef,
10717
+ padding: 4,
10718
+ paddingLeft: 5,
10719
+ paddingRight: 5,
10720
+ background: "neutral100",
10721
+ justifyContent: "space-between",
10722
+ ...restProps,
10723
+ tag: "header",
10724
+ children: [
10725
+ children,
10726
+ /* @__PURE__ */ jsxRuntime.jsx(Close, { children: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { withTooltip: false, label: closeLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) }) })
10727
+ ]
10728
+ }
10729
+ );
10730
+ }
10731
+ );
10732
+ const Head = styledComponents.styled(Flex)`
10733
+ border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
10466
10734
  `;
10467
- const ModalFooter = ({ startActions, endActions }) => {
10468
- return /* @__PURE__ */ jsxRuntime.jsx(ModalFooterWrapper, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", children: [
10469
- /* @__PURE__ */ jsxRuntime.jsx(Flex, { gap: 2, children: startActions }),
10470
- /* @__PURE__ */ jsxRuntime.jsx(Flex, { gap: 2, children: endActions })
10471
- ] }) });
10472
- };
10473
- const ModalBodyWrapper = styledComponents.styled(Box)`
10474
- overflow: auto;
10475
- max-height: 60vh;
10735
+ const Title = React__namespace.forwardRef((props, forwardedRef) => {
10736
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "bold", ref: forwardedRef, ...props }) });
10737
+ });
10738
+ const Body = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
10739
+ return /* @__PURE__ */ jsxRuntime.jsx(BodyScroll, { ref: forwardedRef, ...restProps, children });
10740
+ });
10741
+ const BodyScroll = styledComponents.styled(ScrollAreaImpl$1)`
10742
+ padding-inline: ${(props) => props.theme.spaces[8]};
10743
+
10744
+ & > div {
10745
+ padding-block: ${(props) => props.theme.spaces[8]};
10746
+
10747
+ & > div {
10748
+ // the scroll area component applies a display: table to the child, which we don't want.
10749
+ display: block !important;
10750
+ }
10751
+ }
10476
10752
  `;
10477
- const ModalBody = (props) => {
10478
- return /* @__PURE__ */ jsxRuntime.jsx(ModalBodyWrapper, { padding: 7, ...props });
10479
- };
10753
+ const Footer = React__namespace.forwardRef((props, forwardedRef) => {
10754
+ return /* @__PURE__ */ jsxRuntime.jsx(
10755
+ Foot,
10756
+ {
10757
+ ref: forwardedRef,
10758
+ padding: 4,
10759
+ paddingLeft: 5,
10760
+ paddingRight: 5,
10761
+ background: "neutral100",
10762
+ justifyContent: "space-between",
10763
+ ...props,
10764
+ tag: "footer"
10765
+ }
10766
+ );
10767
+ });
10768
+ const Foot = styledComponents.styled(Flex)`
10769
+ border-top: solid 1px ${(props) => props.theme.colors.neutral150};
10770
+ flex: 1;
10771
+ `;
10772
+ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10773
+ __proto__: null,
10774
+ Body,
10775
+ Close,
10776
+ Content: Content$2,
10777
+ Footer,
10778
+ Header,
10779
+ Root: Root$2,
10780
+ Title,
10781
+ Trigger: Trigger$2
10782
+ }, Symbol.toStringTag, { value: "Module" }));
10480
10783
  const INITIAL_VALUE = "";
10481
10784
  const NumberInput = React__namespace.forwardRef(
10482
10785
  ({ startAction, locale: defaultLocale, onValueChange, value, step = 1, disabled = false, ...props }, ref) => {
@@ -10556,7 +10859,7 @@ const NumberInput = React__namespace.forwardRef(
10556
10859
  onKeyDown: handleKeyDown,
10557
10860
  onBlur: handleBlur,
10558
10861
  value: inputValue,
10559
- endAction: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10862
+ endAction: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", children: [
10560
10863
  /* @__PURE__ */ jsxRuntime.jsx(
10561
10864
  ArrowButton,
10562
10865
  {
@@ -10590,16 +10893,48 @@ const NumberInput = React__namespace.forwardRef(
10590
10893
  );
10591
10894
  const ArrowButton = styledComponents.styled.button`
10592
10895
  display: flex;
10593
- height: 1rem;
10594
- align-items: ${({ $reverse }) => $reverse ? "flex-end" : "flex-start"};
10896
+ justify-content: center;
10897
+ align-items: center;
10595
10898
  transform: translateY(${({ $reverse }) => $reverse ? `-2px` : `2px`});
10596
10899
  cursor: ${({ disabled }) => disabled ? "not-allowed" : void 0};
10900
+ height: 1.1rem;
10901
+
10597
10902
  svg {
10598
- display: block;
10599
- height: 0.4rem;
10903
+ width: 1.2rem;
10600
10904
  transform: ${({ $reverse }) => $reverse ? "rotateX(180deg)" : void 0};
10601
10905
  }
10602
10906
  `;
10907
+ function useControllableState({
10908
+ prop,
10909
+ defaultProp,
10910
+ onChange = () => {
10911
+ }
10912
+ }) {
10913
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
10914
+ defaultProp,
10915
+ onChange
10916
+ });
10917
+ const isControlled = prop !== void 0;
10918
+ const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
10919
+ const value = isControlled ? propValue : uncontrolledProp;
10920
+ const handleChange = uiPrimitives.useCallbackRef(onChange);
10921
+ const setValue = React__namespace.useCallback(
10922
+ (nextValue) => {
10923
+ if (isControlled) {
10924
+ const setter = nextValue;
10925
+ const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
10926
+ if (value2 !== propValue) {
10927
+ handleChange(value2);
10928
+ setUncontrolledProp(nextValue);
10929
+ }
10930
+ } else {
10931
+ setUncontrolledProp(nextValue);
10932
+ }
10933
+ },
10934
+ [isControlled, propValue, setUncontrolledProp, handleChange]
10935
+ );
10936
+ return [value, setValue];
10937
+ }
10603
10938
  const PaginationContext = React__namespace.createContext({ activePage: 1, pageCount: 1 });
10604
10939
  const usePagination = () => React__namespace.useContext(PaginationContext);
10605
10940
  const Pagination = ({ children, label = "Pagination", activePage, pageCount }) => {
@@ -10677,133 +11012,48 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(Box, {
10677
11012
  /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children }),
10678
11013
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
10679
11014
  ] });
10680
- const POPOVER_PLACEMENTS = [
10681
- "top",
10682
- "top-start",
10683
- "top-end",
10684
- "right",
10685
- "right-start",
10686
- "right-end",
10687
- "bottom",
10688
- "bottom-start",
10689
- "bottom-end",
10690
- "left",
10691
- "left-start",
10692
- "left-end"
10693
- ];
10694
- const PopoverWrapper = styledComponents.styled(Box)`
11015
+ const Root$1 = Popover__namespace.Root;
11016
+ const Trigger$1 = React__namespace.forwardRef((props, forwardedRef) => {
11017
+ return /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
11018
+ });
11019
+ const Content$1 = React__namespace.forwardRef((props, forwardedRef) => {
11020
+ return /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { sideOffset: 4, side: "bottom", align: "start", ...props, ref: forwardedRef }) });
11021
+ });
11022
+ const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
10695
11023
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
10696
11024
  z-index: ${({ theme }) => theme.zIndices.popover};
11025
+ background-color: ${(props) => props.theme.colors.neutral0};
10697
11026
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
10698
- `;
10699
- const Content = React__namespace.forwardRef(
10700
- ({
10701
- source,
10702
- children,
10703
- spacing = 0,
10704
- fullWidth = false,
10705
- placement = "bottom-start",
10706
- centered = false,
10707
- onEscapeKeyDown,
10708
- onPointerDownOutside,
10709
- onDismiss,
10710
- onFocusOutside,
10711
- ...props
10712
- }, forwardedRef) => {
10713
- const [content, setContent] = React__namespace.useState(null);
10714
- const [width, setWidth] = React__namespace.useState(void 0);
10715
- const isRightClickOutsideRef = React__namespace.useRef(false);
10716
- const { x, y, refs, strategy } = reactDom$1.useFloating({
10717
- strategy: "fixed",
10718
- placement: centered ? "bottom" : placement,
10719
- middleware: [
10720
- reactDom$1.offset({
10721
- mainAxis: spacing
10722
- }),
10723
- reactDom$1.shift(),
10724
- reactDom$1.flip()
10725
- ],
10726
- elements: {
10727
- reference: source.current
10728
- },
10729
- whileElementsMounted: reactDom$1.autoUpdate
10730
- });
10731
- React__namespace.useLayoutEffect(() => {
10732
- if (fullWidth) {
10733
- setWidth(source.current.offsetWidth);
11027
+
11028
+ @media (prefers-reduced-motion: no-preference) {
11029
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
11030
+
11031
+ &[data-state='open'] {
11032
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
11033
+
11034
+ &[data-side='top'] {
11035
+ animation-name: ${ANIMATIONS.slideDownIn};
10734
11036
  }
10735
- }, [fullWidth, source]);
10736
- React__namespace.useEffect(() => {
10737
- if (content)
10738
- return ariaHidden.hideOthers(content);
10739
- }, [content]);
10740
- const handleDismiss = uiPrimitives.useCallbackRef(onDismiss);
10741
- React__namespace.useEffect(() => {
10742
- const close = () => {
10743
- handleDismiss();
10744
- };
10745
- window.addEventListener("blur", close);
10746
- window.addEventListener("resize", close);
10747
- return () => {
10748
- window.removeEventListener("blur", close);
10749
- window.removeEventListener("resize", close);
10750
- };
10751
- }, [handleDismiss]);
10752
- const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node), refs.setFloating);
10753
- return /* @__PURE__ */ jsxRuntime.jsx(reactRemoveScroll.RemoveScroll, { allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
10754
- reactFocusScope.FocusScope,
10755
- {
10756
- asChild: true,
10757
- loop: true,
10758
- trapped: true,
10759
- onUnmountAutoFocus: (event) => {
10760
- event.preventDefault();
10761
- if (!isRightClickOutsideRef.current)
10762
- source.current?.focus({ preventScroll: true });
10763
- },
10764
- children: /* @__PURE__ */ jsxRuntime.jsx(
10765
- DismissibleLayer,
10766
- {
10767
- asChild: true,
10768
- onEscapeKeyDown,
10769
- onPointerDownOutside: uiPrimitives.composeEventHandlers(
10770
- onPointerDownOutside,
10771
- (event) => {
10772
- const originalEvent = event.detail.originalEvent;
10773
- const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
10774
- const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
10775
- isRightClickOutsideRef.current = isRightClick;
10776
- },
10777
- { checkForDefaultPrevented: false }
10778
- ),
10779
- onFocusOutside: uiPrimitives.composeEventHandlers(onFocusOutside, (event) => event.preventDefault(), {
10780
- checkForDefaultPrevented: false
10781
- }),
10782
- onDismiss,
10783
- children: /* @__PURE__ */ jsxRuntime.jsx(
10784
- PopoverWrapper,
10785
- {
10786
- ref: composedRefs,
10787
- style: {
10788
- left: x,
10789
- top: y,
10790
- position: strategy,
10791
- width: width || void 0
10792
- },
10793
- hasRadius: true,
10794
- background: "neutral0",
10795
- padding: 1,
10796
- ...props,
10797
- children
10798
- }
10799
- )
10800
- }
10801
- )
11037
+
11038
+ &[data-side='bottom'] {
11039
+ animation-name: ${ANIMATIONS.slideUpIn};
10802
11040
  }
10803
- ) });
11041
+ }
11042
+
11043
+ &[data-state='closed'] {
11044
+ animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
11045
+
11046
+ &[data-side='top'] {
11047
+ animation-name: ${ANIMATIONS.slideDownOut};
11048
+ }
11049
+
11050
+ &[data-side='bottom'] {
11051
+ animation-name: ${ANIMATIONS.slideUpOut};
11052
+ }
11053
+ }
10804
11054
  }
10805
- );
10806
- const Scrolling = ({ children, intersectionId, onReachEnd, ...props }) => {
11055
+ `;
11056
+ const ScrollAreaImpl = ({ children, intersectionId, onReachEnd, ...props }) => {
10807
11057
  const popoverRef = React__namespace.useRef(null);
10808
11058
  const generatedIntersectionId = useId();
10809
11059
  useIntersection(popoverRef, onReachEnd ?? (() => {
@@ -10811,99 +11061,128 @@ const Scrolling = ({ children, intersectionId, onReachEnd, ...props }) => {
10811
11061
  selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
10812
11062
  skipWhen: !intersectionId || !onReachEnd
10813
11063
  });
10814
- return /* @__PURE__ */ jsxRuntime.jsxs(PopoverScrollable, { ref: popoverRef, ...props, children: [
11064
+ return /* @__PURE__ */ jsxRuntime.jsxs(PopoverScrollArea, { ref: popoverRef, ...props, children: [
10815
11065
  children,
10816
11066
  intersectionId && onReachEnd && /* @__PURE__ */ jsxRuntime.jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
10817
11067
  ] });
10818
11068
  };
10819
- const PopoverScrollable = styledComponents.styled(Box)`
10820
- max-height: 20rem;
10821
- overflow-y: auto;
10822
- overflow-x: hidden;
11069
+ const PopoverScrollArea = styledComponents.styled(ScrollAreaImpl$1)`
11070
+ height: 20rem;
11071
+ `;
11072
+ const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11073
+ __proto__: null,
11074
+ Content: Content$1,
11075
+ Root: Root$1,
11076
+ ScrollArea: ScrollAreaImpl,
11077
+ Trigger: Trigger$1
11078
+ }, Symbol.toStringTag, { value: "Module" }));
11079
+ const ProgressBar = React__namespace.forwardRef(
11080
+ ({ size = "M", value, ...restProps }, forwardedRef) => {
11081
+ return /* @__PURE__ */ jsxRuntime.jsx(ProgressRoot, { ref: forwardedRef, $size: size, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(ProgressIndicator, { style: { transform: `translate3D(-${100 - (value ?? 0)}%, 0, 0)` } }) });
11082
+ }
11083
+ );
11084
+ const ProgressRoot = styledComponents.styled(Progress__namespace.Root)`
11085
+ position: relative;
11086
+ overflow: hidden;
11087
+ width: ${(props) => props.$size === "S" ? "7.8rem" : "10.2rem"};
11088
+ height: ${(props) => props.$size === "S" ? "0.4rem" : "0.8rem"};
11089
+ background-color: ${(props) => props.theme.colors.neutral600};
11090
+ border-radius: ${(props) => props.theme.borderRadius};
10823
11091
 
10824
- &::-webkit-scrollbar {
10825
- -webkit-appearance: none;
10826
- width: 4px;
11092
+ /* Fix overflow clipping in Safari */
11093
+ /* https://gist.github.com/domske/b66047671c780a238b51c51ffde8d3a0 */
11094
+ transform: translateZ(0);
11095
+ `;
11096
+ const ProgressIndicator = styledComponents.styled(Progress__namespace.Indicator)`
11097
+ background-color: ${({ theme }) => theme.colors.neutral0};
11098
+ border-radius: ${({ theme }) => theme.borderRadius};
11099
+ width: 100%;
11100
+ height: 100%;
11101
+
11102
+ @media (prefers-reduced-motion: no-preference) {
11103
+ transition: transform ${(props) => props.theme.motion.timings["320"]}
11104
+ ${(props) => props.theme.motion.easings.authenticMotion};
10827
11105
  }
11106
+ `;
11107
+ const Group = React__namespace.forwardRef((props, forwardedRef) => {
11108
+ return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupRoot, { ref: forwardedRef, ...props });
11109
+ });
11110
+ const RadioGroupRoot = styledComponents.styled(RadioGroup__namespace.Root)`
11111
+ display: flex;
11112
+ flex-direction: column;
11113
+ gap: ${(props) => props.theme.spaces[3]};
11114
+ `;
11115
+ const Item = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
11116
+ const id = useId(idProp);
11117
+ return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
11118
+ /* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupIndicator, {}) }),
11119
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "label", htmlFor: id, children })
11120
+ ] });
11121
+ });
11122
+ const RadioGroupItem = styledComponents.styled(RadioGroup__namespace.Item)`
11123
+ background: ${(props) => props.theme.colors.neutral0};
11124
+ width: 2rem;
11125
+ height: 2rem;
11126
+ flex: 0 0 2rem;
11127
+ border-radius: 50%;
11128
+ border: 1px solid ${(props) => props.theme.colors.neutral300};
11129
+ position: relative;
11130
+ z-index: 0;
10828
11131
 
10829
- &::-webkit-scrollbar-track {
10830
- background: ${({ theme }) => theme.colors.neutral0};
11132
+ @media (prefers-reduced-motion: no-preference) {
11133
+ transition: border-color ${(props) => props.theme.motion.timings["120"]}
11134
+ ${(props) => props.theme.motion.easings.easeOutQuad};
10831
11135
  }
10832
11136
 
10833
- &::-webkit-scrollbar-thumb {
10834
- background: ${({ theme }) => theme.colors.neutral150};
10835
- border-radius: ${({ theme }) => theme.borderRadius};
10836
- margin-right: 10px;
11137
+ &[data-state='checked'] {
11138
+ border: 1px solid ${(props) => props.theme.colors.primary600};
10837
11139
  }
10838
- `;
10839
- const Popover = ({
10840
- children,
10841
- source,
10842
- spacing,
10843
- fullWidth,
10844
- placement,
10845
- centered,
10846
- onEscapeKeyDown,
10847
- onPointerDownOutside,
10848
- onDismiss,
10849
- ...restProps
10850
- }) => {
10851
- return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
10852
- Content,
10853
- {
10854
- source,
10855
- spacing,
10856
- fullWidth,
10857
- placement,
10858
- centered,
10859
- onEscapeKeyDown,
10860
- onPointerDownOutside,
10861
- onDismiss,
10862
- children: /* @__PURE__ */ jsxRuntime.jsx(Scrolling, { ...restProps, children })
10863
- }
10864
- ) });
10865
- };
10866
- const primitives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10867
- __proto__: null,
10868
- Content,
10869
- Scrolling
10870
- }, Symbol.toStringTag, { value: "Module" }));
10871
- const ProgressbarBase = styledComponents.styled(Box)`
10872
- &:before {
10873
- background-color: ${({ theme }) => theme.colors.neutral0};
10874
- border-radius: ${({ theme }) => theme.borderRadius};
10875
- bottom: 0;
11140
+
11141
+ &[data-disabled] {
11142
+ background-color: ${(props) => props.theme.colors.neutral200};
11143
+ }
11144
+
11145
+ /* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
11146
+ &::before {
10876
11147
  content: '';
10877
11148
  position: absolute;
10878
- top: 0;
10879
- width: ${({ $value }) => `${$value}%`};
11149
+ top: 50%;
11150
+ left: 50%;
11151
+ transform: translate(-50%, -50%);
11152
+ width: 100%;
11153
+ height: 100%;
11154
+ min-width: 44px;
11155
+ min-height: 44px;
10880
11156
  }
10881
11157
  `;
10882
- const ProgressBar = ({ min = 0, max = 100, value = 0, children, size = "M", ...props }) => {
10883
- return /* @__PURE__ */ jsxRuntime.jsx(
10884
- ProgressbarBase,
10885
- {
10886
- background: "neutral600",
10887
- hasRadius: true,
10888
- "aria-label": children,
10889
- "aria-valuemax": max,
10890
- "aria-valuemin": min,
10891
- "aria-valuenow": value,
10892
- height: size === "S" ? 1 : 2,
10893
- position: "relative",
10894
- role: "progressbar",
10895
- $value: value,
10896
- width: size === "S" ? "78px" : "102px",
10897
- ...props
11158
+ const RadioGroupIndicator = styledComponents.styled(RadioGroup__namespace.Indicator)`
11159
+ display: flex;
11160
+ align-items: center;
11161
+ justify-content: center;
11162
+ width: 100%;
11163
+ height: 100%;
11164
+ position: relative;
11165
+
11166
+ &[data-state='checked'] {
11167
+ @media (prefers-reduced-motion: no-preference) {
11168
+ animation: ${ANIMATIONS.popIn} ${(props) => props.theme.motion.timings["200"]};
10898
11169
  }
10899
- );
10900
- };
10901
- const Radio = ({ children, ...props }) => {
10902
- return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { alignItems: "center", tag: "label", gap: 2, children: [
10903
- /* @__PURE__ */ jsxRuntime.jsx(BaseRadio, { ...props }),
10904
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: "neutral800", children })
10905
- ] });
10906
- };
11170
+ }
11171
+
11172
+ &::after {
11173
+ content: '';
11174
+ display: block;
11175
+ width: 1rem;
11176
+ height: 1rem;
11177
+ border-radius: 50%;
11178
+ background: ${(props) => props.theme.colors.primary600};
11179
+ }
11180
+ `;
11181
+ const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11182
+ __proto__: null,
11183
+ Group,
11184
+ Item
11185
+ }, Symbol.toStringTag, { value: "Module" }));
10907
11186
  const focusFocusable = (node) => {
10908
11187
  const nextNode = node.querySelector('[tabindex="0"]');
10909
11188
  if (nextNode) {
@@ -11046,7 +11325,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
11046
11325
  }
11047
11326
  };
11048
11327
  const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
11049
- React__namespace.useLayoutEffect(() => {
11328
+ useIsomorphicLayoutEffect(() => {
11050
11329
  const focusableNodes = getFocusableNodes(tdRef.current, true);
11051
11330
  if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
11052
11331
  tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
@@ -11069,7 +11348,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
11069
11348
  }
11070
11349
  setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
11071
11350
  }, [coords, setTableValues]);
11072
- React__namespace.useLayoutEffect(() => {
11351
+ useIsomorphicLayoutEffect(() => {
11073
11352
  const cell = tdRef.current;
11074
11353
  const focusableNodes = getFocusableNodes(cell, true);
11075
11354
  focusableNodes.forEach((node) => {
@@ -11153,7 +11432,7 @@ const Searchbar = React__namespace.forwardRef(
11153
11432
  inputRef.current.focus();
11154
11433
  };
11155
11434
  const actualRef = composeRefs(ref, inputRef);
11156
- return /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Root$1, { name, children: [
11435
+ return /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Root$6, { name, children: [
11157
11436
  /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(Label, { children }) }),
11158
11437
  /* @__PURE__ */ jsxRuntime.jsx(
11159
11438
  SearchbarInput,
@@ -11161,7 +11440,7 @@ const Searchbar = React__namespace.forwardRef(
11161
11440
  ref: actualRef,
11162
11441
  value,
11163
11442
  startAction: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { "aria-hidden": true }),
11164
- endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(Action, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) }) : void 0,
11443
+ endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(Action$1, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) }) : void 0,
11165
11444
  ...props
11166
11445
  }
11167
11446
  )
@@ -11230,6 +11509,7 @@ const MultiSelect = React__namespace.forwardRef(
11230
11509
  onReachEnd,
11231
11510
  placeholder,
11232
11511
  required: requiredProp,
11512
+ size,
11233
11513
  startIcon,
11234
11514
  value: passedValue,
11235
11515
  withTags,
@@ -11290,7 +11570,7 @@ const MultiSelect = React__namespace.forwardRef(
11290
11570
  ariaDescription = `${id}-hint`;
11291
11571
  }
11292
11572
  return /* @__PURE__ */ jsxRuntime.jsxs(
11293
- Root,
11573
+ Root$4,
11294
11574
  {
11295
11575
  onOpenChange: handleOpenChange,
11296
11576
  disabled,
@@ -11301,7 +11581,7 @@ const MultiSelect = React__namespace.forwardRef(
11301
11581
  multi: true,
11302
11582
  children: [
11303
11583
  /* @__PURE__ */ jsxRuntime.jsx(
11304
- Trigger,
11584
+ Trigger$3,
11305
11585
  {
11306
11586
  ref: forwardedRef,
11307
11587
  id,
@@ -11313,11 +11593,12 @@ const MultiSelect = React__namespace.forwardRef(
11313
11593
  disabled,
11314
11594
  clearLabel,
11315
11595
  onClear: value?.length ? onClear : void 0,
11316
- paddingLeft: withTags && value?.length ? 1 : 3,
11596
+ withTags: Boolean(withTags && (value?.length ?? 0 > 0)),
11597
+ size,
11317
11598
  children: /* @__PURE__ */ jsxRuntime.jsx(Value, { placeholder, textColor: value?.length ? "neutral800" : "neutral600", children: value?.length ? withTags ? renderTags : customizeContent ? customizeContent(value) : void 0 : void 0 })
11318
11599
  }
11319
11600
  ),
11320
- /* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$1, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport, { ref: viewportRef, children: [
11601
+ /* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport, { ref: viewportRef, children: [
11321
11602
  children,
11322
11603
  /* @__PURE__ */ jsxRuntime.jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
11323
11604
  ] }) }) })
@@ -11328,74 +11609,20 @@ const MultiSelect = React__namespace.forwardRef(
11328
11609
  );
11329
11610
  const MultiSelectOption = React__namespace.forwardRef(
11330
11611
  ({ value, children, startIcon, ...restProps }, ref) => {
11331
- return /* @__PURE__ */ jsxRuntime.jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
11612
+ return /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
11332
11613
  startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
11333
- /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(
11334
- CheckMark,
11335
- {
11336
- hasRadius: true,
11337
- overflow: "hidden",
11338
- position: "relative",
11339
- $indeterminate: isIntermediate,
11340
- $selected: isSelected,
11341
- zIndex: 1,
11342
- height: "18px",
11343
- width: "18px"
11344
- }
11345
- ) }),
11346
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
11614
+ /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
11615
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
11347
11616
  ] });
11348
11617
  }
11349
11618
  );
11350
- const CheckMark = styledComponents.styled(Box)`
11351
- border: 1px solid
11352
- ${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral300};
11353
- background-color: ${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral0};
11354
-
11355
- ${({ theme, $indeterminate }) => $indeterminate && styledComponents.css`
11356
- &::after {
11357
- content: '';
11358
- display: block;
11359
- position: relative;
11360
- color: white;
11361
- height: 2px;
11362
- width: 10px;
11363
- background-color: ${theme.colors.neutral0};
11364
- left: 50%;
11365
- top: 50%;
11366
- transform: translateX(-50%) translateY(-50%);
11367
- }
11368
- `}
11369
-
11370
- ${({ $selected }) => $selected && styledComponents.css`
11371
- &::after {
11372
- content: '';
11373
- background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
11374
- width: 100%;
11375
- height: 100%;
11376
- position: absolute;
11377
- }
11378
- `}
11379
- `;
11380
11619
  const MultiSelectGroup = React__namespace.forwardRef(
11381
11620
  ({ children, label, startIcon, values = [], ...restProps }, ref) => {
11382
- return /* @__PURE__ */ jsxRuntime.jsxs(Group, { ref, children: [
11383
- /* @__PURE__ */ jsxRuntime.jsxs(Item, { value: values, ...restProps, children: [
11621
+ return /* @__PURE__ */ jsxRuntime.jsxs(Group$1, { ref, children: [
11622
+ /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { value: values, ...restProps, children: [
11384
11623
  startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
11385
- /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(
11386
- CheckMark,
11387
- {
11388
- hasRadius: true,
11389
- overflow: "hidden",
11390
- position: "relative",
11391
- $indeterminate: isIntermediate,
11392
- $selected: isSelected,
11393
- zIndex: 1,
11394
- height: "18px",
11395
- width: "18px"
11396
- }
11397
- ) }),
11398
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: "neutral800", children: label })
11624
+ /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
11625
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: label })
11399
11626
  ] }),
11400
11627
  children
11401
11628
  ] });
@@ -11460,13 +11687,6 @@ const SubNavWrapper = styledComponents.styled(Box)`
11460
11687
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
11461
11688
  z-index: 1;
11462
11689
  `;
11463
- const usePrevious = (value) => {
11464
- const ref = React__namespace.useRef();
11465
- React__namespace.useEffect(() => {
11466
- ref.current = value;
11467
- });
11468
- return ref.current;
11469
- };
11470
11690
  const CustomDivider = styledComponents.styled(Divider)`
11471
11691
  width: 2.4rem;
11472
11692
  background-color: ${({ theme }) => theme.colors.neutral200};
@@ -11486,7 +11706,7 @@ const SubNavHeader = ({
11486
11706
  id
11487
11707
  }) => {
11488
11708
  const [isSearchOpen, setSearchOpen] = React__namespace.useState(false);
11489
- const previousSearchOpenValue = usePrevious(isSearchOpen);
11709
+ const previousSearchOpenValue = uiPrimitives.usePrev(isSearchOpen);
11490
11710
  const clearButtonId = useId(id);
11491
11711
  const searchRef = React__namespace.useRef(void 0);
11492
11712
  const searchButtonRef = React__namespace.useRef(void 0);
@@ -11566,6 +11786,12 @@ const SubNavLink = forwardRef(
11566
11786
  );
11567
11787
  }
11568
11788
  );
11789
+ const CustomBullet = styledComponents.styled.span`
11790
+ width: 0.4rem;
11791
+ height: 0.4rem;
11792
+ background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
11793
+ border-radius: 50%;
11794
+ `;
11569
11795
  const SubNavLinkWrapper = styledComponents.styled(BaseLink)`
11570
11796
  display: flex;
11571
11797
  align-items: center;
@@ -11585,18 +11811,16 @@ const SubNavLinkWrapper = styledComponents.styled(BaseLink)`
11585
11811
  font-weight: 500;
11586
11812
  `;
11587
11813
  }}
11814
+
11815
+ ${CustomBullet} {
11816
+ background-color: ${({ theme }) => theme.colors.primary600};
11817
+ }
11588
11818
  }
11589
11819
 
11590
11820
  &:focus-visible {
11591
11821
  outline-offset: -2px;
11592
11822
  }
11593
11823
  `;
11594
- const CustomBullet = styledComponents.styled.span`
11595
- width: 0.4rem;
11596
- height: 0.4rem;
11597
- background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
11598
- border-radius: 50%;
11599
- `;
11600
11824
  const IconWrapper = styledComponents.styled.div`
11601
11825
  svg {
11602
11826
  height: 1.6rem;
@@ -11727,341 +11951,216 @@ const SubNavSections = ({ children, spacing = 2, horizontal = false, ...props })
11727
11951
  }
11728
11952
  ) });
11729
11953
  };
11730
- const Switch = React__namespace.forwardRef(
11731
- ({ label, onChange, onLabel = "On", offLabel = "Off", selected, visibleLabels = false, ...props }, ref) => {
11732
- return /* @__PURE__ */ jsxRuntime.jsx(
11733
- SwitchButton,
11734
- {
11735
- ref,
11736
- role: "switch",
11737
- "aria-checked": selected,
11738
- "aria-label": label,
11739
- onClick: onChange,
11740
- type: "button",
11741
- ...props,
11742
- children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
11743
- /* @__PURE__ */ jsxRuntime.jsxs(SwitchContent, { $visibleLabels: visibleLabels, children: [
11744
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: onLabel }),
11745
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: offLabel })
11746
- ] }),
11747
- visibleLabels && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, paddingLeft: 2, color: selected ? "success600" : "danger600", children: selected ? onLabel : offLabel })
11748
- ] })
11749
- }
11750
- );
11954
+ const SwitchImpl = React__namespace.forwardRef(
11955
+ ({
11956
+ visibleLabels,
11957
+ onLabel = "On",
11958
+ offLabel = "Off",
11959
+ onCheckedChange: onCheckedChangeProp,
11960
+ checked: checkedProp,
11961
+ defaultChecked,
11962
+ disabled,
11963
+ ...restProps
11964
+ }, forwardedRef) => {
11965
+ const [internalChecked, setInternalChecked] = useControllableState$1({
11966
+ prop: checkedProp,
11967
+ defaultProp: defaultChecked
11968
+ });
11969
+ const handleCheckChange = (checked) => {
11970
+ setInternalChecked(checked);
11971
+ };
11972
+ return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 3, children: [
11973
+ /* @__PURE__ */ jsxRuntime.jsx(
11974
+ SwitchRoot,
11975
+ {
11976
+ ref: forwardedRef,
11977
+ onCheckedChange: uiPrimitives.composeEventHandlers(onCheckedChangeProp, handleCheckChange),
11978
+ checked: internalChecked,
11979
+ disabled,
11980
+ ...restProps,
11981
+ children: /* @__PURE__ */ jsxRuntime.jsx(SwitchThumb, {})
11982
+ }
11983
+ ),
11984
+ visibleLabels ? /* @__PURE__ */ jsxRuntime.jsx(LabelTypography, { "aria-hidden": true, "data-disabled": disabled, "data-state": internalChecked ? "checked" : "unchecked", children: internalChecked ? onLabel : offLabel }) : null
11985
+ ] });
11751
11986
  }
11752
11987
  );
11753
- const SwitchContent = styledComponents.styled.div`
11754
- background: ${({ theme }) => theme.colors.danger500};
11755
- border: none;
11756
- border-radius: 16px;
11757
- position: relative;
11758
- height: 2.4rem;
11988
+ const SwitchRoot = styledComponents.styled(Switch__namespace.Root)`
11759
11989
  width: 4rem;
11990
+ height: 2.4rem;
11991
+ border-radius: 1.2rem;
11992
+ background-color: ${({ theme }) => theme.colors.danger500};
11760
11993
 
11761
- & > span {
11762
- font-size: ${({ $visibleLabels }) => $visibleLabels ? "1rem" : 0};
11994
+ &[data-state='checked'] {
11995
+ background-color: ${({ theme }) => theme.colors.success500};
11763
11996
  }
11764
11997
 
11765
- &:before {
11766
- content: '';
11767
- background: ${({ theme }) => theme.colors.neutral0};
11768
- width: 1rem;
11769
- height: 1rem;
11770
- border-radius: 50%;
11771
- position: absolute;
11772
- transition: all 0.5s;
11773
- left: ${({ theme }) => theme.spaces[1]};
11774
- top: ${({ theme }) => theme.spaces[1]};
11998
+ &[data-disabled] {
11999
+ background-color: ${({ theme }) => theme.colors.neutral300};
11775
12000
  }
11776
12001
 
11777
- @media (prefers-reduced-motion: reduce) {
11778
- &:before {
11779
- transition: none;
11780
- }
12002
+ @media (prefers-reduced-motion: no-preference) {
12003
+ transition: ${(props) => props.theme.transitions.backgroundColor};
11781
12004
  }
11782
12005
  `;
11783
- const SwitchButton = styledComponents.styled.button`
11784
- background: transparent;
11785
- padding: 0;
11786
- border: none;
12006
+ const SwitchThumb = styledComponents.styled(Switch__namespace.Thumb)`
12007
+ display: block;
12008
+ height: 1.6rem;
12009
+ width: 1.6rem;
12010
+ border-radius: 50%;
12011
+ background-color: ${({ theme }) => theme.colors.neutral0};
12012
+ transform: translateX(4px);
11787
12013
 
11788
- &[aria-checked='true'] ${SwitchContent} {
11789
- background: ${({ theme }) => theme.colors.success500};
12014
+ &[data-state='checked'] {
12015
+ transform: translateX(20px);
11790
12016
  }
11791
12017
 
11792
- &[aria-checked='true'] ${SwitchContent}:before {
11793
- transform: translateX(1rem);
12018
+ @media (prefers-reduced-motion: no-preference) {
12019
+ transition: transform ${(props) => props.theme.motion.timings["120"]}
12020
+ ${(props) => props.theme.motion.easings.authenticMotion};
11794
12021
  }
11795
12022
  `;
11796
- const SimpleTabBox = styledComponents.styled(Box)`
11797
- border-bottom: 2px solid
11798
- ${({ theme, $selected, $hasError }) => {
11799
- if ($selected) {
11800
- if ($hasError) {
11801
- return theme.colors.danger600;
11802
- }
11803
- return theme.colors.primary600;
12023
+ const LabelTypography = styledComponents.styled(Typography)`
12024
+ color: ${(props) => props.theme.colors.danger600};
12025
+
12026
+ &[data-state='checked'] {
12027
+ color: ${(props) => props.theme.colors.success600};
12028
+ }
12029
+
12030
+ &[data-disabled='true'] {
12031
+ color: ${({ theme }) => theme.colors.neutral500};
11804
12032
  }
11805
- return "transparent";
11806
- }};
11807
12033
  `;
11808
- const DefaultTabBox = styledComponents.styled(Box)`
11809
- border-bottom: 1px solid ${({ theme, $selected }) => $selected ? theme.colors.neutral0 : theme.colors.neutral150};
12034
+ const [TabsProvider, useTabs] = createContext("Tabs");
12035
+ const Root = React__namespace.forwardRef(
12036
+ ({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
12037
+ return /* @__PURE__ */ jsxRuntime.jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsxRuntime.jsx(TabsRoot, { ref: forwardedRef, ...props }) });
12038
+ }
12039
+ );
12040
+ const TabsRoot = styledComponents.styled(Tabs__namespace.Root)`
12041
+ width: 100%;
12042
+ position: relative;
11810
12043
  `;
11811
- const DefaultTabButton = styledComponents.styled.button`
11812
- border: none;
11813
- background: transparent;
11814
- padding: 0;
11815
-
11816
- & + & > ${DefaultTabBox} {
11817
- border-left: 1px solid ${({ theme }) => theme.colors.neutral150};
12044
+ const List = React__namespace.forwardRef((props, forwardedRef) => {
12045
+ const { variant: variant2 } = useTabs("List");
12046
+ return /* @__PURE__ */ jsxRuntime.jsx(TabsList, { ref: forwardedRef, ...props, $variant: variant2 });
12047
+ });
12048
+ const TabsList = styledComponents.styled(Tabs__namespace.List)`
12049
+ display: flex;
12050
+ align-items: ${(props) => props.$variant === "regular" ? "flex-end" : "unset"};
12051
+ position: relative;
12052
+ z-index: 0;
12053
+ `;
12054
+ const Trigger = React__namespace.forwardRef(
12055
+ ({ children, disabled: disabledProp, ...props }, forwardedRef) => {
12056
+ const { disabled: disabledContext, variant: variant2, hasError } = useTabs("Trigger");
12057
+ const isDisabled = disabledContext === true || disabledContext === props.value || disabledProp;
12058
+ const isErrored = hasError === props.value;
12059
+ return /* @__PURE__ */ jsxRuntime.jsxs(TabsTrigger, { ref: forwardedRef, ...props, $hasError: isErrored, $variant: variant2, disabled: isDisabled, children: [
12060
+ /* @__PURE__ */ jsxRuntime.jsx(TriggerTypography, { fontWeight: "bold", variant: variant2 === "simple" ? "sigma" : void 0, children }),
12061
+ variant2 === "simple" ? /* @__PURE__ */ jsxRuntime.jsx(TabBar, {}) : null
12062
+ ] });
11818
12063
  }
12064
+ );
12065
+ const TabBar = styledComponents.styled.span`
12066
+ display: block;
12067
+ width: 100%;
12068
+ background-color: currentColor;
12069
+ position: absolute;
12070
+ bottom: 0;
12071
+ left: 0;
12072
+ opacity: 0;
12073
+ height: 0.2rem;
11819
12074
 
11820
- ${DefaultTabBox} {
11821
- border-right: ${({ theme, $showRightBorder }) => $showRightBorder ? `1px solid ${theme.colors.neutral150}` : "none"};
12075
+ @media (prefers-reduced-motion: no-preference) {
12076
+ transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
11822
12077
  }
12078
+ `;
12079
+ const TriggerTypography = styledComponents.styled(Typography)``;
12080
+ const TabsTrigger = styledComponents.styled(Tabs__namespace.Trigger)`
12081
+ position: relative;
12082
+ color: ${(props) => props.$hasError ? props.theme.colors.danger600 : props.theme.colors.neutral600};
12083
+ cursor: pointer;
12084
+ z-index: 0;
11823
12085
 
11824
- // Hack preventing the outline from being overflow by the following tab
11825
- outline-offset: -2px;
12086
+ ${(props) => {
12087
+ if (props.$variant === "simple") {
12088
+ return styledComponents.css`
12089
+ padding-block: ${(props2) => props2.theme.spaces[4]};
12090
+ padding-inline: ${(props2) => props2.theme.spaces[4]};
11826
12091
 
11827
- &[aria-disabled='true'] {
11828
- cursor: not-allowed;
11829
- }
11830
- `;
11831
- const DefaultTabsRow = styledComponents.styled(Flex)`
11832
- & > * {
11833
- flex: 1;
11834
- }
12092
+ & > ${TriggerTypography} {
12093
+ line-height: 1.2rem;
12094
+ }
12095
+
12096
+ &[data-state='active'] {
12097
+ color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
11835
12098
 
11836
- & ${DefaultTabButton}:first-of-type ${DefaultTabBox} {
11837
- border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 0`};
12099
+ & > ${TabBar} {
12100
+ opacity: 1;
12101
+ }
12102
+ }
12103
+ `;
12104
+ } else {
12105
+ return styledComponents.css`
12106
+ padding-block: ${(props2) => props2.theme.spaces[3]};
12107
+ padding-inline: ${(props2) => props2.theme.spaces[3]};
12108
+ flex: 1;
12109
+ background-color: ${(props2) => props2.theme.colors.neutral100};
12110
+ border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral150};
12111
+
12112
+ &:not([data-state='active']) + &:not([data-state='active']) {
12113
+ border-left: solid 1px ${(props2) => props2.theme.colors.neutral150};
12114
+ }
12115
+
12116
+ &[data-state='active'] {
12117
+ padding-block: ${(props2) => props2.theme.spaces[4]};
12118
+ padding-inline: ${(props2) => props2.theme.spaces[4]};
12119
+ color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
12120
+ border-top-right-radius: ${(props2) => props2.theme.borderRadius};
12121
+ border-top-left-radius: ${(props2) => props2.theme.borderRadius};
12122
+ background-color: ${(props2) => props2.theme.colors.neutral0};
12123
+ border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral0};
12124
+ box-shadow: ${props.theme.shadows.tableShadow};
12125
+ z-index: 1;
12126
+ }
12127
+ `;
11838
12128
  }
12129
+ }}
11839
12130
 
11840
- & ${DefaultTabButton}:last-of-type ${DefaultTabBox} {
11841
- border-radius: ${({ theme }) => `0 ${theme.borderRadius} 0 0`};
12131
+ @media (prefers-reduced-motion: no-preference) {
12132
+ transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
11842
12133
  }
11843
12134
 
11844
- & ${DefaultTabButton}[aria-selected="true"] ${DefaultTabBox} {
11845
- border-radius: ${({ theme }) => `${theme.borderRadius} ${theme.borderRadius} 0 0`};
11846
- border-left: none;
11847
- border-right: none;
12135
+ &[data-disabled] {
12136
+ cursor: not-allowed;
12137
+ color: ${(props) => props.theme.colors.neutral400};
11848
12138
  }
11849
12139
  `;
11850
- const TabsContext = React__namespace.createContext({
11851
- id: "",
11852
- label: "",
11853
- selectedTabIndex: 0,
11854
- selectTabIndex() {
11855
- throw new Error("TabsContext.selectTabIndex is not implemented.");
11856
- }
12140
+ const Content = React__namespace.forwardRef((props, forwardedRef) => {
12141
+ const { variant: variant2 } = useTabs("Content");
12142
+ return /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { $variant: variant2, ref: forwardedRef, ...props });
11857
12143
  });
11858
- const useTabs = () => React__namespace.useContext(TabsContext);
11859
- const useTabsFocus = (selectedTabIndex, onTabChange) => {
11860
- const tabsRef = React__namespace.useRef(null);
11861
- const mountedRef = React__namespace.useRef(false);
11862
- const handleTabChange = uiPrimitives.useCallbackRef(onTabChange);
11863
- React__namespace.useEffect(() => {
11864
- if (!tabsRef.current)
11865
- return;
11866
- if (mountedRef.current) {
11867
- const nextFocusEl = tabsRef.current.querySelector('[tabindex="0"]');
11868
- if (nextFocusEl) {
11869
- nextFocusEl.focus();
11870
- handleTabChange(selectedTabIndex);
11871
- }
11872
- }
11873
- if (!mountedRef.current) {
11874
- mountedRef.current = true;
11875
- }
11876
- }, [selectedTabIndex, handleTabChange]);
11877
- return tabsRef;
11878
- };
11879
- const TabButton = styledComponents.styled.button`
11880
- &[aria-disabled='true'] {
11881
- cursor: not-allowed;
12144
+ const TabsContent = styledComponents.styled(Tabs__namespace.Content)`
12145
+ ${(props) => {
12146
+ if (props.$variant === "simple") {
12147
+ return styledComponents.css``;
12148
+ } else {
12149
+ return styledComponents.css`
12150
+ position: relative;
12151
+ z-index: 1;
12152
+ background-color: ${(props2) => props2.theme.colors.neutral0};
12153
+ `;
11882
12154
  }
12155
+ }}
11883
12156
  `;
11884
- const Tabs = ({ children, ...props }) => {
11885
- const { id, selectedTabIndex, selectTabIndex, label, variant: variant2, onTabChange } = useTabs();
11886
- const tabsRef = useTabsFocus(selectedTabIndex, onTabChange);
11887
- const childrenArray = React__namespace.Children.toArray(children).map(
11888
- (node, index) => React__namespace.cloneElement(node, {
11889
- id: `${id}-${index}`,
11890
- index,
11891
- selectedTabIndex,
11892
- onTabClick: () => selectTabIndex(index),
11893
- variant: variant2
11894
- })
11895
- );
11896
- const handleKeyDown = (e) => {
11897
- const hasAllChildrenDisabled = childrenArray.every((node) => node.props.disabled);
11898
- if (hasAllChildrenDisabled) {
11899
- return;
11900
- }
11901
- switch (e.key) {
11902
- case KeyboardKeys.RIGHT: {
11903
- const nextWantedIndex = selectedTabIndex + 1;
11904
- const findNextIndex = (ref) => {
11905
- const isDisabled = childrenArray[ref].props.disabled;
11906
- if (!isDisabled) {
11907
- return ref;
11908
- }
11909
- if (ref === childrenArray.length - 1) {
11910
- return findNextIndex(0);
11911
- }
11912
- return findNextIndex(ref + 1);
11913
- };
11914
- const nextIndex = findNextIndex(nextWantedIndex >= childrenArray.length ? 0 : nextWantedIndex);
11915
- selectTabIndex(nextIndex);
11916
- break;
11917
- }
11918
- case KeyboardKeys.LEFT: {
11919
- const nextWantedIndex = selectedTabIndex - 1;
11920
- const findNextIndex = (ref) => {
11921
- const isDisabled = childrenArray[ref].props.disabled;
11922
- if (!isDisabled) {
11923
- return ref;
11924
- }
11925
- if (ref === 0) {
11926
- return findNextIndex(childrenArray.length - 1);
11927
- }
11928
- return findNextIndex(ref - 1);
11929
- };
11930
- const nextIndex = findNextIndex(nextWantedIndex < 0 ? childrenArray.length - 1 : nextWantedIndex);
11931
- selectTabIndex(nextIndex);
11932
- break;
11933
- }
11934
- case KeyboardKeys.HOME: {
11935
- const nextIndex = childrenArray.findIndex((node) => !node.props.disabled);
11936
- selectTabIndex(nextIndex);
11937
- break;
11938
- }
11939
- case KeyboardKeys.END: {
11940
- const arrayOfChildrenProps = childrenArray.map((node, index) => ({ isDisabled: node.props.disabled, index }));
11941
- const firstNonDisabledChildren = arrayOfChildrenProps.reverse().find(({ isDisabled }) => !isDisabled);
11942
- if (firstNonDisabledChildren) {
11943
- selectTabIndex(firstNonDisabledChildren.index);
11944
- }
11945
- break;
11946
- }
11947
- }
11948
- };
11949
- if (variant2 === "simple") {
11950
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: tabsRef, role: "tablist", "aria-label": label, onKeyDown: handleKeyDown, ...props, children: childrenArray });
11951
- }
11952
- return /* @__PURE__ */ jsxRuntime.jsx(
11953
- DefaultTabsRow,
11954
- {
11955
- ref: tabsRef,
11956
- role: "tablist",
11957
- alignItems: "flex-end",
11958
- "aria-label": label,
11959
- onKeyDown: handleKeyDown,
11960
- ...props,
11961
- children: childrenArray
11962
- }
11963
- );
11964
- };
11965
- const Tab = ({
11966
- disabled = false,
11967
- id,
11968
- children,
11969
- variant: variant2,
11970
- hasError = false,
11971
- index,
11972
- selectedTabIndex,
11973
- onTabClick,
11974
- ...props
11975
- }) => {
11976
- const tabId = `${id}-tab`;
11977
- const tabPanelId = `${id}-tabpanel`;
11978
- const selected = index === selectedTabIndex;
11979
- const handleClick = () => {
11980
- if (disabled) {
11981
- return;
11982
- }
11983
- if (onTabClick) {
11984
- onTabClick();
11985
- }
11986
- };
11987
- if (variant2 === "simple") {
11988
- let textColor;
11989
- if (hasError) {
11990
- textColor = "danger600";
11991
- } else if (selected) {
11992
- textColor = "primary600";
11993
- } else if (disabled) {
11994
- textColor = "neutral600";
11995
- } else {
11996
- textColor = "neutral600";
11997
- }
11998
- return /* @__PURE__ */ jsxRuntime.jsx(
11999
- TabButton,
12000
- {
12001
- id: tabId,
12002
- role: "tab",
12003
- "aria-controls": selected ? tabPanelId : void 0,
12004
- tabIndex: selected ? 0 : -1,
12005
- "aria-selected": selected,
12006
- type: "button",
12007
- onClick: handleClick,
12008
- "aria-disabled": disabled,
12009
- ...props,
12010
- children: /* @__PURE__ */ jsxRuntime.jsx(SimpleTabBox, { padding: 4, $selected: selected, $hasError: hasError, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "sigma", textColor, children }) })
12011
- }
12012
- );
12013
- }
12014
- if (hasError) {
12015
- console.warn('The "hasError" prop is only available for the "simple" variant.');
12016
- }
12017
- const showRightBorder = selectedTabIndex && selectedTabIndex - 1 === index;
12018
- return /* @__PURE__ */ jsxRuntime.jsx(
12019
- DefaultTabButton,
12020
- {
12021
- id: tabId,
12022
- role: "tab",
12023
- type: "button",
12024
- "aria-controls": selected ? tabPanelId : void 0,
12025
- tabIndex: selected ? 0 : -1,
12026
- "aria-selected": selected,
12027
- onClick: handleClick,
12028
- "aria-disabled": disabled,
12029
- $showRightBorder: Boolean(showRightBorder),
12030
- ...props,
12031
- children: /* @__PURE__ */ jsxRuntime.jsx(DefaultTabBox, { padding: selected ? 4 : 3, background: selected ? "neutral0" : "neutral100", $selected: selected, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { fontWeight: "bold", textColor: selected ? "primary700" : "neutral600", children }) })
12032
- }
12033
- );
12034
- };
12035
- const TabPanels = ({ children, ...props }) => {
12036
- const { id, selectedTabIndex } = useTabs();
12037
- const childrenArray = React__namespace.Children.toArray(children).map((node, index) => React__namespace.cloneElement(node, { id: `${id}-${index}` })).filter((_, index) => index === selectedTabIndex);
12038
- return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, children: childrenArray });
12039
- };
12040
- const TabPanel = ({ id, ...props }) => {
12041
- const tabId = `${id}-tab`;
12042
- const tabPanelId = `${id}-tabpanel`;
12043
- return /* @__PURE__ */ jsxRuntime.jsx("div", { id: tabPanelId, role: "tabpanel", tabIndex: 0, "aria-labelledby": tabId, ...props });
12044
- };
12045
- const TabGroup = React__namespace.forwardRef(
12046
- ({ id, initialSelectedTabIndex, label, onTabChange, selectedTabIndex: selectedTabIndexProp, variant: variant2, ...props }, ref) => {
12047
- const tabsId = useId(id);
12048
- const [selectedTabIndex = 0, setSelectedTabIndex] = useControllableState({
12049
- prop: selectedTabIndexProp,
12050
- defaultProp: initialSelectedTabIndex,
12051
- // @ts-expect-error - TODO: fix this.
12052
- onChange: onTabChange
12053
- });
12054
- React__namespace.useImperativeHandle(ref, () => ({
12055
- _handlers: { setSelectedTabIndex }
12056
- }));
12057
- const context = React__namespace.useMemo(
12058
- () => ({ id: tabsId, selectedTabIndex, selectTabIndex: setSelectedTabIndex, label, variant: variant2, onTabChange }),
12059
- [label, onTabChange, selectedTabIndex, tabsId, variant2, setSelectedTabIndex]
12060
- );
12061
- return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props }) });
12062
- }
12063
- );
12064
- TabGroup.displayName = "TabGroup";
12157
+ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12158
+ __proto__: null,
12159
+ Content,
12160
+ List,
12161
+ Root,
12162
+ Trigger
12163
+ }, Symbol.toStringTag, { value: "Module" }));
12065
12164
  const TableContainer = styledComponents.styled(Box)`
12066
12165
  overflow: hidden;
12067
12166
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
@@ -12342,7 +12441,7 @@ const Toggle = React__namespace.forwardRef(
12342
12441
  onChange,
12343
12442
  ...props
12344
12443
  }, forwardedRef) => {
12345
- const [checked = false, setChecked] = useControllableState({
12444
+ const [checked = false, setChecked] = useControllableState$1({
12346
12445
  prop: checkedProp
12347
12446
  });
12348
12447
  const isFalseyChecked = checked !== null && !checked;
@@ -12456,6 +12555,103 @@ const Input = styledComponents.styled.input`
12456
12555
  z-index: 0;
12457
12556
  width: 100%;
12458
12557
  `;
12558
+ const defaultState = {
12559
+ x: 0,
12560
+ y: 0,
12561
+ width: 0,
12562
+ height: 0,
12563
+ top: 0,
12564
+ left: 0,
12565
+ bottom: 0,
12566
+ right: 0
12567
+ };
12568
+ function useMeasure() {
12569
+ const [element, ref] = React.useState(null);
12570
+ const [rect, setRect] = React.useState(defaultState);
12571
+ const observer = React.useMemo(
12572
+ () => new ResizeObserver((entries) => {
12573
+ if (entries[0]) {
12574
+ const { x, y, width, height, top, left, bottom, right } = entries[0].contentRect;
12575
+ setRect({ x, y, width, height, top, left, bottom, right });
12576
+ }
12577
+ }),
12578
+ []
12579
+ );
12580
+ useIsomorphicLayoutEffect(() => {
12581
+ if (!element)
12582
+ return;
12583
+ observer.observe(element);
12584
+ return () => {
12585
+ observer.disconnect();
12586
+ };
12587
+ }, [element, observer]);
12588
+ return [ref, rect];
12589
+ }
12590
+ const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
12591
+ const isValidFocusedElement = () => {
12592
+ const focused = document.activeElement;
12593
+ if (!focused) {
12594
+ return false;
12595
+ }
12596
+ if (tagName) {
12597
+ return focused.tagName.toLowerCase() === tagName;
12598
+ }
12599
+ return focused.hasAttribute(attributeName);
12600
+ };
12601
+ const queryElement = (parentEl) => {
12602
+ if (tagName) {
12603
+ return parentEl.querySelectorAll(tagName);
12604
+ }
12605
+ return parentEl.querySelectorAll(`[${attributeName}]`);
12606
+ };
12607
+ const handleKeyDown = (e) => {
12608
+ switch (e.key) {
12609
+ case KeyboardKeys.RIGHT:
12610
+ case KeyboardKeys.DOWN: {
12611
+ if (isValidFocusedElement()) {
12612
+ e.preventDefault();
12613
+ const focused = document.activeElement;
12614
+ const allElements = [...queryElement(e.currentTarget)];
12615
+ const focusedIndex = allElements.findIndex((node) => node === focused);
12616
+ const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
12617
+ allElements[nextIndex].focus();
12618
+ }
12619
+ break;
12620
+ }
12621
+ case KeyboardKeys.LEFT:
12622
+ case KeyboardKeys.UP: {
12623
+ if (isValidFocusedElement()) {
12624
+ e.preventDefault();
12625
+ const focused = document.activeElement;
12626
+ const allElements = [...queryElement(e.currentTarget)];
12627
+ const focusedIndex = allElements.findIndex((node) => node === focused);
12628
+ const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
12629
+ allElements[nextIndex].focus();
12630
+ }
12631
+ break;
12632
+ }
12633
+ case KeyboardKeys.HOME: {
12634
+ if (isValidFocusedElement()) {
12635
+ e.preventDefault();
12636
+ const allElements = queryElement(e.currentTarget);
12637
+ const focusElement = allElements.item(0);
12638
+ focusElement.focus();
12639
+ }
12640
+ break;
12641
+ }
12642
+ case KeyboardKeys.END: {
12643
+ if (isValidFocusedElement()) {
12644
+ e.preventDefault();
12645
+ const allElements = queryElement(e.currentTarget);
12646
+ const focusElement = allElements.item(allElements.length - 1);
12647
+ focusElement.focus();
12648
+ }
12649
+ break;
12650
+ }
12651
+ }
12652
+ };
12653
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { onKeyDown: handleKeyDown, ...props });
12654
+ };
12459
12655
  Object.defineProperty(exports, "composeEventHandlers", {
12460
12656
  enumerable: true,
12461
12657
  get: () => uiPrimitives.composeEventHandlers
@@ -12476,12 +12672,9 @@ exports.AccessibleIcon = AccessibleIcon;
12476
12672
  exports.Accordion = Accordion;
12477
12673
  exports.Alert = Alert;
12478
12674
  exports.Avatar = Avatar;
12479
- exports.AvatarGroup = AvatarGroup;
12480
12675
  exports.Badge = Badge;
12481
12676
  exports.BaseButton = BaseButton;
12482
- exports.BaseCheckbox = BaseCheckbox;
12483
12677
  exports.BaseLink = BaseLink;
12484
- exports.BaseRadio = BaseRadio;
12485
12678
  exports.Box = Box;
12486
12679
  exports.Breadcrumbs = Breadcrumbs;
12487
12680
  exports.Button = Button;
@@ -12501,7 +12694,7 @@ exports.CarouselActions = CarouselActions;
12501
12694
  exports.CarouselImage = CarouselImage;
12502
12695
  exports.CarouselInput = CarouselInput;
12503
12696
  exports.CarouselSlide = CarouselSlide;
12504
- exports.Checkbox = Checkbox;
12697
+ exports.Checkbox = CheckboxImpl;
12505
12698
  exports.Combobox = Combobox;
12506
12699
  exports.ComboboxOption = Option;
12507
12700
  exports.Crumb = Crumb;
@@ -12511,8 +12704,6 @@ exports.DatePicker = DatePicker$1;
12511
12704
  exports.DateTimePicker = DateTimePicker;
12512
12705
  exports.DesignSystemProvider = DesignSystemProvider;
12513
12706
  exports.Dialog = Dialog;
12514
- exports.DialogBody = DialogBody;
12515
- exports.DialogFooter = DialogFooter;
12516
12707
  exports.DismissibleLayer = DismissibleLayer;
12517
12708
  exports.Divider = Divider;
12518
12709
  exports.Dots = Dots;
@@ -12521,10 +12712,8 @@ exports.Field = Field;
12521
12712
  exports.Flex = Flex;
12522
12713
  exports.FocusTrap = FocusTrap;
12523
12714
  exports.Grid = Grid;
12524
- exports.GridItem = GridItemImpl;
12525
12715
  exports.IconButton = IconButton;
12526
12716
  exports.IconButtonGroup = IconButtonGroup;
12527
- exports.Initials = Initials;
12528
12717
  exports.JSONInput = JSONInput;
12529
12718
  exports.KeyboardNavigable = KeyboardNavigable;
12530
12719
  exports.Link = Link;
@@ -12534,32 +12723,27 @@ exports.Loader = Loader;
12534
12723
  exports.Main = Main;
12535
12724
  exports.Menu = Menu;
12536
12725
  exports.MenuItem = MenuItem;
12537
- exports.ModalBody = ModalBody;
12538
- exports.ModalFooter = ModalFooter;
12539
- exports.ModalHeader = ModalHeader;
12540
- exports.ModalLayout = ModalLayout;
12726
+ exports.Modal = Modal;
12541
12727
  exports.MultiSelect = MultiSelect;
12542
12728
  exports.MultiSelectGroup = MultiSelectGroup;
12543
12729
  exports.MultiSelectNested = MultiSelectNested;
12544
12730
  exports.MultiSelectOption = MultiSelectOption;
12545
12731
  exports.NextLink = NextLink;
12546
12732
  exports.NumberInput = NumberInput;
12547
- exports.POPOVER_PLACEMENTS = POPOVER_PLACEMENTS;
12548
12733
  exports.PageLink = PageLink;
12549
12734
  exports.Pagination = Pagination;
12550
12735
  exports.Popover = Popover;
12551
- exports.PopoverPrimitives = primitives;
12552
12736
  exports.Portal = Portal$1;
12553
12737
  exports.PreviousLink = PreviousLink;
12554
12738
  exports.ProgressBar = ProgressBar;
12555
12739
  exports.Radio = Radio;
12556
- exports.RadioGroup = RadioGroup;
12557
12740
  exports.RawTable = RawTable;
12558
12741
  exports.RawTbody = RawTbody;
12559
12742
  exports.RawTd = RawTd;
12560
12743
  exports.RawTh = RawTh;
12561
12744
  exports.RawThead = RawThead;
12562
12745
  exports.RawTr = RawTr;
12746
+ exports.ScrollArea = ScrollAreaImpl$1;
12563
12747
  exports.SearchForm = SearchForm;
12564
12748
  exports.Searchbar = Searchbar;
12565
12749
  exports.SimpleMenu = SimpleMenu;
@@ -12573,12 +12757,8 @@ exports.SubNavLink = SubNavLink;
12573
12757
  exports.SubNavLinkSection = SubNavLinkSection;
12574
12758
  exports.SubNavSection = SubNavSection;
12575
12759
  exports.SubNavSections = SubNavSections;
12576
- exports.Switch = Switch;
12760
+ exports.Switch = SwitchImpl;
12577
12761
  exports.TFooter = TFooter;
12578
- exports.Tab = Tab;
12579
- exports.TabGroup = TabGroup;
12580
- exports.TabPanel = TabPanel;
12581
- exports.TabPanels = TabPanels;
12582
12762
  exports.Table = Table;
12583
12763
  exports.Tabs = Tabs;
12584
12764
  exports.Tag = Tag;
@@ -12595,16 +12775,22 @@ exports.Tooltip = TooltipImpl;
12595
12775
  exports.Tr = Tr;
12596
12776
  exports.Typography = Typography;
12597
12777
  exports.VisuallyHidden = VisuallyHidden;
12778
+ exports._internaluseUncontrolledState = useUncontrolledState;
12598
12779
  exports.composeRefs = composeRefs;
12599
12780
  exports.convertUTCDateToCalendarDateTime = convertUTCDateToCalendarDateTime;
12600
12781
  exports.darkTheme = darkTheme;
12601
12782
  exports.extendTheme = extendTheme;
12602
12783
  exports.getThemeSize = getThemeSize;
12603
12784
  exports.inputFocusStyle = inputFocusStyle;
12785
+ exports.isSSR = isSSR;
12604
12786
  exports.lightTheme = lightTheme;
12605
12787
  exports.useComposedRefs = useComposedRefs;
12788
+ exports.useControllableState = useControllableState$1;
12606
12789
  exports.useDateFormatter = useDateFormatter;
12607
12790
  exports.useDesignSystem = useDesignSystem;
12608
12791
  exports.useField = useField;
12792
+ exports.useId = useId;
12793
+ exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
12794
+ exports.useMeasure = useMeasure;
12609
12795
  exports.useNotifyAT = useNotifyAT;
12610
12796
  //# sourceMappingURL=index.js.map