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

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 (156) 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.map +1 -1
  16. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  17. package/dist/components/Dialog/Dialog.d.ts +45 -7
  18. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  19. package/dist/components/Dialog/index.d.ts +1 -3
  20. package/dist/components/Dialog/index.d.ts.map +1 -1
  21. package/dist/components/Divider/Divider.d.ts +6 -2
  22. package/dist/components/Divider/Divider.d.ts.map +1 -1
  23. package/dist/components/Field/Field.d.ts +1 -1
  24. package/dist/components/Field/Field.d.ts.map +1 -1
  25. package/dist/components/Grid/Grid.d.ts +14 -5
  26. package/dist/components/Grid/Grid.d.ts.map +1 -1
  27. package/dist/components/Grid/index.d.ts +1 -2
  28. package/dist/components/Grid/index.d.ts.map +1 -1
  29. package/dist/components/IconButton/IconButton.d.ts +2 -2
  30. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  31. package/dist/components/Modal/Modal.d.ts +46 -0
  32. package/dist/components/Modal/Modal.d.ts.map +1 -0
  33. package/dist/components/Modal/index.d.ts +2 -0
  34. package/dist/components/Modal/index.d.ts.map +1 -0
  35. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  36. package/dist/components/Popover/Popover.d.ts +16 -16
  37. package/dist/components/Popover/Popover.d.ts.map +1 -1
  38. package/dist/components/Popover/index.d.ts +1 -3
  39. package/dist/components/Popover/index.d.ts.map +1 -1
  40. package/dist/components/Radio/Radio.d.ts +11 -5
  41. package/dist/components/Radio/Radio.d.ts.map +1 -1
  42. package/dist/components/Radio/index.d.ts +1 -2
  43. package/dist/components/Radio/index.d.ts.map +1 -1
  44. package/dist/components/RawTable/RawCell.d.ts.map +1 -1
  45. package/dist/components/Select/MultiSelect.d.ts.map +1 -1
  46. package/dist/components/Select/SelectParts.d.ts +5 -5
  47. package/dist/components/Select/SelectParts.d.ts.map +1 -1
  48. package/dist/components/SimpleMenu/Menu.d.ts +2 -3
  49. package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
  50. package/dist/components/Tabs/Tabs.d.ts +36 -14
  51. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  52. package/dist/components/Tabs/index.d.ts +1 -3
  53. package/dist/components/Tabs/index.d.ts.map +1 -1
  54. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  55. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  56. package/dist/components/Typography/Typography.d.ts +4 -4
  57. package/dist/components/Typography/Typography.d.ts.map +1 -1
  58. package/dist/components/index.d.ts +2 -7
  59. package/dist/components/index.d.ts.map +1 -1
  60. package/dist/hooks/useControllableState.d.ts +9 -16
  61. package/dist/hooks/useControllableState.d.ts.map +1 -1
  62. package/dist/hooks/useId.d.ts.map +1 -1
  63. package/dist/hooks/useIntersection.d.ts +3 -0
  64. package/dist/hooks/useIntersection.d.ts.map +1 -1
  65. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +12 -0
  66. package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  67. package/dist/hooks/useMeasure.d.ts +7 -0
  68. package/dist/hooks/useMeasure.d.ts.map +1 -0
  69. package/dist/index.d.ts +9 -0
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +1349 -1247
  72. package/dist/index.js.map +1 -1
  73. package/dist/index.mjs +1338 -1244
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/styles/motion.d.ts +55 -0
  76. package/dist/styles/motion.d.ts.map +1 -0
  77. package/dist/themes/common-theme.d.ts +6 -2
  78. package/dist/themes/common-theme.d.ts.map +1 -1
  79. package/dist/utilities/DesignSystemProvider.d.ts.map +1 -1
  80. package/dist/utilities/DismissibleLayer/index.d.ts.map +1 -0
  81. package/dist/utilities/FocusTrap/FocusTrap.d.ts.map +1 -0
  82. package/dist/utilities/FocusTrap/index.d.ts.map +1 -0
  83. package/dist/{components → utilities}/KeyboardNavigable/KeyboardNavigable.d.ts +1 -1
  84. package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts.map +1 -0
  85. package/dist/utilities/KeyboardNavigable/index.d.ts.map +1 -0
  86. package/dist/utilities/Portal/Portal.d.ts +13 -0
  87. package/dist/utilities/Portal/Portal.d.ts.map +1 -0
  88. package/dist/utilities/Portal/index.d.ts.map +1 -0
  89. package/dist/utilities/ScrollArea/ScrollArea.d.ts +15 -0
  90. package/dist/utilities/ScrollArea/ScrollArea.d.ts.map +1 -0
  91. package/dist/utilities/ScrollArea/index.d.ts +2 -0
  92. package/dist/utilities/ScrollArea/index.d.ts.map +1 -0
  93. package/package.json +25 -18
  94. package/dist/components/Avatar/AvatarGroup.d.ts +0 -6
  95. package/dist/components/Avatar/AvatarGroup.d.ts.map +0 -1
  96. package/dist/components/Avatar/constants.d.ts +0 -3
  97. package/dist/components/Avatar/constants.d.ts.map +0 -1
  98. package/dist/components/BaseCheckbox/BaseCheckbox.d.ts +0 -22
  99. package/dist/components/BaseCheckbox/BaseCheckbox.d.ts.map +0 -1
  100. package/dist/components/BaseCheckbox/index.d.ts +0 -2
  101. package/dist/components/BaseCheckbox/index.d.ts.map +0 -1
  102. package/dist/components/BaseRadio/BaseRadio.d.ts +0 -9
  103. package/dist/components/BaseRadio/BaseRadio.d.ts.map +0 -1
  104. package/dist/components/BaseRadio/RadioGroup.d.ts +0 -18
  105. package/dist/components/BaseRadio/RadioGroup.d.ts.map +0 -1
  106. package/dist/components/BaseRadio/index.d.ts +0 -3
  107. package/dist/components/BaseRadio/index.d.ts.map +0 -1
  108. package/dist/components/Dialog/DialogBody.d.ts +0 -7
  109. package/dist/components/Dialog/DialogBody.d.ts.map +0 -1
  110. package/dist/components/Dialog/DialogFooter.d.ts +0 -7
  111. package/dist/components/Dialog/DialogFooter.d.ts.map +0 -1
  112. package/dist/components/DismissibleLayer/index.d.ts.map +0 -1
  113. package/dist/components/EmptyStateLayout/story-assets/Illo.d.ts +0 -2
  114. package/dist/components/EmptyStateLayout/story-assets/Illo.d.ts.map +0 -1
  115. package/dist/components/FocusTrap/FocusTrap.d.ts.map +0 -1
  116. package/dist/components/FocusTrap/index.d.ts.map +0 -1
  117. package/dist/components/Grid/GridItem.d.ts +0 -9
  118. package/dist/components/Grid/GridItem.d.ts.map +0 -1
  119. package/dist/components/KeyboardNavigable/KeyboardNavigable.d.ts.map +0 -1
  120. package/dist/components/KeyboardNavigable/index.d.ts.map +0 -1
  121. package/dist/components/ModalLayout/ModalBody.d.ts +0 -3
  122. package/dist/components/ModalLayout/ModalBody.d.ts.map +0 -1
  123. package/dist/components/ModalLayout/ModalContext.d.ts +0 -4
  124. package/dist/components/ModalLayout/ModalContext.d.ts.map +0 -1
  125. package/dist/components/ModalLayout/ModalFooter.d.ts +0 -7
  126. package/dist/components/ModalLayout/ModalFooter.d.ts.map +0 -1
  127. package/dist/components/ModalLayout/ModalHeader.d.ts +0 -8
  128. package/dist/components/ModalLayout/ModalHeader.d.ts.map +0 -1
  129. package/dist/components/ModalLayout/ModalLayout.d.ts +0 -7
  130. package/dist/components/ModalLayout/ModalLayout.d.ts.map +0 -1
  131. package/dist/components/ModalLayout/index.d.ts +0 -5
  132. package/dist/components/ModalLayout/index.d.ts.map +0 -1
  133. package/dist/components/Popover/primitives.d.ts +0 -4
  134. package/dist/components/Popover/primitives.d.ts.map +0 -1
  135. package/dist/components/Portal/Portal.d.ts +0 -7
  136. package/dist/components/Portal/Portal.d.ts.map +0 -1
  137. package/dist/components/Portal/index.d.ts.map +0 -1
  138. package/dist/components/Tabs/TabGroup.d.ts +0 -15
  139. package/dist/components/Tabs/TabGroup.d.ts.map +0 -1
  140. package/dist/components/Tabs/TabPanels.d.ts +0 -10
  141. package/dist/components/Tabs/TabPanels.d.ts.map +0 -1
  142. package/dist/components/Tabs/TabsContext.d.ts +0 -12
  143. package/dist/components/Tabs/TabsContext.d.ts.map +0 -1
  144. package/dist/components/Tabs/components.d.ts +0 -23
  145. package/dist/components/Tabs/components.d.ts.map +0 -1
  146. package/dist/hooks/useLockScroll.d.ts +0 -3
  147. package/dist/hooks/useLockScroll.d.ts.map +0 -1
  148. package/dist/hooks/usePrevious.d.ts +0 -2
  149. package/dist/hooks/usePrevious.d.ts.map +0 -1
  150. package/dist/styles/easings.d.ts +0 -29
  151. package/dist/styles/easings.d.ts.map +0 -1
  152. /package/dist/{components → utilities}/DismissibleLayer/index.d.ts +0 -0
  153. /package/dist/{components → utilities}/FocusTrap/FocusTrap.d.ts +0 -0
  154. /package/dist/{components → utilities}/FocusTrap/index.d.ts +0 -0
  155. /package/dist/{components → utilities}/KeyboardNavigable/index.d.ts +0 -0
  156. /package/dist/{components → utilities}/Portal/index.d.ts +0 -0
package/dist/index.mjs CHANGED
@@ -1,27 +1,33 @@
1
1
  import * as React from "react";
2
- import { useEffect } from "react";
2
+ import { useRef, useEffect, useMemo, useLayoutEffect, useState } from "react";
3
3
  import { DateFormatter, getLocalTimeZone, today, minDate, maxDate, startOfMonth, startOfWeek, getDayOfWeek, isSameDay, endOfMonth, parseAbsolute, toCalendarDate, parseAbsoluteToLocal, toCalendarDateTime } from "@internationalized/date";
4
4
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
5
5
  import * as Tooltip from "@radix-ui/react-tooltip";
6
6
  import { Provider as Provider$1 } from "@radix-ui/react-tooltip";
7
- import { styled, css, keyframes, createGlobalStyle, ThemeProvider } from "styled-components";
8
- import { useCallbackRef, Combobox as Combobox$1, Select, composeEventHandlers } from "@strapi/ui-primitives";
7
+ import { styled, css, keyframes, useTheme, createGlobalStyle, ThemeProvider } from "styled-components";
8
+ import * as DismissibleLayerPrimitive from "@radix-ui/react-dismissable-layer";
9
+ import { useCallbackRef, Combobox as Combobox$1, Select, composeEventHandlers, usePrev } from "@strapi/ui-primitives";
9
10
  import { composeEventHandlers as composeEventHandlers2, useCallbackRef as useCallbackRef2, useCollator, useFilter } from "@strapi/ui-primitives";
10
11
  import * as RadixAccordion from "@radix-ui/react-accordion";
11
12
  import { CaretDown, Cross, CheckCircle, WarningCircle, Information, Loader as Loader$1, ExternalLink, ChevronRight, ChevronLeft, Calendar, Clock, Search } from "@strapi/icons";
13
+ import * as Avatar$1 from "@radix-ui/react-avatar";
12
14
  import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
13
- import { useControllableState as useControllableState$1 } from "@radix-ui/react-use-controllable-state";
14
- import * as DismissibleLayerPrimitive from "@radix-ui/react-dismissable-layer";
15
- import { createPortal } from "react-dom";
15
+ import * as Checkbox from "@radix-ui/react-checkbox";
16
+ import * as AlertDialog from "@radix-ui/react-alert-dialog";
16
17
  import { useFloating, offset, shift, flip, autoUpdate } from "@floating-ui/react-dom";
17
18
  import { FocusScope } from "@radix-ui/react-focus-scope";
19
+ import { createPortal } from "react-dom";
18
20
  import { RemoveScroll } from "react-remove-scroll";
19
21
  import { json, jsonParseLinter } from "@codemirror/lang-json";
20
22
  import { useCodeMirror } from "@uiw/react-codemirror";
21
23
  import { StateEffect, StateField } from "@codemirror/state";
22
24
  import { Decoration, EditorView } from "@codemirror/view";
25
+ import * as Dialog$1 from "@radix-ui/react-dialog";
26
+ import * as ScrollArea from "@radix-ui/react-scroll-area";
23
27
  import { NumberParser, NumberFormatter } from "@internationalized/number";
24
- import { hideOthers } from "aria-hidden";
28
+ import * as Popover$1 from "@radix-ui/react-popover";
29
+ import * as RadioGroup from "@radix-ui/react-radio-group";
30
+ import * as Tabs$1 from "@radix-ui/react-tabs";
25
31
  const createContext = (rootComponentName, defaultContext) => {
26
32
  const Context = React.createContext(defaultContext);
27
33
  const Provider2 = (props) => {
@@ -404,7 +410,7 @@ const StyledTypography = styled(Box)`
404
410
  text-transform: ${({ $textTransform }) => $textTransform};
405
411
  `;
406
412
  const [AccordionProvider, useAccordion] = createContext("Accordion");
407
- const Root$3 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
413
+ const Root$8 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
408
414
  return /* @__PURE__ */ jsx(AccordionRoot, { ref: forwardedRef, $size: size, collapsible: true, ...props, type: "single", children: /* @__PURE__ */ jsx(AccordionProvider, { size, children }) });
409
415
  });
410
416
  const AccordionRoot = styled(RadixAccordion.Root)`
@@ -421,7 +427,7 @@ const AccordionRoot = styled(RadixAccordion.Root)`
421
427
  }
422
428
  }}
423
429
  `;
424
- const Item$2 = React.forwardRef((props, forwardedRef) => {
430
+ const Item$5 = React.forwardRef((props, forwardedRef) => {
425
431
  const { size } = useAccordion("Item");
426
432
  return /* @__PURE__ */ jsx(AccordionItem, { $size: size, ref: forwardedRef, ...props });
427
433
  });
@@ -449,7 +455,7 @@ const AccordionItem = styled(RadixAccordion.Item)`
449
455
  box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
450
456
  }
451
457
  `;
452
- const Trigger$3 = React.forwardRef(
458
+ const Trigger$7 = React.forwardRef(
453
459
  ({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
454
460
  const { size } = useAccordion("Trigger");
455
461
  return /* @__PURE__ */ jsxs(AccordionTrigger, { $caretPosition: caretPosition, $size: size, ref: forwardedRef, ...restProps, children: [
@@ -477,7 +483,7 @@ const IconBox$4 = styled(Box)`
477
483
  color: ${(props) => props.theme.colors.neutral500};
478
484
 
479
485
  @media (prefers-reduced-motion: no-preference) {
480
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
486
+ transition: ${(props) => props.theme.transitions.color};
481
487
  }
482
488
  `;
483
489
  const TriggerIcon = styled(Flex).attrs((props) => ({
@@ -493,8 +499,8 @@ const TriggerIcon = styled(Flex).attrs((props) => ({
493
499
 
494
500
  @media (prefers-reduced-motion: no-preference) {
495
501
  transition:
496
- transform 300ms ${(props) => props.theme.easings.authenticMotion},
497
- background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
502
+ transform ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.authenticMotion},
503
+ ${(props) => props.theme.transitions.backgroundColor};
498
504
  }
499
505
  `;
500
506
  const AccordionTrigger = styled(RadixAccordion.Trigger)`
@@ -523,7 +529,7 @@ const AccordionTrigger = styled(RadixAccordion.Trigger)`
523
529
  }
524
530
 
525
531
  @media (prefers-reduced-motion: no-preference) {
526
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
532
+ transition: ${(props) => props.theme.transitions.color};
527
533
  }
528
534
  `;
529
535
  const Actions = React.forwardRef((props, forwardedRef) => {
@@ -544,11 +550,11 @@ const ActionWrapper = styled(Flex).attrs((props) => ({
544
550
  color: ${(props) => props.theme.colors.neutral600};
545
551
 
546
552
  @media (prefers-reduced-motion: no-preference) {
547
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
553
+ transition: ${(props) => props.theme.transitions.color};
548
554
  }
549
555
  }
550
556
  `;
551
- const Header = React.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
557
+ const Header$2 = React.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
552
558
  return /* @__PURE__ */ jsx(AccordionHeader, { $variant: variant2, ref: forwardedRef, ...props });
553
559
  });
554
560
  const AccordionHeader = styled(RadixAccordion.Header)`
@@ -584,10 +590,10 @@ const AccordionHeader = styled(RadixAccordion.Header)`
584
590
  }
585
591
 
586
592
  @media (prefers-reduced-motion: no-preference) {
587
- transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
593
+ transition: ${(props) => props.theme.transitions.backgroundColor};
588
594
  }
589
595
  `;
590
- const Content$4 = React.forwardRef((props, forwardedRef) => {
596
+ const Content$7 = React.forwardRef((props, forwardedRef) => {
591
597
  return /* @__PURE__ */ jsx(AccordionContent, { ref: forwardedRef, ...props });
592
598
  });
593
599
  const slideDown = keyframes`
@@ -611,22 +617,24 @@ const AccordionContent = styled(RadixAccordion.Content)`
611
617
 
612
618
  @media (prefers-reduced-motion: no-preference) {
613
619
  &[data-state='open'] {
614
- animation: ${slideDown} 0.3s ${(props) => props.theme.easings.authenticMotion};
620
+ animation: ${slideDown} ${(props) => props.theme.motion.timings["320"]}
621
+ ${(props) => props.theme.motion.easings.authenticMotion};
615
622
  }
616
623
 
617
624
  &[data-state='closed'] {
618
- animation: ${slideUp} 0.3s ${(props) => props.theme.easings.authenticMotion};
625
+ animation: ${slideUp} ${(props) => props.theme.motion.timings["320"]}
626
+ ${(props) => props.theme.motion.easings.authenticMotion};
619
627
  }
620
628
  }
621
629
  `;
622
630
  const Accordion = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
623
631
  __proto__: null,
624
632
  Actions,
625
- Content: Content$4,
626
- Header,
627
- Item: Item$2,
628
- Root: Root$3,
629
- Trigger: Trigger$3
633
+ Content: Content$7,
634
+ Header: Header$2,
635
+ Item: Item$5,
636
+ Root: Root$8,
637
+ Trigger: Trigger$7
630
638
  }, Symbol.toStringTag, { value: "Module" }));
631
639
  const focus = css`
632
640
  position: relative;
@@ -802,88 +810,291 @@ const Alert = ({
802
810
  }
803
811
  );
804
812
  };
805
- const avatarSize = 32;
806
- const previewSize = 64;
807
- const AvatarImg = styled.img`
813
+ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
814
+ const callbackRef = useRef(callback);
815
+ useEffect(() => {
816
+ callbackRef.current = callback;
817
+ });
818
+ return useMemo(
819
+ () => (...args) => {
820
+ var _callbackRef$current;
821
+ return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
822
+ },
823
+ []
824
+ );
825
+ }
826
+ function useControllableState$1({ prop, defaultProp, onChange = () => {
827
+ } }) {
828
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
829
+ const isControlled = prop !== void 0;
830
+ const value = isControlled ? prop : uncontrolledProp;
831
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
832
+ const setValue = React.useCallback(
833
+ (nextValue) => {
834
+ if (isControlled) {
835
+ const setter = nextValue;
836
+ const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
837
+ if (value2 !== prop)
838
+ handleChange(value2);
839
+ } else {
840
+ setUncontrolledProp(nextValue);
841
+ }
842
+ },
843
+ [isControlled, prop, setUncontrolledProp, handleChange]
844
+ );
845
+ return [value, setValue];
846
+ }
847
+ function useUncontrolledState({ defaultProp, onChange }) {
848
+ const uncontrolledState = React.useState(defaultProp);
849
+ const [value] = uncontrolledState;
850
+ const prevValueRef = React.useRef(value);
851
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
852
+ React.useEffect(() => {
853
+ if (prevValueRef.current !== value) {
854
+ handleChange(value);
855
+ prevValueRef.current = value;
856
+ }
857
+ }, [value, prevValueRef, handleChange]);
858
+ return uncontrolledState;
859
+ }
860
+ const EASINGS = {
861
+ easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
862
+ easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
863
+ easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
864
+ easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
865
+ easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
866
+ easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
867
+ easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
868
+ easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
869
+ easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
870
+ easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
871
+ easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
872
+ easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
873
+ easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
874
+ easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
875
+ easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
876
+ easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
877
+ easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
878
+ easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
879
+ easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
880
+ easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
881
+ easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
882
+ easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
883
+ easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
884
+ easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
885
+ easeInOutFast: "cubic-bezier(1,0,0,1)",
886
+ authenticMotion: "cubic-bezier(.4,0,.2,1)"
887
+ };
888
+ const TIMINGS = {
889
+ "320": "320ms",
890
+ "200": "200ms",
891
+ "120": "120ms"
892
+ };
893
+ const TRANSITIONS = {
894
+ color: `color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`,
895
+ backgroundColor: `background-color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`
896
+ };
897
+ const ANIMATIONS = {
898
+ overlayFadeIn: keyframes`
899
+ from {
900
+ opacity: 0;
901
+ }
902
+ to {
903
+ opacity: 0.2;
904
+ }
905
+ `,
906
+ modalPopIn: keyframes`
907
+ from {
908
+ transform:translate(-50%, -50%) scale(0.8);
909
+ opacity: 0;
910
+ }
911
+ to {
912
+ transform: translate(-50%, -50%) scale(1);
913
+ opacity: 1;
914
+ }
915
+ `,
916
+ modalPopOut: keyframes`
917
+ from {
918
+ transform: translate(-50%, -50%) scale(1);
919
+ opacity: 1;
920
+ }
921
+ to {
922
+ transform:translate(-50%, -50%) scale(0.8);
923
+ opacity: 0;
924
+ }
925
+ `,
926
+ popIn: keyframes`
927
+ from {
928
+ transform: scale(0.8);
929
+ opacity: 0;
930
+ }
931
+ to {
932
+ transform: scale(1);
933
+ opacity: 1;
934
+ }
935
+ `,
936
+ popOut: keyframes`
937
+ from {
938
+ transform: scale(1);
939
+ opacity: 1;
940
+ }
941
+ to {
942
+ transform: scale(0.8);
943
+ opacity: 0;
944
+ }
945
+ `,
946
+ slideDownIn: keyframes`
947
+ from {
948
+ opacity: 0;
949
+ transform: translateY(-10px);
950
+ }
951
+ to {
952
+ opacity: 1;
953
+ transform: translateY(0);
954
+ }
955
+ `,
956
+ slideDownOut: keyframes`
957
+ from {
958
+ opacity: 1;
959
+ transform: translateY(0);
960
+ }
961
+ to {
962
+ opacity: 0;
963
+ transform: translateY(-10px);
964
+ }
965
+ `,
966
+ slideUpIn: keyframes`
967
+ from {
968
+ opacity: 0;
969
+ transform: translateY(10px);
970
+ }
971
+ to {
972
+ opacity: 1;
973
+ transform: translateY(0);
974
+ }
975
+ `,
976
+ slideUpOut: keyframes`
977
+ from {
978
+ opacity: 1;
979
+ transform: translateY(0);
980
+ }
981
+ to {
982
+ opacity: 0;
983
+ transform: translateY(10px);
984
+ }
985
+ `,
986
+ fadeIn: keyframes`
987
+ from {
988
+ opacity: 0;
989
+ }
990
+ to {
991
+ opacity: 1;
992
+ }
993
+ `,
994
+ fadeOut: keyframes`
995
+ from {
996
+ opacity: 1;
997
+ }
998
+ to {
999
+ opacity: 0;
1000
+ }
1001
+ `
1002
+ };
1003
+ const SIZE = 32;
1004
+ const PREVIEW_SCALE = 2;
1005
+ const Item$4 = React.forwardRef(
1006
+ ({ onLoadingStatusChange, delayMs = 600, src, alt, fallback, preview = false, ...restProps }, forwardedRef) => {
1007
+ const [loadingStatus, setLoadingStatus] = useControllableState$1({
1008
+ onChange: onLoadingStatusChange
1009
+ });
1010
+ const [tooltipOpen, setTooltipOpen] = React.useState(false);
1011
+ const hasPreview = preview && loadingStatus === "loaded";
1012
+ const handleTooltipOpen = (isOpen) => {
1013
+ if (hasPreview) {
1014
+ setTooltipOpen(isOpen);
1015
+ }
1016
+ };
1017
+ return /* @__PURE__ */ jsxs(Tooltip.Root, { onOpenChange: handleTooltipOpen, children: [
1018
+ /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(AvatarRoot, { ref: forwardedRef, ...restProps, children: [
1019
+ hasPreview ? /* @__PURE__ */ jsx(
1020
+ AvatarOverlay,
1021
+ {
1022
+ width: "100%",
1023
+ height: "100%",
1024
+ position: "absolute",
1025
+ background: "neutral0",
1026
+ zIndex: "overlay",
1027
+ style: { opacity: tooltipOpen ? 0.4 : 0 }
1028
+ }
1029
+ ) : null,
1030
+ /* @__PURE__ */ jsx(AvatarImage, { src, alt, onLoadingStatusChange: setLoadingStatus }),
1031
+ /* @__PURE__ */ jsx(Avatar$1.Fallback, { delayMs, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textTransform: "uppercase", children: fallback }) })
1032
+ ] }) }),
1033
+ hasPreview ? /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(PreviewContent, { side: "top", sideOffset: 4, children: /* @__PURE__ */ jsx(PreviewImg, { src, alt }) }) }) : null
1034
+ ] });
1035
+ }
1036
+ );
1037
+ const avatarStyles = css`
1038
+ display: inline-flex;
1039
+ align-items: center;
1040
+ justify-content: center;
1041
+ vertical-align: middle;
1042
+ overflow: hidden;
1043
+ user-select: none;
1044
+ overflow: hidden;
808
1045
  border-radius: 50%;
1046
+ `;
1047
+ const imgStyles = css`
1048
+ width: 100%;
1049
+ height: 100%;
809
1050
  object-fit: cover;
810
- display: block;
1051
+ border-radius: inherit;
1052
+ `;
1053
+ const AvatarRoot = styled(Avatar$1.Root)`
811
1054
  position: relative;
1055
+ z-index: 0;
1056
+ ${avatarStyles}
1057
+ width: ${SIZE / 10}rem;
1058
+ height: ${SIZE / 10}rem;
1059
+ /* 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 */
1060
+ background-color: ${(p) => p.theme.colors.primary600};
1061
+ color: ${(p) => p.theme.colors.neutral0};
1062
+ `;
1063
+ const AvatarOverlay = styled(Box)`
1064
+ @media (prefers-reduced-motion: no-preference) {
1065
+ transition: opacity ${(props) => props.theme.motion.timings["200"]}
1066
+ ${(props) => props.theme.motion.easings.authenticMotion};
1067
+ }
812
1068
  `;
813
- const PreviewContainer = styled.img`
814
- border-radius: 50%;
815
- object-fit: cover;
816
- position: absolute;
817
- transform: translate(-${(previewSize - avatarSize) / 2}px, -100%);
818
- margin-top: -${({ theme }) => theme.spaces[1]};
819
- `;
820
- const Overlay = styled(Box)`
821
- opacity: 0.4;
822
- `;
823
- const Avatar = ({ src, alt, preview }) => {
824
- const [previewVisible, setPreviewVisible] = React.useState(false);
825
- const isHovering = Boolean(preview && previewVisible);
826
- return /* @__PURE__ */ jsxs("span", { children: [
827
- isHovering ? /* @__PURE__ */ jsx(
828
- PreviewContainer,
829
- {
830
- "aria-hidden": true,
831
- alt: "",
832
- width: `${previewSize}px`,
833
- height: `${previewSize}px`,
834
- src: preview === true ? src : typeof preview === "string" ? preview : ""
835
- }
836
- ) : null,
837
- /* @__PURE__ */ jsxs(
838
- Box,
839
- {
840
- zIndex: isHovering ? 1 : void 0,
841
- position: "relative",
842
- onMouseEnter: () => setPreviewVisible(true),
843
- onMouseLeave: () => setPreviewVisible(false),
844
- width: `${avatarSize}px`,
845
- height: `${avatarSize}px`,
846
- children: [
847
- isHovering ? /* @__PURE__ */ jsx(
848
- Overlay,
849
- {
850
- background: "neutral0",
851
- borderRadius: "50%",
852
- position: "absolute",
853
- width: `${avatarSize}px`,
854
- height: `${avatarSize}px`,
855
- zIndex: 1
856
- }
857
- ) : null,
858
- /* @__PURE__ */ jsx(AvatarImg, { src, alt, width: `${avatarSize}px`, height: `${avatarSize}px` })
859
- ]
860
- }
861
- )
862
- ] });
863
- };
864
- const InitialsWrapper = styled(Flex)`
865
- span {
866
- line-height: 0;
1069
+ const AvatarImage = styled(Avatar$1.Image)`
1070
+ ${imgStyles}
1071
+ `;
1072
+ const PreviewContent = styled(Tooltip.Content)`
1073
+ ${avatarStyles}
1074
+ width: ${SIZE * PREVIEW_SCALE / 10}rem;
1075
+ height: ${SIZE * PREVIEW_SCALE / 10}rem;
1076
+
1077
+ @media (prefers-reduced-motion: no-preference) {
1078
+ animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
1079
+ ${(props) => props.theme.motion.easings.authenticMotion};
867
1080
  }
868
1081
  `;
869
- const Initials = ({ children, background = "primary600", textColor = "buttonNeutral0" }) => {
870
- return /* @__PURE__ */ jsx(
871
- InitialsWrapper,
872
- {
873
- background,
874
- borderRadius: "50%",
875
- width: `${avatarSize}px`,
876
- height: `${avatarSize}px`,
877
- justifyContent: "center",
878
- children: /* @__PURE__ */ jsx(Typography, { fontSize: 0, fontWeight: "bold", textColor, textTransform: "uppercase", children })
879
- }
880
- );
881
- };
882
- const AvatarGroup = styled(Flex)`
883
- & > * + * {
884
- margin-left: -${avatarSize / 2}px;
1082
+ const PreviewImg = styled.img`
1083
+ ${imgStyles}
1084
+ `;
1085
+ const Group$2 = React.forwardRef((props, forwarededRef) => {
1086
+ return /* @__PURE__ */ jsx(GroupFlex, { ...props, ref: forwarededRef, tag: "div" });
1087
+ });
1088
+ const GroupFlex = styled(Flex)`
1089
+ & > ${AvatarRoot} + ${AvatarRoot} {
1090
+ margin-left: -${SIZE / 10 / 2}rem;
885
1091
  }
886
1092
  `;
1093
+ const Avatar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1094
+ __proto__: null,
1095
+ Group: Group$2,
1096
+ Item: Item$4
1097
+ }, Symbol.toStringTag, { value: "Module" }));
887
1098
  const Badge = ({
888
1099
  active = false,
889
1100
  size = "M",
@@ -953,113 +1164,6 @@ const BaseButtonWrapper = styled(Flex)`
953
1164
 
954
1165
  ${focus}
955
1166
  `;
956
- function setRef(ref, value) {
957
- if (typeof ref === "function") {
958
- ref(value);
959
- } else if (ref !== null && ref !== void 0) {
960
- ref.current = value;
961
- }
962
- }
963
- function composeRefs(...refs) {
964
- return (node) => refs.forEach((ref) => setRef(ref, node));
965
- }
966
- function useComposedRefs(...refs) {
967
- return React.useCallback(composeRefs(...refs), refs);
968
- }
969
- 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";
970
- 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";
971
- const BaseCheckbox = React.forwardRef(
972
- ({ indeterminate = false, name, value = false, onValueChange, ...inputProps }, forwardedRef) => {
973
- const checkboxRef = React.useRef(null);
974
- const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
975
- React.useEffect(() => {
976
- if (checkboxRef.current && indeterminate) {
977
- checkboxRef.current.indeterminate = indeterminate;
978
- } else {
979
- checkboxRef.current.indeterminate = false;
980
- }
981
- }, [indeterminate]);
982
- const handleValueChange = () => {
983
- if (onValueChange) {
984
- onValueChange(!value);
985
- }
986
- };
987
- return /* @__PURE__ */ jsx(
988
- CheckboxInput,
989
- {
990
- checked: value,
991
- onChange: handleValueChange,
992
- type: "checkbox",
993
- ref: composedRefs,
994
- name,
995
- ...inputProps
996
- }
997
- );
998
- }
999
- );
1000
- BaseCheckbox.displayName = "BaseCheckbox";
1001
- const CheckboxInput = styled.input`
1002
- min-width: 1.8rem;
1003
- height: 1.8rem;
1004
- margin: 0;
1005
- appearance: none;
1006
- border-radius: ${({ theme }) => theme.borderRadius};
1007
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1008
- background-color: ${({ theme }) => theme.colors.neutral0};
1009
- cursor: pointer;
1010
-
1011
- &:checked {
1012
- background-color: ${({ theme }) => theme.colors.primary600};
1013
- border: 1px solid ${({ theme }) => theme.colors.primary600};
1014
-
1015
- &:after {
1016
- content: '';
1017
- display: block;
1018
- position: relative;
1019
- background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
1020
- width: 1rem;
1021
- height: 1rem;
1022
- left: 50%;
1023
- top: 50%;
1024
- transform: translateX(-50%) translateY(-50%);
1025
- }
1026
-
1027
- &:disabled:after {
1028
- background: ${() => `url("${checkmarkIconDisabled}") no-repeat no-repeat center center`};
1029
- }
1030
- }
1031
-
1032
- &:disabled {
1033
- background-color: ${({ theme }) => theme.colors.neutral200};
1034
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1035
- }
1036
-
1037
- &:indeterminate {
1038
- background-color: ${({ theme }) => theme.colors.primary600};
1039
- border: 1px solid ${({ theme }) => theme.colors.primary600};
1040
-
1041
- &:after {
1042
- content: '';
1043
- display: block;
1044
- position: relative;
1045
- color: white;
1046
- height: 2px;
1047
- width: 10px;
1048
- background-color: ${({ theme }) => theme.colors.neutral0};
1049
- left: 50%;
1050
- top: 50%;
1051
- transform: translateX(-50%) translateY(-50%);
1052
- }
1053
-
1054
- &:disabled {
1055
- background-color: ${({ theme }) => theme.colors.neutral200};
1056
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1057
- &:after {
1058
- background-color: ${({ theme }) => theme.colors.neutral500};
1059
- }
1060
- }
1061
- }
1062
- `;
1063
1167
  const BaseLink = forwardRef(
1064
1168
  ({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
1065
1169
  return /* @__PURE__ */ jsx(
@@ -1077,88 +1181,6 @@ const BaseLink = forwardRef(
1077
1181
  );
1078
1182
  }
1079
1183
  );
1080
- const useReactId = React["useId".toString()] || (() => void 0);
1081
- let count = 0;
1082
- const useId = (initialId) => {
1083
- const [id, setId] = React.useState(useReactId());
1084
- React.useLayoutEffect(() => {
1085
- if (!initialId)
1086
- setId((reactId) => reactId ?? String(count++));
1087
- }, [initialId]);
1088
- return initialId?.toString() ?? (id || "");
1089
- };
1090
- const setTabIndexOnFirstItem = (node, selector) => {
1091
- const list = node.querySelectorAll(selector);
1092
- if (list && list.length > 0) {
1093
- list.item(0).setAttribute("tabindex", "0");
1094
- }
1095
- };
1096
- const [RadioProvider, useRadioGroup] = createContext("RadioGroup", {
1097
- onChange: void 0,
1098
- name: "",
1099
- selected: ""
1100
- });
1101
- const RadioGroup = ({ children, labelledBy, onChange, value = "", name, ...props }) => {
1102
- const radioGroupRef = React.useRef(null);
1103
- React.useLayoutEffect(() => {
1104
- if (!value) {
1105
- setTabIndexOnFirstItem(radioGroupRef.current, `[name="${name}"]`);
1106
- }
1107
- }, [value, name]);
1108
- return /* @__PURE__ */ jsx(RadioProvider, { onChange, selected: value, name, children: /* @__PURE__ */ jsx("div", { ref: radioGroupRef, role: "radiogroup", "aria-labelledby": labelledBy, ...props, children }) });
1109
- };
1110
- const BaseRadio = React.forwardRef(({ value, disabled = false, ...props }, ref) => {
1111
- const generatedId = useId();
1112
- const { onChange, selected, name } = useRadioGroup("BaseRadio");
1113
- const isSelected = selected === value;
1114
- return /* @__PURE__ */ jsx(
1115
- RadioInput,
1116
- {
1117
- ref,
1118
- type: "radio",
1119
- name,
1120
- value,
1121
- tabIndex: isSelected ? 0 : -1,
1122
- "aria-checked": isSelected,
1123
- checked: isSelected,
1124
- disabled,
1125
- id: generatedId,
1126
- onChange,
1127
- ...props
1128
- }
1129
- );
1130
- });
1131
- BaseRadio.displayName = "Radio";
1132
- const RadioInput = styled.input`
1133
- margin: 0;
1134
- padding: 0;
1135
- background-color: ${({ theme }) => theme.colors.neutral0};
1136
- border: 1px solid ${({ theme }) => theme.colors.primary600};
1137
- border-radius: 50%;
1138
- height: 1.8rem;
1139
- width: 1.8rem;
1140
-
1141
- &:after {
1142
- border-radius: 50%;
1143
- content: '';
1144
- position: relative;
1145
- z-index: 1;
1146
- display: block;
1147
- height: 1rem;
1148
- width: 1rem;
1149
- left: 0.3rem;
1150
- top: 0.3rem;
1151
- }
1152
-
1153
- &:checked:after {
1154
- background: ${({ theme }) => theme.colors.primary600};
1155
- }
1156
-
1157
- &:disabled {
1158
- border: 1px solid ${({ theme }) => theme.colors.neutral300};
1159
- background: ${({ theme }) => theme.colors.neutral200};
1160
- }
1161
- `;
1162
1184
  const Divider$1 = () => {
1163
1185
  return /* @__PURE__ */ jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
1164
1186
  };
@@ -1212,6 +1234,18 @@ const StyledLink = styled(BaseLink)`
1212
1234
  const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsx(StyledLink, { ...props, children });
1213
1235
  CrumbLink.displayName = "CrumbLink";
1214
1236
  const stripReactIdOfColon = (str) => str.replaceAll(":", "");
1237
+ const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
1238
+ const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
1239
+ const useReactId = React["useId".toString()] || (() => void 0);
1240
+ let count = 0;
1241
+ const useId = (initialId) => {
1242
+ const [id, setId] = React.useState(useReactId());
1243
+ useIsomorphicLayoutEffect(() => {
1244
+ if (!initialId)
1245
+ setId((reactId) => reactId ?? String(count++));
1246
+ }, [initialId]);
1247
+ return initialId?.toString() ?? (id || "");
1248
+ };
1215
1249
  const useIntersection = (scrollableAreaRef, callback, { selectorToWatch, skipWhen = false }) => {
1216
1250
  const handleIntersection = useCallbackRef(callback);
1217
1251
  React.useEffect(() => {
@@ -1442,6 +1476,13 @@ const ButtonWrapper = styled(BaseButton)`
1442
1476
  }
1443
1477
 
1444
1478
  ${getVariantStyle}
1479
+
1480
+ @media (prefers-reduced-motion: no-preference) {
1481
+ transition:
1482
+ ${(props) => props.theme.transitions.backgroundColor},
1483
+ ${(props) => props.theme.transitions.color},
1484
+ border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
1485
+ }
1445
1486
  `;
1446
1487
  const Link = forwardRef(
1447
1488
  ({ children, href, disabled = false, startIcon, endIcon, isExternal = true, ...props }, ref) => {
@@ -1629,24 +1670,24 @@ const MenuSubContent = React.forwardRef((props, ref) => {
1629
1670
  }
1630
1671
  ) }) });
1631
1672
  });
1632
- const Root$2 = MenuRoot;
1633
- const Trigger$2 = MenuTrigger;
1634
- const Content$3 = MenuContent;
1635
- const Item$1 = MenuItem$1;
1673
+ const Root$7 = MenuRoot;
1674
+ const Trigger$6 = MenuTrigger;
1675
+ const Content$6 = MenuContent;
1676
+ const Item$3 = MenuItem$1;
1636
1677
  const Label$1 = MenuLabel;
1637
1678
  const SubRoot = MenuSubRoot;
1638
1679
  const SubTrigger = MenuSubTrigger;
1639
1680
  const SubContent = MenuSubContent;
1640
1681
  const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1641
1682
  __proto__: null,
1642
- Content: Content$3,
1643
- Item: Item$1,
1683
+ Content: Content$6,
1684
+ Item: Item$3,
1644
1685
  Label: Label$1,
1645
- Root: Root$2,
1686
+ Root: Root$7,
1646
1687
  SubContent,
1647
1688
  SubRoot,
1648
1689
  SubTrigger,
1649
- Trigger: Trigger$2
1690
+ Trigger: Trigger$6
1650
1691
  }, Symbol.toStringTag, { value: "Module" }));
1651
1692
  const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }) => {
1652
1693
  const contentRef = React.useRef(null);
@@ -1674,12 +1715,12 @@ const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, .
1674
1715
  */
1675
1716
  skipWhen: !internalIsOpen
1676
1717
  });
1677
- return /* @__PURE__ */ jsxs(Root$2, { onOpenChange: handleOpenChange, children: [
1678
- /* @__PURE__ */ jsx(Trigger$2, { ...props, children: props.label }),
1679
- /* @__PURE__ */ jsx(Content$3, { intersectionId, popoverPlacement, children })
1718
+ return /* @__PURE__ */ jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
1719
+ /* @__PURE__ */ jsx(Trigger$6, { ...props, children: props.label }),
1720
+ /* @__PURE__ */ jsx(Content$6, { intersectionId, popoverPlacement, children })
1680
1721
  ] });
1681
1722
  };
1682
- const MenuItem = Item$1;
1723
+ const MenuItem = Item$3;
1683
1724
  const StyledButton = styled(SimpleMenu)`
1684
1725
  padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
1685
1726
  height: unset;
@@ -1766,14 +1807,109 @@ const CardBadge = (props) => /* @__PURE__ */ jsx(CardBadgeWrapper, { children: /
1766
1807
  const CardBody = (props) => {
1767
1808
  return /* @__PURE__ */ jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Flex, { ...props, alignItems: "flex-start" }) });
1768
1809
  };
1769
- const CardCheckbox = (props) => {
1770
- const { id } = useCard();
1771
- return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(BaseCheckbox, { "aria-labelledby": `${id}-title`, ...props }) });
1810
+ function setRef(ref, value) {
1811
+ if (typeof ref === "function") {
1812
+ ref(value);
1813
+ } else if (ref !== null && ref !== void 0) {
1814
+ ref.current = value;
1815
+ }
1816
+ }
1817
+ function composeRefs(...refs) {
1818
+ return (node) => refs.forEach((ref) => setRef(ref, node));
1819
+ }
1820
+ function useComposedRefs(...refs) {
1821
+ return React.useCallback(composeRefs(...refs), refs);
1822
+ }
1823
+ const CheckIcon = ({ fill, ...props }) => {
1824
+ const { colors } = useTheme();
1825
+ return /* @__PURE__ */ jsx(
1826
+ Box,
1827
+ {
1828
+ tag: "svg",
1829
+ viewBox: "0 0 10 8",
1830
+ xmlns: "http://www.w3.org/2000/svg",
1831
+ fill: fill ? colors[fill] : void 0,
1832
+ ...props,
1833
+ children: /* @__PURE__ */ 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" })
1834
+ }
1835
+ );
1772
1836
  };
1773
- const BreakBox = styled(Box)`
1774
- word-break: break-all;
1775
- `;
1776
- const CardContent = ({ children, ...props }) => {
1837
+ const CheckboxEl = React.forwardRef(
1838
+ ({ defaultChecked, checked: checkedProp, onCheckedChange, ...props }, forwardedRef) => {
1839
+ const checkboxRef = React.useRef(null);
1840
+ const [checked, setChecked] = useControllableState$1({
1841
+ defaultProp: defaultChecked,
1842
+ prop: checkedProp,
1843
+ onChange: onCheckedChange
1844
+ });
1845
+ const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
1846
+ return /* @__PURE__ */ jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxs(Checkbox.Indicator, { children: [
1847
+ checked === true ? /* @__PURE__ */ jsx(CheckIcon, { width: "1rem", fill: "neutral0" }) : null,
1848
+ checked === "indeterminate" ? /* @__PURE__ */ jsx(Box, { height: "2px", width: "1rem", background: "neutral0", borderRadius: "1px" }) : null
1849
+ ] }) });
1850
+ }
1851
+ );
1852
+ const CheckboxRoot = styled(Checkbox.Root)`
1853
+ background: ${(props) => props.theme.colors.neutral0};
1854
+ width: 2rem;
1855
+ height: 2rem;
1856
+ border-radius: ${(props) => props.theme.borderRadius};
1857
+ border: 1px solid ${(props) => props.theme.colors.neutral300};
1858
+ position: relative;
1859
+ z-index: 0;
1860
+ display: flex;
1861
+ justify-content: center;
1862
+ align-items: center;
1863
+ // this ensures the checkbox is always a square even in flex-containers.
1864
+ flex: 0 0 2rem;
1865
+
1866
+ @media (prefers-reduced-motion: no-preference) {
1867
+ transition:
1868
+ border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
1869
+ ${(props) => props.theme.transitions.backgroundColor};
1870
+ }
1871
+
1872
+ &[data-state='checked'],
1873
+ &[data-state='indeterminate'] {
1874
+ border: 1px solid ${(props) => props.theme.colors.primary600};
1875
+ background-color: ${(props) => props.theme.colors.primary600};
1876
+ }
1877
+
1878
+ &[data-disabled] {
1879
+ background-color: ${(props) => props.theme.colors.neutral200};
1880
+ }
1881
+
1882
+ /* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
1883
+ &::before {
1884
+ content: '';
1885
+ position: absolute;
1886
+ top: 50%;
1887
+ left: 50%;
1888
+ transform: translate(-50%, -50%);
1889
+ width: 100%;
1890
+ height: 100%;
1891
+ min-width: 44px;
1892
+ min-height: 44px;
1893
+ }
1894
+ `;
1895
+ const CheckboxImpl = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
1896
+ const labelId = useId(restProps.id);
1897
+ if (!children) {
1898
+ return /* @__PURE__ */ jsx(CheckboxEl, { ref: forwardedRef, ...restProps });
1899
+ }
1900
+ return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
1901
+ /* @__PURE__ */ jsx(CheckboxEl, { id: labelId, ...restProps }),
1902
+ /* @__PURE__ */ jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
1903
+ ] });
1904
+ });
1905
+ const CardCheckbox = (props) => {
1906
+ const { id } = useCard();
1907
+ return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
1908
+ };
1909
+ const BreakBox = styled(Box)`
1910
+ word-break: break-all;
1911
+ `;
1912
+ const CardContent = ({ children, ...props }) => {
1777
1913
  return /* @__PURE__ */ jsx(BreakBox, { ...props, children });
1778
1914
  };
1779
1915
  const CardHeaderWrapper = styled(Flex)`
@@ -1849,14 +1985,6 @@ const TooltipImpl = React.forwardRef(
1849
1985
  );
1850
1986
  }
1851
1987
  );
1852
- const fadeIn = keyframes`
1853
- from {
1854
- opacity: 0;
1855
- }
1856
- to {
1857
- opacity: 1;
1858
- }
1859
- `;
1860
1988
  const TooltipContent = styled(Tooltip.Content)`
1861
1989
  background-color: ${(props) => props.theme.colors.neutral900};
1862
1990
  color: ${(props) => props.theme.colors.neutral0};
@@ -1868,7 +1996,8 @@ const TooltipContent = styled(Tooltip.Content)`
1868
1996
  transform-origin: var(--radix-tooltip-content-transform-origin);
1869
1997
 
1870
1998
  @media (prefers-reduced-motion: no-preference) {
1871
- animation: ${fadeIn} 200ms ${(props) => props.theme.easings.authenticMotion};
1999
+ animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
2000
+ ${(props) => props.theme.motion.easings.authenticMotion};
1872
2001
  }
1873
2002
  `;
1874
2003
  const CarouselGrid = styled(Box)`
@@ -1941,34 +2070,6 @@ const Carousel = React.forwardRef(
1941
2070
  ] }) });
1942
2071
  }
1943
2072
  );
1944
- const EASINGS = {
1945
- easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
1946
- easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
1947
- easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
1948
- easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
1949
- easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
1950
- easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
1951
- easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
1952
- easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
1953
- easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
1954
- easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
1955
- easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
1956
- easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
1957
- easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
1958
- easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
1959
- easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
1960
- easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
1961
- easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
1962
- easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
1963
- easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
1964
- easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
1965
- easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
1966
- easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
1967
- easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
1968
- easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
1969
- easeInOutFast: "cubic-bezier(1,0,0,1)",
1970
- authenticMotion: "cubic-bezier(.4,0,.2,1)"
1971
- };
1972
2073
  const sizes = {
1973
2074
  accordions: {
1974
2075
  S: `4.8rem`,
@@ -2004,7 +2105,11 @@ const commonTheme = {
2004
2105
  semiBold: 500,
2005
2106
  bold: 600
2006
2107
  },
2007
- easings: EASINGS
2108
+ transitions: TRANSITIONS,
2109
+ motion: {
2110
+ easings: EASINGS,
2111
+ timings: TIMINGS
2112
+ }
2008
2113
  };
2009
2114
  const lightColorTokenObject = {
2010
2115
  color: {
@@ -2832,7 +2937,7 @@ lodash.exports;
2832
2937
  }
2833
2938
  var runInContext = function runInContext2(context) {
2834
2939
  context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
2835
- 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;
2940
+ 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;
2836
2941
  var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
2837
2942
  var coreJsData = context["__core-js_shared__"];
2838
2943
  var funcToString = funcProto.toString;
@@ -2858,7 +2963,7 @@ lodash.exports;
2858
2963
  }
2859
2964
  }();
2860
2965
  var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
2861
- 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;
2966
+ 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;
2862
2967
  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");
2863
2968
  var metaMap = WeakMap && new WeakMap();
2864
2969
  var realNames = {};
@@ -4604,7 +4709,7 @@ lodash.exports;
4604
4709
  return setWrapToString(result2, func, bitmask);
4605
4710
  }
4606
4711
  function createRound(methodName) {
4607
- var func = Math2[methodName];
4712
+ var func = Math[methodName];
4608
4713
  return function(number, precision) {
4609
4714
  number = toNumber(number);
4610
4715
  precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
@@ -7659,7 +7764,7 @@ const getThemeSize = (type) => {
7659
7764
  };
7660
7765
  const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) => css`
7661
7766
  outline: none;
7662
- box-shadow: 0;
7767
+ box-shadow: none;
7663
7768
  transition-property: border-color, box-shadow, fill;
7664
7769
  transition-duration: 0.2s;
7665
7770
 
@@ -7669,7 +7774,7 @@ const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) =>
7669
7774
  }
7670
7775
  `;
7671
7776
  const [FieldProvider, useField] = createContext("Field", {});
7672
- const Root$1 = React.forwardRef(
7777
+ const Root$6 = React.forwardRef(
7673
7778
  ({ children, name, error = false, hint, id, required = false, ...props }, ref) => {
7674
7779
  const generatedId = useId(id);
7675
7780
  const [labelNode, setLabelNode] = React.useState();
@@ -7699,7 +7804,6 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
7699
7804
  {
7700
7805
  ref: composedRefs,
7701
7806
  display: "flex",
7702
- alignItems: "center",
7703
7807
  variant: "pi",
7704
7808
  textColor: "neutral800",
7705
7809
  fontWeight: "bold",
@@ -7834,7 +7938,7 @@ const Error$1 = () => {
7834
7938
  }
7835
7939
  return /* @__PURE__ */ jsx(Typography, { variant: "pi", tag: "p", id: `${id}-error`, textColor: "danger600", "data-strapi-field-error": true, children: error });
7836
7940
  };
7837
- const Action = React.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsx(
7941
+ const Action$1 = React.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsx(
7838
7942
  FieldActionWrapper,
7839
7943
  {
7840
7944
  justifyContent: "unset",
@@ -7853,12 +7957,12 @@ const FieldActionWrapper = styled(Flex)`
7853
7957
  `;
7854
7958
  const Field = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7855
7959
  __proto__: null,
7856
- Action,
7960
+ Action: Action$1,
7857
7961
  Error: Error$1,
7858
7962
  Hint,
7859
7963
  Input: Input$2,
7860
7964
  Label,
7861
- Root: Root$1,
7965
+ Root: Root$6,
7862
7966
  useField
7863
7967
  }, Symbol.toStringTag, { value: "Module" }));
7864
7968
  const CarouselInput = React.forwardRef(
@@ -7880,7 +7984,7 @@ const CarouselInput = React.forwardRef(
7880
7984
  ...props
7881
7985
  }, forwardedRef) => {
7882
7986
  const generatedId = useId(id);
7883
- return /* @__PURE__ */ jsx(Root$1, { hint, error, id: generatedId, required, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
7987
+ return /* @__PURE__ */ jsx(Root$6, { hint, error, id: generatedId, required, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
7884
7988
  label && /* @__PURE__ */ jsx(Label, { action: labelAction, children: label }),
7885
7989
  /* @__PURE__ */ jsx(
7886
7990
  Carousel,
@@ -7944,21 +8048,6 @@ const CarouselSlide = ({ label, children, selected = false, ...props }) => /* @_
7944
8048
  children
7945
8049
  }
7946
8050
  );
7947
- const Checkbox = React.forwardRef(
7948
- ({ children, disabled = false, ...props }, forwardedRef) => {
7949
- return /* @__PURE__ */ jsxs(CheckboxLabel, { tag: "label", textColor: "neutral800", $disabled: disabled, children: [
7950
- /* @__PURE__ */ jsx(BaseCheckbox, { ref: forwardedRef, disabled, ...props }),
7951
- /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children })
7952
- ] });
7953
- }
7954
- );
7955
- const CheckboxLabel = styled(Typography)`
7956
- display: flex;
7957
- align-items: flex-start;
7958
- * {
7959
- cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
7960
- }
7961
- `;
7962
8051
  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";
7963
8052
  const Loader = React.forwardRef(({ children, small = false, ...props }, ref) => {
7964
8053
  return /* @__PURE__ */ jsxs("div", { role: "alert", "aria-live": "assertive", ref, ...props, children: [
@@ -8111,9 +8200,9 @@ const Combobox = React.forwardRef(
8111
8200
  onFilterValueChange: handleFilterValueChange,
8112
8201
  isPrintableCharacter: isPrintableCharacter2,
8113
8202
  children: [
8114
- /* @__PURE__ */ jsxs(Trigger$1, { $hasError: hasError, className, children: [
8203
+ /* @__PURE__ */ jsxs(Trigger$5, { $hasError: hasError, className, children: [
8115
8204
  /* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
8116
- startIcon ? /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }) : null,
8205
+ startIcon ? /* @__PURE__ */ jsx(Box, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
8117
8206
  /* @__PURE__ */ jsx(
8118
8207
  TextInput$1,
8119
8208
  {
@@ -8150,7 +8239,7 @@ const Combobox = React.forwardRef(
8150
8239
  /* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, {}) })
8151
8240
  ] })
8152
8241
  ] }),
8153
- /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$2, { sideOffset: 4, children: /* @__PURE__ */ jsxs(Viewport$1, { ref: viewportRef, children: [
8242
+ /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxs(Viewport$1, { ref: viewportRef, children: [
8154
8243
  children,
8155
8244
  creatable ? /* @__PURE__ */ jsx(
8156
8245
  Combobox$1.CreateItem,
@@ -8173,7 +8262,7 @@ const Combobox = React.forwardRef(
8173
8262
  const IconBox$3 = styled(Box)`
8174
8263
  padding: 0;
8175
8264
  `;
8176
- const Trigger$1 = styled(Combobox$1.Trigger)`
8265
+ const Trigger$5 = styled(Combobox$1.Trigger)`
8177
8266
  position: relative;
8178
8267
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
8179
8268
  padding-right: ${({ theme }) => theme.spaces[3]};
@@ -8228,7 +8317,7 @@ const DownIcon$1 = styled(Combobox$1.Icon)`
8228
8317
  cursor: inherit;
8229
8318
  }
8230
8319
  `;
8231
- const Content$2 = styled(Combobox$1.Content)`
8320
+ const Content$5 = styled(Combobox$1.Content)`
8232
8321
  background: ${({ theme }) => theme.colors.neutral0};
8233
8322
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
8234
8323
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
@@ -8237,6 +8326,23 @@ const Content$2 = styled(Combobox$1.Content)`
8237
8326
  /* This is from the design-system figma file. */
8238
8327
  max-height: 15rem;
8239
8328
  z-index: ${({ theme }) => theme.zIndices.popover};
8329
+
8330
+ @media (prefers-reduced-motion: no-preference) {
8331
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
8332
+
8333
+ /* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
8334
+ &[data-state='open'] {
8335
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
8336
+
8337
+ &[data-side='top'] {
8338
+ animation-name: ${ANIMATIONS.slideDownIn};
8339
+ }
8340
+
8341
+ &[data-side='bottom'] {
8342
+ animation-name: ${ANIMATIONS.slideUpIn};
8343
+ }
8344
+ }
8345
+ }
8240
8346
  `;
8241
8347
  const Viewport$1 = styled(Combobox$1.Viewport)`
8242
8348
  padding: ${({ theme }) => theme.spaces[1]};
@@ -8273,164 +8379,131 @@ const OptionBox = styled.div`
8273
8379
  font-weight: bold;
8274
8380
  }
8275
8381
  `;
8276
- const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
8277
- const useLockScroll = (lockScroll) => {
8278
- React.useEffect(() => {
8279
- if (lockScroll) {
8280
- document.body.classList.add("lock-body-scroll");
8281
- }
8282
- return () => {
8283
- document.body.classList.remove("lock-body-scroll");
8284
- };
8285
- }, [lockScroll]);
8286
- };
8287
- const DismissibleLayer = DismissibleLayerPrimitive.Root;
8288
- const getFocusableNodes = (node, includeNegativeTabIndex) => {
8289
- const nodes = [
8290
- ...node.querySelectorAll(
8291
- 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
8292
- )
8293
- ];
8294
- const focusables = nodes.filter((node2) => {
8295
- if (node2.hasAttribute("disabled"))
8296
- return false;
8297
- if (includeNegativeTabIndex)
8298
- return true;
8299
- return node2.getAttribute("tabindex") !== "-1";
8300
- });
8301
- return focusables;
8302
- };
8303
- const getFocusableNodesWithKeyboardNav = (nodes) => {
8304
- return nodes.filter((node) => {
8305
- if (node.tagName === "INPUT") {
8306
- return node.type !== "checkbox" && node.type !== "radio";
8307
- }
8308
- return false;
8309
- });
8310
- };
8311
- const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
8312
- const trappedRef = React.useRef(null);
8313
- React.useEffect(() => {
8314
- let currentFocus = null;
8315
- if (restoreFocus) {
8316
- currentFocus = document.activeElement;
8317
- }
8318
- return () => {
8319
- if (currentFocus) {
8320
- currentFocus.focus();
8321
- }
8322
- };
8323
- }, [restoreFocus]);
8324
- React.useEffect(() => {
8325
- if (!trappedRef.current || skipAutoFocus)
8326
- return;
8327
- const focusableChildren = getFocusableNodes(trappedRef.current);
8328
- if (focusableChildren.length > 0) {
8329
- const firstElement = focusableChildren[0];
8330
- firstElement.focus();
8331
- } else {
8332
- console.warn(
8333
- "[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
8334
- );
8335
- }
8336
- }, [skipAutoFocus]);
8337
- const handleKeyDown = (e) => {
8338
- if (e.key === KeyboardKeys.ESCAPE && onEscape) {
8339
- onEscape();
8340
- return;
8341
- }
8342
- if (e.key !== KeyboardKeys.TAB)
8343
- return;
8344
- const focusableChildren = getFocusableNodes(trappedRef.current);
8345
- if (focusableChildren.length > 0) {
8346
- const firstElement = focusableChildren[0];
8347
- const lastElement = focusableChildren[focusableChildren.length - 1];
8348
- if (e.shiftKey) {
8349
- if (firstElement === document.activeElement) {
8350
- e.preventDefault();
8351
- lastElement.focus();
8352
- }
8353
- } else if (lastElement === document.activeElement) {
8354
- e.preventDefault();
8355
- firstElement.focus();
8356
- }
8357
- }
8358
- };
8359
- return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
8360
- };
8361
- const Portal$1 = React.forwardRef(
8362
- ({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
8363
- return container ? createPortal(/* @__PURE__ */ jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
8364
- }
8365
- );
8366
- Portal$1.displayName = "Portal";
8367
- const DialogWrapper = styled(Box)`
8382
+ const Root$5 = AlertDialog.Root;
8383
+ const Trigger$4 = React.forwardRef((props, forwardedRef) => {
8384
+ return /* @__PURE__ */ jsx(AlertDialog.Trigger, { ...props, asChild: true, ref: forwardedRef });
8385
+ });
8386
+ const Content$4 = React.forwardRef((props, forwardedRef) => {
8387
+ return /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [
8388
+ /* @__PURE__ */ jsx(Overlay$1, {}),
8389
+ /* @__PURE__ */ jsx(ContentImpl$1, { ref: forwardedRef, ...props })
8390
+ ] });
8391
+ });
8392
+ const Overlay$1 = styled(AlertDialog.Overlay)`
8393
+ background-color: ${(props) => props.theme.colors.neutral800};
8394
+ position: fixed;
8368
8395
  inset: 0;
8369
- background: ${({ theme }) => setOpacity(theme.colors.neutral800, 0.2)};
8396
+ z-index: ${(props) => props.theme.zIndices.overlay};
8397
+ opacity: 0.2;
8398
+
8399
+ @media (prefers-reduced-motion: no-preference) {
8400
+ animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
8401
+ ${(props) => props.theme.motion.easings.authenticMotion};
8402
+ }
8370
8403
  `;
8371
- const DialogContainer = styled(Box)`
8372
- max-width: 41.2rem;
8373
- margin: 0 auto;
8404
+ const ContentImpl$1 = styled(AlertDialog.Content)`
8405
+ max-width: 42rem;
8406
+ height: min-content;
8407
+ width: 100%;
8374
8408
  overflow: hidden;
8375
- margin-top: 10%;
8376
- `;
8377
- const DialogHeader = styled(Flex)`
8378
- border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
8379
- `;
8380
- const Dialog = ({ onClose, title, as = "h2", isOpen, id, zIndex = "dialog", ...props }) => {
8381
- const generatedId = useId(id);
8382
- useLockScroll(isOpen);
8383
- if (!isOpen) {
8384
- return null;
8385
- }
8386
- const labelledBy = `${generatedId}-label`;
8387
- return /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(DialogWrapper, { padding: 8, position: "fixed", zIndex, children: /* @__PURE__ */ jsx(FocusTrap, { children: /* @__PURE__ */ jsx(DismissibleLayer, { onEscapeKeyDown: onClose, onPointerDownOutside: onClose, children: /* @__PURE__ */ jsxs(
8388
- DialogContainer,
8389
- {
8390
- "aria-labelledby": labelledBy,
8391
- "aria-modal": true,
8392
- background: "neutral0",
8393
- hasRadius: true,
8394
- shadow: "popupShadow",
8395
- role: "dialog",
8396
- children: [
8397
- /* @__PURE__ */ jsx(DialogHeader, { padding: 6, justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "beta", as, id: labelledBy, children: title }) }),
8398
- /* @__PURE__ */ jsx(Box, { ...props })
8399
- ]
8409
+ margin: 0 auto;
8410
+ display: flex;
8411
+ flex-direction: column;
8412
+
8413
+ position: fixed;
8414
+ top: 50%;
8415
+ left: 50%;
8416
+ transform: translate(-50%, -50%);
8417
+
8418
+ border-radius: ${(props) => props.theme.borderRadius};
8419
+ background-color: ${(props) => props.theme.colors.neutral0};
8420
+ box-shadow: ${(props) => props.theme.shadows.popupShadow};
8421
+ z-index: ${(props) => props.theme.zIndices.modal};
8422
+
8423
+ @media (prefers-reduced-motion: no-preference) {
8424
+ &[data-state='open'] {
8425
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
8426
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
8427
+ animation-name: ${ANIMATIONS.modalPopIn};
8400
8428
  }
8401
- ) }) }) }) });
8402
- };
8403
- const IconContainer = styled(Box)`
8404
- svg {
8405
- width: ${({ theme }) => theme.spaces[6]};
8406
- height: ${({ theme }) => theme.spaces[6]};
8407
8429
 
8408
- path {
8409
- fill: ${({ theme }) => theme.colors.danger600};
8430
+ &[data-state='closed'] {
8431
+ animation-duration: ${(props) => props.theme.motion.timings["120"]};
8432
+ animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
8433
+ animation-name: ${ANIMATIONS.modalPopOut};
8410
8434
  }
8411
8435
  }
8412
8436
  `;
8413
- const DialogBody = ({ children, icon }) => {
8414
- return /* @__PURE__ */ jsxs(Box, { paddingTop: 8, paddingBottom: 8, paddingLeft: 6, paddingRight: 6, children: [
8415
- icon && /* @__PURE__ */ jsx(IconContainer, { paddingBottom: 2, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: icon }) }),
8416
- children
8417
- ] });
8418
- };
8419
- const FooterWrapper = styled(Box)`
8420
- border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
8421
-
8422
- button {
8423
- width: 100%;
8424
- display: inline-flex;
8425
- justify-content: center;
8426
- }
8437
+ const Header$1 = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
8438
+ return /* @__PURE__ */ jsx(AlertDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(
8439
+ Title$1,
8440
+ {
8441
+ tag: "h2",
8442
+ ref: forwardedRef,
8443
+ padding: 6,
8444
+ justifyContent: "center",
8445
+ variant: "h2",
8446
+ fontWeight: "bold",
8447
+ ...restProps,
8448
+ children
8449
+ }
8450
+ ) });
8451
+ });
8452
+ const Title$1 = styled(Typography)`
8453
+ display: flex;
8454
+ justify-content: center;
8455
+ border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
8427
8456
  `;
8428
- const DialogFooter = ({ startAction, endAction }) => {
8429
- return /* @__PURE__ */ jsx(FooterWrapper, { padding: 4, children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
8430
- startAction,
8431
- endAction
8432
- ] }) });
8433
- };
8457
+ const Body$1 = React.forwardRef(({ children, icon, ...restProps }, forwardedRef) => {
8458
+ return /* @__PURE__ */ jsx(
8459
+ Flex,
8460
+ {
8461
+ ref: forwardedRef,
8462
+ gap: 2,
8463
+ direction: "column",
8464
+ paddingTop: 8,
8465
+ paddingBottom: 8,
8466
+ paddingLeft: 6,
8467
+ paddingRight: 6,
8468
+ ...restProps,
8469
+ children: typeof children === "string" ? /* @__PURE__ */ jsxs(Fragment, { children: [
8470
+ icon ? React.cloneElement(icon, {
8471
+ width: 24,
8472
+ height: 24
8473
+ }) : null,
8474
+ /* @__PURE__ */ jsx(Description, { children })
8475
+ ] }) : children
8476
+ }
8477
+ );
8478
+ });
8479
+ const Description = React.forwardRef((props, forwardedRef) => {
8480
+ return /* @__PURE__ */ jsx(AlertDialog.Description, { asChild: true, children: /* @__PURE__ */ jsx(Typography, { ref: forwardedRef, variant: "omega", ...props, tag: "p" }) });
8481
+ });
8482
+ const Footer$1 = React.forwardRef((props, forwardedRef) => {
8483
+ return /* @__PURE__ */ jsx(Foot$1, { ref: forwardedRef, gap: 2, padding: 4, justifyContent: "space-between", ...props, tag: "footer" });
8484
+ });
8485
+ const Foot$1 = styled(Flex)`
8486
+ border-top: solid 1px ${(props) => props.theme.colors.neutral150};
8487
+ flex: 1;
8488
+ `;
8489
+ const Cancel = React.forwardRef((props, forwardedRef) => {
8490
+ return /* @__PURE__ */ jsx(AlertDialog.Cancel, { ...props, asChild: true, ref: forwardedRef });
8491
+ });
8492
+ const Action = React.forwardRef((props, forwardedRef) => {
8493
+ return /* @__PURE__ */ jsx(AlertDialog.Action, { ...props, asChild: true, ref: forwardedRef });
8494
+ });
8495
+ const Dialog = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8496
+ __proto__: null,
8497
+ Action,
8498
+ Body: Body$1,
8499
+ Cancel,
8500
+ Content: Content$4,
8501
+ Description,
8502
+ Footer: Footer$1,
8503
+ Header: Header$1,
8504
+ Root: Root$5,
8505
+ Trigger: Trigger$4
8506
+ }, Symbol.toStringTag, { value: "Module" }));
8434
8507
  let $3db38b7d1fb3fe6a$var$count = 0;
8435
8508
  function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
8436
8509
  useEffect(() => {
@@ -8455,47 +8528,6 @@ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
8455
8528
  element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
8456
8529
  return element;
8457
8530
  }
8458
- function useControllableState({
8459
- prop,
8460
- defaultProp,
8461
- onChange = () => {
8462
- }
8463
- }) {
8464
- const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
8465
- const isControlled = prop !== void 0;
8466
- const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
8467
- const value = isControlled ? propValue : uncontrolledProp;
8468
- const handleChange = useCallbackRef(onChange);
8469
- const setValue = React.useCallback(
8470
- (nextValue) => {
8471
- if (isControlled) {
8472
- const setter = nextValue;
8473
- const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
8474
- if (value2 !== propValue) {
8475
- handleChange(value2);
8476
- setUncontrolledProp(nextValue);
8477
- }
8478
- } else {
8479
- setUncontrolledProp(nextValue);
8480
- }
8481
- },
8482
- [isControlled, propValue, setUncontrolledProp, handleChange]
8483
- );
8484
- return [value, setValue];
8485
- }
8486
- function useUncontrolledState({ defaultProp, onChange }) {
8487
- const uncontrolledState = React.useState(defaultProp);
8488
- const [value] = uncontrolledState;
8489
- const prevValueRef = React.useRef(value);
8490
- const handleChange = useCallbackRef(onChange);
8491
- React.useEffect(() => {
8492
- if (prevValueRef.current !== value) {
8493
- handleChange(value);
8494
- prevValueRef.current = value;
8495
- }
8496
- }, [value, prevValueRef, handleChange]);
8497
- return uncontrolledState;
8498
- }
8499
8531
  function useDateFormatter(locale, options) {
8500
8532
  const lastOptions = React.useRef(null);
8501
8533
  if (options && lastOptions.current && isEqual(options, lastOptions.current)) {
@@ -8672,12 +8704,38 @@ const DesignSystemProvider = ({
8672
8704
  theme = lightTheme,
8673
8705
  tooltipConfig
8674
8706
  }) => {
8707
+ useIsomorphicLayoutEffect(() => {
8708
+ const css2 = document.createElement("style");
8709
+ css2.type = "text/css";
8710
+ css2.appendChild(
8711
+ document.createTextNode(`
8712
+ * {
8713
+ -webkit-transition: none !important;
8714
+ -moz-transition: none !important;
8715
+ -o-transition: none !important;
8716
+ -ms-transition: none !important;
8717
+ transition: none !important;
8718
+ animation: none !important;
8719
+ }
8720
+ `)
8721
+ );
8722
+ document.head.appendChild(css2);
8723
+ window.getComputedStyle(css2).opacity;
8724
+ document.head.removeChild(css2);
8725
+ }, [theme]);
8675
8726
  return /* @__PURE__ */ jsx(Provider, { locale, children: /* @__PURE__ */ jsxs(ThemeProvider, { theme, children: [
8676
8727
  /* @__PURE__ */ jsx(Provider$1, { ...tooltipConfig, children }),
8677
8728
  /* @__PURE__ */ jsx(LiveRegions, {}),
8678
8729
  /* @__PURE__ */ jsx(GlobalStyle, {})
8679
8730
  ] }) });
8680
8731
  };
8732
+ const DismissibleLayer = DismissibleLayerPrimitive.Root;
8733
+ const Portal$1 = React.forwardRef(
8734
+ ({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
8735
+ return container ? createPortal(/* @__PURE__ */ jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
8736
+ }
8737
+ );
8738
+ Portal$1.displayName = "Portal";
8681
8739
  const SelectTrigger = React.forwardRef(
8682
8740
  ({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, ...restProps }, ref) => {
8683
8741
  const triggerRef = React.useRef(null);
@@ -8789,6 +8847,23 @@ const SelectContent = styled(Select.Content)`
8789
8847
  /* This is from the design-system figma file. */
8790
8848
  max-height: 15rem;
8791
8849
  z-index: ${({ theme }) => theme.zIndices.popover};
8850
+
8851
+ @media (prefers-reduced-motion: no-preference) {
8852
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
8853
+
8854
+ /* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
8855
+ &[data-state='open'] {
8856
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
8857
+
8858
+ &[data-side='top'] {
8859
+ animation-name: ${ANIMATIONS.slideDownIn};
8860
+ }
8861
+
8862
+ &[data-side='bottom'] {
8863
+ animation-name: ${ANIMATIONS.slideUpIn};
8864
+ }
8865
+ }
8866
+ }
8792
8867
  `;
8793
8868
  const SelectViewport = styled(Select.Viewport)`
8794
8869
  padding: ${({ theme }) => theme.spaces[1]};
@@ -8808,6 +8883,7 @@ const itemStyles = css`
8808
8883
  gap: ${({ theme }) => theme.spaces[2]};
8809
8884
  white-space: nowrap;
8810
8885
  user-select: none;
8886
+ color: ${({ theme }) => theme.colors.neutral800};
8811
8887
 
8812
8888
  &:focus-visible {
8813
8889
  outline: none;
@@ -8823,19 +8899,21 @@ const StyledSelectItem = styled(Select.Item)`
8823
8899
 
8824
8900
  &[data-state='checked'] {
8825
8901
  font-weight: bold;
8902
+ background-color: ${({ theme }) => theme.colors.primary100};
8826
8903
  color: ${({ theme }) => theme.colors.primary600};
8904
+ font-weight: bold;
8827
8905
  }
8828
8906
  `;
8829
- const Root = Select.Root;
8830
- const Trigger = SelectTrigger;
8907
+ const Root$4 = Select.Root;
8908
+ const Trigger$3 = SelectTrigger;
8831
8909
  const Value = SelectValue;
8832
8910
  const Portal = Select.Portal;
8833
- const Content$1 = SelectContent;
8911
+ const Content$3 = SelectContent;
8834
8912
  const Viewport = SelectViewport;
8835
- const Item = SelectItem;
8913
+ const Item$2 = SelectItem;
8836
8914
  const ItemIndicator = Select.ItemIndicator;
8837
8915
  const ItemText = Select.ItemText;
8838
- const Group = Select.Group;
8916
+ const Group$1 = Select.Group;
8839
8917
  const SingleSelect = React.forwardRef(
8840
8918
  ({
8841
8919
  children,
@@ -8904,7 +8982,7 @@ const SingleSelect = React.forwardRef(
8904
8982
  }
8905
8983
  const value = (typeof passedValue !== "undefined" && passedValue !== null ? passedValue.toString() : internalValue) ?? "";
8906
8984
  return /* @__PURE__ */ jsxs(
8907
- Root,
8985
+ Root$4,
8908
8986
  {
8909
8987
  onOpenChange: handleOpenChange,
8910
8988
  disabled,
@@ -8914,7 +8992,7 @@ const SingleSelect = React.forwardRef(
8914
8992
  ...restProps,
8915
8993
  children: [
8916
8994
  /* @__PURE__ */ jsx(
8917
- Trigger,
8995
+ Trigger$3,
8918
8996
  {
8919
8997
  ref: forwardedRef,
8920
8998
  id,
@@ -8929,7 +9007,7 @@ const SingleSelect = React.forwardRef(
8929
9007
  children: /* @__PURE__ */ jsx(Value, { placeholder, textColor: value ? "neutral800" : "neutral600", children: value && customizeContent ? customizeContent(value) : void 0 })
8930
9008
  }
8931
9009
  ),
8932
- /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$1, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxs(Viewport, { ref: viewportRef, children: [
9010
+ /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxs(Viewport, { ref: viewportRef, children: [
8933
9011
  children,
8934
9012
  /* @__PURE__ */ jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
8935
9013
  ] }) }) })
@@ -8940,9 +9018,9 @@ const SingleSelect = React.forwardRef(
8940
9018
  );
8941
9019
  const SingleSelectOption = React.forwardRef(
8942
9020
  ({ value, startIcon, children, ...restProps }, ref) => {
8943
- return /* @__PURE__ */ jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
9021
+ return /* @__PURE__ */ jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
8944
9022
  startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
8945
- /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: /* @__PURE__ */ jsx(ItemText, { children }) })
9023
+ /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(ItemText, { children }) })
8946
9024
  ] });
8947
9025
  }
8948
9026
  );
@@ -8989,7 +9067,7 @@ const DatePicker$1 = React.forwardRef(
8989
9067
  const [textInput, setTextInput] = React.useState(null);
8990
9068
  const [content, setContent] = React.useState(null);
8991
9069
  const [textValue, setTextValue] = React.useState();
8992
- const [value, setValue] = useControllableState({
9070
+ const [value, setValue] = useControllableState$1({
8993
9071
  defaultProp: initialDate ? convertUTCDateToCalendarDate(initialDate) : void 0,
8994
9072
  prop: valueProp ? convertUTCDateToCalendarDate(valueProp) : void 0,
8995
9073
  onChange(date) {
@@ -9033,7 +9111,7 @@ const DatePicker$1 = React.forwardRef(
9033
9111
  },
9034
9112
  [value]
9035
9113
  );
9036
- React.useLayoutEffect(() => {
9114
+ useIsomorphicLayoutEffect(() => {
9037
9115
  if (valueProp) {
9038
9116
  const date = convertUTCDateToCalendarDate(valueProp);
9039
9117
  setTextValue(formatter.format(date.toDate(timeZone)));
@@ -9042,7 +9120,7 @@ const DatePicker$1 = React.forwardRef(
9042
9120
  setTextValue("");
9043
9121
  }
9044
9122
  }, [valueProp, formatter, timeZone]);
9045
- React.useLayoutEffect(() => {
9123
+ useIsomorphicLayoutEffect(() => {
9046
9124
  if (initialDate && textValue === void 0) {
9047
9125
  const date = convertUTCDateToCalendarDate(initialDate);
9048
9126
  setTextValue(formatter.format(date.toDate(timeZone)));
@@ -9411,7 +9489,7 @@ const CONTENT_NAME = "DatePickerContent";
9411
9489
  const DatePickerContent = React.forwardRef((props, forwardedRef) => {
9412
9490
  const [fragment, setFragment] = React.useState();
9413
9491
  const context = useDatePickerContext(CONTENT_NAME);
9414
- React.useLayoutEffect(() => {
9492
+ useIsomorphicLayoutEffect(() => {
9415
9493
  setFragment(new DocumentFragment());
9416
9494
  }, []);
9417
9495
  if (!context.open) {
@@ -9540,7 +9618,7 @@ const DatePickerCalendar = React.forwardRef(
9540
9618
  const getDatesInWeek = makeGetDatesInWeek(startDate, locale);
9541
9619
  return /* @__PURE__ */ jsxs(Flex, { ref, direction: "column", alignItems: "stretch", padding: 4, ...restProps, children: [
9542
9620
  /* @__PURE__ */ jsxs(ToolbarFlex, { justifyContent: "flex-start", paddingBottom: 4, paddingLeft: 2, paddingRight: 2, gap: 2, children: [
9543
- /* @__PURE__ */ jsx(Root$1, { children: /* @__PURE__ */ jsx(
9621
+ /* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(
9544
9622
  SingleSelect,
9545
9623
  {
9546
9624
  "aria-label": monthSelectLabel,
@@ -9549,7 +9627,7 @@ const DatePickerCalendar = React.forwardRef(
9549
9627
  children: months.map((month) => /* @__PURE__ */ jsx(SingleSelectOption, { value: month, children: month }, month))
9550
9628
  }
9551
9629
  ) }),
9552
- /* @__PURE__ */ jsx(Root$1, { children: /* @__PURE__ */ jsx(SingleSelect, { value: calendarDate.year.toString(), "aria-label": yearSelectLabel, onChange: handleYearChange, children: years.map((year) => /* @__PURE__ */ jsx(SingleSelectOption, { value: year, children: year }, year)) }) })
9630
+ /* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(SingleSelect, { value: calendarDate.year.toString(), "aria-label": yearSelectLabel, onChange: handleYearChange, children: years.map((year) => /* @__PURE__ */ jsx(SingleSelectOption, { value: year, children: year }, year)) }) })
9553
9631
  ] }),
9554
9632
  /* @__PURE__ */ jsxs("table", { role: "grid", children: [
9555
9633
  /* @__PURE__ */ jsx("thead", { "aria-hidden": true, children: /* @__PURE__ */ jsx("tr", { "aria-rowindex": 0, children: weekDays.map((day, index) => /* @__PURE__ */ jsx(DatePickerHeaderCell, { "aria-colindex": index, children: day }, day)) }) }),
@@ -9772,7 +9850,7 @@ const TimePicker$1 = React.forwardRef(
9772
9850
  allowCustomValue: true,
9773
9851
  placeholder: `--${separator}--`,
9774
9852
  autocomplete: "none",
9775
- startIcon: /* @__PURE__ */ jsx(StyledClock, {}),
9853
+ startIcon: /* @__PURE__ */ jsx(Clock, { fill: "neutral500" }),
9776
9854
  inputMode: "numeric",
9777
9855
  pattern: `\\d{2}\\${separator}\\d{2}`,
9778
9856
  textValue,
@@ -9783,14 +9861,6 @@ const TimePicker$1 = React.forwardRef(
9783
9861
  );
9784
9862
  }
9785
9863
  );
9786
- const StyledClock = styled(Clock)`
9787
- height: 1rem;
9788
- width: 1rem;
9789
-
9790
- & > path {
9791
- fill: ${({ theme }) => theme.colors.neutral500};
9792
- }
9793
- `;
9794
9864
  const DatePicker = styled(DatePicker$1)`
9795
9865
  flex: 1 1 70%;
9796
9866
  min-width: 120px;
@@ -9815,7 +9885,7 @@ const DateTimePicker = React.forwardRef(
9815
9885
  ...props
9816
9886
  }, forwardedRef) => {
9817
9887
  const DatePickerElement2 = React.useRef(null);
9818
- const [dateValue, setDateValue] = useControllableState({
9888
+ const [dateValue, setDateValue] = useControllableState$1({
9819
9889
  defaultProp: initialDate ? convertUTCDateToCalendarDateTime(initialDate, false) : void 0,
9820
9890
  prop: value ? convertUTCDateToCalendarDateTime(value, false) : value ?? void 0,
9821
9891
  onChange(date) {
@@ -9867,7 +9937,7 @@ const DateTimePicker = React.forwardRef(
9867
9937
  const { error, id, labelNode } = useField("DateTimePicker");
9868
9938
  const hasError = Boolean(error) || hasErrorProp;
9869
9939
  return /* @__PURE__ */ jsxs(Flex, { "aria-labelledby": labelNode ? `${id}-label` : void 0, role: "group", flex: "1", gap: 1, children: [
9870
- /* @__PURE__ */ jsx(Root$1, { children: /* @__PURE__ */ jsx(
9940
+ /* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(
9871
9941
  DatePicker,
9872
9942
  {
9873
9943
  ...props,
@@ -9881,7 +9951,7 @@ const DateTimePicker = React.forwardRef(
9881
9951
  "aria-label": dateLabel
9882
9952
  }
9883
9953
  ) }),
9884
- /* @__PURE__ */ jsx(Root$1, { children: /* @__PURE__ */ jsx(
9954
+ /* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(
9885
9955
  TimePicker,
9886
9956
  {
9887
9957
  hasError,
@@ -9906,15 +9976,25 @@ const convertUTCDateToCalendarDateTime = (date, resetTime = true) => {
9906
9976
  }
9907
9977
  return toCalendarDateTime(zonedDateTime);
9908
9978
  };
9909
- const DividerWrapper = styled(Box)`
9979
+ const Divider = React.forwardRef((props, forwardedRef) => {
9980
+ return /* @__PURE__ */ jsx(
9981
+ DividerImpl,
9982
+ {
9983
+ ref: forwardedRef,
9984
+ background: "neutral150",
9985
+ ...props,
9986
+ "data-orientation": "horizontal",
9987
+ role: "separator",
9988
+ tag: "div"
9989
+ }
9990
+ );
9991
+ });
9992
+ const DividerImpl = styled(Box)`
9910
9993
  height: 1px;
9911
9994
  border: none;
9912
9995
  /* If contained in a Flex parent we want to prevent the Divider to shink */
9913
9996
  flex-shrink: 0;
9914
9997
  `;
9915
- const Divider = (props) => {
9916
- return /* @__PURE__ */ jsx(DividerWrapper, { ...props, background: "neutral150", tag: "hr" });
9917
- };
9918
9998
  const EmptyStateIconWrapper = styled(Box)`
9919
9999
  svg {
9920
10000
  height: 8.8rem;
@@ -9944,17 +10024,92 @@ const EmptyStateLayout = ({
9944
10024
  }
9945
10025
  );
9946
10026
  };
9947
- const Grid = (props) => {
9948
- const { gap = 0, gridCols = 12, ...rest } = props;
9949
- return /* @__PURE__ */ jsx(GridWrapper, { $gap: gap, $gridCols: gridCols, ...rest });
10027
+ const getFocusableNodes = (node, includeNegativeTabIndex) => {
10028
+ const nodes = [
10029
+ ...node.querySelectorAll(
10030
+ 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
10031
+ )
10032
+ ];
10033
+ const focusables = nodes.filter((node2) => {
10034
+ if (node2.hasAttribute("disabled"))
10035
+ return false;
10036
+ if (includeNegativeTabIndex)
10037
+ return true;
10038
+ return node2.getAttribute("tabindex") !== "-1";
10039
+ });
10040
+ return focusables;
10041
+ };
10042
+ const getFocusableNodesWithKeyboardNav = (nodes) => {
10043
+ return nodes.filter((node) => {
10044
+ if (node.tagName === "INPUT") {
10045
+ return node.type !== "checkbox" && node.type !== "radio";
10046
+ }
10047
+ return false;
10048
+ });
10049
+ };
10050
+ const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
10051
+ const trappedRef = React.useRef(null);
10052
+ React.useEffect(() => {
10053
+ let currentFocus = null;
10054
+ if (restoreFocus) {
10055
+ currentFocus = document.activeElement;
10056
+ }
10057
+ return () => {
10058
+ if (currentFocus) {
10059
+ currentFocus.focus();
10060
+ }
10061
+ };
10062
+ }, [restoreFocus]);
10063
+ React.useEffect(() => {
10064
+ if (!trappedRef.current || skipAutoFocus)
10065
+ return;
10066
+ const focusableChildren = getFocusableNodes(trappedRef.current);
10067
+ if (focusableChildren.length > 0) {
10068
+ const firstElement = focusableChildren[0];
10069
+ firstElement.focus();
10070
+ } else {
10071
+ console.warn(
10072
+ "[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
10073
+ );
10074
+ }
10075
+ }, [skipAutoFocus]);
10076
+ const handleKeyDown = (e) => {
10077
+ if (e.key === KeyboardKeys.ESCAPE && onEscape) {
10078
+ onEscape();
10079
+ return;
10080
+ }
10081
+ if (e.key !== KeyboardKeys.TAB)
10082
+ return;
10083
+ const focusableChildren = getFocusableNodes(trappedRef.current);
10084
+ if (focusableChildren.length > 0) {
10085
+ const firstElement = focusableChildren[0];
10086
+ const lastElement = focusableChildren[focusableChildren.length - 1];
10087
+ if (e.shiftKey) {
10088
+ if (firstElement === document.activeElement) {
10089
+ e.preventDefault();
10090
+ lastElement.focus();
10091
+ }
10092
+ } else if (lastElement === document.activeElement) {
10093
+ e.preventDefault();
10094
+ firstElement.focus();
10095
+ }
10096
+ }
10097
+ };
10098
+ return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
9950
10099
  };
9951
- const GridWrapper = styled(Box)`
10100
+ const Root$3 = forwardRef((props, forwardedRef) => {
10101
+ const { gap = 0, gridCols = 12, ...rest } = props;
10102
+ return /* @__PURE__ */ jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
10103
+ });
10104
+ const Wrapper$1 = styled(Box)`
9952
10105
  display: grid;
9953
10106
  grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
9954
10107
  ${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
9955
10108
  `;
9956
- const GridItemImpl = ({ col, s, xs, ...props }) => /* @__PURE__ */ jsx(GridItem, { $col: col, $s: s, $xs: xs, ...props });
9957
- const GridItem = styled(Box)`
10109
+ const ItemImpl = forwardRef(
10110
+ ({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
10111
+ );
10112
+ const Item$1 = styled(Box)`
9958
10113
  grid-column: span ${({ $col }) => $col ?? 1};
9959
10114
  max-width: 100%;
9960
10115
 
@@ -9966,6 +10121,11 @@ const GridItem = styled(Box)`
9966
10121
  grid-column: span ${({ $xs }) => $xs};
9967
10122
  }
9968
10123
  `;
10124
+ const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10125
+ __proto__: null,
10126
+ Item: ItemImpl,
10127
+ Root: Root$3
10128
+ }, Symbol.toStringTag, { value: "Module" }));
9969
10129
  const VARIANT_DEFAULT = "tertiary";
9970
10130
  const VARIANT_SECONDARY = "secondary";
9971
10131
  const SIZES = ["S", "M", "L"];
@@ -10041,20 +10201,22 @@ const IconButtonWrapper = styled(BaseButton)`
10041
10201
  }
10042
10202
  `;
10043
10203
  const IconButtonGroup = styled(Flex)`
10044
- & span:first-child button {
10045
- border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
10204
+ & ${IconButtonWrapper}:first-child {
10046
10205
  border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
10047
10206
  }
10048
10207
 
10049
- & span:last-child button {
10208
+ & ${IconButtonWrapper}:last-child {
10050
10209
  border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
10051
10210
  }
10052
10211
 
10053
10212
  & ${IconButtonWrapper} {
10054
10213
  border-radius: 0;
10055
- border-left: none;
10056
10214
  color: ${({ theme }) => theme.colors.neutral700};
10057
10215
 
10216
+ & + ${IconButtonWrapper} {
10217
+ border-left: none;
10218
+ }
10219
+
10058
10220
  &:hover {
10059
10221
  background-color: ${({ theme }) => theme.colors.neutral100};
10060
10222
  color: ${({ theme }) => theme.colors.neutral800};
@@ -10246,71 +10408,6 @@ const JSONInputContainer = styled(Flex)`
10246
10408
  background-color: #4a4a6a;
10247
10409
  }
10248
10410
  `;
10249
- const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
10250
- const isValidFocusedElement = () => {
10251
- const focused = document.activeElement;
10252
- if (!focused) {
10253
- return false;
10254
- }
10255
- if (tagName) {
10256
- return focused.tagName.toLowerCase() === tagName;
10257
- }
10258
- return focused.hasAttribute(attributeName);
10259
- };
10260
- const queryElement = (parentEl) => {
10261
- if (tagName) {
10262
- return parentEl.querySelectorAll(tagName);
10263
- }
10264
- return parentEl.querySelectorAll(`[${attributeName}]`);
10265
- };
10266
- const handleKeyDown = (e) => {
10267
- switch (e.key) {
10268
- case KeyboardKeys.RIGHT:
10269
- case KeyboardKeys.DOWN: {
10270
- if (isValidFocusedElement()) {
10271
- e.preventDefault();
10272
- const focused = document.activeElement;
10273
- const allElements = [...queryElement(e.currentTarget)];
10274
- const focusedIndex = allElements.findIndex((node) => node === focused);
10275
- const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
10276
- allElements[nextIndex].focus();
10277
- }
10278
- break;
10279
- }
10280
- case KeyboardKeys.LEFT:
10281
- case KeyboardKeys.UP: {
10282
- if (isValidFocusedElement()) {
10283
- e.preventDefault();
10284
- const focused = document.activeElement;
10285
- const allElements = [...queryElement(e.currentTarget)];
10286
- const focusedIndex = allElements.findIndex((node) => node === focused);
10287
- const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
10288
- allElements[nextIndex].focus();
10289
- }
10290
- break;
10291
- }
10292
- case KeyboardKeys.HOME: {
10293
- if (isValidFocusedElement()) {
10294
- e.preventDefault();
10295
- const allElements = queryElement(e.currentTarget);
10296
- const focusElement = allElements.item(0);
10297
- focusElement.focus();
10298
- }
10299
- break;
10300
- }
10301
- case KeyboardKeys.END: {
10302
- if (isValidFocusedElement()) {
10303
- e.preventDefault();
10304
- const allElements = queryElement(e.currentTarget);
10305
- const focusElement = allElements.item(allElements.length - 1);
10306
- focusElement.focus();
10307
- }
10308
- break;
10309
- }
10310
- }
10311
- };
10312
- return /* @__PURE__ */ jsx(Box, { onKeyDown: handleKeyDown, ...props });
10313
- };
10314
10411
  const LinkButton = forwardRef(
10315
10412
  ({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
10316
10413
  const paddingX = size === "S" ? 2 : "10px";
@@ -10403,59 +10500,192 @@ const SkipToContent = ({ children }) => {
10403
10500
  }
10404
10501
  );
10405
10502
  };
10406
- const ModalContext = React.createContext(() => {
10407
- });
10408
- const useModal = () => React.useContext(ModalContext);
10409
- const ModalWrapper = styled(Flex)`
10410
- background: ${({ theme }) => `${theme.colors.neutral800}1F`};
10411
- inset: 0;
10503
+ const ScrollAreaImpl$1 = React.forwardRef(
10504
+ ({ children, viewportRef, ...restProps }, forwardedRef) => {
10505
+ return /* @__PURE__ */ jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
10506
+ /* @__PURE__ */ jsx(ScrollAreaViewport, { ref: viewportRef, children }),
10507
+ /* @__PURE__ */ jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(Thumb, {}) }),
10508
+ /* @__PURE__ */ jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsx(Thumb, {}) })
10509
+ ] });
10510
+ }
10511
+ );
10512
+ const ScrollAreaRoot = styled(ScrollArea.Root)`
10513
+ width: 100%;
10514
+ height: 100%;
10515
+ overflow: hidden;
10516
+ display: flex;
10412
10517
  `;
10413
- const ModalLayout = ({ onClose, labelledBy, ...props }) => {
10414
- useLockScroll(true);
10415
- return /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(ModalContext.Provider, { value: onClose, children: /* @__PURE__ */ jsx(ModalWrapper, { justifyContent: "center", paddingLeft: 8, paddingRight: 8, position: "fixed", zIndex: "modal", children: /* @__PURE__ */ jsx(FocusTrap, { children: /* @__PURE__ */ jsx(DismissibleLayer, { onEscapeKeyDown: onClose, onPointerDownOutside: onClose, children: /* @__PURE__ */ jsx(
10416
- Box,
10417
- {
10418
- "aria-labelledby": labelledBy,
10419
- "aria-modal": true,
10420
- onClick: (e) => e.stopPropagation(),
10421
- background: "neutral0",
10422
- hasRadius: true,
10423
- role: "dialog",
10424
- shadow: "popupShadow",
10425
- width: "83rem",
10426
- ...props
10427
- }
10428
- ) }) }) }) }) });
10429
- };
10430
- const ModalHeaderWrapper = styled(Box)`
10431
- border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
10432
- border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
10518
+ const ScrollAreaViewport = styled(ScrollArea.Viewport)`
10519
+ min-width: 100%;
10520
+ padding-inline-end: 4px;
10433
10521
  `;
10434
- const ModalHeader = ({ children, closeLabel = "Close the modal" }) => {
10435
- const onClose = useModal();
10436
- return /* @__PURE__ */ jsx(ModalHeaderWrapper, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
10437
- children,
10438
- /* @__PURE__ */ jsx(IconButton, { onClick: onClose, label: closeLabel, withTooltip: false, children: /* @__PURE__ */ jsx(Cross, {}) })
10439
- ] }) });
10440
- };
10441
- const ModalFooterWrapper = styled(Box)`
10442
- border-radius: 0 0 ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius};
10443
- border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
10522
+ const Scrollbar = styled(ScrollArea.Scrollbar)`
10523
+ display: flex;
10524
+ /* ensures no selection */
10525
+ user-select: none;
10526
+ /* disable browser handling of all panning and zooming gestures on touch devices */
10527
+ touch-action: none;
10528
+
10529
+ &[data-orientation='vertical'] {
10530
+ width: 0.4rem;
10531
+ }
10532
+
10533
+ &[data-orientation='horizontal'] {
10534
+ flex-direction: column;
10535
+ height: 0.4rem;
10536
+ }
10444
10537
  `;
10445
- const ModalFooter = ({ startActions, endActions }) => {
10446
- return /* @__PURE__ */ jsx(ModalFooterWrapper, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
10447
- /* @__PURE__ */ jsx(Flex, { gap: 2, children: startActions }),
10448
- /* @__PURE__ */ jsx(Flex, { gap: 2, children: endActions })
10449
- ] }) });
10450
- };
10451
- const ModalBodyWrapper = styled(Box)`
10452
- overflow: auto;
10453
- max-height: 60vh;
10538
+ const Thumb = styled(ScrollArea.Thumb)`
10539
+ position: relative;
10540
+ flex: 1;
10541
+ background-color: ${(props) => props.theme.colors.neutral150};
10542
+ border-radius: var(--scrollbar-size);
10543
+
10544
+ /* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
10545
+ &::before {
10546
+ content: '';
10547
+ position: absolute;
10548
+ top: 50%;
10549
+ left: 50%;
10550
+ transform: translate(-50%, -50%);
10551
+ width: 100%;
10552
+ height: 100%;
10553
+ min-width: 44px;
10554
+ min-height: 44px;
10555
+ }
10454
10556
  `;
10455
- const ModalBody = (props) => {
10456
- return /* @__PURE__ */ jsx(ModalBodyWrapper, { padding: 7, ...props });
10457
- };
10458
- const INITIAL_VALUE = "";
10557
+ const Root$2 = Dialog$1.Root;
10558
+ const Trigger$2 = React.forwardRef((props, forwardedRef) => {
10559
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
10560
+ });
10561
+ const Content$2 = React.forwardRef((props, forwardedRef) => {
10562
+ return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [
10563
+ /* @__PURE__ */ jsx(Overlay, {}),
10564
+ /* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props })
10565
+ ] });
10566
+ });
10567
+ const Overlay = styled(Dialog$1.Overlay)`
10568
+ background-color: ${(props) => props.theme.colors.neutral800};
10569
+ position: fixed;
10570
+ inset: 0;
10571
+ z-index: ${(props) => props.theme.zIndices.overlay};
10572
+ opacity: 0.2;
10573
+
10574
+ @media (prefers-reduced-motion: no-preference) {
10575
+ animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
10576
+ ${(props) => props.theme.motion.easings.authenticMotion};
10577
+ }
10578
+ `;
10579
+ const ContentImpl = styled(Dialog$1.Content)`
10580
+ max-width: 83rem;
10581
+ max-height: 80vh;
10582
+ height: min-content;
10583
+ width: 60%;
10584
+ overflow: hidden;
10585
+ margin: 0 auto;
10586
+ display: flex;
10587
+ flex-direction: column;
10588
+
10589
+ position: fixed;
10590
+ top: 50%;
10591
+ left: 50%;
10592
+ transform: translate(-50%, -50%);
10593
+
10594
+ border-radius: ${(props) => props.theme.borderRadius};
10595
+ background-color: ${(props) => props.theme.colors.neutral0};
10596
+ box-shadow: ${(props) => props.theme.shadows.popupShadow};
10597
+ z-index: ${(props) => props.theme.zIndices.modal};
10598
+
10599
+ @media (prefers-reduced-motion: no-preference) {
10600
+ &[data-state='open'] {
10601
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
10602
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
10603
+ animation-name: ${ANIMATIONS.modalPopIn};
10604
+ }
10605
+
10606
+ &[data-state='closed'] {
10607
+ animation-duration: ${(props) => props.theme.motion.timings["120"]};
10608
+ animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
10609
+ animation-name: ${ANIMATIONS.modalPopOut};
10610
+ }
10611
+ }
10612
+ `;
10613
+ const Close = React.forwardRef((props, forwardedRef) => {
10614
+ return /* @__PURE__ */ jsx(Dialog$1.Close, { ...props, asChild: true, ref: forwardedRef });
10615
+ });
10616
+ const Header = React.forwardRef(
10617
+ ({ children, closeLabel = "Close modal", ...restProps }, forwardedRef) => {
10618
+ return /* @__PURE__ */ jsxs(
10619
+ Head,
10620
+ {
10621
+ ref: forwardedRef,
10622
+ padding: 4,
10623
+ paddingLeft: 5,
10624
+ paddingRight: 5,
10625
+ background: "neutral100",
10626
+ justifyContent: "space-between",
10627
+ ...restProps,
10628
+ tag: "header",
10629
+ children: [
10630
+ children,
10631
+ /* @__PURE__ */ jsx(Close, { children: /* @__PURE__ */ jsx(IconButton, { withTooltip: false, label: closeLabel, children: /* @__PURE__ */ jsx(Cross, {}) }) })
10632
+ ]
10633
+ }
10634
+ );
10635
+ }
10636
+ );
10637
+ const Head = styled(Flex)`
10638
+ border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
10639
+ `;
10640
+ const Title = React.forwardRef((props, forwardedRef) => {
10641
+ return /* @__PURE__ */ jsx(Dialog$1.Title, { asChild: true, children: /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "bold", ref: forwardedRef, ...props }) });
10642
+ });
10643
+ const Body = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
10644
+ return /* @__PURE__ */ jsx(BodyScroll, { ref: forwardedRef, ...restProps, children });
10645
+ });
10646
+ const BodyScroll = styled(ScrollAreaImpl$1)`
10647
+ padding-inline: ${(props) => props.theme.spaces[8]};
10648
+
10649
+ & > div {
10650
+ padding-block: ${(props) => props.theme.spaces[8]};
10651
+
10652
+ & > div {
10653
+ // the scroll area component applies a display: table to the child, which we don't want.
10654
+ display: block !important;
10655
+ }
10656
+ }
10657
+ `;
10658
+ const Footer = React.forwardRef((props, forwardedRef) => {
10659
+ return /* @__PURE__ */ jsx(
10660
+ Foot,
10661
+ {
10662
+ ref: forwardedRef,
10663
+ padding: 4,
10664
+ paddingLeft: 5,
10665
+ paddingRight: 5,
10666
+ background: "neutral100",
10667
+ justifyContent: "space-between",
10668
+ ...props,
10669
+ tag: "footer"
10670
+ }
10671
+ );
10672
+ });
10673
+ const Foot = styled(Flex)`
10674
+ border-top: solid 1px ${(props) => props.theme.colors.neutral150};
10675
+ flex: 1;
10676
+ `;
10677
+ const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10678
+ __proto__: null,
10679
+ Body,
10680
+ Close,
10681
+ Content: Content$2,
10682
+ Footer,
10683
+ Header,
10684
+ Root: Root$2,
10685
+ Title,
10686
+ Trigger: Trigger$2
10687
+ }, Symbol.toStringTag, { value: "Module" }));
10688
+ const INITIAL_VALUE = "";
10459
10689
  const NumberInput = React.forwardRef(
10460
10690
  ({ startAction, locale: defaultLocale, onValueChange, value, step = 1, disabled = false, ...props }, ref) => {
10461
10691
  const designContext = useDesignSystem("NumberInput");
@@ -10578,6 +10808,37 @@ const ArrowButton = styled.button`
10578
10808
  transform: ${({ $reverse }) => $reverse ? "rotateX(180deg)" : void 0};
10579
10809
  }
10580
10810
  `;
10811
+ function useControllableState({
10812
+ prop,
10813
+ defaultProp,
10814
+ onChange = () => {
10815
+ }
10816
+ }) {
10817
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
10818
+ defaultProp,
10819
+ onChange
10820
+ });
10821
+ const isControlled = prop !== void 0;
10822
+ const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
10823
+ const value = isControlled ? propValue : uncontrolledProp;
10824
+ const handleChange = useCallbackRef(onChange);
10825
+ const setValue = React.useCallback(
10826
+ (nextValue) => {
10827
+ if (isControlled) {
10828
+ const setter = nextValue;
10829
+ const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
10830
+ if (value2 !== propValue) {
10831
+ handleChange(value2);
10832
+ setUncontrolledProp(nextValue);
10833
+ }
10834
+ } else {
10835
+ setUncontrolledProp(nextValue);
10836
+ }
10837
+ },
10838
+ [isControlled, propValue, setUncontrolledProp, handleChange]
10839
+ );
10840
+ return [value, setValue];
10841
+ }
10581
10842
  const PaginationContext = React.createContext({ activePage: 1, pageCount: 1 });
10582
10843
  const usePagination = () => React.useContext(PaginationContext);
10583
10844
  const Pagination = ({ children, label = "Pagination", activePage, pageCount }) => {
@@ -10655,133 +10916,48 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxs(Box, { ...props, c
10655
10916
  /* @__PURE__ */ jsx(VisuallyHidden, { children }),
10656
10917
  /* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
10657
10918
  ] });
10658
- const POPOVER_PLACEMENTS = [
10659
- "top",
10660
- "top-start",
10661
- "top-end",
10662
- "right",
10663
- "right-start",
10664
- "right-end",
10665
- "bottom",
10666
- "bottom-start",
10667
- "bottom-end",
10668
- "left",
10669
- "left-start",
10670
- "left-end"
10671
- ];
10672
- const PopoverWrapper = styled(Box)`
10919
+ const Root$1 = Popover$1.Root;
10920
+ const Trigger$1 = React.forwardRef((props, forwardedRef) => {
10921
+ return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
10922
+ });
10923
+ const Content$1 = React.forwardRef((props, forwardedRef) => {
10924
+ return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(PopoverContent, { sideOffset: 4, side: "bottom", align: "start", ...props, ref: forwardedRef }) });
10925
+ });
10926
+ const PopoverContent = styled(Popover$1.Content)`
10673
10927
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
10674
10928
  z-index: ${({ theme }) => theme.zIndices.popover};
10929
+ background-color: ${(props) => props.theme.colors.neutral0};
10675
10930
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
10676
- `;
10677
- const Content = React.forwardRef(
10678
- ({
10679
- source,
10680
- children,
10681
- spacing = 0,
10682
- fullWidth = false,
10683
- placement = "bottom-start",
10684
- centered = false,
10685
- onEscapeKeyDown,
10686
- onPointerDownOutside,
10687
- onDismiss,
10688
- onFocusOutside,
10689
- ...props
10690
- }, forwardedRef) => {
10691
- const [content, setContent] = React.useState(null);
10692
- const [width, setWidth] = React.useState(void 0);
10693
- const isRightClickOutsideRef = React.useRef(false);
10694
- const { x, y, refs, strategy } = useFloating({
10695
- strategy: "fixed",
10696
- placement: centered ? "bottom" : placement,
10697
- middleware: [
10698
- offset({
10699
- mainAxis: spacing
10700
- }),
10701
- shift(),
10702
- flip()
10703
- ],
10704
- elements: {
10705
- reference: source.current
10706
- },
10707
- whileElementsMounted: autoUpdate
10708
- });
10709
- React.useLayoutEffect(() => {
10710
- if (fullWidth) {
10711
- setWidth(source.current.offsetWidth);
10931
+
10932
+ @media (prefers-reduced-motion: no-preference) {
10933
+ animation-duration: ${(props) => props.theme.motion.timings["200"]};
10934
+
10935
+ &[data-state='open'] {
10936
+ animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
10937
+
10938
+ &[data-side='top'] {
10939
+ animation-name: ${ANIMATIONS.slideDownIn};
10712
10940
  }
10713
- }, [fullWidth, source]);
10714
- React.useEffect(() => {
10715
- if (content)
10716
- return hideOthers(content);
10717
- }, [content]);
10718
- const handleDismiss = useCallbackRef(onDismiss);
10719
- React.useEffect(() => {
10720
- const close = () => {
10721
- handleDismiss();
10722
- };
10723
- window.addEventListener("blur", close);
10724
- window.addEventListener("resize", close);
10725
- return () => {
10726
- window.removeEventListener("blur", close);
10727
- window.removeEventListener("resize", close);
10728
- };
10729
- }, [handleDismiss]);
10730
- const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node), refs.setFloating);
10731
- return /* @__PURE__ */ jsx(RemoveScroll, { allowPinchZoom: true, children: /* @__PURE__ */ jsx(
10732
- FocusScope,
10733
- {
10734
- asChild: true,
10735
- loop: true,
10736
- trapped: true,
10737
- onUnmountAutoFocus: (event) => {
10738
- event.preventDefault();
10739
- if (!isRightClickOutsideRef.current)
10740
- source.current?.focus({ preventScroll: true });
10741
- },
10742
- children: /* @__PURE__ */ jsx(
10743
- DismissibleLayer,
10744
- {
10745
- asChild: true,
10746
- onEscapeKeyDown,
10747
- onPointerDownOutside: composeEventHandlers(
10748
- onPointerDownOutside,
10749
- (event) => {
10750
- const originalEvent = event.detail.originalEvent;
10751
- const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
10752
- const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
10753
- isRightClickOutsideRef.current = isRightClick;
10754
- },
10755
- { checkForDefaultPrevented: false }
10756
- ),
10757
- onFocusOutside: composeEventHandlers(onFocusOutside, (event) => event.preventDefault(), {
10758
- checkForDefaultPrevented: false
10759
- }),
10760
- onDismiss,
10761
- children: /* @__PURE__ */ jsx(
10762
- PopoverWrapper,
10763
- {
10764
- ref: composedRefs,
10765
- style: {
10766
- left: x,
10767
- top: y,
10768
- position: strategy,
10769
- width: width || void 0
10770
- },
10771
- hasRadius: true,
10772
- background: "neutral0",
10773
- padding: 1,
10774
- ...props,
10775
- children
10776
- }
10777
- )
10778
- }
10779
- )
10941
+
10942
+ &[data-side='bottom'] {
10943
+ animation-name: ${ANIMATIONS.slideUpIn};
10780
10944
  }
10781
- ) });
10945
+ }
10946
+
10947
+ &[data-state='closed'] {
10948
+ animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
10949
+
10950
+ &[data-side='top'] {
10951
+ animation-name: ${ANIMATIONS.slideDownOut};
10952
+ }
10953
+
10954
+ &[data-side='bottom'] {
10955
+ animation-name: ${ANIMATIONS.slideUpOut};
10956
+ }
10957
+ }
10782
10958
  }
10783
- );
10784
- const Scrolling = ({ children, intersectionId, onReachEnd, ...props }) => {
10959
+ `;
10960
+ const ScrollAreaImpl = ({ children, intersectionId, onReachEnd, ...props }) => {
10785
10961
  const popoverRef = React.useRef(null);
10786
10962
  const generatedIntersectionId = useId();
10787
10963
  useIntersection(popoverRef, onReachEnd ?? (() => {
@@ -10789,62 +10965,20 @@ const Scrolling = ({ children, intersectionId, onReachEnd, ...props }) => {
10789
10965
  selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
10790
10966
  skipWhen: !intersectionId || !onReachEnd
10791
10967
  });
10792
- return /* @__PURE__ */ jsxs(PopoverScrollable, { ref: popoverRef, ...props, children: [
10968
+ return /* @__PURE__ */ jsxs(PopoverScrollArea, { ref: popoverRef, ...props, children: [
10793
10969
  children,
10794
10970
  intersectionId && onReachEnd && /* @__PURE__ */ jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
10795
10971
  ] });
10796
10972
  };
10797
- const PopoverScrollable = styled(Box)`
10798
- max-height: 20rem;
10799
- overflow-y: auto;
10800
- overflow-x: hidden;
10801
-
10802
- &::-webkit-scrollbar {
10803
- -webkit-appearance: none;
10804
- width: 4px;
10805
- }
10806
-
10807
- &::-webkit-scrollbar-track {
10808
- background: ${({ theme }) => theme.colors.neutral0};
10809
- }
10810
-
10811
- &::-webkit-scrollbar-thumb {
10812
- background: ${({ theme }) => theme.colors.neutral150};
10813
- border-radius: ${({ theme }) => theme.borderRadius};
10814
- margin-right: 10px;
10815
- }
10973
+ const PopoverScrollArea = styled(ScrollAreaImpl$1)`
10974
+ height: 20rem;
10816
10975
  `;
10817
- const Popover = ({
10818
- children,
10819
- source,
10820
- spacing,
10821
- fullWidth,
10822
- placement,
10823
- centered,
10824
- onEscapeKeyDown,
10825
- onPointerDownOutside,
10826
- onDismiss,
10827
- ...restProps
10828
- }) => {
10829
- return /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(
10830
- Content,
10831
- {
10832
- source,
10833
- spacing,
10834
- fullWidth,
10835
- placement,
10836
- centered,
10837
- onEscapeKeyDown,
10838
- onPointerDownOutside,
10839
- onDismiss,
10840
- children: /* @__PURE__ */ jsx(Scrolling, { ...restProps, children })
10841
- }
10842
- ) });
10843
- };
10844
- const primitives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10976
+ const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10845
10977
  __proto__: null,
10846
- Content,
10847
- Scrolling
10978
+ Content: Content$1,
10979
+ Root: Root$1,
10980
+ ScrollArea: ScrollAreaImpl,
10981
+ Trigger: Trigger$1
10848
10982
  }, Symbol.toStringTag, { value: "Module" }));
10849
10983
  const ProgressbarBase = styled(Box)`
10850
10984
  &:before {
@@ -10876,12 +11010,85 @@ const ProgressBar = ({ min = 0, max = 100, value = 0, children, size = "M", ...p
10876
11010
  }
10877
11011
  );
10878
11012
  };
10879
- const Radio = ({ children, ...props }) => {
10880
- return /* @__PURE__ */ jsxs(Flex, { alignItems: "center", tag: "label", gap: 2, children: [
10881
- /* @__PURE__ */ jsx(BaseRadio, { ...props }),
10882
- /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children })
11013
+ const Group = React.forwardRef((props, forwardedRef) => {
11014
+ return /* @__PURE__ */ jsx(RadioGroupRoot, { ref: forwardedRef, ...props });
11015
+ });
11016
+ const RadioGroupRoot = styled(RadioGroup.Root)`
11017
+ display: flex;
11018
+ flex-direction: column;
11019
+ gap: ${(props) => props.theme.spaces[3]};
11020
+ `;
11021
+ const Item = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
11022
+ const id = useId(idProp);
11023
+ return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
11024
+ /* @__PURE__ */ jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsx(RadioGroupIndicator, {}) }),
11025
+ /* @__PURE__ */ jsx(Typography, { tag: "label", htmlFor: id, children })
10883
11026
  ] });
10884
- };
11027
+ });
11028
+ const RadioGroupItem = styled(RadioGroup.Item)`
11029
+ background: ${(props) => props.theme.colors.neutral0};
11030
+ width: 2rem;
11031
+ height: 2rem;
11032
+ flex: 0 0 2rem;
11033
+ border-radius: 50%;
11034
+ border: 1px solid ${(props) => props.theme.colors.neutral300};
11035
+ position: relative;
11036
+ z-index: 0;
11037
+
11038
+ @media (prefers-reduced-motion: no-preference) {
11039
+ transition: border-color ${(props) => props.theme.motion.timings["120"]}
11040
+ ${(props) => props.theme.motion.easings.easeOutQuad};
11041
+ }
11042
+
11043
+ &[data-state='checked'] {
11044
+ border: 1px solid ${(props) => props.theme.colors.primary600};
11045
+ }
11046
+
11047
+ &[data-disabled] {
11048
+ background-color: ${(props) => props.theme.colors.neutral200};
11049
+ }
11050
+
11051
+ /* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
11052
+ &::before {
11053
+ content: '';
11054
+ position: absolute;
11055
+ top: 50%;
11056
+ left: 50%;
11057
+ transform: translate(-50%, -50%);
11058
+ width: 100%;
11059
+ height: 100%;
11060
+ min-width: 44px;
11061
+ min-height: 44px;
11062
+ }
11063
+ `;
11064
+ const RadioGroupIndicator = styled(RadioGroup.Indicator)`
11065
+ display: flex;
11066
+ align-items: center;
11067
+ justify-content: center;
11068
+ width: 100%;
11069
+ height: 100%;
11070
+ position: relative;
11071
+
11072
+ &[data-state='checked'] {
11073
+ @media (prefers-reduced-motion: no-preference) {
11074
+ animation: ${ANIMATIONS.popIn} ${(props) => props.theme.motion.timings["200"]};
11075
+ }
11076
+ }
11077
+
11078
+ &::after {
11079
+ content: '';
11080
+ display: block;
11081
+ width: 1rem;
11082
+ height: 1rem;
11083
+ border-radius: 50%;
11084
+ background: ${(props) => props.theme.colors.primary600};
11085
+ }
11086
+ `;
11087
+ const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11088
+ __proto__: null,
11089
+ Group,
11090
+ Item
11091
+ }, Symbol.toStringTag, { value: "Module" }));
10885
11092
  const focusFocusable = (node) => {
10886
11093
  const nextNode = node.querySelector('[tabindex="0"]');
10887
11094
  if (nextNode) {
@@ -11024,7 +11231,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
11024
11231
  }
11025
11232
  };
11026
11233
  const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
11027
- React.useLayoutEffect(() => {
11234
+ useIsomorphicLayoutEffect(() => {
11028
11235
  const focusableNodes = getFocusableNodes(tdRef.current, true);
11029
11236
  if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
11030
11237
  tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
@@ -11047,7 +11254,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
11047
11254
  }
11048
11255
  setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
11049
11256
  }, [coords, setTableValues]);
11050
- React.useLayoutEffect(() => {
11257
+ useIsomorphicLayoutEffect(() => {
11051
11258
  const cell = tdRef.current;
11052
11259
  const focusableNodes = getFocusableNodes(cell, true);
11053
11260
  focusableNodes.forEach((node) => {
@@ -11131,7 +11338,7 @@ const Searchbar = React.forwardRef(
11131
11338
  inputRef.current.focus();
11132
11339
  };
11133
11340
  const actualRef = composeRefs(ref, inputRef);
11134
- return /* @__PURE__ */ jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxs(Root$1, { name, children: [
11341
+ return /* @__PURE__ */ jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxs(Root$6, { name, children: [
11135
11342
  /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(Label, { children }) }),
11136
11343
  /* @__PURE__ */ jsx(
11137
11344
  SearchbarInput,
@@ -11139,7 +11346,7 @@ const Searchbar = React.forwardRef(
11139
11346
  ref: actualRef,
11140
11347
  value,
11141
11348
  startAction: /* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": true }),
11142
- endAction: isCompleting ? /* @__PURE__ */ jsx(Action, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsx(CloseIcon, {}) }) : void 0,
11349
+ endAction: isCompleting ? /* @__PURE__ */ jsx(Action$1, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsx(CloseIcon, {}) }) : void 0,
11143
11350
  ...props
11144
11351
  }
11145
11352
  )
@@ -11268,7 +11475,7 @@ const MultiSelect = React.forwardRef(
11268
11475
  ariaDescription = `${id}-hint`;
11269
11476
  }
11270
11477
  return /* @__PURE__ */ jsxs(
11271
- Root,
11478
+ Root$4,
11272
11479
  {
11273
11480
  onOpenChange: handleOpenChange,
11274
11481
  disabled,
@@ -11279,7 +11486,7 @@ const MultiSelect = React.forwardRef(
11279
11486
  multi: true,
11280
11487
  children: [
11281
11488
  /* @__PURE__ */ jsx(
11282
- Trigger,
11489
+ Trigger$3,
11283
11490
  {
11284
11491
  ref: forwardedRef,
11285
11492
  id,
@@ -11295,7 +11502,7 @@ const MultiSelect = React.forwardRef(
11295
11502
  children: /* @__PURE__ */ jsx(Value, { placeholder, textColor: value?.length ? "neutral800" : "neutral600", children: value?.length ? withTags ? renderTags : customizeContent ? customizeContent(value) : void 0 : void 0 })
11296
11503
  }
11297
11504
  ),
11298
- /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$1, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxs(Viewport, { ref: viewportRef, children: [
11505
+ /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxs(Viewport, { ref: viewportRef, children: [
11299
11506
  children,
11300
11507
  /* @__PURE__ */ jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
11301
11508
  ] }) }) })
@@ -11306,74 +11513,20 @@ const MultiSelect = React.forwardRef(
11306
11513
  );
11307
11514
  const MultiSelectOption = React.forwardRef(
11308
11515
  ({ value, children, startIcon, ...restProps }, ref) => {
11309
- return /* @__PURE__ */ jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
11516
+ return /* @__PURE__ */ jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
11310
11517
  startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
11311
- /* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(
11312
- CheckMark,
11313
- {
11314
- hasRadius: true,
11315
- overflow: "hidden",
11316
- position: "relative",
11317
- $indeterminate: isIntermediate,
11318
- $selected: isSelected,
11319
- zIndex: 1,
11320
- height: "18px",
11321
- width: "18px"
11322
- }
11323
- ) }),
11324
- /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: /* @__PURE__ */ jsx(ItemText, { children }) })
11518
+ /* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
11519
+ /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(ItemText, { children }) })
11325
11520
  ] });
11326
11521
  }
11327
11522
  );
11328
- const CheckMark = styled(Box)`
11329
- border: 1px solid
11330
- ${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral300};
11331
- background-color: ${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral0};
11332
-
11333
- ${({ theme, $indeterminate }) => $indeterminate && css`
11334
- &::after {
11335
- content: '';
11336
- display: block;
11337
- position: relative;
11338
- color: white;
11339
- height: 2px;
11340
- width: 10px;
11341
- background-color: ${theme.colors.neutral0};
11342
- left: 50%;
11343
- top: 50%;
11344
- transform: translateX(-50%) translateY(-50%);
11345
- }
11346
- `}
11347
-
11348
- ${({ $selected }) => $selected && css`
11349
- &::after {
11350
- content: '';
11351
- background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
11352
- width: 100%;
11353
- height: 100%;
11354
- position: absolute;
11355
- }
11356
- `}
11357
- `;
11358
11523
  const MultiSelectGroup = React.forwardRef(
11359
11524
  ({ children, label, startIcon, values = [], ...restProps }, ref) => {
11360
- return /* @__PURE__ */ jsxs(Group, { ref, children: [
11361
- /* @__PURE__ */ jsxs(Item, { value: values, ...restProps, children: [
11525
+ return /* @__PURE__ */ jsxs(Group$1, { ref, children: [
11526
+ /* @__PURE__ */ jsxs(Item$2, { value: values, ...restProps, children: [
11362
11527
  startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
11363
- /* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(
11364
- CheckMark,
11365
- {
11366
- hasRadius: true,
11367
- overflow: "hidden",
11368
- position: "relative",
11369
- $indeterminate: isIntermediate,
11370
- $selected: isSelected,
11371
- zIndex: 1,
11372
- height: "18px",
11373
- width: "18px"
11374
- }
11375
- ) }),
11376
- /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: label })
11528
+ /* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
11529
+ /* @__PURE__ */ jsx(Typography, { children: label })
11377
11530
  ] }),
11378
11531
  children
11379
11532
  ] });
@@ -11438,13 +11591,6 @@ const SubNavWrapper = styled(Box)`
11438
11591
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
11439
11592
  z-index: 1;
11440
11593
  `;
11441
- const usePrevious = (value) => {
11442
- const ref = React.useRef();
11443
- React.useEffect(() => {
11444
- ref.current = value;
11445
- });
11446
- return ref.current;
11447
- };
11448
11594
  const CustomDivider = styled(Divider)`
11449
11595
  width: 2.4rem;
11450
11596
  background-color: ${({ theme }) => theme.colors.neutral200};
@@ -11464,7 +11610,7 @@ const SubNavHeader = ({
11464
11610
  id
11465
11611
  }) => {
11466
11612
  const [isSearchOpen, setSearchOpen] = React.useState(false);
11467
- const previousSearchOpenValue = usePrevious(isSearchOpen);
11613
+ const previousSearchOpenValue = usePrev(isSearchOpen);
11468
11614
  const clearButtonId = useId(id);
11469
11615
  const searchRef = React.useRef(void 0);
11470
11616
  const searchButtonRef = React.useRef(void 0);
@@ -11771,275 +11917,136 @@ const SwitchButton = styled.button`
11771
11917
  transform: translateX(1rem);
11772
11918
  }
11773
11919
  `;
11774
- const SimpleTabBox = styled(Box)`
11775
- border-bottom: 2px solid
11776
- ${({ theme, $selected, $hasError }) => {
11777
- if ($selected) {
11778
- if ($hasError) {
11779
- return theme.colors.danger600;
11780
- }
11781
- return theme.colors.primary600;
11920
+ const [TabsProvider, useTabs] = createContext("Tabs");
11921
+ const Root = React.forwardRef(
11922
+ ({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
11923
+ return /* @__PURE__ */ jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsx(TabsRoot, { ref: forwardedRef, ...props }) });
11782
11924
  }
11783
- return "transparent";
11784
- }};
11925
+ );
11926
+ const TabsRoot = styled(Tabs$1.Root)`
11927
+ width: 100%;
11928
+ position: relative;
11785
11929
  `;
11786
- const DefaultTabBox = styled(Box)`
11787
- border-bottom: 1px solid ${({ theme, $selected }) => $selected ? theme.colors.neutral0 : theme.colors.neutral150};
11930
+ const List = React.forwardRef((props, forwardedRef) => {
11931
+ const { variant: variant2 } = useTabs("List");
11932
+ return /* @__PURE__ */ jsx(TabsList, { ref: forwardedRef, ...props, $variant: variant2 });
11933
+ });
11934
+ const TabsList = styled(Tabs$1.List)`
11935
+ display: flex;
11936
+ align-items: ${(props) => props.$variant === "regular" ? "flex-end" : "unset"};
11937
+ position: relative;
11938
+ z-index: 0;
11788
11939
  `;
11789
- const DefaultTabButton = styled.button`
11790
- border: none;
11791
- background: transparent;
11792
- padding: 0;
11793
-
11794
- & + & > ${DefaultTabBox} {
11795
- border-left: 1px solid ${({ theme }) => theme.colors.neutral150};
11940
+ const Trigger = React.forwardRef(
11941
+ ({ children, disabled: disabledProp, ...props }, forwardedRef) => {
11942
+ const { disabled: disabledContext, variant: variant2, hasError } = useTabs("Trigger");
11943
+ const isDisabled = disabledContext === true || disabledContext === props.value || disabledProp;
11944
+ const isErrored = hasError === props.value;
11945
+ return /* @__PURE__ */ jsxs(TabsTrigger, { ref: forwardedRef, ...props, $hasError: isErrored, $variant: variant2, disabled: isDisabled, children: [
11946
+ /* @__PURE__ */ jsx(TriggerTypography, { fontWeight: "bold", variant: variant2 === "simple" ? "sigma" : void 0, children }),
11947
+ variant2 === "simple" ? /* @__PURE__ */ jsx(TabBar, {}) : null
11948
+ ] });
11796
11949
  }
11950
+ );
11951
+ const TabBar = styled.span`
11952
+ display: block;
11953
+ width: 100%;
11954
+ background-color: currentColor;
11955
+ position: absolute;
11956
+ bottom: 0;
11957
+ left: 0;
11958
+ opacity: 0;
11959
+ height: 0.2rem;
11797
11960
 
11798
- ${DefaultTabBox} {
11799
- border-right: ${({ theme, $showRightBorder }) => $showRightBorder ? `1px solid ${theme.colors.neutral150}` : "none"};
11961
+ @media (prefers-reduced-motion: no-preference) {
11962
+ transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
11800
11963
  }
11964
+ `;
11965
+ const TriggerTypography = styled(Typography)``;
11966
+ const TabsTrigger = styled(Tabs$1.Trigger)`
11967
+ position: relative;
11968
+ color: ${(props) => props.$hasError ? props.theme.colors.danger600 : props.theme.colors.neutral600};
11969
+ cursor: pointer;
11970
+ z-index: 0;
11801
11971
 
11802
- // Hack preventing the outline from being overflow by the following tab
11803
- outline-offset: -2px;
11972
+ ${(props) => {
11973
+ if (props.$variant === "simple") {
11974
+ return css`
11975
+ padding-block: ${(props2) => props2.theme.spaces[4]};
11976
+ padding-inline: ${(props2) => props2.theme.spaces[4]};
11804
11977
 
11805
- &[aria-disabled='true'] {
11806
- cursor: not-allowed;
11807
- }
11808
- `;
11809
- const DefaultTabsRow = styled(Flex)`
11810
- & > * {
11811
- flex: 1;
11812
- }
11978
+ & > ${TriggerTypography} {
11979
+ line-height: 1.2rem;
11980
+ }
11813
11981
 
11814
- & ${DefaultTabButton}:first-of-type ${DefaultTabBox} {
11815
- border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 0`};
11982
+ &[data-state='active'] {
11983
+ color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
11984
+
11985
+ & > ${TabBar} {
11986
+ opacity: 1;
11987
+ }
11988
+ }
11989
+ `;
11990
+ } else {
11991
+ return css`
11992
+ padding-block: ${(props2) => props2.theme.spaces[3]};
11993
+ padding-inline: ${(props2) => props2.theme.spaces[3]};
11994
+ flex: 1;
11995
+ background-color: ${(props2) => props2.theme.colors.neutral100};
11996
+ border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral150};
11997
+
11998
+ &:not([data-state='active']) + &:not([data-state='active']) {
11999
+ border-left: solid 1px ${(props2) => props2.theme.colors.neutral150};
12000
+ }
12001
+
12002
+ &[data-state='active'] {
12003
+ padding-block: ${(props2) => props2.theme.spaces[4]};
12004
+ padding-inline: ${(props2) => props2.theme.spaces[4]};
12005
+ color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
12006
+ border-top-right-radius: ${(props2) => props2.theme.borderRadius};
12007
+ border-top-left-radius: ${(props2) => props2.theme.borderRadius};
12008
+ background-color: ${(props2) => props2.theme.colors.neutral0};
12009
+ border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral0};
12010
+ box-shadow: ${props.theme.shadows.tableShadow};
12011
+ z-index: 1;
12012
+ }
12013
+ `;
11816
12014
  }
12015
+ }}
11817
12016
 
11818
- & ${DefaultTabButton}:last-of-type ${DefaultTabBox} {
11819
- border-radius: ${({ theme }) => `0 ${theme.borderRadius} 0 0`};
12017
+ @media (prefers-reduced-motion: no-preference) {
12018
+ transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
11820
12019
  }
11821
12020
 
11822
- & ${DefaultTabButton}[aria-selected="true"] ${DefaultTabBox} {
11823
- border-radius: ${({ theme }) => `${theme.borderRadius} ${theme.borderRadius} 0 0`};
11824
- border-left: none;
11825
- border-right: none;
12021
+ &[data-disabled] {
12022
+ cursor: not-allowed;
12023
+ color: ${(props) => props.theme.colors.neutral400};
11826
12024
  }
11827
12025
  `;
11828
- const TabsContext = React.createContext({
11829
- id: "",
11830
- label: "",
11831
- selectedTabIndex: 0,
11832
- selectTabIndex() {
11833
- throw new Error("TabsContext.selectTabIndex is not implemented.");
11834
- }
12026
+ const Content = React.forwardRef((props, forwardedRef) => {
12027
+ const { variant: variant2 } = useTabs("Content");
12028
+ return /* @__PURE__ */ jsx(TabsContent, { $variant: variant2, ref: forwardedRef, ...props });
11835
12029
  });
11836
- const useTabs = () => React.useContext(TabsContext);
11837
- const useTabsFocus = (selectedTabIndex, onTabChange) => {
11838
- const tabsRef = React.useRef(null);
11839
- const mountedRef = React.useRef(false);
11840
- const handleTabChange = useCallbackRef(onTabChange);
11841
- React.useEffect(() => {
11842
- if (!tabsRef.current)
11843
- return;
11844
- if (mountedRef.current) {
11845
- const nextFocusEl = tabsRef.current.querySelector('[tabindex="0"]');
11846
- if (nextFocusEl) {
11847
- nextFocusEl.focus();
11848
- handleTabChange(selectedTabIndex);
11849
- }
11850
- }
11851
- if (!mountedRef.current) {
11852
- mountedRef.current = true;
11853
- }
11854
- }, [selectedTabIndex, handleTabChange]);
11855
- return tabsRef;
11856
- };
11857
- const TabButton = styled.button`
11858
- &[aria-disabled='true'] {
11859
- cursor: not-allowed;
12030
+ const TabsContent = styled(Tabs$1.Content)`
12031
+ ${(props) => {
12032
+ if (props.$variant === "simple") {
12033
+ return css``;
12034
+ } else {
12035
+ return css`
12036
+ position: relative;
12037
+ z-index: 1;
12038
+ background-color: ${(props2) => props2.theme.colors.neutral0};
12039
+ `;
11860
12040
  }
12041
+ }}
11861
12042
  `;
11862
- const Tabs = ({ children, ...props }) => {
11863
- const { id, selectedTabIndex, selectTabIndex, label, variant: variant2, onTabChange } = useTabs();
11864
- const tabsRef = useTabsFocus(selectedTabIndex, onTabChange);
11865
- const childrenArray = React.Children.toArray(children).map(
11866
- (node, index) => React.cloneElement(node, {
11867
- id: `${id}-${index}`,
11868
- index,
11869
- selectedTabIndex,
11870
- onTabClick: () => selectTabIndex(index),
11871
- variant: variant2
11872
- })
11873
- );
11874
- const handleKeyDown = (e) => {
11875
- const hasAllChildrenDisabled = childrenArray.every((node) => node.props.disabled);
11876
- if (hasAllChildrenDisabled) {
11877
- return;
11878
- }
11879
- switch (e.key) {
11880
- case KeyboardKeys.RIGHT: {
11881
- const nextWantedIndex = selectedTabIndex + 1;
11882
- const findNextIndex = (ref) => {
11883
- const isDisabled = childrenArray[ref].props.disabled;
11884
- if (!isDisabled) {
11885
- return ref;
11886
- }
11887
- if (ref === childrenArray.length - 1) {
11888
- return findNextIndex(0);
11889
- }
11890
- return findNextIndex(ref + 1);
11891
- };
11892
- const nextIndex = findNextIndex(nextWantedIndex >= childrenArray.length ? 0 : nextWantedIndex);
11893
- selectTabIndex(nextIndex);
11894
- break;
11895
- }
11896
- case KeyboardKeys.LEFT: {
11897
- const nextWantedIndex = selectedTabIndex - 1;
11898
- const findNextIndex = (ref) => {
11899
- const isDisabled = childrenArray[ref].props.disabled;
11900
- if (!isDisabled) {
11901
- return ref;
11902
- }
11903
- if (ref === 0) {
11904
- return findNextIndex(childrenArray.length - 1);
11905
- }
11906
- return findNextIndex(ref - 1);
11907
- };
11908
- const nextIndex = findNextIndex(nextWantedIndex < 0 ? childrenArray.length - 1 : nextWantedIndex);
11909
- selectTabIndex(nextIndex);
11910
- break;
11911
- }
11912
- case KeyboardKeys.HOME: {
11913
- const nextIndex = childrenArray.findIndex((node) => !node.props.disabled);
11914
- selectTabIndex(nextIndex);
11915
- break;
11916
- }
11917
- case KeyboardKeys.END: {
11918
- const arrayOfChildrenProps = childrenArray.map((node, index) => ({ isDisabled: node.props.disabled, index }));
11919
- const firstNonDisabledChildren = arrayOfChildrenProps.reverse().find(({ isDisabled }) => !isDisabled);
11920
- if (firstNonDisabledChildren) {
11921
- selectTabIndex(firstNonDisabledChildren.index);
11922
- }
11923
- break;
11924
- }
11925
- }
11926
- };
11927
- if (variant2 === "simple") {
11928
- return /* @__PURE__ */ jsx("div", { ref: tabsRef, role: "tablist", "aria-label": label, onKeyDown: handleKeyDown, ...props, children: childrenArray });
11929
- }
11930
- return /* @__PURE__ */ jsx(
11931
- DefaultTabsRow,
11932
- {
11933
- ref: tabsRef,
11934
- role: "tablist",
11935
- alignItems: "flex-end",
11936
- "aria-label": label,
11937
- onKeyDown: handleKeyDown,
11938
- ...props,
11939
- children: childrenArray
11940
- }
11941
- );
11942
- };
11943
- const Tab = ({
11944
- disabled = false,
11945
- id,
11946
- children,
11947
- variant: variant2,
11948
- hasError = false,
11949
- index,
11950
- selectedTabIndex,
11951
- onTabClick,
11952
- ...props
11953
- }) => {
11954
- const tabId = `${id}-tab`;
11955
- const tabPanelId = `${id}-tabpanel`;
11956
- const selected = index === selectedTabIndex;
11957
- const handleClick = () => {
11958
- if (disabled) {
11959
- return;
11960
- }
11961
- if (onTabClick) {
11962
- onTabClick();
11963
- }
11964
- };
11965
- if (variant2 === "simple") {
11966
- let textColor;
11967
- if (hasError) {
11968
- textColor = "danger600";
11969
- } else if (selected) {
11970
- textColor = "primary600";
11971
- } else if (disabled) {
11972
- textColor = "neutral600";
11973
- } else {
11974
- textColor = "neutral600";
11975
- }
11976
- return /* @__PURE__ */ jsx(
11977
- TabButton,
11978
- {
11979
- id: tabId,
11980
- role: "tab",
11981
- "aria-controls": selected ? tabPanelId : void 0,
11982
- tabIndex: selected ? 0 : -1,
11983
- "aria-selected": selected,
11984
- type: "button",
11985
- onClick: handleClick,
11986
- "aria-disabled": disabled,
11987
- ...props,
11988
- children: /* @__PURE__ */ jsx(SimpleTabBox, { padding: 4, $selected: selected, $hasError: hasError, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor, children }) })
11989
- }
11990
- );
11991
- }
11992
- if (hasError) {
11993
- console.warn('The "hasError" prop is only available for the "simple" variant.');
11994
- }
11995
- const showRightBorder = selectedTabIndex && selectedTabIndex - 1 === index;
11996
- return /* @__PURE__ */ jsx(
11997
- DefaultTabButton,
11998
- {
11999
- id: tabId,
12000
- role: "tab",
12001
- type: "button",
12002
- "aria-controls": selected ? tabPanelId : void 0,
12003
- tabIndex: selected ? 0 : -1,
12004
- "aria-selected": selected,
12005
- onClick: handleClick,
12006
- "aria-disabled": disabled,
12007
- $showRightBorder: Boolean(showRightBorder),
12008
- ...props,
12009
- children: /* @__PURE__ */ jsx(DefaultTabBox, { padding: selected ? 4 : 3, background: selected ? "neutral0" : "neutral100", $selected: selected, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: selected ? "primary700" : "neutral600", children }) })
12010
- }
12011
- );
12012
- };
12013
- const TabPanels = ({ children, ...props }) => {
12014
- const { id, selectedTabIndex } = useTabs();
12015
- const childrenArray = React.Children.toArray(children).map((node, index) => React.cloneElement(node, { id: `${id}-${index}` })).filter((_, index) => index === selectedTabIndex);
12016
- return /* @__PURE__ */ jsx("div", { ...props, children: childrenArray });
12017
- };
12018
- const TabPanel = ({ id, ...props }) => {
12019
- const tabId = `${id}-tab`;
12020
- const tabPanelId = `${id}-tabpanel`;
12021
- return /* @__PURE__ */ jsx("div", { id: tabPanelId, role: "tabpanel", tabIndex: 0, "aria-labelledby": tabId, ...props });
12022
- };
12023
- const TabGroup = React.forwardRef(
12024
- ({ id, initialSelectedTabIndex, label, onTabChange, selectedTabIndex: selectedTabIndexProp, variant: variant2, ...props }, ref) => {
12025
- const tabsId = useId(id);
12026
- const [selectedTabIndex = 0, setSelectedTabIndex] = useControllableState({
12027
- prop: selectedTabIndexProp,
12028
- defaultProp: initialSelectedTabIndex,
12029
- // @ts-expect-error - TODO: fix this.
12030
- onChange: onTabChange
12031
- });
12032
- React.useImperativeHandle(ref, () => ({
12033
- _handlers: { setSelectedTabIndex }
12034
- }));
12035
- const context = React.useMemo(
12036
- () => ({ id: tabsId, selectedTabIndex, selectTabIndex: setSelectedTabIndex, label, variant: variant2, onTabChange }),
12037
- [label, onTabChange, selectedTabIndex, tabsId, variant2, setSelectedTabIndex]
12038
- );
12039
- return /* @__PURE__ */ jsx(TabsContext.Provider, { value: context, children: /* @__PURE__ */ jsx("div", { ...props }) });
12040
- }
12041
- );
12042
- TabGroup.displayName = "TabGroup";
12043
+ const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12044
+ __proto__: null,
12045
+ Content,
12046
+ List,
12047
+ Root,
12048
+ Trigger
12049
+ }, Symbol.toStringTag, { value: "Module" }));
12043
12050
  const TableContainer = styled(Box)`
12044
12051
  overflow: hidden;
12045
12052
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
@@ -12320,7 +12327,7 @@ const Toggle = React.forwardRef(
12320
12327
  onChange,
12321
12328
  ...props
12322
12329
  }, forwardedRef) => {
12323
- const [checked = false, setChecked] = useControllableState({
12330
+ const [checked = false, setChecked] = useControllableState$1({
12324
12331
  prop: checkedProp
12325
12332
  });
12326
12333
  const isFalseyChecked = checked !== null && !checked;
@@ -12434,17 +12441,111 @@ const Input = styled.input`
12434
12441
  z-index: 0;
12435
12442
  width: 100%;
12436
12443
  `;
12444
+ const defaultState = {
12445
+ x: 0,
12446
+ y: 0,
12447
+ width: 0,
12448
+ height: 0,
12449
+ top: 0,
12450
+ left: 0,
12451
+ bottom: 0,
12452
+ right: 0
12453
+ };
12454
+ function useMeasure() {
12455
+ const [element, ref] = useState(null);
12456
+ const [rect, setRect] = useState(defaultState);
12457
+ const observer = useMemo(
12458
+ () => new ResizeObserver((entries) => {
12459
+ if (entries[0]) {
12460
+ const { x, y, width, height, top, left, bottom, right } = entries[0].contentRect;
12461
+ setRect({ x, y, width, height, top, left, bottom, right });
12462
+ }
12463
+ }),
12464
+ []
12465
+ );
12466
+ useIsomorphicLayoutEffect(() => {
12467
+ if (!element)
12468
+ return;
12469
+ observer.observe(element);
12470
+ return () => {
12471
+ observer.disconnect();
12472
+ };
12473
+ }, [element, observer]);
12474
+ return [ref, rect];
12475
+ }
12476
+ const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
12477
+ const isValidFocusedElement = () => {
12478
+ const focused = document.activeElement;
12479
+ if (!focused) {
12480
+ return false;
12481
+ }
12482
+ if (tagName) {
12483
+ return focused.tagName.toLowerCase() === tagName;
12484
+ }
12485
+ return focused.hasAttribute(attributeName);
12486
+ };
12487
+ const queryElement = (parentEl) => {
12488
+ if (tagName) {
12489
+ return parentEl.querySelectorAll(tagName);
12490
+ }
12491
+ return parentEl.querySelectorAll(`[${attributeName}]`);
12492
+ };
12493
+ const handleKeyDown = (e) => {
12494
+ switch (e.key) {
12495
+ case KeyboardKeys.RIGHT:
12496
+ case KeyboardKeys.DOWN: {
12497
+ if (isValidFocusedElement()) {
12498
+ e.preventDefault();
12499
+ const focused = document.activeElement;
12500
+ const allElements = [...queryElement(e.currentTarget)];
12501
+ const focusedIndex = allElements.findIndex((node) => node === focused);
12502
+ const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
12503
+ allElements[nextIndex].focus();
12504
+ }
12505
+ break;
12506
+ }
12507
+ case KeyboardKeys.LEFT:
12508
+ case KeyboardKeys.UP: {
12509
+ if (isValidFocusedElement()) {
12510
+ e.preventDefault();
12511
+ const focused = document.activeElement;
12512
+ const allElements = [...queryElement(e.currentTarget)];
12513
+ const focusedIndex = allElements.findIndex((node) => node === focused);
12514
+ const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
12515
+ allElements[nextIndex].focus();
12516
+ }
12517
+ break;
12518
+ }
12519
+ case KeyboardKeys.HOME: {
12520
+ if (isValidFocusedElement()) {
12521
+ e.preventDefault();
12522
+ const allElements = queryElement(e.currentTarget);
12523
+ const focusElement = allElements.item(0);
12524
+ focusElement.focus();
12525
+ }
12526
+ break;
12527
+ }
12528
+ case KeyboardKeys.END: {
12529
+ if (isValidFocusedElement()) {
12530
+ e.preventDefault();
12531
+ const allElements = queryElement(e.currentTarget);
12532
+ const focusElement = allElements.item(allElements.length - 1);
12533
+ focusElement.focus();
12534
+ }
12535
+ break;
12536
+ }
12537
+ }
12538
+ };
12539
+ return /* @__PURE__ */ jsx(Box, { onKeyDown: handleKeyDown, ...props });
12540
+ };
12437
12541
  export {
12438
12542
  AccessibleIcon,
12439
12543
  Accordion,
12440
12544
  Alert,
12441
12545
  Avatar,
12442
- AvatarGroup,
12443
12546
  Badge,
12444
12547
  BaseButton,
12445
- BaseCheckbox,
12446
12548
  BaseLink,
12447
- BaseRadio,
12448
12549
  Box,
12449
12550
  Breadcrumbs,
12450
12551
  Button,
@@ -12464,7 +12565,7 @@ export {
12464
12565
  CarouselImage,
12465
12566
  CarouselInput,
12466
12567
  CarouselSlide,
12467
- Checkbox,
12568
+ CheckboxImpl as Checkbox,
12468
12569
  Combobox,
12469
12570
  Option as ComboboxOption,
12470
12571
  Crumb,
@@ -12474,8 +12575,6 @@ export {
12474
12575
  DateTimePicker,
12475
12576
  DesignSystemProvider,
12476
12577
  Dialog,
12477
- DialogBody,
12478
- DialogFooter,
12479
12578
  DismissibleLayer,
12480
12579
  Divider,
12481
12580
  Dots,
@@ -12484,10 +12583,8 @@ export {
12484
12583
  Flex,
12485
12584
  FocusTrap,
12486
12585
  Grid,
12487
- GridItemImpl as GridItem,
12488
12586
  IconButton,
12489
12587
  IconButtonGroup,
12490
- Initials,
12491
12588
  JSONInput,
12492
12589
  KeyboardNavigable,
12493
12590
  Link,
@@ -12497,32 +12594,27 @@ export {
12497
12594
  Main,
12498
12595
  Menu,
12499
12596
  MenuItem,
12500
- ModalBody,
12501
- ModalFooter,
12502
- ModalHeader,
12503
- ModalLayout,
12597
+ Modal,
12504
12598
  MultiSelect,
12505
12599
  MultiSelectGroup,
12506
12600
  MultiSelectNested,
12507
12601
  MultiSelectOption,
12508
12602
  NextLink,
12509
12603
  NumberInput,
12510
- POPOVER_PLACEMENTS,
12511
12604
  PageLink,
12512
12605
  Pagination,
12513
12606
  Popover,
12514
- primitives as PopoverPrimitives,
12515
12607
  Portal$1 as Portal,
12516
12608
  PreviousLink,
12517
12609
  ProgressBar,
12518
12610
  Radio,
12519
- RadioGroup,
12520
12611
  RawTable,
12521
12612
  RawTbody,
12522
12613
  RawTd,
12523
12614
  RawTh,
12524
12615
  RawThead,
12525
12616
  RawTr,
12617
+ ScrollAreaImpl$1 as ScrollArea,
12526
12618
  SearchForm,
12527
12619
  Searchbar,
12528
12620
  SimpleMenu,
@@ -12538,10 +12630,6 @@ export {
12538
12630
  SubNavSections,
12539
12631
  Switch,
12540
12632
  TFooter,
12541
- Tab,
12542
- TabGroup,
12543
- TabPanel,
12544
- TabPanels,
12545
12633
  Table,
12546
12634
  Tabs,
12547
12635
  Tag,
@@ -12558,6 +12646,7 @@ export {
12558
12646
  Tr,
12559
12647
  Typography,
12560
12648
  VisuallyHidden,
12649
+ useUncontrolledState as _internaluseUncontrolledState,
12561
12650
  composeEventHandlers2 as composeEventHandlers,
12562
12651
  composeRefs,
12563
12652
  convertUTCDateToCalendarDateTime,
@@ -12565,14 +12654,19 @@ export {
12565
12654
  extendTheme,
12566
12655
  getThemeSize,
12567
12656
  inputFocusStyle,
12657
+ isSSR,
12568
12658
  lightTheme,
12569
12659
  useCallbackRef2 as useCallbackRef,
12570
12660
  useCollator,
12571
12661
  useComposedRefs,
12662
+ useControllableState$1 as useControllableState,
12572
12663
  useDateFormatter,
12573
12664
  useDesignSystem,
12574
12665
  useField,
12575
12666
  useFilter,
12667
+ useId,
12668
+ useIsomorphicLayoutEffect,
12669
+ useMeasure,
12576
12670
  useNotifyAT
12577
12671
  };
12578
12672
  //# sourceMappingURL=index.mjs.map