@strapi/design-system 2.0.0-beta.4 → 2.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +4 -0
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +5 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.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 +5 -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/Link/Link.d.ts +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/ProgressBar/ProgressBar.d.ts +8 -10
- package/dist/components/ProgressBar/ProgressBar.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 +2 -2
- package/dist/components/Select/MultiSelect.d.ts.map +1 -1
- package/dist/components/Select/SelectParts.d.ts +11 -5
- package/dist/components/Select/SelectParts.d.ts.map +1 -1
- package/dist/components/Select/SingleSelect.d.ts +2 -2
- package/dist/components/Select/SingleSelect.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/SubNav/SubNavLink.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +4 -6
- package/dist/components/Switch/Switch.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 +1565 -1379
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1553 -1377
- 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 +27 -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.mjs
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useEffect } from "react";
|
|
2
|
+
import { useRef, useEffect, useMemo, useLayoutEffect, useState } from "react";
|
|
3
3
|
import { DateFormatter, getLocalTimeZone, today, minDate, maxDate, startOfMonth, startOfWeek, getDayOfWeek, isSameDay, endOfMonth, parseAbsolute, toCalendarDate, parseAbsoluteToLocal, toCalendarDateTime } from "@internationalized/date";
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
5
|
import * as Tooltip from "@radix-ui/react-tooltip";
|
|
6
6
|
import { Provider as Provider$1 } from "@radix-ui/react-tooltip";
|
|
7
|
-
import { styled, css, keyframes, createGlobalStyle, ThemeProvider } from "styled-components";
|
|
8
|
-
import
|
|
7
|
+
import { styled, css, keyframes, useTheme, createGlobalStyle, ThemeProvider } from "styled-components";
|
|
8
|
+
import * as DismissibleLayerPrimitive from "@radix-ui/react-dismissable-layer";
|
|
9
|
+
import { useCallbackRef, Combobox as Combobox$1, Select, composeEventHandlers, usePrev } from "@strapi/ui-primitives";
|
|
9
10
|
import { composeEventHandlers as composeEventHandlers2, useCallbackRef as useCallbackRef2, useCollator, useFilter } from "@strapi/ui-primitives";
|
|
10
11
|
import * as RadixAccordion from "@radix-ui/react-accordion";
|
|
11
12
|
import { CaretDown, Cross, CheckCircle, WarningCircle, Information, Loader as Loader$1, ExternalLink, ChevronRight, ChevronLeft, Calendar, Clock, Search } from "@strapi/icons";
|
|
13
|
+
import * as Avatar$1 from "@radix-ui/react-avatar";
|
|
12
14
|
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
13
|
-
import
|
|
14
|
-
import * as
|
|
15
|
-
import { createPortal } from "react-dom";
|
|
15
|
+
import * as Checkbox from "@radix-ui/react-checkbox";
|
|
16
|
+
import * as AlertDialog from "@radix-ui/react-alert-dialog";
|
|
16
17
|
import { useFloating, offset, shift, flip, autoUpdate } from "@floating-ui/react-dom";
|
|
17
18
|
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
19
|
+
import { createPortal } from "react-dom";
|
|
18
20
|
import { RemoveScroll } from "react-remove-scroll";
|
|
19
21
|
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
20
22
|
import { useCodeMirror } from "@uiw/react-codemirror";
|
|
21
23
|
import { StateEffect, StateField } from "@codemirror/state";
|
|
22
24
|
import { Decoration, EditorView } from "@codemirror/view";
|
|
25
|
+
import * as Dialog$1 from "@radix-ui/react-dialog";
|
|
26
|
+
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
|
23
27
|
import { NumberParser, NumberFormatter } from "@internationalized/number";
|
|
24
|
-
import
|
|
28
|
+
import * as Popover$1 from "@radix-ui/react-popover";
|
|
29
|
+
import * as Progress from "@radix-ui/react-progress";
|
|
30
|
+
import * as RadioGroup from "@radix-ui/react-radio-group";
|
|
31
|
+
import * as Switch from "@radix-ui/react-switch";
|
|
32
|
+
import * as Tabs$1 from "@radix-ui/react-tabs";
|
|
25
33
|
const createContext = (rootComponentName, defaultContext) => {
|
|
26
34
|
const Context = React.createContext(defaultContext);
|
|
27
35
|
const Provider2 = (props) => {
|
|
@@ -404,7 +412,7 @@ const StyledTypography = styled(Box)`
|
|
|
404
412
|
text-transform: ${({ $textTransform }) => $textTransform};
|
|
405
413
|
`;
|
|
406
414
|
const [AccordionProvider, useAccordion] = createContext("Accordion");
|
|
407
|
-
const Root$
|
|
415
|
+
const Root$8 = React.forwardRef(({ children, size = "S", ...props }, forwardedRef) => {
|
|
408
416
|
return /* @__PURE__ */ jsx(AccordionRoot, { ref: forwardedRef, $size: size, collapsible: true, ...props, type: "single", children: /* @__PURE__ */ jsx(AccordionProvider, { size, children }) });
|
|
409
417
|
});
|
|
410
418
|
const AccordionRoot = styled(RadixAccordion.Root)`
|
|
@@ -421,7 +429,7 @@ const AccordionRoot = styled(RadixAccordion.Root)`
|
|
|
421
429
|
}
|
|
422
430
|
}}
|
|
423
431
|
`;
|
|
424
|
-
const Item$
|
|
432
|
+
const Item$5 = React.forwardRef((props, forwardedRef) => {
|
|
425
433
|
const { size } = useAccordion("Item");
|
|
426
434
|
return /* @__PURE__ */ jsx(AccordionItem, { $size: size, ref: forwardedRef, ...props });
|
|
427
435
|
});
|
|
@@ -449,7 +457,7 @@ const AccordionItem = styled(RadixAccordion.Item)`
|
|
|
449
457
|
box-shadow: 0 0 0 2px ${(props) => props.theme.colors.primary600};
|
|
450
458
|
}
|
|
451
459
|
`;
|
|
452
|
-
const Trigger$
|
|
460
|
+
const Trigger$7 = React.forwardRef(
|
|
453
461
|
({ caretPosition = "left", description, icon: Icon, children, ...restProps }, forwardedRef) => {
|
|
454
462
|
const { size } = useAccordion("Trigger");
|
|
455
463
|
return /* @__PURE__ */ jsxs(AccordionTrigger, { $caretPosition: caretPosition, $size: size, ref: forwardedRef, ...restProps, children: [
|
|
@@ -477,7 +485,7 @@ const IconBox$4 = styled(Box)`
|
|
|
477
485
|
color: ${(props) => props.theme.colors.neutral500};
|
|
478
486
|
|
|
479
487
|
@media (prefers-reduced-motion: no-preference) {
|
|
480
|
-
transition:
|
|
488
|
+
transition: ${(props) => props.theme.transitions.color};
|
|
481
489
|
}
|
|
482
490
|
`;
|
|
483
491
|
const TriggerIcon = styled(Flex).attrs((props) => ({
|
|
@@ -493,8 +501,8 @@ const TriggerIcon = styled(Flex).attrs((props) => ({
|
|
|
493
501
|
|
|
494
502
|
@media (prefers-reduced-motion: no-preference) {
|
|
495
503
|
transition:
|
|
496
|
-
transform
|
|
497
|
-
|
|
504
|
+
transform ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.authenticMotion},
|
|
505
|
+
${(props) => props.theme.transitions.backgroundColor};
|
|
498
506
|
}
|
|
499
507
|
`;
|
|
500
508
|
const AccordionTrigger = styled(RadixAccordion.Trigger)`
|
|
@@ -523,7 +531,7 @@ const AccordionTrigger = styled(RadixAccordion.Trigger)`
|
|
|
523
531
|
}
|
|
524
532
|
|
|
525
533
|
@media (prefers-reduced-motion: no-preference) {
|
|
526
|
-
transition:
|
|
534
|
+
transition: ${(props) => props.theme.transitions.color};
|
|
527
535
|
}
|
|
528
536
|
`;
|
|
529
537
|
const Actions = React.forwardRef((props, forwardedRef) => {
|
|
@@ -544,11 +552,11 @@ const ActionWrapper = styled(Flex).attrs((props) => ({
|
|
|
544
552
|
color: ${(props) => props.theme.colors.neutral600};
|
|
545
553
|
|
|
546
554
|
@media (prefers-reduced-motion: no-preference) {
|
|
547
|
-
transition:
|
|
555
|
+
transition: ${(props) => props.theme.transitions.color};
|
|
548
556
|
}
|
|
549
557
|
}
|
|
550
558
|
`;
|
|
551
|
-
const Header = React.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
|
|
559
|
+
const Header$2 = React.forwardRef(({ variant: variant2 = "primary", ...props }, forwardedRef) => {
|
|
552
560
|
return /* @__PURE__ */ jsx(AccordionHeader, { $variant: variant2, ref: forwardedRef, ...props });
|
|
553
561
|
});
|
|
554
562
|
const AccordionHeader = styled(RadixAccordion.Header)`
|
|
@@ -584,10 +592,10 @@ const AccordionHeader = styled(RadixAccordion.Header)`
|
|
|
584
592
|
}
|
|
585
593
|
|
|
586
594
|
@media (prefers-reduced-motion: no-preference) {
|
|
587
|
-
transition:
|
|
595
|
+
transition: ${(props) => props.theme.transitions.backgroundColor};
|
|
588
596
|
}
|
|
589
597
|
`;
|
|
590
|
-
const Content$
|
|
598
|
+
const Content$7 = React.forwardRef((props, forwardedRef) => {
|
|
591
599
|
return /* @__PURE__ */ jsx(AccordionContent, { ref: forwardedRef, ...props });
|
|
592
600
|
});
|
|
593
601
|
const slideDown = keyframes`
|
|
@@ -611,22 +619,24 @@ const AccordionContent = styled(RadixAccordion.Content)`
|
|
|
611
619
|
|
|
612
620
|
@media (prefers-reduced-motion: no-preference) {
|
|
613
621
|
&[data-state='open'] {
|
|
614
|
-
animation: ${slideDown}
|
|
622
|
+
animation: ${slideDown} ${(props) => props.theme.motion.timings["320"]}
|
|
623
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
615
624
|
}
|
|
616
625
|
|
|
617
626
|
&[data-state='closed'] {
|
|
618
|
-
animation: ${slideUp}
|
|
627
|
+
animation: ${slideUp} ${(props) => props.theme.motion.timings["320"]}
|
|
628
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
619
629
|
}
|
|
620
630
|
}
|
|
621
631
|
`;
|
|
622
632
|
const Accordion = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
623
633
|
__proto__: null,
|
|
624
634
|
Actions,
|
|
625
|
-
Content: Content$
|
|
626
|
-
Header,
|
|
627
|
-
Item: Item$
|
|
628
|
-
Root: Root$
|
|
629
|
-
Trigger: Trigger$
|
|
635
|
+
Content: Content$7,
|
|
636
|
+
Header: Header$2,
|
|
637
|
+
Item: Item$5,
|
|
638
|
+
Root: Root$8,
|
|
639
|
+
Trigger: Trigger$7
|
|
630
640
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
631
641
|
const focus = css`
|
|
632
642
|
position: relative;
|
|
@@ -802,88 +812,291 @@ const Alert = ({
|
|
|
802
812
|
}
|
|
803
813
|
);
|
|
804
814
|
};
|
|
805
|
-
|
|
806
|
-
const
|
|
807
|
-
|
|
815
|
+
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
816
|
+
const callbackRef = useRef(callback);
|
|
817
|
+
useEffect(() => {
|
|
818
|
+
callbackRef.current = callback;
|
|
819
|
+
});
|
|
820
|
+
return useMemo(
|
|
821
|
+
() => (...args) => {
|
|
822
|
+
var _callbackRef$current;
|
|
823
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
824
|
+
},
|
|
825
|
+
[]
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
function useControllableState$1({ prop, defaultProp, onChange = () => {
|
|
829
|
+
} }) {
|
|
830
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
831
|
+
const isControlled = prop !== void 0;
|
|
832
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
833
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
834
|
+
const setValue = React.useCallback(
|
|
835
|
+
(nextValue) => {
|
|
836
|
+
if (isControlled) {
|
|
837
|
+
const setter = nextValue;
|
|
838
|
+
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
839
|
+
if (value2 !== prop)
|
|
840
|
+
handleChange(value2);
|
|
841
|
+
} else {
|
|
842
|
+
setUncontrolledProp(nextValue);
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
[isControlled, prop, setUncontrolledProp, handleChange]
|
|
846
|
+
);
|
|
847
|
+
return [value, setValue];
|
|
848
|
+
}
|
|
849
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
850
|
+
const uncontrolledState = React.useState(defaultProp);
|
|
851
|
+
const [value] = uncontrolledState;
|
|
852
|
+
const prevValueRef = React.useRef(value);
|
|
853
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
854
|
+
React.useEffect(() => {
|
|
855
|
+
if (prevValueRef.current !== value) {
|
|
856
|
+
handleChange(value);
|
|
857
|
+
prevValueRef.current = value;
|
|
858
|
+
}
|
|
859
|
+
}, [value, prevValueRef, handleChange]);
|
|
860
|
+
return uncontrolledState;
|
|
861
|
+
}
|
|
862
|
+
const EASINGS = {
|
|
863
|
+
easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
|
|
864
|
+
easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
865
|
+
easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
866
|
+
easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
|
|
867
|
+
easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
868
|
+
easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
869
|
+
easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
|
|
870
|
+
easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
871
|
+
easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
872
|
+
easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
|
|
873
|
+
easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
874
|
+
easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
875
|
+
easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
|
|
876
|
+
easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
877
|
+
easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
878
|
+
easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
|
|
879
|
+
easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
880
|
+
easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
881
|
+
easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
|
|
882
|
+
easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
883
|
+
easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
884
|
+
easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
|
|
885
|
+
easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
886
|
+
easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
|
|
887
|
+
easeInOutFast: "cubic-bezier(1,0,0,1)",
|
|
888
|
+
authenticMotion: "cubic-bezier(.4,0,.2,1)"
|
|
889
|
+
};
|
|
890
|
+
const TIMINGS = {
|
|
891
|
+
"320": "320ms",
|
|
892
|
+
"200": "200ms",
|
|
893
|
+
"120": "120ms"
|
|
894
|
+
};
|
|
895
|
+
const TRANSITIONS = {
|
|
896
|
+
color: `color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`,
|
|
897
|
+
backgroundColor: `background-color ${TIMINGS["120"]} ${EASINGS.easeOutQuad}`
|
|
898
|
+
};
|
|
899
|
+
const ANIMATIONS = {
|
|
900
|
+
overlayFadeIn: keyframes`
|
|
901
|
+
from {
|
|
902
|
+
opacity: 0;
|
|
903
|
+
}
|
|
904
|
+
to {
|
|
905
|
+
opacity: 0.2;
|
|
906
|
+
}
|
|
907
|
+
`,
|
|
908
|
+
modalPopIn: keyframes`
|
|
909
|
+
from {
|
|
910
|
+
transform:translate(-50%, -50%) scale(0.8);
|
|
911
|
+
opacity: 0;
|
|
912
|
+
}
|
|
913
|
+
to {
|
|
914
|
+
transform: translate(-50%, -50%) scale(1);
|
|
915
|
+
opacity: 1;
|
|
916
|
+
}
|
|
917
|
+
`,
|
|
918
|
+
modalPopOut: keyframes`
|
|
919
|
+
from {
|
|
920
|
+
transform: translate(-50%, -50%) scale(1);
|
|
921
|
+
opacity: 1;
|
|
922
|
+
}
|
|
923
|
+
to {
|
|
924
|
+
transform:translate(-50%, -50%) scale(0.8);
|
|
925
|
+
opacity: 0;
|
|
926
|
+
}
|
|
927
|
+
`,
|
|
928
|
+
popIn: keyframes`
|
|
929
|
+
from {
|
|
930
|
+
transform: scale(0.8);
|
|
931
|
+
opacity: 0;
|
|
932
|
+
}
|
|
933
|
+
to {
|
|
934
|
+
transform: scale(1);
|
|
935
|
+
opacity: 1;
|
|
936
|
+
}
|
|
937
|
+
`,
|
|
938
|
+
popOut: keyframes`
|
|
939
|
+
from {
|
|
940
|
+
transform: scale(1);
|
|
941
|
+
opacity: 1;
|
|
942
|
+
}
|
|
943
|
+
to {
|
|
944
|
+
transform: scale(0.8);
|
|
945
|
+
opacity: 0;
|
|
946
|
+
}
|
|
947
|
+
`,
|
|
948
|
+
slideDownIn: keyframes`
|
|
949
|
+
from {
|
|
950
|
+
opacity: 0;
|
|
951
|
+
transform: translateY(-10px);
|
|
952
|
+
}
|
|
953
|
+
to {
|
|
954
|
+
opacity: 1;
|
|
955
|
+
transform: translateY(0);
|
|
956
|
+
}
|
|
957
|
+
`,
|
|
958
|
+
slideDownOut: keyframes`
|
|
959
|
+
from {
|
|
960
|
+
opacity: 1;
|
|
961
|
+
transform: translateY(0);
|
|
962
|
+
}
|
|
963
|
+
to {
|
|
964
|
+
opacity: 0;
|
|
965
|
+
transform: translateY(-10px);
|
|
966
|
+
}
|
|
967
|
+
`,
|
|
968
|
+
slideUpIn: keyframes`
|
|
969
|
+
from {
|
|
970
|
+
opacity: 0;
|
|
971
|
+
transform: translateY(10px);
|
|
972
|
+
}
|
|
973
|
+
to {
|
|
974
|
+
opacity: 1;
|
|
975
|
+
transform: translateY(0);
|
|
976
|
+
}
|
|
977
|
+
`,
|
|
978
|
+
slideUpOut: keyframes`
|
|
979
|
+
from {
|
|
980
|
+
opacity: 1;
|
|
981
|
+
transform: translateY(0);
|
|
982
|
+
}
|
|
983
|
+
to {
|
|
984
|
+
opacity: 0;
|
|
985
|
+
transform: translateY(10px);
|
|
986
|
+
}
|
|
987
|
+
`,
|
|
988
|
+
fadeIn: keyframes`
|
|
989
|
+
from {
|
|
990
|
+
opacity: 0;
|
|
991
|
+
}
|
|
992
|
+
to {
|
|
993
|
+
opacity: 1;
|
|
994
|
+
}
|
|
995
|
+
`,
|
|
996
|
+
fadeOut: keyframes`
|
|
997
|
+
from {
|
|
998
|
+
opacity: 1;
|
|
999
|
+
}
|
|
1000
|
+
to {
|
|
1001
|
+
opacity: 0;
|
|
1002
|
+
}
|
|
1003
|
+
`
|
|
1004
|
+
};
|
|
1005
|
+
const SIZE = 32;
|
|
1006
|
+
const PREVIEW_SCALE = 2;
|
|
1007
|
+
const Item$4 = React.forwardRef(
|
|
1008
|
+
({ onLoadingStatusChange, delayMs = 600, src, alt, fallback, preview = false, ...restProps }, forwardedRef) => {
|
|
1009
|
+
const [loadingStatus, setLoadingStatus] = useControllableState$1({
|
|
1010
|
+
onChange: onLoadingStatusChange
|
|
1011
|
+
});
|
|
1012
|
+
const [tooltipOpen, setTooltipOpen] = React.useState(false);
|
|
1013
|
+
const hasPreview = preview && loadingStatus === "loaded";
|
|
1014
|
+
const handleTooltipOpen = (isOpen) => {
|
|
1015
|
+
if (hasPreview) {
|
|
1016
|
+
setTooltipOpen(isOpen);
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
return /* @__PURE__ */ jsxs(Tooltip.Root, { onOpenChange: handleTooltipOpen, children: [
|
|
1020
|
+
/* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(AvatarRoot, { ref: forwardedRef, ...restProps, children: [
|
|
1021
|
+
hasPreview ? /* @__PURE__ */ jsx(
|
|
1022
|
+
AvatarOverlay,
|
|
1023
|
+
{
|
|
1024
|
+
width: "100%",
|
|
1025
|
+
height: "100%",
|
|
1026
|
+
position: "absolute",
|
|
1027
|
+
background: "neutral0",
|
|
1028
|
+
zIndex: "overlay",
|
|
1029
|
+
style: { opacity: tooltipOpen ? 0.4 : 0 }
|
|
1030
|
+
}
|
|
1031
|
+
) : null,
|
|
1032
|
+
/* @__PURE__ */ jsx(AvatarImage, { src, alt, onLoadingStatusChange: setLoadingStatus }),
|
|
1033
|
+
/* @__PURE__ */ jsx(Avatar$1.Fallback, { delayMs, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textTransform: "uppercase", children: fallback }) })
|
|
1034
|
+
] }) }),
|
|
1035
|
+
hasPreview ? /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(PreviewContent, { side: "top", sideOffset: 4, children: /* @__PURE__ */ jsx(PreviewImg, { src, alt }) }) }) : null
|
|
1036
|
+
] });
|
|
1037
|
+
}
|
|
1038
|
+
);
|
|
1039
|
+
const avatarStyles = css`
|
|
1040
|
+
display: inline-flex;
|
|
1041
|
+
align-items: center;
|
|
1042
|
+
justify-content: center;
|
|
1043
|
+
vertical-align: middle;
|
|
1044
|
+
overflow: hidden;
|
|
1045
|
+
user-select: none;
|
|
1046
|
+
overflow: hidden;
|
|
808
1047
|
border-radius: 50%;
|
|
1048
|
+
`;
|
|
1049
|
+
const imgStyles = css`
|
|
1050
|
+
width: 100%;
|
|
1051
|
+
height: 100%;
|
|
809
1052
|
object-fit: cover;
|
|
810
|
-
|
|
1053
|
+
border-radius: inherit;
|
|
1054
|
+
`;
|
|
1055
|
+
const AvatarRoot = styled(Avatar$1.Root)`
|
|
811
1056
|
position: relative;
|
|
1057
|
+
z-index: 0;
|
|
1058
|
+
${avatarStyles}
|
|
1059
|
+
width: ${SIZE / 10}rem;
|
|
1060
|
+
height: ${SIZE / 10}rem;
|
|
1061
|
+
/* 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 */
|
|
1062
|
+
background-color: ${(p) => p.theme.colors.primary600};
|
|
1063
|
+
color: ${(p) => p.theme.colors.neutral0};
|
|
1064
|
+
`;
|
|
1065
|
+
const AvatarOverlay = styled(Box)`
|
|
1066
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1067
|
+
transition: opacity ${(props) => props.theme.motion.timings["200"]}
|
|
1068
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1069
|
+
}
|
|
812
1070
|
`;
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
825
|
-
const isHovering = Boolean(preview && previewVisible);
|
|
826
|
-
return /* @__PURE__ */ jsxs("span", { children: [
|
|
827
|
-
isHovering ? /* @__PURE__ */ jsx(
|
|
828
|
-
PreviewContainer,
|
|
829
|
-
{
|
|
830
|
-
"aria-hidden": true,
|
|
831
|
-
alt: "",
|
|
832
|
-
width: `${previewSize}px`,
|
|
833
|
-
height: `${previewSize}px`,
|
|
834
|
-
src: preview === true ? src : typeof preview === "string" ? preview : ""
|
|
835
|
-
}
|
|
836
|
-
) : null,
|
|
837
|
-
/* @__PURE__ */ jsxs(
|
|
838
|
-
Box,
|
|
839
|
-
{
|
|
840
|
-
zIndex: isHovering ? 1 : void 0,
|
|
841
|
-
position: "relative",
|
|
842
|
-
onMouseEnter: () => setPreviewVisible(true),
|
|
843
|
-
onMouseLeave: () => setPreviewVisible(false),
|
|
844
|
-
width: `${avatarSize}px`,
|
|
845
|
-
height: `${avatarSize}px`,
|
|
846
|
-
children: [
|
|
847
|
-
isHovering ? /* @__PURE__ */ jsx(
|
|
848
|
-
Overlay,
|
|
849
|
-
{
|
|
850
|
-
background: "neutral0",
|
|
851
|
-
borderRadius: "50%",
|
|
852
|
-
position: "absolute",
|
|
853
|
-
width: `${avatarSize}px`,
|
|
854
|
-
height: `${avatarSize}px`,
|
|
855
|
-
zIndex: 1
|
|
856
|
-
}
|
|
857
|
-
) : null,
|
|
858
|
-
/* @__PURE__ */ jsx(AvatarImg, { src, alt, width: `${avatarSize}px`, height: `${avatarSize}px` })
|
|
859
|
-
]
|
|
860
|
-
}
|
|
861
|
-
)
|
|
862
|
-
] });
|
|
863
|
-
};
|
|
864
|
-
const InitialsWrapper = styled(Flex)`
|
|
865
|
-
span {
|
|
866
|
-
line-height: 0;
|
|
1071
|
+
const AvatarImage = styled(Avatar$1.Image)`
|
|
1072
|
+
${imgStyles}
|
|
1073
|
+
`;
|
|
1074
|
+
const PreviewContent = styled(Tooltip.Content)`
|
|
1075
|
+
${avatarStyles}
|
|
1076
|
+
width: ${SIZE * PREVIEW_SCALE / 10}rem;
|
|
1077
|
+
height: ${SIZE * PREVIEW_SCALE / 10}rem;
|
|
1078
|
+
|
|
1079
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1080
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
1081
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
867
1082
|
}
|
|
868
1083
|
`;
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
children: /* @__PURE__ */ jsx(Typography, { fontSize: 0, fontWeight: "bold", textColor, textTransform: "uppercase", children })
|
|
879
|
-
}
|
|
880
|
-
);
|
|
881
|
-
};
|
|
882
|
-
const AvatarGroup = styled(Flex)`
|
|
883
|
-
& > * + * {
|
|
884
|
-
margin-left: -${avatarSize / 2}px;
|
|
1084
|
+
const PreviewImg = styled.img`
|
|
1085
|
+
${imgStyles}
|
|
1086
|
+
`;
|
|
1087
|
+
const Group$2 = React.forwardRef((props, forwarededRef) => {
|
|
1088
|
+
return /* @__PURE__ */ jsx(GroupFlex, { ...props, ref: forwarededRef, tag: "div" });
|
|
1089
|
+
});
|
|
1090
|
+
const GroupFlex = styled(Flex)`
|
|
1091
|
+
& > ${AvatarRoot} + ${AvatarRoot} {
|
|
1092
|
+
margin-left: -${SIZE / 10 / 2}rem;
|
|
885
1093
|
}
|
|
886
1094
|
`;
|
|
1095
|
+
const Avatar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1096
|
+
__proto__: null,
|
|
1097
|
+
Group: Group$2,
|
|
1098
|
+
Item: Item$4
|
|
1099
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
887
1100
|
const Badge = ({
|
|
888
1101
|
active = false,
|
|
889
1102
|
size = "M",
|
|
@@ -953,113 +1166,6 @@ const BaseButtonWrapper = styled(Flex)`
|
|
|
953
1166
|
|
|
954
1167
|
${focus}
|
|
955
1168
|
`;
|
|
956
|
-
function setRef(ref, value) {
|
|
957
|
-
if (typeof ref === "function") {
|
|
958
|
-
ref(value);
|
|
959
|
-
} else if (ref !== null && ref !== void 0) {
|
|
960
|
-
ref.current = value;
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
function composeRefs(...refs) {
|
|
964
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
965
|
-
}
|
|
966
|
-
function useComposedRefs(...refs) {
|
|
967
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
968
|
-
}
|
|
969
|
-
const checkmarkIconDisabled = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='%238E8EA9'%20/%3e%3c/svg%3e";
|
|
970
|
-
const checkmarkIcon = "data:image/svg+xml,%3csvg%20width='10'%20height='8'%20viewBox='0%200%2010%208'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.55323%200.396973C8.63135%200.316355%208.76051%200.315811%208.83931%200.395768L9.86256%201.43407C9.93893%201.51157%209.93935%201.6359%209.86349%201.7139L4.06401%207.67724C3.9859%207.75755%203.85707%207.75805%203.77834%207.67834L0.13866%203.99333C0.0617798%203.91549%200.0617102%203.79032%200.138504%203.7124L1.16213%202.67372C1.24038%202.59432%201.36843%202.59422%201.4468%202.67348L3.92174%205.17647L8.55323%200.396973Z'%20fill='white'%20/%3e%3c/svg%3e";
|
|
971
|
-
const BaseCheckbox = React.forwardRef(
|
|
972
|
-
({ indeterminate = false, name, value = false, onValueChange, ...inputProps }, forwardedRef) => {
|
|
973
|
-
const checkboxRef = React.useRef(null);
|
|
974
|
-
const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
|
|
975
|
-
React.useEffect(() => {
|
|
976
|
-
if (checkboxRef.current && indeterminate) {
|
|
977
|
-
checkboxRef.current.indeterminate = indeterminate;
|
|
978
|
-
} else {
|
|
979
|
-
checkboxRef.current.indeterminate = false;
|
|
980
|
-
}
|
|
981
|
-
}, [indeterminate]);
|
|
982
|
-
const handleValueChange = () => {
|
|
983
|
-
if (onValueChange) {
|
|
984
|
-
onValueChange(!value);
|
|
985
|
-
}
|
|
986
|
-
};
|
|
987
|
-
return /* @__PURE__ */ jsx(
|
|
988
|
-
CheckboxInput,
|
|
989
|
-
{
|
|
990
|
-
checked: value,
|
|
991
|
-
onChange: handleValueChange,
|
|
992
|
-
type: "checkbox",
|
|
993
|
-
ref: composedRefs,
|
|
994
|
-
name,
|
|
995
|
-
...inputProps
|
|
996
|
-
}
|
|
997
|
-
);
|
|
998
|
-
}
|
|
999
|
-
);
|
|
1000
|
-
BaseCheckbox.displayName = "BaseCheckbox";
|
|
1001
|
-
const CheckboxInput = styled.input`
|
|
1002
|
-
min-width: 1.8rem;
|
|
1003
|
-
height: 1.8rem;
|
|
1004
|
-
margin: 0;
|
|
1005
|
-
appearance: none;
|
|
1006
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
1007
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1008
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
1009
|
-
cursor: pointer;
|
|
1010
|
-
|
|
1011
|
-
&:checked {
|
|
1012
|
-
background-color: ${({ theme }) => theme.colors.primary600};
|
|
1013
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
1014
|
-
|
|
1015
|
-
&:after {
|
|
1016
|
-
content: '';
|
|
1017
|
-
display: block;
|
|
1018
|
-
position: relative;
|
|
1019
|
-
background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
|
|
1020
|
-
width: 1rem;
|
|
1021
|
-
height: 1rem;
|
|
1022
|
-
left: 50%;
|
|
1023
|
-
top: 50%;
|
|
1024
|
-
transform: translateX(-50%) translateY(-50%);
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
&:disabled:after {
|
|
1028
|
-
background: ${() => `url("${checkmarkIconDisabled}") no-repeat no-repeat center center`};
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
&:disabled {
|
|
1033
|
-
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1034
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
&:indeterminate {
|
|
1038
|
-
background-color: ${({ theme }) => theme.colors.primary600};
|
|
1039
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
1040
|
-
|
|
1041
|
-
&:after {
|
|
1042
|
-
content: '';
|
|
1043
|
-
display: block;
|
|
1044
|
-
position: relative;
|
|
1045
|
-
color: white;
|
|
1046
|
-
height: 2px;
|
|
1047
|
-
width: 10px;
|
|
1048
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
1049
|
-
left: 50%;
|
|
1050
|
-
top: 50%;
|
|
1051
|
-
transform: translateX(-50%) translateY(-50%);
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
&:disabled {
|
|
1055
|
-
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
1056
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1057
|
-
&:after {
|
|
1058
|
-
background-color: ${({ theme }) => theme.colors.neutral500};
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
`;
|
|
1063
1169
|
const BaseLink = forwardRef(
|
|
1064
1170
|
({ href, rel = "noreferrer noopener", target = "_self", disabled = false, isExternal = false, ...props }, ref) => {
|
|
1065
1171
|
return /* @__PURE__ */ jsx(
|
|
@@ -1077,88 +1183,6 @@ const BaseLink = forwardRef(
|
|
|
1077
1183
|
);
|
|
1078
1184
|
}
|
|
1079
1185
|
);
|
|
1080
|
-
const useReactId = React["useId".toString()] || (() => void 0);
|
|
1081
|
-
let count = 0;
|
|
1082
|
-
const useId = (initialId) => {
|
|
1083
|
-
const [id, setId] = React.useState(useReactId());
|
|
1084
|
-
React.useLayoutEffect(() => {
|
|
1085
|
-
if (!initialId)
|
|
1086
|
-
setId((reactId) => reactId ?? String(count++));
|
|
1087
|
-
}, [initialId]);
|
|
1088
|
-
return initialId?.toString() ?? (id || "");
|
|
1089
|
-
};
|
|
1090
|
-
const setTabIndexOnFirstItem = (node, selector) => {
|
|
1091
|
-
const list = node.querySelectorAll(selector);
|
|
1092
|
-
if (list && list.length > 0) {
|
|
1093
|
-
list.item(0).setAttribute("tabindex", "0");
|
|
1094
|
-
}
|
|
1095
|
-
};
|
|
1096
|
-
const [RadioProvider, useRadioGroup] = createContext("RadioGroup", {
|
|
1097
|
-
onChange: void 0,
|
|
1098
|
-
name: "",
|
|
1099
|
-
selected: ""
|
|
1100
|
-
});
|
|
1101
|
-
const RadioGroup = ({ children, labelledBy, onChange, value = "", name, ...props }) => {
|
|
1102
|
-
const radioGroupRef = React.useRef(null);
|
|
1103
|
-
React.useLayoutEffect(() => {
|
|
1104
|
-
if (!value) {
|
|
1105
|
-
setTabIndexOnFirstItem(radioGroupRef.current, `[name="${name}"]`);
|
|
1106
|
-
}
|
|
1107
|
-
}, [value, name]);
|
|
1108
|
-
return /* @__PURE__ */ jsx(RadioProvider, { onChange, selected: value, name, children: /* @__PURE__ */ jsx("div", { ref: radioGroupRef, role: "radiogroup", "aria-labelledby": labelledBy, ...props, children }) });
|
|
1109
|
-
};
|
|
1110
|
-
const BaseRadio = React.forwardRef(({ value, disabled = false, ...props }, ref) => {
|
|
1111
|
-
const generatedId = useId();
|
|
1112
|
-
const { onChange, selected, name } = useRadioGroup("BaseRadio");
|
|
1113
|
-
const isSelected = selected === value;
|
|
1114
|
-
return /* @__PURE__ */ jsx(
|
|
1115
|
-
RadioInput,
|
|
1116
|
-
{
|
|
1117
|
-
ref,
|
|
1118
|
-
type: "radio",
|
|
1119
|
-
name,
|
|
1120
|
-
value,
|
|
1121
|
-
tabIndex: isSelected ? 0 : -1,
|
|
1122
|
-
"aria-checked": isSelected,
|
|
1123
|
-
checked: isSelected,
|
|
1124
|
-
disabled,
|
|
1125
|
-
id: generatedId,
|
|
1126
|
-
onChange,
|
|
1127
|
-
...props
|
|
1128
|
-
}
|
|
1129
|
-
);
|
|
1130
|
-
});
|
|
1131
|
-
BaseRadio.displayName = "Radio";
|
|
1132
|
-
const RadioInput = styled.input`
|
|
1133
|
-
margin: 0;
|
|
1134
|
-
padding: 0;
|
|
1135
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
1136
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
1137
|
-
border-radius: 50%;
|
|
1138
|
-
height: 1.8rem;
|
|
1139
|
-
width: 1.8rem;
|
|
1140
|
-
|
|
1141
|
-
&:after {
|
|
1142
|
-
border-radius: 50%;
|
|
1143
|
-
content: '';
|
|
1144
|
-
position: relative;
|
|
1145
|
-
z-index: 1;
|
|
1146
|
-
display: block;
|
|
1147
|
-
height: 1rem;
|
|
1148
|
-
width: 1rem;
|
|
1149
|
-
left: 0.3rem;
|
|
1150
|
-
top: 0.3rem;
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
&:checked:after {
|
|
1154
|
-
background: ${({ theme }) => theme.colors.primary600};
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
&:disabled {
|
|
1158
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral300};
|
|
1159
|
-
background: ${({ theme }) => theme.colors.neutral200};
|
|
1160
|
-
}
|
|
1161
|
-
`;
|
|
1162
1186
|
const Divider$1 = () => {
|
|
1163
1187
|
return /* @__PURE__ */ jsx(Box, { "aria-hidden": true, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral500", children: "/" }) });
|
|
1164
1188
|
};
|
|
@@ -1212,6 +1236,18 @@ const StyledLink = styled(BaseLink)`
|
|
|
1212
1236
|
const CrumbLink = ({ children, ...props }) => /* @__PURE__ */ jsx(StyledLink, { ...props, children });
|
|
1213
1237
|
CrumbLink.displayName = "CrumbLink";
|
|
1214
1238
|
const stripReactIdOfColon = (str) => str.replaceAll(":", "");
|
|
1239
|
+
const isSSR = () => typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
|
|
1240
|
+
const useIsomorphicLayoutEffect = isSSR() ? useEffect : useLayoutEffect;
|
|
1241
|
+
const useReactId = React["useId".toString()] || (() => void 0);
|
|
1242
|
+
let count = 0;
|
|
1243
|
+
const useId = (initialId) => {
|
|
1244
|
+
const [id, setId] = React.useState(useReactId());
|
|
1245
|
+
useIsomorphicLayoutEffect(() => {
|
|
1246
|
+
if (!initialId)
|
|
1247
|
+
setId((reactId) => reactId ?? String(count++));
|
|
1248
|
+
}, [initialId]);
|
|
1249
|
+
return initialId?.toString() ?? (id || "");
|
|
1250
|
+
};
|
|
1215
1251
|
const useIntersection = (scrollableAreaRef, callback, { selectorToWatch, skipWhen = false }) => {
|
|
1216
1252
|
const handleIntersection = useCallbackRef(callback);
|
|
1217
1253
|
React.useEffect(() => {
|
|
@@ -1442,9 +1478,16 @@ const ButtonWrapper = styled(BaseButton)`
|
|
|
1442
1478
|
}
|
|
1443
1479
|
|
|
1444
1480
|
${getVariantStyle}
|
|
1481
|
+
|
|
1482
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1483
|
+
transition:
|
|
1484
|
+
${(props) => props.theme.transitions.backgroundColor},
|
|
1485
|
+
${(props) => props.theme.transitions.color},
|
|
1486
|
+
border-color ${(props) => props.theme.motion.timings["200"]} ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
1487
|
+
}
|
|
1445
1488
|
`;
|
|
1446
1489
|
const Link = forwardRef(
|
|
1447
|
-
({ children, href, disabled = false, startIcon, endIcon, isExternal =
|
|
1490
|
+
({ children, href, disabled = false, startIcon, endIcon, isExternal = false, ...props }, ref) => {
|
|
1448
1491
|
return /* @__PURE__ */ jsxs(LinkWrapper$2, { ref, href, disabled, isExternal, ...props, children: [
|
|
1449
1492
|
startIcon,
|
|
1450
1493
|
/* @__PURE__ */ jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", children }),
|
|
@@ -1629,24 +1672,24 @@ const MenuSubContent = React.forwardRef((props, ref) => {
|
|
|
1629
1672
|
}
|
|
1630
1673
|
) }) });
|
|
1631
1674
|
});
|
|
1632
|
-
const Root$
|
|
1633
|
-
const Trigger$
|
|
1634
|
-
const Content$
|
|
1635
|
-
const Item$
|
|
1675
|
+
const Root$7 = MenuRoot;
|
|
1676
|
+
const Trigger$6 = MenuTrigger;
|
|
1677
|
+
const Content$6 = MenuContent;
|
|
1678
|
+
const Item$3 = MenuItem$1;
|
|
1636
1679
|
const Label$1 = MenuLabel;
|
|
1637
1680
|
const SubRoot = MenuSubRoot;
|
|
1638
1681
|
const SubTrigger = MenuSubTrigger;
|
|
1639
1682
|
const SubContent = MenuSubContent;
|
|
1640
1683
|
const Menu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1641
1684
|
__proto__: null,
|
|
1642
|
-
Content: Content$
|
|
1643
|
-
Item: Item$
|
|
1685
|
+
Content: Content$6,
|
|
1686
|
+
Item: Item$3,
|
|
1644
1687
|
Label: Label$1,
|
|
1645
|
-
Root: Root$
|
|
1688
|
+
Root: Root$7,
|
|
1646
1689
|
SubContent,
|
|
1647
1690
|
SubRoot,
|
|
1648
1691
|
SubTrigger,
|
|
1649
|
-
Trigger: Trigger$
|
|
1692
|
+
Trigger: Trigger$6
|
|
1650
1693
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1651
1694
|
const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }) => {
|
|
1652
1695
|
const contentRef = React.useRef(null);
|
|
@@ -1674,12 +1717,12 @@ const SimpleMenu = ({ children, onOpen, onClose, popoverPlacement, onReachEnd, .
|
|
|
1674
1717
|
*/
|
|
1675
1718
|
skipWhen: !internalIsOpen
|
|
1676
1719
|
});
|
|
1677
|
-
return /* @__PURE__ */ jsxs(Root$
|
|
1678
|
-
/* @__PURE__ */ jsx(Trigger$
|
|
1679
|
-
/* @__PURE__ */ jsx(Content$
|
|
1720
|
+
return /* @__PURE__ */ jsxs(Root$7, { onOpenChange: handleOpenChange, children: [
|
|
1721
|
+
/* @__PURE__ */ jsx(Trigger$6, { ...props, children: props.label }),
|
|
1722
|
+
/* @__PURE__ */ jsx(Content$6, { intersectionId, popoverPlacement, children })
|
|
1680
1723
|
] });
|
|
1681
1724
|
};
|
|
1682
|
-
const MenuItem = Item$
|
|
1725
|
+
const MenuItem = Item$3;
|
|
1683
1726
|
const StyledButton = styled(SimpleMenu)`
|
|
1684
1727
|
padding: ${({ theme }) => `${theme.spaces[1]} ${theme.spaces[2]}`};
|
|
1685
1728
|
height: unset;
|
|
@@ -1766,14 +1809,109 @@ const CardBadge = (props) => /* @__PURE__ */ jsx(CardBadgeWrapper, { children: /
|
|
|
1766
1809
|
const CardBody = (props) => {
|
|
1767
1810
|
return /* @__PURE__ */ jsx(Box, { paddingLeft: 3, paddingRight: 3, paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Flex, { ...props, alignItems: "flex-start" }) });
|
|
1768
1811
|
};
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1812
|
+
function setRef(ref, value) {
|
|
1813
|
+
if (typeof ref === "function") {
|
|
1814
|
+
ref(value);
|
|
1815
|
+
} else if (ref !== null && ref !== void 0) {
|
|
1816
|
+
ref.current = value;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
function composeRefs(...refs) {
|
|
1820
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
1821
|
+
}
|
|
1822
|
+
function useComposedRefs(...refs) {
|
|
1823
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
1824
|
+
}
|
|
1825
|
+
const CheckIcon = ({ fill, ...props }) => {
|
|
1826
|
+
const { colors } = useTheme();
|
|
1827
|
+
return /* @__PURE__ */ jsx(
|
|
1828
|
+
Box,
|
|
1829
|
+
{
|
|
1830
|
+
tag: "svg",
|
|
1831
|
+
viewBox: "0 0 10 8",
|
|
1832
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1833
|
+
fill: fill ? colors[fill] : void 0,
|
|
1834
|
+
...props,
|
|
1835
|
+
children: /* @__PURE__ */ jsx("path", { d: "M8.55323 0.396973C8.63135 0.316355 8.76051 0.315811 8.83931 0.395768L9.86256 1.43407C9.93893 1.51157 9.93935 1.6359 9.86349 1.7139L4.06401 7.67724C3.9859 7.75755 3.85707 7.75805 3.77834 7.67834L0.13866 3.99333C0.0617798 3.91549 0.0617102 3.79032 0.138504 3.7124L1.16213 2.67372C1.24038 2.59432 1.36843 2.59422 1.4468 2.67348L3.92174 5.17647L8.55323 0.396973Z" })
|
|
1836
|
+
}
|
|
1837
|
+
);
|
|
1772
1838
|
};
|
|
1773
|
-
const
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
const
|
|
1839
|
+
const CheckboxEl = React.forwardRef(
|
|
1840
|
+
({ defaultChecked, checked: checkedProp, onCheckedChange, ...props }, forwardedRef) => {
|
|
1841
|
+
const checkboxRef = React.useRef(null);
|
|
1842
|
+
const [checked, setChecked] = useControllableState$1({
|
|
1843
|
+
defaultProp: defaultChecked,
|
|
1844
|
+
prop: checkedProp,
|
|
1845
|
+
onChange: onCheckedChange
|
|
1846
|
+
});
|
|
1847
|
+
const composedRefs = useComposedRefs(checkboxRef, forwardedRef);
|
|
1848
|
+
return /* @__PURE__ */ jsx(CheckboxRoot, { ref: composedRefs, checked, onCheckedChange: setChecked, ...props, children: /* @__PURE__ */ jsxs(Checkbox.Indicator, { children: [
|
|
1849
|
+
checked === true ? /* @__PURE__ */ jsx(CheckIcon, { width: "1rem", fill: "neutral0" }) : null,
|
|
1850
|
+
checked === "indeterminate" ? /* @__PURE__ */ jsx(Box, { height: "2px", width: "1rem", background: "neutral0", borderRadius: "1px" }) : null
|
|
1851
|
+
] }) });
|
|
1852
|
+
}
|
|
1853
|
+
);
|
|
1854
|
+
const CheckboxRoot = styled(Checkbox.Root)`
|
|
1855
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
1856
|
+
width: 2rem;
|
|
1857
|
+
height: 2rem;
|
|
1858
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
1859
|
+
border: 1px solid ${(props) => props.theme.colors.neutral300};
|
|
1860
|
+
position: relative;
|
|
1861
|
+
z-index: 0;
|
|
1862
|
+
display: flex;
|
|
1863
|
+
justify-content: center;
|
|
1864
|
+
align-items: center;
|
|
1865
|
+
// this ensures the checkbox is always a square even in flex-containers.
|
|
1866
|
+
flex: 0 0 2rem;
|
|
1867
|
+
|
|
1868
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1869
|
+
transition:
|
|
1870
|
+
border-color ${(props) => props.theme.motion.timings["120"]} ${(props) => props.theme.motion.easings.easeOutQuad},
|
|
1871
|
+
${(props) => props.theme.transitions.backgroundColor};
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
&[data-state='checked'],
|
|
1875
|
+
&[data-state='indeterminate'] {
|
|
1876
|
+
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
1877
|
+
background-color: ${(props) => props.theme.colors.primary600};
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
&[data-disabled] {
|
|
1881
|
+
background-color: ${(props) => props.theme.colors.neutral200};
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
1885
|
+
&::before {
|
|
1886
|
+
content: '';
|
|
1887
|
+
position: absolute;
|
|
1888
|
+
top: 50%;
|
|
1889
|
+
left: 50%;
|
|
1890
|
+
transform: translate(-50%, -50%);
|
|
1891
|
+
width: 100%;
|
|
1892
|
+
height: 100%;
|
|
1893
|
+
min-width: 44px;
|
|
1894
|
+
min-height: 44px;
|
|
1895
|
+
}
|
|
1896
|
+
`;
|
|
1897
|
+
const CheckboxImpl = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
1898
|
+
const labelId = useId(restProps.id);
|
|
1899
|
+
if (!children) {
|
|
1900
|
+
return /* @__PURE__ */ jsx(CheckboxEl, { ref: forwardedRef, ...restProps });
|
|
1901
|
+
}
|
|
1902
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
1903
|
+
/* @__PURE__ */ jsx(CheckboxEl, { id: labelId, ...restProps }),
|
|
1904
|
+
/* @__PURE__ */ jsx(Typography, { tag: "label", textColor: "neutral800", htmlFor: labelId, children })
|
|
1905
|
+
] });
|
|
1906
|
+
});
|
|
1907
|
+
const CardCheckbox = (props) => {
|
|
1908
|
+
const { id } = useCard();
|
|
1909
|
+
return /* @__PURE__ */ jsx(CardActionImpl, { position: "start", children: /* @__PURE__ */ jsx(CheckboxImpl, { "aria-labelledby": `${id}-title`, ...props }) });
|
|
1910
|
+
};
|
|
1911
|
+
const BreakBox = styled(Box)`
|
|
1912
|
+
word-break: break-all;
|
|
1913
|
+
`;
|
|
1914
|
+
const CardContent = ({ children, ...props }) => {
|
|
1777
1915
|
return /* @__PURE__ */ jsx(BreakBox, { ...props, children });
|
|
1778
1916
|
};
|
|
1779
1917
|
const CardHeaderWrapper = styled(Flex)`
|
|
@@ -1849,14 +1987,6 @@ const TooltipImpl = React.forwardRef(
|
|
|
1849
1987
|
);
|
|
1850
1988
|
}
|
|
1851
1989
|
);
|
|
1852
|
-
const fadeIn = keyframes`
|
|
1853
|
-
from {
|
|
1854
|
-
opacity: 0;
|
|
1855
|
-
}
|
|
1856
|
-
to {
|
|
1857
|
-
opacity: 1;
|
|
1858
|
-
}
|
|
1859
|
-
`;
|
|
1860
1990
|
const TooltipContent = styled(Tooltip.Content)`
|
|
1861
1991
|
background-color: ${(props) => props.theme.colors.neutral900};
|
|
1862
1992
|
color: ${(props) => props.theme.colors.neutral0};
|
|
@@ -1868,7 +1998,8 @@ const TooltipContent = styled(Tooltip.Content)`
|
|
|
1868
1998
|
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
1869
1999
|
|
|
1870
2000
|
@media (prefers-reduced-motion: no-preference) {
|
|
1871
|
-
animation: ${fadeIn}
|
|
2001
|
+
animation: ${ANIMATIONS.fadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
2002
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
1872
2003
|
}
|
|
1873
2004
|
`;
|
|
1874
2005
|
const CarouselGrid = styled(Box)`
|
|
@@ -1941,34 +2072,6 @@ const Carousel = React.forwardRef(
|
|
|
1941
2072
|
] }) });
|
|
1942
2073
|
}
|
|
1943
2074
|
);
|
|
1944
|
-
const EASINGS = {
|
|
1945
|
-
easeInSine: "cubic-bezier(0.47, 0, 0.745, 0.715)",
|
|
1946
|
-
easeOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
1947
|
-
easeInOutSine: "cubic-bezier(0.39, 0.575, 0.565, 1)",
|
|
1948
|
-
easeInQuad: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
|
|
1949
|
-
easeOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
1950
|
-
easeInOutQuad: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
1951
|
-
easeInCubic: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
|
|
1952
|
-
easeOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
1953
|
-
easeInOutCubic: "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
1954
|
-
easeInQuart: "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
|
|
1955
|
-
easeOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
1956
|
-
easeInOutQuart: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
1957
|
-
easeInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
|
|
1958
|
-
easeOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
1959
|
-
easeInOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
1960
|
-
easeInExpo: "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
|
|
1961
|
-
easeOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
1962
|
-
easeInOutExpo: "cubic-bezier(0.19, 1, 0.22, 1)",
|
|
1963
|
-
easeInCirc: "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
|
|
1964
|
-
easeOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
1965
|
-
easeInOutCirc: "cubic-bezier(0.075, 0.82, 0.165, 1)",
|
|
1966
|
-
easeInBack: "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
|
|
1967
|
-
easeOutBack: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
1968
|
-
easeInOutBack: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
|
|
1969
|
-
easeInOutFast: "cubic-bezier(1,0,0,1)",
|
|
1970
|
-
authenticMotion: "cubic-bezier(.4,0,.2,1)"
|
|
1971
|
-
};
|
|
1972
2075
|
const sizes = {
|
|
1973
2076
|
accordions: {
|
|
1974
2077
|
S: `4.8rem`,
|
|
@@ -2004,7 +2107,11 @@ const commonTheme = {
|
|
|
2004
2107
|
semiBold: 500,
|
|
2005
2108
|
bold: 600
|
|
2006
2109
|
},
|
|
2007
|
-
|
|
2110
|
+
transitions: TRANSITIONS,
|
|
2111
|
+
motion: {
|
|
2112
|
+
easings: EASINGS,
|
|
2113
|
+
timings: TIMINGS
|
|
2114
|
+
}
|
|
2008
2115
|
};
|
|
2009
2116
|
const lightColorTokenObject = {
|
|
2010
2117
|
color: {
|
|
@@ -2832,7 +2939,7 @@ lodash.exports;
|
|
|
2832
2939
|
}
|
|
2833
2940
|
var runInContext = function runInContext2(context) {
|
|
2834
2941
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
2835
|
-
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function,
|
|
2942
|
+
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError = context.TypeError;
|
|
2836
2943
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
2837
2944
|
var coreJsData = context["__core-js_shared__"];
|
|
2838
2945
|
var funcToString = funcProto.toString;
|
|
@@ -2858,7 +2965,7 @@ lodash.exports;
|
|
|
2858
2965
|
}
|
|
2859
2966
|
}();
|
|
2860
2967
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
2861
|
-
var nativeCeil =
|
|
2968
|
+
var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse;
|
|
2862
2969
|
var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
2863
2970
|
var metaMap = WeakMap && new WeakMap();
|
|
2864
2971
|
var realNames = {};
|
|
@@ -4604,7 +4711,7 @@ lodash.exports;
|
|
|
4604
4711
|
return setWrapToString(result2, func, bitmask);
|
|
4605
4712
|
}
|
|
4606
4713
|
function createRound(methodName) {
|
|
4607
|
-
var func =
|
|
4714
|
+
var func = Math[methodName];
|
|
4608
4715
|
return function(number, precision) {
|
|
4609
4716
|
number = toNumber(number);
|
|
4610
4717
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
@@ -7659,7 +7766,7 @@ const getThemeSize = (type) => {
|
|
|
7659
7766
|
};
|
|
7660
7767
|
const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) => css`
|
|
7661
7768
|
outline: none;
|
|
7662
|
-
box-shadow:
|
|
7769
|
+
box-shadow: none;
|
|
7663
7770
|
transition-property: border-color, box-shadow, fill;
|
|
7664
7771
|
transition-duration: 0.2s;
|
|
7665
7772
|
|
|
@@ -7669,7 +7776,7 @@ const inputFocusStyle = (rootElement = "&") => ({ theme, $hasError = false }) =>
|
|
|
7669
7776
|
}
|
|
7670
7777
|
`;
|
|
7671
7778
|
const [FieldProvider, useField] = createContext("Field", {});
|
|
7672
|
-
const Root$
|
|
7779
|
+
const Root$6 = React.forwardRef(
|
|
7673
7780
|
({ children, name, error = false, hint, id, required = false, ...props }, ref) => {
|
|
7674
7781
|
const generatedId = useId(id);
|
|
7675
7782
|
const [labelNode, setLabelNode] = React.useState();
|
|
@@ -7699,7 +7806,6 @@ const Label = React.forwardRef(({ children, action, ...props }, ref) => {
|
|
|
7699
7806
|
{
|
|
7700
7807
|
ref: composedRefs,
|
|
7701
7808
|
display: "flex",
|
|
7702
|
-
alignItems: "center",
|
|
7703
7809
|
variant: "pi",
|
|
7704
7810
|
textColor: "neutral800",
|
|
7705
7811
|
fontWeight: "bold",
|
|
@@ -7728,6 +7834,7 @@ const Input$2 = React.forwardRef(
|
|
|
7728
7834
|
hasError: hasErrorProp,
|
|
7729
7835
|
required: requiredProp,
|
|
7730
7836
|
className,
|
|
7837
|
+
size = "M",
|
|
7731
7838
|
...props
|
|
7732
7839
|
}, ref) => {
|
|
7733
7840
|
const { id, error, hint, name, required } = useField("Input");
|
|
@@ -7746,10 +7853,6 @@ const Input$2 = React.forwardRef(
|
|
|
7746
7853
|
return /* @__PURE__ */ jsxs(
|
|
7747
7854
|
InputWrapper,
|
|
7748
7855
|
{
|
|
7749
|
-
paddingLeft: 3,
|
|
7750
|
-
paddingRight: 3,
|
|
7751
|
-
paddingTop: 2,
|
|
7752
|
-
paddingBottom: 2,
|
|
7753
7856
|
gap: 2,
|
|
7754
7857
|
justifyContent: "space-between",
|
|
7755
7858
|
$hasError: hasError || hasErrorProp,
|
|
@@ -7763,13 +7866,14 @@ const Input$2 = React.forwardRef(
|
|
|
7763
7866
|
id,
|
|
7764
7867
|
name,
|
|
7765
7868
|
ref,
|
|
7869
|
+
$hasLeftAction: Boolean(startAction),
|
|
7870
|
+
$hasRightAction: Boolean(endAction),
|
|
7871
|
+
$size: size,
|
|
7766
7872
|
"aria-describedby": ariaDescription,
|
|
7767
7873
|
"aria-invalid": hasError || hasErrorProp,
|
|
7768
7874
|
"aria-disabled": disabled,
|
|
7769
7875
|
disabled,
|
|
7770
7876
|
"data-disabled": disabled ? "" : void 0,
|
|
7771
|
-
$hasLeftAction: Boolean(startAction),
|
|
7772
|
-
$hasRightAction: Boolean(endAction),
|
|
7773
7877
|
onChange: handleChange,
|
|
7774
7878
|
"aria-required": required || requiredProp,
|
|
7775
7879
|
...props
|
|
@@ -7794,6 +7898,23 @@ const InputElement = styled.input`
|
|
|
7794
7898
|
width: 100%;
|
|
7795
7899
|
background: inherit;
|
|
7796
7900
|
|
|
7901
|
+
${(props) => {
|
|
7902
|
+
switch (props.$size) {
|
|
7903
|
+
case "S":
|
|
7904
|
+
return css`
|
|
7905
|
+
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7906
|
+
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7907
|
+
padding-block: ${props.theme.spaces[1]};
|
|
7908
|
+
`;
|
|
7909
|
+
default:
|
|
7910
|
+
return css`
|
|
7911
|
+
padding-inline-start: ${props.$hasLeftAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7912
|
+
padding-inline-end: ${props.$hasRightAction ? props.theme.spaces[3] : props.theme.spaces[4]};
|
|
7913
|
+
padding-block: ${props.theme.spaces[2]};
|
|
7914
|
+
`;
|
|
7915
|
+
}
|
|
7916
|
+
}};
|
|
7917
|
+
|
|
7797
7918
|
::placeholder {
|
|
7798
7919
|
color: ${({ theme }) => theme.colors.neutral500};
|
|
7799
7920
|
opacity: 1;
|
|
@@ -7834,7 +7955,7 @@ const Error$1 = () => {
|
|
|
7834
7955
|
}
|
|
7835
7956
|
return /* @__PURE__ */ jsx(Typography, { variant: "pi", tag: "p", id: `${id}-error`, textColor: "danger600", "data-strapi-field-error": true, children: error });
|
|
7836
7957
|
};
|
|
7837
|
-
const Action = React.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7958
|
+
const Action$1 = React.forwardRef(({ label, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7838
7959
|
FieldActionWrapper,
|
|
7839
7960
|
{
|
|
7840
7961
|
justifyContent: "unset",
|
|
@@ -7853,12 +7974,12 @@ const FieldActionWrapper = styled(Flex)`
|
|
|
7853
7974
|
`;
|
|
7854
7975
|
const Field = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7855
7976
|
__proto__: null,
|
|
7856
|
-
Action,
|
|
7977
|
+
Action: Action$1,
|
|
7857
7978
|
Error: Error$1,
|
|
7858
7979
|
Hint,
|
|
7859
7980
|
Input: Input$2,
|
|
7860
7981
|
Label,
|
|
7861
|
-
Root: Root$
|
|
7982
|
+
Root: Root$6,
|
|
7862
7983
|
useField
|
|
7863
7984
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7864
7985
|
const CarouselInput = React.forwardRef(
|
|
@@ -7880,7 +8001,7 @@ const CarouselInput = React.forwardRef(
|
|
|
7880
8001
|
...props
|
|
7881
8002
|
}, forwardedRef) => {
|
|
7882
8003
|
const generatedId = useId(id);
|
|
7883
|
-
return /* @__PURE__ */ jsx(Root$
|
|
8004
|
+
return /* @__PURE__ */ jsx(Root$6, { hint, error, id: generatedId, required, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
|
7884
8005
|
label && /* @__PURE__ */ jsx(Label, { action: labelAction, children: label }),
|
|
7885
8006
|
/* @__PURE__ */ jsx(
|
|
7886
8007
|
Carousel,
|
|
@@ -7944,21 +8065,6 @@ const CarouselSlide = ({ label, children, selected = false, ...props }) => /* @_
|
|
|
7944
8065
|
children
|
|
7945
8066
|
}
|
|
7946
8067
|
);
|
|
7947
|
-
const Checkbox = React.forwardRef(
|
|
7948
|
-
({ children, disabled = false, ...props }, forwardedRef) => {
|
|
7949
|
-
return /* @__PURE__ */ jsxs(CheckboxLabel, { tag: "label", textColor: "neutral800", $disabled: disabled, children: [
|
|
7950
|
-
/* @__PURE__ */ jsx(BaseCheckbox, { ref: forwardedRef, disabled, ...props }),
|
|
7951
|
-
/* @__PURE__ */ jsx(Box, { paddingLeft: 2, children })
|
|
7952
|
-
] });
|
|
7953
|
-
}
|
|
7954
|
-
);
|
|
7955
|
-
const CheckboxLabel = styled(Typography)`
|
|
7956
|
-
display: flex;
|
|
7957
|
-
align-items: flex-start;
|
|
7958
|
-
* {
|
|
7959
|
-
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
7960
|
-
}
|
|
7961
|
-
`;
|
|
7962
8068
|
const loaderSvg = "data:image/svg+xml,%3csvg%20width='63'%20height='63'%20viewBox='0%200%2063%2063'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.5563%2011.9816C39.484%2010.3071%2035.8575%209.29097%2032.3354%209.13521C28.6443%208.92888%2024.8295%209.72318%2021.3336%2011.4129C20.9123%2011.5901%2020.5376%2011.8101%2020.1722%2012.0249L20.0108%2012.1179C19.8774%2012.1951%2019.7441%2012.2724%2019.608%2012.3536C19.3253%2012.5146%2019.0492%2012.6744%2018.7544%2012.8792C18.5463%2013.0329%2018.3395%2013.1759%2018.1301%2013.323C17.5658%2013.7208%2016.9868%2014.1317%2016.4983%2014.5979C14.8476%2015.9524%2013.5571%2017.6075%2012.6071%2018.9214C10.4365%2022.1566%209.08622%2025.9567%208.80702%2029.6143L8.7764%2030.1588C8.73328%2030.9196%208.68476%2031.7057%208.75353%2032.4555C8.76648%2032.6084%208.7661%2032.7638%208.77506%2032.914C8.78895%2033.229%208.80152%2033.5373%208.846%2033.8672L9.07396%2035.4221C9.09756%2035.5764%209.1198%2035.7413%209.1633%2035.9263L9.65919%2037.9272L10.138%2039.2823C10.2729%2039.6673%2010.4158%2040.0751%2010.6%2040.43C12.0292%2043.637%2014.1425%2046.4578%2016.7063%2048.585C19.0508%2050.5296%2021.824%2052.0023%2024.7491%2052.8452L26.2371%2053.2376C26.3781%2053.2693%2026.4926%2053.2889%2026.6031%2053.3058L26.7775%2053.3311C27.0052%2053.3636%2027.2195%2053.3986%2027.4445%2053.435C27.8598%2053.5076%2028.2672%2053.5748%2028.7079%2053.6183L30.5641%2053.7229C30.9516%2053.7249%2031.3352%2053.7068%2031.7081%2053.6874C31.9039%2053.681%2032.0984%2053.6681%2032.3288%2053.662C34.5253%2053.4772%2036.5106%2053.0634%2038.0516%2052.4652C38.1769%2052.4171%2038.3008%2052.3796%2038.4234%2052.3355C38.6727%2052.2499%2038.9259%2052.167%2039.1432%2052.0599L40.8591%2051.2626L42.5702%2050.266C42.9009%2050.0682%2043.0205%2049.6414%2042.8282%2049.2984C42.632%2048.9526%2042.2034%2048.8308%2041.8634%2049.0166L40.1792%2049.9218L38.4995%2050.6224C38.3169%2050.6953%2038.121%2050.7534%2037.9224%2050.8155C37.7838%2050.8489%2037.6518%2050.8983%2037.5012%2050.9408C36.0711%2051.435%2034.2445%2051.7425%2032.244%2051.8346C32.0442%2051.8383%2031.8471%2051.8379%2031.654%2051.8403C31.3051%2051.8414%2030.9602%2051.8451%2030.6392%2051.8305L28.9177%2051.6725C28.5476%2051.619%2028.1695%2051.5427%2027.7848%2051.4678C27.5639%2051.4167%2027.3376%2051.3737%2027.1299%2051.3374L26.9529%2051.2987C26.8704%2051.2834%2026.7772%2051.2667%2026.7333%2051.2543L25.3466%2050.8322C22.7651%2049.9789%2020.33%2048.5729%2018.2942%2046.7557C16.1056%2044.7951%2014.3339%2042.2335%2013.1742%2039.3582C12.0276%2036.6013%2011.5988%2033.2792%2011.9716%2030.0076C12.3145%2027.0213%2013.3948%2024.1635%2015.1858%2021.5083C15.3034%2021.3339%2015.421%2021.1596%2015.5212%2021.0196C16.4309%2019.8688%2017.5408%2018.5589%2018.9483%2017.496C19.3367%2017.1525%2019.7862%2016.856%2020.2611%2016.5478C20.4878%2016.4009%2020.7079%2016.2553%2020.8907%2016.1306C21.0974%2016.0048%2021.3188%2015.8831%2021.5348%2015.7694C21.6761%2015.6975%2021.8162%2015.619%2021.9388%2015.5576L22.1002%2015.4646C22.4002%2015.3037%2022.6749%2015.1546%2022.9908%2015.039L24.1186%2014.5715C24.3399%2014.4844%2024.5718%2014.4159%2024.7997%2014.3447C24.953%2014.2982%2025.0982%2014.2635%2025.2635%2014.2078C25.786%2014.0182%2026.3283%2013.9112%2026.9105%2013.7965C27.117%2013.7571%2027.3302%2013.7163%2027.5608%2013.6585C27.7553%2013.611%2027.9737%2013.5969%2028.2082%2013.5762C28.364%2013.5603%2028.5172%2013.5483%2028.6318%2013.5333C28.7876%2013.5173%2028.9342%2013.5066%2029.0927%2013.4867C29.3285%2013.4555%2029.5456%2013.4347%2029.7494%2013.4337C30.0237%2013.44%2030.2994%2013.4357%2030.5777%2013.4274C31.0811%2013.421%2031.5579%2013.4197%2032.0318%2013.4914C34.9664%2013.7352%2037.7144%2014.6085%2040.2052%2016.0868C42.3489%2017.3655%2044.2716%2019.1525%2045.7607%2021.264C47.0255%2023.0628%2047.9756%2025.0528%2048.4928%2027.0393C48.572%2027.3176%2048.6299%2027.5931%2048.6839%2027.8659C48.7154%2028.0428%2048.7563%2028.2145%2048.7892%2028.3636C48.8037%2028.4541%2048.8208%2028.5406%2048.8445%2028.6258C48.8749%2028.7443%2048.8986%2028.864%2048.9116%2028.9651L48.9793%2029.6047C48.9922%2029.7748%2049.0132%2029.9331%2049.0301%2030.0887C49.0668%2030.3268%2049.0889%2030.5608%2049.0964%2030.7561L49.1083%2031.9001C49.1312%2032.3307%2049.089%2032.7116%2049.0522%2033.0673C49.0384%2033.2598%2049.0126%2033.4443%2049.0123%2033.5824C48.9961%2033.6926%2048.9918%2033.7935%2048.9836%2033.8917C48.9753%2034.0072%2048.9724%2034.1148%2048.9414%2034.2554L48.5449%2036.3059C48.3134%2037.8623%2049.3793%2039.3365%2050.9488%2039.5822C52.0417%2039.7601%2053.1536%2039.2819%2053.7711%2038.3664C54.0063%2038.0176%2054.1604%2037.6257%2054.2227%2037.2064L54.5217%2035.2574C54.5514%2035.0756%2054.572%2034.83%2054.5846%2034.5791L54.6028%2034.2338C54.6098%2034.0598%2054.6223%2033.8779%2054.6347%2033.6788C54.6734%2033.1052%2054.7163%2032.4479%2054.6619%2031.8058L54.5867%2030.4289C54.5622%2030.0952%2054.5097%2029.76%2054.4559%2029.4181C54.431%2029.2572%2054.4048%2029.0896%2054.3826%2028.9074L54.2687%2028.104C54.2332%2027.9244%2054.1804%2027.7273%2054.1329%2027.5396L54.0643%2027.2454C54.0195%2027.071%2053.9773%2026.8927%2053.9338%2026.7076C53.8455%2026.3309%2053.7479%2025.9422%2053.613%2025.5571C52.84%2023.0292%2051.5383%2020.5194%2049.8338%2018.2799C47.8544%2015.682%2045.3333%2013.5087%2042.5563%2011.9816Z'%20fill='%234945FF'/%3e%3c/svg%3e";
|
|
7963
8069
|
const Loader = React.forwardRef(({ children, small = false, ...props }, ref) => {
|
|
7964
8070
|
return /* @__PURE__ */ jsxs("div", { role: "alert", "aria-live": "assertive", ref, ...props, children: [
|
|
@@ -8012,6 +8118,7 @@ const Combobox = React.forwardRef(
|
|
|
8012
8118
|
onLoadMore,
|
|
8013
8119
|
placeholder = "Select or enter a value",
|
|
8014
8120
|
required: requiredProp = false,
|
|
8121
|
+
size = "M",
|
|
8015
8122
|
startIcon,
|
|
8016
8123
|
textValue,
|
|
8017
8124
|
value,
|
|
@@ -8111,9 +8218,9 @@ const Combobox = React.forwardRef(
|
|
|
8111
8218
|
onFilterValueChange: handleFilterValueChange,
|
|
8112
8219
|
isPrintableCharacter: isPrintableCharacter2,
|
|
8113
8220
|
children: [
|
|
8114
|
-
/* @__PURE__ */ jsxs(Trigger$
|
|
8221
|
+
/* @__PURE__ */ jsxs(Trigger$5, { $hasError: hasError, $size: size, className, children: [
|
|
8115
8222
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
8116
|
-
startIcon ? /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8223
|
+
startIcon ? /* @__PURE__ */ jsx(Box, { flex: "0 0 1.6rem", tag: "span", "aria-hidden": true, children: startIcon }) : null,
|
|
8117
8224
|
/* @__PURE__ */ jsx(
|
|
8118
8225
|
TextInput$1,
|
|
8119
8226
|
{
|
|
@@ -8150,7 +8257,7 @@ const Combobox = React.forwardRef(
|
|
|
8150
8257
|
/* @__PURE__ */ jsx(DownIcon$1, { children: /* @__PURE__ */ jsx(CaretDown, {}) })
|
|
8151
8258
|
] })
|
|
8152
8259
|
] }),
|
|
8153
|
-
/* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$
|
|
8260
|
+
/* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Content$5, { sideOffset: 4, children: /* @__PURE__ */ jsxs(Viewport$1, { ref: viewportRef, children: [
|
|
8154
8261
|
children,
|
|
8155
8262
|
creatable ? /* @__PURE__ */ jsx(
|
|
8156
8263
|
Combobox$1.CreateItem,
|
|
@@ -8173,13 +8280,9 @@ const Combobox = React.forwardRef(
|
|
|
8173
8280
|
const IconBox$3 = styled(Box)`
|
|
8174
8281
|
padding: 0;
|
|
8175
8282
|
`;
|
|
8176
|
-
const Trigger$
|
|
8283
|
+
const Trigger$5 = styled(Combobox$1.Trigger)`
|
|
8177
8284
|
position: relative;
|
|
8178
8285
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
8179
|
-
padding-right: ${({ theme }) => theme.spaces[3]};
|
|
8180
|
-
padding-left: ${({ theme }) => theme.spaces[3]};
|
|
8181
|
-
padding-top: ${({ theme }) => theme.spaces[2]};
|
|
8182
|
-
padding-bottom: ${({ theme }) => theme.spaces[2]};
|
|
8183
8286
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
8184
8287
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
8185
8288
|
overflow: hidden;
|
|
@@ -8188,6 +8291,23 @@ const Trigger$1 = styled(Combobox$1.Trigger)`
|
|
|
8188
8291
|
justify-content: space-between;
|
|
8189
8292
|
gap: ${({ theme }) => theme.spaces[4]};
|
|
8190
8293
|
|
|
8294
|
+
${(props) => {
|
|
8295
|
+
switch (props.$size) {
|
|
8296
|
+
case "S":
|
|
8297
|
+
return css`
|
|
8298
|
+
padding-inline-start: ${({ theme }) => theme.spaces[4]};
|
|
8299
|
+
padding-inline-end: ${({ theme }) => theme.spaces[3]};
|
|
8300
|
+
padding-block: ${({ theme }) => theme.spaces[1]};
|
|
8301
|
+
`;
|
|
8302
|
+
default:
|
|
8303
|
+
return css`
|
|
8304
|
+
padding-inline-start: ${({ theme }) => theme.spaces[4]};
|
|
8305
|
+
padding-inline-end: ${({ theme }) => theme.spaces[3]};
|
|
8306
|
+
padding-block: ${({ theme }) => theme.spaces[2]};
|
|
8307
|
+
`;
|
|
8308
|
+
}
|
|
8309
|
+
}}
|
|
8310
|
+
|
|
8191
8311
|
&[data-disabled] {
|
|
8192
8312
|
color: ${({ theme }) => theme.colors.neutral600};
|
|
8193
8313
|
background: ${({ theme }) => theme.colors.neutral150};
|
|
@@ -8228,7 +8348,7 @@ const DownIcon$1 = styled(Combobox$1.Icon)`
|
|
|
8228
8348
|
cursor: inherit;
|
|
8229
8349
|
}
|
|
8230
8350
|
`;
|
|
8231
|
-
const Content$
|
|
8351
|
+
const Content$5 = styled(Combobox$1.Content)`
|
|
8232
8352
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
8233
8353
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
8234
8354
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
@@ -8237,6 +8357,23 @@ const Content$2 = styled(Combobox$1.Content)`
|
|
|
8237
8357
|
/* This is from the design-system figma file. */
|
|
8238
8358
|
max-height: 15rem;
|
|
8239
8359
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8360
|
+
|
|
8361
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8362
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
8363
|
+
|
|
8364
|
+
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
8365
|
+
&[data-state='open'] {
|
|
8366
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8367
|
+
|
|
8368
|
+
&[data-side='top'] {
|
|
8369
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8370
|
+
}
|
|
8371
|
+
|
|
8372
|
+
&[data-side='bottom'] {
|
|
8373
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8374
|
+
}
|
|
8375
|
+
}
|
|
8376
|
+
}
|
|
8240
8377
|
`;
|
|
8241
8378
|
const Viewport$1 = styled(Combobox$1.Viewport)`
|
|
8242
8379
|
padding: ${({ theme }) => theme.spaces[1]};
|
|
@@ -8273,168 +8410,135 @@ const OptionBox = styled.div`
|
|
|
8273
8410
|
font-weight: bold;
|
|
8274
8411
|
}
|
|
8275
8412
|
`;
|
|
8276
|
-
const
|
|
8277
|
-
const
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
const nodes = [
|
|
8290
|
-
...node.querySelectorAll(
|
|
8291
|
-
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
8292
|
-
)
|
|
8293
|
-
];
|
|
8294
|
-
const focusables = nodes.filter((node2) => {
|
|
8295
|
-
if (node2.hasAttribute("disabled"))
|
|
8296
|
-
return false;
|
|
8297
|
-
if (includeNegativeTabIndex)
|
|
8298
|
-
return true;
|
|
8299
|
-
return node2.getAttribute("tabindex") !== "-1";
|
|
8300
|
-
});
|
|
8301
|
-
return focusables;
|
|
8302
|
-
};
|
|
8303
|
-
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
8304
|
-
return nodes.filter((node) => {
|
|
8305
|
-
if (node.tagName === "INPUT") {
|
|
8306
|
-
return node.type !== "checkbox" && node.type !== "radio";
|
|
8307
|
-
}
|
|
8308
|
-
return false;
|
|
8309
|
-
});
|
|
8310
|
-
};
|
|
8311
|
-
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
8312
|
-
const trappedRef = React.useRef(null);
|
|
8313
|
-
React.useEffect(() => {
|
|
8314
|
-
let currentFocus = null;
|
|
8315
|
-
if (restoreFocus) {
|
|
8316
|
-
currentFocus = document.activeElement;
|
|
8317
|
-
}
|
|
8318
|
-
return () => {
|
|
8319
|
-
if (currentFocus) {
|
|
8320
|
-
currentFocus.focus();
|
|
8321
|
-
}
|
|
8322
|
-
};
|
|
8323
|
-
}, [restoreFocus]);
|
|
8324
|
-
React.useEffect(() => {
|
|
8325
|
-
if (!trappedRef.current || skipAutoFocus)
|
|
8326
|
-
return;
|
|
8327
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
8328
|
-
if (focusableChildren.length > 0) {
|
|
8329
|
-
const firstElement = focusableChildren[0];
|
|
8330
|
-
firstElement.focus();
|
|
8331
|
-
} else {
|
|
8332
|
-
console.warn(
|
|
8333
|
-
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
8334
|
-
);
|
|
8335
|
-
}
|
|
8336
|
-
}, [skipAutoFocus]);
|
|
8337
|
-
const handleKeyDown = (e) => {
|
|
8338
|
-
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
8339
|
-
onEscape();
|
|
8340
|
-
return;
|
|
8341
|
-
}
|
|
8342
|
-
if (e.key !== KeyboardKeys.TAB)
|
|
8343
|
-
return;
|
|
8344
|
-
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
8345
|
-
if (focusableChildren.length > 0) {
|
|
8346
|
-
const firstElement = focusableChildren[0];
|
|
8347
|
-
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
8348
|
-
if (e.shiftKey) {
|
|
8349
|
-
if (firstElement === document.activeElement) {
|
|
8350
|
-
e.preventDefault();
|
|
8351
|
-
lastElement.focus();
|
|
8352
|
-
}
|
|
8353
|
-
} else if (lastElement === document.activeElement) {
|
|
8354
|
-
e.preventDefault();
|
|
8355
|
-
firstElement.focus();
|
|
8356
|
-
}
|
|
8357
|
-
}
|
|
8358
|
-
};
|
|
8359
|
-
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
8360
|
-
};
|
|
8361
|
-
const Portal$1 = React.forwardRef(
|
|
8362
|
-
({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
|
|
8363
|
-
return container ? createPortal(/* @__PURE__ */ jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
|
|
8364
|
-
}
|
|
8365
|
-
);
|
|
8366
|
-
Portal$1.displayName = "Portal";
|
|
8367
|
-
const DialogWrapper = styled(Box)`
|
|
8413
|
+
const Root$5 = AlertDialog.Root;
|
|
8414
|
+
const Trigger$4 = React.forwardRef((props, forwardedRef) => {
|
|
8415
|
+
return /* @__PURE__ */ jsx(AlertDialog.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
8416
|
+
});
|
|
8417
|
+
const Content$4 = React.forwardRef((props, forwardedRef) => {
|
|
8418
|
+
return /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [
|
|
8419
|
+
/* @__PURE__ */ jsx(Overlay$1, {}),
|
|
8420
|
+
/* @__PURE__ */ jsx(ContentImpl$1, { ref: forwardedRef, ...props })
|
|
8421
|
+
] });
|
|
8422
|
+
});
|
|
8423
|
+
const Overlay$1 = styled(AlertDialog.Overlay)`
|
|
8424
|
+
background-color: ${(props) => props.theme.colors.neutral800};
|
|
8425
|
+
position: fixed;
|
|
8368
8426
|
inset: 0;
|
|
8369
|
-
|
|
8427
|
+
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
8428
|
+
opacity: 0.2;
|
|
8429
|
+
|
|
8430
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8431
|
+
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
8432
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
8433
|
+
}
|
|
8370
8434
|
`;
|
|
8371
|
-
const
|
|
8372
|
-
max-width:
|
|
8373
|
-
|
|
8435
|
+
const ContentImpl$1 = styled(AlertDialog.Content)`
|
|
8436
|
+
max-width: 42rem;
|
|
8437
|
+
height: min-content;
|
|
8438
|
+
width: 100%;
|
|
8374
8439
|
overflow: hidden;
|
|
8375
|
-
margin
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
}
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
shadow: "popupShadow",
|
|
8395
|
-
role: "dialog",
|
|
8396
|
-
children: [
|
|
8397
|
-
/* @__PURE__ */ jsx(DialogHeader, { padding: 6, justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "beta", as, id: labelledBy, children: title }) }),
|
|
8398
|
-
/* @__PURE__ */ jsx(Box, { ...props })
|
|
8399
|
-
]
|
|
8440
|
+
margin: 0 auto;
|
|
8441
|
+
display: flex;
|
|
8442
|
+
flex-direction: column;
|
|
8443
|
+
|
|
8444
|
+
position: fixed;
|
|
8445
|
+
top: 50%;
|
|
8446
|
+
left: 50%;
|
|
8447
|
+
transform: translate(-50%, -50%);
|
|
8448
|
+
|
|
8449
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
8450
|
+
background-color: ${(props) => props.theme.colors.neutral0};
|
|
8451
|
+
box-shadow: ${(props) => props.theme.shadows.popupShadow};
|
|
8452
|
+
z-index: ${(props) => props.theme.zIndices.modal};
|
|
8453
|
+
|
|
8454
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8455
|
+
&[data-state='open'] {
|
|
8456
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
8457
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8458
|
+
animation-name: ${ANIMATIONS.modalPopIn};
|
|
8400
8459
|
}
|
|
8401
|
-
) }) }) }) });
|
|
8402
|
-
};
|
|
8403
|
-
const IconContainer = styled(Box)`
|
|
8404
|
-
svg {
|
|
8405
|
-
width: ${({ theme }) => theme.spaces[6]};
|
|
8406
|
-
height: ${({ theme }) => theme.spaces[6]};
|
|
8407
8460
|
|
|
8408
|
-
|
|
8409
|
-
|
|
8461
|
+
&[data-state='closed'] {
|
|
8462
|
+
animation-duration: ${(props) => props.theme.motion.timings["120"]};
|
|
8463
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
8464
|
+
animation-name: ${ANIMATIONS.modalPopOut};
|
|
8410
8465
|
}
|
|
8411
8466
|
}
|
|
8412
8467
|
`;
|
|
8413
|
-
const
|
|
8414
|
-
return /* @__PURE__ */
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
}
|
|
8468
|
+
const Header$1 = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
8469
|
+
return /* @__PURE__ */ jsx(AlertDialog.Title, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
8470
|
+
Title$1,
|
|
8471
|
+
{
|
|
8472
|
+
tag: "h2",
|
|
8473
|
+
ref: forwardedRef,
|
|
8474
|
+
padding: 6,
|
|
8475
|
+
justifyContent: "center",
|
|
8476
|
+
variant: "h2",
|
|
8477
|
+
fontWeight: "bold",
|
|
8478
|
+
...restProps,
|
|
8479
|
+
children
|
|
8480
|
+
}
|
|
8481
|
+
) });
|
|
8482
|
+
});
|
|
8483
|
+
const Title$1 = styled(Typography)`
|
|
8484
|
+
display: flex;
|
|
8485
|
+
justify-content: center;
|
|
8486
|
+
border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
8427
8487
|
`;
|
|
8428
|
-
const
|
|
8429
|
-
return /* @__PURE__ */ jsx(
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8488
|
+
const Body$1 = React.forwardRef(({ children, icon, ...restProps }, forwardedRef) => {
|
|
8489
|
+
return /* @__PURE__ */ jsx(
|
|
8490
|
+
Flex,
|
|
8491
|
+
{
|
|
8492
|
+
ref: forwardedRef,
|
|
8493
|
+
gap: 2,
|
|
8494
|
+
direction: "column",
|
|
8495
|
+
paddingTop: 8,
|
|
8496
|
+
paddingBottom: 8,
|
|
8497
|
+
paddingLeft: 6,
|
|
8498
|
+
paddingRight: 6,
|
|
8499
|
+
...restProps,
|
|
8500
|
+
children: typeof children === "string" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8501
|
+
icon ? React.cloneElement(icon, {
|
|
8502
|
+
width: 24,
|
|
8503
|
+
height: 24
|
|
8504
|
+
}) : null,
|
|
8505
|
+
/* @__PURE__ */ jsx(Description, { children })
|
|
8506
|
+
] }) : children
|
|
8507
|
+
}
|
|
8508
|
+
);
|
|
8509
|
+
});
|
|
8510
|
+
const Description = React.forwardRef((props, forwardedRef) => {
|
|
8511
|
+
return /* @__PURE__ */ jsx(AlertDialog.Description, { asChild: true, children: /* @__PURE__ */ jsx(Typography, { ref: forwardedRef, variant: "omega", ...props, tag: "p" }) });
|
|
8512
|
+
});
|
|
8513
|
+
const Footer$1 = React.forwardRef((props, forwardedRef) => {
|
|
8514
|
+
return /* @__PURE__ */ jsx(Foot$1, { ref: forwardedRef, gap: 2, padding: 4, justifyContent: "space-between", ...props, tag: "footer" });
|
|
8515
|
+
});
|
|
8516
|
+
const Foot$1 = styled(Flex)`
|
|
8517
|
+
border-top: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
8518
|
+
flex: 1;
|
|
8519
|
+
`;
|
|
8520
|
+
const Cancel = React.forwardRef((props, forwardedRef) => {
|
|
8521
|
+
return /* @__PURE__ */ jsx(AlertDialog.Cancel, { ...props, asChild: true, ref: forwardedRef });
|
|
8522
|
+
});
|
|
8523
|
+
const Action = React.forwardRef((props, forwardedRef) => {
|
|
8524
|
+
return /* @__PURE__ */ jsx(AlertDialog.Action, { ...props, asChild: true, ref: forwardedRef });
|
|
8525
|
+
});
|
|
8526
|
+
const Dialog = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8527
|
+
__proto__: null,
|
|
8528
|
+
Action,
|
|
8529
|
+
Body: Body$1,
|
|
8530
|
+
Cancel,
|
|
8531
|
+
Content: Content$4,
|
|
8532
|
+
Description,
|
|
8533
|
+
Footer: Footer$1,
|
|
8534
|
+
Header: Header$1,
|
|
8535
|
+
Root: Root$5,
|
|
8536
|
+
Trigger: Trigger$4
|
|
8537
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
8538
|
+
let $3db38b7d1fb3fe6a$var$count = 0;
|
|
8539
|
+
function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
8540
|
+
useEffect(() => {
|
|
8541
|
+
var _edgeGuards$, _edgeGuards$2;
|
|
8438
8542
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
8439
8543
|
document.body.insertAdjacentElement("afterbegin", (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
8440
8544
|
document.body.insertAdjacentElement("beforeend", (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
@@ -8455,47 +8559,6 @@ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
|
8455
8559
|
element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
|
|
8456
8560
|
return element;
|
|
8457
8561
|
}
|
|
8458
|
-
function useControllableState({
|
|
8459
|
-
prop,
|
|
8460
|
-
defaultProp,
|
|
8461
|
-
onChange = () => {
|
|
8462
|
-
}
|
|
8463
|
-
}) {
|
|
8464
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
8465
|
-
const isControlled = prop !== void 0;
|
|
8466
|
-
const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
|
|
8467
|
-
const value = isControlled ? propValue : uncontrolledProp;
|
|
8468
|
-
const handleChange = useCallbackRef(onChange);
|
|
8469
|
-
const setValue = React.useCallback(
|
|
8470
|
-
(nextValue) => {
|
|
8471
|
-
if (isControlled) {
|
|
8472
|
-
const setter = nextValue;
|
|
8473
|
-
const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
|
|
8474
|
-
if (value2 !== propValue) {
|
|
8475
|
-
handleChange(value2);
|
|
8476
|
-
setUncontrolledProp(nextValue);
|
|
8477
|
-
}
|
|
8478
|
-
} else {
|
|
8479
|
-
setUncontrolledProp(nextValue);
|
|
8480
|
-
}
|
|
8481
|
-
},
|
|
8482
|
-
[isControlled, propValue, setUncontrolledProp, handleChange]
|
|
8483
|
-
);
|
|
8484
|
-
return [value, setValue];
|
|
8485
|
-
}
|
|
8486
|
-
function useUncontrolledState({ defaultProp, onChange }) {
|
|
8487
|
-
const uncontrolledState = React.useState(defaultProp);
|
|
8488
|
-
const [value] = uncontrolledState;
|
|
8489
|
-
const prevValueRef = React.useRef(value);
|
|
8490
|
-
const handleChange = useCallbackRef(onChange);
|
|
8491
|
-
React.useEffect(() => {
|
|
8492
|
-
if (prevValueRef.current !== value) {
|
|
8493
|
-
handleChange(value);
|
|
8494
|
-
prevValueRef.current = value;
|
|
8495
|
-
}
|
|
8496
|
-
}, [value, prevValueRef, handleChange]);
|
|
8497
|
-
return uncontrolledState;
|
|
8498
|
-
}
|
|
8499
8562
|
function useDateFormatter(locale, options) {
|
|
8500
8563
|
const lastOptions = React.useRef(null);
|
|
8501
8564
|
if (options && lastOptions.current && isEqual(options, lastOptions.current)) {
|
|
@@ -8672,14 +8735,40 @@ const DesignSystemProvider = ({
|
|
|
8672
8735
|
theme = lightTheme,
|
|
8673
8736
|
tooltipConfig
|
|
8674
8737
|
}) => {
|
|
8738
|
+
useIsomorphicLayoutEffect(() => {
|
|
8739
|
+
const css2 = document.createElement("style");
|
|
8740
|
+
css2.type = "text/css";
|
|
8741
|
+
css2.appendChild(
|
|
8742
|
+
document.createTextNode(`
|
|
8743
|
+
* {
|
|
8744
|
+
-webkit-transition: none !important;
|
|
8745
|
+
-moz-transition: none !important;
|
|
8746
|
+
-o-transition: none !important;
|
|
8747
|
+
-ms-transition: none !important;
|
|
8748
|
+
transition: none !important;
|
|
8749
|
+
animation: none !important;
|
|
8750
|
+
}
|
|
8751
|
+
`)
|
|
8752
|
+
);
|
|
8753
|
+
document.head.appendChild(css2);
|
|
8754
|
+
window.getComputedStyle(css2).opacity;
|
|
8755
|
+
document.head.removeChild(css2);
|
|
8756
|
+
}, [theme]);
|
|
8675
8757
|
return /* @__PURE__ */ jsx(Provider, { locale, children: /* @__PURE__ */ jsxs(ThemeProvider, { theme, children: [
|
|
8676
8758
|
/* @__PURE__ */ jsx(Provider$1, { ...tooltipConfig, children }),
|
|
8677
8759
|
/* @__PURE__ */ jsx(LiveRegions, {}),
|
|
8678
8760
|
/* @__PURE__ */ jsx(GlobalStyle, {})
|
|
8679
8761
|
] }) });
|
|
8680
8762
|
};
|
|
8763
|
+
const DismissibleLayer = DismissibleLayerPrimitive.Root;
|
|
8764
|
+
const Portal$1 = React.forwardRef(
|
|
8765
|
+
({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
|
|
8766
|
+
return container ? createPortal(/* @__PURE__ */ jsx(Box, { ref: forwardedRef, ...portalProps }), container) : null;
|
|
8767
|
+
}
|
|
8768
|
+
);
|
|
8769
|
+
Portal$1.displayName = "Portal";
|
|
8681
8770
|
const SelectTrigger = React.forwardRef(
|
|
8682
|
-
({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, ...restProps }, ref) => {
|
|
8771
|
+
({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, size = "M", withTags, ...restProps }, ref) => {
|
|
8683
8772
|
const triggerRef = React.useRef(null);
|
|
8684
8773
|
const handleClearClick = (e) => {
|
|
8685
8774
|
if (onClear && !disabled) {
|
|
@@ -8701,13 +8790,11 @@ const SelectTrigger = React.forwardRef(
|
|
|
8701
8790
|
overflow: "hidden",
|
|
8702
8791
|
hasRadius: true,
|
|
8703
8792
|
background: disabled ? "neutral150" : "neutral0",
|
|
8704
|
-
paddingLeft: 3,
|
|
8705
|
-
paddingRight: 3,
|
|
8706
|
-
paddingTop: 2,
|
|
8707
|
-
paddingBottom: 2,
|
|
8708
8793
|
gap: 4,
|
|
8709
8794
|
cursor: "default",
|
|
8710
8795
|
"aria-labelledby": labelNode ? `${id}-label` : void 0,
|
|
8796
|
+
$size: size,
|
|
8797
|
+
$withTags: withTags,
|
|
8711
8798
|
...restProps,
|
|
8712
8799
|
children: [
|
|
8713
8800
|
/* @__PURE__ */ jsxs(Flex, { flex: "1", tag: "span", gap: 3, children: [
|
|
@@ -8752,6 +8839,22 @@ const IconBox$2 = styled(Box)`
|
|
|
8752
8839
|
`;
|
|
8753
8840
|
const StyledTrigger = styled(Flex)`
|
|
8754
8841
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
8842
|
+
${(props) => {
|
|
8843
|
+
switch (props.$size) {
|
|
8844
|
+
case "S":
|
|
8845
|
+
return css`
|
|
8846
|
+
padding-block: ${props.theme.spaces[1]};
|
|
8847
|
+
padding-inline-start: ${props.$withTags ? props.theme.spaces[1] : props.theme.spaces[4]};
|
|
8848
|
+
padding-inline-end: ${props.theme.spaces[3]};
|
|
8849
|
+
`;
|
|
8850
|
+
default:
|
|
8851
|
+
return css`
|
|
8852
|
+
padding-block: ${props.$withTags ? "0.3rem" : props.theme.spaces[2]};
|
|
8853
|
+
padding-inline-start: ${props.$withTags ? props.theme.spaces[1] : props.theme.spaces[4]};
|
|
8854
|
+
padding-inline-end: ${props.theme.spaces[3]};
|
|
8855
|
+
`;
|
|
8856
|
+
}
|
|
8857
|
+
}}
|
|
8755
8858
|
|
|
8756
8859
|
&[aria-disabled='true'] {
|
|
8757
8860
|
color: ${(props) => props.theme.colors.neutral600};
|
|
@@ -8789,6 +8892,23 @@ const SelectContent = styled(Select.Content)`
|
|
|
8789
8892
|
/* This is from the design-system figma file. */
|
|
8790
8893
|
max-height: 15rem;
|
|
8791
8894
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
8895
|
+
|
|
8896
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
8897
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
8898
|
+
|
|
8899
|
+
/* The select can't animate out yet, watch https://github.com/radix-ui/primitives/issues/1893, or take a look and solve it yourself. */
|
|
8900
|
+
&[data-state='open'] {
|
|
8901
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
8902
|
+
|
|
8903
|
+
&[data-side='top'] {
|
|
8904
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
8905
|
+
}
|
|
8906
|
+
|
|
8907
|
+
&[data-side='bottom'] {
|
|
8908
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
8909
|
+
}
|
|
8910
|
+
}
|
|
8911
|
+
}
|
|
8792
8912
|
`;
|
|
8793
8913
|
const SelectViewport = styled(Select.Viewport)`
|
|
8794
8914
|
padding: ${({ theme }) => theme.spaces[1]};
|
|
@@ -8808,6 +8928,7 @@ const itemStyles = css`
|
|
|
8808
8928
|
gap: ${({ theme }) => theme.spaces[2]};
|
|
8809
8929
|
white-space: nowrap;
|
|
8810
8930
|
user-select: none;
|
|
8931
|
+
color: ${({ theme }) => theme.colors.neutral800};
|
|
8811
8932
|
|
|
8812
8933
|
&:focus-visible {
|
|
8813
8934
|
outline: none;
|
|
@@ -8823,19 +8944,21 @@ const StyledSelectItem = styled(Select.Item)`
|
|
|
8823
8944
|
|
|
8824
8945
|
&[data-state='checked'] {
|
|
8825
8946
|
font-weight: bold;
|
|
8947
|
+
background-color: ${({ theme }) => theme.colors.primary100};
|
|
8826
8948
|
color: ${({ theme }) => theme.colors.primary600};
|
|
8949
|
+
font-weight: bold;
|
|
8827
8950
|
}
|
|
8828
8951
|
`;
|
|
8829
|
-
const Root = Select.Root;
|
|
8830
|
-
const Trigger = SelectTrigger;
|
|
8952
|
+
const Root$4 = Select.Root;
|
|
8953
|
+
const Trigger$3 = SelectTrigger;
|
|
8831
8954
|
const Value = SelectValue;
|
|
8832
8955
|
const Portal = Select.Portal;
|
|
8833
|
-
const Content$
|
|
8956
|
+
const Content$3 = SelectContent;
|
|
8834
8957
|
const Viewport = SelectViewport;
|
|
8835
|
-
const Item = SelectItem;
|
|
8958
|
+
const Item$2 = SelectItem;
|
|
8836
8959
|
const ItemIndicator = Select.ItemIndicator;
|
|
8837
8960
|
const ItemText = Select.ItemText;
|
|
8838
|
-
const Group = Select.Group;
|
|
8961
|
+
const Group$1 = Select.Group;
|
|
8839
8962
|
const SingleSelect = React.forwardRef(
|
|
8840
8963
|
({
|
|
8841
8964
|
children,
|
|
@@ -8851,6 +8974,7 @@ const SingleSelect = React.forwardRef(
|
|
|
8851
8974
|
onReachEnd,
|
|
8852
8975
|
placeholder,
|
|
8853
8976
|
required: requiredProp,
|
|
8977
|
+
size,
|
|
8854
8978
|
startIcon,
|
|
8855
8979
|
value: passedValue,
|
|
8856
8980
|
...restProps
|
|
@@ -8904,7 +9028,7 @@ const SingleSelect = React.forwardRef(
|
|
|
8904
9028
|
}
|
|
8905
9029
|
const value = (typeof passedValue !== "undefined" && passedValue !== null ? passedValue.toString() : internalValue) ?? "";
|
|
8906
9030
|
return /* @__PURE__ */ jsxs(
|
|
8907
|
-
Root,
|
|
9031
|
+
Root$4,
|
|
8908
9032
|
{
|
|
8909
9033
|
onOpenChange: handleOpenChange,
|
|
8910
9034
|
disabled,
|
|
@@ -8914,7 +9038,7 @@ const SingleSelect = React.forwardRef(
|
|
|
8914
9038
|
...restProps,
|
|
8915
9039
|
children: [
|
|
8916
9040
|
/* @__PURE__ */ jsx(
|
|
8917
|
-
Trigger,
|
|
9041
|
+
Trigger$3,
|
|
8918
9042
|
{
|
|
8919
9043
|
ref: forwardedRef,
|
|
8920
9044
|
id,
|
|
@@ -8926,10 +9050,11 @@ const SingleSelect = React.forwardRef(
|
|
|
8926
9050
|
onClear: value && onClear ? handleOnClear : void 0,
|
|
8927
9051
|
"aria-label": restProps["aria-label"],
|
|
8928
9052
|
"aria-describedby": ariaDescription ?? restProps["aria-describedby"],
|
|
9053
|
+
size,
|
|
8929
9054
|
children: /* @__PURE__ */ jsx(Value, { placeholder, textColor: value ? "neutral800" : "neutral600", children: value && customizeContent ? customizeContent(value) : void 0 })
|
|
8930
9055
|
}
|
|
8931
9056
|
),
|
|
8932
|
-
/* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$
|
|
9057
|
+
/* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxs(Viewport, { ref: viewportRef, children: [
|
|
8933
9058
|
children,
|
|
8934
9059
|
/* @__PURE__ */ jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
|
|
8935
9060
|
] }) }) })
|
|
@@ -8940,9 +9065,9 @@ const SingleSelect = React.forwardRef(
|
|
|
8940
9065
|
);
|
|
8941
9066
|
const SingleSelectOption = React.forwardRef(
|
|
8942
9067
|
({ value, startIcon, children, ...restProps }, ref) => {
|
|
8943
|
-
return /* @__PURE__ */ jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
|
|
9068
|
+
return /* @__PURE__ */ jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
8944
9069
|
startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
8945
|
-
/* @__PURE__ */ jsx(Typography, {
|
|
9070
|
+
/* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(ItemText, { children }) })
|
|
8946
9071
|
] });
|
|
8947
9072
|
}
|
|
8948
9073
|
);
|
|
@@ -8974,6 +9099,7 @@ const DatePicker$1 = React.forwardRef(
|
|
|
8974
9099
|
required: requiredProp = false,
|
|
8975
9100
|
onClear,
|
|
8976
9101
|
clearLabel = "Clear",
|
|
9102
|
+
size = "M",
|
|
8977
9103
|
...restProps
|
|
8978
9104
|
}, ref) => {
|
|
8979
9105
|
const timeZone = getLocalTimeZone();
|
|
@@ -8989,7 +9115,7 @@ const DatePicker$1 = React.forwardRef(
|
|
|
8989
9115
|
const [textInput, setTextInput] = React.useState(null);
|
|
8990
9116
|
const [content, setContent] = React.useState(null);
|
|
8991
9117
|
const [textValue, setTextValue] = React.useState();
|
|
8992
|
-
const [value, setValue] = useControllableState({
|
|
9118
|
+
const [value, setValue] = useControllableState$1({
|
|
8993
9119
|
defaultProp: initialDate ? convertUTCDateToCalendarDate(initialDate) : void 0,
|
|
8994
9120
|
prop: valueProp ? convertUTCDateToCalendarDate(valueProp) : void 0,
|
|
8995
9121
|
onChange(date) {
|
|
@@ -9033,7 +9159,7 @@ const DatePicker$1 = React.forwardRef(
|
|
|
9033
9159
|
},
|
|
9034
9160
|
[value]
|
|
9035
9161
|
);
|
|
9036
|
-
|
|
9162
|
+
useIsomorphicLayoutEffect(() => {
|
|
9037
9163
|
if (valueProp) {
|
|
9038
9164
|
const date = convertUTCDateToCalendarDate(valueProp);
|
|
9039
9165
|
setTextValue(formatter.format(date.toDate(timeZone)));
|
|
@@ -9042,7 +9168,7 @@ const DatePicker$1 = React.forwardRef(
|
|
|
9042
9168
|
setTextValue("");
|
|
9043
9169
|
}
|
|
9044
9170
|
}, [valueProp, formatter, timeZone]);
|
|
9045
|
-
|
|
9171
|
+
useIsomorphicLayoutEffect(() => {
|
|
9046
9172
|
if (initialDate && textValue === void 0) {
|
|
9047
9173
|
const date = convertUTCDateToCalendarDate(initialDate);
|
|
9048
9174
|
setTextValue(formatter.format(date.toDate(timeZone)));
|
|
@@ -9084,7 +9210,7 @@ const DatePicker$1 = React.forwardRef(
|
|
|
9084
9210
|
trigger,
|
|
9085
9211
|
value,
|
|
9086
9212
|
children: [
|
|
9087
|
-
/* @__PURE__ */ jsxs(DatePickerTrigger, { className, hasError, children: [
|
|
9213
|
+
/* @__PURE__ */ jsxs(DatePickerTrigger, { className, hasError, size, children: [
|
|
9088
9214
|
/* @__PURE__ */ jsx(Calendar, { fill: "neutral500", "aria-hidden": true }),
|
|
9089
9215
|
/* @__PURE__ */ jsx(DatePickerTextInput, { ref, "aria-describedby": ariaDescription, id, name, ...restProps }),
|
|
9090
9216
|
textValue && onClear ? /* @__PURE__ */ jsx(
|
|
@@ -9130,7 +9256,7 @@ const makeInitialCalendarDate = ({ currentValue, minDate: minDate$1, maxDate: ma
|
|
|
9130
9256
|
};
|
|
9131
9257
|
const DATE_PICKER_TRIGGER_NAME = "DatePickerTrigger";
|
|
9132
9258
|
const DatePickerTrigger = React.forwardRef(
|
|
9133
|
-
({ hasError, ...restProps }, forwardedRef) => {
|
|
9259
|
+
({ hasError, size, ...restProps }, forwardedRef) => {
|
|
9134
9260
|
const context = useDatePickerContext(DATE_PICKER_TRIGGER_NAME);
|
|
9135
9261
|
const composedRefs = useComposedRefs(forwardedRef, (node) => context.onTriggerChange(node));
|
|
9136
9262
|
const handleOpenChange = () => {
|
|
@@ -9155,9 +9281,8 @@ const DatePickerTrigger = React.forwardRef(
|
|
|
9155
9281
|
{
|
|
9156
9282
|
ref: composedRefs,
|
|
9157
9283
|
$hasError: hasError,
|
|
9284
|
+
$size: size,
|
|
9158
9285
|
...restProps,
|
|
9159
|
-
paddingLeft: 3,
|
|
9160
|
-
paddingRight: 3,
|
|
9161
9286
|
hasRadius: true,
|
|
9162
9287
|
gap: 3,
|
|
9163
9288
|
overflow: "hidden",
|
|
@@ -9187,7 +9312,20 @@ const DatePickerTrigger = React.forwardRef(
|
|
|
9187
9312
|
);
|
|
9188
9313
|
const TriggerElement = styled(Flex)`
|
|
9189
9314
|
border: 1px solid ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
|
9190
|
-
|
|
9315
|
+
${(props) => {
|
|
9316
|
+
switch (props.$size) {
|
|
9317
|
+
case "S":
|
|
9318
|
+
return css`
|
|
9319
|
+
padding-block: ${props.theme.spaces[1]};
|
|
9320
|
+
padding-inline: ${props.theme.spaces[3]};
|
|
9321
|
+
`;
|
|
9322
|
+
default:
|
|
9323
|
+
return css`
|
|
9324
|
+
padding-block: ${props.theme.spaces[2]};
|
|
9325
|
+
padding-inline: ${props.theme.spaces[3]};
|
|
9326
|
+
`;
|
|
9327
|
+
}
|
|
9328
|
+
}}
|
|
9191
9329
|
|
|
9192
9330
|
& > svg {
|
|
9193
9331
|
flex: 1 0 auto;
|
|
@@ -9411,7 +9549,7 @@ const CONTENT_NAME = "DatePickerContent";
|
|
|
9411
9549
|
const DatePickerContent = React.forwardRef((props, forwardedRef) => {
|
|
9412
9550
|
const [fragment, setFragment] = React.useState();
|
|
9413
9551
|
const context = useDatePickerContext(CONTENT_NAME);
|
|
9414
|
-
|
|
9552
|
+
useIsomorphicLayoutEffect(() => {
|
|
9415
9553
|
setFragment(new DocumentFragment());
|
|
9416
9554
|
}, []);
|
|
9417
9555
|
if (!context.open) {
|
|
@@ -9540,7 +9678,7 @@ const DatePickerCalendar = React.forwardRef(
|
|
|
9540
9678
|
const getDatesInWeek = makeGetDatesInWeek(startDate, locale);
|
|
9541
9679
|
return /* @__PURE__ */ jsxs(Flex, { ref, direction: "column", alignItems: "stretch", padding: 4, ...restProps, children: [
|
|
9542
9680
|
/* @__PURE__ */ jsxs(ToolbarFlex, { justifyContent: "flex-start", paddingBottom: 4, paddingLeft: 2, paddingRight: 2, gap: 2, children: [
|
|
9543
|
-
/* @__PURE__ */ jsx(Root$
|
|
9681
|
+
/* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(
|
|
9544
9682
|
SingleSelect,
|
|
9545
9683
|
{
|
|
9546
9684
|
"aria-label": monthSelectLabel,
|
|
@@ -9549,7 +9687,7 @@ const DatePickerCalendar = React.forwardRef(
|
|
|
9549
9687
|
children: months.map((month) => /* @__PURE__ */ jsx(SingleSelectOption, { value: month, children: month }, month))
|
|
9550
9688
|
}
|
|
9551
9689
|
) }),
|
|
9552
|
-
/* @__PURE__ */ jsx(Root$
|
|
9690
|
+
/* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(SingleSelect, { value: calendarDate.year.toString(), "aria-label": yearSelectLabel, onChange: handleYearChange, children: years.map((year) => /* @__PURE__ */ jsx(SingleSelectOption, { value: year, children: year }, year)) }) })
|
|
9553
9691
|
] }),
|
|
9554
9692
|
/* @__PURE__ */ jsxs("table", { role: "grid", children: [
|
|
9555
9693
|
/* @__PURE__ */ jsx("thead", { "aria-hidden": true, children: /* @__PURE__ */ jsx("tr", { "aria-rowindex": 0, children: weekDays.map((day, index) => /* @__PURE__ */ jsx(DatePickerHeaderCell, { "aria-colindex": index, children: day }, day)) }) }),
|
|
@@ -9772,7 +9910,7 @@ const TimePicker$1 = React.forwardRef(
|
|
|
9772
9910
|
allowCustomValue: true,
|
|
9773
9911
|
placeholder: `--${separator}--`,
|
|
9774
9912
|
autocomplete: "none",
|
|
9775
|
-
startIcon: /* @__PURE__ */ jsx(
|
|
9913
|
+
startIcon: /* @__PURE__ */ jsx(Clock, { fill: "neutral500" }),
|
|
9776
9914
|
inputMode: "numeric",
|
|
9777
9915
|
pattern: `\\d{2}\\${separator}\\d{2}`,
|
|
9778
9916
|
textValue,
|
|
@@ -9783,14 +9921,6 @@ const TimePicker$1 = React.forwardRef(
|
|
|
9783
9921
|
);
|
|
9784
9922
|
}
|
|
9785
9923
|
);
|
|
9786
|
-
const StyledClock = styled(Clock)`
|
|
9787
|
-
height: 1rem;
|
|
9788
|
-
width: 1rem;
|
|
9789
|
-
|
|
9790
|
-
& > path {
|
|
9791
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
9792
|
-
}
|
|
9793
|
-
`;
|
|
9794
9924
|
const DatePicker = styled(DatePicker$1)`
|
|
9795
9925
|
flex: 1 1 70%;
|
|
9796
9926
|
min-width: 120px;
|
|
@@ -9812,10 +9942,11 @@ const DateTimePicker = React.forwardRef(
|
|
|
9812
9942
|
step,
|
|
9813
9943
|
value,
|
|
9814
9944
|
initialDate,
|
|
9945
|
+
size,
|
|
9815
9946
|
...props
|
|
9816
9947
|
}, forwardedRef) => {
|
|
9817
9948
|
const DatePickerElement2 = React.useRef(null);
|
|
9818
|
-
const [dateValue, setDateValue] = useControllableState({
|
|
9949
|
+
const [dateValue, setDateValue] = useControllableState$1({
|
|
9819
9950
|
defaultProp: initialDate ? convertUTCDateToCalendarDateTime(initialDate, false) : void 0,
|
|
9820
9951
|
prop: value ? convertUTCDateToCalendarDateTime(value, false) : value ?? void 0,
|
|
9821
9952
|
onChange(date) {
|
|
@@ -9867,10 +9998,11 @@ const DateTimePicker = React.forwardRef(
|
|
|
9867
9998
|
const { error, id, labelNode } = useField("DateTimePicker");
|
|
9868
9999
|
const hasError = Boolean(error) || hasErrorProp;
|
|
9869
10000
|
return /* @__PURE__ */ jsxs(Flex, { "aria-labelledby": labelNode ? `${id}-label` : void 0, role: "group", flex: "1", gap: 1, children: [
|
|
9870
|
-
/* @__PURE__ */ jsx(Root$
|
|
10001
|
+
/* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(
|
|
9871
10002
|
DatePicker,
|
|
9872
10003
|
{
|
|
9873
10004
|
...props,
|
|
10005
|
+
size,
|
|
9874
10006
|
value: dateValue?.toDate("UTC"),
|
|
9875
10007
|
onChange: handleDateChange,
|
|
9876
10008
|
required,
|
|
@@ -9881,9 +10013,10 @@ const DateTimePicker = React.forwardRef(
|
|
|
9881
10013
|
"aria-label": dateLabel
|
|
9882
10014
|
}
|
|
9883
10015
|
) }),
|
|
9884
|
-
/* @__PURE__ */ jsx(Root$
|
|
10016
|
+
/* @__PURE__ */ jsx(Root$6, { children: /* @__PURE__ */ jsx(
|
|
9885
10017
|
TimePicker,
|
|
9886
10018
|
{
|
|
10019
|
+
size,
|
|
9887
10020
|
hasError,
|
|
9888
10021
|
value: timeValue,
|
|
9889
10022
|
onChange: handleTimeChange,
|
|
@@ -9906,15 +10039,25 @@ const convertUTCDateToCalendarDateTime = (date, resetTime = true) => {
|
|
|
9906
10039
|
}
|
|
9907
10040
|
return toCalendarDateTime(zonedDateTime);
|
|
9908
10041
|
};
|
|
9909
|
-
const
|
|
10042
|
+
const Divider = React.forwardRef((props, forwardedRef) => {
|
|
10043
|
+
return /* @__PURE__ */ jsx(
|
|
10044
|
+
DividerImpl,
|
|
10045
|
+
{
|
|
10046
|
+
ref: forwardedRef,
|
|
10047
|
+
background: "neutral150",
|
|
10048
|
+
...props,
|
|
10049
|
+
"data-orientation": "horizontal",
|
|
10050
|
+
role: "separator",
|
|
10051
|
+
tag: "div"
|
|
10052
|
+
}
|
|
10053
|
+
);
|
|
10054
|
+
});
|
|
10055
|
+
const DividerImpl = styled(Box)`
|
|
9910
10056
|
height: 1px;
|
|
9911
10057
|
border: none;
|
|
9912
10058
|
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
9913
10059
|
flex-shrink: 0;
|
|
9914
10060
|
`;
|
|
9915
|
-
const Divider = (props) => {
|
|
9916
|
-
return /* @__PURE__ */ jsx(DividerWrapper, { ...props, background: "neutral150", tag: "hr" });
|
|
9917
|
-
};
|
|
9918
10061
|
const EmptyStateIconWrapper = styled(Box)`
|
|
9919
10062
|
svg {
|
|
9920
10063
|
height: 8.8rem;
|
|
@@ -9944,17 +10087,92 @@ const EmptyStateLayout = ({
|
|
|
9944
10087
|
}
|
|
9945
10088
|
);
|
|
9946
10089
|
};
|
|
9947
|
-
const
|
|
9948
|
-
const
|
|
9949
|
-
|
|
10090
|
+
const getFocusableNodes = (node, includeNegativeTabIndex) => {
|
|
10091
|
+
const nodes = [
|
|
10092
|
+
...node.querySelectorAll(
|
|
10093
|
+
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
10094
|
+
)
|
|
10095
|
+
];
|
|
10096
|
+
const focusables = nodes.filter((node2) => {
|
|
10097
|
+
if (node2.hasAttribute("disabled"))
|
|
10098
|
+
return false;
|
|
10099
|
+
if (includeNegativeTabIndex)
|
|
10100
|
+
return true;
|
|
10101
|
+
return node2.getAttribute("tabindex") !== "-1";
|
|
10102
|
+
});
|
|
10103
|
+
return focusables;
|
|
9950
10104
|
};
|
|
9951
|
-
const
|
|
10105
|
+
const getFocusableNodesWithKeyboardNav = (nodes) => {
|
|
10106
|
+
return nodes.filter((node) => {
|
|
10107
|
+
if (node.tagName === "INPUT") {
|
|
10108
|
+
return node.type !== "checkbox" && node.type !== "radio";
|
|
10109
|
+
}
|
|
10110
|
+
return false;
|
|
10111
|
+
});
|
|
10112
|
+
};
|
|
10113
|
+
const FocusTrap = ({ onEscape, restoreFocus = true, skipAutoFocus = false, ...props }) => {
|
|
10114
|
+
const trappedRef = React.useRef(null);
|
|
10115
|
+
React.useEffect(() => {
|
|
10116
|
+
let currentFocus = null;
|
|
10117
|
+
if (restoreFocus) {
|
|
10118
|
+
currentFocus = document.activeElement;
|
|
10119
|
+
}
|
|
10120
|
+
return () => {
|
|
10121
|
+
if (currentFocus) {
|
|
10122
|
+
currentFocus.focus();
|
|
10123
|
+
}
|
|
10124
|
+
};
|
|
10125
|
+
}, [restoreFocus]);
|
|
10126
|
+
React.useEffect(() => {
|
|
10127
|
+
if (!trappedRef.current || skipAutoFocus)
|
|
10128
|
+
return;
|
|
10129
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10130
|
+
if (focusableChildren.length > 0) {
|
|
10131
|
+
const firstElement = focusableChildren[0];
|
|
10132
|
+
firstElement.focus();
|
|
10133
|
+
} else {
|
|
10134
|
+
console.warn(
|
|
10135
|
+
"[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one."
|
|
10136
|
+
);
|
|
10137
|
+
}
|
|
10138
|
+
}, [skipAutoFocus]);
|
|
10139
|
+
const handleKeyDown = (e) => {
|
|
10140
|
+
if (e.key === KeyboardKeys.ESCAPE && onEscape) {
|
|
10141
|
+
onEscape();
|
|
10142
|
+
return;
|
|
10143
|
+
}
|
|
10144
|
+
if (e.key !== KeyboardKeys.TAB)
|
|
10145
|
+
return;
|
|
10146
|
+
const focusableChildren = getFocusableNodes(trappedRef.current);
|
|
10147
|
+
if (focusableChildren.length > 0) {
|
|
10148
|
+
const firstElement = focusableChildren[0];
|
|
10149
|
+
const lastElement = focusableChildren[focusableChildren.length - 1];
|
|
10150
|
+
if (e.shiftKey) {
|
|
10151
|
+
if (firstElement === document.activeElement) {
|
|
10152
|
+
e.preventDefault();
|
|
10153
|
+
lastElement.focus();
|
|
10154
|
+
}
|
|
10155
|
+
} else if (lastElement === document.activeElement) {
|
|
10156
|
+
e.preventDefault();
|
|
10157
|
+
firstElement.focus();
|
|
10158
|
+
}
|
|
10159
|
+
}
|
|
10160
|
+
};
|
|
10161
|
+
return /* @__PURE__ */ jsx("div", { ref: trappedRef, onKeyDown: handleKeyDown, ...props });
|
|
10162
|
+
};
|
|
10163
|
+
const Root$3 = forwardRef((props, forwardedRef) => {
|
|
10164
|
+
const { gap = 0, gridCols = 12, ...rest } = props;
|
|
10165
|
+
return /* @__PURE__ */ jsx(Wrapper$1, { ref: forwardedRef, $gap: gap, $gridCols: gridCols, ...rest });
|
|
10166
|
+
});
|
|
10167
|
+
const Wrapper$1 = styled(Box)`
|
|
9952
10168
|
display: grid;
|
|
9953
10169
|
grid-template-columns: repeat(${({ $gridCols }) => $gridCols}, 1fr);
|
|
9954
10170
|
${({ theme, $gap }) => handleResponsiveValues("gap", $gap, theme)}
|
|
9955
10171
|
`;
|
|
9956
|
-
const
|
|
9957
|
-
|
|
10172
|
+
const ItemImpl = forwardRef(
|
|
10173
|
+
({ col, s, xs, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Item$1, { ref: forwardedRef, $col: col, $s: s, $xs: xs, ...props })
|
|
10174
|
+
);
|
|
10175
|
+
const Item$1 = styled(Box)`
|
|
9958
10176
|
grid-column: span ${({ $col }) => $col ?? 1};
|
|
9959
10177
|
max-width: 100%;
|
|
9960
10178
|
|
|
@@ -9966,6 +10184,11 @@ const GridItem = styled(Box)`
|
|
|
9966
10184
|
grid-column: span ${({ $xs }) => $xs};
|
|
9967
10185
|
}
|
|
9968
10186
|
`;
|
|
10187
|
+
const Grid = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10188
|
+
__proto__: null,
|
|
10189
|
+
Item: ItemImpl,
|
|
10190
|
+
Root: Root$3
|
|
10191
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
9969
10192
|
const VARIANT_DEFAULT = "tertiary";
|
|
9970
10193
|
const VARIANT_SECONDARY = "secondary";
|
|
9971
10194
|
const SIZES = ["S", "M", "L"];
|
|
@@ -10041,20 +10264,22 @@ const IconButtonWrapper = styled(BaseButton)`
|
|
|
10041
10264
|
}
|
|
10042
10265
|
`;
|
|
10043
10266
|
const IconButtonGroup = styled(Flex)`
|
|
10044
|
-
&
|
|
10045
|
-
border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
10267
|
+
& ${IconButtonWrapper}:first-child {
|
|
10046
10268
|
border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};
|
|
10047
10269
|
}
|
|
10048
10270
|
|
|
10049
|
-
&
|
|
10271
|
+
& ${IconButtonWrapper}:last-child {
|
|
10050
10272
|
border-radius: ${({ theme }) => `0 ${theme.borderRadius} ${theme.borderRadius} 0`};
|
|
10051
10273
|
}
|
|
10052
10274
|
|
|
10053
10275
|
& ${IconButtonWrapper} {
|
|
10054
10276
|
border-radius: 0;
|
|
10055
|
-
border-left: none;
|
|
10056
10277
|
color: ${({ theme }) => theme.colors.neutral700};
|
|
10057
10278
|
|
|
10279
|
+
& + ${IconButtonWrapper} {
|
|
10280
|
+
border-left: none;
|
|
10281
|
+
}
|
|
10282
|
+
|
|
10058
10283
|
&:hover {
|
|
10059
10284
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
10060
10285
|
color: ${({ theme }) => theme.colors.neutral800};
|
|
@@ -10246,96 +10471,31 @@ const JSONInputContainer = styled(Flex)`
|
|
|
10246
10471
|
background-color: #4a4a6a;
|
|
10247
10472
|
}
|
|
10248
10473
|
`;
|
|
10249
|
-
const
|
|
10250
|
-
|
|
10251
|
-
const
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
10275
|
-
const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
|
|
10276
|
-
allElements[nextIndex].focus();
|
|
10277
|
-
}
|
|
10278
|
-
break;
|
|
10279
|
-
}
|
|
10280
|
-
case KeyboardKeys.LEFT:
|
|
10281
|
-
case KeyboardKeys.UP: {
|
|
10282
|
-
if (isValidFocusedElement()) {
|
|
10283
|
-
e.preventDefault();
|
|
10284
|
-
const focused = document.activeElement;
|
|
10285
|
-
const allElements = [...queryElement(e.currentTarget)];
|
|
10286
|
-
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
10287
|
-
const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
|
|
10288
|
-
allElements[nextIndex].focus();
|
|
10289
|
-
}
|
|
10290
|
-
break;
|
|
10291
|
-
}
|
|
10292
|
-
case KeyboardKeys.HOME: {
|
|
10293
|
-
if (isValidFocusedElement()) {
|
|
10294
|
-
e.preventDefault();
|
|
10295
|
-
const allElements = queryElement(e.currentTarget);
|
|
10296
|
-
const focusElement = allElements.item(0);
|
|
10297
|
-
focusElement.focus();
|
|
10298
|
-
}
|
|
10299
|
-
break;
|
|
10300
|
-
}
|
|
10301
|
-
case KeyboardKeys.END: {
|
|
10302
|
-
if (isValidFocusedElement()) {
|
|
10303
|
-
e.preventDefault();
|
|
10304
|
-
const allElements = queryElement(e.currentTarget);
|
|
10305
|
-
const focusElement = allElements.item(allElements.length - 1);
|
|
10306
|
-
focusElement.focus();
|
|
10307
|
-
}
|
|
10308
|
-
break;
|
|
10309
|
-
}
|
|
10310
|
-
}
|
|
10311
|
-
};
|
|
10312
|
-
return /* @__PURE__ */ jsx(Box, { onKeyDown: handleKeyDown, ...props });
|
|
10313
|
-
};
|
|
10314
|
-
const LinkButton = forwardRef(
|
|
10315
|
-
({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
|
|
10316
|
-
const paddingX = size === "S" ? 2 : "10px";
|
|
10317
|
-
const paddingY = 4;
|
|
10318
|
-
return /* @__PURE__ */ jsxs(
|
|
10319
|
-
LinkWrapper$1,
|
|
10320
|
-
{
|
|
10321
|
-
ref,
|
|
10322
|
-
"aria-disabled": disabled,
|
|
10323
|
-
$variant: variant2,
|
|
10324
|
-
background: "buttonPrimary600",
|
|
10325
|
-
borderColor: "buttonPrimary600",
|
|
10326
|
-
hasRadius: true,
|
|
10327
|
-
display: "inline-flex",
|
|
10328
|
-
paddingBottom: paddingX,
|
|
10329
|
-
paddingLeft: paddingY,
|
|
10330
|
-
paddingRight: paddingY,
|
|
10331
|
-
paddingTop: paddingX,
|
|
10332
|
-
pointerEvents: disabled ? "none" : void 0,
|
|
10333
|
-
...props,
|
|
10334
|
-
children: [
|
|
10335
|
-
startIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: startIcon }),
|
|
10336
|
-
/* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", textColor: "buttonNeutral0", children }),
|
|
10337
|
-
endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
10338
|
-
]
|
|
10474
|
+
const LinkButton = forwardRef(
|
|
10475
|
+
({ variant: variant2 = "default", startIcon, endIcon, disabled = false, children, size = "S", ...props }, ref) => {
|
|
10476
|
+
const paddingX = size === "S" ? 2 : "10px";
|
|
10477
|
+
const paddingY = 4;
|
|
10478
|
+
return /* @__PURE__ */ jsxs(
|
|
10479
|
+
LinkWrapper$1,
|
|
10480
|
+
{
|
|
10481
|
+
ref,
|
|
10482
|
+
"aria-disabled": disabled,
|
|
10483
|
+
$variant: variant2,
|
|
10484
|
+
background: "buttonPrimary600",
|
|
10485
|
+
borderColor: "buttonPrimary600",
|
|
10486
|
+
hasRadius: true,
|
|
10487
|
+
display: "inline-flex",
|
|
10488
|
+
paddingBottom: paddingX,
|
|
10489
|
+
paddingLeft: paddingY,
|
|
10490
|
+
paddingRight: paddingY,
|
|
10491
|
+
paddingTop: paddingX,
|
|
10492
|
+
pointerEvents: disabled ? "none" : void 0,
|
|
10493
|
+
...props,
|
|
10494
|
+
children: [
|
|
10495
|
+
startIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: startIcon }),
|
|
10496
|
+
/* @__PURE__ */ jsx(Typography, { variant: size === "S" ? "pi" : void 0, fontWeight: "bold", children }),
|
|
10497
|
+
endIcon && /* @__PURE__ */ jsx(Flex, { "aria-hidden": true, children: endIcon })
|
|
10498
|
+
]
|
|
10339
10499
|
}
|
|
10340
10500
|
);
|
|
10341
10501
|
}
|
|
@@ -10403,58 +10563,191 @@ const SkipToContent = ({ children }) => {
|
|
|
10403
10563
|
}
|
|
10404
10564
|
);
|
|
10405
10565
|
};
|
|
10406
|
-
const
|
|
10566
|
+
const ScrollAreaImpl$1 = React.forwardRef(
|
|
10567
|
+
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
10568
|
+
return /* @__PURE__ */ jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
10569
|
+
/* @__PURE__ */ jsx(ScrollAreaViewport, { ref: viewportRef, children }),
|
|
10570
|
+
/* @__PURE__ */ jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(Thumb, {}) }),
|
|
10571
|
+
/* @__PURE__ */ jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsx(Thumb, {}) })
|
|
10572
|
+
] });
|
|
10573
|
+
}
|
|
10574
|
+
);
|
|
10575
|
+
const ScrollAreaRoot = styled(ScrollArea.Root)`
|
|
10576
|
+
width: 100%;
|
|
10577
|
+
height: 100%;
|
|
10578
|
+
overflow: hidden;
|
|
10579
|
+
display: flex;
|
|
10580
|
+
`;
|
|
10581
|
+
const ScrollAreaViewport = styled(ScrollArea.Viewport)`
|
|
10582
|
+
min-width: 100%;
|
|
10583
|
+
padding-inline: 4px;
|
|
10584
|
+
`;
|
|
10585
|
+
const Scrollbar = styled(ScrollArea.Scrollbar)`
|
|
10586
|
+
display: flex;
|
|
10587
|
+
/* ensures no selection */
|
|
10588
|
+
user-select: none;
|
|
10589
|
+
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
10590
|
+
touch-action: none;
|
|
10591
|
+
|
|
10592
|
+
&[data-orientation='vertical'] {
|
|
10593
|
+
width: 0.4rem;
|
|
10594
|
+
}
|
|
10595
|
+
|
|
10596
|
+
&[data-orientation='horizontal'] {
|
|
10597
|
+
flex-direction: column;
|
|
10598
|
+
height: 0.4rem;
|
|
10599
|
+
}
|
|
10600
|
+
`;
|
|
10601
|
+
const Thumb = styled(ScrollArea.Thumb)`
|
|
10602
|
+
position: relative;
|
|
10603
|
+
flex: 1;
|
|
10604
|
+
background-color: ${(props) => props.theme.colors.neutral150};
|
|
10605
|
+
border-radius: var(--scrollbar-size);
|
|
10606
|
+
|
|
10607
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
10608
|
+
&::before {
|
|
10609
|
+
content: '';
|
|
10610
|
+
position: absolute;
|
|
10611
|
+
top: 50%;
|
|
10612
|
+
left: 50%;
|
|
10613
|
+
transform: translate(-50%, -50%);
|
|
10614
|
+
width: 100%;
|
|
10615
|
+
height: 100%;
|
|
10616
|
+
min-width: 44px;
|
|
10617
|
+
min-height: 44px;
|
|
10618
|
+
}
|
|
10619
|
+
`;
|
|
10620
|
+
const Root$2 = Dialog$1.Root;
|
|
10621
|
+
const Trigger$2 = React.forwardRef((props, forwardedRef) => {
|
|
10622
|
+
return /* @__PURE__ */ jsx(Dialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10623
|
+
});
|
|
10624
|
+
const Content$2 = React.forwardRef((props, forwardedRef) => {
|
|
10625
|
+
return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [
|
|
10626
|
+
/* @__PURE__ */ jsx(Overlay, {}),
|
|
10627
|
+
/* @__PURE__ */ jsx(ContentImpl, { ref: forwardedRef, ...props })
|
|
10628
|
+
] });
|
|
10407
10629
|
});
|
|
10408
|
-
const
|
|
10409
|
-
|
|
10410
|
-
|
|
10630
|
+
const Overlay = styled(Dialog$1.Overlay)`
|
|
10631
|
+
background-color: ${(props) => props.theme.colors.neutral800};
|
|
10632
|
+
position: fixed;
|
|
10411
10633
|
inset: 0;
|
|
10634
|
+
z-index: ${(props) => props.theme.zIndices.overlay};
|
|
10635
|
+
opacity: 0.2;
|
|
10636
|
+
|
|
10637
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
10638
|
+
animation: ${ANIMATIONS.overlayFadeIn} ${(props) => props.theme.motion.timings["200"]}
|
|
10639
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
10640
|
+
}
|
|
10412
10641
|
`;
|
|
10413
|
-
const
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10642
|
+
const ContentImpl = styled(Dialog$1.Content)`
|
|
10643
|
+
max-width: 83rem;
|
|
10644
|
+
max-height: 80vh;
|
|
10645
|
+
height: min-content;
|
|
10646
|
+
width: 60%;
|
|
10647
|
+
overflow: hidden;
|
|
10648
|
+
margin: 0 auto;
|
|
10649
|
+
display: flex;
|
|
10650
|
+
flex-direction: column;
|
|
10651
|
+
|
|
10652
|
+
position: fixed;
|
|
10653
|
+
top: 50%;
|
|
10654
|
+
left: 50%;
|
|
10655
|
+
transform: translate(-50%, -50%);
|
|
10656
|
+
|
|
10657
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
10658
|
+
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10659
|
+
box-shadow: ${(props) => props.theme.shadows.popupShadow};
|
|
10660
|
+
z-index: ${(props) => props.theme.zIndices.modal};
|
|
10661
|
+
|
|
10662
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
10663
|
+
&[data-state='open'] {
|
|
10664
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
10665
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
10666
|
+
animation-name: ${ANIMATIONS.modalPopIn};
|
|
10427
10667
|
}
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10668
|
+
|
|
10669
|
+
&[data-state='closed'] {
|
|
10670
|
+
animation-duration: ${(props) => props.theme.motion.timings["120"]};
|
|
10671
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10672
|
+
animation-name: ${ANIMATIONS.modalPopOut};
|
|
10673
|
+
}
|
|
10674
|
+
}
|
|
10433
10675
|
`;
|
|
10434
|
-
const
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10676
|
+
const Close = React.forwardRef((props, forwardedRef) => {
|
|
10677
|
+
return /* @__PURE__ */ jsx(Dialog$1.Close, { ...props, asChild: true, ref: forwardedRef });
|
|
10678
|
+
});
|
|
10679
|
+
const Header = React.forwardRef(
|
|
10680
|
+
({ children, closeLabel = "Close modal", ...restProps }, forwardedRef) => {
|
|
10681
|
+
return /* @__PURE__ */ jsxs(
|
|
10682
|
+
Head,
|
|
10683
|
+
{
|
|
10684
|
+
ref: forwardedRef,
|
|
10685
|
+
padding: 4,
|
|
10686
|
+
paddingLeft: 5,
|
|
10687
|
+
paddingRight: 5,
|
|
10688
|
+
background: "neutral100",
|
|
10689
|
+
justifyContent: "space-between",
|
|
10690
|
+
...restProps,
|
|
10691
|
+
tag: "header",
|
|
10692
|
+
children: [
|
|
10693
|
+
children,
|
|
10694
|
+
/* @__PURE__ */ jsx(Close, { children: /* @__PURE__ */ jsx(IconButton, { withTooltip: false, label: closeLabel, children: /* @__PURE__ */ jsx(Cross, {}) }) })
|
|
10695
|
+
]
|
|
10696
|
+
}
|
|
10697
|
+
);
|
|
10698
|
+
}
|
|
10699
|
+
);
|
|
10700
|
+
const Head = styled(Flex)`
|
|
10701
|
+
border-bottom: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
10444
10702
|
`;
|
|
10445
|
-
const
|
|
10446
|
-
return /* @__PURE__ */ jsx(
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
};
|
|
10451
|
-
const
|
|
10452
|
-
|
|
10453
|
-
|
|
10703
|
+
const Title = React.forwardRef((props, forwardedRef) => {
|
|
10704
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, { asChild: true, children: /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "bold", ref: forwardedRef, ...props }) });
|
|
10705
|
+
});
|
|
10706
|
+
const Body = React.forwardRef(({ children, ...restProps }, forwardedRef) => {
|
|
10707
|
+
return /* @__PURE__ */ jsx(BodyScroll, { ref: forwardedRef, ...restProps, children });
|
|
10708
|
+
});
|
|
10709
|
+
const BodyScroll = styled(ScrollAreaImpl$1)`
|
|
10710
|
+
padding-inline: ${(props) => props.theme.spaces[8]};
|
|
10711
|
+
|
|
10712
|
+
& > div {
|
|
10713
|
+
padding-block: ${(props) => props.theme.spaces[8]};
|
|
10714
|
+
|
|
10715
|
+
& > div {
|
|
10716
|
+
// the scroll area component applies a display: table to the child, which we don't want.
|
|
10717
|
+
display: block !important;
|
|
10718
|
+
}
|
|
10719
|
+
}
|
|
10454
10720
|
`;
|
|
10455
|
-
const
|
|
10456
|
-
return /* @__PURE__ */ jsx(
|
|
10457
|
-
|
|
10721
|
+
const Footer = React.forwardRef((props, forwardedRef) => {
|
|
10722
|
+
return /* @__PURE__ */ jsx(
|
|
10723
|
+
Foot,
|
|
10724
|
+
{
|
|
10725
|
+
ref: forwardedRef,
|
|
10726
|
+
padding: 4,
|
|
10727
|
+
paddingLeft: 5,
|
|
10728
|
+
paddingRight: 5,
|
|
10729
|
+
background: "neutral100",
|
|
10730
|
+
justifyContent: "space-between",
|
|
10731
|
+
...props,
|
|
10732
|
+
tag: "footer"
|
|
10733
|
+
}
|
|
10734
|
+
);
|
|
10735
|
+
});
|
|
10736
|
+
const Foot = styled(Flex)`
|
|
10737
|
+
border-top: solid 1px ${(props) => props.theme.colors.neutral150};
|
|
10738
|
+
flex: 1;
|
|
10739
|
+
`;
|
|
10740
|
+
const Modal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10741
|
+
__proto__: null,
|
|
10742
|
+
Body,
|
|
10743
|
+
Close,
|
|
10744
|
+
Content: Content$2,
|
|
10745
|
+
Footer,
|
|
10746
|
+
Header,
|
|
10747
|
+
Root: Root$2,
|
|
10748
|
+
Title,
|
|
10749
|
+
Trigger: Trigger$2
|
|
10750
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
10458
10751
|
const INITIAL_VALUE = "";
|
|
10459
10752
|
const NumberInput = React.forwardRef(
|
|
10460
10753
|
({ startAction, locale: defaultLocale, onValueChange, value, step = 1, disabled = false, ...props }, ref) => {
|
|
@@ -10534,7 +10827,7 @@ const NumberInput = React.forwardRef(
|
|
|
10534
10827
|
onKeyDown: handleKeyDown,
|
|
10535
10828
|
onBlur: handleBlur,
|
|
10536
10829
|
value: inputValue,
|
|
10537
|
-
endAction: /* @__PURE__ */ jsxs(
|
|
10830
|
+
endAction: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
10538
10831
|
/* @__PURE__ */ jsx(
|
|
10539
10832
|
ArrowButton,
|
|
10540
10833
|
{
|
|
@@ -10568,16 +10861,48 @@ const NumberInput = React.forwardRef(
|
|
|
10568
10861
|
);
|
|
10569
10862
|
const ArrowButton = styled.button`
|
|
10570
10863
|
display: flex;
|
|
10571
|
-
|
|
10572
|
-
align-items:
|
|
10864
|
+
justify-content: center;
|
|
10865
|
+
align-items: center;
|
|
10573
10866
|
transform: translateY(${({ $reverse }) => $reverse ? `-2px` : `2px`});
|
|
10574
10867
|
cursor: ${({ disabled }) => disabled ? "not-allowed" : void 0};
|
|
10868
|
+
height: 1.1rem;
|
|
10869
|
+
|
|
10575
10870
|
svg {
|
|
10576
|
-
|
|
10577
|
-
height: 0.4rem;
|
|
10871
|
+
width: 1.2rem;
|
|
10578
10872
|
transform: ${({ $reverse }) => $reverse ? "rotateX(180deg)" : void 0};
|
|
10579
10873
|
}
|
|
10580
10874
|
`;
|
|
10875
|
+
function useControllableState({
|
|
10876
|
+
prop,
|
|
10877
|
+
defaultProp,
|
|
10878
|
+
onChange = () => {
|
|
10879
|
+
}
|
|
10880
|
+
}) {
|
|
10881
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
10882
|
+
defaultProp,
|
|
10883
|
+
onChange
|
|
10884
|
+
});
|
|
10885
|
+
const isControlled = prop !== void 0;
|
|
10886
|
+
const propValue = prop instanceof Function ? prop(uncontrolledProp) : prop;
|
|
10887
|
+
const value = isControlled ? propValue : uncontrolledProp;
|
|
10888
|
+
const handleChange = useCallbackRef(onChange);
|
|
10889
|
+
const setValue = React.useCallback(
|
|
10890
|
+
(nextValue) => {
|
|
10891
|
+
if (isControlled) {
|
|
10892
|
+
const setter = nextValue;
|
|
10893
|
+
const value2 = typeof nextValue === "function" ? setter(propValue) : nextValue;
|
|
10894
|
+
if (value2 !== propValue) {
|
|
10895
|
+
handleChange(value2);
|
|
10896
|
+
setUncontrolledProp(nextValue);
|
|
10897
|
+
}
|
|
10898
|
+
} else {
|
|
10899
|
+
setUncontrolledProp(nextValue);
|
|
10900
|
+
}
|
|
10901
|
+
},
|
|
10902
|
+
[isControlled, propValue, setUncontrolledProp, handleChange]
|
|
10903
|
+
);
|
|
10904
|
+
return [value, setValue];
|
|
10905
|
+
}
|
|
10581
10906
|
const PaginationContext = React.createContext({ activePage: 1, pageCount: 1 });
|
|
10582
10907
|
const usePagination = () => React.useContext(PaginationContext);
|
|
10583
10908
|
const Pagination = ({ children, label = "Pagination", activePage, pageCount }) => {
|
|
@@ -10655,133 +10980,48 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxs(Box, { ...props, c
|
|
|
10655
10980
|
/* @__PURE__ */ jsx(VisuallyHidden, { children }),
|
|
10656
10981
|
/* @__PURE__ */ jsx(Typography, { "aria-hidden": true, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })
|
|
10657
10982
|
] });
|
|
10658
|
-
const
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
"
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
"bottom-start",
|
|
10667
|
-
"bottom-end",
|
|
10668
|
-
"left",
|
|
10669
|
-
"left-start",
|
|
10670
|
-
"left-end"
|
|
10671
|
-
];
|
|
10672
|
-
const PopoverWrapper = styled(Box)`
|
|
10983
|
+
const Root$1 = Popover$1.Root;
|
|
10984
|
+
const Trigger$1 = React.forwardRef((props, forwardedRef) => {
|
|
10985
|
+
return /* @__PURE__ */ jsx(Popover$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
10986
|
+
});
|
|
10987
|
+
const Content$1 = React.forwardRef((props, forwardedRef) => {
|
|
10988
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(PopoverContent, { sideOffset: 4, side: "bottom", align: "start", ...props, ref: forwardedRef }) });
|
|
10989
|
+
});
|
|
10990
|
+
const PopoverContent = styled(Popover$1.Content)`
|
|
10673
10991
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
10674
10992
|
z-index: ${({ theme }) => theme.zIndices.popover};
|
|
10993
|
+
background-color: ${(props) => props.theme.colors.neutral0};
|
|
10675
10994
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
onEscapeKeyDown,
|
|
10686
|
-
onPointerDownOutside,
|
|
10687
|
-
onDismiss,
|
|
10688
|
-
onFocusOutside,
|
|
10689
|
-
...props
|
|
10690
|
-
}, forwardedRef) => {
|
|
10691
|
-
const [content, setContent] = React.useState(null);
|
|
10692
|
-
const [width, setWidth] = React.useState(void 0);
|
|
10693
|
-
const isRightClickOutsideRef = React.useRef(false);
|
|
10694
|
-
const { x, y, refs, strategy } = useFloating({
|
|
10695
|
-
strategy: "fixed",
|
|
10696
|
-
placement: centered ? "bottom" : placement,
|
|
10697
|
-
middleware: [
|
|
10698
|
-
offset({
|
|
10699
|
-
mainAxis: spacing
|
|
10700
|
-
}),
|
|
10701
|
-
shift(),
|
|
10702
|
-
flip()
|
|
10703
|
-
],
|
|
10704
|
-
elements: {
|
|
10705
|
-
reference: source.current
|
|
10706
|
-
},
|
|
10707
|
-
whileElementsMounted: autoUpdate
|
|
10708
|
-
});
|
|
10709
|
-
React.useLayoutEffect(() => {
|
|
10710
|
-
if (fullWidth) {
|
|
10711
|
-
setWidth(source.current.offsetWidth);
|
|
10995
|
+
|
|
10996
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
10997
|
+
animation-duration: ${(props) => props.theme.motion.timings["200"]};
|
|
10998
|
+
|
|
10999
|
+
&[data-state='open'] {
|
|
11000
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.authenticMotion};
|
|
11001
|
+
|
|
11002
|
+
&[data-side='top'] {
|
|
11003
|
+
animation-name: ${ANIMATIONS.slideDownIn};
|
|
10712
11004
|
}
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
return hideOthers(content);
|
|
10717
|
-
}, [content]);
|
|
10718
|
-
const handleDismiss = useCallbackRef(onDismiss);
|
|
10719
|
-
React.useEffect(() => {
|
|
10720
|
-
const close = () => {
|
|
10721
|
-
handleDismiss();
|
|
10722
|
-
};
|
|
10723
|
-
window.addEventListener("blur", close);
|
|
10724
|
-
window.addEventListener("resize", close);
|
|
10725
|
-
return () => {
|
|
10726
|
-
window.removeEventListener("blur", close);
|
|
10727
|
-
window.removeEventListener("resize", close);
|
|
10728
|
-
};
|
|
10729
|
-
}, [handleDismiss]);
|
|
10730
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node), refs.setFloating);
|
|
10731
|
-
return /* @__PURE__ */ jsx(RemoveScroll, { allowPinchZoom: true, children: /* @__PURE__ */ jsx(
|
|
10732
|
-
FocusScope,
|
|
10733
|
-
{
|
|
10734
|
-
asChild: true,
|
|
10735
|
-
loop: true,
|
|
10736
|
-
trapped: true,
|
|
10737
|
-
onUnmountAutoFocus: (event) => {
|
|
10738
|
-
event.preventDefault();
|
|
10739
|
-
if (!isRightClickOutsideRef.current)
|
|
10740
|
-
source.current?.focus({ preventScroll: true });
|
|
10741
|
-
},
|
|
10742
|
-
children: /* @__PURE__ */ jsx(
|
|
10743
|
-
DismissibleLayer,
|
|
10744
|
-
{
|
|
10745
|
-
asChild: true,
|
|
10746
|
-
onEscapeKeyDown,
|
|
10747
|
-
onPointerDownOutside: composeEventHandlers(
|
|
10748
|
-
onPointerDownOutside,
|
|
10749
|
-
(event) => {
|
|
10750
|
-
const originalEvent = event.detail.originalEvent;
|
|
10751
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
10752
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
10753
|
-
isRightClickOutsideRef.current = isRightClick;
|
|
10754
|
-
},
|
|
10755
|
-
{ checkForDefaultPrevented: false }
|
|
10756
|
-
),
|
|
10757
|
-
onFocusOutside: composeEventHandlers(onFocusOutside, (event) => event.preventDefault(), {
|
|
10758
|
-
checkForDefaultPrevented: false
|
|
10759
|
-
}),
|
|
10760
|
-
onDismiss,
|
|
10761
|
-
children: /* @__PURE__ */ jsx(
|
|
10762
|
-
PopoverWrapper,
|
|
10763
|
-
{
|
|
10764
|
-
ref: composedRefs,
|
|
10765
|
-
style: {
|
|
10766
|
-
left: x,
|
|
10767
|
-
top: y,
|
|
10768
|
-
position: strategy,
|
|
10769
|
-
width: width || void 0
|
|
10770
|
-
},
|
|
10771
|
-
hasRadius: true,
|
|
10772
|
-
background: "neutral0",
|
|
10773
|
-
padding: 1,
|
|
10774
|
-
...props,
|
|
10775
|
-
children
|
|
10776
|
-
}
|
|
10777
|
-
)
|
|
10778
|
-
}
|
|
10779
|
-
)
|
|
11005
|
+
|
|
11006
|
+
&[data-side='bottom'] {
|
|
11007
|
+
animation-name: ${ANIMATIONS.slideUpIn};
|
|
10780
11008
|
}
|
|
10781
|
-
|
|
11009
|
+
}
|
|
11010
|
+
|
|
11011
|
+
&[data-state='closed'] {
|
|
11012
|
+
animation-timing-function: ${(props) => props.theme.motion.easings.easeOutQuad};
|
|
11013
|
+
|
|
11014
|
+
&[data-side='top'] {
|
|
11015
|
+
animation-name: ${ANIMATIONS.slideDownOut};
|
|
11016
|
+
}
|
|
11017
|
+
|
|
11018
|
+
&[data-side='bottom'] {
|
|
11019
|
+
animation-name: ${ANIMATIONS.slideUpOut};
|
|
11020
|
+
}
|
|
11021
|
+
}
|
|
10782
11022
|
}
|
|
10783
|
-
|
|
10784
|
-
const
|
|
11023
|
+
`;
|
|
11024
|
+
const ScrollAreaImpl = ({ children, intersectionId, onReachEnd, ...props }) => {
|
|
10785
11025
|
const popoverRef = React.useRef(null);
|
|
10786
11026
|
const generatedIntersectionId = useId();
|
|
10787
11027
|
useIntersection(popoverRef, onReachEnd ?? (() => {
|
|
@@ -10789,99 +11029,128 @@ const Scrolling = ({ children, intersectionId, onReachEnd, ...props }) => {
|
|
|
10789
11029
|
selectorToWatch: `#${stripReactIdOfColon(generatedIntersectionId)}`,
|
|
10790
11030
|
skipWhen: !intersectionId || !onReachEnd
|
|
10791
11031
|
});
|
|
10792
|
-
return /* @__PURE__ */ jsxs(
|
|
11032
|
+
return /* @__PURE__ */ jsxs(PopoverScrollArea, { ref: popoverRef, ...props, children: [
|
|
10793
11033
|
children,
|
|
10794
11034
|
intersectionId && onReachEnd && /* @__PURE__ */ jsx(Box, { id: stripReactIdOfColon(generatedIntersectionId), width: "100%", height: "1px" })
|
|
10795
11035
|
] });
|
|
10796
11036
|
};
|
|
10797
|
-
const
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
11037
|
+
const PopoverScrollArea = styled(ScrollAreaImpl$1)`
|
|
11038
|
+
height: 20rem;
|
|
11039
|
+
`;
|
|
11040
|
+
const Popover = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11041
|
+
__proto__: null,
|
|
11042
|
+
Content: Content$1,
|
|
11043
|
+
Root: Root$1,
|
|
11044
|
+
ScrollArea: ScrollAreaImpl,
|
|
11045
|
+
Trigger: Trigger$1
|
|
11046
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
11047
|
+
const ProgressBar = React.forwardRef(
|
|
11048
|
+
({ size = "M", value, ...restProps }, forwardedRef) => {
|
|
11049
|
+
return /* @__PURE__ */ jsx(ProgressRoot, { ref: forwardedRef, $size: size, ...restProps, children: /* @__PURE__ */ jsx(ProgressIndicator, { style: { transform: `translate3D(-${100 - (value ?? 0)}%, 0, 0)` } }) });
|
|
11050
|
+
}
|
|
11051
|
+
);
|
|
11052
|
+
const ProgressRoot = styled(Progress.Root)`
|
|
11053
|
+
position: relative;
|
|
11054
|
+
overflow: hidden;
|
|
11055
|
+
width: ${(props) => props.$size === "S" ? "7.8rem" : "10.2rem"};
|
|
11056
|
+
height: ${(props) => props.$size === "S" ? "0.4rem" : "0.8rem"};
|
|
11057
|
+
background-color: ${(props) => props.theme.colors.neutral600};
|
|
11058
|
+
border-radius: ${(props) => props.theme.borderRadius};
|
|
10801
11059
|
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
11060
|
+
/* Fix overflow clipping in Safari */
|
|
11061
|
+
/* https://gist.github.com/domske/b66047671c780a238b51c51ffde8d3a0 */
|
|
11062
|
+
transform: translateZ(0);
|
|
11063
|
+
`;
|
|
11064
|
+
const ProgressIndicator = styled(Progress.Indicator)`
|
|
11065
|
+
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
11066
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
|
11067
|
+
width: 100%;
|
|
11068
|
+
height: 100%;
|
|
11069
|
+
|
|
11070
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11071
|
+
transition: transform ${(props) => props.theme.motion.timings["320"]}
|
|
11072
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
10805
11073
|
}
|
|
11074
|
+
`;
|
|
11075
|
+
const Group = React.forwardRef((props, forwardedRef) => {
|
|
11076
|
+
return /* @__PURE__ */ jsx(RadioGroupRoot, { ref: forwardedRef, ...props });
|
|
11077
|
+
});
|
|
11078
|
+
const RadioGroupRoot = styled(RadioGroup.Root)`
|
|
11079
|
+
display: flex;
|
|
11080
|
+
flex-direction: column;
|
|
11081
|
+
gap: ${(props) => props.theme.spaces[3]};
|
|
11082
|
+
`;
|
|
11083
|
+
const Item = React.forwardRef(({ children, id: idProp, ...restProps }, forwardedRef) => {
|
|
11084
|
+
const id = useId(idProp);
|
|
11085
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
11086
|
+
/* @__PURE__ */ jsx(RadioGroupItem, { id, ref: forwardedRef, ...restProps, children: /* @__PURE__ */ jsx(RadioGroupIndicator, {}) }),
|
|
11087
|
+
/* @__PURE__ */ jsx(Typography, { tag: "label", htmlFor: id, children })
|
|
11088
|
+
] });
|
|
11089
|
+
});
|
|
11090
|
+
const RadioGroupItem = styled(RadioGroup.Item)`
|
|
11091
|
+
background: ${(props) => props.theme.colors.neutral0};
|
|
11092
|
+
width: 2rem;
|
|
11093
|
+
height: 2rem;
|
|
11094
|
+
flex: 0 0 2rem;
|
|
11095
|
+
border-radius: 50%;
|
|
11096
|
+
border: 1px solid ${(props) => props.theme.colors.neutral300};
|
|
11097
|
+
position: relative;
|
|
11098
|
+
z-index: 0;
|
|
10806
11099
|
|
|
10807
|
-
|
|
10808
|
-
|
|
11100
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11101
|
+
transition: border-color ${(props) => props.theme.motion.timings["120"]}
|
|
11102
|
+
${(props) => props.theme.motion.easings.easeOutQuad};
|
|
10809
11103
|
}
|
|
10810
11104
|
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10814
|
-
margin-right: 10px;
|
|
11105
|
+
&[data-state='checked'] {
|
|
11106
|
+
border: 1px solid ${(props) => props.theme.colors.primary600};
|
|
10815
11107
|
}
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
centered,
|
|
10824
|
-
onEscapeKeyDown,
|
|
10825
|
-
onPointerDownOutside,
|
|
10826
|
-
onDismiss,
|
|
10827
|
-
...restProps
|
|
10828
|
-
}) => {
|
|
10829
|
-
return /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(
|
|
10830
|
-
Content,
|
|
10831
|
-
{
|
|
10832
|
-
source,
|
|
10833
|
-
spacing,
|
|
10834
|
-
fullWidth,
|
|
10835
|
-
placement,
|
|
10836
|
-
centered,
|
|
10837
|
-
onEscapeKeyDown,
|
|
10838
|
-
onPointerDownOutside,
|
|
10839
|
-
onDismiss,
|
|
10840
|
-
children: /* @__PURE__ */ jsx(Scrolling, { ...restProps, children })
|
|
10841
|
-
}
|
|
10842
|
-
) });
|
|
10843
|
-
};
|
|
10844
|
-
const primitives = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10845
|
-
__proto__: null,
|
|
10846
|
-
Content,
|
|
10847
|
-
Scrolling
|
|
10848
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
10849
|
-
const ProgressbarBase = styled(Box)`
|
|
10850
|
-
&:before {
|
|
10851
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
10852
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
10853
|
-
bottom: 0;
|
|
11108
|
+
|
|
11109
|
+
&[data-disabled] {
|
|
11110
|
+
background-color: ${(props) => props.theme.colors.neutral200};
|
|
11111
|
+
}
|
|
11112
|
+
|
|
11113
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
11114
|
+
&::before {
|
|
10854
11115
|
content: '';
|
|
10855
11116
|
position: absolute;
|
|
10856
|
-
top:
|
|
10857
|
-
|
|
11117
|
+
top: 50%;
|
|
11118
|
+
left: 50%;
|
|
11119
|
+
transform: translate(-50%, -50%);
|
|
11120
|
+
width: 100%;
|
|
11121
|
+
height: 100%;
|
|
11122
|
+
min-width: 44px;
|
|
11123
|
+
min-height: 44px;
|
|
10858
11124
|
}
|
|
10859
11125
|
`;
|
|
10860
|
-
const
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
position: "relative",
|
|
10872
|
-
role: "progressbar",
|
|
10873
|
-
$value: value,
|
|
10874
|
-
width: size === "S" ? "78px" : "102px",
|
|
10875
|
-
...props
|
|
11126
|
+
const RadioGroupIndicator = styled(RadioGroup.Indicator)`
|
|
11127
|
+
display: flex;
|
|
11128
|
+
align-items: center;
|
|
11129
|
+
justify-content: center;
|
|
11130
|
+
width: 100%;
|
|
11131
|
+
height: 100%;
|
|
11132
|
+
position: relative;
|
|
11133
|
+
|
|
11134
|
+
&[data-state='checked'] {
|
|
11135
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11136
|
+
animation: ${ANIMATIONS.popIn} ${(props) => props.theme.motion.timings["200"]};
|
|
10876
11137
|
}
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
11138
|
+
}
|
|
11139
|
+
|
|
11140
|
+
&::after {
|
|
11141
|
+
content: '';
|
|
11142
|
+
display: block;
|
|
11143
|
+
width: 1rem;
|
|
11144
|
+
height: 1rem;
|
|
11145
|
+
border-radius: 50%;
|
|
11146
|
+
background: ${(props) => props.theme.colors.primary600};
|
|
11147
|
+
}
|
|
11148
|
+
`;
|
|
11149
|
+
const Radio = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
11150
|
+
__proto__: null,
|
|
11151
|
+
Group,
|
|
11152
|
+
Item
|
|
11153
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
10885
11154
|
const focusFocusable = (node) => {
|
|
10886
11155
|
const nextNode = node.querySelector('[tabindex="0"]');
|
|
10887
11156
|
if (nextNode) {
|
|
@@ -11024,7 +11293,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
|
|
|
11024
11293
|
}
|
|
11025
11294
|
};
|
|
11026
11295
|
const isFocused = rowIndex === coords.row - 1 && colIndex === coords.col - 1;
|
|
11027
|
-
|
|
11296
|
+
useIsomorphicLayoutEffect(() => {
|
|
11028
11297
|
const focusableNodes = getFocusableNodes(tdRef.current, true);
|
|
11029
11298
|
if (focusableNodes.length === 0 || focusableNodes.length === 1 && getFocusableNodesWithKeyboardNav(focusableNodes).length !== 0 || focusableNodes.length > 1 && Boolean(focusableNodes.find((node) => node.tagName !== "BUTTON"))) {
|
|
11030
11299
|
tdRef.current.setAttribute("tabIndex", !isActive && isFocused ? "0" : "-1");
|
|
@@ -11047,7 +11316,7 @@ const RawTd = ({ coords = { col: 0, row: 0 }, tag = "td", ...props }) => {
|
|
|
11047
11316
|
}
|
|
11048
11317
|
setTableValues({ rowIndex: coords.row - 1, colIndex: coords.col - 1 });
|
|
11049
11318
|
}, [coords, setTableValues]);
|
|
11050
|
-
|
|
11319
|
+
useIsomorphicLayoutEffect(() => {
|
|
11051
11320
|
const cell = tdRef.current;
|
|
11052
11321
|
const focusableNodes = getFocusableNodes(cell, true);
|
|
11053
11322
|
focusableNodes.forEach((node) => {
|
|
@@ -11131,7 +11400,7 @@ const Searchbar = React.forwardRef(
|
|
|
11131
11400
|
inputRef.current.focus();
|
|
11132
11401
|
};
|
|
11133
11402
|
const actualRef = composeRefs(ref, inputRef);
|
|
11134
|
-
return /* @__PURE__ */ jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxs(Root$
|
|
11403
|
+
return /* @__PURE__ */ jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxs(Root$6, { name, children: [
|
|
11135
11404
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(Label, { children }) }),
|
|
11136
11405
|
/* @__PURE__ */ jsx(
|
|
11137
11406
|
SearchbarInput,
|
|
@@ -11139,7 +11408,7 @@ const Searchbar = React.forwardRef(
|
|
|
11139
11408
|
ref: actualRef,
|
|
11140
11409
|
value,
|
|
11141
11410
|
startAction: /* @__PURE__ */ jsx(SearchIcon, { "aria-hidden": true }),
|
|
11142
|
-
endAction: isCompleting ? /* @__PURE__ */ jsx(Action, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsx(CloseIcon, {}) }) : void 0,
|
|
11411
|
+
endAction: isCompleting ? /* @__PURE__ */ jsx(Action$1, { label: clearLabel, onClick: handleClear, children: /* @__PURE__ */ jsx(CloseIcon, {}) }) : void 0,
|
|
11143
11412
|
...props
|
|
11144
11413
|
}
|
|
11145
11414
|
)
|
|
@@ -11208,6 +11477,7 @@ const MultiSelect = React.forwardRef(
|
|
|
11208
11477
|
onReachEnd,
|
|
11209
11478
|
placeholder,
|
|
11210
11479
|
required: requiredProp,
|
|
11480
|
+
size,
|
|
11211
11481
|
startIcon,
|
|
11212
11482
|
value: passedValue,
|
|
11213
11483
|
withTags,
|
|
@@ -11268,7 +11538,7 @@ const MultiSelect = React.forwardRef(
|
|
|
11268
11538
|
ariaDescription = `${id}-hint`;
|
|
11269
11539
|
}
|
|
11270
11540
|
return /* @__PURE__ */ jsxs(
|
|
11271
|
-
Root,
|
|
11541
|
+
Root$4,
|
|
11272
11542
|
{
|
|
11273
11543
|
onOpenChange: handleOpenChange,
|
|
11274
11544
|
disabled,
|
|
@@ -11279,7 +11549,7 @@ const MultiSelect = React.forwardRef(
|
|
|
11279
11549
|
multi: true,
|
|
11280
11550
|
children: [
|
|
11281
11551
|
/* @__PURE__ */ jsx(
|
|
11282
|
-
Trigger,
|
|
11552
|
+
Trigger$3,
|
|
11283
11553
|
{
|
|
11284
11554
|
ref: forwardedRef,
|
|
11285
11555
|
id,
|
|
@@ -11291,11 +11561,12 @@ const MultiSelect = React.forwardRef(
|
|
|
11291
11561
|
disabled,
|
|
11292
11562
|
clearLabel,
|
|
11293
11563
|
onClear: value?.length ? onClear : void 0,
|
|
11294
|
-
|
|
11564
|
+
withTags: Boolean(withTags && (value?.length ?? 0 > 0)),
|
|
11565
|
+
size,
|
|
11295
11566
|
children: /* @__PURE__ */ jsx(Value, { placeholder, textColor: value?.length ? "neutral800" : "neutral600", children: value?.length ? withTags ? renderTags : customizeContent ? customizeContent(value) : void 0 : void 0 })
|
|
11296
11567
|
}
|
|
11297
11568
|
),
|
|
11298
|
-
/* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$
|
|
11569
|
+
/* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content$3, { position: "popper", sideOffset: 4, onCloseAutoFocus, children: /* @__PURE__ */ jsxs(Viewport, { ref: viewportRef, children: [
|
|
11299
11570
|
children,
|
|
11300
11571
|
/* @__PURE__ */ jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
|
|
11301
11572
|
] }) }) })
|
|
@@ -11306,74 +11577,20 @@ const MultiSelect = React.forwardRef(
|
|
|
11306
11577
|
);
|
|
11307
11578
|
const MultiSelectOption = React.forwardRef(
|
|
11308
11579
|
({ value, children, startIcon, ...restProps }, ref) => {
|
|
11309
|
-
return /* @__PURE__ */ jsxs(Item, { ref, value: value.toString(), ...restProps, children: [
|
|
11580
|
+
return /* @__PURE__ */ jsxs(Item$2, { ref, value: value.toString(), ...restProps, children: [
|
|
11310
11581
|
startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
11311
|
-
/* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(
|
|
11312
|
-
|
|
11313
|
-
{
|
|
11314
|
-
hasRadius: true,
|
|
11315
|
-
overflow: "hidden",
|
|
11316
|
-
position: "relative",
|
|
11317
|
-
$indeterminate: isIntermediate,
|
|
11318
|
-
$selected: isSelected,
|
|
11319
|
-
zIndex: 1,
|
|
11320
|
-
height: "18px",
|
|
11321
|
-
width: "18px"
|
|
11322
|
-
}
|
|
11323
|
-
) }),
|
|
11324
|
-
/* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: /* @__PURE__ */ jsx(ItemText, { children }) })
|
|
11582
|
+
/* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
|
|
11583
|
+
/* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(ItemText, { children }) })
|
|
11325
11584
|
] });
|
|
11326
11585
|
}
|
|
11327
11586
|
);
|
|
11328
|
-
const CheckMark = styled(Box)`
|
|
11329
|
-
border: 1px solid
|
|
11330
|
-
${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral300};
|
|
11331
|
-
background-color: ${({ theme, $selected, $indeterminate }) => $selected || $indeterminate ? theme.colors.primary600 : theme.colors.neutral0};
|
|
11332
|
-
|
|
11333
|
-
${({ theme, $indeterminate }) => $indeterminate && css`
|
|
11334
|
-
&::after {
|
|
11335
|
-
content: '';
|
|
11336
|
-
display: block;
|
|
11337
|
-
position: relative;
|
|
11338
|
-
color: white;
|
|
11339
|
-
height: 2px;
|
|
11340
|
-
width: 10px;
|
|
11341
|
-
background-color: ${theme.colors.neutral0};
|
|
11342
|
-
left: 50%;
|
|
11343
|
-
top: 50%;
|
|
11344
|
-
transform: translateX(-50%) translateY(-50%);
|
|
11345
|
-
}
|
|
11346
|
-
`}
|
|
11347
|
-
|
|
11348
|
-
${({ $selected }) => $selected && css`
|
|
11349
|
-
&::after {
|
|
11350
|
-
content: '';
|
|
11351
|
-
background: ${() => `url("${checkmarkIcon}") no-repeat no-repeat center center`};
|
|
11352
|
-
width: 100%;
|
|
11353
|
-
height: 100%;
|
|
11354
|
-
position: absolute;
|
|
11355
|
-
}
|
|
11356
|
-
`}
|
|
11357
|
-
`;
|
|
11358
11587
|
const MultiSelectGroup = React.forwardRef(
|
|
11359
11588
|
({ children, label, startIcon, values = [], ...restProps }, ref) => {
|
|
11360
|
-
return /* @__PURE__ */ jsxs(Group, { ref, children: [
|
|
11361
|
-
/* @__PURE__ */ jsxs(Item, { value: values, ...restProps, children: [
|
|
11589
|
+
return /* @__PURE__ */ jsxs(Group$1, { ref, children: [
|
|
11590
|
+
/* @__PURE__ */ jsxs(Item$2, { value: values, ...restProps, children: [
|
|
11362
11591
|
startIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, children: startIcon }),
|
|
11363
|
-
/* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(
|
|
11364
|
-
|
|
11365
|
-
{
|
|
11366
|
-
hasRadius: true,
|
|
11367
|
-
overflow: "hidden",
|
|
11368
|
-
position: "relative",
|
|
11369
|
-
$indeterminate: isIntermediate,
|
|
11370
|
-
$selected: isSelected,
|
|
11371
|
-
zIndex: 1,
|
|
11372
|
-
height: "18px",
|
|
11373
|
-
width: "18px"
|
|
11374
|
-
}
|
|
11375
|
-
) }),
|
|
11376
|
-
/* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: label })
|
|
11592
|
+
/* @__PURE__ */ jsx(ItemIndicator, { children: ({ isSelected, isIntermediate }) => /* @__PURE__ */ jsx(CheckboxImpl, { checked: isIntermediate ? "indeterminate" : isSelected }) }),
|
|
11593
|
+
/* @__PURE__ */ jsx(Typography, { children: label })
|
|
11377
11594
|
] }),
|
|
11378
11595
|
children
|
|
11379
11596
|
] });
|
|
@@ -11438,13 +11655,6 @@ const SubNavWrapper = styled(Box)`
|
|
|
11438
11655
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
11439
11656
|
z-index: 1;
|
|
11440
11657
|
`;
|
|
11441
|
-
const usePrevious = (value) => {
|
|
11442
|
-
const ref = React.useRef();
|
|
11443
|
-
React.useEffect(() => {
|
|
11444
|
-
ref.current = value;
|
|
11445
|
-
});
|
|
11446
|
-
return ref.current;
|
|
11447
|
-
};
|
|
11448
11658
|
const CustomDivider = styled(Divider)`
|
|
11449
11659
|
width: 2.4rem;
|
|
11450
11660
|
background-color: ${({ theme }) => theme.colors.neutral200};
|
|
@@ -11464,7 +11674,7 @@ const SubNavHeader = ({
|
|
|
11464
11674
|
id
|
|
11465
11675
|
}) => {
|
|
11466
11676
|
const [isSearchOpen, setSearchOpen] = React.useState(false);
|
|
11467
|
-
const previousSearchOpenValue =
|
|
11677
|
+
const previousSearchOpenValue = usePrev(isSearchOpen);
|
|
11468
11678
|
const clearButtonId = useId(id);
|
|
11469
11679
|
const searchRef = React.useRef(void 0);
|
|
11470
11680
|
const searchButtonRef = React.useRef(void 0);
|
|
@@ -11544,6 +11754,12 @@ const SubNavLink = forwardRef(
|
|
|
11544
11754
|
);
|
|
11545
11755
|
}
|
|
11546
11756
|
);
|
|
11757
|
+
const CustomBullet = styled.span`
|
|
11758
|
+
width: 0.4rem;
|
|
11759
|
+
height: 0.4rem;
|
|
11760
|
+
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11761
|
+
border-radius: 50%;
|
|
11762
|
+
`;
|
|
11547
11763
|
const SubNavLinkWrapper = styled(BaseLink)`
|
|
11548
11764
|
display: flex;
|
|
11549
11765
|
align-items: center;
|
|
@@ -11563,18 +11779,16 @@ const SubNavLinkWrapper = styled(BaseLink)`
|
|
|
11563
11779
|
font-weight: 500;
|
|
11564
11780
|
`;
|
|
11565
11781
|
}}
|
|
11782
|
+
|
|
11783
|
+
${CustomBullet} {
|
|
11784
|
+
background-color: ${({ theme }) => theme.colors.primary600};
|
|
11785
|
+
}
|
|
11566
11786
|
}
|
|
11567
11787
|
|
|
11568
11788
|
&:focus-visible {
|
|
11569
11789
|
outline-offset: -2px;
|
|
11570
11790
|
}
|
|
11571
11791
|
`;
|
|
11572
|
-
const CustomBullet = styled.span`
|
|
11573
|
-
width: 0.4rem;
|
|
11574
|
-
height: 0.4rem;
|
|
11575
|
-
background-color: ${({ theme, $active }) => $active ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11576
|
-
border-radius: 50%;
|
|
11577
|
-
`;
|
|
11578
11792
|
const IconWrapper = styled.div`
|
|
11579
11793
|
svg {
|
|
11580
11794
|
height: 1.6rem;
|
|
@@ -11705,341 +11919,216 @@ const SubNavSections = ({ children, spacing = 2, horizontal = false, ...props })
|
|
|
11705
11919
|
}
|
|
11706
11920
|
) });
|
|
11707
11921
|
};
|
|
11708
|
-
const
|
|
11709
|
-
({
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11722
|
-
|
|
11723
|
-
|
|
11724
|
-
|
|
11725
|
-
|
|
11726
|
-
|
|
11727
|
-
|
|
11728
|
-
|
|
11922
|
+
const SwitchImpl = React.forwardRef(
|
|
11923
|
+
({
|
|
11924
|
+
visibleLabels,
|
|
11925
|
+
onLabel = "On",
|
|
11926
|
+
offLabel = "Off",
|
|
11927
|
+
onCheckedChange: onCheckedChangeProp,
|
|
11928
|
+
checked: checkedProp,
|
|
11929
|
+
defaultChecked,
|
|
11930
|
+
disabled,
|
|
11931
|
+
...restProps
|
|
11932
|
+
}, forwardedRef) => {
|
|
11933
|
+
const [internalChecked, setInternalChecked] = useControllableState$1({
|
|
11934
|
+
prop: checkedProp,
|
|
11935
|
+
defaultProp: defaultChecked
|
|
11936
|
+
});
|
|
11937
|
+
const handleCheckChange = (checked) => {
|
|
11938
|
+
setInternalChecked(checked);
|
|
11939
|
+
};
|
|
11940
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: 3, children: [
|
|
11941
|
+
/* @__PURE__ */ jsx(
|
|
11942
|
+
SwitchRoot,
|
|
11943
|
+
{
|
|
11944
|
+
ref: forwardedRef,
|
|
11945
|
+
onCheckedChange: composeEventHandlers(onCheckedChangeProp, handleCheckChange),
|
|
11946
|
+
checked: internalChecked,
|
|
11947
|
+
disabled,
|
|
11948
|
+
...restProps,
|
|
11949
|
+
children: /* @__PURE__ */ jsx(SwitchThumb, {})
|
|
11950
|
+
}
|
|
11951
|
+
),
|
|
11952
|
+
visibleLabels ? /* @__PURE__ */ jsx(LabelTypography, { "aria-hidden": true, "data-disabled": disabled, "data-state": internalChecked ? "checked" : "unchecked", children: internalChecked ? onLabel : offLabel }) : null
|
|
11953
|
+
] });
|
|
11729
11954
|
}
|
|
11730
11955
|
);
|
|
11731
|
-
const
|
|
11732
|
-
background: ${({ theme }) => theme.colors.danger500};
|
|
11733
|
-
border: none;
|
|
11734
|
-
border-radius: 16px;
|
|
11735
|
-
position: relative;
|
|
11736
|
-
height: 2.4rem;
|
|
11956
|
+
const SwitchRoot = styled(Switch.Root)`
|
|
11737
11957
|
width: 4rem;
|
|
11958
|
+
height: 2.4rem;
|
|
11959
|
+
border-radius: 1.2rem;
|
|
11960
|
+
background-color: ${({ theme }) => theme.colors.danger500};
|
|
11738
11961
|
|
|
11739
|
-
&
|
|
11740
|
-
|
|
11962
|
+
&[data-state='checked'] {
|
|
11963
|
+
background-color: ${({ theme }) => theme.colors.success500};
|
|
11741
11964
|
}
|
|
11742
11965
|
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
background: ${({ theme }) => theme.colors.neutral0};
|
|
11746
|
-
width: 1rem;
|
|
11747
|
-
height: 1rem;
|
|
11748
|
-
border-radius: 50%;
|
|
11749
|
-
position: absolute;
|
|
11750
|
-
transition: all 0.5s;
|
|
11751
|
-
left: ${({ theme }) => theme.spaces[1]};
|
|
11752
|
-
top: ${({ theme }) => theme.spaces[1]};
|
|
11966
|
+
&[data-disabled] {
|
|
11967
|
+
background-color: ${({ theme }) => theme.colors.neutral300};
|
|
11753
11968
|
}
|
|
11754
11969
|
|
|
11755
|
-
@media (prefers-reduced-motion:
|
|
11756
|
-
|
|
11757
|
-
transition: none;
|
|
11758
|
-
}
|
|
11970
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11971
|
+
transition: ${(props) => props.theme.transitions.backgroundColor};
|
|
11759
11972
|
}
|
|
11760
11973
|
`;
|
|
11761
|
-
const
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11974
|
+
const SwitchThumb = styled(Switch.Thumb)`
|
|
11975
|
+
display: block;
|
|
11976
|
+
height: 1.6rem;
|
|
11977
|
+
width: 1.6rem;
|
|
11978
|
+
border-radius: 50%;
|
|
11979
|
+
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
11980
|
+
transform: translateX(4px);
|
|
11765
11981
|
|
|
11766
|
-
&[
|
|
11767
|
-
|
|
11982
|
+
&[data-state='checked'] {
|
|
11983
|
+
transform: translateX(20px);
|
|
11768
11984
|
}
|
|
11769
11985
|
|
|
11770
|
-
|
|
11771
|
-
|
|
11986
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
11987
|
+
transition: transform ${(props) => props.theme.motion.timings["120"]}
|
|
11988
|
+
${(props) => props.theme.motion.easings.authenticMotion};
|
|
11772
11989
|
}
|
|
11773
11990
|
`;
|
|
11774
|
-
const
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11991
|
+
const LabelTypography = styled(Typography)`
|
|
11992
|
+
color: ${(props) => props.theme.colors.danger600};
|
|
11993
|
+
|
|
11994
|
+
&[data-state='checked'] {
|
|
11995
|
+
color: ${(props) => props.theme.colors.success600};
|
|
11996
|
+
}
|
|
11997
|
+
|
|
11998
|
+
&[data-disabled='true'] {
|
|
11999
|
+
color: ${({ theme }) => theme.colors.neutral500};
|
|
11782
12000
|
}
|
|
11783
|
-
return "transparent";
|
|
11784
|
-
}};
|
|
11785
12001
|
`;
|
|
11786
|
-
const
|
|
11787
|
-
|
|
12002
|
+
const [TabsProvider, useTabs] = createContext("Tabs");
|
|
12003
|
+
const Root = React.forwardRef(
|
|
12004
|
+
({ disabled = false, variant: variant2 = "regular", hasError, ...props }, forwardedRef) => {
|
|
12005
|
+
return /* @__PURE__ */ jsx(TabsProvider, { disabled, hasError, variant: variant2, children: /* @__PURE__ */ jsx(TabsRoot, { ref: forwardedRef, ...props }) });
|
|
12006
|
+
}
|
|
12007
|
+
);
|
|
12008
|
+
const TabsRoot = styled(Tabs$1.Root)`
|
|
12009
|
+
width: 100%;
|
|
12010
|
+
position: relative;
|
|
11788
12011
|
`;
|
|
11789
|
-
const
|
|
11790
|
-
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
12012
|
+
const List = React.forwardRef((props, forwardedRef) => {
|
|
12013
|
+
const { variant: variant2 } = useTabs("List");
|
|
12014
|
+
return /* @__PURE__ */ jsx(TabsList, { ref: forwardedRef, ...props, $variant: variant2 });
|
|
12015
|
+
});
|
|
12016
|
+
const TabsList = styled(Tabs$1.List)`
|
|
12017
|
+
display: flex;
|
|
12018
|
+
align-items: ${(props) => props.$variant === "regular" ? "flex-end" : "unset"};
|
|
12019
|
+
position: relative;
|
|
12020
|
+
z-index: 0;
|
|
12021
|
+
`;
|
|
12022
|
+
const Trigger = React.forwardRef(
|
|
12023
|
+
({ children, disabled: disabledProp, ...props }, forwardedRef) => {
|
|
12024
|
+
const { disabled: disabledContext, variant: variant2, hasError } = useTabs("Trigger");
|
|
12025
|
+
const isDisabled = disabledContext === true || disabledContext === props.value || disabledProp;
|
|
12026
|
+
const isErrored = hasError === props.value;
|
|
12027
|
+
return /* @__PURE__ */ jsxs(TabsTrigger, { ref: forwardedRef, ...props, $hasError: isErrored, $variant: variant2, disabled: isDisabled, children: [
|
|
12028
|
+
/* @__PURE__ */ jsx(TriggerTypography, { fontWeight: "bold", variant: variant2 === "simple" ? "sigma" : void 0, children }),
|
|
12029
|
+
variant2 === "simple" ? /* @__PURE__ */ jsx(TabBar, {}) : null
|
|
12030
|
+
] });
|
|
11796
12031
|
}
|
|
12032
|
+
);
|
|
12033
|
+
const TabBar = styled.span`
|
|
12034
|
+
display: block;
|
|
12035
|
+
width: 100%;
|
|
12036
|
+
background-color: currentColor;
|
|
12037
|
+
position: absolute;
|
|
12038
|
+
bottom: 0;
|
|
12039
|
+
left: 0;
|
|
12040
|
+
opacity: 0;
|
|
12041
|
+
height: 0.2rem;
|
|
11797
12042
|
|
|
11798
|
-
|
|
11799
|
-
|
|
12043
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
12044
|
+
transition: ${(props) => `opacity 200ms ${props.theme.motion.easings.authenticMotion}`};
|
|
11800
12045
|
}
|
|
12046
|
+
`;
|
|
12047
|
+
const TriggerTypography = styled(Typography)``;
|
|
12048
|
+
const TabsTrigger = styled(Tabs$1.Trigger)`
|
|
12049
|
+
position: relative;
|
|
12050
|
+
color: ${(props) => props.$hasError ? props.theme.colors.danger600 : props.theme.colors.neutral600};
|
|
12051
|
+
cursor: pointer;
|
|
12052
|
+
z-index: 0;
|
|
11801
12053
|
|
|
11802
|
-
|
|
11803
|
-
|
|
12054
|
+
${(props) => {
|
|
12055
|
+
if (props.$variant === "simple") {
|
|
12056
|
+
return css`
|
|
12057
|
+
padding-block: ${(props2) => props2.theme.spaces[4]};
|
|
12058
|
+
padding-inline: ${(props2) => props2.theme.spaces[4]};
|
|
11804
12059
|
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
flex: 1;
|
|
11812
|
-
}
|
|
12060
|
+
& > ${TriggerTypography} {
|
|
12061
|
+
line-height: 1.2rem;
|
|
12062
|
+
}
|
|
12063
|
+
|
|
12064
|
+
&[data-state='active'] {
|
|
12065
|
+
color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
|
|
11813
12066
|
|
|
11814
|
-
|
|
11815
|
-
|
|
12067
|
+
& > ${TabBar} {
|
|
12068
|
+
opacity: 1;
|
|
12069
|
+
}
|
|
12070
|
+
}
|
|
12071
|
+
`;
|
|
12072
|
+
} else {
|
|
12073
|
+
return css`
|
|
12074
|
+
padding-block: ${(props2) => props2.theme.spaces[3]};
|
|
12075
|
+
padding-inline: ${(props2) => props2.theme.spaces[3]};
|
|
12076
|
+
flex: 1;
|
|
12077
|
+
background-color: ${(props2) => props2.theme.colors.neutral100};
|
|
12078
|
+
border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral150};
|
|
12079
|
+
|
|
12080
|
+
&:not([data-state='active']) + &:not([data-state='active']) {
|
|
12081
|
+
border-left: solid 1px ${(props2) => props2.theme.colors.neutral150};
|
|
12082
|
+
}
|
|
12083
|
+
|
|
12084
|
+
&[data-state='active'] {
|
|
12085
|
+
padding-block: ${(props2) => props2.theme.spaces[4]};
|
|
12086
|
+
padding-inline: ${(props2) => props2.theme.spaces[4]};
|
|
12087
|
+
color: ${props.$hasError ? props.theme.colors.danger600 : props.theme.colors.primary700};
|
|
12088
|
+
border-top-right-radius: ${(props2) => props2.theme.borderRadius};
|
|
12089
|
+
border-top-left-radius: ${(props2) => props2.theme.borderRadius};
|
|
12090
|
+
background-color: ${(props2) => props2.theme.colors.neutral0};
|
|
12091
|
+
border-bottom: solid 1px ${(props2) => props2.theme.colors.neutral0};
|
|
12092
|
+
box-shadow: ${props.theme.shadows.tableShadow};
|
|
12093
|
+
z-index: 1;
|
|
12094
|
+
}
|
|
12095
|
+
`;
|
|
11816
12096
|
}
|
|
12097
|
+
}}
|
|
11817
12098
|
|
|
11818
|
-
|
|
11819
|
-
|
|
12099
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
12100
|
+
transition: ${(props) => `${props.theme.transitions.color}, ${props.theme.transitions.backgroundColor}, box-shadow ${props.theme.motion.timings["120"]} ${props.theme.motion.easings.easeOutQuad}`};
|
|
11820
12101
|
}
|
|
11821
12102
|
|
|
11822
|
-
&
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
border-right: none;
|
|
12103
|
+
&[data-disabled] {
|
|
12104
|
+
cursor: not-allowed;
|
|
12105
|
+
color: ${(props) => props.theme.colors.neutral400};
|
|
11826
12106
|
}
|
|
11827
12107
|
`;
|
|
11828
|
-
const
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
selectedTabIndex: 0,
|
|
11832
|
-
selectTabIndex() {
|
|
11833
|
-
throw new Error("TabsContext.selectTabIndex is not implemented.");
|
|
11834
|
-
}
|
|
12108
|
+
const Content = React.forwardRef((props, forwardedRef) => {
|
|
12109
|
+
const { variant: variant2 } = useTabs("Content");
|
|
12110
|
+
return /* @__PURE__ */ jsx(TabsContent, { $variant: variant2, ref: forwardedRef, ...props });
|
|
11835
12111
|
});
|
|
11836
|
-
const
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
if (nextFocusEl) {
|
|
11847
|
-
nextFocusEl.focus();
|
|
11848
|
-
handleTabChange(selectedTabIndex);
|
|
11849
|
-
}
|
|
11850
|
-
}
|
|
11851
|
-
if (!mountedRef.current) {
|
|
11852
|
-
mountedRef.current = true;
|
|
11853
|
-
}
|
|
11854
|
-
}, [selectedTabIndex, handleTabChange]);
|
|
11855
|
-
return tabsRef;
|
|
11856
|
-
};
|
|
11857
|
-
const TabButton = styled.button`
|
|
11858
|
-
&[aria-disabled='true'] {
|
|
11859
|
-
cursor: not-allowed;
|
|
12112
|
+
const TabsContent = styled(Tabs$1.Content)`
|
|
12113
|
+
${(props) => {
|
|
12114
|
+
if (props.$variant === "simple") {
|
|
12115
|
+
return css``;
|
|
12116
|
+
} else {
|
|
12117
|
+
return css`
|
|
12118
|
+
position: relative;
|
|
12119
|
+
z-index: 1;
|
|
12120
|
+
background-color: ${(props2) => props2.theme.colors.neutral0};
|
|
12121
|
+
`;
|
|
11860
12122
|
}
|
|
12123
|
+
}}
|
|
11861
12124
|
`;
|
|
11862
|
-
const Tabs =
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
selectedTabIndex,
|
|
11870
|
-
onTabClick: () => selectTabIndex(index),
|
|
11871
|
-
variant: variant2
|
|
11872
|
-
})
|
|
11873
|
-
);
|
|
11874
|
-
const handleKeyDown = (e) => {
|
|
11875
|
-
const hasAllChildrenDisabled = childrenArray.every((node) => node.props.disabled);
|
|
11876
|
-
if (hasAllChildrenDisabled) {
|
|
11877
|
-
return;
|
|
11878
|
-
}
|
|
11879
|
-
switch (e.key) {
|
|
11880
|
-
case KeyboardKeys.RIGHT: {
|
|
11881
|
-
const nextWantedIndex = selectedTabIndex + 1;
|
|
11882
|
-
const findNextIndex = (ref) => {
|
|
11883
|
-
const isDisabled = childrenArray[ref].props.disabled;
|
|
11884
|
-
if (!isDisabled) {
|
|
11885
|
-
return ref;
|
|
11886
|
-
}
|
|
11887
|
-
if (ref === childrenArray.length - 1) {
|
|
11888
|
-
return findNextIndex(0);
|
|
11889
|
-
}
|
|
11890
|
-
return findNextIndex(ref + 1);
|
|
11891
|
-
};
|
|
11892
|
-
const nextIndex = findNextIndex(nextWantedIndex >= childrenArray.length ? 0 : nextWantedIndex);
|
|
11893
|
-
selectTabIndex(nextIndex);
|
|
11894
|
-
break;
|
|
11895
|
-
}
|
|
11896
|
-
case KeyboardKeys.LEFT: {
|
|
11897
|
-
const nextWantedIndex = selectedTabIndex - 1;
|
|
11898
|
-
const findNextIndex = (ref) => {
|
|
11899
|
-
const isDisabled = childrenArray[ref].props.disabled;
|
|
11900
|
-
if (!isDisabled) {
|
|
11901
|
-
return ref;
|
|
11902
|
-
}
|
|
11903
|
-
if (ref === 0) {
|
|
11904
|
-
return findNextIndex(childrenArray.length - 1);
|
|
11905
|
-
}
|
|
11906
|
-
return findNextIndex(ref - 1);
|
|
11907
|
-
};
|
|
11908
|
-
const nextIndex = findNextIndex(nextWantedIndex < 0 ? childrenArray.length - 1 : nextWantedIndex);
|
|
11909
|
-
selectTabIndex(nextIndex);
|
|
11910
|
-
break;
|
|
11911
|
-
}
|
|
11912
|
-
case KeyboardKeys.HOME: {
|
|
11913
|
-
const nextIndex = childrenArray.findIndex((node) => !node.props.disabled);
|
|
11914
|
-
selectTabIndex(nextIndex);
|
|
11915
|
-
break;
|
|
11916
|
-
}
|
|
11917
|
-
case KeyboardKeys.END: {
|
|
11918
|
-
const arrayOfChildrenProps = childrenArray.map((node, index) => ({ isDisabled: node.props.disabled, index }));
|
|
11919
|
-
const firstNonDisabledChildren = arrayOfChildrenProps.reverse().find(({ isDisabled }) => !isDisabled);
|
|
11920
|
-
if (firstNonDisabledChildren) {
|
|
11921
|
-
selectTabIndex(firstNonDisabledChildren.index);
|
|
11922
|
-
}
|
|
11923
|
-
break;
|
|
11924
|
-
}
|
|
11925
|
-
}
|
|
11926
|
-
};
|
|
11927
|
-
if (variant2 === "simple") {
|
|
11928
|
-
return /* @__PURE__ */ jsx("div", { ref: tabsRef, role: "tablist", "aria-label": label, onKeyDown: handleKeyDown, ...props, children: childrenArray });
|
|
11929
|
-
}
|
|
11930
|
-
return /* @__PURE__ */ jsx(
|
|
11931
|
-
DefaultTabsRow,
|
|
11932
|
-
{
|
|
11933
|
-
ref: tabsRef,
|
|
11934
|
-
role: "tablist",
|
|
11935
|
-
alignItems: "flex-end",
|
|
11936
|
-
"aria-label": label,
|
|
11937
|
-
onKeyDown: handleKeyDown,
|
|
11938
|
-
...props,
|
|
11939
|
-
children: childrenArray
|
|
11940
|
-
}
|
|
11941
|
-
);
|
|
11942
|
-
};
|
|
11943
|
-
const Tab = ({
|
|
11944
|
-
disabled = false,
|
|
11945
|
-
id,
|
|
11946
|
-
children,
|
|
11947
|
-
variant: variant2,
|
|
11948
|
-
hasError = false,
|
|
11949
|
-
index,
|
|
11950
|
-
selectedTabIndex,
|
|
11951
|
-
onTabClick,
|
|
11952
|
-
...props
|
|
11953
|
-
}) => {
|
|
11954
|
-
const tabId = `${id}-tab`;
|
|
11955
|
-
const tabPanelId = `${id}-tabpanel`;
|
|
11956
|
-
const selected = index === selectedTabIndex;
|
|
11957
|
-
const handleClick = () => {
|
|
11958
|
-
if (disabled) {
|
|
11959
|
-
return;
|
|
11960
|
-
}
|
|
11961
|
-
if (onTabClick) {
|
|
11962
|
-
onTabClick();
|
|
11963
|
-
}
|
|
11964
|
-
};
|
|
11965
|
-
if (variant2 === "simple") {
|
|
11966
|
-
let textColor;
|
|
11967
|
-
if (hasError) {
|
|
11968
|
-
textColor = "danger600";
|
|
11969
|
-
} else if (selected) {
|
|
11970
|
-
textColor = "primary600";
|
|
11971
|
-
} else if (disabled) {
|
|
11972
|
-
textColor = "neutral600";
|
|
11973
|
-
} else {
|
|
11974
|
-
textColor = "neutral600";
|
|
11975
|
-
}
|
|
11976
|
-
return /* @__PURE__ */ jsx(
|
|
11977
|
-
TabButton,
|
|
11978
|
-
{
|
|
11979
|
-
id: tabId,
|
|
11980
|
-
role: "tab",
|
|
11981
|
-
"aria-controls": selected ? tabPanelId : void 0,
|
|
11982
|
-
tabIndex: selected ? 0 : -1,
|
|
11983
|
-
"aria-selected": selected,
|
|
11984
|
-
type: "button",
|
|
11985
|
-
onClick: handleClick,
|
|
11986
|
-
"aria-disabled": disabled,
|
|
11987
|
-
...props,
|
|
11988
|
-
children: /* @__PURE__ */ jsx(SimpleTabBox, { padding: 4, $selected: selected, $hasError: hasError, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor, children }) })
|
|
11989
|
-
}
|
|
11990
|
-
);
|
|
11991
|
-
}
|
|
11992
|
-
if (hasError) {
|
|
11993
|
-
console.warn('The "hasError" prop is only available for the "simple" variant.');
|
|
11994
|
-
}
|
|
11995
|
-
const showRightBorder = selectedTabIndex && selectedTabIndex - 1 === index;
|
|
11996
|
-
return /* @__PURE__ */ jsx(
|
|
11997
|
-
DefaultTabButton,
|
|
11998
|
-
{
|
|
11999
|
-
id: tabId,
|
|
12000
|
-
role: "tab",
|
|
12001
|
-
type: "button",
|
|
12002
|
-
"aria-controls": selected ? tabPanelId : void 0,
|
|
12003
|
-
tabIndex: selected ? 0 : -1,
|
|
12004
|
-
"aria-selected": selected,
|
|
12005
|
-
onClick: handleClick,
|
|
12006
|
-
"aria-disabled": disabled,
|
|
12007
|
-
$showRightBorder: Boolean(showRightBorder),
|
|
12008
|
-
...props,
|
|
12009
|
-
children: /* @__PURE__ */ jsx(DefaultTabBox, { padding: selected ? 4 : 3, background: selected ? "neutral0" : "neutral100", $selected: selected, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", textColor: selected ? "primary700" : "neutral600", children }) })
|
|
12010
|
-
}
|
|
12011
|
-
);
|
|
12012
|
-
};
|
|
12013
|
-
const TabPanels = ({ children, ...props }) => {
|
|
12014
|
-
const { id, selectedTabIndex } = useTabs();
|
|
12015
|
-
const childrenArray = React.Children.toArray(children).map((node, index) => React.cloneElement(node, { id: `${id}-${index}` })).filter((_, index) => index === selectedTabIndex);
|
|
12016
|
-
return /* @__PURE__ */ jsx("div", { ...props, children: childrenArray });
|
|
12017
|
-
};
|
|
12018
|
-
const TabPanel = ({ id, ...props }) => {
|
|
12019
|
-
const tabId = `${id}-tab`;
|
|
12020
|
-
const tabPanelId = `${id}-tabpanel`;
|
|
12021
|
-
return /* @__PURE__ */ jsx("div", { id: tabPanelId, role: "tabpanel", tabIndex: 0, "aria-labelledby": tabId, ...props });
|
|
12022
|
-
};
|
|
12023
|
-
const TabGroup = React.forwardRef(
|
|
12024
|
-
({ id, initialSelectedTabIndex, label, onTabChange, selectedTabIndex: selectedTabIndexProp, variant: variant2, ...props }, ref) => {
|
|
12025
|
-
const tabsId = useId(id);
|
|
12026
|
-
const [selectedTabIndex = 0, setSelectedTabIndex] = useControllableState({
|
|
12027
|
-
prop: selectedTabIndexProp,
|
|
12028
|
-
defaultProp: initialSelectedTabIndex,
|
|
12029
|
-
// @ts-expect-error - TODO: fix this.
|
|
12030
|
-
onChange: onTabChange
|
|
12031
|
-
});
|
|
12032
|
-
React.useImperativeHandle(ref, () => ({
|
|
12033
|
-
_handlers: { setSelectedTabIndex }
|
|
12034
|
-
}));
|
|
12035
|
-
const context = React.useMemo(
|
|
12036
|
-
() => ({ id: tabsId, selectedTabIndex, selectTabIndex: setSelectedTabIndex, label, variant: variant2, onTabChange }),
|
|
12037
|
-
[label, onTabChange, selectedTabIndex, tabsId, variant2, setSelectedTabIndex]
|
|
12038
|
-
);
|
|
12039
|
-
return /* @__PURE__ */ jsx(TabsContext.Provider, { value: context, children: /* @__PURE__ */ jsx("div", { ...props }) });
|
|
12040
|
-
}
|
|
12041
|
-
);
|
|
12042
|
-
TabGroup.displayName = "TabGroup";
|
|
12125
|
+
const Tabs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12126
|
+
__proto__: null,
|
|
12127
|
+
Content,
|
|
12128
|
+
List,
|
|
12129
|
+
Root,
|
|
12130
|
+
Trigger
|
|
12131
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
12043
12132
|
const TableContainer = styled(Box)`
|
|
12044
12133
|
overflow: hidden;
|
|
12045
12134
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
@@ -12320,7 +12409,7 @@ const Toggle = React.forwardRef(
|
|
|
12320
12409
|
onChange,
|
|
12321
12410
|
...props
|
|
12322
12411
|
}, forwardedRef) => {
|
|
12323
|
-
const [checked = false, setChecked] = useControllableState({
|
|
12412
|
+
const [checked = false, setChecked] = useControllableState$1({
|
|
12324
12413
|
prop: checkedProp
|
|
12325
12414
|
});
|
|
12326
12415
|
const isFalseyChecked = checked !== null && !checked;
|
|
@@ -12434,17 +12523,111 @@ const Input = styled.input`
|
|
|
12434
12523
|
z-index: 0;
|
|
12435
12524
|
width: 100%;
|
|
12436
12525
|
`;
|
|
12526
|
+
const defaultState = {
|
|
12527
|
+
x: 0,
|
|
12528
|
+
y: 0,
|
|
12529
|
+
width: 0,
|
|
12530
|
+
height: 0,
|
|
12531
|
+
top: 0,
|
|
12532
|
+
left: 0,
|
|
12533
|
+
bottom: 0,
|
|
12534
|
+
right: 0
|
|
12535
|
+
};
|
|
12536
|
+
function useMeasure() {
|
|
12537
|
+
const [element, ref] = useState(null);
|
|
12538
|
+
const [rect, setRect] = useState(defaultState);
|
|
12539
|
+
const observer = useMemo(
|
|
12540
|
+
() => new ResizeObserver((entries) => {
|
|
12541
|
+
if (entries[0]) {
|
|
12542
|
+
const { x, y, width, height, top, left, bottom, right } = entries[0].contentRect;
|
|
12543
|
+
setRect({ x, y, width, height, top, left, bottom, right });
|
|
12544
|
+
}
|
|
12545
|
+
}),
|
|
12546
|
+
[]
|
|
12547
|
+
);
|
|
12548
|
+
useIsomorphicLayoutEffect(() => {
|
|
12549
|
+
if (!element)
|
|
12550
|
+
return;
|
|
12551
|
+
observer.observe(element);
|
|
12552
|
+
return () => {
|
|
12553
|
+
observer.disconnect();
|
|
12554
|
+
};
|
|
12555
|
+
}, [element, observer]);
|
|
12556
|
+
return [ref, rect];
|
|
12557
|
+
}
|
|
12558
|
+
const KeyboardNavigable = ({ tagName, attributeName = "", ...props }) => {
|
|
12559
|
+
const isValidFocusedElement = () => {
|
|
12560
|
+
const focused = document.activeElement;
|
|
12561
|
+
if (!focused) {
|
|
12562
|
+
return false;
|
|
12563
|
+
}
|
|
12564
|
+
if (tagName) {
|
|
12565
|
+
return focused.tagName.toLowerCase() === tagName;
|
|
12566
|
+
}
|
|
12567
|
+
return focused.hasAttribute(attributeName);
|
|
12568
|
+
};
|
|
12569
|
+
const queryElement = (parentEl) => {
|
|
12570
|
+
if (tagName) {
|
|
12571
|
+
return parentEl.querySelectorAll(tagName);
|
|
12572
|
+
}
|
|
12573
|
+
return parentEl.querySelectorAll(`[${attributeName}]`);
|
|
12574
|
+
};
|
|
12575
|
+
const handleKeyDown = (e) => {
|
|
12576
|
+
switch (e.key) {
|
|
12577
|
+
case KeyboardKeys.RIGHT:
|
|
12578
|
+
case KeyboardKeys.DOWN: {
|
|
12579
|
+
if (isValidFocusedElement()) {
|
|
12580
|
+
e.preventDefault();
|
|
12581
|
+
const focused = document.activeElement;
|
|
12582
|
+
const allElements = [...queryElement(e.currentTarget)];
|
|
12583
|
+
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
12584
|
+
const nextIndex = focusedIndex + 1 < allElements.length ? focusedIndex + 1 : 0;
|
|
12585
|
+
allElements[nextIndex].focus();
|
|
12586
|
+
}
|
|
12587
|
+
break;
|
|
12588
|
+
}
|
|
12589
|
+
case KeyboardKeys.LEFT:
|
|
12590
|
+
case KeyboardKeys.UP: {
|
|
12591
|
+
if (isValidFocusedElement()) {
|
|
12592
|
+
e.preventDefault();
|
|
12593
|
+
const focused = document.activeElement;
|
|
12594
|
+
const allElements = [...queryElement(e.currentTarget)];
|
|
12595
|
+
const focusedIndex = allElements.findIndex((node) => node === focused);
|
|
12596
|
+
const nextIndex = focusedIndex - 1 > -1 ? focusedIndex - 1 : allElements.length - 1;
|
|
12597
|
+
allElements[nextIndex].focus();
|
|
12598
|
+
}
|
|
12599
|
+
break;
|
|
12600
|
+
}
|
|
12601
|
+
case KeyboardKeys.HOME: {
|
|
12602
|
+
if (isValidFocusedElement()) {
|
|
12603
|
+
e.preventDefault();
|
|
12604
|
+
const allElements = queryElement(e.currentTarget);
|
|
12605
|
+
const focusElement = allElements.item(0);
|
|
12606
|
+
focusElement.focus();
|
|
12607
|
+
}
|
|
12608
|
+
break;
|
|
12609
|
+
}
|
|
12610
|
+
case KeyboardKeys.END: {
|
|
12611
|
+
if (isValidFocusedElement()) {
|
|
12612
|
+
e.preventDefault();
|
|
12613
|
+
const allElements = queryElement(e.currentTarget);
|
|
12614
|
+
const focusElement = allElements.item(allElements.length - 1);
|
|
12615
|
+
focusElement.focus();
|
|
12616
|
+
}
|
|
12617
|
+
break;
|
|
12618
|
+
}
|
|
12619
|
+
}
|
|
12620
|
+
};
|
|
12621
|
+
return /* @__PURE__ */ jsx(Box, { onKeyDown: handleKeyDown, ...props });
|
|
12622
|
+
};
|
|
12437
12623
|
export {
|
|
12438
12624
|
AccessibleIcon,
|
|
12439
12625
|
Accordion,
|
|
12440
12626
|
Alert,
|
|
12441
12627
|
Avatar,
|
|
12442
|
-
AvatarGroup,
|
|
12443
12628
|
Badge,
|
|
12444
12629
|
BaseButton,
|
|
12445
|
-
BaseCheckbox,
|
|
12446
12630
|
BaseLink,
|
|
12447
|
-
BaseRadio,
|
|
12448
12631
|
Box,
|
|
12449
12632
|
Breadcrumbs,
|
|
12450
12633
|
Button,
|
|
@@ -12464,7 +12647,7 @@ export {
|
|
|
12464
12647
|
CarouselImage,
|
|
12465
12648
|
CarouselInput,
|
|
12466
12649
|
CarouselSlide,
|
|
12467
|
-
Checkbox,
|
|
12650
|
+
CheckboxImpl as Checkbox,
|
|
12468
12651
|
Combobox,
|
|
12469
12652
|
Option as ComboboxOption,
|
|
12470
12653
|
Crumb,
|
|
@@ -12474,8 +12657,6 @@ export {
|
|
|
12474
12657
|
DateTimePicker,
|
|
12475
12658
|
DesignSystemProvider,
|
|
12476
12659
|
Dialog,
|
|
12477
|
-
DialogBody,
|
|
12478
|
-
DialogFooter,
|
|
12479
12660
|
DismissibleLayer,
|
|
12480
12661
|
Divider,
|
|
12481
12662
|
Dots,
|
|
@@ -12484,10 +12665,8 @@ export {
|
|
|
12484
12665
|
Flex,
|
|
12485
12666
|
FocusTrap,
|
|
12486
12667
|
Grid,
|
|
12487
|
-
GridItemImpl as GridItem,
|
|
12488
12668
|
IconButton,
|
|
12489
12669
|
IconButtonGroup,
|
|
12490
|
-
Initials,
|
|
12491
12670
|
JSONInput,
|
|
12492
12671
|
KeyboardNavigable,
|
|
12493
12672
|
Link,
|
|
@@ -12497,32 +12676,27 @@ export {
|
|
|
12497
12676
|
Main,
|
|
12498
12677
|
Menu,
|
|
12499
12678
|
MenuItem,
|
|
12500
|
-
|
|
12501
|
-
ModalFooter,
|
|
12502
|
-
ModalHeader,
|
|
12503
|
-
ModalLayout,
|
|
12679
|
+
Modal,
|
|
12504
12680
|
MultiSelect,
|
|
12505
12681
|
MultiSelectGroup,
|
|
12506
12682
|
MultiSelectNested,
|
|
12507
12683
|
MultiSelectOption,
|
|
12508
12684
|
NextLink,
|
|
12509
12685
|
NumberInput,
|
|
12510
|
-
POPOVER_PLACEMENTS,
|
|
12511
12686
|
PageLink,
|
|
12512
12687
|
Pagination,
|
|
12513
12688
|
Popover,
|
|
12514
|
-
primitives as PopoverPrimitives,
|
|
12515
12689
|
Portal$1 as Portal,
|
|
12516
12690
|
PreviousLink,
|
|
12517
12691
|
ProgressBar,
|
|
12518
12692
|
Radio,
|
|
12519
|
-
RadioGroup,
|
|
12520
12693
|
RawTable,
|
|
12521
12694
|
RawTbody,
|
|
12522
12695
|
RawTd,
|
|
12523
12696
|
RawTh,
|
|
12524
12697
|
RawThead,
|
|
12525
12698
|
RawTr,
|
|
12699
|
+
ScrollAreaImpl$1 as ScrollArea,
|
|
12526
12700
|
SearchForm,
|
|
12527
12701
|
Searchbar,
|
|
12528
12702
|
SimpleMenu,
|
|
@@ -12536,12 +12710,8 @@ export {
|
|
|
12536
12710
|
SubNavLinkSection,
|
|
12537
12711
|
SubNavSection,
|
|
12538
12712
|
SubNavSections,
|
|
12539
|
-
Switch,
|
|
12713
|
+
SwitchImpl as Switch,
|
|
12540
12714
|
TFooter,
|
|
12541
|
-
Tab,
|
|
12542
|
-
TabGroup,
|
|
12543
|
-
TabPanel,
|
|
12544
|
-
TabPanels,
|
|
12545
12715
|
Table,
|
|
12546
12716
|
Tabs,
|
|
12547
12717
|
Tag,
|
|
@@ -12558,6 +12728,7 @@ export {
|
|
|
12558
12728
|
Tr,
|
|
12559
12729
|
Typography,
|
|
12560
12730
|
VisuallyHidden,
|
|
12731
|
+
useUncontrolledState as _internaluseUncontrolledState,
|
|
12561
12732
|
composeEventHandlers2 as composeEventHandlers,
|
|
12562
12733
|
composeRefs,
|
|
12563
12734
|
convertUTCDateToCalendarDateTime,
|
|
@@ -12565,14 +12736,19 @@ export {
|
|
|
12565
12736
|
extendTheme,
|
|
12566
12737
|
getThemeSize,
|
|
12567
12738
|
inputFocusStyle,
|
|
12739
|
+
isSSR,
|
|
12568
12740
|
lightTheme,
|
|
12569
12741
|
useCallbackRef2 as useCallbackRef,
|
|
12570
12742
|
useCollator,
|
|
12571
12743
|
useComposedRefs,
|
|
12744
|
+
useControllableState$1 as useControllableState,
|
|
12572
12745
|
useDateFormatter,
|
|
12573
12746
|
useDesignSystem,
|
|
12574
12747
|
useField,
|
|
12575
12748
|
useFilter,
|
|
12749
|
+
useId,
|
|
12750
|
+
useIsomorphicLayoutEffect,
|
|
12751
|
+
useMeasure,
|
|
12576
12752
|
useNotifyAT
|
|
12577
12753
|
};
|
|
12578
12754
|
//# sourceMappingURL=index.mjs.map
|