@strapi/design-system 2.0.0-beta.4 → 2.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +19 -15
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/index.d.ts +1 -2
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Box/Box.d.ts +2 -2
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Card/CardCheckbox.d.ts +6 -3
- package/dist/components/Card/CardCheckbox.d.ts.map +1 -1
- package/dist/components/Card/CardTitle.d.ts +1 -1
- package/dist/components/Card/CardTitle.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +8 -7
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +45 -7
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/index.d.ts +1 -3
- package/dist/components/Dialog/index.d.ts.map +1 -1
- package/dist/components/Divider/Divider.d.ts +6 -2
- package/dist/components/Divider/Divider.d.ts.map +1 -1
- package/dist/components/Field/Field.d.ts +1 -1
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/Grid/Grid.d.ts +14 -5
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Grid/index.d.ts +1 -2
- package/dist/components/Grid/index.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -2
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +46 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +16 -16
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/index.d.ts +1 -3
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +11 -5
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/index.d.ts +1 -2
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/RawTable/RawCell.d.ts.map +1 -1
- package/dist/components/Select/MultiSelect.d.ts.map +1 -1
- package/dist/components/Select/SelectParts.d.ts +5 -5
- package/dist/components/Select/SelectParts.d.ts.map +1 -1
- package/dist/components/SimpleMenu/Menu.d.ts +2 -3
- package/dist/components/SimpleMenu/Menu.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +36 -14
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/index.d.ts +1 -3
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Typography/Typography.d.ts +4 -4
- package/dist/components/Typography/Typography.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -7
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/useControllableState.d.ts +9 -16
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useId.d.ts.map +1 -1
- package/dist/hooks/useIntersection.d.ts +3 -0
- package/dist/hooks/useIntersection.d.ts.map +1 -1
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +12 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/hooks/useMeasure.d.ts +7 -0
- package/dist/hooks/useMeasure.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1349 -1247
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1338 -1244
- package/dist/index.mjs.map +1 -1
- package/dist/styles/motion.d.ts +55 -0
- package/dist/styles/motion.d.ts.map +1 -0
- package/dist/themes/common-theme.d.ts +6 -2
- package/dist/themes/common-theme.d.ts.map +1 -1
- package/dist/utilities/DesignSystemProvider.d.ts.map +1 -1
- package/dist/utilities/DismissibleLayer/index.d.ts.map +1 -0
- package/dist/utilities/FocusTrap/FocusTrap.d.ts.map +1 -0
- package/dist/utilities/FocusTrap/index.d.ts.map +1 -0
- package/dist/{components → utilities}/KeyboardNavigable/KeyboardNavigable.d.ts +1 -1
- package/dist/utilities/KeyboardNavigable/KeyboardNavigable.d.ts.map +1 -0
- package/dist/utilities/KeyboardNavigable/index.d.ts.map +1 -0
- package/dist/utilities/Portal/Portal.d.ts +13 -0
- package/dist/utilities/Portal/Portal.d.ts.map +1 -0
- package/dist/utilities/Portal/index.d.ts.map +1 -0
- package/dist/utilities/ScrollArea/ScrollArea.d.ts +15 -0
- package/dist/utilities/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/utilities/ScrollArea/index.d.ts +2 -0
- package/dist/utilities/ScrollArea/index.d.ts.map +1 -0
- package/package.json +25 -18
- package/dist/components/Avatar/AvatarGroup.d.ts +0 -6
- package/dist/components/Avatar/AvatarGroup.d.ts.map +0 -1
- package/dist/components/Avatar/constants.d.ts +0 -3
- package/dist/components/Avatar/constants.d.ts.map +0 -1
- package/dist/components/BaseCheckbox/BaseCheckbox.d.ts +0 -22
- package/dist/components/BaseCheckbox/BaseCheckbox.d.ts.map +0 -1
- package/dist/components/BaseCheckbox/index.d.ts +0 -2
- package/dist/components/BaseCheckbox/index.d.ts.map +0 -1
- package/dist/components/BaseRadio/BaseRadio.d.ts +0 -9
- package/dist/components/BaseRadio/BaseRadio.d.ts.map +0 -1
- package/dist/components/BaseRadio/RadioGroup.d.ts +0 -18
- package/dist/components/BaseRadio/RadioGroup.d.ts.map +0 -1
- package/dist/components/BaseRadio/index.d.ts +0 -3
- package/dist/components/BaseRadio/index.d.ts.map +0 -1
- package/dist/components/Dialog/DialogBody.d.ts +0 -7
- package/dist/components/Dialog/DialogBody.d.ts.map +0 -1
- package/dist/components/Dialog/DialogFooter.d.ts +0 -7
- package/dist/components/Dialog/DialogFooter.d.ts.map +0 -1
- package/dist/components/DismissibleLayer/index.d.ts.map +0 -1
- package/dist/components/EmptyStateLayout/story-assets/Illo.d.ts +0 -2
- package/dist/components/EmptyStateLayout/story-assets/Illo.d.ts.map +0 -1
- package/dist/components/FocusTrap/FocusTrap.d.ts.map +0 -1
- package/dist/components/FocusTrap/index.d.ts.map +0 -1
- package/dist/components/Grid/GridItem.d.ts +0 -9
- package/dist/components/Grid/GridItem.d.ts.map +0 -1
- package/dist/components/KeyboardNavigable/KeyboardNavigable.d.ts.map +0 -1
- package/dist/components/KeyboardNavigable/index.d.ts.map +0 -1
- package/dist/components/ModalLayout/ModalBody.d.ts +0 -3
- package/dist/components/ModalLayout/ModalBody.d.ts.map +0 -1
- package/dist/components/ModalLayout/ModalContext.d.ts +0 -4
- package/dist/components/ModalLayout/ModalContext.d.ts.map +0 -1
- package/dist/components/ModalLayout/ModalFooter.d.ts +0 -7
- package/dist/components/ModalLayout/ModalFooter.d.ts.map +0 -1
- package/dist/components/ModalLayout/ModalHeader.d.ts +0 -8
- package/dist/components/ModalLayout/ModalHeader.d.ts.map +0 -1
- package/dist/components/ModalLayout/ModalLayout.d.ts +0 -7
- package/dist/components/ModalLayout/ModalLayout.d.ts.map +0 -1
- package/dist/components/ModalLayout/index.d.ts +0 -5
- package/dist/components/ModalLayout/index.d.ts.map +0 -1
- package/dist/components/Popover/primitives.d.ts +0 -4
- package/dist/components/Popover/primitives.d.ts.map +0 -1
- package/dist/components/Portal/Portal.d.ts +0 -7
- package/dist/components/Portal/Portal.d.ts.map +0 -1
- package/dist/components/Portal/index.d.ts.map +0 -1
- package/dist/components/Tabs/TabGroup.d.ts +0 -15
- package/dist/components/Tabs/TabGroup.d.ts.map +0 -1
- package/dist/components/Tabs/TabPanels.d.ts +0 -10
- package/dist/components/Tabs/TabPanels.d.ts.map +0 -1
- package/dist/components/Tabs/TabsContext.d.ts +0 -12
- package/dist/components/Tabs/TabsContext.d.ts.map +0 -1
- package/dist/components/Tabs/components.d.ts +0 -23
- package/dist/components/Tabs/components.d.ts.map +0 -1
- package/dist/hooks/useLockScroll.d.ts +0 -3
- package/dist/hooks/useLockScroll.d.ts.map +0 -1
- package/dist/hooks/usePrevious.d.ts +0 -2
- package/dist/hooks/usePrevious.d.ts.map +0 -1
- package/dist/styles/easings.d.ts +0 -29
- package/dist/styles/easings.d.ts.map +0 -1
- /package/dist/{components → utilities}/DismissibleLayer/index.d.ts +0 -0
- /package/dist/{components → utilities}/FocusTrap/FocusTrap.d.ts +0 -0
- /package/dist/{components → utilities}/FocusTrap/index.d.ts +0 -0
- /package/dist/{components → utilities}/KeyboardNavigable/index.d.ts +0 -0
- /package/dist/{components → utilities}/Portal/index.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -5,22 +5,28 @@ const date = require("@internationalized/date");
|
|
|
5
5
|
const jsxRuntime = require("react/jsx-runtime");
|
|
6
6
|
const Tooltip = require("@radix-ui/react-tooltip");
|
|
7
7
|
const styledComponents = require("styled-components");
|
|
8
|
+
const DismissibleLayerPrimitive = require("@radix-ui/react-dismissable-layer");
|
|
8
9
|
const uiPrimitives = require("@strapi/ui-primitives");
|
|
9
10
|
const RadixAccordion = require("@radix-ui/react-accordion");
|
|
10
11
|
const icons = require("@strapi/icons");
|
|
12
|
+
const Avatar$1 = require("@radix-ui/react-avatar");
|
|
11
13
|
const DropdownMenu = require("@radix-ui/react-dropdown-menu");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const reactDom = require("react-dom");
|
|
14
|
+
const Checkbox = require("@radix-ui/react-checkbox");
|
|
15
|
+
const AlertDialog = require("@radix-ui/react-alert-dialog");
|
|
15
16
|
const reactDom$1 = require("@floating-ui/react-dom");
|
|
16
17
|
const reactFocusScope = require("@radix-ui/react-focus-scope");
|
|
18
|
+
const reactDom = require("react-dom");
|
|
17
19
|
const reactRemoveScroll = require("react-remove-scroll");
|
|
18
20
|
const langJson = require("@codemirror/lang-json");
|
|
19
21
|
const reactCodemirror = require("@uiw/react-codemirror");
|
|
20
22
|
const state = require("@codemirror/state");
|
|
21
23
|
const view = require("@codemirror/view");
|
|
24
|
+
const Dialog$1 = require("@radix-ui/react-dialog");
|
|
25
|
+
const ScrollArea = require("@radix-ui/react-scroll-area");
|
|
22
26
|
const number = require("@internationalized/number");
|
|
23
|
-
const
|
|
27
|
+
const Popover$1 = require("@radix-ui/react-popover");
|
|
28
|
+
const RadioGroup = require("@radix-ui/react-radio-group");
|
|
29
|
+
const Tabs$1 = require("@radix-ui/react-tabs");
|
|
24
30
|
function _interopNamespace(e) {
|
|
25
31
|
if (e && e.__esModule)
|
|
26
32
|
return e;
|
|
@@ -41,9 +47,17 @@ function _interopNamespace(e) {
|
|
|
41
47
|
}
|
|
42
48
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
43
49
|
const Tooltip__namespace = /* @__PURE__ */ _interopNamespace(Tooltip);
|
|
50
|
+
const DismissibleLayerPrimitive__namespace = /* @__PURE__ */ _interopNamespace(DismissibleLayerPrimitive);
|
|
44
51
|
const RadixAccordion__namespace = /* @__PURE__ */ _interopNamespace(RadixAccordion);
|
|
52
|
+
const Avatar__namespace = /* @__PURE__ */ _interopNamespace(Avatar$1);
|
|
45
53
|
const DropdownMenu__namespace = /* @__PURE__ */ _interopNamespace(DropdownMenu);
|
|
46
|
-
const
|
|
54
|
+
const Checkbox__namespace = /* @__PURE__ */ _interopNamespace(Checkbox);
|
|
55
|
+
const AlertDialog__namespace = /* @__PURE__ */ _interopNamespace(AlertDialog);
|
|
56
|
+
const Dialog__namespace = /* @__PURE__ */ _interopNamespace(Dialog$1);
|
|
57
|
+
const ScrollArea__namespace = /* @__PURE__ */ _interopNamespace(ScrollArea);
|
|
58
|
+
const Popover__namespace = /* @__PURE__ */ _interopNamespace(Popover$1);
|
|
59
|
+
const RadioGroup__namespace = /* @__PURE__ */ _interopNamespace(RadioGroup);
|
|
60
|
+
const Tabs__namespace = /* @__PURE__ */ _interopNamespace(Tabs$1);
|
|
47
61
|
const createContext = (rootComponentName, defaultContext) => {
|
|
48
62
|
const Context = React__namespace.createContext(defaultContext);
|
|
49
63
|
const Provider2 = (props) => {
|
|
@@ -426,7 +440,7 @@ const StyledTypography = styledComponents.styled(Box)`
|
|
|
426
440
|
text-transform: ${({ $textTransform }) => $textTransform};
|
|
427
441
|
`;
|
|
428
442
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
429
|
-
const Root$
|
|
443
|
+
const Root$8 = React__namespace.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
430
444
|
return /* @__PURE__ */ jsxRuntime.jsx(AccordionRoot, { ref: forwardedRef, $size: size, collapsible: true, ...props, type: "single", children: /* @__PURE__ */ jsxRuntime.jsx(AccordionProvider, { size, children }) });
|
|
431
445
|
});
|
|
432
446
|
const AccordionRoot = styledComponents.styled(RadixAccordion__namespace.Root)`
|
|
@@ -443,7 +457,7 @@ const AccordionRoot = styledComponents.styled(RadixAccordion__namespace.Root)`
|
|
|
443
457
|
}
|
|
444
458
|
}}
|
|
445
459
|
`;
|
|
446
|
-
const Item$
|
|
460
|
+
const Item$5 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
447
461
|
const { size } = useAccordion("Item");
|
|
448
462
|
return /* @__PURE__ */ jsxRuntime.jsx(AccordionItem, { $size: size, ref: forwardedRef, ...props });
|
|
449
463
|
});
|
|
@@ -471,7 +485,7 @@ const AccordionItem = styledComponents.styled(RadixAccordion__namespace.Item)`
|
|
|
471
485
|
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
472
486
|
}
|
|
473
487
|
`;
|
|
474
|
-
const Trigger$
|
|
488
|
+
const Trigger$7 = React__namespace.forwardRef(
|
|
475
489
|
({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
|
|
476
490
|
const { size } = useAccordion("Trigger");
|
|
477
491
|
return /* @__PURE__ */ jsxRuntime.jsxs(AccordionTrigger, { $caretPosition: caretPosition, $size: size, ref: forwardedRef, ...restProps, children: [
|
|
@@ -499,7 +513,7 @@ const IconBox$4 = styledComponents.styled(Box)`
|
|
|
499
513
|
color: ${(props) => props.theme.colors.neutral500};
|
|
500
514
|
|
|
501
515
|
@media (prefers-reduced-motion: no-preference) {
|
|
502
|
-
transition:
|
|
516
|
+
transition: ${(props) => props.theme.transitions.color};
|
|
503
517
|
}
|
|
504
518
|
`;
|
|
505
519
|
const TriggerIcon = styledComponents.styled(Flex).attrs((props) => ({
|
|
@@ -515,8 +529,8 @@ const TriggerIcon = styledComponents.styled(Flex).attrs((props) => ({
|
|
|
515
529
|
|
|
516
530
|
@media (prefers-reduced-motion: no-preference) {
|
|
517
531
|
transition:
|
|
518
|
-
transform
|
|
519
|
-
|
|
532
|
+
transform ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.authenticMotion},
|
|
533
|
+
${(props) => props.theme.transitions.backgroundColor};
|
|
520
534
|
}
|
|
521
535
|
`;
|
|
522
536
|
const AccordionTrigger = styledComponents.styled(RadixAccordion__namespace.Trigger)`
|
|
@@ -545,7 +559,7 @@ const AccordionTrigger = styledComponents.styled(RadixAccordion__namespace.Trigg
|
|
|
545
559
|
}
|
|
546
560
|
|
|
547
561
|
@media (prefers-reduced-motion: no-preference) {
|
|
548
|
-
transition:
|
|
562
|
+
transition: ${(props) => props.theme.transitions.color};
|
|
549
563
|
}
|
|
550
564
|
`;
|
|
551
565
|
const Actions = React__namespace.forwardRef((props, forwardedRef) => {
|
|
@@ -566,11 +580,11 @@ const ActionWrapper = styledComponents.styled(Flex).attrs((props) => ({
|
|
|
566
580
|
color: ${(props) => props.theme.colors.neutral600};
|
|
567
581
|
|
|
568
582
|
@media (prefers-reduced-motion: no-preference) {
|
|
569
|
-
transition:
|
|
583
|
+
transition: ${(props) => props.theme.transitions.color};
|
|
570
584
|
}
|
|
571
585
|
}
|
|
572
586
|
`;
|
|
573
|
-
const Header = React__namespace.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
|
|
587
|
+
const Header$2 = React__namespace.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
|
|
574
588
|
return /* @__PURE__ */ jsxRuntime.jsx(AccordionHeader, { $variant: variant2, ref: forwardedRef, ...props });
|
|
575
589
|
});
|
|
576
590
|
const AccordionHeader = styledComponents.styled(RadixAccordion__namespace.Header)`
|
|
@@ -606,10 +620,10 @@ const AccordionHeader = styledComponents.styled(RadixAccordion__namespace.Header
|
|
|
606
620
|
}
|
|
607
621
|
|
|
608
622
|
@media (prefers-reduced-motion: no-preference) {
|
|
609
|
-
transition:
|
|
623
|
+
transition: ${(props) => props.theme.transitions.backgroundColor};
|
|
610
624
|
}
|
|
611
625
|
`;
|
|
612
|
-
const Content$
|
|
626
|
+
const Content$7 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
613
627
|
return /* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { ref: forwardedRef, ...props });
|
|
614
628
|
});
|
|
615
629
|
const slideDown = styledComponents.keyframes`
|
|
@@ -633,22 +647,24 @@ const AccordionContent = styledComponents.styled(RadixAccordion__namespace.Conte
|
|
|
633
647
|
|
|
634
648
|
@media (prefers-reduced-motion: no-preference) {
|
|
635
649
|
&[data-state='open'] {
|
|
636
|
-
animation: ${slideDown}
|
|
650
|
+
animation: ${slideDown} ${(props) => props.theme.motion.timings["320"]}
|
|
651
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
637
652
|
}
|
|
638
653
|
|
|
639
654
|
&[data-state='closed'] {
|
|
640
|
-
animation: ${slideUp}
|
|
655
|
+
animation: ${slideUp} ${(props) => props.theme.motion.timings["320"]}
|
|
656
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
641
657
|
}
|
|
642
658
|
}
|
|
643
659
|
`;
|
|
644
660
|
const Accordion = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
645
661
|
__proto__: null,
|
|
646
662
|
Actions,
|
|
647
|
-
Content: Content$
|
|
648
|
-
Header,
|
|
649
|
-
Item: Item$
|
|
650
|
-
Root: Root$
|
|
651
|
-
Trigger: Trigger$
|
|
663
|
+
Content: Content$7,
|
|
664
|
+
Header: Header$2,
|
|
665
|
+
Item: Item$5,
|
|
666
|
+
Root: Root$8,
|
|
667
|
+
Trigger: Trigger$7
|
|
652
668
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
653
669
|
const focus = styledComponents.css`
|
|
654
670
|
position: relative;
|
|
@@ -824,88 +840,291 @@ const Alert = ({
|
|
|
824
840
|
}
|
|
825
841
|
);
|
|
826
842
|
};
|
|
827
|
-
|
|
828
|
-
const
|
|
829
|
-
|
|
843
|
+
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
844
|
+
const callbackRef = React.useRef(callback);
|
|
845
|
+
React.useEffect(() => {
|
|
846
|
+
callbackRef.current = callback;
|
|
847
|
+
});
|
|
848
|
+
return React.useMemo(
|
|
849
|
+
() => (...args) => {
|
|
850
|
+
var _callbackRef$current;
|
|
851
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
852
|
+
},
|
|
853
|
+
[]
|
|
854
|
+
);
|
|
855
|
+
}
|
|
856
|
+
function useControllableState$1({ prop, defaultProp, onChange = () => {
|
|
857
|
+
} }) {
|
|
858
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
859
|
+
const isControlled = prop !== void 0;
|
|
860
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
861
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
862
|
+
const setValue = React__namespace.useCallback(
|
|
863
|
+
(nextValue) => {
|
|
864
|
+
if (isControlled) {
|
|
865
|
+
const setter = nextValue;
|
|
866
|
+
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
867
|
+
if (value2 !== prop)
|
|
868
|
+
handleChange(value2);
|
|
869
|
+
} else {
|
|
870
|
+
setUncontrolledProp(nextValue);
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
[isControlled, prop, setUncontrolledProp, handleChange]
|
|
874
|
+
);
|
|
875
|
+
return [value, setValue];
|
|
876
|
+
}
|
|
877
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
878
|
+
const uncontrolledState = React__namespace.useState(defaultProp);
|
|
879
|
+
const [value] = uncontrolledState;
|
|
880
|
+
const prevValueRef = React__namespace.useRef(value);
|
|
881
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
882
|
+
React__namespace.useEffect(() => {
|
|
883
|
+
if (prevValueRef.current !== value) {
|
|
884
|
+
handleChange(value);
|
|
885
|
+
prevValueRef.current = value;
|
|
886
|
+
}
|
|
887
|
+
}, [value, prevValueRef, handleChange]);
|
|
888
|
+
return uncontrolledState;
|
|
889
|
+
}
|
|
890
|
+
const EASINGS = {
|
|
891
|
+
easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
|
|
892
|
+
easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
893
|
+
easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
894
|
+
easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
|
|
895
|
+
easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
896
|
+
easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
897
|
+
easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
|
|
898
|
+
easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
899
|
+
easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
900
|
+
easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
|
|
901
|
+
easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
902
|
+
easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
903
|
+
easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
|
|
904
|
+
easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
905
|
+
easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
906
|
+
easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
|
|
907
|
+
easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
908
|
+
easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
909
|
+
easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
|
|
910
|
+
easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
911
|
+
easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
912
|
+
easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
|
|
913
|
+
easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
914
|
+
easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
|
|
915
|
+
easeInOutFast: "cubic-bezier(1,0,0,1)",
|
|
916
|
+
authenticMotion: "cubic-bezier(.4,0,.2,1)"
|
|
917
|
+
};
|
|
918
|
+
const TIMINGS = {
|
|
919
|
+
"320": "320ms",
|
|
920
|
+
"200": "200ms",
|
|
921
|
+
"120": "120ms"
|
|
922
|
+
};
|
|
923
|
+
const TRANSITIONS = {
|
|
924
|
+
color: `color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`,
|
|
925
|
+
backgroundColor: `background-color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`
|
|
926
|
+
};
|
|
927
|
+
const ANIMATIONS = {
|
|
928
|
+
overlayFadeIn: styledComponents.keyframes`
|
|
929
|
+
from {
|
|
930
|
+
opacity: 0;
|
|
931
|
+
}
|
|
932
|
+
to {
|
|
933
|
+
opacity: 0.2;
|
|
934
|
+
}
|
|
935
|
+
`,
|
|
936
|
+
modalPopIn: styledComponents.keyframes`
|
|
937
|
+
from {
|
|
938
|
+
transform:translate(-50%, -50%) scale(0.8);
|
|
939
|
+
opacity: 0;
|
|
940
|
+
}
|
|
941
|
+
to {
|
|
942
|
+
transform: translate(-50%, -50%) scale(1);
|
|
943
|
+
opacity: 1;
|
|
944
|
+
}
|
|
945
|
+
`,
|
|
946
|
+
modalPopOut: styledComponents.keyframes`
|
|
947
|
+
from {
|
|
948
|
+
transform: translate(-50%, -50%) scale(1);
|
|
949
|
+
opacity: 1;
|
|
950
|
+
}
|
|
951
|
+
to {
|
|
952
|
+
transform:translate(-50%, -50%) scale(0.8);
|
|
953
|
+
opacity: 0;
|
|
954
|
+
}
|
|
955
|
+
`,
|
|
956
|
+
popIn: styledComponents.keyframes`
|
|
957
|
+
from {
|
|
958
|
+
transform: scale(0.8);
|
|
959
|
+
opacity: 0;
|
|
960
|
+
}
|
|
961
|
+
to {
|
|
962
|
+
transform: scale(1);
|
|
963
|
+
opacity: 1;
|
|
964
|
+
}
|
|
965
|
+
`,
|
|
966
|
+
popOut: styledComponents.keyframes`
|
|
967
|
+
from {
|
|
968
|
+
transform: scale(1);
|
|
969
|
+
opacity: 1;
|
|
970
|
+
}
|
|
971
|
+
to {
|
|
972
|
+
transform: scale(0.8);
|
|
973
|
+
opacity: 0;
|
|
974
|
+
}
|
|
975
|
+
`,
|
|
976
|
+
slideDownIn: styledComponents.keyframes`
|
|
977
|
+
from {
|
|
978
|
+
opacity: 0;
|
|
979
|
+
transform: translateY(-10px);
|
|
980
|
+
}
|
|
981
|
+
to {
|
|
982
|
+
opacity: 1;
|
|
983
|
+
transform: translateY(0);
|
|
984
|
+
}
|
|
985
|
+
`,
|
|
986
|
+
slideDownOut: styledComponents.keyframes`
|
|
987
|
+
from {
|
|
988
|
+
opacity: 1;
|
|
989
|
+
transform: translateY(0);
|
|
990
|
+
}
|
|
991
|
+
to {
|
|
992
|
+
opacity: 0;
|
|
993
|
+
transform: translateY(-10px);
|
|
994
|
+
}
|
|
995
|
+
`,
|
|
996
|
+
slideUpIn: styledComponents.keyframes`
|
|
997
|
+
from {
|
|
998
|
+
opacity: 0;
|
|
999
|
+
transform: translateY(10px);
|
|
1000
|
+
}
|
|
1001
|
+
to {
|
|
1002
|
+
opacity: 1;
|
|
1003
|
+
transform: translateY(0);
|
|
1004
|
+
}
|
|
1005
|
+
`,
|
|
1006
|
+
slideUpOut: styledComponents.keyframes`
|
|
1007
|
+
from {
|
|
1008
|
+
opacity: 1;
|
|
1009
|
+
transform: translateY(0);
|
|
1010
|
+
}
|
|
1011
|
+
to {
|
|
1012
|
+
opacity: 0;
|
|
1013
|
+
transform: translateY(10px);
|
|
1014
|
+
}
|
|
1015
|
+
`,
|
|
1016
|
+
fadeIn: styledComponents.keyframes`
|
|
1017
|
+
from {
|
|
1018
|
+
opacity: 0;
|
|
1019
|
+
}
|
|
1020
|
+
to {
|
|
1021
|
+
opacity: 1;
|
|
1022
|
+
}
|
|
1023
|
+
`,
|
|
1024
|
+
fadeOut: styledComponents.keyframes`
|
|
1025
|
+
from {
|
|
1026
|
+
opacity: 1;
|
|
1027
|
+
}
|
|
1028
|
+
to {
|
|
1029
|
+
opacity: 0;
|
|
1030
|
+
}
|
|
1031
|
+
`
|
|
1032
|
+
};
|
|
1033
|
+
const SIZE = 32;
|
|
1034
|
+
const PREVIEW_SCALE = 2;
|
|
1035
|
+
const Item$4 = React__namespace.forwardRef(
|
|
1036
|
+
({ onLoadingStatusChange, delayMs = 600, src, alt, fallback, preview = false, ...restProps }, forwardedRef) => {
|
|
1037
|
+
const [loadingStatus, setLoadingStatus] = useControllableState$1({
|
|
1038
|
+
onChange: onLoadingStatusChange
|
|
1039
|
+
});
|
|
1040
|
+
const [tooltipOpen, setTooltipOpen] = React__namespace.useState(false);
|
|
1041
|
+
const hasPreview = preview && loadingStatus === "loaded";
|
|
1042
|
+
const handleTooltipOpen = (isOpen) => {
|
|
1043
|
+
if (hasPreview) {
|
|
1044
|
+
setTooltipOpen(isOpen);
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip__namespace.Root, { onOpenChange: handleTooltipOpen, children: [
|
|
1048
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(AvatarRoot, { ref: forwardedRef, ...restProps, children: [
|
|
1049
|
+
hasPreview ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1050
|
+
AvatarOverlay,
|
|
1051
|
+
{
|
|
1052
|
+
width: "100%",
|
|
1053
|
+
height: "100%",
|
|
1054
|
+
position: "absolute",
|
|
1055
|
+
background: "neutral0",
|
|
1056
|
+
zIndex: "overlay",
|
|
1057
|
+
style: { opacity: tooltipOpen ? 0.4 : 0 }
|
|
1058
|
+
}
|
|
1059
|
+
) : null,
|
|
1060
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src, alt, onLoadingStatusChange: setLoadingStatus }),
|
|
1061
|
+
/* @__PURE__ */ jsxRuntime.jsx(Avatar__namespace.Fallback, { delayMs, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { fontWeight: "bold", textTransform: "uppercase", children: fallback }) })
|
|
1062
|
+
] }) }),
|
|
1063
|
+
hasPreview ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(PreviewContent, { side: "top", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(PreviewImg, { src, alt }) }) }) : null
|
|
1064
|
+
] });
|
|
1065
|
+
}
|
|
1066
|
+
);
|
|
1067
|
+
const avatarStyles = styledComponents.css`
|
|
1068
|
+
display: inline-flex;
|
|
1069
|
+
align-items: center;
|
|
1070
|
+
justify-content: center;
|
|
1071
|
+
vertical-align: middle;
|
|
1072
|
+
overflow: hidden;
|
|
1073
|
+
user-select: none;
|
|
1074
|
+
overflow: hidden;
|
|
830
1075
|
border-radius: 50%;
|
|
1076
|
+
`;
|
|
1077
|
+
const imgStyles = styledComponents.css`
|
|
1078
|
+
width: 100%;
|
|
1079
|
+
height: 100%;
|
|
831
1080
|
object-fit: cover;
|
|
832
|
-
|
|
1081
|
+
border-radius: inherit;
|
|
1082
|
+
`;
|
|
1083
|
+
const AvatarRoot = styledComponents.styled(Avatar__namespace.Root)`
|
|
833
1084
|
position: relative;
|
|
1085
|
+
z-index: 0;
|
|
1086
|
+
${avatarStyles}
|
|
1087
|
+
width: ${SIZE / 10}rem;
|
|
1088
|
+
height: ${SIZE / 10}rem;
|
|
1089
|
+
/* TODO: we should get the user email & hash it to turn it into a hex-value so different emails can consistently get a different background */
|
|
1090
|
+
background-color: ${(p) => p.theme.colors.primary600};
|
|
1091
|
+
color: ${(p) => p.theme.colors.neutral0};
|
|
1092
|
+
`;
|
|
1093
|
+
const AvatarOverlay = styledComponents.styled(Box)`
|
|
1094
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1095
|
+
transition: opacity ${(props) => props.theme.motion.timings["200"]}
|
|
1096
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1097
|
+
}
|
|
834
1098
|
`;
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
const [previewVisible, setPreviewVisible] = React__namespace.useState(false);
|
|
847
|
-
const isHovering = Boolean(preview && previewVisible);
|
|
848
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
849
|
-
isHovering ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
850
|
-
PreviewContainer,
|
|
851
|
-
{
|
|
852
|
-
"aria-hidden": true,
|
|
853
|
-
alt: "",
|
|
854
|
-
width: `${previewSize}px`,
|
|
855
|
-
height: `${previewSize}px`,
|
|
856
|
-
src: preview === true ? src : typeof preview === "string" ? preview : ""
|
|
857
|
-
}
|
|
858
|
-
) : null,
|
|
859
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
860
|
-
Box,
|
|
861
|
-
{
|
|
862
|
-
zIndex: isHovering ? 1 : void 0,
|
|
863
|
-
position: "relative",
|
|
864
|
-
onMouseEnter: () => setPreviewVisible(true),
|
|
865
|
-
onMouseLeave: () => setPreviewVisible(false),
|
|
866
|
-
width: `${avatarSize}px`,
|
|
867
|
-
height: `${avatarSize}px`,
|
|
868
|
-
children: [
|
|
869
|
-
isHovering ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
870
|
-
Overlay,
|
|
871
|
-
{
|
|
872
|
-
background: "neutral0",
|
|
873
|
-
borderRadius: "50%",
|
|
874
|
-
position: "absolute",
|
|
875
|
-
width: `${avatarSize}px`,
|
|
876
|
-
height: `${avatarSize}px`,
|
|
877
|
-
zIndex: 1
|
|
878
|
-
}
|
|
879
|
-
) : null,
|
|
880
|
-
/* @__PURE__ */ jsxRuntime.jsx(AvatarImg, { src, alt, width: `${avatarSize}px`, height: `${avatarSize}px` })
|
|
881
|
-
]
|
|
882
|
-
}
|
|
883
|
-
)
|
|
884
|
-
] });
|
|
885
|
-
};
|
|
886
|
-
const InitialsWrapper = styledComponents.styled(Flex)`
|
|
887
|
-
span {
|
|
888
|
-
line-height: 0;
|
|
1099
|
+
const AvatarImage = styledComponents.styled(Avatar__namespace.Image)`
|
|
1100
|
+
${imgStyles}
|
|
1101
|
+
`;
|
|
1102
|
+
const PreviewContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
1103
|
+
${avatarStyles}
|
|
1104
|
+
width: ${SIZE * PREVIEW_SCALE / 10}rem;
|
|
1105
|
+
height: ${SIZE * PREVIEW_SCALE / 10}rem;
|
|
1106
|
+
|
|
1107
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1108
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1109
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
889
1110
|
}
|
|
890
1111
|
`;
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { fontSize: 0, fontWeight: "bold", textColor, textTransform: "uppercase", children })
|
|
901
|
-
}
|
|
902
|
-
);
|
|
903
|
-
};
|
|
904
|
-
const AvatarGroup = styledComponents.styled(Flex)`
|
|
905
|
-
& > * + * {
|
|
906
|
-
margin-left: -${avatarSize / 2}px;
|
|
1112
|
+
const PreviewImg = styledComponents.styled.img`
|
|
1113
|
+
${imgStyles}
|
|
1114
|
+
`;
|
|
1115
|
+
const Group$2 = React__namespace.forwardRef((props, forwarededRef) => {
|
|
1116
|
+
return /* @__PURE__ */ jsxRuntime.jsx(GroupFlex, { ...props, ref: forwarededRef, tag: "div" });
|
|
1117
|
+
});
|
|
1118
|
+
const GroupFlex = styledComponents.styled(Flex)`
|
|
1119
|
+
& > ${AvatarRoot} + ${AvatarRoot} {
|
|
1120
|
+
margin-left: -${SIZE / 10 / 2}rem;
|
|
907
1121
|
}
|
|
908
1122
|
`;
|
|
1123
|
+
const Avatar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1124
|
+
__proto__: null,
|
|
1125
|
+
Group: Group$2,
|
|
1126
|
+
Item: Item$4
|
|
1127
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
909
1128
|
const Badge = ({
|
|
910
1129
|
active = false,
|
|
911
1130
|
size = "M",
|
|
@@ -975,113 +1194,6 @@ const BaseButtonWrapper = styledComponents.styled(Flex)`
|
|
|
975
1194
|
|
|
976
1195
|
${focus}
|
|
977
1196
|
`;
|
|
978
|
-
function setRef(ref, value) {
|
|
979
|
-
if (typeof ref === "function") {
|
|
980
|
-
ref(value);
|
|
981
|
-
} else if (ref !== null && ref !== void 0) {
|
|
982
|
-
ref.current = value;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
function composeRefs(...refs) {
|
|
986
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
987
|
-
}
|
|
988
|
-
function useComposedRefs(...refs) {
|
|
989
|
-
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
990
|
-
}
|
|
991
|
-
const checkmarkIconDisabled = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='%238E8EA9'%20/%3e%3c/svg%3e";
|
|
992
|
-
const checkmarkIcon = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='white'%20/%3e%3c/svg%3e";
|
|
993
|
-
const BaseCheckbox = React__namespace.forwardRef(
|
|
994
|
-
({ indeterminate = false, name, value = false, onValueChange, ...inputProps }, forwardedRef) => {
|
|
995
|
-
const checkboxRef = React__namespace.useRef(null);
|
|
996
|
-
const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
|
|
997
|
-
React__namespace.useEffect(() => {
|
|
998
|
-
if (checkboxRef.current && indeterminate) {
|
|
999
|
-
checkboxRef.current.indeterminate = indeterminate;
|
|
1000
|
-
} else {
|
|
1001
|
-
checkboxRef.current.indeterminate = false;
|
|
1002
|
-
}
|
|
1003
|
-
}, [indeterminate]);
|
|
1004
|
-
const handleValueChange = () => {
|
|
1005
|
-
if (onValueChange) {
|
|
1006
|
-
onValueChange(!value);
|
|
1007
|
-
}
|
|
1008
|
-
};
|
|
1009
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1010
|
-
CheckboxInput,
|
|
1011
|
-
{
|
|
1012
|
-
checked: value,
|
|
1013
|
-
onChange: handleValueChange,
|
|
1014
|
-
type: "checkbox",
|
|
1015
|
-
ref: composedRefs,
|
|
1016
|
-
name,
|
|
1017
|
-
...inputProps
|
|
1018
|
-
}
|
|
1019
|
-
);
|
|
1020
|
-
}
|
|
1021
|
-
);
|
|
1022
|
-
BaseCheckbox.displayName = "BaseCheckbox";
|
|
1023
|
-
const CheckboxInput = styledComponents.styled.input`
|
|
1024
|
-
min-width: 1.8rem;
|
|
1025
|
-
height: 1.8rem;
|
|
1026
|
-
margin: 0;
|
|
1027
|
-
appearance: none;
|
|
1028
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
1029
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1030
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
1031
|
-
cursor: pointer;
|
|
1032
|
-
|
|
1033
|
-
&:checked {
|
|
1034
|
-
background-color: ${({ theme }) => theme.colors.primary600};
|
|
1035
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
1036
|
-
|
|
1037
|
-
&:after {
|
|
1038
|
-
content: '';
|
|
1039
|
-
display: block;
|
|
1040
|
-
position: relative;
|
|
1041
|
-
background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
|
|
1042
|
-
width: 1rem;
|
|
1043
|
-
height: 1rem;
|
|
1044
|
-
left: 50%;
|
|
1045
|
-
top: 50%;
|
|
1046
|
-
transform: translateX(-50%) translateY(-50%);
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
&:disabled:after {
|
|
1050
|
-
background: ${() => `url("${checkmarkIconDisabled}") no-repeat no-repeat center center`};
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
&:disabled {
|
|
1055
|
-
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1056
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
&:indeterminate {
|
|
1060
|
-
background-color: ${({ theme }) => theme.colors.primary600};
|
|
1061
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
1062
|
-
|
|
1063
|
-
&:after {
|
|
1064
|
-
content: '';
|
|
1065
|
-
display: block;
|
|
1066
|
-
position: relative;
|
|
1067
|
-
color: white;
|
|
1068
|
-
height: 2px;
|
|
1069
|
-
width: 10px;
|
|
1070
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
1071
|
-
left: 50%;
|
|
1072
|
-
top: 50%;
|
|
1073
|
-
transform: translateX(-50%) translateY(-50%);
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
&:disabled {
|
|
1077
|
-
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1078
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1079
|
-
&:after {
|
|
1080
|
-
background-color: ${({ theme }) => theme.colors.neutral500};
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
`;
|
|
1085
1197
|
const BaseLink = forwardRef(
|
|
1086
1198
|
({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
|
|
1087
1199
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1099,88 +1211,6 @@ const BaseLink = forwardRef(
|
|
|
1099
1211
|
);
|
|
1100
1212
|
}
|
|
1101
1213
|
);
|
|
1102
|
-
const useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
1103
|
-
let count = 0;
|
|
1104
|
-
const useId = (initialId) => {
|
|
1105
|
-
const [id, setId] = React__namespace.useState(useReactId());
|
|
1106
|
-
React__namespace.useLayoutEffect(() => {
|
|
1107
|
-
if (!initialId)
|
|
1108
|
-
setId((reactId) => reactId ?? String(count++));
|
|
1109
|
-
}, [initialId]);
|
|
1110
|
-
return initialId?.toString() ?? (id || "");
|
|
1111
|
-
};
|
|
1112
|
-
const setTabIndexOnFirstItem = (node, selector) => {
|
|
1113
|
-
const list = node.querySelectorAll(selector);
|
|
1114
|
-
if (list && list.length > 0) {
|
|
1115
|
-
list.item(0).setAttribute("tabindex", "0");
|
|
1116
|
-
}
|
|
1117
|
-
};
|
|
1118
|
-
const [RadioProvider, useRadioGroup] = createContext("RadioGroup", {
|
|
1119
|
-
onChange: void 0,
|
|
1120
|
-
name: "",
|
|
1121
|
-
selected: ""
|
|
1122
|
-
});
|
|
1123
|
-
const RadioGroup = ({ children, labelledBy, onChange, value = "", name, ...props }) => {
|
|
1124
|
-
const radioGroupRef = React__namespace.useRef(null);
|
|
1125
|
-
React__namespace.useLayoutEffect(() => {
|
|
1126
|
-
if (!value) {
|
|
1127
|
-
setTabIndexOnFirstItem(radioGroupRef.current, `[name="${name}"]`);
|
|
1128
|
-
}
|
|
1129
|
-
}, [value, name]);
|
|
1130
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RadioProvider, { onChange, selected: value, name, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: radioGroupRef, role: "radiogroup", "aria-labelledby": labelledBy, ...props, children }) });
|
|
1131
|
-
};
|
|
1132
|
-
const BaseRadio = React__namespace.forwardRef(({ value, disabled = false, ...props }, ref) => {
|
|
1133
|
-
const generatedId = useId();
|
|
1134
|
-
const { onChange, selected, name } = useRadioGroup("BaseRadio");
|
|
1135
|
-
const isSelected = selected === value;
|
|
1136
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1137
|
-
RadioInput,
|
|
1138
|
-
{
|
|
1139
|
-
ref,
|
|
1140
|
-
type: "radio",
|
|
1141
|
-
name,
|
|
1142
|
-
value,
|
|
1143
|
-
tabIndex: isSelected ? 0 : -1,
|
|
1144
|
-
"aria-checked": isSelected,
|
|
1145
|
-
checked: isSelected,
|
|
1146
|
-
disabled,
|
|
1147
|
-
id: generatedId,
|
|
1148
|
-
onChange,
|
|
1149
|
-
...props
|
|
1150
|
-
}
|
|
1151
|
-
);
|
|
1152
|
-
});
|
|
1153
|
-
BaseRadio.displayName = "Radio";
|
|
1154
|
-
const RadioInput = styledComponents.styled.input`
|
|
1155
|
-
margin: 0;
|
|
1156
|
-
padding: 0;
|
|
1157
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
1158
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
1159
|
-
border-radius: 50%;
|
|
1160
|
-
height: 1.8rem;
|
|
1161
|
-
width: 1.8rem;
|
|
1162
|
-
|
|
1163
|
-
&:after {
|
|
1164
|
-
border-radius: 50%;
|
|
1165
|
-
content: '';
|
|
1166
|
-
position: relative;
|
|
1167
|
-
z-index: 1;
|
|
1168
|
-
display: block;
|
|
1169
|
-
height: 1rem;
|
|
1170
|
-
width: 1rem;
|
|
1171
|
-
left: 0.3rem;
|
|
1172
|
-
top: 0.3rem;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
&:checked:after {
|
|
1176
|
-
background: ${({ theme }) => theme.colors.primary600};
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
&:disabled {
|
|
1180
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1181
|
-
background: ${({ theme }) => theme.colors.neutral200};
|
|
1182
|
-
}
|
|
1183
|
-
`;
|
|
1184
1214
|
const Divider$1 = () => {
|
|
1185
1215
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
|
|
1186
1216
|
};
|
|
@@ -1234,6 +1264,18 @@ const StyledLink = styledComponents.styled(BaseLink)`
|
|
|
1234
1264
|
const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ...props, children });
|
|
1235
1265
|
CrumbLink.displayName = "CrumbLink";
|
|
1236
1266
|
const stripReactIdOfColon = (str) => str.replaceAll(":", "");
|
|
1267
|
+
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
|
1268
|
+
const useIsomorphicLayoutEffect = isSSR() ? React.useEffect : React.useLayoutEffect;
|
|
1269
|
+
const useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
1270
|
+
let count = 0;
|
|
1271
|
+
const useId = (initialId) => {
|
|
1272
|
+
const [id, setId] = React__namespace.useState(useReactId());
|
|
1273
|
+
useIsomorphicLayoutEffect(() => {
|
|
1274
|
+
if (!initialId)
|
|
1275
|
+
setId((reactId) => reactId ?? String(count++));
|
|
1276
|
+
}, [initialId]);
|
|
1277
|
+
return initialId?.toString() ?? (id || "");
|
|
1278
|
+
};
|
|
1237
1279
|
const useIntersection = (scrollableAreaRef, callback, { selectorToWatch, skipWhen = false }) => {
|
|
1238
1280
|
const handleIntersection = uiPrimitives.useCallbackRef(callback);
|
|
1239
1281
|
React__namespace.useEffect(() => {
|
|
@@ -1464,6 +1506,13 @@ const ButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
1464
1506
|
}
|
|
1465
1507
|
|
|
1466
1508
|
${getVariantStyle}
|
|
1509
|
+
|
|
1510
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1511
|
+
transition:
|
|
1512
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1513
|
+
${(props) => props.theme.transitions.color},
|
|
1514
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1515
|
+
}
|
|
1467
1516
|
`;
|
|
1468
1517
|
const Link = forwardRef(
|
|
1469
1518
|
({ children, href, disabled = false, startIcon, endIcon, isExternal = true, ...props }, ref) => {
|
|
@@ -1651,24 +1700,24 @@ const MenuSubContent = React__namespace.forwardRef((props, ref) => {
|
|
|
1651
1700
|
}
|
|
1652
1701
|
) }) });
|
|
1653
1702
|
});
|
|
1654
|
-
const Root$
|
|
1655
|
-
const Trigger$
|
|
1656
|
-
const Content$
|
|
1657
|
-
const Item$
|
|
1703
|
+
const Root$7 = MenuRoot;
|
|
1704
|
+
const Trigger$6 = MenuTrigger;
|
|
1705
|
+
const Content$6 = MenuContent;
|
|
1706
|
+
const Item$3 = MenuItem$1;
|
|
1658
1707
|
const Label$1 = MenuLabel;
|
|
1659
1708
|
const SubRoot = MenuSubRoot;
|
|
1660
1709
|
const SubTrigger = MenuSubTrigger;
|
|
1661
1710
|
const SubContent = MenuSubContent;
|
|
1662
1711
|
const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1663
1712
|
__proto__: null,
|
|
1664
|
-
Content: Content$
|
|
1665
|
-
Item: Item$
|
|
1713
|
+
Content: Content$6,
|
|
1714
|
+
Item: Item$3,
|
|
1666
1715
|
Label: Label$1,
|
|
1667
|
-
Root: Root$
|
|
1716
|
+
Root: Root$7,
|
|
1668
1717
|
SubContent,
|
|
1669
1718
|
SubRoot,
|
|
1670
1719
|
SubTrigger,
|
|
1671
|
-
Trigger: Trigger$
|
|
1720
|
+
Trigger: Trigger$6
|
|
1672
1721
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1673
1722
|
const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }) => {
|
|
1674
1723
|
const contentRef = React__namespace.useRef(null);
|
|
@@ -1696,12 +1745,12 @@ const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, .
|
|
|
1696
1745
|
*/
|
|
1697
1746
|
skipWhen: !internalIsOpen
|
|
1698
1747
|
});
|
|
1699
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Root$
|
|
1700
|
-
/* @__PURE__ */ jsxRuntime.jsx(Trigger$
|
|
1701
|
-
/* @__PURE__ */ jsxRuntime.jsx(Content$
|
|
1748
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
|
|
1749
|
+
/* @__PURE__ */ jsxRuntime.jsx(Trigger$6, { ...props, children: props.label }),
|
|
1750
|
+
/* @__PURE__ */ jsxRuntime.jsx(Content$6, { intersectionId, popoverPlacement, children })
|
|
1702
1751
|
] });
|
|
1703
1752
|
};
|
|
1704
|
-
const MenuItem = Item$
|
|
1753
|
+
const MenuItem = Item$3;
|
|
1705
1754
|
const StyledButton = styledComponents.styled(SimpleMenu)`
|
|
1706
1755
|
padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
|
|
1707
1756
|
height: unset;
|
|
@@ -1788,12 +1837,107 @@ const CardBadge = (props) => /* @__PURE__ */ jsxRuntime.jsx(CardBadgeWrapper, {
|
|
|
1788
1837
|
const CardBody = (props) => {
|
|
1789
1838
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { ...props, alignItems: "flex-start" }) });
|
|
1790
1839
|
};
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1840
|
+
function setRef(ref, value) {
|
|
1841
|
+
if (typeof ref === "function") {
|
|
1842
|
+
ref(value);
|
|
1843
|
+
} else if (ref !== null && ref !== void 0) {
|
|
1844
|
+
ref.current = value;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
function composeRefs(...refs) {
|
|
1848
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1849
|
+
}
|
|
1850
|
+
function useComposedRefs(...refs) {
|
|
1851
|
+
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
1852
|
+
}
|
|
1853
|
+
const CheckIcon = ({ fill, ...props }) => {
|
|
1854
|
+
const { colors } = styledComponents.useTheme();
|
|
1855
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1856
|
+
Box,
|
|
1857
|
+
{
|
|
1858
|
+
tag: "svg",
|
|
1859
|
+
viewBox: "0 0 10 8",
|
|
1860
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1861
|
+
fill: fill ? colors[fill] : void 0,
|
|
1862
|
+
...props,
|
|
1863
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.55323 0.396973C8.63135 0.316355 8.76051 0.315811 8.83931 0.395768L9.86256 1.43407C9.93893 1.51157 9.93935 1.6359 9.86349 1.7139L4.06401 7.67724C3.9859 7.75755 3.85707 7.75805 3.77834 7.67834L0.13866 3.99333C0.0617798 3.91549 0.0617102 3.79032 0.138504 3.7124L1.16213 2.67372C1.24038 2.59432 1.36843 2.59422 1.4468 2.67348L3.92174 5.17647L8.55323 0.396973Z" })
|
|
1864
|
+
}
|
|
1865
|
+
);
|
|
1794
1866
|
};
|
|
1795
|
-
const
|
|
1796
|
-
|
|
1867
|
+
const CheckboxEl = React__namespace.forwardRef(
|
|
1868
|
+
({ defaultChecked, checked: checkedProp, onCheckedChange, ...props }, forwardedRef) => {
|
|
1869
|
+
const checkboxRef = React__namespace.useRef(null);
|
|
1870
|
+
const [checked, setChecked] = useControllableState$1({
|
|
1871
|
+
defaultProp: defaultChecked,
|
|
1872
|
+
prop: checkedProp,
|
|
1873
|
+
onChange: onCheckedChange
|
|
1874
|
+
});
|
|
1875
|
+
const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
|
|
1876
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Checkbox__namespace.Indicator, { children: [
|
|
1877
|
+
checked === true ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { width: "1rem", fill: "neutral0" }) : null,
|
|
1878
|
+
checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(Box, { height: "2px", width: "1rem", background: "neutral0", borderRadius: "1px" }) : null
|
|
1879
|
+
] }) });
|
|
1880
|
+
}
|
|
1881
|
+
);
|
|
1882
|
+
const CheckboxRoot = styledComponents.styled(Checkbox__namespace.Root)`
|
|
1883
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
1884
|
+
width: 2rem;
|
|
1885
|
+
height: 2rem;
|
|
1886
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1887
|
+
border: 1px solid ${(props) => props.theme.colors.neutral300};
|
|
1888
|
+
position: relative;
|
|
1889
|
+
z-index: 0;
|
|
1890
|
+
display: flex;
|
|
1891
|
+
justify-content: center;
|
|
1892
|
+
align-items: center;
|
|
1893
|
+
// this ensures the checkbox is always a square even in flex-containers.
|
|
1894
|
+
flex: 0 0 2rem;
|
|
1895
|
+
|
|
1896
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1897
|
+
transition:
|
|
1898
|
+
border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
|
|
1899
|
+
${(props) => props.theme.transitions.backgroundColor};
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
&[data-state='checked'],
|
|
1903
|
+
&[data-state='indeterminate'] {
|
|
1904
|
+
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
1905
|
+
background-color: ${(props) => props.theme.colors.primary600};
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
&[data-disabled] {
|
|
1909
|
+
background-color: ${(props) => props.theme.colors.neutral200};
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
1913
|
+
&::before {
|
|
1914
|
+
content: '';
|
|
1915
|
+
position: absolute;
|
|
1916
|
+
top: 50%;
|
|
1917
|
+
left: 50%;
|
|
1918
|
+
transform: translate(-50%, -50%);
|
|
1919
|
+
width: 100%;
|
|
1920
|
+
height: 100%;
|
|
1921
|
+
min-width: 44px;
|
|
1922
|
+
min-height: 44px;
|
|
1923
|
+
}
|
|
1924
|
+
`;
|
|
1925
|
+
const CheckboxImpl = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
1926
|
+
const labelId = useId(restProps.id);
|
|
1927
|
+
if (!children) {
|
|
1928
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxEl, { ref: forwardedRef, ...restProps });
|
|
1929
|
+
}
|
|
1930
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
|
|
1931
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckboxEl, { id: labelId, ...restProps }),
|
|
1932
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
|
|
1933
|
+
] });
|
|
1934
|
+
});
|
|
1935
|
+
const CardCheckbox = (props) => {
|
|
1936
|
+
const { id } = useCard();
|
|
1937
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
|
|
1938
|
+
};
|
|
1939
|
+
const BreakBox = styledComponents.styled(Box)`
|
|
1940
|
+
word-break: break-all;
|
|
1797
1941
|
`;
|
|
1798
1942
|
const CardContent = ({ children, ...props }) => {
|
|
1799
1943
|
return /* @__PURE__ */ jsxRuntime.jsx(BreakBox, { ...props, children });
|
|
@@ -1871,14 +2015,6 @@ const TooltipImpl = React__namespace.forwardRef(
|
|
|
1871
2015
|
);
|
|
1872
2016
|
}
|
|
1873
2017
|
);
|
|
1874
|
-
const fadeIn = styledComponents.keyframes`
|
|
1875
|
-
from {
|
|
1876
|
-
opacity: 0;
|
|
1877
|
-
}
|
|
1878
|
-
to {
|
|
1879
|
-
opacity: 1;
|
|
1880
|
-
}
|
|
1881
|
-
`;
|
|
1882
2018
|
const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
1883
2019
|
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1884
2020
|
color: ${(props) => props.theme.colors.neutral0};
|
|
@@ -1890,7 +2026,8 @@ const TooltipContent = styledComponents.styled(Tooltip__namespace.Content)`
|
|
|
1890
2026
|
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1891
2027
|
|
|
1892
2028
|
@media (prefers-reduced-motion: no-preference) {
|
|
1893
|
-
animation: ${fadeIn}
|
|
2029
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2030
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1894
2031
|
}
|
|
1895
2032
|
`;
|
|
1896
2033
|
const CarouselGrid = styledComponents.styled(Box)`
|
|
@@ -1963,34 +2100,6 @@ const Carousel = React__namespace.forwardRef(
|
|
|
1963
2100
|
] }) });
|
|
1964
2101
|
}
|
|
1965
2102
|
);
|
|
1966
|
-
const EASINGS = {
|
|
1967
|
-
easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
|
|
1968
|
-
easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
1969
|
-
easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
1970
|
-
easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
|
|
1971
|
-
easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
1972
|
-
easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
1973
|
-
easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
|
|
1974
|
-
easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
1975
|
-
easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
1976
|
-
easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
|
|
1977
|
-
easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
1978
|
-
easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
1979
|
-
easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
|
|
1980
|
-
easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
1981
|
-
easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
1982
|
-
easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
|
|
1983
|
-
easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
1984
|
-
easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
1985
|
-
easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
|
|
1986
|
-
easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
1987
|
-
easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
1988
|
-
easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
|
|
1989
|
-
easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
1990
|
-
easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
|
|
1991
|
-
easeInOutFast: "cubic-bezier(1,0,0,1)",
|
|
1992
|
-
authenticMotion: "cubic-bezier(.4,0,.2,1)"
|
|
1993
|
-
};
|
|
1994
2103
|
const sizes = {
|
|
1995
2104
|
accordions: {
|
|
1996
2105
|
S: `4.8rem`,
|
|
@@ -2026,7 +2135,11 @@ const commonTheme = {
|
|
|
2026
2135
|
semiBold: 500,
|
|
2027
2136
|
bold: 600
|
|
2028
2137
|
},
|
|
2029
|
-
|
|
2138
|
+
transitions: TRANSITIONS,
|
|
2139
|
+
motion: {
|
|
2140
|
+
easings: EASINGS,
|
|
2141
|
+
timings: TIMINGS
|
|
2142
|
+
}
|
|
2030
2143
|
};
|
|
2031
2144
|
const lightColorTokenObject = {
|
|
2032
2145
|
color: {
|
|
@@ -2854,7 +2967,7 @@ lodash.exports;
|
|
|
2854
2967
|
}
|
|
2855
2968
|
var runInContext = function runInContext2(context) {
|
|
2856
2969
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
2857
|
-
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function,
|
|
2970
|
+
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
|
|
2858
2971
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
2859
2972
|
var coreJsData = context["__core-js_shared__"];
|
|
2860
2973
|
var funcToString = funcProto.toString;
|
|
@@ -2880,7 +2993,7 @@ lodash.exports;
|
|
|
2880
2993
|
}
|
|
2881
2994
|
}();
|
|
2882
2995
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
2883
|
-
var nativeCeil =
|
|
2996
|
+
var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse;
|
|
2884
2997
|
var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
2885
2998
|
var metaMap = WeakMap && new WeakMap();
|
|
2886
2999
|
var realNames = {};
|
|
@@ -4626,7 +4739,7 @@ lodash.exports;
|
|
|
4626
4739
|
return setWrapToString(result2, func, bitmask);
|
|
4627
4740
|
}
|
|
4628
4741
|
function createRound(methodName) {
|
|
4629
|
-
var func =
|
|
4742
|
+
var func = Math[methodName];
|
|
4630
4743
|
return function(number2, precision) {
|
|
4631
4744
|
number2 = toNumber(number2);
|
|
4632
4745
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -7681,7 +7794,7 @@ const getThemeSize = (type) => {
|
|
|
7681
7794
|
};
|
|
7682
7795
|
const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) => styledComponents.css`
|
|
7683
7796
|
outline: none;
|
|
7684
|
-
box-shadow:
|
|
7797
|
+
box-shadow: none;
|
|
7685
7798
|
transition-property: border-color, box-shadow, fill;
|
|
7686
7799
|
transition-duration: 0.2s;
|
|
7687
7800
|
|
|
@@ -7691,7 +7804,7 @@ const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) =>
|
|
|
7691
7804
|
}
|
|
7692
7805
|
`;
|
|
7693
7806
|
const [FieldProvider, useField] = createContext("Field", {});
|
|
7694
|
-
const Root$
|
|
7807
|
+
const Root$6 = React__namespace.forwardRef(
|
|
7695
7808
|
({ children, name, error = false, hint, id, required = false, ...props }, ref) => {
|
|
7696
7809
|
const generatedId = useId(id);
|
|
7697
7810
|
const [labelNode, setLabelNode] = React__namespace.useState();
|
|
@@ -7721,7 +7834,6 @@ const Label = React__namespace.forwardRef(({ children, action, ...props }, ref)
|
|
|
7721
7834
|
{
|
|
7722
7835
|
ref: composedRefs,
|
|
7723
7836
|
display: "flex",
|
|
7724
|
-
alignItems: "center",
|
|
7725
7837
|
variant: "pi",
|
|
7726
7838
|
textColor: "neutral800",
|
|
7727
7839
|
fontWeight: "bold",
|
|
@@ -7856,7 +7968,7 @@ const Error$1 = () => {
|
|
|
7856
7968
|
}
|
|
7857
7969
|
return /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "pi", tag: "p", id: `${id}-error`, textColor: "danger600", "data-strapi-field-error": true, children: error });
|
|
7858
7970
|
};
|
|
7859
|
-
const Action = React__namespace.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7971
|
+
const Action$1 = React__namespace.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7860
7972
|
FieldActionWrapper,
|
|
7861
7973
|
{
|
|
7862
7974
|
justifyContent: "unset",
|
|
@@ -7875,12 +7987,12 @@ const FieldActionWrapper = styledComponents.styled(Flex)`
|
|
|
7875
7987
|
`;
|
|
7876
7988
|
const Field = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7877
7989
|
__proto__: null,
|
|
7878
|
-
Action,
|
|
7990
|
+
Action: Action$1,
|
|
7879
7991
|
Error: Error$1,
|
|
7880
7992
|
Hint,
|
|
7881
7993
|
Input: Input$2,
|
|
7882
7994
|
Label,
|
|
7883
|
-
Root: Root$
|
|
7995
|
+
Root: Root$6,
|
|
7884
7996
|
useField
|
|
7885
7997
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7886
7998
|
const CarouselInput = React__namespace.forwardRef(
|
|
@@ -7902,7 +8014,7 @@ const CarouselInput = React__namespace.forwardRef(
|
|
|
7902
8014
|
...props
|
|
7903
8015
|
}, forwardedRef) => {
|
|
7904
8016
|
const generatedId = useId(id);
|
|
7905
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root$
|
|
8017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root$6, { hint, error, id: generatedId, required, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
|
7906
8018
|
label && /* @__PURE__ */ jsxRuntime.jsx(Label, { action: labelAction, children: label }),
|
|
7907
8019
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7908
8020
|
Carousel,
|
|
@@ -7966,21 +8078,6 @@ const CarouselSlide = ({ label, children, selected = false, ...props }) => /* @_
|
|
|
7966
8078
|
children
|
|
7967
8079
|
}
|
|
7968
8080
|
);
|
|
7969
|
-
const Checkbox = React__namespace.forwardRef(
|
|
7970
|
-
({ children, disabled = false, ...props }, forwardedRef) => {
|
|
7971
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CheckboxLabel, { tag: "label", textColor: "neutral800", $disabled: disabled, children: [
|
|
7972
|
-
/* @__PURE__ */ jsxRuntime.jsx(BaseCheckbox, { ref: forwardedRef, disabled, ...props }),
|
|
7973
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { paddingLeft: 2, children })
|
|
7974
|
-
] });
|
|
7975
|
-
}
|
|
7976
|
-
);
|
|
7977
|
-
const CheckboxLabel = styledComponents.styled(Typography)`
|
|
7978
|
-
display: flex;
|
|
7979
|
-
align-items: flex-start;
|
|
7980
|
-
* {
|
|
7981
|
-
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
7982
|
-
}
|
|
7983
|
-
`;
|
|
7984
8081
|
const loaderSvg = "data:image/svg+xml,%3csvg%20width='63'%20height='63'%20viewBox='0%200%2063%2063'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.5563%2011.9816C39.484%2010.3071%2035.8575%209.29097%2032.3354%209.13521C28.6443%208.92888%2024.8295%209.72318%2021.3336%2011.4129C20.9123%2011.5901%2020.5376%2011.8101%2020.1722%2012.0249L20.0108%2012.1179C19.8774%2012.1951%2019.7441%2012.2724%2019.608%2012.3536C19.3253%2012.5146%2019.0492%2012.6744%2018.7544%2012.8792C18.5463%2013.0329%2018.3395%2013.1759%2018.1301%2013.323C17.5658%2013.7208%2016.9868%2014.1317%2016.4983%2014.5979C14.8476%2015.9524%2013.5571%2017.6075%2012.6071%2018.9214C10.4365%2022.1566%209.08622%2025.9567%208.80702%2029.6143L8.7764%2030.1588C8.73328%2030.9196%208.68476%2031.7057%208.75353%2032.4555C8.76648%2032.6084%208.7661%2032.7638%208.77506%2032.914C8.78895%2033.229%208.80152%2033.5373%208.846%2033.8672L9.07396%2035.4221C9.09756%2035.5764%209.1198%2035.7413%209.1633%2035.9263L9.65919%2037.9272L10.138%2039.2823C10.2729%2039.6673%2010.4158%2040.0751%2010.6%2040.43C12.0292%2043.637%2014.1425%2046.4578%2016.7063%2048.585C19.0508%2050.5296%2021.824%2052.0023%2024.7491%2052.8452L26.2371%2053.2376C26.3781%2053.2693%2026.4926%2053.2889%2026.6031%2053.3058L26.7775%2053.3311C27.0052%2053.3636%2027.2195%2053.3986%2027.4445%2053.435C27.8598%2053.5076%2028.2672%2053.5748%2028.7079%2053.6183L30.5641%2053.7229C30.9516%2053.7249%2031.3352%2053.7068%2031.7081%2053.6874C31.9039%2053.681%2032.0984%2053.6681%2032.3288%2053.662C34.5253%2053.4772%2036.5106%2053.0634%2038.0516%2052.4652C38.1769%2052.4171%2038.3008%2052.3796%2038.4234%2052.3355C38.6727%2052.2499%2038.9259%2052.167%2039.1432%2052.0599L40.8591%2051.2626L42.5702%2050.266C42.9009%2050.0682%2043.0205%2049.6414%2042.8282%2049.2984C42.632%2048.9526%2042.2034%2048.8308%2041.8634%2049.0166L40.1792%2049.9218L38.4995%2050.6224C38.3169%2050.6953%2038.121%2050.7534%2037.9224%2050.8155C37.7838%2050.8489%2037.6518%2050.8983%2037.5012%2050.9408C36.0711%2051.435%2034.2445%2051.7425%2032.244%2051.8346C32.0442%2051.8383%2031.8471%2051.8379%2031.654%2051.8403C31.3051%2051.8414%2030.9602%2051.8451%2030.6392%2051.8305L28.9177%2051.6725C28.5476%2051.619%2028.1695%2051.5427%2027.7848%2051.4678C27.5639%2051.4167%2027.3376%2051.3737%2027.1299%2051.3374L26.9529%2051.2987C26.8704%2051.2834%2026.7772%2051.2667%2026.7333%2051.2543L25.3466%2050.8322C22.7651%2049.9789%2020.33%2048.5729%2018.2942%2046.7557C16.1056%2044.7951%2014.3339%2042.2335%2013.1742%2039.3582C12.0276%2036.6013%2011.5988%2033.2792%2011.9716%2030.0076C12.3145%2027.0213%2013.3948%2024.1635%2015.1858%2021.5083C15.3034%2021.3339%2015.421%2021.1596%2015.5212%2021.0196C16.4309%2019.8688%2017.5408%2018.5589%2018.9483%2017.496C19.3367%2017.1525%2019.7862%2016.856%2020.2611%2016.5478C20.4878%2016.4009%2020.7079%2016.2553%2020.8907%2016.1306C21.0974%2016.0048%2021.3188%2015.8831%2021.5348%2015.7694C21.6761%2015.6975%2021.8162%2015.619%2021.9388%2015.5576L22.1002%2015.4646C22.4002%2015.3037%2022.6749%2015.1546%2022.9908%2015.039L24.1186%2014.5715C24.3399%2014.4844%2024.5718%2014.4159%2024.7997%2014.3447C24.953%2014.2982%2025.0982%2014.2635%2025.2635%2014.2078C25.786%2014.0182%2026.3283%2013.9112%2026.9105%2013.7965C27.117%2013.7571%2027.3302%2013.7163%2027.5608%2013.6585C27.7553%2013.611%2027.9737%2013.5969%2028.2082%2013.5762C28.364%2013.5603%2028.5172%2013.5483%2028.6318%2013.5333C28.7876%2013.5173%2028.9342%2013.5066%2029.0927%2013.4867C29.3285%2013.4555%2029.5456%2013.4347%2029.7494%2013.4337C30.0237%2013.44%2030.2994%2013.4357%2030.5777%2013.4274C31.0811%2013.421%2031.5579%2013.4197%2032.0318%2013.4914C34.9664%2013.7352%2037.7144%2014.6085%2040.2052%2016.0868C42.3489%2017.3655%2044.2716%2019.1525%2045.7607%2021.264C47.0255%2023.0628%2047.9756%2025.0528%2048.4928%2027.0393C48.572%2027.3176%2048.6299%2027.5931%2048.6839%2027.8659C48.7154%2028.0428%2048.7563%2028.2145%2048.7892%2028.3636C48.8037%2028.4541%2048.8208%2028.5406%2048.8445%2028.6258C48.8749%2028.7443%2048.8986%2028.864%2048.9116%2028.9651L48.9793%2029.6047C48.9922%2029.7748%2049.0132%2029.9331%2049.0301%2030.0887C49.0668%2030.3268%2049.0889%2030.5608%2049.0964%2030.7561L49.1083%2031.9001C49.1312%2032.3307%2049.089%2032.7116%2049.0522%2033.0673C49.0384%2033.2598%2049.0126%2033.4443%2049.0123%2033.5824C48.9961%2033.6926%2048.9918%2033.7935%2048.9836%2033.8917C48.9753%2034.0072%2048.9724%2034.1148%2048.9414%2034.2554L48.5449%2036.3059C48.3134%2037.8623%2049.3793%2039.3365%2050.9488%2039.5822C52.0417%2039.7601%2053.1536%2039.2819%2053.7711%2038.3664C54.0063%2038.0176%2054.1604%2037.6257%2054.2227%2037.2064L54.5217%2035.2574C54.5514%2035.0756%2054.572%2034.83%2054.5846%2034.5791L54.6028%2034.2338C54.6098%2034.0598%2054.6223%2033.8779%2054.6347%2033.6788C54.6734%2033.1052%2054.7163%2032.4479%2054.6619%2031.8058L54.5867%2030.4289C54.5622%2030.0952%2054.5097%2029.76%2054.4559%2029.4181C54.431%2029.2572%2054.4048%2029.0896%2054.3826%2028.9074L54.2687%2028.104C54.2332%2027.9244%2054.1804%2027.7273%2054.1329%2027.5396L54.0643%2027.2454C54.0195%2027.071%2053.9773%2026.8927%2053.9338%2026.7076C53.8455%2026.3309%2053.7479%2025.9422%2053.613%2025.5571C52.84%2023.0292%2051.5383%2020.5194%2049.8338%2018.2799C47.8544%2015.682%2045.3333%2013.5087%2042.5563%2011.9816Z'%20fill='%234945FF'/%3e%3c/svg%3e";
|
|
7985
8082
|
const Loader = React__namespace.forwardRef(({ children, small = false, ...props }, ref) => {
|
|
7986
8083
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "alert", "aria-live": "assertive", ref, ...props, children: [
|
|
@@ -8039,17 +8136,17 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8039
8136
|
value,
|
|
8040
8137
|
...restProps
|
|
8041
8138
|
}, forwardedRef) => {
|
|
8042
|
-
const [internalIsOpen, setInternalIsOpen] =
|
|
8139
|
+
const [internalIsOpen, setInternalIsOpen] = useControllableState$1({
|
|
8043
8140
|
prop: open,
|
|
8044
8141
|
defaultProp: defaultOpen,
|
|
8045
8142
|
onChange: onOpenChange
|
|
8046
8143
|
});
|
|
8047
|
-
const [internalTextValue, setInternalTextValue] =
|
|
8144
|
+
const [internalTextValue, setInternalTextValue] = useControllableState$1({
|
|
8048
8145
|
prop: textValue,
|
|
8049
8146
|
defaultProp: allowCustomValue && !defaultTextValue ? value : defaultTextValue,
|
|
8050
8147
|
onChange: onTextValueChange
|
|
8051
8148
|
});
|
|
8052
|
-
const [internalFilterValue, setInternalFilterValue] =
|
|
8149
|
+
const [internalFilterValue, setInternalFilterValue] = useControllableState$1({
|
|
8053
8150
|
prop: filterValue,
|
|
8054
8151
|
defaultProp: defaultFilterValue,
|
|
8055
8152
|
onChange: onFilterValueChange
|
|
@@ -8133,9 +8230,9 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8133
8230
|
onFilterValueChange: handleFilterValueChange,
|
|
8134
8231
|
isPrintableCharacter: isPrintableCharacter2,
|
|
8135
8232
|
children: [
|
|
8136
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Trigger$
|
|
8233
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Trigger$5, { $hasError: hasError, className, children: [
|
|
8137
8234
|
/* @__PURE__ */ jsxRuntime.jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8138
|
-
startIcon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8235
|
+
startIcon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8139
8236
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8140
8237
|
TextInput$1,
|
|
8141
8238
|
{
|
|
@@ -8172,7 +8269,7 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8172
8269
|
/* @__PURE__ */ jsxRuntime.jsx(DownIcon$1, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}) })
|
|
8173
8270
|
] })
|
|
8174
8271
|
] }),
|
|
8175
|
-
/* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$
|
|
8272
|
+
/* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Combobox.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport$1, { ref: viewportRef, children: [
|
|
8176
8273
|
children,
|
|
8177
8274
|
creatable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8178
8275
|
uiPrimitives.Combobox.CreateItem,
|
|
@@ -8195,7 +8292,7 @@ const Combobox = React__namespace.forwardRef(
|
|
|
8195
8292
|
const IconBox$3 = styledComponents.styled(Box)`
|
|
8196
8293
|
padding: 0;
|
|
8197
8294
|
`;
|
|
8198
|
-
const Trigger$
|
|
8295
|
+
const Trigger$5 = styledComponents.styled(uiPrimitives.Combobox.Trigger)`
|
|
8199
8296
|
position: relative;
|
|
8200
8297
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
8201
8298
|
padding-right: ${({ theme }) => theme.spaces[3]};
|
|
@@ -8250,7 +8347,7 @@ const DownIcon$1 = styledComponents.styled(uiPrimitives.Combobox.Icon)`
|
|
|
8250
8347
|
cursor: inherit;
|
|
8251
8348
|
}
|
|
8252
8349
|
`;
|
|
8253
|
-
const Content$
|
|
8350
|
+
const Content$5 = styledComponents.styled(uiPrimitives.Combobox.Content)`
|
|
8254
8351
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
8255
8352
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
8256
8353
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
@@ -8259,6 +8356,23 @@ const Content$2 = styledComponents.styled(uiPrimitives.Combobox.Content)`
|
|
|
8259
8356
|
/* This is from the design-system figma file. */
|
|
8260
8357
|
max-height: 15rem;
|
|
8261
8358
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8359
|
+
|
|
8360
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8361
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
8362
|
+
|
|
8363
|
+
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
8364
|
+
&[data-state='open'] {
|
|
8365
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8366
|
+
|
|
8367
|
+
&[data-side='top'] {
|
|
8368
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8369
|
+
}
|
|
8370
|
+
|
|
8371
|
+
&[data-side='bottom'] {
|
|
8372
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8373
|
+
}
|
|
8374
|
+
}
|
|
8375
|
+
}
|
|
8262
8376
|
`;
|
|
8263
8377
|
const Viewport$1 = styledComponents.styled(uiPrimitives.Combobox.Viewport)`
|
|
8264
8378
|
padding: ${({ theme }) => theme.spaces[1]};
|
|
@@ -8295,164 +8409,131 @@ const OptionBox = styledComponents.styled.div`
|
|
|
8295
8409
|
font-weight: bold;
|
|
8296
8410
|
}
|
|
8297
8411
|
`;
|
|
8298
|
-
const
|
|
8299
|
-
const
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
const nodes = [
|
|
8312
|
-
...node.querySelectorAll(
|
|
8313
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
8314
|
-
)
|
|
8315
|
-
];
|
|
8316
|
-
const focusables = nodes.filter((node2) => {
|
|
8317
|
-
if (node2.hasAttribute("disabled"))
|
|
8318
|
-
return false;
|
|
8319
|
-
if (includeNegativeTabIndex)
|
|
8320
|
-
return true;
|
|
8321
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
8322
|
-
});
|
|
8323
|
-
return focusables;
|
|
8324
|
-
};
|
|
8325
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
8326
|
-
return nodes.filter((node) => {
|
|
8327
|
-
if (node.tagName === "INPUT") {
|
|
8328
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
8329
|
-
}
|
|
8330
|
-
return false;
|
|
8331
|
-
});
|
|
8332
|
-
};
|
|
8333
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
8334
|
-
const trappedRef = React__namespace.useRef(null);
|
|
8335
|
-
React__namespace.useEffect(() => {
|
|
8336
|
-
let currentFocus = null;
|
|
8337
|
-
if (restoreFocus) {
|
|
8338
|
-
currentFocus = document.activeElement;
|
|
8339
|
-
}
|
|
8340
|
-
return () => {
|
|
8341
|
-
if (currentFocus) {
|
|
8342
|
-
currentFocus.focus();
|
|
8343
|
-
}
|
|
8344
|
-
};
|
|
8345
|
-
}, [restoreFocus]);
|
|
8346
|
-
React__namespace.useEffect(() => {
|
|
8347
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
8348
|
-
return;
|
|
8349
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
8350
|
-
if (focusableChildren.length > 0) {
|
|
8351
|
-
const firstElement = focusableChildren[0];
|
|
8352
|
-
firstElement.focus();
|
|
8353
|
-
} else {
|
|
8354
|
-
console.warn(
|
|
8355
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
8356
|
-
);
|
|
8357
|
-
}
|
|
8358
|
-
}, [skipAutoFocus]);
|
|
8359
|
-
const handleKeyDown = (e) => {
|
|
8360
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
8361
|
-
onEscape();
|
|
8362
|
-
return;
|
|
8363
|
-
}
|
|
8364
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
8365
|
-
return;
|
|
8366
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
8367
|
-
if (focusableChildren.length > 0) {
|
|
8368
|
-
const firstElement = focusableChildren[0];
|
|
8369
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
8370
|
-
if (e.shiftKey) {
|
|
8371
|
-
if (firstElement === document.activeElement) {
|
|
8372
|
-
e.preventDefault();
|
|
8373
|
-
lastElement.focus();
|
|
8374
|
-
}
|
|
8375
|
-
} else if (lastElement === document.activeElement) {
|
|
8376
|
-
e.preventDefault();
|
|
8377
|
-
firstElement.focus();
|
|
8378
|
-
}
|
|
8379
|
-
}
|
|
8380
|
-
};
|
|
8381
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
8382
|
-
};
|
|
8383
|
-
const Portal$1 = React__namespace.forwardRef(
|
|
8384
|
-
({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
|
|
8385
|
-
return container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
|
|
8386
|
-
}
|
|
8387
|
-
);
|
|
8388
|
-
Portal$1.displayName = "Portal";
|
|
8389
|
-
const DialogWrapper = styledComponents.styled(Box)`
|
|
8412
|
+
const Root$5 = AlertDialog__namespace.Root;
|
|
8413
|
+
const Trigger$4 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
8414
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
8415
|
+
});
|
|
8416
|
+
const Content$4 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
8417
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialog__namespace.Portal, { children: [
|
|
8418
|
+
/* @__PURE__ */ jsxRuntime.jsx(Overlay$1, {}),
|
|
8419
|
+
/* @__PURE__ */ jsxRuntime.jsx(ContentImpl$1, { ref: forwardedRef, ...props })
|
|
8420
|
+
] });
|
|
8421
|
+
});
|
|
8422
|
+
const Overlay$1 = styledComponents.styled(AlertDialog__namespace.Overlay)`
|
|
8423
|
+
background-color: ${(props) => props.theme.colors.neutral800};
|
|
8424
|
+
position: fixed;
|
|
8390
8425
|
inset: 0;
|
|
8391
|
-
|
|
8426
|
+
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
8427
|
+
opacity: 0.2;
|
|
8428
|
+
|
|
8429
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8430
|
+
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
8431
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
8432
|
+
}
|
|
8392
8433
|
`;
|
|
8393
|
-
const
|
|
8394
|
-
max-width:
|
|
8395
|
-
|
|
8434
|
+
const ContentImpl$1 = styledComponents.styled(AlertDialog__namespace.Content)`
|
|
8435
|
+
max-width: 42rem;
|
|
8436
|
+
height: min-content;
|
|
8437
|
+
width: 100%;
|
|
8396
8438
|
overflow: hidden;
|
|
8397
|
-
margin
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
}
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
shadow: "popupShadow",
|
|
8417
|
-
role: "dialog",
|
|
8418
|
-
children: [
|
|
8419
|
-
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { padding: 6, justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "beta", as, id: labelledBy, children: title }) }),
|
|
8420
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { ...props })
|
|
8421
|
-
]
|
|
8439
|
+
margin: 0 auto;
|
|
8440
|
+
display: flex;
|
|
8441
|
+
flex-direction: column;
|
|
8442
|
+
|
|
8443
|
+
position: fixed;
|
|
8444
|
+
top: 50%;
|
|
8445
|
+
left: 50%;
|
|
8446
|
+
transform: translate(-50%, -50%);
|
|
8447
|
+
|
|
8448
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
8449
|
+
background-color: ${(props) => props.theme.colors.neutral0};
|
|
8450
|
+
box-shadow: ${(props) => props.theme.shadows.popupShadow};
|
|
8451
|
+
z-index: ${(props) => props.theme.zIndices.modal};
|
|
8452
|
+
|
|
8453
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8454
|
+
&[data-state='open'] {
|
|
8455
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
8456
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8457
|
+
animation-name: ${ANIMATIONS.modalPopIn};
|
|
8422
8458
|
}
|
|
8423
|
-
) }) }) }) });
|
|
8424
|
-
};
|
|
8425
|
-
const IconContainer = styledComponents.styled(Box)`
|
|
8426
|
-
svg {
|
|
8427
|
-
width: ${({ theme }) => theme.spaces[6]};
|
|
8428
|
-
height: ${({ theme }) => theme.spaces[6]};
|
|
8429
8459
|
|
|
8430
|
-
|
|
8431
|
-
|
|
8460
|
+
&[data-state='closed'] {
|
|
8461
|
+
animation-duration: ${(props) => props.theme.motion.timings["120"]};
|
|
8462
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
8463
|
+
animation-name: ${ANIMATIONS.modalPopOut};
|
|
8432
8464
|
}
|
|
8433
8465
|
}
|
|
8434
8466
|
`;
|
|
8435
|
-
const
|
|
8436
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
}
|
|
8467
|
+
const Header$1 = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
8468
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8469
|
+
Title$1,
|
|
8470
|
+
{
|
|
8471
|
+
tag: "h2",
|
|
8472
|
+
ref: forwardedRef,
|
|
8473
|
+
padding: 6,
|
|
8474
|
+
justifyContent: "center",
|
|
8475
|
+
variant: "h2",
|
|
8476
|
+
fontWeight: "bold",
|
|
8477
|
+
...restProps,
|
|
8478
|
+
children
|
|
8479
|
+
}
|
|
8480
|
+
) });
|
|
8481
|
+
});
|
|
8482
|
+
const Title$1 = styledComponents.styled(Typography)`
|
|
8483
|
+
display: flex;
|
|
8484
|
+
justify-content: center;
|
|
8485
|
+
border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
8449
8486
|
`;
|
|
8450
|
-
const
|
|
8451
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8487
|
+
const Body$1 = React__namespace.forwardRef(({ children, icon, ...restProps }, forwardedRef) => {
|
|
8488
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8489
|
+
Flex,
|
|
8490
|
+
{
|
|
8491
|
+
ref: forwardedRef,
|
|
8492
|
+
gap: 2,
|
|
8493
|
+
direction: "column",
|
|
8494
|
+
paddingTop: 8,
|
|
8495
|
+
paddingBottom: 8,
|
|
8496
|
+
paddingLeft: 6,
|
|
8497
|
+
paddingRight: 6,
|
|
8498
|
+
...restProps,
|
|
8499
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8500
|
+
icon ? React__namespace.cloneElement(icon, {
|
|
8501
|
+
width: 24,
|
|
8502
|
+
height: 24
|
|
8503
|
+
}) : null,
|
|
8504
|
+
/* @__PURE__ */ jsxRuntime.jsx(Description, { children })
|
|
8505
|
+
] }) : children
|
|
8506
|
+
}
|
|
8507
|
+
);
|
|
8508
|
+
});
|
|
8509
|
+
const Description = React__namespace.forwardRef((props, forwardedRef) => {
|
|
8510
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { ref: forwardedRef, variant: "omega", ...props, tag: "p" }) });
|
|
8511
|
+
});
|
|
8512
|
+
const Footer$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
8513
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Foot$1, { ref: forwardedRef, gap: 2, padding: 4, justifyContent: "space-between", ...props, tag: "footer" });
|
|
8514
|
+
});
|
|
8515
|
+
const Foot$1 = styledComponents.styled(Flex)`
|
|
8516
|
+
border-top: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
8517
|
+
flex: 1;
|
|
8518
|
+
`;
|
|
8519
|
+
const Cancel = React__namespace.forwardRef((props, forwardedRef) => {
|
|
8520
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Cancel, { ...props, asChild: true, ref: forwardedRef });
|
|
8521
|
+
});
|
|
8522
|
+
const Action = React__namespace.forwardRef((props, forwardedRef) => {
|
|
8523
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog__namespace.Action, { ...props, asChild: true, ref: forwardedRef });
|
|
8524
|
+
});
|
|
8525
|
+
const Dialog = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8526
|
+
__proto__: null,
|
|
8527
|
+
Action,
|
|
8528
|
+
Body: Body$1,
|
|
8529
|
+
Cancel,
|
|
8530
|
+
Content: Content$4,
|
|
8531
|
+
Description,
|
|
8532
|
+
Footer: Footer$1,
|
|
8533
|
+
Header: Header$1,
|
|
8534
|
+
Root: Root$5,
|
|
8535
|
+
Trigger: Trigger$4
|
|
8536
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
8456
8537
|
let $3db38b7d1fb3fe6a$var$count = 0;
|
|
8457
8538
|
function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
8458
8539
|
React.useEffect(() => {
|
|
@@ -8477,47 +8558,6 @@ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
|
8477
8558
|
element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
|
|
8478
8559
|
return element;
|
|
8479
8560
|
}
|
|
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
8561
|
function useDateFormatter(locale, options) {
|
|
8522
8562
|
const lastOptions = React__namespace.useRef(null);
|
|
8523
8563
|
if (options && lastOptions.current && isEqual(options, lastOptions.current)) {
|
|
@@ -8694,12 +8734,38 @@ const DesignSystemProvider = ({
|
|
|
8694
8734
|
theme = lightTheme,
|
|
8695
8735
|
tooltipConfig
|
|
8696
8736
|
}) => {
|
|
8737
|
+
useIsomorphicLayoutEffect(() => {
|
|
8738
|
+
const css = document.createElement("style");
|
|
8739
|
+
css.type = "text/css";
|
|
8740
|
+
css.appendChild(
|
|
8741
|
+
document.createTextNode(`
|
|
8742
|
+
* {
|
|
8743
|
+
-webkit-transition: none !important;
|
|
8744
|
+
-moz-transition: none !important;
|
|
8745
|
+
-o-transition: none !important;
|
|
8746
|
+
-ms-transition: none !important;
|
|
8747
|
+
transition: none !important;
|
|
8748
|
+
animation: none !important;
|
|
8749
|
+
}
|
|
8750
|
+
`)
|
|
8751
|
+
);
|
|
8752
|
+
document.head.appendChild(css);
|
|
8753
|
+
window.getComputedStyle(css).opacity;
|
|
8754
|
+
document.head.removeChild(css);
|
|
8755
|
+
}, [theme]);
|
|
8697
8756
|
return /* @__PURE__ */ jsxRuntime.jsx(Provider, { locale, children: /* @__PURE__ */ jsxRuntime.jsxs(styledComponents.ThemeProvider, { theme, children: [
|
|
8698
8757
|
/* @__PURE__ */ jsxRuntime.jsx(Tooltip.Provider, { ...tooltipConfig, children }),
|
|
8699
8758
|
/* @__PURE__ */ jsxRuntime.jsx(LiveRegions, {}),
|
|
8700
8759
|
/* @__PURE__ */ jsxRuntime.jsx(GlobalStyle, {})
|
|
8701
8760
|
] }) });
|
|
8702
8761
|
};
|
|
8762
|
+
const DismissibleLayer = DismissibleLayerPrimitive__namespace.Root;
|
|
8763
|
+
const Portal$1 = React__namespace.forwardRef(
|
|
8764
|
+
({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
|
|
8765
|
+
return container ? reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
|
|
8766
|
+
}
|
|
8767
|
+
);
|
|
8768
|
+
Portal$1.displayName = "Portal";
|
|
8703
8769
|
const SelectTrigger = React__namespace.forwardRef(
|
|
8704
8770
|
({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, ...restProps }, ref) => {
|
|
8705
8771
|
const triggerRef = React__namespace.useRef(null);
|
|
@@ -8811,6 +8877,23 @@ const SelectContent = styledComponents.styled(uiPrimitives.Select.Content)`
|
|
|
8811
8877
|
/* This is from the design-system figma file. */
|
|
8812
8878
|
max-height: 15rem;
|
|
8813
8879
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8880
|
+
|
|
8881
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8882
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
8883
|
+
|
|
8884
|
+
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
8885
|
+
&[data-state='open'] {
|
|
8886
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8887
|
+
|
|
8888
|
+
&[data-side='top'] {
|
|
8889
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8890
|
+
}
|
|
8891
|
+
|
|
8892
|
+
&[data-side='bottom'] {
|
|
8893
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8894
|
+
}
|
|
8895
|
+
}
|
|
8896
|
+
}
|
|
8814
8897
|
`;
|
|
8815
8898
|
const SelectViewport = styledComponents.styled(uiPrimitives.Select.Viewport)`
|
|
8816
8899
|
padding: ${({ theme }) => theme.spaces[1]};
|
|
@@ -8830,6 +8913,7 @@ const itemStyles = styledComponents.css`
|
|
|
8830
8913
|
gap: ${({ theme }) => theme.spaces[2]};
|
|
8831
8914
|
white-space: nowrap;
|
|
8832
8915
|
user-select: none;
|
|
8916
|
+
color: ${({ theme }) => theme.colors.neutral800};
|
|
8833
8917
|
|
|
8834
8918
|
&:focus-visible {
|
|
8835
8919
|
outline: none;
|
|
@@ -8845,19 +8929,21 @@ const StyledSelectItem = styledComponents.styled(uiPrimitives.Select.Item)`
|
|
|
8845
8929
|
|
|
8846
8930
|
&[data-state='checked'] {
|
|
8847
8931
|
font-weight: bold;
|
|
8932
|
+
background-color: ${({ theme }) => theme.colors.primary100};
|
|
8848
8933
|
color: ${({ theme }) => theme.colors.primary600};
|
|
8934
|
+
font-weight: bold;
|
|
8849
8935
|
}
|
|
8850
8936
|
`;
|
|
8851
|
-
const Root = uiPrimitives.Select.Root;
|
|
8852
|
-
const Trigger = SelectTrigger;
|
|
8937
|
+
const Root$4 = uiPrimitives.Select.Root;
|
|
8938
|
+
const Trigger$3 = SelectTrigger;
|
|
8853
8939
|
const Value = SelectValue;
|
|
8854
8940
|
const Portal = uiPrimitives.Select.Portal;
|
|
8855
|
-
const Content$
|
|
8941
|
+
const Content$3 = SelectContent;
|
|
8856
8942
|
const Viewport = SelectViewport;
|
|
8857
|
-
const Item = SelectItem;
|
|
8943
|
+
const Item$2 = SelectItem;
|
|
8858
8944
|
const ItemIndicator = uiPrimitives.Select.ItemIndicator;
|
|
8859
8945
|
const ItemText = uiPrimitives.Select.ItemText;
|
|
8860
|
-
const Group = uiPrimitives.Select.Group;
|
|
8946
|
+
const Group$1 = uiPrimitives.Select.Group;
|
|
8861
8947
|
const SingleSelect = React__namespace.forwardRef(
|
|
8862
8948
|
({
|
|
8863
8949
|
children,
|
|
@@ -8926,7 +9012,7 @@ const SingleSelect = React__namespace.forwardRef(
|
|
|
8926
9012
|
}
|
|
8927
9013
|
const value = (typeof passedValue !== "undefined" && passedValue !== null ? passedValue.toString() : internalValue) ?? "";
|
|
8928
9014
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8929
|
-
Root,
|
|
9015
|
+
Root$4,
|
|
8930
9016
|
{
|
|
8931
9017
|
onOpenChange: handleOpenChange,
|
|
8932
9018
|
disabled,
|
|
@@ -8936,7 +9022,7 @@ const SingleSelect = React__namespace.forwardRef(
|
|
|
8936
9022
|
...restProps,
|
|
8937
9023
|
children: [
|
|
8938
9024
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8939
|
-
Trigger,
|
|
9025
|
+
Trigger$3,
|
|
8940
9026
|
{
|
|
8941
9027
|
ref: forwardedRef,
|
|
8942
9028
|
id,
|
|
@@ -8951,7 +9037,7 @@ const SingleSelect = React__namespace.forwardRef(
|
|
|
8951
9037
|
children: /* @__PURE__ */ jsxRuntime.jsx(Value, { placeholder, textColor: value ? "neutral800" : "neutral600", children: value && customizeContent ? customizeContent(value) : void 0 })
|
|
8952
9038
|
}
|
|
8953
9039
|
),
|
|
8954
|
-
/* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$
|
|
9040
|
+
/* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport, { ref: viewportRef, children: [
|
|
8955
9041
|
children,
|
|
8956
9042
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
|
|
8957
9043
|
] }) }) })
|
|
@@ -8962,9 +9048,9 @@ const SingleSelect = React__namespace.forwardRef(
|
|
|
8962
9048
|
);
|
|
8963
9049
|
const SingleSelectOption = React__namespace.forwardRef(
|
|
8964
9050
|
({ value, startIcon, children, ...restProps }, ref) => {
|
|
8965
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
|
|
9051
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
8966
9052
|
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
8967
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, {
|
|
9053
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
8968
9054
|
] });
|
|
8969
9055
|
}
|
|
8970
9056
|
);
|
|
@@ -9011,7 +9097,7 @@ const DatePicker$1 = React__namespace.forwardRef(
|
|
|
9011
9097
|
const [textInput, setTextInput] = React__namespace.useState(null);
|
|
9012
9098
|
const [content, setContent] = React__namespace.useState(null);
|
|
9013
9099
|
const [textValue, setTextValue] = React__namespace.useState();
|
|
9014
|
-
const [value, setValue] = useControllableState({
|
|
9100
|
+
const [value, setValue] = useControllableState$1({
|
|
9015
9101
|
defaultProp: initialDate ? convertUTCDateToCalendarDate(initialDate) : void 0,
|
|
9016
9102
|
prop: valueProp ? convertUTCDateToCalendarDate(valueProp) : void 0,
|
|
9017
9103
|
onChange(date2) {
|
|
@@ -9055,7 +9141,7 @@ const DatePicker$1 = React__namespace.forwardRef(
|
|
|
9055
9141
|
},
|
|
9056
9142
|
[value]
|
|
9057
9143
|
);
|
|
9058
|
-
|
|
9144
|
+
useIsomorphicLayoutEffect(() => {
|
|
9059
9145
|
if (valueProp) {
|
|
9060
9146
|
const date2 = convertUTCDateToCalendarDate(valueProp);
|
|
9061
9147
|
setTextValue(formatter.format(date2.toDate(timeZone)));
|
|
@@ -9064,7 +9150,7 @@ const DatePicker$1 = React__namespace.forwardRef(
|
|
|
9064
9150
|
setTextValue("");
|
|
9065
9151
|
}
|
|
9066
9152
|
}, [valueProp, formatter, timeZone]);
|
|
9067
|
-
|
|
9153
|
+
useIsomorphicLayoutEffect(() => {
|
|
9068
9154
|
if (initialDate && textValue === void 0) {
|
|
9069
9155
|
const date2 = convertUTCDateToCalendarDate(initialDate);
|
|
9070
9156
|
setTextValue(formatter.format(date2.toDate(timeZone)));
|
|
@@ -9433,7 +9519,7 @@ const CONTENT_NAME = "DatePickerContent";
|
|
|
9433
9519
|
const DatePickerContent = React__namespace.forwardRef((props, forwardedRef) => {
|
|
9434
9520
|
const [fragment, setFragment] = React__namespace.useState();
|
|
9435
9521
|
const context = useDatePickerContext(CONTENT_NAME);
|
|
9436
|
-
|
|
9522
|
+
useIsomorphicLayoutEffect(() => {
|
|
9437
9523
|
setFragment(new DocumentFragment());
|
|
9438
9524
|
}, []);
|
|
9439
9525
|
if (!context.open) {
|
|
@@ -9562,7 +9648,7 @@ const DatePickerCalendar = React__namespace.forwardRef(
|
|
|
9562
9648
|
const getDatesInWeek = makeGetDatesInWeek(startDate, locale);
|
|
9563
9649
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { ref, direction: "column", alignItems: "stretch", padding: 4, ...restProps, children: [
|
|
9564
9650
|
/* @__PURE__ */ jsxRuntime.jsxs(ToolbarFlex, { justifyContent: "flex-start", paddingBottom: 4, paddingLeft: 2, paddingRight: 2, gap: 2, children: [
|
|
9565
|
-
/* @__PURE__ */ jsxRuntime.jsx(Root$
|
|
9651
|
+
/* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9566
9652
|
SingleSelect,
|
|
9567
9653
|
{
|
|
9568
9654
|
"aria-label": monthSelectLabel,
|
|
@@ -9571,7 +9657,7 @@ const DatePickerCalendar = React__namespace.forwardRef(
|
|
|
9571
9657
|
children: months.map((month) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: month, children: month }, month))
|
|
9572
9658
|
}
|
|
9573
9659
|
) }),
|
|
9574
|
-
/* @__PURE__ */ jsxRuntime.jsx(Root$
|
|
9660
|
+
/* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(SingleSelect, { value: calendarDate.year.toString(), "aria-label": yearSelectLabel, onChange: handleYearChange, children: years.map((year) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: year, children: year }, year)) }) })
|
|
9575
9661
|
] }),
|
|
9576
9662
|
/* @__PURE__ */ jsxRuntime.jsxs("table", { role: "grid", children: [
|
|
9577
9663
|
/* @__PURE__ */ jsxRuntime.jsx("thead", { "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { "aria-rowindex": 0, children: weekDays.map((day, index) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerHeaderCell, { "aria-colindex": index, children: day }, day)) }) }),
|
|
@@ -9724,7 +9810,7 @@ const TimePicker$1 = React__namespace.forwardRef(
|
|
|
9724
9810
|
({ step = 15, value: valueProp, defaultValue, onChange, ...restProps }, forwardedRef) => {
|
|
9725
9811
|
const context = useDesignSystem("TimePicker");
|
|
9726
9812
|
const [textValue, setTextValue] = React__namespace.useState("");
|
|
9727
|
-
const [value, setValue] =
|
|
9813
|
+
const [value, setValue] = useControllableState$1({
|
|
9728
9814
|
prop: valueProp,
|
|
9729
9815
|
defaultProp: defaultValue,
|
|
9730
9816
|
onChange
|
|
@@ -9794,7 +9880,7 @@ const TimePicker$1 = React__namespace.forwardRef(
|
|
|
9794
9880
|
allowCustomValue: true,
|
|
9795
9881
|
placeholder: `--${separator}--`,
|
|
9796
9882
|
autocomplete: "none",
|
|
9797
|
-
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9883
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Clock, { fill: "neutral500" }),
|
|
9798
9884
|
inputMode: "numeric",
|
|
9799
9885
|
pattern: `\\d{2}\\${separator}\\d{2}`,
|
|
9800
9886
|
textValue,
|
|
@@ -9805,14 +9891,6 @@ const TimePicker$1 = React__namespace.forwardRef(
|
|
|
9805
9891
|
);
|
|
9806
9892
|
}
|
|
9807
9893
|
);
|
|
9808
|
-
const StyledClock = styledComponents.styled(icons.Clock)`
|
|
9809
|
-
height: 1rem;
|
|
9810
|
-
width: 1rem;
|
|
9811
|
-
|
|
9812
|
-
& > path {
|
|
9813
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
9814
|
-
}
|
|
9815
|
-
`;
|
|
9816
9894
|
const DatePicker = styledComponents.styled(DatePicker$1)`
|
|
9817
9895
|
flex: 1 1 70%;
|
|
9818
9896
|
min-width: 120px;
|
|
@@ -9837,7 +9915,7 @@ const DateTimePicker = React__namespace.forwardRef(
|
|
|
9837
9915
|
...props
|
|
9838
9916
|
}, forwardedRef) => {
|
|
9839
9917
|
const DatePickerElement2 = React__namespace.useRef(null);
|
|
9840
|
-
const [dateValue, setDateValue] = useControllableState({
|
|
9918
|
+
const [dateValue, setDateValue] = useControllableState$1({
|
|
9841
9919
|
defaultProp: initialDate ? convertUTCDateToCalendarDateTime(initialDate, false) : void 0,
|
|
9842
9920
|
prop: value ? convertUTCDateToCalendarDateTime(value, false) : value ?? void 0,
|
|
9843
9921
|
onChange(date$1) {
|
|
@@ -9889,7 +9967,7 @@ const DateTimePicker = React__namespace.forwardRef(
|
|
|
9889
9967
|
const { error, id, labelNode } = useField("DateTimePicker");
|
|
9890
9968
|
const hasError = Boolean(error) || hasErrorProp;
|
|
9891
9969
|
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { "aria-labelledby": labelNode ? `${id}-label` : void 0, role: "group", flex: "1", gap: 1, children: [
|
|
9892
|
-
/* @__PURE__ */ jsxRuntime.jsx(Root$
|
|
9970
|
+
/* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9893
9971
|
DatePicker,
|
|
9894
9972
|
{
|
|
9895
9973
|
...props,
|
|
@@ -9903,7 +9981,7 @@ const DateTimePicker = React__namespace.forwardRef(
|
|
|
9903
9981
|
"aria-label": dateLabel
|
|
9904
9982
|
}
|
|
9905
9983
|
) }),
|
|
9906
|
-
/* @__PURE__ */ jsxRuntime.jsx(Root$
|
|
9984
|
+
/* @__PURE__ */ jsxRuntime.jsx(Root$6, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9907
9985
|
TimePicker,
|
|
9908
9986
|
{
|
|
9909
9987
|
hasError,
|
|
@@ -9928,15 +10006,25 @@ const convertUTCDateToCalendarDateTime = (date$1, resetTime = true) => {
|
|
|
9928
10006
|
}
|
|
9929
10007
|
return date.toCalendarDateTime(zonedDateTime);
|
|
9930
10008
|
};
|
|
9931
|
-
const
|
|
10009
|
+
const Divider = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10010
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10011
|
+
DividerImpl,
|
|
10012
|
+
{
|
|
10013
|
+
ref: forwardedRef,
|
|
10014
|
+
background: "neutral150",
|
|
10015
|
+
...props,
|
|
10016
|
+
"data-orientation": "horizontal",
|
|
10017
|
+
role: "separator",
|
|
10018
|
+
tag: "div"
|
|
10019
|
+
}
|
|
10020
|
+
);
|
|
10021
|
+
});
|
|
10022
|
+
const DividerImpl = styledComponents.styled(Box)`
|
|
9932
10023
|
height: 1px;
|
|
9933
10024
|
border: none;
|
|
9934
10025
|
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
9935
10026
|
flex-shrink: 0;
|
|
9936
10027
|
`;
|
|
9937
|
-
const Divider = (props) => {
|
|
9938
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DividerWrapper, { ...props, background: "neutral150", tag: "hr" });
|
|
9939
|
-
};
|
|
9940
10028
|
const EmptyStateIconWrapper = styledComponents.styled(Box)`
|
|
9941
10029
|
svg {
|
|
9942
10030
|
height: 8.8rem;
|
|
@@ -9966,17 +10054,92 @@ const EmptyStateLayout = ({
|
|
|
9966
10054
|
}
|
|
9967
10055
|
);
|
|
9968
10056
|
};
|
|
9969
|
-
const
|
|
9970
|
-
const
|
|
9971
|
-
|
|
10057
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10058
|
+
const nodes = [
|
|
10059
|
+
...node.querySelectorAll(
|
|
10060
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10061
|
+
)
|
|
10062
|
+
];
|
|
10063
|
+
const focusables = nodes.filter((node2) => {
|
|
10064
|
+
if (node2.hasAttribute("disabled"))
|
|
10065
|
+
return false;
|
|
10066
|
+
if (includeNegativeTabIndex)
|
|
10067
|
+
return true;
|
|
10068
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
10069
|
+
});
|
|
10070
|
+
return focusables;
|
|
10071
|
+
};
|
|
10072
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10073
|
+
return nodes.filter((node) => {
|
|
10074
|
+
if (node.tagName === "INPUT") {
|
|
10075
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
10076
|
+
}
|
|
10077
|
+
return false;
|
|
10078
|
+
});
|
|
10079
|
+
};
|
|
10080
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10081
|
+
const trappedRef = React__namespace.useRef(null);
|
|
10082
|
+
React__namespace.useEffect(() => {
|
|
10083
|
+
let currentFocus = null;
|
|
10084
|
+
if (restoreFocus) {
|
|
10085
|
+
currentFocus = document.activeElement;
|
|
10086
|
+
}
|
|
10087
|
+
return () => {
|
|
10088
|
+
if (currentFocus) {
|
|
10089
|
+
currentFocus.focus();
|
|
10090
|
+
}
|
|
10091
|
+
};
|
|
10092
|
+
}, [restoreFocus]);
|
|
10093
|
+
React__namespace.useEffect(() => {
|
|
10094
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
10095
|
+
return;
|
|
10096
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10097
|
+
if (focusableChildren.length > 0) {
|
|
10098
|
+
const firstElement = focusableChildren[0];
|
|
10099
|
+
firstElement.focus();
|
|
10100
|
+
} else {
|
|
10101
|
+
console.warn(
|
|
10102
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10103
|
+
);
|
|
10104
|
+
}
|
|
10105
|
+
}, [skipAutoFocus]);
|
|
10106
|
+
const handleKeyDown = (e) => {
|
|
10107
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10108
|
+
onEscape();
|
|
10109
|
+
return;
|
|
10110
|
+
}
|
|
10111
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
10112
|
+
return;
|
|
10113
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10114
|
+
if (focusableChildren.length > 0) {
|
|
10115
|
+
const firstElement = focusableChildren[0];
|
|
10116
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10117
|
+
if (e.shiftKey) {
|
|
10118
|
+
if (firstElement === document.activeElement) {
|
|
10119
|
+
e.preventDefault();
|
|
10120
|
+
lastElement.focus();
|
|
10121
|
+
}
|
|
10122
|
+
} else if (lastElement === document.activeElement) {
|
|
10123
|
+
e.preventDefault();
|
|
10124
|
+
firstElement.focus();
|
|
10125
|
+
}
|
|
10126
|
+
}
|
|
10127
|
+
};
|
|
10128
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
9972
10129
|
};
|
|
9973
|
-
const
|
|
10130
|
+
const Root$3 = forwardRef((props, forwardedRef) => {
|
|
10131
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
10132
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
10133
|
+
});
|
|
10134
|
+
const Wrapper$1 = styledComponents.styled(Box)`
|
|
9974
10135
|
display: grid;
|
|
9975
10136
|
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
9976
10137
|
${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
|
|
9977
10138
|
`;
|
|
9978
|
-
const
|
|
9979
|
-
|
|
10139
|
+
const ItemImpl = forwardRef(
|
|
10140
|
+
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsxRuntime.jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
10141
|
+
);
|
|
10142
|
+
const Item$1 = styledComponents.styled(Box)`
|
|
9980
10143
|
grid-column: span ${({ $col }) => $col ?? 1};
|
|
9981
10144
|
max-width: 100%;
|
|
9982
10145
|
|
|
@@ -9988,6 +10151,11 @@ const GridItem = styledComponents.styled(Box)`
|
|
|
9988
10151
|
grid-column: span ${({ $xs }) => $xs};
|
|
9989
10152
|
}
|
|
9990
10153
|
`;
|
|
10154
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10155
|
+
__proto__: null,
|
|
10156
|
+
Item: ItemImpl,
|
|
10157
|
+
Root: Root$3
|
|
10158
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
9991
10159
|
const VARIANT_DEFAULT = "tertiary";
|
|
9992
10160
|
const VARIANT_SECONDARY = "secondary";
|
|
9993
10161
|
const SIZES = ["S", "M", "L"];
|
|
@@ -10063,20 +10231,22 @@ const IconButtonWrapper = styledComponents.styled(BaseButton)`
|
|
|
10063
10231
|
}
|
|
10064
10232
|
`;
|
|
10065
10233
|
const IconButtonGroup = styledComponents.styled(Flex)`
|
|
10066
|
-
&
|
|
10067
|
-
border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
10234
|
+
& ${IconButtonWrapper}:first-child {
|
|
10068
10235
|
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10069
10236
|
}
|
|
10070
10237
|
|
|
10071
|
-
&
|
|
10238
|
+
& ${IconButtonWrapper}:last-child {
|
|
10072
10239
|
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10073
10240
|
}
|
|
10074
10241
|
|
|
10075
10242
|
& ${IconButtonWrapper} {
|
|
10076
10243
|
border-radius: 0;
|
|
10077
|
-
border-left: none;
|
|
10078
10244
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
10079
10245
|
|
|
10246
|
+
& + ${IconButtonWrapper} {
|
|
10247
|
+
border-left: none;
|
|
10248
|
+
}
|
|
10249
|
+
|
|
10080
10250
|
&:hover {
|
|
10081
10251
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
10082
10252
|
color: ${({ theme }) => theme.colors.neutral800};
|
|
@@ -10268,71 +10438,6 @@ const JSONInputContainer = styledComponents.styled(Flex)`
|
|
|
10268
10438
|
background-color: #4a4a6a;
|
|
10269
10439
|
}
|
|
10270
10440
|
`;
|
|
10271
|
-
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
10272
|
-
const isValidFocusedElement = () => {
|
|
10273
|
-
const focused = document.activeElement;
|
|
10274
|
-
if (!focused) {
|
|
10275
|
-
return false;
|
|
10276
|
-
}
|
|
10277
|
-
if (tagName) {
|
|
10278
|
-
return focused.tagName.toLowerCase() === tagName;
|
|
10279
|
-
}
|
|
10280
|
-
return focused.hasAttribute(attributeName);
|
|
10281
|
-
};
|
|
10282
|
-
const queryElement = (parentEl) => {
|
|
10283
|
-
if (tagName) {
|
|
10284
|
-
return parentEl.querySelectorAll(tagName);
|
|
10285
|
-
}
|
|
10286
|
-
return parentEl.querySelectorAll(`[${attributeName}]`);
|
|
10287
|
-
};
|
|
10288
|
-
const handleKeyDown = (e) => {
|
|
10289
|
-
switch (e.key) {
|
|
10290
|
-
case KeyboardKeys.RIGHT:
|
|
10291
|
-
case KeyboardKeys.DOWN: {
|
|
10292
|
-
if (isValidFocusedElement()) {
|
|
10293
|
-
e.preventDefault();
|
|
10294
|
-
const focused = document.activeElement;
|
|
10295
|
-
const allElements = [...queryElement(e.currentTarget)];
|
|
10296
|
-
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
10297
|
-
const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
|
|
10298
|
-
allElements[nextIndex].focus();
|
|
10299
|
-
}
|
|
10300
|
-
break;
|
|
10301
|
-
}
|
|
10302
|
-
case KeyboardKeys.LEFT:
|
|
10303
|
-
case KeyboardKeys.UP: {
|
|
10304
|
-
if (isValidFocusedElement()) {
|
|
10305
|
-
e.preventDefault();
|
|
10306
|
-
const focused = document.activeElement;
|
|
10307
|
-
const allElements = [...queryElement(e.currentTarget)];
|
|
10308
|
-
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
10309
|
-
const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
|
|
10310
|
-
allElements[nextIndex].focus();
|
|
10311
|
-
}
|
|
10312
|
-
break;
|
|
10313
|
-
}
|
|
10314
|
-
case KeyboardKeys.HOME: {
|
|
10315
|
-
if (isValidFocusedElement()) {
|
|
10316
|
-
e.preventDefault();
|
|
10317
|
-
const allElements = queryElement(e.currentTarget);
|
|
10318
|
-
const focusElement = allElements.item(0);
|
|
10319
|
-
focusElement.focus();
|
|
10320
|
-
}
|
|
10321
|
-
break;
|
|
10322
|
-
}
|
|
10323
|
-
case KeyboardKeys.END: {
|
|
10324
|
-
if (isValidFocusedElement()) {
|
|
10325
|
-
e.preventDefault();
|
|
10326
|
-
const allElements = queryElement(e.currentTarget);
|
|
10327
|
-
const focusElement = allElements.item(allElements.length - 1);
|
|
10328
|
-
focusElement.focus();
|
|
10329
|
-
}
|
|
10330
|
-
break;
|
|
10331
|
-
}
|
|
10332
|
-
}
|
|
10333
|
-
};
|
|
10334
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { onKeyDown: handleKeyDown, ...props });
|
|
10335
|
-
};
|
|
10336
10441
|
const LinkButton = forwardRef(
|
|
10337
10442
|
({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
|
|
10338
10443
|
const paddingX = size === "S" ? 2 : "10px";
|
|
@@ -10425,62 +10530,195 @@ const SkipToContent = ({ children }) => {
|
|
|
10425
10530
|
}
|
|
10426
10531
|
);
|
|
10427
10532
|
};
|
|
10428
|
-
const
|
|
10429
|
-
})
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10533
|
+
const ScrollAreaImpl$1 = React__namespace.forwardRef(
|
|
10534
|
+
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
10535
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
10536
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaViewport, { ref: viewportRef, children }),
|
|
10537
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) }),
|
|
10538
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) })
|
|
10539
|
+
] });
|
|
10540
|
+
}
|
|
10541
|
+
);
|
|
10542
|
+
const ScrollAreaRoot = styledComponents.styled(ScrollArea__namespace.Root)`
|
|
10543
|
+
width: 100%;
|
|
10544
|
+
height: 100%;
|
|
10545
|
+
overflow: hidden;
|
|
10546
|
+
display: flex;
|
|
10434
10547
|
`;
|
|
10435
|
-
const
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
Box,
|
|
10439
|
-
{
|
|
10440
|
-
"aria-labelledby": labelledBy,
|
|
10441
|
-
"aria-modal": true,
|
|
10442
|
-
onClick: (e) => e.stopPropagation(),
|
|
10443
|
-
background: "neutral0",
|
|
10444
|
-
hasRadius: true,
|
|
10445
|
-
role: "dialog",
|
|
10446
|
-
shadow: "popupShadow",
|
|
10447
|
-
width: "83rem",
|
|
10448
|
-
...props
|
|
10449
|
-
}
|
|
10450
|
-
) }) }) }) }) });
|
|
10451
|
-
};
|
|
10452
|
-
const ModalHeaderWrapper = styledComponents.styled(Box)`
|
|
10453
|
-
border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
|
|
10454
|
-
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10548
|
+
const ScrollAreaViewport = styledComponents.styled(ScrollArea__namespace.Viewport)`
|
|
10549
|
+
min-width: 100%;
|
|
10550
|
+
padding-inline-end: 4px;
|
|
10455
10551
|
`;
|
|
10456
|
-
const
|
|
10457
|
-
|
|
10458
|
-
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10552
|
+
const Scrollbar = styledComponents.styled(ScrollArea__namespace.Scrollbar)`
|
|
10553
|
+
display: flex;
|
|
10554
|
+
/* ensures no selection */
|
|
10555
|
+
user-select: none;
|
|
10556
|
+
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
10557
|
+
touch-action: none;
|
|
10558
|
+
|
|
10559
|
+
&[data-orientation='vertical'] {
|
|
10560
|
+
width: 0.4rem;
|
|
10561
|
+
}
|
|
10562
|
+
|
|
10563
|
+
&[data-orientation='horizontal'] {
|
|
10564
|
+
flex-direction: column;
|
|
10565
|
+
height: 0.4rem;
|
|
10566
|
+
}
|
|
10466
10567
|
`;
|
|
10467
|
-
const
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
|
|
10568
|
+
const Thumb = styledComponents.styled(ScrollArea__namespace.Thumb)`
|
|
10569
|
+
position: relative;
|
|
10570
|
+
flex: 1;
|
|
10571
|
+
background-color: ${(props) => props.theme.colors.neutral150};
|
|
10572
|
+
border-radius: var(--scrollbar-size);
|
|
10573
|
+
|
|
10574
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
10575
|
+
&::before {
|
|
10576
|
+
content: '';
|
|
10577
|
+
position: absolute;
|
|
10578
|
+
top: 50%;
|
|
10579
|
+
left: 50%;
|
|
10580
|
+
transform: translate(-50%, -50%);
|
|
10581
|
+
width: 100%;
|
|
10582
|
+
height: 100%;
|
|
10583
|
+
min-width: 44px;
|
|
10584
|
+
min-height: 44px;
|
|
10585
|
+
}
|
|
10476
10586
|
`;
|
|
10477
|
-
const
|
|
10478
|
-
|
|
10479
|
-
};
|
|
10480
|
-
|
|
10481
|
-
const
|
|
10482
|
-
|
|
10483
|
-
|
|
10587
|
+
const Root$2 = Dialog__namespace.Root;
|
|
10588
|
+
const Trigger$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10589
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10590
|
+
});
|
|
10591
|
+
const Content$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10592
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Dialog__namespace.Portal, { children: [
|
|
10593
|
+
/* @__PURE__ */ jsxRuntime.jsx(Overlay, {}),
|
|
10594
|
+
/* @__PURE__ */ jsxRuntime.jsx(ContentImpl, { ref: forwardedRef, ...props })
|
|
10595
|
+
] });
|
|
10596
|
+
});
|
|
10597
|
+
const Overlay = styledComponents.styled(Dialog__namespace.Overlay)`
|
|
10598
|
+
background-color: ${(props) => props.theme.colors.neutral800};
|
|
10599
|
+
position: fixed;
|
|
10600
|
+
inset: 0;
|
|
10601
|
+
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
10602
|
+
opacity: 0.2;
|
|
10603
|
+
|
|
10604
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
10605
|
+
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
10606
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
10607
|
+
}
|
|
10608
|
+
`;
|
|
10609
|
+
const ContentImpl = styledComponents.styled(Dialog__namespace.Content)`
|
|
10610
|
+
max-width: 83rem;
|
|
10611
|
+
max-height: 80vh;
|
|
10612
|
+
height: min-content;
|
|
10613
|
+
width: 60%;
|
|
10614
|
+
overflow: hidden;
|
|
10615
|
+
margin: 0 auto;
|
|
10616
|
+
display: flex;
|
|
10617
|
+
flex-direction: column;
|
|
10618
|
+
|
|
10619
|
+
position: fixed;
|
|
10620
|
+
top: 50%;
|
|
10621
|
+
left: 50%;
|
|
10622
|
+
transform: translate(-50%, -50%);
|
|
10623
|
+
|
|
10624
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
10625
|
+
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10626
|
+
box-shadow: ${(props) => props.theme.shadows.popupShadow};
|
|
10627
|
+
z-index: ${(props) => props.theme.zIndices.modal};
|
|
10628
|
+
|
|
10629
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
10630
|
+
&[data-state='open'] {
|
|
10631
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
10632
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
10633
|
+
animation-name: ${ANIMATIONS.modalPopIn};
|
|
10634
|
+
}
|
|
10635
|
+
|
|
10636
|
+
&[data-state='closed'] {
|
|
10637
|
+
animation-duration: ${(props) => props.theme.motion.timings["120"]};
|
|
10638
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10639
|
+
animation-name: ${ANIMATIONS.modalPopOut};
|
|
10640
|
+
}
|
|
10641
|
+
}
|
|
10642
|
+
`;
|
|
10643
|
+
const Close = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10644
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Close, { ...props, asChild: true, ref: forwardedRef });
|
|
10645
|
+
});
|
|
10646
|
+
const Header = React__namespace.forwardRef(
|
|
10647
|
+
({ children, closeLabel = "Close modal", ...restProps }, forwardedRef) => {
|
|
10648
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10649
|
+
Head,
|
|
10650
|
+
{
|
|
10651
|
+
ref: forwardedRef,
|
|
10652
|
+
padding: 4,
|
|
10653
|
+
paddingLeft: 5,
|
|
10654
|
+
paddingRight: 5,
|
|
10655
|
+
background: "neutral100",
|
|
10656
|
+
justifyContent: "space-between",
|
|
10657
|
+
...restProps,
|
|
10658
|
+
tag: "header",
|
|
10659
|
+
children: [
|
|
10660
|
+
children,
|
|
10661
|
+
/* @__PURE__ */ jsxRuntime.jsx(Close, { children: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { withTooltip: false, label: closeLabel, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cross, {}) }) })
|
|
10662
|
+
]
|
|
10663
|
+
}
|
|
10664
|
+
);
|
|
10665
|
+
}
|
|
10666
|
+
);
|
|
10667
|
+
const Head = styledComponents.styled(Flex)`
|
|
10668
|
+
border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
10669
|
+
`;
|
|
10670
|
+
const Title = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10671
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "bold", ref: forwardedRef, ...props }) });
|
|
10672
|
+
});
|
|
10673
|
+
const Body = React__namespace.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
10674
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BodyScroll, { ref: forwardedRef, ...restProps, children });
|
|
10675
|
+
});
|
|
10676
|
+
const BodyScroll = styledComponents.styled(ScrollAreaImpl$1)`
|
|
10677
|
+
padding-inline: ${(props) => props.theme.spaces[8]};
|
|
10678
|
+
|
|
10679
|
+
& > div {
|
|
10680
|
+
padding-block: ${(props) => props.theme.spaces[8]};
|
|
10681
|
+
|
|
10682
|
+
& > div {
|
|
10683
|
+
// the scroll area component applies a display: table to the child, which we don't want.
|
|
10684
|
+
display: block !important;
|
|
10685
|
+
}
|
|
10686
|
+
}
|
|
10687
|
+
`;
|
|
10688
|
+
const Footer = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10689
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10690
|
+
Foot,
|
|
10691
|
+
{
|
|
10692
|
+
ref: forwardedRef,
|
|
10693
|
+
padding: 4,
|
|
10694
|
+
paddingLeft: 5,
|
|
10695
|
+
paddingRight: 5,
|
|
10696
|
+
background: "neutral100",
|
|
10697
|
+
justifyContent: "space-between",
|
|
10698
|
+
...props,
|
|
10699
|
+
tag: "footer"
|
|
10700
|
+
}
|
|
10701
|
+
);
|
|
10702
|
+
});
|
|
10703
|
+
const Foot = styledComponents.styled(Flex)`
|
|
10704
|
+
border-top: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
10705
|
+
flex: 1;
|
|
10706
|
+
`;
|
|
10707
|
+
const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10708
|
+
__proto__: null,
|
|
10709
|
+
Body,
|
|
10710
|
+
Close,
|
|
10711
|
+
Content: Content$2,
|
|
10712
|
+
Footer,
|
|
10713
|
+
Header,
|
|
10714
|
+
Root: Root$2,
|
|
10715
|
+
Title,
|
|
10716
|
+
Trigger: Trigger$2
|
|
10717
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
10718
|
+
const INITIAL_VALUE = "";
|
|
10719
|
+
const NumberInput = React__namespace.forwardRef(
|
|
10720
|
+
({ startAction, locale: defaultLocale, onValueChange, value, step = 1, disabled = false, ...props }, ref) => {
|
|
10721
|
+
const designContext = useDesignSystem("NumberInput");
|
|
10484
10722
|
const locale = defaultLocale || designContext.locale;
|
|
10485
10723
|
const numberParserRef = React__namespace.useRef(new number.NumberParser(locale, { style: "decimal" }));
|
|
10486
10724
|
const numberFormaterRef = React__namespace.useRef(new number.NumberFormatter(locale, { maximumFractionDigits: 20 }));
|
|
@@ -10600,6 +10838,37 @@ const ArrowButton = styledComponents.styled.button`
|
|
|
10600
10838
|
transform: ${({ $reverse }) => $reverse ? "rotateX(180deg)" : void 0};
|
|
10601
10839
|
}
|
|
10602
10840
|
`;
|
|
10841
|
+
function useControllableState({
|
|
10842
|
+
prop,
|
|
10843
|
+
defaultProp,
|
|
10844
|
+
onChange = () => {
|
|
10845
|
+
}
|
|
10846
|
+
}) {
|
|
10847
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
10848
|
+
defaultProp,
|
|
10849
|
+
onChange
|
|
10850
|
+
});
|
|
10851
|
+
const isControlled = prop !== void 0;
|
|
10852
|
+
const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
|
|
10853
|
+
const value = isControlled ? propValue : uncontrolledProp;
|
|
10854
|
+
const handleChange = uiPrimitives.useCallbackRef(onChange);
|
|
10855
|
+
const setValue = React__namespace.useCallback(
|
|
10856
|
+
(nextValue) => {
|
|
10857
|
+
if (isControlled) {
|
|
10858
|
+
const setter = nextValue;
|
|
10859
|
+
const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
|
|
10860
|
+
if (value2 !== propValue) {
|
|
10861
|
+
handleChange(value2);
|
|
10862
|
+
setUncontrolledProp(nextValue);
|
|
10863
|
+
}
|
|
10864
|
+
} else {
|
|
10865
|
+
setUncontrolledProp(nextValue);
|
|
10866
|
+
}
|
|
10867
|
+
},
|
|
10868
|
+
[isControlled, propValue, setUncontrolledProp, handleChange]
|
|
10869
|
+
);
|
|
10870
|
+
return [value, setValue];
|
|
10871
|
+
}
|
|
10603
10872
|
const PaginationContext = React__namespace.createContext({ activePage: 1, pageCount: 1 });
|
|
10604
10873
|
const usePagination = () => React__namespace.useContext(PaginationContext);
|
|
10605
10874
|
const Pagination = ({ children, label = "Pagination", activePage, pageCount }) => {
|
|
@@ -10677,133 +10946,48 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(Box, {
|
|
|
10677
10946
|
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children }),
|
|
10678
10947
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
10679
10948
|
] });
|
|
10680
|
-
const
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
"
|
|
10686
|
-
|
|
10687
|
-
|
|
10688
|
-
"bottom-start",
|
|
10689
|
-
"bottom-end",
|
|
10690
|
-
"left",
|
|
10691
|
-
"left-start",
|
|
10692
|
-
"left-end"
|
|
10693
|
-
];
|
|
10694
|
-
const PopoverWrapper = styledComponents.styled(Box)`
|
|
10949
|
+
const Root$1 = Popover__namespace.Root;
|
|
10950
|
+
const Trigger$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10951
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10952
|
+
});
|
|
10953
|
+
const Content$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
10954
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { sideOffset: 4, side: "bottom", align: "start", ...props, ref: forwardedRef }) });
|
|
10955
|
+
});
|
|
10956
|
+
const PopoverContent = styledComponents.styled(Popover__namespace.Content)`
|
|
10695
10957
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
10696
10958
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
10959
|
+
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10697
10960
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
onEscapeKeyDown,
|
|
10708
|
-
onPointerDownOutside,
|
|
10709
|
-
onDismiss,
|
|
10710
|
-
onFocusOutside,
|
|
10711
|
-
...props
|
|
10712
|
-
}, forwardedRef) => {
|
|
10713
|
-
const [content, setContent] = React__namespace.useState(null);
|
|
10714
|
-
const [width, setWidth] = React__namespace.useState(void 0);
|
|
10715
|
-
const isRightClickOutsideRef = React__namespace.useRef(false);
|
|
10716
|
-
const { x, y, refs, strategy } = reactDom$1.useFloating({
|
|
10717
|
-
strategy: "fixed",
|
|
10718
|
-
placement: centered ? "bottom" : placement,
|
|
10719
|
-
middleware: [
|
|
10720
|
-
reactDom$1.offset({
|
|
10721
|
-
mainAxis: spacing
|
|
10722
|
-
}),
|
|
10723
|
-
reactDom$1.shift(),
|
|
10724
|
-
reactDom$1.flip()
|
|
10725
|
-
],
|
|
10726
|
-
elements: {
|
|
10727
|
-
reference: source.current
|
|
10728
|
-
},
|
|
10729
|
-
whileElementsMounted: reactDom$1.autoUpdate
|
|
10730
|
-
});
|
|
10731
|
-
React__namespace.useLayoutEffect(() => {
|
|
10732
|
-
if (fullWidth) {
|
|
10733
|
-
setWidth(source.current.offsetWidth);
|
|
10961
|
+
|
|
10962
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
10963
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
10964
|
+
|
|
10965
|
+
&[data-state='open'] {
|
|
10966
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
10967
|
+
|
|
10968
|
+
&[data-side='top'] {
|
|
10969
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
10734
10970
|
}
|
|
10735
|
-
|
|
10736
|
-
|
|
10737
|
-
|
|
10738
|
-
return ariaHidden.hideOthers(content);
|
|
10739
|
-
}, [content]);
|
|
10740
|
-
const handleDismiss = uiPrimitives.useCallbackRef(onDismiss);
|
|
10741
|
-
React__namespace.useEffect(() => {
|
|
10742
|
-
const close = () => {
|
|
10743
|
-
handleDismiss();
|
|
10744
|
-
};
|
|
10745
|
-
window.addEventListener("blur", close);
|
|
10746
|
-
window.addEventListener("resize", close);
|
|
10747
|
-
return () => {
|
|
10748
|
-
window.removeEventListener("blur", close);
|
|
10749
|
-
window.removeEventListener("resize", close);
|
|
10750
|
-
};
|
|
10751
|
-
}, [handleDismiss]);
|
|
10752
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node), refs.setFloating);
|
|
10753
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactRemoveScroll.RemoveScroll, { allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10754
|
-
reactFocusScope.FocusScope,
|
|
10755
|
-
{
|
|
10756
|
-
asChild: true,
|
|
10757
|
-
loop: true,
|
|
10758
|
-
trapped: true,
|
|
10759
|
-
onUnmountAutoFocus: (event) => {
|
|
10760
|
-
event.preventDefault();
|
|
10761
|
-
if (!isRightClickOutsideRef.current)
|
|
10762
|
-
source.current?.focus({ preventScroll: true });
|
|
10763
|
-
},
|
|
10764
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10765
|
-
DismissibleLayer,
|
|
10766
|
-
{
|
|
10767
|
-
asChild: true,
|
|
10768
|
-
onEscapeKeyDown,
|
|
10769
|
-
onPointerDownOutside: uiPrimitives.composeEventHandlers(
|
|
10770
|
-
onPointerDownOutside,
|
|
10771
|
-
(event) => {
|
|
10772
|
-
const originalEvent = event.detail.originalEvent;
|
|
10773
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
10774
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
10775
|
-
isRightClickOutsideRef.current = isRightClick;
|
|
10776
|
-
},
|
|
10777
|
-
{ checkForDefaultPrevented: false }
|
|
10778
|
-
),
|
|
10779
|
-
onFocusOutside: uiPrimitives.composeEventHandlers(onFocusOutside, (event) => event.preventDefault(), {
|
|
10780
|
-
checkForDefaultPrevented: false
|
|
10781
|
-
}),
|
|
10782
|
-
onDismiss,
|
|
10783
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10784
|
-
PopoverWrapper,
|
|
10785
|
-
{
|
|
10786
|
-
ref: composedRefs,
|
|
10787
|
-
style: {
|
|
10788
|
-
left: x,
|
|
10789
|
-
top: y,
|
|
10790
|
-
position: strategy,
|
|
10791
|
-
width: width || void 0
|
|
10792
|
-
},
|
|
10793
|
-
hasRadius: true,
|
|
10794
|
-
background: "neutral0",
|
|
10795
|
-
padding: 1,
|
|
10796
|
-
...props,
|
|
10797
|
-
children
|
|
10798
|
-
}
|
|
10799
|
-
)
|
|
10800
|
-
}
|
|
10801
|
-
)
|
|
10971
|
+
|
|
10972
|
+
&[data-side='bottom'] {
|
|
10973
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
10802
10974
|
}
|
|
10803
|
-
|
|
10975
|
+
}
|
|
10976
|
+
|
|
10977
|
+
&[data-state='closed'] {
|
|
10978
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10979
|
+
|
|
10980
|
+
&[data-side='top'] {
|
|
10981
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
10982
|
+
}
|
|
10983
|
+
|
|
10984
|
+
&[data-side='bottom'] {
|
|
10985
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
10986
|
+
}
|
|
10987
|
+
}
|
|
10804
10988
|
}
|
|
10805
|
-
|
|
10806
|
-
const
|
|
10989
|
+
`;
|
|
10990
|
+
const ScrollAreaImpl = ({ children, intersectionId, onReachEnd, ...props }) => {
|
|
10807
10991
|
const popoverRef = React__namespace.useRef(null);
|
|
10808
10992
|
const generatedIntersectionId = useId();
|
|
10809
10993
|
useIntersection(popoverRef, onReachEnd ?? (() => {
|
|
@@ -10811,62 +10995,20 @@ const Scrolling = ({ children, intersectionId, onReachEnd, ...props }) => {
|
|
|
10811
10995
|
selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
|
|
10812
10996
|
skipWhen: !intersectionId || !onReachEnd
|
|
10813
10997
|
});
|
|
10814
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10998
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(PopoverScrollArea, { ref: popoverRef, ...props, children: [
|
|
10815
10999
|
children,
|
|
10816
11000
|
intersectionId && onReachEnd && /* @__PURE__ */ jsxRuntime.jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
|
|
10817
11001
|
] });
|
|
10818
11002
|
};
|
|
10819
|
-
const
|
|
10820
|
-
|
|
10821
|
-
overflow-y: auto;
|
|
10822
|
-
overflow-x: hidden;
|
|
10823
|
-
|
|
10824
|
-
&::-webkit-scrollbar {
|
|
10825
|
-
-webkit-appearance: none;
|
|
10826
|
-
width: 4px;
|
|
10827
|
-
}
|
|
10828
|
-
|
|
10829
|
-
&::-webkit-scrollbar-track {
|
|
10830
|
-
background: ${({ theme }) => theme.colors.neutral0};
|
|
10831
|
-
}
|
|
10832
|
-
|
|
10833
|
-
&::-webkit-scrollbar-thumb {
|
|
10834
|
-
background: ${({ theme }) => theme.colors.neutral150};
|
|
10835
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10836
|
-
margin-right: 10px;
|
|
10837
|
-
}
|
|
11003
|
+
const PopoverScrollArea = styledComponents.styled(ScrollAreaImpl$1)`
|
|
11004
|
+
height: 20rem;
|
|
10838
11005
|
`;
|
|
10839
|
-
const Popover = ({
|
|
10840
|
-
children,
|
|
10841
|
-
source,
|
|
10842
|
-
spacing,
|
|
10843
|
-
fullWidth,
|
|
10844
|
-
placement,
|
|
10845
|
-
centered,
|
|
10846
|
-
onEscapeKeyDown,
|
|
10847
|
-
onPointerDownOutside,
|
|
10848
|
-
onDismiss,
|
|
10849
|
-
...restProps
|
|
10850
|
-
}) => {
|
|
10851
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10852
|
-
Content,
|
|
10853
|
-
{
|
|
10854
|
-
source,
|
|
10855
|
-
spacing,
|
|
10856
|
-
fullWidth,
|
|
10857
|
-
placement,
|
|
10858
|
-
centered,
|
|
10859
|
-
onEscapeKeyDown,
|
|
10860
|
-
onPointerDownOutside,
|
|
10861
|
-
onDismiss,
|
|
10862
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Scrolling, { ...restProps, children })
|
|
10863
|
-
}
|
|
10864
|
-
) });
|
|
10865
|
-
};
|
|
10866
|
-
const primitives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11006
|
+
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10867
11007
|
__proto__: null,
|
|
10868
|
-
Content,
|
|
10869
|
-
|
|
11008
|
+
Content: Content$1,
|
|
11009
|
+
Root: Root$1,
|
|
11010
|
+
ScrollArea: ScrollAreaImpl,
|
|
11011
|
+
Trigger: Trigger$1
|
|
10870
11012
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
10871
11013
|
const ProgressbarBase = styledComponents.styled(Box)`
|
|
10872
11014
|
&:before {
|
|
@@ -10898,12 +11040,85 @@ const ProgressBar = ({ min = 0, max = 100, value = 0, children, size = "M", ...p
|
|
|
10898
11040
|
}
|
|
10899
11041
|
);
|
|
10900
11042
|
};
|
|
10901
|
-
const
|
|
10902
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
10903
|
-
|
|
10904
|
-
|
|
11043
|
+
const Group = React__namespace.forwardRef((props, forwardedRef) => {
|
|
11044
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupRoot, { ref: forwardedRef, ...props });
|
|
11045
|
+
});
|
|
11046
|
+
const RadioGroupRoot = styledComponents.styled(RadioGroup__namespace.Root)`
|
|
11047
|
+
display: flex;
|
|
11048
|
+
flex-direction: column;
|
|
11049
|
+
gap: ${(props) => props.theme.spaces[3]};
|
|
11050
|
+
`;
|
|
11051
|
+
const Item = React__namespace.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11052
|
+
const id = useId(idProp);
|
|
11053
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: 2, children: [
|
|
11054
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupIndicator, {}) }),
|
|
11055
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { tag: "label", htmlFor: id, children })
|
|
10905
11056
|
] });
|
|
10906
|
-
};
|
|
11057
|
+
});
|
|
11058
|
+
const RadioGroupItem = styledComponents.styled(RadioGroup__namespace.Item)`
|
|
11059
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
11060
|
+
width: 2rem;
|
|
11061
|
+
height: 2rem;
|
|
11062
|
+
flex: 0 0 2rem;
|
|
11063
|
+
border-radius: 50%;
|
|
11064
|
+
border: 1px solid ${(props) => props.theme.colors.neutral300};
|
|
11065
|
+
position: relative;
|
|
11066
|
+
z-index: 0;
|
|
11067
|
+
|
|
11068
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11069
|
+
transition: border-color ${(props) => props.theme.motion.timings["120"]}
|
|
11070
|
+
${(props) => props.theme.motion.easings.easeOutQuad};
|
|
11071
|
+
}
|
|
11072
|
+
|
|
11073
|
+
&[data-state='checked'] {
|
|
11074
|
+
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
11075
|
+
}
|
|
11076
|
+
|
|
11077
|
+
&[data-disabled] {
|
|
11078
|
+
background-color: ${(props) => props.theme.colors.neutral200};
|
|
11079
|
+
}
|
|
11080
|
+
|
|
11081
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
11082
|
+
&::before {
|
|
11083
|
+
content: '';
|
|
11084
|
+
position: absolute;
|
|
11085
|
+
top: 50%;
|
|
11086
|
+
left: 50%;
|
|
11087
|
+
transform: translate(-50%, -50%);
|
|
11088
|
+
width: 100%;
|
|
11089
|
+
height: 100%;
|
|
11090
|
+
min-width: 44px;
|
|
11091
|
+
min-height: 44px;
|
|
11092
|
+
}
|
|
11093
|
+
`;
|
|
11094
|
+
const RadioGroupIndicator = styledComponents.styled(RadioGroup__namespace.Indicator)`
|
|
11095
|
+
display: flex;
|
|
11096
|
+
align-items: center;
|
|
11097
|
+
justify-content: center;
|
|
11098
|
+
width: 100%;
|
|
11099
|
+
height: 100%;
|
|
11100
|
+
position: relative;
|
|
11101
|
+
|
|
11102
|
+
&[data-state='checked'] {
|
|
11103
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11104
|
+
animation: ${ANIMATIONS.popIn} ${(props) => props.theme.motion.timings["200"]};
|
|
11105
|
+
}
|
|
11106
|
+
}
|
|
11107
|
+
|
|
11108
|
+
&::after {
|
|
11109
|
+
content: '';
|
|
11110
|
+
display: block;
|
|
11111
|
+
width: 1rem;
|
|
11112
|
+
height: 1rem;
|
|
11113
|
+
border-radius: 50%;
|
|
11114
|
+
background: ${(props) => props.theme.colors.primary600};
|
|
11115
|
+
}
|
|
11116
|
+
`;
|
|
11117
|
+
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11118
|
+
__proto__: null,
|
|
11119
|
+
Group,
|
|
11120
|
+
Item
|
|
11121
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
10907
11122
|
const focusFocusable = (node) => {
|
|
10908
11123
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
10909
11124
|
if (nextNode) {
|
|
@@ -11046,7 +11261,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
|
|
|
11046
11261
|
}
|
|
11047
11262
|
};
|
|
11048
11263
|
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11049
|
-
|
|
11264
|
+
useIsomorphicLayoutEffect(() => {
|
|
11050
11265
|
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11051
11266
|
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11052
11267
|
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
@@ -11069,7 +11284,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
|
|
|
11069
11284
|
}
|
|
11070
11285
|
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11071
11286
|
}, [coords, setTableValues]);
|
|
11072
|
-
|
|
11287
|
+
useIsomorphicLayoutEffect(() => {
|
|
11073
11288
|
const cell = tdRef.current;
|
|
11074
11289
|
const focusableNodes = getFocusableNodes(cell, true);
|
|
11075
11290
|
focusableNodes.forEach((node) => {
|
|
@@ -11153,7 +11368,7 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11153
11368
|
inputRef.current.focus();
|
|
11154
11369
|
};
|
|
11155
11370
|
const actualRef = composeRefs(ref, inputRef);
|
|
11156
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Root$
|
|
11371
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsxs(Root$6, { name, children: [
|
|
11157
11372
|
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(Label, { children }) }),
|
|
11158
11373
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11159
11374
|
SearchbarInput,
|
|
@@ -11161,7 +11376,7 @@ const Searchbar = React__namespace.forwardRef(
|
|
|
11161
11376
|
ref: actualRef,
|
|
11162
11377
|
value,
|
|
11163
11378
|
startAction: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { "aria-hidden": true }),
|
|
11164
|
-
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(Action, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) }) : void 0,
|
|
11379
|
+
endAction: isCompleting ? /* @__PURE__ */ jsxRuntime.jsx(Action$1, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {}) }) : void 0,
|
|
11165
11380
|
...props
|
|
11166
11381
|
}
|
|
11167
11382
|
)
|
|
@@ -11290,7 +11505,7 @@ const MultiSelect = React__namespace.forwardRef(
|
|
|
11290
11505
|
ariaDescription = `${id}-hint`;
|
|
11291
11506
|
}
|
|
11292
11507
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11293
|
-
Root,
|
|
11508
|
+
Root$4,
|
|
11294
11509
|
{
|
|
11295
11510
|
onOpenChange: handleOpenChange,
|
|
11296
11511
|
disabled,
|
|
@@ -11301,7 +11516,7 @@ const MultiSelect = React__namespace.forwardRef(
|
|
|
11301
11516
|
multi: true,
|
|
11302
11517
|
children: [
|
|
11303
11518
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11304
|
-
Trigger,
|
|
11519
|
+
Trigger$3,
|
|
11305
11520
|
{
|
|
11306
11521
|
ref: forwardedRef,
|
|
11307
11522
|
id,
|
|
@@ -11317,7 +11532,7 @@ const MultiSelect = React__namespace.forwardRef(
|
|
|
11317
11532
|
children: /* @__PURE__ */ jsxRuntime.jsx(Value, { placeholder, textColor: value?.length ? "neutral800" : "neutral600", children: value?.length ? withTags ? renderTags : customizeContent ? customizeContent(value) : void 0 : void 0 })
|
|
11318
11533
|
}
|
|
11319
11534
|
),
|
|
11320
|
-
/* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$
|
|
11535
|
+
/* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxRuntime.jsxs(Viewport, { ref: viewportRef, children: [
|
|
11321
11536
|
children,
|
|
11322
11537
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
|
|
11323
11538
|
] }) }) })
|
|
@@ -11328,74 +11543,20 @@ const MultiSelect = React__namespace.forwardRef(
|
|
|
11328
11543
|
);
|
|
11329
11544
|
const MultiSelectOption = React__namespace.forwardRef(
|
|
11330
11545
|
({ value, children, startIcon, ...restProps }, ref) => {
|
|
11331
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
|
|
11546
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
11332
11547
|
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
11333
|
-
/* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11334
|
-
|
|
11335
|
-
{
|
|
11336
|
-
hasRadius: true,
|
|
11337
|
-
overflow: "hidden",
|
|
11338
|
-
position: "relative",
|
|
11339
|
-
$indeterminate: isIntermediate,
|
|
11340
|
-
$selected: isSelected,
|
|
11341
|
-
zIndex: 1,
|
|
11342
|
-
height: "18px",
|
|
11343
|
-
width: "18px"
|
|
11344
|
-
}
|
|
11345
|
-
) }),
|
|
11346
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
11548
|
+
/* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
|
|
11549
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ItemText, { children }) })
|
|
11347
11550
|
] });
|
|
11348
11551
|
}
|
|
11349
11552
|
);
|
|
11350
|
-
const CheckMark = styledComponents.styled(Box)`
|
|
11351
|
-
border: 1px solid
|
|
11352
|
-
${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral300};
|
|
11353
|
-
background-color: ${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral0};
|
|
11354
|
-
|
|
11355
|
-
${({ theme, $indeterminate }) => $indeterminate && styledComponents.css`
|
|
11356
|
-
&::after {
|
|
11357
|
-
content: '';
|
|
11358
|
-
display: block;
|
|
11359
|
-
position: relative;
|
|
11360
|
-
color: white;
|
|
11361
|
-
height: 2px;
|
|
11362
|
-
width: 10px;
|
|
11363
|
-
background-color: ${theme.colors.neutral0};
|
|
11364
|
-
left: 50%;
|
|
11365
|
-
top: 50%;
|
|
11366
|
-
transform: translateX(-50%) translateY(-50%);
|
|
11367
|
-
}
|
|
11368
|
-
`}
|
|
11369
|
-
|
|
11370
|
-
${({ $selected }) => $selected && styledComponents.css`
|
|
11371
|
-
&::after {
|
|
11372
|
-
content: '';
|
|
11373
|
-
background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
|
|
11374
|
-
width: 100%;
|
|
11375
|
-
height: 100%;
|
|
11376
|
-
position: absolute;
|
|
11377
|
-
}
|
|
11378
|
-
`}
|
|
11379
|
-
`;
|
|
11380
11553
|
const MultiSelectGroup = React__namespace.forwardRef(
|
|
11381
11554
|
({ children, label, startIcon, values = [], ...restProps }, ref) => {
|
|
11382
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Group, { ref, children: [
|
|
11383
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Item, { value: values, ...restProps, children: [
|
|
11555
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Group$1, { ref, children: [
|
|
11556
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Item$2, { value: values, ...restProps, children: [
|
|
11384
11557
|
startIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
11385
|
-
/* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11386
|
-
|
|
11387
|
-
{
|
|
11388
|
-
hasRadius: true,
|
|
11389
|
-
overflow: "hidden",
|
|
11390
|
-
position: "relative",
|
|
11391
|
-
$indeterminate: isIntermediate,
|
|
11392
|
-
$selected: isSelected,
|
|
11393
|
-
zIndex: 1,
|
|
11394
|
-
height: "18px",
|
|
11395
|
-
width: "18px"
|
|
11396
|
-
}
|
|
11397
|
-
) }),
|
|
11398
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { textColor: "neutral800", children: label })
|
|
11558
|
+
/* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsxRuntime.jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
|
|
11559
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { children: label })
|
|
11399
11560
|
] }),
|
|
11400
11561
|
children
|
|
11401
11562
|
] });
|
|
@@ -11460,13 +11621,6 @@ const SubNavWrapper = styledComponents.styled(Box)`
|
|
|
11460
11621
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
11461
11622
|
z-index: 1;
|
|
11462
11623
|
`;
|
|
11463
|
-
const usePrevious = (value) => {
|
|
11464
|
-
const ref = React__namespace.useRef();
|
|
11465
|
-
React__namespace.useEffect(() => {
|
|
11466
|
-
ref.current = value;
|
|
11467
|
-
});
|
|
11468
|
-
return ref.current;
|
|
11469
|
-
};
|
|
11470
11624
|
const CustomDivider = styledComponents.styled(Divider)`
|
|
11471
11625
|
width: 2.4rem;
|
|
11472
11626
|
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
@@ -11486,7 +11640,7 @@ const SubNavHeader = ({
|
|
|
11486
11640
|
id
|
|
11487
11641
|
}) => {
|
|
11488
11642
|
const [isSearchOpen, setSearchOpen] = React__namespace.useState(false);
|
|
11489
|
-
const previousSearchOpenValue =
|
|
11643
|
+
const previousSearchOpenValue = uiPrimitives.usePrev(isSearchOpen);
|
|
11490
11644
|
const clearButtonId = useId(id);
|
|
11491
11645
|
const searchRef = React__namespace.useRef(void 0);
|
|
11492
11646
|
const searchButtonRef = React__namespace.useRef(void 0);
|
|
@@ -11793,275 +11947,136 @@ const SwitchButton = styledComponents.styled.button`
|
|
|
11793
11947
|
transform: translateX(1rem);
|
|
11794
11948
|
}
|
|
11795
11949
|
`;
|
|
11796
|
-
const
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
if ($hasError) {
|
|
11801
|
-
return theme.colors.danger600;
|
|
11802
|
-
}
|
|
11803
|
-
return theme.colors.primary600;
|
|
11950
|
+
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
11951
|
+
const Root = React__namespace.forwardRef(
|
|
11952
|
+
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
11953
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsxRuntime.jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
11804
11954
|
}
|
|
11805
|
-
|
|
11806
|
-
|
|
11955
|
+
);
|
|
11956
|
+
const TabsRoot = styledComponents.styled(Tabs__namespace.Root)`
|
|
11957
|
+
width: 100%;
|
|
11958
|
+
position: relative;
|
|
11807
11959
|
`;
|
|
11808
|
-
const
|
|
11809
|
-
|
|
11960
|
+
const List = React__namespace.forwardRef((props, forwardedRef) => {
|
|
11961
|
+
const { variant: variant2 } = useTabs("List");
|
|
11962
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsList, { ref: forwardedRef, ...props, $variant: variant2 });
|
|
11963
|
+
});
|
|
11964
|
+
const TabsList = styledComponents.styled(Tabs__namespace.List)`
|
|
11965
|
+
display: flex;
|
|
11966
|
+
align-items: ${(props) => props.$variant === "regular" ? "flex-end" : "unset"};
|
|
11967
|
+
position: relative;
|
|
11968
|
+
z-index: 0;
|
|
11810
11969
|
`;
|
|
11811
|
-
const
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11970
|
+
const Trigger = React__namespace.forwardRef(
|
|
11971
|
+
({ children, disabled: disabledProp, ...props }, forwardedRef) => {
|
|
11972
|
+
const { disabled: disabledContext, variant: variant2, hasError } = useTabs("Trigger");
|
|
11973
|
+
const isDisabled = disabledContext === true || disabledContext === props.value || disabledProp;
|
|
11974
|
+
const isErrored = hasError === props.value;
|
|
11975
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(TabsTrigger, { ref: forwardedRef, ...props, $hasError: isErrored, $variant: variant2, disabled: isDisabled, children: [
|
|
11976
|
+
/* @__PURE__ */ jsxRuntime.jsx(TriggerTypography, { fontWeight: "bold", variant: variant2 === "simple" ? "sigma" : void 0, children }),
|
|
11977
|
+
variant2 === "simple" ? /* @__PURE__ */ jsxRuntime.jsx(TabBar, {}) : null
|
|
11978
|
+
] });
|
|
11818
11979
|
}
|
|
11980
|
+
);
|
|
11981
|
+
const TabBar = styledComponents.styled.span`
|
|
11982
|
+
display: block;
|
|
11983
|
+
width: 100%;
|
|
11984
|
+
background-color: currentColor;
|
|
11985
|
+
position: absolute;
|
|
11986
|
+
bottom: 0;
|
|
11987
|
+
left: 0;
|
|
11988
|
+
opacity: 0;
|
|
11989
|
+
height: 0.2rem;
|
|
11819
11990
|
|
|
11820
|
-
|
|
11821
|
-
|
|
11991
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11992
|
+
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
11822
11993
|
}
|
|
11994
|
+
`;
|
|
11995
|
+
const TriggerTypography = styledComponents.styled(Typography)``;
|
|
11996
|
+
const TabsTrigger = styledComponents.styled(Tabs__namespace.Trigger)`
|
|
11997
|
+
position: relative;
|
|
11998
|
+
color: ${(props) => props.$hasError ? props.theme.colors.danger600 : props.theme.colors.neutral600};
|
|
11999
|
+
cursor: pointer;
|
|
12000
|
+
z-index: 0;
|
|
11823
12001
|
|
|
11824
|
-
|
|
11825
|
-
|
|
12002
|
+
${(props) => {
|
|
12003
|
+
if (props.$variant === "simple") {
|
|
12004
|
+
return styledComponents.css`
|
|
12005
|
+
padding-block: ${(props2) => props2.theme.spaces[4]};
|
|
12006
|
+
padding-inline: ${(props2) => props2.theme.spaces[4]};
|
|
11826
12007
|
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
flex: 1;
|
|
11834
|
-
}
|
|
12008
|
+
& > ${TriggerTypography} {
|
|
12009
|
+
line-height: 1.2rem;
|
|
12010
|
+
}
|
|
12011
|
+
|
|
12012
|
+
&[data-state='active'] {
|
|
12013
|
+
color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
|
|
11835
12014
|
|
|
11836
|
-
|
|
11837
|
-
|
|
12015
|
+
& > ${TabBar} {
|
|
12016
|
+
opacity: 1;
|
|
12017
|
+
}
|
|
12018
|
+
}
|
|
12019
|
+
`;
|
|
12020
|
+
} else {
|
|
12021
|
+
return styledComponents.css`
|
|
12022
|
+
padding-block: ${(props2) => props2.theme.spaces[3]};
|
|
12023
|
+
padding-inline: ${(props2) => props2.theme.spaces[3]};
|
|
12024
|
+
flex: 1;
|
|
12025
|
+
background-color: ${(props2) => props2.theme.colors.neutral100};
|
|
12026
|
+
border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral150};
|
|
12027
|
+
|
|
12028
|
+
&:not([data-state='active']) + &:not([data-state='active']) {
|
|
12029
|
+
border-left: solid 1px ${(props2) => props2.theme.colors.neutral150};
|
|
12030
|
+
}
|
|
12031
|
+
|
|
12032
|
+
&[data-state='active'] {
|
|
12033
|
+
padding-block: ${(props2) => props2.theme.spaces[4]};
|
|
12034
|
+
padding-inline: ${(props2) => props2.theme.spaces[4]};
|
|
12035
|
+
color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
|
|
12036
|
+
border-top-right-radius: ${(props2) => props2.theme.borderRadius};
|
|
12037
|
+
border-top-left-radius: ${(props2) => props2.theme.borderRadius};
|
|
12038
|
+
background-color: ${(props2) => props2.theme.colors.neutral0};
|
|
12039
|
+
border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral0};
|
|
12040
|
+
box-shadow: ${props.theme.shadows.tableShadow};
|
|
12041
|
+
z-index: 1;
|
|
12042
|
+
}
|
|
12043
|
+
`;
|
|
11838
12044
|
}
|
|
12045
|
+
}}
|
|
11839
12046
|
|
|
11840
|
-
|
|
11841
|
-
|
|
12047
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
12048
|
+
transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
|
|
11842
12049
|
}
|
|
11843
12050
|
|
|
11844
|
-
&
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
border-right: none;
|
|
12051
|
+
&[data-disabled] {
|
|
12052
|
+
cursor: not-allowed;
|
|
12053
|
+
color: ${(props) => props.theme.colors.neutral400};
|
|
11848
12054
|
}
|
|
11849
12055
|
`;
|
|
11850
|
-
const
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
selectedTabIndex: 0,
|
|
11854
|
-
selectTabIndex() {
|
|
11855
|
-
throw new Error("TabsContext.selectTabIndex is not implemented.");
|
|
11856
|
-
}
|
|
12056
|
+
const Content = React__namespace.forwardRef((props, forwardedRef) => {
|
|
12057
|
+
const { variant: variant2 } = useTabs("Content");
|
|
12058
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { $variant: variant2, ref: forwardedRef, ...props });
|
|
11857
12059
|
});
|
|
11858
|
-
const
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
if (nextFocusEl) {
|
|
11869
|
-
nextFocusEl.focus();
|
|
11870
|
-
handleTabChange(selectedTabIndex);
|
|
11871
|
-
}
|
|
11872
|
-
}
|
|
11873
|
-
if (!mountedRef.current) {
|
|
11874
|
-
mountedRef.current = true;
|
|
11875
|
-
}
|
|
11876
|
-
}, [selectedTabIndex, handleTabChange]);
|
|
11877
|
-
return tabsRef;
|
|
11878
|
-
};
|
|
11879
|
-
const TabButton = styledComponents.styled.button`
|
|
11880
|
-
&[aria-disabled='true'] {
|
|
11881
|
-
cursor: not-allowed;
|
|
12060
|
+
const TabsContent = styledComponents.styled(Tabs__namespace.Content)`
|
|
12061
|
+
${(props) => {
|
|
12062
|
+
if (props.$variant === "simple") {
|
|
12063
|
+
return styledComponents.css``;
|
|
12064
|
+
} else {
|
|
12065
|
+
return styledComponents.css`
|
|
12066
|
+
position: relative;
|
|
12067
|
+
z-index: 1;
|
|
12068
|
+
background-color: ${(props2) => props2.theme.colors.neutral0};
|
|
12069
|
+
`;
|
|
11882
12070
|
}
|
|
12071
|
+
}}
|
|
11883
12072
|
`;
|
|
11884
|
-
const Tabs =
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
selectedTabIndex,
|
|
11892
|
-
onTabClick: () => selectTabIndex(index),
|
|
11893
|
-
variant: variant2
|
|
11894
|
-
})
|
|
11895
|
-
);
|
|
11896
|
-
const handleKeyDown = (e) => {
|
|
11897
|
-
const hasAllChildrenDisabled = childrenArray.every((node) => node.props.disabled);
|
|
11898
|
-
if (hasAllChildrenDisabled) {
|
|
11899
|
-
return;
|
|
11900
|
-
}
|
|
11901
|
-
switch (e.key) {
|
|
11902
|
-
case KeyboardKeys.RIGHT: {
|
|
11903
|
-
const nextWantedIndex = selectedTabIndex + 1;
|
|
11904
|
-
const findNextIndex = (ref) => {
|
|
11905
|
-
const isDisabled = childrenArray[ref].props.disabled;
|
|
11906
|
-
if (!isDisabled) {
|
|
11907
|
-
return ref;
|
|
11908
|
-
}
|
|
11909
|
-
if (ref === childrenArray.length - 1) {
|
|
11910
|
-
return findNextIndex(0);
|
|
11911
|
-
}
|
|
11912
|
-
return findNextIndex(ref + 1);
|
|
11913
|
-
};
|
|
11914
|
-
const nextIndex = findNextIndex(nextWantedIndex >= childrenArray.length ? 0 : nextWantedIndex);
|
|
11915
|
-
selectTabIndex(nextIndex);
|
|
11916
|
-
break;
|
|
11917
|
-
}
|
|
11918
|
-
case KeyboardKeys.LEFT: {
|
|
11919
|
-
const nextWantedIndex = selectedTabIndex - 1;
|
|
11920
|
-
const findNextIndex = (ref) => {
|
|
11921
|
-
const isDisabled = childrenArray[ref].props.disabled;
|
|
11922
|
-
if (!isDisabled) {
|
|
11923
|
-
return ref;
|
|
11924
|
-
}
|
|
11925
|
-
if (ref === 0) {
|
|
11926
|
-
return findNextIndex(childrenArray.length - 1);
|
|
11927
|
-
}
|
|
11928
|
-
return findNextIndex(ref - 1);
|
|
11929
|
-
};
|
|
11930
|
-
const nextIndex = findNextIndex(nextWantedIndex < 0 ? childrenArray.length - 1 : nextWantedIndex);
|
|
11931
|
-
selectTabIndex(nextIndex);
|
|
11932
|
-
break;
|
|
11933
|
-
}
|
|
11934
|
-
case KeyboardKeys.HOME: {
|
|
11935
|
-
const nextIndex = childrenArray.findIndex((node) => !node.props.disabled);
|
|
11936
|
-
selectTabIndex(nextIndex);
|
|
11937
|
-
break;
|
|
11938
|
-
}
|
|
11939
|
-
case KeyboardKeys.END: {
|
|
11940
|
-
const arrayOfChildrenProps = childrenArray.map((node, index) => ({ isDisabled: node.props.disabled, index }));
|
|
11941
|
-
const firstNonDisabledChildren = arrayOfChildrenProps.reverse().find(({ isDisabled }) => !isDisabled);
|
|
11942
|
-
if (firstNonDisabledChildren) {
|
|
11943
|
-
selectTabIndex(firstNonDisabledChildren.index);
|
|
11944
|
-
}
|
|
11945
|
-
break;
|
|
11946
|
-
}
|
|
11947
|
-
}
|
|
11948
|
-
};
|
|
11949
|
-
if (variant2 === "simple") {
|
|
11950
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: tabsRef, role: "tablist", "aria-label": label, onKeyDown: handleKeyDown, ...props, children: childrenArray });
|
|
11951
|
-
}
|
|
11952
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11953
|
-
DefaultTabsRow,
|
|
11954
|
-
{
|
|
11955
|
-
ref: tabsRef,
|
|
11956
|
-
role: "tablist",
|
|
11957
|
-
alignItems: "flex-end",
|
|
11958
|
-
"aria-label": label,
|
|
11959
|
-
onKeyDown: handleKeyDown,
|
|
11960
|
-
...props,
|
|
11961
|
-
children: childrenArray
|
|
11962
|
-
}
|
|
11963
|
-
);
|
|
11964
|
-
};
|
|
11965
|
-
const Tab = ({
|
|
11966
|
-
disabled = false,
|
|
11967
|
-
id,
|
|
11968
|
-
children,
|
|
11969
|
-
variant: variant2,
|
|
11970
|
-
hasError = false,
|
|
11971
|
-
index,
|
|
11972
|
-
selectedTabIndex,
|
|
11973
|
-
onTabClick,
|
|
11974
|
-
...props
|
|
11975
|
-
}) => {
|
|
11976
|
-
const tabId = `${id}-tab`;
|
|
11977
|
-
const tabPanelId = `${id}-tabpanel`;
|
|
11978
|
-
const selected = index === selectedTabIndex;
|
|
11979
|
-
const handleClick = () => {
|
|
11980
|
-
if (disabled) {
|
|
11981
|
-
return;
|
|
11982
|
-
}
|
|
11983
|
-
if (onTabClick) {
|
|
11984
|
-
onTabClick();
|
|
11985
|
-
}
|
|
11986
|
-
};
|
|
11987
|
-
if (variant2 === "simple") {
|
|
11988
|
-
let textColor;
|
|
11989
|
-
if (hasError) {
|
|
11990
|
-
textColor = "danger600";
|
|
11991
|
-
} else if (selected) {
|
|
11992
|
-
textColor = "primary600";
|
|
11993
|
-
} else if (disabled) {
|
|
11994
|
-
textColor = "neutral600";
|
|
11995
|
-
} else {
|
|
11996
|
-
textColor = "neutral600";
|
|
11997
|
-
}
|
|
11998
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11999
|
-
TabButton,
|
|
12000
|
-
{
|
|
12001
|
-
id: tabId,
|
|
12002
|
-
role: "tab",
|
|
12003
|
-
"aria-controls": selected ? tabPanelId : void 0,
|
|
12004
|
-
tabIndex: selected ? 0 : -1,
|
|
12005
|
-
"aria-selected": selected,
|
|
12006
|
-
type: "button",
|
|
12007
|
-
onClick: handleClick,
|
|
12008
|
-
"aria-disabled": disabled,
|
|
12009
|
-
...props,
|
|
12010
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(SimpleTabBox, { padding: 4, $selected: selected, $hasError: hasError, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "sigma", textColor, children }) })
|
|
12011
|
-
}
|
|
12012
|
-
);
|
|
12013
|
-
}
|
|
12014
|
-
if (hasError) {
|
|
12015
|
-
console.warn('The "hasError" prop is only available for the "simple" variant.');
|
|
12016
|
-
}
|
|
12017
|
-
const showRightBorder = selectedTabIndex && selectedTabIndex - 1 === index;
|
|
12018
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12019
|
-
DefaultTabButton,
|
|
12020
|
-
{
|
|
12021
|
-
id: tabId,
|
|
12022
|
-
role: "tab",
|
|
12023
|
-
type: "button",
|
|
12024
|
-
"aria-controls": selected ? tabPanelId : void 0,
|
|
12025
|
-
tabIndex: selected ? 0 : -1,
|
|
12026
|
-
"aria-selected": selected,
|
|
12027
|
-
onClick: handleClick,
|
|
12028
|
-
"aria-disabled": disabled,
|
|
12029
|
-
$showRightBorder: Boolean(showRightBorder),
|
|
12030
|
-
...props,
|
|
12031
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(DefaultTabBox, { padding: selected ? 4 : 3, background: selected ? "neutral0" : "neutral100", $selected: selected, children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { fontWeight: "bold", textColor: selected ? "primary700" : "neutral600", children }) })
|
|
12032
|
-
}
|
|
12033
|
-
);
|
|
12034
|
-
};
|
|
12035
|
-
const TabPanels = ({ children, ...props }) => {
|
|
12036
|
-
const { id, selectedTabIndex } = useTabs();
|
|
12037
|
-
const childrenArray = React__namespace.Children.toArray(children).map((node, index) => React__namespace.cloneElement(node, { id: `${id}-${index}` })).filter((_, index) => index === selectedTabIndex);
|
|
12038
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, children: childrenArray });
|
|
12039
|
-
};
|
|
12040
|
-
const TabPanel = ({ id, ...props }) => {
|
|
12041
|
-
const tabId = `${id}-tab`;
|
|
12042
|
-
const tabPanelId = `${id}-tabpanel`;
|
|
12043
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { id: tabPanelId, role: "tabpanel", tabIndex: 0, "aria-labelledby": tabId, ...props });
|
|
12044
|
-
};
|
|
12045
|
-
const TabGroup = React__namespace.forwardRef(
|
|
12046
|
-
({ id, initialSelectedTabIndex, label, onTabChange, selectedTabIndex: selectedTabIndexProp, variant: variant2, ...props }, ref) => {
|
|
12047
|
-
const tabsId = useId(id);
|
|
12048
|
-
const [selectedTabIndex = 0, setSelectedTabIndex] = useControllableState({
|
|
12049
|
-
prop: selectedTabIndexProp,
|
|
12050
|
-
defaultProp: initialSelectedTabIndex,
|
|
12051
|
-
// @ts-expect-error - TODO: fix this.
|
|
12052
|
-
onChange: onTabChange
|
|
12053
|
-
});
|
|
12054
|
-
React__namespace.useImperativeHandle(ref, () => ({
|
|
12055
|
-
_handlers: { setSelectedTabIndex }
|
|
12056
|
-
}));
|
|
12057
|
-
const context = React__namespace.useMemo(
|
|
12058
|
-
() => ({ id: tabsId, selectedTabIndex, selectTabIndex: setSelectedTabIndex, label, variant: variant2, onTabChange }),
|
|
12059
|
-
[label, onTabChange, selectedTabIndex, tabsId, variant2, setSelectedTabIndex]
|
|
12060
|
-
);
|
|
12061
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props }) });
|
|
12062
|
-
}
|
|
12063
|
-
);
|
|
12064
|
-
TabGroup.displayName = "TabGroup";
|
|
12073
|
+
const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12074
|
+
__proto__: null,
|
|
12075
|
+
Content,
|
|
12076
|
+
List,
|
|
12077
|
+
Root,
|
|
12078
|
+
Trigger
|
|
12079
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12065
12080
|
const TableContainer = styledComponents.styled(Box)`
|
|
12066
12081
|
overflow: hidden;
|
|
12067
12082
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
@@ -12342,7 +12357,7 @@ const Toggle = React__namespace.forwardRef(
|
|
|
12342
12357
|
onChange,
|
|
12343
12358
|
...props
|
|
12344
12359
|
}, forwardedRef) => {
|
|
12345
|
-
const [checked = false, setChecked] = useControllableState({
|
|
12360
|
+
const [checked = false, setChecked] = useControllableState$1({
|
|
12346
12361
|
prop: checkedProp
|
|
12347
12362
|
});
|
|
12348
12363
|
const isFalseyChecked = checked !== null && !checked;
|
|
@@ -12456,6 +12471,103 @@ const Input = styledComponents.styled.input`
|
|
|
12456
12471
|
z-index: 0;
|
|
12457
12472
|
width: 100%;
|
|
12458
12473
|
`;
|
|
12474
|
+
const defaultState = {
|
|
12475
|
+
x: 0,
|
|
12476
|
+
y: 0,
|
|
12477
|
+
width: 0,
|
|
12478
|
+
height: 0,
|
|
12479
|
+
top: 0,
|
|
12480
|
+
left: 0,
|
|
12481
|
+
bottom: 0,
|
|
12482
|
+
right: 0
|
|
12483
|
+
};
|
|
12484
|
+
function useMeasure() {
|
|
12485
|
+
const [element, ref] = React.useState(null);
|
|
12486
|
+
const [rect, setRect] = React.useState(defaultState);
|
|
12487
|
+
const observer = React.useMemo(
|
|
12488
|
+
() => new ResizeObserver((entries) => {
|
|
12489
|
+
if (entries[0]) {
|
|
12490
|
+
const { x, y, width, height, top, left, bottom, right } = entries[0].contentRect;
|
|
12491
|
+
setRect({ x, y, width, height, top, left, bottom, right });
|
|
12492
|
+
}
|
|
12493
|
+
}),
|
|
12494
|
+
[]
|
|
12495
|
+
);
|
|
12496
|
+
useIsomorphicLayoutEffect(() => {
|
|
12497
|
+
if (!element)
|
|
12498
|
+
return;
|
|
12499
|
+
observer.observe(element);
|
|
12500
|
+
return () => {
|
|
12501
|
+
observer.disconnect();
|
|
12502
|
+
};
|
|
12503
|
+
}, [element, observer]);
|
|
12504
|
+
return [ref, rect];
|
|
12505
|
+
}
|
|
12506
|
+
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12507
|
+
const isValidFocusedElement = () => {
|
|
12508
|
+
const focused = document.activeElement;
|
|
12509
|
+
if (!focused) {
|
|
12510
|
+
return false;
|
|
12511
|
+
}
|
|
12512
|
+
if (tagName) {
|
|
12513
|
+
return focused.tagName.toLowerCase() === tagName;
|
|
12514
|
+
}
|
|
12515
|
+
return focused.hasAttribute(attributeName);
|
|
12516
|
+
};
|
|
12517
|
+
const queryElement = (parentEl) => {
|
|
12518
|
+
if (tagName) {
|
|
12519
|
+
return parentEl.querySelectorAll(tagName);
|
|
12520
|
+
}
|
|
12521
|
+
return parentEl.querySelectorAll(`[${attributeName}]`);
|
|
12522
|
+
};
|
|
12523
|
+
const handleKeyDown = (e) => {
|
|
12524
|
+
switch (e.key) {
|
|
12525
|
+
case KeyboardKeys.RIGHT:
|
|
12526
|
+
case KeyboardKeys.DOWN: {
|
|
12527
|
+
if (isValidFocusedElement()) {
|
|
12528
|
+
e.preventDefault();
|
|
12529
|
+
const focused = document.activeElement;
|
|
12530
|
+
const allElements = [...queryElement(e.currentTarget)];
|
|
12531
|
+
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
12532
|
+
const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
|
|
12533
|
+
allElements[nextIndex].focus();
|
|
12534
|
+
}
|
|
12535
|
+
break;
|
|
12536
|
+
}
|
|
12537
|
+
case KeyboardKeys.LEFT:
|
|
12538
|
+
case KeyboardKeys.UP: {
|
|
12539
|
+
if (isValidFocusedElement()) {
|
|
12540
|
+
e.preventDefault();
|
|
12541
|
+
const focused = document.activeElement;
|
|
12542
|
+
const allElements = [...queryElement(e.currentTarget)];
|
|
12543
|
+
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
12544
|
+
const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
|
|
12545
|
+
allElements[nextIndex].focus();
|
|
12546
|
+
}
|
|
12547
|
+
break;
|
|
12548
|
+
}
|
|
12549
|
+
case KeyboardKeys.HOME: {
|
|
12550
|
+
if (isValidFocusedElement()) {
|
|
12551
|
+
e.preventDefault();
|
|
12552
|
+
const allElements = queryElement(e.currentTarget);
|
|
12553
|
+
const focusElement = allElements.item(0);
|
|
12554
|
+
focusElement.focus();
|
|
12555
|
+
}
|
|
12556
|
+
break;
|
|
12557
|
+
}
|
|
12558
|
+
case KeyboardKeys.END: {
|
|
12559
|
+
if (isValidFocusedElement()) {
|
|
12560
|
+
e.preventDefault();
|
|
12561
|
+
const allElements = queryElement(e.currentTarget);
|
|
12562
|
+
const focusElement = allElements.item(allElements.length - 1);
|
|
12563
|
+
focusElement.focus();
|
|
12564
|
+
}
|
|
12565
|
+
break;
|
|
12566
|
+
}
|
|
12567
|
+
}
|
|
12568
|
+
};
|
|
12569
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { onKeyDown: handleKeyDown, ...props });
|
|
12570
|
+
};
|
|
12459
12571
|
Object.defineProperty(exports, "composeEventHandlers", {
|
|
12460
12572
|
enumerable: true,
|
|
12461
12573
|
get: () => uiPrimitives.composeEventHandlers
|
|
@@ -12476,12 +12588,9 @@ exports.AccessibleIcon = AccessibleIcon;
|
|
|
12476
12588
|
exports.Accordion = Accordion;
|
|
12477
12589
|
exports.Alert = Alert;
|
|
12478
12590
|
exports.Avatar = Avatar;
|
|
12479
|
-
exports.AvatarGroup = AvatarGroup;
|
|
12480
12591
|
exports.Badge = Badge;
|
|
12481
12592
|
exports.BaseButton = BaseButton;
|
|
12482
|
-
exports.BaseCheckbox = BaseCheckbox;
|
|
12483
12593
|
exports.BaseLink = BaseLink;
|
|
12484
|
-
exports.BaseRadio = BaseRadio;
|
|
12485
12594
|
exports.Box = Box;
|
|
12486
12595
|
exports.Breadcrumbs = Breadcrumbs;
|
|
12487
12596
|
exports.Button = Button;
|
|
@@ -12501,7 +12610,7 @@ exports.CarouselActions = CarouselActions;
|
|
|
12501
12610
|
exports.CarouselImage = CarouselImage;
|
|
12502
12611
|
exports.CarouselInput = CarouselInput;
|
|
12503
12612
|
exports.CarouselSlide = CarouselSlide;
|
|
12504
|
-
exports.Checkbox =
|
|
12613
|
+
exports.Checkbox = CheckboxImpl;
|
|
12505
12614
|
exports.Combobox = Combobox;
|
|
12506
12615
|
exports.ComboboxOption = Option;
|
|
12507
12616
|
exports.Crumb = Crumb;
|
|
@@ -12511,8 +12620,6 @@ exports.DatePicker = DatePicker$1;
|
|
|
12511
12620
|
exports.DateTimePicker = DateTimePicker;
|
|
12512
12621
|
exports.DesignSystemProvider = DesignSystemProvider;
|
|
12513
12622
|
exports.Dialog = Dialog;
|
|
12514
|
-
exports.DialogBody = DialogBody;
|
|
12515
|
-
exports.DialogFooter = DialogFooter;
|
|
12516
12623
|
exports.DismissibleLayer = DismissibleLayer;
|
|
12517
12624
|
exports.Divider = Divider;
|
|
12518
12625
|
exports.Dots = Dots;
|
|
@@ -12521,10 +12628,8 @@ exports.Field = Field;
|
|
|
12521
12628
|
exports.Flex = Flex;
|
|
12522
12629
|
exports.FocusTrap = FocusTrap;
|
|
12523
12630
|
exports.Grid = Grid;
|
|
12524
|
-
exports.GridItem = GridItemImpl;
|
|
12525
12631
|
exports.IconButton = IconButton;
|
|
12526
12632
|
exports.IconButtonGroup = IconButtonGroup;
|
|
12527
|
-
exports.Initials = Initials;
|
|
12528
12633
|
exports.JSONInput = JSONInput;
|
|
12529
12634
|
exports.KeyboardNavigable = KeyboardNavigable;
|
|
12530
12635
|
exports.Link = Link;
|
|
@@ -12534,32 +12639,27 @@ exports.Loader = Loader;
|
|
|
12534
12639
|
exports.Main = Main;
|
|
12535
12640
|
exports.Menu = Menu;
|
|
12536
12641
|
exports.MenuItem = MenuItem;
|
|
12537
|
-
exports.
|
|
12538
|
-
exports.ModalFooter = ModalFooter;
|
|
12539
|
-
exports.ModalHeader = ModalHeader;
|
|
12540
|
-
exports.ModalLayout = ModalLayout;
|
|
12642
|
+
exports.Modal = Modal;
|
|
12541
12643
|
exports.MultiSelect = MultiSelect;
|
|
12542
12644
|
exports.MultiSelectGroup = MultiSelectGroup;
|
|
12543
12645
|
exports.MultiSelectNested = MultiSelectNested;
|
|
12544
12646
|
exports.MultiSelectOption = MultiSelectOption;
|
|
12545
12647
|
exports.NextLink = NextLink;
|
|
12546
12648
|
exports.NumberInput = NumberInput;
|
|
12547
|
-
exports.POPOVER_PLACEMENTS = POPOVER_PLACEMENTS;
|
|
12548
12649
|
exports.PageLink = PageLink;
|
|
12549
12650
|
exports.Pagination = Pagination;
|
|
12550
12651
|
exports.Popover = Popover;
|
|
12551
|
-
exports.PopoverPrimitives = primitives;
|
|
12552
12652
|
exports.Portal = Portal$1;
|
|
12553
12653
|
exports.PreviousLink = PreviousLink;
|
|
12554
12654
|
exports.ProgressBar = ProgressBar;
|
|
12555
12655
|
exports.Radio = Radio;
|
|
12556
|
-
exports.RadioGroup = RadioGroup;
|
|
12557
12656
|
exports.RawTable = RawTable;
|
|
12558
12657
|
exports.RawTbody = RawTbody;
|
|
12559
12658
|
exports.RawTd = RawTd;
|
|
12560
12659
|
exports.RawTh = RawTh;
|
|
12561
12660
|
exports.RawThead = RawThead;
|
|
12562
12661
|
exports.RawTr = RawTr;
|
|
12662
|
+
exports.ScrollArea = ScrollAreaImpl$1;
|
|
12563
12663
|
exports.SearchForm = SearchForm;
|
|
12564
12664
|
exports.Searchbar = Searchbar;
|
|
12565
12665
|
exports.SimpleMenu = SimpleMenu;
|
|
@@ -12575,10 +12675,6 @@ exports.SubNavSection = SubNavSection;
|
|
|
12575
12675
|
exports.SubNavSections = SubNavSections;
|
|
12576
12676
|
exports.Switch = Switch;
|
|
12577
12677
|
exports.TFooter = TFooter;
|
|
12578
|
-
exports.Tab = Tab;
|
|
12579
|
-
exports.TabGroup = TabGroup;
|
|
12580
|
-
exports.TabPanel = TabPanel;
|
|
12581
|
-
exports.TabPanels = TabPanels;
|
|
12582
12678
|
exports.Table = Table;
|
|
12583
12679
|
exports.Tabs = Tabs;
|
|
12584
12680
|
exports.Tag = Tag;
|
|
@@ -12595,16 +12691,22 @@ exports.Tooltip = TooltipImpl;
|
|
|
12595
12691
|
exports.Tr = Tr;
|
|
12596
12692
|
exports.Typography = Typography;
|
|
12597
12693
|
exports.VisuallyHidden = VisuallyHidden;
|
|
12694
|
+
exports._internaluseUncontrolledState = useUncontrolledState;
|
|
12598
12695
|
exports.composeRefs = composeRefs;
|
|
12599
12696
|
exports.convertUTCDateToCalendarDateTime = convertUTCDateToCalendarDateTime;
|
|
12600
12697
|
exports.darkTheme = darkTheme;
|
|
12601
12698
|
exports.extendTheme = extendTheme;
|
|
12602
12699
|
exports.getThemeSize = getThemeSize;
|
|
12603
12700
|
exports.inputFocusStyle = inputFocusStyle;
|
|
12701
|
+
exports.isSSR = isSSR;
|
|
12604
12702
|
exports.lightTheme = lightTheme;
|
|
12605
12703
|
exports.useComposedRefs = useComposedRefs;
|
|
12704
|
+
exports.useControllableState = useControllableState$1;
|
|
12606
12705
|
exports.useDateFormatter = useDateFormatter;
|
|
12607
12706
|
exports.useDesignSystem = useDesignSystem;
|
|
12608
12707
|
exports.useField = useField;
|
|
12708
|
+
exports.useId = useId;
|
|
12709
|
+
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
12710
|
+
exports.useMeasure = useMeasure;
|
|
12609
12711
|
exports.useNotifyAT = useNotifyAT;
|
|
12610
12712
|
//# sourceMappingURL=index.js.map
|