@norges-domstoler/dds-components 18.3.0 → 19.1.0
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/IBMPlexSans-Medium-F6RY5FT3.woff +0 -0
- package/dist/IBMPlexSans-Medium-GPYSN6WY.woff2 +0 -0
- package/dist/IBMPlexSans-MediumItalic-HYTLJOHM.woff +0 -0
- package/dist/IBMPlexSans-MediumItalic-NOK4NVHM.woff2 +0 -0
- package/dist/index.css +117 -34
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +103 -164
- package/dist/index.d.ts +103 -164
- package/dist/index.js +1040 -893
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1096 -951
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(index_exports, {
|
|
|
34
34
|
Accordion: () => Accordion,
|
|
35
35
|
AccordionBody: () => AccordionBody,
|
|
36
36
|
AccordionHeader: () => AccordionHeader,
|
|
37
|
+
AddTabButton: () => AddTabButton,
|
|
37
38
|
AddressShieldedIcon: () => AddressShieldedIcon,
|
|
38
39
|
AgreementIcon: () => AgreementIcon,
|
|
39
40
|
AnimatedChevronUpDown: () => AnimatedChevronUpDown,
|
|
@@ -3680,13 +3681,11 @@ var OverflowMenuContext = (0, import_react33.createContext)({
|
|
|
3680
3681
|
unregisterItem: () => null
|
|
3681
3682
|
});
|
|
3682
3683
|
function OverflowMenuContextProvider({
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
onClose,
|
|
3686
|
-
children
|
|
3684
|
+
children,
|
|
3685
|
+
...rest
|
|
3687
3686
|
}) {
|
|
3688
3687
|
const [items, setItems] = (0, import_react33.useState)([]);
|
|
3689
|
-
const [focusIndex] = useRoveFocus(items.length, isOpen);
|
|
3688
|
+
const [focusIndex] = useRoveFocus(items.length, rest.isOpen);
|
|
3690
3689
|
(0, import_react33.useEffect)(() => {
|
|
3691
3690
|
var _a, _b;
|
|
3692
3691
|
(_b = (_a = items[focusIndex]) == null ? void 0 : _a.current) == null ? void 0 : _b.focus();
|
|
@@ -3695,9 +3694,7 @@ function OverflowMenuContextProvider({
|
|
|
3695
3694
|
OverflowMenuContext.Provider,
|
|
3696
3695
|
{
|
|
3697
3696
|
value: {
|
|
3698
|
-
|
|
3699
|
-
onToggle,
|
|
3700
|
-
onClose,
|
|
3697
|
+
...rest,
|
|
3701
3698
|
registerItem: (ref) => setItems((prev) => [...prev, ref]),
|
|
3702
3699
|
unregisterItem: (ref) => setItems((prev) => prev.filter((item) => item !== ref)),
|
|
3703
3700
|
focusedRef: items[focusIndex]
|
|
@@ -3706,7 +3703,7 @@ function OverflowMenuContextProvider({
|
|
|
3706
3703
|
}
|
|
3707
3704
|
);
|
|
3708
3705
|
}
|
|
3709
|
-
var
|
|
3706
|
+
var useOverflowMenuContext = () => {
|
|
3710
3707
|
return (0, import_react33.useContext)(OverflowMenuContext);
|
|
3711
3708
|
};
|
|
3712
3709
|
|
|
@@ -3727,64 +3724,31 @@ var OverflowMenu_default = {
|
|
|
3727
3724
|
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
3728
3725
|
var OverflowMenu = (0, import_react34.forwardRef)(
|
|
3729
3726
|
(props, ref) => {
|
|
3730
|
-
var _a, _b;
|
|
3731
3727
|
const {
|
|
3732
|
-
anchorRef,
|
|
3733
|
-
onClose,
|
|
3734
|
-
onToggle,
|
|
3735
|
-
isOpen = false,
|
|
3736
3728
|
placement = "bottom-end",
|
|
3737
|
-
id,
|
|
3738
3729
|
offset = 2,
|
|
3739
3730
|
className,
|
|
3740
3731
|
htmlProps = {},
|
|
3741
3732
|
...rest
|
|
3742
3733
|
} = props;
|
|
3743
|
-
const {
|
|
3744
|
-
placement,
|
|
3745
|
-
offset
|
|
3746
|
-
});
|
|
3747
|
-
const combinedRef = useCombinedRef(ref, refs.setFloating);
|
|
3734
|
+
const { isOpen, floatStyling, setFloatOptions, menuRef, menuId } = useOverflowMenuContext();
|
|
3748
3735
|
(0, import_react34.useEffect)(() => {
|
|
3749
|
-
|
|
3750
|
-
}, [
|
|
3751
|
-
useOnClickOutside(
|
|
3752
|
-
[(_a = refs == null ? void 0 : refs.floating) == null ? void 0 : _a.current, (_b = refs == null ? void 0 : refs.reference) == null ? void 0 : _b.current],
|
|
3753
|
-
() => {
|
|
3754
|
-
if (isOpen) {
|
|
3755
|
-
onClose && onClose();
|
|
3756
|
-
onToggle && onToggle();
|
|
3757
|
-
}
|
|
3758
|
-
}
|
|
3759
|
-
);
|
|
3760
|
-
useOnKeyDown(["Esc", "Escape"], () => {
|
|
3761
|
-
var _a2;
|
|
3762
|
-
if (isOpen) {
|
|
3763
|
-
onClose && onClose();
|
|
3764
|
-
onToggle && onToggle();
|
|
3765
|
-
anchorRef && ((_a2 = anchorRef.current) == null ? void 0 : _a2.focus());
|
|
3766
|
-
}
|
|
3767
|
-
});
|
|
3768
|
-
useOnKeyDown(["Tab"], () => {
|
|
3769
|
-
if (isOpen) {
|
|
3770
|
-
onClose && onClose();
|
|
3771
|
-
onToggle && onToggle();
|
|
3772
|
-
}
|
|
3773
|
-
});
|
|
3736
|
+
setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
|
|
3737
|
+
}, [placement, offset]);
|
|
3774
3738
|
const { style = {}, ...restHTMLProps } = htmlProps;
|
|
3775
|
-
const
|
|
3739
|
+
const openCn = isOpen ? "open" : "closed";
|
|
3776
3740
|
return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(
|
|
3777
3741
|
Paper,
|
|
3778
3742
|
{
|
|
3779
|
-
ref:
|
|
3743
|
+
ref: useCombinedRef(menuRef, ref),
|
|
3780
3744
|
...getBaseHTMLProps(
|
|
3781
|
-
|
|
3745
|
+
menuId,
|
|
3782
3746
|
cn(
|
|
3783
3747
|
className,
|
|
3784
3748
|
OverflowMenu_default.container,
|
|
3785
3749
|
utilStyles_default.scrollbar,
|
|
3786
3750
|
utilStyles_default["visibility-transition"],
|
|
3787
|
-
|
|
3751
|
+
utilStyles_default[`visibility-transition--${openCn}`]
|
|
3788
3752
|
),
|
|
3789
3753
|
restHTMLProps,
|
|
3790
3754
|
rest
|
|
@@ -3793,16 +3757,8 @@ var OverflowMenu = (0, import_react34.forwardRef)(
|
|
|
3793
3757
|
"aria-hidden": !isOpen,
|
|
3794
3758
|
border: "default",
|
|
3795
3759
|
elevation: 1,
|
|
3796
|
-
style: { ...style, ...
|
|
3797
|
-
children:
|
|
3798
|
-
OverflowMenuContextProvider,
|
|
3799
|
-
{
|
|
3800
|
-
isOpen,
|
|
3801
|
-
onToggle,
|
|
3802
|
-
onClose,
|
|
3803
|
-
children: props.children
|
|
3804
|
-
}
|
|
3805
|
-
)
|
|
3760
|
+
style: { ...style, ...floatStyling },
|
|
3761
|
+
children: props.children
|
|
3806
3762
|
}
|
|
3807
3763
|
);
|
|
3808
3764
|
}
|
|
@@ -3824,7 +3780,7 @@ var OverflowMenuButton = (0, import_react35.forwardRef)((props, ref) => {
|
|
|
3824
3780
|
} = props;
|
|
3825
3781
|
const itemRef = (0, import_react35.useRef)(null);
|
|
3826
3782
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
3827
|
-
const {
|
|
3783
|
+
const { onClose, registerItem, unregisterItem, focusedRef } = useOverflowMenuContext();
|
|
3828
3784
|
(0, import_react35.useEffect)(() => {
|
|
3829
3785
|
registerItem(itemRef);
|
|
3830
3786
|
return () => unregisterItem(itemRef);
|
|
@@ -3844,9 +3800,8 @@ var OverflowMenuButton = (0, import_react35.forwardRef)((props, ref) => {
|
|
|
3844
3800
|
focus_default["focusable--inset"]
|
|
3845
3801
|
),
|
|
3846
3802
|
onClick: (e) => {
|
|
3847
|
-
onClick
|
|
3848
|
-
onClose
|
|
3849
|
-
onToggle && onToggle();
|
|
3803
|
+
onClick == null ? void 0 : onClick(e);
|
|
3804
|
+
onClose == null ? void 0 : onClose();
|
|
3850
3805
|
},
|
|
3851
3806
|
...rest,
|
|
3852
3807
|
tabIndex: focusedRef === itemRef ? 0 : -1,
|
|
@@ -3875,7 +3830,7 @@ var OverflowMenuLink = (0, import_react36.forwardRef)((props, ref) => {
|
|
|
3875
3830
|
} = props;
|
|
3876
3831
|
const itemRef = (0, import_react36.useRef)(null);
|
|
3877
3832
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
3878
|
-
const {
|
|
3833
|
+
const { onClose, registerItem, unregisterItem, focusedRef } = useOverflowMenuContext();
|
|
3879
3834
|
(0, import_react36.useEffect)(() => {
|
|
3880
3835
|
registerItem(itemRef);
|
|
3881
3836
|
return () => unregisterItem(itemRef);
|
|
@@ -3896,9 +3851,8 @@ var OverflowMenuLink = (0, import_react36.forwardRef)((props, ref) => {
|
|
|
3896
3851
|
),
|
|
3897
3852
|
href,
|
|
3898
3853
|
onClick: (e) => {
|
|
3899
|
-
onClick
|
|
3900
|
-
onClose
|
|
3901
|
-
onToggle && onToggle();
|
|
3854
|
+
onClick == null ? void 0 : onClick(e);
|
|
3855
|
+
onClose == null ? void 0 : onClose();
|
|
3902
3856
|
},
|
|
3903
3857
|
...rest,
|
|
3904
3858
|
tabIndex: focusedRef === itemRef ? 0 : -1,
|
|
@@ -4022,42 +3976,75 @@ var import_jsx_runtime194 = require("react/jsx-runtime");
|
|
|
4022
3976
|
var OverflowMenuGroup = ({
|
|
4023
3977
|
children,
|
|
4024
3978
|
onClose,
|
|
4025
|
-
onToggle,
|
|
4026
3979
|
onOpen,
|
|
3980
|
+
setIsOpen: propSetIsOpen,
|
|
3981
|
+
isOpen: propIsOpen,
|
|
3982
|
+
isInitiallyOpen = false,
|
|
4027
3983
|
overflowMenuId
|
|
4028
3984
|
}) => {
|
|
4029
|
-
const [
|
|
3985
|
+
const [internalIsOpen, internalSetIsOpen] = (0, import_react42.useState)(isInitiallyOpen);
|
|
3986
|
+
const [isOpen, setIsOpen] = [
|
|
3987
|
+
propIsOpen != null ? propIsOpen : internalIsOpen,
|
|
3988
|
+
propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen
|
|
3989
|
+
];
|
|
4030
3990
|
const toggle = () => setIsOpen(!isOpen);
|
|
4031
3991
|
const close = () => setIsOpen(false);
|
|
4032
|
-
const buttonRef = (0, import_react42.useRef)(null);
|
|
4033
3992
|
const generatedId = (0, import_react42.useId)();
|
|
4034
3993
|
const uniqueOverflowMenuId = overflowMenuId != null ? overflowMenuId : `${generatedId}-overflowMenu`;
|
|
3994
|
+
const [floatOptions, setFloatOptions] = (0, import_react42.useState)();
|
|
3995
|
+
const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
|
|
3996
|
+
const buttonRef = (0, import_react42.useRef)(null);
|
|
3997
|
+
const anchorRef = refs.setReference;
|
|
3998
|
+
const combinedAnchorRef = useCombinedRef(buttonRef, anchorRef);
|
|
3999
|
+
const menuRef = (0, import_react42.useRef)(null);
|
|
4000
|
+
const floatingRef = refs.setFloating;
|
|
4001
|
+
const combinedMenuRef = useCombinedRef(menuRef, floatingRef);
|
|
4035
4002
|
const handleClose = () => {
|
|
4036
|
-
|
|
4037
|
-
|
|
4003
|
+
if (isOpen) {
|
|
4004
|
+
onClose && onClose();
|
|
4005
|
+
close();
|
|
4006
|
+
}
|
|
4038
4007
|
};
|
|
4039
4008
|
const handleToggle = () => {
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
onToggle && onToggle();
|
|
4009
|
+
!isOpen && (onOpen == null ? void 0 : onOpen());
|
|
4010
|
+
isOpen && (onClose == null ? void 0 : onClose());
|
|
4043
4011
|
toggle();
|
|
4044
4012
|
};
|
|
4013
|
+
useOnClickOutside([menuRef.current, buttonRef.current], () => {
|
|
4014
|
+
handleClose();
|
|
4015
|
+
});
|
|
4016
|
+
useOnKeyDown(["Esc", "Escape"], () => {
|
|
4017
|
+
var _a;
|
|
4018
|
+
if (isOpen) {
|
|
4019
|
+
onClose && onClose();
|
|
4020
|
+
close();
|
|
4021
|
+
(_a = buttonRef.current) == null ? void 0 : _a.focus();
|
|
4022
|
+
}
|
|
4023
|
+
});
|
|
4024
|
+
useOnKeyDown(["Tab"], () => {
|
|
4025
|
+
handleClose();
|
|
4026
|
+
});
|
|
4045
4027
|
const Children8 = import_react42.Children.map(children, (child, childIndex) => {
|
|
4046
4028
|
return (0, import_react42.isValidElement)(child) && (childIndex === 0 ? (0, import_react42.cloneElement)(child, {
|
|
4047
4029
|
"aria-haspopup": "menu",
|
|
4048
4030
|
"aria-controls": uniqueOverflowMenuId,
|
|
4049
4031
|
"aria-expanded": isOpen,
|
|
4050
4032
|
onClick: handleToggle,
|
|
4051
|
-
ref:
|
|
4052
|
-
}) :
|
|
4033
|
+
ref: combinedAnchorRef
|
|
4034
|
+
}) : child);
|
|
4035
|
+
});
|
|
4036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
4037
|
+
OverflowMenuContextProvider,
|
|
4038
|
+
{
|
|
4053
4039
|
isOpen,
|
|
4054
|
-
id: uniqueOverflowMenuId,
|
|
4055
4040
|
onClose: handleClose,
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4041
|
+
menuRef: combinedMenuRef,
|
|
4042
|
+
setFloatOptions,
|
|
4043
|
+
floatStyling: positionStyles.floating,
|
|
4044
|
+
menuId: uniqueOverflowMenuId,
|
|
4045
|
+
children: Children8
|
|
4046
|
+
}
|
|
4047
|
+
);
|
|
4061
4048
|
};
|
|
4062
4049
|
OverflowMenuGroup.displayName = "OverflowMenuGroup";
|
|
4063
4050
|
|
|
@@ -4531,18 +4518,18 @@ var import_date4 = require("@internationalized/date");
|
|
|
4531
4518
|
var import_calendar3 = require("@react-aria/calendar");
|
|
4532
4519
|
var import_i18n2 = require("@react-aria/i18n");
|
|
4533
4520
|
var import_calendar4 = require("@react-stately/calendar");
|
|
4534
|
-
var
|
|
4521
|
+
var import_react55 = require("react");
|
|
4535
4522
|
|
|
4536
4523
|
// src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
|
|
4537
4524
|
var import_date3 = require("@internationalized/date");
|
|
4538
4525
|
var import_calendar2 = require("@react-aria/calendar");
|
|
4539
4526
|
var import_i18n = require("@react-aria/i18n");
|
|
4540
|
-
var
|
|
4527
|
+
var import_react54 = require("react");
|
|
4541
4528
|
|
|
4542
4529
|
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
4543
4530
|
var import_date = require("@internationalized/date");
|
|
4544
4531
|
var import_calendar = require("@react-aria/calendar");
|
|
4545
|
-
var
|
|
4532
|
+
var import_react51 = require("react");
|
|
4546
4533
|
|
|
4547
4534
|
// src/components/date-inputs/common/DateInput.module.css
|
|
4548
4535
|
var DateInput_default = {
|
|
@@ -4563,6 +4550,18 @@ var DateInput_default = {
|
|
|
4563
4550
|
disabled: "DateInput_disabled",
|
|
4564
4551
|
"popover-button--readonly": "DateInput_popover-button--readonly",
|
|
4565
4552
|
popover: "DateInput_popover",
|
|
4553
|
+
"popover--large-screen-hide-xs": "DateInput_popover--large-screen-hide-xs",
|
|
4554
|
+
"popover--large-screen-hide-sm": "DateInput_popover--large-screen-hide-sm",
|
|
4555
|
+
"popover--large-screen-hide-md": "DateInput_popover--large-screen-hide-md",
|
|
4556
|
+
"popover--large-screen-hide-lg": "DateInput_popover--large-screen-hide-lg",
|
|
4557
|
+
"popover--large-screen-hide-xl": "DateInput_popover--large-screen-hide-xl",
|
|
4558
|
+
modal: "DateInput_modal",
|
|
4559
|
+
"modal--small-screen-show-xs": "DateInput_modal--small-screen-show-xs",
|
|
4560
|
+
"modal--small-screen-show-sm": "DateInput_modal--small-screen-show-sm",
|
|
4561
|
+
"modal--small-screen-show-md": "DateInput_modal--small-screen-show-md",
|
|
4562
|
+
"modal--small-screen-show-lg": "DateInput_modal--small-screen-show-lg",
|
|
4563
|
+
"modal--small-screen-show-xl": "DateInput_modal--small-screen-show-xl",
|
|
4564
|
+
"modal-close-button-wrapper": "DateInput_modal-close-button-wrapper",
|
|
4566
4565
|
calendar: "DateInput_calendar",
|
|
4567
4566
|
calendar__header: "DateInput_calendar__header",
|
|
4568
4567
|
calendar__header__month: "DateInput_calendar__header__month",
|
|
@@ -4576,64 +4575,14 @@ var DateInput_default = {
|
|
|
4576
4575
|
"calendar__cell-button--unavailable--today": "DateInput_calendar__cell-button--unavailable--today"
|
|
4577
4576
|
};
|
|
4578
4577
|
|
|
4579
|
-
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
4580
|
-
var import_react51 = require("react");
|
|
4581
|
-
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
4582
|
-
var CalendarPopoverContext = (0, import_react51.createContext)({
|
|
4583
|
-
anchorRef: null,
|
|
4584
|
-
isOpen: false,
|
|
4585
|
-
onClose: () => null,
|
|
4586
|
-
showWeekNumbers: true
|
|
4587
|
-
});
|
|
4588
|
-
var CalendarPopover = ({
|
|
4589
|
-
children,
|
|
4590
|
-
onClose,
|
|
4591
|
-
...props
|
|
4592
|
-
}) => {
|
|
4593
|
-
const anchorRef = (0, import_react51.useRef)(null);
|
|
4594
|
-
useOnKeyDown("Escape", onClose);
|
|
4595
|
-
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(CalendarPopoverContext.Provider, { value: { anchorRef, onClose, ...props }, children });
|
|
4596
|
-
};
|
|
4597
|
-
var CalendarPopoverAnchor = ({
|
|
4598
|
-
children
|
|
4599
|
-
}) => {
|
|
4600
|
-
const { anchorRef } = (0, import_react51.useContext)(CalendarPopoverContext);
|
|
4601
|
-
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("div", { ref: anchorRef != null ? anchorRef : void 0, children });
|
|
4602
|
-
};
|
|
4603
|
-
var CalendarPopoverContent = ({
|
|
4604
|
-
children
|
|
4605
|
-
}) => {
|
|
4606
|
-
const ref = (0, import_react51.useRef)(null);
|
|
4607
|
-
const { refs, styles: floatingStyles } = useFloatPosition(null, {
|
|
4608
|
-
placement: "bottom-start"
|
|
4609
|
-
});
|
|
4610
|
-
const { isOpen, onClose, anchorRef } = (0, import_react51.useContext)(CalendarPopoverContext);
|
|
4611
|
-
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
4612
|
-
useOnClickOutside(ref.current, onClose);
|
|
4613
|
-
(0, import_react51.useEffect)(() => {
|
|
4614
|
-
var _a;
|
|
4615
|
-
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
4616
|
-
}, []);
|
|
4617
|
-
if (!isOpen) return null;
|
|
4618
|
-
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
4619
|
-
"div",
|
|
4620
|
-
{
|
|
4621
|
-
ref: combinedRef,
|
|
4622
|
-
className: DateInput_default.popover,
|
|
4623
|
-
style: floatingStyles.floating,
|
|
4624
|
-
children
|
|
4625
|
-
}
|
|
4626
|
-
);
|
|
4627
|
-
};
|
|
4628
|
-
|
|
4629
4578
|
// src/components/date-inputs/DatePicker/constants.ts
|
|
4630
4579
|
var locale = "no-NO";
|
|
4631
4580
|
var timezone = "Europe/Oslo";
|
|
4632
4581
|
|
|
4633
4582
|
// src/components/date-inputs/DatePicker/Calendar/CalendarCell.tsx
|
|
4634
|
-
var
|
|
4635
|
-
function CalendarCell({ date, state }) {
|
|
4636
|
-
const ref = (0,
|
|
4583
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
4584
|
+
function CalendarCell({ date, state, onClose }) {
|
|
4585
|
+
const ref = (0, import_react51.useRef)(null);
|
|
4637
4586
|
const {
|
|
4638
4587
|
buttonProps,
|
|
4639
4588
|
cellProps,
|
|
@@ -4644,16 +4593,15 @@ function CalendarCell({ date, state }) {
|
|
|
4644
4593
|
isUnavailable
|
|
4645
4594
|
} = (0, import_calendar.useCalendarCell)({ date }, state, ref);
|
|
4646
4595
|
if (isDisabled) {
|
|
4647
|
-
return /* @__PURE__ */ (0,
|
|
4596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("td", { ...cellProps });
|
|
4648
4597
|
}
|
|
4649
|
-
const { onClose } = (0, import_react52.useContext)(CalendarPopoverContext);
|
|
4650
4598
|
const variant = isSelected ? "selected" : isUnavailable || isDisabled ? "unavailable" : "default";
|
|
4651
4599
|
const closeOnKeyboardBlurForward = (event) => {
|
|
4652
4600
|
if (event.key === "Tab" && event.shiftKey === false) {
|
|
4653
4601
|
onClose();
|
|
4654
4602
|
}
|
|
4655
4603
|
};
|
|
4656
|
-
return /* @__PURE__ */ (0,
|
|
4604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("td", { ...cellProps, children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
4657
4605
|
"button",
|
|
4658
4606
|
{
|
|
4659
4607
|
...buttonProps,
|
|
@@ -4675,14 +4623,14 @@ function CalendarCell({ date, state }) {
|
|
|
4675
4623
|
CalendarCell.displayName = "CalendarCell";
|
|
4676
4624
|
|
|
4677
4625
|
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
4678
|
-
var
|
|
4626
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
4679
4627
|
var VisuallyHidden = (props) => {
|
|
4680
4628
|
const { id, className, htmlProps, as, ...rest } = props;
|
|
4681
4629
|
const cl = cn(className, utilStyles_default["visually-hidden"]);
|
|
4682
4630
|
if (as === "div") {
|
|
4683
|
-
return /* @__PURE__ */ (0,
|
|
4631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("div", { ...getBaseHTMLProps(id, cl, htmlProps, rest) });
|
|
4684
4632
|
}
|
|
4685
|
-
return /* @__PURE__ */ (0,
|
|
4633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("span", { ...getBaseHTMLProps(id, cl, htmlProps, rest) });
|
|
4686
4634
|
};
|
|
4687
4635
|
VisuallyHidden.displayName = "VisuallyHidden";
|
|
4688
4636
|
|
|
@@ -4721,8 +4669,191 @@ function isLeapYear(date) {
|
|
|
4721
4669
|
return date.year % 4 === 0 && date.year % 100 !== 0 || date.year % 400 === 0;
|
|
4722
4670
|
}
|
|
4723
4671
|
|
|
4724
|
-
// src/components/date-inputs/DatePicker/
|
|
4672
|
+
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
4673
|
+
var import_react53 = require("react");
|
|
4674
|
+
var import_react_dom2 = require("react-dom");
|
|
4675
|
+
|
|
4676
|
+
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
4677
|
+
var import_dds_design_tokens = require("@norges-domstoler/dds-design-tokens");
|
|
4678
|
+
var import_react52 = require("react");
|
|
4679
|
+
|
|
4680
|
+
// src/components/ThemeProvider/ThemeProvider.module.css
|
|
4681
|
+
var ThemeProvider_default = {
|
|
4682
|
+
"global-variables": "ThemeProvider_global-variables",
|
|
4683
|
+
"global-styles": "ThemeProvider_global-styles"
|
|
4684
|
+
};
|
|
4685
|
+
|
|
4686
|
+
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
4687
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
4688
|
+
var defaultTheme = "core";
|
|
4689
|
+
var ThemeContext = (0, import_react52.createContext)(
|
|
4690
|
+
void 0
|
|
4691
|
+
);
|
|
4692
|
+
function ThemeProvider({
|
|
4693
|
+
theme = defaultTheme,
|
|
4694
|
+
children
|
|
4695
|
+
}) {
|
|
4696
|
+
const themeRef = (0, import_react52.useRef)(null);
|
|
4697
|
+
const [element, setElement] = (0, import_react52.useState)(null);
|
|
4698
|
+
(0, import_react52.useEffect)(() => {
|
|
4699
|
+
setElement(themeRef.current);
|
|
4700
|
+
}, []);
|
|
4701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
4702
|
+
"div",
|
|
4703
|
+
{
|
|
4704
|
+
ref: themeRef,
|
|
4705
|
+
className: cn(
|
|
4706
|
+
`dds-${theme}`,
|
|
4707
|
+
ThemeProvider_default["global-variables"],
|
|
4708
|
+
ThemeProvider_default["global-styles"],
|
|
4709
|
+
"dds-themed"
|
|
4710
|
+
),
|
|
4711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(ThemeContext.Provider, { value: { theme, el: element }, children })
|
|
4712
|
+
}
|
|
4713
|
+
);
|
|
4714
|
+
}
|
|
4715
|
+
function useTheme() {
|
|
4716
|
+
var _a;
|
|
4717
|
+
const themeName = (_a = (0, import_react52.useContext)(ThemeContext)) == null ? void 0 : _a.theme;
|
|
4718
|
+
if (!themeName) {
|
|
4719
|
+
throw new Error("useTheme must be used inside a ThemeProvider");
|
|
4720
|
+
}
|
|
4721
|
+
const theme = import_dds_design_tokens.ddsTokens[themeName];
|
|
4722
|
+
return { theme, themeName };
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4725
|
+
// src/components/date-inputs/DatePicker/CalendarPopover.tsx
|
|
4725
4726
|
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
4727
|
+
var CalendarPopoverContext = (0, import_react53.createContext)({
|
|
4728
|
+
anchorRef: null,
|
|
4729
|
+
closeButtonRef: null,
|
|
4730
|
+
isOpen: false,
|
|
4731
|
+
onClose: () => null,
|
|
4732
|
+
showWeekNumbers: true
|
|
4733
|
+
});
|
|
4734
|
+
var CalendarPopover = ({
|
|
4735
|
+
children,
|
|
4736
|
+
onClose,
|
|
4737
|
+
...props
|
|
4738
|
+
}) => {
|
|
4739
|
+
const anchorRef = (0, import_react53.useRef)(null);
|
|
4740
|
+
const closeButtonRef = (0, import_react53.useRef)(null);
|
|
4741
|
+
useOnKeyDown("Escape", onClose);
|
|
4742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
4743
|
+
CalendarPopoverContext.Provider,
|
|
4744
|
+
{
|
|
4745
|
+
value: { anchorRef, closeButtonRef, onClose, ...props },
|
|
4746
|
+
children
|
|
4747
|
+
}
|
|
4748
|
+
);
|
|
4749
|
+
};
|
|
4750
|
+
var CalendarPopoverAnchor = ({
|
|
4751
|
+
children
|
|
4752
|
+
}) => {
|
|
4753
|
+
const { anchorRef } = (0, import_react53.useContext)(CalendarPopoverContext);
|
|
4754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { ref: anchorRef != null ? anchorRef : void 0, children });
|
|
4755
|
+
};
|
|
4756
|
+
var CalendarPopoverContent = ({
|
|
4757
|
+
children,
|
|
4758
|
+
className,
|
|
4759
|
+
smallScreenBreakpoint
|
|
4760
|
+
}) => {
|
|
4761
|
+
const ref = (0, import_react53.useRef)(null);
|
|
4762
|
+
const modalRef = (0, import_react53.useRef)(null);
|
|
4763
|
+
const { refs, styles: floatingStyles } = useFloatPosition(null, {
|
|
4764
|
+
placement: "bottom-start"
|
|
4765
|
+
});
|
|
4766
|
+
const themeContext = (0, import_react53.useContext)(ThemeContext);
|
|
4767
|
+
if (!themeContext) {
|
|
4768
|
+
throw new Error("DatePicker must be used within a ThemeProvider");
|
|
4769
|
+
}
|
|
4770
|
+
const portalTarget = themeContext.el;
|
|
4771
|
+
const { isOpen, onClose, anchorRef, closeButtonRef } = (0, import_react53.useContext)(
|
|
4772
|
+
CalendarPopoverContext
|
|
4773
|
+
);
|
|
4774
|
+
const hasTransitionedIn = useMountTransition(isOpen, 500);
|
|
4775
|
+
const isMounted = isOpen && hasTransitionedIn;
|
|
4776
|
+
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
4777
|
+
useOnClickOutside([ref.current, modalRef.current], onClose);
|
|
4778
|
+
(0, import_react53.useEffect)(() => {
|
|
4779
|
+
var _a;
|
|
4780
|
+
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
4781
|
+
}, []);
|
|
4782
|
+
const hasBreakpoint = !!smallScreenBreakpoint;
|
|
4783
|
+
(0, import_react53.useEffect)(() => {
|
|
4784
|
+
var _a;
|
|
4785
|
+
if (hasBreakpoint && ((_a = modalRef.current) == null ? void 0 : _a.checkVisibility())) {
|
|
4786
|
+
if (isOpen) {
|
|
4787
|
+
handleElementWithBackdropMount(document.body);
|
|
4788
|
+
} else {
|
|
4789
|
+
handleElementWithBackdropUnmount(document.body);
|
|
4790
|
+
}
|
|
4791
|
+
return () => handleElementWithBackdropUnmount(document.body);
|
|
4792
|
+
}
|
|
4793
|
+
}, [isOpen, hasBreakpoint]);
|
|
4794
|
+
const closeOnKeyboardBlurBack = (event) => {
|
|
4795
|
+
if (event.key === "Tab" && event.shiftKey === true) {
|
|
4796
|
+
onClose();
|
|
4797
|
+
}
|
|
4798
|
+
};
|
|
4799
|
+
if (!isOpen) return null;
|
|
4800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(import_jsx_runtime207.Fragment, { children: [
|
|
4801
|
+
portalTarget && hasBreakpoint && (0, import_react_dom2.createPortal)(
|
|
4802
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
4803
|
+
"div",
|
|
4804
|
+
{
|
|
4805
|
+
className: cn(
|
|
4806
|
+
DateInput_default.modal,
|
|
4807
|
+
!!smallScreenBreakpoint && DateInput_default[`modal--small-screen-show-${smallScreenBreakpoint}`]
|
|
4808
|
+
),
|
|
4809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(Backdrop, { zIndex: "modal", isMounted, children: /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)(
|
|
4810
|
+
Paper,
|
|
4811
|
+
{
|
|
4812
|
+
ref: modalRef,
|
|
4813
|
+
className: cn(DateInput_default.popover, className),
|
|
4814
|
+
elevation: 2,
|
|
4815
|
+
border: "default",
|
|
4816
|
+
children: [
|
|
4817
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)("div", { className: DateInput_default["modal-close-button-wrapper"], children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
4818
|
+
Button,
|
|
4819
|
+
{
|
|
4820
|
+
ref: closeButtonRef,
|
|
4821
|
+
icon: CloseIcon,
|
|
4822
|
+
size: "small",
|
|
4823
|
+
purpose: "tertiary",
|
|
4824
|
+
"aria-label": "Lukk",
|
|
4825
|
+
onClick: onClose,
|
|
4826
|
+
htmlProps: { onKeyDown: closeOnKeyboardBlurBack }
|
|
4827
|
+
}
|
|
4828
|
+
) }),
|
|
4829
|
+
children
|
|
4830
|
+
]
|
|
4831
|
+
}
|
|
4832
|
+
) })
|
|
4833
|
+
}
|
|
4834
|
+
),
|
|
4835
|
+
portalTarget
|
|
4836
|
+
),
|
|
4837
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
4838
|
+
Paper,
|
|
4839
|
+
{
|
|
4840
|
+
ref: combinedRef,
|
|
4841
|
+
className: cn(
|
|
4842
|
+
DateInput_default.popover,
|
|
4843
|
+
!!smallScreenBreakpoint && DateInput_default[`popover--large-screen-hide-${smallScreenBreakpoint}`],
|
|
4844
|
+
className
|
|
4845
|
+
),
|
|
4846
|
+
style: floatingStyles.floating,
|
|
4847
|
+
elevation: 2,
|
|
4848
|
+
border: "default",
|
|
4849
|
+
children
|
|
4850
|
+
}
|
|
4851
|
+
)
|
|
4852
|
+
] });
|
|
4853
|
+
};
|
|
4854
|
+
|
|
4855
|
+
// src/components/date-inputs/DatePicker/Calendar/CalendarGrid.tsx
|
|
4856
|
+
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
4726
4857
|
function CalendarGrid({ state, ...props }) {
|
|
4727
4858
|
const { locale: locale2 } = (0, import_i18n.useLocale)();
|
|
4728
4859
|
const {
|
|
@@ -4731,12 +4862,12 @@ function CalendarGrid({ state, ...props }) {
|
|
|
4731
4862
|
} = (0, import_calendar2.useCalendarGrid)(props, state);
|
|
4732
4863
|
const weeksInMonth = (0, import_date3.getWeeksInMonth)(state.visibleRange.start, locale2);
|
|
4733
4864
|
const weekDays = ["Ma", "Ti", "On", "To", "Fr", "L\xF8", "S\xF8"];
|
|
4734
|
-
const { showWeekNumbers } = (0,
|
|
4865
|
+
const { showWeekNumbers, onClose } = (0, import_react54.useContext)(CalendarPopoverContext);
|
|
4735
4866
|
const typographyCn = [
|
|
4736
4867
|
typographyStyles_default["body-xsmall"],
|
|
4737
4868
|
typographyStyles_default["text-color--subtle"]
|
|
4738
4869
|
];
|
|
4739
|
-
return /* @__PURE__ */ (0,
|
|
4870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
|
|
4740
4871
|
"table",
|
|
4741
4872
|
{
|
|
4742
4873
|
...gridProps,
|
|
@@ -4748,19 +4879,19 @@ function CalendarGrid({ state, ...props }) {
|
|
|
4748
4879
|
},
|
|
4749
4880
|
cellPadding: "0",
|
|
4750
4881
|
children: [
|
|
4751
|
-
/* @__PURE__ */ (0,
|
|
4752
|
-
showWeekNumbers && /* @__PURE__ */ (0,
|
|
4882
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)("thead", { ...headerProps, children: /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)("tr", { children: [
|
|
4883
|
+
showWeekNumbers && /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)("th", { className: cn(...typographyCn), children: [
|
|
4753
4884
|
"# ",
|
|
4754
|
-
/* @__PURE__ */ (0,
|
|
4885
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(VisuallyHidden, { as: "span", children: "Ukenummer" })
|
|
4755
4886
|
] }),
|
|
4756
|
-
weekDays.map((day, index) => /* @__PURE__ */ (0,
|
|
4887
|
+
weekDays.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("th", { className: cn(...typographyCn), children: day }, index))
|
|
4757
4888
|
] }) }),
|
|
4758
|
-
/* @__PURE__ */ (0,
|
|
4889
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)("tbody", { children: [...new Array(weeksInMonth).keys()].map((weekIndex) => {
|
|
4759
4890
|
const datesInWeek = state.getDatesInWeek(weekIndex);
|
|
4760
4891
|
const firstExistingDay = datesInWeek.find(Boolean);
|
|
4761
4892
|
const weekNumber = firstExistingDay ? getWeekNumber(firstExistingDay) : "";
|
|
4762
|
-
return /* @__PURE__ */ (0,
|
|
4763
|
-
showWeekNumbers && /* @__PURE__ */ (0,
|
|
4893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)("tr", { children: [
|
|
4894
|
+
showWeekNumbers && /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
4764
4895
|
"td",
|
|
4765
4896
|
{
|
|
4766
4897
|
className: cn(
|
|
@@ -4771,7 +4902,15 @@ function CalendarGrid({ state, ...props }) {
|
|
|
4771
4902
|
}
|
|
4772
4903
|
),
|
|
4773
4904
|
datesInWeek.map(
|
|
4774
|
-
(date, i) => date ? /* @__PURE__ */ (0,
|
|
4905
|
+
(date, i) => date ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
4906
|
+
CalendarCell,
|
|
4907
|
+
{
|
|
4908
|
+
state,
|
|
4909
|
+
date,
|
|
4910
|
+
onClose
|
|
4911
|
+
},
|
|
4912
|
+
i
|
|
4913
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime208.jsx)("td", {}, i)
|
|
4775
4914
|
)
|
|
4776
4915
|
] }, weekIndex);
|
|
4777
4916
|
}) })
|
|
@@ -4782,7 +4921,7 @@ function CalendarGrid({ state, ...props }) {
|
|
|
4782
4921
|
CalendarGrid.displayName = "CalendarGrid";
|
|
4783
4922
|
|
|
4784
4923
|
// src/components/date-inputs/DatePicker/Calendar/Calendar.tsx
|
|
4785
|
-
var
|
|
4924
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
4786
4925
|
function createCalendar(identifier) {
|
|
4787
4926
|
switch (identifier) {
|
|
4788
4927
|
case "gregory":
|
|
@@ -4804,15 +4943,18 @@ function Calendar(props) {
|
|
|
4804
4943
|
nextButtonProps: { onPress: onNext, "aria-label": nextAriaLabel },
|
|
4805
4944
|
title
|
|
4806
4945
|
} = (0, import_calendar3.useCalendar)(props, state);
|
|
4807
|
-
const { onClose } = (0,
|
|
4946
|
+
const { onClose, closeButtonRef } = (0, import_react55.useContext)(CalendarPopoverContext);
|
|
4808
4947
|
const closeOnKeyboardBlurBack = (event) => {
|
|
4948
|
+
var _a;
|
|
4809
4949
|
if (event.key === "Tab" && event.shiftKey === true) {
|
|
4810
|
-
|
|
4950
|
+
if (!((_a = closeButtonRef == null ? void 0 : closeButtonRef.current) == null ? void 0 : _a.checkVisibility())) {
|
|
4951
|
+
onClose();
|
|
4952
|
+
}
|
|
4811
4953
|
}
|
|
4812
4954
|
};
|
|
4813
|
-
return /* @__PURE__ */ (0,
|
|
4814
|
-
/* @__PURE__ */ (0,
|
|
4815
|
-
/* @__PURE__ */ (0,
|
|
4955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { ...calendarProps, className: DateInput_default.calendar, children: [
|
|
4956
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsxs)("div", { className: DateInput_default.calendar__header, children: [
|
|
4957
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
4816
4958
|
Button,
|
|
4817
4959
|
{
|
|
4818
4960
|
type: "button",
|
|
@@ -4825,7 +4967,7 @@ function Calendar(props) {
|
|
|
4825
4967
|
className: DateInput_default["calendar__month-button"]
|
|
4826
4968
|
}
|
|
4827
4969
|
),
|
|
4828
|
-
/* @__PURE__ */ (0,
|
|
4970
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
4829
4971
|
Heading,
|
|
4830
4972
|
{
|
|
4831
4973
|
level: 2,
|
|
@@ -4834,7 +4976,7 @@ function Calendar(props) {
|
|
|
4834
4976
|
children: title
|
|
4835
4977
|
}
|
|
4836
4978
|
),
|
|
4837
|
-
/* @__PURE__ */ (0,
|
|
4979
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
4838
4980
|
Button,
|
|
4839
4981
|
{
|
|
4840
4982
|
type: "button",
|
|
@@ -4847,7 +4989,7 @@ function Calendar(props) {
|
|
|
4847
4989
|
}
|
|
4848
4990
|
)
|
|
4849
4991
|
] }),
|
|
4850
|
-
/* @__PURE__ */ (0,
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime209.jsx)(CalendarGrid, { state })
|
|
4851
4993
|
] });
|
|
4852
4994
|
}
|
|
4853
4995
|
Calendar.displayName = "Calendar";
|
|
@@ -4856,39 +4998,33 @@ Calendar.displayName = "Calendar";
|
|
|
4856
4998
|
var import_datepicker4 = require("@react-aria/datepicker");
|
|
4857
4999
|
var import_i18n4 = require("@react-aria/i18n");
|
|
4858
5000
|
var import_datepicker5 = require("@react-stately/datepicker");
|
|
4859
|
-
var
|
|
5001
|
+
var import_react62 = require("react");
|
|
4860
5002
|
|
|
4861
5003
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
4862
5004
|
var import_date5 = require("@internationalized/date");
|
|
4863
5005
|
var import_datepicker2 = require("@react-aria/datepicker");
|
|
4864
5006
|
var import_i18n3 = require("@react-aria/i18n");
|
|
4865
5007
|
var import_datepicker3 = require("@react-stately/datepicker");
|
|
4866
|
-
var
|
|
5008
|
+
var import_react60 = require("react");
|
|
4867
5009
|
|
|
4868
5010
|
// src/components/date-inputs/DatePicker/DateField/CalendarButton.tsx
|
|
4869
5011
|
var import_button = require("@react-aria/button");
|
|
4870
|
-
var
|
|
4871
|
-
var
|
|
5012
|
+
var import_react56 = require("react");
|
|
5013
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
4872
5014
|
function CalendarButton({
|
|
4873
5015
|
componentSize,
|
|
4874
5016
|
isReadOnly,
|
|
4875
5017
|
...props
|
|
4876
5018
|
}) {
|
|
4877
|
-
const ref = (0,
|
|
5019
|
+
const ref = (0, import_react56.useRef)(null);
|
|
4878
5020
|
const { buttonProps } = (0, import_button.useButton)(props, ref);
|
|
4879
5021
|
const size2 = componentSize === "xsmall" ? "small" : "medium";
|
|
4880
|
-
return /* @__PURE__ */ (0,
|
|
5022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
4881
5023
|
"button",
|
|
4882
5024
|
{
|
|
4883
5025
|
...buttonProps,
|
|
4884
5026
|
ref,
|
|
4885
5027
|
type: "button",
|
|
4886
|
-
onClick: (e) => {
|
|
4887
|
-
var _a;
|
|
4888
|
-
if (!props.isDisabled && !isReadOnly) {
|
|
4889
|
-
(_a = buttonProps.onClick) == null ? void 0 : _a.call(buttonProps, e);
|
|
4890
|
-
}
|
|
4891
|
-
},
|
|
4892
5028
|
className: cn(
|
|
4893
5029
|
buttonProps.className,
|
|
4894
5030
|
DateInput_default["icon-wrapper"],
|
|
@@ -4898,15 +5034,15 @@ function CalendarButton({
|
|
|
4898
5034
|
!props.isDisabled && focusable,
|
|
4899
5035
|
props.isDisabled && "disabled"
|
|
4900
5036
|
),
|
|
4901
|
-
children: /* @__PURE__ */ (0,
|
|
5037
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(Icon, { icon: CalendarIcon, iconSize: size2 })
|
|
4902
5038
|
}
|
|
4903
5039
|
);
|
|
4904
5040
|
}
|
|
4905
5041
|
|
|
4906
5042
|
// src/components/date-inputs/DatePicker/DateField/DateSegment.tsx
|
|
4907
5043
|
var import_datepicker = require("@react-aria/datepicker");
|
|
4908
|
-
var
|
|
4909
|
-
var
|
|
5044
|
+
var import_react57 = require("react");
|
|
5045
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
4910
5046
|
var typographyTypes2 = {
|
|
4911
5047
|
medium: "bodyMedium",
|
|
4912
5048
|
small: "bodySmall",
|
|
@@ -4918,9 +5054,9 @@ function DateSegment({
|
|
|
4918
5054
|
componentSize
|
|
4919
5055
|
}) {
|
|
4920
5056
|
var _a;
|
|
4921
|
-
const ref = (0,
|
|
5057
|
+
const ref = (0, import_react57.useRef)(null);
|
|
4922
5058
|
const { segmentProps } = (0, import_datepicker.useDateSegment)(segment, state, ref);
|
|
4923
|
-
return /* @__PURE__ */ (0,
|
|
5059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(
|
|
4924
5060
|
"div",
|
|
4925
5061
|
{
|
|
4926
5062
|
...segmentProps,
|
|
@@ -4935,7 +5071,7 @@ function DateSegment({
|
|
|
4935
5071
|
minWidth: segment.maxValue != null ? String(segment.maxValue).length + "ch" : void 0
|
|
4936
5072
|
},
|
|
4937
5073
|
children: [
|
|
4938
|
-
/* @__PURE__ */ (0,
|
|
5074
|
+
/* @__PURE__ */ (0, import_jsx_runtime211.jsx)(
|
|
4939
5075
|
"span",
|
|
4940
5076
|
{
|
|
4941
5077
|
"aria-hidden": "true",
|
|
@@ -4955,10 +5091,10 @@ function DateSegment({
|
|
|
4955
5091
|
DateSegment.displayName = "DateSegment";
|
|
4956
5092
|
|
|
4957
5093
|
// src/components/date-inputs/common/DateInput.tsx
|
|
4958
|
-
var
|
|
5094
|
+
var import_react59 = require("react");
|
|
4959
5095
|
|
|
4960
5096
|
// src/components/InputMessage/InputMessage.tsx
|
|
4961
|
-
var
|
|
5097
|
+
var import_react58 = require("react");
|
|
4962
5098
|
|
|
4963
5099
|
// src/components/InputMessage/InputMessage.module.css
|
|
4964
5100
|
var InputMessage_default = {
|
|
@@ -4968,12 +5104,12 @@ var InputMessage_default = {
|
|
|
4968
5104
|
};
|
|
4969
5105
|
|
|
4970
5106
|
// src/components/InputMessage/InputMessage.tsx
|
|
4971
|
-
var
|
|
4972
|
-
var InputMessage = (0,
|
|
5107
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
5108
|
+
var InputMessage = (0, import_react58.forwardRef)(
|
|
4973
5109
|
(props, ref) => {
|
|
4974
5110
|
const { message, messageType, id, className, htmlProps, ...rest } = props;
|
|
4975
5111
|
const isError = messageType === "error";
|
|
4976
|
-
return /* @__PURE__ */ (0,
|
|
5112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(
|
|
4977
5113
|
"div",
|
|
4978
5114
|
{
|
|
4979
5115
|
...getBaseHTMLProps(
|
|
@@ -4988,8 +5124,8 @@ var InputMessage = (0, import_react57.forwardRef)(
|
|
|
4988
5124
|
),
|
|
4989
5125
|
ref,
|
|
4990
5126
|
children: [
|
|
4991
|
-
isError && /* @__PURE__ */ (0,
|
|
4992
|
-
/* @__PURE__ */ (0,
|
|
5127
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(Icon, { icon: ErrorIcon, iconSize: "small", className: InputMessage_default.icon }),
|
|
5128
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
4993
5129
|
Typography,
|
|
4994
5130
|
{
|
|
4995
5131
|
typographyType: isError ? "bodySmall" : "bodyXsmall",
|
|
@@ -5004,8 +5140,8 @@ var InputMessage = (0, import_react57.forwardRef)(
|
|
|
5004
5140
|
}
|
|
5005
5141
|
);
|
|
5006
5142
|
InputMessage.displayName = "InputMessage";
|
|
5007
|
-
var renderInputMessage = (tip, tipId, errorMessage, errorMessageId) => /* @__PURE__ */ (0,
|
|
5008
|
-
errorMessage && errorMessageId && /* @__PURE__ */ (0,
|
|
5143
|
+
var renderInputMessage = (tip, tipId, errorMessage, errorMessageId) => /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(import_jsx_runtime212.Fragment, { children: [
|
|
5144
|
+
errorMessage && errorMessageId && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
5009
5145
|
InputMessage,
|
|
5010
5146
|
{
|
|
5011
5147
|
message: errorMessage,
|
|
@@ -5013,11 +5149,11 @@ var renderInputMessage = (tip, tipId, errorMessage, errorMessageId) => /* @__PUR
|
|
|
5013
5149
|
id: errorMessageId
|
|
5014
5150
|
}
|
|
5015
5151
|
),
|
|
5016
|
-
tip && tipId && !errorMessage && /* @__PURE__ */ (0,
|
|
5152
|
+
tip && tipId && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(InputMessage, { message: tip, messageType: "tip", id: tipId })
|
|
5017
5153
|
] });
|
|
5018
5154
|
|
|
5019
5155
|
// src/components/date-inputs/common/DateInput.tsx
|
|
5020
|
-
var
|
|
5156
|
+
var import_jsx_runtime213 = require("react/jsx-runtime");
|
|
5021
5157
|
function _DateInput({
|
|
5022
5158
|
errorMessage,
|
|
5023
5159
|
tip,
|
|
@@ -5042,19 +5178,19 @@ function _DateInput({
|
|
|
5042
5178
|
const hasTip = !!tip;
|
|
5043
5179
|
const hasLabel = props.label != null;
|
|
5044
5180
|
const hasMessage = hasErrorMessage || hasTip;
|
|
5045
|
-
const { isOpen } = (0,
|
|
5181
|
+
const { isOpen } = (0, import_react59.useContext)(CalendarPopoverContext);
|
|
5046
5182
|
const styleVariables = {
|
|
5047
5183
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5048
5184
|
["--dds-date-input-width"]: width ? width : "fit-content"
|
|
5049
5185
|
};
|
|
5050
|
-
return /* @__PURE__ */ (0,
|
|
5186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
|
|
5051
5187
|
"div",
|
|
5052
5188
|
{
|
|
5053
5189
|
...groupProps,
|
|
5054
5190
|
className: cn(className, Input_default.container),
|
|
5055
5191
|
ref: forwardedRef,
|
|
5056
5192
|
children: [
|
|
5057
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
5193
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
5058
5194
|
Label,
|
|
5059
5195
|
{
|
|
5060
5196
|
...labelProps,
|
|
@@ -5064,7 +5200,7 @@ function _DateInput({
|
|
|
5064
5200
|
children: props.label
|
|
5065
5201
|
}
|
|
5066
5202
|
),
|
|
5067
|
-
/* @__PURE__ */ (0,
|
|
5203
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsxs)(
|
|
5068
5204
|
"div",
|
|
5069
5205
|
{
|
|
5070
5206
|
...fieldProps,
|
|
@@ -5088,11 +5224,11 @@ function _DateInput({
|
|
|
5088
5224
|
),
|
|
5089
5225
|
children: [
|
|
5090
5226
|
button,
|
|
5091
|
-
/* @__PURE__ */ (0,
|
|
5227
|
+
/* @__PURE__ */ (0, import_jsx_runtime213.jsx)("div", { className: DateInput_default["date-segment-container"], children })
|
|
5092
5228
|
]
|
|
5093
5229
|
}
|
|
5094
5230
|
),
|
|
5095
|
-
hasMessage && /* @__PURE__ */ (0,
|
|
5231
|
+
hasMessage && /* @__PURE__ */ (0, import_jsx_runtime213.jsx)(
|
|
5096
5232
|
InputMessage,
|
|
5097
5233
|
{
|
|
5098
5234
|
messageType: hasErrorMessage ? "error" : "tip",
|
|
@@ -5103,11 +5239,11 @@ function _DateInput({
|
|
|
5103
5239
|
}
|
|
5104
5240
|
);
|
|
5105
5241
|
}
|
|
5106
|
-
var DateInput = (0,
|
|
5242
|
+
var DateInput = (0, import_react59.forwardRef)(_DateInput);
|
|
5107
5243
|
DateInput.displayName = "DateInput";
|
|
5108
5244
|
|
|
5109
5245
|
// src/components/date-inputs/DatePicker/DateField/DateField.tsx
|
|
5110
|
-
var
|
|
5246
|
+
var import_jsx_runtime214 = require("react/jsx-runtime");
|
|
5111
5247
|
function _DateField({
|
|
5112
5248
|
componentSize = "medium",
|
|
5113
5249
|
buttonProps,
|
|
@@ -5120,10 +5256,10 @@ function _DateField({
|
|
|
5120
5256
|
locale: locale2,
|
|
5121
5257
|
createCalendar: import_date5.createCalendar
|
|
5122
5258
|
});
|
|
5123
|
-
const ref = (0,
|
|
5259
|
+
const ref = (0, import_react60.useRef)(null);
|
|
5124
5260
|
const { labelProps, fieldProps } = (0, import_datepicker2.useDateField)(props, state, ref);
|
|
5125
5261
|
const disabled = props.isDisabled || !!fieldProps["aria-disabled"];
|
|
5126
|
-
return /* @__PURE__ */ (0,
|
|
5262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
5127
5263
|
DateInput,
|
|
5128
5264
|
{
|
|
5129
5265
|
...props,
|
|
@@ -5135,7 +5271,7 @@ function _DateField({
|
|
|
5135
5271
|
ref: forwardedRef,
|
|
5136
5272
|
internalRef: ref,
|
|
5137
5273
|
readOnly: props.isReadOnly,
|
|
5138
|
-
prefix: /* @__PURE__ */ (0,
|
|
5274
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
5139
5275
|
CalendarButton,
|
|
5140
5276
|
{
|
|
5141
5277
|
componentSize,
|
|
@@ -5146,7 +5282,7 @@ function _DateField({
|
|
|
5146
5282
|
),
|
|
5147
5283
|
labelProps,
|
|
5148
5284
|
fieldProps,
|
|
5149
|
-
children: state.segments.map((segment, i) => /* @__PURE__ */ (0,
|
|
5285
|
+
children: state.segments.map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(
|
|
5150
5286
|
DateSegment,
|
|
5151
5287
|
{
|
|
5152
5288
|
"aria-readonly": props.isReadOnly,
|
|
@@ -5159,15 +5295,15 @@ function _DateField({
|
|
|
5159
5295
|
}
|
|
5160
5296
|
);
|
|
5161
5297
|
}
|
|
5162
|
-
var DateField = (0,
|
|
5298
|
+
var DateField = (0, import_react60.forwardRef)(_DateField);
|
|
5163
5299
|
DateField.displayName = "DateField";
|
|
5164
5300
|
|
|
5165
5301
|
// src/components/date-inputs/utils/useFocusManagerRef.ts
|
|
5166
5302
|
var import_focus13 = require("@react-aria/focus");
|
|
5167
|
-
var
|
|
5303
|
+
var import_react61 = require("react");
|
|
5168
5304
|
function useFocusManagerRef(ref) {
|
|
5169
|
-
const domRef = (0,
|
|
5170
|
-
(0,
|
|
5305
|
+
const domRef = (0, import_react61.useRef)(null);
|
|
5306
|
+
(0, import_react61.useImperativeHandle)(ref, () => ({
|
|
5171
5307
|
...createDOMRef(domRef),
|
|
5172
5308
|
focus() {
|
|
5173
5309
|
(0, import_focus13.createFocusManager)(domRef).focusFirst({ tabbable: true });
|
|
@@ -5184,7 +5320,7 @@ function createDOMRef(ref) {
|
|
|
5184
5320
|
}
|
|
5185
5321
|
|
|
5186
5322
|
// src/components/date-inputs/DatePicker/DatePicker.tsx
|
|
5187
|
-
var
|
|
5323
|
+
var import_jsx_runtime215 = require("react/jsx-runtime");
|
|
5188
5324
|
var refIsFocusable = (ref) => {
|
|
5189
5325
|
return typeof ref === "object" && ref !== null && "focus" in ref;
|
|
5190
5326
|
};
|
|
@@ -5194,58 +5330,60 @@ function _DatePicker({
|
|
|
5194
5330
|
tip,
|
|
5195
5331
|
style,
|
|
5196
5332
|
width,
|
|
5333
|
+
smallScreenBreakpoint,
|
|
5197
5334
|
showWeekNumbers = true,
|
|
5198
5335
|
...props
|
|
5199
5336
|
}, forwardedRef) {
|
|
5200
5337
|
const state = (0, import_datepicker5.useDatePickerState)(props);
|
|
5201
5338
|
const domRef = useFocusManagerRef(
|
|
5202
|
-
refIsFocusable(
|
|
5339
|
+
refIsFocusable(import_react62.forwardRef) ? forwardedRef : null
|
|
5203
5340
|
);
|
|
5204
|
-
const ref = (0,
|
|
5341
|
+
const ref = (0, import_react62.useRef)(null);
|
|
5205
5342
|
const combinedRef = useCombinedRef(ref, domRef);
|
|
5206
5343
|
const { buttonProps, calendarProps, fieldProps, groupProps } = (0, import_datepicker4.useDatePicker)(
|
|
5207
5344
|
{ ...props, granularity: "day" },
|
|
5208
5345
|
state,
|
|
5209
5346
|
ref
|
|
5210
5347
|
);
|
|
5211
|
-
|
|
5348
|
+
const dateField = /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(
|
|
5349
|
+
DateField,
|
|
5350
|
+
{
|
|
5351
|
+
...fieldProps,
|
|
5352
|
+
groupProps,
|
|
5353
|
+
ref: combinedRef,
|
|
5354
|
+
componentSize,
|
|
5355
|
+
tip,
|
|
5356
|
+
label: props.label,
|
|
5357
|
+
errorMessage,
|
|
5358
|
+
buttonProps,
|
|
5359
|
+
isOpen: state.isOpen,
|
|
5360
|
+
style,
|
|
5361
|
+
width
|
|
5362
|
+
}
|
|
5363
|
+
);
|
|
5364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_i18n4.I18nProvider, { locale, children: /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(
|
|
5212
5365
|
CalendarPopover,
|
|
5213
5366
|
{
|
|
5214
5367
|
isOpen: state.isOpen,
|
|
5215
5368
|
onClose: state.close,
|
|
5216
5369
|
showWeekNumbers,
|
|
5217
5370
|
children: [
|
|
5218
|
-
/* @__PURE__ */ (0,
|
|
5219
|
-
|
|
5220
|
-
{
|
|
5221
|
-
...fieldProps,
|
|
5222
|
-
groupProps,
|
|
5223
|
-
ref: combinedRef,
|
|
5224
|
-
componentSize,
|
|
5225
|
-
tip,
|
|
5226
|
-
label: props.label,
|
|
5227
|
-
errorMessage,
|
|
5228
|
-
buttonProps,
|
|
5229
|
-
isOpen: state.isOpen,
|
|
5230
|
-
style,
|
|
5231
|
-
width
|
|
5232
|
-
}
|
|
5233
|
-
) }),
|
|
5234
|
-
/* @__PURE__ */ (0, import_jsx_runtime214.jsx)(CalendarPopoverContent, { children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(Calendar, { ...calendarProps }) })
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(CalendarPopoverAnchor, { children: dateField }),
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime215.jsx)(CalendarPopoverContent, { smallScreenBreakpoint, children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(Calendar, { ...calendarProps }) })
|
|
5235
5373
|
]
|
|
5236
5374
|
}
|
|
5237
5375
|
) });
|
|
5238
5376
|
}
|
|
5239
|
-
var DatePicker = (0,
|
|
5377
|
+
var DatePicker = (0, import_react62.forwardRef)(_DatePicker);
|
|
5240
5378
|
DatePicker.displayName = "DatePicker";
|
|
5241
5379
|
|
|
5242
5380
|
// src/components/date-inputs/TimePicker/TimePicker.tsx
|
|
5243
5381
|
var import_datepicker6 = require("@react-aria/datepicker");
|
|
5244
5382
|
var import_datepicker7 = require("@react-stately/datepicker");
|
|
5245
|
-
var
|
|
5246
|
-
var
|
|
5383
|
+
var import_react63 = require("react");
|
|
5384
|
+
var import_jsx_runtime216 = require("react/jsx-runtime");
|
|
5247
5385
|
function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef) {
|
|
5248
|
-
const ref = (0,
|
|
5386
|
+
const ref = (0, import_react63.useRef)(null);
|
|
5249
5387
|
const state = (0, import_datepicker7.useTimeFieldState)({
|
|
5250
5388
|
...props,
|
|
5251
5389
|
locale
|
|
@@ -5257,7 +5395,7 @@ function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef
|
|
|
5257
5395
|
);
|
|
5258
5396
|
const iconSize = componentSize === "xsmall" ? "small" : "medium";
|
|
5259
5397
|
const disabled = props.isDisabled || !!fieldProps["aria-disabled"];
|
|
5260
|
-
return /* @__PURE__ */ (0,
|
|
5398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
5261
5399
|
DateInput,
|
|
5262
5400
|
{
|
|
5263
5401
|
...props,
|
|
@@ -5270,7 +5408,7 @@ function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef
|
|
|
5270
5408
|
readOnly: props.isReadOnly,
|
|
5271
5409
|
labelProps,
|
|
5272
5410
|
fieldProps,
|
|
5273
|
-
prefix: /* @__PURE__ */ (0,
|
|
5411
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
5274
5412
|
"span",
|
|
5275
5413
|
{
|
|
5276
5414
|
className: cn(
|
|
@@ -5279,10 +5417,10 @@ function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef
|
|
|
5279
5417
|
props.isReadOnly && DateInput_default["icon-wrapper--readonly"],
|
|
5280
5418
|
DateInput_default[`icon-wrapper--${iconSize}`]
|
|
5281
5419
|
),
|
|
5282
|
-
children: /* @__PURE__ */ (0,
|
|
5420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(Icon, { icon: TimeIcon, iconSize })
|
|
5283
5421
|
}
|
|
5284
5422
|
),
|
|
5285
|
-
children: state.segments.map((segment, i) => /* @__PURE__ */ (0,
|
|
5423
|
+
children: state.segments.map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime216.jsx)(
|
|
5286
5424
|
DateSegment,
|
|
5287
5425
|
{
|
|
5288
5426
|
componentSize,
|
|
@@ -5294,7 +5432,7 @@ function _TimePicker({ componentSize = "medium", width, ...props }, forwardedRef
|
|
|
5294
5432
|
}
|
|
5295
5433
|
);
|
|
5296
5434
|
}
|
|
5297
|
-
var TimePicker = (0,
|
|
5435
|
+
var TimePicker = (0, import_react63.forwardRef)(_TimePicker);
|
|
5298
5436
|
TimePicker.displayName = "TimePicker";
|
|
5299
5437
|
|
|
5300
5438
|
// src/components/date-inputs/utils/transform.ts
|
|
@@ -5327,7 +5465,7 @@ function calendarDateToNativeDate(date, time = new import_date6.Time(12, 0, 0, 0
|
|
|
5327
5465
|
}
|
|
5328
5466
|
|
|
5329
5467
|
// src/components/DescriptionList/DescriptionList.tsx
|
|
5330
|
-
var
|
|
5468
|
+
var import_react64 = require("react");
|
|
5331
5469
|
|
|
5332
5470
|
// src/components/DescriptionList/DescriptionList.module.css
|
|
5333
5471
|
var DescriptionList_default = {
|
|
@@ -5341,8 +5479,8 @@ var DescriptionList_default = {
|
|
|
5341
5479
|
};
|
|
5342
5480
|
|
|
5343
5481
|
// src/components/DescriptionList/DescriptionList.tsx
|
|
5344
|
-
var
|
|
5345
|
-
var DescriptionList = (0,
|
|
5482
|
+
var import_jsx_runtime217 = require("react/jsx-runtime");
|
|
5483
|
+
var DescriptionList = (0, import_react64.forwardRef)((props, ref) => {
|
|
5346
5484
|
const {
|
|
5347
5485
|
appearance = "default",
|
|
5348
5486
|
direction = "column",
|
|
@@ -5352,7 +5490,7 @@ var DescriptionList = (0, import_react63.forwardRef)((props, ref) => {
|
|
|
5352
5490
|
htmlProps,
|
|
5353
5491
|
...rest
|
|
5354
5492
|
} = props;
|
|
5355
|
-
return /* @__PURE__ */ (0,
|
|
5493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(
|
|
5356
5494
|
"dl",
|
|
5357
5495
|
{
|
|
5358
5496
|
ref,
|
|
@@ -5374,25 +5512,25 @@ var DescriptionList = (0, import_react63.forwardRef)((props, ref) => {
|
|
|
5374
5512
|
DescriptionList.displayName = "DescriptionList";
|
|
5375
5513
|
|
|
5376
5514
|
// src/components/DescriptionList/DescriptionListTerm.tsx
|
|
5377
|
-
var
|
|
5378
|
-
var
|
|
5379
|
-
var DescriptionListTerm = (0,
|
|
5380
|
-
return /* @__PURE__ */ (0,
|
|
5515
|
+
var import_react65 = require("react");
|
|
5516
|
+
var import_jsx_runtime218 = require("react/jsx-runtime");
|
|
5517
|
+
var DescriptionListTerm = (0, import_react65.forwardRef)(({ ...rest }, ref) => {
|
|
5518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("dt", { ref, ...rest });
|
|
5381
5519
|
});
|
|
5382
5520
|
DescriptionListTerm.displayName = "DescriptionListTerm";
|
|
5383
5521
|
|
|
5384
5522
|
// src/components/DescriptionList/DescriptionListDesc.tsx
|
|
5385
|
-
var
|
|
5386
|
-
var
|
|
5387
|
-
var DescriptionListDesc = (0,
|
|
5523
|
+
var import_react66 = require("react");
|
|
5524
|
+
var import_jsx_runtime219 = require("react/jsx-runtime");
|
|
5525
|
+
var DescriptionListDesc = (0, import_react66.forwardRef)((props, ref) => {
|
|
5388
5526
|
const { children, icon, id, className, htmlProps, ...rest } = props;
|
|
5389
|
-
return /* @__PURE__ */ (0,
|
|
5527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(
|
|
5390
5528
|
"dd",
|
|
5391
5529
|
{
|
|
5392
5530
|
ref,
|
|
5393
5531
|
...getBaseHTMLProps(id, cn(className, DescriptionList_default.desc), htmlProps, rest),
|
|
5394
5532
|
children: [
|
|
5395
|
-
icon && /* @__PURE__ */ (0,
|
|
5533
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(Icon, { icon }),
|
|
5396
5534
|
" ",
|
|
5397
5535
|
children
|
|
5398
5536
|
]
|
|
@@ -5402,9 +5540,9 @@ var DescriptionListDesc = (0, import_react65.forwardRef)((props, ref) => {
|
|
|
5402
5540
|
DescriptionListDesc.displayName = "DescriptionListDesc";
|
|
5403
5541
|
|
|
5404
5542
|
// src/components/DescriptionList/DescriptionListGroup.tsx
|
|
5405
|
-
var
|
|
5406
|
-
var
|
|
5407
|
-
var DescriptionListGroup = (0,
|
|
5543
|
+
var import_react67 = require("react");
|
|
5544
|
+
var import_jsx_runtime220 = require("react/jsx-runtime");
|
|
5545
|
+
var DescriptionListGroup = (0, import_react67.forwardRef)((props, ref) => {
|
|
5408
5546
|
const {
|
|
5409
5547
|
children,
|
|
5410
5548
|
margin,
|
|
@@ -5415,7 +5553,7 @@ var DescriptionListGroup = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
5415
5553
|
htmlProps,
|
|
5416
5554
|
...rest
|
|
5417
5555
|
} = props;
|
|
5418
|
-
return /* @__PURE__ */ (0,
|
|
5556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)(
|
|
5419
5557
|
"div",
|
|
5420
5558
|
{
|
|
5421
5559
|
ref,
|
|
@@ -5428,7 +5566,7 @@ var DescriptionListGroup = (0, import_react66.forwardRef)((props, ref) => {
|
|
|
5428
5566
|
DescriptionListGroup.displayName = "DescriptionListGroup";
|
|
5429
5567
|
|
|
5430
5568
|
// src/components/DetailList/DetailList.tsx
|
|
5431
|
-
var
|
|
5569
|
+
var import_react68 = require("react");
|
|
5432
5570
|
|
|
5433
5571
|
// src/components/DetailList/DetailList.module.css
|
|
5434
5572
|
var DetailList_default = {
|
|
@@ -5444,8 +5582,8 @@ var DetailList_default = {
|
|
|
5444
5582
|
};
|
|
5445
5583
|
|
|
5446
5584
|
// src/components/DetailList/DetailList.tsx
|
|
5447
|
-
var
|
|
5448
|
-
var DetailList = (0,
|
|
5585
|
+
var import_jsx_runtime221 = require("react/jsx-runtime");
|
|
5586
|
+
var DetailList = (0, import_react68.forwardRef)(
|
|
5449
5587
|
(props, ref) => {
|
|
5450
5588
|
const {
|
|
5451
5589
|
id,
|
|
@@ -5456,7 +5594,7 @@ var DetailList = (0, import_react67.forwardRef)(
|
|
|
5456
5594
|
size: size2 = "medium",
|
|
5457
5595
|
...rest
|
|
5458
5596
|
} = props;
|
|
5459
|
-
return /* @__PURE__ */ (0,
|
|
5597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
|
|
5460
5598
|
"dl",
|
|
5461
5599
|
{
|
|
5462
5600
|
ref,
|
|
@@ -5479,31 +5617,31 @@ var DetailList = (0, import_react67.forwardRef)(
|
|
|
5479
5617
|
DetailList.displayName = "DetailList";
|
|
5480
5618
|
|
|
5481
5619
|
// src/components/DetailList/DetailListDesc.tsx
|
|
5482
|
-
var
|
|
5483
|
-
var
|
|
5484
|
-
var DetailListDesc = (0,
|
|
5620
|
+
var import_react69 = require("react");
|
|
5621
|
+
var import_jsx_runtime222 = require("react/jsx-runtime");
|
|
5622
|
+
var DetailListDesc = (0, import_react69.forwardRef)(
|
|
5485
5623
|
({ className, ...rest }, ref) => {
|
|
5486
|
-
return /* @__PURE__ */ (0,
|
|
5624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("dd", { ref, className: cn(className, DetailList_default.cell), ...rest });
|
|
5487
5625
|
}
|
|
5488
5626
|
);
|
|
5489
5627
|
DetailListDesc.displayName = "DetailListDesc";
|
|
5490
5628
|
|
|
5491
5629
|
// src/components/DetailList/DetailListRow.tsx
|
|
5492
|
-
var
|
|
5493
|
-
var
|
|
5494
|
-
var DetailListRow = (0,
|
|
5630
|
+
var import_react70 = require("react");
|
|
5631
|
+
var import_jsx_runtime223 = require("react/jsx-runtime");
|
|
5632
|
+
var DetailListRow = (0, import_react70.forwardRef)(
|
|
5495
5633
|
({ className, ...rest }, ref) => {
|
|
5496
|
-
return /* @__PURE__ */ (0,
|
|
5634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("div", { ref, className: cn(className, DetailList_default.row), ...rest });
|
|
5497
5635
|
}
|
|
5498
5636
|
);
|
|
5499
5637
|
DetailListRow.displayName = "DetailListRow";
|
|
5500
5638
|
|
|
5501
5639
|
// src/components/DetailList/DetailListTerm.tsx
|
|
5502
|
-
var
|
|
5503
|
-
var
|
|
5504
|
-
var DetailListTerm = (0,
|
|
5640
|
+
var import_react71 = require("react");
|
|
5641
|
+
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
5642
|
+
var DetailListTerm = (0, import_react71.forwardRef)(
|
|
5505
5643
|
({ className, ...rest }, ref) => {
|
|
5506
|
-
return /* @__PURE__ */ (0,
|
|
5644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
5507
5645
|
"dt",
|
|
5508
5646
|
{
|
|
5509
5647
|
ref,
|
|
@@ -5516,8 +5654,8 @@ var DetailListTerm = (0, import_react70.forwardRef)(
|
|
|
5516
5654
|
DetailListTerm.displayName = "DetailListTerm";
|
|
5517
5655
|
|
|
5518
5656
|
// src/components/Drawer/Drawer.tsx
|
|
5519
|
-
var
|
|
5520
|
-
var
|
|
5657
|
+
var import_react73 = require("react");
|
|
5658
|
+
var import_react_dom3 = require("react-dom");
|
|
5521
5659
|
|
|
5522
5660
|
// src/components/Drawer/Drawer.module.css
|
|
5523
5661
|
var Drawer_default = {
|
|
@@ -5535,88 +5673,37 @@ var Drawer_default = {
|
|
|
5535
5673
|
"button--close": "Drawer_button--close"
|
|
5536
5674
|
};
|
|
5537
5675
|
|
|
5538
|
-
// src/components/
|
|
5539
|
-
var
|
|
5540
|
-
var
|
|
5541
|
-
|
|
5542
|
-
// src/components/ThemeProvider/ThemeProvider.module.css
|
|
5543
|
-
var ThemeProvider_default = {
|
|
5544
|
-
"global-variables": "ThemeProvider_global-variables",
|
|
5545
|
-
"global-styles": "ThemeProvider_global-styles"
|
|
5546
|
-
};
|
|
5547
|
-
|
|
5548
|
-
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
5549
|
-
var import_jsx_runtime224 = require("react/jsx-runtime");
|
|
5550
|
-
var defaultTheme = "core";
|
|
5551
|
-
var ThemeContext = (0, import_react71.createContext)(
|
|
5552
|
-
void 0
|
|
5553
|
-
);
|
|
5554
|
-
function ThemeProvider({
|
|
5555
|
-
theme = defaultTheme,
|
|
5556
|
-
children
|
|
5557
|
-
}) {
|
|
5558
|
-
const themeRef = (0, import_react71.useRef)(null);
|
|
5559
|
-
const [element, setElement] = (0, import_react71.useState)(null);
|
|
5560
|
-
(0, import_react71.useEffect)(() => {
|
|
5561
|
-
setElement(themeRef.current);
|
|
5562
|
-
}, []);
|
|
5563
|
-
return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(
|
|
5564
|
-
"div",
|
|
5565
|
-
{
|
|
5566
|
-
ref: themeRef,
|
|
5567
|
-
className: cn(
|
|
5568
|
-
`dds-${theme}`,
|
|
5569
|
-
ThemeProvider_default["global-variables"],
|
|
5570
|
-
ThemeProvider_default["global-styles"],
|
|
5571
|
-
"dds-themed"
|
|
5572
|
-
),
|
|
5573
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(ThemeContext.Provider, { value: { theme, el: element }, children })
|
|
5574
|
-
}
|
|
5575
|
-
);
|
|
5576
|
-
}
|
|
5577
|
-
function useTheme() {
|
|
5578
|
-
var _a;
|
|
5579
|
-
const themeName = (_a = (0, import_react71.useContext)(ThemeContext)) == null ? void 0 : _a.theme;
|
|
5580
|
-
if (!themeName) {
|
|
5581
|
-
throw new Error("useTheme must be used inside a ThemeProvider");
|
|
5582
|
-
}
|
|
5583
|
-
const theme = import_dds_design_tokens.ddsTokens[themeName];
|
|
5584
|
-
return { theme, themeName };
|
|
5585
|
-
}
|
|
5676
|
+
// src/components/Drawer/Drawer.context.tsx
|
|
5677
|
+
var import_react72 = require("react");
|
|
5678
|
+
var DrawerContext = (0, import_react72.createContext)({});
|
|
5679
|
+
var useDrawerContext = () => (0, import_react72.useContext)(DrawerContext);
|
|
5586
5680
|
|
|
5587
5681
|
// src/components/Drawer/Drawer.tsx
|
|
5588
5682
|
var import_jsx_runtime225 = require("react/jsx-runtime");
|
|
5589
|
-
var Drawer = (0,
|
|
5683
|
+
var Drawer = (0, import_react73.forwardRef)((props, ref) => {
|
|
5590
5684
|
const {
|
|
5591
5685
|
children,
|
|
5592
|
-
onClose,
|
|
5593
5686
|
header,
|
|
5594
|
-
isOpen = false,
|
|
5595
5687
|
placement = "right",
|
|
5596
5688
|
parentElement,
|
|
5597
5689
|
size: size2 = "small",
|
|
5598
|
-
triggerRef,
|
|
5599
|
-
id,
|
|
5600
5690
|
className,
|
|
5601
5691
|
htmlProps,
|
|
5602
5692
|
widthProps,
|
|
5603
5693
|
withBackdrop,
|
|
5604
5694
|
...rest
|
|
5605
5695
|
} = props;
|
|
5606
|
-
const
|
|
5607
|
-
|
|
5696
|
+
const themeContext = (0, import_react73.useContext)(ThemeContext);
|
|
5697
|
+
if (!themeContext) {
|
|
5698
|
+
throw new Error("Drawer must be used within a ThemeProvider");
|
|
5699
|
+
}
|
|
5700
|
+
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
5701
|
+
const { isOpen = false, onClose, drawerId, triggerEl } = useDrawerContext();
|
|
5608
5702
|
const hasHeader = !!header;
|
|
5609
|
-
const headerId = hasHeader ? `${
|
|
5703
|
+
const headerId = hasHeader ? `${drawerId}-header` : void 0;
|
|
5610
5704
|
const drawerRef = useFocusTrap(isOpen);
|
|
5611
5705
|
const combinedRef = useCombinedRef(ref, drawerRef);
|
|
5612
|
-
|
|
5613
|
-
var _a;
|
|
5614
|
-
if (isOpen) {
|
|
5615
|
-
triggerRef && ((_a = triggerRef.current) == null ? void 0 : _a.focus());
|
|
5616
|
-
onClose && onClose();
|
|
5617
|
-
}
|
|
5618
|
-
});
|
|
5619
|
-
(0, import_react72.useEffect)(() => {
|
|
5706
|
+
(0, import_react73.useEffect)(() => {
|
|
5620
5707
|
if (withBackdrop) {
|
|
5621
5708
|
if (isOpen) {
|
|
5622
5709
|
handleElementWithBackdropMount(document.body);
|
|
@@ -5629,18 +5716,13 @@ var Drawer = (0, import_react72.forwardRef)((props, ref) => {
|
|
|
5629
5716
|
const elements = [
|
|
5630
5717
|
drawerRef.current
|
|
5631
5718
|
];
|
|
5632
|
-
if (
|
|
5633
|
-
const themeContext = (0, import_react72.useContext)(ThemeContext);
|
|
5634
|
-
if (!themeContext) {
|
|
5635
|
-
throw new Error("Drawer must be used within a ThemeProvider");
|
|
5636
|
-
}
|
|
5637
|
-
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
5719
|
+
if (triggerEl) elements.push(triggerEl);
|
|
5638
5720
|
useOnClickOutside(elements, () => {
|
|
5639
5721
|
if (isOpen && !withBackdrop) {
|
|
5640
5722
|
onClose == null ? void 0 : onClose();
|
|
5641
5723
|
}
|
|
5642
5724
|
});
|
|
5643
|
-
const backdropRef = (0,
|
|
5725
|
+
const backdropRef = (0, import_react73.useRef)(null);
|
|
5644
5726
|
const onBackdropClick = (event) => {
|
|
5645
5727
|
if (event.target === backdropRef.current && isOpen && withBackdrop) {
|
|
5646
5728
|
onClose == null ? void 0 : onClose();
|
|
@@ -5656,7 +5738,7 @@ var Drawer = (0, import_react72.forwardRef)((props, ref) => {
|
|
|
5656
5738
|
role: "dialog",
|
|
5657
5739
|
tabIndex: -1,
|
|
5658
5740
|
...getBaseHTMLProps(
|
|
5659
|
-
|
|
5741
|
+
drawerId,
|
|
5660
5742
|
cn(
|
|
5661
5743
|
className,
|
|
5662
5744
|
Drawer_default.container,
|
|
@@ -5711,52 +5793,68 @@ var Drawer = (0, import_react72.forwardRef)((props, ref) => {
|
|
|
5711
5793
|
children: drawer
|
|
5712
5794
|
}
|
|
5713
5795
|
) : drawer;
|
|
5714
|
-
return (isOpen || hasTransitionedIn) && portalTarget ? (0,
|
|
5796
|
+
return (isOpen || hasTransitionedIn) && portalTarget ? (0, import_react_dom3.createPortal)(component, portalTarget) : null;
|
|
5715
5797
|
});
|
|
5716
5798
|
Drawer.displayName = "Drawer";
|
|
5717
5799
|
|
|
5718
5800
|
// src/components/Drawer/DrawerGroup.tsx
|
|
5719
|
-
var
|
|
5801
|
+
var import_react74 = require("react");
|
|
5720
5802
|
var import_jsx_runtime226 = require("react/jsx-runtime");
|
|
5721
5803
|
var DrawerGroup = ({
|
|
5722
5804
|
children,
|
|
5805
|
+
isInitiallyOpen,
|
|
5806
|
+
isOpen: propIsOpen,
|
|
5807
|
+
setIsOpen: propSetIsOpen,
|
|
5723
5808
|
drawerId,
|
|
5724
5809
|
onOpen,
|
|
5725
5810
|
onClose
|
|
5726
5811
|
}) => {
|
|
5727
|
-
const
|
|
5812
|
+
const [internalIsOpen, internalSetIsOpen] = (0, import_react74.useState)(isInitiallyOpen);
|
|
5813
|
+
const [isOpen, setIsOpen] = [
|
|
5814
|
+
propIsOpen != null ? propIsOpen : internalIsOpen,
|
|
5815
|
+
propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen
|
|
5816
|
+
];
|
|
5817
|
+
const generatedId = (0, import_react74.useId)();
|
|
5728
5818
|
const uniqueDrawerId = drawerId != null ? drawerId : `${generatedId}-drawer`;
|
|
5729
|
-
const
|
|
5730
|
-
const
|
|
5731
|
-
const
|
|
5732
|
-
const close = () => setClosed(true);
|
|
5819
|
+
const triggerRef = (0, import_react74.useRef)(null);
|
|
5820
|
+
const open = () => setIsOpen(true);
|
|
5821
|
+
const close = () => setIsOpen(false);
|
|
5733
5822
|
const handleOpen = () => {
|
|
5734
5823
|
open();
|
|
5735
|
-
onOpen
|
|
5824
|
+
onOpen == null ? void 0 : onOpen();
|
|
5736
5825
|
};
|
|
5737
5826
|
const handleClose = () => {
|
|
5738
5827
|
close();
|
|
5739
|
-
onClose
|
|
5828
|
+
onClose == null ? void 0 : onClose();
|
|
5740
5829
|
};
|
|
5741
|
-
|
|
5742
|
-
|
|
5830
|
+
useOnKeyDown(["Esc", "Escape"], () => {
|
|
5831
|
+
var _a;
|
|
5832
|
+
if (isOpen) {
|
|
5833
|
+
(_a = triggerRef == null ? void 0 : triggerRef.current) == null ? void 0 : _a.focus();
|
|
5834
|
+
handleClose();
|
|
5835
|
+
}
|
|
5836
|
+
});
|
|
5837
|
+
const Children8 = import_react74.Children.map(children, (child, childIndex) => {
|
|
5838
|
+
return (0, import_react74.isValidElement)(child) && (childIndex === 0 ? (0, import_react74.cloneElement)(child, {
|
|
5743
5839
|
"aria-haspopup": "dialog",
|
|
5744
5840
|
"aria-controls": uniqueDrawerId,
|
|
5745
|
-
"aria-expanded":
|
|
5746
|
-
ref:
|
|
5841
|
+
"aria-expanded": isOpen,
|
|
5842
|
+
ref: triggerRef,
|
|
5747
5843
|
onClick: handleOpen
|
|
5748
|
-
}) :
|
|
5749
|
-
id: uniqueDrawerId,
|
|
5750
|
-
triggerRef: buttonRef,
|
|
5751
|
-
isOpen: !closed,
|
|
5752
|
-
onClose: handleClose
|
|
5753
|
-
}));
|
|
5844
|
+
}) : child);
|
|
5754
5845
|
});
|
|
5755
|
-
return /* @__PURE__ */ (0, import_jsx_runtime226.
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)(
|
|
5847
|
+
DrawerContext.Provider,
|
|
5848
|
+
{
|
|
5849
|
+
value: {
|
|
5850
|
+
drawerId: uniqueDrawerId,
|
|
5851
|
+
isOpen,
|
|
5852
|
+
onClose: handleClose,
|
|
5853
|
+
triggerEl: triggerRef.current
|
|
5854
|
+
},
|
|
5855
|
+
children: Children8
|
|
5856
|
+
}
|
|
5857
|
+
);
|
|
5760
5858
|
};
|
|
5761
5859
|
DrawerGroup.displayName = "DrawerGroup";
|
|
5762
5860
|
|
|
@@ -5770,21 +5868,21 @@ var EmptyContent_default = {
|
|
|
5770
5868
|
// src/components/EmptyContent/EmptyContent.tsx
|
|
5771
5869
|
var import_jsx_runtime227 = require("react/jsx-runtime");
|
|
5772
5870
|
function EmptyContent({
|
|
5773
|
-
|
|
5871
|
+
headerText,
|
|
5774
5872
|
message,
|
|
5775
|
-
|
|
5873
|
+
headerHeadingLevel = 2,
|
|
5776
5874
|
className,
|
|
5777
5875
|
...rest
|
|
5778
5876
|
}) {
|
|
5779
5877
|
return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("div", { ...rest, className: cn(className, EmptyContent_default.containter), children: /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)("div", { className: EmptyContent_default.text, children: [
|
|
5780
|
-
|
|
5878
|
+
headerText && /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Heading, { level: headerHeadingLevel, typographyType: "headingMedium", children: headerText }),
|
|
5781
5879
|
/* @__PURE__ */ (0, import_jsx_runtime227.jsx)(Paragraph, { className: EmptyContent_default.message, children: message })
|
|
5782
5880
|
] }) });
|
|
5783
5881
|
}
|
|
5784
5882
|
EmptyContent.displayName = "EmptyContent";
|
|
5785
5883
|
|
|
5786
5884
|
// src/components/FavStar/FavStar.tsx
|
|
5787
|
-
var
|
|
5885
|
+
var import_react77 = require("react");
|
|
5788
5886
|
|
|
5789
5887
|
// src/components/FavStar/FavStar.module.css
|
|
5790
5888
|
var FavStar_default = {
|
|
@@ -5796,16 +5894,16 @@ var FavStar_default = {
|
|
|
5796
5894
|
};
|
|
5797
5895
|
|
|
5798
5896
|
// src/hooks/useControllableState.ts
|
|
5799
|
-
var
|
|
5897
|
+
var import_react76 = require("react");
|
|
5800
5898
|
|
|
5801
5899
|
// src/hooks/useCallbackRef.ts
|
|
5802
|
-
var
|
|
5900
|
+
var import_react75 = require("react");
|
|
5803
5901
|
function useCallbackRef(callback, deps = []) {
|
|
5804
|
-
const callbackRef = (0,
|
|
5805
|
-
(0,
|
|
5902
|
+
const callbackRef = (0, import_react75.useRef)(callback);
|
|
5903
|
+
(0, import_react75.useEffect)(() => {
|
|
5806
5904
|
callbackRef.current = callback;
|
|
5807
5905
|
});
|
|
5808
|
-
return (0,
|
|
5906
|
+
return (0, import_react75.useCallback)((...args) => {
|
|
5809
5907
|
var _a;
|
|
5810
5908
|
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
5811
5909
|
}, deps);
|
|
@@ -5815,7 +5913,7 @@ function useCallbackRef(callback, deps = []) {
|
|
|
5815
5913
|
function useControllableState(props) {
|
|
5816
5914
|
const { value: valueProp, defaultValue, onChange } = props;
|
|
5817
5915
|
const onChangeProp = useCallbackRef(onChange);
|
|
5818
|
-
const [uncontrolledState, setUncontrolledState] = (0,
|
|
5916
|
+
const [uncontrolledState, setUncontrolledState] = (0, import_react76.useState)(defaultValue);
|
|
5819
5917
|
const controlled = valueProp !== void 0;
|
|
5820
5918
|
const value = controlled ? valueProp : uncontrolledState;
|
|
5821
5919
|
const setValue = useCallbackRef(
|
|
@@ -5834,7 +5932,7 @@ function useControllableState(props) {
|
|
|
5834
5932
|
|
|
5835
5933
|
// src/components/FavStar/FavStar.tsx
|
|
5836
5934
|
var import_jsx_runtime228 = require("react/jsx-runtime");
|
|
5837
|
-
var FavStar = (0,
|
|
5935
|
+
var FavStar = (0, import_react77.forwardRef)(
|
|
5838
5936
|
({
|
|
5839
5937
|
id,
|
|
5840
5938
|
className,
|
|
@@ -5852,7 +5950,7 @@ var FavStar = (0, import_react76.forwardRef)(
|
|
|
5852
5950
|
htmlProps,
|
|
5853
5951
|
rest
|
|
5854
5952
|
);
|
|
5855
|
-
const generatedId = (0,
|
|
5953
|
+
const generatedId = (0, import_react77.useId)();
|
|
5856
5954
|
const [checked, setChecked] = useControllableState({
|
|
5857
5955
|
value: checkedProp,
|
|
5858
5956
|
defaultValue: defaultChecked != null ? defaultChecked : false,
|
|
@@ -5900,7 +5998,7 @@ var FavStar = (0, import_react76.forwardRef)(
|
|
|
5900
5998
|
FavStar.displayName = "FavStar";
|
|
5901
5999
|
|
|
5902
6000
|
// src/components/Feedback/Feedback.tsx
|
|
5903
|
-
var
|
|
6001
|
+
var import_react81 = require("react");
|
|
5904
6002
|
|
|
5905
6003
|
// src/components/Feedback/Feedback.module.css
|
|
5906
6004
|
var Feedback_default = {
|
|
@@ -5914,7 +6012,7 @@ var Feedback_default = {
|
|
|
5914
6012
|
};
|
|
5915
6013
|
|
|
5916
6014
|
// src/components/Stack/Stack.tsx
|
|
5917
|
-
var
|
|
6015
|
+
var import_react78 = require("react");
|
|
5918
6016
|
|
|
5919
6017
|
// src/components/Stack/Stack.module.css
|
|
5920
6018
|
var Stack_default = {
|
|
@@ -5951,7 +6049,7 @@ var Stack_default = {
|
|
|
5951
6049
|
|
|
5952
6050
|
// src/components/Stack/Stack.tsx
|
|
5953
6051
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
5954
|
-
var HStack = (0,
|
|
6052
|
+
var HStack = (0, import_react78.forwardRef)(
|
|
5955
6053
|
({
|
|
5956
6054
|
id,
|
|
5957
6055
|
className,
|
|
@@ -5990,7 +6088,7 @@ var HStack = (0, import_react77.forwardRef)(
|
|
|
5990
6088
|
}
|
|
5991
6089
|
);
|
|
5992
6090
|
HStack.displayName = "HStack";
|
|
5993
|
-
var VStack = (0,
|
|
6091
|
+
var VStack = (0, import_react78.forwardRef)(
|
|
5994
6092
|
({
|
|
5995
6093
|
id,
|
|
5996
6094
|
className,
|
|
@@ -6034,7 +6132,7 @@ function spacingPropToCn(value) {
|
|
|
6034
6132
|
}
|
|
6035
6133
|
|
|
6036
6134
|
// src/components/TextArea/TextArea.tsx
|
|
6037
|
-
var
|
|
6135
|
+
var import_react79 = require("react");
|
|
6038
6136
|
|
|
6039
6137
|
// src/components/TextArea/TextArea.module.css
|
|
6040
6138
|
var TextArea_default = {
|
|
@@ -6044,7 +6142,7 @@ var TextArea_default = {
|
|
|
6044
6142
|
|
|
6045
6143
|
// src/components/TextArea/TextArea.tsx
|
|
6046
6144
|
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
6047
|
-
var TextArea = (0,
|
|
6145
|
+
var TextArea = (0, import_react79.forwardRef)(
|
|
6048
6146
|
(props, ref) => {
|
|
6049
6147
|
const {
|
|
6050
6148
|
id,
|
|
@@ -6065,14 +6163,14 @@ var TextArea = (0, import_react78.forwardRef)(
|
|
|
6065
6163
|
width,
|
|
6066
6164
|
...rest
|
|
6067
6165
|
} = props;
|
|
6068
|
-
const generatedId = (0,
|
|
6166
|
+
const generatedId = (0, import_react79.useId)();
|
|
6069
6167
|
const uniqueId = id != null ? id : `${generatedId}-textArea`;
|
|
6070
|
-
const textAreaRef = (0,
|
|
6168
|
+
const textAreaRef = (0, import_react79.useRef)(null);
|
|
6071
6169
|
const multiRef = useCombinedRef(ref, textAreaRef);
|
|
6072
|
-
const [text, setText] = (0,
|
|
6170
|
+
const [text, setText] = (0, import_react79.useState)(
|
|
6073
6171
|
getDefaultText(value, defaultValue)
|
|
6074
6172
|
);
|
|
6075
|
-
(0,
|
|
6173
|
+
(0, import_react79.useEffect)(() => {
|
|
6076
6174
|
if (textAreaRef == null ? void 0 : textAreaRef.current) {
|
|
6077
6175
|
textAreaRef.current.style.height = `${textAreaRef.current.scrollHeight + 2}px`;
|
|
6078
6176
|
}
|
|
@@ -6224,7 +6322,7 @@ var CommentComponent = ({
|
|
|
6224
6322
|
};
|
|
6225
6323
|
|
|
6226
6324
|
// src/components/Tooltip/Tooltip.tsx
|
|
6227
|
-
var
|
|
6325
|
+
var import_react80 = require("react");
|
|
6228
6326
|
|
|
6229
6327
|
// src/components/Tooltip/Tooltip.module.css
|
|
6230
6328
|
var Tooltip_default = {
|
|
@@ -6236,7 +6334,7 @@ var Tooltip_default = {
|
|
|
6236
6334
|
|
|
6237
6335
|
// src/components/Tooltip/Tooltip.tsx
|
|
6238
6336
|
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
6239
|
-
var Tooltip = (0,
|
|
6337
|
+
var Tooltip = (0, import_react80.forwardRef)(
|
|
6240
6338
|
(props, ref) => {
|
|
6241
6339
|
const {
|
|
6242
6340
|
text,
|
|
@@ -6252,21 +6350,21 @@ var Tooltip = (0, import_react79.forwardRef)(
|
|
|
6252
6350
|
htmlProps,
|
|
6253
6351
|
...rest
|
|
6254
6352
|
} = props;
|
|
6255
|
-
const generatedId = (0,
|
|
6353
|
+
const generatedId = (0, import_react80.useId)();
|
|
6256
6354
|
const uniqueTooltipId = tooltipId != null ? tooltipId : `${generatedId}-tooltip`;
|
|
6257
|
-
const [open, setOpen] = (0,
|
|
6258
|
-
const [inView, setInView] = (0,
|
|
6259
|
-
const [arrowElement, setArrowElement] = (0,
|
|
6355
|
+
const [open, setOpen] = (0, import_react80.useState)(false);
|
|
6356
|
+
const [inView, setInView] = (0, import_react80.useState)(false);
|
|
6357
|
+
const [arrowElement, setArrowElement] = (0, import_react80.useState)(null);
|
|
6260
6358
|
const { refs, styles: positionStyles } = useFloatPosition(arrowElement, {
|
|
6261
6359
|
placement
|
|
6262
6360
|
});
|
|
6263
|
-
const tooltipRef = (0,
|
|
6361
|
+
const tooltipRef = (0, import_react80.useRef)(null);
|
|
6264
6362
|
const combinedRef = useCombinedRef(ref, refs.setFloating, tooltipRef);
|
|
6265
6363
|
const closeWhenNotInView = (entries) => {
|
|
6266
6364
|
const [entry] = entries;
|
|
6267
6365
|
entry.isIntersecting ? setInView(true) : setInView(false);
|
|
6268
6366
|
};
|
|
6269
|
-
(0,
|
|
6367
|
+
(0, import_react80.useEffect)(() => {
|
|
6270
6368
|
const options = {
|
|
6271
6369
|
root: null,
|
|
6272
6370
|
rootMargin: "0px"
|
|
@@ -6278,7 +6376,7 @@ var Tooltip = (0, import_react79.forwardRef)(
|
|
|
6278
6376
|
if (ref2) observer.unobserve(ref2);
|
|
6279
6377
|
};
|
|
6280
6378
|
}, [tooltipRef]);
|
|
6281
|
-
(0,
|
|
6379
|
+
(0, import_react80.useEffect)(() => {
|
|
6282
6380
|
if (tooltipRef.current) {
|
|
6283
6381
|
window.addEventListener("scroll", () => {
|
|
6284
6382
|
closeTooltip();
|
|
@@ -6291,7 +6389,7 @@ var Tooltip = (0, import_react79.forwardRef)(
|
|
|
6291
6389
|
};
|
|
6292
6390
|
}, []);
|
|
6293
6391
|
let timer;
|
|
6294
|
-
(0,
|
|
6392
|
+
(0, import_react80.useEffect)(() => {
|
|
6295
6393
|
return () => {
|
|
6296
6394
|
clearTimeout(timer);
|
|
6297
6395
|
};
|
|
@@ -6310,8 +6408,8 @@ var Tooltip = (0, import_react79.forwardRef)(
|
|
|
6310
6408
|
}
|
|
6311
6409
|
};
|
|
6312
6410
|
const anchorProps = children.props;
|
|
6313
|
-
const anchorElement =
|
|
6314
|
-
(0,
|
|
6411
|
+
const anchorElement = import_react80.Children.only(
|
|
6412
|
+
(0, import_react80.isValidElement)(children) && (0, import_react80.cloneElement)(children, {
|
|
6315
6413
|
ref: refs.setReference,
|
|
6316
6414
|
onFocus: combineHandlers(openTooltip, anchorProps.onFocus),
|
|
6317
6415
|
onBlur: combineHandlers(closeTooltip, anchorProps.onBlur),
|
|
@@ -6442,16 +6540,16 @@ var Feedback = ({
|
|
|
6442
6540
|
onFeedbackTextChange,
|
|
6443
6541
|
onSubmit
|
|
6444
6542
|
}) => {
|
|
6445
|
-
const [rating, setRating] = (0,
|
|
6446
|
-
const [feedbackText, setFeedbackText] = (0,
|
|
6447
|
-
const [isFeedbackSubmitted, setIsFeedbackSubmitted] = (0,
|
|
6448
|
-
(0,
|
|
6543
|
+
const [rating, setRating] = (0, import_react81.useState)(null);
|
|
6544
|
+
const [feedbackText, setFeedbackText] = (0, import_react81.useState)();
|
|
6545
|
+
const [isFeedbackSubmitted, setIsFeedbackSubmitted] = (0, import_react81.useState)(false);
|
|
6546
|
+
(0, import_react81.useEffect)(() => {
|
|
6449
6547
|
ratingProp !== void 0 && setRating(ratingProp);
|
|
6450
6548
|
}, [ratingProp]);
|
|
6451
|
-
(0,
|
|
6549
|
+
(0, import_react81.useEffect)(() => {
|
|
6452
6550
|
feedbackTextProp !== void 0 && setFeedbackText(feedbackTextProp);
|
|
6453
6551
|
}, [feedbackTextProp]);
|
|
6454
|
-
(0,
|
|
6552
|
+
(0, import_react81.useEffect)(() => {
|
|
6455
6553
|
isSubmittedProp !== void 0 && setIsFeedbackSubmitted(isSubmittedProp);
|
|
6456
6554
|
}, [isSubmittedProp]);
|
|
6457
6555
|
const handleRatingChange = (newRating) => {
|
|
@@ -6501,7 +6599,7 @@ var Feedback = ({
|
|
|
6501
6599
|
};
|
|
6502
6600
|
|
|
6503
6601
|
// src/components/Fieldset/Fieldset.tsx
|
|
6504
|
-
var
|
|
6602
|
+
var import_react82 = require("react");
|
|
6505
6603
|
|
|
6506
6604
|
// src/components/Fieldset/Fieldset.module.css
|
|
6507
6605
|
var Fieldset_default = {
|
|
@@ -6510,7 +6608,7 @@ var Fieldset_default = {
|
|
|
6510
6608
|
|
|
6511
6609
|
// src/components/Fieldset/Fieldset.tsx
|
|
6512
6610
|
var import_jsx_runtime236 = require("react/jsx-runtime");
|
|
6513
|
-
var Fieldset = (0,
|
|
6611
|
+
var Fieldset = (0, import_react82.forwardRef)(
|
|
6514
6612
|
(props, ref) => {
|
|
6515
6613
|
const { id, className, htmlProps, ...rest } = props;
|
|
6516
6614
|
return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(
|
|
@@ -6529,7 +6627,7 @@ var Fieldset = (0, import_react81.forwardRef)(
|
|
|
6529
6627
|
);
|
|
6530
6628
|
|
|
6531
6629
|
// src/components/FileUploader/FileUploader.tsx
|
|
6532
|
-
var
|
|
6630
|
+
var import_react84 = require("react");
|
|
6533
6631
|
|
|
6534
6632
|
// src/components/FileUploader/ErrorList.tsx
|
|
6535
6633
|
var import_jsx_runtime237 = require("react/jsx-runtime");
|
|
@@ -6624,7 +6722,7 @@ var File = (props) => {
|
|
|
6624
6722
|
|
|
6625
6723
|
// src/components/FileUploader/useFileUploader.ts
|
|
6626
6724
|
var import_file_selector = require("file-selector");
|
|
6627
|
-
var
|
|
6725
|
+
var import_react83 = require("react");
|
|
6628
6726
|
|
|
6629
6727
|
// src/components/FileUploader/fileUploaderReducer.ts
|
|
6630
6728
|
var fileUploaderReducer = (state, action) => {
|
|
@@ -6723,18 +6821,18 @@ var useFileUploader = (props) => {
|
|
|
6723
6821
|
disabled,
|
|
6724
6822
|
errorMessage
|
|
6725
6823
|
} = props;
|
|
6726
|
-
const rootRef = (0,
|
|
6727
|
-
const inputRef = (0,
|
|
6728
|
-
const buttonRef = (0,
|
|
6824
|
+
const rootRef = (0, import_react83.useRef)(null);
|
|
6825
|
+
const inputRef = (0, import_react83.useRef)(null);
|
|
6826
|
+
const buttonRef = (0, import_react83.useRef)(null);
|
|
6729
6827
|
const isControlled = !!value;
|
|
6730
|
-
const initialFileUploaderFiles = (0,
|
|
6828
|
+
const initialFileUploaderFiles = (0, import_react83.useMemo)(
|
|
6731
6829
|
() => (initialFiles != null ? initialFiles : []).map((f) => ({
|
|
6732
6830
|
file: f,
|
|
6733
6831
|
errors: []
|
|
6734
6832
|
})),
|
|
6735
6833
|
[initialFiles]
|
|
6736
6834
|
);
|
|
6737
|
-
const [state, dispatch] = (0,
|
|
6835
|
+
const [state, dispatch] = (0, import_react83.useReducer)(fileUploaderReducer, {
|
|
6738
6836
|
files: initialFileUploaderFiles,
|
|
6739
6837
|
isFocused: false,
|
|
6740
6838
|
isFileDialogActive: false,
|
|
@@ -6746,7 +6844,7 @@ var useFileUploader = (props) => {
|
|
|
6746
6844
|
)
|
|
6747
6845
|
});
|
|
6748
6846
|
const { files: stateFiles } = state;
|
|
6749
|
-
(0,
|
|
6847
|
+
(0, import_react83.useEffect)(() => {
|
|
6750
6848
|
if (isControlled) {
|
|
6751
6849
|
const files = value.map((file) => {
|
|
6752
6850
|
const accepted = isFileAccepted(file, accept);
|
|
@@ -6761,18 +6859,18 @@ var useFileUploader = (props) => {
|
|
|
6761
6859
|
});
|
|
6762
6860
|
}
|
|
6763
6861
|
}, [value, isControlled, accept, dispatch]);
|
|
6764
|
-
(0,
|
|
6862
|
+
(0, import_react83.useEffect)(() => {
|
|
6765
6863
|
dispatch({
|
|
6766
6864
|
type: "setRootErrors",
|
|
6767
6865
|
payload: calcRootErrors(stateFiles, maxFiles, errorMessage)
|
|
6768
6866
|
});
|
|
6769
6867
|
}, [dispatch, stateFiles, maxFiles, errorMessage]);
|
|
6770
|
-
const onRootFocus = (0,
|
|
6868
|
+
const onRootFocus = (0, import_react83.useCallback)(
|
|
6771
6869
|
() => dispatch({ type: "focus" }),
|
|
6772
6870
|
[dispatch]
|
|
6773
6871
|
);
|
|
6774
|
-
const onRootBlur = (0,
|
|
6775
|
-
const onRootDragEnter = (0,
|
|
6872
|
+
const onRootBlur = (0, import_react83.useCallback)(() => dispatch({ type: "blur" }), [dispatch]);
|
|
6873
|
+
const onRootDragEnter = (0, import_react83.useCallback)(
|
|
6776
6874
|
async (evt) => {
|
|
6777
6875
|
preventDefaults(evt);
|
|
6778
6876
|
if (isEventWithFiles(evt)) {
|
|
@@ -6784,7 +6882,7 @@ var useFileUploader = (props) => {
|
|
|
6784
6882
|
},
|
|
6785
6883
|
[dispatch, accept, maxFiles]
|
|
6786
6884
|
);
|
|
6787
|
-
const onRootDragOver = (0,
|
|
6885
|
+
const onRootDragOver = (0, import_react83.useCallback)((evt) => {
|
|
6788
6886
|
preventDefaults(evt);
|
|
6789
6887
|
const hasFiles = isEventWithFiles(evt);
|
|
6790
6888
|
if (hasFiles && evt.dataTransfer) {
|
|
@@ -6794,7 +6892,7 @@ var useFileUploader = (props) => {
|
|
|
6794
6892
|
}
|
|
6795
6893
|
}
|
|
6796
6894
|
}, []);
|
|
6797
|
-
const onRootDragLeave = (0,
|
|
6895
|
+
const onRootDragLeave = (0, import_react83.useCallback)(
|
|
6798
6896
|
(evt) => {
|
|
6799
6897
|
preventDefaults(evt);
|
|
6800
6898
|
if (evt.currentTarget.contains(evt.relatedTarget)) return;
|
|
@@ -6802,7 +6900,7 @@ var useFileUploader = (props) => {
|
|
|
6802
6900
|
},
|
|
6803
6901
|
[dispatch]
|
|
6804
6902
|
);
|
|
6805
|
-
const setFiles = (0,
|
|
6903
|
+
const setFiles = (0, import_react83.useCallback)(
|
|
6806
6904
|
async (evt) => {
|
|
6807
6905
|
evt.preventDefault();
|
|
6808
6906
|
if (isEventWithFiles(evt)) {
|
|
@@ -6836,13 +6934,13 @@ var useFileUploader = (props) => {
|
|
|
6836
6934
|
dispatch
|
|
6837
6935
|
]
|
|
6838
6936
|
);
|
|
6839
|
-
const openFileDialog = (0,
|
|
6937
|
+
const openFileDialog = (0, import_react83.useCallback)(() => {
|
|
6840
6938
|
if (inputRef.current) {
|
|
6841
6939
|
inputRef.current.value = "";
|
|
6842
6940
|
inputRef.current.click();
|
|
6843
6941
|
}
|
|
6844
6942
|
}, [inputRef]);
|
|
6845
|
-
const removeFile = (0,
|
|
6943
|
+
const removeFile = (0, import_react83.useCallback)(
|
|
6846
6944
|
(file) => {
|
|
6847
6945
|
const newFiles = [...stateFiles];
|
|
6848
6946
|
newFiles.splice(stateFiles.indexOf(file), 1);
|
|
@@ -6856,7 +6954,7 @@ var useFileUploader = (props) => {
|
|
|
6856
6954
|
},
|
|
6857
6955
|
[stateFiles, isControlled, maxFiles, errorMessage, onChange, dispatch]
|
|
6858
6956
|
);
|
|
6859
|
-
const getRootProps = (0,
|
|
6957
|
+
const getRootProps = (0, import_react83.useCallback)(
|
|
6860
6958
|
() => ({
|
|
6861
6959
|
onBlur: onRootBlur,
|
|
6862
6960
|
onFocus: onRootFocus,
|
|
@@ -6878,14 +6976,14 @@ var useFileUploader = (props) => {
|
|
|
6878
6976
|
disabled
|
|
6879
6977
|
]
|
|
6880
6978
|
);
|
|
6881
|
-
const getButtonProps = (0,
|
|
6979
|
+
const getButtonProps = (0, import_react83.useCallback)(
|
|
6882
6980
|
() => ({
|
|
6883
6981
|
onClick: openFileDialog,
|
|
6884
6982
|
ref: buttonRef
|
|
6885
6983
|
}),
|
|
6886
6984
|
[openFileDialog, buttonRef]
|
|
6887
6985
|
);
|
|
6888
|
-
const getInputProps = (0,
|
|
6986
|
+
const getInputProps = (0, import_react83.useCallback)(
|
|
6889
6987
|
() => ({
|
|
6890
6988
|
type: "file",
|
|
6891
6989
|
style: { display: "none" },
|
|
@@ -6931,7 +7029,7 @@ var FileUploader = (props) => {
|
|
|
6931
7029
|
className,
|
|
6932
7030
|
...rest
|
|
6933
7031
|
} = props;
|
|
6934
|
-
const generatedId = (0,
|
|
7032
|
+
const generatedId = (0, import_react84.useId)();
|
|
6935
7033
|
const uniqueId = id != null ? id : `${generatedId}-fileUploader`;
|
|
6936
7034
|
const {
|
|
6937
7035
|
state: { files: stateFiles, isDragActive, rootErrors },
|
|
@@ -7050,7 +7148,7 @@ var FileUploader = (props) => {
|
|
|
7050
7148
|
FileUploader.displayName = "FileUploader";
|
|
7051
7149
|
|
|
7052
7150
|
// src/components/Footer/Footer.tsx
|
|
7053
|
-
var
|
|
7151
|
+
var import_react85 = require("react");
|
|
7054
7152
|
|
|
7055
7153
|
// src/components/Footer/Footer.module.css
|
|
7056
7154
|
var Footer_default = {
|
|
@@ -7067,7 +7165,7 @@ var Footer_default = {
|
|
|
7067
7165
|
|
|
7068
7166
|
// src/components/Footer/Footer.tsx
|
|
7069
7167
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
7070
|
-
var Footer = (0,
|
|
7168
|
+
var Footer = (0, import_react85.forwardRef)((props, ref) => {
|
|
7071
7169
|
const { className, ...rest } = props;
|
|
7072
7170
|
return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
7073
7171
|
Contrast,
|
|
@@ -7081,21 +7179,21 @@ var Footer = (0, import_react84.forwardRef)((props, ref) => {
|
|
|
7081
7179
|
});
|
|
7082
7180
|
|
|
7083
7181
|
// src/components/Footer/FooterListHeader.tsx
|
|
7084
|
-
var
|
|
7182
|
+
var import_react86 = require("react");
|
|
7085
7183
|
var import_jsx_runtime241 = require("react/jsx-runtime");
|
|
7086
|
-
var FooterListHeader = (0,
|
|
7184
|
+
var FooterListHeader = (0, import_react86.forwardRef)((props, ref) => {
|
|
7087
7185
|
return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(Heading, { level: 2, typographyType: "headingSmall", ref, ...props });
|
|
7088
7186
|
});
|
|
7089
7187
|
|
|
7090
7188
|
// src/components/Footer/FooterLogo.tsx
|
|
7091
|
-
var
|
|
7189
|
+
var import_react87 = require("react");
|
|
7092
7190
|
|
|
7093
7191
|
// src/components/Footer/norges_domstoler_logo.svg
|
|
7094
7192
|
var norges_domstoler_logo_default = 'data:image/svg+xml,<svg width="151" height="80" viewBox="0 0 151 80" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<g id="Logo" clip-path="url(%23clip0_18254_1882)">%0A<path id="Vector" d="M0 19.5721V0.38501H3.50998L9.51314 13.2128C10.169 14.6541 10.6734 16.1596 11.0182 17.7051H11.1848C10.9502 16.2655 10.8311 14.8093 10.8287 13.3507V0.38501H13.0174V19.5721H9.51314L3.50998 6.77306C2.84978 5.3389 2.34334 3.83883 1.99914 2.29798H1.83829C2.07013 3.73991 2.18921 5.19772 2.19446 6.65817V19.5721H0Z" fill="white"/>%0A<path id="Vector_2" d="M19.2848 17.4063C17.9942 15.7059 17.3489 13.2299 17.3489 9.97846C17.3489 6.72699 17.9942 4.25104 19.2848 2.55062C20.5716 0.850208 22.4118 0 24.8054 0C27.199 0 29.0488 0.844463 30.3548 2.53339C31.6416 4.25679 32.2907 6.70401 32.2907 10.0014C32.2907 13.2989 31.6416 15.7461 30.3548 17.4695C29.068 19.1929 27.2182 20.0029 24.8054 20.0029C22.3927 20.0029 20.5716 19.101 19.2848 17.4063ZM21.3357 4.05572C20.6003 5.31955 20.2308 7.29379 20.2269 9.97846C20.2231 12.6631 20.5927 14.6355 21.3357 15.8954C21.6776 16.4998 22.1813 16.9969 22.7902 17.3307C23.3991 17.6646 24.089 17.8221 24.7825 17.7854C25.4832 17.8288 26.182 17.6747 26.7994 17.3406C27.4169 17.0064 27.9282 16.5058 28.2752 15.8954C29.0143 14.6355 29.3858 12.6631 29.3897 9.97846C29.3935 7.29379 29.0297 5.31955 28.2982 4.05572C27.9502 3.44633 27.4387 2.9464 26.8215 2.61242C26.2042 2.27844 25.5059 2.12372 24.8054 2.16573C24.1083 2.12541 23.4138 2.28107 22.8006 2.6151C22.1874 2.94912 21.6799 3.44817 21.3357 4.05572Z" fill="white"/>%0A<path id="Vector_3" d="M48.594 15.5968C48.8111 16.9446 49.1318 18.2737 49.5534 19.5721H46.5317C46.4288 19.2619 46.3463 18.9453 46.2847 18.6243C46.21 18.2681 46.1238 17.7856 46.0376 17.1709C45.9515 16.5562 45.8825 16.1254 45.8423 15.8668C45.5513 13.9903 45.1415 12.7207 44.613 12.0581C44.0845 11.3956 43.2151 11.0681 42.0049 11.0758H39.1326V19.5721H36.4556V0.38501H43.0045C44.7968 0.38501 46.1813 0.815859 47.1693 1.6833C47.6677 2.13766 48.0592 2.69689 48.3154 3.32072C48.5717 3.94454 48.6865 4.61743 48.6515 5.29094C48.6898 5.93617 48.5867 6.58197 48.3496 7.18326C48.1125 7.78455 47.7469 8.32682 47.2785 8.7722C46.2192 9.64565 44.8691 10.0868 43.4985 10.0073H42.7287V10.1681L43.5272 10.1969C44.1017 10.2313 44.4866 10.2658 44.7566 10.2945C45.102 10.3329 45.4427 10.4061 45.7734 10.5128C46.1234 10.601 46.4442 10.7792 46.704 11.0298C46.968 11.3147 47.2064 11.6223 47.4164 11.949C47.7076 12.4082 47.9301 12.9075 48.077 13.4311C48.2551 14.0343 48.4332 14.7581 48.594 15.5968ZM39.167 9.09964H42.43C42.8862 9.13106 43.3441 9.06822 43.775 8.91503C44.2059 8.76184 44.6006 8.52159 44.9347 8.20922C45.241 7.86617 45.4755 7.4653 45.6245 7.03021C45.7734 6.59512 45.8338 6.13462 45.8021 5.67583C45.8021 3.48138 44.6781 2.38415 42.43 2.38415H39.167V9.09964Z" fill="white"/>%0A<path id="Vector_4" d="M63.8634 6.27892C63.8374 5.16647 63.448 4.0931 62.7547 3.22277C62.4351 2.8708 62.0419 2.59361 61.6031 2.41091C61.1642 2.22821 60.6904 2.14451 60.2155 2.16575C59.518 2.12433 58.8231 2.28288 58.2125 2.62276C57.6019 2.96264 57.1011 3.46974 56.7688 4.08447C56.0334 5.36744 55.6658 7.33211 55.6658 9.97848C55.6658 12.6248 56.0315 14.5933 56.763 15.884C57.0847 16.4915 57.5726 16.995 58.1697 17.3358C58.7668 17.6765 59.4484 17.8404 60.1351 17.8084C62.8581 17.8084 64.2196 15.974 64.2196 12.3051V11.6214H59.9168V9.64529H66.7415V19.572H64.5757V17.6246C64.5824 16.3521 64.6552 15.0808 64.794 13.8159H64.6274C64.4283 15.9338 63.9132 17.4867 63.0821 18.4748C62.2491 19.4629 61.0198 19.9512 59.3941 19.9512C58.4312 19.9882 57.4753 19.7741 56.6202 19.3299C55.7651 18.8857 55.0403 18.2268 54.5169 17.4178C53.3679 15.7289 52.7935 13.2759 52.7935 10.0589C52.7935 6.77296 53.4292 4.28361 54.7007 2.59086C55.9722 0.898101 57.8009 0.0344883 60.1868 2.04411e-05C61.7689 -0.0690547 63.3242 0.425623 64.5757 1.39597C65.1677 1.92295 65.6473 2.56392 65.9859 3.28052C66.3244 3.99712 66.515 4.77464 66.5461 5.56659L63.8634 6.27892Z" fill="white"/>%0A<path id="Vector_5" d="M74.824 17.5673H82.8034V19.5721H72.1125V0.38501H82.6368V2.38415H74.824V8.66305H82.0048V10.6622H74.824V17.5673Z" fill="white"/>%0A<path id="Vector_6" d="M93.0633 19.9512C90.9953 19.9512 89.3695 19.4342 88.1804 18.3887C87.5786 17.8382 87.1032 17.164 86.7869 16.4123C86.4705 15.6606 86.3207 14.8493 86.3478 14.0342L89.0421 13.2645C89.1876 16.3283 90.5491 17.8602 93.1265 17.8602C94.0518 17.9146 94.9669 17.6422 95.7116 17.0904C96.0388 16.8086 96.2951 16.4538 96.4598 16.0546C96.6245 15.6554 96.6929 15.2231 96.6595 14.7925C96.6595 13.3334 95.838 12.284 94.195 11.6445L91.0699 10.3806C88.4159 9.32362 87.0908 7.55236 87.0947 5.06684C87.054 4.35555 87.1815 3.64468 87.467 2.99192C87.7524 2.33915 88.1878 1.76287 88.7376 1.30984C90.0484 0.449859 91.5818 -0.00830078 93.1495 -0.00830078C94.7172 -0.00830078 96.2507 0.449859 97.5614 1.30984C98.139 1.77201 98.6034 2.36008 98.919 3.02914C99.2346 3.6982 99.3931 4.43055 99.3825 5.17024L96.7801 5.9113C96.6155 3.36451 95.4014 2.09302 93.138 2.09685C92.2848 2.02806 91.4347 2.26195 90.7368 2.75749C90.4435 3.00371 90.2126 3.31574 90.0629 3.66814C89.9131 4.02055 89.8488 4.40335 89.8751 4.78535C89.835 5.48253 90.0539 6.16994 90.4897 6.71555C91.0398 7.27423 91.7096 7.70051 92.4487 7.96214L95.3612 9.15703C98.042 10.2294 99.3825 12.0006 99.3825 14.4708C99.4281 15.2308 99.2996 15.9911 99.0069 16.694C98.7143 17.3968 98.2651 18.0236 97.6935 18.5266C96.602 19.4802 95.051 19.9512 93.0633 19.9512Z" fill="white"/>%0A<path id="Vector_7" d="M5.2104 35.4617C7.95251 35.4617 9.98037 36.308 11.294 38.0008C12.6076 39.6936 13.2644 42.045 13.2644 45.0552C13.2644 48.0884 12.6076 50.4456 11.294 52.1269C9.98037 53.8082 7.95251 54.6488 5.2104 54.6488H0V35.4617H5.2104ZM4.96338 52.6497C6.97401 52.6497 8.3757 52.0063 9.17995 50.7195C9.9842 49.4327 10.3863 47.5427 10.3863 45.0552C10.3863 42.5678 9.9842 40.6836 9.17995 39.3968C8.3757 38.11 6.97401 37.4666 4.96338 37.4666H2.71148V52.6497H4.96338Z" fill="white"/>%0A<path id="Vector_8" d="M18.5954 52.4831C17.3047 50.7903 16.6594 48.3144 16.6594 45.0552C16.6594 41.7961 17.3047 39.3202 18.5954 37.6274C19.8898 35.9308 21.732 35.0825 24.1217 35.0825C26.5115 35.0825 28.3613 35.927 29.6711 37.6159C30.954 39.3048 31.5955 41.7846 31.5955 45.0552C31.5955 48.3259 30.9521 50.8152 29.6653 52.5233C28.3823 54.1969 26.5364 55.0337 24.1275 55.0337C21.7185 55.0337 19.8745 54.1835 18.5954 52.4831ZM20.6807 39.1382C19.9147 40.3944 19.5317 42.3667 19.5317 45.0552C19.5317 47.7437 19.9147 49.718 20.6807 50.978C21.0254 51.5787 21.5302 52.0719 22.1388 52.4025C22.7474 52.7332 23.4359 52.8884 24.1275 52.8507C24.8279 52.8921 25.5259 52.7371 26.143 52.4031C26.7601 52.0692 27.2717 51.5697 27.6202 50.9607C28.3555 49.7084 28.7232 47.7399 28.7232 45.0552C28.7232 42.3706 28.3536 40.3982 27.6145 39.1382C27.2674 38.5293 26.7569 38.0296 26.1407 37.6956C25.5245 37.3616 24.8271 37.2067 24.1275 37.2483C23.434 37.2116 22.7441 37.3691 22.1352 37.703C21.5264 38.0368 21.0226 38.5339 20.6807 39.1382Z" fill="white"/>%0A<path id="Vector_9" d="M35.7661 54.6488V35.4617H39.7414L42.8148 46.1237C43.5024 48.2936 43.9079 50.5429 44.0212 52.8163H44.2337C44.2993 50.5424 44.6861 48.2893 45.3827 46.1237L48.5939 35.4617H52.2762V54.6488H49.6911V43.7684C49.6911 41.5223 49.7773 39.414 49.9382 37.4493H49.7486C49.4555 39.2625 49.0527 41.0562 48.5422 42.8206L45.0954 54.6603H42.6827L39.121 42.5965C38.6304 40.9144 38.2467 39.2029 37.9721 37.4723H37.7767C37.9261 39.2417 38.0008 41.2638 38.0008 43.5272V54.6488H35.7661Z" fill="white"/>%0A<path id="Vector_10" d="M63.2314 55.0338C61.171 55.0338 59.5452 54.513 58.3542 53.4713C57.7505 52.9221 57.2734 52.2482 56.9559 51.4963C56.6385 50.7444 56.4884 49.9325 56.5159 49.1168L59.1699 48.3471C59.3155 51.4109 60.6769 52.9428 63.2544 52.9428C64.1809 52.9928 65.0963 52.7208 65.8452 52.173C66.1703 51.8898 66.4248 51.5346 66.5883 51.1356C66.7519 50.7367 66.82 50.3051 66.7873 49.8751C66.7873 48.416 65.9659 47.3647 64.3229 46.7213L61.1978 45.4632C58.5476 44.3986 57.2225 42.6254 57.2225 40.1437C57.1827 39.4334 57.3107 38.7236 57.5962 38.0719C57.8816 37.4202 58.3164 36.8449 58.8655 36.3924C60.1497 35.4549 61.7185 34.9902 63.3061 35.0769C64.8757 35.0068 66.4227 35.4705 67.695 36.3924C68.2714 36.8566 68.7344 37.4461 69.0489 38.116C69.3635 38.7859 69.5213 39.5186 69.5103 40.2586L66.9022 40.9997C66.7414 38.4605 65.5273 37.1909 63.2601 37.1909C62.4071 37.1241 61.5576 37.3578 60.8589 37.8516C60.5656 38.0978 60.3347 38.4098 60.185 38.7622C60.0352 39.1146 59.9709 39.4974 59.9972 39.8794C59.9571 40.5766 60.176 41.264 60.6118 41.8096C61.1632 42.3762 61.8346 42.812 62.5765 43.085L65.535 44.2339C68.2158 45.3139 69.5563 47.0871 69.5563 49.5534C69.6008 50.3128 69.4725 51.0723 69.181 51.7748C68.8894 52.4773 68.4422 53.1045 67.8731 53.6092C66.7529 54.5743 65.2076 55.0338 63.2314 55.0338Z" fill="white"/>%0A<path id="Vector_11" d="M85.8997 35.4617V37.6274H80.6376V54.6488H77.9491V37.6274H72.687V35.4617H85.8997Z" fill="white"/>%0A<path id="Vector_12" d="M90.4092 52.4831C89.1148 50.7903 88.4675 48.3144 88.4675 45.0552C88.4675 41.7961 89.1128 39.3202 90.4035 37.6274C91.6903 35.9308 93.5305 35.0825 95.9241 35.0825C98.3177 35.0825 100.167 35.927 101.473 37.6159C102.76 39.3048 103.404 41.7942 103.404 45.084C103.404 48.3737 102.76 50.8631 101.473 52.552C100.19 54.2065 98.3445 55.0337 95.9356 55.0337C93.5267 55.0337 91.6845 54.1835 90.4092 52.4831ZM92.4888 39.1382C91.7228 40.3944 91.3399 42.3667 91.3399 45.0552C91.3399 47.7437 91.7228 49.718 92.4888 50.978C92.866 51.5576 93.382 52.034 93.9899 52.3637C94.5978 52.6934 95.2785 52.8661 95.97 52.8661C96.6616 52.8661 97.3423 52.6934 97.9502 52.3637C98.5581 52.034 99.0741 51.5576 99.4513 50.978C100.171 49.7141 100.531 47.7399 100.531 45.0552C100.531 42.3706 100.162 40.3982 99.4226 39.1382C99.0454 38.5586 98.5294 38.0823 97.9215 37.7525C97.3136 37.4228 96.6329 37.2501 95.9413 37.2501C95.2497 37.2501 94.5691 37.4228 93.9612 37.7525C93.3532 38.0823 92.8373 38.5586 92.4601 39.1382H92.4888Z" fill="white"/>%0A<path id="Vector_13" d="M107.58 35.4617H110.297V52.4831H117.915V54.6488H107.574L107.58 35.4617Z" fill="white"/>%0A<path id="Vector_14" d="M124.544 52.6497H132.518V54.6488H121.833V35.4617H132.357V37.4666H124.544V43.7397H131.725V45.7446H124.544V52.6497Z" fill="white"/>%0A<path id="Vector_15" d="M149.321 50.6735C149.534 52.022 149.855 53.3513 150.28 54.6488H147.264C147.163 54.3399 147.081 54.0253 147.017 53.7067C146.942 53.3505 146.862 52.8622 146.77 52.2533C146.678 51.6444 146.615 51.2078 146.581 50.9493C146.289 49.0688 145.878 47.7993 145.345 47.1405C144.817 46.4857 143.949 46.1525 142.743 46.1525H139.871V54.6488H137.154V35.4617H143.731C145.52 35.4617 146.908 35.8963 147.896 36.7657C148.392 37.2209 148.781 37.7807 149.034 38.4047C149.288 39.0286 149.399 39.701 149.361 40.3733C149.394 41.0129 149.289 41.6521 149.052 42.247C148.815 42.8419 148.452 43.3786 147.988 43.8201C146.93 44.6951 145.579 45.1365 144.208 45.0552H143.438V45.2218H144.231C144.805 45.2563 145.19 45.285 145.466 45.3137C145.811 45.3579 146.151 45.4309 146.483 45.532C146.833 45.6236 147.153 45.8036 147.413 46.0548C147.676 46.3411 147.914 46.6485 148.126 46.9739C148.422 47.451 148.645 47.97 148.786 48.5135C148.982 49.1167 149.154 49.8348 149.321 50.6735ZM139.894 44.1821H143.151C143.608 44.2136 144.067 44.1508 144.499 43.9976C144.931 43.8445 145.326 43.6042 145.661 43.2916C146.273 42.5923 146.583 41.6795 146.523 40.7525C146.523 38.5638 145.403 37.4666 143.151 37.4666H139.894V44.1821Z" fill="white"/>%0A<path id="Vector_16" d="M150.389 75.0137H0V80H150.389V75.0137Z" fill="white"/>%0A</g>%0A<defs>%0A<clipPath id="clip0_18254_1882">%0A<rect width="150.389" height="80" fill="white"/>%0A</clipPath>%0A</defs>%0A</svg>%0A';
|
|
7095
7193
|
|
|
7096
7194
|
// src/components/Footer/FooterLogo.tsx
|
|
7097
7195
|
var import_jsx_runtime242 = require("react/jsx-runtime");
|
|
7098
|
-
var FooterLogo = (0,
|
|
7196
|
+
var FooterLogo = (0, import_react87.forwardRef)(
|
|
7099
7197
|
(props, ref) => {
|
|
7100
7198
|
const { className, hideBreakpoint, ...rest } = props;
|
|
7101
7199
|
return /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(
|
|
@@ -7117,9 +7215,9 @@ var FooterLogo = (0, import_react86.forwardRef)(
|
|
|
7117
7215
|
);
|
|
7118
7216
|
|
|
7119
7217
|
// src/components/Footer/FooterList.tsx
|
|
7120
|
-
var
|
|
7218
|
+
var import_react88 = require("react");
|
|
7121
7219
|
var import_jsx_runtime243 = require("react/jsx-runtime");
|
|
7122
|
-
var FooterList = (0,
|
|
7220
|
+
var FooterList = (0, import_react88.forwardRef)(
|
|
7123
7221
|
(props, ref) => {
|
|
7124
7222
|
const { className, ...rest } = props;
|
|
7125
7223
|
return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
|
|
@@ -7138,9 +7236,9 @@ var FooterList = (0, import_react87.forwardRef)(
|
|
|
7138
7236
|
);
|
|
7139
7237
|
|
|
7140
7238
|
// src/components/Footer/FooterSocialsList.tsx
|
|
7141
|
-
var
|
|
7239
|
+
var import_react89 = require("react");
|
|
7142
7240
|
var import_jsx_runtime244 = require("react/jsx-runtime");
|
|
7143
|
-
var FooterSocialsList = (0,
|
|
7241
|
+
var FooterSocialsList = (0, import_react89.forwardRef)((props, ref) => {
|
|
7144
7242
|
const { className, ...rest } = props;
|
|
7145
7243
|
return /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(
|
|
7146
7244
|
"ul",
|
|
@@ -7157,9 +7255,9 @@ var FooterSocialsList = (0, import_react88.forwardRef)((props, ref) => {
|
|
|
7157
7255
|
});
|
|
7158
7256
|
|
|
7159
7257
|
// src/components/Footer/FooterSocialsGroup.tsx
|
|
7160
|
-
var
|
|
7258
|
+
var import_react90 = require("react");
|
|
7161
7259
|
var import_jsx_runtime245 = require("react/jsx-runtime");
|
|
7162
|
-
var FooterSocialsGroup = (0,
|
|
7260
|
+
var FooterSocialsGroup = (0, import_react90.forwardRef)((props, ref) => {
|
|
7163
7261
|
const { className, ...rest } = props;
|
|
7164
7262
|
return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
|
|
7165
7263
|
"div",
|
|
@@ -7172,9 +7270,9 @@ var FooterSocialsGroup = (0, import_react89.forwardRef)((props, ref) => {
|
|
|
7172
7270
|
});
|
|
7173
7271
|
|
|
7174
7272
|
// src/components/Footer/FooterListGroup.tsx
|
|
7175
|
-
var
|
|
7273
|
+
var import_react91 = require("react");
|
|
7176
7274
|
var import_jsx_runtime246 = require("react/jsx-runtime");
|
|
7177
|
-
var FooterListGroup = (0,
|
|
7275
|
+
var FooterListGroup = (0, import_react91.forwardRef)(
|
|
7178
7276
|
(props, ref) => {
|
|
7179
7277
|
const { className, ...rest } = props;
|
|
7180
7278
|
return /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(
|
|
@@ -7189,9 +7287,9 @@ var FooterListGroup = (0, import_react90.forwardRef)(
|
|
|
7189
7287
|
);
|
|
7190
7288
|
|
|
7191
7289
|
// src/components/Footer/FooterLeft.tsx
|
|
7192
|
-
var
|
|
7290
|
+
var import_react92 = require("react");
|
|
7193
7291
|
var import_jsx_runtime247 = require("react/jsx-runtime");
|
|
7194
|
-
var FooterLeft = (0,
|
|
7292
|
+
var FooterLeft = (0, import_react92.forwardRef)(
|
|
7195
7293
|
(props, ref) => {
|
|
7196
7294
|
const { className, ...rest } = props;
|
|
7197
7295
|
return /* @__PURE__ */ (0, import_jsx_runtime247.jsx)("div", { ref, className: cn(className, Footer_default["left"]), ...rest });
|
|
@@ -7199,7 +7297,7 @@ var FooterLeft = (0, import_react91.forwardRef)(
|
|
|
7199
7297
|
);
|
|
7200
7298
|
|
|
7201
7299
|
// src/components/GlobalMessage/GlobalMessage.tsx
|
|
7202
|
-
var
|
|
7300
|
+
var import_react93 = require("react");
|
|
7203
7301
|
|
|
7204
7302
|
// src/components/GlobalMessage/GlobalMessage.module.css
|
|
7205
7303
|
var GlobalMessage_default = {
|
|
@@ -7219,7 +7317,7 @@ var icons = {
|
|
|
7219
7317
|
danger: ErrorIcon,
|
|
7220
7318
|
warning: WarningIcon
|
|
7221
7319
|
};
|
|
7222
|
-
var GlobalMessage = (0,
|
|
7320
|
+
var GlobalMessage = (0, import_react93.forwardRef)(
|
|
7223
7321
|
(props, ref) => {
|
|
7224
7322
|
const {
|
|
7225
7323
|
message,
|
|
@@ -7232,7 +7330,7 @@ var GlobalMessage = (0, import_react92.forwardRef)(
|
|
|
7232
7330
|
htmlProps,
|
|
7233
7331
|
...rest
|
|
7234
7332
|
} = props;
|
|
7235
|
-
const [isClosed, setClosed] = (0,
|
|
7333
|
+
const [isClosed, setClosed] = (0, import_react93.useState)(false);
|
|
7236
7334
|
return !isClosed ? /* @__PURE__ */ (0, import_jsx_runtime248.jsxs)(
|
|
7237
7335
|
"div",
|
|
7238
7336
|
{
|
|
@@ -7426,7 +7524,7 @@ var GridChild = (props) => {
|
|
|
7426
7524
|
GridChild.displayName = "GridChild";
|
|
7427
7525
|
|
|
7428
7526
|
// src/components/InlineButton/InlineButton.tsx
|
|
7429
|
-
var
|
|
7527
|
+
var import_react94 = require("react");
|
|
7430
7528
|
|
|
7431
7529
|
// src/components/InlineButton/InlineButton.module.css
|
|
7432
7530
|
var InlineButton_default = {
|
|
@@ -7435,7 +7533,7 @@ var InlineButton_default = {
|
|
|
7435
7533
|
|
|
7436
7534
|
// src/components/InlineButton/InlineButton.tsx
|
|
7437
7535
|
var import_jsx_runtime251 = require("react/jsx-runtime");
|
|
7438
|
-
var InlineButton = (0,
|
|
7536
|
+
var InlineButton = (0, import_react94.forwardRef)(
|
|
7439
7537
|
(props, ref) => {
|
|
7440
7538
|
const { className, ...rest } = props;
|
|
7441
7539
|
return /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(
|
|
@@ -7457,10 +7555,10 @@ var InlineButton = (0, import_react93.forwardRef)(
|
|
|
7457
7555
|
);
|
|
7458
7556
|
|
|
7459
7557
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
7460
|
-
var
|
|
7558
|
+
var import_react97 = require("react");
|
|
7461
7559
|
|
|
7462
7560
|
// src/components/InlineEdit/InlineEdit.tsx
|
|
7463
|
-
var
|
|
7561
|
+
var import_react95 = require("react");
|
|
7464
7562
|
var import_jsx_runtime252 = require("react/jsx-runtime");
|
|
7465
7563
|
var InlineEdit = (props) => {
|
|
7466
7564
|
const {
|
|
@@ -7473,8 +7571,8 @@ var InlineEdit = (props) => {
|
|
|
7473
7571
|
inputRef,
|
|
7474
7572
|
children
|
|
7475
7573
|
} = props;
|
|
7476
|
-
const [editingValue, setEditingValue] = (0,
|
|
7477
|
-
const [isEditing, setIsEditing] = (0,
|
|
7574
|
+
const [editingValue, setEditingValue] = (0, import_react95.useState)(value != null ? value : "");
|
|
7575
|
+
const [isEditing, setIsEditing] = (0, import_react95.useState)(false);
|
|
7478
7576
|
const onChangeHandler = (e) => {
|
|
7479
7577
|
setEditingValue(e.target.value);
|
|
7480
7578
|
onChange && onChange();
|
|
@@ -7501,8 +7599,8 @@ var InlineEdit = (props) => {
|
|
|
7501
7599
|
useOnKeyDown(["Enter"], () => onExitHandler());
|
|
7502
7600
|
useOnKeyDown(["Escape"], () => onExitHandler());
|
|
7503
7601
|
useOnClickOutside(inputRef.current, () => onExitHandler());
|
|
7504
|
-
const inputChild =
|
|
7505
|
-
(0,
|
|
7602
|
+
const inputChild = import_react95.Children.only(
|
|
7603
|
+
(0, import_react95.isValidElement)(children) && (0, import_react95.cloneElement)(children, {
|
|
7506
7604
|
onChange: onChangeHandler,
|
|
7507
7605
|
onBlur: onBlurHandler,
|
|
7508
7606
|
onFocus: onFocusHandler,
|
|
@@ -7516,7 +7614,7 @@ var InlineEdit = (props) => {
|
|
|
7516
7614
|
InlineEdit.displayName = "InlineEdit";
|
|
7517
7615
|
|
|
7518
7616
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
7519
|
-
var
|
|
7617
|
+
var import_react96 = require("react");
|
|
7520
7618
|
|
|
7521
7619
|
// src/components/InlineEdit/InlineEdit.module.css
|
|
7522
7620
|
var InlineEdit_default = {
|
|
@@ -7538,7 +7636,7 @@ var inlineEditVisuallyHidden = (id, emptiable) => /* @__PURE__ */ (0, import_jsx
|
|
|
7538
7636
|
|
|
7539
7637
|
// src/components/InlineEdit/InlineTextArea.tsx
|
|
7540
7638
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
7541
|
-
var InlineTextArea = (0,
|
|
7639
|
+
var InlineTextArea = (0, import_react96.forwardRef)((props, ref) => {
|
|
7542
7640
|
const {
|
|
7543
7641
|
id,
|
|
7544
7642
|
error,
|
|
@@ -7550,14 +7648,14 @@ var InlineTextArea = (0, import_react95.forwardRef)((props, ref) => {
|
|
|
7550
7648
|
hideIcon,
|
|
7551
7649
|
...rest
|
|
7552
7650
|
} = props;
|
|
7553
|
-
const genereatedId = (0,
|
|
7651
|
+
const genereatedId = (0, import_react96.useId)();
|
|
7554
7652
|
const uniqueId = id != null ? id : `${genereatedId}-InlineTextArea`;
|
|
7555
7653
|
const hasErrorMessage = !!errorMessage;
|
|
7556
7654
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
7557
7655
|
const hasError = !!error;
|
|
7558
7656
|
const hasErrorState = hasError || hasErrorMessage;
|
|
7559
7657
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
7560
|
-
const inputRef = (0,
|
|
7658
|
+
const inputRef = (0, import_react96.useRef)(null);
|
|
7561
7659
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
7562
7660
|
return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)("div", { className: InlineEdit_default.container, style: { width }, children: [
|
|
7563
7661
|
/* @__PURE__ */ (0, import_jsx_runtime254.jsxs)("div", { className: Input_default["input-group"], children: [
|
|
@@ -7605,9 +7703,9 @@ InlineTextArea.displayName = "InlineTextArea";
|
|
|
7605
7703
|
|
|
7606
7704
|
// src/components/InlineEdit/InlineEditTextArea.tsx
|
|
7607
7705
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
7608
|
-
var InlineEditTextArea = (0,
|
|
7706
|
+
var InlineEditTextArea = (0, import_react97.forwardRef)((props, ref) => {
|
|
7609
7707
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
7610
|
-
const textareaRef = (0,
|
|
7708
|
+
const textareaRef = (0, import_react97.useRef)(null);
|
|
7611
7709
|
const combinedRef = useCombinedRef(ref, textareaRef);
|
|
7612
7710
|
return /* @__PURE__ */ (0, import_jsx_runtime255.jsx)(
|
|
7613
7711
|
InlineEdit,
|
|
@@ -7625,12 +7723,12 @@ var InlineEditTextArea = (0, import_react96.forwardRef)((props, ref) => {
|
|
|
7625
7723
|
});
|
|
7626
7724
|
|
|
7627
7725
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
7628
|
-
var
|
|
7726
|
+
var import_react99 = require("react");
|
|
7629
7727
|
|
|
7630
7728
|
// src/components/InlineEdit/InlineInput.tsx
|
|
7631
|
-
var
|
|
7729
|
+
var import_react98 = require("react");
|
|
7632
7730
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
7633
|
-
var InlineInput = (0,
|
|
7731
|
+
var InlineInput = (0, import_react98.forwardRef)(
|
|
7634
7732
|
(props, ref) => {
|
|
7635
7733
|
const {
|
|
7636
7734
|
id,
|
|
@@ -7643,14 +7741,14 @@ var InlineInput = (0, import_react97.forwardRef)(
|
|
|
7643
7741
|
hideIcon,
|
|
7644
7742
|
...rest
|
|
7645
7743
|
} = props;
|
|
7646
|
-
const genereatedId = (0,
|
|
7744
|
+
const genereatedId = (0, import_react98.useId)();
|
|
7647
7745
|
const uniqueId = id != null ? id : `${genereatedId}-InlineInput`;
|
|
7648
7746
|
const hasErrorMessage = !!errorMessage;
|
|
7649
7747
|
const hasError = !!error;
|
|
7650
7748
|
const hasErrorState = hasError || hasErrorMessage;
|
|
7651
7749
|
const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
|
|
7652
7750
|
const descId = derivativeIdGenerator(uniqueId, "desc");
|
|
7653
|
-
const inputRef = (0,
|
|
7751
|
+
const inputRef = (0, import_react98.useRef)(null);
|
|
7654
7752
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
7655
7753
|
return /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)("div", { className: InlineEdit_default.container, style: { width }, children: [
|
|
7656
7754
|
/* @__PURE__ */ (0, import_jsx_runtime256.jsxs)("div", { className: Input_default["input-group"], children: [
|
|
@@ -7697,9 +7795,9 @@ InlineInput.displayName = "InlineInput";
|
|
|
7697
7795
|
|
|
7698
7796
|
// src/components/InlineEdit/InlineEditInput.tsx
|
|
7699
7797
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
7700
|
-
var InlineEditInput = (0,
|
|
7798
|
+
var InlineEditInput = (0, import_react99.forwardRef)((props, ref) => {
|
|
7701
7799
|
const { onSetValue, emptiable, value, onFocus, onChange, onBlur, ...rest } = props;
|
|
7702
|
-
const inputRef = (0,
|
|
7800
|
+
const inputRef = (0, import_react99.useRef)(null);
|
|
7703
7801
|
const combinedRef = useCombinedRef(ref, inputRef);
|
|
7704
7802
|
return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(
|
|
7705
7803
|
InlineEdit,
|
|
@@ -7717,7 +7815,7 @@ var InlineEditInput = (0, import_react98.forwardRef)((props, ref) => {
|
|
|
7717
7815
|
});
|
|
7718
7816
|
|
|
7719
7817
|
// src/components/InternalHeader/InternalHeader.tsx
|
|
7720
|
-
var
|
|
7818
|
+
var import_react101 = require("react");
|
|
7721
7819
|
|
|
7722
7820
|
// src/components/InternalHeader/InternalHeader.module.css
|
|
7723
7821
|
var InternalHeader_default = {
|
|
@@ -7773,9 +7871,9 @@ var InternalHeader_default = {
|
|
|
7773
7871
|
};
|
|
7774
7872
|
|
|
7775
7873
|
// src/components/InternalHeader/NavigationItem.tsx
|
|
7776
|
-
var
|
|
7874
|
+
var import_react100 = require("react");
|
|
7777
7875
|
var import_jsx_runtime258 = require("react/jsx-runtime");
|
|
7778
|
-
var NavigationItem = (0,
|
|
7876
|
+
var NavigationItem = (0, import_react100.forwardRef)(({ isCurrent, ...rest }, ref) => {
|
|
7779
7877
|
return /* @__PURE__ */ (0, import_jsx_runtime258.jsx)(
|
|
7780
7878
|
"a",
|
|
7781
7879
|
{
|
|
@@ -7810,19 +7908,13 @@ var InternalHeader = (props) => {
|
|
|
7810
7908
|
htmlProps,
|
|
7811
7909
|
...rest
|
|
7812
7910
|
} = props;
|
|
7813
|
-
const [
|
|
7814
|
-
const [currentPage, setCurrentPage] = (0, import_react100.useState)(
|
|
7911
|
+
const [currentPage, setCurrentPage] = (0, import_react101.useState)(
|
|
7815
7912
|
currentPageHref
|
|
7816
7913
|
);
|
|
7817
|
-
const buttonRef = (0, import_react100.useRef)(null);
|
|
7818
7914
|
const handleCurrentPageChange = (href) => {
|
|
7819
7915
|
setCurrentPage(href);
|
|
7820
|
-
onCurrentPageChange
|
|
7821
|
-
};
|
|
7822
|
-
const handleContextMenuClick = () => {
|
|
7823
|
-
setContextMenuIsClosed(!contextMenuIsClosed);
|
|
7916
|
+
onCurrentPageChange == null ? void 0 : onCurrentPageChange();
|
|
7824
7917
|
};
|
|
7825
|
-
const onOveflowMenuClose = () => setContextMenuIsClosed(true);
|
|
7826
7918
|
const hasNavigationElements = !!navItems && navItems.length > 0;
|
|
7827
7919
|
const hasContextMenuElements = !!contextMenuItems && contextMenuItems.length > 0;
|
|
7828
7920
|
const hasSmallScreenBreakpoint = !!smallScreenBreakpoint;
|
|
@@ -7879,7 +7971,7 @@ var InternalHeader = (props) => {
|
|
|
7879
7971
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(Typography, { typographyType: "bodyMedium", as: "span", children: applicationDesc }),
|
|
7880
7972
|
(hasContextMenu || navigation !== null) && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)("div", { className: InternalHeader_default["bar-separator"] }),
|
|
7881
7973
|
navigation,
|
|
7882
|
-
hasContextMenu && /* @__PURE__ */ (0, import_jsx_runtime259.
|
|
7974
|
+
hasContextMenu && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
7883
7975
|
"div",
|
|
7884
7976
|
{
|
|
7885
7977
|
className: cn(
|
|
@@ -7887,60 +7979,47 @@ var InternalHeader = (props) => {
|
|
|
7887
7979
|
!hasContextMenuLargeScreen && InternalHeader_default["context-menu-group--small-screen-only"],
|
|
7888
7980
|
!hasContextMenuLargeScreen && hasSmallScreenBreakpoint && InternalHeader_default[`context-menu-group--small-screen-only-${smallScreenBreakpoint}`]
|
|
7889
7981
|
),
|
|
7890
|
-
children: [
|
|
7982
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(OverflowMenuGroup, { children: [
|
|
7891
7983
|
/* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
7892
7984
|
Button,
|
|
7893
7985
|
{
|
|
7894
|
-
ref: buttonRef,
|
|
7895
7986
|
icon: hasNavInContextMenu ? MenuIcon : MoreVerticalIcon,
|
|
7896
7987
|
purpose: "tertiary",
|
|
7897
|
-
onClick: handleContextMenuClick,
|
|
7898
|
-
"aria-haspopup": "menu",
|
|
7899
|
-
"aria-expanded": !contextMenuIsClosed ? true : void 0,
|
|
7900
7988
|
"aria-label": "\xE5pne meny"
|
|
7901
7989
|
}
|
|
7902
7990
|
),
|
|
7903
|
-
/* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
hasNavInContextMenu && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
7913
|
-
"nav",
|
|
7914
|
-
{
|
|
7915
|
-
"aria-label": "sidenavigasjon",
|
|
7916
|
-
className: cn(
|
|
7917
|
-
InternalHeader_default["nav--in-menu--small-screen"],
|
|
7918
|
-
InternalHeader_default[`nav--in-menu--small-screen-${smallScreenBreakpoint}`]
|
|
7919
|
-
),
|
|
7920
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuList, { children: navItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuLink, { ...item })) })
|
|
7921
|
-
}
|
|
7922
|
-
),
|
|
7923
|
-
hasNavInContextMenu && hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
7924
|
-
OverflowMenuDivider,
|
|
7925
|
-
{
|
|
7926
|
-
className: cn(
|
|
7927
|
-
InternalHeader_default["menu-divider"],
|
|
7928
|
-
InternalHeader_default[`menu-divider--small-screen-${smallScreenBreakpoint}`]
|
|
7929
|
-
)
|
|
7930
|
-
}
|
|
7991
|
+
/* @__PURE__ */ (0, import_jsx_runtime259.jsxs)(OverflowMenu, { className: InternalHeader_default["context-menu"], children: [
|
|
7992
|
+
user && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuList, { children: user.href ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuLink, { icon: PersonIcon, ...user }) : /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuSpan, { icon: PersonIcon, ...user }) }),
|
|
7993
|
+
hasNavInContextMenu && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
7994
|
+
"nav",
|
|
7995
|
+
{
|
|
7996
|
+
"aria-label": "sidenavigasjon",
|
|
7997
|
+
className: cn(
|
|
7998
|
+
InternalHeader_default["nav--in-menu--small-screen"],
|
|
7999
|
+
InternalHeader_default[`nav--in-menu--small-screen-${smallScreenBreakpoint}`]
|
|
7931
8000
|
),
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
8001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuList, { children: navItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuLink, { ...item })) })
|
|
8002
|
+
}
|
|
8003
|
+
),
|
|
8004
|
+
hasNavInContextMenu && hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
8005
|
+
OverflowMenuDivider,
|
|
8006
|
+
{
|
|
8007
|
+
className: cn(
|
|
8008
|
+
InternalHeader_default["menu-divider"],
|
|
8009
|
+
InternalHeader_default[`menu-divider--small-screen-${smallScreenBreakpoint}`]
|
|
8010
|
+
)
|
|
8011
|
+
}
|
|
8012
|
+
),
|
|
8013
|
+
hasContextMenuElements && /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuList, { children: contextMenuItems.map((item) => {
|
|
8014
|
+
return item.href ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(OverflowMenuLink, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(
|
|
8015
|
+
OverflowMenuButton,
|
|
8016
|
+
{
|
|
8017
|
+
...item
|
|
8018
|
+
}
|
|
8019
|
+
);
|
|
8020
|
+
}) })
|
|
8021
|
+
] })
|
|
8022
|
+
] })
|
|
7944
8023
|
}
|
|
7945
8024
|
)
|
|
7946
8025
|
]
|
|
@@ -7950,7 +8029,7 @@ var InternalHeader = (props) => {
|
|
|
7950
8029
|
InternalHeader.displayName = "InternalHeader";
|
|
7951
8030
|
|
|
7952
8031
|
// src/components/List/List.tsx
|
|
7953
|
-
var
|
|
8032
|
+
var import_react102 = require("react");
|
|
7954
8033
|
|
|
7955
8034
|
// src/components/List/List.module.css
|
|
7956
8035
|
var List_default = {
|
|
@@ -7963,7 +8042,7 @@ var List_default = {
|
|
|
7963
8042
|
|
|
7964
8043
|
// src/components/List/List.tsx
|
|
7965
8044
|
var import_jsx_runtime260 = require("react/jsx-runtime");
|
|
7966
|
-
var List = (0,
|
|
8045
|
+
var List = (0, import_react102.forwardRef)((props, ref) => {
|
|
7967
8046
|
const {
|
|
7968
8047
|
listType = "unordered",
|
|
7969
8048
|
typographyType = "inherit",
|
|
@@ -7991,9 +8070,9 @@ var List = (0, import_react101.forwardRef)((props, ref) => {
|
|
|
7991
8070
|
List.displayName = "List";
|
|
7992
8071
|
|
|
7993
8072
|
// src/components/List/ListItem.tsx
|
|
7994
|
-
var
|
|
8073
|
+
var import_react103 = require("react");
|
|
7995
8074
|
var import_jsx_runtime261 = require("react/jsx-runtime");
|
|
7996
|
-
var ListItem = (0,
|
|
8075
|
+
var ListItem = (0, import_react103.forwardRef)(
|
|
7997
8076
|
({ className, ...rest }, ref) => {
|
|
7998
8077
|
return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("li", { ref, ...rest, className: cn(className, List_default.li) });
|
|
7999
8078
|
}
|
|
@@ -8001,7 +8080,7 @@ var ListItem = (0, import_react102.forwardRef)(
|
|
|
8001
8080
|
ListItem.displayName = "ListItem";
|
|
8002
8081
|
|
|
8003
8082
|
// src/components/LocalMessage/LocalMessage.tsx
|
|
8004
|
-
var
|
|
8083
|
+
var import_react104 = require("react");
|
|
8005
8084
|
|
|
8006
8085
|
// src/components/LocalMessage/LocalMessage.module.css
|
|
8007
8086
|
var LocalMessage_default = {
|
|
@@ -8030,7 +8109,7 @@ var icons2 = {
|
|
|
8030
8109
|
success: CheckCircledIcon,
|
|
8031
8110
|
tips: TipIcon
|
|
8032
8111
|
};
|
|
8033
|
-
var LocalMessage = (0,
|
|
8112
|
+
var LocalMessage = (0, import_react104.forwardRef)(
|
|
8034
8113
|
(props, ref) => {
|
|
8035
8114
|
const {
|
|
8036
8115
|
message,
|
|
@@ -8045,7 +8124,7 @@ var LocalMessage = (0, import_react103.forwardRef)(
|
|
|
8045
8124
|
htmlProps,
|
|
8046
8125
|
...rest
|
|
8047
8126
|
} = props;
|
|
8048
|
-
const [isClosed, setClosed] = (0,
|
|
8127
|
+
const [isClosed, setClosed] = (0, import_react104.useState)(false);
|
|
8049
8128
|
if (isClosed) {
|
|
8050
8129
|
return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_jsx_runtime262.Fragment, {});
|
|
8051
8130
|
}
|
|
@@ -8098,8 +8177,8 @@ var LocalMessage = (0, import_react103.forwardRef)(
|
|
|
8098
8177
|
LocalMessage.displayName = "LocalMessage";
|
|
8099
8178
|
|
|
8100
8179
|
// src/components/Modal/Modal.tsx
|
|
8101
|
-
var
|
|
8102
|
-
var
|
|
8180
|
+
var import_react105 = require("react");
|
|
8181
|
+
var import_react_dom4 = require("react-dom");
|
|
8103
8182
|
|
|
8104
8183
|
// src/components/Modal/Modal.module.css
|
|
8105
8184
|
var Modal_default = {
|
|
@@ -8114,7 +8193,7 @@ var Modal_default = {
|
|
|
8114
8193
|
|
|
8115
8194
|
// src/components/Modal/Modal.tsx
|
|
8116
8195
|
var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
8117
|
-
var Modal = (0,
|
|
8196
|
+
var Modal = (0, import_react105.forwardRef)((props, ref) => {
|
|
8118
8197
|
const {
|
|
8119
8198
|
isOpen = false,
|
|
8120
8199
|
parentElement,
|
|
@@ -8129,7 +8208,7 @@ var Modal = (0, import_react104.forwardRef)((props, ref) => {
|
|
|
8129
8208
|
htmlProps,
|
|
8130
8209
|
...rest
|
|
8131
8210
|
} = props;
|
|
8132
|
-
const generatedId = (0,
|
|
8211
|
+
const generatedId = (0, import_react105.useId)();
|
|
8133
8212
|
const modalId = id != null ? id : `${generatedId}-modal`;
|
|
8134
8213
|
const headerId = `${modalId}-header`;
|
|
8135
8214
|
const modalRef = useFocusTrap(isOpen, initialFocusRef);
|
|
@@ -8137,16 +8216,16 @@ var Modal = (0, import_react104.forwardRef)((props, ref) => {
|
|
|
8137
8216
|
const handleClose = () => {
|
|
8138
8217
|
var _a;
|
|
8139
8218
|
if (onClose && isOpen) {
|
|
8140
|
-
|
|
8219
|
+
(_a = triggerRef == null ? void 0 : triggerRef.current) == null ? void 0 : _a.focus();
|
|
8141
8220
|
onClose();
|
|
8142
8221
|
}
|
|
8143
8222
|
};
|
|
8144
|
-
const themeContext = (0,
|
|
8223
|
+
const themeContext = (0, import_react105.useContext)(ThemeContext);
|
|
8145
8224
|
if (!themeContext) {
|
|
8146
8225
|
throw new Error("Modal must be used within a ThemeProvider");
|
|
8147
8226
|
}
|
|
8148
8227
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
8149
|
-
(0,
|
|
8228
|
+
(0, import_react105.useEffect)(() => {
|
|
8150
8229
|
if (isOpen) {
|
|
8151
8230
|
handleElementWithBackdropMount(document.body);
|
|
8152
8231
|
} else {
|
|
@@ -8154,7 +8233,7 @@ var Modal = (0, import_react104.forwardRef)((props, ref) => {
|
|
|
8154
8233
|
}
|
|
8155
8234
|
return () => handleElementWithBackdropUnmount(document.body);
|
|
8156
8235
|
}, [isOpen]);
|
|
8157
|
-
const backdropRef = (0,
|
|
8236
|
+
const backdropRef = (0, import_react105.useRef)(null);
|
|
8158
8237
|
const onBackdropClick = (event) => {
|
|
8159
8238
|
if (event.target === backdropRef.current && isOpen) {
|
|
8160
8239
|
handleClose();
|
|
@@ -8162,7 +8241,7 @@ var Modal = (0, import_react104.forwardRef)((props, ref) => {
|
|
|
8162
8241
|
};
|
|
8163
8242
|
useOnKeyDown(["Escape", "Esc"], () => handleClose());
|
|
8164
8243
|
const hasTransitionedIn = useMountTransition(isOpen, 200);
|
|
8165
|
-
return (isOpen || hasTransitionedIn) && portalTarget ? (0,
|
|
8244
|
+
return (isOpen || hasTransitionedIn) && portalTarget ? (0, import_react_dom4.createPortal)(
|
|
8166
8245
|
/* @__PURE__ */ (0, import_jsx_runtime263.jsx)(
|
|
8167
8246
|
Backdrop,
|
|
8168
8247
|
{
|
|
@@ -8221,9 +8300,9 @@ var Modal = (0, import_react104.forwardRef)((props, ref) => {
|
|
|
8221
8300
|
Modal.displayName = "Modal";
|
|
8222
8301
|
|
|
8223
8302
|
// src/components/Modal/ModalBody.tsx
|
|
8224
|
-
var
|
|
8303
|
+
var import_react106 = require("react");
|
|
8225
8304
|
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
8226
|
-
var ModalBody = (0,
|
|
8305
|
+
var ModalBody = (0, import_react106.forwardRef)(
|
|
8227
8306
|
(props, ref) => {
|
|
8228
8307
|
const { children, id, className, scrollable, htmlProps, height, ...rest } = props;
|
|
8229
8308
|
return /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
@@ -8250,9 +8329,9 @@ var ModalBody = (0, import_react105.forwardRef)(
|
|
|
8250
8329
|
ModalBody.displayName = "ModalBody";
|
|
8251
8330
|
|
|
8252
8331
|
// src/components/Modal/ModalActions.tsx
|
|
8253
|
-
var
|
|
8332
|
+
var import_react107 = require("react");
|
|
8254
8333
|
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
8255
|
-
var ModalActions = (0,
|
|
8334
|
+
var ModalActions = (0, import_react107.forwardRef)(
|
|
8256
8335
|
({ className, ...rest }, ref) => {
|
|
8257
8336
|
return /* @__PURE__ */ (0, import_jsx_runtime265.jsx)("div", { ref, ...rest, className: cn(className, Modal_default.actions) });
|
|
8258
8337
|
}
|
|
@@ -8260,7 +8339,7 @@ var ModalActions = (0, import_react106.forwardRef)(
|
|
|
8260
8339
|
ModalActions.displayName = "ModalActions";
|
|
8261
8340
|
|
|
8262
8341
|
// src/components/Pagination/Pagination.tsx
|
|
8263
|
-
var
|
|
8342
|
+
var import_react110 = require("react");
|
|
8264
8343
|
|
|
8265
8344
|
// src/components/Pagination/Pagination.module.css
|
|
8266
8345
|
var Pagination_default = {
|
|
@@ -8323,7 +8402,7 @@ function PaginationGenerator(pagesAmount, activePage) {
|
|
|
8323
8402
|
}
|
|
8324
8403
|
|
|
8325
8404
|
// src/components/Select/Select.tsx
|
|
8326
|
-
var
|
|
8405
|
+
var import_react108 = require("react");
|
|
8327
8406
|
var import_react_select2 = __toESM(require("react-select"));
|
|
8328
8407
|
|
|
8329
8408
|
// src/components/Select/Select.module.css
|
|
@@ -8720,12 +8799,12 @@ function SelectInner(props, ref) {
|
|
|
8720
8799
|
"data-testid": dataTestId,
|
|
8721
8800
|
...rest
|
|
8722
8801
|
} = props;
|
|
8723
|
-
const themeContext = (0,
|
|
8802
|
+
const themeContext = (0, import_react108.useContext)(ThemeContext);
|
|
8724
8803
|
if (!themeContext) {
|
|
8725
8804
|
throw new Error("Select must be used within a ThemeProvider");
|
|
8726
8805
|
}
|
|
8727
8806
|
const portalTarget = menuPortalTarget != null ? menuPortalTarget : themeContext == null ? void 0 : themeContext.el;
|
|
8728
|
-
const generatedId = (0,
|
|
8807
|
+
const generatedId = (0, import_react108.useId)();
|
|
8729
8808
|
const uniqueId = id != null ? id : `${generatedId}-select`;
|
|
8730
8809
|
const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
|
|
8731
8810
|
const hasLabel = !!label;
|
|
@@ -8816,11 +8895,11 @@ function SelectInner(props, ref) {
|
|
|
8816
8895
|
}
|
|
8817
8896
|
);
|
|
8818
8897
|
}
|
|
8819
|
-
var Select = (0,
|
|
8898
|
+
var Select = (0, import_react108.forwardRef)(SelectInner);
|
|
8820
8899
|
Select.displayName = "Select";
|
|
8821
8900
|
|
|
8822
8901
|
// src/components/Select/NativeSelect/NativeSelect.tsx
|
|
8823
|
-
var
|
|
8902
|
+
var import_react109 = require("react");
|
|
8824
8903
|
|
|
8825
8904
|
// src/components/Select/NativeSelect/NativeSelect.module.css
|
|
8826
8905
|
var NativeSelect_default = {
|
|
@@ -8836,7 +8915,7 @@ var NativeSelect_default = {
|
|
|
8836
8915
|
|
|
8837
8916
|
// src/components/Select/NativeSelect/NativeSelect.tsx
|
|
8838
8917
|
var import_jsx_runtime268 = require("react/jsx-runtime");
|
|
8839
|
-
var NativeSelect = (0,
|
|
8918
|
+
var NativeSelect = (0, import_react109.forwardRef)(
|
|
8840
8919
|
(props, ref) => {
|
|
8841
8920
|
const {
|
|
8842
8921
|
id,
|
|
@@ -8855,7 +8934,7 @@ var NativeSelect = (0, import_react108.forwardRef)(
|
|
|
8855
8934
|
style,
|
|
8856
8935
|
...rest
|
|
8857
8936
|
} = props;
|
|
8858
|
-
const generatedId = (0,
|
|
8937
|
+
const generatedId = (0, import_react109.useId)();
|
|
8859
8938
|
const uniqueId = id != null ? id : `${generatedId}-native-select`;
|
|
8860
8939
|
const hasErrorMessage = !!errorMessage;
|
|
8861
8940
|
const hasTip = !!tip;
|
|
@@ -8930,7 +9009,7 @@ var NativeSelect = (0, import_react108.forwardRef)(
|
|
|
8930
9009
|
] });
|
|
8931
9010
|
}
|
|
8932
9011
|
);
|
|
8933
|
-
var NativeSelectPlaceholder = (0,
|
|
9012
|
+
var NativeSelectPlaceholder = (0, import_react109.forwardRef)((props, ref) => {
|
|
8934
9013
|
const { children = "-- Velg fra listen --", value, ...rest } = props;
|
|
8935
9014
|
return /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("option", { ref, value: value != null ? value : "", selected: true, ...rest, children });
|
|
8936
9015
|
});
|
|
@@ -8941,7 +9020,7 @@ var createSelectOptions = (...args) => args.map((v) => ({ label: v, value: v }))
|
|
|
8941
9020
|
|
|
8942
9021
|
// src/components/Pagination/Pagination.tsx
|
|
8943
9022
|
var import_jsx_runtime269 = require("react/jsx-runtime");
|
|
8944
|
-
var Pagination = (0,
|
|
9023
|
+
var Pagination = (0, import_react110.forwardRef)(
|
|
8945
9024
|
(props, ref) => {
|
|
8946
9025
|
const {
|
|
8947
9026
|
itemsAmount,
|
|
@@ -8964,8 +9043,8 @@ var Pagination = (0, import_react109.forwardRef)(
|
|
|
8964
9043
|
htmlProps,
|
|
8965
9044
|
...rest
|
|
8966
9045
|
} = props;
|
|
8967
|
-
const [activePage, setActivePage] = (0,
|
|
8968
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
9046
|
+
const [activePage, setActivePage] = (0, import_react110.useState)(defaultActivePage);
|
|
9047
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react110.useState)(defaultItemsPerPage);
|
|
8969
9048
|
const pagesLength = Math.ceil(itemsAmount / itemsPerPage);
|
|
8970
9049
|
const items = PaginationGenerator(pagesLength, activePage);
|
|
8971
9050
|
const onPageChange = (event, page) => {
|
|
@@ -9198,7 +9277,7 @@ var Pagination = (0, import_react109.forwardRef)(
|
|
|
9198
9277
|
Pagination.displayName = "Pagination";
|
|
9199
9278
|
|
|
9200
9279
|
// src/components/PhoneInput/PhoneInput.tsx
|
|
9201
|
-
var
|
|
9280
|
+
var import_react111 = require("react");
|
|
9202
9281
|
|
|
9203
9282
|
// src/components/PhoneInput/constants.ts
|
|
9204
9283
|
var COUNTRIES = {
|
|
@@ -9634,7 +9713,7 @@ var countryOptions = [
|
|
|
9634
9713
|
...prioritizedCountryOptions,
|
|
9635
9714
|
...sortedCountryOptions
|
|
9636
9715
|
];
|
|
9637
|
-
var PhoneInput = (0,
|
|
9716
|
+
var PhoneInput = (0, import_react111.forwardRef)(
|
|
9638
9717
|
({
|
|
9639
9718
|
label,
|
|
9640
9719
|
readOnly,
|
|
@@ -9657,7 +9736,7 @@ var PhoneInput = (0, import_react110.forwardRef)(
|
|
|
9657
9736
|
...props
|
|
9658
9737
|
}, ref) => {
|
|
9659
9738
|
var _a;
|
|
9660
|
-
const generatedId = (0,
|
|
9739
|
+
const generatedId = (0, import_react111.useId)();
|
|
9661
9740
|
const uniqueId = (_a = props.id) != null ? _a : generatedId;
|
|
9662
9741
|
const phoneInputId = `${uniqueId}-phone-input`;
|
|
9663
9742
|
const phoneNumberId = `${uniqueId}-phone-number`;
|
|
@@ -9668,18 +9747,18 @@ var PhoneInput = (0, import_react110.forwardRef)(
|
|
|
9668
9747
|
const hasMessage = hasErrorMessage || hasTip;
|
|
9669
9748
|
const tipId = derivativeIdGenerator(phoneInputId, "tip");
|
|
9670
9749
|
const errorMessageId = derivativeIdGenerator(phoneInputId, "errorMessage");
|
|
9671
|
-
const [callingCode, setCallingCode] = (0,
|
|
9672
|
-
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0,
|
|
9673
|
-
const [internalValue, setInternalValue] = (0,
|
|
9750
|
+
const [callingCode, setCallingCode] = (0, import_react111.useState)("");
|
|
9751
|
+
const [selectedCountryCodeText, setSelectedCountryCodeText] = (0, import_react111.useState)("");
|
|
9752
|
+
const [internalValue, setInternalValue] = (0, import_react111.useState)(
|
|
9674
9753
|
defaultValue != null ? defaultValue : {
|
|
9675
9754
|
countryCode: "",
|
|
9676
9755
|
phoneNumber: ""
|
|
9677
9756
|
}
|
|
9678
9757
|
);
|
|
9679
9758
|
const isControlled = value !== void 0;
|
|
9680
|
-
const [callingCodeWidth, setCallingCodeWidth] = (0,
|
|
9681
|
-
const callingCodeRef = (0,
|
|
9682
|
-
(0,
|
|
9759
|
+
const [callingCodeWidth, setCallingCodeWidth] = (0, import_react111.useState)(0);
|
|
9760
|
+
const callingCodeRef = (0, import_react111.useRef)(null);
|
|
9761
|
+
(0, import_react111.useLayoutEffect)(() => {
|
|
9683
9762
|
if (callingCodeRef.current) {
|
|
9684
9763
|
setCallingCodeWidth(callingCodeRef.current.offsetWidth);
|
|
9685
9764
|
}
|
|
@@ -9689,10 +9768,10 @@ var PhoneInput = (0, import_react110.forwardRef)(
|
|
|
9689
9768
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9690
9769
|
["--dds-phone-input-width"]: width ? width : componentSize === "xsmall" ? "131px" : "194px"
|
|
9691
9770
|
};
|
|
9692
|
-
const internalSelectRef = (0,
|
|
9771
|
+
const internalSelectRef = (0, import_react111.useRef)(null);
|
|
9693
9772
|
const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
|
|
9694
9773
|
const displayedValue = isControlled ? value : internalValue;
|
|
9695
|
-
(0,
|
|
9774
|
+
(0, import_react111.useEffect)(() => {
|
|
9696
9775
|
const selectEl = internalSelectRef.current;
|
|
9697
9776
|
if (selectEl && selectEl.value) {
|
|
9698
9777
|
const { options, selectedIndex } = selectEl;
|
|
@@ -9834,33 +9913,29 @@ var getCallingCode = (s) => {
|
|
|
9834
9913
|
};
|
|
9835
9914
|
|
|
9836
9915
|
// src/components/Popover/Popover.tsx
|
|
9837
|
-
var
|
|
9916
|
+
var import_react113 = require("react");
|
|
9838
9917
|
|
|
9839
9918
|
// src/components/Popover/Popover.module.css
|
|
9840
9919
|
var Popover_default = {
|
|
9841
9920
|
container: "Popover_container",
|
|
9842
|
-
"content--closable--no-
|
|
9843
|
-
|
|
9921
|
+
"content--closable--no-header": "Popover_content--closable--no-header",
|
|
9922
|
+
header: "Popover_header",
|
|
9844
9923
|
"close-button": "Popover_close-button"
|
|
9845
9924
|
};
|
|
9846
9925
|
|
|
9847
9926
|
// src/components/Popover/Popover.context.tsx
|
|
9848
|
-
var
|
|
9849
|
-
var PopoverContext = (0,
|
|
9850
|
-
var usePopoverContext = () => (0,
|
|
9927
|
+
var import_react112 = require("react");
|
|
9928
|
+
var PopoverContext = (0, import_react112.createContext)({});
|
|
9929
|
+
var usePopoverContext = () => (0, import_react112.useContext)(PopoverContext);
|
|
9851
9930
|
|
|
9852
9931
|
// src/components/Popover/Popover.tsx
|
|
9853
9932
|
var import_jsx_runtime271 = require("react/jsx-runtime");
|
|
9854
|
-
var Popover = (0,
|
|
9933
|
+
var Popover = (0, import_react113.forwardRef)(
|
|
9855
9934
|
(props, ref) => {
|
|
9856
9935
|
const {
|
|
9857
|
-
|
|
9858
|
-
isOpen = false,
|
|
9936
|
+
header,
|
|
9859
9937
|
withCloseButton = true,
|
|
9860
9938
|
onBlur,
|
|
9861
|
-
onCloseButtonClick,
|
|
9862
|
-
onClose,
|
|
9863
|
-
anchorElement,
|
|
9864
9939
|
children,
|
|
9865
9940
|
placement = "bottom",
|
|
9866
9941
|
offset = 8,
|
|
@@ -9870,26 +9945,29 @@ var Popover = (0, import_react112.forwardRef)(
|
|
|
9870
9945
|
htmlProps = {},
|
|
9871
9946
|
...rest
|
|
9872
9947
|
} = props;
|
|
9948
|
+
const {
|
|
9949
|
+
floatStyling,
|
|
9950
|
+
setFloatOptions,
|
|
9951
|
+
floatingRef,
|
|
9952
|
+
popoverId,
|
|
9953
|
+
onClose,
|
|
9954
|
+
isOpen = false,
|
|
9955
|
+
anchorEl
|
|
9956
|
+
} = usePopoverContext();
|
|
9873
9957
|
const hasTransitionedIn = useMountTransition(isOpen, 400);
|
|
9874
|
-
const { floatStyling, setFloatOptions, floatingRef, popoverId } = usePopoverContext();
|
|
9875
9958
|
const popoverRef = useReturnFocusOnBlur(
|
|
9876
9959
|
isOpen && hasTransitionedIn && returnFocusOnBlur,
|
|
9877
9960
|
() => {
|
|
9878
9961
|
onClose && onClose();
|
|
9879
9962
|
onBlur && onBlur();
|
|
9880
9963
|
},
|
|
9881
|
-
|
|
9964
|
+
anchorEl && anchorEl
|
|
9882
9965
|
);
|
|
9883
9966
|
const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
|
|
9884
|
-
(0,
|
|
9967
|
+
(0, import_react113.useEffect)(() => {
|
|
9885
9968
|
setFloatOptions && setFloatOptions({ placement, offset });
|
|
9886
|
-
}, []);
|
|
9887
|
-
const
|
|
9888
|
-
if (anchorElement) elements.push(anchorElement);
|
|
9889
|
-
const hasTitle = !!title;
|
|
9890
|
-
useOnClickOutside(elements, () => {
|
|
9891
|
-
if (isOpen) onClose && onClose();
|
|
9892
|
-
});
|
|
9969
|
+
}, [placement, offset]);
|
|
9970
|
+
const hasTitle = !!header;
|
|
9893
9971
|
const openCn = hasTransitionedIn && isOpen ? "open" : "closed";
|
|
9894
9972
|
return isOpen || hasTransitionedIn ? /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)(
|
|
9895
9973
|
Paper,
|
|
@@ -9917,11 +9995,11 @@ var Popover = (0, import_react112.forwardRef)(
|
|
|
9917
9995
|
elevation: 3,
|
|
9918
9996
|
border: "subtle",
|
|
9919
9997
|
children: [
|
|
9920
|
-
|
|
9998
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime271.jsx)("div", { className: Popover_default.header, children: typeof header === "string" ? /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(Heading, { level: 2, typographyType: "headingMedium", children: header }) : header }),
|
|
9921
9999
|
/* @__PURE__ */ (0, import_jsx_runtime271.jsx)(
|
|
9922
10000
|
"div",
|
|
9923
10001
|
{
|
|
9924
|
-
className: !hasTitle && withCloseButton ? Popover_default["content--closable--no-
|
|
10002
|
+
className: !hasTitle && withCloseButton ? Popover_default["content--closable--no-header"] : "",
|
|
9925
10003
|
children
|
|
9926
10004
|
}
|
|
9927
10005
|
),
|
|
@@ -9931,7 +10009,7 @@ var Popover = (0, import_react112.forwardRef)(
|
|
|
9931
10009
|
icon: CloseIcon,
|
|
9932
10010
|
purpose: "tertiary",
|
|
9933
10011
|
size: "small",
|
|
9934
|
-
onClick:
|
|
10012
|
+
onClick: onClose,
|
|
9935
10013
|
"aria-label": "Lukk",
|
|
9936
10014
|
className: Popover_default["close-button"]
|
|
9937
10015
|
}
|
|
@@ -9944,54 +10022,67 @@ var Popover = (0, import_react112.forwardRef)(
|
|
|
9944
10022
|
Popover.displayName = "Popover";
|
|
9945
10023
|
|
|
9946
10024
|
// src/components/Popover/PopoverGroup.tsx
|
|
9947
|
-
var
|
|
10025
|
+
var import_react114 = require("react");
|
|
9948
10026
|
var import_jsx_runtime272 = require("react/jsx-runtime");
|
|
9949
10027
|
var PopoverGroup = ({
|
|
9950
|
-
isOpen
|
|
9951
|
-
|
|
9952
|
-
|
|
10028
|
+
isOpen: propIsOpen,
|
|
10029
|
+
setIsOpen: propSetIsOpen,
|
|
10030
|
+
onClose,
|
|
10031
|
+
onOpen,
|
|
10032
|
+
isInitiallyOpen = false,
|
|
9953
10033
|
children,
|
|
9954
10034
|
popoverId
|
|
9955
10035
|
}) => {
|
|
9956
|
-
|
|
9957
|
-
const
|
|
10036
|
+
var _a;
|
|
10037
|
+
const [internalIsOpen, internalSetIsOpen] = (0, import_react114.useState)(isInitiallyOpen);
|
|
10038
|
+
const open = propIsOpen != null ? propIsOpen : internalIsOpen;
|
|
10039
|
+
const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
|
|
10040
|
+
const generatedId = (0, import_react114.useId)();
|
|
9958
10041
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
9959
|
-
const [floatOptions, setFloatOptions] = (0,
|
|
10042
|
+
const [floatOptions, setFloatOptions] = (0, import_react114.useState)();
|
|
9960
10043
|
const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
|
|
9961
|
-
const
|
|
10044
|
+
const handleClose = () => {
|
|
9962
10045
|
setOpen(false);
|
|
9963
|
-
|
|
10046
|
+
onClose && onClose();
|
|
9964
10047
|
};
|
|
9965
|
-
const
|
|
9966
|
-
setOpen(
|
|
9967
|
-
|
|
10048
|
+
const handleOpen = () => {
|
|
10049
|
+
setOpen(true);
|
|
10050
|
+
onOpen && onOpen();
|
|
10051
|
+
};
|
|
10052
|
+
const handleToggle = () => {
|
|
10053
|
+
if (open) {
|
|
10054
|
+
handleClose();
|
|
10055
|
+
} else {
|
|
10056
|
+
handleOpen();
|
|
10057
|
+
}
|
|
9968
10058
|
};
|
|
9969
|
-
const buttonRef = (0,
|
|
10059
|
+
const buttonRef = (0, import_react114.useRef)(null);
|
|
9970
10060
|
const anchorRef = refs.setReference;
|
|
9971
|
-
const
|
|
10061
|
+
const combinedAnchorRef = useCombinedRef(buttonRef, anchorRef);
|
|
10062
|
+
const popoverRef = (0, import_react114.useRef)(null);
|
|
10063
|
+
const floatingRef = refs.setFloating;
|
|
10064
|
+
const combinedPopoverRef = useCombinedRef(popoverRef, floatingRef);
|
|
9972
10065
|
useOnKeyDown(["Esc", "Escape"], () => {
|
|
9973
|
-
var
|
|
10066
|
+
var _a2;
|
|
9974
10067
|
if (open) {
|
|
9975
|
-
|
|
9976
|
-
(
|
|
10068
|
+
handleClose();
|
|
10069
|
+
(_a2 = buttonRef.current) == null ? void 0 : _a2.focus();
|
|
9977
10070
|
}
|
|
9978
10071
|
});
|
|
9979
|
-
const
|
|
10072
|
+
const elements = [popoverRef.current];
|
|
10073
|
+
if (buttonRef.current) elements.push(buttonRef.current);
|
|
10074
|
+
useOnClickOutside(elements, () => {
|
|
10075
|
+
if (open) handleClose();
|
|
10076
|
+
});
|
|
9980
10077
|
const isAnchorChild = (i) => i === 0;
|
|
9981
|
-
const Children8 =
|
|
9982
|
-
return (0,
|
|
10078
|
+
const Children8 = import_react114.Children.map(children, (child, childIndex) => {
|
|
10079
|
+
return (0, import_react114.isValidElement)(child) && (isAnchorChild(childIndex) ? (0, import_react114.cloneElement)(child, {
|
|
9983
10080
|
"aria-haspopup": "dialog",
|
|
9984
10081
|
"aria-controls": uniquePopoverId,
|
|
9985
10082
|
"aria-expanded": open,
|
|
9986
|
-
onClick:
|
|
9987
|
-
ref:
|
|
9988
|
-
}) :
|
|
9989
|
-
isOpen: open,
|
|
9990
|
-
"aria-hidden": !open,
|
|
9991
|
-
onCloseButtonClick: handleOnCloseButtonClick,
|
|
9992
|
-
anchorElement: buttonRef.current,
|
|
9993
|
-
onClose: handleClose
|
|
9994
|
-
}));
|
|
10083
|
+
onClick: handleToggle,
|
|
10084
|
+
ref: combinedAnchorRef
|
|
10085
|
+
}) : child);
|
|
9995
10086
|
});
|
|
9996
10087
|
return /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(
|
|
9997
10088
|
PopoverContext.Provider,
|
|
@@ -9999,8 +10090,11 @@ var PopoverGroup = ({
|
|
|
9999
10090
|
value: {
|
|
10000
10091
|
floatStyling: positionStyles.floating,
|
|
10001
10092
|
setFloatOptions,
|
|
10002
|
-
floatingRef:
|
|
10003
|
-
popoverId: uniquePopoverId
|
|
10093
|
+
floatingRef: combinedPopoverRef,
|
|
10094
|
+
popoverId: uniquePopoverId,
|
|
10095
|
+
onClose: handleClose,
|
|
10096
|
+
isOpen: open,
|
|
10097
|
+
anchorEl: (_a = buttonRef.current) != null ? _a : void 0
|
|
10004
10098
|
},
|
|
10005
10099
|
children: Children8
|
|
10006
10100
|
}
|
|
@@ -10009,16 +10103,16 @@ var PopoverGroup = ({
|
|
|
10009
10103
|
PopoverGroup.displayName = "PopoverGroup";
|
|
10010
10104
|
|
|
10011
10105
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
10012
|
-
var
|
|
10106
|
+
var import_react117 = require("react");
|
|
10013
10107
|
|
|
10014
10108
|
// src/components/ProgressTracker/ProgressTracker.context.tsx
|
|
10015
|
-
var
|
|
10016
|
-
var ProgressTrackerContext = (0,
|
|
10109
|
+
var import_react115 = require("react");
|
|
10110
|
+
var ProgressTrackerContext = (0, import_react115.createContext)(
|
|
10017
10111
|
{
|
|
10018
10112
|
activeStep: 0
|
|
10019
10113
|
}
|
|
10020
10114
|
);
|
|
10021
|
-
var useProgressTrackerContext = () => (0,
|
|
10115
|
+
var useProgressTrackerContext = () => (0, import_react115.useContext)(ProgressTrackerContext);
|
|
10022
10116
|
|
|
10023
10117
|
// src/components/ProgressTracker/ProgressTracker.module.css
|
|
10024
10118
|
var ProgressTracker_default = {
|
|
@@ -10042,7 +10136,7 @@ var ProgressTracker_default = {
|
|
|
10042
10136
|
};
|
|
10043
10137
|
|
|
10044
10138
|
// src/components/ProgressTracker/ProgressTrackerItem.tsx
|
|
10045
|
-
var
|
|
10139
|
+
var import_react116 = require("react");
|
|
10046
10140
|
var import_jsx_runtime273 = require("react/jsx-runtime");
|
|
10047
10141
|
var toItemState = (active, completed, disabled) => {
|
|
10048
10142
|
if (disabled) {
|
|
@@ -10084,7 +10178,7 @@ var ProgressTrackerItem = (props) => {
|
|
|
10084
10178
|
handleStepChange && handleStepChange(index);
|
|
10085
10179
|
}
|
|
10086
10180
|
};
|
|
10087
|
-
const stepNumberContent = (0,
|
|
10181
|
+
const stepNumberContent = (0, import_react116.useMemo)(() => {
|
|
10088
10182
|
if (completed) {
|
|
10089
10183
|
return /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(Icon, { icon: CheckIcon, iconSize: "small" });
|
|
10090
10184
|
}
|
|
@@ -10152,7 +10246,7 @@ ProgressTrackerItem.displayName = "ProgressTracker.Item";
|
|
|
10152
10246
|
// src/components/ProgressTracker/ProgressTracker.tsx
|
|
10153
10247
|
var import_jsx_runtime274 = require("react/jsx-runtime");
|
|
10154
10248
|
var ProgressTracker = (() => {
|
|
10155
|
-
const Res = (0,
|
|
10249
|
+
const Res = (0, import_react117.forwardRef)((props, ref) => {
|
|
10156
10250
|
const {
|
|
10157
10251
|
id,
|
|
10158
10252
|
activeStep = 0,
|
|
@@ -10162,12 +10256,12 @@ var ProgressTracker = (() => {
|
|
|
10162
10256
|
htmlProps,
|
|
10163
10257
|
...rest
|
|
10164
10258
|
} = props;
|
|
10165
|
-
const [thisActiveStep, setActiveStep] = (0,
|
|
10259
|
+
const [thisActiveStep, setActiveStep] = (0, import_react117.useState)(activeStep);
|
|
10166
10260
|
const handleChange = (step) => {
|
|
10167
10261
|
setActiveStep(step);
|
|
10168
10262
|
onStepChange && onStepChange(step);
|
|
10169
10263
|
};
|
|
10170
|
-
(0,
|
|
10264
|
+
(0, import_react117.useEffect)(() => {
|
|
10171
10265
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
10172
10266
|
setActiveStep(activeStep);
|
|
10173
10267
|
}
|
|
@@ -10176,7 +10270,7 @@ var ProgressTracker = (() => {
|
|
|
10176
10270
|
...getBaseHTMLProps(id, className, htmlProps, rest),
|
|
10177
10271
|
ref
|
|
10178
10272
|
};
|
|
10179
|
-
const steps = (0,
|
|
10273
|
+
const steps = (0, import_react117.useMemo)(() => {
|
|
10180
10274
|
const validChildren = removeInvalidChildren(children);
|
|
10181
10275
|
const itemsWithIndex = passIndexPropToProgressTrackerItem(validChildren);
|
|
10182
10276
|
const itemsWithConnectorsBetween = intersperseItemsWithConnector(itemsWithIndex);
|
|
@@ -10198,29 +10292,29 @@ var ProgressTracker = (() => {
|
|
|
10198
10292
|
return Res;
|
|
10199
10293
|
})();
|
|
10200
10294
|
function removeInvalidChildren(children) {
|
|
10201
|
-
return
|
|
10295
|
+
return import_react117.Children.toArray(children).filter(import_react117.isValidElement);
|
|
10202
10296
|
}
|
|
10203
10297
|
function passIndexPropToProgressTrackerItem(children) {
|
|
10204
|
-
return
|
|
10298
|
+
return import_react117.Children.map(
|
|
10205
10299
|
children,
|
|
10206
|
-
(item, index) => (0,
|
|
10300
|
+
(item, index) => (0, import_react117.cloneElement)(item, {
|
|
10207
10301
|
...item.props,
|
|
10208
10302
|
index
|
|
10209
10303
|
})
|
|
10210
10304
|
);
|
|
10211
10305
|
}
|
|
10212
|
-
var intersperseItemsWithConnector = (children) =>
|
|
10306
|
+
var intersperseItemsWithConnector = (children) => import_react117.Children.map(children, (child, index) => {
|
|
10213
10307
|
if (index === 0) {
|
|
10214
10308
|
return child;
|
|
10215
10309
|
}
|
|
10216
|
-
return /* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(
|
|
10310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime274.jsxs)(import_react117.Fragment, { children: [
|
|
10217
10311
|
/* @__PURE__ */ (0, import_jsx_runtime274.jsx)("div", { "aria-hidden": true, className: ProgressTracker_default.connector }),
|
|
10218
10312
|
child
|
|
10219
10313
|
] }, index);
|
|
10220
10314
|
});
|
|
10221
10315
|
|
|
10222
10316
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10223
|
-
var
|
|
10317
|
+
var import_react118 = require("react");
|
|
10224
10318
|
|
|
10225
10319
|
// src/components/ProgressBar/ProgressBar.module.css
|
|
10226
10320
|
var ProgressBar_default = {
|
|
@@ -10237,7 +10331,7 @@ var ProgressBar_default = {
|
|
|
10237
10331
|
|
|
10238
10332
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10239
10333
|
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
10240
|
-
var ProgressBar = (0,
|
|
10334
|
+
var ProgressBar = (0, import_react118.forwardRef)(
|
|
10241
10335
|
(props, ref) => {
|
|
10242
10336
|
const {
|
|
10243
10337
|
label,
|
|
@@ -10253,7 +10347,7 @@ var ProgressBar = (0, import_react117.forwardRef)(
|
|
|
10253
10347
|
style,
|
|
10254
10348
|
...rest
|
|
10255
10349
|
} = props;
|
|
10256
|
-
const generatedId = (0,
|
|
10350
|
+
const generatedId = (0, import_react118.useId)();
|
|
10257
10351
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
10258
10352
|
const hasErrorMessage = !!errorMessage;
|
|
10259
10353
|
const hasTip = !!tip;
|
|
@@ -10316,13 +10410,13 @@ var ProgressBar = (0, import_react117.forwardRef)(
|
|
|
10316
10410
|
ProgressBar.displayName = "ProgressBar";
|
|
10317
10411
|
|
|
10318
10412
|
// src/components/Search/Search.tsx
|
|
10319
|
-
var
|
|
10413
|
+
var import_react122 = require("react");
|
|
10320
10414
|
|
|
10321
10415
|
// src/components/Search/AutocompleteSearch.context.tsx
|
|
10322
|
-
var
|
|
10323
|
-
var AutocompleteSearchContext = (0,
|
|
10416
|
+
var import_react119 = require("react");
|
|
10417
|
+
var AutocompleteSearchContext = (0, import_react119.createContext)({});
|
|
10324
10418
|
var useAutocompleteSearch = () => {
|
|
10325
|
-
return (0,
|
|
10419
|
+
return (0, import_react119.useContext)(AutocompleteSearchContext);
|
|
10326
10420
|
};
|
|
10327
10421
|
|
|
10328
10422
|
// src/components/Search/Search.module.css
|
|
@@ -10372,16 +10466,16 @@ function createEmptyChangeEvent(inputElementId) {
|
|
|
10372
10466
|
}
|
|
10373
10467
|
|
|
10374
10468
|
// src/components/Search/SearchSuggestions.tsx
|
|
10375
|
-
var
|
|
10469
|
+
var import_react121 = require("react");
|
|
10376
10470
|
|
|
10377
10471
|
// src/components/Search/SearchSuggestionItem.tsx
|
|
10378
|
-
var
|
|
10472
|
+
var import_react120 = require("react");
|
|
10379
10473
|
var import_jsx_runtime276 = require("react/jsx-runtime");
|
|
10380
|
-
var SearchSuggestionItem = (0,
|
|
10474
|
+
var SearchSuggestionItem = (0, import_react120.forwardRef)((props, ref) => {
|
|
10381
10475
|
const { focus, className, ...rest } = props;
|
|
10382
|
-
const itemRef = (0,
|
|
10476
|
+
const itemRef = (0, import_react120.useRef)(null);
|
|
10383
10477
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
10384
|
-
(0,
|
|
10478
|
+
(0, import_react120.useEffect)(() => {
|
|
10385
10479
|
var _a;
|
|
10386
10480
|
if (focus) {
|
|
10387
10481
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
@@ -10407,7 +10501,7 @@ SearchSuggestionItem.displayName = "SearchSuggestionItem";
|
|
|
10407
10501
|
|
|
10408
10502
|
// src/components/Search/SearchSuggestions.tsx
|
|
10409
10503
|
var import_jsx_runtime277 = require("react/jsx-runtime");
|
|
10410
|
-
var SearchSuggestions = (0,
|
|
10504
|
+
var SearchSuggestions = (0, import_react121.forwardRef)((props, ref) => {
|
|
10411
10505
|
const {
|
|
10412
10506
|
id,
|
|
10413
10507
|
searchId,
|
|
@@ -10497,7 +10591,7 @@ var getIconSize2 = (size2) => {
|
|
|
10497
10591
|
return "small";
|
|
10498
10592
|
}
|
|
10499
10593
|
};
|
|
10500
|
-
var Search = (0,
|
|
10594
|
+
var Search = (0, import_react122.forwardRef)(
|
|
10501
10595
|
({
|
|
10502
10596
|
componentSize = "medium",
|
|
10503
10597
|
buttonProps,
|
|
@@ -10513,7 +10607,7 @@ var Search = (0, import_react121.forwardRef)(
|
|
|
10513
10607
|
...rest
|
|
10514
10608
|
}, ref) => {
|
|
10515
10609
|
var _a;
|
|
10516
|
-
const generatedId = (0,
|
|
10610
|
+
const generatedId = (0, import_react122.useId)();
|
|
10517
10611
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
10518
10612
|
const hasLabel = !!label;
|
|
10519
10613
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -10522,7 +10616,7 @@ var Search = (0, import_react121.forwardRef)(
|
|
|
10522
10616
|
uniqueId,
|
|
10523
10617
|
"suggestions-description"
|
|
10524
10618
|
);
|
|
10525
|
-
const [hasValue, setHasValue] = (0,
|
|
10619
|
+
const [hasValue, setHasValue] = (0, import_react122.useState)(!!value);
|
|
10526
10620
|
const context = useAutocompleteSearch();
|
|
10527
10621
|
const combinedRef = context.inputRef ? useCombinedRef(context.inputRef, ref) : ref;
|
|
10528
10622
|
const handleChange = (e) => {
|
|
@@ -10639,7 +10733,7 @@ var Search = (0, import_react121.forwardRef)(
|
|
|
10639
10733
|
Search.displayName = "Search";
|
|
10640
10734
|
|
|
10641
10735
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
10642
|
-
var
|
|
10736
|
+
var import_react123 = require("react");
|
|
10643
10737
|
var import_jsx_runtime279 = require("react/jsx-runtime");
|
|
10644
10738
|
var SearchAutocompleteWrapper = (props) => {
|
|
10645
10739
|
const {
|
|
@@ -10651,12 +10745,12 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
10651
10745
|
onSuggestionSelection,
|
|
10652
10746
|
children
|
|
10653
10747
|
} = props;
|
|
10654
|
-
const [inputValue, setInputValue] = (0,
|
|
10655
|
-
const [suggestions, setSuggestions] = (0,
|
|
10656
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
10748
|
+
const [inputValue, setInputValue] = (0, import_react123.useState)(value != null ? value : "");
|
|
10749
|
+
const [suggestions, setSuggestions] = (0, import_react123.useState)([]);
|
|
10750
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react123.useState)(false);
|
|
10657
10751
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
10658
10752
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
10659
|
-
(0,
|
|
10753
|
+
(0, import_react123.useEffect)(() => {
|
|
10660
10754
|
if (suggestions.length > 0) {
|
|
10661
10755
|
openSuggestions();
|
|
10662
10756
|
} else {
|
|
@@ -10701,8 +10795,8 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
10701
10795
|
const handleSetInputValue = (value2) => {
|
|
10702
10796
|
setInputValue(value2 != null ? value2 : "");
|
|
10703
10797
|
};
|
|
10704
|
-
const inputRef = (0,
|
|
10705
|
-
const suggestionsRef = (0,
|
|
10798
|
+
const inputRef = (0, import_react123.useRef)(null);
|
|
10799
|
+
const suggestionsRef = (0, import_react123.useRef)(null);
|
|
10706
10800
|
useOnClickOutside([inputRef.current, suggestionsRef.current], () => {
|
|
10707
10801
|
closeSuggestions();
|
|
10708
10802
|
});
|
|
@@ -10726,17 +10820,17 @@ Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
|
10726
10820
|
Search2.Suggestions = SearchSuggestions;
|
|
10727
10821
|
|
|
10728
10822
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
10729
|
-
var
|
|
10823
|
+
var import_react126 = require("react");
|
|
10730
10824
|
|
|
10731
10825
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
10732
|
-
var
|
|
10733
|
-
var CheckboxGroupContext = (0,
|
|
10826
|
+
var import_react124 = require("react");
|
|
10827
|
+
var CheckboxGroupContext = (0, import_react124.createContext)(null);
|
|
10734
10828
|
var useCheckboxGroup = () => {
|
|
10735
|
-
return (0,
|
|
10829
|
+
return (0, import_react124.useContext)(CheckboxGroupContext);
|
|
10736
10830
|
};
|
|
10737
10831
|
|
|
10738
10832
|
// src/components/SelectionControl/SelectionControl.styles.tsx
|
|
10739
|
-
var
|
|
10833
|
+
var import_react125 = require("react");
|
|
10740
10834
|
|
|
10741
10835
|
// src/components/SelectionControl/SelectionControl.module.css
|
|
10742
10836
|
var SelectionControl_default = {
|
|
@@ -10757,7 +10851,7 @@ var SelectionControl_default = {
|
|
|
10757
10851
|
|
|
10758
10852
|
// src/components/SelectionControl/SelectionControl.styles.tsx
|
|
10759
10853
|
var import_jsx_runtime280 = require("react/jsx-runtime");
|
|
10760
|
-
var SelectionControl = (0,
|
|
10854
|
+
var SelectionControl = (0, import_react125.forwardRef)((props, ref) => {
|
|
10761
10855
|
const { controlType, className, ...rest } = props;
|
|
10762
10856
|
return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(
|
|
10763
10857
|
"span",
|
|
@@ -10772,7 +10866,7 @@ var SelectionControl = (0, import_react124.forwardRef)((props, ref) => {
|
|
|
10772
10866
|
}
|
|
10773
10867
|
);
|
|
10774
10868
|
});
|
|
10775
|
-
var Label2 = (0,
|
|
10869
|
+
var Label2 = (0, import_react125.forwardRef)(
|
|
10776
10870
|
(props, ref) => {
|
|
10777
10871
|
const {
|
|
10778
10872
|
disabled,
|
|
@@ -10815,7 +10909,7 @@ var selectionControlTypographyProps = {
|
|
|
10815
10909
|
|
|
10816
10910
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
10817
10911
|
var import_jsx_runtime281 = require("react/jsx-runtime");
|
|
10818
|
-
var Checkbox = (0,
|
|
10912
|
+
var Checkbox = (0, import_react126.forwardRef)(
|
|
10819
10913
|
(props, ref) => {
|
|
10820
10914
|
const {
|
|
10821
10915
|
id,
|
|
@@ -10830,7 +10924,7 @@ var Checkbox = (0, import_react125.forwardRef)(
|
|
|
10830
10924
|
htmlProps = {},
|
|
10831
10925
|
...rest
|
|
10832
10926
|
} = props;
|
|
10833
|
-
const generatedId = (0,
|
|
10927
|
+
const generatedId = (0, import_react126.useId)();
|
|
10834
10928
|
const uniqueId = id != null ? id : `${generatedId}-checkbox`;
|
|
10835
10929
|
const checkboxGroup = useCheckboxGroup();
|
|
10836
10930
|
const hasLabel = !!label;
|
|
@@ -10900,7 +10994,7 @@ var Checkbox = (0, import_react125.forwardRef)(
|
|
|
10900
10994
|
Checkbox.displayName = "Checkbox";
|
|
10901
10995
|
|
|
10902
10996
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
10903
|
-
var
|
|
10997
|
+
var import_react127 = require("react");
|
|
10904
10998
|
var import_jsx_runtime282 = require("react/jsx-runtime");
|
|
10905
10999
|
var CheckboxGroup = (props) => {
|
|
10906
11000
|
const {
|
|
@@ -10919,7 +11013,7 @@ var CheckboxGroup = (props) => {
|
|
|
10919
11013
|
...rest
|
|
10920
11014
|
} = props;
|
|
10921
11015
|
const { "aria-required": ariaRequired } = htmlProps;
|
|
10922
|
-
const generatedId = (0,
|
|
11016
|
+
const generatedId = (0, import_react127.useId)();
|
|
10923
11017
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-checkboxGroup`;
|
|
10924
11018
|
const hasErrorMessage = !!errorMessage;
|
|
10925
11019
|
const showRequiredMarker = required || ariaRequired;
|
|
@@ -10977,13 +11071,13 @@ var CheckboxGroup = (props) => {
|
|
|
10977
11071
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
10978
11072
|
|
|
10979
11073
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
10980
|
-
var
|
|
11074
|
+
var import_react129 = require("react");
|
|
10981
11075
|
|
|
10982
11076
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
10983
|
-
var
|
|
10984
|
-
var RadioButtonGroupContext = (0,
|
|
11077
|
+
var import_react128 = require("react");
|
|
11078
|
+
var RadioButtonGroupContext = (0, import_react128.createContext)(null);
|
|
10985
11079
|
var useRadioButtonGroup = () => {
|
|
10986
|
-
return (0,
|
|
11080
|
+
return (0, import_react128.useContext)(RadioButtonGroupContext);
|
|
10987
11081
|
};
|
|
10988
11082
|
|
|
10989
11083
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
@@ -11002,7 +11096,7 @@ var getIsChecked = ({
|
|
|
11002
11096
|
}
|
|
11003
11097
|
return !!value;
|
|
11004
11098
|
};
|
|
11005
|
-
var RadioButton = (0,
|
|
11099
|
+
var RadioButton = (0, import_react129.forwardRef)(
|
|
11006
11100
|
(props, ref) => {
|
|
11007
11101
|
const {
|
|
11008
11102
|
id,
|
|
@@ -11026,7 +11120,7 @@ var RadioButton = (0, import_react128.forwardRef)(
|
|
|
11026
11120
|
style,
|
|
11027
11121
|
...restHtmlProps
|
|
11028
11122
|
} = htmlProps;
|
|
11029
|
-
const generatedId = (0,
|
|
11123
|
+
const generatedId = (0, import_react129.useId)();
|
|
11030
11124
|
const uniqueId = id != null ? id : `${generatedId}-radioButton`;
|
|
11031
11125
|
const hasLabel = !!label;
|
|
11032
11126
|
const radioButtonGroup = useRadioButtonGroup();
|
|
@@ -11096,7 +11190,7 @@ var RadioButton = (0, import_react128.forwardRef)(
|
|
|
11096
11190
|
RadioButton.displayName = "RadioButton";
|
|
11097
11191
|
|
|
11098
11192
|
// src/components/SelectionControl/RadioButton/RadioButtonGroup.tsx
|
|
11099
|
-
var
|
|
11193
|
+
var import_react130 = require("react");
|
|
11100
11194
|
var import_jsx_runtime284 = require("react/jsx-runtime");
|
|
11101
11195
|
var RadioButtonGroupInner = (props, ref) => {
|
|
11102
11196
|
const {
|
|
@@ -11119,10 +11213,10 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
11119
11213
|
...rest
|
|
11120
11214
|
} = props;
|
|
11121
11215
|
const { "aria-required": ariaRequired = false } = htmlProps;
|
|
11122
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
11216
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react130.useState)(
|
|
11123
11217
|
defaultValue
|
|
11124
11218
|
);
|
|
11125
|
-
const generatedId = (0,
|
|
11219
|
+
const generatedId = (0, import_react130.useId)();
|
|
11126
11220
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-radioButtonGroup`;
|
|
11127
11221
|
const isControlled = value !== void 0;
|
|
11128
11222
|
const groupValue = isControlled ? value : uncontrolledValue;
|
|
@@ -11193,11 +11287,11 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
11193
11287
|
}
|
|
11194
11288
|
);
|
|
11195
11289
|
};
|
|
11196
|
-
var RadioButtonGroup = (0,
|
|
11290
|
+
var RadioButtonGroup = (0, import_react130.forwardRef)(RadioButtonGroupInner);
|
|
11197
11291
|
RadioButtonGroup.displayName = "RadioButtonGroup";
|
|
11198
11292
|
|
|
11199
11293
|
// src/components/Skeleton/Skeleton.tsx
|
|
11200
|
-
var
|
|
11294
|
+
var import_react131 = require("react");
|
|
11201
11295
|
|
|
11202
11296
|
// src/components/Skeleton/Skeleton.module.css
|
|
11203
11297
|
var Skeleton_default = {
|
|
@@ -11207,7 +11301,7 @@ var Skeleton_default = {
|
|
|
11207
11301
|
|
|
11208
11302
|
// src/components/Skeleton/Skeleton.tsx
|
|
11209
11303
|
var import_jsx_runtime285 = require("react/jsx-runtime");
|
|
11210
|
-
var Skeleton = (0,
|
|
11304
|
+
var Skeleton = (0, import_react131.forwardRef)(
|
|
11211
11305
|
(props, ref) => {
|
|
11212
11306
|
const {
|
|
11213
11307
|
width,
|
|
@@ -11231,7 +11325,7 @@ var Skeleton = (0, import_react130.forwardRef)(
|
|
|
11231
11325
|
Skeleton.displayName = "Skeleton";
|
|
11232
11326
|
|
|
11233
11327
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
11234
|
-
var
|
|
11328
|
+
var import_react132 = require("react");
|
|
11235
11329
|
|
|
11236
11330
|
// src/components/SkipToContent/SkipToContent.module.css
|
|
11237
11331
|
var SkipToContent_default = {
|
|
@@ -11240,7 +11334,7 @@ var SkipToContent_default = {
|
|
|
11240
11334
|
|
|
11241
11335
|
// src/components/SkipToContent/SkipToContent.tsx
|
|
11242
11336
|
var import_jsx_runtime286 = require("react/jsx-runtime");
|
|
11243
|
-
var SkipToContent = (0,
|
|
11337
|
+
var SkipToContent = (0, import_react132.forwardRef)(
|
|
11244
11338
|
(props, ref) => {
|
|
11245
11339
|
const {
|
|
11246
11340
|
text = "Til hovedinnhold",
|
|
@@ -11268,7 +11362,7 @@ var SkipToContent = (0, import_react131.forwardRef)(
|
|
|
11268
11362
|
SkipToContent.displayName = "SkipToContent";
|
|
11269
11363
|
|
|
11270
11364
|
// src/components/SplitButton/SplitButton.tsx
|
|
11271
|
-
var
|
|
11365
|
+
var import_react133 = require("react");
|
|
11272
11366
|
|
|
11273
11367
|
// src/components/SplitButton/SplitButton.module.css
|
|
11274
11368
|
var SplitButton_default = {
|
|
@@ -11280,7 +11374,7 @@ var SplitButton_default = {
|
|
|
11280
11374
|
|
|
11281
11375
|
// src/components/SplitButton/SplitButton.tsx
|
|
11282
11376
|
var import_jsx_runtime287 = require("react/jsx-runtime");
|
|
11283
|
-
var SplitButton = (0,
|
|
11377
|
+
var SplitButton = (0, import_react133.forwardRef)(
|
|
11284
11378
|
(props, ref) => {
|
|
11285
11379
|
const {
|
|
11286
11380
|
size: size2,
|
|
@@ -11290,7 +11384,7 @@ var SplitButton = (0, import_react132.forwardRef)(
|
|
|
11290
11384
|
className,
|
|
11291
11385
|
...rest
|
|
11292
11386
|
} = props;
|
|
11293
|
-
const [isOpen, setIsOpen] = (0,
|
|
11387
|
+
const [isOpen, setIsOpen] = (0, import_react133.useState)(false);
|
|
11294
11388
|
const buttonStyleProps = {
|
|
11295
11389
|
purpose,
|
|
11296
11390
|
size: size2
|
|
@@ -11305,7 +11399,7 @@ var SplitButton = (0, import_react132.forwardRef)(
|
|
|
11305
11399
|
className: SplitButton_default.main
|
|
11306
11400
|
}
|
|
11307
11401
|
),
|
|
11308
|
-
/* @__PURE__ */ (0, import_jsx_runtime287.jsxs)(OverflowMenuGroup, {
|
|
11402
|
+
/* @__PURE__ */ (0, import_jsx_runtime287.jsxs)(OverflowMenuGroup, { isOpen, setIsOpen, children: [
|
|
11309
11403
|
/* @__PURE__ */ (0, import_jsx_runtime287.jsx)(
|
|
11310
11404
|
Button,
|
|
11311
11405
|
{
|
|
@@ -11327,20 +11421,20 @@ var SplitButton = (0, import_react132.forwardRef)(
|
|
|
11327
11421
|
SplitButton.displayName = "SplitButton";
|
|
11328
11422
|
|
|
11329
11423
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
11330
|
-
var
|
|
11424
|
+
var import_react143 = require("react");
|
|
11331
11425
|
|
|
11332
11426
|
// src/components/Table/collapsible/Table.context.tsx
|
|
11333
|
-
var
|
|
11334
|
-
var CollapsibleTableContext = (0,
|
|
11427
|
+
var import_react134 = require("react");
|
|
11428
|
+
var CollapsibleTableContext = (0, import_react134.createContext)({
|
|
11335
11429
|
headerValues: [],
|
|
11336
11430
|
definingColumnIndex: [0]
|
|
11337
11431
|
});
|
|
11338
|
-
var useCollapsibleTableContext = () => (0,
|
|
11432
|
+
var useCollapsibleTableContext = () => (0, import_react134.useContext)(CollapsibleTableContext);
|
|
11339
11433
|
|
|
11340
11434
|
// src/components/Table/normal/Body.tsx
|
|
11341
|
-
var
|
|
11435
|
+
var import_react135 = require("react");
|
|
11342
11436
|
var import_jsx_runtime288 = require("react/jsx-runtime");
|
|
11343
|
-
var Body = (0,
|
|
11437
|
+
var Body = (0, import_react135.forwardRef)(
|
|
11344
11438
|
(props, ref) => {
|
|
11345
11439
|
return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)("tbody", { ref, ...props });
|
|
11346
11440
|
}
|
|
@@ -11348,20 +11442,20 @@ var Body = (0, import_react134.forwardRef)(
|
|
|
11348
11442
|
Body.displayName = "Table.Body";
|
|
11349
11443
|
|
|
11350
11444
|
// src/components/Table/normal/Cell.tsx
|
|
11351
|
-
var
|
|
11445
|
+
var import_react137 = require("react");
|
|
11352
11446
|
|
|
11353
11447
|
// src/components/Table/normal/Head.tsx
|
|
11354
|
-
var
|
|
11448
|
+
var import_react136 = require("react");
|
|
11355
11449
|
var import_jsx_runtime289 = require("react/jsx-runtime");
|
|
11356
|
-
var Head = (0,
|
|
11450
|
+
var Head = (0, import_react136.forwardRef)(
|
|
11357
11451
|
({ children, ...rest }, ref) => {
|
|
11358
11452
|
return /* @__PURE__ */ (0, import_jsx_runtime289.jsx)("thead", { ref, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(HeadContext.Provider, { value: true, children }) });
|
|
11359
11453
|
}
|
|
11360
11454
|
);
|
|
11361
11455
|
Head.displayName = "Table.Head";
|
|
11362
|
-
var HeadContext = (0,
|
|
11456
|
+
var HeadContext = (0, import_react136.createContext)(false);
|
|
11363
11457
|
function useIsInTableHead() {
|
|
11364
|
-
const isInTableHead = (0,
|
|
11458
|
+
const isInTableHead = (0, import_react136.useContext)(HeadContext);
|
|
11365
11459
|
return isInTableHead;
|
|
11366
11460
|
}
|
|
11367
11461
|
|
|
@@ -11392,7 +11486,7 @@ var Table_default = {
|
|
|
11392
11486
|
|
|
11393
11487
|
// src/components/Table/normal/Cell.tsx
|
|
11394
11488
|
var import_jsx_runtime290 = require("react/jsx-runtime");
|
|
11395
|
-
var Cell = (0,
|
|
11489
|
+
var Cell = (0, import_react137.forwardRef)(
|
|
11396
11490
|
({
|
|
11397
11491
|
children,
|
|
11398
11492
|
type: _type,
|
|
@@ -11431,9 +11525,9 @@ var Cell = (0, import_react136.forwardRef)(
|
|
|
11431
11525
|
Cell.displayName = "Table.Cell";
|
|
11432
11526
|
|
|
11433
11527
|
// src/components/Table/normal/Foot.tsx
|
|
11434
|
-
var
|
|
11528
|
+
var import_react138 = require("react");
|
|
11435
11529
|
var import_jsx_runtime291 = require("react/jsx-runtime");
|
|
11436
|
-
var Foot = (0,
|
|
11530
|
+
var Foot = (0, import_react138.forwardRef)(
|
|
11437
11531
|
(props, ref) => {
|
|
11438
11532
|
return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)("tfoot", { ref, ...props });
|
|
11439
11533
|
}
|
|
@@ -11441,9 +11535,9 @@ var Foot = (0, import_react137.forwardRef)(
|
|
|
11441
11535
|
Foot.displayName = "Table.Foot";
|
|
11442
11536
|
|
|
11443
11537
|
// src/components/Table/normal/Row.tsx
|
|
11444
|
-
var
|
|
11538
|
+
var import_react139 = require("react");
|
|
11445
11539
|
var import_jsx_runtime292 = require("react/jsx-runtime");
|
|
11446
|
-
var Row = (0,
|
|
11540
|
+
var Row = (0, import_react139.forwardRef)(
|
|
11447
11541
|
({ type: _type, mode = "normal", hoverable, selected, className, ...rest }, ref) => {
|
|
11448
11542
|
const isInHeader = useIsInTableHead();
|
|
11449
11543
|
const type = _type != null ? _type : isInHeader ? "head" : "body";
|
|
@@ -11469,7 +11563,7 @@ var Row = (0, import_react138.forwardRef)(
|
|
|
11469
11563
|
Row.displayName = "Table.Row";
|
|
11470
11564
|
|
|
11471
11565
|
// src/components/Table/normal/SortCell.tsx
|
|
11472
|
-
var
|
|
11566
|
+
var import_react140 = require("react");
|
|
11473
11567
|
var import_jsx_runtime293 = require("react/jsx-runtime");
|
|
11474
11568
|
var makeSortIcon = (isSorted, sortOrder) => {
|
|
11475
11569
|
if (!isSorted || !sortOrder) {
|
|
@@ -11477,7 +11571,7 @@ var makeSortIcon = (isSorted, sortOrder) => {
|
|
|
11477
11571
|
}
|
|
11478
11572
|
return sortOrder === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(Icon, { icon: ChevronDownIcon, iconSize: "inherit" }) : /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(Icon, { icon: ChevronUpIcon, iconSize: "inherit" });
|
|
11479
11573
|
};
|
|
11480
|
-
var SortCell = (0,
|
|
11574
|
+
var SortCell = (0, import_react140.forwardRef)(
|
|
11481
11575
|
({ isSorted, sortOrder, onClick, children, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
|
|
11482
11576
|
Cell,
|
|
11483
11577
|
{
|
|
@@ -11509,9 +11603,9 @@ var SortCell = (0, import_react139.forwardRef)(
|
|
|
11509
11603
|
SortCell.displayName = "Table.SortCell";
|
|
11510
11604
|
|
|
11511
11605
|
// src/components/Table/normal/Table.tsx
|
|
11512
|
-
var
|
|
11606
|
+
var import_react141 = require("react");
|
|
11513
11607
|
var import_jsx_runtime294 = require("react/jsx-runtime");
|
|
11514
|
-
var Table = (0,
|
|
11608
|
+
var Table = (0, import_react141.forwardRef)(
|
|
11515
11609
|
({
|
|
11516
11610
|
size: size2 = "medium",
|
|
11517
11611
|
stickyHeader,
|
|
@@ -11541,26 +11635,26 @@ var Table = (0, import_react140.forwardRef)(
|
|
|
11541
11635
|
Table.displayName = "Table";
|
|
11542
11636
|
|
|
11543
11637
|
// src/components/Table/normal/TableWrapper.tsx
|
|
11544
|
-
var
|
|
11638
|
+
var import_react142 = require("react");
|
|
11545
11639
|
var import_jsx_runtime295 = require("react/jsx-runtime");
|
|
11546
11640
|
var TableWrapper = ({ className, ...rest }) => {
|
|
11547
|
-
const themeContext = (0,
|
|
11641
|
+
const themeContext = (0, import_react142.useContext)(ThemeContext);
|
|
11548
11642
|
const container = themeContext == null ? void 0 : themeContext.el;
|
|
11549
11643
|
const containerWidth = container ? container.clientWidth : 0;
|
|
11550
|
-
const [overflowX, setOverflowX] = (0,
|
|
11551
|
-
const [themeContainerWidth, setThemeContainerWidth] = (0,
|
|
11644
|
+
const [overflowX, setOverflowX] = (0, import_react142.useState)(false);
|
|
11645
|
+
const [themeContainerWidth, setThemeContainerWidth] = (0, import_react142.useState)(containerWidth);
|
|
11552
11646
|
function isOverflowingX(event) {
|
|
11553
11647
|
return event.offsetWidth < event.scrollWidth;
|
|
11554
11648
|
}
|
|
11555
|
-
const wrapperRef = (0,
|
|
11556
|
-
(0,
|
|
11649
|
+
const wrapperRef = (0, import_react142.useRef)(null);
|
|
11650
|
+
(0, import_react142.useEffect)(() => {
|
|
11557
11651
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
11558
11652
|
setOverflowX(true);
|
|
11559
11653
|
return;
|
|
11560
11654
|
}
|
|
11561
11655
|
setOverflowX(false);
|
|
11562
11656
|
}, [themeContainerWidth]);
|
|
11563
|
-
(0,
|
|
11657
|
+
(0, import_react142.useEffect)(() => {
|
|
11564
11658
|
function handleResize() {
|
|
11565
11659
|
setThemeContainerWidth(containerWidth);
|
|
11566
11660
|
}
|
|
@@ -11595,7 +11689,7 @@ Table2.Foot = Foot;
|
|
|
11595
11689
|
|
|
11596
11690
|
// src/components/Table/collapsible/CollapsibleRow.tsx
|
|
11597
11691
|
var import_jsx_runtime296 = require("react/jsx-runtime");
|
|
11598
|
-
var CollapsibleRow = (0,
|
|
11692
|
+
var CollapsibleRow = (0, import_react143.forwardRef)(
|
|
11599
11693
|
({
|
|
11600
11694
|
type: _type,
|
|
11601
11695
|
className,
|
|
@@ -11608,8 +11702,8 @@ var CollapsibleRow = (0, import_react142.forwardRef)(
|
|
|
11608
11702
|
const isInHead = useIsInTableHead();
|
|
11609
11703
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
11610
11704
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
11611
|
-
const [childrenCollapsed, setChildrenCollapsed] = (0,
|
|
11612
|
-
(0,
|
|
11705
|
+
const [childrenCollapsed, setChildrenCollapsed] = (0, import_react143.useState)(true);
|
|
11706
|
+
(0, import_react143.useEffect)(() => {
|
|
11613
11707
|
!isCollapsed && setChildrenCollapsed(true);
|
|
11614
11708
|
}, [isCollapsed]);
|
|
11615
11709
|
const rowProps = (isOpenCollapsibleHeader) => {
|
|
@@ -11627,7 +11721,7 @@ var CollapsibleRow = (0, import_react142.forwardRef)(
|
|
|
11627
11721
|
const collapsedHeaderValues = headerValues.filter(
|
|
11628
11722
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
11629
11723
|
);
|
|
11630
|
-
const childrenArray =
|
|
11724
|
+
const childrenArray = import_react143.Children.toArray(children);
|
|
11631
11725
|
const collapsedChildren = childrenArray.filter(
|
|
11632
11726
|
(column, index) => definingColumnIndex.indexOf(index) === -1
|
|
11633
11727
|
);
|
|
@@ -11636,9 +11730,9 @@ var CollapsibleRow = (0, import_react142.forwardRef)(
|
|
|
11636
11730
|
const collapsedRenderedChildren = isCollapsed && collapsedHeaderValues.length > 0 ? collapsedChildren.map(function(child, index) {
|
|
11637
11731
|
const id = derivativeIdGenerator(prefix2, index.toString());
|
|
11638
11732
|
collapsibleIds.push(id);
|
|
11639
|
-
return /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(
|
|
11733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(import_react143.Fragment, { children: [
|
|
11640
11734
|
/* @__PURE__ */ (0, import_jsx_runtime296.jsx)(DescriptionListTerm, { children: collapsedHeaderValues[index].content }),
|
|
11641
|
-
(0,
|
|
11735
|
+
(0, import_react143.isValidElement)(child) && (0, import_react143.cloneElement)(child, {
|
|
11642
11736
|
collapsibleProps: { isCollapsibleChild: true }
|
|
11643
11737
|
})
|
|
11644
11738
|
] }, `DL-${index}`);
|
|
@@ -11698,9 +11792,9 @@ var CollapsibleRow = (0, import_react142.forwardRef)(
|
|
|
11698
11792
|
CollapsibleRow.displayName = "CollapsibleTable.Row";
|
|
11699
11793
|
|
|
11700
11794
|
// src/components/Table/collapsible/CollapsibleTable.tsx
|
|
11701
|
-
var
|
|
11795
|
+
var import_react144 = require("react");
|
|
11702
11796
|
var import_jsx_runtime297 = require("react/jsx-runtime");
|
|
11703
|
-
var CollapsibleTable = (0,
|
|
11797
|
+
var CollapsibleTable = (0, import_react144.forwardRef)((props, ref) => {
|
|
11704
11798
|
const {
|
|
11705
11799
|
isCollapsed,
|
|
11706
11800
|
headerValues,
|
|
@@ -11725,22 +11819,24 @@ CollapsibleTable.displayName = "CollapsibleTable";
|
|
|
11725
11819
|
var CollapsibleTable2 = CollapsibleTable;
|
|
11726
11820
|
CollapsibleTable2.Row = CollapsibleRow;
|
|
11727
11821
|
|
|
11728
|
-
// src/components/Tabs/
|
|
11729
|
-
var
|
|
11822
|
+
// src/components/Tabs/AddTabButton.tsx
|
|
11823
|
+
var import_react147 = require("react");
|
|
11730
11824
|
|
|
11731
11825
|
// src/components/Tabs/Tabs.context.tsx
|
|
11732
|
-
var
|
|
11733
|
-
var TabsContext = (0,
|
|
11826
|
+
var import_react145 = require("react");
|
|
11827
|
+
var TabsContext = (0, import_react145.createContext)({
|
|
11734
11828
|
activeTab: 0,
|
|
11735
11829
|
tabsId: "",
|
|
11830
|
+
size: "small",
|
|
11736
11831
|
handleTabChange: () => null,
|
|
11737
11832
|
tabListRef: null,
|
|
11738
11833
|
tabPanelsRef: null,
|
|
11739
11834
|
hasTabFocus: false,
|
|
11740
11835
|
setHasTabFocus: () => null,
|
|
11741
|
-
tabContentDirection: "row"
|
|
11836
|
+
tabContentDirection: "row",
|
|
11837
|
+
addTabButtonProps: void 0
|
|
11742
11838
|
});
|
|
11743
|
-
var useTabsContext = () => (0,
|
|
11839
|
+
var useTabsContext = () => (0, import_react145.useContext)(TabsContext);
|
|
11744
11840
|
|
|
11745
11841
|
// src/components/Tabs/Tabs.module.css
|
|
11746
11842
|
var Tabs_default = {
|
|
@@ -11749,37 +11845,114 @@ var Tabs_default = {
|
|
|
11749
11845
|
"tab-row--standard-widths": "Tabs_tab-row--standard-widths",
|
|
11750
11846
|
"tab-row--custom-widths": "Tabs_tab-row--custom-widths",
|
|
11751
11847
|
tab: "Tabs_tab",
|
|
11848
|
+
"tab--medium--row": "Tabs_tab--medium--row",
|
|
11849
|
+
"tab--small--row": "Tabs_tab--small--row",
|
|
11850
|
+
"tab--medium--column": "Tabs_tab--medium--column",
|
|
11851
|
+
"tab--small--column": "Tabs_tab--small--column",
|
|
11752
11852
|
"tab--row": "Tabs_tab--row",
|
|
11753
11853
|
"tab--column": "Tabs_tab--column",
|
|
11754
11854
|
"tab--active": "Tabs_tab--active",
|
|
11755
11855
|
"tab-panel": "Tabs_tab-panel"
|
|
11756
11856
|
};
|
|
11757
11857
|
|
|
11758
|
-
// src/components/Tabs/
|
|
11858
|
+
// src/components/Tabs/TabWidthContext.tsx
|
|
11859
|
+
var import_react146 = require("react");
|
|
11759
11860
|
var import_jsx_runtime298 = require("react/jsx-runtime");
|
|
11760
|
-
var
|
|
11861
|
+
var TabContext = (0, import_react146.createContext)(null);
|
|
11862
|
+
function TabWidthContextProvider({
|
|
11863
|
+
children,
|
|
11864
|
+
onChangeWidths
|
|
11865
|
+
}) {
|
|
11866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(
|
|
11867
|
+
TabContext.Provider,
|
|
11868
|
+
{
|
|
11869
|
+
value: {
|
|
11870
|
+
updateWidth: (index, newWidth) => {
|
|
11871
|
+
onChangeWidths((prev) => {
|
|
11872
|
+
const newValue = [...prev];
|
|
11873
|
+
newValue[index] = newWidth;
|
|
11874
|
+
return newValue;
|
|
11875
|
+
});
|
|
11876
|
+
},
|
|
11877
|
+
removeTab: (index) => {
|
|
11878
|
+
onChangeWidths((prev) => {
|
|
11879
|
+
const newValue = [...prev];
|
|
11880
|
+
newValue.splice(index, 1);
|
|
11881
|
+
return newValue;
|
|
11882
|
+
});
|
|
11883
|
+
}
|
|
11884
|
+
},
|
|
11885
|
+
children
|
|
11886
|
+
}
|
|
11887
|
+
);
|
|
11888
|
+
}
|
|
11889
|
+
function useSetTabWidth(index, width) {
|
|
11890
|
+
const context = (0, import_react146.useContext)(TabContext);
|
|
11891
|
+
(0, import_react146.useLayoutEffect)(() => {
|
|
11892
|
+
context == null ? void 0 : context.updateWidth(index, width);
|
|
11893
|
+
return () => context == null ? void 0 : context.removeTab(index);
|
|
11894
|
+
}, [index, width]);
|
|
11895
|
+
}
|
|
11896
|
+
|
|
11897
|
+
// src/components/Tabs/AddTabButton.tsx
|
|
11898
|
+
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
11899
|
+
var AddTabButton = (0, import_react147.forwardRef)(
|
|
11900
|
+
(props, ref) => {
|
|
11901
|
+
const { children, index, className, width = "1fr", ...rest } = props;
|
|
11902
|
+
useSetTabWidth(index, width);
|
|
11903
|
+
const buttonRef = (0, import_react147.useRef)(null);
|
|
11904
|
+
const combinedRef = useCombinedRef(ref, buttonRef);
|
|
11905
|
+
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
11906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)(
|
|
11907
|
+
"button",
|
|
11908
|
+
{
|
|
11909
|
+
...rest,
|
|
11910
|
+
ref: combinedRef,
|
|
11911
|
+
className: cn(
|
|
11912
|
+
className,
|
|
11913
|
+
Tabs_default.tab,
|
|
11914
|
+
Tabs_default[`tab--${tabContentDirection}`],
|
|
11915
|
+
typographyStyles_default[`body-${size2}`],
|
|
11916
|
+
focus_default["focusable--inset"]
|
|
11917
|
+
),
|
|
11918
|
+
children: [
|
|
11919
|
+
/* @__PURE__ */ (0, import_jsx_runtime299.jsx)(Icon, { icon: PlusIcon, iconSize: "inherit" }),
|
|
11920
|
+
/* @__PURE__ */ (0, import_jsx_runtime299.jsx)("span", { children })
|
|
11921
|
+
]
|
|
11922
|
+
}
|
|
11923
|
+
);
|
|
11924
|
+
}
|
|
11925
|
+
);
|
|
11926
|
+
AddTabButton.displayName = "AddTabButton";
|
|
11927
|
+
|
|
11928
|
+
// src/components/Tabs/Tabs.tsx
|
|
11929
|
+
var import_react148 = require("react");
|
|
11930
|
+
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
11931
|
+
var Tabs = (0, import_react148.forwardRef)((props, ref) => {
|
|
11761
11932
|
const {
|
|
11762
11933
|
id,
|
|
11763
11934
|
activeTab,
|
|
11764
11935
|
onChange,
|
|
11765
11936
|
tabContentDirection = "row",
|
|
11937
|
+
size: size2 = "small",
|
|
11938
|
+
addTabButtonProps,
|
|
11766
11939
|
width,
|
|
11767
11940
|
children,
|
|
11768
11941
|
className,
|
|
11769
11942
|
htmlProps,
|
|
11770
11943
|
...rest
|
|
11771
11944
|
} = props;
|
|
11772
|
-
const generatedId = (0,
|
|
11945
|
+
const generatedId = (0, import_react148.useId)();
|
|
11773
11946
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
11774
|
-
const [thisActiveTab, setActiveTab] = (0,
|
|
11775
|
-
const [hasTabFocus, setHasTabFocus] = (0,
|
|
11776
|
-
const tabListRef = (0,
|
|
11777
|
-
const tabPanelsRef = (0,
|
|
11947
|
+
const [thisActiveTab, setActiveTab] = (0, import_react148.useState)(activeTab != null ? activeTab : 0);
|
|
11948
|
+
const [hasTabFocus, setHasTabFocus] = (0, import_react148.useState)(false);
|
|
11949
|
+
const tabListRef = (0, import_react148.useRef)(null);
|
|
11950
|
+
const tabPanelsRef = (0, import_react148.useRef)(null);
|
|
11778
11951
|
const handleTabChange = (index) => {
|
|
11779
11952
|
setActiveTab(index);
|
|
11780
11953
|
onChange && onChange(index);
|
|
11781
11954
|
};
|
|
11782
|
-
(0,
|
|
11955
|
+
(0, import_react148.useEffect)(() => {
|
|
11783
11956
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
11784
11957
|
setActiveTab(activeTab);
|
|
11785
11958
|
}
|
|
@@ -11788,20 +11961,22 @@ var Tabs = (0, import_react145.forwardRef)((props, ref) => {
|
|
|
11788
11961
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11789
11962
|
["--dds-tabs-width"]: width
|
|
11790
11963
|
};
|
|
11791
|
-
return /* @__PURE__ */ (0,
|
|
11964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(
|
|
11792
11965
|
TabsContext.Provider,
|
|
11793
11966
|
{
|
|
11794
11967
|
value: {
|
|
11795
11968
|
tabsId: uniqueId,
|
|
11796
11969
|
activeTab: thisActiveTab,
|
|
11970
|
+
size: size2,
|
|
11797
11971
|
handleTabChange,
|
|
11798
11972
|
tabListRef,
|
|
11799
11973
|
tabPanelsRef,
|
|
11800
11974
|
hasTabFocus,
|
|
11801
11975
|
setHasTabFocus,
|
|
11802
|
-
tabContentDirection
|
|
11976
|
+
tabContentDirection,
|
|
11977
|
+
addTabButtonProps
|
|
11803
11978
|
},
|
|
11804
|
-
children: /* @__PURE__ */ (0,
|
|
11979
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(
|
|
11805
11980
|
"div",
|
|
11806
11981
|
{
|
|
11807
11982
|
ref,
|
|
@@ -11821,50 +11996,9 @@ var Tabs = (0, import_react145.forwardRef)((props, ref) => {
|
|
|
11821
11996
|
Tabs.displayName = "Tabs";
|
|
11822
11997
|
|
|
11823
11998
|
// src/components/Tabs/Tab.tsx
|
|
11824
|
-
var
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
var import_react146 = require("react");
|
|
11828
|
-
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
11829
|
-
var TabContext = (0, import_react146.createContext)(null);
|
|
11830
|
-
function TabWidthContextProvider({
|
|
11831
|
-
children,
|
|
11832
|
-
onChangeWidths
|
|
11833
|
-
}) {
|
|
11834
|
-
return /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(
|
|
11835
|
-
TabContext.Provider,
|
|
11836
|
-
{
|
|
11837
|
-
value: {
|
|
11838
|
-
updateWidth: (index, newWidth) => {
|
|
11839
|
-
onChangeWidths((prev) => {
|
|
11840
|
-
const newValue = [...prev];
|
|
11841
|
-
newValue[index] = newWidth;
|
|
11842
|
-
return newValue;
|
|
11843
|
-
});
|
|
11844
|
-
},
|
|
11845
|
-
removeTab: (index) => {
|
|
11846
|
-
onChangeWidths((prev) => {
|
|
11847
|
-
const newValue = [...prev];
|
|
11848
|
-
newValue.splice(index, 1);
|
|
11849
|
-
return newValue;
|
|
11850
|
-
});
|
|
11851
|
-
}
|
|
11852
|
-
},
|
|
11853
|
-
children
|
|
11854
|
-
}
|
|
11855
|
-
);
|
|
11856
|
-
}
|
|
11857
|
-
function useSetTabWidth(index, width) {
|
|
11858
|
-
const context = (0, import_react146.useContext)(TabContext);
|
|
11859
|
-
(0, import_react146.useLayoutEffect)(() => {
|
|
11860
|
-
context == null ? void 0 : context.updateWidth(index, width);
|
|
11861
|
-
return () => context == null ? void 0 : context.removeTab(index);
|
|
11862
|
-
}, [index, width]);
|
|
11863
|
-
}
|
|
11864
|
-
|
|
11865
|
-
// src/components/Tabs/Tab.tsx
|
|
11866
|
-
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
11867
|
-
var Tab = (0, import_react147.forwardRef)((props, ref) => {
|
|
11999
|
+
var import_react149 = require("react");
|
|
12000
|
+
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
12001
|
+
var Tab = (0, import_react149.forwardRef)((props, ref) => {
|
|
11868
12002
|
const {
|
|
11869
12003
|
active = false,
|
|
11870
12004
|
icon,
|
|
@@ -11881,16 +12015,16 @@ var Tab = (0, import_react147.forwardRef)((props, ref) => {
|
|
|
11881
12015
|
...rest
|
|
11882
12016
|
} = props;
|
|
11883
12017
|
useSetTabWidth(index, width);
|
|
11884
|
-
const itemRef = (0,
|
|
12018
|
+
const itemRef = (0, import_react149.useRef)(null);
|
|
11885
12019
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
11886
|
-
const { tabContentDirection } = useTabsContext();
|
|
11887
|
-
(0,
|
|
12020
|
+
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
12021
|
+
(0, import_react149.useEffect)(() => {
|
|
11888
12022
|
var _a;
|
|
11889
12023
|
if (focus) {
|
|
11890
12024
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
11891
12025
|
}
|
|
11892
12026
|
}, [focus]);
|
|
11893
|
-
const handleSelect = (0,
|
|
12027
|
+
const handleSelect = (0, import_react149.useCallback)(() => {
|
|
11894
12028
|
if (setFocus && index) {
|
|
11895
12029
|
setFocus(index);
|
|
11896
12030
|
}
|
|
@@ -11903,7 +12037,7 @@ var Tab = (0, import_react147.forwardRef)((props, ref) => {
|
|
|
11903
12037
|
handleSelect();
|
|
11904
12038
|
onKeyDown && onKeyDown(e);
|
|
11905
12039
|
};
|
|
11906
|
-
return /* @__PURE__ */ (0,
|
|
12040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(
|
|
11907
12041
|
"button",
|
|
11908
12042
|
{
|
|
11909
12043
|
...getBaseHTMLProps(
|
|
@@ -11911,9 +12045,10 @@ var Tab = (0, import_react147.forwardRef)((props, ref) => {
|
|
|
11911
12045
|
cn(
|
|
11912
12046
|
className,
|
|
11913
12047
|
Tabs_default.tab,
|
|
12048
|
+
Tabs_default[`tab--${size2}--${tabContentDirection}`],
|
|
11914
12049
|
active && Tabs_default["tab--active"],
|
|
11915
12050
|
Tabs_default[`tab--${tabContentDirection}`],
|
|
11916
|
-
typographyStyles_default[
|
|
12051
|
+
typographyStyles_default[`body-${size2}`],
|
|
11917
12052
|
focus_default["focusable--inset"]
|
|
11918
12053
|
),
|
|
11919
12054
|
htmlProps,
|
|
@@ -11926,8 +12061,8 @@ var Tab = (0, import_react147.forwardRef)((props, ref) => {
|
|
|
11926
12061
|
onKeyDown: handleOnKeyDown,
|
|
11927
12062
|
tabIndex: focus ? 0 : -1,
|
|
11928
12063
|
children: [
|
|
11929
|
-
icon && /* @__PURE__ */ (0,
|
|
11930
|
-
/* @__PURE__ */ (0,
|
|
12064
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(Icon, { icon, iconSize: "inherit" }),
|
|
12065
|
+
/* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { children })
|
|
11931
12066
|
]
|
|
11932
12067
|
}
|
|
11933
12068
|
);
|
|
@@ -11935,9 +12070,9 @@ var Tab = (0, import_react147.forwardRef)((props, ref) => {
|
|
|
11935
12070
|
Tab.displayName = "Tab";
|
|
11936
12071
|
|
|
11937
12072
|
// src/components/Tabs/TabList.tsx
|
|
11938
|
-
var
|
|
11939
|
-
var
|
|
11940
|
-
var TabList = (0,
|
|
12073
|
+
var import_react150 = require("react");
|
|
12074
|
+
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
12075
|
+
var TabList = (0, import_react150.forwardRef)(
|
|
11941
12076
|
({ children, id, style, onFocus, ...rest }, ref) => {
|
|
11942
12077
|
const {
|
|
11943
12078
|
activeTab,
|
|
@@ -11945,24 +12080,35 @@ var TabList = (0, import_react148.forwardRef)(
|
|
|
11945
12080
|
handleTabChange,
|
|
11946
12081
|
tabListRef,
|
|
11947
12082
|
hasTabFocus,
|
|
11948
|
-
setHasTabFocus
|
|
12083
|
+
setHasTabFocus,
|
|
12084
|
+
addTabButtonProps
|
|
11949
12085
|
} = useTabsContext();
|
|
11950
12086
|
const uniqueId = id != null ? id : `${tabsId}-tablist`;
|
|
11951
|
-
const childrenArray =
|
|
12087
|
+
const childrenArray = import_react150.Children.toArray(children).length;
|
|
11952
12088
|
const [focus, setFocus] = useRoveFocus(childrenArray, hasTabFocus, "row");
|
|
11953
12089
|
const combinedRef = useCombinedRef(ref, tabListRef);
|
|
11954
|
-
const
|
|
11955
|
-
|
|
12090
|
+
const hasButton = addTabButtonProps ? true : false;
|
|
12091
|
+
const tabListChildren = import_react150.Children ? import_react150.Children.map(children, (child, index) => {
|
|
12092
|
+
return (0, import_react150.isValidElement)(child) && (0, import_react150.cloneElement)(child, {
|
|
11956
12093
|
id: `${tabsId}-tab-${index}`,
|
|
11957
12094
|
"aria-controls": `${tabsId}-panel-${index}`,
|
|
11958
12095
|
active: activeTab === index,
|
|
11959
12096
|
index,
|
|
11960
12097
|
focus: focus === index && hasTabFocus,
|
|
11961
12098
|
setFocus,
|
|
11962
|
-
onClick: () =>
|
|
12099
|
+
onClick: () => {
|
|
12100
|
+
var _a, _b;
|
|
12101
|
+
handleTabChange(index);
|
|
12102
|
+
(_b = (_a = child.props).onClick) == null ? void 0 : _b.call(_a);
|
|
12103
|
+
}
|
|
11963
12104
|
});
|
|
11964
|
-
});
|
|
11965
|
-
|
|
12105
|
+
}) : [];
|
|
12106
|
+
if (hasButton && tabListChildren) {
|
|
12107
|
+
tabListChildren.push(
|
|
12108
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)(AddTabButton, { index: tabListChildren.length, ...addTabButtonProps })
|
|
12109
|
+
);
|
|
12110
|
+
}
|
|
12111
|
+
const [widths, setWidths] = (0, import_react150.useState)([]);
|
|
11966
12112
|
const handleOnFocus = (event) => {
|
|
11967
12113
|
setHasTabFocus(true);
|
|
11968
12114
|
onFocus && onFocus(event);
|
|
@@ -11980,7 +12126,7 @@ var TabList = (0, import_react148.forwardRef)(
|
|
|
11980
12126
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11981
12127
|
["--dds-tab-widths"]: widths.join(" ")
|
|
11982
12128
|
};
|
|
11983
|
-
return /* @__PURE__ */ (0,
|
|
12129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(TabWidthContextProvider, { onChangeWidths: setWidths, children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
11984
12130
|
"div",
|
|
11985
12131
|
{
|
|
11986
12132
|
...rest,
|
|
@@ -12006,11 +12152,11 @@ var TabList = (0, import_react148.forwardRef)(
|
|
|
12006
12152
|
TabList.displayName = "TabList";
|
|
12007
12153
|
|
|
12008
12154
|
// src/components/Tabs/TabPanel.tsx
|
|
12009
|
-
var
|
|
12010
|
-
var
|
|
12011
|
-
var TabPanel = (0,
|
|
12155
|
+
var import_react151 = require("react");
|
|
12156
|
+
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
12157
|
+
var TabPanel = (0, import_react151.forwardRef)(
|
|
12012
12158
|
({ active = false, children, id, className, htmlProps, ...rest }, ref) => {
|
|
12013
|
-
return /* @__PURE__ */ (0,
|
|
12159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
12014
12160
|
"div",
|
|
12015
12161
|
{
|
|
12016
12162
|
...getBaseHTMLProps(
|
|
@@ -12031,28 +12177,28 @@ var TabPanel = (0, import_react149.forwardRef)(
|
|
|
12031
12177
|
TabPanel.displayName = "TabPanel";
|
|
12032
12178
|
|
|
12033
12179
|
// src/components/Tabs/TabPanels.tsx
|
|
12034
|
-
var
|
|
12035
|
-
var
|
|
12036
|
-
var TabPanels = (0,
|
|
12180
|
+
var import_react152 = require("react");
|
|
12181
|
+
var import_jsx_runtime304 = require("react/jsx-runtime");
|
|
12182
|
+
var TabPanels = (0, import_react152.forwardRef)(
|
|
12037
12183
|
({ children, ...rest }, ref) => {
|
|
12038
12184
|
const { activeTab, tabsId, tabPanelsRef } = useTabsContext();
|
|
12039
12185
|
const combinedRef = useCombinedRef(ref, tabPanelsRef);
|
|
12040
|
-
const panelChildren =
|
|
12186
|
+
const panelChildren = import_react152.Children.map(children, (child, index) => {
|
|
12041
12187
|
const active = index === activeTab;
|
|
12042
|
-
return (0,
|
|
12188
|
+
return (0, import_react152.isValidElement)(child) && (0, import_react152.cloneElement)(child, {
|
|
12043
12189
|
id: `${tabsId}-panel-${index}`,
|
|
12044
12190
|
"aria-labelledby": `${tabsId}-tab-${index}`,
|
|
12045
12191
|
active,
|
|
12046
12192
|
"aria-expanded": active
|
|
12047
12193
|
});
|
|
12048
12194
|
});
|
|
12049
|
-
return /* @__PURE__ */ (0,
|
|
12195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { ref: combinedRef, ...rest, children: panelChildren });
|
|
12050
12196
|
}
|
|
12051
12197
|
);
|
|
12052
12198
|
TabPanels.displayName = "TabPanels";
|
|
12053
12199
|
|
|
12054
12200
|
// src/components/Tag/Tag.tsx
|
|
12055
|
-
var
|
|
12201
|
+
var import_react153 = require("react");
|
|
12056
12202
|
|
|
12057
12203
|
// src/components/Tag/Tag.module.css
|
|
12058
12204
|
var Tag_default = {
|
|
@@ -12071,7 +12217,7 @@ var Tag_default = {
|
|
|
12071
12217
|
};
|
|
12072
12218
|
|
|
12073
12219
|
// src/components/Tag/Tag.tsx
|
|
12074
|
-
var
|
|
12220
|
+
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
12075
12221
|
var icons3 = {
|
|
12076
12222
|
info: InfoIcon,
|
|
12077
12223
|
danger: ErrorIcon,
|
|
@@ -12079,7 +12225,7 @@ var icons3 = {
|
|
|
12079
12225
|
success: CheckCircledIcon,
|
|
12080
12226
|
default: void 0
|
|
12081
12227
|
};
|
|
12082
|
-
var Tag = (0,
|
|
12228
|
+
var Tag = (0, import_react153.forwardRef)((props, ref) => {
|
|
12083
12229
|
const {
|
|
12084
12230
|
text,
|
|
12085
12231
|
purpose = "default",
|
|
@@ -12092,7 +12238,7 @@ var Tag = (0, import_react151.forwardRef)((props, ref) => {
|
|
|
12092
12238
|
...rest
|
|
12093
12239
|
} = props;
|
|
12094
12240
|
const icon = icons3[purpose];
|
|
12095
|
-
return /* @__PURE__ */ (0,
|
|
12241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
|
|
12096
12242
|
TextOverflowEllipsisWrapper,
|
|
12097
12243
|
{
|
|
12098
12244
|
...getBaseHTMLProps(
|
|
@@ -12109,8 +12255,8 @@ var Tag = (0, import_react151.forwardRef)((props, ref) => {
|
|
|
12109
12255
|
),
|
|
12110
12256
|
ref,
|
|
12111
12257
|
children: [
|
|
12112
|
-
withIcon && icon && /* @__PURE__ */ (0,
|
|
12113
|
-
/* @__PURE__ */ (0,
|
|
12258
|
+
withIcon && icon && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Icon, { icon, iconSize: "small" }),
|
|
12259
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(TextOverflowEllipsisInner, { children: children != null ? children : text })
|
|
12114
12260
|
]
|
|
12115
12261
|
}
|
|
12116
12262
|
);
|
|
@@ -12118,7 +12264,7 @@ var Tag = (0, import_react151.forwardRef)((props, ref) => {
|
|
|
12118
12264
|
Tag.displayName = "Tag";
|
|
12119
12265
|
|
|
12120
12266
|
// src/components/TextInput/TextInput.tsx
|
|
12121
|
-
var
|
|
12267
|
+
var import_react154 = require("react");
|
|
12122
12268
|
|
|
12123
12269
|
// src/components/TextInput/TextInput.module.css
|
|
12124
12270
|
var TextInput_default = {
|
|
@@ -12144,8 +12290,8 @@ var TextInput_default = {
|
|
|
12144
12290
|
};
|
|
12145
12291
|
|
|
12146
12292
|
// src/components/TextInput/TextInput.tsx
|
|
12147
|
-
var
|
|
12148
|
-
var TextInput = (0,
|
|
12293
|
+
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
12294
|
+
var TextInput = (0, import_react154.forwardRef)(
|
|
12149
12295
|
({
|
|
12150
12296
|
label,
|
|
12151
12297
|
disabled,
|
|
@@ -12171,14 +12317,14 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12171
12317
|
suffix,
|
|
12172
12318
|
...rest
|
|
12173
12319
|
}, ref) => {
|
|
12174
|
-
const [text, setText] = (0,
|
|
12320
|
+
const [text, setText] = (0, import_react154.useState)(
|
|
12175
12321
|
getDefaultText(value, defaultValue)
|
|
12176
12322
|
);
|
|
12177
|
-
const prefixRef = (0,
|
|
12178
|
-
const suffixRef = (0,
|
|
12179
|
-
const [prefixLength, setPrefixLength] = (0,
|
|
12180
|
-
const [suffixLength, setSuffixLength] = (0,
|
|
12181
|
-
(0,
|
|
12323
|
+
const prefixRef = (0, import_react154.useRef)(null);
|
|
12324
|
+
const suffixRef = (0, import_react154.useRef)(null);
|
|
12325
|
+
const [prefixLength, setPrefixLength] = (0, import_react154.useState)(0);
|
|
12326
|
+
const [suffixLength, setSuffixLength] = (0, import_react154.useState)(0);
|
|
12327
|
+
(0, import_react154.useLayoutEffect)(() => {
|
|
12182
12328
|
if (prefixRef.current) {
|
|
12183
12329
|
setPrefixLength(prefixRef.current.offsetWidth);
|
|
12184
12330
|
}
|
|
@@ -12192,7 +12338,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12192
12338
|
onChange(event);
|
|
12193
12339
|
}
|
|
12194
12340
|
};
|
|
12195
|
-
const generatedId = (0,
|
|
12341
|
+
const generatedId = (0, import_react154.useId)();
|
|
12196
12342
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
12197
12343
|
const hasErrorMessage = !!errorMessage;
|
|
12198
12344
|
const hasTip = !!tip;
|
|
@@ -12234,13 +12380,13 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12234
12380
|
const suffixPaddingInlineEnd = suffixLength ? `calc(var(--dds-spacing-x1) + ${suffixLength}px)` : void 0;
|
|
12235
12381
|
let extendedInput = null;
|
|
12236
12382
|
if (hasIcon) {
|
|
12237
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
12383
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
|
|
12238
12384
|
"div",
|
|
12239
12385
|
{
|
|
12240
12386
|
className: cn(TextInput_default["input-width"], Input_default["input-group"]),
|
|
12241
12387
|
style: styleVariables,
|
|
12242
12388
|
children: [
|
|
12243
|
-
/* @__PURE__ */ (0,
|
|
12389
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
12244
12390
|
Icon,
|
|
12245
12391
|
{
|
|
12246
12392
|
icon,
|
|
@@ -12251,7 +12397,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12251
12397
|
)
|
|
12252
12398
|
}
|
|
12253
12399
|
),
|
|
12254
|
-
/* @__PURE__ */ (0,
|
|
12400
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
12255
12401
|
StatefulInput,
|
|
12256
12402
|
{
|
|
12257
12403
|
ref,
|
|
@@ -12270,13 +12416,13 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12270
12416
|
}
|
|
12271
12417
|
);
|
|
12272
12418
|
} else if (hasAffix) {
|
|
12273
|
-
extendedInput = /* @__PURE__ */ (0,
|
|
12419
|
+
extendedInput = /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
|
|
12274
12420
|
"div",
|
|
12275
12421
|
{
|
|
12276
12422
|
className: cn(TextInput_default["affix-container"], TextInput_default["input-width"]),
|
|
12277
12423
|
style: styleVariables,
|
|
12278
12424
|
children: [
|
|
12279
|
-
prefix2 && /* @__PURE__ */ (0,
|
|
12425
|
+
prefix2 && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
12280
12426
|
"span",
|
|
12281
12427
|
{
|
|
12282
12428
|
ref: prefixRef,
|
|
@@ -12289,7 +12435,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12289
12435
|
children: prefix2
|
|
12290
12436
|
}
|
|
12291
12437
|
),
|
|
12292
|
-
/* @__PURE__ */ (0,
|
|
12438
|
+
/* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
12293
12439
|
StatefulInput,
|
|
12294
12440
|
{
|
|
12295
12441
|
ref,
|
|
@@ -12304,7 +12450,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12304
12450
|
className: TextInput_default["input--extended"]
|
|
12305
12451
|
}
|
|
12306
12452
|
),
|
|
12307
|
-
suffix && /* @__PURE__ */ (0,
|
|
12453
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
12308
12454
|
"span",
|
|
12309
12455
|
{
|
|
12310
12456
|
ref: suffixRef,
|
|
@@ -12321,7 +12467,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12321
12467
|
}
|
|
12322
12468
|
);
|
|
12323
12469
|
}
|
|
12324
|
-
return /* @__PURE__ */ (0,
|
|
12470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
|
|
12325
12471
|
"div",
|
|
12326
12472
|
{
|
|
12327
12473
|
className: cn(
|
|
@@ -12333,7 +12479,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12333
12479
|
),
|
|
12334
12480
|
style,
|
|
12335
12481
|
children: [
|
|
12336
|
-
hasLabel && /* @__PURE__ */ (0,
|
|
12482
|
+
hasLabel && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
12337
12483
|
Label,
|
|
12338
12484
|
{
|
|
12339
12485
|
htmlFor: uniqueId,
|
|
@@ -12343,7 +12489,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12343
12489
|
children: label
|
|
12344
12490
|
}
|
|
12345
12491
|
),
|
|
12346
|
-
extendedInput ? extendedInput : /* @__PURE__ */ (0,
|
|
12492
|
+
extendedInput ? extendedInput : /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
12347
12493
|
StatefulInput,
|
|
12348
12494
|
{
|
|
12349
12495
|
ref,
|
|
@@ -12355,7 +12501,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12355
12501
|
className: TextInput_default["input-width"]
|
|
12356
12502
|
}
|
|
12357
12503
|
),
|
|
12358
|
-
hasMessage && /* @__PURE__ */ (0,
|
|
12504
|
+
hasMessage && /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: TextInput_default["message-container"], children: [
|
|
12359
12505
|
renderInputMessage(tip, tipId, errorMessage, errorMessageId),
|
|
12360
12506
|
renderCharCounter(
|
|
12361
12507
|
characterCounterId,
|
|
@@ -12372,7 +12518,7 @@ var TextInput = (0, import_react152.forwardRef)(
|
|
|
12372
12518
|
TextInput.displayName = "TextInput";
|
|
12373
12519
|
|
|
12374
12520
|
// src/components/Toggle/Toggle.tsx
|
|
12375
|
-
var
|
|
12521
|
+
var import_react155 = require("react");
|
|
12376
12522
|
|
|
12377
12523
|
// src/components/Toggle/Toggle.module.css
|
|
12378
12524
|
var Toggle_default = {
|
|
@@ -12390,8 +12536,8 @@ var Toggle_default = {
|
|
|
12390
12536
|
};
|
|
12391
12537
|
|
|
12392
12538
|
// src/components/Toggle/Toggle.tsx
|
|
12393
|
-
var
|
|
12394
|
-
var Toggle = (0,
|
|
12539
|
+
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
12540
|
+
var Toggle = (0, import_react155.forwardRef)(
|
|
12395
12541
|
({
|
|
12396
12542
|
id,
|
|
12397
12543
|
children,
|
|
@@ -12406,7 +12552,7 @@ var Toggle = (0, import_react153.forwardRef)(
|
|
|
12406
12552
|
htmlProps = {},
|
|
12407
12553
|
...rest
|
|
12408
12554
|
}, ref) => {
|
|
12409
|
-
const generatedId = (0,
|
|
12555
|
+
const generatedId = (0, import_react155.useId)();
|
|
12410
12556
|
const uniqueId = id != null ? id : `${generatedId}-toggle`;
|
|
12411
12557
|
const iconSize = size2 === "large" ? "medium" : "small";
|
|
12412
12558
|
const [checked, setChecked] = useControllableState({
|
|
@@ -12414,7 +12560,7 @@ var Toggle = (0, import_react153.forwardRef)(
|
|
|
12414
12560
|
defaultValue: defaultChecked != null ? defaultChecked : false,
|
|
12415
12561
|
onChange
|
|
12416
12562
|
});
|
|
12417
|
-
return /* @__PURE__ */ (0,
|
|
12563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(
|
|
12418
12564
|
"label",
|
|
12419
12565
|
{
|
|
12420
12566
|
htmlFor: uniqueId,
|
|
@@ -12426,7 +12572,7 @@ var Toggle = (0, import_react153.forwardRef)(
|
|
|
12426
12572
|
readOnly && Toggle_default["label--read-only"]
|
|
12427
12573
|
),
|
|
12428
12574
|
children: [
|
|
12429
|
-
/* @__PURE__ */ (0,
|
|
12575
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
12430
12576
|
"input",
|
|
12431
12577
|
{
|
|
12432
12578
|
...getBaseHTMLProps(
|
|
@@ -12457,7 +12603,7 @@ var Toggle = (0, import_react153.forwardRef)(
|
|
|
12457
12603
|
)
|
|
12458
12604
|
}
|
|
12459
12605
|
),
|
|
12460
|
-
/* @__PURE__ */ (0,
|
|
12606
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: cn(Toggle_default.track, focus_default["focus-styled-sibling"]), children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("span", { className: Toggle_default.thumb, children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(Spinner, { size: `var(--dds-icon-size-${size2})` }) : /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
12461
12607
|
Icon,
|
|
12462
12608
|
{
|
|
12463
12609
|
className: Toggle_default.checkmark,
|
|
@@ -12465,8 +12611,8 @@ var Toggle = (0, import_react153.forwardRef)(
|
|
|
12465
12611
|
iconSize
|
|
12466
12612
|
}
|
|
12467
12613
|
) }) }),
|
|
12468
|
-
/* @__PURE__ */ (0,
|
|
12469
|
-
readOnly && /* @__PURE__ */ (0,
|
|
12614
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("span", { className: cn(readOnly && Toggle_default["labeltext--readonly"]), children: [
|
|
12615
|
+
readOnly && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
12470
12616
|
Icon,
|
|
12471
12617
|
{
|
|
12472
12618
|
icon: LockIcon,
|
|
@@ -12476,7 +12622,7 @@ var Toggle = (0, import_react153.forwardRef)(
|
|
|
12476
12622
|
),
|
|
12477
12623
|
children,
|
|
12478
12624
|
" ",
|
|
12479
|
-
isLoading && /* @__PURE__ */ (0,
|
|
12625
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(VisuallyHidden, { as: "span", children: "Innlastning p\xE5g\xE5r" })
|
|
12480
12626
|
] })
|
|
12481
12627
|
]
|
|
12482
12628
|
}
|
|
@@ -12486,14 +12632,14 @@ var Toggle = (0, import_react153.forwardRef)(
|
|
|
12486
12632
|
Toggle.displayName = "Toggle";
|
|
12487
12633
|
|
|
12488
12634
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
12489
|
-
var
|
|
12635
|
+
var import_react157 = require("react");
|
|
12490
12636
|
|
|
12491
12637
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
12492
|
-
var
|
|
12493
|
-
var ToggleBarContext = (0,
|
|
12638
|
+
var import_react156 = require("react");
|
|
12639
|
+
var ToggleBarContext = (0, import_react156.createContext)({
|
|
12494
12640
|
size: "medium"
|
|
12495
12641
|
});
|
|
12496
|
-
var useToggleBarContext = () => (0,
|
|
12642
|
+
var useToggleBarContext = () => (0, import_react156.useContext)(ToggleBarContext);
|
|
12497
12643
|
|
|
12498
12644
|
// src/components/ToggleBar/ToggleBar.module.css
|
|
12499
12645
|
var ToggleBar_default = {
|
|
@@ -12512,7 +12658,7 @@ var ToggleBar_default = {
|
|
|
12512
12658
|
};
|
|
12513
12659
|
|
|
12514
12660
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
12515
|
-
var
|
|
12661
|
+
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
12516
12662
|
var ToggleBar = (props) => {
|
|
12517
12663
|
const {
|
|
12518
12664
|
children,
|
|
@@ -12527,15 +12673,15 @@ var ToggleBar = (props) => {
|
|
|
12527
12673
|
id,
|
|
12528
12674
|
...rest
|
|
12529
12675
|
} = props;
|
|
12530
|
-
const generatedId = (0,
|
|
12676
|
+
const generatedId = (0, import_react157.useId)();
|
|
12531
12677
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
12532
|
-
const [groupValue, setGroupValue] = (0,
|
|
12678
|
+
const [groupValue, setGroupValue] = (0, import_react157.useState)(value);
|
|
12533
12679
|
const handleChange = combineHandlers(
|
|
12534
12680
|
(e) => setGroupValue(e.target.value),
|
|
12535
12681
|
(e) => onChange && onChange(e, e.target.value)
|
|
12536
12682
|
);
|
|
12537
12683
|
const labelId = label && `${uniqueId}-label`;
|
|
12538
|
-
return /* @__PURE__ */ (0,
|
|
12684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
12539
12685
|
ToggleBarContext.Provider,
|
|
12540
12686
|
{
|
|
12541
12687
|
value: {
|
|
@@ -12544,7 +12690,7 @@ var ToggleBar = (props) => {
|
|
|
12544
12690
|
name,
|
|
12545
12691
|
value: groupValue
|
|
12546
12692
|
},
|
|
12547
|
-
children: /* @__PURE__ */ (0,
|
|
12693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(
|
|
12548
12694
|
"div",
|
|
12549
12695
|
{
|
|
12550
12696
|
...getBaseHTMLProps(
|
|
@@ -12557,8 +12703,8 @@ var ToggleBar = (props) => {
|
|
|
12557
12703
|
role: "radiogroup",
|
|
12558
12704
|
"aria-labelledby": labelId != null ? labelId : htmlProps == null ? void 0 : htmlProps["aria-labelledby"],
|
|
12559
12705
|
children: [
|
|
12560
|
-
label && /* @__PURE__ */ (0,
|
|
12561
|
-
/* @__PURE__ */ (0,
|
|
12706
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(Typography, { id: labelId, as: "span", typographyType: "labelMedium", children: label }),
|
|
12707
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)("div", { className: ToggleBar_default.bar, children })
|
|
12562
12708
|
]
|
|
12563
12709
|
}
|
|
12564
12710
|
)
|
|
@@ -12568,8 +12714,8 @@ var ToggleBar = (props) => {
|
|
|
12568
12714
|
ToggleBar.displayName = "ToggleBar";
|
|
12569
12715
|
|
|
12570
12716
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
12571
|
-
var
|
|
12572
|
-
var
|
|
12717
|
+
var import_react158 = require("react");
|
|
12718
|
+
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
12573
12719
|
var typographyTypes4 = {
|
|
12574
12720
|
large: "bodyLarge",
|
|
12575
12721
|
medium: "bodyMedium",
|
|
@@ -12586,7 +12732,7 @@ var calculateChecked = (value, group, checked) => {
|
|
|
12586
12732
|
}
|
|
12587
12733
|
return !!value;
|
|
12588
12734
|
};
|
|
12589
|
-
var ToggleRadio = (0,
|
|
12735
|
+
var ToggleRadio = (0, import_react158.forwardRef)(
|
|
12590
12736
|
(props, ref) => {
|
|
12591
12737
|
const {
|
|
12592
12738
|
value,
|
|
@@ -12602,7 +12748,7 @@ var ToggleRadio = (0, import_react156.forwardRef)(
|
|
|
12602
12748
|
id,
|
|
12603
12749
|
...rest
|
|
12604
12750
|
} = props;
|
|
12605
|
-
const generatedId = (0,
|
|
12751
|
+
const generatedId = (0, import_react158.useId)();
|
|
12606
12752
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
12607
12753
|
const group = useToggleBarContext();
|
|
12608
12754
|
const handleChange = (event) => {
|
|
@@ -12610,8 +12756,8 @@ var ToggleRadio = (0, import_react156.forwardRef)(
|
|
|
12610
12756
|
(group == null ? void 0 : group.onChange) && group.onChange(event);
|
|
12611
12757
|
};
|
|
12612
12758
|
const contentTypeCn = label ? "with-text" : "just-icon";
|
|
12613
|
-
return /* @__PURE__ */ (0,
|
|
12614
|
-
/* @__PURE__ */ (0,
|
|
12759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)("label", { htmlFor: uniqueId, className: ToggleBar_default.label, children: [
|
|
12760
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
12615
12761
|
"input",
|
|
12616
12762
|
{
|
|
12617
12763
|
...getBaseHTMLProps(
|
|
@@ -12634,7 +12780,7 @@ var ToggleRadio = (0, import_react156.forwardRef)(
|
|
|
12634
12780
|
"aria-labelledby": ariaLabelledBy
|
|
12635
12781
|
}
|
|
12636
12782
|
),
|
|
12637
|
-
/* @__PURE__ */ (0,
|
|
12783
|
+
/* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(
|
|
12638
12784
|
Typography,
|
|
12639
12785
|
{
|
|
12640
12786
|
as: "span",
|
|
@@ -12645,8 +12791,8 @@ var ToggleRadio = (0, import_react156.forwardRef)(
|
|
|
12645
12791
|
focus_default["focus-styled-sibling"]
|
|
12646
12792
|
),
|
|
12647
12793
|
children: [
|
|
12648
|
-
icon && /* @__PURE__ */ (0,
|
|
12649
|
-
label && /* @__PURE__ */ (0,
|
|
12794
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(Icon, { icon, iconSize: "inherit" }),
|
|
12795
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("span", { children: label })
|
|
12650
12796
|
]
|
|
12651
12797
|
}
|
|
12652
12798
|
)
|
|
@@ -12656,7 +12802,7 @@ var ToggleRadio = (0, import_react156.forwardRef)(
|
|
|
12656
12802
|
ToggleRadio.displayName = "ToggleRadio";
|
|
12657
12803
|
|
|
12658
12804
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
12659
|
-
var
|
|
12805
|
+
var import_react159 = require("react");
|
|
12660
12806
|
|
|
12661
12807
|
// src/components/ToggleButton/ToggleButton.module.css
|
|
12662
12808
|
var ToggleButton_default = {
|
|
@@ -12672,14 +12818,14 @@ var ToggleButton_default = {
|
|
|
12672
12818
|
};
|
|
12673
12819
|
|
|
12674
12820
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
12675
|
-
var
|
|
12676
|
-
var ToggleButton = (0,
|
|
12821
|
+
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
12822
|
+
var ToggleButton = (0, import_react159.forwardRef)(
|
|
12677
12823
|
({ id, label, icon, size: size2 = "small", className, htmlProps, ...rest }, ref) => {
|
|
12678
|
-
const generatedId = (0,
|
|
12824
|
+
const generatedId = (0, import_react159.useId)();
|
|
12679
12825
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
12680
12826
|
const hasIcon = !!icon;
|
|
12681
|
-
return /* @__PURE__ */ (0,
|
|
12682
|
-
/* @__PURE__ */ (0,
|
|
12827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("label", { htmlFor: uniqueId, className: ToggleButton_default.container, children: [
|
|
12828
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
12683
12829
|
"input",
|
|
12684
12830
|
{
|
|
12685
12831
|
...getBaseHTMLProps(
|
|
@@ -12696,7 +12842,7 @@ var ToggleButton = (0, import_react157.forwardRef)(
|
|
|
12696
12842
|
type: "checkbox"
|
|
12697
12843
|
}
|
|
12698
12844
|
),
|
|
12699
|
-
/* @__PURE__ */ (0,
|
|
12845
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(
|
|
12700
12846
|
"span",
|
|
12701
12847
|
{
|
|
12702
12848
|
className: cn(
|
|
@@ -12707,7 +12853,7 @@ var ToggleButton = (0, import_react157.forwardRef)(
|
|
|
12707
12853
|
focus_default["focus-styled-sibling"]
|
|
12708
12854
|
),
|
|
12709
12855
|
children: [
|
|
12710
|
-
hasIcon && /* @__PURE__ */ (0,
|
|
12856
|
+
hasIcon && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(Icon, { icon, iconSize: "inherit" }),
|
|
12711
12857
|
" ",
|
|
12712
12858
|
label
|
|
12713
12859
|
]
|
|
@@ -12719,8 +12865,8 @@ var ToggleButton = (0, import_react157.forwardRef)(
|
|
|
12719
12865
|
ToggleButton.displayName = "ToggleButton";
|
|
12720
12866
|
|
|
12721
12867
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
12722
|
-
var
|
|
12723
|
-
var
|
|
12868
|
+
var import_react160 = require("react");
|
|
12869
|
+
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
12724
12870
|
var ToggleButtonGroup = (props) => {
|
|
12725
12871
|
const {
|
|
12726
12872
|
children,
|
|
@@ -12732,9 +12878,9 @@ var ToggleButtonGroup = (props) => {
|
|
|
12732
12878
|
htmlProps,
|
|
12733
12879
|
...rest
|
|
12734
12880
|
} = props;
|
|
12735
|
-
const generatedId = (0,
|
|
12881
|
+
const generatedId = (0, import_react160.useId)();
|
|
12736
12882
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
12737
|
-
return /* @__PURE__ */ (0,
|
|
12883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
|
|
12738
12884
|
"div",
|
|
12739
12885
|
{
|
|
12740
12886
|
...getBaseHTMLProps(
|
|
@@ -12746,8 +12892,8 @@ var ToggleButtonGroup = (props) => {
|
|
|
12746
12892
|
role: "group",
|
|
12747
12893
|
"aria-labelledby": label ? uniqueLabelId : void 0,
|
|
12748
12894
|
children: [
|
|
12749
|
-
!!label && /* @__PURE__ */ (0,
|
|
12750
|
-
/* @__PURE__ */ (0,
|
|
12895
|
+
!!label && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(Typography, { as: "span", typographyType: "labelMedium", id: uniqueLabelId, children: label }),
|
|
12896
|
+
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: cn(ToggleButton_default.group, ToggleButton_default[`group--${direction}`]), children })
|
|
12751
12897
|
]
|
|
12752
12898
|
}
|
|
12753
12899
|
);
|
|
@@ -12758,6 +12904,7 @@ ToggleButtonGroup.displayName = "ToggleButtonGroup";
|
|
|
12758
12904
|
Accordion,
|
|
12759
12905
|
AccordionBody,
|
|
12760
12906
|
AccordionHeader,
|
|
12907
|
+
AddTabButton,
|
|
12761
12908
|
AddressShieldedIcon,
|
|
12762
12909
|
AgreementIcon,
|
|
12763
12910
|
AnimatedChevronUpDown,
|