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