@photon-ai/pho-ui 4.10.0 → 4.12.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 (58) hide show
  1. package/dist/chunks/animated-height-zr7BmFY1.js +56 -0
  2. package/dist/chunks/animated-height-zr7BmFY1.js.map +1 -0
  3. package/dist/chunks/{bar-chart-HsoFFaPb.js → bar-chart-By5gWQqP.js} +2 -2
  4. package/dist/chunks/{bar-chart-HsoFFaPb.js.map → bar-chart-By5gWQqP.js.map} +1 -1
  5. package/dist/chunks/basic-page-CJ11ekjH.js +2217 -0
  6. package/dist/chunks/basic-page-CJ11ekjH.js.map +1 -0
  7. package/dist/chunks/{chart-BrIXaMue.js → chart-Dx3rjeFn.js} +527 -490
  8. package/dist/chunks/chart-Dx3rjeFn.js.map +1 -0
  9. package/dist/chunks/{chat-B0WIgEyM.js → chat-CU3XVm99.js} +2 -2
  10. package/dist/chunks/{chat-B0WIgEyM.js.map → chat-CU3XVm99.js.map} +1 -1
  11. package/dist/chunks/{checkbox-CLPmblNA.js → checkbox-CwvoEJhd.js} +2 -2
  12. package/dist/chunks/{checkbox-CLPmblNA.js.map → checkbox-CwvoEJhd.js.map} +1 -1
  13. package/dist/chunks/choice-card-_Ocs0iUj.js +17 -0
  14. package/dist/chunks/choice-card-_Ocs0iUj.js.map +1 -0
  15. package/dist/chunks/{command-iYvU6Mhf.js → command-D5g49VqR.js} +3 -3
  16. package/dist/chunks/{command-iYvU6Mhf.js.map → command-D5g49VqR.js.map} +1 -1
  17. package/dist/chunks/{data-table-B1dmrN6r.js → data-table-Ce_c6T73.js} +3 -3
  18. package/dist/chunks/{data-table-B1dmrN6r.js.map → data-table-Ce_c6T73.js.map} +1 -1
  19. package/dist/chunks/{dialog-MPvem7yV.js → dialog-ChS0tdHa.js} +120 -116
  20. package/dist/chunks/dialog-ChS0tdHa.js.map +1 -0
  21. package/dist/chunks/{filter-bar-B-oYYBsU.js → filter-bar-CMkvhvgL.js} +2 -2
  22. package/dist/chunks/{filter-bar-B-oYYBsU.js.map → filter-bar-CMkvhvgL.js.map} +1 -1
  23. package/dist/chunks/{input-DjvZoF8v.js → input-fFWvPJOf.js} +2 -1
  24. package/dist/chunks/{input-DjvZoF8v.js.map → input-fFWvPJOf.js.map} +1 -1
  25. package/dist/chunks/{line-chart-Bv25WyGp.js → line-chart-CAe09fqr.js} +2 -2
  26. package/dist/chunks/{line-chart-Bv25WyGp.js.map → line-chart-CAe09fqr.js.map} +1 -1
  27. package/dist/components/bar-chart.js +1 -1
  28. package/dist/components/chart.js +1 -1
  29. package/dist/components/chat.js +1 -1
  30. package/dist/components/checkbox.js +1 -1
  31. package/dist/components/command.js +1 -1
  32. package/dist/components/data-table.js +1 -1
  33. package/dist/components/dialog.js +1 -1
  34. package/dist/components/field.js +34 -29
  35. package/dist/components/field.js.map +1 -1
  36. package/dist/components/filter-bar.js +1 -1
  37. package/dist/components/input.js +1 -1
  38. package/dist/components/line-chart.js +1 -1
  39. package/dist/components/radio-group.js +64 -59
  40. package/dist/components/radio-group.js.map +1 -1
  41. package/dist/index.js +9 -9
  42. package/dist/sections/basic-page.js +2 -2
  43. package/dist/src/components/dialog/dialog.d.ts +9 -1
  44. package/dist/src/components/field/field.d.ts +11 -1
  45. package/dist/src/components/radio-group/radio-card.d.ts +11 -4
  46. package/dist/src/sections/basic-page/basic-page.d.ts +230 -15
  47. package/dist/src/sections/basic-page/index.d.ts +1 -1
  48. package/dist/src/utils/animated-height.d.ts +16 -7
  49. package/dist/src/utils/choice-card.d.ts +8 -1
  50. package/package.json +1 -1
  51. package/dist/chunks/animated-height-I44sUq0n.js +0 -48
  52. package/dist/chunks/animated-height-I44sUq0n.js.map +0 -1
  53. package/dist/chunks/basic-page-DzT8yecB.js +0 -1801
  54. package/dist/chunks/basic-page-DzT8yecB.js.map +0 -1
  55. package/dist/chunks/chart-BrIXaMue.js.map +0 -1
  56. package/dist/chunks/choice-card-BVNP1NB6.js +0 -17
  57. package/dist/chunks/choice-card-BVNP1NB6.js.map +0 -1
  58. package/dist/chunks/dialog-MPvem7yV.js.map +0 -1
@@ -1,1801 +0,0 @@
1
- "use client";
2
- import { t as p } from "./cn-ChIgwEl3.js";
3
- import { n as je } from "./link-provider-DXzDQ08N.js";
4
- import { FADE_ENTRANCE as ha, FADE_SWAP as ga, SPRING_ENTRANCE as ba, TRAVEL_LINEAR as va, fadeThroughBlur as ne } from "../motion.js";
5
- import { a as Z, o as Ne } from "./button-C9VqBBIr.js";
6
- import { t as ya } from "./error-D5SzZ0ev.js";
7
- import { f as xa, p as wa, t as Na } from "./code-block-CbcE994O.js";
8
- import { t as se } from "./IconChevronLeft-CSWMKQ4C.js";
9
- import { t as Aa } from "./IconChevronRight-CzoJnYNI.js";
10
- import { t as Oe } from "./IconSearch-BKAHkLyX.js";
11
- import { a as _a, n as Ca, r as Ae, t as Ea } from "./data-table-B1dmrN6r.js";
12
- import { t as ka } from "./IconX-pZ9vrtSr.js";
13
- import { t as Sa } from "./toast-BACxYsv6.js";
14
- import { t as ge } from "./input-group-fc9_jD4d.js";
15
- import { t as Ra } from "./animated-height-I44sUq0n.js";
16
- import { n as _e, t as J } from "./scroll-area-DSwD9th7.js";
17
- import { i as Ta } from "./checkbox-CLPmblNA.js";
18
- import { t as Pa } from "./form-AiHbbw4m.js";
19
- import { i as Q } from "./menu-BQeprfxB.js";
20
- import { t as Ia } from "./ghost-search-CNVs9k1o.js";
21
- import { t as K } from "./tooltip-BTF7GChl.js";
22
- import { t as Be } from "./description-list-8qm83WZB.js";
23
- import { Children as ee, Fragment as Oa, createContext as G, isValidElement as Ke, useCallback as Ce, useContext as k, useEffect as O, useId as Ba, useLayoutEffect as z, useMemo as V, useRef as E, useState as w, useSyncExternalStore as ue } from "react";
24
- import { Fragment as de, jsx as a, jsxs as y } from "react/jsx-runtime";
25
- import { AnimatePresence as $, motion as A, useIsPresent as La, useReducedMotion as M } from "motion/react";
26
- import { Dialog as re } from "@base-ui/react/dialog";
27
- import { createPortal as Le } from "react-dom";
28
- var Ee = "rounded-base border border-pho-secondary bg-pho-primary", le = "divide-y divide-pho-secondary [&>:has(+[data-basic-page-alert])]:border-b-0", Xe = `${Ee} ${le} gap-0`, Me = "flex min-w-0 flex-col gap-3 rounded-base border border-pho-secondary bg-pho-page p-5", Ma = "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", Da = "flex flex-col gap-3 px-5 py-4", Ha = "-mx-5 -mb-4 flex items-center rounded-b-[calc(0.75rem-1px)] bg-pho-secondary py-1 pr-3 pl-5", Fa = "-mx-2 -mt-1.5 flex items-center rounded-sm bg-pho-secondary px-2 py-0.5", P = ba, D = ha, X = 12, Qe = G(null), za = 768;
29
- function Ga(e, t = "default") {
30
- return Math.round(t === "wide" ? Math.min(Math.max(e * (2 / 3), 448), 768) : Math.min(Math.max(e * 0.4, 320), 448));
31
- }
32
- var Ye = G(null), Ue = G(null);
33
- function Wa(e) {
34
- const [t, n] = w(null), [r, l] = w(!1), [s, u] = w(!1), [d, i] = w(!1), [c, f] = w(() => ({
35
- width: typeof window > "u" ? 0 : window.innerWidth,
36
- height: null
37
- }));
38
- return z(() => {
39
- const o = e.current;
40
- if (!r || o == null) return;
41
- const m = Re(o), h = () => {
42
- const v = o.offsetWidth, N = m?.clientHeight ?? null;
43
- f((b) => b.width === v && b.height === N ? b : {
44
- width: v,
45
- height: N
46
- });
47
- };
48
- if (h(), typeof ResizeObserver > "u") return;
49
- const g = new ResizeObserver(h);
50
- return g.observe(o), m != null && g.observe(m), () => g.disconnect();
51
- }, [e, r]), {
52
- host: V(() => ({
53
- slot: t,
54
- paneNarrow: c.width < za,
55
- paneWidth: c.width,
56
- paneHeight: c.height,
57
- setOpen: u,
58
- setAsPage: i,
59
- setPresent: l
60
- }), [t, c]),
61
- setSlot: n,
62
- open: s,
63
- asPage: d
64
- };
65
- }
66
- function Va(e) {
67
- return e == null ? window.scrollY : e.scrollTop;
68
- }
69
- function De(e, t) {
70
- e == null ? window.scrollTo({ top: t }) : e.scrollTop = t;
71
- }
72
- function $a({ condense: e = !0, width: t, prerendered: n = !1, className: r, children: l, ref: s, ...u }) {
73
- const d = k(ae)?.adopt ?? !1, i = k(Ue), c = e === "pinned", [f, o] = w(!1), m = E(0), h = Ce((q) => {
74
- m.current += q ? 1 : -1, o(m.current > 0);
75
- }, []), g = t === "full" && i == null, v = t === "wide" || t == null && f, [N] = w(_a), b = E(null), _ = V(() => ({
76
- ref: b,
77
- prerendered: n
78
- }), [n]), [x, S] = w(null), [R, I] = w(null);
79
- O(() => {
80
- if (i != null)
81
- return i.setBack(R), () => i.setBack(null);
82
- }, [i, R]);
83
- const { host: B, setSlot: L, open: W, asPage: te } = Wa(b), H = W && te, me = V(() => ({
84
- setTitle: S,
85
- setTail: I,
86
- pinned: c
87
- }), [c]), T = V(() => ({
88
- tail: i == null ? R : null,
89
- silent: H || i != null
90
- }), [
91
- R,
92
- i,
93
- H
94
- ]), C = E(!1), j = E(0);
95
- z(() => {
96
- const q = b.current;
97
- if (H === C.current || q == null) return;
98
- C.current = H;
99
- const he = Re(q);
100
- H ? (j.current = Va(he), De(he, 0)) : De(he, j.current);
101
- }, [H]);
102
- const F = e && !c ? /* @__PURE__ */ a(Je, {
103
- title: x,
104
- tail: i == null ? R : null,
105
- silent: H || i != null
106
- }) : null, fe = /* @__PURE__ */ a("div", {
107
- "data-basic-page-column": "",
108
- className: p("mx-auto flex w-full min-w-0 flex-1 flex-col px-5 pt-12 pb-12 *:min-w-0", i == null && (g ? "px-0 pb-0" : v ? "max-w-[84rem] md:px-8" : "max-w-[44.5rem]"), c ? "pt-0 [&_[data-basic-page-back]]:hidden" : d || i != null ? "[&_[data-basic-page-back]]:hidden" : "has-[[data-basic-page-back]]:pt-16"),
109
- children: e ? /* @__PURE__ */ a(Se.Provider, {
110
- value: me,
111
- children: /* @__PURE__ */ a(aa.Provider, {
112
- value: T,
113
- children: l
114
- })
115
- }) : l
116
- });
117
- return /* @__PURE__ */ a("div", {
118
- "data-basic-page-root": "",
119
- "data-basic-page-width": g ? "full" : v ? "wide" : void 0,
120
- "data-basic-page-prerendered": n ? "" : void 0,
121
- "data-basic-page-pinned": c ? "" : void 0,
122
- className: p("relative flex min-h-full w-full min-w-0 flex-row", r),
123
- ...u,
124
- ref: (q) => {
125
- b.current = q, typeof s == "function" ? s(q) : s != null && (s.current = q);
126
- },
127
- children: /* @__PURE__ */ a(Qe.Provider, {
128
- value: _,
129
- children: /* @__PURE__ */ a(Ye.Provider, {
130
- value: B,
131
- children: /* @__PURE__ */ a(Ca.Provider, {
132
- value: h,
133
- children: /* @__PURE__ */ y(Ae.Provider, {
134
- value: N,
135
- children: [/* @__PURE__ */ y("div", {
136
- "data-basic-page-main": "",
137
- className: p("flex min-w-0 flex-1 flex-col", H && "hidden"),
138
- children: [F, fe]
139
- }), /* @__PURE__ */ a("div", {
140
- ref: L,
141
- className: "contents"
142
- })]
143
- })
144
- })
145
- })
146
- })
147
- });
148
- }
149
- var be = /* @__PURE__ */ new Set();
150
- function Je({ title: e, tail: t, silent: n = !1, pinned: r = !1, className: l }) {
151
- const s = M(), [u, d] = w(() => r || !n && be.size > 0), i = k(ae), c = Ba();
152
- z(() => {
153
- if (!(!u || n))
154
- return be.add(c), () => {
155
- be.delete(c);
156
- };
157
- }, [
158
- c,
159
- u,
160
- n
161
- ]), O(() => {
162
- if (i != null) {
163
- if (n) {
164
- i.store.clear(c);
165
- return;
166
- }
167
- i.store.set(c, {
168
- condensed: u,
169
- title: e?.label ?? null,
170
- back: t
171
- });
172
- }
173
- }, [
174
- i,
175
- c,
176
- u,
177
- e,
178
- t,
179
- n
180
- ]), O(() => {
181
- if (i != null)
182
- return () => i.store.clear(c);
183
- }, [i, c]);
184
- const f = e?.el ?? null;
185
- O(() => {
186
- if (r) return;
187
- if (f == null || typeof IntersectionObserver > "u") {
188
- if (typeof requestAnimationFrame > "u") return;
189
- const g = requestAnimationFrame(() => d(!1));
190
- return () => cancelAnimationFrame(g);
191
- }
192
- const h = new IntersectionObserver(([g]) => d(g != null && !g.isIntersecting), { root: Re(f) });
193
- return h.observe(f), () => h.disconnect();
194
- }, [f, r]);
195
- const o = s ? 0 : -tt, m = s ? "blur(0px)" : `blur(${_e}px)`;
196
- return /* @__PURE__ */ a("div", {
197
- "data-basic-page-condense": "",
198
- className: p("sticky top-0 z-20 h-0 overflow-visible", l),
199
- children: /* @__PURE__ */ a($, {
200
- initial: !1,
201
- children: u && !(i?.adopt ?? !1) && /* @__PURE__ */ y(A.div, {
202
- initial: { opacity: 0 },
203
- animate: { opacity: 1 },
204
- exit: { opacity: 0 },
205
- transition: oe,
206
- 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",
207
- children: [/* @__PURE__ */ a("div", {
208
- className: "flex min-w-0 items-center justify-start",
209
- children: t != null && /* @__PURE__ */ a(Ne, {
210
- variant: "ghost",
211
- size: "sm",
212
- href: t.href,
213
- onClick: t.onClick,
214
- prefix: /* @__PURE__ */ a("span", {
215
- className: "inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0",
216
- children: /* @__PURE__ */ a(se, {})
217
- }),
218
- className: "min-w-max",
219
- children: t.label
220
- })
221
- }), /* @__PURE__ */ a(A.span, {
222
- initial: {
223
- opacity: 0,
224
- y: o,
225
- filter: m
226
- },
227
- animate: {
228
- opacity: 1,
229
- y: 0,
230
- filter: "blur(0px)"
231
- },
232
- exit: {
233
- opacity: 0,
234
- y: o,
235
- filter: m
236
- },
237
- transition: {
238
- ...oe,
239
- y: at
240
- },
241
- className: "text-pho-primary block max-w-full min-w-0 truncate text-center text-base font-medium",
242
- children: e?.label
243
- })]
244
- })
245
- })
246
- });
247
- }
248
- function qa(e) {
249
- return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
250
- }
251
- function ja(e) {
252
- if (!(typeof e != "string" && typeof e != "number"))
253
- return qa(String(e)) || void 0;
254
- }
255
- function ke(e, t) {
256
- if (e !== "")
257
- return e ?? ja(t);
258
- }
259
- var Ka = (e) => `basic-page-morph-${e}`, Xa = { layout: P }, He = 10, Fe = {
260
- delay: 0.2,
261
- duration: 0.12,
262
- ease: "easeOut"
263
- }, Qa = {
264
- duration: 0.18,
265
- ease: "easeOut"
266
- }, Ya = -8, Ua = {
267
- duration: 0.16,
268
- ease: "easeOut"
269
- }, Ja = {
270
- delay: 0.14,
271
- duration: 0.16,
272
- ease: "easeOut"
273
- }, Ze = {
274
- duration: 0.12,
275
- ease: "easeOut"
276
- }, Y = [];
277
- function Za(e) {
278
- const t = E({ labels: e });
279
- t.current.labels = e, z(() => {
280
- const n = t.current;
281
- return Y.push(n), () => {
282
- Y.splice(Y.indexOf(n), 1);
283
- };
284
- }, []);
285
- }
286
- function ea() {
287
- const [e] = w(() => {
288
- const t = Y[Y.length - 1];
289
- return t ? { labels: [...t.labels] } : null;
290
- });
291
- return e;
292
- }
293
- var Se = G(null), aa = G({
294
- tail: null,
295
- silent: !1
296
- }), xe = {
297
- condensed: !1,
298
- title: null,
299
- back: null
300
- }, ae = G(null), pe = () => () => {
301
- }, ze = () => xe;
302
- function et({ adopt: e = !0, children: t }) {
303
- const [n] = w(() => {
304
- let l = xe, s = null;
305
- const u = /* @__PURE__ */ new Set(), d = () => {
306
- for (const i of u) i();
307
- };
308
- return {
309
- get: () => l,
310
- set(i, c) {
311
- s = i, l = c, d();
312
- },
313
- clear(i) {
314
- s === i && (s = null, l = xe, d());
315
- },
316
- subscribe(i) {
317
- return u.add(i), () => u.delete(i);
318
- }
319
- };
320
- }), r = V(() => ({
321
- store: n,
322
- adopt: e
323
- }), [n, e]);
324
- return /* @__PURE__ */ a(ae.Provider, {
325
- value: r,
326
- children: t
327
- });
328
- }
329
- function Bn() {
330
- const e = k(ae);
331
- return ue(e?.store.subscribe ?? pe, e?.store.get ?? ze, e?.store.get ?? ze);
332
- }
333
- var oe = ga, at = va, tt = -8;
334
- function Re(e) {
335
- if (typeof getComputedStyle != "function") return null;
336
- for (let t = e.parentElement; t != null && t !== document.body; t = t.parentElement) {
337
- const { overflowY: n } = getComputedStyle(t);
338
- if (n === "auto" || n === "scroll") return t;
339
- }
340
- return null;
341
- }
342
- var ve = /* @__PURE__ */ new Map(), nt = 96;
343
- function rt(e) {
344
- const t = e.closest("[data-basic-page-root]"), n = t?.querySelector("[data-basic-page-column]");
345
- return !t || !n ? 0 : n.getBoundingClientRect().left - t.getBoundingClientRect().left;
346
- }
347
- function ta(e) {
348
- const [t] = w(() => {
349
- if (e == null) return !1;
350
- const r = ve.get(e);
351
- return r != null && r.visible && r.el.isConnected && rt(r.el) <= nt;
352
- }), n = E(null);
353
- return O(() => {
354
- if (e == null || typeof IntersectionObserver > "u") return;
355
- const r = n.current;
356
- if (!r) return;
357
- const l = new IntersectionObserver(([s]) => {
358
- s && ve.set(e, {
359
- visible: s.isIntersecting,
360
- el: r
361
- });
362
- });
363
- return l.observe(r), () => {
364
- l.disconnect(), ve.delete(e);
365
- };
366
- }, [e]), {
367
- fly: t,
368
- ref: n
369
- };
370
- }
371
- var it = {
372
- fade: {
373
- initial: { opacity: 0 },
374
- animate: { opacity: 1 },
375
- transition: { opacity: D }
376
- },
377
- rise: {
378
- initial: {
379
- opacity: 0,
380
- y: X
381
- },
382
- animate: {
383
- opacity: 1,
384
- y: 0
385
- },
386
- transition: {
387
- y: P,
388
- opacity: D
389
- }
390
- },
391
- slide: {
392
- initial: { x: "-100%" },
393
- animate: { x: 0 },
394
- transition: { x: Ja }
395
- }
396
- };
397
- function na({ morphId: e, fromClassName: t, fly: n, morphRef: r, arrival: l, className: s, children: u }) {
398
- const [d, i] = w(!1), c = !n && l != null ? it[l] : null;
399
- return /* @__PURE__ */ y(A.span, {
400
- ref: r,
401
- layoutId: Ka(e),
402
- initial: c?.initial,
403
- animate: c?.animate,
404
- transition: n ? Xa : {
405
- layout: { duration: 0 },
406
- ...c?.transition
407
- },
408
- onLayoutAnimationStart: () => {
409
- n && i(!0);
410
- },
411
- onLayoutAnimationComplete: () => i(!1),
412
- className: p("relative inline-block", s),
413
- children: [u, d && /* @__PURE__ */ a(A.span, {
414
- "aria-hidden": !0,
415
- initial: { opacity: 1 },
416
- animate: { opacity: 0 },
417
- transition: Qa,
418
- onAnimationComplete: () => i(!1),
419
- className: p("absolute inset-0", t),
420
- children: u
421
- })]
422
- });
423
- }
424
- var Ge = "max-w-full min-w-0 truncate align-top", We = "flex shrink-0 items-center";
425
- function st({ id: e, morphId: t, enter: n, trailing: r, className: l, children: s, ...u }) {
426
- const d = ke(e, s), i = M(), c = Pe(n === !0), f = ta(t), o = ea(), m = !i && (t != null || c === !0), h = c || o != null ? "rise" : void 0, g = k(Se), v = g?.pinned ?? !1, N = k(ae)?.adopt ?? !1, b = k(aa), _ = E(null);
427
- z(() => {
428
- if (!(g == null || v))
429
- return g.setTitle({
430
- label: s,
431
- el: _.current
432
- }), () => g.setTitle(null);
433
- }, [
434
- g,
435
- v,
436
- s
437
- ]);
438
- const [x, S] = w(f.fly && o != null);
439
- z(() => {
440
- Y.length > 0 && S(!1);
441
- }, []);
442
- const R = r != null && r !== !1, I = !i && (t != null ? f.fly || h != null : c === !0), B = t != null && !i ? /* @__PURE__ */ a(na, {
443
- morphId: t,
444
- fromClassName: "text-pho-secondary",
445
- fly: f.fly,
446
- morphRef: f.ref,
447
- arrival: h,
448
- className: Ge,
449
- children: s
450
- }) : c && !i ? /* @__PURE__ */ a(A.span, {
451
- initial: {
452
- opacity: 0,
453
- y: X
454
- },
455
- animate: {
456
- opacity: 1,
457
- y: 0
458
- },
459
- transition: {
460
- y: P,
461
- opacity: D
462
- },
463
- className: p("inline-block", Ge),
464
- children: s
465
- }) : R ? /* @__PURE__ */ a("span", {
466
- className: "min-w-0 truncate",
467
- children: s
468
- }) : s;
469
- return /* @__PURE__ */ y(de, { children: [v && g != null && /* @__PURE__ */ a(Je, {
470
- title: {
471
- label: s,
472
- el: _.current
473
- },
474
- tail: b.tail,
475
- silent: b.silent,
476
- pinned: !0,
477
- className: N ? void 0 : "h-12 shrink-0"
478
- }), /* @__PURE__ */ y("h1", {
479
- id: d,
480
- "data-basic-page-title": "",
481
- className: p("text-display-base text-pho-primary max-w-full min-w-0 scroll-mt-12 px-5 font-medium", m ? "whitespace-nowrap" : "truncate", v && "sr-only", l),
482
- ...u,
483
- ref: (L) => {
484
- _.current = L;
485
- const W = u.ref;
486
- typeof W == "function" ? W(L) : W != null && (W.current = L);
487
- },
488
- children: [R ? /* @__PURE__ */ y("span", {
489
- className: "flex max-w-full min-w-0 items-center gap-2",
490
- children: [B, I ? /* @__PURE__ */ a(A.span, {
491
- "data-basic-page-title-trailing": "",
492
- initial: {
493
- opacity: 0,
494
- y: X
495
- },
496
- animate: {
497
- opacity: 1,
498
- y: 0
499
- },
500
- transition: {
501
- y: P,
502
- opacity: D
503
- },
504
- className: We,
505
- children: r
506
- }) : /* @__PURE__ */ a("span", {
507
- "data-basic-page-title-trailing": "",
508
- className: We,
509
- children: r
510
- })]
511
- }) : B, x && /* @__PURE__ */ a(A.span, {
512
- "aria-hidden": !0,
513
- initial: { opacity: 1 },
514
- animate: { opacity: 0 },
515
- transition: Ze,
516
- onAnimationComplete: () => S(!1),
517
- className: p("text-pho-secondary pointer-events-none absolute inline-flex items-center", $t),
518
- children: /* @__PURE__ */ a(se, {})
519
- })]
520
- })] });
521
- }
522
- var ra = G(!1);
523
- function lt() {
524
- const e = k(ra), t = M(), [n] = w(() => e && !t);
525
- return n;
526
- }
527
- var ot = {
528
- height: 0,
529
- opacity: 0,
530
- paddingTop: 0,
531
- paddingBottom: 0,
532
- borderTopWidth: 0
533
- }, ct = {
534
- y: P,
535
- opacity: D,
536
- height: P,
537
- paddingTop: P,
538
- paddingBottom: P,
539
- borderTopWidth: P
540
- };
541
- function Te() {
542
- const e = lt(), t = La(), n = M();
543
- return {
544
- initial: e ? {
545
- opacity: 0,
546
- y: X
547
- } : !1,
548
- animate: {
549
- opacity: 1,
550
- y: 0
551
- },
552
- exit: ot,
553
- transition: n ? { duration: 0 } : ct,
554
- leaving: !t
555
- };
556
- }
557
- var ut = typeof process < "u" && process.env.NODE_ENV !== "production";
558
- function ia(e, t, n, r) {
559
- O(() => {
560
- if (!ut || e.current == null || typeof getComputedStyle != "function") return;
561
- const l = (u) => {
562
- const d = getComputedStyle(u).rowGap;
563
- return d === "" || d === "normal" ? null : parseFloat(d);
564
- }, s = l(e.current);
565
- s != null && s !== n && console.warn(`[BasicPage.${t}] spaced at ${s}px instead of ${n}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);
566
- for (const u of Array.from(e.current.children)) {
567
- const d = r(u);
568
- if (d == null || getComputedStyle(u).display === "contents") continue;
569
- const i = l(u);
570
- i != null && i !== d && console.warn(`[BasicPage.${t}] a child is spaced at ${i}px instead of ${d}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.`, u);
571
- }
572
- });
573
- }
574
- function dt(e) {
575
- return Array.from(e.querySelectorAll("[data-basic-page-stack], [data-basic-page-title], [data-basic-page-header]")).some((t) => t.closest('[aria-busy="true"]') != null);
576
- }
577
- var pt = () => !1, mt = () => !0;
578
- function ft() {
579
- return ue(pe, pt, mt);
580
- }
581
- function Pe(e, t = !1) {
582
- const n = k(Qe), r = ft(), [l] = w(() => {
583
- if (r || !e || n?.prerendered) return !1;
584
- if (t) return !0;
585
- if (document.querySelector("[data-basic-page-prerendered]") != null) return !1;
586
- const s = n ? n.ref.current : document;
587
- return s == null || !dt(s);
588
- });
589
- return l;
590
- }
591
- function ie({ enter: e, className: t, children: n, ref: r, ...l }) {
592
- const s = M(), u = E(null);
593
- ia(u, "Stack", 40, (m) => m.hasAttribute("data-basic-page-fields") ? 20 : m.hasAttribute("data-basic-page-card") || m.hasAttribute("data-basic-page-onboard") || m.hasAttribute("data-basic-page-header") || m.hasAttribute("data-basic-page-columns") || m.hasAttribute("data-data-table") || m.hasAttribute("data-code-block") ? null : 12);
594
- const d = Pe(e ?? !0, e === !0), i = l["aria-busy"], c = i === !0 || i === "true", f = E(c), o = f.current && !c;
595
- return O(() => {
596
- f.current = c;
597
- }), /* @__PURE__ */ a(A.div, {
598
- ref: (m) => {
599
- u.current = m, typeof r == "function" ? r(m) : r != null && (r.current = m);
600
- },
601
- "data-basic-page-stack": "",
602
- initial: s || !d ? !1 : {
603
- opacity: 0,
604
- y: X
605
- },
606
- animate: {
607
- opacity: 1,
608
- y: 0
609
- },
610
- transition: {
611
- y: P,
612
- opacity: D
613
- },
614
- className: p("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", "[[data-basic-page-pinned]:not([data-basic-page-width=full])_[data-basic-page-column]_&]:mt-3 [[data-basic-page-pinned][data-basic-page-width=full]_[data-basic-page-column]_&]:mt-0", "*:min-w-0 [&>*:not([data-basic-page-fields]):not([data-basic-page-card]):not([data-basic-page-callout]):not([data-basic-page-onboard]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table]):not([data-code-block])]:flex [&>*:not([data-basic-page-fields]):not([data-basic-page-card]):not([data-basic-page-callout]):not([data-basic-page-onboard]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table]):not([data-code-block])]:flex-col [&>*:not([data-basic-page-fields]):not([data-basic-page-card]):not([data-basic-page-callout]):not([data-basic-page-onboard]):not([data-basic-page-header]):not([data-basic-page-columns]):not([data-data-table]):not([data-code-block])]:gap-3", t),
615
- ...l,
616
- children: /* @__PURE__ */ a(ra.Provider, {
617
- value: o,
618
- children: n
619
- })
620
- });
621
- }
622
- var Ve = "@container grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] mb-3 gap-y-0 [&>:not([data-basic-page-search]):not([data-basic-page-header-action])]:col-start-1 [&>:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])):nth-last-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action]))]:row-span-2 [&>:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])):nth-last-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action]))]:self-center [&>:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])):not(:nth-last-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])))]:self-end [&>:not([data-basic-page-search]):not([data-basic-page-header-action]):not(:nth-child(1_of_:not([data-basic-page-search]):not([data-basic-page-header-action])))]:self-start [[data-basic-page-callout]_&]:mb-0 [[data-basic-page-stack]>*>&]:mb-0";
623
- function ht({ enter: e, className: t, ...n }) {
624
- const r = M();
625
- return Pe(e === !0) && !r ? /* @__PURE__ */ a(A.div, {
626
- initial: {
627
- opacity: 0,
628
- y: X
629
- },
630
- animate: {
631
- opacity: 1,
632
- y: 0
633
- },
634
- transition: {
635
- y: P,
636
- opacity: D
637
- },
638
- className: p(Ve, t),
639
- ...n,
640
- "data-basic-page-header": ""
641
- }) : /* @__PURE__ */ a("div", {
642
- className: p(Ve, t),
643
- ...n,
644
- "data-basic-page-header": ""
645
- });
646
- }
647
- function gt({ className: e, ...t }) {
648
- return /* @__PURE__ */ a("div", {
649
- "data-basic-page-header-action": "",
650
- className: p("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]>&]:mr-5 [[data-basic-page-header]>&]:ml-4 [[data-basic-page-header]>&]:self-start [[data-basic-page-header]>&]:justify-self-end", "[[data-basic-page-callout]_[data-basic-page-header]>&]:mr-0", e),
651
- ...t
652
- });
653
- }
654
- function bt({ id: e, className: t, children: n, ...r }) {
655
- const l = ke(e, n);
656
- return /* @__PURE__ */ a("h2", {
657
- id: l,
658
- className: p("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),
659
- ...r,
660
- children: n
661
- });
662
- }
663
- function sa({ className: e, ...t }) {
664
- return /* @__PURE__ */ a("p", {
665
- className: p("text-display-xs text-pho-description px-5 font-normal", e),
666
- ...t
667
- });
668
- }
669
- function vt({ one: e, other: t, ...n }) {
670
- const r = k(Ae), l = ue(r?.subscribe ?? pe, () => r?.get().api ?? null, () => null);
671
- if (l == null) return null;
672
- const s = l.query.trim() !== "" ? `${l.matched} of ${l.total}.` : `${l.total} ${l.total === 1 ? e : t}.`;
673
- return /* @__PURE__ */ a(sa, {
674
- ...n,
675
- children: s
676
- });
677
- }
678
- function yt({ className: e, ...t }) {
679
- return /* @__PURE__ */ a("p", {
680
- className: p("text-pho-description px-5 text-xs font-normal", "mt-3 [[data-basic-page-callout]_&]:mt-0 [[data-basic-page-stack]>*>&]:mt-0", e),
681
- ...t
682
- });
683
- }
684
- function xt({ animateHeight: e, className: t, children: n, ...r }) {
685
- const l = /* @__PURE__ */ a($, { children: ee.toArray(n) });
686
- return e ? /* @__PURE__ */ a("div", {
687
- className: p(Ee, "min-h-0 gap-0", t),
688
- ...r,
689
- "data-basic-page-card": "",
690
- children: /* @__PURE__ */ a(Ra, {
691
- transition: P,
692
- className: le,
693
- children: l
694
- })
695
- }) : /* @__PURE__ */ a("div", {
696
- className: p(Xe, t),
697
- ...r,
698
- "data-basic-page-card": "",
699
- children: l
700
- });
701
- }
702
- function wt({ className: e, ...t }) {
703
- const { leaving: n, ...r } = Te();
704
- return /* @__PURE__ */ a(A.div, {
705
- ...r,
706
- className: p(Da, n && "overflow-hidden", e),
707
- ...t
708
- });
709
- }
710
- function Nt({ divided: e = !1, className: t, ...n }) {
711
- return /* @__PURE__ */ a("div", {
712
- className: p(e ? Fa : Ha, t),
713
- ...n
714
- });
715
- }
716
- function At({ className: e, icon: t, children: n, ...r }) {
717
- if (t == null || t === !1 || t === !0) return /* @__PURE__ */ a("div", {
718
- className: p(Me, e),
719
- ...r,
720
- "data-basic-page-callout": "",
721
- children: n
722
- });
723
- const [l, ...s] = ee.toArray(n);
724
- return /* @__PURE__ */ y("div", {
725
- className: p(Me, e),
726
- ...r,
727
- "data-basic-page-callout": "",
728
- children: [/* @__PURE__ */ y("div", {
729
- className: "relative",
730
- children: [/* @__PURE__ */ a("div", {
731
- className: "min-w-0 pr-16",
732
- children: l
733
- }), /* @__PURE__ */ a("div", {
734
- "aria-hidden": !0,
735
- className: "text-pho-primary pointer-events-none absolute top-0 right-0 size-14 opacity-[0.275] [&>svg]:size-full",
736
- children: t
737
- })]
738
- }), s]
739
- });
740
- }
741
- function _t({ id: e, className: t, children: n, ...r }) {
742
- const l = ke(e, n);
743
- return /* @__PURE__ */ a("h2", {
744
- id: l,
745
- className: p("text-display-xs text-pho-primary max-w-full min-w-0 scroll-mt-12 truncate font-medium", t),
746
- ...r,
747
- children: n
748
- });
749
- }
750
- function Ct({ className: e, ...t }) {
751
- return /* @__PURE__ */ a("p", {
752
- className: p("text-display-xs text-pho-description font-normal", e),
753
- ...t
754
- });
755
- }
756
- var la = G(null), oa = G(!1);
757
- function Et({ className: e, children: t, ...n }) {
758
- let r = !1;
759
- const l = ee.toArray(t).map((s, u) => {
760
- if (!Ke(s)) return s;
761
- let d;
762
- return s.props.done ? d = "done" : r ? d = "upcoming" : (r = !0, d = s.props.working ? "working" : s.props.pending ? "pending" : "current"), /* @__PURE__ */ a(la.Provider, {
763
- value: {
764
- number: u + 1,
765
- state: d
766
- },
767
- children: s
768
- }, s.key ?? u);
769
- });
770
- return /* @__PURE__ */ a("ol", {
771
- className: p(Xe, "m-0 list-none p-0", e),
772
- ...n,
773
- "data-basic-page-onboard": "",
774
- children: l
775
- });
776
- }
777
- var kt = "relative grid size-5 shrink-0 place-items-center rounded-full border text-xs font-medium tabular-nums transition-[background-color,border-color,color] duration-200 ease-out *:[grid-area:1/1]", St = {
778
- done: "border-pho-ink text-pho-primary",
779
- current: "bg-pho-brand-solid text-pho-on-brand border-transparent",
780
- working: "border-transparent text-pho-primary",
781
- pending: "border-pho-ink text-pho-primary border-dashed",
782
- upcoming: "border-pho-primary text-pho-description"
783
- }, Rt = "pointer-events-none absolute -inset-px rounded-full border border-pho-ink opacity-30", Tt = "pointer-events-none absolute -inset-px rounded-full border border-pho-ink border-r-transparent border-b-transparent border-l-transparent animate-pho-spinner", Pt = {
784
- done: "Done.",
785
- working: "In progress.",
786
- pending: "Waiting."
787
- };
788
- function It({ icon: e, aside: t, title: n, description: r, done: l, working: s, pending: u, className: d, children: i, ...c }) {
789
- const f = k(la), o = f?.state ?? (l ? "done" : s ? "working" : u ? "pending" : "current"), m = M(), h = o === "current" || o === "working" || o === "pending", g = o === "upcoming", v = Pt[o], N = i != null && i !== !1, b = e != null && e !== !1, _ = t != null && t !== !1;
790
- return /* @__PURE__ */ a("li", {
791
- "data-basic-page-step": o,
792
- "aria-current": h ? "step" : void 0,
793
- className: p("relative m-0 grid min-w-0 grid-cols-[auto_minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)] items-center gap-x-3 px-5 py-4", "transition-[background-color] duration-200 ease-out first:rounded-t-[calc(0.75rem-1px)] last:rounded-b-[calc(0.75rem-1px)] motion-reduce:transition-none", h && "bg-pho-page", d),
794
- ...c,
795
- children: /* @__PURE__ */ y(oa.Provider, {
796
- value: !0,
797
- children: [
798
- /* @__PURE__ */ y("span", {
799
- "aria-hidden": !0,
800
- className: p(kt, St[o], "col-start-1 row-start-1"),
801
- children: [/* @__PURE__ */ a($, {
802
- initial: !1,
803
- children: o === "done" ? /* @__PURE__ */ a(A.span, {
804
- ...ne(m),
805
- className: "flex",
806
- children: /* @__PURE__ */ a(Ta, { className: "size-3" })
807
- }, "check") : /* @__PURE__ */ a(A.span, {
808
- ...ne(m),
809
- children: f?.number ?? 1
810
- }, "number")
811
- }), o === "working" ? /* @__PURE__ */ y(de, { children: [/* @__PURE__ */ a("span", { className: Rt }), /* @__PURE__ */ a("span", { className: Tt })] }) : null]
812
- }),
813
- /* @__PURE__ */ y("div", {
814
- "data-basic-page-step-title": "",
815
- className: p("text-display-xs col-start-2 row-start-1 min-w-0 font-medium transition-colors duration-200 ease-out", g ? "text-pho-description" : "text-pho-primary"),
816
- children: [v ? /* @__PURE__ */ y("span", {
817
- className: "sr-only",
818
- children: [v, " "]
819
- }) : null, n]
820
- }),
821
- /* @__PURE__ */ a(Ie, {
822
- show: h,
823
- gap: "none",
824
- clip: !1,
825
- className: "col-start-2 row-start-2 flex min-w-0 flex-col self-stretch",
826
- children: /* @__PURE__ */ y("div", {
827
- "data-basic-page-step-body": "",
828
- className: "flex min-w-0 flex-1 flex-col",
829
- children: [r ? /* @__PURE__ */ a("div", {
830
- className: "text-display-xs text-pho-description font-normal",
831
- children: r
832
- }) : null, N ? /* @__PURE__ */ a("div", {
833
- className: "mt-auto flex flex-wrap items-center gap-2 pt-3",
834
- children: i
835
- }) : null]
836
- })
837
- }),
838
- o === "done" && N ? /* @__PURE__ */ a("div", {
839
- className: "col-start-3 row-start-1 flex min-w-0 items-center gap-2",
840
- children: i
841
- }) : _ ? /* @__PURE__ */ a($, {
842
- initial: !1,
843
- children: h ? /* @__PURE__ */ a(A.div, {
844
- ...ne(m),
845
- className: "col-start-3 row-span-2 row-start-1 self-start",
846
- children: t
847
- }, "aside") : null
848
- }) : b ? /* @__PURE__ */ a($, {
849
- initial: !1,
850
- children: h ? /* @__PURE__ */ a(A.div, {
851
- "aria-hidden": !0,
852
- ...ne(m),
853
- className: "pointer-events-none col-start-3 row-span-2 row-start-1 size-14 self-start",
854
- children: /* @__PURE__ */ a("div", {
855
- className: "text-pho-primary size-full opacity-[0.275] [&>svg]:size-full",
856
- children: e
857
- })
858
- }, "icon") : null
859
- }) : null
860
- ]
861
- })
862
- });
863
- }
864
- function Ot({ label: e, description: t, htmlFor: n, stacked: r = !1, className: l, children: s, ...u }) {
865
- const { leaving: d, ...i } = Te();
866
- return /* @__PURE__ */ y(A.div, {
867
- ...i,
868
- className: p(Ma, r && "sm:flex-col sm:items-stretch sm:justify-start sm:gap-3", d && "overflow-hidden", l),
869
- ...u,
870
- children: [/* @__PURE__ */ y("div", {
871
- className: "min-w-0",
872
- children: [n ? /* @__PURE__ */ a("label", {
873
- htmlFor: n,
874
- className: "text-pho-primary block text-base font-normal",
875
- children: e
876
- }) : /* @__PURE__ */ a("div", {
877
- className: "text-pho-primary text-base font-normal",
878
- children: e
879
- }), t ? /* @__PURE__ */ a("p", {
880
- className: "text-pho-description text-xs",
881
- children: t
882
- }) : null]
883
- }), /* @__PURE__ */ a("div", {
884
- className: p("flex w-full min-w-0 items-center gap-2 sm:w-auto", r && "sm:w-full"),
885
- children: s
886
- })]
887
- });
888
- }
889
- function Bt({ className: e, ...t }) {
890
- const n = k(oa);
891
- return /* @__PURE__ */ a("p", {
892
- className: p("text-pho-description max-w-full min-w-0 truncate", n ? "text-display-xs font-normal" : "text-base", e),
893
- ...t
894
- });
895
- }
896
- function Lt({ error: e, show: t, className: n, children: r, ...l }) {
897
- const s = M(), u = k(U), d = e ?? u?.error ?? void 0;
898
- return /* @__PURE__ */ a($, {
899
- initial: !1,
900
- children: (t ?? !0) && (d != null || r != null) ? /* @__PURE__ */ a(A.div, {
901
- "data-basic-page-alert": "",
902
- className: "overflow-hidden",
903
- initial: {
904
- height: 0,
905
- opacity: 0
906
- },
907
- animate: {
908
- height: "auto",
909
- opacity: 1
910
- },
911
- exit: {
912
- height: 0,
913
- opacity: 0
914
- },
915
- transition: s ? { duration: 0 } : {
916
- height: P,
917
- opacity: D
918
- },
919
- children: /* @__PURE__ */ a(ya, {
920
- error: d,
921
- className: p("px-5 pb-3", n),
922
- ...l,
923
- children: r
924
- })
925
- }) : null
926
- });
927
- }
928
- function Ln() {
929
- return k(U)?.requestSave ?? null;
930
- }
931
- var Mn = 800, ye = Sa.createToastManager(), U = G(null);
932
- function Mt({ action: e, errors: t, autoSave: n = !1, className: r, children: l, onChange: s, onBlur: u, ...d }) {
933
- const [i, c] = w(!1), [f, o] = w(!1), [m, h] = w(null), [g, v] = w(t ?? {}), [N, b] = w(null), _ = E(null), x = E(null), S = E(null), R = E(!1), I = E(!1), B = E(null), L = E(async () => {
934
- });
935
- O(() => () => {
936
- x.current != null && clearTimeout(x.current);
937
- }, []);
938
- const W = async () => {
939
- const T = _.current;
940
- if (T == null || e == null) return;
941
- if (R.current) {
942
- I.current = !0;
943
- return;
944
- }
945
- if (!T.checkValidity()) return;
946
- const C = Object.fromEntries(new FormData(T).entries()), j = S.current;
947
- R.current = !0, b({
948
- field: j,
949
- phase: "saving"
950
- }), h(null);
951
- try {
952
- const F = (await e(C))?.errors;
953
- if (F != null && Object.keys(F).length > 0) {
954
- v(F), b(null);
955
- return;
956
- }
957
- v({}), o(!1), b({
958
- field: j,
959
- phase: "saved"
960
- }), B.current != null && (ye.close(B.current), B.current = null);
961
- } catch (F) {
962
- b(null), h(F), B.current != null && ye.close(B.current), B.current = ye.add({
963
- type: "error",
964
- title: "Couldn't save",
965
- description: F instanceof Error && F.message !== "" ? F.message : "The change is still here — try again.",
966
- timeout: 0,
967
- actionProps: {
968
- children: "Retry",
969
- onClick: () => {
970
- L.current();
971
- }
972
- }
973
- });
974
- } finally {
975
- R.current = !1, I.current && (I.current = !1, L.current());
976
- }
977
- };
978
- L.current = W;
979
- const te = () => {
980
- x.current != null && clearTimeout(x.current), x.current = setTimeout(() => {
981
- x.current = null, L.current();
982
- }, 800);
983
- }, H = V(() => n ? (T) => {
984
- T != null && (S.current = T), o(!0), te();
985
- } : null, [n]), me = V(() => ({
986
- pending: i,
987
- dirty: f,
988
- error: m,
989
- auto: N,
990
- requestSave: H
991
- }), [
992
- i,
993
- f,
994
- m,
995
- N,
996
- H
997
- ]);
998
- return /* @__PURE__ */ a(U.Provider, {
999
- value: me,
1000
- children: /* @__PURE__ */ a(Pa, {
1001
- errors: g,
1002
- onFormSubmit: async (T) => {
1003
- if (e != null) {
1004
- c(!0), h(null);
1005
- try {
1006
- const C = (await e(T))?.errors;
1007
- if (C != null && Object.keys(C).length > 0) {
1008
- v(C);
1009
- return;
1010
- }
1011
- v({}), o(!1);
1012
- } catch (C) {
1013
- h(C);
1014
- } finally {
1015
- c(!1);
1016
- }
1017
- }
1018
- },
1019
- onChange: (T) => {
1020
- o(!0), h(null);
1021
- const C = T.target.name;
1022
- C && C in g && v((j) => {
1023
- const { [C]: F, ...fe } = j;
1024
- return fe;
1025
- }), n && (C && (S.current = C), te()), s?.(T);
1026
- },
1027
- onBlur: (T) => {
1028
- n && f && x.current != null && (clearTimeout(x.current), x.current = null, L.current()), u?.(T);
1029
- },
1030
- className: p("contents [[data-basic-page-stack]>&]:flex [[data-basic-page-stack]>&]:min-w-0 [[data-basic-page-stack]>&]:flex-col", r),
1031
- ...d,
1032
- ref: (T) => {
1033
- _.current = T;
1034
- const C = d.ref;
1035
- typeof C == "function" ? C(T) : C != null && (C.current = T);
1036
- },
1037
- children: /* @__PURE__ */ a("fieldset", {
1038
- disabled: i,
1039
- "aria-busy": i || void 0,
1040
- className: "contents",
1041
- children: l
1042
- })
1043
- })
1044
- });
1045
- }
1046
- function Dt({ name: e, className: t, ...n }) {
1047
- const r = k(U), l = M(), s = r?.auto ?? null, u = s != null && (e == null || s.field === e), [d, i] = w(!1), c = u ? s.phase : null;
1048
- O(() => {
1049
- if (c !== "saved") return;
1050
- i(!0);
1051
- const m = setTimeout(() => i(!1), 1800);
1052
- return () => clearTimeout(m);
1053
- }, [c, s]);
1054
- const f = c === "saving" ? "Saving…" : c === "saved" && d ? "Saved" : null, o = l ? "blur(0px)" : `blur(${_e}px)`;
1055
- return /* @__PURE__ */ a("span", {
1056
- className: "grid justify-items-end",
1057
- children: /* @__PURE__ */ a($, {
1058
- initial: !1,
1059
- children: f != null && /* @__PURE__ */ a(A.output, {
1060
- initial: {
1061
- opacity: 0,
1062
- filter: o
1063
- },
1064
- animate: {
1065
- opacity: 1,
1066
- filter: "blur(0px)"
1067
- },
1068
- exit: {
1069
- opacity: 0,
1070
- filter: o
1071
- },
1072
- transition: oe,
1073
- className: p("text-pho-description pl-8 [grid-area:1/1]", t),
1074
- style: { background: "linear-gradient(to left, var(--background-color-pho-primary) calc(100% - 2rem), transparent)" },
1075
- ...n,
1076
- children: f
1077
- }, f)
1078
- })
1079
- });
1080
- }
1081
- var Ht = "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";
1082
- function Ft({ className: e, ...t }) {
1083
- const n = E(null);
1084
- return ia(n, "Fields", 20, () => null), /* @__PURE__ */ a("div", {
1085
- className: p(Ee, Ht, e),
1086
- ...t,
1087
- ref: (r) => {
1088
- n.current = r;
1089
- const l = t.ref;
1090
- typeof l == "function" ? l(r) : l != null && (l.current = r);
1091
- },
1092
- "data-basic-page-fields": ""
1093
- });
1094
- }
1095
- function zt({ className: e, ...t }) {
1096
- return /* @__PURE__ */ a("div", {
1097
- className: p("flex min-w-0 flex-col gap-5 *:min-w-0 sm:flex-row sm:gap-3 sm:*:flex-1", e),
1098
- ...t
1099
- });
1100
- }
1101
- function Gt({ children: e = "Save changes", ...t }) {
1102
- const n = k(U);
1103
- return /* @__PURE__ */ a(Z, {
1104
- type: "submit",
1105
- variant: "effect",
1106
- size: "sm",
1107
- loading: n?.pending,
1108
- ...t,
1109
- children: e
1110
- });
1111
- }
1112
- function Wt({ show: e, className: t, ...n }) {
1113
- const r = k(U), l = e === "dirty" ? r?.dirty ?? !1 : e, s = /* @__PURE__ */ a("div", {
1114
- "data-basic-page-footer": "",
1115
- className: p("flex items-center justify-end gap-3 pr-[calc(1.25rem+2.5px)]", t),
1116
- ...n
1117
- });
1118
- return l === void 0 ? s : /* @__PURE__ */ a(Ie, {
1119
- show: l,
1120
- gap: "block",
1121
- clip: !1,
1122
- children: s
1123
- });
1124
- }
1125
- var Vt = {
1126
- stack: "-2.5rem",
1127
- block: "-0.75rem",
1128
- fields: "-1.25rem",
1129
- none: "0px"
1130
- };
1131
- function Ie({ show: e, clip: t = !0, gap: n = "stack", dividers: r, className: l, ...s }) {
1132
- const u = M(), d = Vt[r ? "none" : n], i = E(null), c = E(e !== !0);
1133
- O(() => {
1134
- c.current = !0;
1135
- }, []);
1136
- const f = () => {
1137
- t && i.current && (i.current.style.overflow = "hidden");
1138
- }, o = () => {
1139
- i.current && (i.current.style.overflow = "");
1140
- };
1141
- return e === void 0 ? /* @__PURE__ */ a(A.div, {
1142
- initial: u ? !1 : {
1143
- opacity: 0,
1144
- y: X
1145
- },
1146
- animate: {
1147
- opacity: 1,
1148
- y: 0
1149
- },
1150
- transition: {
1151
- y: P,
1152
- opacity: D
1153
- },
1154
- className: p(r && le, l),
1155
- ...s
1156
- }) : /* @__PURE__ */ a($, {
1157
- initial: !1,
1158
- children: e ? /* @__PURE__ */ a(A.div, {
1159
- "data-basic-page-reveal": "",
1160
- ref: (m) => {
1161
- i.current = m, t && m && c.current && (m.style.overflow = "hidden");
1162
- },
1163
- onAnimationStart: f,
1164
- onAnimationComplete: o,
1165
- initial: {
1166
- height: 0,
1167
- opacity: 0,
1168
- marginTop: d
1169
- },
1170
- animate: {
1171
- height: "auto",
1172
- opacity: 1,
1173
- marginTop: 0
1174
- },
1175
- exit: {
1176
- height: 0,
1177
- opacity: 0,
1178
- marginTop: d
1179
- },
1180
- transition: u ? { duration: 0 } : {
1181
- height: P,
1182
- marginTop: P,
1183
- opacity: D
1184
- },
1185
- className: p(r && le, l),
1186
- ...s
1187
- }) : null
1188
- });
1189
- }
1190
- var $t = "top-4 left-5 h-8 text-base [&>svg]:size-[1.125em] [&>svg]:shrink-0", qt = "(min-width: 40rem)";
1191
- function jt() {
1192
- return typeof window < "u" && typeof window.matchMedia == "function" && !window.matchMedia(qt).matches;
1193
- }
1194
- var ca = G(null);
1195
- function ua({ className: e, children: t, ...n }) {
1196
- const r = ee.toArray(t).filter(Ke), l = r.map((_) => _.props.children ?? null), s = ea();
1197
- Za(l);
1198
- const [u] = w(jt), d = M(), i = r.length, c = je(), f = !u && i >= Kt, o = k(Se), m = i > 0 ? r[i - 1]?.props : null, h = m?.children ?? "Back", g = m?.href, v = m?.onClick;
1199
- z(() => {
1200
- if (!(o == null || g == null))
1201
- return o.setTail({
1202
- label: h,
1203
- href: g,
1204
- onClick: v
1205
- }), () => o.setTail(null);
1206
- }, [
1207
- o,
1208
- h,
1209
- g,
1210
- v
1211
- ]);
1212
- const [N, b] = w(!d && !u && s != null && s.labels.length > i);
1213
- return /* @__PURE__ */ a("nav", {
1214
- "aria-label": "Breadcrumb",
1215
- "data-basic-page-back": "",
1216
- className: p("absolute top-4 left-3 flex min-w-max items-center", e),
1217
- ...n,
1218
- children: /* @__PURE__ */ y("ol", {
1219
- className: "m-0 flex list-none items-center p-0",
1220
- children: [r.map((_, x) => f && x > 0 && x < i - 2 ? null : /* @__PURE__ */ y(Oa, { children: [f && x === i - 2 && /* @__PURE__ */ y("li", {
1221
- className: "m-0 flex items-center max-sm:hidden",
1222
- children: [/* @__PURE__ */ a("span", {
1223
- "aria-hidden": !0,
1224
- className: we,
1225
- children: ce
1226
- }), /* @__PURE__ */ y(Q.Root, { children: [/* @__PURE__ */ a(Q.Trigger, { render: /* @__PURE__ */ a(Z, {
1227
- variant: "ghost",
1228
- size: "sm",
1229
- "aria-label": "Hidden pages",
1230
- className: "px-2.5",
1231
- children: Xt
1232
- }) }), /* @__PURE__ */ a(Q.Portal, { children: /* @__PURE__ */ a(Q.Positioner, {
1233
- align: "start",
1234
- sideOffset: 4,
1235
- children: /* @__PURE__ */ a(Q.Popup, { children: r.slice(1, i - 2).map((S, R) => {
1236
- const I = S.props;
1237
- return /* @__PURE__ */ a(Q.LinkItem, {
1238
- render: /* @__PURE__ */ a(c, {
1239
- href: I.href,
1240
- onClick: I.onClick
1241
- }),
1242
- children: I.children ?? "Back"
1243
- }, S.key ?? R);
1244
- }) })
1245
- }) })] })]
1246
- }), /* @__PURE__ */ a("li", {
1247
- className: p("m-0 flex items-center", x < i - 1 && "max-sm:hidden"),
1248
- children: /* @__PURE__ */ a(ca.Provider, {
1249
- value: {
1250
- index: x,
1251
- count: i,
1252
- departing: s,
1253
- narrow: u
1254
- },
1255
- children: _
1256
- })
1257
- })] }, _.key ?? x)), N && /* @__PURE__ */ a("li", {
1258
- "aria-hidden": !0,
1259
- className: "m-0 flex items-center max-sm:hidden",
1260
- children: /* @__PURE__ */ a(A.span, {
1261
- initial: { opacity: 1 },
1262
- animate: { opacity: 0 },
1263
- transition: Ze,
1264
- onAnimationComplete: () => b(!1),
1265
- className: we,
1266
- children: ce
1267
- })
1268
- })]
1269
- })
1270
- });
1271
- }
1272
- var we = "text-pho-description -mx-1 inline-flex shrink-0 text-base select-none", ce = "/", Kt = 4, Xt = "…";
1273
- function da({ href: e, className: t, morphId: n, children: r = "Back", ...l }) {
1274
- const s = k(ca), u = M(), d = n != null && !u, i = ta(d ? n : void 0);
1275
- if (s == null) throw new Error("BasicPage.Crumb must be rendered inside BasicPage.Breadcrumbs");
1276
- const { index: c, count: f, departing: o, narrow: m } = s, h = c === 0, g = c === f - 1, v = o != null && o.labels.length < f, N = o != null && o.labels.length > f, b = g && (o == null || v || m), _ = h || g, x = h && g ? "" : h ? "max-sm:hidden" : "sm:hidden", S = o != null, R = g ? m ? N ? "slide" : "fade" : b ? "fade" : void 0 : void 0, [I, B] = w(d && m && i.fly && o != null && !N ? o.labels[o.labels.length - 1] : null), L = d && _ && !S, W = d && !h && g && (o == null || v);
1277
- return /* @__PURE__ */ y(de, { children: [!h && /* @__PURE__ */ a("span", {
1278
- "aria-hidden": !0,
1279
- className: p(we, "max-sm:hidden"),
1280
- children: W ? /* @__PURE__ */ a(A.span, {
1281
- initial: i.fly ? {
1282
- opacity: 0,
1283
- x: He
1284
- } : { opacity: 0 },
1285
- animate: i.fly ? {
1286
- opacity: 1,
1287
- x: 0
1288
- } : { opacity: 1 },
1289
- transition: i.fly ? Fe : D,
1290
- className: "inline-flex",
1291
- children: ce
1292
- }) : ce
1293
- }), /* @__PURE__ */ a(Ne, {
1294
- variant: "ghost",
1295
- size: "sm",
1296
- href: e,
1297
- prefix: _ ? L ? /* @__PURE__ */ a(A.span, {
1298
- initial: i.fly ? {
1299
- opacity: 0,
1300
- x: He
1301
- } : { opacity: 0 },
1302
- animate: i.fly ? {
1303
- opacity: 1,
1304
- x: 0
1305
- } : { opacity: 1 },
1306
- transition: i.fly ? Fe : D,
1307
- className: p("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1308
- children: /* @__PURE__ */ a(se, {})
1309
- }) : /* @__PURE__ */ a("span", {
1310
- className: p("inline-flex [&>svg]:size-[1.125em] [&>svg]:shrink-0", x),
1311
- children: /* @__PURE__ */ a(se, {})
1312
- }) : /* @__PURE__ */ a("span", { className: "hidden" }),
1313
- className: p("min-w-max", t),
1314
- ...l,
1315
- children: d && n != null ? /* @__PURE__ */ y("span", {
1316
- className: p("relative block", !i.fly && R === "slide" && "overflow-hidden", !g && "max-w-40 truncate"),
1317
- children: [/* @__PURE__ */ a(na, {
1318
- morphId: n,
1319
- fromClassName: "text-pho-primary",
1320
- fly: i.fly,
1321
- morphRef: i.ref,
1322
- arrival: R,
1323
- children: r
1324
- }), I != null && /* @__PURE__ */ a(A.span, {
1325
- "aria-hidden": !0,
1326
- initial: {
1327
- x: 0,
1328
- opacity: 1
1329
- },
1330
- animate: {
1331
- x: Ya,
1332
- opacity: 0
1333
- },
1334
- transition: Ua,
1335
- onAnimationComplete: () => B(null),
1336
- className: "pointer-events-none absolute inset-y-0 left-0 whitespace-nowrap",
1337
- children: I
1338
- })]
1339
- }) : /* @__PURE__ */ a("span", {
1340
- className: p("block", !g && "max-w-40 truncate"),
1341
- children: r
1342
- })
1343
- })] });
1344
- }
1345
- function Qt({ className: e, ...t }) {
1346
- return /* @__PURE__ */ a(ua, {
1347
- className: e,
1348
- children: /* @__PURE__ */ a(da, { ...t })
1349
- });
1350
- }
1351
- function Yt({ label: e, description: t, leading: n, href: r, className: l, children: s, ...u }) {
1352
- const d = je(), i = V(() => A.create(d), [d]), { leaving: c, ...f } = Te();
1353
- return /* @__PURE__ */ y(i, {
1354
- href: r,
1355
- ...f,
1356
- ...u,
1357
- className: p("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)]", c && "overflow-hidden", l),
1358
- children: [/* @__PURE__ */ y("div", {
1359
- className: p("flex min-w-0 flex-1 items-center", n != null && "gap-3"),
1360
- children: [n, /* @__PURE__ */ y("div", {
1361
- className: "min-w-0",
1362
- children: [/* @__PURE__ */ a("div", {
1363
- className: "flex min-w-0 items-center gap-1",
1364
- children: typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ a("p", {
1365
- className: "text-pho-primary truncate text-base font-medium",
1366
- children: e
1367
- }) : e
1368
- }), t ? /* @__PURE__ */ a("div", {
1369
- className: "text-pho-description truncate text-xs",
1370
- children: t
1371
- }) : null]
1372
- })]
1373
- }), /* @__PURE__ */ y("div", {
1374
- className: "flex min-w-0 items-center justify-end gap-2",
1375
- children: [s != null ? /* @__PURE__ */ a("div", {
1376
- className: "min-w-0",
1377
- children: s
1378
- }) : null, /* @__PURE__ */ a(Aa, {
1379
- "aria-hidden": !0,
1380
- className: "text-pho-secondary group-hover:text-pho-secondary-hover size-4 shrink-0 transition-colors"
1381
- })]
1382
- })]
1383
- });
1384
- }
1385
- function Ut({ open: e, variant: t = "overlay", modal: n = !1, placeholder: r, onClose: l, width: s = "default", presentation: u, defaultPresentation: d, onPresentationChange: i, expandable: c = !0, children: f }) {
1386
- const o = k(Ye), m = o != null ? Ga(o.paneWidth, s) : 0, h = e ?? ee.toArray(f).length > 0, { presentation: g, setPresentation: v, canChoose: N } = Jt({
1387
- isOpen: h,
1388
- paneNarrow: o?.paneNarrow ?? !1,
1389
- presentation: u,
1390
- defaultPresentation: d,
1391
- onPresentationChange: i
1392
- }), b = o?.setOpen, _ = o?.setAsPage, x = o?.setPresent;
1393
- if (z(() => {
1394
- if (x != null)
1395
- return x(!0), () => x(!1);
1396
- }, [x]), z(() => {
1397
- if (b != null)
1398
- return b(h), () => b(!1);
1399
- }, [b, h]), z(() => {
1400
- if (_ != null)
1401
- return _(g === "page"), () => _(!1);
1402
- }, [_, g]), O(() => {
1403
- o == null && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn("BasicPage.Aside: needs a `BasicPage.Root` around it.");
1404
- }, [o]), o == null || o.slot == null) return null;
1405
- const S = c && N ? () => v("page") : void 0;
1406
- if (g === "page") {
1407
- const R = c && N && !o.paneNarrow ? () => v("panel") : void 0;
1408
- return Le(h ? /* @__PURE__ */ y("div", {
1409
- "data-basic-page-aside": "page",
1410
- "data-basic-page-aside-expanded": o.paneNarrow ? void 0 : "",
1411
- className: "relative flex min-w-0 flex-1 flex-col",
1412
- children: [R != null ? /* @__PURE__ */ a("span", {
1413
- className: "absolute top-2 right-2 z-30",
1414
- children: /* @__PURE__ */ a(K.Provider, { children: /* @__PURE__ */ a(ma, {
1415
- label: "Show as panel",
1416
- icon: /* @__PURE__ */ a(xa, {}),
1417
- onClick: R
1418
- }) })
1419
- }) : null, f]
1420
- }) : null, o.slot);
1421
- }
1422
- return t === "inline" ? Le(/* @__PURE__ */ a(Zt, {
1423
- width: m,
1424
- paneHeight: o.paneHeight,
1425
- onClose: l,
1426
- onExpand: S,
1427
- open: h,
1428
- placeholder: r,
1429
- children: f
1430
- }), o.slot) : /* @__PURE__ */ a(en, {
1431
- container: o.slot,
1432
- width: m,
1433
- paneHeight: o.paneHeight,
1434
- onClose: l,
1435
- onExpand: S,
1436
- open: h,
1437
- modal: n,
1438
- children: f
1439
- });
1440
- }
1441
- function Jt({ isOpen: e, paneNarrow: t, presentation: n, defaultPresentation: r, onPresentationChange: l }) {
1442
- const [s, u] = w(e), [d, i] = w(null);
1443
- z(() => {
1444
- e || (u(!1), i(null));
1445
- }, [e]);
1446
- const c = n != null;
1447
- return {
1448
- presentation: t ? "page" : n ?? d ?? r ?? (s ? "page" : "panel"),
1449
- setPresentation: Ce((f) => {
1450
- c || i(f), l?.(f);
1451
- }, [c, l]),
1452
- canChoose: !c || l != null
1453
- };
1454
- }
1455
- function pa() {
1456
- const [e, t] = w(null), n = V(() => ({ setBack: t }), []), r = E(null);
1457
- return {
1458
- back: e,
1459
- panel: n,
1460
- closeRef: r,
1461
- leave: Ce(() => {
1462
- const l = r.current?.querySelector("a, button");
1463
- return l == null ? !1 : (l.click(), !0);
1464
- }, [])
1465
- };
1466
- }
1467
- var $e = {
1468
- variant: "ghost",
1469
- size: "sm",
1470
- svgOnly: !0,
1471
- "aria-label": "Close",
1472
- children: /* @__PURE__ */ a(ka, {})
1473
- };
1474
- function ma({ label: e, icon: t, onClick: n }) {
1475
- return /* @__PURE__ */ y(K.Root, { children: [/* @__PURE__ */ a(K.Trigger, { render: /* @__PURE__ */ a(Z, {
1476
- variant: "ghost",
1477
- size: "sm",
1478
- svgOnly: !0,
1479
- "aria-label": e,
1480
- onClick: n,
1481
- children: t
1482
- }) }), /* @__PURE__ */ a(K.Portal, { children: /* @__PURE__ */ a(K.Positioner, { children: /* @__PURE__ */ a(K.Popup, { children: e }) }) })] });
1483
- }
1484
- function fa({ back: e, onClose: t, onExpand: n, closeRef: r, panel: l, children: s }) {
1485
- return /* @__PURE__ */ y(de, { children: [/* @__PURE__ */ y("span", {
1486
- className: "absolute top-2 right-2 z-30 flex items-center gap-0.5",
1487
- children: [n != null ? /* @__PURE__ */ a(K.Provider, { children: /* @__PURE__ */ a(ma, {
1488
- label: "Expand",
1489
- icon: /* @__PURE__ */ a(wa, {}),
1490
- onClick: n
1491
- }) }) : null, /* @__PURE__ */ a("span", {
1492
- ref: r,
1493
- className: "contents",
1494
- children: e != null ? /* @__PURE__ */ a(Ne, {
1495
- ...$e,
1496
- href: e.href,
1497
- onClick: e.onClick
1498
- }) : t != null ? /* @__PURE__ */ a(Z, {
1499
- ...$e,
1500
- onClick: t
1501
- }) : null
1502
- })]
1503
- }), /* @__PURE__ */ y(J.Root, {
1504
- className: "min-h-0 min-w-0 flex-1",
1505
- children: [/* @__PURE__ */ a(J.Viewport, {
1506
- className: "overflow-x-hidden",
1507
- style: { overflowX: "hidden" },
1508
- children: /* @__PURE__ */ a(J.Content, {
1509
- className: "flex min-h-full w-full min-w-0 flex-col",
1510
- style: {
1511
- minWidth: 0,
1512
- width: "100%",
1513
- maxWidth: "100%"
1514
- },
1515
- children: /* @__PURE__ */ a(Ue.Provider, {
1516
- value: l,
1517
- children: s
1518
- })
1519
- })
1520
- }), /* @__PURE__ */ a(J.Scrollbar, { children: /* @__PURE__ */ a(J.Thumb, {}) })]
1521
- })] });
1522
- }
1523
- function Zt({ width: e, paneHeight: t, onClose: n, onExpand: r, open: l, placeholder: s, children: u }) {
1524
- const d = M(), { back: i, panel: c, closeRef: f, leave: o } = pa(), m = d ? "blur(0px)" : `blur(${_e}px)`, h = t ?? "100dvh";
1525
- O(() => {
1526
- const v = (N) => {
1527
- N.key !== "Escape" || N.defaultPrevented || o() && N.preventDefault();
1528
- };
1529
- return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
1530
- }, [o]);
1531
- const g = {
1532
- initial: {
1533
- opacity: 0,
1534
- filter: m
1535
- },
1536
- animate: {
1537
- opacity: 1,
1538
- filter: "blur(0px)"
1539
- },
1540
- exit: {
1541
- opacity: 0,
1542
- filter: m
1543
- },
1544
- transition: d ? { duration: 0 } : oe
1545
- };
1546
- return /* @__PURE__ */ a("aside", {
1547
- "data-basic-page-aside": "panel",
1548
- "data-basic-page-aside-variant": "inline",
1549
- className: "relative flex min-w-0 shrink-0 flex-col",
1550
- style: {
1551
- width: e,
1552
- minWidth: 0,
1553
- maxWidth: e,
1554
- minHeight: h
1555
- },
1556
- children: /* @__PURE__ */ a("div", {
1557
- className: "border-pho-secondary bg-pho-primary sticky top-0 grid min-w-0 overflow-hidden border-l *:min-h-0 *:[grid-area:1/1]",
1558
- style: { height: h },
1559
- children: /* @__PURE__ */ a($, {
1560
- initial: !1,
1561
- children: l ? /* @__PURE__ */ a(A.div, {
1562
- ...g,
1563
- className: "relative flex min-w-0 flex-col",
1564
- children: /* @__PURE__ */ a(fa, {
1565
- back: i,
1566
- onClose: n,
1567
- onExpand: r,
1568
- closeRef: f,
1569
- panel: c,
1570
- children: u
1571
- })
1572
- }, "page") : /* @__PURE__ */ a(A.div, {
1573
- ...g,
1574
- className: "flex flex-col",
1575
- children: s
1576
- }, "empty")
1577
- })
1578
- })
1579
- });
1580
- }
1581
- function en({ container: e, width: t, paneHeight: n, onClose: r, onExpand: l, open: s, modal: u, children: d }) {
1582
- const { back: i, panel: c, closeRef: f, leave: o } = pa(), m = n ?? "100dvh";
1583
- return /* @__PURE__ */ a(re.Root, {
1584
- open: s,
1585
- modal: u ? "trap-focus" : !1,
1586
- disablePointerDismissal: !0,
1587
- onOpenChange: (h, g) => {
1588
- h || (g.cancel(), o());
1589
- },
1590
- children: /* @__PURE__ */ y(re.Portal, {
1591
- container: e,
1592
- className: "contents",
1593
- children: [u ? /* @__PURE__ */ a(re.Backdrop, {
1594
- "data-basic-page-aside-backdrop": "",
1595
- className: p("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"),
1596
- onClick: o
1597
- }) : null, /* @__PURE__ */ a(re.Popup, {
1598
- "data-basic-page-aside": "panel",
1599
- "data-basic-page-aside-variant": "overlay",
1600
- initialFocus: u ? void 0 : !1,
1601
- finalFocus: u ? void 0 : !1,
1602
- className: p("absolute inset-y-0 right-0 z-30 flex min-w-0 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"),
1603
- style: {
1604
- width: t,
1605
- minWidth: 0,
1606
- maxWidth: t
1607
- },
1608
- children: /* @__PURE__ */ a("div", {
1609
- className: "border-pho-secondary bg-pho-primary shadow-pho-xl sticky top-0 flex min-w-0 flex-col overflow-hidden border-l",
1610
- style: { height: m },
1611
- children: /* @__PURE__ */ a(fa, {
1612
- back: i,
1613
- onClose: r,
1614
- onExpand: l,
1615
- closeRef: f,
1616
- panel: c,
1617
- children: d
1618
- })
1619
- })
1620
- })]
1621
- })
1622
- });
1623
- }
1624
- var an = "14rem", tn = "transition-[width] duration-[330ms] ease-pho-spring motion-reduce:transition-none", qe = "transition-[opacity,visibility] duration-200 ease-out motion-reduce:transition-none";
1625
- function nn({ variant: e = "box", fold: t = "auto", value: n, onValueChange: r, placeholder: l, label: s, className: u, ...d }) {
1626
- const i = k(Ae), c = ue(i?.subscribe ?? pe, () => i?.get().api ?? null, () => null), f = n != null;
1627
- O(() => {
1628
- if (!(i == null || f))
1629
- return i.adopt(!0), () => i.adopt(!1);
1630
- }, [i, f]);
1631
- const o = f ? {
1632
- query: n,
1633
- setQuery: r,
1634
- placeholder: l ?? "Search",
1635
- label: s ?? l ?? "Search"
1636
- } : c == null ? null : {
1637
- query: c.query,
1638
- setQuery: c.setQuery,
1639
- placeholder: c.placeholder,
1640
- label: s ?? c.placeholder
1641
- }, [m, h] = w(!1), g = E(null), v = m || (o?.query ?? "") !== "";
1642
- if (O(() => {
1643
- if (!m) return;
1644
- let b = 0, _ = 0;
1645
- const x = () => {
1646
- const S = g.current;
1647
- S != null && (S.focus(), document.activeElement !== S && _++ < 5 && (b = requestAnimationFrame(x)));
1648
- };
1649
- return b = requestAnimationFrame(x), () => cancelAnimationFrame(b);
1650
- }, [m]), e === "ghost") return /* @__PURE__ */ a("div", {
1651
- "data-basic-page-search": "",
1652
- "data-variant": "ghost",
1653
- className: p("flex min-w-0 flex-1", o == null && "hidden", u),
1654
- ...d,
1655
- children: o != null && /* @__PURE__ */ a(Ia, {
1656
- value: o.query,
1657
- onChange: o.setQuery,
1658
- placeholder: o.placeholder,
1659
- "aria-label": o.label,
1660
- onKeyDown: (b) => {
1661
- b.key === "Escape" && (b.preventDefault(), o.setQuery(""), b.currentTarget.blur());
1662
- }
1663
- })
1664
- });
1665
- const N = t === "auto";
1666
- return /* @__PURE__ */ a("div", {
1667
- "data-basic-page-search": "",
1668
- "data-expanded": v || void 0,
1669
- className: p("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-start", o == null && "hidden", u),
1670
- ...d,
1671
- children: o != null && /* @__PURE__ */ y("div", {
1672
- className: p("grid w-9 max-w-full justify-items-end *:[grid-area:1/1]", tn, N && "@[36rem]:w-56"),
1673
- style: v ? { width: an } : void 0,
1674
- children: [/* @__PURE__ */ a(Z, {
1675
- variant: "outlined",
1676
- size: "sm",
1677
- shape: "circle",
1678
- svgOnly: !0,
1679
- "aria-label": o.label,
1680
- "aria-hidden": v || void 0,
1681
- tabIndex: v ? -1 : void 0,
1682
- onClick: () => h(!0),
1683
- className: p(qe, v ? "pointer-events-none invisible opacity-0" : "visible opacity-100", N && "@[36rem]:pointer-events-none @[36rem]:invisible @[36rem]:opacity-0"),
1684
- children: /* @__PURE__ */ a(Oe, {})
1685
- }), /* @__PURE__ */ a("div", {
1686
- inert: !N && !v,
1687
- className: p("w-full min-w-0", qe, v ? "visible opacity-100" : "pointer-events-none invisible opacity-0", N && "@[36rem]:pointer-events-auto @[36rem]:visible @[36rem]:opacity-100"),
1688
- children: /* @__PURE__ */ y(ge.Root, {
1689
- size: "sm",
1690
- className: "w-full",
1691
- children: [/* @__PURE__ */ a(ge.Addon, { children: /* @__PURE__ */ a(Oe, {}) }), /* @__PURE__ */ a(ge.Input, {
1692
- ref: g,
1693
- type: "search",
1694
- value: o.query,
1695
- onChange: (b) => o.setQuery(b.target.value),
1696
- onBlur: () => {
1697
- o.query === "" && h(!1);
1698
- },
1699
- onKeyDown: (b) => {
1700
- b.key === "Escape" && (b.preventDefault(), o.setQuery(""), h(!1), b.currentTarget.blur());
1701
- },
1702
- placeholder: o.placeholder,
1703
- "aria-label": o.label
1704
- })]
1705
- })
1706
- })]
1707
- })
1708
- });
1709
- }
1710
- function rn({ header: e, main: t, side: n, foot: r, enter: l }) {
1711
- const s = n != null;
1712
- return /* @__PURE__ */ a("div", {
1713
- "data-basic-page-columns": "",
1714
- className: "@container w-full min-w-0",
1715
- children: /* @__PURE__ */ y("div", {
1716
- className: p("mx-auto w-full max-w-[42rem]", s && "@min-[73.5rem]:max-w-none"),
1717
- children: [e, /* @__PURE__ */ y("div", {
1718
- className: p("grid gap-x-10 gap-y-4", s && "@min-[73.5rem]:grid-cols-[minmax(42rem,1fr)_minmax(29rem,32rem)] @min-[73.5rem]:grid-rows-[auto_minmax(0,1fr)]", s && "[&>[data-basic-page-columns-side]]:mt-6 @min-[73.5rem]:[&>[data-basic-page-columns-side]]:mt-7", r != null && "[&>[data-basic-page-columns-foot]]:mt-6"),
1719
- children: [
1720
- /* @__PURE__ */ a(ie, {
1721
- enter: l,
1722
- "data-basic-page-columns-main": "",
1723
- className: p("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", s && "@min-[73.5rem]:col-start-1 @min-[73.5rem]:row-span-2 @min-[73.5rem]:row-start-1"),
1724
- children: t
1725
- }),
1726
- s ? /* @__PURE__ */ a(ie, {
1727
- enter: l,
1728
- "data-basic-page-columns-side": "",
1729
- className: p("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", "@min-[73.5rem]:col-start-2 @min-[73.5rem]:row-start-1"),
1730
- children: n
1731
- }) : null,
1732
- r != null ? /* @__PURE__ */ a(ie, {
1733
- enter: l,
1734
- "data-basic-page-columns-foot": "",
1735
- className: p("[[data-basic-page-stack]>[data-basic-page-columns]_&]:mt-0", s && "@min-[73.5rem]:col-start-2 @min-[73.5rem]:row-start-2 @min-[73.5rem]:self-start"),
1736
- children: r
1737
- }) : null
1738
- ]
1739
- })]
1740
- })
1741
- });
1742
- }
1743
- var Dn = {
1744
- Root: $a,
1745
- Aside: Ut,
1746
- Search: nn,
1747
- Table: Ea,
1748
- Code: Na,
1749
- CondenseScope: et,
1750
- Breadcrumbs: ua,
1751
- Crumb: da,
1752
- Back: Qt,
1753
- Title: st,
1754
- Stack: ie,
1755
- Columns: rn,
1756
- Header: ht,
1757
- HeaderAction: gt,
1758
- SectionTitle: bt,
1759
- Description: sa,
1760
- TableCount: vt,
1761
- SectionFooter: yt,
1762
- Card: xt,
1763
- Item: wt,
1764
- ItemPanel: Nt,
1765
- Callout: At,
1766
- CalloutTitle: _t,
1767
- CalloutDescription: Ct,
1768
- Onboard: Et,
1769
- Step: It,
1770
- Row: Ot,
1771
- RowLink: Yt,
1772
- Value: Bt,
1773
- Meta: Be.Root,
1774
- MetaItem: Be.Item,
1775
- Alert: Lt,
1776
- Footer: Wt,
1777
- Form: Mt,
1778
- Saved: Dt,
1779
- Fields: Ft,
1780
- Inline: zt,
1781
- Submit: Gt,
1782
- Reveal: Ie
1783
- };
1784
- export {
1785
- Ha as a,
1786
- Dn as c,
1787
- at as d,
1788
- ye as f,
1789
- Da as i,
1790
- oe as l,
1791
- Bn as m,
1792
- Me as n,
1793
- Fa as o,
1794
- Ln as p,
1795
- Xe as r,
1796
- Ma as s,
1797
- Mn as t,
1798
- tt as u
1799
- };
1800
-
1801
- //# sourceMappingURL=basic-page-DzT8yecB.js.map