asma-ui-core 3.108.2 → 3.108.4
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/asma-ui-core.css +1 -1
- package/dist/components/feedback/dialog/StyledDialog.js +139 -96
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +180 -171
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +115 -106
- package/dist/components/inputs/select/StyledSelect.js +56 -50
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +102 -96
- package/dist/components/navigation/drawer/StyledDrawer.js +55 -51
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +158 -118
- package/dist/components/utils/popover/PopoverSheet.js +95 -85
- package/dist/components/utils/popover/StyledPopover.js +81 -71
- package/dist/datetime/components/date-picker/StyledDatePicker.js +33 -28
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +9 -8
- package/dist/datetime/components/time-picker/StyledTimePicker.js +56 -51
- package/dist/datetime/hooks/useBackNavigationClose.hook.js +16 -7
- package/dist/hooks/useBackCloses.hook.js +100 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +6 -1
- package/dist/src/components/navigation/drawer/StyledDrawer.d.ts +2 -0
- package/dist/src/components/utils/bottom-sheet/StyledBottomSheet.d.ts +6 -2
- package/dist/src/components/utils/popover/StyledPopover.d.ts +3 -1
- package/dist/src/datetime/hooks/useBackNavigationClose.hook.d.ts +2 -1
- package/dist/src/hooks/useBackCloses.hook.d.ts +101 -0
- package/dist/src/hooks/useBackCloses.hook.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,137 +1,177 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { registerOpenModalDialog as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { IndeterminateIcon as
|
|
5
|
-
import { StyledButton as
|
|
6
|
-
import { useShortViewportMediaQuery as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { cn as d } from "../../../helpers/cn.js";
|
|
2
|
+
import { registerOpenModalDialog as z } from "../../../hooks/useTopLayer.hook.js";
|
|
3
|
+
import { CloseIcon as J } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { IndeterminateIcon as W } from "../../icons/indeterminate-icon/IndeterminateIcon.js";
|
|
5
|
+
import { StyledButton as j } from "../../inputs/button/StyledButton.js";
|
|
6
|
+
import { useShortViewportMediaQuery as X } from "../../../hooks/useMediaQuery.hook.js";
|
|
7
|
+
import { OverlayBackOwnerContext as Z, isOverlayBackEnabled as P, requestCloseTopOverlayBack as x, useBackCloses as ee } from "../../../hooks/useBackCloses.hook.js";
|
|
8
|
+
import { useDebouncedValue as te } from "../../../hooks/useDebouncedValue.hook.js";
|
|
9
|
+
import { useFocusTrap as re } from "../../../hooks/useFocusTrap.hook.js";
|
|
10
|
+
import { formatResultsLabel as oe } from "./formatResultsLabel.js";
|
|
11
|
+
import { useBodyScrollLock as ne } from "../../../hooks/useBodyScrollLock.hook.js";
|
|
12
|
+
import ae from "./StyledBottomSheet.module.js";
|
|
13
|
+
import { useDragToDismiss as se } from "./useDragToDismiss.hook.js";
|
|
14
|
+
import { useEffect as y, useId as ie, useLayoutEffect as le, useRef as l, useState as ce } from "react";
|
|
15
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
16
|
+
var de = 500, Le = ({ dataTest: c, id: T, open: t, onClose: s, title: m, ariaLabel: _, children: q, viewResultsAction: g, resetAction: $, footerActions: A, resultCount: E, closeLabel: U = "Lukk", className: V, registerBackClose: H = !0, ownerRef: K }) => {
|
|
17
|
+
const k = ie(), i = l(null), S = l(null), N = l(null), R = K ?? i, h = l(!1), [b, L] = ce(!1), G = X(), f = l(s), B = l(t);
|
|
18
|
+
y(() => {
|
|
19
|
+
f.current = s, B.current = t;
|
|
20
|
+
}, [s, t]);
|
|
21
|
+
const { dragHandleProps: Q, dragOffset: C } = se(S, () => {
|
|
22
|
+
f.current("drag");
|
|
22
23
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
24
|
+
ne(t), re(t, i), y(() => {
|
|
25
|
+
if (!t) return;
|
|
26
|
+
const e = (r) => {
|
|
27
|
+
r.key === "Escape" && (h.current = !0, window.setTimeout(() => {
|
|
28
|
+
h.current = !1;
|
|
29
|
+
}, 0));
|
|
30
|
+
}, n = (r) => {
|
|
31
|
+
if (r.key !== "Escape" || r.defaultPrevented) return;
|
|
32
|
+
const a = document.activeElement;
|
|
33
|
+
a instanceof Element && a.closest("dialog[open]") !== i.current || (r.preventDefault(), r.stopImmediatePropagation(), x(r));
|
|
34
|
+
};
|
|
35
|
+
return window.addEventListener("keydown", e, !0), window.addEventListener("keydown", n), () => {
|
|
36
|
+
window.removeEventListener("keydown", e, !0), window.removeEventListener("keydown", n);
|
|
37
|
+
};
|
|
38
|
+
}, [t]), ee({
|
|
39
|
+
active: t && H,
|
|
40
|
+
requestClose: () => f.current("escape"),
|
|
41
|
+
ownerRef: R
|
|
42
|
+
}), le(() => {
|
|
43
|
+
const e = i.current;
|
|
44
|
+
if (!t || !e) return;
|
|
45
|
+
N.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.open || e.showModal(), e.focus({ preventScroll: !0 });
|
|
46
|
+
const n = requestAnimationFrame(() => {
|
|
47
|
+
L(!0);
|
|
48
|
+
}), r = z(e);
|
|
30
49
|
return () => {
|
|
31
|
-
cancelAnimationFrame(
|
|
32
|
-
const
|
|
33
|
-
|
|
50
|
+
cancelAnimationFrame(n), r(), L(!1), e.open && e.close();
|
|
51
|
+
const a = N.current;
|
|
52
|
+
a?.isConnected && a.focus({ preventScroll: !0 });
|
|
53
|
+
};
|
|
54
|
+
}, [t]), y(() => {
|
|
55
|
+
const e = i.current;
|
|
56
|
+
if (!e || !t) return;
|
|
57
|
+
let n = !1;
|
|
58
|
+
const r = () => {
|
|
59
|
+
requestAnimationFrame(() => {
|
|
60
|
+
n = !1, B.current && e.isConnected && !e.open && (e.showModal(), e.focus({ preventScroll: !0 }));
|
|
61
|
+
});
|
|
62
|
+
}, a = () => {
|
|
63
|
+
n || (n = !0, P() && x(), r());
|
|
34
64
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
65
|
+
return e.addEventListener("close", a), () => e.removeEventListener("close", a);
|
|
66
|
+
}, [t]);
|
|
67
|
+
const O = oe(te(E, de));
|
|
68
|
+
if (!t) return null;
|
|
69
|
+
const Y = { close: () => {
|
|
70
|
+
s("action");
|
|
71
|
+
} }, p = (e) => typeof e == "function" ? e(Y) : e, I = E !== void 0, w = g !== void 0 ? p(g) : I ? /* @__PURE__ */ o(j, {
|
|
72
|
+
dataTest: `${c}-view-results`,
|
|
42
73
|
type: "button",
|
|
43
74
|
variant: "text",
|
|
44
75
|
onClick: () => {
|
|
45
|
-
|
|
76
|
+
s("viewResults");
|
|
46
77
|
},
|
|
47
|
-
children:
|
|
48
|
-
}) : void 0,
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
ref:
|
|
51
|
-
id:
|
|
78
|
+
children: O
|
|
79
|
+
}) : void 0, D = p($), v = p(A), F = !!(w ?? D), M = C > 0;
|
|
80
|
+
return /* @__PURE__ */ o("dialog", {
|
|
81
|
+
ref: i,
|
|
82
|
+
id: T,
|
|
52
83
|
tabIndex: -1,
|
|
53
84
|
"aria-modal": "true",
|
|
54
|
-
"aria-labelledby":
|
|
55
|
-
"aria-label":
|
|
56
|
-
"data-test":
|
|
57
|
-
"data-testid":
|
|
85
|
+
"aria-labelledby": m ? k : void 0,
|
|
86
|
+
"aria-label": m ? void 0 : _,
|
|
87
|
+
"data-test": c,
|
|
88
|
+
"data-testid": c,
|
|
58
89
|
onCancel: (e) => {
|
|
59
|
-
e.preventDefault(),
|
|
90
|
+
if (e.cancelable && e.preventDefault(), !h.current) {
|
|
91
|
+
if (!P()) {
|
|
92
|
+
f.current("escape");
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
x();
|
|
96
|
+
}
|
|
60
97
|
},
|
|
61
|
-
className:
|
|
62
|
-
children:
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
className: d(ae.StyledBottomSheet, "fixed inset-0 m-0 h-full max-h-none w-full max-w-none flex-col items-center justify-end overflow-hidden border-0 bg-transparent p-0 outline-none open:flex"),
|
|
99
|
+
children: /* @__PURE__ */ u(Z.Provider, {
|
|
100
|
+
value: R,
|
|
101
|
+
children: [/* @__PURE__ */ o("div", {
|
|
102
|
+
"aria-hidden": "true",
|
|
103
|
+
"data-testid": `${c}-scrim`,
|
|
104
|
+
onClick: () => {
|
|
105
|
+
s("scrim");
|
|
106
|
+
},
|
|
107
|
+
className: d("absolute inset-0 bg-[#626e7eb2] transition-opacity duration-[250ms] ease-out motion-reduce:duration-150", b ? "opacity-100" : "opacity-0")
|
|
108
|
+
}), /* @__PURE__ */ u("div", {
|
|
109
|
+
ref: S,
|
|
110
|
+
"data-state": b ? "open" : "closed",
|
|
111
|
+
style: M ? { transform: `translateY(${C}px)` } : void 0,
|
|
112
|
+
className: d("relative box-border flex w-full max-w-[640px] flex-col border border-solid border-delta-300 bg-white text-delta-700 outline-none", G ? "h-full max-h-none rounded-none" : "max-h-[90dvh] rounded-t-[28px]", !M && ["ease-out motion-safe:transition-transform motion-safe:duration-[250ms] motion-reduce:transition-opacity motion-reduce:duration-150", b ? "translate-y-0 opacity-100" : "motion-safe:translate-y-full motion-reduce:opacity-0"], V),
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ u("div", {
|
|
115
|
+
className: "border-b-solid shrink-0 border-b border-delta-200 pb-2",
|
|
116
|
+
children: [/* @__PURE__ */ u("div", {
|
|
117
|
+
...Q,
|
|
118
|
+
className: "relative flex h-12 touch-none items-center gap-2 px-2",
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1" }),
|
|
121
|
+
/* @__PURE__ */ o(j, {
|
|
122
|
+
dataTest: `${c}-close`,
|
|
123
|
+
variant: "textGray",
|
|
124
|
+
type: "button",
|
|
125
|
+
"aria-label": U,
|
|
126
|
+
onClick: () => {
|
|
127
|
+
s("closeButton");
|
|
128
|
+
},
|
|
129
|
+
startIcon: /* @__PURE__ */ o(J, {
|
|
130
|
+
width: 24,
|
|
131
|
+
height: 24
|
|
132
|
+
})
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ o(W, {
|
|
135
|
+
"aria-hidden": "true",
|
|
136
|
+
focusable: "false",
|
|
91
137
|
width: 24,
|
|
92
|
-
height: 24
|
|
138
|
+
height: 24,
|
|
139
|
+
className: "pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-delta-800"
|
|
93
140
|
})
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
141
|
+
]
|
|
142
|
+
}), m && /* @__PURE__ */ o("div", {
|
|
143
|
+
id: k,
|
|
144
|
+
className: "truncate px-4 text-lg font-semibold leading-7 text-delta-800",
|
|
145
|
+
children: m
|
|
146
|
+
})]
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ o("div", {
|
|
149
|
+
className: d("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain pl-4 pr-2 pt-2", F || v ? "pb-2" : "pb-[max(0.5rem,env(safe-area-inset-bottom))]"),
|
|
150
|
+
children: p(q)
|
|
151
|
+
}),
|
|
152
|
+
F && /* @__PURE__ */ u("div", {
|
|
153
|
+
className: d("border-t-solid flex shrink-0 items-start border-t border-delta-200 bg-white p-1", w ? "justify-between" : "justify-end", !v && "pb-[max(0.25rem,env(safe-area-inset-bottom))]"),
|
|
154
|
+
children: [
|
|
155
|
+
w,
|
|
156
|
+
D,
|
|
157
|
+
I && /* @__PURE__ */ o("span", {
|
|
158
|
+
className: "sr-only",
|
|
159
|
+
role: "status",
|
|
160
|
+
"aria-live": "polite",
|
|
161
|
+
"aria-atomic": "true",
|
|
162
|
+
children: O
|
|
101
163
|
})
|
|
102
164
|
]
|
|
103
|
-
}),
|
|
104
|
-
|
|
105
|
-
className: "
|
|
106
|
-
children:
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
children: l(j)
|
|
112
|
-
}),
|
|
113
|
-
R && /* @__PURE__ */ i("div", {
|
|
114
|
-
className: n("border-t-solid flex shrink-0 items-start border-t border-delta-200 bg-white p-1", f ? "justify-between" : "justify-end", !c && "pb-[max(0.25rem,env(safe-area-inset-bottom))]"),
|
|
115
|
-
children: [
|
|
116
|
-
f,
|
|
117
|
-
k,
|
|
118
|
-
N && /* @__PURE__ */ t("span", {
|
|
119
|
-
className: "sr-only",
|
|
120
|
-
role: "status",
|
|
121
|
-
"aria-live": "polite",
|
|
122
|
-
"aria-atomic": "true",
|
|
123
|
-
children: S
|
|
124
|
-
})
|
|
125
|
-
]
|
|
126
|
-
}),
|
|
127
|
-
c && /* @__PURE__ */ t("div", {
|
|
128
|
-
className: "flex shrink-0 flex-col items-end bg-white p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
129
|
-
children: c
|
|
130
|
-
})
|
|
131
|
-
]
|
|
132
|
-
})]
|
|
165
|
+
}),
|
|
166
|
+
v && /* @__PURE__ */ o("div", {
|
|
167
|
+
className: "flex shrink-0 flex-col items-end bg-white p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]",
|
|
168
|
+
children: v
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
})]
|
|
172
|
+
})
|
|
133
173
|
});
|
|
134
174
|
};
|
|
135
175
|
export {
|
|
136
|
-
|
|
176
|
+
Le as StyledBottomSheet
|
|
137
177
|
};
|
|
@@ -3,54 +3,59 @@ import { firstTabbable as se } from "../../../helpers/focusable.js";
|
|
|
3
3
|
import { TOP_LAYER_PROPS as ae, TOP_LAYER_RESET_STYLE as le, getOpenModalDialogAncestor as ce, shouldUsePopoverTopLayer as de, useTopLayerRef as ue } from "../../../hooks/useTopLayer.hook.js";
|
|
4
4
|
import { StyledButton as fe } from "../../inputs/button/StyledButton.js";
|
|
5
5
|
import { useMobileMediaQuery as pe } from "../../../hooks/useMediaQuery.hook.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
6
|
+
import { OverlayBackOwnerContext as me, useBackCloses as ge } from "../../../hooks/useBackCloses.hook.js";
|
|
7
|
+
import { useDebouncedValue as ve } from "../../../hooks/useDebouncedValue.hook.js";
|
|
8
|
+
import { useFocusTrap as he } from "../../../hooks/useFocusTrap.hook.js";
|
|
9
|
+
import { formatResultsLabel as xe } from "../bottom-sheet/formatResultsLabel.js";
|
|
10
|
+
import { StyledBottomSheet as _e } from "../bottom-sheet/StyledBottomSheet.js";
|
|
11
|
+
import { PopoverAnatomy as Pe } from "./PopoverAnatomy.js";
|
|
12
|
+
import { useCallback as x, useEffect as w, useId as be, useRef as O, useState as d } from "react";
|
|
13
|
+
import { Fragment as D, jsx as a, jsxs as N } from "react/jsx-runtime";
|
|
14
|
+
import { FloatingPortal as ye, autoUpdate as Re, flip as we, offset as Oe, shift as Te, size as Ee, useDismiss as Me, useFloating as Se, useInteractions as Ae, useMergeRefs as Fe } from "@floating-ui/react";
|
|
15
|
+
var Ie = 240, Ce = {
|
|
15
16
|
info: 472,
|
|
16
17
|
action: 472
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
}, [
|
|
18
|
+
}, ke = 0.6, X = "calc(100vw - 32px)", Le = (i, u, f) => Re(i, u, f, { elementResize: !1 }), Je = ({ dataTest: i, renderTrigger: u, variant: f = "info", title: p, children: T, viewResultsAction: E, resetAction: M, footerActions: S, resultCount: _, closeLabel: A = "Lukk", ariaLabel: F, onOpenChange: I, className: C }) => {
|
|
19
|
+
const l = be(), k = `${l}-title`, [o, q] = d(!1), [L, z] = d(), [K, U] = d(), m = pe(), t = f === "action", Y = m && !t, H = m && t, g = x((e) => {
|
|
20
|
+
q(e), I?.(e);
|
|
21
|
+
}, [I]), { refs: P, floatingStyles: $, context: j } = Se({
|
|
21
22
|
open: o,
|
|
22
|
-
onOpenChange:
|
|
23
|
+
onOpenChange: g,
|
|
23
24
|
placement: "bottom-start",
|
|
24
25
|
strategy: "fixed",
|
|
25
26
|
whileElementsMounted: Le,
|
|
26
27
|
middleware: [
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
Oe(8),
|
|
29
|
+
...Y ? [] : [we({ padding: 8 })],
|
|
29
30
|
Te({ padding: 8 }),
|
|
30
31
|
Ee({
|
|
31
32
|
padding: 8,
|
|
32
33
|
apply({ availableHeight: e }) {
|
|
33
|
-
|
|
34
|
+
U(Math.min(e, Math.round(window.innerHeight * ke)));
|
|
34
35
|
}
|
|
35
36
|
})
|
|
36
37
|
]
|
|
37
|
-
}), { getFloatingProps: V } =
|
|
38
|
-
enabled: !
|
|
38
|
+
}), { getFloatingProps: V } = Ae([Me(j, {
|
|
39
|
+
enabled: !H,
|
|
39
40
|
escapeKey: !0,
|
|
40
41
|
outsidePress: (e) => {
|
|
41
|
-
const s =
|
|
42
|
+
const s = v.current;
|
|
42
43
|
return !(s && e.target instanceof Node && s.contains(e.target));
|
|
43
44
|
}
|
|
44
|
-
})]), b = de(
|
|
45
|
-
|
|
46
|
-
}, []), J =
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
ge(
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
})]), b = de(L), c = O(null), [r, G] = d(null), Q = x((e) => {
|
|
46
|
+
c.current = e, G(e);
|
|
47
|
+
}, []), J = Fe([ue(P.setFloating, b), Q]), v = O(null), Z = x((e) => {
|
|
48
|
+
v.current = e, P.setReference(e);
|
|
49
|
+
}, [P]), n = x(() => {
|
|
50
|
+
g(!1);
|
|
51
|
+
}, [g]);
|
|
52
|
+
ge({
|
|
53
|
+
active: o,
|
|
54
|
+
requestClose: n,
|
|
55
|
+
ownerRef: c
|
|
56
|
+
}), he(o && t && r !== null, c);
|
|
57
|
+
const [W, ee] = d(!1);
|
|
58
|
+
w(() => {
|
|
54
59
|
if (!r || t && !W) return;
|
|
55
60
|
const e = requestAnimationFrame(() => {
|
|
56
61
|
(t ? se(r) : r)?.focus({ preventScroll: !0 });
|
|
@@ -62,11 +67,11 @@ var Oe = 240, Fe = {
|
|
|
62
67
|
r,
|
|
63
68
|
t,
|
|
64
69
|
W
|
|
65
|
-
]),
|
|
70
|
+
]), w(() => {
|
|
66
71
|
if (!r || t) return;
|
|
67
72
|
const e = (s) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
73
|
+
const R = s.relatedTarget;
|
|
74
|
+
R instanceof Node && (r.contains(R) || v.current?.contains(R)) || n();
|
|
70
75
|
};
|
|
71
76
|
return r.addEventListener("focusout", e), () => {
|
|
72
77
|
r.removeEventListener("focusout", e);
|
|
@@ -74,17 +79,17 @@ var Oe = 240, Fe = {
|
|
|
74
79
|
}, [
|
|
75
80
|
r,
|
|
76
81
|
t,
|
|
77
|
-
|
|
82
|
+
n
|
|
78
83
|
]);
|
|
79
|
-
const
|
|
80
|
-
|
|
84
|
+
const y = O(!1);
|
|
85
|
+
w(() => {
|
|
81
86
|
if (o) {
|
|
82
|
-
|
|
87
|
+
y.current = !0;
|
|
83
88
|
return;
|
|
84
89
|
}
|
|
85
|
-
if (!
|
|
86
|
-
|
|
87
|
-
const e =
|
|
90
|
+
if (!y.current) return;
|
|
91
|
+
y.current = !1;
|
|
92
|
+
const e = v.current;
|
|
88
93
|
if (!e) return;
|
|
89
94
|
const s = requestAnimationFrame(() => {
|
|
90
95
|
document.activeElement === document.body && e.focus();
|
|
@@ -93,79 +98,84 @@ var Oe = 240, Fe = {
|
|
|
93
98
|
cancelAnimationFrame(s);
|
|
94
99
|
};
|
|
95
100
|
}, [o]);
|
|
96
|
-
const
|
|
101
|
+
const B = {
|
|
97
102
|
ref: Z,
|
|
98
103
|
isOpen: o,
|
|
99
104
|
triggerProps: {
|
|
100
105
|
onClick: (e) => {
|
|
101
106
|
if (o) {
|
|
102
|
-
|
|
107
|
+
n();
|
|
103
108
|
return;
|
|
104
109
|
}
|
|
105
|
-
|
|
110
|
+
z(ce(e.currentTarget)), ee(e.detail === 0), g(!0);
|
|
106
111
|
},
|
|
107
112
|
"aria-expanded": o,
|
|
108
|
-
"aria-controls": o ?
|
|
113
|
+
"aria-controls": o ? l : void 0,
|
|
109
114
|
"aria-haspopup": t ? "dialog" : void 0,
|
|
110
|
-
"aria-describedby": !t && o ?
|
|
115
|
+
"aria-describedby": !t && o ? l : void 0
|
|
111
116
|
}
|
|
112
|
-
}, h = (e) => typeof e == "function" ? e({ close:
|
|
113
|
-
dataTest: `${
|
|
117
|
+
}, h = (e) => typeof e == "function" ? e({ close: n }) : e, te = ve(_, 500), oe = E ?? (_ === void 0 ? void 0 : /* @__PURE__ */ a(fe, {
|
|
118
|
+
dataTest: `${i}-view-results`,
|
|
114
119
|
type: "button",
|
|
115
120
|
variant: "text",
|
|
116
|
-
onClick:
|
|
117
|
-
children:
|
|
118
|
-
})), re =
|
|
119
|
-
return
|
|
120
|
-
id:
|
|
121
|
-
dataTest:
|
|
121
|
+
onClick: n,
|
|
122
|
+
children: xe(te)
|
|
123
|
+
})), re = m ? X : Ce[f], ne = m ? X : void 0;
|
|
124
|
+
return H ? /* @__PURE__ */ N(D, { children: [u(B), /* @__PURE__ */ a(_e, {
|
|
125
|
+
id: l,
|
|
126
|
+
dataTest: i,
|
|
122
127
|
open: o,
|
|
123
|
-
onClose:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
onClose: n,
|
|
129
|
+
registerBackClose: !1,
|
|
130
|
+
ownerRef: c,
|
|
131
|
+
title: p,
|
|
132
|
+
ariaLabel: F,
|
|
133
|
+
viewResultsAction: E,
|
|
134
|
+
resetAction: M,
|
|
135
|
+
footerActions: S,
|
|
136
|
+
resultCount: _,
|
|
130
137
|
closeLabel: A,
|
|
131
|
-
className:
|
|
132
|
-
children:
|
|
133
|
-
})] }) : /* @__PURE__ */
|
|
134
|
-
root:
|
|
135
|
-
children: /* @__PURE__ */
|
|
138
|
+
className: C,
|
|
139
|
+
children: T
|
|
140
|
+
})] }) : /* @__PURE__ */ N(D, { children: [u(B), o && /* @__PURE__ */ a(ye, {
|
|
141
|
+
root: L,
|
|
142
|
+
children: /* @__PURE__ */ a("div", {
|
|
136
143
|
...V(),
|
|
137
144
|
ref: J,
|
|
138
|
-
id:
|
|
139
|
-
"data-test":
|
|
140
|
-
"data-testid":
|
|
145
|
+
id: l,
|
|
146
|
+
"data-test": i,
|
|
147
|
+
"data-testid": i,
|
|
141
148
|
role: t ? "dialog" : void 0,
|
|
142
|
-
"aria-labelledby": t &&
|
|
143
|
-
"aria-label": t && !
|
|
149
|
+
"aria-labelledby": t && p ? k : void 0,
|
|
150
|
+
"aria-label": t && !p ? F : void 0,
|
|
144
151
|
tabIndex: t ? void 0 : -1,
|
|
145
152
|
...b ? ae : {},
|
|
146
153
|
style: {
|
|
147
154
|
...b ? le : {},
|
|
148
|
-
|
|
149
|
-
minWidth:
|
|
155
|
+
...$,
|
|
156
|
+
minWidth: Ie,
|
|
150
157
|
width: ne,
|
|
151
158
|
maxWidth: re,
|
|
152
|
-
maxHeight:
|
|
159
|
+
maxHeight: K
|
|
153
160
|
},
|
|
154
|
-
className: ie("z-[1300]", "box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[inset_0_0_0_1px_var(--colors-delta-300),0px_4px_40px_0px_#22213366]",
|
|
155
|
-
children: /* @__PURE__ */
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
className: ie("z-[1300]", "box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[inset_0_0_0_1px_var(--colors-delta-300),0px_4px_40px_0px_#22213366]", C),
|
|
162
|
+
children: /* @__PURE__ */ a(me.Provider, {
|
|
163
|
+
value: c,
|
|
164
|
+
children: /* @__PURE__ */ a(Pe, {
|
|
165
|
+
dataTest: i,
|
|
166
|
+
title: p,
|
|
167
|
+
titleId: k,
|
|
168
|
+
viewResultsAction: h(oe),
|
|
169
|
+
resetAction: h(M),
|
|
170
|
+
footerActions: h(S),
|
|
171
|
+
closeLabel: A,
|
|
172
|
+
onClose: n,
|
|
173
|
+
children: h(T)
|
|
174
|
+
})
|
|
165
175
|
})
|
|
166
176
|
})
|
|
167
177
|
})] });
|
|
168
178
|
};
|
|
169
179
|
export {
|
|
170
|
-
|
|
180
|
+
Je as PopoverSheet
|
|
171
181
|
};
|