asma-ui-core 3.130.4 → 3.131.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.
@@ -1,16 +1,16 @@
1
1
  import { CloseIcon as y } from "../../icons/close-icon/CloseIcon.js";
2
2
  import { StyledButton as w } from "../button/StyledButton.js";
3
- import { usePickerOneRowHeaderMediaQuery as g } from "../../../hooks/useMediaQuery.hook.js";
4
- import { StyledDialog as k } from "../../feedback/dialog/StyledDialog.js";
5
- import { PickerLiveRegion as N } from "./PickerLiveRegion.js";
6
- import { isKeyboardModality as S, trackInputModality as R } from "./inputModality.js";
3
+ import { isKeyboardModality as g, trackInputModality as k } from "./inputModality.js";
4
+ import { usePickerOneRowHeaderMediaQuery as N } from "../../../hooks/useMediaQuery.hook.js";
5
+ import { StyledDialog as S } from "../../feedback/dialog/StyledDialog.js";
6
+ import { PickerLiveRegion as R } from "./PickerLiveRegion.js";
7
7
  import { useReleaseFieldOnKeyboardDismiss as I } from "./useReleaseFieldOnKeyboardDismiss.js";
8
8
  import { useVisualViewportHeight as F } from "./useVisualViewportHeight.js";
9
9
  import { useEffect as x, useRef as p } from "react";
10
10
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
11
11
  var E = ({ open: i, onClose: o, dataTest: l, title: r, fallbackName: n, ...c }) => {
12
12
  const t = r != null && r !== !1 && r !== "";
13
- return x(R, []), /* @__PURE__ */ e(k, {
13
+ return x(k, []), /* @__PURE__ */ e(S, {
14
14
  open: i,
15
15
  onClose: (f, s) => o(s),
16
16
  dataTest: l,
@@ -25,11 +25,11 @@ var E = ({ open: i, onClose: o, dataTest: l, title: r, fallbackName: n, ...c })
25
25
  })
26
26
  });
27
27
  }, P = ({ dataTest: i, title: o, closeLabel: l, search: r, headerRow: n, children: c, announcement: t, onClose: f }) => {
28
- const s = g(), v = F(), a = p(null), u = p(null);
28
+ const s = N(), v = F(), a = p(null), u = p(null);
29
29
  return I(a), x(() => {
30
30
  const b = requestAnimationFrame(() => {
31
31
  const h = a.current?.closest("dialog");
32
- if (!h || document.activeElement !== h || !S()) return;
32
+ if (!h || document.activeElement !== h || !g()) return;
33
33
  const d = u.current?.querySelector('[role="listbox"]');
34
34
  (d && d.tabIndex >= 0 ? d : a.current)?.focus({ preventScroll: !0 });
35
35
  });
@@ -83,7 +83,7 @@ var E = ({ open: i, onClose: o, dataTest: l, title: r, fallbackName: n, ...c })
83
83
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4",
84
84
  children: c
85
85
  }),
86
- /* @__PURE__ */ e(N, {
86
+ /* @__PURE__ */ e(R, {
87
87
  announcement: t,
88
88
  dataTest: `${i}-live`
89
89
  })
@@ -1,28 +1,29 @@
1
1
  import { cn as l } 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 _ } from "../../inputs/button/StyledButton.js";
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
- import { SHEET_TEXT as ne } from "./sheetCopy.js";
11
- import { formatResultsLabel as ae } from "./formatResultsLabel.js";
12
- import { useBodyScrollLock as se } from "../../../hooks/useBodyScrollLock.hook.js";
13
- import ie from "./StyledBottomSheet.module.js";
14
- import { useDragToDismiss as le } from "./useDragToDismiss.hook.js";
15
- import { useEffect as g, useId as ce, useLayoutEffect as de, useRef as c, useState as ue } from "react";
2
+ import { registerOpenModalDialog as W } from "../../../hooks/useTopLayer.hook.js";
3
+ import { CloseIcon as Z } from "../../icons/close-icon/CloseIcon.js";
4
+ import { IndeterminateIcon as ee } from "../../icons/indeterminate-icon/IndeterminateIcon.js";
5
+ import { StyledButton as P } from "../../inputs/button/StyledButton.js";
6
+ import { OverlayBackOwnerContext as te, isOverlayBackEnabled as q, requestCloseTopOverlayBack as w, useBackCloses as re } from "../../../hooks/useBackCloses.hook.js";
7
+ import { isKeyboardModality as oe, trackInputModality as ne } from "../../inputs/full-screen-picker/inputModality.js";
8
+ import { useDebouncedValue as ae } from "../../../hooks/useDebouncedValue.hook.js";
9
+ import { useFocusTrap as se } from "../../../hooks/useFocusTrap.hook.js";
10
+ import { useShortViewportMediaQuery as ie } from "../../../hooks/useMediaQuery.hook.js";
11
+ import { SHEET_TEXT as le } from "./sheetCopy.js";
12
+ import { formatResultsLabel as ce } from "./formatResultsLabel.js";
13
+ import { useBodyScrollLock as de } from "../../../hooks/useBodyScrollLock.hook.js";
14
+ import ue from "./StyledBottomSheet.module.js";
15
+ import { useDragToDismiss as me } from "./useDragToDismiss.hook.js";
16
+ import { useEffect as g, useId as fe, useLayoutEffect as pe, useRef as c, useState as ve } from "react";
16
17
  import { jsx as o, jsxs as u } from "react/jsx-runtime";
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 = oe(), f = c(s), O = c(t);
18
+ var he = 500, Fe = ({ dataTest: d, id: V, open: t, onClose: a, title: m, ariaLabel: $, children: A, viewResultsAction: E, resetAction: H, footerActions: K, resultCount: k, locale: S = "en", closeLabel: U = le[S].close, className: G, registerBackClose: Q = !0, ownerRef: X, triggerRef: N }) => {
19
+ const R = fe(), i = c(null), B = c(null), L = c(null), C = X ?? i, h = c(!1), [x, I] = ve(!1), Y = ie(), f = c(a), O = c(t);
19
20
  g(() => {
20
- f.current = s, O.current = t;
21
- }, [s, t]);
22
- const { dragHandleProps: X, dragOffset: I } = le(R, () => {
21
+ f.current = a, O.current = t;
22
+ }, [a, t]);
23
+ const { dragHandleProps: z, dragOffset: D } = me(B, () => {
23
24
  f.current("drag");
24
25
  });
25
- se(t), re(t, i), g(() => {
26
+ de(t), se(t, i), g(() => {
26
27
  if (!t) return;
27
28
  const e = (r) => {
28
29
  r.key === "Escape" && (h.current = !0, window.setTimeout(() => {
@@ -30,29 +31,34 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
30
31
  }, 0));
31
32
  }, n = (r) => {
32
33
  if (r.key !== "Escape" || r.defaultPrevented) return;
33
- const a = document.activeElement;
34
- a instanceof Element && a.closest("dialog[open]") !== i.current || (r.preventDefault(), r.stopImmediatePropagation(), y(r));
34
+ const s = document.activeElement;
35
+ s instanceof Element && s.closest("dialog[open]") !== i.current || (r.preventDefault(), r.stopImmediatePropagation(), w(r));
35
36
  };
36
37
  return window.addEventListener("keydown", e, !0), window.addEventListener("keydown", n), () => {
37
38
  window.removeEventListener("keydown", e, !0), window.removeEventListener("keydown", n);
38
39
  };
39
- }, [t]), ee({
40
- active: t && K,
40
+ }, [t]), re({
41
+ active: t && Q,
41
42
  requestClose: () => f.current("escape"),
42
- ownerRef: L
43
- }), de(() => {
43
+ ownerRef: C
44
+ }), pe(() => {
44
45
  const e = i.current;
45
46
  if (!t || !e) return;
46
- B.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.open || e.showModal(), e.focus({ preventScroll: !0 });
47
- const n = requestAnimationFrame(() => {
48
- C(!0);
49
- }), r = z(e);
47
+ ne();
48
+ const n = document.activeElement instanceof HTMLElement ? document.activeElement : null;
49
+ L.current = N?.current ?? n, e.open || e.showModal(), e.focus({ preventScroll: !0 });
50
+ const r = requestAnimationFrame(() => {
51
+ I(!0);
52
+ }), s = W(e);
50
53
  return () => {
51
- cancelAnimationFrame(n), r(), C(!1), e.open && e.close();
52
- const a = B.current;
53
- a?.isConnected && a.focus({ preventScroll: !0 });
54
+ cancelAnimationFrame(r), s(), I(!1), e.open && e.close();
55
+ const j = L.current;
56
+ j?.isConnected && j.focus({
57
+ preventScroll: !0,
58
+ focusVisible: oe()
59
+ });
54
60
  };
55
- }, [t]), g(() => {
61
+ }, [t, N]), g(() => {
56
62
  const e = i.current;
57
63
  if (!e || !t) return;
58
64
  let n = !1;
@@ -60,79 +66,79 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
60
66
  requestAnimationFrame(() => {
61
67
  n = !1, O.current && e.isConnected && !e.open && (e.showModal(), e.focus({ preventScroll: !0 }));
62
68
  });
63
- }, a = () => {
64
- n || (n = !0, j() && y(), r());
69
+ }, s = () => {
70
+ n || (n = !0, q() && w(), r());
65
71
  };
66
- return e.addEventListener("close", a), () => e.removeEventListener("close", a);
72
+ return e.addEventListener("close", s), () => e.removeEventListener("close", s);
67
73
  }, [t]);
68
- const D = ae(te(S, me), k);
74
+ const M = ce(ae(k, he), S);
69
75
  if (!t) return null;
70
- const Y = { close: () => {
71
- s("action");
72
- } }, p = (e) => typeof e == "function" ? e(Y) : e, T = S !== void 0, b = E !== void 0 ? p(E) : T ? /* @__PURE__ */ o(_, {
76
+ const J = { close: () => {
77
+ a("action");
78
+ } }, p = (e) => typeof e == "function" ? e(J) : e, T = k !== void 0, b = E !== void 0 ? p(E) : T ? /* @__PURE__ */ o(P, {
73
79
  dataTest: `${d}-view-results`,
74
80
  type: "button",
75
81
  variant: "text",
76
82
  onClick: () => {
77
- s("viewResults");
83
+ a("viewResults");
78
84
  },
79
- children: D
80
- }) : void 0, F = p(A), v = p(H), w = !!(b ?? F), M = I > 0;
85
+ children: M
86
+ }) : void 0, F = p(H), v = p(K), y = !!(b ?? F), _ = D > 0;
81
87
  return /* @__PURE__ */ o("dialog", {
82
88
  ref: i,
83
- id: P,
89
+ id: V,
84
90
  tabIndex: -1,
85
91
  "aria-modal": "true",
86
- "aria-labelledby": m ? N : void 0,
87
- "aria-label": m ? void 0 : q,
92
+ "aria-labelledby": m ? R : void 0,
93
+ "aria-label": m ? void 0 : $,
88
94
  "data-test": d,
89
95
  "data-testid": d,
90
96
  onCancel: (e) => {
91
97
  if (e.cancelable && e.preventDefault(), !h.current) {
92
- if (!j()) {
98
+ if (!q()) {
93
99
  f.current("escape");
94
100
  return;
95
101
  }
96
- y();
102
+ w();
97
103
  }
98
104
  },
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(Z.Provider, {
101
- value: L,
105
+ className: l(ue.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"),
106
+ children: /* @__PURE__ */ u(te.Provider, {
107
+ value: C,
102
108
  children: [/* @__PURE__ */ o("div", {
103
109
  "aria-hidden": "true",
104
110
  "data-testid": `${d}-scrim`,
105
111
  onClick: () => {
106
- s("scrim");
112
+ a("scrim");
107
113
  },
108
114
  className: l("absolute inset-0 bg-[#626e7eb2] transition-opacity duration-[250ms] ease-out motion-reduce:duration-150", x ? "opacity-100" : "opacity-0")
109
115
  }), /* @__PURE__ */ u("div", {
110
- ref: R,
116
+ ref: B,
111
117
  "data-state": x ? "open" : "closed",
112
- style: M ? { transform: `translateY(${I}px)` } : void 0,
113
- className: l("relative box-border flex w-full max-w-[640px] flex-col border border-solid border-delta-300 bg-white text-delta-700 outline-none", Q ? "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", x ? "translate-y-0 opacity-100" : "motion-safe:translate-y-full motion-reduce:opacity-0"], V),
118
+ style: _ ? { transform: `translateY(${D}px)` } : void 0,
119
+ className: l("relative box-border flex w-full max-w-[640px] flex-col border border-solid border-delta-300 bg-white text-delta-700 outline-none", Y ? "h-full max-h-none rounded-none" : "max-h-[90dvh] rounded-t-[28px]", !_ && ["ease-out motion-safe:transition-transform motion-safe:duration-[250ms] motion-reduce:transition-opacity motion-reduce:duration-150", x ? "translate-y-0 opacity-100" : "motion-safe:translate-y-full motion-reduce:opacity-0"], G),
114
120
  children: [
115
121
  /* @__PURE__ */ u("div", {
116
122
  className: "border-b-solid shrink-0 border-b border-delta-200 pb-2",
117
123
  children: [/* @__PURE__ */ u("div", {
118
- ...X,
124
+ ...z,
119
125
  className: "relative flex h-12 touch-none items-center gap-2 px-2",
120
126
  children: [
121
127
  /* @__PURE__ */ o("div", { className: "min-w-0 flex-1" }),
122
- /* @__PURE__ */ o(_, {
128
+ /* @__PURE__ */ o(P, {
123
129
  dataTest: `${d}-close`,
124
130
  variant: "textGray",
125
131
  type: "button",
126
132
  "aria-label": U,
127
133
  onClick: () => {
128
- s("closeButton");
134
+ a("closeButton");
129
135
  },
130
- startIcon: /* @__PURE__ */ o(J, {
136
+ startIcon: /* @__PURE__ */ o(Z, {
131
137
  width: 24,
132
138
  height: 24
133
139
  })
134
140
  }),
135
- /* @__PURE__ */ o(W, {
141
+ /* @__PURE__ */ o(ee, {
136
142
  "aria-hidden": "true",
137
143
  focusable: "false",
138
144
  width: 24,
@@ -141,16 +147,16 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
141
147
  })
142
148
  ]
143
149
  }), m && /* @__PURE__ */ o("div", {
144
- id: N,
150
+ id: R,
145
151
  className: "truncate px-4 text-lg font-semibold leading-7 text-delta-800",
146
152
  children: m
147
153
  })]
148
154
  }),
149
155
  /* @__PURE__ */ o("div", {
150
- className: l("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain pl-4 pr-2 pt-2", w || v ? "pb-2" : "pb-[max(0.5rem,env(safe-area-inset-bottom))]"),
151
- children: p($)
156
+ className: l("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain pl-4 pr-2 pt-2", y || v ? "pb-2" : "pb-[max(0.5rem,env(safe-area-inset-bottom))]"),
157
+ children: p(A)
152
158
  }),
153
- w && /* @__PURE__ */ u("div", {
159
+ y && /* @__PURE__ */ u("div", {
154
160
  className: l("border-t-solid flex shrink-0 items-start border-t border-delta-200 bg-white p-1", b ? "justify-between" : "justify-end", "max-xs:flex-wrap max-xs:gap-y-2 max-xs:[&>:nth-child(2)]:ml-auto", !v && "pb-[max(0.25rem,env(safe-area-inset-bottom))]"),
155
161
  children: [
156
162
  b,
@@ -160,12 +166,12 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
160
166
  role: "status",
161
167
  "aria-live": "polite",
162
168
  "aria-atomic": "true",
163
- children: D
169
+ children: M
164
170
  })
165
171
  ]
166
172
  }),
167
173
  v && /* @__PURE__ */ o("div", {
168
- className: l("flex shrink-0 flex-col items-end bg-white p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]", w && "max-xs:pt-1"),
174
+ className: l("flex shrink-0 flex-col items-end bg-white p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]", y && "max-xs:pt-1"),
169
175
  children: v
170
176
  })
171
177
  ]
@@ -174,5 +180,5 @@ var me = 500, Oe = ({ dataTest: d, id: P, open: t, onClose: s, title: m, ariaLab
174
180
  });
175
181
  };
176
182
  export {
177
- Oe as StyledBottomSheet
183
+ Fe as StyledBottomSheet
178
184
  };
@@ -1,64 +1,65 @@
1
1
  import { cn as Le } from "../../../helpers/cn.js";
2
2
  import { firstTabbable as ne } from "../../../helpers/focusable.js";
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";
3
+ import { TOP_LAYER_PROPS as Me, TOP_LAYER_RESET_STYLE as Se, getOpenModalDialogAncestor as Ce, shouldUsePopoverTopLayer as Ie, useTopLayerRef as _e } from "../../../hooks/useTopLayer.hook.js";
4
4
  import { StyledButton as ke } from "../../inputs/button/StyledButton.js";
5
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
- import { SHEET_TEXT as $e } from "../bottom-sheet/sheetCopy.js";
10
- import { formatResultsLabel as Ne } from "../bottom-sheet/formatResultsLabel.js";
11
- import { StyledBottomSheet as je } from "../bottom-sheet/StyledBottomSheet.js";
12
- import { PopoverAnatomy as Ke } from "./PopoverAnatomy.js";
13
- import { useCallback as d, useEffect as v, useId as Ue, useRef as f, useState as l } from "react";
6
+ import { isKeyboardModality as De, trackInputModality as qe } from "../../inputs/full-screen-picker/inputModality.js";
7
+ import { useDebouncedValue as Xe } from "../../../hooks/useDebouncedValue.hook.js";
8
+ import { useFocusTrap as $e } from "../../../hooks/useFocusTrap.hook.js";
9
+ import { useMobileMediaQuery as Ke } from "../../../hooks/useMediaQuery.hook.js";
10
+ import { SHEET_TEXT as Ne } from "../bottom-sheet/sheetCopy.js";
11
+ import { formatResultsLabel as je } from "../bottom-sheet/formatResultsLabel.js";
12
+ import { StyledBottomSheet as Ue } from "../bottom-sheet/StyledBottomSheet.js";
13
+ import { PopoverAnatomy as Ve } from "./PopoverAnatomy.js";
14
+ import { useCallback as d, useEffect as v, useId as Ye, useRef as f, useState as l } from "react";
14
15
  import { Fragment as re, jsx as m, jsxs as ie } from "react/jsx-runtime";
15
- import { FloatingPortal as Ye, autoUpdate as ze, flip as Ve, offset as Ge, shift as Qe, size as Je, useDismiss as Ze, useFloating as et, useInteractions as tt, useMergeRefs as ot } from "@floating-ui/react";
16
- var C = 240, nt = {
16
+ import { FloatingPortal as ze, autoUpdate as Ge, flip as Qe, offset as Je, shift as Ze, size as et, useDismiss as tt, useFloating as ot, useInteractions as nt, useMergeRefs as rt } from "@floating-ui/react";
17
+ var S = 240, it = {
17
18
  info: 472,
18
19
  action: 472
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 = Xe(), n = I === "action", pe = u && !n, w = u && n, y = d((e) => {
20
+ }, se = 0.6, ae = "calc(100vw - 32px)", Rt = ({ dataTest: p, renderTrigger: C, variant: I = "info", title: y, children: _, viewResultsAction: k, resetAction: H, footerActions: W, resultCount: b, locale: R = "en", closeLabel: B = Ne[R].close, ariaLabel: D, onOpenChange: q, className: X, align: $ = "auto", ignoreOutside: K }) => {
21
+ const g = Ye(), N = `${g}-title`, [o, ce] = l(!1), [j, le] = l(), [ue, U] = l(), [de, fe] = l("start"), [T, V] = l(), [me, Y] = l(S), u = Ke(), n = I === "action", pe = u && !n, E = u && n, w = d((e) => {
21
22
  ce(e), q?.(e);
22
- }, [q]), { refs: b, floatingStyles: ge, context: he, placement: V, isPositioned: ve } = et({
23
+ }, [q]), { refs: F, floatingStyles: ge, context: he, placement: z, isPositioned: ve } = ot({
23
24
  open: o,
24
- onOpenChange: y,
25
+ onOpenChange: w,
25
26
  placement: `${T ?? "bottom"}-${de}`,
26
27
  strategy: "fixed",
27
- whileElementsMounted: ze,
28
+ whileElementsMounted: Ge,
28
29
  middleware: [
29
- Ge(8),
30
- ...pe || T ? [] : [Ve({
30
+ Je(8),
31
+ ...pe || T ? [] : [Qe({
31
32
  padding: 8,
32
33
  crossAxis: !1,
33
34
  flipAlignment: !1
34
35
  })],
35
- Qe({ padding: 8 }),
36
- Je({
36
+ Ze({ padding: 8 }),
37
+ et({
37
38
  padding: 8,
38
39
  apply({ availableHeight: e, rects: t }) {
39
- U(Math.min(e, Math.round(window.innerHeight * se))), u || z((a) => Math.max(a, t.floating.width));
40
+ U(Math.min(e, Math.round(window.innerHeight * se))), u || Y((a) => Math.max(a, t.floating.width));
40
41
  }
41
42
  })
42
43
  ]
43
44
  });
44
- o && ve && !T && Y(V.startsWith("top") ? "top" : "bottom");
45
- const F = Ie(K), c = f(null), [r, Ee] = l(null), we = d((e) => {
46
- c.current = e, Ee(e);
47
- }, []), ye = ot([Me(b.setFloating, F), we]), A = f(null), Pe = d((e) => {
48
- A.current = e, b.setReference(e);
49
- }, [b]), G = f(null), O = N?.length ? N.join(",") : void 0, Q = f(O);
45
+ o && ve && !T && V(z.startsWith("top") ? "top" : "bottom");
46
+ const A = Ie(j), c = f(null), [r, ye] = l(null), Ee = d((e) => {
47
+ c.current = e, ye(e);
48
+ }, []), we = rt([_e(F.setFloating, A), Ee]), P = f(null), Pe = d((e) => {
49
+ P.current = e, F.setReference(e);
50
+ }, [F]), G = f(null), O = K?.length ? K.join(",") : void 0, Q = f(O);
50
51
  v(() => {
51
52
  Q.current = O;
52
53
  }, [O]);
53
54
  const h = d((e) => {
54
55
  if (!(e instanceof Element)) return !1;
55
- if (c.current?.contains(e) || A.current?.contains(e) || G.current === e) return !0;
56
+ if (c.current?.contains(e) || P.current?.contains(e) || G.current === e) return !0;
56
57
  const t = Q.current;
57
58
  return t !== void 0 && e.closest(t) !== null;
58
59
  }, []), J = f(null), xe = d((e) => {
59
60
  G.current = e.target, e.target instanceof HTMLElement && c.current?.contains(e.target) && (J.current = e.target);
60
- }, []), { getFloatingProps: Re } = tt([Ze(he, {
61
- enabled: !w,
61
+ }, []), { getFloatingProps: be } = nt([tt(he, {
62
+ enabled: !E,
62
63
  escapeKey: !1,
63
64
  outsidePress: (e) => {
64
65
  const t = e.target;
@@ -68,20 +69,20 @@ var C = 240, nt = {
68
69
  return !a || a.contains(c.current);
69
70
  }
70
71
  })]), s = d(() => {
71
- y(!1);
72
- }, [y]);
72
+ w(!1);
73
+ }, [w]);
73
74
  Be({
74
75
  active: o,
75
76
  requestClose: s,
76
77
  ownerRef: c
77
78
  }), v(() => {
78
- if (!o || w) return;
79
+ if (!o || E) return;
79
80
  const e = (t) => {
80
81
  t.key !== "Escape" || t.defaultPrevented || t.isComposing || (t.preventDefault(), t.stopImmediatePropagation(), We(t));
81
82
  };
82
83
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
83
- }, [o, w]), qe(o && n && r !== null, c);
84
- const [Z, Te] = l(!1);
84
+ }, [o, E]), $e(o && n && r !== null, c);
85
+ const [Z, Re] = l(!1);
85
86
  v(() => {
86
87
  if (!r || n && !Z) return;
87
88
  const e = requestAnimationFrame(() => {
@@ -101,8 +102,8 @@ var C = 240, nt = {
101
102
  cancelAnimationFrame(e), e = requestAnimationFrame(() => {
102
103
  const i = document.activeElement;
103
104
  if (!r.isConnected || i && i !== document.body && h(i)) return;
104
- const S = J.current;
105
- (S?.isConnected && r.contains(S) ? S : ne(r) ?? r).focus({ preventScroll: !0 });
105
+ const M = J.current;
106
+ (M?.isConnected && r.contains(M) ? M : ne(r) ?? r).focus({ preventScroll: !0 });
106
107
  });
107
108
  }, a = (i) => {
108
109
  i.relatedTarget === null && s();
@@ -123,15 +124,15 @@ var C = 240, nt = {
123
124
  const L = f(!1);
124
125
  v(() => {
125
126
  if (o) {
126
- L.current = !0;
127
+ qe(), L.current = !0;
127
128
  return;
128
129
  }
129
130
  if (!L.current) return;
130
131
  L.current = !1;
131
- const e = A.current;
132
+ const e = P.current;
132
133
  if (!e) return;
133
134
  const t = requestAnimationFrame(() => {
134
- document.activeElement === document.body && e.focus();
135
+ document.activeElement === document.body && e.focus({ focusVisible: De() });
135
136
  });
136
137
  return () => {
137
138
  cancelAnimationFrame(t);
@@ -146,58 +147,59 @@ var C = 240, nt = {
146
147
  s();
147
148
  return;
148
149
  }
149
- le(_e(e.currentTarget));
150
+ le(Ce(e.currentTarget));
150
151
  const t = e.currentTarget.getBoundingClientRect(), a = t.left + t.width / 2 > window.innerWidth / 2;
151
- fe($ === "auto" ? a ? "end" : "start" : $), Y(void 0), z(C), U(Math.round(window.innerHeight * se)), Te(e.detail === 0), y(!0);
152
+ fe($ === "auto" ? a ? "end" : "start" : $), V(void 0), Y(S), U(Math.round(window.innerHeight * se)), Re(e.detail === 0), w(!0);
152
153
  },
153
154
  "aria-expanded": o,
154
155
  "aria-controls": o ? g : void 0,
155
156
  "aria-haspopup": n ? "dialog" : void 0,
156
157
  "aria-describedby": !n && o ? g : void 0
157
158
  }
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
+ }, x = (e) => typeof e == "function" ? e({ close: s }) : e, Te = Xe(b, 500), Fe = k ?? (b === void 0 ? void 0 : /* @__PURE__ */ m(ke, {
159
160
  dataTest: `${p}-view-results`,
160
161
  type: "button",
161
162
  variant: "text",
162
163
  onClick: s,
163
- children: Ne(be, R)
164
- })), Ae = u ? ae : nt[I], Oe = u ? ae : void 0;
165
- return w ? /* @__PURE__ */ ie(re, { children: [_(ee), /* @__PURE__ */ m(je, {
164
+ children: je(Te, R)
165
+ })), Ae = u ? ae : it[I], Oe = u ? ae : void 0;
166
+ return E ? /* @__PURE__ */ ie(re, { children: [C(ee), /* @__PURE__ */ m(Ue, {
166
167
  id: g,
167
168
  dataTest: p,
168
169
  open: o,
169
170
  onClose: s,
170
171
  registerBackClose: !1,
171
172
  ownerRef: c,
172
- title: E,
173
+ triggerRef: P,
174
+ title: y,
173
175
  ariaLabel: D,
174
176
  viewResultsAction: k,
175
177
  resetAction: H,
176
178
  footerActions: W,
177
- resultCount: x,
179
+ resultCount: b,
178
180
  locale: R,
179
181
  closeLabel: B,
180
182
  className: X,
181
- children: M
182
- })] }) : /* @__PURE__ */ ie(re, { children: [_(ee), o && /* @__PURE__ */ m(Ye, {
183
- root: K,
183
+ children: _
184
+ })] }) : /* @__PURE__ */ ie(re, { children: [C(ee), o && /* @__PURE__ */ m(ze, {
185
+ root: j,
184
186
  children: /* @__PURE__ */ m("div", {
185
- ...Re(),
187
+ ...be(),
186
188
  onFocusCapture: xe,
187
- ref: ye,
189
+ ref: we,
188
190
  id: g,
189
- "data-placement": V,
191
+ "data-placement": z,
190
192
  "data-test": p,
191
193
  "data-testid": p,
192
194
  role: n ? "dialog" : void 0,
193
- "aria-labelledby": n && E ? j : void 0,
194
- "aria-label": n && !E ? D : void 0,
195
+ "aria-labelledby": n && y ? N : void 0,
196
+ "aria-label": n && !y ? D : void 0,
195
197
  tabIndex: n ? void 0 : -1,
196
- ...F ? Se : {},
198
+ ...A ? Me : {},
197
199
  style: {
198
- ...F ? Ce : {},
200
+ ...A ? Se : {},
199
201
  ...ge,
200
- minWidth: u ? C : me,
202
+ minWidth: u ? S : me,
201
203
  width: Oe,
202
204
  maxWidth: Ae,
203
205
  maxHeight: ue
@@ -205,21 +207,21 @@ var C = 240, nt = {
205
207
  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
208
  children: /* @__PURE__ */ m(He.Provider, {
207
209
  value: c,
208
- children: /* @__PURE__ */ m(Ke, {
210
+ children: /* @__PURE__ */ m(Ve, {
209
211
  dataTest: p,
210
- title: E,
211
- titleId: j,
212
- viewResultsAction: P(Fe),
213
- resetAction: P(H),
214
- footerActions: P(W),
212
+ title: y,
213
+ titleId: N,
214
+ viewResultsAction: x(Fe),
215
+ resetAction: x(H),
216
+ footerActions: x(W),
215
217
  closeLabel: B,
216
218
  onClose: s,
217
- children: P(M)
219
+ children: x(_)
218
220
  })
219
221
  })
220
222
  })
221
223
  })] });
222
224
  };
223
225
  export {
224
- Pt as PopoverSheet
226
+ Rt as PopoverSheet
225
227
  };
@@ -48,6 +48,12 @@ export interface StyledBottomSheetProps {
48
48
  registerBackClose?: boolean;
49
49
  /** Logical owner supplied by a wrapper that must keep one identity across responsive variants. */
50
50
  ownerRef?: RefObject<Element | null>;
51
+ /**
52
+ * The control that opened the sheet; focus returns to it on close. Without it the sheet returns
53
+ * focus to whatever was focused on open — in Safari a tap never focuses a button, so that is the
54
+ * nearest focusable ancestor (a dialog's scrollable content), which then shows a focus ring.
55
+ */
56
+ triggerRef?: RefObject<HTMLElement | null>;
51
57
  }
52
58
  /**
53
59
  * ASMA Design System **Bottom Sheet** (ASMA-8184) — the mobile (0–743px) form of the Action popover:
@@ -63,4 +69,4 @@ export interface StyledBottomSheetProps {
63
69
  * Focus moves to the sheet on open (so the title is announced first) and back to the trigger on
64
70
  * close. `PopoverSheet` with `variant='action'` renders this automatically below 744px.
65
71
  */
66
- export declare const StyledBottomSheet: ({ dataTest, id, open, onClose, title, ariaLabel, children, viewResultsAction, resetAction, footerActions, resultCount, locale, closeLabel, className, registerBackClose, ownerRef, }: StyledBottomSheetProps) => JSX.Element | null;
72
+ export declare const StyledBottomSheet: ({ dataTest, id, open, onClose, title, ariaLabel, children, viewResultsAction, resetAction, footerActions, resultCount, locale, closeLabel, className, registerBackClose, ownerRef, triggerRef, }: StyledBottomSheetProps) => JSX.Element | null;
@@ -0,0 +1,41 @@
1
+ import { ColumnDefLike } from './columnIds';
2
+ /** UX round 4 (D16): the room a sortable column's triangle needs, in px. */
3
+ export declare const SORTABLE_EXTRA_WIDTH = 20;
4
+ /** ui-core's own minimum width of a resizable column. It does not grow with D16. */
5
+ export declare const RESIZABLE_MIN_SIZE = 100;
6
+ /** The parts of a column definition that decide its default width. */
7
+ export interface SizableColumnDef extends ColumnDefLike {
8
+ size?: number;
9
+ minSize?: number;
10
+ maxSize?: number;
11
+ }
12
+ interface ColumnSizingDefaultsOptions {
13
+ /** The table's own `defaultColumn`, which each column definition is merged over. */
14
+ defaultColumn?: SizableColumnDef;
15
+ /** The table's `enableSorting`. */
16
+ enableSorting?: boolean;
17
+ /** Whether the table can resize its columns (D15): only then does a column get ui-core's minimum width. */
18
+ canResize: boolean;
19
+ }
20
+ /**
21
+ * Resolves the default `size`, `minSize` and `maxSize` of every leaf column before TanStack sees the definitions
22
+ * (ASMA-8597, UX round 4, P2e). It changes defaults only: a width the user saved, an app's `initialState.columnSizing`
23
+ * and a controlled `state.columnSizing` are applied on top by TanStack as given (DEC-D16).
24
+ *
25
+ * - **D16, +20 px for a sortable column.** A data column that can sort (the rule `getLeafColumnInfos` already uses, which is
26
+ * TanStack's `getCanSort()` for a leaf) gets `size` + 20, where `size` is its own, else the table's `defaultColumn.size`,
27
+ * else TanStack's 150. Its `minSize` and `maxSize` grow by 20 when the column or `defaultColumn` sets them. A sortable
28
+ * column that opts out of resizing grows too (DEC-D16-OPTOUTS): it keeps no handle, and a `minSize === maxSize` column
29
+ * stays fixed, at the new width. Columns that cannot sort, group headers and ui-core's own columns are left as they are.
30
+ * - **DEC-NARROW, the minimum of a resizable column.** A column that sets no `minSize` gets the smaller of 100 px and its
31
+ * default width (its `size` after D16) as its minimum, so turning resizing on never widens a column past its default
32
+ * width. A column with no `size` at all keeps the 100 px minimum. A column that sets its own `minSize` keeps it.
33
+ * ui-core's own columns keep the 100 px minimum they have always had.
34
+ */
35
+ export declare const resolveColumnSizingDefaults: <TDef extends SizableColumnDef>(columns: readonly TDef[], options: ColumnSizingDefaultsOptions) => TDef[];
36
+ /**
37
+ * Whether a column has a fixed width: it sets `maxSize` equal to `minSize`. Such a column has no resize handle (OQ-15,
38
+ * the apps' own decision), however resizing came to be on. Reads the resolved definition (`column.columnDef`).
39
+ */
40
+ export declare const hasFixedWidth: (columnDef: Pick<SizableColumnDef, "minSize" | "maxSize">) => boolean;
41
+ export {};