@norges-domstoler/dds-components 19.0.0 → 19.2.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/index.css +15 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +20 -3
- package/dist/index.d.ts +20 -3
- package/dist/index.js +80 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -2502,7 +2502,7 @@ import { useEffect as useEffect5 } from "react";
|
|
|
2502
2502
|
function useOnClickOutside(element, handler) {
|
|
2503
2503
|
useEffect5(() => {
|
|
2504
2504
|
const listener = (event) => {
|
|
2505
|
-
const elements = Array.isArray(element) ? element : [element];
|
|
2505
|
+
const elements = Array.isArray(element) ? element : [element].filter(Boolean);
|
|
2506
2506
|
const hasClickedInside = elements.some(
|
|
2507
2507
|
(el) => el == null ? void 0 : el.contains(event.target)
|
|
2508
2508
|
);
|
|
@@ -4459,7 +4459,7 @@ var CalendarPopoverContent = ({
|
|
|
4459
4459
|
if (!themeContext) {
|
|
4460
4460
|
throw new Error("DatePicker must be used within a ThemeProvider");
|
|
4461
4461
|
}
|
|
4462
|
-
const portalTarget = themeContext
|
|
4462
|
+
const portalTarget = themeContext.el;
|
|
4463
4463
|
const { isOpen, onClose, anchorRef, closeButtonRef } = useContext4(
|
|
4464
4464
|
CalendarPopoverContext
|
|
4465
4465
|
);
|
|
@@ -4471,14 +4471,18 @@ var CalendarPopoverContent = ({
|
|
|
4471
4471
|
var _a;
|
|
4472
4472
|
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
4473
4473
|
}, []);
|
|
4474
|
+
const hasBreakpoint = !!smallScreenBreakpoint;
|
|
4474
4475
|
useEffect16(() => {
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4476
|
+
var _a;
|
|
4477
|
+
if (hasBreakpoint && ((_a = modalRef.current) == null ? void 0 : _a.checkVisibility())) {
|
|
4478
|
+
if (isOpen) {
|
|
4479
|
+
handleElementWithBackdropMount(document.body);
|
|
4480
|
+
} else {
|
|
4481
|
+
handleElementWithBackdropUnmount(document.body);
|
|
4482
|
+
}
|
|
4483
|
+
return () => handleElementWithBackdropUnmount(document.body);
|
|
4479
4484
|
}
|
|
4480
|
-
|
|
4481
|
-
}, [isOpen]);
|
|
4485
|
+
}, [isOpen, hasBreakpoint]);
|
|
4482
4486
|
const closeOnKeyboardBlurBack = (event) => {
|
|
4483
4487
|
if (event.key === "Tab" && event.shiftKey === true) {
|
|
4484
4488
|
onClose();
|
|
@@ -4486,7 +4490,7 @@ var CalendarPopoverContent = ({
|
|
|
4486
4490
|
};
|
|
4487
4491
|
if (!isOpen) return null;
|
|
4488
4492
|
return /* @__PURE__ */ jsxs34(Fragment3, { children: [
|
|
4489
|
-
portalTarget && createPortal(
|
|
4493
|
+
portalTarget && hasBreakpoint && createPortal(
|
|
4490
4494
|
/* @__PURE__ */ jsx207(
|
|
4491
4495
|
"div",
|
|
4492
4496
|
{
|
|
@@ -9664,7 +9668,11 @@ var getCallingCode = (s) => {
|
|
|
9664
9668
|
};
|
|
9665
9669
|
|
|
9666
9670
|
// src/components/Popover/Popover.tsx
|
|
9667
|
-
import {
|
|
9671
|
+
import {
|
|
9672
|
+
forwardRef as forwardRef79,
|
|
9673
|
+
useEffect as useEffect25,
|
|
9674
|
+
useId as useId16
|
|
9675
|
+
} from "react";
|
|
9668
9676
|
|
|
9669
9677
|
// src/components/Popover/Popover.module.css
|
|
9670
9678
|
var Popover_default = {
|
|
@@ -9687,6 +9695,7 @@ import { jsx as jsx270, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
|
9687
9695
|
var Popover = forwardRef79(
|
|
9688
9696
|
(props, ref) => {
|
|
9689
9697
|
const {
|
|
9698
|
+
id,
|
|
9690
9699
|
header,
|
|
9691
9700
|
withCloseButton = true,
|
|
9692
9701
|
onBlur,
|
|
@@ -9697,23 +9706,59 @@ var Popover = forwardRef79(
|
|
|
9697
9706
|
returnFocusOnBlur = true,
|
|
9698
9707
|
className,
|
|
9699
9708
|
htmlProps = {},
|
|
9709
|
+
anchorRef,
|
|
9710
|
+
isOpen: propIsOpen,
|
|
9711
|
+
onClose: propOnClose,
|
|
9700
9712
|
...rest
|
|
9701
9713
|
} = props;
|
|
9714
|
+
const { refs, styles: positionStyles } = useFloatPosition(null, {
|
|
9715
|
+
offset,
|
|
9716
|
+
placement
|
|
9717
|
+
});
|
|
9718
|
+
const context = usePopoverContext();
|
|
9702
9719
|
const {
|
|
9703
|
-
floatStyling,
|
|
9720
|
+
floatStyling: contextFloatStyling,
|
|
9704
9721
|
setFloatOptions,
|
|
9705
|
-
floatingRef,
|
|
9722
|
+
floatingRef: contextFloatingRef,
|
|
9723
|
+
popoverId: contextPopoverId,
|
|
9724
|
+
onClose: contextOnClose,
|
|
9725
|
+
isOpen: contextIsOpen,
|
|
9726
|
+
anchorEl: contextAnchorEl
|
|
9727
|
+
} = context;
|
|
9728
|
+
const hasContext = contextPopoverId !== void 0;
|
|
9729
|
+
const generatedId = useId16();
|
|
9730
|
+
const uniquePopoverId = id != null ? id : `${generatedId}-popover`;
|
|
9731
|
+
const [
|
|
9706
9732
|
popoverId,
|
|
9707
|
-
|
|
9733
|
+
anchorEl,
|
|
9708
9734
|
isOpen = false,
|
|
9709
|
-
|
|
9710
|
-
|
|
9735
|
+
floatingRef,
|
|
9736
|
+
floatStyling,
|
|
9737
|
+
onClose
|
|
9738
|
+
] = hasContext ? [
|
|
9739
|
+
contextPopoverId,
|
|
9740
|
+
contextAnchorEl,
|
|
9741
|
+
contextIsOpen,
|
|
9742
|
+
contextFloatingRef,
|
|
9743
|
+
contextFloatStyling,
|
|
9744
|
+
contextOnClose
|
|
9745
|
+
] : [
|
|
9746
|
+
uniquePopoverId,
|
|
9747
|
+
(anchorRef == null ? void 0 : anchorRef.current) && anchorRef.current,
|
|
9748
|
+
propIsOpen,
|
|
9749
|
+
refs.setFloating,
|
|
9750
|
+
positionStyles.floating,
|
|
9751
|
+
propOnClose
|
|
9752
|
+
];
|
|
9753
|
+
if (!hasContext) {
|
|
9754
|
+
refs.setReference(anchorEl || null);
|
|
9755
|
+
}
|
|
9711
9756
|
const hasTransitionedIn = useMountTransition(isOpen, 400);
|
|
9712
9757
|
const popoverRef = useReturnFocusOnBlur(
|
|
9713
9758
|
isOpen && hasTransitionedIn && returnFocusOnBlur,
|
|
9714
9759
|
() => {
|
|
9715
|
-
onClose
|
|
9716
|
-
onBlur
|
|
9760
|
+
onClose == null ? void 0 : onClose();
|
|
9761
|
+
onBlur == null ? void 0 : onBlur();
|
|
9717
9762
|
},
|
|
9718
9763
|
anchorEl && anchorEl
|
|
9719
9764
|
);
|
|
@@ -9721,6 +9766,12 @@ var Popover = forwardRef79(
|
|
|
9721
9766
|
useEffect25(() => {
|
|
9722
9767
|
setFloatOptions && setFloatOptions({ placement, offset });
|
|
9723
9768
|
}, [placement, offset]);
|
|
9769
|
+
useOnClickOutside([popoverRef.current, anchorEl], () => {
|
|
9770
|
+
if (isOpen && !hasContext) onClose == null ? void 0 : onClose();
|
|
9771
|
+
});
|
|
9772
|
+
useOnKeyDown("Escape", () => {
|
|
9773
|
+
if (isOpen && !hasContext) onClose == null ? void 0 : onClose();
|
|
9774
|
+
});
|
|
9724
9775
|
const hasTitle = !!header;
|
|
9725
9776
|
const openCn = hasTransitionedIn && isOpen ? "open" : "closed";
|
|
9726
9777
|
return isOpen || hasTransitionedIn ? /* @__PURE__ */ jsxs63(
|
|
@@ -9780,7 +9831,7 @@ import {
|
|
|
9780
9831
|
Children as ReactChildren5,
|
|
9781
9832
|
cloneElement as cloneElement6,
|
|
9782
9833
|
isValidElement as isValidElement7,
|
|
9783
|
-
useId as
|
|
9834
|
+
useId as useId17,
|
|
9784
9835
|
useRef as useRef30,
|
|
9785
9836
|
useState as useState21
|
|
9786
9837
|
} from "react";
|
|
@@ -9798,7 +9849,7 @@ var PopoverGroup = ({
|
|
|
9798
9849
|
const [internalIsOpen, internalSetIsOpen] = useState21(isInitiallyOpen);
|
|
9799
9850
|
const open = propIsOpen != null ? propIsOpen : internalIsOpen;
|
|
9800
9851
|
const setOpen = propSetIsOpen != null ? propSetIsOpen : internalSetIsOpen;
|
|
9801
|
-
const generatedId =
|
|
9852
|
+
const generatedId = useId17();
|
|
9802
9853
|
const uniquePopoverId = popoverId != null ? popoverId : `${generatedId}-popover`;
|
|
9803
9854
|
const [floatOptions, setFloatOptions] = useState21();
|
|
9804
9855
|
const { refs, styles: positionStyles } = useFloatPosition(null, floatOptions);
|
|
@@ -10084,7 +10135,7 @@ var intersperseItemsWithConnector = (children) => Children4.map(children, (child
|
|
|
10084
10135
|
});
|
|
10085
10136
|
|
|
10086
10137
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
10087
|
-
import { forwardRef as forwardRef81, useId as
|
|
10138
|
+
import { forwardRef as forwardRef81, useId as useId18 } from "react";
|
|
10088
10139
|
|
|
10089
10140
|
// src/components/ProgressBar/ProgressBar.module.css
|
|
10090
10141
|
var ProgressBar_default = {
|
|
@@ -10117,7 +10168,7 @@ var ProgressBar = forwardRef81(
|
|
|
10117
10168
|
style,
|
|
10118
10169
|
...rest
|
|
10119
10170
|
} = props;
|
|
10120
|
-
const generatedId =
|
|
10171
|
+
const generatedId = useId18();
|
|
10121
10172
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
10122
10173
|
const hasErrorMessage = !!errorMessage;
|
|
10123
10174
|
const hasTip = !!tip;
|
|
@@ -10182,7 +10233,7 @@ ProgressBar.displayName = "ProgressBar";
|
|
|
10182
10233
|
// src/components/Search/Search.tsx
|
|
10183
10234
|
import {
|
|
10184
10235
|
forwardRef as forwardRef84,
|
|
10185
|
-
useId as
|
|
10236
|
+
useId as useId19,
|
|
10186
10237
|
useState as useState23
|
|
10187
10238
|
} from "react";
|
|
10188
10239
|
|
|
@@ -10388,7 +10439,7 @@ var Search = forwardRef84(
|
|
|
10388
10439
|
...rest
|
|
10389
10440
|
}, ref) => {
|
|
10390
10441
|
var _a;
|
|
10391
|
-
const generatedId =
|
|
10442
|
+
const generatedId = useId19();
|
|
10392
10443
|
const uniqueId = id != null ? id : `${generatedId}-searchInput`;
|
|
10393
10444
|
const hasLabel = !!label;
|
|
10394
10445
|
const tipId = derivativeIdGenerator(uniqueId, "tip");
|
|
@@ -10605,7 +10656,7 @@ Search2.AutocompleteWrapper = SearchAutocompleteWrapper;
|
|
|
10605
10656
|
Search2.Suggestions = SearchSuggestions;
|
|
10606
10657
|
|
|
10607
10658
|
// src/components/SelectionControl/Checkbox/Checkbox.tsx
|
|
10608
|
-
import { forwardRef as forwardRef86, useId as
|
|
10659
|
+
import { forwardRef as forwardRef86, useId as useId20 } from "react";
|
|
10609
10660
|
|
|
10610
10661
|
// src/components/SelectionControl/Checkbox/CheckboxGroupContext.tsx
|
|
10611
10662
|
import { createContext as createContext9, useContext as useContext15 } from "react";
|
|
@@ -10711,7 +10762,7 @@ var Checkbox = forwardRef86(
|
|
|
10711
10762
|
htmlProps = {},
|
|
10712
10763
|
...rest
|
|
10713
10764
|
} = props;
|
|
10714
|
-
const generatedId =
|
|
10765
|
+
const generatedId = useId20();
|
|
10715
10766
|
const uniqueId = id != null ? id : `${generatedId}-checkbox`;
|
|
10716
10767
|
const checkboxGroup = useCheckboxGroup();
|
|
10717
10768
|
const hasLabel = !!label;
|
|
@@ -10781,7 +10832,7 @@ var Checkbox = forwardRef86(
|
|
|
10781
10832
|
Checkbox.displayName = "Checkbox";
|
|
10782
10833
|
|
|
10783
10834
|
// src/components/SelectionControl/Checkbox/CheckboxGroup.tsx
|
|
10784
|
-
import { useId as
|
|
10835
|
+
import { useId as useId21 } from "react";
|
|
10785
10836
|
import { jsx as jsx281, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
10786
10837
|
var CheckboxGroup = (props) => {
|
|
10787
10838
|
const {
|
|
@@ -10800,7 +10851,7 @@ var CheckboxGroup = (props) => {
|
|
|
10800
10851
|
...rest
|
|
10801
10852
|
} = props;
|
|
10802
10853
|
const { "aria-required": ariaRequired } = htmlProps;
|
|
10803
|
-
const generatedId =
|
|
10854
|
+
const generatedId = useId21();
|
|
10804
10855
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-checkboxGroup`;
|
|
10805
10856
|
const hasErrorMessage = !!errorMessage;
|
|
10806
10857
|
const showRequiredMarker = required || ariaRequired;
|
|
@@ -10858,7 +10909,7 @@ var CheckboxGroup = (props) => {
|
|
|
10858
10909
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
10859
10910
|
|
|
10860
10911
|
// src/components/SelectionControl/RadioButton/RadioButton.tsx
|
|
10861
|
-
import { forwardRef as forwardRef87, useId as
|
|
10912
|
+
import { forwardRef as forwardRef87, useId as useId22 } from "react";
|
|
10862
10913
|
|
|
10863
10914
|
// src/components/SelectionControl/RadioButton/RadioButtonGroupContext.tsx
|
|
10864
10915
|
import { createContext as createContext10, useContext as useContext16 } from "react";
|
|
@@ -10907,7 +10958,7 @@ var RadioButton = forwardRef87(
|
|
|
10907
10958
|
style,
|
|
10908
10959
|
...restHtmlProps
|
|
10909
10960
|
} = htmlProps;
|
|
10910
|
-
const generatedId =
|
|
10961
|
+
const generatedId = useId22();
|
|
10911
10962
|
const uniqueId = id != null ? id : `${generatedId}-radioButton`;
|
|
10912
10963
|
const hasLabel = !!label;
|
|
10913
10964
|
const radioButtonGroup = useRadioButtonGroup();
|
|
@@ -10979,7 +11030,7 @@ RadioButton.displayName = "RadioButton";
|
|
|
10979
11030
|
// src/components/SelectionControl/RadioButton/RadioButtonGroup.tsx
|
|
10980
11031
|
import {
|
|
10981
11032
|
forwardRef as forwardRef88,
|
|
10982
|
-
useId as
|
|
11033
|
+
useId as useId23,
|
|
10983
11034
|
useState as useState25
|
|
10984
11035
|
} from "react";
|
|
10985
11036
|
import { jsx as jsx283, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
@@ -11007,7 +11058,7 @@ var RadioButtonGroupInner = (props, ref) => {
|
|
|
11007
11058
|
const [uncontrolledValue, setUncontrolledValue] = useState25(
|
|
11008
11059
|
defaultValue
|
|
11009
11060
|
);
|
|
11010
|
-
const generatedId =
|
|
11061
|
+
const generatedId = useId23();
|
|
11011
11062
|
const uniqueGroupId = groupId != null ? groupId : `${generatedId}-radioButtonGroup`;
|
|
11012
11063
|
const isControlled = value !== void 0;
|
|
11013
11064
|
const groupValue = isControlled ? value : uncontrolledValue;
|
|
@@ -11637,6 +11688,7 @@ import { createContext as createContext13, useContext as useContext20 } from "re
|
|
|
11637
11688
|
var TabsContext = createContext13({
|
|
11638
11689
|
activeTab: 0,
|
|
11639
11690
|
tabsId: "",
|
|
11691
|
+
size: "small",
|
|
11640
11692
|
handleTabChange: () => null,
|
|
11641
11693
|
tabListRef: null,
|
|
11642
11694
|
tabPanelsRef: null,
|
|
@@ -11654,6 +11706,10 @@ var Tabs_default = {
|
|
|
11654
11706
|
"tab-row--standard-widths": "Tabs_tab-row--standard-widths",
|
|
11655
11707
|
"tab-row--custom-widths": "Tabs_tab-row--custom-widths",
|
|
11656
11708
|
tab: "Tabs_tab",
|
|
11709
|
+
"tab--medium--row": "Tabs_tab--medium--row",
|
|
11710
|
+
"tab--small--row": "Tabs_tab--small--row",
|
|
11711
|
+
"tab--medium--column": "Tabs_tab--medium--column",
|
|
11712
|
+
"tab--small--column": "Tabs_tab--small--column",
|
|
11657
11713
|
"tab--row": "Tabs_tab--row",
|
|
11658
11714
|
"tab--column": "Tabs_tab--column",
|
|
11659
11715
|
"tab--active": "Tabs_tab--active",
|
|
@@ -11711,7 +11767,7 @@ var AddTabButton = forwardRef101(
|
|
|
11711
11767
|
useSetTabWidth(index, width);
|
|
11712
11768
|
const buttonRef = useRef34(null);
|
|
11713
11769
|
const combinedRef = useCombinedRef(ref, buttonRef);
|
|
11714
|
-
const { tabContentDirection } = useTabsContext();
|
|
11770
|
+
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
11715
11771
|
return /* @__PURE__ */ jsxs76(
|
|
11716
11772
|
"button",
|
|
11717
11773
|
{
|
|
@@ -11721,7 +11777,7 @@ var AddTabButton = forwardRef101(
|
|
|
11721
11777
|
className,
|
|
11722
11778
|
Tabs_default.tab,
|
|
11723
11779
|
Tabs_default[`tab--${tabContentDirection}`],
|
|
11724
|
-
typographyStyles_default[
|
|
11780
|
+
typographyStyles_default[`body-${size2}`],
|
|
11725
11781
|
focus_default["focusable--inset"]
|
|
11726
11782
|
),
|
|
11727
11783
|
children: [
|
|
@@ -11738,7 +11794,7 @@ AddTabButton.displayName = "AddTabButton";
|
|
|
11738
11794
|
import {
|
|
11739
11795
|
forwardRef as forwardRef102,
|
|
11740
11796
|
useEffect as useEffect31,
|
|
11741
|
-
useId as
|
|
11797
|
+
useId as useId24,
|
|
11742
11798
|
useRef as useRef35,
|
|
11743
11799
|
useState as useState29
|
|
11744
11800
|
} from "react";
|
|
@@ -11749,6 +11805,7 @@ var Tabs = forwardRef102((props, ref) => {
|
|
|
11749
11805
|
activeTab,
|
|
11750
11806
|
onChange,
|
|
11751
11807
|
tabContentDirection = "row",
|
|
11808
|
+
size: size2 = "small",
|
|
11752
11809
|
addTabButtonProps,
|
|
11753
11810
|
width,
|
|
11754
11811
|
children,
|
|
@@ -11756,7 +11813,7 @@ var Tabs = forwardRef102((props, ref) => {
|
|
|
11756
11813
|
htmlProps,
|
|
11757
11814
|
...rest
|
|
11758
11815
|
} = props;
|
|
11759
|
-
const generatedId =
|
|
11816
|
+
const generatedId = useId24();
|
|
11760
11817
|
const uniqueId = id != null ? id : `${generatedId}-tabs`;
|
|
11761
11818
|
const [thisActiveTab, setActiveTab] = useState29(activeTab != null ? activeTab : 0);
|
|
11762
11819
|
const [hasTabFocus, setHasTabFocus] = useState29(false);
|
|
@@ -11781,6 +11838,7 @@ var Tabs = forwardRef102((props, ref) => {
|
|
|
11781
11838
|
value: {
|
|
11782
11839
|
tabsId: uniqueId,
|
|
11783
11840
|
activeTab: thisActiveTab,
|
|
11841
|
+
size: size2,
|
|
11784
11842
|
handleTabChange,
|
|
11785
11843
|
tabListRef,
|
|
11786
11844
|
tabPanelsRef,
|
|
@@ -11835,7 +11893,7 @@ var Tab = forwardRef103((props, ref) => {
|
|
|
11835
11893
|
useSetTabWidth(index, width);
|
|
11836
11894
|
const itemRef = useRef36(null);
|
|
11837
11895
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
11838
|
-
const { tabContentDirection } = useTabsContext();
|
|
11896
|
+
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
11839
11897
|
useEffect32(() => {
|
|
11840
11898
|
var _a;
|
|
11841
11899
|
if (focus) {
|
|
@@ -11863,9 +11921,10 @@ var Tab = forwardRef103((props, ref) => {
|
|
|
11863
11921
|
cn(
|
|
11864
11922
|
className,
|
|
11865
11923
|
Tabs_default.tab,
|
|
11924
|
+
Tabs_default[`tab--${size2}--${tabContentDirection}`],
|
|
11866
11925
|
active && Tabs_default["tab--active"],
|
|
11867
11926
|
Tabs_default[`tab--${tabContentDirection}`],
|
|
11868
|
-
typographyStyles_default[
|
|
11927
|
+
typographyStyles_default[`body-${size2}`],
|
|
11869
11928
|
focus_default["focusable--inset"]
|
|
11870
11929
|
),
|
|
11871
11930
|
htmlProps,
|
|
@@ -11919,7 +11978,11 @@ var TabList = forwardRef104(
|
|
|
11919
11978
|
index,
|
|
11920
11979
|
focus: focus === index && hasTabFocus,
|
|
11921
11980
|
setFocus,
|
|
11922
|
-
onClick: () =>
|
|
11981
|
+
onClick: () => {
|
|
11982
|
+
var _a, _b;
|
|
11983
|
+
handleTabChange(index);
|
|
11984
|
+
(_b = (_a = child.props).onClick) == null ? void 0 : _b.call(_a);
|
|
11985
|
+
}
|
|
11923
11986
|
});
|
|
11924
11987
|
}) : [];
|
|
11925
11988
|
if (hasButton && tabListChildren) {
|
|
@@ -12090,7 +12153,7 @@ Tag.displayName = "Tag";
|
|
|
12090
12153
|
// src/components/TextInput/TextInput.tsx
|
|
12091
12154
|
import {
|
|
12092
12155
|
forwardRef as forwardRef108,
|
|
12093
|
-
useId as
|
|
12156
|
+
useId as useId25,
|
|
12094
12157
|
useLayoutEffect as useLayoutEffect4,
|
|
12095
12158
|
useRef as useRef37,
|
|
12096
12159
|
useState as useState31
|
|
@@ -12168,7 +12231,7 @@ var TextInput = forwardRef108(
|
|
|
12168
12231
|
onChange(event);
|
|
12169
12232
|
}
|
|
12170
12233
|
};
|
|
12171
|
-
const generatedId =
|
|
12234
|
+
const generatedId = useId25();
|
|
12172
12235
|
const uniqueId = id != null ? id : `${generatedId}-textInput`;
|
|
12173
12236
|
const hasErrorMessage = !!errorMessage;
|
|
12174
12237
|
const hasTip = !!tip;
|
|
@@ -12350,7 +12413,7 @@ TextInput.displayName = "TextInput";
|
|
|
12350
12413
|
// src/components/Toggle/Toggle.tsx
|
|
12351
12414
|
import {
|
|
12352
12415
|
forwardRef as forwardRef109,
|
|
12353
|
-
useId as
|
|
12416
|
+
useId as useId26
|
|
12354
12417
|
} from "react";
|
|
12355
12418
|
|
|
12356
12419
|
// src/components/Toggle/Toggle.module.css
|
|
@@ -12385,7 +12448,7 @@ var Toggle = forwardRef109(
|
|
|
12385
12448
|
htmlProps = {},
|
|
12386
12449
|
...rest
|
|
12387
12450
|
}, ref) => {
|
|
12388
|
-
const generatedId =
|
|
12451
|
+
const generatedId = useId26();
|
|
12389
12452
|
const uniqueId = id != null ? id : `${generatedId}-toggle`;
|
|
12390
12453
|
const iconSize = size2 === "large" ? "medium" : "small";
|
|
12391
12454
|
const [checked, setChecked] = useControllableState({
|
|
@@ -12465,7 +12528,7 @@ var Toggle = forwardRef109(
|
|
|
12465
12528
|
Toggle.displayName = "Toggle";
|
|
12466
12529
|
|
|
12467
12530
|
// src/components/ToggleBar/ToggleBar.tsx
|
|
12468
|
-
import { useId as
|
|
12531
|
+
import { useId as useId27, useState as useState32 } from "react";
|
|
12469
12532
|
|
|
12470
12533
|
// src/components/ToggleBar/ToggleBar.context.tsx
|
|
12471
12534
|
import { createContext as createContext15, useContext as useContext22 } from "react";
|
|
@@ -12506,7 +12569,7 @@ var ToggleBar = (props) => {
|
|
|
12506
12569
|
id,
|
|
12507
12570
|
...rest
|
|
12508
12571
|
} = props;
|
|
12509
|
-
const generatedId =
|
|
12572
|
+
const generatedId = useId27();
|
|
12510
12573
|
const uniqueId = id != null ? id : `${generatedId}-ToggleBar`;
|
|
12511
12574
|
const [groupValue, setGroupValue] = useState32(value);
|
|
12512
12575
|
const handleChange = combineHandlers(
|
|
@@ -12549,7 +12612,7 @@ ToggleBar.displayName = "ToggleBar";
|
|
|
12549
12612
|
// src/components/ToggleBar/ToggleRadio.tsx
|
|
12550
12613
|
import {
|
|
12551
12614
|
forwardRef as forwardRef110,
|
|
12552
|
-
useId as
|
|
12615
|
+
useId as useId28
|
|
12553
12616
|
} from "react";
|
|
12554
12617
|
import { jsx as jsx308, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
12555
12618
|
var typographyTypes4 = {
|
|
@@ -12584,7 +12647,7 @@ var ToggleRadio = forwardRef110(
|
|
|
12584
12647
|
id,
|
|
12585
12648
|
...rest
|
|
12586
12649
|
} = props;
|
|
12587
|
-
const generatedId =
|
|
12650
|
+
const generatedId = useId28();
|
|
12588
12651
|
const uniqueId = id != null ? id : `${generatedId}-ToggleRadio`;
|
|
12589
12652
|
const group = useToggleBarContext();
|
|
12590
12653
|
const handleChange = (event) => {
|
|
@@ -12638,7 +12701,7 @@ var ToggleRadio = forwardRef110(
|
|
|
12638
12701
|
ToggleRadio.displayName = "ToggleRadio";
|
|
12639
12702
|
|
|
12640
12703
|
// src/components/ToggleButton/ToggleButton.tsx
|
|
12641
|
-
import { forwardRef as forwardRef111, useId as
|
|
12704
|
+
import { forwardRef as forwardRef111, useId as useId29 } from "react";
|
|
12642
12705
|
|
|
12643
12706
|
// src/components/ToggleButton/ToggleButton.module.css
|
|
12644
12707
|
var ToggleButton_default = {
|
|
@@ -12657,7 +12720,7 @@ var ToggleButton_default = {
|
|
|
12657
12720
|
import { jsx as jsx309, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
12658
12721
|
var ToggleButton = forwardRef111(
|
|
12659
12722
|
({ id, label, icon, size: size2 = "small", className, htmlProps, ...rest }, ref) => {
|
|
12660
|
-
const generatedId =
|
|
12723
|
+
const generatedId = useId29();
|
|
12661
12724
|
const uniqueId = id != null ? id : `${generatedId}-toggleButton`;
|
|
12662
12725
|
const hasIcon = !!icon;
|
|
12663
12726
|
return /* @__PURE__ */ jsxs83("label", { htmlFor: uniqueId, className: ToggleButton_default.container, children: [
|
|
@@ -12701,7 +12764,7 @@ var ToggleButton = forwardRef111(
|
|
|
12701
12764
|
ToggleButton.displayName = "ToggleButton";
|
|
12702
12765
|
|
|
12703
12766
|
// src/components/ToggleButton/ToggleButtonGroup.tsx
|
|
12704
|
-
import { useId as
|
|
12767
|
+
import { useId as useId30 } from "react";
|
|
12705
12768
|
import { jsx as jsx310, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
12706
12769
|
var ToggleButtonGroup = (props) => {
|
|
12707
12770
|
const {
|
|
@@ -12714,7 +12777,7 @@ var ToggleButtonGroup = (props) => {
|
|
|
12714
12777
|
htmlProps,
|
|
12715
12778
|
...rest
|
|
12716
12779
|
} = props;
|
|
12717
|
-
const generatedId =
|
|
12780
|
+
const generatedId = useId30();
|
|
12718
12781
|
const uniqueLabelId = labelId != null ? labelId : `${generatedId}-ToggleButtonGroupLabel`;
|
|
12719
12782
|
return /* @__PURE__ */ jsxs84(
|
|
12720
12783
|
"div",
|