@photon-ai/pho-ui 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/chunks/basic-page-BI8y4hHk.js +1449 -0
  2. package/dist/chunks/basic-page-BI8y4hHk.js.map +1 -0
  3. package/dist/chunks/{checkbox-Cdm08HWG.js → checkbox-CznlNhDY.js} +40 -37
  4. package/dist/chunks/checkbox-CznlNhDY.js.map +1 -0
  5. package/dist/chunks/data-table-Cmz0p-jt.js +279 -0
  6. package/dist/chunks/data-table-Cmz0p-jt.js.map +1 -0
  7. package/dist/chunks/rolldown-runtime-wKSmTnsc.js +22 -0
  8. package/dist/components/accordion.js +87 -28
  9. package/dist/components/accordion.js.map +1 -1
  10. package/dist/components/checkbox.js +1 -1
  11. package/dist/components/data-table.js +1 -1
  12. package/dist/components/phone-input.js +1 -1
  13. package/dist/components/radio-group.js +50 -43
  14. package/dist/components/radio-group.js.map +1 -1
  15. package/dist/components/select.js +7 -7
  16. package/dist/components/select.js.map +1 -1
  17. package/dist/index.js +2 -2
  18. package/dist/primitives/accordion.js +1 -1
  19. package/dist/primitives/alert-dialog.js +1 -1
  20. package/dist/primitives/autocomplete.js +1 -1
  21. package/dist/primitives/avatar.js +1 -1
  22. package/dist/primitives/button.js +1 -1
  23. package/dist/primitives/checkbox-group.js +1 -1
  24. package/dist/primitives/checkbox.js +1 -1
  25. package/dist/primitives/collapsible.js +1 -1
  26. package/dist/primitives/combobox.js +1 -1
  27. package/dist/primitives/context-menu.js +1 -1
  28. package/dist/primitives/csp-provider.js +1 -1
  29. package/dist/primitives/dialog.js +1 -1
  30. package/dist/primitives/direction-provider.js +1 -1
  31. package/dist/primitives/drawer.js +1 -1
  32. package/dist/primitives/field.js +1 -1
  33. package/dist/primitives/fieldset.js +1 -1
  34. package/dist/primitives/form.js +1 -1
  35. package/dist/primitives/input.js +1 -1
  36. package/dist/primitives/menu.js +1 -1
  37. package/dist/primitives/menubar.js +1 -1
  38. package/dist/primitives/meter.js +1 -1
  39. package/dist/primitives/navigation-menu.js +1 -1
  40. package/dist/primitives/number-field.js +1 -1
  41. package/dist/primitives/otp-field.js +1 -1
  42. package/dist/primitives/popover.js +1 -1
  43. package/dist/primitives/preview-card.js +1 -1
  44. package/dist/primitives/progress.js +1 -1
  45. package/dist/primitives/radio-group.js +1 -1
  46. package/dist/primitives/radio.js +1 -1
  47. package/dist/primitives/scroll-area.js +1 -1
  48. package/dist/primitives/select.js +1 -1
  49. package/dist/primitives/separator.js +1 -1
  50. package/dist/primitives/slider.js +1 -1
  51. package/dist/primitives/switch.js +1 -1
  52. package/dist/primitives/tabs.js +1 -1
  53. package/dist/primitives/toast.js +1 -1
  54. package/dist/primitives/toggle-group.js +1 -1
  55. package/dist/primitives/toggle.js +1 -1
  56. package/dist/primitives/toolbar.js +1 -1
  57. package/dist/primitives/tooltip.js +1 -1
  58. package/dist/primitives.js +1 -1
  59. package/dist/sections/basic-page.js +2 -2
  60. package/dist/src/components/accordion/accordion.d.ts +45 -8
  61. package/dist/src/components/checkbox/checkbox-card.d.ts +2 -1
  62. package/dist/src/components/data-table/data-table.d.ts +3 -2
  63. package/dist/src/components/radio-group/radio-card.d.ts +3 -2
  64. package/dist/src/sections/basic-page/basic-page.d.ts +43 -11
  65. package/package.json +1 -1
  66. package/src/styles/theme.css +54 -0
  67. package/dist/chunks/basic-page-DR5szOOs.js +0 -1373
  68. package/dist/chunks/basic-page-DR5szOOs.js.map +0 -1
  69. package/dist/chunks/checkbox-Cdm08HWG.js.map +0 -1
  70. package/dist/chunks/data-table-DwbPU0zt.js +0 -2970
  71. package/dist/chunks/data-table-DwbPU0zt.js.map +0 -1
  72. package/dist/chunks/rolldown-runtime-DG5F_Nuu.js +0 -27
@@ -0,0 +1,1449 @@
1
+ "use client";
2
+ import { t as u } from "./cn-ChIgwEl3.js";
3
+ import { n as Ie } from "./link-provider-DXzDQ08N.js";
4
+ import { FADE_ENTRANCE as Je, FADE_SWAP as Ze, SPRING_ENTRANCE as et, TRAVEL_LINEAR as tt } from "../motion.js";
5
+ import { a as ae, o as de } from "./button-CdqS_t5a.js";
6
+ import { t as nt } from "./createReactComponent-BqCmnqfX.js";
7
+ import { t as at } from "./error-D0yoFxCv.js";
8
+ import { t as ee } from "./IconChevronLeft-CSWMKQ4C.js";
9
+ import { a as pe, i as rt, n as it, r as st, s as lt } from "./data-table-Cmz0p-jt.js";
10
+ import { t as we } from "./IconSearch-BKAHkLyX.js";
11
+ import { t as ot } from "./IconX-pZ9vrtSr.js";
12
+ import { t as ct } from "./toast-iSf6NuAS.js";
13
+ import { t as se } from "./input-group-fc9_jD4d.js";
14
+ import { t as ut } from "./animated-height-CCO-Ocoz.js";
15
+ import { n as Oe, t as Y } from "./scroll-area-BO-9PMM7.js";
16
+ import { t as dt } from "./form-AiHbbw4m.js";
17
+ import { i as j } from "./menu-BQeprfxB.js";
18
+ import { Children as re, Fragment as pt, createContext as V, isValidElement as ft, useCallback as Le, useContext as _, useEffect as k, useId as mt, useLayoutEffect as G, useMemo as z, useRef as N, useState as v, useSyncExternalStore as fe } from "react";
19
+ import { Fragment as Be, jsx as n, jsxs as b } from "react/jsx-runtime";
20
+ import { AnimatePresence as X, motion as A, useIsPresent as ht, useReducedMotion as O } from "motion/react";
21
+ import { Dialog as Z } from "@base-ui/react/dialog";
22
+ import { createPortal as Ne } from "react-dom";
23
+ var gt = [["path", {
24
+ d: "M9 6l6 6l-6 6",
25
+ key: "svg-0"
26
+ }]], vt = nt("outline", "chevron-right", "ChevronRight", gt), me = "rounded-base border border-pho-secondary bg-pho-primary", te = "divide-y divide-pho-secondary [&>:has(+[data-basic-page-alert])]:border-b-0", yt = `${me} ${te}`, Ae = "flex min-w-0 flex-col gap-3 rounded-base border border-pho-secondary bg-pho-page p-5", bt = "flex min-h-[4.25rem] min-w-0 flex-col gap-3 px-5 py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6", xt = "flex flex-col gap-3 px-5 py-4", wt = "-mx-5 -mb-4 flex items-center rounded-b-[calc(0.75rem-1px)] bg-pho-secondary py-1 pr-3 pl-5", Nt = "-mx-2 -mt-1.5 flex items-center rounded-sm bg-pho-secondary px-2 py-0.5", S = et, B = Je, K = 12, At = 768;
27
+ function Ct(e) {
28
+ return Math.round(Math.min(Math.max(e * 0.4, 320), 448));
29
+ }
30
+ var Me = V(null), De = V(null);
31
+ function Et(e) {
32
+ const [t, a] = v(null), [i, r] = v(!1), [c, o] = v(!1), [l, s] = v(() => ({
33
+ width: typeof window > "u" ? 0 : window.innerWidth,
34
+ height: null
35
+ }));
36
+ return G(() => {
37
+ const d = e.current;
38
+ if (!i || d == null) return;
39
+ const f = be(d), p = () => {
40
+ const h = d.offsetWidth, g = f?.clientHeight ?? null;
41
+ s((y) => y.width === h && y.height === g ? y : {
42
+ width: h,
43
+ height: g
44
+ });
45
+ };
46
+ if (p(), typeof ResizeObserver > "u") return;
47
+ const m = new ResizeObserver(p);
48
+ return m.observe(d), f != null && m.observe(f), () => m.disconnect();
49
+ }, [e, i]), {
50
+ host: z(() => ({
51
+ slot: t,
52
+ presentation: l.width >= At ? "panel" : "page",
53
+ width: Ct(l.width),
54
+ paneHeight: l.height,
55
+ setOpen: o,
56
+ setPresent: r
57
+ }), [t, l]),
58
+ setSlot: a,
59
+ open: c
60
+ };
61
+ }
62
+ function _t(e) {
63
+ return e == null ? window.scrollY : e.scrollTop;
64
+ }
65
+ function Ce(e, t) {
66
+ e == null ? window.scrollTo({ top: t }) : e.scrollTop = t;
67
+ }
68
+ function Rt({ condense: e = !0, width: t, className: a, children: i, ref: r, ...c }) {
69
+ const o = _(ie)?.adopt ?? !1, l = _(De), [s, d] = v(!1), f = N(0), p = Le((H) => {
70
+ f.current += H ? 1 : -1, d(f.current > 0);
71
+ }, []), m = t === "wide" || t == null && s, [h] = v(lt), g = N(null), [y, T] = v(null), [E, P] = v(null), x = z(() => ({
72
+ setTitle: T,
73
+ setTail: P
74
+ }), []);
75
+ k(() => {
76
+ if (l != null)
77
+ return l.setBack(E), () => l.setBack(null);
78
+ }, [l, E]);
79
+ const { host: L, setSlot: M, open: I } = Et(g), R = I && L.presentation === "page", D = N(!1), $ = N(0);
80
+ G(() => {
81
+ const H = g.current;
82
+ if (R === D.current || H == null) return;
83
+ D.current = R;
84
+ const w = be(H);
85
+ R ? ($.current = _t(w), Ce(w, 0)) : Ce(w, $.current);
86
+ }, [R]);
87
+ const Q = e ? /* @__PURE__ */ n(St, {
88
+ title: y,
89
+ tail: l == null ? E : null,
90
+ silent: R || l != null
91
+ }) : null, U = /* @__PURE__ */ n("div", {
92
+ "data-basic-page-column": "",
93
+ className: u("mx-auto flex w-full min-w-0 flex-1 flex-col px-5 pt-12 pb-12 *:min-w-0", m ? "max-w-[84rem] md:px-8" : "max-w-[44.5rem]", o || l != null ? "[&_[data-basic-page-back]]:hidden" : "has-[[data-basic-page-back]]:pt-16"),
94
+ children: e ? /* @__PURE__ */ n(ge.Provider, {
95
+ value: x,
96
+ children: i
97
+ }) : i
98
+ });
99
+ return /* @__PURE__ */ n("div", {
100
+ "data-basic-page-root": "",
101
+ "data-basic-page-width": m ? "wide" : void 0,
102
+ className: u("relative flex min-h-full w-full min-w-0 flex-row", a),
103
+ ...c,
104
+ ref: (H) => {
105
+ g.current = H, typeof r == "function" ? r(H) : r != null && (r.current = H);
106
+ },
107
+ children: /* @__PURE__ */ n(Me.Provider, {
108
+ value: L,
109
+ children: /* @__PURE__ */ n(rt.Provider, {
110
+ value: p,
111
+ children: /* @__PURE__ */ b(pe.Provider, {
112
+ value: h,
113
+ children: [/* @__PURE__ */ b("div", {
114
+ "data-basic-page-main": "",
115
+ className: u("flex min-w-0 flex-1 flex-col", R && "hidden"),
116
+ children: [Q, U]
117
+ }), /* @__PURE__ */ n("div", {
118
+ ref: M,
119
+ className: "contents"
120
+ })]
121
+ })
122
+ })
123
+ })
124
+ });
125
+ }
126
+ function St({ title: e, tail: t, silent: a = !1 }) {
127
+ const i = O(), [r, c] = v(!1), o = _(ie), l = mt();
128
+ k(() => {
129
+ if (o != null) {
130
+ if (a) {
131
+ o.store.clear(l);
132
+ return;
133
+ }
134
+ o.store.set(l, {
135
+ condensed: r,
136
+ title: e?.label ?? null,
137
+ back: t
138
+ });
139
+ }
140
+ }, [
141
+ o,
142
+ l,
143
+ r,
144
+ e,
145
+ t,
146
+ a
147
+ ]), k(() => {
148
+ if (o != null)
149
+ return () => o.store.clear(l);
150
+ }, [o, l]);
151
+ const s = e?.el ?? null;
152
+ return k(() => {
153
+ if (s == null || typeof IntersectionObserver > "u") return;
154
+ const d = new IntersectionObserver(([f]) => c(f != null && !f.isIntersecting), { root: be(s) });
155
+ return d.observe(s), () => d.disconnect();
156
+ }, [s]), /* @__PURE__ */ n("div", {
157
+ "data-basic-page-condense": "",
158
+ className: "sticky top-0 z-20 h-0 overflow-visible",
159
+ children: /* @__PURE__ */ n(X, { children: r && !(o?.adopt ?? !1) && /* @__PURE__ */ b(A.div, {
160
+ initial: {
161
+ opacity: 0,
162
+ y: i ? 0 : Se
163
+ },
164
+ animate: {
165
+ opacity: 1,
166
+ y: 0
167
+ },
168
+ exit: {
169
+ opacity: 0,
170
+ y: i ? 0 : Se
171
+ },
172
+ transition: {
173
+ ...ye,
174
+ y: Ft
175
+ },
176
+ className: "border-pho-secondary bg-pho-page/85 relative grid h-12 grid-cols-[1fr_minmax(0,auto)_1fr] items-center border-b px-3 backdrop-blur",
177
+ children: [/* @__PURE__ */ n("div", {
178
+ className: "flex min-w-0 items-center justify-start",
179
+ children: t != null && /* @__PURE__ */ n(de, {
180
+ variant: "ghost",
181
+ size: "sm",
182
+ href: t.href,
183
+ onClick: t.onClick,
184
+ prefix: /* @__PURE__ */ n("span", {
185
+ className: "inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0",
186
+ children: /* @__PURE__ */ n(ee, {})
187
+ }),
188
+ className: "min-w-max",
189
+ children: t.label
190
+ })
191
+ }), /* @__PURE__ */ n("span", {
192
+ className: "text-pho-primary block max-w-full min-w-0 truncate text-center text-base font-medium",
193
+ children: e?.label
194
+ })]
195
+ }) })
196
+ });
197
+ }
198
+ function kt(e) {
199
+ return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
200
+ }
201
+ function Tt(e) {
202
+ if (!(typeof e != "string" && typeof e != "number"))
203
+ return kt(String(e)) || void 0;
204
+ }
205
+ function he(e, t) {
206
+ if (e !== "")
207
+ return e ?? Tt(t);
208
+ }
209
+ var Pt = (e) => `basic-page-morph-${e}`, It = { layout: S }, Ee = 10, _e = {
210
+ delay: 0.2,
211
+ duration: 0.12,
212
+ ease: "easeOut"
213
+ }, Ot = {
214
+ duration: 0.18,
215
+ ease: "easeOut"
216
+ }, Lt = -8, Bt = {
217
+ duration: 0.16,
218
+ ease: "easeOut"
219
+ }, Mt = {
220
+ delay: 0.14,
221
+ duration: 0.16,
222
+ ease: "easeOut"
223
+ }, He = {
224
+ duration: 0.12,
225
+ ease: "easeOut"
226
+ }, W = [];
227
+ function Dt(e) {
228
+ const t = N({ labels: e });
229
+ t.current.labels = e, G(() => {
230
+ const a = t.current;
231
+ return W.push(a), () => {
232
+ W.splice(W.indexOf(a), 1);
233
+ };
234
+ }, []);
235
+ }
236
+ function Fe() {
237
+ const [e] = v(() => {
238
+ const t = W[W.length - 1];
239
+ return t ? { labels: [...t.labels] } : null;
240
+ });
241
+ return e;
242
+ }
243
+ var ge = V(null), ce = {
244
+ condensed: !1,
245
+ title: null,
246
+ back: null
247
+ }, ie = V(null), ve = () => () => {
248
+ }, Re = () => ce;
249
+ function Ht({ adopt: e = !0, children: t }) {
250
+ const [a] = v(() => {
251
+ let r = ce, c = null;
252
+ const o = /* @__PURE__ */ new Set(), l = () => {
253
+ for (const s of o) s();
254
+ };
255
+ return {
256
+ get: () => r,
257
+ set(s, d) {
258
+ c = s, r = d, l();
259
+ },
260
+ clear(s) {
261
+ c === s && (c = null, r = ce, l());
262
+ },
263
+ subscribe(s) {
264
+ return o.add(s), () => o.delete(s);
265
+ }
266
+ };
267
+ }), i = z(() => ({
268
+ store: a,
269
+ adopt: e
270
+ }), [a, e]);
271
+ return /* @__PURE__ */ n(ie.Provider, {
272
+ value: i,
273
+ children: t
274
+ });
275
+ }
276
+ function Zn() {
277
+ const e = _(ie);
278
+ return fe(e?.store.subscribe ?? ve, e?.store.get ?? Re, e?.store.get ?? Re);
279
+ }
280
+ var ye = Ze, Ft = tt, Se = -8;
281
+ function be(e) {
282
+ if (typeof getComputedStyle != "function") return null;
283
+ for (let t = e.parentElement; t != null && t !== document.body; t = t.parentElement) {
284
+ const { overflowY: a } = getComputedStyle(t);
285
+ if (a === "auto" || a === "scroll") return t;
286
+ }
287
+ return null;
288
+ }
289
+ var le = /* @__PURE__ */ new Map(), Gt = 96;
290
+ function zt(e) {
291
+ const t = e.closest("[data-basic-page-root]"), a = t?.querySelector("[data-basic-page-column]");
292
+ return !t || !a ? 0 : a.getBoundingClientRect().left - t.getBoundingClientRect().left;
293
+ }
294
+ function Ge(e) {
295
+ const [t] = v(() => {
296
+ if (e == null) return !1;
297
+ const i = le.get(e);
298
+ return i != null && i.visible && i.el.isConnected && zt(i.el) <= Gt;
299
+ }), a = N(null);
300
+ return k(() => {
301
+ if (e == null || typeof IntersectionObserver > "u") return;
302
+ const i = a.current;
303
+ if (!i) return;
304
+ const r = new IntersectionObserver(([c]) => {
305
+ c && le.set(e, {
306
+ visible: c.isIntersecting,
307
+ el: i
308
+ });
309
+ });
310
+ return r.observe(i), () => {
311
+ r.disconnect(), le.delete(e);
312
+ };
313
+ }, [e]), {
314
+ fly: t,
315
+ ref: a
316
+ };
317
+ }
318
+ var Vt = {
319
+ fade: {
320
+ initial: { opacity: 0 },
321
+ animate: { opacity: 1 },
322
+ transition: { opacity: B }
323
+ },
324
+ rise: {
325
+ initial: {
326
+ opacity: 0,
327
+ y: K
328
+ },
329
+ animate: {
330
+ opacity: 1,
331
+ y: 0
332
+ },
333
+ transition: {
334
+ y: S,
335
+ opacity: B
336
+ }
337
+ },
338
+ slide: {
339
+ initial: { x: "-100%" },
340
+ animate: { x: 0 },
341
+ transition: { x: Mt }
342
+ }
343
+ };
344
+ function ze({ morphId: e, fromClassName: t, fly: a, morphRef: i, arrival: r, className: c, children: o }) {
345
+ const [l, s] = v(!1), d = !a && r != null ? Vt[r] : null;
346
+ return /* @__PURE__ */ b(A.span, {
347
+ ref: i,
348
+ layoutId: Pt(e),
349
+ initial: d?.initial,
350
+ animate: d?.animate,
351
+ transition: a ? It : {
352
+ layout: { duration: 0 },
353
+ ...d?.transition
354
+ },
355
+ onLayoutAnimationStart: () => {
356
+ a && s(!0);
357
+ },
358
+ onLayoutAnimationComplete: () => s(!1),
359
+ className: u("relative inline-block", c),
360
+ children: [o, l && /* @__PURE__ */ n(A.span, {
361
+ "aria-hidden": !0,
362
+ initial: { opacity: 1 },
363
+ animate: { opacity: 0 },
364
+ transition: Ot,
365
+ onAnimationComplete: () => s(!1),
366
+ className: u("absolute inset-0", t),
367
+ children: o
368
+ })]
369
+ });
370
+ }
371
+ var ke = "max-w-full min-w-0 truncate align-top";
372
+ function $t({ id: e, morphId: t, enter: a, className: i, children: r, ...c }) {
373
+ const o = he(e, r), l = O(), s = Ge(t), d = Fe(), f = !l && (t != null || a === !0), p = a || d != null ? "rise" : void 0, m = _(ge), h = N(null);
374
+ G(() => {
375
+ if (m != null)
376
+ return m.setTitle({
377
+ label: r,
378
+ el: h.current
379
+ }), () => m.setTitle(null);
380
+ }, [m, r]);
381
+ const [g, y] = v(s.fly && d != null);
382
+ return G(() => {
383
+ W.length > 0 && y(!1);
384
+ }, []), /* @__PURE__ */ b("h1", {
385
+ id: o,
386
+ className: u("text-display-base text-pho-primary max-w-full min-w-0 scroll-mt-12 px-5 font-medium", f ? "whitespace-nowrap" : "truncate", i),
387
+ ...c,
388
+ ref: (T) => {
389
+ h.current = T;
390
+ const E = c.ref;
391
+ typeof E == "function" ? E(T) : E != null && (E.current = T);
392
+ },
393
+ children: [t != null && !l ? /* @__PURE__ */ n(ze, {
394
+ morphId: t,
395
+ fromClassName: "text-pho-secondary",
396
+ fly: s.fly,
397
+ morphRef: s.ref,
398
+ arrival: p,
399
+ className: ke,
400
+ children: r
401
+ }) : a && !l ? /* @__PURE__ */ n(A.span, {
402
+ initial: {
403
+ opacity: 0,
404
+ y: K
405
+ },
406
+ animate: {
407
+ opacity: 1,
408
+ y: 0
409
+ },
410
+ transition: {
411
+ y: S,
412
+ opacity: B
413
+ },
414
+ className: u("inline-block", ke),
415
+ children: r
416
+ }) : r, g && /* @__PURE__ */ n(A.span, {
417
+ "aria-hidden": !0,
418
+ initial: { opacity: 1 },
419
+ animate: { opacity: 0 },
420
+ transition: He,
421
+ onAnimationComplete: () => y(!1),
422
+ className: u("text-pho-secondary pointer-events-none absolute inline-flex items-center", yn),
423
+ children: /* @__PURE__ */ n(ee, {})
424
+ })]
425
+ });
426
+ }
427
+ var Ve = V(!1);
428
+ function jt() {
429
+ const e = _(Ve), t = O(), [a] = v(() => e && !t);
430
+ return a;
431
+ }
432
+ var Wt = {
433
+ height: 0,
434
+ opacity: 0,
435
+ paddingTop: 0,
436
+ paddingBottom: 0,
437
+ borderTopWidth: 0
438
+ }, Xt = {
439
+ y: S,
440
+ opacity: B,
441
+ height: S,
442
+ paddingTop: S,
443
+ paddingBottom: S,
444
+ borderTopWidth: S
445
+ };
446
+ function xe() {
447
+ const e = jt(), t = ht(), a = O();
448
+ return {
449
+ initial: e ? {
450
+ opacity: 0,
451
+ y: K
452
+ } : !1,
453
+ animate: {
454
+ opacity: 1,
455
+ y: 0
456
+ },
457
+ exit: Wt,
458
+ transition: a ? { duration: 0 } : Xt,
459
+ leaving: !t
460
+ };
461
+ }
462
+ var Kt = typeof process < "u" && process.env.NODE_ENV !== "production";
463
+ function $e(e, t, a, i) {
464
+ k(() => {
465
+ if (!Kt || e.current == null || typeof getComputedStyle != "function") return;
466
+ const r = (o) => {
467
+ const l = getComputedStyle(o).rowGap;
468
+ return l === "" || l === "normal" ? null : parseFloat(l);
469
+ }, c = r(e.current);
470
+ c != null && c !== a && console.warn(`[BasicPage.${t}] spaced at ${c}px instead of ${a}px. Spacing is the system's: Stack gap-10 between blocks, a block gap-3, Fields gap-5. Remove the class and move the wrapper instead.`, e.current);
471
+ for (const o of Array.from(e.current.children)) {
472
+ const l = i(o);
473
+ if (l == null || getComputedStyle(o).display === "contents") continue;
474
+ const s = r(o);
475
+ s != null && s !== l && console.warn(`[BasicPage.${t}] a child is spaced at ${s}px instead of ${l}px. Spacing is the system's: Stack gap-10 between blocks, a block gap-3, Fields gap-5. Remove the class and move the wrapper instead.`, o);
476
+ }
477
+ });
478
+ }
479
+ function qt({ className: e, children: t, ref: a, ...i }) {
480
+ const r = O(), c = N(null);
481
+ $e(c, "Stack", 40, (f) => f.hasAttribute("data-basic-page-fields") ? 20 : 12);
482
+ const o = i["aria-busy"], l = o === !0 || o === "true", s = N(l), d = s.current && !l;
483
+ return k(() => {
484
+ s.current = l;
485
+ }), /* @__PURE__ */ n(A.div, {
486
+ ref: (f) => {
487
+ c.current = f, typeof a == "function" ? a(f) : a != null && (a.current = f);
488
+ },
489
+ "data-basic-page-stack": "",
490
+ initial: r ? !1 : {
491
+ opacity: 0,
492
+ y: K
493
+ },
494
+ animate: {
495
+ opacity: 1,
496
+ y: 0
497
+ },
498
+ transition: {
499
+ y: S,
500
+ opacity: B
501
+ },
502
+ className: u("mt-7 flex min-w-0 flex-col gap-10", "[&:has(>*:first-child:not([data-basic-page-callout])>[data-basic-page-header]:first-child)]:mt-6 [&:has(>*:first-child:not([data-basic-page-callout])>h2:first-child)]:mt-6 [&:has(>[data-basic-page-header]:first-child)]:mt-6 [&:has(>h2:first-child)]:mt-6", "*:flex *:min-w-0 *:flex-col [&>*:not([data-basic-page-fields])]:gap-3", e),
503
+ ...i,
504
+ children: /* @__PURE__ */ n(Ve.Provider, {
505
+ value: d,
506
+ children: t
507
+ })
508
+ });
509
+ }
510
+ var Te = "@container grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] mb-3 [&>:not([data-basic-page-search]):not([data-basic-page-header-action])]:col-start-1 [[data-basic-page-callout]_&]:mb-0 [[data-basic-page-stack]>*>&]:mb-0";
511
+ function Yt({ enter: e, className: t, ...a }) {
512
+ const i = O();
513
+ return e && !i ? /* @__PURE__ */ n(A.div, {
514
+ initial: {
515
+ opacity: 0,
516
+ y: K
517
+ },
518
+ animate: {
519
+ opacity: 1,
520
+ y: 0
521
+ },
522
+ transition: {
523
+ y: S,
524
+ opacity: B
525
+ },
526
+ "data-basic-page-header": "",
527
+ className: u(Te, t),
528
+ ...a
529
+ }) : /* @__PURE__ */ n("div", {
530
+ "data-basic-page-header": "",
531
+ className: u(Te, t),
532
+ ...a
533
+ });
534
+ }
535
+ function Qt({ className: e, ...t }) {
536
+ return /* @__PURE__ */ n("div", {
537
+ "data-basic-page-header-action": "",
538
+ className: u("flex items-center gap-2", "[[data-basic-page-header]>&]:col-start-3 [[data-basic-page-header]>&]:row-span-2 [[data-basic-page-header]>&]:row-start-1 [[data-basic-page-header]>&]:ml-4 [[data-basic-page-header]>&]:self-start [[data-basic-page-header]>&]:justify-self-end", e),
539
+ ...t
540
+ });
541
+ }
542
+ function Ut({ id: e, className: t, children: a, ...i }) {
543
+ const r = he(e, a);
544
+ return /* @__PURE__ */ n("h2", {
545
+ id: r,
546
+ className: u("text-display-xs text-pho-primary max-w-full min-w-0 scroll-mt-12 truncate px-5 font-medium", "mb-3 [[data-basic-page-callout]_&]:mb-0 [[data-basic-page-header]>&]:mb-0 [[data-basic-page-stack]>*>&]:mb-0", t),
547
+ ...i,
548
+ children: a
549
+ });
550
+ }
551
+ function je({ className: e, ...t }) {
552
+ return /* @__PURE__ */ n("p", {
553
+ className: u("text-display-xs text-pho-description px-5 font-normal", e),
554
+ ...t
555
+ });
556
+ }
557
+ function Jt({ one: e, other: t, ...a }) {
558
+ const i = _(pe), r = fe(i?.subscribe ?? ve, () => i?.get().api ?? null, () => null);
559
+ if (r == null) return null;
560
+ const c = r.query.trim() !== "" ? `${r.matched} of ${r.total}.` : `${r.total} ${r.total === 1 ? e : t}.`;
561
+ return /* @__PURE__ */ n(je, {
562
+ ...a,
563
+ children: c
564
+ });
565
+ }
566
+ function Zt({ className: e, ...t }) {
567
+ return /* @__PURE__ */ n("p", {
568
+ className: u("text-pho-description px-5 text-xs font-normal", "mt-3 [[data-basic-page-callout]_&]:mt-0 [[data-basic-page-stack]>*>&]:mt-0", e),
569
+ ...t
570
+ });
571
+ }
572
+ function en({ animateHeight: e, className: t, children: a, ...i }) {
573
+ const r = /* @__PURE__ */ n(X, { children: re.toArray(a) });
574
+ return e ? /* @__PURE__ */ n("div", {
575
+ className: u(me, "min-h-0 overflow-hidden", t),
576
+ ...i,
577
+ children: /* @__PURE__ */ n(ut, {
578
+ transition: S,
579
+ className: te,
580
+ children: r
581
+ })
582
+ }) : /* @__PURE__ */ n("div", {
583
+ className: u(yt, t),
584
+ ...i,
585
+ children: r
586
+ });
587
+ }
588
+ function tn({ className: e, ...t }) {
589
+ const { leaving: a, ...i } = xe();
590
+ return /* @__PURE__ */ n(A.div, {
591
+ ...i,
592
+ className: u(xt, a && "overflow-hidden", e),
593
+ ...t
594
+ });
595
+ }
596
+ function nn({ divided: e = !1, className: t, ...a }) {
597
+ return /* @__PURE__ */ n("div", {
598
+ className: u(e ? Nt : wt, t),
599
+ ...a
600
+ });
601
+ }
602
+ function an({ className: e, icon: t, children: a, ...i }) {
603
+ if (t == null || t === !1 || t === !0) return /* @__PURE__ */ n("div", {
604
+ "data-basic-page-callout": "",
605
+ className: u(Ae, e),
606
+ ...i,
607
+ children: a
608
+ });
609
+ const [r, ...c] = re.toArray(a);
610
+ return /* @__PURE__ */ b("div", {
611
+ "data-basic-page-callout": "",
612
+ className: u(Ae, e),
613
+ ...i,
614
+ children: [/* @__PURE__ */ b("div", {
615
+ className: "relative",
616
+ children: [/* @__PURE__ */ n("div", {
617
+ className: "min-w-0 pr-16",
618
+ children: r
619
+ }), /* @__PURE__ */ n("div", {
620
+ "aria-hidden": !0,
621
+ className: "text-pho-primary pointer-events-none absolute top-0 right-0 size-14 opacity-[0.275] [&>svg]:size-full",
622
+ children: t
623
+ })]
624
+ }), c]
625
+ });
626
+ }
627
+ function rn({ id: e, className: t, children: a, ...i }) {
628
+ const r = he(e, a);
629
+ return /* @__PURE__ */ n("h2", {
630
+ id: r,
631
+ className: u("text-display-xs text-pho-primary max-w-full min-w-0 scroll-mt-12 truncate font-medium", t),
632
+ ...i,
633
+ children: a
634
+ });
635
+ }
636
+ function sn({ className: e, ...t }) {
637
+ return /* @__PURE__ */ n("p", {
638
+ className: u("text-display-xs text-pho-description font-normal", e),
639
+ ...t
640
+ });
641
+ }
642
+ function ln({ label: e, description: t, htmlFor: a, stacked: i = !1, className: r, children: c, ...o }) {
643
+ const { leaving: l, ...s } = xe();
644
+ return /* @__PURE__ */ b(A.div, {
645
+ ...s,
646
+ className: u(bt, i && "sm:flex-col sm:items-stretch sm:justify-start sm:gap-3", l && "overflow-hidden", r),
647
+ ...o,
648
+ children: [/* @__PURE__ */ b("div", {
649
+ className: "min-w-0",
650
+ children: [a ? /* @__PURE__ */ n("label", {
651
+ htmlFor: a,
652
+ className: "text-pho-primary block text-base font-normal",
653
+ children: e
654
+ }) : /* @__PURE__ */ n("div", {
655
+ className: "text-pho-primary text-base font-normal",
656
+ children: e
657
+ }), t ? /* @__PURE__ */ n("p", {
658
+ className: "text-pho-description text-xs",
659
+ children: t
660
+ }) : null]
661
+ }), /* @__PURE__ */ n("div", {
662
+ className: u("flex w-full min-w-0 items-center gap-2 sm:w-auto", i && "sm:w-full"),
663
+ children: c
664
+ })]
665
+ });
666
+ }
667
+ function on({ className: e, ...t }) {
668
+ return /* @__PURE__ */ n("p", {
669
+ className: u("text-pho-description max-w-full min-w-0 truncate text-base", e),
670
+ ...t
671
+ });
672
+ }
673
+ function cn({ error: e, show: t, className: a, children: i, ...r }) {
674
+ const c = O(), o = _(q), l = e ?? o?.error ?? void 0;
675
+ return /* @__PURE__ */ n(X, {
676
+ initial: !1,
677
+ children: (t ?? !0) && (l != null || i != null) ? /* @__PURE__ */ n(A.div, {
678
+ "data-basic-page-alert": "",
679
+ className: "overflow-hidden",
680
+ initial: {
681
+ height: 0,
682
+ opacity: 0
683
+ },
684
+ animate: {
685
+ height: "auto",
686
+ opacity: 1
687
+ },
688
+ exit: {
689
+ height: 0,
690
+ opacity: 0
691
+ },
692
+ transition: c ? { duration: 0 } : {
693
+ height: S,
694
+ opacity: B
695
+ },
696
+ children: /* @__PURE__ */ n(at, {
697
+ error: l,
698
+ className: u("px-5 pb-3", a),
699
+ ...r,
700
+ children: i
701
+ })
702
+ }) : null
703
+ });
704
+ }
705
+ function ea() {
706
+ return _(q)?.requestSave ?? null;
707
+ }
708
+ var ta = 800, oe = ct.createToastManager(), q = V(null);
709
+ function un({ action: e, errors: t, autoSave: a = !1, className: i, children: r, onChange: c, onBlur: o, ...l }) {
710
+ const [s, d] = v(!1), [f, p] = v(!1), [m, h] = v(null), [g, y] = v(t ?? {}), [T, E] = v(null), P = N(null), x = N(null), L = N(null), M = N(!1), I = N(!1), R = N(null), D = N(async () => {
711
+ });
712
+ k(() => () => {
713
+ x.current != null && clearTimeout(x.current);
714
+ }, []);
715
+ const $ = async () => {
716
+ const w = P.current;
717
+ if (w == null || e == null) return;
718
+ if (M.current) {
719
+ I.current = !0;
720
+ return;
721
+ }
722
+ if (!w.checkValidity()) return;
723
+ const C = Object.fromEntries(new FormData(w).entries()), J = L.current;
724
+ M.current = !0, E({
725
+ field: J,
726
+ phase: "saving"
727
+ }), h(null);
728
+ try {
729
+ const F = (await e(C))?.errors;
730
+ if (F != null && Object.keys(F).length > 0) {
731
+ y(F), E(null);
732
+ return;
733
+ }
734
+ y({}), p(!1), E({
735
+ field: J,
736
+ phase: "saved"
737
+ }), R.current != null && (oe.close(R.current), R.current = null);
738
+ } catch (F) {
739
+ E(null), h(F), R.current != null && oe.close(R.current), R.current = oe.add({
740
+ type: "error",
741
+ title: "Couldn't save",
742
+ description: F instanceof Error && F.message !== "" ? F.message : "The change is still here — try again.",
743
+ timeout: 0,
744
+ actionProps: {
745
+ children: "Retry",
746
+ onClick: () => {
747
+ D.current();
748
+ }
749
+ }
750
+ });
751
+ } finally {
752
+ M.current = !1, I.current && (I.current = !1, D.current());
753
+ }
754
+ };
755
+ D.current = $;
756
+ const Q = () => {
757
+ x.current != null && clearTimeout(x.current), x.current = setTimeout(() => {
758
+ x.current = null, D.current();
759
+ }, 800);
760
+ }, U = z(() => a ? (w) => {
761
+ w != null && (L.current = w), p(!0), Q();
762
+ } : null, [a]), H = z(() => ({
763
+ pending: s,
764
+ dirty: f,
765
+ error: m,
766
+ auto: T,
767
+ requestSave: U
768
+ }), [
769
+ s,
770
+ f,
771
+ m,
772
+ T,
773
+ U
774
+ ]);
775
+ return /* @__PURE__ */ n(q.Provider, {
776
+ value: H,
777
+ children: /* @__PURE__ */ n(dt, {
778
+ errors: g,
779
+ onFormSubmit: async (w) => {
780
+ if (e != null) {
781
+ d(!0), h(null);
782
+ try {
783
+ const C = (await e(w))?.errors;
784
+ if (C != null && Object.keys(C).length > 0) {
785
+ y(C);
786
+ return;
787
+ }
788
+ y({}), p(!1);
789
+ } catch (C) {
790
+ h(C);
791
+ } finally {
792
+ d(!1);
793
+ }
794
+ }
795
+ },
796
+ onChange: (w) => {
797
+ p(!0), h(null);
798
+ const C = w.target.name;
799
+ C && C in g && y((J) => {
800
+ const { [C]: F, ...Ue } = J;
801
+ return Ue;
802
+ }), a && (C && (L.current = C), Q()), c?.(w);
803
+ },
804
+ onBlur: (w) => {
805
+ a && f && x.current != null && (clearTimeout(x.current), x.current = null, D.current()), o?.(w);
806
+ },
807
+ className: u("contents [[data-basic-page-stack]>&]:flex [[data-basic-page-stack]>&]:min-w-0 [[data-basic-page-stack]>&]:flex-col", i),
808
+ ...l,
809
+ ref: (w) => {
810
+ P.current = w;
811
+ const C = l.ref;
812
+ typeof C == "function" ? C(w) : C != null && (C.current = w);
813
+ },
814
+ children: /* @__PURE__ */ n("fieldset", {
815
+ disabled: s,
816
+ "aria-busy": s || void 0,
817
+ className: "contents",
818
+ children: r
819
+ })
820
+ })
821
+ });
822
+ }
823
+ function dn({ name: e, className: t, ...a }) {
824
+ const i = _(q), r = O(), c = i?.auto ?? null, o = c != null && (e == null || c.field === e), [l, s] = v(!1), d = o ? c.phase : null;
825
+ k(() => {
826
+ if (d !== "saved") return;
827
+ s(!0);
828
+ const m = setTimeout(() => s(!1), 1800);
829
+ return () => clearTimeout(m);
830
+ }, [d, c]);
831
+ const f = d === "saving" ? "Saving…" : d === "saved" && l ? "Saved" : null, p = r ? "blur(0px)" : `blur(${Oe}px)`;
832
+ return /* @__PURE__ */ n("span", {
833
+ className: "grid justify-items-end",
834
+ children: /* @__PURE__ */ n(X, {
835
+ initial: !1,
836
+ children: f != null && /* @__PURE__ */ n(A.output, {
837
+ initial: {
838
+ opacity: 0,
839
+ filter: p
840
+ },
841
+ animate: {
842
+ opacity: 1,
843
+ filter: "blur(0px)"
844
+ },
845
+ exit: {
846
+ opacity: 0,
847
+ filter: p
848
+ },
849
+ transition: ye,
850
+ className: u("text-pho-description pl-8 [grid-area:1/1]", t),
851
+ style: { background: "linear-gradient(to left, var(--background-color-pho-primary) calc(100% - 2rem), transparent)" },
852
+ ...a,
853
+ children: f
854
+ }, f)
855
+ })
856
+ });
857
+ }
858
+ var pn = "flex min-w-0 flex-col gap-5 p-5 [&>[data-basic-page-alert]]:-mx-5 [&>[data-basic-page-alert]]:-mt-2 [&>[data-basic-page-alert]]:-mb-5 [&>[data-basic-page-footer]]:pr-0 [&>[data-basic-page-reveal]]:flex [&>[data-basic-page-reveal]]:flex-col [&>[data-basic-page-reveal]]:gap-5";
859
+ function fn({ className: e, ...t }) {
860
+ const a = N(null);
861
+ return $e(a, "Fields", 20, () => null), /* @__PURE__ */ n("div", {
862
+ "data-basic-page-fields": "",
863
+ className: u(me, pn, e),
864
+ ...t,
865
+ ref: (i) => {
866
+ a.current = i;
867
+ const r = t.ref;
868
+ typeof r == "function" ? r(i) : r != null && (r.current = i);
869
+ }
870
+ });
871
+ }
872
+ function mn({ className: e, ...t }) {
873
+ return /* @__PURE__ */ n("div", {
874
+ className: u("flex min-w-0 flex-col gap-5 *:min-w-0 sm:flex-row sm:gap-3 sm:*:flex-1", e),
875
+ ...t
876
+ });
877
+ }
878
+ function hn({ children: e = "Save changes", ...t }) {
879
+ const a = _(q);
880
+ return /* @__PURE__ */ n(ae, {
881
+ type: "submit",
882
+ variant: "effect",
883
+ size: "sm",
884
+ loading: a?.pending,
885
+ ...t,
886
+ children: e
887
+ });
888
+ }
889
+ function gn({ show: e, className: t, ...a }) {
890
+ const i = _(q), r = e === "dirty" ? i?.dirty ?? !1 : e, c = /* @__PURE__ */ n("div", {
891
+ "data-basic-page-footer": "",
892
+ className: u("flex items-center justify-end gap-3 pr-[calc(1.25rem+2.5px)]", t),
893
+ ...a
894
+ });
895
+ return r === void 0 ? c : /* @__PURE__ */ n(We, {
896
+ show: r,
897
+ gap: "block",
898
+ clip: !1,
899
+ children: c
900
+ });
901
+ }
902
+ var vn = {
903
+ stack: "-2.5rem",
904
+ block: "-0.75rem",
905
+ fields: "-1.25rem",
906
+ none: "0px"
907
+ };
908
+ function We({ show: e, clip: t = !0, gap: a = "stack", dividers: i, className: r, ...c }) {
909
+ const o = O(), l = vn[i ? "none" : a], s = N(null), d = N(e !== !0);
910
+ k(() => {
911
+ d.current = !0;
912
+ }, []);
913
+ const f = () => {
914
+ t && s.current && (s.current.style.overflow = "hidden");
915
+ }, p = () => {
916
+ s.current && (s.current.style.overflow = "");
917
+ };
918
+ return e === void 0 ? /* @__PURE__ */ n(A.div, {
919
+ initial: o ? !1 : {
920
+ opacity: 0,
921
+ y: K
922
+ },
923
+ animate: {
924
+ opacity: 1,
925
+ y: 0
926
+ },
927
+ transition: {
928
+ y: S,
929
+ opacity: B
930
+ },
931
+ className: u(i && te, r),
932
+ ...c
933
+ }) : /* @__PURE__ */ n(X, {
934
+ initial: !1,
935
+ children: e ? /* @__PURE__ */ n(A.div, {
936
+ "data-basic-page-reveal": "",
937
+ ref: (m) => {
938
+ s.current = m, t && m && d.current && (m.style.overflow = "hidden");
939
+ },
940
+ onAnimationStart: f,
941
+ onAnimationComplete: p,
942
+ initial: {
943
+ height: 0,
944
+ opacity: 0,
945
+ marginTop: l
946
+ },
947
+ animate: {
948
+ height: "auto",
949
+ opacity: 1,
950
+ marginTop: 0
951
+ },
952
+ exit: {
953
+ height: 0,
954
+ opacity: 0,
955
+ marginTop: l
956
+ },
957
+ transition: o ? { duration: 0 } : {
958
+ height: S,
959
+ marginTop: S,
960
+ opacity: B
961
+ },
962
+ className: u(i && te, r),
963
+ ...c
964
+ }) : null
965
+ });
966
+ }
967
+ var yn = "top-4 left-5 h-8 text-base [&>svg]:size-[1.125em] [&>svg]:shrink-0", bn = "(min-width: 40rem)";
968
+ function xn() {
969
+ return typeof window < "u" && typeof window.matchMedia == "function" && !window.matchMedia(bn).matches;
970
+ }
971
+ var Xe = V(null);
972
+ function Ke({ className: e, children: t, ...a }) {
973
+ const i = re.toArray(t).filter(ft), r = i.map((P) => P.props.children ?? null), c = Fe();
974
+ Dt(r);
975
+ const [o] = v(xn), l = O(), s = i.length, d = Ie(), f = !o && s >= wn, p = _(ge), m = s > 0 ? i[s - 1]?.props : null, h = m?.children ?? "Back", g = m?.href, y = m?.onClick;
976
+ G(() => {
977
+ if (!(p == null || g == null))
978
+ return p.setTail({
979
+ label: h,
980
+ href: g,
981
+ onClick: y
982
+ }), () => p.setTail(null);
983
+ }, [
984
+ p,
985
+ h,
986
+ g,
987
+ y
988
+ ]);
989
+ const [T, E] = v(!l && !o && c != null && c.labels.length > s);
990
+ return /* @__PURE__ */ n("nav", {
991
+ "aria-label": "Breadcrumb",
992
+ "data-basic-page-back": "",
993
+ className: u("absolute top-4 left-3 flex min-w-max items-center", e),
994
+ ...a,
995
+ children: /* @__PURE__ */ b("ol", {
996
+ className: "m-0 flex list-none items-center p-0",
997
+ children: [i.map((P, x) => f && x > 0 && x < s - 2 ? null : /* @__PURE__ */ b(pt, { children: [f && x === s - 2 && /* @__PURE__ */ b("li", {
998
+ className: "m-0 flex items-center max-sm:hidden",
999
+ children: [/* @__PURE__ */ n("span", {
1000
+ "aria-hidden": !0,
1001
+ className: ue,
1002
+ children: ne
1003
+ }), /* @__PURE__ */ b(j.Root, { children: [/* @__PURE__ */ n(j.Trigger, { render: /* @__PURE__ */ n(ae, {
1004
+ variant: "ghost",
1005
+ size: "sm",
1006
+ "aria-label": "Hidden pages",
1007
+ className: "px-2",
1008
+ children: Nn
1009
+ }) }), /* @__PURE__ */ n(j.Portal, { children: /* @__PURE__ */ n(j.Positioner, {
1010
+ align: "start",
1011
+ sideOffset: 4,
1012
+ children: /* @__PURE__ */ n(j.Popup, { children: i.slice(1, s - 2).map((L, M) => {
1013
+ const I = L.props;
1014
+ return /* @__PURE__ */ n(j.LinkItem, {
1015
+ render: /* @__PURE__ */ n(d, {
1016
+ href: I.href,
1017
+ onClick: I.onClick
1018
+ }),
1019
+ children: I.children ?? "Back"
1020
+ }, L.key ?? M);
1021
+ }) })
1022
+ }) })] })]
1023
+ }), /* @__PURE__ */ n("li", {
1024
+ className: u("m-0 flex items-center", x < s - 1 && "max-sm:hidden"),
1025
+ children: /* @__PURE__ */ n(Xe.Provider, {
1026
+ value: {
1027
+ index: x,
1028
+ count: s,
1029
+ departing: c,
1030
+ narrow: o
1031
+ },
1032
+ children: P
1033
+ })
1034
+ })] }, P.key ?? x)), T && /* @__PURE__ */ n("li", {
1035
+ "aria-hidden": !0,
1036
+ className: "m-0 flex items-center max-sm:hidden",
1037
+ children: /* @__PURE__ */ n(A.span, {
1038
+ initial: { opacity: 1 },
1039
+ animate: { opacity: 0 },
1040
+ transition: He,
1041
+ onAnimationComplete: () => E(!1),
1042
+ className: ue,
1043
+ children: ne
1044
+ })
1045
+ })]
1046
+ })
1047
+ });
1048
+ }
1049
+ var ue = "text-pho-description -mx-1 inline-flex shrink-0 text-base select-none", ne = "/", wn = 4, Nn = "…";
1050
+ function qe({ href: e, className: t, morphId: a, children: i = "Back", ...r }) {
1051
+ const c = _(Xe), o = O(), l = a != null && !o, s = Ge(l ? a : void 0);
1052
+ if (c == null) throw new Error("BasicPage.Crumb must be rendered inside BasicPage.Breadcrumbs");
1053
+ const { index: d, count: f, departing: p, narrow: m } = c, h = d === 0, g = d === f - 1, y = p != null && p.labels.length < f, T = p != null && p.labels.length > f, E = g && (p == null || y || m), P = h || g, x = h && g ? "" : h ? "max-sm:hidden" : "sm:hidden", L = p != null, M = g ? m ? T ? "slide" : "fade" : E ? "fade" : void 0 : void 0, [I, R] = v(l && m && s.fly && p != null && !T ? p.labels[p.labels.length - 1] : null), D = l && P && !L, $ = l && !h && g && (p == null || y);
1054
+ return /* @__PURE__ */ b(Be, { children: [!h && /* @__PURE__ */ n("span", {
1055
+ "aria-hidden": !0,
1056
+ className: u(ue, "max-sm:hidden"),
1057
+ children: $ ? /* @__PURE__ */ n(A.span, {
1058
+ initial: s.fly ? {
1059
+ opacity: 0,
1060
+ x: Ee
1061
+ } : { opacity: 0 },
1062
+ animate: s.fly ? {
1063
+ opacity: 1,
1064
+ x: 0
1065
+ } : { opacity: 1 },
1066
+ transition: s.fly ? _e : B,
1067
+ className: "inline-flex",
1068
+ children: ne
1069
+ }) : ne
1070
+ }), /* @__PURE__ */ n(de, {
1071
+ variant: "ghost",
1072
+ size: "sm",
1073
+ href: e,
1074
+ prefix: P ? D ? /* @__PURE__ */ n(A.span, {
1075
+ initial: s.fly ? {
1076
+ opacity: 0,
1077
+ x: Ee
1078
+ } : { opacity: 0 },
1079
+ animate: s.fly ? {
1080
+ opacity: 1,
1081
+ x: 0
1082
+ } : { opacity: 1 },
1083
+ transition: s.fly ? _e : B,
1084
+ className: u("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1085
+ children: /* @__PURE__ */ n(ee, {})
1086
+ }) : /* @__PURE__ */ n("span", {
1087
+ className: u("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1088
+ children: /* @__PURE__ */ n(ee, {})
1089
+ }) : /* @__PURE__ */ n("span", { className: "hidden" }),
1090
+ className: u("min-w-max", t),
1091
+ ...r,
1092
+ children: l && a != null ? /* @__PURE__ */ b("span", {
1093
+ className: u("relative block", !s.fly && M === "slide" && "overflow-hidden", !g && "max-w-40 truncate"),
1094
+ children: [/* @__PURE__ */ n(ze, {
1095
+ morphId: a,
1096
+ fromClassName: "text-pho-primary",
1097
+ fly: s.fly,
1098
+ morphRef: s.ref,
1099
+ arrival: M,
1100
+ children: i
1101
+ }), I != null && /* @__PURE__ */ n(A.span, {
1102
+ "aria-hidden": !0,
1103
+ initial: {
1104
+ x: 0,
1105
+ opacity: 1
1106
+ },
1107
+ animate: {
1108
+ x: Lt,
1109
+ opacity: 0
1110
+ },
1111
+ transition: Bt,
1112
+ onAnimationComplete: () => R(null),
1113
+ className: "pointer-events-none absolute inset-y-0 left-0 whitespace-nowrap",
1114
+ children: I
1115
+ })]
1116
+ }) : /* @__PURE__ */ n("span", {
1117
+ className: u("block", !g && "max-w-40 truncate"),
1118
+ children: i
1119
+ })
1120
+ })] });
1121
+ }
1122
+ function An({ className: e, ...t }) {
1123
+ return /* @__PURE__ */ n(Ke, {
1124
+ className: e,
1125
+ children: /* @__PURE__ */ n(qe, { ...t })
1126
+ });
1127
+ }
1128
+ function Cn({ label: e, description: t, leading: a, href: i, className: r, children: c, ...o }) {
1129
+ const l = Ie(), s = z(() => A.create(l), [l]), { leaving: d, ...f } = xe();
1130
+ return /* @__PURE__ */ b(s, {
1131
+ href: i,
1132
+ ...f,
1133
+ ...o,
1134
+ className: u("flex min-h-[4.25rem] min-w-0 flex-row items-center justify-between gap-6 px-5 py-4", "group outline-pho-brand hover:bg-pho-primary-hover cursor-pointer transition-colors focus-visible:outline-2 focus-visible:-outline-offset-2", "aria-[current=page]:bg-pho-primary-hover", "first:rounded-t-[calc(var(--radius-base)-1px)] last:rounded-b-[calc(var(--radius-base)-1px)]", d && "overflow-hidden", r),
1135
+ children: [/* @__PURE__ */ b("div", {
1136
+ className: u("flex min-w-0 flex-1 items-center", a != null && "gap-3"),
1137
+ children: [a, /* @__PURE__ */ b("div", {
1138
+ className: "min-w-0",
1139
+ children: [/* @__PURE__ */ n("div", {
1140
+ className: "flex min-w-0 items-center gap-1",
1141
+ children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ n("p", {
1142
+ className: "text-pho-primary truncate text-base font-medium",
1143
+ children: e
1144
+ }) : e
1145
+ }), t ? /* @__PURE__ */ n("div", {
1146
+ className: "text-pho-description truncate text-xs",
1147
+ children: t
1148
+ }) : null]
1149
+ })]
1150
+ }), /* @__PURE__ */ b("div", {
1151
+ className: "flex min-w-0 items-center justify-end gap-2",
1152
+ children: [c != null ? /* @__PURE__ */ n("div", {
1153
+ className: "min-w-0",
1154
+ children: c
1155
+ }) : null, /* @__PURE__ */ n(vt, {
1156
+ "aria-hidden": !0,
1157
+ className: "text-pho-secondary group-hover:text-pho-secondary-hover size-4 shrink-0 transition-colors"
1158
+ })]
1159
+ })]
1160
+ });
1161
+ }
1162
+ function En({ open: e, variant: t = "overlay", modal: a = !1, placeholder: i, onClose: r, children: c }) {
1163
+ const o = _(Me), l = e ?? re.toArray(c).length > 0, s = o?.setOpen, d = o?.setPresent;
1164
+ return G(() => {
1165
+ if (d != null)
1166
+ return d(!0), () => d(!1);
1167
+ }, [d]), G(() => {
1168
+ if (s != null)
1169
+ return s(l), () => s(!1);
1170
+ }, [s, l]), k(() => {
1171
+ o == null && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn("BasicPage.Aside: needs a `BasicPage.Root` around it.");
1172
+ }, [o]), o == null || o.slot == null ? null : o.presentation === "page" ? Ne(l ? /* @__PURE__ */ n("div", {
1173
+ "data-basic-page-aside": "page",
1174
+ className: "flex min-w-0 flex-1 flex-col",
1175
+ children: c
1176
+ }) : null, o.slot) : t === "inline" ? Ne(/* @__PURE__ */ n(_n, {
1177
+ width: o.width,
1178
+ paneHeight: o.paneHeight,
1179
+ onClose: r,
1180
+ open: l,
1181
+ placeholder: i,
1182
+ children: c
1183
+ }), o.slot) : /* @__PURE__ */ n(Rn, {
1184
+ container: o.slot,
1185
+ width: o.width,
1186
+ paneHeight: o.paneHeight,
1187
+ onClose: r,
1188
+ open: l,
1189
+ modal: a,
1190
+ children: c
1191
+ });
1192
+ }
1193
+ function Ye() {
1194
+ const [e, t] = v(null), a = z(() => ({ setBack: t }), []), i = N(null);
1195
+ return {
1196
+ back: e,
1197
+ panel: a,
1198
+ closeRef: i,
1199
+ leave: Le(() => {
1200
+ const r = i.current?.querySelector("a, button");
1201
+ return r == null ? !1 : (r.click(), !0);
1202
+ }, [])
1203
+ };
1204
+ }
1205
+ var Pe = {
1206
+ variant: "ghost",
1207
+ size: "sm",
1208
+ svgOnly: !0,
1209
+ "aria-label": "Close",
1210
+ children: /* @__PURE__ */ n(ot, {})
1211
+ };
1212
+ function Qe({ back: e, onClose: t, closeRef: a, panel: i, children: r }) {
1213
+ return /* @__PURE__ */ b(Be, { children: [/* @__PURE__ */ n("span", {
1214
+ ref: a,
1215
+ className: "absolute top-2 right-2 z-30",
1216
+ children: e != null ? /* @__PURE__ */ n(de, {
1217
+ ...Pe,
1218
+ href: e.href,
1219
+ onClick: e.onClick
1220
+ }) : t != null ? /* @__PURE__ */ n(ae, {
1221
+ ...Pe,
1222
+ onClick: t
1223
+ }) : null
1224
+ }), /* @__PURE__ */ b(Y.Root, {
1225
+ className: "min-h-0 flex-1",
1226
+ children: [/* @__PURE__ */ n(Y.Viewport, { children: /* @__PURE__ */ n(Y.Content, {
1227
+ className: "flex min-h-full flex-col",
1228
+ children: /* @__PURE__ */ n(De.Provider, {
1229
+ value: i,
1230
+ children: r
1231
+ })
1232
+ }) }), /* @__PURE__ */ n(Y.Scrollbar, { children: /* @__PURE__ */ n(Y.Thumb, {}) })]
1233
+ })] });
1234
+ }
1235
+ function _n({ width: e, paneHeight: t, onClose: a, open: i, placeholder: r, children: c }) {
1236
+ const o = O(), { back: l, panel: s, closeRef: d, leave: f } = Ye(), p = o ? "blur(0px)" : `blur(${Oe}px)`, m = t ?? "100dvh";
1237
+ k(() => {
1238
+ const g = (y) => {
1239
+ y.key !== "Escape" || y.defaultPrevented || f() && y.preventDefault();
1240
+ };
1241
+ return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
1242
+ }, [f]);
1243
+ const h = {
1244
+ initial: {
1245
+ opacity: 0,
1246
+ filter: p
1247
+ },
1248
+ animate: {
1249
+ opacity: 1,
1250
+ filter: "blur(0px)"
1251
+ },
1252
+ exit: {
1253
+ opacity: 0,
1254
+ filter: p
1255
+ },
1256
+ transition: o ? { duration: 0 } : ye
1257
+ };
1258
+ return /* @__PURE__ */ n("aside", {
1259
+ "data-basic-page-aside": "panel",
1260
+ "data-basic-page-aside-variant": "inline",
1261
+ className: "relative flex shrink-0 flex-col",
1262
+ style: {
1263
+ width: e,
1264
+ minHeight: m
1265
+ },
1266
+ children: /* @__PURE__ */ n("div", {
1267
+ className: "border-pho-secondary bg-pho-primary sticky top-0 grid border-l *:min-h-0 *:[grid-area:1/1]",
1268
+ style: { height: m },
1269
+ children: /* @__PURE__ */ n(X, {
1270
+ initial: !1,
1271
+ children: i ? /* @__PURE__ */ n(A.div, {
1272
+ ...h,
1273
+ className: "relative flex flex-col",
1274
+ children: /* @__PURE__ */ n(Qe, {
1275
+ back: l,
1276
+ onClose: a,
1277
+ closeRef: d,
1278
+ panel: s,
1279
+ children: c
1280
+ })
1281
+ }, "page") : /* @__PURE__ */ n(A.div, {
1282
+ ...h,
1283
+ className: "flex flex-col",
1284
+ children: r
1285
+ }, "empty")
1286
+ })
1287
+ })
1288
+ });
1289
+ }
1290
+ function Rn({ container: e, width: t, paneHeight: a, onClose: i, open: r, modal: c, children: o }) {
1291
+ const { back: l, panel: s, closeRef: d, leave: f } = Ye(), p = a ?? "100dvh";
1292
+ return /* @__PURE__ */ n(Z.Root, {
1293
+ open: r,
1294
+ modal: c ? "trap-focus" : !1,
1295
+ disablePointerDismissal: !0,
1296
+ onOpenChange: (m, h) => {
1297
+ m || (h.cancel(), f());
1298
+ },
1299
+ children: /* @__PURE__ */ b(Z.Portal, {
1300
+ container: e,
1301
+ className: "contents",
1302
+ children: [c ? /* @__PURE__ */ n(Z.Backdrop, {
1303
+ "data-basic-page-aside-backdrop": "",
1304
+ className: u("bg-pho-overlay absolute inset-0 z-30 transition-opacity duration-200 ease-out motion-reduce:transition-none", "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"),
1305
+ onClick: f
1306
+ }) : null, /* @__PURE__ */ n(Z.Popup, {
1307
+ "data-basic-page-aside": "panel",
1308
+ "data-basic-page-aside-variant": "overlay",
1309
+ initialFocus: c ? void 0 : !1,
1310
+ finalFocus: c ? void 0 : !1,
1311
+ className: u("absolute inset-y-0 right-0 z-30 flex flex-col outline-none", "transition-[translate,opacity] duration-250 ease-out motion-reduce:transition-none", "data-[ending-style]:translate-x-3 data-[ending-style]:opacity-0 data-[ending-style]:duration-200 data-[starting-style]:translate-x-3 data-[starting-style]:opacity-0"),
1312
+ style: { width: t },
1313
+ children: /* @__PURE__ */ n("div", {
1314
+ className: "border-pho-secondary bg-pho-primary shadow-pho-xl sticky top-0 flex flex-col border-l",
1315
+ style: { height: p },
1316
+ children: /* @__PURE__ */ n(Qe, {
1317
+ back: l,
1318
+ onClose: i,
1319
+ closeRef: d,
1320
+ panel: s,
1321
+ children: o
1322
+ })
1323
+ })
1324
+ })]
1325
+ })
1326
+ });
1327
+ }
1328
+ var Sn = "14rem";
1329
+ function kn({ variant: e = "box", className: t, ...a }) {
1330
+ const i = _(pe), r = fe(i?.subscribe ?? ve, () => i?.get().api ?? null, () => null);
1331
+ k(() => {
1332
+ if (i != null)
1333
+ return i.adopt(!0), () => i.adopt(!1);
1334
+ }, [i]);
1335
+ const [c, o] = v("folded"), l = N(null), s = () => o("open"), d = () => {
1336
+ o("closing"), window.setTimeout(() => o((p) => p === "closing" ? "folded" : p), 250);
1337
+ };
1338
+ k(() => {
1339
+ c === "open" && l.current?.focus();
1340
+ }, [c]);
1341
+ const f = c !== "folded";
1342
+ return e === "ghost" ? /* @__PURE__ */ n("div", {
1343
+ "data-basic-page-search": "",
1344
+ "data-variant": "ghost",
1345
+ className: u("flex min-w-0 flex-1", r == null && "hidden", t),
1346
+ ...a,
1347
+ children: r != null && /* @__PURE__ */ n(st, {
1348
+ value: r.query,
1349
+ onChange: r.setQuery,
1350
+ placeholder: r.placeholder,
1351
+ "aria-label": r.placeholder,
1352
+ onKeyDown: (p) => {
1353
+ p.key === "Escape" && (p.preventDefault(), r.setQuery(""), p.currentTarget.blur());
1354
+ }
1355
+ })
1356
+ }) : /* @__PURE__ */ n("div", {
1357
+ "data-basic-page-search": "",
1358
+ "data-expanded": c === "open" || void 0,
1359
+ className: u("grid min-w-0 content-center", "[[data-basic-page-header]>&]:col-start-2 [[data-basic-page-header]>&]:row-span-2 [[data-basic-page-header]>&]:row-start-1 [[data-basic-page-header]>&]:ml-4 [[data-basic-page-header]>&]:justify-items-end [[data-basic-page-header]>&]:self-center", r == null && "hidden", t),
1360
+ ...a,
1361
+ children: r != null && /* @__PURE__ */ b("div", {
1362
+ className: u("grid w-9 max-w-full justify-items-end transition-[width] duration-200 ease-linear *:[grid-area:1/1] motion-reduce:transition-none", "@[36rem]:w-56"),
1363
+ style: c === "open" ? { width: Sn } : void 0,
1364
+ children: [/* @__PURE__ */ n(ae, {
1365
+ variant: "outlined",
1366
+ size: "sm",
1367
+ shape: "circle",
1368
+ svgOnly: !0,
1369
+ "aria-label": r.placeholder,
1370
+ onClick: s,
1371
+ className: u("@[36rem]:hidden", f && "hidden"),
1372
+ children: /* @__PURE__ */ n(we, {})
1373
+ }), /* @__PURE__ */ n("div", {
1374
+ className: u("w-full @[36rem]:block", f ? "block" : "hidden"),
1375
+ children: /* @__PURE__ */ b(se.Root, {
1376
+ size: "sm",
1377
+ className: "w-full",
1378
+ children: [/* @__PURE__ */ n(se.Addon, { children: /* @__PURE__ */ n(we, {}) }), /* @__PURE__ */ n(se.Input, {
1379
+ ref: l,
1380
+ type: "search",
1381
+ value: r.query,
1382
+ onChange: (p) => r.setQuery(p.target.value),
1383
+ onBlur: () => {
1384
+ r.query === "" && d();
1385
+ },
1386
+ onKeyDown: (p) => {
1387
+ p.key === "Escape" && (p.preventDefault(), r.setQuery(""), d(), p.currentTarget.blur());
1388
+ },
1389
+ placeholder: r.placeholder,
1390
+ "aria-label": r.placeholder
1391
+ })]
1392
+ })
1393
+ })]
1394
+ })
1395
+ });
1396
+ }
1397
+ var na = {
1398
+ Root: Rt,
1399
+ Aside: En,
1400
+ Search: kn,
1401
+ Table: it,
1402
+ CondenseScope: Ht,
1403
+ Breadcrumbs: Ke,
1404
+ Crumb: qe,
1405
+ Back: An,
1406
+ Title: $t,
1407
+ Stack: qt,
1408
+ Header: Yt,
1409
+ HeaderAction: Qt,
1410
+ SectionTitle: Ut,
1411
+ Description: je,
1412
+ TableCount: Jt,
1413
+ SectionFooter: Zt,
1414
+ Card: en,
1415
+ Item: tn,
1416
+ ItemPanel: nn,
1417
+ Callout: an,
1418
+ CalloutTitle: rn,
1419
+ CalloutDescription: sn,
1420
+ Row: ln,
1421
+ RowLink: Cn,
1422
+ Value: on,
1423
+ Alert: cn,
1424
+ Footer: gn,
1425
+ Form: un,
1426
+ Saved: dn,
1427
+ Fields: fn,
1428
+ Inline: mn,
1429
+ Submit: hn,
1430
+ Reveal: We
1431
+ };
1432
+ export {
1433
+ wt as a,
1434
+ na as c,
1435
+ Ft as d,
1436
+ oe as f,
1437
+ xt as i,
1438
+ ye as l,
1439
+ Zn as m,
1440
+ Ae as n,
1441
+ Nt as o,
1442
+ ea as p,
1443
+ yt as r,
1444
+ bt as s,
1445
+ ta as t,
1446
+ Se as u
1447
+ };
1448
+
1449
+ //# sourceMappingURL=basic-page-BI8y4hHk.js.map