asma-ui-core 3.128.2 → 3.129.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/widget/widget/StyledWidget.js +4 -4
- package/dist/components/data-display/card/Card.js +327 -0
- package/dist/components/data-display/card/Card.module.js +7 -0
- package/dist/components/data-display/card/Card.types.js +21 -0
- package/dist/components/data-display/card/CardList.js +85 -0
- package/dist/components/data-display/card/CardParts.js +97 -0
- package/dist/components/data-display/card/cardModel.js +46 -0
- package/dist/components/data-display/interactive-chip/StyledInteractiveChip.js +4 -4
- package/dist/components/feedback/dialog/StyledDialog.js +5 -5
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +7 -7
- package/dist/components/inputs/button/StyledButton.js +1 -1
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +4 -4
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +1 -1
- package/dist/components/inputs/emoji-choice/StyledEmojiChoice.js +1 -1
- package/dist/components/inputs/phone-field/CountryCodeSelect.js +4 -4
- package/dist/components/inputs/select-autocomplete/SelectAutocompletePicker.js +1 -1
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +4 -4
- package/dist/components/navigation/menu/StyledMenuList.js +1 -1
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +9 -9
- package/dist/components/utils/popover/PopoverSheet.js +10 -10
- package/dist/index.js +632 -619
- package/dist/src/components/data-display/card/Card.d.ts +9 -0
- package/dist/src/components/data-display/card/Card.types.d.ts +193 -0
- package/dist/src/components/data-display/card/CardList.d.ts +45 -0
- package/dist/src/components/data-display/card/CardParts.d.ts +44 -0
- package/dist/src/components/data-display/card/cardModel.d.ts +61 -0
- package/dist/src/components/data-display/card/cardModel.test.d.ts +1 -0
- package/dist/src/components/data-display/card/index.d.ts +5 -0
- package/dist/src/components/data-display/card/story/cardStoryFixtures.d.ts +95 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { cn as n } from "../../../../helpers/cn.js";
|
|
|
2
2
|
import { firstTabbable as A } from "../../../../helpers/focusable.js";
|
|
3
3
|
import { StyledTooltip as le } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
4
4
|
import { DialogBusyContext as L, useDialogBusyBoundary as ie } from "../../dialog/DialogBusyContext.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { OverlayBackOwnerContext as oe, isOverlayBackNavigationPending as ae, useBackCloses as re } from "../../../../hooks/useBackCloses.hook.js";
|
|
6
|
+
import { useFocusTrap as se } from "../../../../hooks/useFocusTrap.hook.js";
|
|
7
|
+
import { useMobileMediaQuery as ce } from "../../../../hooks/useMediaQuery.hook.js";
|
|
8
8
|
import { fullScreenFieldWidthVars as me } from "../../../inputs/field-styles.js";
|
|
9
9
|
import { CloseBtn as V } from "../components/CloseBtn.js";
|
|
10
10
|
import { MinimizeBtn as $ } from "../components/MinimizeBtn.js";
|
|
@@ -20,7 +20,7 @@ var Pe = (C) => {
|
|
|
20
20
|
maximized: "",
|
|
21
21
|
minimized: "",
|
|
22
22
|
fullscreen: ""
|
|
23
|
-
}, dataTest: K, actionNode: X, locale: Y = "en", busyReason: Z, style: k, initialFocusRef: B } = C, r =
|
|
23
|
+
}, dataTest: K, actionNode: X, locale: Y = "en", busyReason: Z, style: k, initialFocusRef: B } = C, r = ce(), i = ue(Y), o = m(null), f = m(null), F = m(null), S = m(null), w = m(!1), y = m(null), p = W(), T = W(), { minimized: t, setMinimized: I, fullScreen: s, setFullScreen: M } = xe(C), c = s && !t, j = !!N, { busy: g, busyReason: E, contextValue: P } = ie(Z ?? i.waitUntilSaved), h = () => {
|
|
24
24
|
if (g) return !1;
|
|
25
25
|
I(!1), J();
|
|
26
26
|
};
|
|
@@ -49,9 +49,9 @@ var Pe = (C) => {
|
|
|
49
49
|
d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ?? A(d))?.focus({ preventScroll: !0 });
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
se(l && c, o, h), re({
|
|
53
53
|
active: l && !t,
|
|
54
|
-
requestClose: () => !c &&
|
|
54
|
+
requestClose: () => !c && ae() ? !1 : h(),
|
|
55
55
|
ownerRef: o
|
|
56
56
|
});
|
|
57
57
|
const ee = c ? r ? {
|
|
@@ -129,7 +129,7 @@ var Pe = (C) => {
|
|
|
129
129
|
"aria-modal": c ? !0 : void 0,
|
|
130
130
|
"aria-labelledby": te,
|
|
131
131
|
className: n(v.dialog, t && v.hidden, !s && b.maximized, s && b.fullscreen, c && "fixed z-[53] duration-0"),
|
|
132
|
-
children: /* @__PURE__ */ a(
|
|
132
|
+
children: /* @__PURE__ */ a(oe.Provider, {
|
|
133
133
|
value: o,
|
|
134
134
|
children: [/* @__PURE__ */ a("div", {
|
|
135
135
|
className: n("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyledTooltip as O } from "../../data-display/tooltip/StyledTooltip.js";
|
|
2
|
-
import { LoadingIcon as W } from "../../icons/loading-icon/LoadingIcon.js";
|
|
3
2
|
import e from "./StyledButton.module.js";
|
|
3
|
+
import { LoadingIcon as W } from "../../icons/loading-icon/LoadingIcon.js";
|
|
4
4
|
import { useReportDialogBusy as _ } from "../../feedback/dialog/DialogBusyContext.js";
|
|
5
5
|
import y from "clsx";
|
|
6
6
|
import "react";
|
|
@@ -2,9 +2,9 @@ import { cn as v } from "../../../../helpers/cn.js";
|
|
|
2
2
|
import { StyledTooltip as X } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
3
|
import { CloseIcon as j } from "../../../icons/close-icon/CloseIcon.js";
|
|
4
4
|
import { ErrorOutlineIcon as Y } from "../../../icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
5
|
-
import {
|
|
5
|
+
import { StyledButton as Z } from "../../button/StyledButton.js";
|
|
6
|
+
import { StyledChip as _ } from "../../../data-display/chip/StyledChip.js";
|
|
6
7
|
import { StyledInteractiveChip as O } from "../../../data-display/interactive-chip/StyledInteractiveChip.js";
|
|
7
|
-
import { StyledButton as _ } from "../../button/StyledButton.js";
|
|
8
8
|
import { useHelperSlot as ee } from "../../../../helpers/useHelperSlot.js";
|
|
9
9
|
import { fieldWidthStyle as te } from "../../field-styles.js";
|
|
10
10
|
import { useWrap as le } from "../helpers/useWrap.js";
|
|
@@ -71,7 +71,7 @@ var ve = ae((V, D) => {
|
|
|
71
71
|
arrow: !0,
|
|
72
72
|
children: /* @__PURE__ */ t("span", {
|
|
73
73
|
className: v(h && "cursor-not-allowed"),
|
|
74
|
-
children: i && !y ? /* @__PURE__ */ t(
|
|
74
|
+
children: i && !y ? /* @__PURE__ */ t(_, {
|
|
75
75
|
ref: k,
|
|
76
76
|
disabled: !!x || h,
|
|
77
77
|
classes: { root: "min-h-[32px] h-full" },
|
|
@@ -98,7 +98,7 @@ var ve = ae((V, D) => {
|
|
|
98
98
|
}, c(e));
|
|
99
99
|
}) : /* @__PURE__ */ t("span", { children: "-" })
|
|
100
100
|
}),
|
|
101
|
-
!R && J && !i && !x && /* @__PURE__ */ t(
|
|
101
|
+
!R && J && !i && !x && /* @__PURE__ */ t(Z, {
|
|
102
102
|
dataTest: "clear-selection-btn",
|
|
103
103
|
variant: "text",
|
|
104
104
|
startIcon: w === "medium" ? /* @__PURE__ */ t(j, {
|
|
@@ -3,8 +3,8 @@ import { StyledTooltip as E } from "../../../data-display/tooltip/StyledTooltip.
|
|
|
3
3
|
import { LoadingIcon as ie } from "../../../icons/loading-icon/LoadingIcon.js";
|
|
4
4
|
import { CheckIcon as ae } from "../../../icons/check-icon/CheckIcon.js";
|
|
5
5
|
import { PlusIconCircle as oe } from "../../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
6
|
-
import { StyledChip as F } from "../../../data-display/chip/StyledChip.js";
|
|
7
6
|
import { StyledCheckbox as ne } from "../../checkbox/base-ui/StyledCheckbox.js";
|
|
7
|
+
import { StyledChip as F } from "../../../data-display/chip/StyledChip.js";
|
|
8
8
|
import { fieldWidthStyle as de } from "../../field-styles.js";
|
|
9
9
|
import { StyledInputField as se } from "../../input-field/StyledInputField.js";
|
|
10
10
|
import { StyledSelectAutocomplete as ce } from "../../select-autocomplete/StyledSelectAutocomplete.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as u } from "../../../helpers/cn.js";
|
|
2
2
|
import { ChevronDownIcon as P } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
|
-
import { StyledRadio as $ } from "../radio-button/base-ui/StyledRadio.js";
|
|
4
3
|
import { StyledButton as x } from "../button/StyledButton.js";
|
|
4
|
+
import { StyledRadio as $ } from "../radio-button/base-ui/StyledRadio.js";
|
|
5
5
|
import { HelperRow as H } from "../../../helpers/HelperRow.js";
|
|
6
6
|
import { useHelperSlot as q } from "../../../helpers/useHelperSlot.js";
|
|
7
7
|
import { StyledInputField as D } from "../input-field/StyledInputField.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as f } from "../../../helpers/cn.js";
|
|
2
2
|
import { ChevronDownIcon as F } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { StyledPopover as M } from "../../utils/popover/StyledPopover.js";
|
|
4
|
+
import { useFullScreenPickerMediaQuery as Q } from "../../../hooks/useMediaQuery.hook.js";
|
|
5
5
|
import { notchedOutlineClass as U } from "../field-styles.js";
|
|
6
6
|
import { StyledSearchField as q } from "../search-field/StyledSearchField.js";
|
|
7
7
|
import { FullScreenPicker as L } from "../full-screen-picker/FullScreenPicker.js";
|
|
@@ -10,7 +10,7 @@ import { useCountryPicker as H } from "./useCountryPicker.js";
|
|
|
10
10
|
import { useEffect as P, useId as J, useRef as w, useState as m } from "react";
|
|
11
11
|
import { Fragment as V, jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
12
12
|
var ae = ({ dataTest: r, countries: y, value: s, onChange: O, disabled: c, selectCountryLabel: g, searchPlaceholder: A, renderFlag: x, labelledBy: E, className: B }) => {
|
|
13
|
-
const [t, d] = m(!1), [R, u] = m(!1), [b, a] = m(""), [W, j] = m(null), v = w(null), I = w(null), C = w(!1), i =
|
|
13
|
+
const [t, d] = m(!1), [R, u] = m(!1), [b, a] = m(""), [W, j] = m(null), v = w(null), I = w(null), C = w(!1), i = Q(), l = `${J()}-country-listbox`, k = y.find((e) => e.iso2 === s), D = k === void 0 ? "" : `+${k.dialCode}`, o = H({
|
|
14
14
|
countries: y,
|
|
15
15
|
selectedIso2: s,
|
|
16
16
|
query: b,
|
|
@@ -152,7 +152,7 @@ var ae = ({ dataTest: r, countries: y, value: s, onChange: O, disabled: c, selec
|
|
|
152
152
|
slotProps: { htmlInput: S }
|
|
153
153
|
}),
|
|
154
154
|
children: N(!0)
|
|
155
|
-
}) : /* @__PURE__ */ n(
|
|
155
|
+
}) : /* @__PURE__ */ n(M, {
|
|
156
156
|
open: t,
|
|
157
157
|
anchorEl: W,
|
|
158
158
|
onClose: o.dismiss,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn as re } from "../../../helpers/cn.js";
|
|
2
|
-
import { StyledCheckbox as Ne } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
3
2
|
import { StyledButton as F } from "../button/StyledButton.js";
|
|
3
|
+
import { StyledCheckbox as Ne } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
4
4
|
import { StyledEmptyPage as De } from "../../feedback/empty-page/StyledEmptyPage.js";
|
|
5
5
|
import { StyledSearchField as Se } from "../search-field/StyledSearchField.js";
|
|
6
6
|
import { useAnnouncer as $e } from "../full-screen-picker/PickerLiveRegion.js";
|
|
@@ -4,10 +4,10 @@ import { ChevronDownIcon as Nt } from "../../icons/chevron-down-icon/ChevronDown
|
|
|
4
4
|
import { CloseIcon as Pt } from "../../icons/close-icon/CloseIcon.js";
|
|
5
5
|
import { CheckIcon as Ct } from "../../icons/check-icon/CheckIcon.js";
|
|
6
6
|
import { PlusIconCircle as At } from "../../icons/plus-icon-circle/PlusIconCircle.js";
|
|
7
|
-
import { StyledChip as St } from "../../data-display/chip/StyledChip.js";
|
|
8
7
|
import { StyledCheckbox as ve } from "../checkbox/base-ui/StyledCheckbox.js";
|
|
8
|
+
import { useBackCloses as St } from "../../../hooks/useBackCloses.hook.js";
|
|
9
9
|
import { useFullScreenPickerMediaQuery as Rt } from "../../../hooks/useMediaQuery.hook.js";
|
|
10
|
-
import {
|
|
10
|
+
import { StyledChip as Mt } from "../../data-display/chip/StyledChip.js";
|
|
11
11
|
import { fieldWidthStyle as $t } from "../field-styles.js";
|
|
12
12
|
import { LoadingIcon as Ft } from "../../../table/shared-components/LoadingIcon.js";
|
|
13
13
|
import { PickerLiveRegion as _t, useAnnouncer as Lt } from "../full-screen-picker/PickerLiveRegion.js";
|
|
@@ -77,7 +77,7 @@ function Dr({ dataTest: r, options: b, renderInput: Ne, value: F, onChange: P, g
|
|
|
77
77
|
} })
|
|
78
78
|
]
|
|
79
79
|
}), { getReferenceProps: rt, getFloatingProps: lt, getItemProps: ot } = Jt([Qt(he, { enabled: !y }), Xt(he, { role: "listbox" })]);
|
|
80
|
-
|
|
80
|
+
St({
|
|
81
81
|
active: n && !y,
|
|
82
82
|
requestClose: () => i(!1)
|
|
83
83
|
});
|
|
@@ -131,7 +131,7 @@ function Dr({ dataTest: r, options: b, renderInput: Ne, value: F, onChange: P, g
|
|
|
131
131
|
n && s != null && (s === -1 || f[s] !== void 0) && (xe = s === -1 ? `${r}-select-all` : `${r}-option-${s}`);
|
|
132
132
|
const ft = (e) => {
|
|
133
133
|
e.preventDefault(), !(A || p) && (E.current?.focus(), i(!n));
|
|
134
|
-
}, pt = l ? K ? K(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ o(
|
|
134
|
+
}, pt = l ? K ? K(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ o(Mt, {
|
|
135
135
|
dataTest: `selected-chip-${d(e)}`,
|
|
136
136
|
label: d(e),
|
|
137
137
|
readOnly: p,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn as R } from "../../../helpers/cn.js";
|
|
2
|
-
import { consumerOverrides as T } from "../../../helpers/classOverride.js";
|
|
3
2
|
import p from "./StyledMenu.module.js";
|
|
3
|
+
import { consumerOverrides as T } from "../../../helpers/classOverride.js";
|
|
4
4
|
import { useEffect as M, useLayoutEffect as k, useRef as q } from "react";
|
|
5
5
|
import { jsx as A } from "react/jsx-runtime";
|
|
6
6
|
var d = '[role="menu"], [role="listbox"]', y = '[role="menuitem"]', E = (r) => Array.from(r.childNodes).flatMap((t) => t instanceof HTMLElement ? t.hidden ? [] : t.matches(d) ? [null] : t.matches(y) ? [t] : t.querySelector(y) ? E(t) : [null] : t.textContent?.trim() ? [null] : []), h = (r) => r ? Array.from(r.querySelectorAll('[role="menuitem"]')) : [], v = (r) => h(r).filter((t) => t.getAttribute("aria-disabled") !== "true"), x = (r, t) => {
|
|
@@ -3,10 +3,10 @@ import { registerOpenModalDialog as z } from "../../../hooks/useTopLayer.hook.js
|
|
|
3
3
|
import { CloseIcon as J } from "../../icons/close-icon/CloseIcon.js";
|
|
4
4
|
import { IndeterminateIcon as W } from "../../icons/indeterminate-icon/IndeterminateIcon.js";
|
|
5
5
|
import { StyledButton as _ } from "../../inputs/button/StyledButton.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { OverlayBackOwnerContext as Z, isOverlayBackEnabled as j, requestCloseTopOverlayBack as y, useBackCloses as ee } from "../../../hooks/useBackCloses.hook.js";
|
|
7
|
+
import { useDebouncedValue as te } from "../../../hooks/useDebouncedValue.hook.js";
|
|
8
|
+
import { useFocusTrap as re } from "../../../hooks/useFocusTrap.hook.js";
|
|
9
|
+
import { useShortViewportMediaQuery as oe } from "../../../hooks/useMediaQuery.hook.js";
|
|
10
10
|
import { SHEET_TEXT as ne } from "./sheetCopy.js";
|
|
11
11
|
import { formatResultsLabel as ae } from "./formatResultsLabel.js";
|
|
12
12
|
import { useBodyScrollLock as se } from "../../../hooks/useBodyScrollLock.hook.js";
|
|
@@ -15,14 +15,14 @@ import { useDragToDismiss as le } from "./useDragToDismiss.hook.js";
|
|
|
15
15
|
import { useEffect as g, useId as ce, useLayoutEffect as de, useRef as c, useState as ue } from "react";
|
|
16
16
|
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
17
17
|
var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLabel: q, children: $, viewResultsAction: E, resetAction: A, footerActions: H, resultCount: S, locale: k = "en", closeLabel: U = ne[k].close, className: V, registerBackClose: K = !0, ownerRef: G }) => {
|
|
18
|
-
const N = ce(), i = c(null), R = c(null), B = c(null), L = G ?? i, h = c(!1), [x, C] = ue(!1), Q =
|
|
18
|
+
const N = ce(), i = c(null), R = c(null), B = c(null), L = G ?? i, h = c(!1), [x, C] = ue(!1), Q = oe(), f = c(s), O = c(t);
|
|
19
19
|
g(() => {
|
|
20
20
|
f.current = s, O.current = t;
|
|
21
21
|
}, [s, t]);
|
|
22
22
|
const { dragHandleProps: X, dragOffset: I } = le(R, () => {
|
|
23
23
|
f.current("drag");
|
|
24
24
|
});
|
|
25
|
-
se(t),
|
|
25
|
+
se(t), re(t, i), g(() => {
|
|
26
26
|
if (!t) return;
|
|
27
27
|
const e = (r) => {
|
|
28
28
|
r.key === "Escape" && (h.current = !0, window.setTimeout(() => {
|
|
@@ -36,7 +36,7 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
|
|
|
36
36
|
return window.addEventListener("keydown", e, !0), window.addEventListener("keydown", n), () => {
|
|
37
37
|
window.removeEventListener("keydown", e, !0), window.removeEventListener("keydown", n);
|
|
38
38
|
};
|
|
39
|
-
}, [t]),
|
|
39
|
+
}, [t]), ee({
|
|
40
40
|
active: t && K,
|
|
41
41
|
requestClose: () => f.current("escape"),
|
|
42
42
|
ownerRef: L
|
|
@@ -65,7 +65,7 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
|
|
|
65
65
|
};
|
|
66
66
|
return e.addEventListener("close", a), () => e.removeEventListener("close", a);
|
|
67
67
|
}, [t]);
|
|
68
|
-
const D = ae(
|
|
68
|
+
const D = ae(te(S, me), k);
|
|
69
69
|
if (!t) return null;
|
|
70
70
|
const Y = { close: () => {
|
|
71
71
|
s("action");
|
|
@@ -97,7 +97,7 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
className: l(ie.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"),
|
|
100
|
-
children: /* @__PURE__ */ u(
|
|
100
|
+
children: /* @__PURE__ */ u(Z.Provider, {
|
|
101
101
|
value: L,
|
|
102
102
|
children: [/* @__PURE__ */ o("div", {
|
|
103
103
|
"aria-hidden": "true",
|
|
@@ -2,10 +2,10 @@ import { cn as Le } from "../../../helpers/cn.js";
|
|
|
2
2
|
import { firstTabbable as ne } from "../../../helpers/focusable.js";
|
|
3
3
|
import { TOP_LAYER_PROPS as Se, TOP_LAYER_RESET_STYLE as Ce, getOpenModalDialogAncestor as _e, shouldUsePopoverTopLayer as Ie, useTopLayerRef as Me } from "../../../hooks/useTopLayer.hook.js";
|
|
4
4
|
import { StyledButton as ke } from "../../inputs/button/StyledButton.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { OverlayBackOwnerContext as He, requestCloseTopOverlayBack as We, useBackCloses as Be } from "../../../hooks/useBackCloses.hook.js";
|
|
6
|
+
import { useDebouncedValue as De } from "../../../hooks/useDebouncedValue.hook.js";
|
|
7
|
+
import { useFocusTrap as qe } from "../../../hooks/useFocusTrap.hook.js";
|
|
8
|
+
import { useMobileMediaQuery as Xe } from "../../../hooks/useMediaQuery.hook.js";
|
|
9
9
|
import { SHEET_TEXT as $e } from "../bottom-sheet/sheetCopy.js";
|
|
10
10
|
import { formatResultsLabel as Ne } from "../bottom-sheet/formatResultsLabel.js";
|
|
11
11
|
import { StyledBottomSheet as je } from "../bottom-sheet/StyledBottomSheet.js";
|
|
@@ -17,7 +17,7 @@ var C = 240, nt = {
|
|
|
17
17
|
info: 472,
|
|
18
18
|
action: 472
|
|
19
19
|
}, se = 0.6, ae = "calc(100vw - 32px)", Pt = ({ dataTest: p, renderTrigger: _, variant: I = "info", title: E, children: M, viewResultsAction: k, resetAction: H, footerActions: W, resultCount: x, locale: R = "en", closeLabel: B = $e[R].close, ariaLabel: D, onOpenChange: q, className: X, align: $ = "auto", ignoreOutside: N }) => {
|
|
20
|
-
const g = Ue(), j = `${g}-title`, [o, ce] = l(!1), [K, le] = l(), [ue, U] = l(), [de, fe] = l("start"), [T, Y] = l(), [me, z] = l(C), u =
|
|
20
|
+
const g = Ue(), j = `${g}-title`, [o, ce] = l(!1), [K, le] = l(), [ue, U] = l(), [de, fe] = l("start"), [T, Y] = l(), [me, z] = l(C), u = Xe(), n = I === "action", pe = u && !n, w = u && n, y = d((e) => {
|
|
21
21
|
ce(e), q?.(e);
|
|
22
22
|
}, [q]), { refs: b, floatingStyles: ge, context: he, placement: V, isPositioned: ve } = et({
|
|
23
23
|
open: o,
|
|
@@ -70,17 +70,17 @@ var C = 240, nt = {
|
|
|
70
70
|
})]), s = d(() => {
|
|
71
71
|
y(!1);
|
|
72
72
|
}, [y]);
|
|
73
|
-
|
|
73
|
+
Be({
|
|
74
74
|
active: o,
|
|
75
75
|
requestClose: s,
|
|
76
76
|
ownerRef: c
|
|
77
77
|
}), v(() => {
|
|
78
78
|
if (!o || w) return;
|
|
79
79
|
const e = (t) => {
|
|
80
|
-
t.key !== "Escape" || t.defaultPrevented || t.isComposing || (t.preventDefault(), t.stopImmediatePropagation(),
|
|
80
|
+
t.key !== "Escape" || t.defaultPrevented || t.isComposing || (t.preventDefault(), t.stopImmediatePropagation(), We(t));
|
|
81
81
|
};
|
|
82
82
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
83
|
-
}, [o, w]),
|
|
83
|
+
}, [o, w]), qe(o && n && r !== null, c);
|
|
84
84
|
const [Z, Te] = l(!1);
|
|
85
85
|
v(() => {
|
|
86
86
|
if (!r || n && !Z) return;
|
|
@@ -155,7 +155,7 @@ var C = 240, nt = {
|
|
|
155
155
|
"aria-haspopup": n ? "dialog" : void 0,
|
|
156
156
|
"aria-describedby": !n && o ? g : void 0
|
|
157
157
|
}
|
|
158
|
-
}, P = (e) => typeof e == "function" ? e({ close: s }) : e, be =
|
|
158
|
+
}, P = (e) => typeof e == "function" ? e({ close: s }) : e, be = De(x, 500), Fe = k ?? (x === void 0 ? void 0 : /* @__PURE__ */ m(ke, {
|
|
159
159
|
dataTest: `${p}-view-results`,
|
|
160
160
|
type: "button",
|
|
161
161
|
variant: "text",
|
|
@@ -203,7 +203,7 @@ var C = 240, nt = {
|
|
|
203
203
|
maxHeight: ue
|
|
204
204
|
},
|
|
205
205
|
className: Le("z-[1300]", "box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[0px_4px_40px_0px_#22213366]", X),
|
|
206
|
-
children: /* @__PURE__ */ m(
|
|
206
|
+
children: /* @__PURE__ */ m(He.Provider, {
|
|
207
207
|
value: c,
|
|
208
208
|
children: /* @__PURE__ */ m(Ke, {
|
|
209
209
|
dataTest: p,
|