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

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 (142) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +38 -53
  2. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  3. package/dist/components/Accordion/index.d.ts +1 -6
  4. package/dist/components/Accordion/index.d.ts.map +1 -1
  5. package/dist/components/Badge/Badge.d.ts +8 -3
  6. package/dist/components/Badge/Badge.d.ts.map +1 -1
  7. package/dist/components/BaseCheckbox/BaseCheckbox.d.ts +1 -6
  8. package/dist/components/BaseCheckbox/BaseCheckbox.d.ts.map +1 -1
  9. package/dist/components/BaseRadio/BaseRadio.d.ts.map +1 -1
  10. package/dist/components/BaseRadio/RadioGroup.d.ts +9 -4
  11. package/dist/components/BaseRadio/RadioGroup.d.ts.map +1 -1
  12. package/dist/components/Box/Box.d.ts +5 -5
  13. package/dist/components/Box/Box.d.ts.map +1 -1
  14. package/dist/components/Button/Button.d.ts +3 -3
  15. package/dist/components/Button/Button.d.ts.map +1 -1
  16. package/dist/components/Button/constants.d.ts +2 -2
  17. package/dist/components/Button/constants.d.ts.map +1 -1
  18. package/dist/components/Button/utils.d.ts +5 -5
  19. package/dist/components/Button/utils.d.ts.map +1 -1
  20. package/dist/components/Card/CardAsset.d.ts +6 -3
  21. package/dist/components/Card/CardAsset.d.ts.map +1 -1
  22. package/dist/components/CarouselInput/CarouselActions.d.ts +1 -6
  23. package/dist/components/CarouselInput/CarouselActions.d.ts.map +1 -1
  24. package/dist/components/Combobox/Combobox.d.ts +13 -26
  25. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  26. package/dist/components/Combobox/index.d.ts +1 -3
  27. package/dist/components/Combobox/index.d.ts.map +1 -1
  28. package/dist/components/DatePicker/DatePicker.d.ts +3 -19
  29. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  30. package/dist/components/DateTimePicker/DateTimePicker.d.ts +2 -2
  31. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  32. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  33. package/dist/components/Divider/Divider.d.ts +1 -6
  34. package/dist/components/Divider/Divider.d.ts.map +1 -1
  35. package/dist/components/Field/Field.d.ts +0 -2
  36. package/dist/components/Field/Field.d.ts.map +1 -1
  37. package/dist/components/IconButton/IconButton.d.ts +16 -27
  38. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  39. package/dist/components/JSONInput/utils/decorationExtension.d.ts +1 -1
  40. package/dist/components/JSONInput/utils/decorationExtension.d.ts.map +1 -1
  41. package/dist/components/LinkButton/LinkButton.d.ts +3 -3
  42. package/dist/components/LinkButton/LinkButton.d.ts.map +1 -1
  43. package/dist/components/ModalLayout/ModalHeader.d.ts.map +1 -1
  44. package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
  45. package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
  46. package/dist/components/Select/MultiSelect.d.ts +2 -14
  47. package/dist/components/Select/MultiSelect.d.ts.map +1 -1
  48. package/dist/components/Select/SelectParts.d.ts +0 -4
  49. package/dist/components/Select/SelectParts.d.ts.map +1 -1
  50. package/dist/components/Select/SingleSelect.d.ts +2 -2
  51. package/dist/components/Select/SingleSelect.d.ts.map +1 -1
  52. package/dist/components/SimpleMenu/Menu.d.ts +1 -1
  53. package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
  54. package/dist/components/SimpleMenu/SimpleMenu.d.ts +1 -1
  55. package/dist/components/SimpleMenu/SimpleMenu.d.ts.map +1 -1
  56. package/dist/components/SubNav/SubNavHeader.d.ts.map +1 -1
  57. package/dist/components/Table/Cell.d.ts +3 -0
  58. package/dist/components/Table/Cell.d.ts.map +1 -1
  59. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  60. package/dist/components/Toggle/Toggle.d.ts +0 -2
  61. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  62. package/dist/components/Tooltip/Tooltip.d.ts +24 -9
  63. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  64. package/dist/components/index.d.ts +0 -2
  65. package/dist/components/index.d.ts.map +1 -1
  66. package/dist/hooks/useControllableState.d.ts +0 -3
  67. package/dist/hooks/useControllableState.d.ts.map +1 -1
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +830 -1354
  71. package/dist/index.js.map +1 -1
  72. package/dist/index.mjs +831 -1356
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/styles/easings.d.ts +29 -0
  75. package/dist/styles/easings.d.ts.map +1 -0
  76. package/dist/styles/global.d.ts +4 -0
  77. package/dist/styles/global.d.ts.map +1 -0
  78. package/dist/themes/common-theme.d.ts +11 -1
  79. package/dist/themes/common-theme.d.ts.map +1 -1
  80. package/dist/themes/sizes.d.ts +0 -9
  81. package/dist/themes/sizes.d.ts.map +1 -1
  82. package/dist/utilities/DesignSystemProvider.d.ts +16 -0
  83. package/dist/utilities/DesignSystemProvider.d.ts.map +1 -0
  84. package/package.json +6 -3
  85. package/dist/DesignSystemProvider.d.ts +0 -11
  86. package/dist/DesignSystemProvider.d.ts.map +0 -1
  87. package/dist/components/Accordion/AccordionContent.d.ts +0 -6
  88. package/dist/components/Accordion/AccordionContent.d.ts.map +0 -1
  89. package/dist/components/Accordion/AccordionContext.d.ts +0 -14
  90. package/dist/components/Accordion/AccordionContext.d.ts.map +0 -1
  91. package/dist/components/Accordion/AccordionGroup.d.ts +0 -13
  92. package/dist/components/Accordion/AccordionGroup.d.ts.map +0 -1
  93. package/dist/components/Accordion/AccordionToggle.d.ts +0 -31
  94. package/dist/components/Accordion/AccordionToggle.d.ts.map +0 -1
  95. package/dist/components/BaseCheckbox/utils.d.ts +0 -5
  96. package/dist/components/BaseCheckbox/utils.d.ts.map +0 -1
  97. package/dist/components/BaseRadio/context.d.ts +0 -10
  98. package/dist/components/BaseRadio/context.d.ts.map +0 -1
  99. package/dist/components/BaseRadio/utils.d.ts +0 -5
  100. package/dist/components/BaseRadio/utils.d.ts.map +0 -1
  101. package/dist/components/Combobox/ComboboxList.d.ts +0 -11
  102. package/dist/components/Combobox/ComboboxList.d.ts.map +0 -1
  103. package/dist/components/Combobox/ComboboxOption.d.ts +0 -5
  104. package/dist/components/Combobox/ComboboxOption.d.ts.map +0 -1
  105. package/dist/components/Layout/Layout.d.ts +0 -8
  106. package/dist/components/Layout/Layout.d.ts.map +0 -1
  107. package/dist/components/MainNav/MainNav.d.ts +0 -6
  108. package/dist/components/MainNav/MainNav.d.ts.map +0 -1
  109. package/dist/components/MainNav/MainNavContext.d.ts +0 -4
  110. package/dist/components/MainNav/MainNavContext.d.ts.map +0 -1
  111. package/dist/components/MainNav/NavBrand.d.ts +0 -10
  112. package/dist/components/MainNav/NavBrand.d.ts.map +0 -1
  113. package/dist/components/MainNav/NavCondense.d.ts +0 -6
  114. package/dist/components/MainNav/NavCondense.d.ts.map +0 -1
  115. package/dist/components/MainNav/NavFooter.d.ts +0 -6
  116. package/dist/components/MainNav/NavFooter.d.ts.map +0 -1
  117. package/dist/components/MainNav/NavLink.d.ts +0 -12
  118. package/dist/components/MainNav/NavLink.d.ts.map +0 -1
  119. package/dist/components/MainNav/NavSection.d.ts +0 -10
  120. package/dist/components/MainNav/NavSection.d.ts.map +0 -1
  121. package/dist/components/MainNav/NavSections.d.ts +0 -9
  122. package/dist/components/MainNav/NavSections.d.ts.map +0 -1
  123. package/dist/components/MainNav/NavUser.d.ts +0 -9
  124. package/dist/components/MainNav/NavUser.d.ts.map +0 -1
  125. package/dist/components/MainNav/index.d.ts +0 -9
  126. package/dist/components/MainNav/index.d.ts.map +0 -1
  127. package/dist/components/ThemeProvider/ThemeProvider.d.ts +0 -11
  128. package/dist/components/ThemeProvider/ThemeProvider.d.ts.map +0 -1
  129. package/dist/components/ThemeProvider/hooks.d.ts +0 -2
  130. package/dist/components/ThemeProvider/hooks.d.ts.map +0 -1
  131. package/dist/components/ThemeProvider/index.d.ts +0 -3
  132. package/dist/components/ThemeProvider/index.d.ts.map +0 -1
  133. package/dist/components/Tooltip/hooks/useTooltipHandlers.d.ts +0 -8
  134. package/dist/components/Tooltip/hooks/useTooltipHandlers.d.ts.map +0 -1
  135. package/dist/components/Tooltip/hooks/useTooltipLayout.d.ts +0 -7
  136. package/dist/components/Tooltip/hooks/useTooltipLayout.d.ts.map +0 -1
  137. package/dist/components/Tooltip/utils/positionTooltip.d.ts +0 -6
  138. package/dist/components/Tooltip/utils/positionTooltip.d.ts.map +0 -1
  139. package/dist/helpers/getDefaultLocale.d.ts +0 -6
  140. package/dist/helpers/getDefaultLocale.d.ts.map +0 -1
  141. package/dist/styles/inputs.d.ts +0 -1
  142. package/dist/styles/inputs.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
3
  const React = require("react");
5
- const styledComponents = require("styled-components");
6
4
  const date = require("@internationalized/date");
5
+ const jsxRuntime = require("react/jsx-runtime");
6
+ const Tooltip = require("@radix-ui/react-tooltip");
7
+ const styledComponents = require("styled-components");
7
8
  const uiPrimitives = require("@strapi/ui-primitives");
9
+ const RadixAccordion = require("@radix-ui/react-accordion");
8
10
  const icons = require("@strapi/icons");
9
11
  const DropdownMenu = require("@radix-ui/react-dropdown-menu");
10
- const reactDom = require("react-dom");
12
+ const reactUseControllableState = require("@radix-ui/react-use-controllable-state");
11
13
  const DismissibleLayerPrimitive = require("@radix-ui/react-dismissable-layer");
14
+ const reactDom = require("react-dom");
12
15
  const reactDom$1 = require("@floating-ui/react-dom");
13
16
  const reactFocusScope = require("@radix-ui/react-focus-scope");
14
17
  const reactRemoveScroll = require("react-remove-scroll");
@@ -37,17 +40,27 @@ function _interopNamespace(e) {
37
40
  return Object.freeze(n);
38
41
  }
39
42
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
43
+ const Tooltip__namespace = /* @__PURE__ */ _interopNamespace(Tooltip);
44
+ const RadixAccordion__namespace = /* @__PURE__ */ _interopNamespace(RadixAccordion);
40
45
  const DropdownMenu__namespace = /* @__PURE__ */ _interopNamespace(DropdownMenu);
41
46
  const DismissibleLayerPrimitive__namespace = /* @__PURE__ */ _interopNamespace(DismissibleLayerPrimitive);
42
- const useReactId = React__namespace["useId".toString()] || (() => void 0);
43
- let count = 0;
44
- const useId = (initialId) => {
45
- const [id, setId] = React__namespace.useState(useReactId());
46
- React__namespace.useLayoutEffect(() => {
47
- if (!initialId)
48
- setId((reactId) => reactId ?? String(count++));
49
- }, [initialId]);
50
- return initialId?.toString() ?? (id || "");
47
+ const createContext = (rootComponentName, defaultContext) => {
48
+ const Context = React__namespace.createContext(defaultContext);
49
+ const Provider2 = (props) => {
50
+ const { children, ...context } = props;
51
+ const value = React__namespace.useMemo(() => context, Object.values(context));
52
+ return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
53
+ };
54
+ function useContext(consumerName) {
55
+ const context = React__namespace.useContext(Context);
56
+ if (context)
57
+ return context;
58
+ if (defaultContext !== void 0)
59
+ return defaultContext;
60
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
61
+ }
62
+ Provider2.displayName = `${rootComponentName}Provider`;
63
+ return [Provider2, useContext];
51
64
  };
52
65
  const handleResponsiveValues = (property, value, theme) => {
53
66
  if (!value) {
@@ -201,7 +214,7 @@ const StyledBox = styledComponents.styled.div`
201
214
 
202
215
  // Colors
203
216
  background: ${({ theme, $background }) => extractStyleFromTheme(theme.colors, $background, $background)};
204
- color: ${({ theme, $color }) => extractStyleFromTheme(theme.colors, $color, void 0)};
217
+ color: ${({ theme, $color }) => extractStyleFromTheme(theme.colors, $color, $color)};
205
218
 
206
219
  // Spaces
207
220
  ${({ theme, $padding }) => handleResponsiveValues("padding-block", $padding, theme)}
@@ -250,7 +263,7 @@ const StyledBox = styledComponents.styled.div`
250
263
  right: ${({ $right, theme }) => extractStyleFromTheme(theme.spaces, $right, $right)};
251
264
  top: ${({ $top, theme }) => extractStyleFromTheme(theme.spaces, $top, $top)};
252
265
  bottom: ${({ $bottom, theme }) => extractStyleFromTheme(theme.spaces, $bottom, $bottom)};
253
- z-index: ${({ $zIndex }) => $zIndex};
266
+ z-index: ${({ $zIndex, theme }) => extractStyleFromTheme(theme.zIndices, $zIndex, $zIndex)};
254
267
  overflow: ${({ $overflow }) => $overflow};
255
268
 
256
269
  // Size
@@ -280,6 +293,27 @@ const StyledBox = styledComponents.styled.div`
280
293
  // Cursor
281
294
  cursor: ${({ $cursor }) => $cursor};
282
295
  `;
296
+ const Flex = forwardRef((props, ref) => {
297
+ const { className, alignItems, direction, gap, inline, justifyContent, wrap, ...rest } = props;
298
+ const mappedProps = {
299
+ $alignItems: alignItems,
300
+ $direction: direction,
301
+ $gap: gap,
302
+ $inline: inline,
303
+ $justifyContent: justifyContent,
304
+ $wrap: wrap
305
+ };
306
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
307
+ });
308
+ const StyledFlex = styledComponents.styled(Box)`
309
+ align-items: ${({ $alignItems = "center" }) => $alignItems};
310
+ display: ${({ display = "flex", $inline }) => $inline ? "inline-flex" : display};
311
+ flex-direction: ${({ $direction = "row" }) => $direction};
312
+ flex-shrink: ${({ shrink }) => shrink};
313
+ flex-wrap: ${({ $wrap }) => $wrap};
314
+ ${({ $gap, theme }) => handleResponsiveValues("gap", $gap, theme)};
315
+ justify-content: ${({ $justifyContent }) => $justifyContent};
316
+ `;
283
317
  const ALPHA = "alpha";
284
318
  const BETA = "beta";
285
319
  const DELTA = "delta";
@@ -391,483 +425,261 @@ const StyledTypography = styledComponents.styled(Box)`
391
425
  text-decoration: ${({ $textDecoration }) => $textDecoration};
392
426
  text-transform: ${({ $textTransform }) => $textTransform};
393
427
  `;
394
- const AccordionContext = React__namespace.createContext({
395
- disabled: false,
396
- expanded: false,
397
- id: "",
398
- size: "M",
399
- variant: "primary"
400
- });
401
- const useAccordion = () => React__namespace.useContext(AccordionContext);
402
- const Flex = forwardRef((props, ref) => {
403
- const { className, alignItems, direction, gap, inline, justifyContent, wrap, ...rest } = props;
404
- const mappedProps = {
405
- $alignItems: alignItems,
406
- $direction: direction,
407
- $gap: gap,
408
- $inline: inline,
409
- $justifyContent: justifyContent,
410
- $wrap: wrap
411
- };
412
- return /* @__PURE__ */ jsxRuntime.jsx(StyledFlex, { className, ref, ...mappedProps, ...rest });
428
+ const [AccordionProvider, useAccordion] = createContext("Accordion");
429
+ const Root$3 = React__namespace.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
430
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionRoot, { ref: forwardedRef, $size: size, collapsible: true, ...props, type: "single", children: /* @__PURE__ */ jsxRuntime.jsx(AccordionProvider, { size, children }) });
413
431
  });
414
- const StyledFlex = styledComponents.styled(Box)`
415
- align-items: ${({ $alignItems = "center" }) => $alignItems};
416
- display: ${({ display = "flex", $inline }) => $inline ? "inline-flex" : display};
417
- flex-direction: ${({ $direction = "row" }) => $direction};
418
- flex-shrink: ${({ shrink }) => shrink};
419
- flex-wrap: ${({ $wrap }) => $wrap};
420
- ${({ $gap, theme }) => handleResponsiveValues("gap", $gap, theme)};
421
- justify-content: ${({ $justifyContent }) => $justifyContent};
432
+ const AccordionRoot = styledComponents.styled(RadixAccordion__namespace.Root)`
433
+ background-color: ${(props) => props.theme.colors.neutral0};
434
+
435
+ ${(props) => {
436
+ if (props.$size === "S") {
437
+ return styledComponents.css`
438
+ border-radius: ${(props2) => props2.theme.borderRadius};
439
+ border: solid 1px ${(props2) => props2.theme.colors.neutral200};
440
+ `;
441
+ } else {
442
+ return styledComponents.css``;
443
+ }
444
+ }}
422
445
  `;
423
- const focus = styledComponents.css`
424
- position: relative;
425
- outline: none;
446
+ const Item$2 = React__namespace.forwardRef((props, forwardedRef) => {
447
+ const { size } = useAccordion("Item");
448
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionItem, { $size: size, ref: forwardedRef, ...props });
449
+ });
450
+ const AccordionItem = styledComponents.styled(RadixAccordion__namespace.Item)`
451
+ overflow: hidden;
426
452
 
427
- &:after {
428
- transition-property: all;
429
- transition-duration: 0.2s;
430
- border-radius: 8px;
431
- content: '';
432
- position: absolute;
433
- top: -4px;
434
- bottom: -4px;
435
- left: -4px;
436
- right: -4px;
437
- border: 2px solid transparent;
453
+ &:first-child {
454
+ border-top-left-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
455
+ border-top-right-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
438
456
  }
439
457
 
440
- &:focus-visible {
441
- outline: none;
458
+ &:last-child {
459
+ border-bottom-left-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
460
+ border-bottom-right-radius: ${(props) => props.$size === "S" ? "0.3rem" : ""};
461
+ }
442
462
 
443
- &:after {
444
- border-radius: 8px;
445
- content: '';
446
- position: absolute;
447
- top: -5px;
448
- bottom: -5px;
449
- left: -5px;
450
- right: -5px;
451
- border: 2px solid ${(props) => props.theme.colors.primary600};
452
- }
463
+ & + & {
464
+ border-top: ${(props) => props.$size === "S" ? `solid 1px ${props.theme.colors.neutral200}` : "unset"};
465
+ }
466
+
467
+ /* This applies our desired focus effect correctly. */
468
+ &:focus-within {
469
+ position: relative;
470
+ z-index: 1;
471
+ box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
453
472
  }
454
473
  `;
455
- const rotation$2 = styledComponents.keyframes`
456
- from {
457
- transform: rotate(0deg);
474
+ const Trigger$3 = React__namespace.forwardRef(
475
+ ({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
476
+ const { size } = useAccordion("Trigger");
477
+ return /* @__PURE__ */ jsxRuntime.jsxs(AccordionTrigger, { $caretPosition: caretPosition, $size: size, ref: forwardedRef, ...restProps, children: [
478
+ caretPosition === "left" ? /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { $size: size, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: size === "S" ? "1.2rem" : "1.6rem", height: size === "S" ? "1.2rem" : "1.6rem" }) }) : null,
479
+ /* @__PURE__ */ jsxRuntime.jsxs(Flex, { tag: "span", gap: 2, children: [
480
+ Icon ? /* @__PURE__ */ jsxRuntime.jsx(IconBox$4, { children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) }) : null,
481
+ /* @__PURE__ */ jsxRuntime.jsxs(Flex, { alignItems: "flex-start", direction: "column", tag: "span", ref: forwardedRef, children: [
482
+ /* @__PURE__ */ jsxRuntime.jsx(
483
+ Typography,
484
+ {
485
+ fontWeight: size === "S" ? "bold" : void 0,
486
+ ellipsis: true,
487
+ variant: size === "M" ? "delta" : void 0,
488
+ children
489
+ }
490
+ ),
491
+ description && size === "M" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: description }) : null
492
+ ] })
493
+ ] }),
494
+ caretPosition === "right" ? /* @__PURE__ */ jsxRuntime.jsx(TriggerIcon, { $size: size, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: size === "S" ? "1.2rem" : "1.6rem", height: size === "S" ? "1.2rem" : "1.6rem" }) }) : null
495
+ ] });
458
496
  }
459
- to {
460
- transform: rotate(359deg);
497
+ );
498
+ const IconBox$4 = styledComponents.styled(Box)`
499
+ color: ${(props) => props.theme.colors.neutral500};
500
+
501
+ @media (prefers-reduced-motion: no-preference) {
502
+ transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
461
503
  }
462
504
  `;
463
- const LoadingWrapper = styledComponents.styled.div`
464
- animation: ${rotation$2} 2s infinite linear;
465
- will-change: transform;
466
- `;
467
- const TextButtonWrapper = styledComponents.styled(Flex)`
468
- border: none;
505
+ const TriggerIcon = styledComponents.styled(Flex).attrs((props) => ({
506
+ ...props,
507
+ tag: "span"
508
+ }))`
509
+ background-color: ${(props) => props.theme.colors.neutral200};
510
+ width: ${(props) => props.$size === "S" ? "2.4rem" : "3.2rem"};
511
+ height: ${(props) => props.$size === "S" ? "2.4rem" : "3.2rem"};
512
+ flex: ${(props) => props.$size === "S" ? "0 0 2.4rem" : "0 0 3.2rem"};
513
+ border-radius: 50%;
514
+ justify-content: center;
469
515
 
470
- &[aria-disabled='true'] {
471
- pointer-events: none;
472
- svg path {
473
- fill: ${({ theme }) => theme.colors.neutral600};
474
- }
516
+ @media (prefers-reduced-motion: no-preference) {
517
+ transition:
518
+ transform 300ms ${(props) => props.theme.easings.authenticMotion},
519
+ background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
475
520
  }
521
+ `;
522
+ const AccordionTrigger = styledComponents.styled(RadixAccordion__namespace.Trigger)`
523
+ display: flex;
524
+ align-items: center;
525
+ justify-content: ${(props) => props.$caretPosition === "left" ? "flex-start" : "space-between"};
526
+ width: 100%;
527
+ gap: ${(props) => props.theme.spaces[4]};
528
+ padding-inline: ${(props) => props.$size === "S" ? props.theme.spaces[4] : props.theme.spaces[6]};
529
+ padding-block: ${(props) => props.$size === "S" ? props.theme.spaces[3] : props.theme.spaces[6]};
530
+ cursor: pointer;
531
+ color: ${(props) => props.theme.colors.neutral800};
476
532
 
477
- svg path {
478
- fill: ${({ theme }) => theme.colors.primary600};
533
+ &[data-disabled] {
534
+ cursor: default;
535
+ color: ${(props) => props.theme.colors.neutral600};
479
536
  }
480
537
 
481
- ${focus}
482
- `;
483
- const TextButton = React__namespace.forwardRef(
484
- ({ children, startIcon, endIcon, onClick, disabled = false, loading = false, ...props }, ref) => {
485
- const handleClick = onClick && !disabled ? onClick : void 0;
486
- const isDisabled = disabled || loading;
487
- return /* @__PURE__ */ jsxRuntime.jsxs(
488
- TextButtonWrapper,
489
- {
490
- ref,
491
- "aria-disabled": isDisabled,
492
- onClick: handleClick,
493
- tag: "button",
494
- type: "button",
495
- background: "transparent",
496
- gap: 2,
497
- ...props,
498
- children: [
499
- loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Loader, {}) }) : startIcon,
500
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: isDisabled ? "neutral600" : "primary600", children }),
501
- endIcon
502
- ]
503
- }
504
- );
538
+ &[data-state='open'] > ${TriggerIcon} {
539
+ transform: rotate(180deg);
505
540
  }
506
- );
507
- TextButton.displayName = "TextButton";
508
- const AccordionToggle = ({
509
- title,
510
- description,
511
- tag,
512
- togglePosition = "right",
513
- action,
514
- ...props
515
- }) => {
516
- const { onToggle, toggle, expanded, id, size, variant: variant2, disabled } = useAccordion();
517
- const ariaControls = `accordion-content-${id}`;
518
- const ariaLabelId = `accordion-label-${id}`;
519
- const ariaDescriptionId = `accordion-desc-${id}`;
520
- const boxPaddingX = size === "M" ? 6 : 4;
521
- const boxPaddingY = size === "M" ? boxPaddingX : boxPaddingX - 2;
522
- let boxBackground = "neutral100";
523
- if (expanded) {
524
- boxBackground = "primary100";
525
- } else if (disabled) {
526
- boxBackground = "neutral150";
527
- } else if (variant2 === "primary") {
528
- boxBackground = "neutral0";
529
- }
530
- const titleColor = expanded ? "primary600" : "neutral700";
531
- const titleProps = {
532
- tag,
533
- fontWeight: size === "S" ? "bold" : void 0,
534
- id: ariaLabelId,
535
- textColor: titleColor,
536
- ellipsis: true,
537
- variant: size === "M" ? "delta" : void 0
538
- };
539
- const descriptionColor = expanded ? "primary600" : "neutral600";
540
- const iconColor = expanded ? "primary200" : "neutral200";
541
- const iconSize = size === "M" ? `3.2rem` : `2.4rem`;
542
- const handleToggle = () => {
543
- if (!disabled) {
544
- if (toggle && !onToggle) {
545
- console.warn(
546
- 'Deprecation warning: Usage of "toggle" prop in Accordion component is deprecated. This is discouraged and will be removed in the next major release. Please use "onToggle" instead'
547
- );
548
- toggle();
549
- } else if (onToggle) {
550
- onToggle();
551
- }
552
- }
553
- };
554
- const dropdownIcon = /* @__PURE__ */ jsxRuntime.jsx(
555
- Flex,
556
- {
557
- justifyContent: "center",
558
- borderRadius: "50%",
559
- height: iconSize,
560
- width: iconSize,
561
- transform: expanded ? `rotate(180deg)` : void 0,
562
- "data-strapi-dropdown": true,
563
- "aria-hidden": true,
564
- tag: "span",
565
- background: iconColor,
566
- cursor: disabled ? "not-allowed" : "pointer",
567
- shrink: 0,
568
- children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: size === "M" ? `1.6rem` : `1.2rem`, fill: expanded ? "primary600" : "neutral600" })
569
- }
570
- );
571
- const stopPropagation = (e) => {
572
- e.stopPropagation();
573
- };
574
- return /* @__PURE__ */ jsxRuntime.jsx(
575
- FlexWithSize,
576
- {
577
- paddingBottom: boxPaddingY,
578
- paddingLeft: boxPaddingX,
579
- paddingRight: boxPaddingX,
580
- paddingTop: boxPaddingY,
581
- background: boxBackground,
582
- $expanded: expanded,
583
- $size: size,
584
- justifyContent: "space-between",
585
- cursor: disabled ? "not-allowed" : "pointer",
586
- onClick: handleToggle,
587
- children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 3, flex: 1, maxWidth: "100%", children: [
588
- togglePosition === "left" && dropdownIcon,
589
- /* @__PURE__ */ jsxRuntime.jsxs(
590
- ToggleButton,
591
- {
592
- "aria-disabled": disabled,
593
- "aria-expanded": expanded,
594
- "aria-controls": ariaControls,
595
- "aria-labelledby": ariaLabelId,
596
- "data-strapi-accordion-toggle": true,
597
- $expanded: expanded,
598
- type: "button",
599
- flex: 1,
600
- minWidth: 0,
601
- ...props,
602
- children: [
603
- /* @__PURE__ */ jsxRuntime.jsx(AccordionTitle, { ...titleProps, children: title }),
604
- description && /* @__PURE__ */ jsxRuntime.jsx(AccordionDescription, { tag: "p", id: ariaDescriptionId, textColor: descriptionColor, children: description })
605
- ]
606
- }
607
- ),
608
- togglePosition === "right" && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 3, children: [
609
- dropdownIcon,
610
- /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", onClick: stopPropagation, children: action })
611
- ] }),
612
- togglePosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", onClick: stopPropagation, children: action })
613
- ] })
614
- }
615
- );
616
- };
617
- const AccordionDescription = styledComponents.styled(Typography)``;
618
- const AccordionTitle = styledComponents.styled(Typography)``;
619
- const ToggleButton = styledComponents.styled(TextButton)`
620
- text-align: left;
621
541
 
622
- // necessary to make the ellipsis prop work on the title
623
- > span {
624
- max-width: 100%;
542
+ /* we remove the default focus because the entire item should have the focus style and the default would be hidden. */
543
+ &:focus-visible {
544
+ outline: none;
625
545
  }
626
546
 
627
- & > svg {
628
- width: 1.4rem;
629
- height: 1.4rem;
630
- fill: ${({ theme, $expanded }) => $expanded ? theme.colors.primary600 : theme.colors.neutral500};
547
+ @media (prefers-reduced-motion: no-preference) {
548
+ transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
631
549
  }
632
550
  `;
633
- const FlexWithSize = styledComponents.styled(Flex)`
634
- min-height: ${({ theme, $size }) => theme.sizes.accordions[$size]};
635
- border-radius: ${({ theme, $expanded }) => $expanded ? `${theme.borderRadius} ${theme.borderRadius} 0 0` : theme.borderRadius};
551
+ const Actions = React__namespace.forwardRef((props, forwardedRef) => {
552
+ const { size } = useAccordion("Trigger");
553
+ return /* @__PURE__ */ jsxRuntime.jsx(ActionWrapper, { $size: size, ...props, ref: forwardedRef });
554
+ });
555
+ const ActionWrapper = styledComponents.styled(Flex).attrs((props) => ({
556
+ ...props,
557
+ tag: "span"
558
+ }))`
559
+ padding-inline: ${(props) => props.$size === "S" ? props.theme.spaces[2] : props.theme.spaces[6]};
560
+ padding-block: ${(props) => props.$size === "S" ? props.theme.spaces[2] : props.theme.spaces[6]};
636
561
 
637
- &:hover {
638
- ${ToggleButton} {
639
- svg {
640
- fill: ${({ theme }) => theme.colors.primary600};
641
- }
562
+ // Remove default IconButton styles so there are no backgrounds or borders.
563
+ & > button {
564
+ border: none;
565
+ background: none;
566
+ color: ${(props) => props.theme.colors.neutral600};
567
+
568
+ @media (prefers-reduced-motion: no-preference) {
569
+ transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
642
570
  }
643
571
  }
644
572
  `;
645
- const Accordion = ({
646
- children,
647
- disabled = false,
648
- error,
649
- expanded = false,
650
- hasErrorMessage = true,
651
- id,
652
- onToggle,
653
- toggle,
654
- size = "M",
655
- variant: variant2 = "primary",
656
- shadow
657
- }) => {
658
- const generatedId = useId(id);
659
- const context = React__namespace.useMemo(
660
- () => ({ expanded, onToggle, toggle, id: generatedId, size, variant: variant2, disabled }),
661
- [disabled, expanded, generatedId, onToggle, size, toggle, variant2]
662
- );
663
- return /* @__PURE__ */ jsxRuntime.jsxs(AccordionContext.Provider, { value: context, children: [
664
- /* @__PURE__ */ jsxRuntime.jsx(
665
- AccordionWrapper,
666
- {
667
- "data-strapi-expanded": expanded,
668
- "aria-disabled": disabled,
669
- hasRadius: true,
670
- shadow,
671
- $expanded: expanded,
672
- $disabled: disabled,
673
- $variant: variant2,
674
- $error: error,
675
- children
676
- }
677
- ),
678
- error && hasErrorMessage && /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "danger600", children: error }) })
679
- ] });
680
- };
681
- const AccordionWrapper = styledComponents.styled(Box)`
682
- border: ${({ theme, $expanded, $variant, $disabled, $error }) => {
683
- if ($error) {
684
- return `1px solid ${theme.colors.danger600} !important`;
685
- }
686
- if ($disabled) {
687
- return `1px solid ${theme.colors.neutral150}`;
688
- }
689
- if ($expanded) {
690
- return `1px solid ${theme.colors.primary600}`;
691
- }
692
- if ($variant === "primary") {
693
- return `1px solid ${theme.colors.neutral0}`;
573
+ const Header = React__namespace.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
574
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionHeader, { $variant: variant2, ref: forwardedRef, ...props });
575
+ });
576
+ const AccordionHeader = styledComponents.styled(RadixAccordion__namespace.Header)`
577
+ display: flex;
578
+ align-items: center;
579
+ background-color: ${(props) => props.$variant === "primary" ? props.theme.colors.neutral0 : props.theme.colors.neutral100};
580
+
581
+ &[data-disabled] {
582
+ background-color: ${(props) => props.theme.colors.neutral150};
694
583
  }
695
- return `1px solid ${theme.colors.neutral100}`;
696
- }};
697
584
 
698
- &:hover:not([aria-disabled='true']) {
699
- border: 1px solid ${({ theme }) => theme.colors.primary600};
585
+ &:not([data-disabled]) {
586
+ &:hover,
587
+ &[data-state='open'] {
588
+ background-color: ${(props) => props.theme.colors.primary100};
700
589
 
701
- ${AccordionTitle} {
702
- color: ${({ theme, $expanded }) => $expanded ? void 0 : theme.colors.primary700};
703
- }
590
+ & > ${AccordionTrigger} {
591
+ color: ${(props) => props.theme.colors.primary600};
704
592
 
705
- ${AccordionDescription} {
706
- color: ${({ theme, $expanded }) => $expanded ? void 0 : theme.colors.primary600};
707
- }
593
+ & ${IconBox$4} {
594
+ color: ${(props) => props.theme.colors.primary600};
595
+ }
708
596
 
709
- & > div:first-child {
710
- background: ${({ theme }) => theme.colors.primary100};
711
- }
597
+ & ${TriggerIcon} {
598
+ background-color: ${(props) => props.theme.colors.primary200};
599
+ }
600
+ }
712
601
 
713
- [data-strapi-dropdown='true'] {
714
- background: ${({ theme }) => theme.colors.primary200};
602
+ & > ${ActionWrapper} > button {
603
+ color: ${(props) => props.theme.colors.primary600};
604
+ }
715
605
  }
716
606
  }
607
+
608
+ @media (prefers-reduced-motion: no-preference) {
609
+ transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
610
+ }
717
611
  `;
718
- const AccordionContent = ({ children, ...props }) => {
719
- const { expanded, id } = useAccordion();
720
- if (!expanded) {
721
- return null;
612
+ const Content$4 = React__namespace.forwardRef((props, forwardedRef) => {
613
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { ref: forwardedRef, ...props });
614
+ });
615
+ const slideDown = styledComponents.keyframes`
616
+ from {
617
+ height: 0;
618
+ }
619
+ to {
620
+ height: var(--radix-accordion-content-height);
722
621
  }
723
- const idContent = `accordion-content-${id}`;
724
- const ariaLabelId = `accordion-label-${id}`;
725
- const ariaDescriptionId = `accordion-desc-${id}`;
726
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { role: "region", id: idContent, "aria-labelledby": ariaLabelId, "aria-describedby": ariaDescriptionId, ...props, children });
727
- };
728
- const KeyboardKeys = {
729
- DOWN: "ArrowDown",
730
- UP: "ArrowUp",
731
- RIGHT: "ArrowRight",
732
- LEFT: "ArrowLeft",
733
- ESCAPE: "Escape",
734
- ENTER: "Enter",
735
- SPACE: " ",
736
- TAB: "Tab",
737
- END: "End",
738
- HOME: "Home",
739
- DELETE: "Delete",
740
- PAGE_UP: "PageUp",
741
- PAGE_DOWN: "PageDown",
742
- BACKSPACE: "Backspace",
743
- CLEAR: "Clear"
744
- };
745
- const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
746
- const isValidFocusedElement = () => {
747
- const focused = document.activeElement;
748
- if (!focused) {
749
- return false;
750
- }
751
- if (tagName) {
752
- return focused.tagName.toLowerCase() === tagName;
753
- }
754
- return focused.hasAttribute(attributeName);
755
- };
756
- const queryElement = (parentEl) => {
757
- if (tagName) {
758
- return parentEl.querySelectorAll(tagName);
759
- }
760
- return parentEl.querySelectorAll(`[${attributeName}]`);
761
- };
762
- const handleKeyDown = (e) => {
763
- switch (e.key) {
764
- case KeyboardKeys.RIGHT:
765
- case KeyboardKeys.DOWN: {
766
- if (isValidFocusedElement()) {
767
- e.preventDefault();
768
- const focused = document.activeElement;
769
- const allElements = [...queryElement(e.currentTarget)];
770
- const focusedIndex = allElements.findIndex((node) => node === focused);
771
- const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
772
- allElements[nextIndex].focus();
773
- }
774
- break;
775
- }
776
- case KeyboardKeys.LEFT:
777
- case KeyboardKeys.UP: {
778
- if (isValidFocusedElement()) {
779
- e.preventDefault();
780
- const focused = document.activeElement;
781
- const allElements = [...queryElement(e.currentTarget)];
782
- const focusedIndex = allElements.findIndex((node) => node === focused);
783
- const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
784
- allElements[nextIndex].focus();
785
- }
786
- break;
787
- }
788
- case KeyboardKeys.HOME: {
789
- if (isValidFocusedElement()) {
790
- e.preventDefault();
791
- const allElements = queryElement(e.currentTarget);
792
- const focusElement = allElements.item(0);
793
- focusElement.focus();
794
- }
795
- break;
796
- }
797
- case KeyboardKeys.END: {
798
- if (isValidFocusedElement()) {
799
- e.preventDefault();
800
- const allElements = queryElement(e.currentTarget);
801
- const focusElement = allElements.item(allElements.length - 1);
802
- focusElement.focus();
803
- }
804
- break;
805
- }
806
- }
807
- };
808
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { onKeyDown: handleKeyDown, ...props });
809
- };
810
- const AccordionGroup = ({ children, footer, label, labelAction, error }) => {
811
- const childrenArray = React__namespace.Children.toArray(children).map((child) => {
812
- return React__namespace.cloneElement(child, { hasErrorMessage: false });
813
- });
814
- return /* @__PURE__ */ jsxRuntime.jsxs(KeyboardNavigable, { attributeName: "data-strapi-accordion-toggle", children: [
815
- label && /* @__PURE__ */ jsxRuntime.jsxs(Flex, { paddingBottom: 1, children: [
816
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", tag: "label", textColor: "neutral800", fontWeight: "bold", children: label }),
817
- labelAction && /* @__PURE__ */ jsxRuntime.jsx(LabelAction$1, { paddingLeft: 1, children: labelAction })
818
- ] }),
819
- /* @__PURE__ */ jsxRuntime.jsx(EnhancedGroup, { $footer: footer, children: childrenArray }),
820
- footer && /* @__PURE__ */ jsxRuntime.jsx(AccordionFooter, { children: footer }),
821
- error && /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "danger600", children: error }) })
822
- ] });
823
- };
824
- const AccordionFooter = styledComponents.styled(Box)`
825
- border-bottom: 1px solid ${({ theme }) => theme.colors.neutral200};
826
- border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
827
- border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
828
- border-radius: 0 0 ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius};
829
622
  `;
830
- const EnhancedGroup = styledComponents.styled(Box)`
831
- & > * {
832
- & > * {
833
- border-radius: unset;
834
- }
623
+ const slideUp = styledComponents.keyframes`
624
+ from {
625
+ height: var(--radix-accordion-content-height);
835
626
  }
836
-
837
- & > ${AccordionWrapper} {
838
- border-radius: unset;
839
- border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
840
- border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
841
- border-bottom: 1px solid ${({ theme }) => theme.colors.neutral200};
627
+ to {
628
+ height: 0;
842
629
  }
630
+ `;
631
+ const AccordionContent = styledComponents.styled(RadixAccordion__namespace.Content)`
632
+ overflow: hidden;
843
633
 
844
- & > ${AccordionWrapper}:first-of-type {
845
- border-top: 1px solid ${({ theme }) => theme.colors.neutral200};
846
- border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
847
- & > * {
848
- border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
634
+ @media (prefers-reduced-motion: no-preference) {
635
+ &[data-state='open'] {
636
+ animation: ${slideDown} 0.3s ${(props) => props.theme.easings.authenticMotion};
849
637
  }
850
638
 
851
- &:hover {
852
- border-top: 1px solid ${({ theme }) => theme.colors.primary600};
639
+ &[data-state='closed'] {
640
+ animation: ${slideUp} 0.3s ${(props) => props.theme.easings.authenticMotion};
853
641
  }
854
642
  }
643
+ `;
644
+ const Accordion = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
645
+ __proto__: null,
646
+ Actions,
647
+ Content: Content$4,
648
+ Header,
649
+ Item: Item$2,
650
+ Root: Root$3,
651
+ Trigger: Trigger$3
652
+ }, Symbol.toStringTag, { value: "Module" }));
653
+ const focus = styledComponents.css`
654
+ position: relative;
655
+ outline: none;
855
656
 
856
- & [data-strapi-expanded='true'] {
857
- border: 1px solid ${({ theme }) => theme.colors.primary600};
657
+ &:after {
658
+ transition-property: all;
659
+ transition-duration: 0.2s;
660
+ border-radius: 8px;
661
+ content: '';
662
+ position: absolute;
663
+ top: -4px;
664
+ bottom: -4px;
665
+ left: -4px;
666
+ right: -4px;
667
+ border: 2px solid transparent;
858
668
  }
859
669
 
860
- ${({ theme, $footer }) => `
861
- &:not(${$footer}) {
862
- & > *:last-of-type {
863
- border-radius: 0 0 ${theme.borderRadius} ${theme.borderRadius};
864
- }
670
+ &:focus-visible {
671
+ outline: none;
672
+
673
+ &:after {
674
+ border-radius: 8px;
675
+ content: '';
676
+ position: absolute;
677
+ top: -5px;
678
+ bottom: -5px;
679
+ left: -5px;
680
+ right: -5px;
681
+ border: 2px solid ${(props) => props.theme.colors.primary600};
865
682
  }
866
- `}
867
- `;
868
- const LabelAction$1 = styledComponents.styled(Box)`
869
- svg path {
870
- fill: ${({ theme }) => theme.colors.neutral500};
871
683
  }
872
684
  `;
873
685
  const VisuallyHidden = ({ tag, ...props }) => {
@@ -1094,10 +906,6 @@ const AvatarGroup = styledComponents.styled(Flex)`
1094
906
  margin-left: -${avatarSize / 2}px;
1095
907
  }
1096
908
  `;
1097
- const Base = styledComponents.styled(Flex)`
1098
- border-radius: ${({ theme, $size }) => $size === "S" ? "2px" : theme.borderRadius};
1099
- height: ${({ $size, theme }) => theme.sizes.badge[$size]};
1100
- `;
1101
909
  const Badge = ({
1102
910
  active = false,
1103
911
  size = "M",
@@ -1120,10 +928,25 @@ const Badge = ({
1120
928
  background: active ? "primary200" : backgroundColor,
1121
929
  $size: size,
1122
930
  ...props,
1123
- children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "sigma", textColor: active ? "primary600" : textColor, children })
931
+ children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "sigma", textColor: active ? "primary600" : textColor, lineHeight: "1rem", children })
1124
932
  }
1125
933
  );
1126
934
  };
935
+ const Base = styledComponents.styled(Flex)`
936
+ border-radius: ${({ theme, $size }) => $size === "S" ? "2px" : theme.borderRadius};
937
+ ${({ $size, theme }) => {
938
+ if ($size === "S") {
939
+ return styledComponents.css`
940
+ padding-block: 0.3rem;
941
+ padding-inline ${theme.spaces[1]}
942
+ `;
943
+ }
944
+ return styledComponents.css`
945
+ padding-block: 0.7rem;
946
+ padding-inline ${theme.spaces[2]}
947
+ `;
948
+ }};
949
+ `;
1127
950
  const BaseButton = forwardRef(
1128
951
  ({ disabled, children, ...props }, ref) => {
1129
952
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1167,14 +990,8 @@ function useComposedRefs(...refs) {
1167
990
  }
1168
991
  const checkmarkIconDisabled = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='%238E8EA9'%20/%3e%3c/svg%3e";
1169
992
  const checkmarkIcon = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='white'%20/%3e%3c/svg%3e";
1170
- const getCheckboxSize = ({ $size }) => {
1171
- if ($size === "M") {
1172
- return "18px";
1173
- }
1174
- return "20px";
1175
- };
1176
993
  const BaseCheckbox = React__namespace.forwardRef(
1177
- ({ indeterminate = false, size = "M", name, value = false, onValueChange, ...inputProps }, forwardedRef) => {
994
+ ({ indeterminate = false, name, value = false, onValueChange, ...inputProps }, forwardedRef) => {
1178
995
  const checkboxRef = React__namespace.useRef(null);
1179
996
  const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
1180
997
  React__namespace.useEffect(() => {
@@ -1189,10 +1006,9 @@ const BaseCheckbox = React__namespace.forwardRef(
1189
1006
  onValueChange(!value);
1190
1007
  }
1191
1008
  };
1192
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
1009
+ return /* @__PURE__ */ jsxRuntime.jsx(
1193
1010
  CheckboxInput,
1194
1011
  {
1195
- $size: size,
1196
1012
  checked: value,
1197
1013
  onChange: handleValueChange,
1198
1014
  type: "checkbox",
@@ -1200,17 +1016,17 @@ const BaseCheckbox = React__namespace.forwardRef(
1200
1016
  name,
1201
1017
  ...inputProps
1202
1018
  }
1203
- ) });
1019
+ );
1204
1020
  }
1205
1021
  );
1206
1022
  BaseCheckbox.displayName = "BaseCheckbox";
1207
1023
  const CheckboxInput = styledComponents.styled.input`
1208
- height: ${getCheckboxSize};
1209
- min-width: ${getCheckboxSize};
1024
+ min-width: 1.8rem;
1025
+ height: 1.8rem;
1210
1026
  margin: 0;
1027
+ appearance: none;
1211
1028
  border-radius: ${({ theme }) => theme.borderRadius};
1212
1029
  border: 1px solid ${({ theme }) => theme.colors.neutral300};
1213
- -webkit-appearance: none;
1214
1030
  background-color: ${({ theme }) => theme.colors.neutral0};
1215
1031
  cursor: pointer;
1216
1032
 
@@ -1223,8 +1039,8 @@ const CheckboxInput = styledComponents.styled.input`
1223
1039
  display: block;
1224
1040
  position: relative;
1225
1041
  background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
1226
- width: 10px;
1227
- height: 10px;
1042
+ width: 1rem;
1043
+ height: 1rem;
1228
1044
  left: 50%;
1229
1045
  top: 50%;
1230
1046
  transform: translateX(-50%) translateY(-50%);
@@ -1283,30 +1099,39 @@ const BaseLink = forwardRef(
1283
1099
  );
1284
1100
  }
1285
1101
  );
1286
- const RadioContext = React__namespace.createContext({
1102
+ const useReactId = React__namespace["useId".toString()] || (() => void 0);
1103
+ let count = 0;
1104
+ const useId = (initialId) => {
1105
+ const [id, setId] = React__namespace.useState(useReactId());
1106
+ React__namespace.useLayoutEffect(() => {
1107
+ if (!initialId)
1108
+ setId((reactId) => reactId ?? String(count++));
1109
+ }, [initialId]);
1110
+ return initialId?.toString() ?? (id || "");
1111
+ };
1112
+ const setTabIndexOnFirstItem = (node, selector) => {
1113
+ const list = node.querySelectorAll(selector);
1114
+ if (list && list.length > 0) {
1115
+ list.item(0).setAttribute("tabindex", "0");
1116
+ }
1117
+ };
1118
+ const [RadioProvider, useRadioGroup] = createContext("RadioGroup", {
1287
1119
  onChange: void 0,
1288
1120
  name: "",
1289
- size: "M",
1290
1121
  selected: ""
1291
1122
  });
1292
- const getRadioSize = (size) => {
1293
- if (size === "M") {
1294
- return "18px";
1295
- }
1296
- return "20px";
1297
- };
1298
- const getSelectedRadioSize = (size) => {
1299
- if (size === "M") {
1300
- return "10px";
1301
- }
1302
- return "12px";
1303
- };
1304
- const getSelectedRadioPosition = () => {
1305
- return "3px";
1123
+ const RadioGroup = ({ children, labelledBy, onChange, value = "", name, ...props }) => {
1124
+ const radioGroupRef = React__namespace.useRef(null);
1125
+ React__namespace.useLayoutEffect(() => {
1126
+ if (!value) {
1127
+ setTabIndexOnFirstItem(radioGroupRef.current, `[name="${name}"]`);
1128
+ }
1129
+ }, [value, name]);
1130
+ return /* @__PURE__ */ jsxRuntime.jsx(RadioProvider, { onChange, selected: value, name, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: radioGroupRef, role: "radiogroup", "aria-labelledby": labelledBy, ...props, children }) });
1306
1131
  };
1307
1132
  const BaseRadio = React__namespace.forwardRef(({ value, disabled = false, ...props }, ref) => {
1308
1133
  const generatedId = useId();
1309
- const { onChange, selected, name, size } = React__namespace.useContext(RadioContext);
1134
+ const { onChange, selected, name } = useRadioGroup("BaseRadio");
1310
1135
  const isSelected = selected === value;
1311
1136
  return /* @__PURE__ */ jsxRuntime.jsx(
1312
1137
  RadioInput,
@@ -1320,7 +1145,6 @@ const BaseRadio = React__namespace.forwardRef(({ value, disabled = false, ...pro
1320
1145
  checked: isSelected,
1321
1146
  disabled,
1322
1147
  id: generatedId,
1323
- $size: size,
1324
1148
  onChange,
1325
1149
  ...props
1326
1150
  }
@@ -1333,9 +1157,8 @@ const RadioInput = styledComponents.styled.input`
1333
1157
  background-color: ${({ theme }) => theme.colors.neutral0};
1334
1158
  border: 1px solid ${({ theme }) => theme.colors.primary600};
1335
1159
  border-radius: 50%;
1336
- height: ${({ $size }) => getRadioSize($size)};
1337
- width: ${({ $size }) => getRadioSize($size)};
1338
- -webkit-appearance: none;
1160
+ height: 1.8rem;
1161
+ width: 1.8rem;
1339
1162
 
1340
1163
  &:after {
1341
1164
  border-radius: 50%;
@@ -1343,10 +1166,10 @@ const RadioInput = styledComponents.styled.input`
1343
1166
  position: relative;
1344
1167
  z-index: 1;
1345
1168
  display: block;
1346
- height: ${({ $size }) => typeof $size === "number" ? $size : getSelectedRadioSize($size)};
1347
- width: ${({ $size }) => typeof $size === "number" ? $size : getSelectedRadioSize($size)};
1348
- left: ${getSelectedRadioPosition};
1349
- top: ${getSelectedRadioPosition};
1169
+ height: 1rem;
1170
+ width: 1rem;
1171
+ left: 0.3rem;
1172
+ top: 0.3rem;
1350
1173
  }
1351
1174
 
1352
1175
  &:checked:after {
@@ -1358,30 +1181,6 @@ const RadioInput = styledComponents.styled.input`
1358
1181
  background: ${({ theme }) => theme.colors.neutral200};
1359
1182
  }
1360
1183
  `;
1361
- const setTabIndexOnFirstItem = (node, selector) => {
1362
- const list = node.querySelectorAll(selector);
1363
- if (list && list.length > 0) {
1364
- list.item(0).setAttribute("tabindex", "0");
1365
- }
1366
- };
1367
- const RadioGroup = ({
1368
- children,
1369
- labelledBy,
1370
- onChange,
1371
- value = "",
1372
- size = "M",
1373
- name,
1374
- ...props
1375
- }) => {
1376
- const radioGroupRef = React__namespace.useRef(null);
1377
- React__namespace.useLayoutEffect(() => {
1378
- if (!value) {
1379
- setTabIndexOnFirstItem(radioGroupRef.current, `[name="${name}"]`);
1380
- }
1381
- }, [value, name]);
1382
- const context = React__namespace.useMemo(() => ({ onChange, selected: value, name, size }), [name, onChange, size, value]);
1383
- return /* @__PURE__ */ jsxRuntime.jsx(RadioContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: radioGroupRef, role: "radiogroup", "aria-labelledby": labelledBy, ...props, children }) });
1384
- };
1385
1184
  const Divider$1 = () => {
1386
1185
  return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
1387
1186
  };
@@ -1629,7 +1428,7 @@ const Button = forwardRef(
1629
1428
  );
1630
1429
  }
1631
1430
  );
1632
- const rotation$1 = styledComponents.keyframes`
1431
+ const rotation$2 = styledComponents.keyframes`
1633
1432
  from {
1634
1433
  transform: rotate(0deg);
1635
1434
  }
@@ -1638,7 +1437,7 @@ const rotation$1 = styledComponents.keyframes`
1638
1437
  }
1639
1438
  `;
1640
1439
  const LoaderAnimated = styledComponents.styled(icons.Loader)`
1641
- animation: ${rotation$1} 2s infinite linear;
1440
+ animation: ${rotation$2} 2s infinite linear;
1642
1441
  will-change: transform;
1643
1442
  `;
1644
1443
  const ButtonWrapper = styledComponents.styled(BaseButton)`
@@ -1757,8 +1556,8 @@ const Viewport$2 = styledComponents.styled(Flex)`
1757
1556
  display: none;
1758
1557
  }
1759
1558
  `;
1760
- const MenuItem$1 = ({ onSelect, disabled = false, ...props }) => {
1761
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Item, { asChild: true, onSelect, disabled, children: props.isLink || props.isExternal ? /* @__PURE__ */ jsxRuntime.jsx(OptionLink, { color: "neutral800", ...props, isExternal: props.isExternal ?? false, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: props.children }) }) : /* @__PURE__ */ jsxRuntime.jsx(OptionButton, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: props.children }) }) });
1559
+ const MenuItem$1 = ({ onSelect, disabled = false, isLink, ...props }) => {
1560
+ return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Item, { asChild: true, onSelect, disabled, children: isLink || props.isExternal ? /* @__PURE__ */ jsxRuntime.jsx(OptionLink, { color: "neutral800", ...props, isExternal: props.isExternal ?? false, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: props.children }) }) : /* @__PURE__ */ jsxRuntime.jsx(OptionButton, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { children: props.children }) }) });
1762
1561
  };
1763
1562
  const getOptionStyle = ({ theme }) => styledComponents.css`
1764
1563
  text-align: left;
@@ -1955,12 +1754,8 @@ const CardAction = styledComponents.styled(Flex)`
1955
1754
  return void 0;
1956
1755
  }};
1957
1756
  `;
1958
- const CARD_SIZES = {
1959
- S: 8.8,
1960
- M: 16.4
1961
- };
1962
1757
  const CardAsset = ({ size = "M", children, ...props }) => {
1963
- return /* @__PURE__ */ jsxRuntime.jsx(CardAssetWrapper, { $size: size, children: children ? /* @__PURE__ */ jsxRuntime.jsx(Flex, { children }) : /* @__PURE__ */ jsxRuntime.jsx(CardAssetImg, { ...props, "aria-hidden": true }) });
1758
+ return /* @__PURE__ */ jsxRuntime.jsx(CardAssetWrapper, { $size: size, children: children ? children : /* @__PURE__ */ jsxRuntime.jsx(CardAssetImg, { ...props, "aria-hidden": true }) });
1964
1759
  };
1965
1760
  const CardAssetImg = styledComponents.styled.img`
1966
1761
  // inline flows is based on typography and displays an extra white space below the image
@@ -1975,7 +1770,7 @@ const CardAssetImg = styledComponents.styled.img`
1975
1770
  const CardAssetWrapper = styledComponents.styled.div`
1976
1771
  display: flex;
1977
1772
  justify-content: center;
1978
- height: ${({ $size }) => `${CARD_SIZES[$size]}rem`};
1773
+ height: ${({ $size }) => $size === "S" ? "8.8rem" : "16.4rem"};
1979
1774
  width: 100%;
1980
1775
  background: repeating-conic-gradient(${({ theme }) => theme.colors.neutral100} 0% 25%, transparent 0% 50%) 50% / 20px
1981
1776
  20px;
@@ -2028,155 +1823,75 @@ const CardTitle = (props) => {
2028
1823
  const { id } = useCard();
2029
1824
  return /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", id: `${id}-title`, textColor: "neutral800", fontWeight: "bold", tag: "div", ...props });
2030
1825
  };
2031
- const CardSubtitle = (props) => {
2032
- return /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", ...props, textColor: "neutral600", tag: "div" });
2033
- };
2034
- const Portal$1 = React__namespace.forwardRef(
2035
- ({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
2036
- return container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
2037
- }
2038
- );
2039
- Portal$1.displayName = "Portal";
2040
- const useTooltipHandlers = (delay) => {
2041
- const [visible, setVisible] = React__namespace.useState(false);
2042
- const timerRef = React__namespace.useRef(null);
2043
- const clearTimer = () => {
2044
- if (typeof timerRef.current === "number") {
2045
- clearTimeout(timerRef.current);
2046
- timerRef.current = null;
2047
- }
2048
- };
2049
- React__namespace.useEffect(() => {
2050
- return () => {
2051
- clearTimer();
2052
- };
2053
- }, []);
2054
- const onFocus = () => {
2055
- setVisible(true);
2056
- };
2057
- const onBlur = () => {
2058
- setVisible(false);
2059
- };
2060
- const onMouseEnter = () => {
2061
- timerRef.current = setTimeout(() => {
2062
- setVisible(true);
2063
- }, delay);
2064
- };
2065
- const onMouseLeave = () => {
2066
- clearTimer();
2067
- setVisible(false);
2068
- };
2069
- return { visible, onFocus, onBlur, onMouseEnter, onMouseLeave };
2070
- };
2071
- const SPACE_BETWEEN = 8;
2072
- const positionBottom = (tooltipRect, toggleSourceRect) => {
2073
- const widthDifference = (tooltipRect.width - toggleSourceRect.width) / 2;
2074
- const left = toggleSourceRect.left - widthDifference;
2075
- const top = toggleSourceRect.top + toggleSourceRect.height + SPACE_BETWEEN + window.pageYOffset;
2076
- return {
2077
- left,
2078
- top
2079
- };
2080
- };
2081
- const positionRight = (tooltipRect, toggleSourceRect) => {
2082
- const heightDifference = (tooltipRect.height - toggleSourceRect.height) / 2;
2083
- const left = toggleSourceRect.left + toggleSourceRect.width + SPACE_BETWEEN;
2084
- const top = toggleSourceRect.top - heightDifference + window.pageYOffset;
2085
- return { left, top };
2086
- };
2087
- const positionLeft = (tooltipRect, toggleSourceRect) => {
2088
- const heightDifference = (tooltipRect.height - toggleSourceRect.height) / 2;
2089
- const left = toggleSourceRect.left - tooltipRect.width - SPACE_BETWEEN;
2090
- const top = toggleSourceRect.top - heightDifference + window.pageYOffset;
2091
- return { left, top };
2092
- };
2093
- const positionTop = (tooltipRect, toggleSourceRect) => {
2094
- const widthDifference = (tooltipRect.width - toggleSourceRect.width) / 2;
2095
- let left = toggleSourceRect.left - widthDifference;
2096
- let top = toggleSourceRect.top - tooltipRect.height - SPACE_BETWEEN + window.pageYOffset;
2097
- const rightSpaceDifference = window.innerWidth - toggleSourceRect.right;
2098
- const overflowRight = toggleSourceRect.left + tooltipRect.width - rightSpaceDifference;
2099
- if (overflowRight > window.innerWidth) {
2100
- left = toggleSourceRect.left - tooltipRect.width - SPACE_BETWEEN;
2101
- top = toggleSourceRect.top + window.scrollY - toggleSourceRect.height / 2;
2102
- } else if (left < 0) {
2103
- left = toggleSourceRect.width + toggleSourceRect.left + SPACE_BETWEEN;
2104
- top = toggleSourceRect.top + window.scrollY - tooltipRect.height / 2 + SPACE_BETWEEN;
2105
- } else if (top < 0 && left > 0) {
2106
- top = toggleSourceRect.top + toggleSourceRect.height + SPACE_BETWEEN;
2107
- }
2108
- return {
2109
- left,
2110
- top
2111
- };
2112
- };
2113
- const positionTooltip = (tooltipNode, toggleSourceNode, position) => {
2114
- const tooltipRect = tooltipNode.getBoundingClientRect();
2115
- const toggleSourceRect = toggleSourceNode.getBoundingClientRect();
2116
- if (position === "bottom") {
2117
- return positionBottom(tooltipRect, toggleSourceRect);
2118
- }
2119
- if (position === "right") {
2120
- return positionRight(tooltipRect, toggleSourceRect);
2121
- }
2122
- if (position === "left") {
2123
- return positionLeft(tooltipRect, toggleSourceRect);
2124
- }
2125
- return positionTop(tooltipRect, toggleSourceRect);
2126
- };
2127
- const useTooltipLayout = (visible, position) => {
2128
- const tooltipWrapperRef = React__namespace.useRef(null);
2129
- const toggleSourceRef = React__namespace.useRef(null);
2130
- React__namespace.useLayoutEffect(() => {
2131
- if (visible) {
2132
- const tooltip = tooltipWrapperRef.current;
2133
- const toggleSource = toggleSourceRef.current;
2134
- if (tooltip && toggleSource) {
2135
- const tooltipPosition = positionTooltip(tooltip, toggleSource, position);
2136
- tooltip.style.left = `${tooltipPosition.left}px`;
2137
- tooltip.style.top = `${tooltipPosition.top}px`;
2138
- }
2139
- }
2140
- }, [position, visible]);
2141
- return { tooltipWrapperRef, toggleSourceRef };
1826
+ const CardSubtitle = (props) => {
1827
+ return /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", ...props, textColor: "neutral600", tag: "div" });
2142
1828
  };
2143
- const Tooltip = ({ children, label, description, delay = 500, position = "top", id, ...props }) => {
2144
- const tooltipId = useId(id);
2145
- const descriptionId = useId();
2146
- const { visible, ...tooltipHandlers } = useTooltipHandlers(delay);
2147
- const { tooltipWrapperRef, toggleSourceRef } = useTooltipLayout(visible, position);
2148
- const childrenClone = React__namespace.cloneElement(children, {
2149
- tabIndex: 0,
2150
- "aria-labelledby": label ? tooltipId : void 0,
2151
- "aria-describedby": description ? tooltipId : void 0,
2152
- ...tooltipHandlers
2153
- });
2154
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2155
- /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsxs(
2156
- TooltipWrapper,
1829
+ const KeyboardKeys = {
1830
+ DOWN: "ArrowDown",
1831
+ UP: "ArrowUp",
1832
+ RIGHT: "ArrowRight",
1833
+ LEFT: "ArrowLeft",
1834
+ ESCAPE: "Escape",
1835
+ ENTER: "Enter",
1836
+ SPACE: " ",
1837
+ TAB: "Tab",
1838
+ END: "End",
1839
+ HOME: "Home",
1840
+ DELETE: "Delete",
1841
+ PAGE_UP: "PageUp",
1842
+ PAGE_DOWN: "PageDown",
1843
+ BACKSPACE: "Backspace",
1844
+ CLEAR: "Clear"
1845
+ };
1846
+ const TooltipImpl = React__namespace.forwardRef(
1847
+ ({
1848
+ children,
1849
+ description,
1850
+ label,
1851
+ defaultOpen,
1852
+ open,
1853
+ onOpenChange,
1854
+ delayDuration = 500,
1855
+ disableHoverableContent,
1856
+ ...restProps
1857
+ }, forwardedRef) => {
1858
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1859
+ Tooltip__namespace.Root,
2157
1860
  {
2158
- id: tooltipId,
2159
- background: "neutral900",
2160
- hasRadius: true,
2161
- padding: 2,
2162
- role: "tooltip",
2163
- ref: tooltipWrapperRef,
2164
- $visible: visible,
2165
- position: "absolute",
2166
- ...props,
1861
+ defaultOpen,
1862
+ open,
1863
+ onOpenChange,
1864
+ delayDuration,
1865
+ disableHoverableContent,
2167
1866
  children: [
2168
- visible && /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { id: descriptionId, children: description }),
2169
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "p", variant: "pi", fontWeight: "bold", textColor: "neutral0", children: label || description })
1867
+ /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children }),
1868
+ /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { ref: forwardedRef, sideOffset: 8, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", fontWeight: "bold", children: label || description }) }) })
2170
1869
  ]
2171
1870
  }
2172
- ) }),
2173
- /* @__PURE__ */ jsxRuntime.jsx("span", { ref: toggleSourceRef, children: childrenClone })
2174
- ] });
2175
- };
2176
- const TooltipWrapper = styledComponents.styled(Box)`
2177
- /* z-index exist because of its position inside Modals */
2178
- z-index: 4;
2179
- display: ${({ $visible }) => $visible ? "revert" : "none"};
1871
+ );
1872
+ }
1873
+ );
1874
+ const fadeIn = styledComponents.keyframes`
1875
+ from {
1876
+ opacity: 0;
1877
+ }
1878
+ to {
1879
+ opacity: 1;
1880
+ }
1881
+ `;
1882
+ const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
1883
+ background-color: ${(props) => props.theme.colors.neutral900};
1884
+ color: ${(props) => props.theme.colors.neutral0};
1885
+ padding-inline: ${(props) => props.theme.spaces[2]};
1886
+ padding-block: ${(props) => props.theme.spaces[2]};
1887
+ border-radius: ${(props) => props.theme.borderRadius};
1888
+ z-index: ${(props) => props.theme.zIndices.tooltip};
1889
+ will-change: opacity;
1890
+ transform-origin: var(--radix-tooltip-content-transform-origin);
1891
+
1892
+ @media (prefers-reduced-motion: no-preference) {
1893
+ animation: ${fadeIn} 200ms ${(props) => props.theme.easings.authenticMotion};
1894
+ }
2180
1895
  `;
2181
1896
  const CarouselGrid = styledComponents.styled(Box)`
2182
1897
  grid-template-columns: auto 1fr auto;
@@ -2244,41 +1959,43 @@ const Carousel = React__namespace.forwardRef(
2244
1959
  ]
2245
1960
  }
2246
1961
  ),
2247
- secondaryLabel && /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingTop: 2, paddingLeft: 4, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label: secondaryLabel, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral600", ellipsis: true, children: secondaryLabel }) }) }) })
1962
+ secondaryLabel && /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingTop: 2, paddingLeft: 4, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label: secondaryLabel, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral600", ellipsis: true, children: secondaryLabel }) }) }) })
2248
1963
  ] }) });
2249
1964
  }
2250
1965
  );
2251
- const createContext = (rootComponentName, defaultContext) => {
2252
- const Context = React__namespace.createContext(defaultContext);
2253
- const Provider2 = (props) => {
2254
- const { children, ...context } = props;
2255
- const value = React__namespace.useMemo(() => context, Object.values(context));
2256
- return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
2257
- };
2258
- function useContext(consumerName) {
2259
- const context = React__namespace.useContext(Context);
2260
- if (context)
2261
- return context;
2262
- if (defaultContext !== void 0)
2263
- return defaultContext;
2264
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
2265
- }
2266
- Provider2.displayName = `${rootComponentName}Provider`;
2267
- return [Provider2, useContext];
1966
+ const EASINGS = {
1967
+ easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
1968
+ easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
1969
+ easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
1970
+ easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
1971
+ easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
1972
+ easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
1973
+ easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
1974
+ easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
1975
+ easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
1976
+ easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
1977
+ easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
1978
+ easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
1979
+ easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
1980
+ easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
1981
+ easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
1982
+ easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
1983
+ easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
1984
+ easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
1985
+ easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
1986
+ easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
1987
+ easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
1988
+ easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
1989
+ easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
1990
+ easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
1991
+ easeInOutFast: "cubic-bezier(1,0,0,1)",
1992
+ authenticMotion: "cubic-bezier(.4,0,.2,1)"
2268
1993
  };
2269
1994
  const sizes = {
2270
- input: {
2271
- S: `3.2rem`,
2272
- M: `4rem`
2273
- },
2274
1995
  accordions: {
2275
1996
  S: `4.8rem`,
2276
1997
  M: `8.8rem`
2277
1998
  },
2278
- badge: {
2279
- S: `1.6rem`,
2280
- M: `2.4rem`
2281
- },
2282
1999
  button: {
2283
2000
  S: `3.2rem`,
2284
2001
  M: `3.6rem`,
@@ -2287,8 +2004,15 @@ const sizes = {
2287
2004
  };
2288
2005
  const commonTheme = {
2289
2006
  sizes,
2290
- zIndices: [5, 10, 15, 20],
2291
- // TBD
2007
+ zIndices: {
2008
+ navigation: 100,
2009
+ overlay: 300,
2010
+ modal: 310,
2011
+ dialog: 320,
2012
+ popover: 500,
2013
+ notification: 700,
2014
+ tooltip: 1e3
2015
+ },
2292
2016
  spaces: ["0px", "4px", "8px", "12px", "16px", "20px", "24px", "32px", "40px", "48px", "56px", "64px"],
2293
2017
  borderRadius: "4px",
2294
2018
  mediaQueries: {
@@ -2301,7 +2025,8 @@ const commonTheme = {
2301
2025
  regular: 400,
2302
2026
  semiBold: 500,
2303
2027
  bold: 600
2304
- }
2028
+ },
2029
+ easings: EASINGS
2305
2030
  };
2306
2031
  const lightColorTokenObject = {
2307
2032
  color: {
@@ -3129,7 +2854,7 @@ lodash.exports;
3129
2854
  }
3130
2855
  var runInContext = function runInContext2(context) {
3131
2856
  context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
3132
- 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, TypeError2 = context.TypeError;
2857
+ var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
3133
2858
  var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
3134
2859
  var coreJsData = context["__core-js_shared__"];
3135
2860
  var funcToString = funcProto.toString;
@@ -3652,9 +3377,9 @@ lodash.exports;
3652
3377
  }
3653
3378
  function baseDelay(func, wait, args) {
3654
3379
  if (typeof func != "function") {
3655
- throw new TypeError2(FUNC_ERROR_TEXT);
3380
+ throw new TypeError(FUNC_ERROR_TEXT);
3656
3381
  }
3657
- return setTimeout2(function() {
3382
+ return setTimeout(function() {
3658
3383
  func.apply(undefined$1, args);
3659
3384
  }, wait);
3660
3385
  }
@@ -4434,7 +4159,7 @@ lodash.exports;
4434
4159
  end = end === undefined$1 ? length : end;
4435
4160
  return !start && end >= length ? array : baseSlice(array, start, end);
4436
4161
  }
4437
- var clearTimeout2 = ctxClearTimeout || function(id) {
4162
+ var clearTimeout = ctxClearTimeout || function(id) {
4438
4163
  return root.clearTimeout(id);
4439
4164
  };
4440
4165
  function cloneBuffer(buffer, isDeep) {
@@ -4707,7 +4432,7 @@ lodash.exports;
4707
4432
  while (index--) {
4708
4433
  var func = funcs[index];
4709
4434
  if (typeof func != "function") {
4710
- throw new TypeError2(FUNC_ERROR_TEXT);
4435
+ throw new TypeError(FUNC_ERROR_TEXT);
4711
4436
  }
4712
4437
  if (prereq && !wrapper && getFuncName(func) == "wrapper") {
4713
4438
  var wrapper = new LodashWrapper([], true);
@@ -4931,7 +4656,7 @@ lodash.exports;
4931
4656
  function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
4932
4657
  var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
4933
4658
  if (!isBindKey && typeof func != "function") {
4934
- throw new TypeError2(FUNC_ERROR_TEXT);
4659
+ throw new TypeError(FUNC_ERROR_TEXT);
4935
4660
  }
4936
4661
  var length = partials ? partials.length : 0;
4937
4662
  if (!length) {
@@ -5485,7 +5210,7 @@ lodash.exports;
5485
5210
  return object[key];
5486
5211
  }
5487
5212
  var setData = shortOut(baseSetData);
5488
- var setTimeout2 = ctxSetTimeout || function(func, wait) {
5213
+ var setTimeout = ctxSetTimeout || function(func, wait) {
5489
5214
  return root.setTimeout(func, wait);
5490
5215
  };
5491
5216
  var setToString = shortOut(baseSetToString);
@@ -6198,7 +5923,7 @@ lodash.exports;
6198
5923
  };
6199
5924
  function after(n, func) {
6200
5925
  if (typeof func != "function") {
6201
- throw new TypeError2(FUNC_ERROR_TEXT);
5926
+ throw new TypeError(FUNC_ERROR_TEXT);
6202
5927
  }
6203
5928
  n = toInteger(n);
6204
5929
  return function() {
@@ -6215,7 +5940,7 @@ lodash.exports;
6215
5940
  function before(n, func) {
6216
5941
  var result2;
6217
5942
  if (typeof func != "function") {
6218
- throw new TypeError2(FUNC_ERROR_TEXT);
5943
+ throw new TypeError(FUNC_ERROR_TEXT);
6219
5944
  }
6220
5945
  n = toInteger(n);
6221
5946
  return function() {
@@ -6259,7 +5984,7 @@ lodash.exports;
6259
5984
  function debounce(func, wait, options) {
6260
5985
  var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
6261
5986
  if (typeof func != "function") {
6262
- throw new TypeError2(FUNC_ERROR_TEXT);
5987
+ throw new TypeError(FUNC_ERROR_TEXT);
6263
5988
  }
6264
5989
  wait = toNumber(wait) || 0;
6265
5990
  if (isObject2(options)) {
@@ -6277,7 +6002,7 @@ lodash.exports;
6277
6002
  }
6278
6003
  function leadingEdge(time) {
6279
6004
  lastInvokeTime = time;
6280
- timerId = setTimeout2(timerExpired, wait);
6005
+ timerId = setTimeout(timerExpired, wait);
6281
6006
  return leading ? invokeFunc(time) : result2;
6282
6007
  }
6283
6008
  function remainingWait(time) {
@@ -6293,7 +6018,7 @@ lodash.exports;
6293
6018
  if (shouldInvoke(time)) {
6294
6019
  return trailingEdge(time);
6295
6020
  }
6296
- timerId = setTimeout2(timerExpired, remainingWait(time));
6021
+ timerId = setTimeout(timerExpired, remainingWait(time));
6297
6022
  }
6298
6023
  function trailingEdge(time) {
6299
6024
  timerId = undefined$1;
@@ -6305,7 +6030,7 @@ lodash.exports;
6305
6030
  }
6306
6031
  function cancel() {
6307
6032
  if (timerId !== undefined$1) {
6308
- clearTimeout2(timerId);
6033
+ clearTimeout(timerId);
6309
6034
  }
6310
6035
  lastInvokeTime = 0;
6311
6036
  lastArgs = lastCallTime = lastThis = timerId = undefined$1;
@@ -6323,13 +6048,13 @@ lodash.exports;
6323
6048
  return leadingEdge(lastCallTime);
6324
6049
  }
6325
6050
  if (maxing) {
6326
- clearTimeout2(timerId);
6327
- timerId = setTimeout2(timerExpired, wait);
6051
+ clearTimeout(timerId);
6052
+ timerId = setTimeout(timerExpired, wait);
6328
6053
  return invokeFunc(lastCallTime);
6329
6054
  }
6330
6055
  }
6331
6056
  if (timerId === undefined$1) {
6332
- timerId = setTimeout2(timerExpired, wait);
6057
+ timerId = setTimeout(timerExpired, wait);
6333
6058
  }
6334
6059
  return result2;
6335
6060
  }
@@ -6348,7 +6073,7 @@ lodash.exports;
6348
6073
  }
6349
6074
  function memoize(func, resolver) {
6350
6075
  if (typeof func != "function" || resolver != null && typeof resolver != "function") {
6351
- throw new TypeError2(FUNC_ERROR_TEXT);
6076
+ throw new TypeError(FUNC_ERROR_TEXT);
6352
6077
  }
6353
6078
  var memoized = function() {
6354
6079
  var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
@@ -6365,7 +6090,7 @@ lodash.exports;
6365
6090
  memoize.Cache = MapCache;
6366
6091
  function negate(predicate) {
6367
6092
  if (typeof predicate != "function") {
6368
- throw new TypeError2(FUNC_ERROR_TEXT);
6093
+ throw new TypeError(FUNC_ERROR_TEXT);
6369
6094
  }
6370
6095
  return function() {
6371
6096
  var args = arguments;
@@ -6382,7 +6107,7 @@ lodash.exports;
6382
6107
  return !predicate.apply(this, args);
6383
6108
  };
6384
6109
  }
6385
- function once2(func) {
6110
+ function once(func) {
6386
6111
  return before(2, func);
6387
6112
  }
6388
6113
  var overArgs = castRest(function(func, transforms) {
@@ -6409,14 +6134,14 @@ lodash.exports;
6409
6134
  });
6410
6135
  function rest(func, start) {
6411
6136
  if (typeof func != "function") {
6412
- throw new TypeError2(FUNC_ERROR_TEXT);
6137
+ throw new TypeError(FUNC_ERROR_TEXT);
6413
6138
  }
6414
6139
  start = start === undefined$1 ? start : toInteger(start);
6415
6140
  return baseRest(func, start);
6416
6141
  }
6417
6142
  function spread(func, start) {
6418
6143
  if (typeof func != "function") {
6419
- throw new TypeError2(FUNC_ERROR_TEXT);
6144
+ throw new TypeError(FUNC_ERROR_TEXT);
6420
6145
  }
6421
6146
  start = start == null ? 0 : nativeMax(toInteger(start), 0);
6422
6147
  return baseRest(function(args) {
@@ -6430,7 +6155,7 @@ lodash.exports;
6430
6155
  function throttle(func, wait, options) {
6431
6156
  var leading = true, trailing = true;
6432
6157
  if (typeof func != "function") {
6433
- throw new TypeError2(FUNC_ERROR_TEXT);
6158
+ throw new TypeError(FUNC_ERROR_TEXT);
6434
6159
  }
6435
6160
  if (isObject2(options)) {
6436
6161
  leading = "leading" in options ? !!options.leading : leading;
@@ -7246,7 +6971,7 @@ lodash.exports;
7246
6971
  var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
7247
6972
  pairs = !length ? [] : arrayMap(pairs, function(pair) {
7248
6973
  if (typeof pair[1] != "function") {
7249
- throw new TypeError2(FUNC_ERROR_TEXT);
6974
+ throw new TypeError(FUNC_ERROR_TEXT);
7250
6975
  }
7251
6976
  return [toIteratee(pair[0]), pair[1]];
7252
6977
  });
@@ -7503,7 +7228,7 @@ lodash.exports;
7503
7228
  lodash2.nthArg = nthArg;
7504
7229
  lodash2.omit = omit;
7505
7230
  lodash2.omitBy = omitBy;
7506
- lodash2.once = once2;
7231
+ lodash2.once = once;
7507
7232
  lodash2.orderBy = orderBy;
7508
7233
  lodash2.over = over;
7509
7234
  lodash2.overArgs = overArgs;
@@ -8016,17 +7741,12 @@ const LabelAction = styledComponents.styled(Flex)`
8016
7741
  line-height: 0;
8017
7742
  color: ${({ theme }) => theme.colors.neutral500};
8018
7743
  `;
8019
- const PADDING_Y = {
8020
- S: 0.6,
8021
- M: 0.8
8022
- };
8023
7744
  const Input$2 = React__namespace.forwardRef(
8024
7745
  ({
8025
7746
  endAction,
8026
7747
  startAction,
8027
7748
  disabled = false,
8028
7749
  onChange,
8029
- size = "M",
8030
7750
  hasError: hasErrorProp,
8031
7751
  required: requiredProp,
8032
7752
  className,
@@ -8050,6 +7770,8 @@ const Input$2 = React__namespace.forwardRef(
8050
7770
  {
8051
7771
  paddingLeft: 3,
8052
7772
  paddingRight: 3,
7773
+ paddingTop: 2,
7774
+ paddingBottom: 2,
8053
7775
  gap: 2,
8054
7776
  justifyContent: "space-between",
8055
7777
  $hasError: hasError || hasErrorProp,
@@ -8072,7 +7794,6 @@ const Input$2 = React__namespace.forwardRef(
8072
7794
  $hasRightAction: Boolean(endAction),
8073
7795
  onChange: handleChange,
8074
7796
  "aria-required": required || requiredProp,
8075
- $size: size,
8076
7797
  ...props
8077
7798
  }
8078
7799
  ),
@@ -8085,9 +7806,6 @@ const Input$2 = React__namespace.forwardRef(
8085
7806
  const InputElement = styledComponents.styled.input`
8086
7807
  border: none;
8087
7808
  border-radius: ${({ theme }) => theme.borderRadius};
8088
- padding: 0;
8089
- padding-bottom: ${({ $size }) => `${PADDING_Y[$size]}rem`};
8090
- padding-top: ${({ $size }) => `${PADDING_Y[$size]}rem`};
8091
7809
  cursor: ${(props) => props["aria-disabled"] ? "not-allowed" : void 0};
8092
7810
 
8093
7811
  color: ${({ theme }) => theme.colors.neutral800};
@@ -8208,11 +7926,10 @@ const CarouselInput = React__namespace.forwardRef(
8208
7926
  ] }) });
8209
7927
  }
8210
7928
  );
8211
- const CarouselActions = ({ horizontal = true, spacing = 1, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
7929
+ const CarouselActions = ({ horizontal = true, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8212
7930
  Flex,
8213
7931
  {
8214
7932
  justifyContent: "center",
8215
- gap: spacing,
8216
7933
  direction: horizontal ? "row" : "column",
8217
7934
  alignItems: horizontal ? "center" : "stretch",
8218
7935
  position: "absolute",
@@ -8230,7 +7947,7 @@ const CarouselImage = (props) => {
8230
7947
  setIsError(true);
8231
7948
  };
8232
7949
  if (isError) {
8233
- return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { description: props.alt ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(StyledImage, { tag: "img", height: "100%", maxWidth: "100%", ...props }) });
7950
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label: props.alt ?? "", children: /* @__PURE__ */ jsxRuntime.jsx(StyledImage, { tag: "img", height: "100%", maxWidth: "100%", ...props }) });
8234
7951
  }
8235
7952
  return /* @__PURE__ */ jsxRuntime.jsx(StyledImage, { tag: "img", height: "100%", maxWidth: "100%", ...props, onError: handleImageError });
8236
7953
  };
@@ -8264,47 +7981,6 @@ const CheckboxLabel = styledComponents.styled(Typography)`
8264
7981
  cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
8265
7982
  }
8266
7983
  `;
8267
- function useControllableState({
8268
- prop,
8269
- defaultProp,
8270
- onChange = () => {
8271
- }
8272
- }) {
8273
- const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
8274
- const isControlled = prop !== void 0;
8275
- const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
8276
- const value = isControlled ? propValue : uncontrolledProp;
8277
- const handleChange = uiPrimitives.useCallbackRef(onChange);
8278
- const setValue = React__namespace.useCallback(
8279
- (nextValue) => {
8280
- if (isControlled) {
8281
- const setter = nextValue;
8282
- const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
8283
- if (value2 !== propValue) {
8284
- handleChange(value2);
8285
- setUncontrolledProp(nextValue);
8286
- }
8287
- } else {
8288
- setUncontrolledProp(nextValue);
8289
- }
8290
- },
8291
- [isControlled, propValue, setUncontrolledProp, handleChange]
8292
- );
8293
- return [value, setValue];
8294
- }
8295
- function useUncontrolledState({ defaultProp, onChange }) {
8296
- const uncontrolledState = React__namespace.useState(defaultProp);
8297
- const [value] = uncontrolledState;
8298
- const prevValueRef = React__namespace.useRef(value);
8299
- const handleChange = uiPrimitives.useCallbackRef(onChange);
8300
- React__namespace.useEffect(() => {
8301
- if (prevValueRef.current !== value) {
8302
- handleChange(value);
8303
- prevValueRef.current = value;
8304
- }
8305
- }, [value, prevValueRef, handleChange]);
8306
- return uncontrolledState;
8307
- }
8308
7984
  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";
8309
7985
  const Loader = React__namespace.forwardRef(({ children, small = false, ...props }, ref) => {
8310
7986
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "alert", "aria-live": "assertive", ref, ...props, children: [
@@ -8312,7 +7988,7 @@ const Loader = React__namespace.forwardRef(({ children, small = false, ...props
8312
7988
  /* @__PURE__ */ jsxRuntime.jsx(LoaderImg, { src: loaderSvg, "aria-hidden": true, $small: small })
8313
7989
  ] });
8314
7990
  });
8315
- const rotation = styledComponents.keyframes`
7991
+ const rotation$1 = styledComponents.keyframes`
8316
7992
  from {
8317
7993
  transform: rotate(0deg);
8318
7994
  }
@@ -8321,7 +7997,7 @@ const rotation = styledComponents.keyframes`
8321
7997
  }
8322
7998
  `;
8323
7999
  const LoaderImg = styledComponents.styled.img`
8324
- animation: ${rotation} 1s infinite linear;
8000
+ animation: ${rotation$1} 1s infinite linear;
8325
8001
  will-change: transform;
8326
8002
  ${({ $small, theme }) => $small && `width: ${theme.spaces[6]}; height: ${theme.spaces[6]};`}
8327
8003
  `;
@@ -8358,23 +8034,22 @@ const Combobox = React__namespace.forwardRef(
8358
8034
  onLoadMore,
8359
8035
  placeholder = "Select or enter a value",
8360
8036
  required: requiredProp = false,
8361
- size = "M",
8362
8037
  startIcon,
8363
8038
  textValue,
8364
8039
  value,
8365
8040
  ...restProps
8366
8041
  }, forwardedRef) => {
8367
- const [internalIsOpen, setInternalIsOpen] = useControllableState({
8042
+ const [internalIsOpen, setInternalIsOpen] = reactUseControllableState.useControllableState({
8368
8043
  prop: open,
8369
8044
  defaultProp: defaultOpen,
8370
8045
  onChange: onOpenChange
8371
8046
  });
8372
- const [internalTextValue, setInternalTextValue] = useControllableState({
8047
+ const [internalTextValue, setInternalTextValue] = reactUseControllableState.useControllableState({
8373
8048
  prop: textValue,
8374
8049
  defaultProp: allowCustomValue && !defaultTextValue ? value : defaultTextValue,
8375
8050
  onChange: onTextValueChange
8376
8051
  });
8377
- const [internalFilterValue, setInternalFilterValue] = useControllableState({
8052
+ const [internalFilterValue, setInternalFilterValue] = reactUseControllableState.useControllableState({
8378
8053
  prop: filterValue,
8379
8054
  defaultProp: defaultFilterValue,
8380
8055
  onChange: onFilterValueChange
@@ -8458,7 +8133,7 @@ const Combobox = React__namespace.forwardRef(
8458
8133
  onFilterValueChange: handleFilterValueChange,
8459
8134
  isPrintableCharacter: isPrintableCharacter2,
8460
8135
  children: [
8461
- /* @__PURE__ */ jsxRuntime.jsxs(Trigger$1, { $hasError: hasError, $size: size, className, children: [
8136
+ /* @__PURE__ */ jsxRuntime.jsxs(Trigger$1, { $hasError: hasError, className, children: [
8462
8137
  /* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
8463
8138
  startIcon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }) : null,
8464
8139
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -8483,6 +8158,9 @@ const Combobox = React__namespace.forwardRef(
8483
8158
  hasRadius: true,
8484
8159
  background: "transparent",
8485
8160
  type: "button",
8161
+ padding: 0,
8162
+ color: "neutral600",
8163
+ borderStyle: "none",
8486
8164
  onClick: handleClearClick,
8487
8165
  "aria-disabled": disabled,
8488
8166
  "aria-label": clearLabel,
@@ -8515,22 +8193,15 @@ const Combobox = React__namespace.forwardRef(
8515
8193
  }
8516
8194
  );
8517
8195
  const IconBox$3 = styledComponents.styled(Box)`
8518
- border: none;
8519
-
8520
- svg {
8521
- height: 1.1rem;
8522
- width: 1.1rem;
8523
- }
8524
-
8525
- svg path {
8526
- fill: ${({ theme }) => theme.colors.neutral600};
8527
- }
8196
+ padding: 0;
8528
8197
  `;
8529
8198
  const Trigger$1 = styledComponents.styled(uiPrimitives.Combobox.Trigger)`
8530
8199
  position: relative;
8531
8200
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
8532
8201
  padding-right: ${({ theme }) => theme.spaces[3]};
8533
8202
  padding-left: ${({ theme }) => theme.spaces[3]};
8203
+ padding-top: ${({ theme }) => theme.spaces[2]};
8204
+ padding-bottom: ${({ theme }) => theme.spaces[2]};
8534
8205
  border-radius: ${({ theme }) => theme.borderRadius};
8535
8206
  background: ${({ theme }) => theme.colors.neutral0};
8536
8207
  overflow: hidden;
@@ -8538,7 +8209,6 @@ const Trigger$1 = styledComponents.styled(uiPrimitives.Combobox.Trigger)`
8538
8209
  align-items: center;
8539
8210
  justify-content: space-between;
8540
8211
  gap: ${({ theme }) => theme.spaces[4]};
8541
- min-height: ${({ theme, $size }) => getThemeSize("input")({ theme, size: $size })};
8542
8212
 
8543
8213
  &[data-disabled] {
8544
8214
  color: ${({ theme }) => theme.colors.neutral600};
@@ -8556,6 +8226,7 @@ const Trigger$1 = styledComponents.styled(uiPrimitives.Combobox.Trigger)`
8556
8226
  const TextInput$1 = styledComponents.styled(uiPrimitives.Combobox.TextInput)`
8557
8227
  width: 100%;
8558
8228
  font-size: 1.4rem;
8229
+ line-height: 2.2rem;
8559
8230
  color: ${({ theme }) => theme.colors.neutral800};
8560
8231
  padding: 0;
8561
8232
  border: none;
@@ -8570,13 +8241,10 @@ const TextInput$1 = styledComponents.styled(uiPrimitives.Combobox.TextInput)`
8570
8241
  }
8571
8242
  `;
8572
8243
  const DownIcon$1 = styledComponents.styled(uiPrimitives.Combobox.Icon)`
8573
- & > svg {
8574
- width: 0.6rem;
8575
-
8576
- & > path {
8577
- fill: ${({ theme }) => theme.colors.neutral600};
8578
- }
8579
- }
8244
+ border: none;
8245
+ background: transparent;
8246
+ padding: 0;
8247
+ color: ${({ theme }) => theme.colors.neutral600};
8580
8248
 
8581
8249
  &[aria-disabled='true'] {
8582
8250
  cursor: inherit;
@@ -8590,7 +8258,7 @@ const Content$2 = styledComponents.styled(uiPrimitives.Combobox.Content)`
8590
8258
  width: var(--radix-combobox-trigger-width);
8591
8259
  /* This is from the design-system figma file. */
8592
8260
  max-height: 15rem;
8593
- z-index: ${({ theme }) => theme.zIndices[1]};
8261
+ z-index: ${({ theme }) => theme.zIndices.popover};
8594
8262
  `;
8595
8263
  const Viewport$1 = styledComponents.styled(uiPrimitives.Combobox.Viewport)`
8596
8264
  padding: ${({ theme }) => theme.spaces[1]};
@@ -8627,7 +8295,6 @@ const OptionBox = styledComponents.styled.div`
8627
8295
  font-weight: bold;
8628
8296
  }
8629
8297
  `;
8630
- const ComboboxOption = Option;
8631
8298
  const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
8632
8299
  const useLockScroll = (lockScroll) => {
8633
8300
  React__namespace.useEffect(() => {
@@ -8713,6 +8380,12 @@ const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...pr
8713
8380
  };
8714
8381
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
8715
8382
  };
8383
+ const Portal$1 = React__namespace.forwardRef(
8384
+ ({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
8385
+ return container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
8386
+ }
8387
+ );
8388
+ Portal$1.displayName = "Portal";
8716
8389
  const DialogWrapper = styledComponents.styled(Box)`
8717
8390
  inset: 0;
8718
8391
  background: ${({ theme }) => setOpacity(theme.colors.neutral800, 0.2)};
@@ -8726,7 +8399,7 @@ const DialogContainer = styledComponents.styled(Box)`
8726
8399
  const DialogHeader = styledComponents.styled(Flex)`
8727
8400
  border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
8728
8401
  `;
8729
- const Dialog = ({ onClose, title, as = "h2", isOpen, id, zIndex = 4, ...props }) => {
8402
+ const Dialog = ({ onClose, title, as = "h2", isOpen, id, zIndex = "dialog", ...props }) => {
8730
8403
  const generatedId = useId(id);
8731
8404
  useLockScroll(isOpen);
8732
8405
  if (!isOpen) {
@@ -8747,67 +8420,160 @@ const Dialog = ({ onClose, title, as = "h2", isOpen, id, zIndex = 4, ...props })
8747
8420
  /* @__PURE__ */ jsxRuntime.jsx(Box, { ...props })
8748
8421
  ]
8749
8422
  }
8750
- ) }) }) }) });
8423
+ ) }) }) }) });
8424
+ };
8425
+ const IconContainer = styledComponents.styled(Box)`
8426
+ svg {
8427
+ width: ${({ theme }) => theme.spaces[6]};
8428
+ height: ${({ theme }) => theme.spaces[6]};
8429
+
8430
+ path {
8431
+ fill: ${({ theme }) => theme.colors.danger600};
8432
+ }
8433
+ }
8434
+ `;
8435
+ const DialogBody = ({ children, icon }) => {
8436
+ return /* @__PURE__ */ jsxRuntime.jsxs(Box, { paddingTop: 8, paddingBottom: 8, paddingLeft: 6, paddingRight: 6, children: [
8437
+ icon && /* @__PURE__ */ jsxRuntime.jsx(IconContainer, { paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { justifyContent: "center", children: icon }) }),
8438
+ children
8439
+ ] });
8440
+ };
8441
+ const FooterWrapper = styledComponents.styled(Box)`
8442
+ border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
8443
+
8444
+ button {
8445
+ width: 100%;
8446
+ display: inline-flex;
8447
+ justify-content: center;
8448
+ }
8449
+ `;
8450
+ const DialogFooter = ({ startAction, endAction }) => {
8451
+ return /* @__PURE__ */ jsxRuntime.jsx(FooterWrapper, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
8452
+ startAction,
8453
+ endAction
8454
+ ] }) });
8455
+ };
8456
+ let $3db38b7d1fb3fe6a$var$count = 0;
8457
+ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
8458
+ React.useEffect(() => {
8459
+ var _edgeGuards$, _edgeGuards$2;
8460
+ const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
8461
+ document.body.insertAdjacentElement("afterbegin", (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
8462
+ document.body.insertAdjacentElement("beforeend", (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
8463
+ $3db38b7d1fb3fe6a$var$count++;
8464
+ return () => {
8465
+ if ($3db38b7d1fb3fe6a$var$count === 1)
8466
+ document.querySelectorAll("[data-radix-focus-guard]").forEach(
8467
+ (node) => node.remove()
8468
+ );
8469
+ $3db38b7d1fb3fe6a$var$count--;
8470
+ };
8471
+ }, []);
8472
+ }
8473
+ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
8474
+ const element = document.createElement("span");
8475
+ element.setAttribute("data-radix-focus-guard", "");
8476
+ element.tabIndex = 0;
8477
+ element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
8478
+ return element;
8479
+ }
8480
+ function useControllableState({
8481
+ prop,
8482
+ defaultProp,
8483
+ onChange = () => {
8484
+ }
8485
+ }) {
8486
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
8487
+ const isControlled = prop !== void 0;
8488
+ const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
8489
+ const value = isControlled ? propValue : uncontrolledProp;
8490
+ const handleChange = uiPrimitives.useCallbackRef(onChange);
8491
+ const setValue = React__namespace.useCallback(
8492
+ (nextValue) => {
8493
+ if (isControlled) {
8494
+ const setter = nextValue;
8495
+ const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
8496
+ if (value2 !== propValue) {
8497
+ handleChange(value2);
8498
+ setUncontrolledProp(nextValue);
8499
+ }
8500
+ } else {
8501
+ setUncontrolledProp(nextValue);
8502
+ }
8503
+ },
8504
+ [isControlled, propValue, setUncontrolledProp, handleChange]
8505
+ );
8506
+ return [value, setValue];
8507
+ }
8508
+ function useUncontrolledState({ defaultProp, onChange }) {
8509
+ const uncontrolledState = React__namespace.useState(defaultProp);
8510
+ const [value] = uncontrolledState;
8511
+ const prevValueRef = React__namespace.useRef(value);
8512
+ const handleChange = uiPrimitives.useCallbackRef(onChange);
8513
+ React__namespace.useEffect(() => {
8514
+ if (prevValueRef.current !== value) {
8515
+ handleChange(value);
8516
+ prevValueRef.current = value;
8517
+ }
8518
+ }, [value, prevValueRef, handleChange]);
8519
+ return uncontrolledState;
8520
+ }
8521
+ function useDateFormatter(locale, options) {
8522
+ const lastOptions = React__namespace.useRef(null);
8523
+ if (options && lastOptions.current && isEqual(options, lastOptions.current)) {
8524
+ options = lastOptions.current;
8525
+ }
8526
+ lastOptions.current = options ?? null;
8527
+ return React__namespace.useMemo(() => new date.DateFormatter(locale, options), [locale, options]);
8528
+ }
8529
+ function isEqual(a, b) {
8530
+ if (a === b) {
8531
+ return true;
8532
+ }
8533
+ const aKeys = Object.keys(a);
8534
+ const bKeys = Object.keys(b);
8535
+ if (aKeys.length !== bKeys.length) {
8536
+ return false;
8537
+ }
8538
+ for (const key of aKeys) {
8539
+ if (b[key] !== a[key]) {
8540
+ return false;
8541
+ }
8542
+ }
8543
+ return true;
8544
+ }
8545
+ const LiveRegionIds = {
8546
+ Log: "live-region-log",
8547
+ Status: "live-region-status",
8548
+ Alert: "live-region-alert"
8751
8549
  };
8752
- const IconContainer = styledComponents.styled(Box)`
8753
- svg {
8754
- width: ${({ theme }) => theme.spaces[6]};
8755
- height: ${({ theme }) => theme.spaces[6]};
8756
-
8757
- path {
8758
- fill: ${({ theme }) => theme.colors.danger600};
8759
- }
8550
+ const notifyLog = (message) => {
8551
+ const logEl = document.querySelector(`#${LiveRegionIds.Log}`);
8552
+ if (logEl) {
8553
+ logEl.innerText = message;
8760
8554
  }
8761
- `;
8762
- const DialogBody = ({ children, icon }) => {
8763
- return /* @__PURE__ */ jsxRuntime.jsxs(Box, { paddingTop: 8, paddingBottom: 8, paddingLeft: 6, paddingRight: 6, children: [
8764
- icon && /* @__PURE__ */ jsxRuntime.jsx(IconContainer, { paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { justifyContent: "center", children: icon }) }),
8765
- children
8766
- ] });
8767
8555
  };
8768
- const FooterWrapper = styledComponents.styled(Box)`
8769
- border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
8770
-
8771
- button {
8772
- width: 100%;
8773
- display: inline-flex;
8774
- justify-content: center;
8556
+ const notifyStatus = (message) => {
8557
+ const statusEl = document.querySelector(`#${LiveRegionIds.Status}`);
8558
+ if (statusEl) {
8559
+ statusEl.innerText = message;
8775
8560
  }
8776
- `;
8777
- const DialogFooter = ({ startAction, endAction }) => {
8778
- return /* @__PURE__ */ jsxRuntime.jsx(FooterWrapper, { padding: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
8779
- startAction,
8780
- endAction
8781
- ] }) });
8782
8561
  };
8783
- let $3db38b7d1fb3fe6a$var$count = 0;
8784
- function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
8785
- React.useEffect(() => {
8786
- var _edgeGuards$, _edgeGuards$2;
8787
- const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
8788
- document.body.insertAdjacentElement("afterbegin", (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
8789
- document.body.insertAdjacentElement("beforeend", (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
8790
- $3db38b7d1fb3fe6a$var$count++;
8562
+ const notifyAlert = (message) => {
8563
+ const alertEl = document.querySelector(`#${LiveRegionIds.Alert}`);
8564
+ if (alertEl) {
8565
+ alertEl.innerText = message;
8566
+ }
8567
+ };
8568
+ const useNotifyAT = () => {
8569
+ React__namespace.useEffect(() => {
8791
8570
  return () => {
8792
- if ($3db38b7d1fb3fe6a$var$count === 1)
8793
- document.querySelectorAll("[data-radix-focus-guard]").forEach(
8794
- (node) => node.remove()
8795
- );
8796
- $3db38b7d1fb3fe6a$var$count--;
8571
+ notifyLog("");
8572
+ notifyAlert("");
8573
+ notifyStatus("");
8797
8574
  };
8798
8575
  }, []);
8799
- }
8800
- function $3db38b7d1fb3fe6a$var$createFocusGuard() {
8801
- const element = document.createElement("span");
8802
- element.setAttribute("data-radix-focus-guard", "");
8803
- element.tabIndex = 0;
8804
- element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
8805
- return element;
8806
- }
8807
- const LiveRegionIds = {
8808
- Log: "live-region-log",
8809
- Status: "live-region-status",
8810
- Alert: "live-region-alert"
8576
+ return { notifyLog, notifyAlert, notifyStatus };
8811
8577
  };
8812
8578
  const LiveRegions = () => {
8813
8579
  return /* @__PURE__ */ jsxRuntime.jsxs(VisuallyHidden, { children: [
@@ -8855,6 +8621,7 @@ ${styledComponents.css`
8855
8621
  button,
8856
8622
  textarea,
8857
8623
  select {
8624
+ padding: 0;
8858
8625
  font: inherit;
8859
8626
  }
8860
8627
 
@@ -8908,16 +8675,6 @@ ${styledComponents.css`
8908
8675
  }
8909
8676
  `}
8910
8677
  `;
8911
- const ThemeProvider = ({ children, theme = lightTheme }) => {
8912
- return /* @__PURE__ */ jsxRuntime.jsxs(styledComponents.ThemeProvider, { theme, children: [
8913
- children,
8914
- /* @__PURE__ */ jsxRuntime.jsx(LiveRegions, {}),
8915
- /* @__PURE__ */ jsxRuntime.jsx(GlobalStyle, {})
8916
- ] });
8917
- };
8918
- const useTheme = () => {
8919
- return styledComponents.useTheme();
8920
- };
8921
8678
  const DEFAULT_LOCALE = "en-EN";
8922
8679
  const getDefaultLocale = () => {
8923
8680
  if (typeof navigator === "undefined") {
@@ -8931,49 +8688,20 @@ const getDefaultLocale = () => {
8931
8688
  const [Provider, useDesignSystem] = createContext("StrapiDesignSystem", {
8932
8689
  locale: getDefaultLocale()
8933
8690
  });
8934
- const DesignSystemProvider = ({ locale = getDefaultLocale(), ...restProps }) => {
8935
- return /* @__PURE__ */ jsxRuntime.jsx(Provider, { locale, children: /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { ...restProps }) });
8936
- };
8937
- const PREFIX = "[@strapi/design-system]:";
8938
- const once = (fn) => {
8939
- const func = fn;
8940
- let called = false;
8941
- if (typeof func !== "function") {
8942
- throw new TypeError(`${PREFIX} once requires a function parameter`);
8943
- }
8944
- return (...args) => {
8945
- if (!called) {
8946
- func(...args);
8947
- called = true;
8948
- }
8949
- };
8691
+ const DesignSystemProvider = ({
8692
+ children,
8693
+ locale = getDefaultLocale(),
8694
+ theme = lightTheme,
8695
+ tooltipConfig
8696
+ }) => {
8697
+ return /* @__PURE__ */ jsxRuntime.jsx(Provider, { locale, children: /* @__PURE__ */ jsxRuntime.jsxs(styledComponents.ThemeProvider, { theme, children: [
8698
+ /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Provider, { ...tooltipConfig, children }),
8699
+ /* @__PURE__ */ jsxRuntime.jsx(LiveRegions, {}),
8700
+ /* @__PURE__ */ jsxRuntime.jsx(GlobalStyle, {})
8701
+ ] }) });
8950
8702
  };
8951
- function useDateFormatter(locale, options) {
8952
- const lastOptions = React__namespace.useRef(null);
8953
- if (options && lastOptions.current && isEqual(options, lastOptions.current)) {
8954
- options = lastOptions.current;
8955
- }
8956
- lastOptions.current = options ?? null;
8957
- return React__namespace.useMemo(() => new date.DateFormatter(locale, options), [locale, options]);
8958
- }
8959
- function isEqual(a, b) {
8960
- if (a === b) {
8961
- return true;
8962
- }
8963
- const aKeys = Object.keys(a);
8964
- const bKeys = Object.keys(b);
8965
- if (aKeys.length !== bKeys.length) {
8966
- return false;
8967
- }
8968
- for (const key of aKeys) {
8969
- if (b[key] !== a[key]) {
8970
- return false;
8971
- }
8972
- }
8973
- return true;
8974
- }
8975
8703
  const SelectTrigger = React__namespace.forwardRef(
8976
- ({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, size = "M", children, id, ...restProps }, ref) => {
8704
+ ({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, ...restProps }, ref) => {
8977
8705
  const triggerRef = React__namespace.useRef(null);
8978
8706
  const handleClearClick = (e) => {
8979
8707
  if (onClear && !disabled) {
@@ -8988,7 +8716,6 @@ const SelectTrigger = React__namespace.forwardRef(
8988
8716
  {
8989
8717
  "aria-disabled": disabled,
8990
8718
  $hasError: hasError,
8991
- $size: size,
8992
8719
  ref: composedRefs,
8993
8720
  alignItems: "center",
8994
8721
  justifyContent: "space-between",
@@ -8998,8 +8725,8 @@ const SelectTrigger = React__namespace.forwardRef(
8998
8725
  background: disabled ? "neutral150" : "neutral0",
8999
8726
  paddingLeft: 3,
9000
8727
  paddingRight: 3,
9001
- paddingTop: 1,
9002
- paddingBottom: 1,
8728
+ paddingTop: 2,
8729
+ paddingBottom: 2,
9003
8730
  gap: 4,
9004
8731
  cursor: "default",
9005
8732
  "aria-labelledby": labelNode ? `${id}-label` : void 0,
@@ -9047,7 +8774,6 @@ const IconBox$2 = styledComponents.styled(Box)`
9047
8774
  `;
9048
8775
  const StyledTrigger = styledComponents.styled(Flex)`
9049
8776
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
9050
- min-height: ${({ theme, $size }) => getThemeSize("input")({ theme, size: $size })};
9051
8777
 
9052
8778
  &[aria-disabled='true'] {
9053
8779
  color: ${(props) => props.theme.colors.neutral600};
@@ -9062,13 +8788,14 @@ const StyledTrigger = styledComponents.styled(Flex)`
9062
8788
  `;
9063
8789
  const DownIcon = styledComponents.styled(uiPrimitives.Select.Icon)`
9064
8790
  & > svg {
9065
- width: 1.2rem;
9066
8791
  fill: ${({ theme }) => theme.colors.neutral600};
9067
8792
  }
9068
8793
  `;
9069
8794
  const SelectValue = React__namespace.forwardRef(({ children, placeholder, ...restProps }, ref) => /* @__PURE__ */ jsxRuntime.jsx(ValueType, { ref, ellipsis: true, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(StyledValue, { placeholder, children }) }));
9070
8795
  const ValueType = styledComponents.styled(Typography)`
9071
8796
  flex: 1;
8797
+ font-size: 1.4rem;
8798
+ line-height: 2.2rem;
9072
8799
  `;
9073
8800
  const StyledValue = styledComponents.styled(uiPrimitives.Select.Value)`
9074
8801
  display: flex;
@@ -9083,7 +8810,7 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
9083
8810
  min-width: var(--radix-select-trigger-width);
9084
8811
  /* This is from the design-system figma file. */
9085
8812
  max-height: 15rem;
9086
- z-index: ${({ theme }) => theme.zIndices[1]};
8813
+ z-index: ${({ theme }) => theme.zIndices.popover};
9087
8814
  `;
9088
8815
  const SelectViewport = styledComponents.styled(uiPrimitives.Select.Viewport)`
9089
8816
  padding: ${({ theme }) => theme.spaces[1]};
@@ -9147,7 +8874,6 @@ const SingleSelect = React__namespace.forwardRef(
9147
8874
  placeholder,
9148
8875
  required: requiredProp,
9149
8876
  startIcon,
9150
- size = "M",
9151
8877
  value: passedValue,
9152
8878
  ...restProps
9153
8879
  }, forwardedRef) => {
@@ -9216,7 +8942,6 @@ const SingleSelect = React__namespace.forwardRef(
9216
8942
  id,
9217
8943
  name,
9218
8944
  startIcon,
9219
- size,
9220
8945
  hasError,
9221
8946
  disabled,
9222
8947
  clearLabel,
@@ -9259,7 +8984,7 @@ const DatePicker$1 = React__namespace.forwardRef(
9259
8984
  minDate,
9260
8985
  monthSelectLabel = "Month",
9261
8986
  onChange,
9262
- selectedDate,
8987
+ value: valueProp,
9263
8988
  yearSelectLabel = "Year",
9264
8989
  /**
9265
8990
  * Combobox props
@@ -9271,17 +8996,6 @@ const DatePicker$1 = React__namespace.forwardRef(
9271
8996
  required: requiredProp = false,
9272
8997
  onClear,
9273
8998
  clearLabel = "Clear",
9274
- size,
9275
- /**
9276
- * @preserve
9277
- * @deprecated This is no longer used.
9278
- */
9279
- ariaLabel: _ariaLabel,
9280
- /**
9281
- * @preserve
9282
- * @deprecated This is no longer used.
9283
- */
9284
- selectedDateLabel: _selectedDateLabel,
9285
8999
  ...restProps
9286
9000
  }, ref) => {
9287
9001
  const timeZone = date.getLocalTimeZone();
@@ -9299,7 +9013,7 @@ const DatePicker$1 = React__namespace.forwardRef(
9299
9013
  const [textValue, setTextValue] = React__namespace.useState();
9300
9014
  const [value, setValue] = useControllableState({
9301
9015
  defaultProp: initialDate ? convertUTCDateToCalendarDate(initialDate) : void 0,
9302
- prop: selectedDate ? convertUTCDateToCalendarDate(selectedDate) : void 0,
9016
+ prop: valueProp ? convertUTCDateToCalendarDate(valueProp) : void 0,
9303
9017
  onChange(date2) {
9304
9018
  if (onChange) {
9305
9019
  onChange(date2?.toDate(timeZone));
@@ -9342,14 +9056,14 @@ const DatePicker$1 = React__namespace.forwardRef(
9342
9056
  [value]
9343
9057
  );
9344
9058
  React__namespace.useLayoutEffect(() => {
9345
- if (selectedDate) {
9346
- const date2 = convertUTCDateToCalendarDate(selectedDate);
9059
+ if (valueProp) {
9060
+ const date2 = convertUTCDateToCalendarDate(valueProp);
9347
9061
  setTextValue(formatter.format(date2.toDate(timeZone)));
9348
9062
  setCalendarDate(date2);
9349
9063
  } else {
9350
9064
  setTextValue("");
9351
9065
  }
9352
- }, [selectedDate, formatter, timeZone]);
9066
+ }, [valueProp, formatter, timeZone]);
9353
9067
  React__namespace.useLayoutEffect(() => {
9354
9068
  if (initialDate && textValue === void 0) {
9355
9069
  const date2 = convertUTCDateToCalendarDate(initialDate);
@@ -9392,8 +9106,8 @@ const DatePicker$1 = React__namespace.forwardRef(
9392
9106
  trigger,
9393
9107
  value,
9394
9108
  children: [
9395
- /* @__PURE__ */ jsxRuntime.jsxs(DatePickerTrigger, { className, size, hasError, children: [
9396
- /* @__PURE__ */ jsxRuntime.jsx(StyledCalendarIcon, { "aria-hidden": true }),
9109
+ /* @__PURE__ */ jsxRuntime.jsxs(DatePickerTrigger, { className, hasError, children: [
9110
+ /* @__PURE__ */ jsxRuntime.jsx(icons.Calendar, { fill: "neutral500", "aria-hidden": true }),
9397
9111
  /* @__PURE__ */ jsxRuntime.jsx(DatePickerTextInput, { ref, "aria-describedby": ariaDescription, id, name, ...restProps }),
9398
9112
  textValue && onClear ? /* @__PURE__ */ jsxRuntime.jsx(
9399
9113
  IconBox$1,
@@ -9438,7 +9152,7 @@ const makeInitialCalendarDate = ({ currentValue, minDate, maxDate }) => {
9438
9152
  };
9439
9153
  const DATE_PICKER_TRIGGER_NAME = "DatePickerTrigger";
9440
9154
  const DatePickerTrigger = React__namespace.forwardRef(
9441
- ({ hasError, size = "M", ...restProps }, forwardedRef) => {
9155
+ ({ hasError, ...restProps }, forwardedRef) => {
9442
9156
  const context = useDatePickerContext(DATE_PICKER_TRIGGER_NAME);
9443
9157
  const composedRefs = useComposedRefs(forwardedRef, (node) => context.onTriggerChange(node));
9444
9158
  const handleOpenChange = () => {
@@ -9463,7 +9177,6 @@ const DatePickerTrigger = React__namespace.forwardRef(
9463
9177
  {
9464
9178
  ref: composedRefs,
9465
9179
  $hasError: hasError,
9466
- $size: size,
9467
9180
  ...restProps,
9468
9181
  paddingLeft: 3,
9469
9182
  paddingRight: 3,
@@ -9496,7 +9209,11 @@ const DatePickerTrigger = React__namespace.forwardRef(
9496
9209
  );
9497
9210
  const TriggerElement = styledComponents.styled(Flex)`
9498
9211
  border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
9499
- min-height: ${({ theme, $size }) => getThemeSize("input")({ theme, size: $size })};
9212
+ padding-block: ${({ theme }) => theme.spaces[2]};
9213
+
9214
+ & > svg {
9215
+ flex: 1 0 auto;
9216
+ }
9500
9217
 
9501
9218
  &[data-disabled] {
9502
9219
  color: ${({ theme }) => theme.colors.neutral600};
@@ -9513,20 +9230,9 @@ const TriggerElement = styledComponents.styled(Flex)`
9513
9230
  `;
9514
9231
  const IconBox$1 = styledComponents.styled(Box)`
9515
9232
  border: none;
9516
-
9517
- svg {
9518
- height: 1.1rem;
9519
- width: 1.1rem;
9520
- }
9521
-
9522
- svg path {
9523
- fill: ${({ theme }) => theme.colors.neutral600};
9524
- }
9525
- `;
9526
- const StyledCalendarIcon = styledComponents.styled(icons.Calendar)`
9527
- & > path {
9528
- fill: ${({ theme }) => theme.colors.neutral500};
9529
- }
9233
+ color: ${({ theme }) => theme.colors.neutral600};
9234
+ padding: 0;
9235
+ cursor: pointer;
9530
9236
  `;
9531
9237
  const DATE_PICKER_TEXT_INPUT_NAME = "DatePickerTextInput";
9532
9238
  const DatePickerTextInput = React__namespace.forwardRef(
@@ -9710,8 +9416,8 @@ function constrainValue(date$1, minValue, maxValue) {
9710
9416
  const Input$1 = styledComponents.styled.input`
9711
9417
  width: 100%;
9712
9418
  font-size: 1.4rem;
9419
+ line-height: 2.2rem;
9713
9420
  color: ${({ theme }) => theme.colors.neutral800};
9714
- height: 100%;
9715
9421
  border: none;
9716
9422
  background-color: transparent;
9717
9423
 
@@ -9810,7 +9516,7 @@ const DatePickerContentImpl = React__namespace.forwardRef(
9810
9516
  );
9811
9517
  const ContentElement = styledComponents.styled(Box)`
9812
9518
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
9813
- z-index: ${({ theme }) => theme.zIndices[0]};
9519
+ z-index: ${({ theme }) => theme.zIndices.popover};
9814
9520
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
9815
9521
  `;
9816
9522
  const DATE_PICKER_CALENDAR_NAME = "DatePickerCalendar";
@@ -9860,22 +9566,12 @@ const DatePickerCalendar = React__namespace.forwardRef(
9860
9566
  SingleSelect,
9861
9567
  {
9862
9568
  "aria-label": monthSelectLabel,
9863
- size: "S",
9864
9569
  value: months[calendarDate.month - 1],
9865
9570
  onChange: handleMonthChange,
9866
9571
  children: months.map((month) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: month, children: month }, month))
9867
9572
  }
9868
9573
  ) }),
9869
- /* @__PURE__ */ jsxRuntime.jsx(Root$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
9870
- SingleSelect,
9871
- {
9872
- size: "S",
9873
- value: calendarDate.year.toString(),
9874
- "aria-label": yearSelectLabel,
9875
- onChange: handleYearChange,
9876
- children: years.map((year) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: year, children: year }, year))
9877
- }
9878
- ) })
9574
+ /* @__PURE__ */ jsxRuntime.jsx(Root$1, { children: /* @__PURE__ */ jsxRuntime.jsx(SingleSelect, { value: calendarDate.year.toString(), "aria-label": yearSelectLabel, onChange: handleYearChange, children: years.map((year) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: year, children: year }, year)) }) })
9879
9575
  ] }),
9880
9576
  /* @__PURE__ */ jsxRuntime.jsxs("table", { role: "grid", children: [
9881
9577
  /* @__PURE__ */ jsxRuntime.jsx("thead", { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-rowindex": 0, children: weekDays.map((day, index) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerHeaderCell, { "aria-colindex": index, children: day }, day)) }) }),
@@ -10016,19 +9712,7 @@ const Cell = styledComponents.styled(Box)`
10016
9712
  }
10017
9713
  }
10018
9714
  `;
10019
- const warnOnce$1 = once(console.warn);
10020
9715
  const convertUTCDateToCalendarDate = (date$1) => {
10021
- if (typeof date$1 === "string") {
10022
- warnOnce$1(
10023
- "It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead."
10024
- );
10025
- const timestamp = Date.parse(date$1);
10026
- if (!Number.isNaN(timestamp)) {
10027
- date$1 = new Date(timestamp);
10028
- } else {
10029
- date$1 = /* @__PURE__ */ new Date();
10030
- }
10031
- }
10032
9716
  const utcDateString = date$1.toISOString();
10033
9717
  const zonedDateTime = date.parseAbsolute(utcDateString, "UTC");
10034
9718
  return date.toCalendarDate(zonedDateTime);
@@ -10040,7 +9724,7 @@ const TimePicker$1 = React__namespace.forwardRef(
10040
9724
  ({ step = 15, value: valueProp, defaultValue, onChange, ...restProps }, forwardedRef) => {
10041
9725
  const context = useDesignSystem("TimePicker");
10042
9726
  const [textValue, setTextValue] = React__namespace.useState("");
10043
- const [value, setValue] = useControllableState({
9727
+ const [value, setValue] = reactUseControllableState.useControllableState({
10044
9728
  prop: valueProp,
10045
9729
  defaultProp: defaultValue,
10046
9730
  onChange
@@ -10147,7 +9831,6 @@ const DateTimePicker = React__namespace.forwardRef(
10147
9831
  onChange,
10148
9832
  onClear,
10149
9833
  required = false,
10150
- size = "M",
10151
9834
  step,
10152
9835
  value,
10153
9836
  initialDate,
@@ -10210,10 +9893,9 @@ const DateTimePicker = React__namespace.forwardRef(
10210
9893
  DatePicker,
10211
9894
  {
10212
9895
  ...props,
10213
- selectedDate: dateValue?.toDate("UTC"),
9896
+ value: dateValue?.toDate("UTC"),
10214
9897
  onChange: handleDateChange,
10215
9898
  required,
10216
- size,
10217
9899
  onClear: onClear ? handleDateClear : void 0,
10218
9900
  clearLabel: `${clearLabel} date`,
10219
9901
  disabled,
@@ -10224,7 +9906,6 @@ const DateTimePicker = React__namespace.forwardRef(
10224
9906
  /* @__PURE__ */ jsxRuntime.jsx(Root$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
10225
9907
  TimePicker,
10226
9908
  {
10227
- size,
10228
9909
  hasError,
10229
9910
  value: timeValue,
10230
9911
  onChange: handleTimeChange,
@@ -10239,19 +9920,7 @@ const DateTimePicker = React__namespace.forwardRef(
10239
9920
  ] });
10240
9921
  }
10241
9922
  );
10242
- const warnOnce = once(console.warn);
10243
9923
  const convertUTCDateToCalendarDateTime = (date$1, resetTime = true) => {
10244
- if (typeof date$1 === "string") {
10245
- warnOnce(
10246
- "It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead."
10247
- );
10248
- const timestamp = Date.parse(date$1);
10249
- if (!Number.isNaN(timestamp)) {
10250
- date$1 = new Date(timestamp);
10251
- } else {
10252
- date$1 = /* @__PURE__ */ new Date();
10253
- }
10254
- }
10255
9924
  const utcDateString = date$1.toISOString();
10256
9925
  let zonedDateTime = date.parseAbsoluteToLocal(utcDateString);
10257
9926
  if (resetTime) {
@@ -10264,10 +9933,9 @@ const DividerWrapper = styledComponents.styled(Box)`
10264
9933
  border: none;
10265
9934
  /* If contained in a Flex parent we want to prevent the Divider to shink */
10266
9935
  flex-shrink: 0;
10267
- ${({ $unsetMargin }) => $unsetMargin ? "margin: 0;" : ""}
10268
9936
  `;
10269
- const Divider = ({ unsetMargin = true, ...props }) => {
10270
- return /* @__PURE__ */ jsxRuntime.jsx(DividerWrapper, { ...props, background: "neutral150", tag: "hr", $unsetMargin: unsetMargin });
9937
+ const Divider = (props) => {
9938
+ return /* @__PURE__ */ jsxRuntime.jsx(DividerWrapper, { ...props, background: "neutral150", tag: "hr" });
10271
9939
  };
10272
9940
  const EmptyStateIconWrapper = styledComponents.styled(Box)`
10273
9941
  svg {
@@ -10328,15 +9996,12 @@ const IconButton = forwardRef(
10328
9996
  ({
10329
9997
  label,
10330
9998
  background,
10331
- borderWidth,
10332
- noBorder = false,
10333
9999
  children,
10334
- icon,
10335
10000
  disabled = false,
10336
10001
  onClick,
10337
10002
  size = SIZES[0],
10338
- "aria-label": ariaLabel,
10339
10003
  variant: variant2 = VARIANTS[0],
10004
+ withTooltip = true,
10340
10005
  ...restProps
10341
10006
  }, ref) => {
10342
10007
  const handleClick = (e) => {
@@ -10344,29 +10009,21 @@ const IconButton = forwardRef(
10344
10009
  onClick(e);
10345
10010
  }
10346
10011
  };
10347
- const component = /* @__PURE__ */ jsxRuntime.jsxs(
10012
+ const component = /* @__PURE__ */ jsxRuntime.jsx(
10348
10013
  IconButtonWrapper,
10349
10014
  {
10350
10015
  "aria-disabled": disabled,
10351
10016
  background: disabled ? "neutral150" : background,
10352
- borderWidth: noBorder ? 0 : borderWidth,
10353
10017
  justifyContent: "center",
10354
10018
  ...restProps,
10355
10019
  ref,
10356
10020
  $size: size,
10357
10021
  onClick: handleClick,
10358
10022
  $variant: variant2,
10359
- children: [
10360
- /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children: label ?? ariaLabel }),
10361
- React__namespace.cloneElement(icon || children, {
10362
- "aria-hidden": true,
10363
- focusable: false
10364
- // See: https://allyjs.io/tutorials/focusing-in-svg.html#making-svg-elements-focusable
10365
- })
10366
- ]
10023
+ children: /* @__PURE__ */ jsxRuntime.jsx(AccessibleIcon, { label, children })
10367
10024
  }
10368
10025
  );
10369
- return label ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { label, children: component }) : component;
10026
+ return withTooltip ? /* @__PURE__ */ jsxRuntime.jsx(TooltipImpl, { label, children: component }) : component;
10370
10027
  }
10371
10028
  );
10372
10029
  const IconButtonWrapper = styledComponents.styled(BaseButton)`
@@ -10575,42 +10232,107 @@ const JSONInput = React__namespace.forwardRef(
10575
10232
  "aria-describedby": ariaDescription,
10576
10233
  ...boxProps
10577
10234
  }
10578
- );
10579
- }
10580
- );
10581
- const JSONInputContainer = styledComponents.styled(Flex)`
10582
- line-height: ${({ theme }) => theme.lineHeights[2]};
10583
-
10584
- .cm-editor {
10585
- /**
10586
- * Hard coded since the color is the same between themes,
10587
- * theme.colors.neutral800 changes between themes
10588
- */
10589
- background-color: #32324d;
10590
- width: 100%;
10591
- outline: none;
10592
- }
10593
-
10594
- .cm-scroller {
10595
- border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
10596
- /* inputFocusStyle will receive hasError prop */
10597
- ${inputFocusStyle()}
10598
- }
10599
-
10600
- .cm-editor,
10601
- .cm-scroller {
10602
- border-radius: ${({ theme }) => theme.borderRadius};
10603
- }
10604
-
10605
- .cm-gutters,
10606
- .cm-activeLineGutter {
10607
- /**
10608
- * Hard coded since the color is the same between themes,
10609
- * theme.colors.neutral700 changes between themes
10610
- */
10611
- background-color: #4a4a6a;
10612
- }
10613
- `;
10235
+ );
10236
+ }
10237
+ );
10238
+ const JSONInputContainer = styledComponents.styled(Flex)`
10239
+ line-height: ${({ theme }) => theme.lineHeights[2]};
10240
+
10241
+ .cm-editor {
10242
+ /**
10243
+ * Hard coded since the color is the same between themes,
10244
+ * theme.colors.neutral800 changes between themes
10245
+ */
10246
+ background-color: #32324d;
10247
+ width: 100%;
10248
+ outline: none;
10249
+ }
10250
+
10251
+ .cm-scroller {
10252
+ border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
10253
+ /* inputFocusStyle will receive hasError prop */
10254
+ ${inputFocusStyle()}
10255
+ }
10256
+
10257
+ .cm-editor,
10258
+ .cm-scroller {
10259
+ border-radius: ${({ theme }) => theme.borderRadius};
10260
+ }
10261
+
10262
+ .cm-gutters,
10263
+ .cm-activeLineGutter {
10264
+ /**
10265
+ * Hard coded since the color is the same between themes,
10266
+ * theme.colors.neutral700 changes between themes
10267
+ */
10268
+ background-color: #4a4a6a;
10269
+ }
10270
+ `;
10271
+ const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
10272
+ const isValidFocusedElement = () => {
10273
+ const focused = document.activeElement;
10274
+ if (!focused) {
10275
+ return false;
10276
+ }
10277
+ if (tagName) {
10278
+ return focused.tagName.toLowerCase() === tagName;
10279
+ }
10280
+ return focused.hasAttribute(attributeName);
10281
+ };
10282
+ const queryElement = (parentEl) => {
10283
+ if (tagName) {
10284
+ return parentEl.querySelectorAll(tagName);
10285
+ }
10286
+ return parentEl.querySelectorAll(`[${attributeName}]`);
10287
+ };
10288
+ const handleKeyDown = (e) => {
10289
+ switch (e.key) {
10290
+ case KeyboardKeys.RIGHT:
10291
+ case KeyboardKeys.DOWN: {
10292
+ if (isValidFocusedElement()) {
10293
+ e.preventDefault();
10294
+ const focused = document.activeElement;
10295
+ const allElements = [...queryElement(e.currentTarget)];
10296
+ const focusedIndex = allElements.findIndex((node) => node === focused);
10297
+ const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
10298
+ allElements[nextIndex].focus();
10299
+ }
10300
+ break;
10301
+ }
10302
+ case KeyboardKeys.LEFT:
10303
+ case KeyboardKeys.UP: {
10304
+ if (isValidFocusedElement()) {
10305
+ e.preventDefault();
10306
+ const focused = document.activeElement;
10307
+ const allElements = [...queryElement(e.currentTarget)];
10308
+ const focusedIndex = allElements.findIndex((node) => node === focused);
10309
+ const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
10310
+ allElements[nextIndex].focus();
10311
+ }
10312
+ break;
10313
+ }
10314
+ case KeyboardKeys.HOME: {
10315
+ if (isValidFocusedElement()) {
10316
+ e.preventDefault();
10317
+ const allElements = queryElement(e.currentTarget);
10318
+ const focusElement = allElements.item(0);
10319
+ focusElement.focus();
10320
+ }
10321
+ break;
10322
+ }
10323
+ case KeyboardKeys.END: {
10324
+ if (isValidFocusedElement()) {
10325
+ e.preventDefault();
10326
+ const allElements = queryElement(e.currentTarget);
10327
+ const focusElement = allElements.item(allElements.length - 1);
10328
+ focusElement.focus();
10329
+ }
10330
+ break;
10331
+ }
10332
+ }
10333
+ };
10334
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { onKeyDown: handleKeyDown, ...props });
10335
+ };
10614
10336
  const LinkButton = forwardRef(
10615
10337
  ({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
10616
10338
  const paddingX = size === "S" ? 2 : "10px";
@@ -10668,34 +10390,6 @@ const LinkWrapper$1 = styledComponents.styled(BaseLink)`
10668
10390
 
10669
10391
  ${getVariantStyle}
10670
10392
  `;
10671
- const notifyLog = (message) => {
10672
- const logEl = document.querySelector(`#${LiveRegionIds.Log}`);
10673
- if (logEl) {
10674
- logEl.innerText = message;
10675
- }
10676
- };
10677
- const notifyStatus = (message) => {
10678
- const statusEl = document.querySelector(`#${LiveRegionIds.Status}`);
10679
- if (statusEl) {
10680
- statusEl.innerText = message;
10681
- }
10682
- };
10683
- const notifyAlert = (message) => {
10684
- const alertEl = document.querySelector(`#${LiveRegionIds.Alert}`);
10685
- if (alertEl) {
10686
- alertEl.innerText = message;
10687
- }
10688
- };
10689
- const useNotifyAT = () => {
10690
- React__namespace.useEffect(() => {
10691
- return () => {
10692
- notifyLog("");
10693
- notifyAlert("");
10694
- notifyStatus("");
10695
- };
10696
- }, []);
10697
- return { notifyLog, notifyAlert, notifyStatus };
10698
- };
10699
10393
  const MainWrapper = styledComponents.styled(Box)`
10700
10394
  // To prevent global outline on focus visible to force an outline when Main is focused
10701
10395
  &:focus-visible {
@@ -10731,245 +10425,6 @@ const SkipToContent = ({ children }) => {
10731
10425
  }
10732
10426
  );
10733
10427
  };
10734
- const MainNavContext = React__namespace.createContext(false);
10735
- const useMainNav = () => React__namespace.useContext(MainNavContext);
10736
- const MainNavWrapper = styledComponents.styled(Flex)`
10737
- width: ${({ $condensed }) => $condensed ? "max-content" : `22.4rem`};
10738
- border-right: 1px solid ${({ theme }) => theme.colors.neutral150};
10739
- `;
10740
- const MainNav = ({ condensed = false, ...props }) => {
10741
- return /* @__PURE__ */ jsxRuntime.jsx(MainNavContext.Provider, { value: condensed, children: /* @__PURE__ */ jsxRuntime.jsx(
10742
- MainNavWrapper,
10743
- {
10744
- alignItems: "normal",
10745
- tag: "nav",
10746
- background: "neutral0",
10747
- $condensed: condensed,
10748
- direction: "column",
10749
- height: "100vh",
10750
- position: "sticky",
10751
- top: 0,
10752
- zIndex: 2,
10753
- ...props
10754
- }
10755
- ) });
10756
- };
10757
- const BrandIconWrapper = styledComponents.styled.div`
10758
- border-radius: ${({ theme }) => theme.borderRadius};
10759
-
10760
- svg,
10761
- img {
10762
- height: ${({ $condensed }) => $condensed ? `4rem` : `3.2rem`};
10763
- width: ${({ $condensed }) => $condensed ? `4rem` : `3.2rem`};
10764
- }
10765
- `;
10766
- const NavLinkWrapper = styledComponents.styled(BaseLink)`
10767
- text-decoration: unset;
10768
- color: inherit;
10769
- `;
10770
- const NavBrand = forwardRef(
10771
- ({ workplace, title, icon, ...props }, ref) => {
10772
- const condensed = useMainNav();
10773
- props.to = props?.to ?? "/";
10774
- if (condensed) {
10775
- return /* @__PURE__ */ jsxRuntime.jsx(BaseLink, { ref, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(BrandIconWrapper, { $condensed: true, children: [
10776
- icon,
10777
- /* @__PURE__ */ jsxRuntime.jsxs(VisuallyHidden, { children: [
10778
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
10779
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: workplace })
10780
- ] })
10781
- ] }) }) });
10782
- }
10783
- return /* @__PURE__ */ jsxRuntime.jsx(NavLinkWrapper, { ref, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 4, paddingBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
10784
- /* @__PURE__ */ jsxRuntime.jsx(BrandIconWrapper, { "aria-hidden": true, tabIndex: -1, children: icon }),
10785
- /* @__PURE__ */ jsxRuntime.jsxs(Box, { paddingLeft: 2, children: [
10786
- /* @__PURE__ */ jsxRuntime.jsxs(Typography, { fontWeight: "bold", textColor: "neutral800", tag: "span", children: [
10787
- title,
10788
- /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children: workplace })
10789
- ] }),
10790
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", tag: "p", textColor: "neutral600", "aria-hidden": true, children: workplace })
10791
- ] })
10792
- ] }) }) });
10793
- }
10794
- );
10795
- const NavCondense = ({ children, ...props }) => {
10796
- const condensed = useMainNav();
10797
- const Icon = condensed ? icons.ChevronRight : icons.ChevronLeft;
10798
- return /* @__PURE__ */ jsxRuntime.jsxs(NavCondenseWrapper, { tag: "button", $condensed: condensed, ...props, children: [
10799
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { width: "1.2rem", "aria-hidden": true, fill: "neutral600" }),
10800
- /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children })
10801
- ] });
10802
- };
10803
- const NavCondenseWrapper = styledComponents.styled(Flex).attrs((props) => ({
10804
- justifyContent: "center",
10805
- ...props
10806
- }))`
10807
- background: ${({ theme }) => theme.colors.neutral0};
10808
- border: 1px solid ${({ theme }) => theme.colors.neutral150};
10809
- border-radius: ${({ theme }) => theme.borderRadius};
10810
- position: absolute;
10811
- bottom: 1.3rem; // 9 is the height of the svg and 4 is the padding below
10812
- right: ${({ theme, $condensed }) => $condensed ? 0 : theme.spaces[5]};
10813
- transform: ${({ $condensed }) => $condensed ? `translateX(50%)` : void 0};
10814
- z-index: 2;
10815
- width: 1.8rem;
10816
- height: 2.5rem;
10817
- `;
10818
- const NavFooter = ({ children }) => {
10819
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { position: "relative", children });
10820
- };
10821
- const NavLink = forwardRef(
10822
- ({ children, icon, badgeContent, badgeAriaLabel, ...props }, ref) => {
10823
- const condensed = useMainNav();
10824
- if (condensed) {
10825
- return /* @__PURE__ */ jsxRuntime.jsx(MainNavLinkWrapper, { ref, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { position: "right", label: children, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, tag: "span", justifyContent: "center", children: [
10826
- /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingRight: 0, tag: "span", children: icon }),
10827
- badgeContent && /* @__PURE__ */ jsxRuntime.jsx(CustomBadge, { $condensed: true, "aria-label": badgeAriaLabel, children: badgeContent })
10828
- ] }) }) });
10829
- }
10830
- return /* @__PURE__ */ jsxRuntime.jsx(MainNavLinkWrapper, { ref, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
10831
- Flex,
10832
- {
10833
- paddingLeft: 3,
10834
- paddingRight: 3,
10835
- paddingTop: 2,
10836
- paddingBottom: 2,
10837
- tag: "span",
10838
- justifyContent: "space-between",
10839
- children: [
10840
- /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
10841
- /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingRight: 3, tag: "span", children: icon }),
10842
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { children })
10843
- ] }),
10844
- badgeContent && /* @__PURE__ */ jsxRuntime.jsx(CustomBadge, { justifyContent: "center", "aria-label": badgeAriaLabel, children: badgeContent })
10845
- ]
10846
- }
10847
- ) });
10848
- }
10849
- );
10850
- const MainNavLinkWrapper = styledComponents.styled(BaseLink)`
10851
- position: relative;
10852
- text-decoration: none;
10853
- display: block;
10854
- border-radius: ${({ theme }) => theme.borderRadius};
10855
- background: ${({ theme }) => theme.colors.neutral0};
10856
- color: ${({ theme }) => theme.colors.neutral600};
10857
-
10858
- svg {
10859
- fill: ${({ theme }) => theme.colors.neutral500};
10860
- }
10861
-
10862
- &:hover {
10863
- background: ${({ theme }) => theme.colors.neutral100};
10864
- color: ${({ theme }) => theme.colors.neutral700};
10865
-
10866
- svg {
10867
- fill: ${({ theme }) => theme.colors.neutral600};
10868
- }
10869
- }
10870
-
10871
- &.active {
10872
- background: ${({ theme }) => theme.colors.primary100};
10873
- color: ${({ theme }) => theme.colors.primary600};
10874
- font-weight: 500;
10875
-
10876
- svg {
10877
- fill: ${({ theme }) => theme.colors.primary600};
10878
- }
10879
- }
10880
- `;
10881
- const CustomBadge = styledComponents.styled(Badge)`
10882
- ${({ theme, $condensed }) => $condensed && styledComponents.css`
10883
- position: absolute;
10884
- // Values based on visual aspect
10885
- top: -${theme.spaces[3]};
10886
- right: -${theme.spaces[1]};
10887
- `}
10888
-
10889
- // overwrite to ensure the badge typography is white on blue.
10890
- & > * {
10891
- color: ${({ theme }) => theme.colors.neutral0};
10892
- }
10893
-
10894
- line-height: 0;
10895
- display: flex;
10896
- justify-content: center;
10897
- align-items: center;
10898
- min-width: ${({ theme }) => theme.spaces[6]};
10899
- height: ${({ theme }) => theme.spaces[5]};
10900
- padding: ${({ theme }) => `0 ${theme.spaces[2]}`};
10901
- border-radius: ${({ theme }) => theme.spaces[10]};
10902
- background: ${({ theme }) => theme.colors.primary600};
10903
- `;
10904
- const NavSection = ({ label, children, horizontal = false, spacing = 2, ...props }) => {
10905
- const condensed = useMainNav();
10906
- if (condensed) {
10907
- return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
10908
- /* @__PURE__ */ jsxRuntime.jsxs(Box, { paddingTop: 1, paddingBottom: 1, background: "neutral0", hasRadius: true, tag: "span", children: [
10909
- /* @__PURE__ */ jsxRuntime.jsx(Divider, {}),
10910
- /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }) })
10911
- ] }),
10912
- /* @__PURE__ */ jsxRuntime.jsx(
10913
- Flex,
10914
- {
10915
- tag: "ul",
10916
- gap: spacing,
10917
- direction: horizontal ? "row" : "column",
10918
- alignItems: horizontal ? "center" : "stretch",
10919
- ...props,
10920
- children: React__namespace.Children.map(children, (child, index) => {
10921
- return /* @__PURE__ */ jsxRuntime.jsx("li", { children: child }, index);
10922
- })
10923
- }
10924
- )
10925
- ] });
10926
- }
10927
- return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
10928
- /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingTop: 1, paddingBottom: 1, background: "neutral0", paddingRight: 3, paddingLeft: 3, hasRadius: true, tag: "span", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "sigma", textColor: "neutral600", children: label }) }),
10929
- /* @__PURE__ */ jsxRuntime.jsx(
10930
- Flex,
10931
- {
10932
- tag: "ul",
10933
- gap: spacing,
10934
- direction: horizontal ? "row" : "column",
10935
- alignItems: horizontal ? "center" : "stretch",
10936
- ...props,
10937
- children: React__namespace.Children.map(children, (child, index) => {
10938
- return /* @__PURE__ */ jsxRuntime.jsx("li", { children: child }, index);
10939
- })
10940
- }
10941
- )
10942
- ] });
10943
- };
10944
- const BoxGrow = styledComponents.styled(Box)`
10945
- flex-grow: 1;
10946
- overflow-y: auto;
10947
- `;
10948
- const NavSections = ({ children, spacing = 4, horizontal = false, ...props }) => {
10949
- return /* @__PURE__ */ jsxRuntime.jsx(BoxGrow, { paddingLeft: 3, paddingRight: 2, paddingTop: 3, paddingBottom: 8, children: /* @__PURE__ */ jsxRuntime.jsx(
10950
- Flex,
10951
- {
10952
- tag: "ul",
10953
- gap: spacing,
10954
- direction: horizontal ? "row" : "column",
10955
- alignItems: horizontal ? "center" : "stretch",
10956
- ...props,
10957
- children: React__namespace.Children.map(children, (child, index) => {
10958
- return /* @__PURE__ */ jsxRuntime.jsx("li", { children: child }, index);
10959
- })
10960
- }
10961
- ) });
10962
- };
10963
- const NavUserBox = styledComponents.styled(Box)`
10964
- border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
10965
- `;
10966
- const NavUser = React__namespace.forwardRef(({ src, children, initials, ...props }, ref) => {
10967
- const condensed = useMainNav();
10968
- return /* @__PURE__ */ jsxRuntime.jsx(NavUserBox, { paddingTop: 3, paddingBottom: 3, paddingLeft: 5, paddingRight: 5, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { tag: "button", justifyContent: condensed ? "center" : void 0, ref, children: [
10969
- src ? /* @__PURE__ */ jsxRuntime.jsx(Avatar, { src, alt: "", "aria-hidden": true }) : /* @__PURE__ */ jsxRuntime.jsx(Initials, { children: initials }),
10970
- condensed ? /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { children }) }) : /* @__PURE__ */ jsxRuntime.jsx(Box, { width: "13rem", paddingLeft: 2, tag: "span", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { ellipsis: true, textColor: "neutral600", children }) })
10971
- ] }) });
10972
- });
10973
10428
  const ModalContext = React__namespace.createContext(() => {
10974
10429
  });
10975
10430
  const useModal = () => React__namespace.useContext(ModalContext);
@@ -10979,7 +10434,7 @@ const ModalWrapper = styledComponents.styled(Flex)`
10979
10434
  `;
10980
10435
  const ModalLayout = ({ onClose, labelledBy, ...props }) => {
10981
10436
  useLockScroll(true);
10982
- return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(ModalWrapper, { justifyContent: "center", paddingLeft: 8, paddingRight: 8, position: "fixed", zIndex: 4, children: /* @__PURE__ */ jsxRuntime.jsx(FocusTrap, { children: /* @__PURE__ */ jsxRuntime.jsx(DismissibleLayer, { onEscapeKeyDown: onClose, onPointerDownOutside: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
10437
+ return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(ModalWrapper, { justifyContent: "center", paddingLeft: 8, paddingRight: 8, position: "fixed", zIndex: "modal", children: /* @__PURE__ */ jsxRuntime.jsx(FocusTrap, { children: /* @__PURE__ */ jsxRuntime.jsx(DismissibleLayer, { onEscapeKeyDown: onClose, onPointerDownOutside: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
10983
10438
  Box,
10984
10439
  {
10985
10440
  "aria-labelledby": labelledBy,
@@ -11002,7 +10457,7 @@ const ModalHeader = ({ children, closeLabel = "Close the modal" }) => {
11002
10457
  const onClose = useModal();
11003
10458
  return /* @__PURE__ */ jsxRuntime.jsx(ModalHeaderWrapper, { paddingTop: 4, paddingBottom: 4, paddingLeft: 5, paddingRight: 5, background: "neutral100", children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", children: [
11004
10459
  children,
11005
- /* @__PURE__ */ jsxRuntime.jsx(IconButton, { onClick: onClose, "aria-label": closeLabel, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) })
10460
+ /* @__PURE__ */ jsxRuntime.jsx(IconButton, { onClick: onClose, label: closeLabel, withTooltip: false, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) })
11006
10461
  ] }) });
11007
10462
  };
11008
10463
  const ModalFooterWrapper = styledComponents.styled(Box)`
@@ -11024,7 +10479,7 @@ const ModalBody = (props) => {
11024
10479
  };
11025
10480
  const INITIAL_VALUE = "";
11026
10481
  const NumberInput = React__namespace.forwardRef(
11027
- ({ size = "M", startAction, locale: defaultLocale, onValueChange, value, step = 1, disabled = false, ...props }, ref) => {
10482
+ ({ startAction, locale: defaultLocale, onValueChange, value, step = 1, disabled = false, ...props }, ref) => {
11028
10483
  const designContext = useDesignSystem("NumberInput");
11029
10484
  const locale = defaultLocale || designContext.locale;
11030
10485
  const numberParserRef = React__namespace.useRef(new number.NumberParser(locale, { style: "decimal" }));
@@ -11101,7 +10556,6 @@ const NumberInput = React__namespace.forwardRef(
11101
10556
  onKeyDown: handleKeyDown,
11102
10557
  onBlur: handleBlur,
11103
10558
  value: inputValue,
11104
- size,
11105
10559
  endAction: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11106
10560
  /* @__PURE__ */ jsxRuntime.jsx(
11107
10561
  ArrowButton,
@@ -11239,7 +10693,7 @@ const POPOVER_PLACEMENTS = [
11239
10693
  ];
11240
10694
  const PopoverWrapper = styledComponents.styled(Box)`
11241
10695
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
11242
- z-index: ${({ theme }) => theme.zIndices[0]};
10696
+ z-index: ${({ theme }) => theme.zIndices.popover};
11243
10697
  border: 1px solid ${({ theme }) => theme.colors.neutral150};
11244
10698
  `;
11245
10699
  const Content = React__namespace.forwardRef(
@@ -11691,7 +11145,7 @@ const SearchbarInput = styledComponents.styled(Input$2)`
11691
11145
  ${inputFocusStyle()}
11692
11146
  `;
11693
11147
  const Searchbar = React__namespace.forwardRef(
11694
- ({ name, size = "M", children, value = "", onClear, clearLabel, ...props }, ref) => {
11148
+ ({ name, children, value = "", onClear, clearLabel, ...props }, ref) => {
11695
11149
  const inputRef = React__namespace.useRef(null);
11696
11150
  const isCompleting = value.length > 0;
11697
11151
  const handleClear = (e) => {
@@ -11707,7 +11161,6 @@ const Searchbar = React__namespace.forwardRef(
11707
11161
  ref: actualRef,
11708
11162
  value,
11709
11163
  startAction: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { "aria-hidden": true }),
11710
- size,
11711
11164
  endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(Action, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) }) : void 0,
11712
11165
  ...props
11713
11166
  }
@@ -11777,9 +11230,7 @@ const MultiSelect = React__namespace.forwardRef(
11777
11230
  onReachEnd,
11778
11231
  placeholder,
11779
11232
  required: requiredProp,
11780
- selectButtonTitle: _deprecatedSelectButtonTitle,
11781
11233
  startIcon,
11782
- size = "M",
11783
11234
  value: passedValue,
11784
11235
  withTags,
11785
11236
  ...restProps
@@ -11827,10 +11278,11 @@ const MultiSelect = React__namespace.forwardRef(
11827
11278
  }
11828
11279
  return null;
11829
11280
  };
11830
- const { error, required, ...field } = useField("MultiSelect");
11281
+ const { error, ...field } = useField("MultiSelect");
11831
11282
  const hasError = Boolean(error) || hasErrorProp;
11832
11283
  const id = field.id ?? idProp;
11833
11284
  const name = field.name ?? nameProp;
11285
+ const required = field.required ?? requiredProp;
11834
11286
  let ariaDescription;
11835
11287
  if (error) {
11836
11288
  ariaDescription = `${id}-error`;
@@ -11857,7 +11309,6 @@ const MultiSelect = React__namespace.forwardRef(
11857
11309
  "aria-label": restProps["aria-label"],
11858
11310
  "aria-describedby": ariaDescription ?? restProps["aria-describedby"],
11859
11311
  startIcon,
11860
- size,
11861
11312
  hasError,
11862
11313
  disabled,
11863
11314
  clearLabel,
@@ -12079,7 +11530,6 @@ const SubNavHeader = ({
12079
11530
  onClear: handleClear,
12080
11531
  onSubmit,
12081
11532
  clearLabel: "Clear",
12082
- size: "S",
12083
11533
  children: searchLabel
12084
11534
  }
12085
11535
  ) }),
@@ -12089,7 +11539,7 @@ const SubNavHeader = ({
12089
11539
  return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
12090
11540
  /* @__PURE__ */ jsxRuntime.jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", children: [
12091
11541
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "beta", tag, children: label }),
12092
- searchable && /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Search, {}) })
11542
+ searchable && /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ref: searchButtonRef, onClick: toggleSearch, label: searchLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Search, {}) })
12093
11543
  ] }),
12094
11544
  /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(CustomDivider, {}) })
12095
11545
  ] });
@@ -12726,15 +12176,10 @@ const CellWrapper = styledComponents.styled(RawTd)`
12726
12176
  vertical-align: sub;
12727
12177
  }
12728
12178
  `;
12729
- const ActionWrapper = styledComponents.styled.span`
12730
- svg {
12731
- height: 0.4rem;
12732
- }
12733
- `;
12734
12179
  const Th = ({ children, action, ...props }) => {
12735
12180
  return /* @__PURE__ */ jsxRuntime.jsx(CellWrapper, { as: RawTh, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { children: [
12736
12181
  children,
12737
- /* @__PURE__ */ jsxRuntime.jsx(ActionWrapper, { children: action })
12182
+ action
12738
12183
  ] }) });
12739
12184
  };
12740
12185
  const Td = ({ children, ...props }) => {
@@ -12772,6 +12217,59 @@ const TFooter = ({ children, icon, ...props }) => {
12772
12217
  ] }) })
12773
12218
  ] });
12774
12219
  };
12220
+ const rotation = styledComponents.keyframes`
12221
+ from {
12222
+ transform: rotate(0deg);
12223
+ }
12224
+ to {
12225
+ transform: rotate(359deg);
12226
+ }
12227
+ `;
12228
+ const LoadingWrapper = styledComponents.styled.div`
12229
+ animation: ${rotation} 2s infinite linear;
12230
+ will-change: transform;
12231
+ `;
12232
+ const TextButtonWrapper = styledComponents.styled(Flex)`
12233
+ border: none;
12234
+
12235
+ &[aria-disabled='true'] {
12236
+ pointer-events: none;
12237
+ svg path {
12238
+ fill: ${({ theme }) => theme.colors.neutral600};
12239
+ }
12240
+ }
12241
+
12242
+ svg path {
12243
+ fill: ${({ theme }) => theme.colors.primary600};
12244
+ }
12245
+
12246
+ ${focus}
12247
+ `;
12248
+ const TextButton = React__namespace.forwardRef(
12249
+ ({ children, startIcon, endIcon, onClick, disabled = false, loading = false, ...props }, ref) => {
12250
+ const handleClick = onClick && !disabled ? onClick : void 0;
12251
+ const isDisabled = disabled || loading;
12252
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12253
+ TextButtonWrapper,
12254
+ {
12255
+ ref,
12256
+ "aria-disabled": isDisabled,
12257
+ onClick: handleClick,
12258
+ tag: "button",
12259
+ type: "button",
12260
+ background: "transparent",
12261
+ gap: 2,
12262
+ ...props,
12263
+ children: [
12264
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Loader, {}) }) : startIcon,
12265
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: isDisabled ? "neutral600" : "primary600", children }),
12266
+ endIcon
12267
+ ]
12268
+ }
12269
+ );
12270
+ }
12271
+ );
12272
+ TextButton.displayName = "TextButton";
12775
12273
  const TextInput = React__namespace.forwardRef((props, ref) => {
12776
12274
  return /* @__PURE__ */ jsxRuntime.jsx(Input$2, { ref, ...props });
12777
12275
  });
@@ -12842,7 +12340,6 @@ const Toggle = React__namespace.forwardRef(
12842
12340
  name: nameProp,
12843
12341
  checked: checkedProp,
12844
12342
  onChange,
12845
- size = "M",
12846
12343
  ...props
12847
12344
  }, forwardedRef) => {
12848
12345
  const [checked = false, setChecked] = useControllableState({
@@ -12886,7 +12383,6 @@ const Toggle = React__namespace.forwardRef(
12886
12383
  justifyContent: "center",
12887
12384
  background: disabled && isFalseyChecked ? "neutral200" : isFalseyChecked ? "neutral0" : "transparent",
12888
12385
  borderColor: disabled && isFalseyChecked ? "neutral300" : isFalseyChecked ? "neutral200" : disabled ? "neutral150" : "neutral100",
12889
- $size: size,
12890
12386
  children: /* @__PURE__ */ jsxRuntime.jsx(
12891
12387
  Typography,
12892
12388
  {
@@ -12909,7 +12405,6 @@ const Toggle = React__namespace.forwardRef(
12909
12405
  justifyContent: "center",
12910
12406
  background: disabled && checked ? "neutral200" : checked ? "neutral0" : "transparent",
12911
12407
  borderColor: disabled && checked ? "neutral300" : checked ? "neutral200" : disabled ? "neutral150" : "neutral100",
12912
- $size: size,
12913
12408
  children: /* @__PURE__ */ jsxRuntime.jsx(
12914
12409
  Typography,
12915
12410
  {
@@ -12950,13 +12445,7 @@ const ToggleWrapper = styledComponents.styled(Flex)`
12950
12445
  ${inputFocusStyle()}
12951
12446
  `;
12952
12447
  const ToggleOption = styledComponents.styled(Flex)`
12953
- /**
12954
- We declare the defined value because we want the height of the input when
12955
- the values are in a row to be 40px. But defining a height on the label
12956
- would break the input when it wraps.
12957
- */
12958
- padding-top: ${({ $size }) => `${$size === "S" ? "2px" : "6px"}`};
12959
- padding-bottom: ${({ $size }) => `${$size === "S" ? "2px" : "6px"}`};
12448
+ padding-block: 0.6rem;
12960
12449
  `;
12961
12450
  const Input = styledComponents.styled.input`
12962
12451
  height: 100%;
@@ -12985,9 +12474,6 @@ Object.defineProperty(exports, "useFilter", {
12985
12474
  });
12986
12475
  exports.AccessibleIcon = AccessibleIcon;
12987
12476
  exports.Accordion = Accordion;
12988
- exports.AccordionContent = AccordionContent;
12989
- exports.AccordionGroup = AccordionGroup;
12990
- exports.AccordionToggle = AccordionToggle;
12991
12477
  exports.Alert = Alert;
12992
12478
  exports.Avatar = Avatar;
12993
12479
  exports.AvatarGroup = AvatarGroup;
@@ -13017,7 +12503,7 @@ exports.CarouselInput = CarouselInput;
13017
12503
  exports.CarouselSlide = CarouselSlide;
13018
12504
  exports.Checkbox = Checkbox;
13019
12505
  exports.Combobox = Combobox;
13020
- exports.ComboboxOption = ComboboxOption;
12506
+ exports.ComboboxOption = Option;
13021
12507
  exports.Crumb = Crumb;
13022
12508
  exports.CrumbLink = CrumbLink;
13023
12509
  exports.CrumbSimpleMenu = CrumbSimpleMenu;
@@ -13046,7 +12532,6 @@ exports.LinkButton = LinkButton;
13046
12532
  exports.LiveRegions = LiveRegions;
13047
12533
  exports.Loader = Loader;
13048
12534
  exports.Main = Main;
13049
- exports.MainNav = MainNav;
13050
12535
  exports.Menu = Menu;
13051
12536
  exports.MenuItem = MenuItem;
13052
12537
  exports.ModalBody = ModalBody;
@@ -13057,13 +12542,6 @@ exports.MultiSelect = MultiSelect;
13057
12542
  exports.MultiSelectGroup = MultiSelectGroup;
13058
12543
  exports.MultiSelectNested = MultiSelectNested;
13059
12544
  exports.MultiSelectOption = MultiSelectOption;
13060
- exports.NavBrand = NavBrand;
13061
- exports.NavCondense = NavCondense;
13062
- exports.NavFooter = NavFooter;
13063
- exports.NavLink = NavLink;
13064
- exports.NavSection = NavSection;
13065
- exports.NavSections = NavSections;
13066
- exports.NavUser = NavUser;
13067
12545
  exports.NextLink = NextLink;
13068
12546
  exports.NumberInput = NumberInput;
13069
12547
  exports.POPOVER_PLACEMENTS = POPOVER_PLACEMENTS;
@@ -13111,10 +12589,9 @@ exports.TextInput = TextInput;
13111
12589
  exports.Textarea = Textarea;
13112
12590
  exports.Th = Th;
13113
12591
  exports.Thead = Thead;
13114
- exports.ThemeProvider = ThemeProvider;
13115
12592
  exports.TimePicker = TimePicker$1;
13116
12593
  exports.Toggle = Toggle;
13117
- exports.Tooltip = Tooltip;
12594
+ exports.Tooltip = TooltipImpl;
13118
12595
  exports.Tr = Tr;
13119
12596
  exports.Typography = Typography;
13120
12597
  exports.VisuallyHidden = VisuallyHidden;
@@ -13130,5 +12607,4 @@ exports.useDateFormatter = useDateFormatter;
13130
12607
  exports.useDesignSystem = useDesignSystem;
13131
12608
  exports.useField = useField;
13132
12609
  exports.useNotifyAT = useNotifyAT;
13133
- exports.useTheme = useTheme;
13134
12610
  //# sourceMappingURL=index.js.map