asma-ui-core 3.94.1 → 3.95.1
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/inputs/select-autocomplete/StyledSelectAutocomplete.js +30 -28
- package/dist/components/utils/popover/PopoverAnatomy.js +13 -13
- package/dist/components/utils/popover/PopoverSheet.js +29 -29
- package/dist/src/components/utils/popover/PopoverAnatomy.d.ts +11 -6
- package/package.json +1 -1
|
@@ -10,14 +10,14 @@ import { LoadingIcon as ft } from "../../../table/shared-components/LoadingIcon.
|
|
|
10
10
|
import W from "./StyledSelectAutocomplete.module.js";
|
|
11
11
|
import { useEffect as ce, useMemo as U, useRef as de, useState as D } from "react";
|
|
12
12
|
import { jsx as s, jsxs as I } from "react/jsx-runtime";
|
|
13
|
-
import { FloatingPortal as mt, autoUpdate as ht, flip as bt, offset as gt, shift as xt, size as
|
|
14
|
-
var It = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l),
|
|
15
|
-
function zt({ dataTest: l, options: b, renderInput: pe, value:
|
|
13
|
+
import { FloatingPortal as mt, autoUpdate as ht, flip as bt, offset as gt, shift as xt, size as wt, useDismiss as yt, useFloating as kt, useInteractions as vt, useMergeRefs as ue, useRole as Dt } from "@floating-ui/react";
|
|
14
|
+
var It = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), Nt = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
|
|
15
|
+
function zt({ dataTest: l, options: b, renderInput: pe, value: N, onChange: A, getOptionLabel: fe, getOptionKey: C, isOptionEqualToValue: V, renderOption: B, renderValue: T, filterOptions: _, loading: Y, loadingText: me = "Loading…", noOptionsText: he = "No options", disabled: S, readOnly: g, error: be, helperText: ge, size: xe = "small", disableClearable: we, disableCloseOnSelect: ye, popupIcon: ke, autoHeight: ve, multiple: De, allowSelectAll: F, selectAllLabel: Ie = "Select all", fullWidth: Ne, classes: Ae, inputValue: M, onInputChange: Ce, open: q, onOpen: Se, onClose: Me, className: Re, wrapperClassName: Pe, getOptionDisabled: $e, slotProps: G }) {
|
|
16
16
|
const r = De === !0, d = fe ?? It, R = (e, t) => V ? V(e, t) : e === t, [Le, Ee] = D(!1), a = q ?? Le, u = (e) => {
|
|
17
|
-
e && (g ||
|
|
17
|
+
e && (g || S) || (q === void 0 && Ee(e), e ? Se?.() : (x(null), Me?.()));
|
|
18
18
|
}, [_e, J] = D(""), h = M ?? _e, P = (e, t, n) => {
|
|
19
|
-
M === void 0 && J(t),
|
|
20
|
-
}, [o, x] = D(null), Q = `${l}-listbox`, X = de([]), Z = de(null), [Fe, Oe] = D(null), [K, je] = D(null), i = r ? Array.isArray(
|
|
19
|
+
M === void 0 && J(t), Ce?.(e, t, n);
|
|
20
|
+
}, [o, x] = D(null), Q = `${l}-listbox`, X = de([]), Z = de(null), [Fe, Oe] = D(null), [K, je] = D(null), i = r ? Array.isArray(N) ? N : [] : [], w = r ? null : N ?? null, ee = !r && w !== null ? d(w) : "";
|
|
21
21
|
ce(() => {
|
|
22
22
|
M !== void 0 || r || J(ee);
|
|
23
23
|
}, [
|
|
@@ -25,10 +25,10 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
25
25
|
r,
|
|
26
26
|
ee
|
|
27
27
|
]);
|
|
28
|
-
const O = (e) => r ? i.some((t) => R(e, t)) :
|
|
28
|
+
const O = (e) => r ? i.some((t) => R(e, t)) : w !== null && R(e, w), $ = (e) => $e?.(e) ?? Nt(e), te = U(() => {
|
|
29
29
|
const e = [...b];
|
|
30
30
|
if (_) return _(e, { inputValue: h });
|
|
31
|
-
const t = !r &&
|
|
31
|
+
const t = !r && w !== null ? d(w).toLowerCase() : null;
|
|
32
32
|
if (!h || h.toLowerCase() === t) return e;
|
|
33
33
|
const n = h.toLowerCase();
|
|
34
34
|
return e.filter((f) => d(f).toLowerCase().includes(n));
|
|
@@ -36,7 +36,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
36
36
|
b,
|
|
37
37
|
h,
|
|
38
38
|
_,
|
|
39
|
-
|
|
39
|
+
N
|
|
40
40
|
]), p = U(() => te.slice(0, 100), [te]), le = p.flatMap((e, t) => $(e) ? [] : [t]), c = F && r ? [-1, ...le] : le, k = p.findIndex(O);
|
|
41
41
|
ce(() => {
|
|
42
42
|
if (!a) return;
|
|
@@ -60,26 +60,26 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
60
60
|
gt(0),
|
|
61
61
|
bt({ padding: 8 }),
|
|
62
62
|
xt({ padding: 8 }),
|
|
63
|
-
|
|
63
|
+
wt({ apply({ rects: e, availableHeight: t }) {
|
|
64
64
|
Oe(e.reference.width), je(ve ? t - 8 : Math.min(t - 8, 320));
|
|
65
65
|
} })
|
|
66
66
|
]
|
|
67
|
-
}), { getReferenceProps: He, getFloatingProps: We, getItemProps: Ue } = vt([
|
|
67
|
+
}), { getReferenceProps: He, getFloatingProps: We, getItemProps: Ue } = vt([yt(re), Dt(re, { role: "listbox" })]), Ve = ue([L.setReference]), oe = U(() => a ? dt(L.reference.current) : void 0, [a, L]), j = ut(oe), Be = ue([pt(L.setFloating, j)]), Te = (e) => c.includes(k) ? k : c[e === 1 ? 0 : c.length - 1] ?? null, Ye = (e) => {
|
|
68
68
|
c.length !== 0 && x((t) => {
|
|
69
69
|
const n = c.indexOf(t ?? k);
|
|
70
70
|
return n === -1 ? c[e === 1 ? 0 : c.length - 1] ?? null : c[Math.min(Math.max(n + e, 0), c.length - 1)] ?? null;
|
|
71
71
|
});
|
|
72
|
-
}, v = (e, t, n = !r || !
|
|
72
|
+
}, v = (e, t, n = !r || !ye) => {
|
|
73
73
|
if (r) {
|
|
74
|
-
const f = i.some((m) => R(t, m)),
|
|
75
|
-
|
|
74
|
+
const f = i.some((m) => R(t, m)), y = f ? i.filter((m) => !R(t, m)) : [...i, t];
|
|
75
|
+
A?.(e, y, f ? "removeOption" : "selectOption", { option: t }), P(e, "", "reset"), n && u(!1);
|
|
76
76
|
} else
|
|
77
|
-
|
|
77
|
+
A?.(e, t, "selectOption", { option: t }), P(e, d(t), "reset"), n && u(!1);
|
|
78
78
|
}, se = (e) => {
|
|
79
|
-
|
|
79
|
+
A?.(e, r ? [] : null, "clear", void 0), P(e, "", "clear");
|
|
80
80
|
}, z = (e) => {
|
|
81
81
|
const t = b.length > 0 && i.length === b.length;
|
|
82
|
-
|
|
82
|
+
A?.(e, t ? [] : b, t ? "clear" : "selectOption", void 0);
|
|
83
83
|
}, qe = (e) => {
|
|
84
84
|
if (e.key === "Backspace" && h === "" && ne) {
|
|
85
85
|
const t = i[i.length - 1];
|
|
@@ -107,18 +107,18 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
107
107
|
const t = p[o];
|
|
108
108
|
$(t) || v(e, t, !1);
|
|
109
109
|
} else e.key === "Escape" && a ? (e.preventDefault(), e.stopPropagation(), u(!1)) : e.key === "Tab" && u(!1);
|
|
110
|
-
}, ne = !
|
|
110
|
+
}, ne = !we && !g && !S && (r ? i.length > 0 : w !== null);
|
|
111
111
|
let ae;
|
|
112
112
|
a && o != null && (o === -1 || p[o] !== void 0) && (ae = o === -1 ? `${l}-select-all` : `${l}-option-${o}`);
|
|
113
113
|
const Ge = (e) => {
|
|
114
|
-
e.preventDefault(), !(
|
|
114
|
+
e.preventDefault(), !(S || g) && (Z.current?.focus(), u(!a));
|
|
115
115
|
}, Je = r ? T ? T(i, ({ index: e }) => ({ "data-index": e })) : i.map((e, t) => /* @__PURE__ */ s(at, {
|
|
116
116
|
dataTest: `selected-chip-${d(e)}`,
|
|
117
117
|
label: d(e),
|
|
118
118
|
readOnly: g,
|
|
119
119
|
deleteButtonTabIndex: -1,
|
|
120
120
|
onDelete: g ? void 0 : (n) => v(n, e)
|
|
121
|
-
},
|
|
121
|
+
}, C ? C(e) : `${d(e)}-${t}`)) : void 0, Qe = /* @__PURE__ */ I("span", {
|
|
122
122
|
className: "flex items-center gap-1",
|
|
123
123
|
children: [
|
|
124
124
|
Y && /* @__PURE__ */ s(ft, {
|
|
@@ -161,7 +161,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
161
161
|
})
|
|
162
162
|
]
|
|
163
163
|
}), Xe = {
|
|
164
|
-
disabled:
|
|
164
|
+
disabled: S,
|
|
165
165
|
size: xe,
|
|
166
166
|
fullWidth: !0,
|
|
167
167
|
error: be,
|
|
@@ -191,9 +191,9 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}, Ze = E("asma-pressable", "relative box-border flex min-h-10 cursor-pointer items-center gap-x-3 px-3 py-1.5 text-base text-delta-800", "aria-selected:bg-gama-50 hover:bg-delta-50", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300"), Ke = (e, t, n) => {
|
|
194
|
-
const { key: f, ...
|
|
194
|
+
const { key: f, ...y } = e;
|
|
195
195
|
return /* @__PURE__ */ I("li", {
|
|
196
|
-
...
|
|
196
|
+
...y,
|
|
197
197
|
children: [
|
|
198
198
|
e["data-active"] !== void 0 && /* @__PURE__ */ s("span", {
|
|
199
199
|
"aria-hidden": "true",
|
|
@@ -203,6 +203,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
203
203
|
dataTest: `${l}-${d(t)}-checkbox`,
|
|
204
204
|
checked: n.selected,
|
|
205
205
|
size: "medium",
|
|
206
|
+
checkboxClassName: "!h-4 !w-4",
|
|
206
207
|
hideWrapper: !0,
|
|
207
208
|
decorative: !0
|
|
208
209
|
}) : /* @__PURE__ */ s("span", {
|
|
@@ -228,7 +229,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
228
229
|
},
|
|
229
230
|
onMouseMove: () => x(null)
|
|
230
231
|
}),
|
|
231
|
-
key:
|
|
232
|
+
key: C ? String(C(e)) : `${d(e)}-${t}`,
|
|
232
233
|
ref: (m) => {
|
|
233
234
|
X.current[t] = m;
|
|
234
235
|
},
|
|
@@ -238,15 +239,15 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
238
239
|
"aria-disabled": n || void 0,
|
|
239
240
|
"data-active": o === t ? "" : void 0,
|
|
240
241
|
className: Ze
|
|
241
|
-
},
|
|
242
|
+
}, y = {
|
|
242
243
|
selected: O(e),
|
|
243
244
|
index: t,
|
|
244
245
|
inputValue: h
|
|
245
246
|
};
|
|
246
|
-
return B ? B(f, e,
|
|
247
|
+
return B ? B(f, e, y) : Ke(f, e, y);
|
|
247
248
|
}, tt = !!(F && r), H = b.length > 0 && i.length === b.length, lt = i.length > 0 && !H;
|
|
248
249
|
return /* @__PURE__ */ I("div", {
|
|
249
|
-
className: E(W.styledSelectAutocompleteWrapper, !
|
|
250
|
+
className: E(W.styledSelectAutocompleteWrapper, !Ne && "w-auto", Pe, Re),
|
|
250
251
|
children: [pe(Xe), a && /* @__PURE__ */ s(mt, {
|
|
251
252
|
root: oe,
|
|
252
253
|
children: /* @__PURE__ */ I("ul", {
|
|
@@ -264,7 +265,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
264
265
|
id: Q,
|
|
265
266
|
role: "listbox",
|
|
266
267
|
"aria-multiselectable": r ? !0 : void 0,
|
|
267
|
-
className: E("z-[1300] m-0 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", tt && "py-0", "[&>li:not(:last-child)]:border-0 [&>li:not(:last-child)]:border-b", "[&>li:not(:last-child)]:border-solid [&>li:not(:last-child)]:border-delta-200",
|
|
268
|
+
className: E("z-[1300] m-0 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", tt && "py-0", "[&>li:not(:last-child)]:border-0 [&>li:not(:last-child)]:border-b", "[&>li:not(:last-child)]:border-solid [&>li:not(:last-child)]:border-delta-200", Ae?.listbox, G?.popper?.className),
|
|
268
269
|
children: [F && r && /* @__PURE__ */ I("li", {
|
|
269
270
|
id: `${l}-select-all`,
|
|
270
271
|
role: "option",
|
|
@@ -285,6 +286,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
|
|
|
285
286
|
checked: H,
|
|
286
287
|
indeterminate: lt,
|
|
287
288
|
size: "medium",
|
|
289
|
+
checkboxClassName: "!h-4 !w-4",
|
|
288
290
|
hideWrapper: !0,
|
|
289
291
|
decorative: !0
|
|
290
292
|
}),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { cn as p } from "../../../helpers/cn.js";
|
|
2
2
|
import { CloseIcon as m } from "../../icons/close-icon/CloseIcon.js";
|
|
3
|
-
import { StyledButton as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
var
|
|
6
|
-
/* @__PURE__ */
|
|
3
|
+
import { StyledButton as c } from "../../inputs/button/StyledButton.js";
|
|
4
|
+
import { Fragment as f, jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
5
|
+
var g = "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]", y = ({ dataTest: i, title: a, titleId: d, children: n, viewResultsAction: l, resetAction: r, footerActions: o, closeLabel: s, onClose: x }) => /* @__PURE__ */ t(f, { children: [
|
|
6
|
+
/* @__PURE__ */ t("div", {
|
|
7
7
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
8
8
|
children: [
|
|
9
|
-
|
|
10
|
-
id:
|
|
9
|
+
a && /* @__PURE__ */ e("div", {
|
|
10
|
+
id: d,
|
|
11
11
|
className: "shrink-0 truncate pb-1 pl-4 pr-10 pt-2 text-lg font-semibold leading-7 text-delta-800",
|
|
12
|
-
children:
|
|
12
|
+
children: a
|
|
13
13
|
}),
|
|
14
14
|
/* @__PURE__ */ e("div", {
|
|
15
15
|
className: "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto py-2 pl-4 pr-10",
|
|
@@ -17,8 +17,8 @@ var y = "box-border flex flex-col overflow-hidden rounded-lg border border-solid
|
|
|
17
17
|
}),
|
|
18
18
|
/* @__PURE__ */ e("div", {
|
|
19
19
|
className: "absolute right-0 top-0",
|
|
20
|
-
children: /* @__PURE__ */ e(
|
|
21
|
-
dataTest: `${
|
|
20
|
+
children: /* @__PURE__ */ e(c, {
|
|
21
|
+
dataTest: `${i}-close`,
|
|
22
22
|
variant: "textGray",
|
|
23
23
|
type: "button",
|
|
24
24
|
"aria-label": s,
|
|
@@ -31,9 +31,9 @@ var y = "box-border flex flex-col overflow-hidden rounded-lg border border-solid
|
|
|
31
31
|
})
|
|
32
32
|
]
|
|
33
33
|
}),
|
|
34
|
-
(l ??
|
|
34
|
+
(l ?? r) && /* @__PURE__ */ t("div", {
|
|
35
35
|
className: p("flex shrink-0 items-start p-1", l ? "justify-between" : "justify-end"),
|
|
36
|
-
children: [l,
|
|
36
|
+
children: [l, r]
|
|
37
37
|
}),
|
|
38
38
|
o && /* @__PURE__ */ e("div", {
|
|
39
39
|
className: "flex shrink-0 flex-col items-end p-3",
|
|
@@ -41,6 +41,6 @@ var y = "box-border flex flex-col overflow-hidden rounded-lg border border-solid
|
|
|
41
41
|
})
|
|
42
42
|
] });
|
|
43
43
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
g as POPOVER_SURFACE_CLASSNAME,
|
|
45
|
+
y as PopoverAnatomy
|
|
46
46
|
};
|
|
@@ -2,53 +2,53 @@ import { cn as oe } from "../../../helpers/cn.js";
|
|
|
2
2
|
import { firstTabbable as re } from "../../../helpers/focusable.js";
|
|
3
3
|
import { TOP_LAYER_PROPS as ne, TOP_LAYER_RESET_STYLE as ie, getOpenModalDialogAncestor as se, shouldUsePopoverTopLayer as ae, useTopLayerRef as ce } from "../../../hooks/useTopLayer.hook.js";
|
|
4
4
|
import { StyledButton as le } from "../../inputs/button/StyledButton.js";
|
|
5
|
-
import { useMobileMediaQuery as
|
|
6
|
-
import { useDebouncedValue as
|
|
5
|
+
import { useMobileMediaQuery as ue } from "../../../hooks/useMediaQuery.hook.js";
|
|
6
|
+
import { useDebouncedValue as de } from "../../../hooks/useDebouncedValue.hook.js";
|
|
7
7
|
import { useFocusTrap as fe } from "../../../hooks/useFocusTrap.hook.js";
|
|
8
8
|
import { formatResultsLabel as pe } from "../bottom-sheet/formatResultsLabel.js";
|
|
9
9
|
import { StyledBottomSheet as me } from "../bottom-sheet/StyledBottomSheet.js";
|
|
10
10
|
import { PopoverAnatomy as ge } from "./PopoverAnatomy.js";
|
|
11
|
-
import { useCallback as m, useEffect as
|
|
11
|
+
import { useCallback as m, useEffect as b, useId as ve, useRef as y, useState as g } from "react";
|
|
12
12
|
import { Fragment as N, jsx as c, jsxs as W } from "react/jsx-runtime";
|
|
13
|
-
import { FloatingPortal as he, autoUpdate as xe, flip as
|
|
13
|
+
import { FloatingPortal as he, autoUpdate as xe, flip as _e, offset as Pe, shift as be, size as ye, useDismiss as Re, useFloating as Ee, useInteractions as Se, useMergeRefs as Te } from "@floating-ui/react";
|
|
14
14
|
var Ae = 240, Me = {
|
|
15
15
|
info: 472,
|
|
16
16
|
action: 472
|
|
17
|
-
}, we = 0.6, B = "calc(100vw - 32px)", je = ({ dataTest: s, renderTrigger:
|
|
18
|
-
const a = ve(), L = `${a}-title`, [o, X] = g(!1), [H, U] = g(), [Y, $] = g(),
|
|
17
|
+
}, we = 0.6, B = "calc(100vw - 32px)", je = ({ dataTest: s, renderTrigger: R, variant: E = "info", title: l, children: S, viewResultsAction: T, resetAction: A, footerActions: M, resultCount: v, closeLabel: w = "Lukk", ariaLabel: F, onOpenChange: I, className: O }) => {
|
|
18
|
+
const a = ve(), L = `${a}-title`, [o, X] = g(!1), [H, U] = g(), [Y, $] = g(), u = ue(), t = E === "action", j = u && !t, k = u && t, d = m((e) => {
|
|
19
19
|
X(e), I?.(e);
|
|
20
20
|
}, [I]), { refs: h, floatingStyles: q, context: z } = Ee({
|
|
21
21
|
open: o,
|
|
22
|
-
onOpenChange:
|
|
22
|
+
onOpenChange: d,
|
|
23
23
|
placement: "bottom-start",
|
|
24
24
|
strategy: "fixed",
|
|
25
25
|
whileElementsMounted: xe,
|
|
26
26
|
middleware: [
|
|
27
27
|
Pe(8),
|
|
28
|
-
...j ? [] : [
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
...j ? [] : [_e({ padding: 8 })],
|
|
29
|
+
be({ padding: 8 }),
|
|
30
|
+
ye({
|
|
31
31
|
padding: 8,
|
|
32
32
|
apply({ availableHeight: e }) {
|
|
33
33
|
$(Math.min(e, Math.round(window.innerHeight * we)));
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
36
|
]
|
|
37
|
-
}), { getFloatingProps: V } = Se([
|
|
37
|
+
}), { getFloatingProps: V } = Se([Re(z, {
|
|
38
38
|
enabled: !k,
|
|
39
39
|
escapeKey: !0,
|
|
40
40
|
outsidePress: (e) => {
|
|
41
41
|
const i = f.current;
|
|
42
42
|
return !(i && e.target instanceof Node && i.contains(e.target));
|
|
43
43
|
}
|
|
44
|
-
})]), x = ae(H), C =
|
|
44
|
+
})]), x = ae(H), C = y(null), [r, G] = g(null), K = m((e) => {
|
|
45
45
|
C.current = e, G(e);
|
|
46
|
-
}, []), Q = Te([ce(h.setFloating, x), K]), f =
|
|
46
|
+
}, []), Q = Te([ce(h.setFloating, x), K]), f = y(null), J = m((e) => {
|
|
47
47
|
f.current = e, h.setReference(e);
|
|
48
48
|
}, [h]), n = m(() => {
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
fe(o && t && r !== null, C),
|
|
49
|
+
d(!1);
|
|
50
|
+
}, [d]);
|
|
51
|
+
fe(o && t && r !== null, C), b(() => {
|
|
52
52
|
if (!r) return;
|
|
53
53
|
const e = requestAnimationFrame(() => {
|
|
54
54
|
(t ? re(r) : r)?.focus({ preventScroll: !0 });
|
|
@@ -56,7 +56,7 @@ var Ae = 240, Me = {
|
|
|
56
56
|
return () => {
|
|
57
57
|
cancelAnimationFrame(e);
|
|
58
58
|
};
|
|
59
|
-
}, [r, t]),
|
|
59
|
+
}, [r, t]), b(() => {
|
|
60
60
|
if (!r || t) return;
|
|
61
61
|
const e = (i) => {
|
|
62
62
|
const P = i.relatedTarget;
|
|
@@ -70,14 +70,14 @@ var Ae = 240, Me = {
|
|
|
70
70
|
t,
|
|
71
71
|
n
|
|
72
72
|
]);
|
|
73
|
-
const
|
|
74
|
-
|
|
73
|
+
const _ = y(!1);
|
|
74
|
+
b(() => {
|
|
75
75
|
if (o) {
|
|
76
|
-
|
|
76
|
+
_.current = !0;
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
if (!
|
|
80
|
-
|
|
79
|
+
if (!_.current) return;
|
|
80
|
+
_.current = !1;
|
|
81
81
|
const e = f.current;
|
|
82
82
|
if (!e) return;
|
|
83
83
|
const i = requestAnimationFrame(() => {
|
|
@@ -96,21 +96,21 @@ var Ae = 240, Me = {
|
|
|
96
96
|
n();
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
U(se(e.currentTarget)),
|
|
99
|
+
U(se(e.currentTarget)), d(!0);
|
|
100
100
|
},
|
|
101
101
|
"aria-expanded": o,
|
|
102
102
|
"aria-controls": o ? a : void 0,
|
|
103
103
|
"aria-haspopup": t ? "dialog" : void 0,
|
|
104
104
|
"aria-describedby": !t && o ? a : void 0
|
|
105
105
|
}
|
|
106
|
-
}, p = (e) => typeof e == "function" ? e({ close: n }) : e, Z =
|
|
106
|
+
}, p = (e) => typeof e == "function" ? e({ close: n }) : e, Z = de(v, 500), ee = T ?? (v === void 0 ? void 0 : /* @__PURE__ */ c(le, {
|
|
107
107
|
dataTest: `${s}-view-results`,
|
|
108
108
|
type: "button",
|
|
109
109
|
variant: "text",
|
|
110
110
|
onClick: n,
|
|
111
111
|
children: pe(Z)
|
|
112
|
-
})), te =
|
|
113
|
-
return k ? /* @__PURE__ */ W(N, { children: [
|
|
112
|
+
})), te = u ? B : Me[E];
|
|
113
|
+
return k ? /* @__PURE__ */ W(N, { children: [R(D), /* @__PURE__ */ c(me, {
|
|
114
114
|
id: a,
|
|
115
115
|
dataTest: s,
|
|
116
116
|
open: o,
|
|
@@ -124,7 +124,7 @@ var Ae = 240, Me = {
|
|
|
124
124
|
closeLabel: w,
|
|
125
125
|
className: O,
|
|
126
126
|
children: S
|
|
127
|
-
})] }) : /* @__PURE__ */ W(N, { children: [
|
|
127
|
+
})] }) : /* @__PURE__ */ W(N, { children: [R(D), o && /* @__PURE__ */ c(he, {
|
|
128
128
|
root: H,
|
|
129
129
|
children: /* @__PURE__ */ c("div", {
|
|
130
130
|
...V(),
|
|
@@ -141,11 +141,11 @@ var Ae = 240, Me = {
|
|
|
141
141
|
...x ? ie : {},
|
|
142
142
|
...q,
|
|
143
143
|
minWidth: Ae,
|
|
144
|
-
width:
|
|
144
|
+
width: u ? B : void 0,
|
|
145
145
|
maxWidth: te,
|
|
146
146
|
maxHeight: Y
|
|
147
147
|
},
|
|
148
|
-
className: oe("z-[1300]", "box-border flex flex-col overflow-hidden rounded-lg
|
|
148
|
+
className: oe("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]", O),
|
|
149
149
|
children: /* @__PURE__ */ c(ge, {
|
|
150
150
|
dataTest: s,
|
|
151
151
|
title: l,
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* The Figma "_Popover" surface chrome (node `44531:233781`): white, 1px `border/outline
|
|
4
|
-
* (`dialog` token) and the Dialogue-popup elevation — the same surface `StyledDialog` paints.
|
|
3
|
+
* The Figma "_Popover" surface chrome (node `44531:233781`): white, 1px `border/outline` (delta-300),
|
|
4
|
+
* radius 8 (`dialog` token) and the Dialogue-popup elevation — the same surface `StyledDialog` paints.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
6
|
+
* The 1px edge is an **inset box-shadow ring**, the package's own idiom for non-layout lines
|
|
7
|
+
* (`StyledTab`/`StyledMenuItem` draw their DS focus rings the same way): a border consumes layout
|
|
8
|
+
* width, and at the 472px Action max-width a date-picker pair (200 + 16 + 200 = 416px, with 16px +
|
|
9
|
+
* 40px body padding) needs the full 472px of the frame — with a border only 470px remain and the
|
|
10
|
+
* pair wraps. Figma's stroke takes no width from autolayout, and the inset shadow matches that.
|
|
11
|
+
*
|
|
12
|
+
* `box-border` is load-bearing, not noise: this package builds Tailwind with `preflight: false`, so
|
|
13
|
+
* without it `box-sizing` falls back to `content-box` and a 472px max-width renders 474.
|
|
9
14
|
*
|
|
10
15
|
* Positioning (`z-index`, the floating transform, the top-layer props) deliberately stays with the
|
|
11
16
|
* caller, so the Gallery story can render the same surface statically in a grid.
|
|
12
17
|
*/
|
|
13
|
-
export declare const POPOVER_SURFACE_CLASSNAME = "box-border flex flex-col overflow-hidden rounded-lg
|
|
18
|
+
export declare const POPOVER_SURFACE_CLASSNAME = "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]";
|
|
14
19
|
export interface PopoverAnatomyProps {
|
|
15
20
|
dataTest: string;
|
|
16
21
|
title?: ReactNode;
|