asma-ui-core 3.134.1 → 3.134.3

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.
Files changed (34) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/feedback/dialog/StyledDialog.js +174 -149
  3. package/dist/components/feedback/dialog/StyledDialog.module.js +1 -1
  4. package/dist/components/feedback/dialog/StyledDialogActions.js +4 -3
  5. package/dist/components/feedback/dialog/StyledDialogContent.js +9 -8
  6. package/dist/components/feedback/dialog/StyledDialogTitle.js +23 -21
  7. package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +1 -0
  8. package/dist/components/feedback/dialog/dialogHeaderStyles.js +13 -0
  9. package/dist/components/feedback/dialog/useDialogHeaderPinning.js +56 -0
  10. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +200 -182
  11. package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +143 -131
  12. package/dist/components/inputs/full-screen-picker/FullScreenPicker.js +1 -1
  13. package/dist/components/inputs/full-screen-picker/useReleaseFieldOnKeyboardDismiss.js +13 -12
  14. package/dist/hooks/useElementHeightPx.js +26 -0
  15. package/dist/hooks/useLayoutViewportHeight.js +5 -0
  16. package/dist/hooks/useMediaQuery.hook.js +9 -8
  17. package/dist/hooks/useOnScreenKeyboard.js +24 -0
  18. package/dist/index.js +366 -352
  19. package/dist/src/components/feedback/dialog/StyledDialog.d.ts +4 -3
  20. package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +4 -0
  21. package/dist/src/components/feedback/dialog/dialogHeaderStyles.d.ts +39 -0
  22. package/dist/src/components/feedback/dialog/dialogTitleContext.d.ts +5 -0
  23. package/dist/src/components/feedback/dialog/useDialogHeaderPinning.d.ts +33 -0
  24. package/dist/src/hooks/useElementHeightPx.d.ts +16 -0
  25. package/dist/src/hooks/useLayoutViewportHeight.d.ts +6 -0
  26. package/dist/src/hooks/useMediaQuery.hook.d.ts +6 -0
  27. package/dist/src/hooks/useOnScreenKeyboard.d.ts +21 -0
  28. package/dist/src/index.d.ts +6 -0
  29. package/dist/table/components/StyledTableIndex.js +5 -5
  30. package/package.json +1 -1
  31. package/dist/src/table/components/columns/helpers/useElementHeightPx.d.ts +0 -7
  32. package/dist/table/components/columns/helpers/useElementHeightPx.js +0 -26
  33. /package/dist/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.js +0 -0
  34. /package/dist/src/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.d.ts +0 -0
@@ -1,60 +1,62 @@
1
- import { cn as n } from "../../../../helpers/cn.js";
2
- import { firstTabbable as A } from "../../../../helpers/focusable.js";
3
- import { StyledTooltip as le } from "../../../data-display/tooltip/StyledTooltip.js";
4
- import { DialogBusyContext as L, useDialogBusyBoundary as ie } from "../../dialog/DialogBusyContext.js";
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
- import { fullScreenFieldWidthVars as me } from "../../../inputs/field-styles.js";
9
- import { CloseBtn as V } from "../components/CloseBtn.js";
1
+ import { cn as u } from "../../../../helpers/cn.js";
2
+ import { firstTabbable as q } from "../../../../helpers/focusable.js";
3
+ import { StyledTooltip as de } from "../../../data-display/tooltip/StyledTooltip.js";
4
+ import { DialogBusyContext as V, useDialogBusyBoundary as ce } from "../../dialog/DialogBusyContext.js";
5
+ import { OverlayBackOwnerContext as me, isOverlayBackNavigationPending as ue, useBackCloses as fe } from "../../../../hooks/useBackCloses.hook.js";
6
+ import { useFocusTrap as pe } from "../../../../hooks/useFocusTrap.hook.js";
7
+ import { useMobileMediaQuery as ve } from "../../../../hooks/useMediaQuery.hook.js";
8
+ import { useDialogHeaderPinning as he } from "../../dialog/useDialogHeaderPinning.js";
9
+ import { DIALOG_HEADER_ACTIONS_ROW_CLASSES as xe, DIALOG_HEADER_CLASSES as ge, DIALOG_TITLE_CLASSES as be, dialogContentFlowClasses as ye, dialogScrollerStyle as we } from "../../dialog/dialogHeaderStyles.js";
10
+ import { fullScreenFieldWidthVars as Ce } from "../../../inputs/field-styles.js";
11
+ import { CloseBtn as W } from "../components/CloseBtn.js";
10
12
  import { MinimizeBtn as $ } from "../components/MinimizeBtn.js";
11
- import { FullScreenBtn as de } from "../components/FullscreenBtn.js";
12
- import v from "./MinimizableDialogV2.module.js";
13
- import { useTranslations as ue } from "./useTranslations.js";
14
- import { useControlledProps as xe } from "./useControlledProps.js";
15
- import fe from "clsx";
16
- import { useId as W, useLayoutEffect as H, useRef as m } from "react";
17
- import { Fragment as pe, jsx as e, jsxs as a } from "react/jsx-runtime";
18
- var Pe = (C) => {
19
- const { showCloseIcon: R = !0, showMinimizeIcon: _ = !0, showExpandIcon: Q = !0, enableFullscreen: U = !0, fullscreenLockedReason: N, title: u, label: x, children: G, open: l, onClose: J, classNameOverrides: b = {
13
+ import { FullScreenBtn as Se } from "../components/FullscreenBtn.js";
14
+ import f from "./MinimizableDialogV2.module.js";
15
+ import { useTranslations as ze } from "./useTranslations.js";
16
+ import { useControlledProps as Re } from "./useControlledProps.js";
17
+ import Ne from "clsx";
18
+ import { useId as G, useLayoutEffect as Q, useRef as l } from "react";
19
+ import { Fragment as Be, jsx as e, jsxs as r } from "react/jsx-runtime";
20
+ var Je = (R) => {
21
+ const { showCloseIcon: N = !0, showMinimizeIcon: U = !0, showExpandIcon: J = !0, enableFullscreen: K = !0, fullscreenLockedReason: B, title: p, label: v, children: X, open: i, onClose: Y, classNameOverrides: h = {
20
22
  maximized: "",
21
23
  minimized: "",
22
24
  fullscreen: ""
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
- if (g) return !1;
25
- I(!1), J();
25
+ }, dataTest: Z, actionNode: ee, locale: te = "en", busyReason: ie, style: I, initialFocusRef: _ } = R, x = ve(), o = ze(te), n = l(null), c = l(null), k = l(null), E = l(null), g = l(!1), b = l(null), y = G(), F = G(), T = l(null), { headerRef: oe, pinned: w, hidden: C, scrollPaddingTop: ne, scrollPaddingBottom: le } = he(T), { minimized: t, setMinimized: A, fullScreen: a, setFullScreen: D } = Re(R), s = a && !t, L = !!B, { busy: S, busyReason: O, contextValue: M } = ce(ie ?? o.waitUntilSaved), m = () => {
26
+ if (S) return !1;
27
+ A(!1), Y();
26
28
  };
27
- H(() => {
28
- o.current?.toggleAttribute("inert", t), f.current?.toggleAttribute("inert", !t);
29
- }, [t]), H(() => {
30
- const z = l && !w.current, d = !l && w.current;
31
- if (w.current = l, d) {
32
- const D = y.current;
33
- y.current = null, (!document.activeElement || document.activeElement === document.body) && D?.isConnected && D.focus({ preventScroll: !0 });
29
+ Q(() => {
30
+ n.current?.toggleAttribute("inert", t), c.current?.toggleAttribute("inert", !t);
31
+ }, [t]), Q(() => {
32
+ const z = i && !g.current, d = !i && g.current;
33
+ if (g.current = i, d) {
34
+ const H = b.current;
35
+ b.current = null, (!document.activeElement || document.activeElement === document.body) && H?.isConnected && H.focus({ preventScroll: !0 });
34
36
  return;
35
37
  }
36
38
  if (!z) return;
37
- y.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
38
- const q = t ? f.current : o.current, ne = t ? S.current : F.current;
39
- (B?.current ?? ne ?? (q ? A(q) : void 0))?.focus({ preventScroll: !0 });
39
+ b.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
40
+ const j = t ? c.current : n.current, se = t ? E.current : k.current;
41
+ (_?.current ?? se ?? (j ? q(j) : void 0))?.focus({ preventScroll: !0 });
40
42
  }, [
41
- B,
43
+ _,
42
44
  t,
43
- l
45
+ i
44
46
  ]);
45
- const O = () => {
46
- const z = t ? o : f;
47
- I(!t), requestAnimationFrame(() => {
47
+ const P = () => {
48
+ const z = t ? n : c;
49
+ A(!t), requestAnimationFrame(() => {
48
50
  const d = z.current;
49
- d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ?? A(d))?.focus({ preventScroll: !0 });
51
+ d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ?? q(d))?.focus({ preventScroll: !0 });
50
52
  });
51
53
  };
52
- se(l && c, o, h), re({
53
- active: l && !t,
54
- requestClose: () => !c && ae() ? !1 : h(),
55
- ownerRef: o
54
+ pe(i && s, n, m), fe({
55
+ active: i && !t,
56
+ requestClose: () => !s && ue() ? !1 : m(),
57
+ ownerRef: n
56
58
  });
57
- const ee = c ? r ? {
59
+ const re = s ? x ? {
58
60
  inset: 0,
59
61
  maxHeight: "100dvh",
60
62
  maxWidth: "100dvw",
@@ -70,126 +72,136 @@ var Pe = (C) => {
70
72
  width: "min(1000px, calc(100vw - 32px))",
71
73
  maxWidth: "min(1000px, calc(100vw - 32px))",
72
74
  height: "95dvh",
73
- ...me
75
+ ...Ce
74
76
  } : void 0;
75
- if (!l) return null;
76
- const te = x ? `${T} ${p}` : p;
77
- return /* @__PURE__ */ a(pe, { children: [
77
+ if (!i) return null;
78
+ const ae = v ? `${F} ${y}` : y;
79
+ return /* @__PURE__ */ r(Be, { children: [
78
80
  /* @__PURE__ */ e("div", {
79
- ref: f,
81
+ ref: c,
80
82
  style: {
81
83
  zIndex: 51,
82
- ...k
84
+ ...I
83
85
  },
84
- className: n(v["minimized-dialog"], !t && v.hidden, b.minimized),
85
- children: /* @__PURE__ */ a("div", {
86
- className: fe("flex items-center justify-between", !t && "hidden"),
87
- "data-testid": K,
86
+ className: u(f["minimized-dialog"], !t && f.hidden, h.minimized),
87
+ children: /* @__PURE__ */ r("div", {
88
+ className: Ne("flex items-center justify-between", !t && "hidden"),
89
+ "data-testid": Z,
88
90
  children: [/* @__PURE__ */ e("div", {
89
- className: n("max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
90
- children: /* @__PURE__ */ e(le, {
91
- title: u,
91
+ className: "min-w-0 max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800",
92
+ children: /* @__PURE__ */ e(de, {
93
+ title: p,
92
94
  placement: "top",
93
95
  children: /* @__PURE__ */ e("div", {
94
- className: n("truncate", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
95
- children: u
96
+ tabIndex: 0,
97
+ "data-testid": "minimized-title",
98
+ className: "truncate focus-visible:[outline-offset:-2px]",
99
+ children: p
96
100
  })
97
101
  })
98
- }), /* @__PURE__ */ a("div", {
102
+ }), /* @__PURE__ */ r("div", {
99
103
  className: "flex items-center gap-x-1",
100
104
  children: [/* @__PURE__ */ e($, {
101
105
  type: "expand",
102
- visibility: Q,
103
- onClick: O,
104
- tooltipTitle: i.expand
105
- }), /* @__PURE__ */ e(V, {
106
- buttonRef: S,
107
- showCloseIcon: R,
108
- onClick: h,
109
- disabledReason: g ? E : void 0,
110
- tooltipTitle: i.close
106
+ visibility: J,
107
+ onClick: P,
108
+ tooltipTitle: o.expand
109
+ }), /* @__PURE__ */ e(W, {
110
+ buttonRef: E,
111
+ showCloseIcon: N,
112
+ onClick: m,
113
+ disabledReason: S ? O : void 0,
114
+ tooltipTitle: o.close
111
115
  })]
112
116
  })]
113
117
  })
114
118
  }),
115
- c && /* @__PURE__ */ e("div", {
119
+ s && /* @__PURE__ */ e("div", {
116
120
  className: "fixed inset-0 z-[52] bg-[rgb(98,110,126)] bg-opacity-70",
117
121
  onClick: () => {
118
- j || M(!1);
122
+ L || D(!1);
119
123
  }
120
124
  }),
121
125
  /* @__PURE__ */ e("div", {
122
126
  style: {
123
127
  zIndex: 51,
124
- ...k,
125
- ...ee
128
+ ...I,
129
+ ...re
126
130
  },
127
- ref: o,
131
+ ref: n,
128
132
  role: "dialog",
129
- "aria-modal": c ? !0 : void 0,
130
- "aria-labelledby": te,
131
- className: n(v.dialog, t && v.hidden, !s && b.maximized, s && b.fullscreen, c && "fixed z-[53] duration-0"),
132
- children: /* @__PURE__ */ a(oe.Provider, {
133
- value: o,
134
- children: [/* @__PURE__ */ a("div", {
135
- className: n("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
136
- children: [/* @__PURE__ */ a("div", {
137
- className: n("flex items-center justify-between", "max-xs:flex-wrap-reverse max-xs:gap-x-2 max-xs:gap-y-2"),
138
- children: [x ? /* @__PURE__ */ e("div", {
139
- id: T,
140
- className: "text-sm text-delta-700 max-xs:min-w-0 max-xs:flex-auto max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]",
141
- children: x
142
- }) : /* @__PURE__ */ e("div", {
143
- id: p,
144
- className: n("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none max-xs:hyphens-auto max-xs:whitespace-normal", "max-xs:block max-xs:min-w-[min(100%,5rem)] max-xs:grow max-xs:basis-[min-content] max-xs:break-words"),
145
- children: u
146
- }), /* @__PURE__ */ a("div", {
147
- className: "flex items-center gap-x-1 max-xs:ml-auto max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2 max-xs:self-end",
148
- children: [
149
- /* @__PURE__ */ e(L.Provider, {
150
- value: P,
151
- children: X
152
- }),
153
- /* @__PURE__ */ e($, {
154
- visibility: _ && !r,
155
- type: "minimize",
156
- onClick: O,
157
- tooltipTitle: i.minimize
158
- }),
159
- /* @__PURE__ */ e(de, {
160
- showFullScreenIcon: (U || j) && !r,
161
- disabledReason: N,
162
- fullScreen: s,
163
- onClick: () => {
164
- M(!s);
165
- },
166
- tooltipTitle: s ? i.exitFullscreen : i.fullscreen
167
- }),
168
- /* @__PURE__ */ e(V, {
169
- buttonRef: F,
170
- showCloseIcon: R,
171
- onClick: h,
172
- disabledReason: g ? E : void 0,
173
- tooltipTitle: i.close
174
- })
175
- ]
133
+ "aria-modal": s ? !0 : void 0,
134
+ "aria-labelledby": ae,
135
+ className: u(f.dialog, t && f.hidden, !a && h.maximized, a && h.fullscreen, s && "fixed z-[53] duration-0"),
136
+ children: /* @__PURE__ */ e(me.Provider, {
137
+ value: n,
138
+ children: /* @__PURE__ */ r("div", {
139
+ ref: T,
140
+ "data-dialog-body": "",
141
+ className: u(t && "hidden", "flex min-h-0 flex-grow flex-col overflow-y-auto overscroll-contain", "[&>[data-dialog-content-flow]>[data-dialog-content]]:!flex-[1_0_auto]", "[&_[data-dialog-footer]]:sticky [&_[data-dialog-footer]]:bottom-0 [&_[data-dialog-footer]]:z-[2] [&_[data-dialog-footer]]:bg-white"),
142
+ style: we(ne, le),
143
+ children: [/* @__PURE__ */ r("div", {
144
+ ref: oe,
145
+ "data-dialog-header": "",
146
+ "data-header-pinned": w ? "true" : "false",
147
+ "aria-hidden": C || void 0,
148
+ hidden: C,
149
+ className: u(ge, "border-b-[1px] border-delta-200 sm:rounded-t-lg", w && "sticky top-0 z-[2]", C && "hidden"),
150
+ children: [/* @__PURE__ */ r("div", {
151
+ className: xe,
152
+ children: [v && /* @__PURE__ */ e("div", {
153
+ id: F,
154
+ className: "min-w-0 flex-auto hyphens-auto text-sm text-delta-700 [overflow-wrap:anywhere]",
155
+ children: v
156
+ }), /* @__PURE__ */ r("div", {
157
+ className: "ml-auto flex items-center gap-x-1 max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2",
158
+ children: [
159
+ /* @__PURE__ */ e(V.Provider, {
160
+ value: M,
161
+ children: ee
162
+ }),
163
+ /* @__PURE__ */ e($, {
164
+ visibility: U && !x,
165
+ type: "minimize",
166
+ onClick: P,
167
+ tooltipTitle: o.minimize
168
+ }),
169
+ /* @__PURE__ */ e(Se, {
170
+ showFullScreenIcon: (K || L) && !x,
171
+ disabledReason: B,
172
+ fullScreen: a,
173
+ onClick: () => {
174
+ D(!a);
175
+ },
176
+ tooltipTitle: a ? o.exitFullscreen : o.fullscreen
177
+ }),
178
+ /* @__PURE__ */ e(W, {
179
+ buttonRef: k,
180
+ showCloseIcon: N,
181
+ onClick: m,
182
+ disabledReason: S ? O : void 0,
183
+ tooltipTitle: o.close
184
+ })
185
+ ]
186
+ })]
187
+ }), /* @__PURE__ */ e("div", {
188
+ id: y,
189
+ className: be,
190
+ children: p
176
191
  })]
177
- }), x && /* @__PURE__ */ e("div", {
178
- id: p,
179
- className: n("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
180
- children: u
192
+ }), /* @__PURE__ */ e("div", {
193
+ "data-dialog-content-flow": "",
194
+ className: ye(w),
195
+ children: /* @__PURE__ */ e(V.Provider, {
196
+ value: M,
197
+ children: X
198
+ })
181
199
  })]
182
- }), /* @__PURE__ */ e("div", {
183
- className: n(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
184
- children: /* @__PURE__ */ e(L.Provider, {
185
- value: P,
186
- children: G
187
- })
188
- })]
200
+ })
189
201
  })
190
202
  })
191
203
  ] });
192
204
  };
193
205
  export {
194
- Pe as MinimizableDialogV2
206
+ Je as MinimizableDialogV2
195
207
  };
@@ -5,7 +5,7 @@ import { usePickerOneRowHeaderMediaQuery as N } from "../../../hooks/useMediaQue
5
5
  import { StyledDialog as S } from "../../feedback/dialog/StyledDialog.js";
6
6
  import { PickerLiveRegion as R } from "./PickerLiveRegion.js";
7
7
  import { useReleaseFieldOnKeyboardDismiss as I } from "./useReleaseFieldOnKeyboardDismiss.js";
8
- import { useVisualViewportHeight as F } from "./useVisualViewportHeight.js";
8
+ import { useVisualViewportHeight as F } from "../../../hooks/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 }) => {
@@ -1,18 +1,19 @@
1
+ import { isTextField as a, isVisualViewportShrunkByKeyboard as d } from "../../../hooks/useOnScreenKeyboard.js";
1
2
  import { useEffect as c } from "react";
2
- var l = 150, a = (e) => window.innerHeight - e.height * e.scale >= l, u = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable, f = (e) => {
3
+ var p = (t) => {
3
4
  c(() => {
4
- const t = window.visualViewport;
5
- if (!t) return;
6
- let s = a(t);
7
- const n = () => {
8
- const r = a(t), d = s && !r;
9
- if (s = r, !d) return;
10
- const i = e.current?.closest("dialog"), o = document.activeElement;
11
- i && u(o) && i.contains(o) && i.focus({ preventScroll: !0 });
5
+ const e = window.visualViewport;
6
+ if (!e) return;
7
+ let i = d(e);
8
+ const r = () => {
9
+ const o = d(e), l = i && !o;
10
+ if (i = o, !l) return;
11
+ const s = t.current?.closest("dialog"), n = document.activeElement;
12
+ s && a(n) && s.contains(n) && s.focus({ preventScroll: !0 });
12
13
  };
13
- return t.addEventListener("resize", n), () => t.removeEventListener("resize", n);
14
- }, [e]);
14
+ return e.addEventListener("resize", r), () => e.removeEventListener("resize", r);
15
+ }, [t]);
15
16
  };
16
17
  export {
17
- f as useReleaseFieldOnKeyboardDismiss
18
+ p as useReleaseFieldOnKeyboardDismiss
18
19
  };
@@ -0,0 +1,26 @@
1
+ import { useCallback as h, useLayoutEffect as d, useState as s } from "react";
2
+ var g = (n) => Math.round(n.getBoundingClientRect().height);
3
+ function b(n = g) {
4
+ const [t, a] = s(null), [u, l] = s(0), m = h((e) => a(e), []);
5
+ return d(() => {
6
+ if (!t) return;
7
+ let e = 0;
8
+ const o = () => {
9
+ const i = n(t);
10
+ i !== null && l((c) => c === i ? c : i);
11
+ }, f = () => {
12
+ cancelAnimationFrame(e), e = requestAnimationFrame(o);
13
+ };
14
+ if (o(), typeof ResizeObserver > "u") return () => cancelAnimationFrame(e);
15
+ const r = new ResizeObserver(f);
16
+ return r.observe(t), () => {
17
+ cancelAnimationFrame(e), r.disconnect();
18
+ };
19
+ }, [t, n]), {
20
+ ref: m,
21
+ heightPx: t ? u : 0
22
+ };
23
+ }
24
+ export {
25
+ b as useElementHeightPx
26
+ };
@@ -0,0 +1,5 @@
1
+ import { useSyncExternalStore as r } from "react";
2
+ var t = (e) => (window.addEventListener("resize", e), () => window.removeEventListener("resize", e)), n = () => window.innerHeight, i = () => 0, s = () => r(t, n, i);
3
+ export {
4
+ s as useLayoutViewportHeight
5
+ };
@@ -3,24 +3,25 @@ function e(t) {
3
3
  function i() {
4
4
  return window.matchMedia(t).matches;
5
5
  }
6
- function a(r) {
7
- const n = window.matchMedia(t);
8
- return n.addEventListener("change", r), () => {
9
- n.removeEventListener("change", r);
6
+ function n(r) {
7
+ const a = window.matchMedia(t);
8
+ return a.addEventListener("change", r), () => {
9
+ a.removeEventListener("change", r);
10
10
  };
11
11
  }
12
12
  function u() {
13
13
  return !1;
14
14
  }
15
15
  return function() {
16
- return o(a, i, u);
16
+ return o(n, i, u);
17
17
  };
18
18
  }
19
- var h = e("(max-width: 743px)"), s = e("not all and (min-width: 320px)"), x = e("(max-height: 480px)"), c = e("(max-height: 480px) and (min-width: 480px)"), m = e("(max-width: 743px), (max-height: 480px)");
19
+ var h = e("(max-width: 743px)"), s = e("not all and (min-width: 320px)"), m = e("(max-height: 480px)"), x = e("(max-height: 30em)"), c = e("(max-height: 480px) and (min-width: 480px)"), p = e("(max-width: 743px), (max-height: 480px)");
20
20
  export {
21
- m as useFullScreenPickerMediaQuery,
21
+ p as useFullScreenPickerMediaQuery,
22
22
  s as useMaxXsMediaQuery,
23
23
  h as useMobileMediaQuery,
24
24
  c as usePickerOneRowHeaderMediaQuery,
25
- x as useShortViewportMediaQuery
25
+ x as useShortScreenMediaQuery,
26
+ m as useShortViewportMediaQuery
26
27
  };
@@ -0,0 +1,24 @@
1
+ import { useSyncExternalStore as t } from "react";
2
+ var r = 150, i = (e = typeof window > "u" ? void 0 : window.visualViewport) => !!e && window.innerHeight - e.height * e.scale >= r, o = (e) => typeof HTMLElement > "u" || !(e instanceof HTMLElement) || e.inputMode === "none" ? !1 : e instanceof HTMLTextAreaElement || e.isContentEditable ? !0 : e instanceof HTMLInputElement ? ![
3
+ "button",
4
+ "checkbox",
5
+ "color",
6
+ "file",
7
+ "hidden",
8
+ "image",
9
+ "radio",
10
+ "range",
11
+ "reset",
12
+ "submit"
13
+ ].includes(e.type) : !1, s = () => typeof document < "u" && o(document.activeElement) && i(), d = (e) => {
14
+ const n = window.visualViewport;
15
+ return n?.addEventListener("resize", e), window.addEventListener("resize", e), document.addEventListener("focusin", e), document.addEventListener("focusout", e), () => {
16
+ n?.removeEventListener("resize", e), window.removeEventListener("resize", e), document.removeEventListener("focusin", e), document.removeEventListener("focusout", e);
17
+ };
18
+ }, u = () => !1, f = () => t(d, s, u);
19
+ export {
20
+ s as isOnScreenKeyboardOpen,
21
+ o as isTextField,
22
+ i as isVisualViewportShrunkByKeyboard,
23
+ f as useOnScreenKeyboardOpen
24
+ };