@photon-ai/pho-ui 4.18.5 → 4.18.6

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,121 +1,122 @@
1
1
  "use client";
2
- import { t as h } from "./cn-CPbhpG1q.js";
3
- import { a as I } from "./button-CLfWdqm-.js";
2
+ import { t as u } from "./cn-CPbhpG1q.js";
3
+ import { a as V } from "./button-CLfWdqm-.js";
4
4
  import { t as P } from "./close-button-Ck4rY1Fp.js";
5
- import { t as _ } from "./animated-height-zr7BmFY1.js";
6
- import { t as p } from "./scroll-area-Dhl5hqay.js";
7
- import { createContext as F, useCallback as O, useContext as j, useEffect as T, useMemo as M, useRef as C, useState as R } from "react";
8
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
9
- import { Dialog as f } from "@base-ui/react/dialog";
5
+ import { t as E } from "./animated-height-zr7BmFY1.js";
6
+ import { t as f } from "./scroll-area-Dhl5hqay.js";
7
+ import { createContext as F, useCallback as L, useContext as j, useEffect as R, useMemo as M, useRef as C, useState as A } from "react";
8
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
9
+ import { Dialog as h } from "@base-ui/react/dialog";
10
10
  var w = F(null);
11
- function re() {
11
+ function le() {
12
12
  return j(w)?.pending ?? !1;
13
13
  }
14
- function $({ onOpenChange: t, actionsRef: n, ...s }) {
15
- const [r, a] = R(!1), i = C(!1), o = C(null);
16
- T(() => {
14
+ function W({ onOpenChange: t, actionsRef: n, ...o }) {
15
+ const [r, l] = A(!1), i = C(!1), a = C(null);
16
+ R(() => {
17
17
  if (n)
18
- return n.current = o.current, () => {
18
+ return n.current = a.current, () => {
19
19
  n.current = null;
20
20
  };
21
21
  }, [n]);
22
- const d = O((u, g) => {
23
- if (!u && i.current) {
22
+ const d = L((p, g) => {
23
+ if (!p && i.current) {
24
24
  g.cancel();
25
25
  return;
26
26
  }
27
- t?.(u, g);
27
+ t?.(p, g);
28
28
  }, [t]), c = M(() => ({
29
29
  pending: r,
30
30
  beginPending: () => {
31
- i.current = !0, a(!0);
31
+ i.current = !0, l(!0);
32
32
  },
33
33
  endPending: () => {
34
- i.current = !1, a(!1);
34
+ i.current = !1, l(!1);
35
35
  },
36
- close: () => o.current?.close()
36
+ close: () => a.current?.close()
37
37
  }), [r]);
38
38
  return /* @__PURE__ */ e(w.Provider, {
39
39
  value: c,
40
- children: /* @__PURE__ */ e(f.Root, {
41
- actionsRef: o,
40
+ children: /* @__PURE__ */ e(h.Root, {
41
+ actionsRef: a,
42
42
  onOpenChange: d,
43
- ...s
43
+ ...o
44
44
  })
45
45
  });
46
46
  }
47
- var G = f.Trigger, x = f.Portal, y = f.Close;
48
- function J(t) {
47
+ var $ = h.Trigger, x = h.Portal, y = h.Close;
48
+ function G(t) {
49
49
  return t != null && typeof t.then == "function";
50
50
  }
51
- function K({ onClick: t, loading: n, disabled: s, ...r }) {
52
- const a = j(w), [i, o] = R(!1), d = C(!0);
53
- T(() => (d.current = !0, () => {
51
+ function J({ onClick: t, loading: n, disabled: o, ...r }) {
52
+ const l = j(w), [i, a] = A(!1), d = C(!0);
53
+ R(() => (d.current = !0, () => {
54
54
  d.current = !1;
55
55
  }), []);
56
56
  function c(g) {
57
57
  if (i || n) return;
58
58
  const m = t?.(g);
59
- if (!J(m)) {
60
- a?.close();
59
+ if (!G(m)) {
60
+ l?.close();
61
61
  return;
62
62
  }
63
- o(!0), a?.beginPending(), m.then(() => {
64
- a?.endPending(), d.current && o(!1), a?.close();
63
+ a(!0), l?.beginPending(), m.then(() => {
64
+ l?.endPending(), d.current && a(!1), l?.close();
65
65
  }, (v) => {
66
- a?.endPending(), d.current && o(!1), typeof process < "u" && process.env.NODE_ENV !== "production" && console.error("Dialog.Action: async onClick rejected —", v);
66
+ l?.endPending(), d.current && a(!1), typeof process < "u" && process.env.NODE_ENV !== "production" && console.error("Dialog.Action: async onClick rejected —", v);
67
67
  });
68
68
  }
69
- const u = i || n;
70
- return /* @__PURE__ */ e(I, {
69
+ const p = i || n;
70
+ return /* @__PURE__ */ e(V, {
71
71
  ...r,
72
- disabled: s || u,
73
- loading: u,
72
+ disabled: o || p,
73
+ loading: p,
74
74
  onClick: c
75
75
  });
76
76
  }
77
77
  function z({ className: t, ...n }) {
78
- return /* @__PURE__ */ e(f.Backdrop, {
79
- className: h("bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
78
+ return /* @__PURE__ */ e(h.Backdrop, {
79
+ className: u("bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
80
80
  ...n
81
81
  });
82
82
  }
83
- function A({ className: t, ...n }) {
84
- return /* @__PURE__ */ e(f.Popup, {
85
- className: h("border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none", "flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
83
+ function S({ className: t, ...n }) {
84
+ return /* @__PURE__ */ e(h.Popup, {
85
+ className: u("border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none", "flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
86
86
  ...n
87
87
  });
88
88
  }
89
89
  function N({ className: t, ...n }) {
90
- return /* @__PURE__ */ e(f.Title, {
91
- className: h("text-pho-primary font-display text-display-sm font-medium text-balance", t),
90
+ return /* @__PURE__ */ e(h.Title, {
91
+ className: u("text-pho-primary font-display text-display-sm font-medium text-balance", t),
92
92
  ...n
93
93
  });
94
94
  }
95
95
  function b({ className: t, ...n }) {
96
- return /* @__PURE__ */ e(f.Description, {
97
- className: h("text-pho-description text-display-xs font-normal", t),
96
+ return /* @__PURE__ */ e(h.Description, {
97
+ className: u("text-pho-description text-display-xs font-normal", t),
98
98
  ...n
99
99
  });
100
100
  }
101
101
  function B({ children: t, size: n = "md" }) {
102
102
  return /* @__PURE__ */ e("span", {
103
103
  "aria-hidden": !0,
104
- className: h("text-pho-secondary mb-1", n === "lg" ? "[&>svg]:size-12" : "[&>svg]:size-8"),
104
+ className: u("text-pho-secondary mb-1", n === "lg" ? "[&>svg]:size-12" : "[&>svg]:size-8"),
105
105
  children: t
106
106
  });
107
107
  }
108
- function L({ icon: t, title: n, description: s, consequences: r, warning: a, actions: i, caption: o, showClose: d = !0, children: c, className: u, ...g }) {
109
- const m = i == null && d, v = !!(t || n || s || m), k = r != null && r.length > 0, D = k || a != null || c != null;
110
- return /* @__PURE__ */ l(x, { children: [/* @__PURE__ */ e(z, {}), /* @__PURE__ */ l(A, {
111
- className: u,
108
+ var k = "[&:has(>:nth-child(3))>:first-child]:me-auto";
109
+ function K({ icon: t, title: n, description: o, consequences: r, warning: l, actions: i, caption: a, showClose: d = !0, children: c, className: p, ...g }) {
110
+ const m = i == null && d, v = !!(t || n || o || m), T = r != null && r.length > 0, D = T || l != null || c != null;
111
+ return /* @__PURE__ */ s(x, { children: [/* @__PURE__ */ e(z, {}), /* @__PURE__ */ s(S, {
112
+ className: p,
112
113
  ...g,
113
114
  children: [
114
- v && /* @__PURE__ */ l("div", {
115
+ v && /* @__PURE__ */ s("div", {
115
116
  className: "flex shrink-0 flex-col gap-1 px-6 pt-6",
116
117
  children: [
117
118
  t && /* @__PURE__ */ e(B, { children: t }),
118
- (n || m) && /* @__PURE__ */ l("div", {
119
+ (n || m) && /* @__PURE__ */ s("div", {
119
120
  className: "relative",
120
121
  children: [n ? /* @__PURE__ */ e(N, {
121
122
  className: m ? "pr-12" : void 0,
@@ -125,57 +126,57 @@ function L({ icon: t, title: n, description: s, consequences: r, warning: a, act
125
126
  "aria-hidden": "true"
126
127
  }), m && /* @__PURE__ */ e(y, { render: /* @__PURE__ */ e(P, { className: "absolute top-1/2 right-0 z-10 -translate-y-1/2" }) })]
127
128
  }),
128
- s && /* @__PURE__ */ e(b, { children: s })
129
+ o && /* @__PURE__ */ e(b, { children: o })
129
130
  ]
130
131
  }),
131
- D && /* @__PURE__ */ l(p.Root, {
132
+ D && /* @__PURE__ */ s(f.Root, {
132
133
  className: "min-h-0 flex-1",
133
- children: [/* @__PURE__ */ e(p.Viewport, { children: /* @__PURE__ */ l(p.Content, {
134
+ children: [/* @__PURE__ */ e(f.Viewport, { children: /* @__PURE__ */ s(f.Content, {
134
135
  className: "flex flex-col gap-5 px-6 py-5",
135
136
  children: [
136
- k && /* @__PURE__ */ e("ul", {
137
+ T && /* @__PURE__ */ e("ul", {
137
138
  className: "text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium",
138
- children: r.map((V, E) => /* @__PURE__ */ e("li", {
139
+ children: r.map((_, O) => /* @__PURE__ */ e("li", {
139
140
  className: "relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current",
140
- children: V
141
- }, E))
141
+ children: _
142
+ }, O))
142
143
  }),
143
- a != null && /* @__PURE__ */ e("p", {
144
+ l != null && /* @__PURE__ */ e("p", {
144
145
  className: "text-pho-error text-display-xs font-medium",
145
- children: a
146
+ children: l
146
147
  }),
147
148
  c
148
149
  ]
149
- }) }), /* @__PURE__ */ e(p.Scrollbar, { children: /* @__PURE__ */ e(p.Thumb, {}) })]
150
+ }) }), /* @__PURE__ */ e(f.Scrollbar, { children: /* @__PURE__ */ e(f.Thumb, {}) })]
150
151
  }),
151
- (i != null || o != null) && /* @__PURE__ */ l("div", {
152
- className: h("flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5", !D && "pt-5"),
153
- children: [o != null && /* @__PURE__ */ e("p", {
152
+ (i != null || a != null) && /* @__PURE__ */ s("div", {
153
+ className: u("flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5", a == null && k, !D && "pt-5"),
154
+ children: [a != null && /* @__PURE__ */ e("p", {
154
155
  "data-dialog-caption": "",
155
156
  className: "text-pho-description min-w-48 flex-1 pr-2 text-xs",
156
- children: o
157
+ children: a
157
158
  }), i]
158
159
  })
159
160
  ]
160
161
  })] });
161
162
  }
162
163
  function H({ className: t, ...n }) {
163
- return /* @__PURE__ */ e(f.Popup, {
164
- className: h("border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0", "data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
164
+ return /* @__PURE__ */ e(h.Popup, {
165
+ className: u("border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0", "data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
165
166
  ...n
166
167
  });
167
168
  }
168
- function Q({ icon: t, title: n, description: s, actions: r, showClose: a = !0, children: i, className: o, ...d }) {
169
- const c = r == null && a;
170
- return /* @__PURE__ */ l(x, { children: [/* @__PURE__ */ e(z, {}), /* @__PURE__ */ l(H, {
171
- className: o,
169
+ function Q({ icon: t, title: n, description: o, actions: r, showClose: l = !0, children: i, className: a, ...d }) {
170
+ const c = r == null && l;
171
+ return /* @__PURE__ */ s(x, { children: [/* @__PURE__ */ e(z, {}), /* @__PURE__ */ s(H, {
172
+ className: a,
172
173
  ...d,
173
174
  children: [
174
- !!(t || n || s || c) && /* @__PURE__ */ l("div", {
175
+ !!(t || n || o || c) && /* @__PURE__ */ s("div", {
175
176
  className: "flex shrink-0 flex-col gap-1 px-6 pt-6",
176
177
  children: [
177
178
  t && /* @__PURE__ */ e(B, { children: t }),
178
- (n || c) && /* @__PURE__ */ l("div", {
179
+ (n || c) && /* @__PURE__ */ s("div", {
179
180
  className: "relative",
180
181
  children: [n ? /* @__PURE__ */ e(N, {
181
182
  className: c ? "pr-12" : void 0,
@@ -185,41 +186,41 @@ function Q({ icon: t, title: n, description: s, actions: r, showClose: a = !0, c
185
186
  "aria-hidden": "true"
186
187
  }), c && /* @__PURE__ */ e(y, { render: /* @__PURE__ */ e(P, { className: "absolute top-1/2 right-0 z-10 -translate-y-1/2" }) })]
187
188
  }),
188
- s && /* @__PURE__ */ e(b, { children: s })
189
+ o && /* @__PURE__ */ e(b, { children: o })
189
190
  ]
190
191
  }),
191
- /* @__PURE__ */ l(p.Root, {
192
+ /* @__PURE__ */ s(f.Root, {
192
193
  className: "min-h-0 flex-1",
193
- children: [/* @__PURE__ */ e(p.Viewport, { children: /* @__PURE__ */ e(p.Content, {
194
+ children: [/* @__PURE__ */ e(f.Viewport, { children: /* @__PURE__ */ e(f.Content, {
194
195
  className: "px-6 py-5",
195
196
  children: i
196
- }) }), /* @__PURE__ */ e(p.Scrollbar, { children: /* @__PURE__ */ e(p.Thumb, {}) })]
197
+ }) }), /* @__PURE__ */ e(f.Scrollbar, { children: /* @__PURE__ */ e(f.Thumb, {}) })]
197
198
  }),
198
199
  r != null && /* @__PURE__ */ e("div", {
199
- className: "flex shrink-0 items-center justify-end gap-2 px-6 pb-5",
200
+ className: u("flex shrink-0 items-center justify-end gap-2 px-6 pb-5", k),
200
201
  children: r
201
202
  })
202
203
  ]
203
204
  })] });
204
205
  }
205
- function S({ className: t, ...n }) {
206
- return /* @__PURE__ */ e(f.Popup, {
207
- className: h("bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none", "transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
206
+ function I({ className: t, ...n }) {
207
+ return /* @__PURE__ */ e(h.Popup, {
208
+ className: u("bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none", "transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
208
209
  ...n
209
210
  });
210
211
  }
211
- function U({ icon: t, title: n, description: s, actions: r, showClose: a = !0, frameClassName: i, children: o, className: d, ...c }) {
212
- const u = r == null && a;
213
- return /* @__PURE__ */ e(x, { children: /* @__PURE__ */ l(S, {
212
+ function U({ icon: t, title: n, description: o, actions: r, showClose: l = !0, frameClassName: i, children: a, className: d, ...c }) {
213
+ const p = r == null && l;
214
+ return /* @__PURE__ */ e(x, { children: /* @__PURE__ */ s(I, {
214
215
  className: d,
215
216
  ...c,
216
- children: [u && /* @__PURE__ */ e(y, { render: /* @__PURE__ */ e(P, { className: "fixed top-4 right-4 z-10" }) }), /* @__PURE__ */ e("div", {
217
- className: h("flex min-h-full items-center justify-center px-6 pt-6 pb-20", i),
218
- children: /* @__PURE__ */ l("div", {
217
+ children: [p && /* @__PURE__ */ e(y, { render: /* @__PURE__ */ e(P, { className: "fixed top-4 right-4 z-10" }) }), /* @__PURE__ */ e("div", {
218
+ className: u("flex min-h-full items-center justify-center px-6 pt-6 pb-20", i),
219
+ children: /* @__PURE__ */ s("div", {
219
220
  className: "w-full max-w-md",
220
- children: [/* @__PURE__ */ l(_, {
221
+ children: [/* @__PURE__ */ s(E, {
221
222
  className: "flex flex-col gap-5",
222
- children: [(t || n || s) && /* @__PURE__ */ l("div", {
223
+ children: [(t || n || o) && /* @__PURE__ */ s("div", {
223
224
  className: "flex flex-col gap-1",
224
225
  children: [
225
226
  t && /* @__PURE__ */ e(B, {
@@ -227,11 +228,11 @@ function U({ icon: t, title: n, description: s, actions: r, showClose: a = !0, f
227
228
  children: t
228
229
  }),
229
230
  n && /* @__PURE__ */ e(N, { children: n }),
230
- s && /* @__PURE__ */ e(b, { children: s })
231
+ o && /* @__PURE__ */ e(b, { children: o })
231
232
  ]
232
- }), o]
233
+ }), a]
233
234
  }), r != null && /* @__PURE__ */ e("div", {
234
- className: "mt-5 flex items-center justify-end gap-2",
235
+ className: u("mt-5 flex items-center justify-end gap-2", k),
235
236
  children: r
236
237
  })]
237
238
  })
@@ -239,24 +240,24 @@ function U({ icon: t, title: n, description: s, actions: r, showClose: a = !0, f
239
240
  }) });
240
241
  }
241
242
  var ae = {
242
- Root: $,
243
- Trigger: G,
243
+ Root: W,
244
+ Trigger: $,
244
245
  Portal: x,
245
246
  Backdrop: z,
246
- Popup: A,
247
+ Popup: S,
247
248
  InsetPopup: H,
248
- FullscreenPopup: S,
249
+ FullscreenPopup: I,
249
250
  Title: N,
250
251
  Description: b,
251
252
  Close: y,
252
- Action: K,
253
- Content: L,
253
+ Action: J,
254
+ Content: K,
254
255
  InsetContent: Q,
255
256
  FullscreenContent: U
256
257
  };
257
258
  export {
258
- re as n,
259
+ le as n,
259
260
  ae as t
260
261
  };
261
262
 
262
- //# sourceMappingURL=dialog-CCfeyQBG.js.map
263
+ //# sourceMappingURL=dialog-DORIrfyJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog-DORIrfyJ.js","names":["BaseDialog","Dialog","cn","Button","CloseButton","AnimatedHeight","ScrollArea","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","jsx","jsxs","Dialog","DialogPendingContext","useDialogPending","Root","onOpenChange","actionsRef","props","pending","setPending","pendingRef","internalActionsRef","handleOpenChange","open","eventDetails","contextValue","Trigger","Portal","Close","isThenable","value","Action","onClick","loading","disabled","pendingContext","busy","setBusy","mountedRef","handleClick","event","result","error","inert","Backdrop","className","Popup","Title","Description","DialogHeaderIcon","children","size","ACTION_ROW_SPLIT","Content","icon","title","description","consequences","warning","actions","caption","showClose","showCloseButton","hasHeader","hasConsequences","hasScrollBody","item","index","InsetPopup","InsetContent","FullscreenPopup","FullscreenContent","frameClassName","Dialog$1"],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { CloseButton } from \"../button/close-button\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/* ========================== Async pending context ========================== */\n\n/** Imperative actions exposed by Base UI's `actionsRef`. */\ninterface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface DialogPendingContextValue {\n /** True while a `Dialog.Action` promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the dialog imperatively (used by `Dialog.Action` on resolve). */\n close: () => void;\n}\n\nconst DialogPendingContext = createContext<DialogPendingContextValue | null>(\n null,\n);\n\n/**\n * Whether the surrounding dialog has a `Dialog.Action` promise in flight —\n * use it to disable secondary actions (Cancel etc.) while work is pending.\n * Returns `false` outside a `Dialog.Root`.\n */\nexport function useDialogPending(): boolean {\n return useContext(DialogPendingContext)?.pending ?? false;\n}\n\ntype RootProps = ComponentProps<typeof BaseDialog.Root>;\n\n/**\n * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is\n * pending, every close request (outside press, Escape, `Dialog.Close`) is\n * cancelled so the dialog stays open until the work settles. Props pass\n * through to Base UI's `Dialog.Root` unchanged.\n */\nfunction Root({ onOpenChange, actionsRef, ...props }: RootProps) {\n const [pending, setPending] = useState(false);\n // Guard reads a ref so a resolve → close() in the same tick isn't blocked\n // by a not-yet-flushed state update.\n const pendingRef = useRef(false);\n const internalActionsRef = useRef<RootActions | null>(null);\n\n // Keep a caller-supplied actionsRef working alongside our internal one.\n useEffect(() => {\n if (!actionsRef) return;\n actionsRef.current = internalActionsRef.current;\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback<NonNullable<RootProps[\"onOpenChange\"]>>(\n (open, eventDetails) => {\n if (!open && pendingRef.current) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<DialogPendingContextValue>(\n () => ({\n pending,\n beginPending: () => {\n pendingRef.current = true;\n setPending(true);\n },\n endPending: () => {\n pendingRef.current = false;\n setPending(false);\n },\n close: () => internalActionsRef.current?.close(),\n }),\n [pending],\n );\n\n return (\n <DialogPendingContext.Provider value={contextValue}>\n <BaseDialog.Root\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </DialogPendingContext.Provider>\n );\n}\n\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\n/* ============================== Dialog.Action ============================== */\n\nexport interface DialogActionProps extends Omit<ButtonProps, \"onClick\"> {\n /**\n * Confirm handler. Return a promise to keep the dialog open while it runs:\n * the button shows `loading`, all dismissal is locked, and the dialog\n * closes when the promise resolves. On rejection the dialog stays open —\n * surface errors inside the handler. A non-promise return closes\n * immediately, like `Dialog.Close`.\n */\n onClick?: (\n event: ReactMouseEvent<HTMLButtonElement>,\n ) => void | Promise<unknown>;\n}\n\nfunction isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\n/**\n * The confirm button of an action row, with native promise support — a\n * `Button` that runs its (possibly async) `onClick` and closes the dialog\n * when the work settles successfully.\n */\nfunction Action({ onClick, loading, disabled, ...props }: DialogActionProps) {\n const pendingContext = useContext(DialogPendingContext);\n const [busy, setBusy] = useState(false);\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>) {\n if (busy || loading) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n pendingContext?.close();\n return;\n }\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n pendingContext?.close();\n },\n (error: unknown) => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.error(\"Dialog.Action: async onClick rejected —\", error);\n }\n },\n );\n }\n\n const inert = busy || loading;\n return (\n <Button\n {...props}\n disabled={disabled || inert}\n loading={inert}\n onClick={handleClick}\n />\n );\n}\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none\",\n // Global height cap — the inset panel's footprint (inset-4 /\n // sm:inset-8). A flex column so the body region can shrink and\n // scroll while header and actions stay pinned.\n \"flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]\",\n // Opacity + scale only — leave translate centering alone (no transition-all).\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Header icon chrome: secondary ink, a hair of extra air before the title.\n * Panel dialogs use 32px (`size-8`); fullscreen gates step up to 48px\n * (`size-12`) so the glyph reads at viewport scale.\n */\nfunction DialogHeaderIcon({\n children,\n size = \"md\",\n}: {\n children: ReactNode;\n size?: \"md\" | \"lg\";\n}) {\n return (\n <span\n aria-hidden\n className={cn(\n \"text-pho-secondary mb-1\",\n size === \"lg\" ? \"[&>svg]:size-12\" : \"[&>svg]:size-8\",\n )}\n >\n {children}\n </span>\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — typically a Tabler outline icon.\n * Rendered aria-hidden in secondary ink at 32px (`[&>svg]:size-8`). Pass a\n * styled node to override the ink; the size is owned by the slot.\n */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Consequence bullets rendered as a list at the top of the body — one item\n * per outcome (what is deleted, what survives, who loses access). Use on\n * destructive confirms where the one-line description undersells the\n * impact; keep each item to a single short sentence. Wrap the load-bearing\n * figure in `<strong>` (\"<strong>3 members</strong> lose access\") — the\n * list styles it (secondary ink, medium weight); no classes needed.\n */\n consequences?: ReactNode[];\n /**\n * Final cautionary line under `consequences` — error ink at description\n * size (e.g. \"It cannot be undone. Please be certain.\"). Reserve it for\n * irreversible actions; keep it short.\n */\n warning?: ReactNode;\n /**\n * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is\n * set, the header close button is never shown — dismiss via the actions.\n * Three actions split: the first (tertiary) at the row's start, the\n * secondary and the primary at its end.\n */\n actions?: ReactNode;\n /**\n * A quiet footnote at the panel's foot — the limit, cost or policy that\n * frames the decision without being it (\"You may change these up to five\n * times a week.\"). Description ink at `text-xs`, at the action row's\n * start with the actions at its end; when the row runs short of room it\n * takes a line of its own above them. One short sentence.\n */\n caption?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * The action row's split. One or two actions sit together at the row's end.\n * With three, the first (the tertiary, \"Not now\") sits alone at the row's\n * start and the other two stay at its end: pass them tertiary, secondary,\n * primary. A `caption` already holds the start, so beside one nothing moves.\n */\nconst ACTION_ROW_SPLIT = \"[&:has(>:nth-child(3))>:first-child]:me-auto\";\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close) and optional action row. For\n * full control, compose the parts directly (`Dialog.Portal` /\n * `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n icon,\n title,\n description,\n consequences,\n warning,\n actions,\n caption,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n const hasConsequences = consequences != null && consequences.length > 0;\n // The scrollable middle region — actions stay pinned below it.\n const hasScrollBody = hasConsequences || warning != null || children != null;\n\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n // Title row height = title only. Close is out of flow, centered\n // on the row, and may paint outside it (no clip, no stretch).\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {hasScrollBody && (\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"flex flex-col gap-5 px-6 py-5\">\n {hasConsequences && (\n <ul className=\"text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium\">\n {consequences.map((item, index) => (\n // Hand-drawn marker: a 4px dot on the first line's center —\n // quieter than the browser disc, ink tracks the text.\n <li\n key={index}\n className=\"relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current\"\n >\n {item}\n </li>\n ))}\n </ul>\n )}\n {warning != null && (\n <p className=\"text-pho-error text-display-xs font-medium\">\n {warning}\n </p>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n )}\n {(actions != null || caption != null) && (\n <div\n className={cn(\n \"flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5\",\n // A caption is the row's first child and already fills it.\n caption == null && ACTION_ROW_SPLIT,\n !hasScrollBody && \"pt-5\",\n )}\n >\n {caption != null && (\n // Grows into the row's free width, never under 12rem: below\n // that it wraps to a line of its own above the actions.\n <p\n data-dialog-caption=\"\"\n className=\"text-pho-description min-w-48 flex-1 pr-2 text-xs\"\n >\n {caption}\n </p>\n )}\n {actions}\n </div>\n )}\n </Popup>\n </Portal>\n );\n}\n\n/* =========================== Dialog.InsetContent =========================== */\n\n/**\n * Near-fullscreen popup — the viewport minus a breathing ring, floating over\n * a backdrop (the page stays visible through the gap, so it dims like any\n * floating layer). Still a card: border, elevation, rounded corners; the\n * scale gesture stays but shrinks to 98% — at this size 95% reads like a jump.\n */\nfunction InsetPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8\",\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface InsetContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Decorative icon above the title — same treatment as `Content`. */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Bottom action row. Iron rule as `Content`: when `actions` is set, the\n * header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience near-fullscreen panel: header pinned on top, body filling and\n * scrolling on its own, optional action row pinned at the bottom. Sits\n * between `Content` (a focused card) and `FullscreenContent` (a page\n * takeover): use it for roomy working surfaces — pickers, editors, previews —\n * that still want the page peeking through an edge.\n */\nfunction InsetContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: InsetContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n\n return (\n <Portal>\n <Backdrop />\n <InsetPopup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"px-6 py-5\">\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n {actions != null && (\n <div\n className={cn(\n \"flex shrink-0 items-center justify-end gap-2 px-6 pb-5\",\n ACTION_ROW_SPLIT,\n )}\n >\n {actions}\n </div>\n )}\n </InsetPopup>\n </Portal>\n );\n}\n\n/* ========================= Dialog.FullscreenContent ======================== */\n\n/**\n * Full-viewport popup — a page-surface takeover instead of a floating card.\n * No backdrop: the popup itself is the layer. Fade only; scale is a floating-\n * card gesture and reads wrong at viewport size.\n */\nfunction FullscreenPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none\",\n \"transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface FullscreenContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — same chrome as `Content`, but 48px\n * (`size-12`) for viewport-scale gates.\n */\n icon?: ReactNode;\n /** Heading of the takeover. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Action row under the body. Iron rule as `Content`: when `actions` is set,\n * the corner close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Corner close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n /**\n * Classes on the viewport-centering frame (the `min-h-full` flex host).\n * Use to drop the default optical `pb-20` when the stack grows (e.g. a\n * captcha) so true center stays put: `frameClassName=\"pb-6\"`.\n */\n frameClassName?: string;\n children?: ReactNode;\n}\n\n/**\n * Convenience full-screen panel: the whole viewport becomes the dialog, with\n * a centered column at the standalone-flow width (28rem — the same measure as\n * onboarding / invite cards). Column height follows its content through\n * `AnimatedHeight` (same spring as the Card shell), so step swaps — phone →\n * OTP → captcha — glide instead of jumping. Use for gates the visitor must\n * deal with before the page behind makes sense (e.g. binding a phone number);\n * prefer `Content` for everything conversational.\n */\nfunction FullscreenContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n frameClassName,\n children,\n className,\n ...props\n}: FullscreenContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a corner X.\n const showCloseButton = actions == null && showClose;\n\n return (\n <Portal>\n <FullscreenPopup className={className} {...props}>\n {showCloseButton && (\n <Close\n render={<CloseButton className=\"fixed top-4 right-4 z-10\" />}\n />\n )}\n {/* Default `pb-20` optically lifts the column above true center. */}\n <div\n className={cn(\n \"flex min-h-full items-center justify-center px-6 pt-6 pb-20\",\n frameClassName,\n )}\n >\n {/* Width stays on the outer host; AnimatedHeight measures the\n header + body stack and springs its own height on content\n changes. The action row sits below it, outside the clip: while\n the body grows the container is shorter than its content for a\n few frames, and a row inside it would be cut off at the bottom\n (a pressed \"Send code\" turning grey right as a captcha mounts).\n Outside, the row rides the spring instead. */}\n <div className=\"w-full max-w-md\">\n <AnimatedHeight className=\"flex flex-col gap-5\">\n {(icon || title || description) && (\n <div className=\"flex flex-col gap-1\">\n {icon && (\n <DialogHeaderIcon size=\"lg\">{icon}</DialogHeaderIcon>\n )}\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {children}\n </AnimatedHeight>\n {actions != null && (\n <div\n className={cn(\n \"mt-5 flex items-center justify-end gap-2\",\n ACTION_ROW_SPLIT,\n )}\n >\n {actions}\n </div>\n )}\n </div>\n </div>\n </FullscreenPopup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`\n * adds native promise support: an async confirm keeps the dialog open and\n * undismissable until the work resolves.\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n InsetPopup,\n FullscreenPopup,\n Title,\n Description,\n Close,\n Action,\n Content,\n InsetContent,\n FullscreenContent,\n};\n"],"mappings":";;;;;;;;;AA6CA,IAAMiB,IAAuBV,EAC3B,IACF;AAOA,SAAgBW,KAA4B;AAC1C,SAAOT,EAAWQ,CAAoB,GAAG,WAAW;AACtD;AAUA,SAASE,EAAK,EAAE,cAAAC,GAAc,YAAAC,GAAY,GAAGC,EAAA,GAAoB;AAC/D,QAAM,CAACC,GAASC,CAAA,IAAcX,EAAS,EAAK,GAGtCY,IAAab,EAAO,EAAK,GACzBc,IAAqBd,EAA2B,IAAI;AAG1D,EAAAF,EAAA,MAAgB;AACd,QAAKW;AACL,aAAAA,EAAW,UAAUK,EAAmB,SACxC,MAAa;AACX,QAAAL,EAAW,UAAU;AAAA,MACvB;AAAA,EACF,GAAG,CAACA,CAAU,CAAC;AAEf,QAAMM,IAAmBnB,EAAA,CACtBoB,GAAMC,MAAiB;AACtB,QAAI,CAACD,KAAQH,EAAW,SAAS;AAC/B,MAAAI,EAAa,OAAO;AACpB;AAAA,IACF;AACA,IAAAT,IAAeQ,GAAMC,CAAY;AAAA,EACnC,GACA,CAACT,CAAY,CACf,GAEMU,IAAenB,EAAA,OACZ;AAAA,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AAM,UAAAK;AAAA,cAAuB,CAAA;AAAA,cAErDC,KAAS,gBAAA9C,EAACsC,GAAD,EAAA,UAAQQ,EAAa,CAAA;AAAA,cAC9BC,KAAe,gBAAA/C,EAACuC,GAAD,EAAA,UAAcQ,EAAyB,CAAA;AAAA,YACpD;AAAA,UAEN,CAAA,GAAAN,CACa;AAAA,QACf,CAAA,GAAAS,KAAW,QACV,gBAAAlD,EAAC,OAAD;AAAA,UACE,WAAWZ,EACT,4CACAuD,CACF;AAAA,UAEC,UAAAO;AAAA,QACE,CAAA,CAEJ;AAAA,M;A,IACF,CAAA,CACU;AAAA,EACX,CAAA,EAAA,CAAA;AAEZ;AAQA,IAAa/D,KAAS;AAAA,EACpB,MAAAkB;AAAA,EACA,SAAAY;AAAA,EACA,QAAAC;AAAA,EACA,UAAAiB;AAAA,EACA,OAAAE;AAAA,EACA,YAAAsB;AAAA,EACA,iBAAAE;AAAA,EACA,OAAAvB;AAAA,EACA,aAAAC;AAAA,EACA,OAAApB;AAAA,EACA,QAAAG;AAAA,EACA,SAAAsB;AAAA,EACA,cAAAgB;AAAA,EACA,mBAAAE;AACF"}
@@ -5,7 +5,7 @@ import { SPRING_SETTLE as P } from "../motion.js";
5
5
  import { t as j } from "../chunks/IconArrowUpRight-OK8Fp0KQ.js";
6
6
  import { t as V } from "../chunks/IconChevronLeft-CptqhdxO.js";
7
7
  import { t as Z } from "../chunks/animated-height-zr7BmFY1.js";
8
- import { t as u } from "../chunks/dialog-CCfeyQBG.js";
8
+ import { t as u } from "../chunks/dialog-DORIrfyJ.js";
9
9
  import { useEffect as $, useId as z, useLayoutEffect as A, useRef as F } from "react";
10
10
  import { Fragment as E, jsx as t, jsxs as d } from "react/jsx-runtime";
11
11
  import { LayoutGroup as H, motion as g, useReducedMotion as B } from "motion/react";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { n as i, t as o } from "../chunks/dialog-CCfeyQBG.js";
2
+ import { n as i, t as o } from "../chunks/dialog-DORIrfyJ.js";
3
3
  export {
4
4
  o as Dialog,
5
5
  i as useDialogPending
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import { t as ks } from "./chunks/calendar-DDWITGo4.js";
23
23
  import { t as Ws } from "./chunks/close-button-Ck4rY1Fp.js";
24
24
  import { t as Hs } from "./chunks/input-group-C3upo2OU.js";
25
25
  import { n as xs, t as zs } from "./chunks/card-zyRAihYE.js";
26
- import { n as Ys, t as Zs } from "./chunks/dialog-CCfeyQBG.js";
26
+ import { n as Ys, t as Zs } from "./chunks/dialog-DORIrfyJ.js";
27
27
  import { i as Js, n as Qs, r as qs, t as $s } from "./chunks/status-view-I_Y6eEyX.js";
28
28
  import { t as st } from "./chunks/description-list-Duhhralt.js";
29
29
  import { a as rt, c as ot, d as et, f as it, i as St, l as Et, m as _t, n as nt, o as mt, p as At, r as It, s as Tt, t as pt, u as Rt } from "./chunks/basic-page-BKvtEQkZ.js";
@@ -68,6 +68,8 @@ interface ContentProps extends Omit<StyledProps<typeof BaseDialog.Popup>, "title
68
68
  /**
69
69
  * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is
70
70
  * set, the header close button is never shown — dismiss via the actions.
71
+ * Three actions split: the first (tertiary) at the row's start, the
72
+ * secondary and the primary at its end.
71
73
  */
72
74
  actions?: ReactNode;
73
75
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photon-ai/pho-ui",
3
- "version": "4.18.5",
3
+ "version": "4.18.6",
4
4
  "description": "Photon Design System — Photon's React component library, built on Base UI",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-CCfeyQBG.js","names":["BaseDialog","Dialog","cn","Button","CloseButton","AnimatedHeight","ScrollArea","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","jsx","jsxs","Dialog","DialogPendingContext","useDialogPending","Root","onOpenChange","actionsRef","props","pending","setPending","pendingRef","internalActionsRef","handleOpenChange","open","eventDetails","contextValue","Trigger","Portal","Close","isThenable","value","Action","onClick","loading","disabled","pendingContext","busy","setBusy","mountedRef","handleClick","event","result","error","inert","Backdrop","className","Popup","Title","Description","DialogHeaderIcon","children","size","Content","icon","title","description","consequences","warning","actions","caption","showClose","showCloseButton","hasHeader","hasConsequences","hasScrollBody","item","index","InsetPopup","InsetContent","FullscreenPopup","FullscreenContent","frameClassName","Dialog$1"],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { CloseButton } from \"../button/close-button\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/* ========================== Async pending context ========================== */\n\n/** Imperative actions exposed by Base UI's `actionsRef`. */\ninterface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface DialogPendingContextValue {\n /** True while a `Dialog.Action` promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the dialog imperatively (used by `Dialog.Action` on resolve). */\n close: () => void;\n}\n\nconst DialogPendingContext = createContext<DialogPendingContextValue | null>(\n null,\n);\n\n/**\n * Whether the surrounding dialog has a `Dialog.Action` promise in flight —\n * use it to disable secondary actions (Cancel etc.) while work is pending.\n * Returns `false` outside a `Dialog.Root`.\n */\nexport function useDialogPending(): boolean {\n return useContext(DialogPendingContext)?.pending ?? false;\n}\n\ntype RootProps = ComponentProps<typeof BaseDialog.Root>;\n\n/**\n * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is\n * pending, every close request (outside press, Escape, `Dialog.Close`) is\n * cancelled so the dialog stays open until the work settles. Props pass\n * through to Base UI's `Dialog.Root` unchanged.\n */\nfunction Root({ onOpenChange, actionsRef, ...props }: RootProps) {\n const [pending, setPending] = useState(false);\n // Guard reads a ref so a resolve → close() in the same tick isn't blocked\n // by a not-yet-flushed state update.\n const pendingRef = useRef(false);\n const internalActionsRef = useRef<RootActions | null>(null);\n\n // Keep a caller-supplied actionsRef working alongside our internal one.\n useEffect(() => {\n if (!actionsRef) return;\n actionsRef.current = internalActionsRef.current;\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback<NonNullable<RootProps[\"onOpenChange\"]>>(\n (open, eventDetails) => {\n if (!open && pendingRef.current) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<DialogPendingContextValue>(\n () => ({\n pending,\n beginPending: () => {\n pendingRef.current = true;\n setPending(true);\n },\n endPending: () => {\n pendingRef.current = false;\n setPending(false);\n },\n close: () => internalActionsRef.current?.close(),\n }),\n [pending],\n );\n\n return (\n <DialogPendingContext.Provider value={contextValue}>\n <BaseDialog.Root\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </DialogPendingContext.Provider>\n );\n}\n\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\n/* ============================== Dialog.Action ============================== */\n\nexport interface DialogActionProps extends Omit<ButtonProps, \"onClick\"> {\n /**\n * Confirm handler. Return a promise to keep the dialog open while it runs:\n * the button shows `loading`, all dismissal is locked, and the dialog\n * closes when the promise resolves. On rejection the dialog stays open —\n * surface errors inside the handler. A non-promise return closes\n * immediately, like `Dialog.Close`.\n */\n onClick?: (\n event: ReactMouseEvent<HTMLButtonElement>,\n ) => void | Promise<unknown>;\n}\n\nfunction isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\n/**\n * The confirm button of an action row, with native promise support — a\n * `Button` that runs its (possibly async) `onClick` and closes the dialog\n * when the work settles successfully.\n */\nfunction Action({ onClick, loading, disabled, ...props }: DialogActionProps) {\n const pendingContext = useContext(DialogPendingContext);\n const [busy, setBusy] = useState(false);\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>) {\n if (busy || loading) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n pendingContext?.close();\n return;\n }\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n pendingContext?.close();\n },\n (error: unknown) => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.error(\"Dialog.Action: async onClick rejected —\", error);\n }\n },\n );\n }\n\n const inert = busy || loading;\n return (\n <Button\n {...props}\n disabled={disabled || inert}\n loading={inert}\n onClick={handleClick}\n />\n );\n}\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none\",\n // Global height cap — the inset panel's footprint (inset-4 /\n // sm:inset-8). A flex column so the body region can shrink and\n // scroll while header and actions stay pinned.\n \"flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]\",\n // Opacity + scale only — leave translate centering alone (no transition-all).\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Header icon chrome: secondary ink, a hair of extra air before the title.\n * Panel dialogs use 32px (`size-8`); fullscreen gates step up to 48px\n * (`size-12`) so the glyph reads at viewport scale.\n */\nfunction DialogHeaderIcon({\n children,\n size = \"md\",\n}: {\n children: ReactNode;\n size?: \"md\" | \"lg\";\n}) {\n return (\n <span\n aria-hidden\n className={cn(\n \"text-pho-secondary mb-1\",\n size === \"lg\" ? \"[&>svg]:size-12\" : \"[&>svg]:size-8\",\n )}\n >\n {children}\n </span>\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — typically a Tabler outline icon.\n * Rendered aria-hidden in secondary ink at 32px (`[&>svg]:size-8`). Pass a\n * styled node to override the ink; the size is owned by the slot.\n */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Consequence bullets rendered as a list at the top of the body — one item\n * per outcome (what is deleted, what survives, who loses access). Use on\n * destructive confirms where the one-line description undersells the\n * impact; keep each item to a single short sentence. Wrap the load-bearing\n * figure in `<strong>` (\"<strong>3 members</strong> lose access\") — the\n * list styles it (secondary ink, medium weight); no classes needed.\n */\n consequences?: ReactNode[];\n /**\n * Final cautionary line under `consequences` — error ink at description\n * size (e.g. \"It cannot be undone. Please be certain.\"). Reserve it for\n * irreversible actions; keep it short.\n */\n warning?: ReactNode;\n /**\n * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is\n * set, the header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * A quiet footnote at the panel's foot — the limit, cost or policy that\n * frames the decision without being it (\"You may change these up to five\n * times a week.\"). Description ink at `text-xs`, at the action row's\n * start with the actions at its end; when the row runs short of room it\n * takes a line of its own above them. One short sentence.\n */\n caption?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close) and optional action row. For\n * full control, compose the parts directly (`Dialog.Portal` /\n * `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n icon,\n title,\n description,\n consequences,\n warning,\n actions,\n caption,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n const hasConsequences = consequences != null && consequences.length > 0;\n // The scrollable middle region — actions stay pinned below it.\n const hasScrollBody = hasConsequences || warning != null || children != null;\n\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n // Title row height = title only. Close is out of flow, centered\n // on the row, and may paint outside it (no clip, no stretch).\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {hasScrollBody && (\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"flex flex-col gap-5 px-6 py-5\">\n {hasConsequences && (\n <ul className=\"text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium\">\n {consequences.map((item, index) => (\n // Hand-drawn marker: a 4px dot on the first line's center —\n // quieter than the browser disc, ink tracks the text.\n <li\n key={index}\n className=\"relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current\"\n >\n {item}\n </li>\n ))}\n </ul>\n )}\n {warning != null && (\n <p className=\"text-pho-error text-display-xs font-medium\">\n {warning}\n </p>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n )}\n {(actions != null || caption != null) && (\n <div\n className={cn(\n \"flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5\",\n !hasScrollBody && \"pt-5\",\n )}\n >\n {caption != null && (\n // Grows into the row's free width, never under 12rem: below\n // that it wraps to a line of its own above the actions.\n <p\n data-dialog-caption=\"\"\n className=\"text-pho-description min-w-48 flex-1 pr-2 text-xs\"\n >\n {caption}\n </p>\n )}\n {actions}\n </div>\n )}\n </Popup>\n </Portal>\n );\n}\n\n/* =========================== Dialog.InsetContent =========================== */\n\n/**\n * Near-fullscreen popup — the viewport minus a breathing ring, floating over\n * a backdrop (the page stays visible through the gap, so it dims like any\n * floating layer). Still a card: border, elevation, rounded corners; the\n * scale gesture stays but shrinks to 98% — at this size 95% reads like a jump.\n */\nfunction InsetPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8\",\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface InsetContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Decorative icon above the title — same treatment as `Content`. */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Bottom action row. Iron rule as `Content`: when `actions` is set, the\n * header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience near-fullscreen panel: header pinned on top, body filling and\n * scrolling on its own, optional action row pinned at the bottom. Sits\n * between `Content` (a focused card) and `FullscreenContent` (a page\n * takeover): use it for roomy working surfaces — pickers, editors, previews —\n * that still want the page peeking through an edge.\n */\nfunction InsetContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: InsetContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n\n return (\n <Portal>\n <Backdrop />\n <InsetPopup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"px-6 py-5\">\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n {actions != null && (\n <div className=\"flex shrink-0 items-center justify-end gap-2 px-6 pb-5\">\n {actions}\n </div>\n )}\n </InsetPopup>\n </Portal>\n );\n}\n\n/* ========================= Dialog.FullscreenContent ======================== */\n\n/**\n * Full-viewport popup — a page-surface takeover instead of a floating card.\n * No backdrop: the popup itself is the layer. Fade only; scale is a floating-\n * card gesture and reads wrong at viewport size.\n */\nfunction FullscreenPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none\",\n \"transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface FullscreenContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — same chrome as `Content`, but 48px\n * (`size-12`) for viewport-scale gates.\n */\n icon?: ReactNode;\n /** Heading of the takeover. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Action row under the body. Iron rule as `Content`: when `actions` is set,\n * the corner close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Corner close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n /**\n * Classes on the viewport-centering frame (the `min-h-full` flex host).\n * Use to drop the default optical `pb-20` when the stack grows (e.g. a\n * captcha) so true center stays put: `frameClassName=\"pb-6\"`.\n */\n frameClassName?: string;\n children?: ReactNode;\n}\n\n/**\n * Convenience full-screen panel: the whole viewport becomes the dialog, with\n * a centered column at the standalone-flow width (28rem — the same measure as\n * onboarding / invite cards). Column height follows its content through\n * `AnimatedHeight` (same spring as the Card shell), so step swaps — phone →\n * OTP → captcha — glide instead of jumping. Use for gates the visitor must\n * deal with before the page behind makes sense (e.g. binding a phone number);\n * prefer `Content` for everything conversational.\n */\nfunction FullscreenContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n frameClassName,\n children,\n className,\n ...props\n}: FullscreenContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a corner X.\n const showCloseButton = actions == null && showClose;\n\n return (\n <Portal>\n <FullscreenPopup className={className} {...props}>\n {showCloseButton && (\n <Close\n render={<CloseButton className=\"fixed top-4 right-4 z-10\" />}\n />\n )}\n {/* Default `pb-20` optically lifts the column above true center. */}\n <div\n className={cn(\n \"flex min-h-full items-center justify-center px-6 pt-6 pb-20\",\n frameClassName,\n )}\n >\n {/* Width stays on the outer host; AnimatedHeight measures the\n header + body stack and springs its own height on content\n changes. The action row sits below it, outside the clip: while\n the body grows the container is shorter than its content for a\n few frames, and a row inside it would be cut off at the bottom\n (a pressed \"Send code\" turning grey right as a captcha mounts).\n Outside, the row rides the spring instead. */}\n <div className=\"w-full max-w-md\">\n <AnimatedHeight className=\"flex flex-col gap-5\">\n {(icon || title || description) && (\n <div className=\"flex flex-col gap-1\">\n {icon && (\n <DialogHeaderIcon size=\"lg\">{icon}</DialogHeaderIcon>\n )}\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {children}\n </AnimatedHeight>\n {actions != null && (\n <div className=\"mt-5 flex items-center justify-end gap-2\">\n {actions}\n </div>\n )}\n </div>\n </div>\n </FullscreenPopup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`\n * adds native promise support: an async confirm keeps the dialog open and\n * undismissable until the work resolves.\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n InsetPopup,\n FullscreenPopup,\n Title,\n Description,\n Close,\n Action,\n Content,\n InsetContent,\n FullscreenContent,\n};\n"],"mappings":";;;;;;;;;AA6CA,IAAMiB,IAAuBV,EAC3B,IACF;AAOA,SAAgBW,KAA4B;AAC1C,SAAOT,EAAWQ,CAAoB,GAAG,WAAW;AACtD;AAUA,SAASE,EAAK,EAAE,cAAAC,GAAc,YAAAC,GAAY,GAAGC,EAAA,GAAoB;AAC/D,QAAM,CAACC,GAASC,CAAA,IAAcX,EAAS,EAAK,GAGtCY,IAAab,EAAO,EAAK,GACzBc,IAAqBd,EAA2B,IAAI;AAG1D,EAAAF,EAAA,MAAgB;AACd,QAAKW;AACL,aAAAA,EAAW,UAAUK,EAAmB,SACxC,MAAa;AACX,QAAAL,EAAW,UAAU;AAAA,MACvB;AAAA,EACF,GAAG,CAACA,CAAU,CAAC;AAEf,QAAMM,IAAmBnB,EAAA,CACtBoB,GAAMC,MAAiB;AACtB,QAAI,CAACD,KAAQH,EAAW,SAAS;AAC/B,MAAAI,EAAa,OAAO;AACpB;AAAA,IACF;AACA,IAAAT,IAAeQ,GAAMC,CAAY;AAAA,EACnC,GACA,CAACT,CAAY,CACf,GAEMU,IAAenB,EAAA,OACZ;AAAA,IACL,SAAAY;AAAA,IACA,cAAA,MAAoB;AAClB,MAAAE,EAAW,UAAU,IACrBD,EAAW,EAAI;AAAA,IACjB;AAAA,IACA,YAAA,MAAkB;AAChB,MAAAC,EAAW,UAAU,IACrBD,EAAW,EAAK;AAAA,IAClB;AAAA,IACA,OAAA,MAAaE,EAAmB,SAAS,MAAM;AAAA,EACjD,IACA,CAACH,CAAO,CACV;AAEA,SACE,gBAAAT,EAACG,EAAqB,U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