@navikt/ds-react 6.8.0 → 6.9.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/cjs/chat/Bubble.d.ts +4 -4
- package/cjs/chat/Chat.d.ts +6 -4
- package/cjs/chat/Chat.js +1 -1
- package/cjs/chat/Chat.js.map +1 -1
- package/cjs/date/monthpicker/MonthButton.js +2 -2
- package/cjs/date/monthpicker/MonthButton.js.map +1 -1
- package/cjs/date/utils/check-dates.d.ts +1 -1
- package/cjs/date/utils/check-dates.js +1 -1
- package/cjs/date/utils/check-dates.js.map +1 -1
- package/cjs/date/utils/dates-disabled.js +1 -1
- package/cjs/date/utils/dates-disabled.js.map +1 -1
- package/cjs/date/utils/navigation.d.ts +1 -1
- package/cjs/date/utils/navigation.js +1 -1
- package/cjs/date/utils/navigation.js.map +1 -1
- package/cjs/date/utils/parse-date.js +7 -11
- package/cjs/date/utils/parse-date.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +17 -4
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js +1 -3
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
- package/cjs/form/combobox/combobox-utils.js +1 -3
- package/cjs/form/combobox/combobox-utils.js.map +1 -1
- package/cjs/form/file-upload/parts/item/ItemIcon.js +1 -1
- package/cjs/form/file-upload/parts/item/ItemIcon.js.map +1 -1
- package/cjs/form/file-upload/utils/is-accepted-file-type.js +1 -1
- package/cjs/form/file-upload/utils/is-accepted-file-type.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/bleed/Bleed.d.ts +8 -4
- package/cjs/layout/bleed/Bleed.js.map +1 -1
- package/cjs/layout/box/Box.d.ts +16 -4
- package/cjs/layout/box/Box.js.map +1 -1
- package/cjs/layout/grid/HGrid.d.ts +7 -3
- package/cjs/layout/grid/HGrid.js.map +1 -1
- package/cjs/layout/stack/Stack.d.ts +3 -1
- package/cjs/layout/stack/Stack.js.map +1 -1
- package/cjs/layout/utilities/css.js +1 -1
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/list/List.d.ts +15 -3
- package/cjs/list/List.js +15 -0
- package/cjs/list/List.js.map +1 -1
- package/cjs/list/ListItem.d.ts +4 -11
- package/cjs/list/ListItem.js +3 -0
- package/cjs/list/ListItem.js.map +1 -1
- package/cjs/list/index.d.ts +2 -2
- package/cjs/list/index.js.map +1 -1
- package/cjs/list/types.d.ts +19 -5
- package/cjs/modal/Modal.js +4 -1
- package/cjs/modal/Modal.js.map +1 -1
- package/cjs/modal/dialog-polyfill.js +4 -1
- package/cjs/modal/dialog-polyfill.js.map +1 -1
- package/cjs/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.d.ts +6 -0
- package/cjs/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.js +36 -14
- package/cjs/overlays/dismissablelayer/DismissableLayer.js.map +1 -0
- package/{esm/overlay/dismiss → cjs/overlays/dismissablelayer}/util/dispatchCustomEvent.d.ts +1 -1
- package/cjs/overlays/dismissablelayer/util/dispatchCustomEvent.js.map +1 -0
- package/cjs/overlays/dismissablelayer/util/useEscapeKeydown.js.map +1 -0
- package/cjs/overlays/dismissablelayer/util/useFocusOutside.js.map +1 -0
- package/cjs/overlays/dismissablelayer/util/usePointerDownOutside.js.map +1 -0
- package/cjs/pagination/Pagination.js +1 -1
- package/cjs/pagination/Pagination.js.map +1 -1
- package/cjs/popover/Popover.js +1 -1
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/stepper/Step.d.ts +0 -5
- package/cjs/stepper/Step.js +8 -13
- package/cjs/stepper/Step.js.map +1 -1
- package/cjs/stepper/Stepper.js +12 -22
- package/cjs/stepper/Stepper.js.map +1 -1
- package/cjs/stepper/context.d.ts +6 -3
- package/cjs/stepper/context.js +9 -3
- package/cjs/stepper/context.js.map +1 -1
- package/cjs/table/AnimateHeight.js +1 -1
- package/cjs/table/AnimateHeight.js.map +1 -1
- package/cjs/tabs/parts/tablist/useScrollButtons.js +1 -1
- package/cjs/tabs/parts/tablist/useScrollButtons.js.map +1 -1
- package/cjs/timeline/AxisLabels.js +2 -4
- package/cjs/timeline/AxisLabels.js.map +1 -1
- package/cjs/util/debounce.js.map +1 -1
- package/cjs/util/hooks/descendants/utils.js +1 -3
- package/cjs/util/hooks/descendants/utils.js.map +1 -1
- package/cjs/util/omit.js +2 -3
- package/cjs/util/omit.js.map +1 -1
- package/esm/chat/Bubble.d.ts +4 -4
- package/esm/chat/Chat.d.ts +6 -4
- package/esm/chat/Chat.js +1 -1
- package/esm/chat/Chat.js.map +1 -1
- package/esm/date/monthpicker/MonthButton.js +2 -2
- package/esm/date/monthpicker/MonthButton.js.map +1 -1
- package/esm/date/utils/check-dates.d.ts +1 -1
- package/esm/date/utils/check-dates.js +1 -1
- package/esm/date/utils/check-dates.js.map +1 -1
- package/esm/date/utils/dates-disabled.js +1 -1
- package/esm/date/utils/dates-disabled.js.map +1 -1
- package/esm/date/utils/navigation.d.ts +1 -1
- package/esm/date/utils/navigation.js +1 -1
- package/esm/date/utils/navigation.js.map +1 -1
- package/esm/date/utils/parse-date.js +7 -11
- package/esm/date/utils/parse-date.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +17 -4
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.js +1 -3
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
- package/esm/form/combobox/combobox-utils.js +1 -3
- package/esm/form/combobox/combobox-utils.js.map +1 -1
- package/esm/form/file-upload/parts/item/ItemIcon.js +1 -1
- package/esm/form/file-upload/parts/item/ItemIcon.js.map +1 -1
- package/esm/form/file-upload/utils/is-accepted-file-type.js +1 -1
- package/esm/form/file-upload/utils/is-accepted-file-type.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js.map +1 -1
- package/esm/layout/bleed/Bleed.d.ts +8 -4
- package/esm/layout/bleed/Bleed.js.map +1 -1
- package/esm/layout/box/Box.d.ts +16 -4
- package/esm/layout/box/Box.js.map +1 -1
- package/esm/layout/grid/HGrid.d.ts +7 -3
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/stack/Stack.d.ts +3 -1
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/layout/utilities/css.js +1 -1
- package/esm/layout/utilities/css.js.map +1 -1
- package/esm/list/List.d.ts +15 -3
- package/esm/list/List.js +15 -0
- package/esm/list/List.js.map +1 -1
- package/esm/list/ListItem.d.ts +4 -11
- package/esm/list/ListItem.js +3 -0
- package/esm/list/ListItem.js.map +1 -1
- package/esm/list/index.d.ts +2 -2
- package/esm/list/index.js.map +1 -1
- package/esm/list/types.d.ts +19 -5
- package/esm/modal/Modal.js +4 -1
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/dialog-polyfill.js +4 -1
- package/esm/modal/dialog-polyfill.js.map +1 -1
- package/esm/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.d.ts +6 -0
- package/esm/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.js +37 -15
- package/esm/overlays/dismissablelayer/DismissableLayer.js.map +1 -0
- package/{cjs/overlay/dismiss → esm/overlays/dismissablelayer}/util/dispatchCustomEvent.d.ts +1 -1
- package/esm/overlays/dismissablelayer/util/dispatchCustomEvent.js.map +1 -0
- package/esm/overlays/dismissablelayer/util/useEscapeKeydown.js.map +1 -0
- package/esm/overlays/dismissablelayer/util/useFocusOutside.js.map +1 -0
- package/esm/overlays/dismissablelayer/util/usePointerDownOutside.js.map +1 -0
- package/esm/pagination/Pagination.js +1 -1
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/popover/Popover.js +1 -1
- package/esm/popover/Popover.js.map +1 -1
- package/esm/stepper/Step.d.ts +0 -5
- package/esm/stepper/Step.js +10 -15
- package/esm/stepper/Step.js.map +1 -1
- package/esm/stepper/Stepper.js +13 -23
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/stepper/context.d.ts +6 -3
- package/esm/stepper/context.js +7 -2
- package/esm/stepper/context.js.map +1 -1
- package/esm/table/AnimateHeight.js +1 -1
- package/esm/table/AnimateHeight.js.map +1 -1
- package/esm/tabs/parts/tablist/useScrollButtons.js +1 -1
- package/esm/tabs/parts/tablist/useScrollButtons.js.map +1 -1
- package/esm/timeline/AxisLabels.js +2 -4
- package/esm/timeline/AxisLabels.js.map +1 -1
- package/esm/util/debounce.js.map +1 -1
- package/esm/util/hooks/descendants/utils.js +1 -3
- package/esm/util/hooks/descendants/utils.js.map +1 -1
- package/esm/util/omit.js +2 -3
- package/esm/util/omit.js.map +1 -1
- package/package.json +3 -3
- package/src/chat/Bubble.tsx +4 -4
- package/src/chat/Chat.tsx +6 -4
- package/src/date/monthpicker/MonthButton.tsx +6 -2
- package/src/date/utils/check-dates.ts +2 -2
- package/src/date/utils/dates-disabled.ts +3 -1
- package/src/date/utils/navigation.ts +3 -3
- package/src/date/utils/parse-date.ts +21 -15
- package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +23 -24
- package/src/form/combobox/FilteredOptions/useVirtualFocus.ts +2 -2
- package/src/form/combobox/combobox-utils.ts +5 -5
- package/src/form/file-upload/parts/item/ItemIcon.tsx +3 -1
- package/src/form/file-upload/utils/is-accepted-file-type.ts +4 -1
- package/src/index.ts +1 -1
- package/src/layout/bleed/Bleed.tsx +8 -4
- package/src/layout/box/Box.tsx +16 -4
- package/src/layout/grid/HGrid.tsx +7 -3
- package/src/layout/stack/Stack.tsx +5 -1
- package/src/layout/utilities/css.ts +3 -1
- package/src/list/List.tsx +15 -3
- package/src/list/ListItem.tsx +4 -15
- package/src/list/index.ts +2 -2
- package/src/list/types.ts +20 -5
- package/src/modal/Modal.tsx +6 -1
- package/src/modal/dialog-polyfill.ts +8 -2
- package/src/{overlay/dismiss → overlays/dismissablelayer}/DismissableLayer.tsx +40 -19
- package/src/{overlay/dismiss → overlays/dismissablelayer}/util/dispatchCustomEvent.ts +1 -1
- package/src/pagination/Pagination.tsx +1 -1
- package/src/popover/Popover.tsx +1 -1
- package/src/stepper/Step.tsx +24 -38
- package/src/stepper/Stepper.tsx +29 -35
- package/src/stepper/context.ts +11 -4
- package/src/table/AnimateHeight.tsx +1 -1
- package/src/tabs/parts/tablist/useScrollButtons.ts +2 -2
- package/src/timeline/AxisLabels.tsx +5 -3
- package/src/util/__tests__/omit.test.ts +36 -0
- package/src/util/debounce.ts +1 -1
- package/src/util/hooks/descendants/utils.ts +2 -2
- package/src/util/omit.ts +5 -9
- package/cjs/overlay/dismiss/DismissableLayer.js.map +0 -1
- package/cjs/overlay/dismiss/util/dispatchCustomEvent.js.map +0 -1
- package/cjs/overlay/dismiss/util/useEscapeKeydown.js.map +0 -1
- package/cjs/overlay/dismiss/util/useFocusOutside.js.map +0 -1
- package/cjs/overlay/dismiss/util/usePointerDownOutside.js.map +0 -1
- package/esm/overlay/dismiss/DismissableLayer.js.map +0 -1
- package/esm/overlay/dismiss/util/dispatchCustomEvent.js.map +0 -1
- package/esm/overlay/dismiss/util/useEscapeKeydown.js.map +0 -1
- package/esm/overlay/dismiss/util/useFocusOutside.js.map +0 -1
- package/esm/overlay/dismiss/util/usePointerDownOutside.js.map +0 -1
- /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/dispatchCustomEvent.js +0 -0
- /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.d.ts +0 -0
- /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.js +0 -0
- /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.d.ts +0 -0
- /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.js +0 -0
- /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.d.ts +0 -0
- /package/cjs/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.js +0 -0
- /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/dispatchCustomEvent.js +0 -0
- /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.d.ts +0 -0
- /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.js +0 -0
- /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.d.ts +0 -0
- /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.js +0 -0
- /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.d.ts +0 -0
- /package/esm/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.js +0 -0
- /package/src/{overlay → overlays/dismissablelayer}/README.md +0 -0
- /package/src/{overlay/dismiss → overlays/dismissablelayer}/util/useEscapeKeydown.ts +0 -0
- /package/src/{overlay/dismiss → overlays/dismissablelayer}/util/useFocusOutside.ts +0 -0
- /package/src/{overlay/dismiss → overlays/dismissablelayer}/util/usePointerDownOutside.ts +0 -0
package/src/list/types.ts
CHANGED
|
@@ -1,26 +1,41 @@
|
|
|
1
1
|
export interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
2
|
children: React.ReactNode;
|
|
3
3
|
/**
|
|
4
|
-
* HTML list element to render
|
|
4
|
+
* HTML list element to render.
|
|
5
5
|
* @default "ul"
|
|
6
6
|
*/
|
|
7
7
|
as?: "ul" | "ol";
|
|
8
8
|
/**
|
|
9
|
-
* List heading title
|
|
9
|
+
* List heading title.
|
|
10
10
|
*/
|
|
11
11
|
title?: string;
|
|
12
12
|
/**
|
|
13
|
-
* List heading description
|
|
13
|
+
* List heading description.
|
|
14
14
|
*/
|
|
15
15
|
description?: string;
|
|
16
16
|
/**
|
|
17
|
-
* Allows setting a different HTML h-tag
|
|
17
|
+
* Allows setting a different HTML h-tag.
|
|
18
18
|
* @default "h3"
|
|
19
19
|
*/
|
|
20
20
|
headingTag?: React.ElementType<any>;
|
|
21
21
|
/**
|
|
22
|
-
* Changes padding, height and font-size
|
|
22
|
+
* Changes padding, height and font-size.
|
|
23
23
|
* @default "medium"
|
|
24
24
|
*/
|
|
25
25
|
size?: "medium" | "small";
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
export interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
29
|
+
/**
|
|
30
|
+
* List item content.
|
|
31
|
+
*/
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* List item title.
|
|
35
|
+
*/
|
|
36
|
+
title?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Icon to be used instead of bullet (unordered lists only).
|
|
39
|
+
*/
|
|
40
|
+
icon?: React.ReactNode;
|
|
41
|
+
}
|
package/src/modal/Modal.tsx
CHANGED
|
@@ -21,6 +21,8 @@ import {
|
|
|
21
21
|
import dialogPolyfill, { needPolyfill } from "./dialog-polyfill";
|
|
22
22
|
import { ModalProps } from "./types";
|
|
23
23
|
|
|
24
|
+
const polyfillClassName = "navds-modal--polyfilled";
|
|
25
|
+
|
|
24
26
|
interface ModalComponent
|
|
25
27
|
extends React.ForwardRefExoticComponent<
|
|
26
28
|
ModalProps & React.RefAttributes<HTMLDialogElement>
|
|
@@ -115,6 +117,9 @@ export const Modal = forwardRef<HTMLDialogElement, ModalProps>(
|
|
|
115
117
|
// We check both to avoid activating polyfill twice when not using portal.
|
|
116
118
|
if (needPolyfill && modalRef.current && portalNode) {
|
|
117
119
|
dialogPolyfill.registerDialog(modalRef.current);
|
|
120
|
+
|
|
121
|
+
// Force-add the "polyfilled" class in case of SSR (needPolyfill will always be false on the server)
|
|
122
|
+
modalRef.current.classList.add(polyfillClassName);
|
|
118
123
|
}
|
|
119
124
|
// We set autofocus on the dialog element to prevent the default behavior where first focusable element gets focus when modal is opened.
|
|
120
125
|
// This is mainly to fix an edge case where having a Tooltip as the first focusable element would make it activate when you open the modal.
|
|
@@ -142,7 +147,7 @@ export const Modal = forwardRef<HTMLDialogElement, ModalProps>(
|
|
|
142
147
|
typeof width === "string" && ["small", "medium"].includes(width);
|
|
143
148
|
|
|
144
149
|
const mergedClassName = cl("navds-modal", className, {
|
|
145
|
-
|
|
150
|
+
polyfillClassName: needPolyfill,
|
|
146
151
|
"navds-modal--autowidth": !width,
|
|
147
152
|
[`navds-modal--${width}`]: isWidthPreset,
|
|
148
153
|
});
|
|
@@ -260,7 +260,7 @@ function dialogPolyfillInfo(dialog) {
|
|
|
260
260
|
removed ? this.downgradeModal() : this.maybeHideModal();
|
|
261
261
|
removed = false;
|
|
262
262
|
}.bind(this);
|
|
263
|
-
var timeout
|
|
263
|
+
var timeout: ReturnType<typeof setTimeout>;
|
|
264
264
|
var delayModel = function (ev) {
|
|
265
265
|
if (ev.target !== dialog) {
|
|
266
266
|
return;
|
|
@@ -631,12 +631,16 @@ dialogPolyfill.DialogManager = function () {
|
|
|
631
631
|
this.mo_ = new MutationObserver(function (records) {
|
|
632
632
|
var removed = [];
|
|
633
633
|
records.forEach(function (rec) {
|
|
634
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: Reduntant to type c in this scenario
|
|
634
635
|
for (var i = 0, c; (c = rec.removedNodes[i]); ++i) {
|
|
635
636
|
if (!(c instanceof Element)) {
|
|
636
637
|
continue;
|
|
637
|
-
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
if (c.localName === "dialog") {
|
|
638
641
|
removed.push(c);
|
|
639
642
|
}
|
|
643
|
+
|
|
640
644
|
removed = removed.concat(c.querySelectorAll("dialog"));
|
|
641
645
|
}
|
|
642
646
|
});
|
|
@@ -675,6 +679,7 @@ dialogPolyfill.DialogManager.prototype.unblockDocument = function () {
|
|
|
675
679
|
dialogPolyfill.DialogManager.prototype.updateStacking = function () {
|
|
676
680
|
var zIndex = this.zIndexHigh_;
|
|
677
681
|
|
|
682
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: Reduntant to type dpi in this scenario
|
|
678
683
|
for (var i = 0, dpi; (dpi = this.pendingDialogStack[i]); ++i) {
|
|
679
684
|
dpi.updateZIndex(--zIndex, --zIndex);
|
|
680
685
|
if (i === 0) {
|
|
@@ -700,6 +705,7 @@ dialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function (
|
|
|
700
705
|
candidate,
|
|
701
706
|
) {
|
|
702
707
|
while ((candidate = findNearestDialog(candidate))) {
|
|
708
|
+
// biome-ignore lint/suspicious/noImplicitAnyLet: Reduntant to type dpi in this scenario
|
|
703
709
|
for (var i = 0, dpi; (dpi = this.pendingDialogStack[i]); ++i) {
|
|
704
710
|
if (dpi.dialog === candidate) {
|
|
705
711
|
return i === 0; // only valid if top-most
|
|
@@ -2,7 +2,6 @@ import React, {
|
|
|
2
2
|
CSSProperties,
|
|
3
3
|
forwardRef,
|
|
4
4
|
useEffect,
|
|
5
|
-
useMemo,
|
|
6
5
|
useRef,
|
|
7
6
|
useState,
|
|
8
7
|
} from "react";
|
|
@@ -77,9 +76,13 @@ export const [
|
|
|
77
76
|
useDismissableDescendant,
|
|
78
77
|
] = createDescendantContext<
|
|
79
78
|
HTMLDivElement,
|
|
80
|
-
{ disableOutsidePointerEvents: boolean }
|
|
79
|
+
{ disableOutsidePointerEvents: boolean; forceUpdate: () => void }
|
|
81
80
|
>();
|
|
82
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Number of layers with `disableOutsidePointerEvents` set to `true` currently enabled.
|
|
84
|
+
*/
|
|
85
|
+
let bodyLockCount = 0;
|
|
83
86
|
let originalBodyPointerEvents: string;
|
|
84
87
|
|
|
85
88
|
const DismissableLayer = forwardRef<HTMLDivElement, DismissableLayerProps>(
|
|
@@ -133,9 +136,11 @@ const DismissableLayerNode = forwardRef<HTMLDivElement, DismissableLayerProps>(
|
|
|
133
136
|
}: DismissableLayerProps,
|
|
134
137
|
ref,
|
|
135
138
|
) => {
|
|
139
|
+
const [, setForce] = useState({});
|
|
136
140
|
const { register, index, descendants } = useDismissableDescendant({
|
|
137
141
|
disableOutsidePointerEvents,
|
|
138
142
|
disabled: !enabled,
|
|
143
|
+
forceUpdate: () => setForce({}),
|
|
139
144
|
});
|
|
140
145
|
|
|
141
146
|
/**
|
|
@@ -162,10 +167,11 @@ const DismissableLayerNode = forwardRef<HTMLDivElement, DismissableLayerProps>(
|
|
|
162
167
|
const hasInteractedOutsideRef = useRef(false);
|
|
163
168
|
const hasPointerDownOutsideRef = useRef(false);
|
|
164
169
|
|
|
165
|
-
const
|
|
170
|
+
const pointerState = (() => {
|
|
166
171
|
let lastIndex = -1;
|
|
167
172
|
|
|
168
173
|
const descendantNodes = descendants.enabledValues();
|
|
174
|
+
|
|
169
175
|
descendantNodes.forEach((obj, _index) => {
|
|
170
176
|
if (obj.disableOutsidePointerEvents) {
|
|
171
177
|
lastIndex = _index;
|
|
@@ -181,9 +187,12 @@ const DismissableLayerNode = forwardRef<HTMLDivElement, DismissableLayerProps>(
|
|
|
181
187
|
/**
|
|
182
188
|
* If we find a node with `disableOutsidePointerEvents` we want to disable pointer events on the body.
|
|
183
189
|
*/
|
|
184
|
-
isBodyPointerEventsDisabled:
|
|
190
|
+
isBodyPointerEventsDisabled: bodyLockCount > 0,
|
|
191
|
+
pointerStyle: (index >= lastIndex && bodyLockCount > 0
|
|
192
|
+
? "auto"
|
|
193
|
+
: undefined) as CSSProperties["pointerEvents"] | undefined,
|
|
185
194
|
};
|
|
186
|
-
}
|
|
195
|
+
})();
|
|
187
196
|
|
|
188
197
|
/**
|
|
189
198
|
* We want to prevent the Layer from closing when the trigger, anchor element, or its child elements are interacted with.
|
|
@@ -248,7 +257,7 @@ const DismissableLayerNode = forwardRef<HTMLDivElement, DismissableLayerProps>(
|
|
|
248
257
|
}
|
|
249
258
|
|
|
250
259
|
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
251
|
-
if (!
|
|
260
|
+
if (!pointerState.isPointerEventsEnabled || !enabled) {
|
|
252
261
|
return;
|
|
253
262
|
}
|
|
254
263
|
|
|
@@ -329,17 +338,33 @@ const DismissableLayerNode = forwardRef<HTMLDivElement, DismissableLayerProps>(
|
|
|
329
338
|
* we want to disable pointer events on the body when the first layer is opened.
|
|
330
339
|
*/
|
|
331
340
|
useEffect(() => {
|
|
332
|
-
if (!node || !
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
337
|
-
ownerDocument.body.style.pointerEvents = "none";
|
|
341
|
+
if (!node || !enabled || !disableOutsidePointerEvents) return;
|
|
338
342
|
|
|
343
|
+
if (bodyLockCount === 0) {
|
|
344
|
+
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
345
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
346
|
+
}
|
|
347
|
+
bodyLockCount++;
|
|
339
348
|
return () => {
|
|
340
|
-
|
|
349
|
+
if (bodyLockCount === 1) {
|
|
350
|
+
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
351
|
+
}
|
|
352
|
+
bodyLockCount--;
|
|
341
353
|
};
|
|
342
|
-
}, [
|
|
354
|
+
}, [
|
|
355
|
+
node,
|
|
356
|
+
ownerDocument,
|
|
357
|
+
disableOutsidePointerEvents,
|
|
358
|
+
descendants,
|
|
359
|
+
enabled,
|
|
360
|
+
]);
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* To make sure pointerEvents are enabled for all parents and siblings when the layer is removed from the DOM
|
|
364
|
+
*/
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
return () => descendants.values().forEach((x) => x.forceUpdate());
|
|
367
|
+
}, [descendants, node]);
|
|
343
368
|
|
|
344
369
|
const Comp = asChild ? Slot : "div";
|
|
345
370
|
|
|
@@ -351,11 +376,7 @@ const DismissableLayerNode = forwardRef<HTMLDivElement, DismissableLayerProps>(
|
|
|
351
376
|
onBlurCapture={focusOutside.onBlurCapture}
|
|
352
377
|
onPointerDownCapture={pointerDownOutside.onPointerDownCapture}
|
|
353
378
|
style={{
|
|
354
|
-
pointerEvents:
|
|
355
|
-
? pointerEnabled.isPointerEventsEnabled
|
|
356
|
-
? "auto"
|
|
357
|
-
: "none"
|
|
358
|
-
: undefined,
|
|
379
|
+
pointerEvents: pointerState.pointerStyle,
|
|
359
380
|
...rest.style,
|
|
360
381
|
}}
|
|
361
382
|
>
|
|
@@ -5,7 +5,7 @@ type CustomPointerDownEvent = CustomEvent<{
|
|
|
5
5
|
originalEvent: PointerEvent;
|
|
6
6
|
}>;
|
|
7
7
|
|
|
8
|
-
export { CustomFocusEvent, CustomPointerDownEvent };
|
|
8
|
+
export type { CustomFocusEvent, CustomPointerDownEvent };
|
|
9
9
|
|
|
10
10
|
export const CUSTOM_EVENTS = {
|
|
11
11
|
FOCUS_OUTSIDE: "AKSEL_FOCUS_OUTSIDE",
|
|
@@ -184,7 +184,7 @@ export const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
|
184
184
|
{getSteps({ page, count, siblingCount, boundaryCount }).map(
|
|
185
185
|
(step, i) => {
|
|
186
186
|
const n = Number(step);
|
|
187
|
-
return isNaN(n) ? (
|
|
187
|
+
return Number.isNaN(n) ? (
|
|
188
188
|
<li className="navds-pagination__ellipsis" key={`${step}${i}`}>
|
|
189
189
|
<BodyShort size={size === "xsmall" ? "small" : size}>
|
|
190
190
|
...
|
package/src/popover/Popover.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import cl from "clsx";
|
|
|
10
10
|
import React, { HTMLAttributes, forwardRef, useContext, useRef } from "react";
|
|
11
11
|
import { DateContext } from "../date/context";
|
|
12
12
|
import { useModalContext } from "../modal/Modal.context";
|
|
13
|
-
import { DismissableLayer } from "../
|
|
13
|
+
import { DismissableLayer } from "../overlays/dismissablelayer/DismissableLayer";
|
|
14
14
|
import { useClientLayoutEffect } from "../util/hooks";
|
|
15
15
|
import { useMergeRefs } from "../util/hooks/useMergeRefs";
|
|
16
16
|
import PopoverContent, { PopoverContentType } from "./PopoverContent";
|
package/src/stepper/Step.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import React, { forwardRef
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
3
|
import { Label } from "../typography";
|
|
4
4
|
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
5
5
|
import { OverridableComponent } from "../util/types";
|
|
6
|
-
import {
|
|
6
|
+
import { useStepperContext } from "./context";
|
|
7
7
|
|
|
8
8
|
export interface StepperStepProps
|
|
9
9
|
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
@@ -11,11 +11,6 @@ export interface StepperStepProps
|
|
|
11
11
|
* Text content by indicator.
|
|
12
12
|
*/
|
|
13
13
|
children: string;
|
|
14
|
-
/**
|
|
15
|
-
* Handled by Stepper, overwriting may break component logic.
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
unsafe_index?: number;
|
|
19
14
|
/**
|
|
20
15
|
* Makes step-indicator a checkmark.
|
|
21
16
|
* @default false
|
|
@@ -28,25 +23,6 @@ export interface StepperStepProps
|
|
|
28
23
|
interactive?: boolean;
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
const CompletedIcon = () => (
|
|
32
|
-
<svg
|
|
33
|
-
width="14"
|
|
34
|
-
height="10"
|
|
35
|
-
viewBox="0 0 14 10"
|
|
36
|
-
fill="none"
|
|
37
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
-
focusable={false}
|
|
39
|
-
role="img"
|
|
40
|
-
aria-hidden
|
|
41
|
-
aria-label="Fullført"
|
|
42
|
-
>
|
|
43
|
-
<path
|
|
44
|
-
d="M4.93563 6.41478L11.3755 0.404669C11.9796 -0.160351 12.9294 -0.130672 13.4959 0.47478C14.0624 1.08027 14.0299 2.03007 13.4249 2.59621L5.92151 9.59934C5.64138 9.85904 5.27598 10 4.90064 10C4.5069 10 4.12756 9.84621 3.83953 9.56111L1.33953 7.06111C0.75401 6.47558 0.75401 5.52542 1.33953 4.93989C1.92506 4.35437 2.87522 4.35437 3.46075 4.93989L4.93563 6.41478Z"
|
|
45
|
-
fill="currentColor"
|
|
46
|
-
/>
|
|
47
|
-
</svg>
|
|
48
|
-
);
|
|
49
|
-
|
|
50
26
|
export const Step: OverridableComponent<StepperStepProps, HTMLAnchorElement> =
|
|
51
27
|
forwardRef(
|
|
52
28
|
(
|
|
@@ -54,7 +30,6 @@ export const Step: OverridableComponent<StepperStepProps, HTMLAnchorElement> =
|
|
|
54
30
|
className,
|
|
55
31
|
children,
|
|
56
32
|
as: Component = "a",
|
|
57
|
-
unsafe_index = 0,
|
|
58
33
|
completed = false,
|
|
59
34
|
interactive,
|
|
60
35
|
onClick,
|
|
@@ -62,11 +37,8 @@ export const Step: OverridableComponent<StepperStepProps, HTMLAnchorElement> =
|
|
|
62
37
|
},
|
|
63
38
|
ref,
|
|
64
39
|
) => {
|
|
65
|
-
const context =
|
|
66
|
-
|
|
67
|
-
console.error("<Stepper.Step> has to be used within <Stepper>");
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
40
|
+
const context = useStepperContext();
|
|
41
|
+
|
|
70
42
|
const { activeStep } = context;
|
|
71
43
|
|
|
72
44
|
const isInteractive = interactive ?? context?.interactive;
|
|
@@ -74,17 +46,17 @@ export const Step: OverridableComponent<StepperStepProps, HTMLAnchorElement> =
|
|
|
74
46
|
const Comp = isInteractive ? Component : "div";
|
|
75
47
|
|
|
76
48
|
const handleStepClick = () => {
|
|
77
|
-
isInteractive && context.onStepChange(
|
|
49
|
+
isInteractive && context.onStepChange(context.index + 1);
|
|
78
50
|
};
|
|
79
51
|
|
|
80
52
|
return (
|
|
81
53
|
<Comp
|
|
82
54
|
{...rest}
|
|
83
|
-
aria-current={activeStep ===
|
|
55
|
+
aria-current={activeStep === context.index ? "step" : undefined}
|
|
84
56
|
ref={ref}
|
|
85
57
|
className={cl("navds-stepper__step", className, {
|
|
86
|
-
"navds-stepper__step--active": activeStep ===
|
|
87
|
-
"navds-stepper__step--behind": activeStep >
|
|
58
|
+
"navds-stepper__step--active": activeStep === context.index,
|
|
59
|
+
"navds-stepper__step--behind": activeStep > context.index,
|
|
88
60
|
"navds-stepper__step--non-interactive": !isInteractive,
|
|
89
61
|
"navds-stepper__step--completed": completed,
|
|
90
62
|
})}
|
|
@@ -92,7 +64,21 @@ export const Step: OverridableComponent<StepperStepProps, HTMLAnchorElement> =
|
|
|
92
64
|
>
|
|
93
65
|
{completed ? (
|
|
94
66
|
<span className="navds-stepper__circle navds-stepper__circle--success">
|
|
95
|
-
<
|
|
67
|
+
<svg
|
|
68
|
+
width="14"
|
|
69
|
+
height="10"
|
|
70
|
+
viewBox="0 0 14 10"
|
|
71
|
+
fill="none"
|
|
72
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
73
|
+
focusable={false}
|
|
74
|
+
role="presentation"
|
|
75
|
+
aria-hidden
|
|
76
|
+
>
|
|
77
|
+
<path
|
|
78
|
+
d="M4.93563 6.41478L11.3755 0.404669C11.9796 -0.160351 12.9294 -0.130672 13.4959 0.47478C14.0624 1.08027 14.0299 2.03007 13.4249 2.59621L5.92151 9.59934C5.64138 9.85904 5.27598 10 4.90064 10C4.5069 10 4.12756 9.84621 3.83953 9.56111L1.33953 7.06111C0.75401 6.47558 0.75401 5.52542 1.33953 4.93989C1.92506 4.35437 2.87522 4.35437 3.46075 4.93989L4.93563 6.41478Z"
|
|
79
|
+
fill="currentColor"
|
|
80
|
+
/>
|
|
81
|
+
</svg>
|
|
96
82
|
</span>
|
|
97
83
|
) : (
|
|
98
84
|
<Label
|
|
@@ -100,7 +86,7 @@ export const Step: OverridableComponent<StepperStepProps, HTMLAnchorElement> =
|
|
|
100
86
|
as="span"
|
|
101
87
|
aria-hidden="true"
|
|
102
88
|
>
|
|
103
|
-
{
|
|
89
|
+
{context.index + 1}
|
|
104
90
|
</Label>
|
|
105
91
|
)}
|
|
106
92
|
<Label as="span" className="navds-stepper__content">
|
package/src/stepper/Stepper.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import Step, { StepperStepProps } from "./Step";
|
|
4
|
-
import {
|
|
4
|
+
import { StepperContextProvider } from "./context";
|
|
5
5
|
|
|
6
6
|
export interface StepperProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
7
7
|
/**
|
|
@@ -94,41 +94,35 @@ export const Stepper: StepperComponent = forwardRef<
|
|
|
94
94
|
className,
|
|
95
95
|
)}
|
|
96
96
|
>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
97
|
+
{React.Children.map(children, (step, index) => {
|
|
98
|
+
const stepProps: Partial<StepperStepProps> =
|
|
99
|
+
React.isValidElement<StepperStepProps>(step) ? step.props : {};
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<li
|
|
103
|
+
className={cl("navds-stepper__item", {
|
|
104
|
+
"navds-stepper__item--behind": activeStep > index,
|
|
105
|
+
"navds-stepper__item--completed": stepProps.completed,
|
|
106
|
+
"navds-stepper__item--non-interactive":
|
|
107
|
+
stepProps.interactive ?? interactive,
|
|
108
|
+
})}
|
|
109
|
+
key={index + (children?.toString?.() ?? "")}
|
|
110
|
+
>
|
|
111
|
+
<span className="navds-stepper__line navds-stepper__line--1" />
|
|
112
|
+
<StepperContextProvider
|
|
113
|
+
interactive={interactive}
|
|
114
|
+
activeStep={activeStep}
|
|
115
|
+
lastIndex={React.Children.count(children)}
|
|
116
|
+
index={index}
|
|
117
|
+
onStepChange={onStepChange}
|
|
118
|
+
orientation={orientation}
|
|
119
119
|
>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
: step}
|
|
127
|
-
<span className="navds-stepper__line navds-stepper__line--2" />
|
|
128
|
-
</li>
|
|
129
|
-
);
|
|
130
|
-
})}
|
|
131
|
-
</StepperContext.Provider>
|
|
120
|
+
{step}
|
|
121
|
+
</StepperContextProvider>
|
|
122
|
+
<span className="navds-stepper__line navds-stepper__line--2" />
|
|
123
|
+
</li>
|
|
124
|
+
);
|
|
125
|
+
})}
|
|
132
126
|
</ol>
|
|
133
127
|
);
|
|
134
128
|
},
|
package/src/stepper/context.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { createContext } from "
|
|
1
|
+
import { createContext } from "../util/create-context";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
activeStep: number;
|
|
3
|
+
interface StepperContextValue {
|
|
5
4
|
onStepChange: (step: number) => void;
|
|
6
5
|
lastIndex: number;
|
|
7
6
|
orientation: "horizontal" | "vertical";
|
|
8
7
|
interactive: boolean;
|
|
8
|
+
activeStep: number;
|
|
9
|
+
index: number;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
export const
|
|
12
|
+
export const [StepperContextProvider, useStepperContext] =
|
|
13
|
+
createContext<StepperContextValue>({
|
|
14
|
+
hookName: "useStepperContext",
|
|
15
|
+
providerName: "StepperContextProvider",
|
|
16
|
+
name: "StepperContext",
|
|
17
|
+
errorMessage: "<Stepper.Step> has to be used within <Stepper>",
|
|
18
|
+
});
|
|
@@ -15,7 +15,7 @@ const prefersReducedMotion = globalThis?.matchMedia
|
|
|
15
15
|
|
|
16
16
|
function isNumber(n: string) {
|
|
17
17
|
const number = parseFloat(n);
|
|
18
|
-
return !isNaN(number) && isFinite(number);
|
|
18
|
+
return !Number.isNaN(number) && Number.isFinite(number);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function isPercentage(height: Height) {
|
|
@@ -32,9 +32,9 @@ export function useScrollButtons(listRef: React.RefObject<HTMLDivElement>) {
|
|
|
32
32
|
const win = listRef.current?.ownerDocument ?? document ?? window;
|
|
33
33
|
win.addEventListener("resize", handleResize);
|
|
34
34
|
|
|
35
|
-
let resizeObserver;
|
|
35
|
+
let resizeObserver: ResizeObserver;
|
|
36
36
|
|
|
37
|
-
if (typeof ResizeObserver !== "undefined") {
|
|
37
|
+
if (typeof ResizeObserver !== "undefined" && listRef.current) {
|
|
38
38
|
resizeObserver = new ResizeObserver(handleResize);
|
|
39
39
|
resizeObserver.observe(listRef.current);
|
|
40
40
|
}
|
|
@@ -115,11 +115,13 @@ const axisLabels = (
|
|
|
115
115
|
const totalDays = differenceInDays(end, start);
|
|
116
116
|
if (totalDays < 40) {
|
|
117
117
|
return dayLabels(start, end, totalDays, direction, templates?.day);
|
|
118
|
-
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (totalDays < 370) {
|
|
119
121
|
return monthLabels(start, end, direction, templates?.month);
|
|
120
|
-
} else {
|
|
121
|
-
return yearLabels(start, end, direction, templates?.year);
|
|
122
122
|
}
|
|
123
|
+
|
|
124
|
+
return yearLabels(start, end, direction, templates?.year);
|
|
123
125
|
};
|
|
124
126
|
|
|
125
127
|
export const AxisLabels = ({
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { omit } from "../omit";
|
|
3
|
+
|
|
4
|
+
describe("omit", () => {
|
|
5
|
+
test("should return a new object without the specified properties", () => {
|
|
6
|
+
const obj = { a: 1, b: 2, c: 3 };
|
|
7
|
+
const result = omit(obj, ["a", "b"]);
|
|
8
|
+
expect(result).toEqual({ c: 3 });
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test("should not modify the original object", () => {
|
|
12
|
+
const obj = { a: 1, b: 2, c: 3 };
|
|
13
|
+
omit(obj, ["a"]);
|
|
14
|
+
expect(obj).toEqual({ a: 1, b: 2, c: 3 });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("should return the same object if no properties are omitted", () => {
|
|
18
|
+
const obj = { a: 1, b: 2, c: 3 };
|
|
19
|
+
const result = omit(obj, []);
|
|
20
|
+
expect(result).toEqual(obj);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("should return an empty object if all properties are omitted", () => {
|
|
24
|
+
const obj = { a: 1, b: 2, c: 3 };
|
|
25
|
+
const result = omit(obj, ["a", "b", "c"]);
|
|
26
|
+
expect(result).toEqual({});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test("should ignore properties that do not exist in the original object", () => {
|
|
30
|
+
const obj = { a: 1, b: 2, c: 3 };
|
|
31
|
+
|
|
32
|
+
// @ts-expect-error TS-typing will not allow this in most cases, but we still want to test it just in case
|
|
33
|
+
const result = omit(obj, ["d"]);
|
|
34
|
+
expect(result).toEqual(obj);
|
|
35
|
+
});
|
|
36
|
+
});
|
package/src/util/debounce.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
// https://github.com/mui/material-ui/blob/master/packages/mui-utils/src/debounce.js
|
|
3
3
|
export default function debounce(func, wait = 166) {
|
|
4
|
-
let timeout
|
|
4
|
+
let timeout: ReturnType<typeof setTimeout>;
|
|
5
5
|
function debounced(this: any, ...args) {
|
|
6
6
|
const later = () => {
|
|
7
7
|
func.apply(this, args);
|
package/src/util/omit.ts
CHANGED
|
@@ -2,13 +2,9 @@ export function omit<T extends object, K extends keyof T>(
|
|
|
2
2
|
obj: T,
|
|
3
3
|
props: K[],
|
|
4
4
|
): Omit<T, K> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[key]: value,
|
|
11
|
-
}),
|
|
12
|
-
{} as Omit<T, K>,
|
|
13
|
-
);
|
|
5
|
+
const filteredEntries = Object.entries(obj).filter(
|
|
6
|
+
([key]) => !props.includes(key as K),
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
return Object.fromEntries(filteredEntries) as Omit<T, K>;
|
|
14
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DismissableLayer.js","sourceRoot":"","sources":["../../../src/overlay/dismiss/DismissableLayer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAOe;AACf,0CAAuC;AACvC,4CAAgD;AAChD,8EAAqF;AAMrF,8DAA2D;AAC3D,4DAAyD;AACzD,wEAAqE;AAsDxD,KAKT,IAAA,uCAAuB,GAGxB,EAPD,sCAA8B,UAC9B,wCAAgC,UAChC,iCAAyB,UACzB,gCAAwB,SAItB;AAEJ,IAAI,yBAAiC,CAAC;AAEtC,MAAM,gBAAgB,GAAG,IAAA,kBAAU,EACjC,CAAC,KAA4B,EAAE,GAAG,EAAE,EAAE;IACpC,MAAM,OAAO,GAAG,IAAA,wCAAgC,EAAC,KAAK,CAAC,CAAC;IAExD;;;OAGG;IACH,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,8BAAC,oBAAoB,kBAAC,GAAG,EAAE,GAAG,IAAM,KAAK,EAAI,CAC9C,CAAC,CAAC,CAAC,CACF,8BAAC,eAAe;QACd,8BAAC,oBAAoB,kBAAC,GAAG,EAAE,GAAG,IAAM,KAAK,EAAI,CAC7B,CACnB,CAAC;AACJ,CAAC,CACF,CAAC;AA2QO,4CAAgB;AAzQzB;;;;;GAKG;AACH,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IACtE,MAAM,WAAW,GAAG,IAAA,iCAAyB,GAAE,CAAC;IAEhD,OAAO,CACL,8BAAC,sCAA8B,IAAC,KAAK,EAAE,WAAW,IAC/C,QAAQ,CACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,IAAA,kBAAU,EACrC,CACE,EAYwB,EACxB,GAAG,EACH,EAAE;;QAdF,EACE,QAAQ,EACR,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,iB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OAAO,CAAC,CAAC,CAAC;IAEvE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,WAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAEpC,OAAO,CACL,8BAAC,IAAI,kBACH,GAAG,EAAE,UAAU,IACX,IAAI,IACR,cAAc,EAAE,YAAY,CAAC,cAAc,EAC3C,aAAa,EAAE,YAAY,CAAC,aAAa,EACzC,oBAAoB,EAAE,kBAAkB,CAAC,oBAAoB,EAC7D,KAAK,kBACH,aAAa,EAAE,cAAc,CAAC,2BAA2B;gBACvD,CAAC,CAAC,cAAc,CAAC,sBAAsB;oBACrC,CAAC,CAAC,MAAM;oBACR,CAAC,CAAC,MAAM;gBACV,CAAC,CAAC,SAAS,IACV,IAAI,CAAC,KAAK,MAGd,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dispatchCustomEvent.js","sourceRoot":"","sources":["../../../../src/overlay/dismiss/util/dispatchCustomEvent.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AASpB,QAAA,aAAa,GAAG;IAC3B,aAAa,EAAE,qBAAqB;IACpC,oBAAoB,EAAE,4BAA4B;CACnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,mBAAmB,CAIjC,IAAY,EACZ,OAAyC,EACzC,MAEU,EACV,EAAE,QAAQ,KAA4B,EAAE,QAAQ,EAAE,KAAK,EAAE;IAEzD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE;QAClC,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,IAAI;QAChB,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAwB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAExE,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;QACvB,mBAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AA5BD,kDA4BC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEscapeKeydown.js","sourceRoot":"","sources":["../../../../src/overlay/dismiss/util/useEscapeKeydown.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAClC,+CAAqD;AAErD,SAAgB,gBAAgB,CAC9B,QAAyC,EACzC,gBAA0B,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ;IAE9C,MAAM,eAAe,GAAG,IAAA,sBAAc,EAAC,QAAQ,CAAC,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,CAAC,KAAoB,EAAE,EAAE;YAC7C,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;gBAC3B,eAAe,CAAC,KAAK,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC;QAEF,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QAC/D,OAAO,GAAG,EAAE,CACV,aAAa,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAAC;AACvC,CAAC;AAjBD,4CAiBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusOutside.js","sourceRoot":"","sources":["../../../../src/overlay/dismiss/util/useFocusOutside.ts"],"names":[],"mappings":";;;AAAA,iCAA0C;AAC1C,+CAAqD;AACrD,+DAI+B;AAE/B;;GAEG;AACH,SAAgB,eAAe,CAC7B,QAA4C,EAC5C,gBAA0B,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ;IAE9C,MAAM,kBAAkB,GAAG,IAAA,sBAAc,EAAC,QAAQ,CAAkB,CAAC;IACrE,MAAM,yBAAyB,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAC;IAEhD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAE,EAAE;YACxC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,yBAAyB,CAAC,OAAO,EAAE,CAAC;gBACvD,MAAM,WAAW,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;gBAE7C;;;;;;;;mBAQG;gBACH,IAAA,yCAAmB,EACjB,mCAAa,CAAC,aAAa,EAC3B,kBAAkB,EAClB,WAAW,CACZ,CAAC;YACJ,CAAC;QACH,CAAC,CAAC;QACF,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC,EAAE,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAExC;;;OAGG;IACH,OAAO;QACL,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,yBAAyB,CAAC,OAAO,GAAG,IAAI,CAAC;QAChE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,yBAAyB,CAAC,OAAO,GAAG,KAAK,CAAC;KACjE,CAAC;AACJ,CAAC;AAxCD,0CAwCC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePointerDownOutside.js","sourceRoot":"","sources":["../../../../src/overlay/dismiss/util/usePointerDownOutside.ts"],"names":[],"mappings":";;;AAAA,iCAA0C;A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