asma-ui-core 3.136.1 → 3.137.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/data-display/tooltip/StyledTooltip.js +59 -59
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +180 -135
- package/dist/components/utils/bottom-sheet/useDragToDismiss.hook.js +111 -31
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +7 -0
- package/dist/src/components/utils/bottom-sheet/StyledBottomSheet.d.ts +8 -2
- package/dist/src/components/utils/bottom-sheet/useDragToDismiss.hook.d.ts +14 -3
- package/dist/src/table/components/table-header/useHeaderTruncation.d.ts +33 -0
- package/dist/src/table/helpers/headerLabel.d.ts +7 -0
- package/dist/src/table/helpers/headerLabel.test.d.ts +1 -0
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +41 -40
- package/dist/table/components/table-header/TableHeaderCell.js +67 -56
- package/dist/table/components/table-header/useHeaderTruncation.js +35 -0
- package/dist/table/helpers/headerLabel.js +4 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { firstFocusable as
|
|
4
|
-
import { TOP_LAYER_PROPS as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { FloatingArrow as
|
|
8
|
-
var
|
|
1
|
+
import { cn as te } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as oe } from "../../../helpers/sx.js";
|
|
3
|
+
import { firstFocusable as ne, firstTabbable as re } from "../../../helpers/focusable.js";
|
|
4
|
+
import { TOP_LAYER_PROPS as se, TOP_LAYER_RESET_STYLE as ie, getOpenModalDialogAncestor as ce, shouldUsePopoverTopLayer as le, useTopLayerRef as ae } from "../../../hooks/useTopLayer.hook.js";
|
|
5
|
+
import { Fragment as fe, cloneElement as ue, useCallback as pe, useEffect as H, useId as de, useLayoutEffect as L, useMemo as me, useRef as k, useState as ge } from "react";
|
|
6
|
+
import { Fragment as Y, jsx as R, jsxs as _ } from "react/jsx-runtime";
|
|
7
|
+
import { FloatingArrow as Re, FloatingPortal as be, arrow as ye, autoUpdate as ve, flip as Ee, offset as he, safePolygon as Pe, shift as xe, useDismiss as Te, useFloating as we, useFocus as Fe, useHover as Oe, useInteractions as Ae, useMergeRefs as Le, useRole as _e } from "@floating-ui/react";
|
|
8
|
+
var De = "#363E4A", Me = (t) => {
|
|
9
9
|
const n = document.createRange();
|
|
10
10
|
return n.selectNodeContents(t), n.getBoundingClientRect();
|
|
11
|
-
},
|
|
11
|
+
}, Se = [
|
|
12
12
|
"onFocus",
|
|
13
13
|
"onBlur",
|
|
14
14
|
"onMouseEnter",
|
|
@@ -18,41 +18,41 @@ var _e = "#363E4A", De = (t) => {
|
|
|
18
18
|
"onPointerEnter",
|
|
19
19
|
"onPointerUp",
|
|
20
20
|
"onKeyDown"
|
|
21
|
-
],
|
|
22
|
-
const s =
|
|
21
|
+
], Ye = ({ children: t, ...n }) => {
|
|
22
|
+
const s = k({ element: null }), E = pe((i) => {
|
|
23
23
|
s.current.element = i, s.current.setReference?.(i);
|
|
24
|
-
}, []), c = t.type ===
|
|
24
|
+
}, []), c = t.type === fe, l = c ? /* @__PURE__ */ R("span", {
|
|
25
25
|
style: { display: "contents" },
|
|
26
26
|
children: t
|
|
27
|
-
}) : t, a = l.props,
|
|
27
|
+
}) : t, a = l.props, b = Le([E, Object.getOwnPropertyDescriptor(a, "ref")?.value ?? Object.getOwnPropertyDescriptor(l, "ref")?.value]), h = me(() => Object.fromEntries(Se.map((i) => [i, (P) => {
|
|
28
28
|
const d = (s.current.getReferenceProps?.(a) ?? a)[i];
|
|
29
29
|
d?.(P);
|
|
30
30
|
}])), [a]), y = !!n.title || n.title === 0;
|
|
31
|
-
return /* @__PURE__ */ _(
|
|
31
|
+
return /* @__PURE__ */ _(Y, { children: [y ? ue(l, {
|
|
32
32
|
...h,
|
|
33
|
-
ref:
|
|
34
|
-
}) : l, y && /* @__PURE__ */
|
|
33
|
+
ref: b
|
|
34
|
+
}) : l, y && /* @__PURE__ */ R(Ce, {
|
|
35
35
|
...n,
|
|
36
36
|
referenceRef: s,
|
|
37
37
|
isFragment: c
|
|
38
38
|
})] });
|
|
39
|
-
},
|
|
40
|
-
const [
|
|
41
|
-
T ||
|
|
42
|
-
}, { refs: o, floatingStyles:
|
|
39
|
+
}, Ce = ({ title: t, referenceRef: n, isFragment: s, placement: E = "top", arrow: c = !1, enterDelay: l = 500, leaveDelay: a = 0, open: b, onOpen: h, onClose: y, disableHoverListener: i, disableFocusListener: P, openOnTap: d, persistentDescription: z, persistentDescriptionId: G, describesTrigger: D = !0, offsetDistance: K, className: V, slotProps: x }) => {
|
|
40
|
+
const [W, $] = ge(!1), T = b !== void 0, M = !!t || t === 0, m = M && (b ?? W), w = M && D && z, S = k(null), C = (e) => {
|
|
41
|
+
T || $(e), e ? h?.() : y?.();
|
|
42
|
+
}, { refs: o, floatingStyles: q, context: f } = we({
|
|
43
43
|
open: m,
|
|
44
|
-
onOpenChange:
|
|
44
|
+
onOpenChange: C,
|
|
45
45
|
placement: E,
|
|
46
46
|
strategy: "fixed",
|
|
47
|
-
whileElementsMounted:
|
|
47
|
+
whileElementsMounted: ve,
|
|
48
48
|
middleware: [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
...c ? [
|
|
49
|
+
he(K ?? (c ? 8 : 6)),
|
|
50
|
+
Ee({ padding: 8 }),
|
|
51
|
+
xe({ padding: 8 }),
|
|
52
|
+
...c ? [ye({ element: S })] : []
|
|
53
53
|
]
|
|
54
|
-
}), { getReferenceProps:
|
|
55
|
-
|
|
54
|
+
}), { getReferenceProps: B, getFloatingProps: J } = Ae([
|
|
55
|
+
Oe(f, {
|
|
56
56
|
enabled: !T && !i,
|
|
57
57
|
delay: {
|
|
58
58
|
open: l,
|
|
@@ -60,13 +60,13 @@ var _e = "#363E4A", De = (t) => {
|
|
|
60
60
|
},
|
|
61
61
|
move: !1,
|
|
62
62
|
mouseOnly: !!d,
|
|
63
|
-
handleClose:
|
|
63
|
+
handleClose: Pe()
|
|
64
64
|
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
Fe(f, { enabled: !T && !P }),
|
|
66
|
+
Te(f, { ancestorScroll: !!d }),
|
|
67
|
+
_e(f, { role: "tooltip" }),
|
|
68
68
|
{ reference: { onPointerUp: (e) => {
|
|
69
|
-
!d || e.pointerType !== "touch" ||
|
|
69
|
+
!d || e.pointerType !== "touch" || C(!m);
|
|
70
70
|
} } }
|
|
71
71
|
]);
|
|
72
72
|
L(() => {
|
|
@@ -75,19 +75,19 @@ var _e = "#363E4A", De = (t) => {
|
|
|
75
75
|
e.setReference = void 0, e.getReferenceProps = void 0, o.setReference(null);
|
|
76
76
|
};
|
|
77
77
|
}, [n, o]), L(() => {
|
|
78
|
-
n.current.getReferenceProps =
|
|
79
|
-
}, [n,
|
|
80
|
-
const
|
|
78
|
+
n.current.getReferenceProps = B;
|
|
79
|
+
}, [n, B]);
|
|
80
|
+
const j = m ? ce(o.domReference.current) : void 0, F = le(j), Q = ae(o.setFloating, F), { floatingId: X } = f, Z = de(), I = G ?? Z, u = w ? I : X, O = D && (!!w || m), N = (e) => re(e) ?? ne(e) ?? e, A = typeof t == "string" || typeof t == "number" ? String(t).trim() : "", U = (e, r) => {
|
|
81
81
|
const p = e.getAttribute("aria-describedby"), g = p?.split(/\s+/) ?? [];
|
|
82
82
|
if (g.includes(r)) return;
|
|
83
|
-
const
|
|
84
|
-
A && g.some((v) => v !== r &&
|
|
83
|
+
const ee = (v) => document.getElementById(v)?.textContent?.trim();
|
|
84
|
+
A && g.some((v) => v !== r && ee(v) === A) || e.setAttribute("aria-describedby", p ? `${p} ${r}` : r);
|
|
85
85
|
};
|
|
86
|
-
return
|
|
86
|
+
return H(() => {
|
|
87
87
|
const e = o.domReference.current;
|
|
88
88
|
if (!O || !u || !(e instanceof HTMLElement)) return;
|
|
89
|
-
const r =
|
|
90
|
-
return
|
|
89
|
+
const r = N(e);
|
|
90
|
+
return U(r, u), () => {
|
|
91
91
|
const p = r.getAttribute("aria-describedby")?.split(/\s+/).filter((g) => g && g !== u).join(" ");
|
|
92
92
|
p ? r.setAttribute("aria-describedby", p) : r.removeAttribute("aria-describedby");
|
|
93
93
|
};
|
|
@@ -96,42 +96,42 @@ var _e = "#363E4A", De = (t) => {
|
|
|
96
96
|
o.domReference,
|
|
97
97
|
u,
|
|
98
98
|
A
|
|
99
|
-
]),
|
|
99
|
+
]), H(() => {
|
|
100
100
|
const e = o.domReference.current;
|
|
101
|
-
!O || !u || !(e instanceof HTMLElement) || N(
|
|
101
|
+
!O || !u || !(e instanceof HTMLElement) || U(N(e), u);
|
|
102
102
|
}), L(() => {
|
|
103
103
|
const e = o.domReference.current;
|
|
104
104
|
!s || !e || o.setPositionReference({
|
|
105
105
|
contextElement: e,
|
|
106
|
-
getBoundingClientRect: () =>
|
|
106
|
+
getBoundingClientRect: () => Me(e)
|
|
107
107
|
});
|
|
108
|
-
}, [s, o]), /* @__PURE__ */ _(
|
|
109
|
-
id:
|
|
108
|
+
}, [s, o]), /* @__PURE__ */ _(Y, { children: [w && /* @__PURE__ */ R("span", {
|
|
109
|
+
id: I,
|
|
110
110
|
hidden: !0,
|
|
111
111
|
children: t
|
|
112
|
-
}), m && /* @__PURE__ */
|
|
113
|
-
root:
|
|
112
|
+
}), m && /* @__PURE__ */ R(be, {
|
|
113
|
+
root: j,
|
|
114
114
|
children: /* @__PURE__ */ _("div", {
|
|
115
|
-
ref:
|
|
116
|
-
...F ?
|
|
117
|
-
...
|
|
115
|
+
ref: Q,
|
|
116
|
+
...F ? se : {},
|
|
117
|
+
...J(),
|
|
118
118
|
style: {
|
|
119
|
-
...F ?
|
|
120
|
-
|
|
119
|
+
...F ? ie : {},
|
|
120
|
+
...q,
|
|
121
121
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
122
122
|
overflow: "visible",
|
|
123
123
|
...x?.tooltip?.style,
|
|
124
|
-
...
|
|
124
|
+
...oe(x?.tooltip?.sx)
|
|
125
125
|
},
|
|
126
|
-
className:
|
|
127
|
-
children: [t, c && /* @__PURE__ */
|
|
128
|
-
ref:
|
|
126
|
+
className: te("z-[1500] block max-w-[320px] whitespace-normal break-words rounded-[3px] bg-[#363E4A] px-2 py-1 text-sm leading-5 text-white shadow-[0px_1px_6px_0px_rgba(0,0,0,0.15)]", V, x?.tooltip?.className),
|
|
127
|
+
children: [t, c && /* @__PURE__ */ R(Re, {
|
|
128
|
+
ref: S,
|
|
129
129
|
context: f,
|
|
130
|
-
fill:
|
|
130
|
+
fill: De
|
|
131
131
|
})]
|
|
132
132
|
})
|
|
133
133
|
})] });
|
|
134
134
|
};
|
|
135
135
|
export {
|
|
136
|
-
|
|
136
|
+
Ye as StyledTooltip
|
|
137
137
|
};
|
|
@@ -1,163 +1,198 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { registerOpenModalDialog as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { BackIcon as
|
|
5
|
-
import { StyledButton as
|
|
6
|
-
import { OverlayBackOwnerContext as
|
|
7
|
-
import { isKeyboardModality as
|
|
8
|
-
import { useDebouncedValue as
|
|
9
|
-
import { useFocusTrap as
|
|
10
|
-
import { useShortViewportMediaQuery as
|
|
11
|
-
import { SHEET_HEADER_TEXT as
|
|
12
|
-
import { formatResultsLabel as
|
|
13
|
-
import { useBodyScrollLock as
|
|
14
|
-
import
|
|
15
|
-
import { useDragToDismiss as
|
|
16
|
-
import { useEffect as
|
|
17
|
-
import { jsx as t, jsxs as
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
h
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { cn as u } from "../../../helpers/cn.js";
|
|
2
|
+
import { registerOpenModalDialog as Se } from "../../../hooks/useTopLayer.hook.js";
|
|
3
|
+
import { CloseIcon as _e } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { BackIcon as Te } from "../../icons/back-icon/BackIcon.js";
|
|
5
|
+
import { StyledButton as I } from "../../inputs/button/StyledButton.js";
|
|
6
|
+
import { OverlayBackOwnerContext as Le, isOverlayBackEnabled as oe, requestCloseTopOverlayBack as M, useBackCloses as Re } from "../../../hooks/useBackCloses.hook.js";
|
|
7
|
+
import { isKeyboardModality as Ce, trackInputModality as Oe } from "../../inputs/full-screen-picker/inputModality.js";
|
|
8
|
+
import { useDebouncedValue as Be } from "../../../hooks/useDebouncedValue.hook.js";
|
|
9
|
+
import { useFocusTrap as He } from "../../../hooks/useFocusTrap.hook.js";
|
|
10
|
+
import { useShortViewportMediaQuery as Ie } from "../../../hooks/useMediaQuery.hook.js";
|
|
11
|
+
import { SHEET_HEADER_TEXT as Me, SHEET_TEXT as $e } from "./sheetCopy.js";
|
|
12
|
+
import { formatResultsLabel as De } from "./formatResultsLabel.js";
|
|
13
|
+
import { useBodyScrollLock as Ae } from "../../../hooks/useBodyScrollLock.hook.js";
|
|
14
|
+
import je from "./StyledBottomSheet.module.js";
|
|
15
|
+
import { useDragToDismiss as Fe } from "./useDragToDismiss.hook.js";
|
|
16
|
+
import { useCallback as ae, useEffect as b, useId as Pe, useLayoutEffect as qe, useRef as c, useState as m } from "react";
|
|
17
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
18
|
+
var ze = 500, se = "duration-[250ms] ease-[cubic-bezier(0.05,0.7,0.1,1)]", ie = "duration-[200ms] ease-[cubic-bezier(0.3,0,0.8,0.15)]", Ke = 200, Ve = 300, dt = ({ dataTest: s, id: le, open: n, onClose: d, title: x, ariaLabel: ce, titleIcon: $, onBack: D, backLabel: de, children: ue, viewResultsAction: A, resetAction: fe, footerActions: me, resultCount: j, locale: S = "en", closeLabel: pe = $e[S].close, className: he, registerBackClose: ve = !0, ownerRef: be, triggerRef: F }) => {
|
|
19
|
+
const P = Pe(), f = c(null), _ = c(null), q = c(null), z = be ?? f, T = c(!1), [w, K] = m(!1), [V, X] = m(n);
|
|
20
|
+
n && !V && X(!0);
|
|
21
|
+
const U = c(void 0), y = Ie(), G = c(null), [xe, we] = m(null), ye = ae((e) => {
|
|
22
|
+
G.current = e, we(e);
|
|
23
|
+
}, []), [l, h] = m(!1), [ge, Ee] = m(!1), [v, L] = m(!1), Q = !y && (l || ge || v), Y = ae(() => {
|
|
24
|
+
L(!0), h(!1);
|
|
25
|
+
}, []), R = Me[S], g = c(d), J = c(n);
|
|
26
|
+
b(() => {
|
|
27
|
+
g.current = d, J.current = n;
|
|
28
|
+
}, [d, n]);
|
|
29
|
+
const { dragHandleProps: ke, dragOffset: W, dragRatio: C, liftedHeight: Z } = Fe(_, () => {
|
|
30
|
+
g.current("drag");
|
|
31
|
+
}, Q && !l ? () => h(!0) : void 0, l && !y ? Y : void 0, xe);
|
|
32
|
+
b(() => {
|
|
33
|
+
const e = G.current;
|
|
34
|
+
if (!n || l || v || !e) return;
|
|
35
|
+
let o = e.scrollHeight;
|
|
36
|
+
const r = () => {
|
|
37
|
+
const i = e.scrollHeight > e.clientHeight + 1, N = e.scrollHeight > o + 1;
|
|
38
|
+
o = e.scrollHeight, i && N && e.contains(document.activeElement) ? h(!0) : Ee(i);
|
|
32
39
|
};
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
for (const
|
|
37
|
-
return () =>
|
|
38
|
-
}, [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
r();
|
|
41
|
+
const a = new ResizeObserver(r);
|
|
42
|
+
a.observe(e);
|
|
43
|
+
for (const i of Array.from(e.children)) a.observe(i);
|
|
44
|
+
return () => a.disconnect();
|
|
45
|
+
}, [
|
|
46
|
+
n,
|
|
47
|
+
l,
|
|
48
|
+
v
|
|
49
|
+
]), b(() => {
|
|
50
|
+
const e = _.current;
|
|
51
|
+
if (!v || !e) return;
|
|
52
|
+
const o = () => {
|
|
53
|
+
L(!1);
|
|
54
|
+
}, r = (i) => {
|
|
55
|
+
i.target === e && i.propertyName === "max-height" && o();
|
|
56
|
+
}, a = window.setTimeout(o, Ve);
|
|
57
|
+
return e.addEventListener("transitionend", r), () => {
|
|
58
|
+
window.clearTimeout(a), e.removeEventListener("transitionend", r);
|
|
59
|
+
};
|
|
60
|
+
}, [v]), Ae(n), He(n, f), b(() => {
|
|
61
|
+
if (!n) return;
|
|
62
|
+
const e = (r) => {
|
|
63
|
+
r.key === "Escape" && (T.current = !0, window.setTimeout(() => {
|
|
64
|
+
T.current = !1;
|
|
43
65
|
}, 0));
|
|
44
|
-
},
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
66
|
+
}, o = (r) => {
|
|
67
|
+
if (r.key !== "Escape" || r.defaultPrevented) return;
|
|
68
|
+
const a = document.activeElement;
|
|
69
|
+
a instanceof Element && a.closest("dialog[open]") !== f.current || (r.preventDefault(), r.stopImmediatePropagation(), M(r));
|
|
48
70
|
};
|
|
49
|
-
return window.addEventListener("keydown", e, !0), window.addEventListener("keydown",
|
|
50
|
-
window.removeEventListener("keydown", e, !0), window.removeEventListener("keydown",
|
|
71
|
+
return window.addEventListener("keydown", e, !0), window.addEventListener("keydown", o), () => {
|
|
72
|
+
window.removeEventListener("keydown", e, !0), window.removeEventListener("keydown", o);
|
|
51
73
|
};
|
|
52
|
-
}, [
|
|
53
|
-
active:
|
|
54
|
-
requestClose: () =>
|
|
55
|
-
ownerRef:
|
|
56
|
-
}),
|
|
57
|
-
const e =
|
|
58
|
-
if (!
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
}),
|
|
74
|
+
}, [n]), Re({
|
|
75
|
+
active: n && ve,
|
|
76
|
+
requestClose: () => g.current("escape"),
|
|
77
|
+
ownerRef: z
|
|
78
|
+
}), qe(() => {
|
|
79
|
+
const e = f.current;
|
|
80
|
+
if (!n || !e) return;
|
|
81
|
+
Oe();
|
|
82
|
+
const o = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
83
|
+
window.clearTimeout(U.current), q.current = F?.current ?? o, e.open || e.showModal(), e.focus({ preventScroll: !0 });
|
|
84
|
+
const r = requestAnimationFrame(() => {
|
|
85
|
+
K(!0);
|
|
86
|
+
}), a = Se(e);
|
|
65
87
|
return () => {
|
|
66
|
-
cancelAnimationFrame(
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
88
|
+
cancelAnimationFrame(r), a(), K(!1);
|
|
89
|
+
const i = () => {
|
|
90
|
+
X(!1), h(!1), L(!1), e.open && e.close();
|
|
91
|
+
const N = q.current;
|
|
92
|
+
N?.isConnected && N.focus({
|
|
93
|
+
preventScroll: !0,
|
|
94
|
+
focusVisible: Ce()
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
98
|
+
i();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
U.current = window.setTimeout(i, Ke);
|
|
72
102
|
};
|
|
73
|
-
}, [
|
|
74
|
-
const e =
|
|
75
|
-
if (!e || !
|
|
76
|
-
let
|
|
77
|
-
const
|
|
103
|
+
}, [n, F]), b(() => {
|
|
104
|
+
const e = f.current;
|
|
105
|
+
if (!e || !n) return;
|
|
106
|
+
let o = !1;
|
|
107
|
+
const r = () => {
|
|
78
108
|
requestAnimationFrame(() => {
|
|
79
|
-
|
|
109
|
+
o = !1, J.current && e.isConnected && !e.open && (e.showModal(), e.focus({ preventScroll: !0 }));
|
|
80
110
|
});
|
|
81
|
-
},
|
|
82
|
-
|
|
111
|
+
}, a = () => {
|
|
112
|
+
o || (o = !0, oe() && M(), r());
|
|
83
113
|
};
|
|
84
|
-
return e.addEventListener("close",
|
|
85
|
-
}, [
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
} },
|
|
114
|
+
return e.addEventListener("close", a), () => e.removeEventListener("close", a);
|
|
115
|
+
}, [n]);
|
|
116
|
+
const ee = De(Be(j, ze), S);
|
|
117
|
+
if (!V) return null;
|
|
118
|
+
const Ne = { close: () => {
|
|
119
|
+
d("action");
|
|
120
|
+
} }, E = (e) => typeof e == "function" ? e(Ne) : e, te = j !== void 0, O = A !== void 0 ? E(A) : te ? /* @__PURE__ */ t(I, {
|
|
91
121
|
dataTest: `${s}-view-results`,
|
|
92
122
|
type: "button",
|
|
93
123
|
variant: "text",
|
|
94
124
|
onClick: () => {
|
|
95
|
-
|
|
125
|
+
d("viewResults");
|
|
96
126
|
},
|
|
97
|
-
children:
|
|
98
|
-
}) : void 0,
|
|
127
|
+
children: ee
|
|
128
|
+
}) : void 0, re = E(fe), k = E(me), B = !!(O ?? re), H = Z !== null, ne = W > 0 || H;
|
|
99
129
|
return /* @__PURE__ */ t("dialog", {
|
|
100
|
-
ref:
|
|
101
|
-
id:
|
|
130
|
+
ref: f,
|
|
131
|
+
id: le,
|
|
102
132
|
tabIndex: -1,
|
|
103
133
|
"aria-modal": "true",
|
|
104
|
-
"aria-labelledby":
|
|
105
|
-
"aria-label":
|
|
134
|
+
"aria-labelledby": x ? P : void 0,
|
|
135
|
+
"aria-label": x ? void 0 : ce,
|
|
106
136
|
"data-test": s,
|
|
107
137
|
"data-testid": s,
|
|
108
138
|
onCancel: (e) => {
|
|
109
|
-
if (e.cancelable && e.preventDefault(), !
|
|
110
|
-
if (!
|
|
111
|
-
|
|
139
|
+
if (e.cancelable && e.preventDefault(), !T.current) {
|
|
140
|
+
if (!oe()) {
|
|
141
|
+
g.current("escape");
|
|
112
142
|
return;
|
|
113
143
|
}
|
|
114
|
-
|
|
144
|
+
M();
|
|
115
145
|
}
|
|
116
146
|
},
|
|
117
|
-
className:
|
|
118
|
-
children: /* @__PURE__ */
|
|
119
|
-
value:
|
|
147
|
+
className: u(je.StyledBottomSheet, "fixed inset-0 m-0 h-full max-h-none w-full max-w-none flex-col items-center justify-end overflow-visible border-0 bg-transparent p-0 outline-none open:flex"),
|
|
148
|
+
children: /* @__PURE__ */ p(Le.Provider, {
|
|
149
|
+
value: z,
|
|
120
150
|
children: [/* @__PURE__ */ t("div", {
|
|
121
151
|
"aria-hidden": "true",
|
|
122
152
|
"data-testid": `${s}-scrim`,
|
|
123
153
|
onClick: () => {
|
|
124
|
-
|
|
154
|
+
d("scrim");
|
|
125
155
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
156
|
+
style: C > 0 ? { opacity: 1 - C } : void 0,
|
|
157
|
+
className: u("absolute inset-0 bg-[#626e7eb2]", C === 0 && ["transition-opacity motion-reduce:duration-150", w ? ["opacity-100", se] : ["opacity-0", ie]])
|
|
158
|
+
}), /* @__PURE__ */ p("div", {
|
|
159
|
+
ref: _,
|
|
160
|
+
"data-state": w ? "open" : "closed",
|
|
161
|
+
style: H ? { maxHeight: `min(${Z}px, 90dvh)` } : ne ? { transform: `translateY(${W}px)` } : void 0,
|
|
162
|
+
className: u("relative box-border flex w-full max-w-[640px] flex-col bg-white text-delta-700 outline-none", y ? "h-full max-h-none rounded-none" : u("rounded-t-[28px]", !H && (l ? "max-h-[90dvh]" : "max-h-[50dvh]")), !ne && [
|
|
163
|
+
"motion-safe:transition-[transform,max-height] motion-reduce:transition-opacity motion-reduce:duration-150",
|
|
164
|
+
w ? se : ie,
|
|
165
|
+
w ? "translate-y-0 opacity-100" : "motion-safe:translate-y-full motion-reduce:opacity-0"
|
|
166
|
+
], he),
|
|
132
167
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ p("div", {
|
|
134
169
|
className: "border-b-solid shrink-0 border-b border-delta-200 pb-2",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
136
|
-
...
|
|
170
|
+
children: [/* @__PURE__ */ p("div", {
|
|
171
|
+
...ke,
|
|
137
172
|
className: "relative flex h-12 touch-none items-center gap-2 px-2",
|
|
138
173
|
children: [
|
|
139
174
|
/* @__PURE__ */ t("div", {
|
|
140
175
|
className: "flex min-w-0 flex-1 items-center",
|
|
141
|
-
children:
|
|
176
|
+
children: D && /* @__PURE__ */ t(I, {
|
|
142
177
|
dataTest: `${s}-back`,
|
|
143
178
|
variant: "textGray",
|
|
144
179
|
type: "button",
|
|
145
|
-
"aria-label":
|
|
146
|
-
onClick:
|
|
147
|
-
startIcon: /* @__PURE__ */ t(
|
|
180
|
+
"aria-label": de ?? R.back,
|
|
181
|
+
onClick: D,
|
|
182
|
+
startIcon: /* @__PURE__ */ t(Te, {
|
|
148
183
|
width: 24,
|
|
149
184
|
height: 24
|
|
150
185
|
})
|
|
151
186
|
})
|
|
152
187
|
}),
|
|
153
|
-
|
|
188
|
+
Q ? /* @__PURE__ */ t("button", {
|
|
154
189
|
type: "button",
|
|
155
190
|
"data-drag-handle": !0,
|
|
156
191
|
"data-testid": `${s}-drag-handle`,
|
|
157
|
-
"aria-label":
|
|
158
|
-
"aria-expanded":
|
|
192
|
+
"aria-label": l ? R.collapse : R.expand,
|
|
193
|
+
"aria-expanded": l,
|
|
159
194
|
onClick: () => {
|
|
160
|
-
|
|
195
|
+
l ? Y() : h(!0);
|
|
161
196
|
},
|
|
162
197
|
className: "absolute left-1/2 top-1/2 flex h-6 w-12 -translate-x-1/2 -translate-y-1/2 cursor-grab items-center justify-center rounded border-0 bg-transparent p-0 outline-none focus-visible:[box-shadow:inset_0_0_0_2px_var(--colors-focus-ring)]",
|
|
163
198
|
children: /* @__PURE__ */ t("span", {
|
|
@@ -169,55 +204,65 @@ var Ce = 500, ze = ({ dataTest: s, id: Q, open: r, onClose: i, title: m, ariaLab
|
|
|
169
204
|
"data-testid": `${s}-drag-handle`,
|
|
170
205
|
className: "pointer-events-none absolute left-1/2 top-1/2 h-1 w-8 -translate-x-1/2 -translate-y-1/2 rounded-full bg-delta-700"
|
|
171
206
|
}),
|
|
172
|
-
/* @__PURE__ */ t(
|
|
207
|
+
/* @__PURE__ */ t(I, {
|
|
173
208
|
dataTest: `${s}-close`,
|
|
174
209
|
variant: "textGray",
|
|
175
210
|
type: "button",
|
|
176
|
-
"aria-label":
|
|
211
|
+
"aria-label": pe,
|
|
177
212
|
onClick: () => {
|
|
178
|
-
|
|
213
|
+
d("closeButton");
|
|
179
214
|
},
|
|
180
|
-
startIcon: /* @__PURE__ */ t(
|
|
215
|
+
startIcon: /* @__PURE__ */ t(_e, {
|
|
181
216
|
width: 24,
|
|
182
217
|
height: 24
|
|
183
218
|
})
|
|
184
219
|
})
|
|
185
220
|
]
|
|
186
|
-
}),
|
|
221
|
+
}), x && /* @__PURE__ */ p("div", {
|
|
187
222
|
className: "flex items-center gap-1 px-4",
|
|
188
|
-
children: [
|
|
223
|
+
children: [$ && /* @__PURE__ */ t("span", {
|
|
189
224
|
"aria-hidden": "true",
|
|
190
225
|
className: "flex size-5 shrink-0 items-center justify-center text-delta-700",
|
|
191
|
-
children:
|
|
226
|
+
children: $
|
|
192
227
|
}), /* @__PURE__ */ t("div", {
|
|
193
|
-
id:
|
|
228
|
+
id: P,
|
|
194
229
|
className: "min-w-0 flex-1 truncate text-lg font-semibold leading-7 text-delta-800",
|
|
195
|
-
children:
|
|
230
|
+
children: x
|
|
196
231
|
})]
|
|
197
232
|
})]
|
|
198
233
|
}),
|
|
199
234
|
/* @__PURE__ */ t("div", {
|
|
200
|
-
ref:
|
|
201
|
-
className:
|
|
202
|
-
children:
|
|
235
|
+
ref: ye,
|
|
236
|
+
className: u("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain pl-4 pr-2 pt-2", B || k ? "pb-2" : "pb-[max(0.5rem,env(safe-area-inset-bottom))]"),
|
|
237
|
+
children: E(ue)
|
|
203
238
|
}),
|
|
204
|
-
|
|
205
|
-
className:
|
|
239
|
+
B && /* @__PURE__ */ p("div", {
|
|
240
|
+
className: u("border-t-solid flex shrink-0 items-start border-t border-delta-200 bg-white p-1", O ? "justify-between" : "justify-end", "max-xs:flex-wrap max-xs:gap-y-2 max-xs:[&>:nth-child(2)]:ml-auto", !k && "pb-[max(0.25rem,env(safe-area-inset-bottom))]"),
|
|
206
241
|
children: [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
242
|
+
O,
|
|
243
|
+
re,
|
|
244
|
+
te && /* @__PURE__ */ t("span", {
|
|
210
245
|
className: "sr-only",
|
|
211
246
|
role: "status",
|
|
212
247
|
"aria-live": "polite",
|
|
213
248
|
"aria-atomic": "true",
|
|
214
|
-
children:
|
|
249
|
+
children: ee
|
|
215
250
|
})
|
|
216
251
|
]
|
|
217
252
|
}),
|
|
218
|
-
|
|
219
|
-
className:
|
|
220
|
-
children:
|
|
253
|
+
k && /* @__PURE__ */ t("div", {
|
|
254
|
+
className: u("flex shrink-0 flex-col items-end bg-white p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]", B && "max-xs:pt-1"),
|
|
255
|
+
children: k
|
|
256
|
+
}),
|
|
257
|
+
!y && /* @__PURE__ */ t("span", {
|
|
258
|
+
"aria-hidden": "true",
|
|
259
|
+
"data-testid": `${s}-skirt`,
|
|
260
|
+
className: "pointer-events-none absolute inset-x-0 top-full h-[100lvh] bg-white"
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ t("span", {
|
|
263
|
+
"aria-hidden": "true",
|
|
264
|
+
"data-testid": `${s}-edge`,
|
|
265
|
+
className: "pointer-events-none absolute inset-0 rounded-[inherit] [box-shadow:inset_0_0_0_1px_var(--colors-delta-300)]"
|
|
221
266
|
})
|
|
222
267
|
]
|
|
223
268
|
})]
|
|
@@ -225,5 +270,5 @@ var Ce = 500, ze = ({ dataTest: s, id: Q, open: r, onClose: i, title: m, ariaLab
|
|
|
225
270
|
});
|
|
226
271
|
};
|
|
227
272
|
export {
|
|
228
|
-
|
|
273
|
+
dt as StyledBottomSheet
|
|
229
274
|
};
|