@floegence/floe-webapp-core 0.86.63 → 0.86.65

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,21 +1,22 @@
1
- import { createComponent as r, use as G, setAttribute as c, style as ne, Portal as ae, spread as I, mergeProps as E, memo as p, insert as i, effect as P, className as q, template as m } from "solid-js/web";
2
- import { createSignal as T, onMount as le, onCleanup as M, createUniqueId as ie, createEffect as K, createMemo as U, Show as u, untrack as V } from "solid-js";
1
+ import { createComponent as r, use as q, setAttribute as c, style as ne, Portal as ae, spread as E, mergeProps as M, memo as x, insert as s, effect as P, className as K, template as m } from "solid-js/web";
2
+ import { createSignal as T, onMount as le, onCleanup as B, createUniqueId as ie, createEffect as j, createMemo as U, Show as u, untrack as V } from "solid-js";
3
3
  import { cn as g } from "../../utils/cn.js";
4
- import { Button as j } from "./Button.js";
4
+ import { Button as H } from "./Button.js";
5
5
  import { X as de } from "../icons/index.js";
6
- import { useResolvedFloeConfig as fe } from "../../context/FloeConfigContext.js";
7
- import { useOverlayMask as se } from "../../hooks/useOverlayMask.js";
8
- import { resolveSurfacePortalHost as ce, DIALOG_SURFACE_BOUNDARY_ATTR as k, SURFACE_PORTAL_LAYER_ATTR as ue, DIALOG_SURFACE_HOST_ATTR as ge, isSurfacePortalMode as z, projectSurfacePortalRect as me, resolveSurfacePortalBoundaryRect as he, resolveSurfacePortalMount as ve } from "./dialogSurfaceScope.js";
6
+ import { useResolvedFloeConfig as se } from "../../context/FloeConfigContext.js";
7
+ import { useOverlayMask as fe } from "../../hooks/useOverlayMask.js";
8
+ import { resolveSurfacePortalHost as ce, DIALOG_SURFACE_BOUNDARY_ATTR as S, SURFACE_PORTAL_LAYER_ATTR as ue, DIALOG_SURFACE_HOST_ATTR as ge, isSurfacePortalMode as z, projectSurfacePortalRect as me, resolveSurfacePortalBoundaryRect as he, resolveSurfacePortalMount as ve } from "./dialogSurfaceScope.js";
9
9
  import { LOCAL_INTERACTION_SURFACE_ATTR as ye } from "./localInteractionSurface.js";
10
- import { createFloatingPresence as we } from "./floatingPresence.js";
11
- import { useDialogPlacement as be } from "./DialogPlacementContext.js";
12
- import { observeViewport as pe, viewportStyle as xe } from "../../viewport.js";
13
- import { resolveFloatingBoundary as $e } from "./surfaceFloatingBoundary.js";
14
- var Ae = /* @__PURE__ */ m("<span aria-hidden=true>"), Ce = /* @__PURE__ */ m('<h2 class="text-[length:var(--floe-type-heading-sm)] font-semibold leading-[var(--floe-line-heading)] tracking-[var(--floe-tracking-tight)] text-[var(--floe-ink)]">'), _e = /* @__PURE__ */ m('<div data-floe-dialog-header class="flex shrink-0 items-start justify-between gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-b border-[var(--floe-line)]"><div>'), ke = /* @__PURE__ */ m('<p class="mb-3 shrink-0 text-[length:var(--floe-type-body)] leading-[var(--floe-line-body)] text-[var(--floe-ink-soft)] last:mb-0">'), Se = /* @__PURE__ */ m('<div data-floe-dialog-footer class="flex shrink-0 items-center justify-end gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-t border-[var(--floe-line)]">'), Oe = /* @__PURE__ */ m("<div><div></div><div><div data-floe-surface=floating><div data-floe-dialog-body>"), Re = /* @__PURE__ */ m("<h2 class=sr-only>");
15
- const De = {
10
+ import { createFloatingPresence as be } from "./floatingPresence.js";
11
+ import { observeDialogHeight as we } from "./dialogHeightMotion.js";
12
+ import { useDialogPlacement as pe } from "./DialogPlacementContext.js";
13
+ import { observeViewport as xe, viewportStyle as $e } from "../../viewport.js";
14
+ import { resolveFloatingBoundary as Ae } from "./surfaceFloatingBoundary.js";
15
+ var Ce = /* @__PURE__ */ m("<span aria-hidden=true>"), _e = /* @__PURE__ */ m('<h2 class="text-[length:var(--floe-type-heading-sm)] font-semibold leading-[var(--floe-line-heading)] tracking-[var(--floe-tracking-tight)] text-[var(--floe-ink)]">'), ke = /* @__PURE__ */ m('<div data-floe-dialog-header class="flex shrink-0 items-start justify-between gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-b border-[var(--floe-line)]"><div>'), Se = /* @__PURE__ */ m('<p class="mb-3 shrink-0 text-[length:var(--floe-type-body)] leading-[var(--floe-line-body)] text-[var(--floe-ink-soft)] last:mb-0">'), Oe = /* @__PURE__ */ m('<div data-floe-dialog-footer class="flex shrink-0 items-center justify-end gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-t border-[var(--floe-line)]">'), Re = /* @__PURE__ */ m("<div><div></div><div><div data-floe-surface=floating><div data-floe-dialog-body>"), De = /* @__PURE__ */ m("<h2 class=sr-only>");
16
+ const Pe = {
16
17
  display: "none"
17
18
  };
18
- function Pe(e) {
19
+ function Te(e) {
19
20
  if (typeof queueMicrotask == "function") {
20
21
  queueMicrotask(e);
21
22
  return;
@@ -25,59 +26,64 @@ function Pe(e) {
25
26
  function Z(e) {
26
27
  return `${e.left}|${e.top}|${e.right}|${e.bottom}|${e.width}|${e.height}`;
27
28
  }
28
- function Te(e) {
29
+ function Be(e) {
29
30
  return typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(e) : window.setTimeout(() => e(Date.now()), 16);
30
31
  }
31
- function Be(e) {
32
+ function Fe(e) {
32
33
  if (typeof window < "u" && typeof window.cancelAnimationFrame == "function") {
33
34
  window.cancelAnimationFrame(e);
34
35
  return;
35
36
  }
36
37
  window.clearTimeout(e);
37
38
  }
38
- function Fe(e) {
39
- const x = be(), [n, W] = T();
40
- le(() => M(pe(window, W)));
41
- const s = ie(), B = () => `dialog-${s}-title`, H = () => `dialog-${s}-description`;
42
- let S;
43
- const [O, Y] = T(null), [L, X] = T(0), [J, Q] = T(0), $ = () => e.presentation === "side-drawer", h = () => e.presentation === "bottom-drawer", f = we({
44
- open: () => e.open && !!O() && L() > 0,
45
- element: () => S
46
- }), A = () => f.mounted() && !!O() && L() > 0;
47
- K(() => e.onPresenceChange?.(A())), M(() => e.onPresenceChange?.(!1));
39
+ function Ie(e) {
40
+ const $ = pe(), [n, W] = T();
41
+ le(() => B(xe(window, W)));
42
+ const f = ie(), F = () => `dialog-${f}-title`, L = () => `dialog-${f}-description`;
43
+ let A;
44
+ const [O, Y] = T(null), [N, X] = T(0), [J, Q] = T(0), C = () => e.presentation === "side-drawer", h = () => e.presentation === "bottom-drawer", i = be({
45
+ open: () => e.open && !!O() && N() > 0,
46
+ element: () => A
47
+ }), v = () => i.mounted() && !!O() && N() > 0;
48
+ j(() => {
49
+ const t = A, l = i.state();
50
+ !t || l !== "open" || !v() || B(we(t, {
51
+ isSettled: () => i.state() === "open"
52
+ }));
53
+ }), j(() => e.onPresenceChange?.(v())), B(() => e.onPresenceChange?.(!1));
48
54
  const ee = (t) => {
49
- Y(t), Pe(() => {
50
- V(O) === t && X((d) => d + 1);
55
+ Y(t), Te(() => {
56
+ V(O) === t && X((l) => l + 1);
51
57
  });
52
- }, R = U(() => A() ? ce({
58
+ }, R = U(() => v() ? ce({
53
59
  owner: O()
54
60
  }) : {
55
61
  host: null,
56
62
  boundaryHost: null,
57
63
  mountHost: null,
58
64
  mode: "global"
59
- }), C = () => `dialog-boundary-${s}`, a = () => x.mode() === "auto" && z(R()), te = () => a() ? ve(R()) : void 0, N = () => e.globalZIndex ?? x.globalZIndex(), F = (t) => me($e(t, void 0, V(n)?.safeArea) ?? he(t), t), oe = () => F(R()), D = U(() => (J(), n(), oe())), re = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${k}="${C()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${k}="${C()}"]`) : !1;
60
- return K(() => {
65
+ }), _ = () => `dialog-boundary-${f}`, a = () => $.mode() === "auto" && z(R()), te = () => a() ? ve(R()) : void 0, G = () => e.globalZIndex ?? $.globalZIndex(), I = (t) => me(Ae(t, void 0, V(n)?.safeArea) ?? he(t), t), oe = () => I(R()), D = U(() => (J(), n(), oe())), re = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${S}="${_()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${S}="${_()}"]`) : !1;
66
+ return j(() => {
61
67
  const t = R();
62
- if (!A() || !a() || typeof window > "u")
68
+ if (!v() || !a() || typeof window > "u")
63
69
  return;
64
- let d = !1, v = null, l = Z(F(t));
65
- const y = () => {
66
- if (d || !z(t))
70
+ let l = !1, y = null, d = Z(I(t));
71
+ const b = () => {
72
+ if (l || !z(t))
67
73
  return;
68
- const o = Z(F(t));
69
- o !== l && (l = o, Q((w) => w + 1));
70
- }, _ = () => {
71
- d || (v = Te(() => {
72
- y(), _();
74
+ const o = Z(I(t));
75
+ o !== d && (d = o, Q((w) => w + 1));
76
+ }, k = () => {
77
+ l || (y = Be(() => {
78
+ b(), k();
73
79
  }));
74
80
  };
75
- _(), M(() => {
76
- d = !0, v !== null && Be(v);
81
+ k(), B(() => {
82
+ l = !0, y !== null && Fe(y);
77
83
  });
78
- }), se({
79
- open: A,
80
- root: () => S,
84
+ }), fe({
85
+ open: v,
86
+ root: () => A,
81
87
  containsTarget: re,
82
88
  onClose: () => e.onOpenChange(!1),
83
89
  lockBodyScroll: () => !a(),
@@ -90,11 +96,11 @@ function Fe(e) {
90
96
  blockTouchMove: () => a() ? "none" : "outside",
91
97
  restoreFocus: !0
92
98
  }), [(() => {
93
- var t = Ae();
94
- return G(ee, t), c(t, "data-floe-dialog-owner-anchor", s), ne(t, De), t;
99
+ var t = Ce();
100
+ return q(ee, t), c(t, "data-floe-dialog-owner-anchor", f), ne(t, Pe), t;
95
101
  })(), r(u, {
96
102
  get when() {
97
- return A();
103
+ return v();
98
104
  },
99
105
  get children() {
100
106
  return r(ae, {
@@ -102,8 +108,8 @@ function Fe(e) {
102
108
  return te();
103
109
  },
104
110
  get children() {
105
- var t = Oe(), d = t.firstChild, v = d.nextSibling, l = v.firstChild, y = l.firstChild;
106
- c(t, "data-floe-dialog-overlay-root", s), I(t, E({
111
+ var t = Re(), l = t.firstChild, y = l.nextSibling, d = y.firstChild, b = d.firstChild;
112
+ c(t, "data-floe-dialog-overlay-root", f), E(t, M({
107
113
  get "data-floe-dialog-mode"() {
108
114
  return a() ? "surface" : "global";
109
115
  },
@@ -111,28 +117,28 @@ function Fe(e) {
111
117
  return e.presentation ?? "dialog";
112
118
  },
113
119
  get "data-floating-presence"() {
114
- return f.state();
120
+ return i.state();
115
121
  },
116
122
  get "aria-hidden"() {
117
- return f.exiting() ? "true" : void 0;
123
+ return i.exiting() ? "true" : void 0;
118
124
  }
119
125
  }, {
120
126
  [ye]: "true"
121
127
  }, () => ({
122
128
  [ue]: "true",
123
- [k]: C()
129
+ [S]: _()
124
130
  }), {
125
131
  get class() {
126
- return g(a() ? g("absolute z-20 box-border", !$() && "p-3") : g("fixed box-border p-4", N() === void 0 && "z-50"), h() && "floe-bottom-drawer-overlay", $() && "floe-side-drawer-overlay", f.exiting() && !h() && "pointer-events-none");
132
+ return g(a() ? g("absolute z-20 box-border", !C() && "p-3") : g("fixed box-border p-4", G() === void 0 && "z-50"), h() && "floe-bottom-drawer-overlay", C() && "floe-side-drawer-overlay", i.exiting() && !h() && "pointer-events-none");
127
133
  },
128
134
  get style() {
129
- return p(() => !!a())() ? {
135
+ return x(() => !!a())() ? {
130
136
  left: `${D().left}px`,
131
137
  top: `${D().top}px`,
132
138
  width: `${D().width}px`,
133
139
  height: `${D().height}px`
134
140
  } : {
135
- ...n() ? xe(n()) : {
141
+ ...n() ? $e(n()) : {
136
142
  inset: "0"
137
143
  },
138
144
  "--floe-dialog-safe-top": `${(n()?.safeArea.top ?? 0) / (n()?.fixedScale ?? 1)}px`,
@@ -143,33 +149,33 @@ function Fe(e) {
143
149
  "padding-right": "max(var(--floe-dialog-gap-x, 1rem), var(--floe-dialog-safe-right))",
144
150
  "padding-bottom": "max(var(--floe-dialog-gap-y, 1rem), var(--floe-dialog-safe-bottom))",
145
151
  "padding-left": "max(var(--floe-dialog-gap-x, 1rem), var(--floe-dialog-safe-left))",
146
- "z-index": N()
152
+ "z-index": G()
147
153
  };
148
154
  }
149
- }), !1, !0), c(d, "data-floe-dialog-backdrop", s), I(d, E(() => ({
150
- [k]: C()
155
+ }), !1, !0), c(l, "data-floe-dialog-backdrop", f), E(l, M(() => ({
156
+ [S]: _()
151
157
  }), {
152
158
  get "data-floating-presence"() {
153
- return f.state();
159
+ return i.state();
154
160
  },
155
161
  get class() {
156
162
  return g("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", h() ? "floe-bottom-drawer-backdrop" : a() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
157
163
  },
158
164
  onClick: () => {
159
- !f.exiting() && e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
165
+ !i.exiting() && e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
160
166
  }
161
167
  }), !1, !1);
162
- var _ = S;
163
- return typeof _ == "function" ? G(_, l) : S = l, c(l, "data-floe-dialog-panel", s), I(l, E({
168
+ var k = A;
169
+ return typeof k == "function" ? q(k, d) : A = d, c(d, "data-floe-dialog-panel", f), E(d, M({
164
170
  get "data-floe-drawer-side"() {
165
- return p(() => !!$())() ? e.drawerSide ?? "right" : void 0;
171
+ return x(() => !!C())() ? e.drawerSide ?? "right" : void 0;
166
172
  }
167
173
  }, () => ({
168
- [k]: C(),
174
+ [S]: _(),
169
175
  [ge]: "true"
170
176
  }), {
171
177
  get class() {
172
- return g(a() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md", "bg-popover text-popover-foreground rounded-panel shadow-[var(--floe-elevation-float-strong)]", "border border-[var(--floe-line)]", "floe-floating-presence", h() ? "floe-bottom-drawer-panel" : $() ? "floe-side-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
178
+ return g(a() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md", "bg-popover text-popover-foreground rounded-panel shadow-[var(--floe-elevation-float-strong)]", "border border-[var(--floe-line)]", "floe-floating-presence", h() ? "floe-bottom-drawer-panel" : C() ? "floe-side-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
173
179
  },
174
180
  style: {
175
181
  "max-height": "100%",
@@ -177,24 +183,24 @@ function Fe(e) {
177
183
  "min-width": "0"
178
184
  },
179
185
  get "data-floating-presence"() {
180
- return f.state();
186
+ return i.state();
181
187
  },
182
188
  get inert() {
183
- return p(() => !!h())() && f.exiting();
189
+ return x(() => !!h())() && i.exiting();
184
190
  },
185
191
  role: "dialog",
186
192
  get "aria-modal"() {
187
193
  return a() ? void 0 : "true";
188
194
  },
189
195
  get "aria-labelledby"() {
190
- return p(() => !!e.title)() ? B() : void 0;
196
+ return x(() => !!e.title)() ? F() : void 0;
191
197
  },
192
198
  get "aria-describedby"() {
193
- return p(() => !!e.bodyDescription)() ? H() : void 0;
199
+ return x(() => !!e.bodyDescription)() ? L() : void 0;
194
200
  },
195
201
  onKeyDown: (o) => e.onKeyDown?.(o),
196
202
  tabIndex: -1
197
- }), !1, !0), i(l, r(u, {
203
+ }), !1, !0), s(d, r(u, {
198
204
  get when() {
199
205
  return e.header === void 0;
200
206
  },
@@ -204,10 +210,10 @@ function Fe(e) {
204
210
  return e.title;
205
211
  },
206
212
  get children() {
207
- var o = Re();
208
- return i(o, () => e.title), P(() => c(o, "id", B())), o;
213
+ var o = De();
214
+ return s(o, () => e.title), P(() => c(o, "id", F())), o;
209
215
  }
210
- }), p(() => e.header)];
216
+ }), x(() => e.header)];
211
217
  },
212
218
  get children() {
213
219
  return r(u, {
@@ -215,16 +221,16 @@ function Fe(e) {
215
221
  return e.title;
216
222
  },
217
223
  get children() {
218
- var o = _e(), w = o.firstChild;
219
- return i(w, r(u, {
224
+ var o = ke(), w = o.firstChild;
225
+ return s(w, r(u, {
220
226
  get when() {
221
227
  return e.title;
222
228
  },
223
229
  get children() {
224
- var b = Ce();
225
- return i(b, () => e.title), P(() => c(b, "id", B())), b;
230
+ var p = _e();
231
+ return s(p, () => e.title), P(() => c(p, "id", F())), p;
226
232
  }
227
- })), i(o, r(j, {
233
+ })), s(o, r(H, {
228
234
  variant: "ghost-destructive",
229
235
  size: "icon",
230
236
  class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
@@ -241,25 +247,25 @@ function Fe(e) {
241
247
  }
242
248
  });
243
249
  }
244
- }), y), i(y, r(u, {
250
+ }), b), s(b, r(u, {
245
251
  get when() {
246
252
  return e.bodyDescription;
247
253
  },
248
254
  get children() {
249
- var o = ke();
250
- return i(o, () => e.bodyDescription), P(() => c(o, "id", H())), o;
255
+ var o = Se();
256
+ return s(o, () => e.bodyDescription), P(() => c(o, "id", L())), o;
251
257
  }
252
- }), null), i(y, () => e.children, null), i(l, r(u, {
258
+ }), null), s(b, () => e.children, null), s(d, r(u, {
253
259
  get when() {
254
260
  return e.footer;
255
261
  },
256
262
  get children() {
257
- var o = Se();
258
- return i(o, () => e.footer), o;
263
+ var o = Oe();
264
+ return s(o, () => e.footer), o;
259
265
  }
260
266
  }), null), P((o) => {
261
- var w = g("pointer-events-none relative z-[1] flex h-full w-full", $() ? e.drawerSide === "left" ? "items-stretch justify-start" : "items-stretch justify-end" : h() ? "items-end justify-center" : "items-center justify-center"), b = g("min-h-0 flex-1 overflow-auto overscroll-contain px-[var(--floe-pad-group)] py-[var(--floe-pad-group)]", e.contentClass);
262
- return w !== o.e && q(v, o.e = w), b !== o.t && q(y, o.t = b), o;
267
+ var w = g("pointer-events-none relative z-[1] flex h-full w-full", C() ? e.drawerSide === "left" ? "items-stretch justify-start" : "items-stretch justify-end" : h() ? "items-end justify-center" : "items-center justify-center"), p = g("min-h-0 flex-1 overflow-auto overscroll-contain px-[var(--floe-pad-group)] py-[var(--floe-pad-group)]", e.contentClass);
268
+ return w !== o.e && K(y, o.e = w), p !== o.t && K(b, o.t = p), o;
263
269
  }, {
264
270
  e: void 0,
265
271
  t: void 0
@@ -269,9 +275,9 @@ function Fe(e) {
269
275
  }
270
276
  })];
271
277
  }
272
- function We(e) {
273
- const x = fe();
274
- return r(Fe, {
278
+ function Xe(e) {
279
+ const $ = se();
280
+ return r(Ie, {
275
281
  get open() {
276
282
  return e.open;
277
283
  },
@@ -288,16 +294,16 @@ function We(e) {
288
294
  return e.globalZIndex;
289
295
  },
290
296
  get footer() {
291
- return [r(j, {
297
+ return [r(H, {
292
298
  variant: "ghost",
293
299
  onClick: () => e.onOpenChange(!1),
294
300
  get disabled() {
295
301
  return e.loading;
296
302
  },
297
303
  get children() {
298
- return e.cancelText ?? x.config.strings.confirmDialog.cancel;
304
+ return e.cancelText ?? $.config.strings.confirmDialog.cancel;
299
305
  }
300
- }), r(j, {
306
+ }), r(H, {
301
307
  get variant() {
302
308
  return e.variant === "destructive" ? "destructive" : "primary";
303
309
  },
@@ -308,7 +314,7 @@ function We(e) {
308
314
  return e.loading;
309
315
  },
310
316
  get children() {
311
- return e.confirmText ?? x.config.strings.confirmDialog.confirm;
317
+ return e.confirmText ?? $.config.strings.confirmDialog.confirm;
312
318
  }
313
319
  })];
314
320
  },
@@ -318,6 +324,6 @@ function We(e) {
318
324
  });
319
325
  }
320
326
  export {
321
- We as ConfirmDialog,
322
- Fe as Dialog
327
+ Xe as ConfirmDialog,
328
+ Ie as Dialog
323
329
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Animate the panel from its previous height to whatever its content now needs.
3
+ * Returns a disposer. A panel that is entering, exiting, suspended, or hidden
4
+ * is left alone: its own opening motion already owns the box, and animating a
5
+ * height nobody can see only queues late frames.
6
+ */
7
+ export declare function observeDialogHeight(element: HTMLElement, options?: {
8
+ isSettled?: () => boolean;
9
+ }): () => void;
@@ -0,0 +1,49 @@
1
+ function g() {
2
+ const e = globalThis.matchMedia;
3
+ return typeof e != "function" ? !1 : e.call(globalThis, "(prefers-reduced-motion: reduce)").matches;
4
+ }
5
+ function p(e, l = {}) {
6
+ const u = globalThis.ResizeObserver;
7
+ if (typeof u != "function") return () => {
8
+ };
9
+ const f = () => e.offsetHeight, d = () => typeof e.getAnimations == "function" && e.getAnimations().some((t) => t !== n && t.playState === "running");
10
+ let a = f(), n = null, c = !1, i = null;
11
+ const b = () => {
12
+ n = null, e.style.willChange = "", !c && i && i.observe(e, { box: "border-box" });
13
+ }, h = (t) => {
14
+ const r = a;
15
+ if (a = t, !Number.isFinite(r) || Math.abs(r - t) < 0.5 || g()) return;
16
+ i?.unobserve(e);
17
+ const o = e.animate(
18
+ [{ height: `${r}px` }, { height: `${t}px` }],
19
+ {
20
+ duration: 220,
21
+ easing: "cubic-bezier(0.22, 1, 0.36, 1)",
22
+ fill: "none"
23
+ }
24
+ );
25
+ n = o, e.style.willChange = "height", o.addEventListener("finish", () => {
26
+ if (c) return;
27
+ b();
28
+ const s = f();
29
+ Math.abs(s - a) >= 0.5 && h(s);
30
+ }), o.oncancel = () => {
31
+ c || b();
32
+ };
33
+ };
34
+ return i = new u((t) => {
35
+ const r = t[t.length - 1];
36
+ if (!r || n) return;
37
+ const o = Array.isArray(r.borderBoxSize) ? r.borderBoxSize[0] : r.borderBoxSize, s = o ? o.blockSize : r.contentRect.height;
38
+ if (l.isSettled && !l.isSettled() || d()) {
39
+ a = s;
40
+ return;
41
+ }
42
+ h(s);
43
+ }), i.observe(e, { box: "border-box" }), () => {
44
+ c = !0, i.disconnect(), n?.cancel(), n = null, e.style.willChange = "";
45
+ };
46
+ }
47
+ export {
48
+ p as observeDialogHeight
49
+ };
@@ -11,6 +11,7 @@ export { FloatingWindow, type FloatingWindowProps } from './FloatingWindow';
11
11
  export { SurfaceFloatingPanel, type SurfaceFloatingPanelProps, type SurfaceFloatingPanelHandleProps, } from './SurfaceFloatingPanel';
12
12
  export type { SurfaceFloatingPanelBoundaryInsets, SurfaceFloatingPanelPosition, } from './surfaceFloatingPanelGeometry';
13
13
  export { createFloatingPresence, type FloatingPresence, type FloatingPresenceOptions, type FloatingPresenceState, } from './floatingPresence';
14
+ export { observeDialogHeight } from './dialogHeightMotion';
14
15
  export { MENU_ITEM_SELECTOR, focusMenuItem, getMenuItems, handleMenuKeyboardNavigation, moveMenuFocus, type MenuDismissReason, type MenuFocusMode, type MenuItemNavigationOptions, type MenuKeyboardNavigationOptions, } from './menuUtils';
15
16
  export { resolveFloatingWindowViewport, type FloatingWindowRect, type FloatingWindowViewport, type FloatingWindowViewportInsets, } from './floatingWindowGeometry';
16
17
  export { Dropdown, Select, type DropdownProps, type DropdownItem, type SelectProps, } from './Dropdown';