@norges-domstoler/dds-components 0.0.0-dev-20260319072239 → 0.0.0-dev-20260319140133
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 +6 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +29 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +112 -104
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -125,9 +125,9 @@ var utilStyles_default = {
|
|
|
125
125
|
// src/components/helpers/AccordionBase/useAccordion.tsx
|
|
126
126
|
import {
|
|
127
127
|
useCallback as useCallback5,
|
|
128
|
-
useEffect as
|
|
128
|
+
useEffect as useEffect11,
|
|
129
129
|
useId,
|
|
130
|
-
useLayoutEffect,
|
|
130
|
+
useLayoutEffect as useLayoutEffect2,
|
|
131
131
|
useRef as useRef5,
|
|
132
132
|
useState as useState6
|
|
133
133
|
} from "react";
|
|
@@ -300,7 +300,7 @@ function placementToArrowPlacement(placement) {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
// src/hooks/useFocusTrap/useFocusTrap.tsx
|
|
303
|
-
import {
|
|
303
|
+
import { useLayoutEffect, useRef as useRef2 } from "react";
|
|
304
304
|
|
|
305
305
|
// src/utils/color.tsx
|
|
306
306
|
var TEXT_COLORS = [
|
|
@@ -475,43 +475,45 @@ function useElementHeight(element) {
|
|
|
475
475
|
|
|
476
476
|
// src/hooks/useFocusTrap/useFocusTrap.tsx
|
|
477
477
|
function useFocusTrap(active, initialFocusRef = void 0) {
|
|
478
|
-
const
|
|
479
|
-
|
|
478
|
+
const containerRef = useRef2(null);
|
|
479
|
+
useLayoutEffect(() => {
|
|
480
|
+
const container2 = containerRef.current;
|
|
481
|
+
if (!active || !container2) return;
|
|
482
|
+
if (initialFocusRef == null ? void 0 : initialFocusRef.current) {
|
|
483
|
+
initialFocusRef.current.focus();
|
|
484
|
+
} else {
|
|
485
|
+
container2.tabIndex = container2.tabIndex || -1;
|
|
486
|
+
container2.focus();
|
|
487
|
+
}
|
|
480
488
|
function handleFocus(e) {
|
|
481
|
-
if (e.key !== "Tab"
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
489
|
+
if (e.key !== "Tab") return;
|
|
490
|
+
const focusableEls = getFocusableElements(containerRef);
|
|
491
|
+
if (focusableEls.length < 1) return;
|
|
492
|
+
const firstEl = focusableEls[0];
|
|
493
|
+
const lastEl = focusableEls[focusableEls.length - 1];
|
|
494
|
+
const activeEl = document.activeElement;
|
|
495
|
+
if (!e.shiftKey && activeEl === lastEl) {
|
|
496
|
+
firstEl.focus();
|
|
487
497
|
e.preventDefault();
|
|
488
498
|
}
|
|
489
|
-
if (e.shiftKey &&
|
|
490
|
-
|
|
499
|
+
if (e.shiftKey && activeEl === firstEl) {
|
|
500
|
+
lastEl.focus();
|
|
491
501
|
e.preventDefault();
|
|
492
502
|
}
|
|
493
503
|
}
|
|
494
|
-
|
|
495
|
-
if (element && active) {
|
|
496
|
-
if (initialFocusRef == null ? void 0 : initialFocusRef.current) {
|
|
497
|
-
initialFocusRef.current.focus();
|
|
498
|
-
} else {
|
|
499
|
-
element.focus();
|
|
500
|
-
element.addEventListener("keydown", handleFocus);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
504
|
+
document.addEventListener("keydown", handleFocus);
|
|
503
505
|
return () => {
|
|
504
|
-
|
|
506
|
+
document.removeEventListener("keydown", handleFocus);
|
|
505
507
|
};
|
|
506
508
|
}, [active]);
|
|
507
|
-
return
|
|
509
|
+
return containerRef;
|
|
508
510
|
}
|
|
509
511
|
|
|
510
512
|
// src/hooks/useIsMounted/useIsMounted.ts
|
|
511
|
-
import { useCallback as useCallback3, useEffect as
|
|
513
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
512
514
|
var useIsMounted = () => {
|
|
513
515
|
const isMounted = useRef3(false);
|
|
514
|
-
|
|
516
|
+
useEffect3(() => {
|
|
515
517
|
isMounted.current = true;
|
|
516
518
|
return () => {
|
|
517
519
|
isMounted.current = false;
|
|
@@ -521,10 +523,10 @@ var useIsMounted = () => {
|
|
|
521
523
|
};
|
|
522
524
|
|
|
523
525
|
// src/hooks/useMountTransition/useMountTransition.tsx
|
|
524
|
-
import { useEffect as
|
|
526
|
+
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
525
527
|
var useMountTransition = (isMounted, unmountDelay) => {
|
|
526
528
|
const [hasTransitionedIn, setHasTransitionedIn] = useState3(false);
|
|
527
|
-
|
|
529
|
+
useEffect4(() => {
|
|
528
530
|
let timeoutId;
|
|
529
531
|
if (isMounted && !hasTransitionedIn) setHasTransitionedIn(true);
|
|
530
532
|
else if (!isMounted && hasTransitionedIn) {
|
|
@@ -538,9 +540,9 @@ var useMountTransition = (isMounted, unmountDelay) => {
|
|
|
538
540
|
};
|
|
539
541
|
|
|
540
542
|
// src/hooks/useOnClickOutside/useOnClickOutside.tsx
|
|
541
|
-
import { useEffect as
|
|
543
|
+
import { useEffect as useEffect5 } from "react";
|
|
542
544
|
function useOnClickOutside(element, handler) {
|
|
543
|
-
|
|
545
|
+
useEffect5(() => {
|
|
544
546
|
const listener = (event) => {
|
|
545
547
|
const elements = Array.isArray(element) ? element : [element].filter(Boolean);
|
|
546
548
|
const hasClickedInside = elements.some(
|
|
@@ -562,9 +564,9 @@ function useOnClickOutside(element, handler) {
|
|
|
562
564
|
}
|
|
563
565
|
|
|
564
566
|
// src/hooks/useOnKeyDown/useOnKeyDown.tsx
|
|
565
|
-
import { useEffect as
|
|
567
|
+
import { useEffect as useEffect6 } from "react";
|
|
566
568
|
var useOnKeyDown = (key, handler) => {
|
|
567
|
-
|
|
569
|
+
useEffect6(() => {
|
|
568
570
|
const listener = (event) => {
|
|
569
571
|
const keys = Array.isArray(key) ? key : [key];
|
|
570
572
|
if (keys.indexOf(event.key) !== -1) {
|
|
@@ -579,10 +581,10 @@ var useOnKeyDown = (key, handler) => {
|
|
|
579
581
|
};
|
|
580
582
|
|
|
581
583
|
// src/hooks/useReturnFocusOnBlur/useReturnFocusOnBlur.ts
|
|
582
|
-
import { useEffect as
|
|
584
|
+
import { useEffect as useEffect7, useRef as useRef4 } from "react";
|
|
583
585
|
function useReturnFocusOnBlur(active, onBlur, triggerElement) {
|
|
584
586
|
const elementRef = useRef4(null);
|
|
585
|
-
|
|
587
|
+
useEffect7(() => {
|
|
586
588
|
function handleFocus(e) {
|
|
587
589
|
if (e.key !== "Tab" || !active || !elementRef.current || !triggerElement)
|
|
588
590
|
return;
|
|
@@ -610,7 +612,7 @@ function useReturnFocusOnBlur(active, onBlur, triggerElement) {
|
|
|
610
612
|
// src/hooks/useRoveFocus/useRoveFocus.tsx
|
|
611
613
|
import {
|
|
612
614
|
useCallback as useCallback4,
|
|
613
|
-
useEffect as
|
|
615
|
+
useEffect as useEffect8,
|
|
614
616
|
useState as useState4
|
|
615
617
|
} from "react";
|
|
616
618
|
var isKeyboardEvent = (e) => e.key !== void 0;
|
|
@@ -637,7 +639,7 @@ function useRoveFocus(size2, active, direction = "column", noWrap) {
|
|
|
637
639
|
},
|
|
638
640
|
[size2, setCurrentFocusIndex, direction, noWrap]
|
|
639
641
|
);
|
|
640
|
-
|
|
642
|
+
useEffect8(() => {
|
|
641
643
|
if (!active) {
|
|
642
644
|
setCurrentFocusIndex(-1);
|
|
643
645
|
return;
|
|
@@ -651,7 +653,7 @@ function useRoveFocus(size2, active, direction = "column", noWrap) {
|
|
|
651
653
|
}
|
|
652
654
|
|
|
653
655
|
// src/hooks/useScreenSize/useScreenSize.tsx
|
|
654
|
-
import { useEffect as
|
|
656
|
+
import { useEffect as useEffect9, useState as useState5 } from "react";
|
|
655
657
|
var ScreenSize = /* @__PURE__ */ ((ScreenSize2) => {
|
|
656
658
|
ScreenSize2[ScreenSize2["XSmall"] = 0] = "XSmall";
|
|
657
659
|
ScreenSize2[ScreenSize2["Small"] = 1] = "Small";
|
|
@@ -689,7 +691,7 @@ var screenSizesAndMediaQueries = [
|
|
|
689
691
|
];
|
|
690
692
|
var useScreenSize = function() {
|
|
691
693
|
const [screenSize, setScreenSize] = useState5(3 /* Large */);
|
|
692
|
-
|
|
694
|
+
useEffect9(() => {
|
|
693
695
|
function listener() {
|
|
694
696
|
for (const [screenSize2, mediaQuery] of screenSizesAndMediaQueries) {
|
|
695
697
|
if (window.matchMedia(mediaQuery).matches) {
|
|
@@ -706,9 +708,9 @@ var useScreenSize = function() {
|
|
|
706
708
|
};
|
|
707
709
|
|
|
708
710
|
// src/hooks/useWindowResize/useWindowResize.tsx
|
|
709
|
-
import { useEffect as
|
|
711
|
+
import { useEffect as useEffect10 } from "react";
|
|
710
712
|
var useWindowResize = (handler) => {
|
|
711
|
-
|
|
713
|
+
useEffect10(() => {
|
|
712
714
|
window.addEventListener("resize", handler);
|
|
713
715
|
return () => window.removeEventListener("resize", handler);
|
|
714
716
|
}, [handler]);
|
|
@@ -742,12 +744,12 @@ var useAccordion = ({
|
|
|
742
744
|
const isMounted = useIsMounted();
|
|
743
745
|
const height = useElementHeight(bodyContentRef.current);
|
|
744
746
|
const [initialExpandedHeight, setIntialExpandedHeight] = useState6(null);
|
|
745
|
-
|
|
747
|
+
useLayoutEffect2(() => {
|
|
746
748
|
if (bodyContentRef.current && isExpanded) {
|
|
747
749
|
setIntialExpandedHeight(bodyContentRef.current.scrollHeight);
|
|
748
750
|
}
|
|
749
751
|
}, []);
|
|
750
|
-
|
|
752
|
+
useEffect11(() => {
|
|
751
753
|
if (isMounted()) {
|
|
752
754
|
setAnimate(true);
|
|
753
755
|
}
|
|
@@ -3568,7 +3570,7 @@ import { ddsTokens } from "@norges-domstoler/dds-design-tokens";
|
|
|
3568
3570
|
import {
|
|
3569
3571
|
createContext as createContext3,
|
|
3570
3572
|
useContext as useContext3,
|
|
3571
|
-
useEffect as
|
|
3573
|
+
useEffect as useEffect12,
|
|
3572
3574
|
useRef as useRef7,
|
|
3573
3575
|
useState as useState7
|
|
3574
3576
|
} from "react";
|
|
@@ -3591,7 +3593,7 @@ function ThemeProvider({
|
|
|
3591
3593
|
}) {
|
|
3592
3594
|
const themeRef = useRef7(null);
|
|
3593
3595
|
const [element, setElement] = useState7(null);
|
|
3594
|
-
|
|
3596
|
+
useEffect12(() => {
|
|
3595
3597
|
setElement(themeRef.current);
|
|
3596
3598
|
}, []);
|
|
3597
3599
|
return /* @__PURE__ */ jsx193(
|
|
@@ -4429,13 +4431,13 @@ var texts2 = createTexts({
|
|
|
4429
4431
|
});
|
|
4430
4432
|
|
|
4431
4433
|
// src/components/OverflowMenu/OverflowMenu.tsx
|
|
4432
|
-
import { useEffect as
|
|
4434
|
+
import { useEffect as useEffect14 } from "react";
|
|
4433
4435
|
|
|
4434
4436
|
// src/components/OverflowMenu/OverflowMenu.context.tsx
|
|
4435
4437
|
import {
|
|
4436
4438
|
createContext as createContext5,
|
|
4437
4439
|
useContext as useContext5,
|
|
4438
|
-
useEffect as
|
|
4440
|
+
useEffect as useEffect13,
|
|
4439
4441
|
useState as useState8
|
|
4440
4442
|
} from "react";
|
|
4441
4443
|
import { jsx as jsx209 } from "react/jsx-runtime";
|
|
@@ -4452,7 +4454,7 @@ function OverflowMenuContextProvider({
|
|
|
4452
4454
|
[]
|
|
4453
4455
|
);
|
|
4454
4456
|
const [focusIndex] = useRoveFocus(items.length, rest.isOpen);
|
|
4455
|
-
|
|
4457
|
+
useEffect13(() => {
|
|
4456
4458
|
var _a, _b;
|
|
4457
4459
|
(_b = (_a = items[focusIndex]) == null ? void 0 : _a.current) == null ? void 0 : _b.focus();
|
|
4458
4460
|
}, [focusIndex]);
|
|
@@ -4491,7 +4493,7 @@ var OverflowMenu = ({
|
|
|
4491
4493
|
...rest
|
|
4492
4494
|
}) => {
|
|
4493
4495
|
const { isOpen, floatStyling, setFloatOptions, menuRef, menuId } = useOverflowMenuContext();
|
|
4494
|
-
|
|
4496
|
+
useEffect14(() => {
|
|
4495
4497
|
setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
|
|
4496
4498
|
}, [placement, offset]);
|
|
4497
4499
|
const openCn = isOpen ? "open" : "closed";
|
|
@@ -4526,7 +4528,7 @@ var OverflowMenu = ({
|
|
|
4526
4528
|
OverflowMenu.displayName = "OverflowMenu";
|
|
4527
4529
|
|
|
4528
4530
|
// src/components/OverflowMenu/components/OverflowMenuButton.tsx
|
|
4529
|
-
import { useEffect as
|
|
4531
|
+
import { useEffect as useEffect15, useRef as useRef8, useState as useState9 } from "react";
|
|
4530
4532
|
import { jsx as jsx211 } from "react/jsx-runtime";
|
|
4531
4533
|
var OverflowMenuButton = ({
|
|
4532
4534
|
onClick,
|
|
@@ -4541,7 +4543,7 @@ var OverflowMenuButton = ({
|
|
|
4541
4543
|
const { onClose, registerItem, unregisterItem, focusedRef } = useOverflowMenuContext();
|
|
4542
4544
|
const [internalLoading, setInternalLoading] = useState9(false);
|
|
4543
4545
|
const isLoading = loading || internalLoading;
|
|
4544
|
-
|
|
4546
|
+
useEffect15(() => {
|
|
4545
4547
|
registerItem(itemRef);
|
|
4546
4548
|
return () => unregisterItem(itemRef);
|
|
4547
4549
|
}, []);
|
|
@@ -4577,7 +4579,7 @@ var OverflowMenuButton = ({
|
|
|
4577
4579
|
OverflowMenuButton.displayName = "OverflowMenuButton";
|
|
4578
4580
|
|
|
4579
4581
|
// src/components/OverflowMenu/components/OverflowMenuLink.tsx
|
|
4580
|
-
import { useEffect as
|
|
4582
|
+
import { useEffect as useEffect16, useRef as useRef9 } from "react";
|
|
4581
4583
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
4582
4584
|
var OverflowMenuLink = ({
|
|
4583
4585
|
onClick,
|
|
@@ -4587,7 +4589,7 @@ var OverflowMenuLink = ({
|
|
|
4587
4589
|
const itemRef = useRef9(null);
|
|
4588
4590
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
4589
4591
|
const { onClose, registerItem, unregisterItem, focusedRef } = useOverflowMenuContext();
|
|
4590
|
-
|
|
4592
|
+
useEffect16(() => {
|
|
4591
4593
|
registerItem(itemRef);
|
|
4592
4594
|
return () => unregisterItem(itemRef);
|
|
4593
4595
|
}, []);
|
|
@@ -4609,7 +4611,7 @@ var OverflowMenuLink = ({
|
|
|
4609
4611
|
OverflowMenuLink.displayName = "OverflowMenuLink";
|
|
4610
4612
|
|
|
4611
4613
|
// src/components/OverflowMenu/components/OverflowMenuToggle.tsx
|
|
4612
|
-
import { useEffect as
|
|
4614
|
+
import { useEffect as useEffect17, useRef as useRef10 } from "react";
|
|
4613
4615
|
|
|
4614
4616
|
// src/components/Toggle/Toggle.tsx
|
|
4615
4617
|
import {
|
|
@@ -4776,7 +4778,7 @@ var OverflowMenuToggle = ({
|
|
|
4776
4778
|
const itemRef = useRef10(null);
|
|
4777
4779
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
4778
4780
|
const { registerItem, unregisterItem, focusedRef } = useOverflowMenuContext();
|
|
4779
|
-
|
|
4781
|
+
useEffect17(() => {
|
|
4780
4782
|
registerItem(itemRef);
|
|
4781
4783
|
return () => unregisterItem(itemRef);
|
|
4782
4784
|
}, []);
|
|
@@ -6123,6 +6125,7 @@ import { useId as useId10, useState as useState12 } from "react";
|
|
|
6123
6125
|
|
|
6124
6126
|
// src/components/CookieBanner/CookieBanner.module.css
|
|
6125
6127
|
var CookieBanner_default = {
|
|
6128
|
+
container: "CookieBanner_container",
|
|
6126
6129
|
"checkbox-label": "CookieBanner_checkbox-label"
|
|
6127
6130
|
};
|
|
6128
6131
|
|
|
@@ -6172,9 +6175,12 @@ function CookieBanner({
|
|
|
6172
6175
|
width = "fit-content",
|
|
6173
6176
|
children,
|
|
6174
6177
|
collapsedBreakpoint,
|
|
6178
|
+
ref,
|
|
6175
6179
|
...rest
|
|
6176
6180
|
}) {
|
|
6177
6181
|
const { t } = useTranslation();
|
|
6182
|
+
const containerRef = useFocusTrap(true);
|
|
6183
|
+
const combinedRef = useCombinedRef(containerRef, ref);
|
|
6178
6184
|
const hasBp = !!collapsedBreakpoint;
|
|
6179
6185
|
const [isCollapsedOnBreakpoint, setIsCollapsedOnBreakpoint] = useState12(hasBp);
|
|
6180
6186
|
const generatedId = useId10();
|
|
@@ -6187,6 +6193,7 @@ function CookieBanner({
|
|
|
6187
6193
|
id,
|
|
6188
6194
|
cn(
|
|
6189
6195
|
className,
|
|
6196
|
+
CookieBanner_default.container,
|
|
6190
6197
|
utilStyles_default.scrollbar,
|
|
6191
6198
|
utilStyles_default["scrollable-y"],
|
|
6192
6199
|
typographyStyles_default["tertiary-medium"]
|
|
@@ -6195,6 +6202,7 @@ function CookieBanner({
|
|
|
6195
6202
|
htmlProps,
|
|
6196
6203
|
rest
|
|
6197
6204
|
),
|
|
6205
|
+
ref: combinedRef,
|
|
6198
6206
|
role: "region",
|
|
6199
6207
|
"aria-labelledby": headingId,
|
|
6200
6208
|
padding: styleUpToBreakpoint("x1", "sm", "x1.5"),
|
|
@@ -6405,7 +6413,7 @@ function isLeapYear(date) {
|
|
|
6405
6413
|
import {
|
|
6406
6414
|
createContext as createContext9,
|
|
6407
6415
|
useContext as useContext9,
|
|
6408
|
-
useEffect as
|
|
6416
|
+
useEffect as useEffect18,
|
|
6409
6417
|
useRef as useRef13
|
|
6410
6418
|
} from "react";
|
|
6411
6419
|
import { createPortal } from "react-dom";
|
|
@@ -6462,12 +6470,12 @@ var CalendarPopoverContent = ({
|
|
|
6462
6470
|
const isMounted = isOpen && hasTransitionedIn;
|
|
6463
6471
|
const combinedRef = useCombinedRef(refs.setFloating, ref);
|
|
6464
6472
|
useOnClickOutside([ref.current, modalRef.current], onClose);
|
|
6465
|
-
|
|
6473
|
+
useEffect18(() => {
|
|
6466
6474
|
var _a;
|
|
6467
6475
|
refs.setReference((_a = anchorRef == null ? void 0 : anchorRef.current) != null ? _a : null);
|
|
6468
6476
|
}, []);
|
|
6469
6477
|
const hasBreakpoint = !!smallScreenBreakpoint;
|
|
6470
|
-
|
|
6478
|
+
useEffect18(() => {
|
|
6471
6479
|
var _a;
|
|
6472
6480
|
if (hasBreakpoint && ((_a = modalRef.current) == null ? void 0 : _a.checkVisibility())) {
|
|
6473
6481
|
if (isOpen) {
|
|
@@ -7700,7 +7708,7 @@ DetailListTerm.displayName = "DetailListTerm";
|
|
|
7700
7708
|
// src/components/Drawer/Drawer.tsx
|
|
7701
7709
|
import {
|
|
7702
7710
|
useContext as useContext15,
|
|
7703
|
-
useEffect as
|
|
7711
|
+
useEffect as useEffect19,
|
|
7704
7712
|
useRef as useRef20
|
|
7705
7713
|
} from "react";
|
|
7706
7714
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -7754,7 +7762,7 @@ var Drawer = ({
|
|
|
7754
7762
|
const headerId = hasHeader ? `${drawerId}-header` : void 0;
|
|
7755
7763
|
const drawerRef = useFocusTrap(isOpen);
|
|
7756
7764
|
const combinedRef = useCombinedRef(ref, drawerRef);
|
|
7757
|
-
|
|
7765
|
+
useEffect19(() => {
|
|
7758
7766
|
if (withBackdrop) {
|
|
7759
7767
|
if (isOpen) {
|
|
7760
7768
|
handleElementWithBackdropMount(document.body);
|
|
@@ -8175,7 +8183,7 @@ var texts11 = createTexts({
|
|
|
8175
8183
|
});
|
|
8176
8184
|
|
|
8177
8185
|
// src/components/Feedback/Feedback.tsx
|
|
8178
|
-
import { useEffect as
|
|
8186
|
+
import { useEffect as useEffect22, useState as useState16 } from "react";
|
|
8179
8187
|
|
|
8180
8188
|
// src/components/Feedback/Feedback.module.css
|
|
8181
8189
|
var Feedback_default = {
|
|
@@ -8190,7 +8198,7 @@ var Feedback_default = {
|
|
|
8190
8198
|
|
|
8191
8199
|
// src/components/TextArea/TextArea.tsx
|
|
8192
8200
|
import {
|
|
8193
|
-
useEffect as
|
|
8201
|
+
useEffect as useEffect20,
|
|
8194
8202
|
useId as useId16,
|
|
8195
8203
|
useRef as useRef22,
|
|
8196
8204
|
useState as useState14
|
|
@@ -8276,7 +8284,7 @@ var TextArea = ({
|
|
|
8276
8284
|
const textAreaRef = useRef22(null);
|
|
8277
8285
|
const multiRef = useCombinedRef(ref, textAreaRef);
|
|
8278
8286
|
const [text, setText] = useState14(getDefaultText(value, defaultValue));
|
|
8279
|
-
|
|
8287
|
+
useEffect20(() => {
|
|
8280
8288
|
if (textAreaRef == null ? void 0 : textAreaRef.current) {
|
|
8281
8289
|
const el = textAreaRef.current;
|
|
8282
8290
|
el.style.height = "auto";
|
|
@@ -8423,7 +8431,7 @@ var texts13 = createTexts({
|
|
|
8423
8431
|
import {
|
|
8424
8432
|
Children as ReactChildren3,
|
|
8425
8433
|
cloneElement as cloneElement3,
|
|
8426
|
-
useEffect as
|
|
8434
|
+
useEffect as useEffect21,
|
|
8427
8435
|
useId as useId17,
|
|
8428
8436
|
useRef as useRef23,
|
|
8429
8437
|
useState as useState15
|
|
@@ -8468,7 +8476,7 @@ var Tooltip = ({
|
|
|
8468
8476
|
setInView(true);
|
|
8469
8477
|
} else setInView(false);
|
|
8470
8478
|
};
|
|
8471
|
-
|
|
8479
|
+
useEffect21(() => {
|
|
8472
8480
|
if (keepMounted) {
|
|
8473
8481
|
const options = {
|
|
8474
8482
|
root: null,
|
|
@@ -8482,7 +8490,7 @@ var Tooltip = ({
|
|
|
8482
8490
|
};
|
|
8483
8491
|
}
|
|
8484
8492
|
}, [tooltipRef]);
|
|
8485
|
-
|
|
8493
|
+
useEffect21(() => {
|
|
8486
8494
|
if (tooltipRef.current) {
|
|
8487
8495
|
window.addEventListener("scroll", () => {
|
|
8488
8496
|
closeTooltip();
|
|
@@ -8495,7 +8503,7 @@ var Tooltip = ({
|
|
|
8495
8503
|
};
|
|
8496
8504
|
}, []);
|
|
8497
8505
|
let timer;
|
|
8498
|
-
|
|
8506
|
+
useEffect21(() => {
|
|
8499
8507
|
return () => {
|
|
8500
8508
|
clearTimeout(timer);
|
|
8501
8509
|
};
|
|
@@ -8644,13 +8652,13 @@ var Feedback = ({
|
|
|
8644
8652
|
const tTextAreaTip = textAreaTip != null ? textAreaTip : t(texts15.sensitiveInfo);
|
|
8645
8653
|
const tThumbUpTooltip = thumbUpTooltip != null ? thumbUpTooltip : t(texts15.good);
|
|
8646
8654
|
const tThumbDownTooltip = thumbDownTooltip != null ? thumbDownTooltip : t(texts15.bad);
|
|
8647
|
-
|
|
8655
|
+
useEffect22(() => {
|
|
8648
8656
|
if (ratingProp !== void 0) setRating(ratingProp);
|
|
8649
8657
|
}, [ratingProp]);
|
|
8650
|
-
|
|
8658
|
+
useEffect22(() => {
|
|
8651
8659
|
if (feedbackTextProp !== void 0) setFeedbackText(feedbackTextProp);
|
|
8652
8660
|
}, [feedbackTextProp]);
|
|
8653
|
-
|
|
8661
|
+
useEffect22(() => {
|
|
8654
8662
|
if (isSubmittedProp !== void 0) setIsFeedbackSubmitted(isSubmittedProp);
|
|
8655
8663
|
}, [isSubmittedProp]);
|
|
8656
8664
|
const handleRatingChange = (newRating) => {
|
|
@@ -8801,7 +8809,7 @@ var ErrorList = (props) => {
|
|
|
8801
8809
|
};
|
|
8802
8810
|
|
|
8803
8811
|
// src/components/FileUploader/File.tsx
|
|
8804
|
-
import { useEffect as
|
|
8812
|
+
import { useEffect as useEffect23, useState as useState17 } from "react";
|
|
8805
8813
|
|
|
8806
8814
|
// src/components/FileUploader/FileUploader.module.css
|
|
8807
8815
|
var FileUploader_default = {
|
|
@@ -8833,7 +8841,7 @@ var File2 = (props) => {
|
|
|
8833
8841
|
fileId
|
|
8834
8842
|
} = props;
|
|
8835
8843
|
const [fileUrl, setFileUrl] = useState17();
|
|
8836
|
-
|
|
8844
|
+
useEffect23(() => {
|
|
8837
8845
|
if (stateFile.url) {
|
|
8838
8846
|
setFileUrl(stateFile.url);
|
|
8839
8847
|
} else if (stateFile.file) {
|
|
@@ -8979,7 +8987,7 @@ var texts16 = createTexts({
|
|
|
8979
8987
|
import {
|
|
8980
8988
|
fromEvent as getFilesFromEvent
|
|
8981
8989
|
} from "file-selector";
|
|
8982
|
-
import { useCallback as useCallback6, useEffect as
|
|
8990
|
+
import { useCallback as useCallback6, useEffect as useEffect24, useMemo, useReducer, useRef as useRef24 } from "react";
|
|
8983
8991
|
|
|
8984
8992
|
// src/components/FileUploader/fileUploaderReducer.ts
|
|
8985
8993
|
var fileUploaderReducer = (state, action) => {
|
|
@@ -9112,7 +9120,7 @@ var useFileUploader = (props) => {
|
|
|
9112
9120
|
)
|
|
9113
9121
|
});
|
|
9114
9122
|
const { files: stateFiles } = state;
|
|
9115
|
-
|
|
9123
|
+
useEffect24(() => {
|
|
9116
9124
|
if (isControlled) {
|
|
9117
9125
|
const files = value.map((file) => {
|
|
9118
9126
|
if (file instanceof File) {
|
|
@@ -9135,7 +9143,7 @@ var useFileUploader = (props) => {
|
|
|
9135
9143
|
});
|
|
9136
9144
|
}
|
|
9137
9145
|
}, [value, isControlled, accept, dispatch]);
|
|
9138
|
-
|
|
9146
|
+
useEffect24(() => {
|
|
9139
9147
|
dispatch({
|
|
9140
9148
|
type: "setRootErrors",
|
|
9141
9149
|
payload: calcRootErrors(
|
|
@@ -10492,7 +10500,7 @@ LocalMessage.displayName = "LocalMessage";
|
|
|
10492
10500
|
// src/components/Modal/Modal.tsx
|
|
10493
10501
|
import {
|
|
10494
10502
|
useContext as useContext17,
|
|
10495
|
-
useEffect as
|
|
10503
|
+
useEffect as useEffect25,
|
|
10496
10504
|
useId as useId20,
|
|
10497
10505
|
useRef as useRef29
|
|
10498
10506
|
} from "react";
|
|
@@ -10544,7 +10552,7 @@ var Modal = ({
|
|
|
10544
10552
|
}
|
|
10545
10553
|
const { t } = useTranslation();
|
|
10546
10554
|
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
10547
|
-
|
|
10555
|
+
useEffect25(() => {
|
|
10548
10556
|
if (isOpen) {
|
|
10549
10557
|
handleElementWithBackdropMount(document.body);
|
|
10550
10558
|
} else {
|
|
@@ -11281,7 +11289,7 @@ function Select({
|
|
|
11281
11289
|
Select.displayName = "Select";
|
|
11282
11290
|
|
|
11283
11291
|
// src/components/Select/NativeSelect/NativeSelect.tsx
|
|
11284
|
-
import { useEffect as
|
|
11292
|
+
import { useEffect as useEffect26, useId as useId22, useRef as useRef30, useState as useState22 } from "react";
|
|
11285
11293
|
|
|
11286
11294
|
// src/components/Select/NativeSelect/NativeSelect.module.css
|
|
11287
11295
|
var NativeSelect_default = {
|
|
@@ -11329,12 +11337,12 @@ var NativeSelect = ({
|
|
|
11329
11337
|
const { t } = useTranslation();
|
|
11330
11338
|
const selectRef = useRef30(null);
|
|
11331
11339
|
const [hasValue, setHasValue] = useState22(false);
|
|
11332
|
-
|
|
11340
|
+
useEffect26(() => {
|
|
11333
11341
|
var _a, _b;
|
|
11334
11342
|
const selectedIndex = (_b = (_a = selectRef.current) == null ? void 0 : _a.selectedIndex) != null ? _b : -1;
|
|
11335
11343
|
setHasValue(selectedIndex !== 0);
|
|
11336
11344
|
}, []);
|
|
11337
|
-
|
|
11345
|
+
useEffect26(() => {
|
|
11338
11346
|
var _a;
|
|
11339
11347
|
if (clearable) {
|
|
11340
11348
|
const firstOption = (_a = selectRef.current) == null ? void 0 : _a.options[0];
|
|
@@ -11828,9 +11836,9 @@ var texts22 = createTexts({
|
|
|
11828
11836
|
|
|
11829
11837
|
// src/components/PhoneInput/PhoneInput.tsx
|
|
11830
11838
|
import {
|
|
11831
|
-
useEffect as
|
|
11839
|
+
useEffect as useEffect27,
|
|
11832
11840
|
useId as useId23,
|
|
11833
|
-
useLayoutEffect as
|
|
11841
|
+
useLayoutEffect as useLayoutEffect3,
|
|
11834
11842
|
useRef as useRef31,
|
|
11835
11843
|
useState as useState24
|
|
11836
11844
|
} from "react";
|
|
@@ -12316,7 +12324,7 @@ var PhoneInput = ({
|
|
|
12316
12324
|
const isControlled = value !== void 0;
|
|
12317
12325
|
const [callingCodeWidth, setCallingCodeWidth] = useState24(0);
|
|
12318
12326
|
const callingCodeRef = useRef31(null);
|
|
12319
|
-
|
|
12327
|
+
useLayoutEffect3(() => {
|
|
12320
12328
|
if (callingCodeRef.current) {
|
|
12321
12329
|
setCallingCodeWidth(callingCodeRef.current.offsetWidth);
|
|
12322
12330
|
}
|
|
@@ -12325,7 +12333,7 @@ var PhoneInput = ({
|
|
|
12325
12333
|
const internalSelectRef = useRef31(null);
|
|
12326
12334
|
const combinedSelectRef = useCombinedRef(selectRef, internalSelectRef);
|
|
12327
12335
|
const displayedValue = isControlled ? value : internalValue;
|
|
12328
|
-
|
|
12336
|
+
useEffect27(() => {
|
|
12329
12337
|
const selectEl = internalSelectRef.current;
|
|
12330
12338
|
if (selectEl && selectEl.value) {
|
|
12331
12339
|
const { options, selectedIndex } = selectEl;
|
|
@@ -12488,7 +12496,7 @@ var texts23 = createTexts({
|
|
|
12488
12496
|
// src/components/Popover/Popover.tsx
|
|
12489
12497
|
import {
|
|
12490
12498
|
useContext as useContext20,
|
|
12491
|
-
useEffect as
|
|
12499
|
+
useEffect as useEffect28,
|
|
12492
12500
|
useId as useId24
|
|
12493
12501
|
} from "react";
|
|
12494
12502
|
import { createPortal as createPortal4 } from "react-dom";
|
|
@@ -12588,7 +12596,7 @@ var Popover = ({
|
|
|
12588
12596
|
anchorEl && anchorEl
|
|
12589
12597
|
);
|
|
12590
12598
|
const multiRef = useCombinedRef(ref, popoverRef, floatingRef);
|
|
12591
|
-
|
|
12599
|
+
useEffect28(() => {
|
|
12592
12600
|
setFloatOptions == null ? void 0 : setFloatOptions({ placement, offset });
|
|
12593
12601
|
}, [placement, offset]);
|
|
12594
12602
|
useOnClickOutside([popoverRef.current, anchorEl], () => {
|
|
@@ -12749,7 +12757,7 @@ import {
|
|
|
12749
12757
|
Children as Children3,
|
|
12750
12758
|
cloneElement as cloneElement5,
|
|
12751
12759
|
isValidElement as isValidElement5,
|
|
12752
|
-
useEffect as
|
|
12760
|
+
useEffect as useEffect29,
|
|
12753
12761
|
useMemo as useMemo3,
|
|
12754
12762
|
useState as useState26
|
|
12755
12763
|
} from "react";
|
|
@@ -12960,7 +12968,7 @@ var ProgressTracker = (() => {
|
|
|
12960
12968
|
setActiveStep(step);
|
|
12961
12969
|
onStepChange == null ? void 0 : onStepChange(step);
|
|
12962
12970
|
};
|
|
12963
|
-
|
|
12971
|
+
useEffect29(() => {
|
|
12964
12972
|
if (activeStep !== void 0 && activeStep != thisActiveStep) {
|
|
12965
12973
|
setActiveStep(activeStep);
|
|
12966
12974
|
}
|
|
@@ -13140,7 +13148,7 @@ var Search_default = {
|
|
|
13140
13148
|
};
|
|
13141
13149
|
|
|
13142
13150
|
// src/components/Search/SearchSuggestionItem.tsx
|
|
13143
|
-
import { useEffect as
|
|
13151
|
+
import { useEffect as useEffect30, useRef as useRef33 } from "react";
|
|
13144
13152
|
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
13145
13153
|
var SearchSuggestionItem = ({
|
|
13146
13154
|
focus,
|
|
@@ -13149,7 +13157,7 @@ var SearchSuggestionItem = ({
|
|
|
13149
13157
|
}) => {
|
|
13150
13158
|
const itemRef = useRef33(null);
|
|
13151
13159
|
const combinedRef = useCombinedRef(ref, itemRef);
|
|
13152
|
-
|
|
13160
|
+
useEffect30(() => {
|
|
13153
13161
|
var _a;
|
|
13154
13162
|
if (focus) {
|
|
13155
13163
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
@@ -13438,7 +13446,7 @@ var texts27 = createTexts({
|
|
|
13438
13446
|
|
|
13439
13447
|
// src/components/Search/SearchAutocompleteWrapper.tsx
|
|
13440
13448
|
import {
|
|
13441
|
-
useEffect as
|
|
13449
|
+
useEffect as useEffect31,
|
|
13442
13450
|
useRef as useRef34,
|
|
13443
13451
|
useState as useState28
|
|
13444
13452
|
} from "react";
|
|
@@ -13458,7 +13466,7 @@ var SearchAutocompleteWrapper = (props) => {
|
|
|
13458
13466
|
const [showSuggestions, setShowSuggestions] = useState28(false);
|
|
13459
13467
|
const closeSuggestions = () => showSuggestions === true && setShowSuggestions(false);
|
|
13460
13468
|
const openSuggestions = () => showSuggestions === false && setShowSuggestions(true);
|
|
13461
|
-
|
|
13469
|
+
useEffect31(() => {
|
|
13462
13470
|
if (suggestions.length > 0) {
|
|
13463
13471
|
openSuggestions();
|
|
13464
13472
|
} else {
|
|
@@ -13665,7 +13673,7 @@ import {
|
|
|
13665
13673
|
Fragment as Fragment13,
|
|
13666
13674
|
cloneElement as cloneElement6,
|
|
13667
13675
|
isValidElement as isValidElement6,
|
|
13668
|
-
useEffect as
|
|
13676
|
+
useEffect as useEffect33,
|
|
13669
13677
|
useState as useState31
|
|
13670
13678
|
} from "react";
|
|
13671
13679
|
|
|
@@ -13881,7 +13889,7 @@ Table.displayName = "Table";
|
|
|
13881
13889
|
// src/components/Table/normal/TableWrapper.tsx
|
|
13882
13890
|
import {
|
|
13883
13891
|
useContext as useContext25,
|
|
13884
|
-
useEffect as
|
|
13892
|
+
useEffect as useEffect32,
|
|
13885
13893
|
useRef as useRef35,
|
|
13886
13894
|
useState as useState30
|
|
13887
13895
|
} from "react";
|
|
@@ -13896,14 +13904,14 @@ var TableWrapper = ({ className, ...rest }) => {
|
|
|
13896
13904
|
return event.offsetWidth < event.scrollWidth;
|
|
13897
13905
|
}
|
|
13898
13906
|
const wrapperRef = useRef35(null);
|
|
13899
|
-
|
|
13907
|
+
useEffect32(() => {
|
|
13900
13908
|
if ((wrapperRef == null ? void 0 : wrapperRef.current) && isOverflowingX(wrapperRef.current)) {
|
|
13901
13909
|
setOverflowX(true);
|
|
13902
13910
|
return;
|
|
13903
13911
|
}
|
|
13904
13912
|
setOverflowX(false);
|
|
13905
13913
|
}, [themeContainerWidth]);
|
|
13906
|
-
|
|
13914
|
+
useEffect32(() => {
|
|
13907
13915
|
function handleResize() {
|
|
13908
13916
|
setThemeContainerWidth(containerWidth);
|
|
13909
13917
|
}
|
|
@@ -13953,7 +13961,7 @@ var CollapsibleRow = ({
|
|
|
13953
13961
|
const type = _type != null ? _type : isInHead ? "head" : "body";
|
|
13954
13962
|
const { isCollapsed, headerValues, definingColumnIndex } = useCollapsibleTableContext();
|
|
13955
13963
|
const [childrenCollapsed, setChildrenCollapsed] = useState31(true);
|
|
13956
|
-
|
|
13964
|
+
useEffect33(() => {
|
|
13957
13965
|
if (!isCollapsed) setChildrenCollapsed(true);
|
|
13958
13966
|
}, [isCollapsed]);
|
|
13959
13967
|
const rowProps = (isOpenCollapsibleHeader) => {
|
|
@@ -14116,7 +14124,7 @@ var Tabs_default = {
|
|
|
14116
14124
|
import {
|
|
14117
14125
|
createContext as createContext19,
|
|
14118
14126
|
useContext as useContext27,
|
|
14119
|
-
useLayoutEffect as
|
|
14127
|
+
useLayoutEffect as useLayoutEffect4
|
|
14120
14128
|
} from "react";
|
|
14121
14129
|
import { jsx as jsx331 } from "react/jsx-runtime";
|
|
14122
14130
|
var TabContext = createContext19(null);
|
|
@@ -14149,7 +14157,7 @@ function TabWidthContextProvider({
|
|
|
14149
14157
|
}
|
|
14150
14158
|
function useSetTabWidth(index, width) {
|
|
14151
14159
|
const context = useContext27(TabContext);
|
|
14152
|
-
|
|
14160
|
+
useLayoutEffect4(() => {
|
|
14153
14161
|
context == null ? void 0 : context.updateWidth(index, width);
|
|
14154
14162
|
return () => context == null ? void 0 : context.removeTab(index);
|
|
14155
14163
|
}, [index, width]);
|
|
@@ -14191,7 +14199,7 @@ var AddTabButton = ({
|
|
|
14191
14199
|
AddTabButton.displayName = "AddTabButton";
|
|
14192
14200
|
|
|
14193
14201
|
// src/components/Tabs/Tabs.tsx
|
|
14194
|
-
import { useEffect as
|
|
14202
|
+
import { useEffect as useEffect34, useId as useId28, useRef as useRef37, useState as useState32 } from "react";
|
|
14195
14203
|
import { jsx as jsx333 } from "react/jsx-runtime";
|
|
14196
14204
|
var TABS_SIZES = createSizes("small", "medium");
|
|
14197
14205
|
var Tabs = ({
|
|
@@ -14218,7 +14226,7 @@ var Tabs = ({
|
|
|
14218
14226
|
setActiveTab(index);
|
|
14219
14227
|
onChange == null ? void 0 : onChange(index);
|
|
14220
14228
|
};
|
|
14221
|
-
|
|
14229
|
+
useEffect34(() => {
|
|
14222
14230
|
if (activeTab !== void 0 && activeTab !== thisActiveTab) {
|
|
14223
14231
|
setActiveTab(activeTab);
|
|
14224
14232
|
}
|
|
@@ -14254,7 +14262,7 @@ Tabs.displayName = "Tabs";
|
|
|
14254
14262
|
// src/components/Tabs/Tab.tsx
|
|
14255
14263
|
import {
|
|
14256
14264
|
useCallback as useCallback8,
|
|
14257
|
-
useEffect as
|
|
14265
|
+
useEffect as useEffect35,
|
|
14258
14266
|
useRef as useRef38
|
|
14259
14267
|
} from "react";
|
|
14260
14268
|
import { jsx as jsx334, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
@@ -14281,7 +14289,7 @@ var Tab = ({
|
|
|
14281
14289
|
const { tabContentDirection, size: size2 } = useTabsContext();
|
|
14282
14290
|
const { type = "button", ...restHtmlProps } = htmlProps;
|
|
14283
14291
|
const fixedHtmlProps = { type, ...restHtmlProps };
|
|
14284
|
-
|
|
14292
|
+
useEffect35(() => {
|
|
14285
14293
|
var _a;
|
|
14286
14294
|
if (focus) {
|
|
14287
14295
|
(_a = itemRef.current) == null ? void 0 : _a.focus();
|
|
@@ -14550,7 +14558,7 @@ var Tag = ({
|
|
|
14550
14558
|
Tag.displayName = "Tag";
|
|
14551
14559
|
|
|
14552
14560
|
// src/components/TextInput/TextInput.tsx
|
|
14553
|
-
import { useId as useId29, useLayoutEffect as
|
|
14561
|
+
import { useId as useId29, useLayoutEffect as useLayoutEffect5, useRef as useRef39, useState as useState34 } from "react";
|
|
14554
14562
|
|
|
14555
14563
|
// src/components/TextInput/TextInput.module.css
|
|
14556
14564
|
var TextInput_default = {
|
|
@@ -14598,7 +14606,7 @@ var TextInput = ({
|
|
|
14598
14606
|
const suffixRef = useRef39(null);
|
|
14599
14607
|
const [prefixLength, setPrefixLength] = useState34(0);
|
|
14600
14608
|
const [suffixLength, setSuffixLength] = useState34(0);
|
|
14601
|
-
|
|
14609
|
+
useLayoutEffect5(() => {
|
|
14602
14610
|
requestAnimationFrame(() => {
|
|
14603
14611
|
if (prefixRef.current) {
|
|
14604
14612
|
setPrefixLength(prefixRef.current.offsetWidth);
|