@photon-ai/pho-ui 1.3.0 → 1.5.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.
- package/dist/chunks/IconArrowUpRight-DGgKzQwV.js +14 -0
- package/dist/chunks/IconArrowUpRight-DGgKzQwV.js.map +1 -0
- package/dist/chunks/IconChevronLeft-CSWMKQ4C.js +11 -0
- package/dist/chunks/IconChevronLeft-CSWMKQ4C.js.map +1 -0
- package/dist/chunks/basic-page-awtvmT-6.js +270 -0
- package/dist/chunks/basic-page-awtvmT-6.js.map +1 -0
- package/dist/chunks/combobox-rLdS6fl-.js +117 -0
- package/dist/chunks/combobox-rLdS6fl-.js.map +1 -0
- package/dist/chunks/dialog--PQoodig.js +247 -0
- package/dist/chunks/dialog--PQoodig.js.map +1 -0
- package/dist/chunks/{sidebar-DGpEKxOn.js → sidebar-DLYTxo2j.js} +72 -64
- package/dist/chunks/sidebar-DLYTxo2j.js.map +1 -0
- package/dist/chunks/status-view-CcbctPqR.js +65 -0
- package/dist/chunks/status-view-CcbctPqR.js.map +1 -0
- package/dist/components/combobox.js +2 -114
- package/dist/components/command.js +278 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/dialog.js +1 -1
- package/dist/components/phone-input.js +16982 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/status-view.js +8 -0
- package/dist/index.js +52 -44
- package/dist/sections/basic-page.js +7 -4
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/command/command.d.ts +114 -0
- package/dist/src/components/command/index.d.ts +1 -0
- package/dist/src/components/dialog/dialog.d.ts +81 -1
- package/dist/src/components/phone-input/country-alpha3.d.ts +250 -0
- package/dist/src/components/phone-input/country-search.d.ts +8 -0
- package/dist/src/components/phone-input/index.d.ts +1 -0
- package/dist/src/components/phone-input/phone-input.d.ts +41 -0
- package/dist/src/components/status-view/index.d.ts +1 -0
- package/dist/src/components/status-view/status-view.d.ts +74 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/sections/basic-page/basic-page.d.ts +70 -2
- package/dist/src/sections/basic-page/index.d.ts +1 -1
- package/dist/src/sections/sidebar/sidebar.d.ts +8 -3
- package/dist/src/utils/animated-height.d.ts +10 -0
- package/package.json +16 -1
- package/dist/chunks/basic-page-C50WUzYV.js +0 -238
- package/dist/chunks/basic-page-C50WUzYV.js.map +0 -1
- package/dist/chunks/dialog-Ba0UUE5g.js +0 -155
- package/dist/chunks/dialog-Ba0UUE5g.js.map +0 -1
- package/dist/chunks/sidebar-DGpEKxOn.js.map +0 -1
- package/dist/components/combobox.js.map +0 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as h } from "./cn-DTiB6ek_.js";
|
|
3
|
+
import { o as I, t as C } from "./close-button-B8gF5UNk.js";
|
|
4
|
+
import { createContext as _, useCallback as F, useContext as B, useEffect as k, useMemo as O, useRef as b, useState as D } from "react";
|
|
5
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { Dialog as u } from "@base-ui/react/dialog";
|
|
7
|
+
var P = _(null);
|
|
8
|
+
function Y() {
|
|
9
|
+
return B(P)?.pending ?? !1;
|
|
10
|
+
}
|
|
11
|
+
function V({ onOpenChange: t, actionsRef: n, ...l }) {
|
|
12
|
+
const [r, a] = D(!1), s = b(!1), o = b(null);
|
|
13
|
+
k(() => {
|
|
14
|
+
if (n)
|
|
15
|
+
return n.current = o.current, () => {
|
|
16
|
+
n.current = null;
|
|
17
|
+
};
|
|
18
|
+
}, [n]);
|
|
19
|
+
const i = F((f, p) => {
|
|
20
|
+
if (!f && s.current) {
|
|
21
|
+
p.cancel();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
t?.(f, p);
|
|
25
|
+
}, [t]), d = O(() => ({
|
|
26
|
+
pending: r,
|
|
27
|
+
beginPending: () => {
|
|
28
|
+
s.current = !0, a(!0);
|
|
29
|
+
},
|
|
30
|
+
endPending: () => {
|
|
31
|
+
s.current = !1, a(!1);
|
|
32
|
+
},
|
|
33
|
+
close: () => o.current?.close()
|
|
34
|
+
}), [r]);
|
|
35
|
+
return /* @__PURE__ */ e(P.Provider, {
|
|
36
|
+
value: d,
|
|
37
|
+
children: /* @__PURE__ */ e(u.Root, {
|
|
38
|
+
actionsRef: o,
|
|
39
|
+
onOpenChange: i,
|
|
40
|
+
...l
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
var M = u.Trigger, y = u.Portal, x = u.Close;
|
|
45
|
+
function S(t) {
|
|
46
|
+
return t != null && typeof t.then == "function";
|
|
47
|
+
}
|
|
48
|
+
function $({ onClick: t, loading: n, disabled: l, ...r }) {
|
|
49
|
+
const a = B(P), [s, o] = D(!1), i = b(!0);
|
|
50
|
+
k(() => (i.current = !0, () => {
|
|
51
|
+
i.current = !1;
|
|
52
|
+
}), []);
|
|
53
|
+
function d(p) {
|
|
54
|
+
if (s || n) return;
|
|
55
|
+
const m = t?.(p);
|
|
56
|
+
if (!S(m)) {
|
|
57
|
+
a?.close();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
o(!0), a?.beginPending(), m.then(() => {
|
|
61
|
+
a?.endPending(), i.current && o(!1), a?.close();
|
|
62
|
+
}, (g) => {
|
|
63
|
+
a?.endPending(), i.current && o(!1), typeof process < "u" && process.env.NODE_ENV !== "production" && console.error("Dialog.Action: async onClick rejected —", g);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const f = s || n;
|
|
67
|
+
return /* @__PURE__ */ e(I, {
|
|
68
|
+
...r,
|
|
69
|
+
disabled: l || f,
|
|
70
|
+
loading: f,
|
|
71
|
+
onClick: d
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function w({ className: t, ...n }) {
|
|
75
|
+
return /* @__PURE__ */ e(u.Backdrop, {
|
|
76
|
+
className: h("bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
|
|
77
|
+
...n
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function j({ className: t, ...n }) {
|
|
81
|
+
return /* @__PURE__ */ e(u.Popup, {
|
|
82
|
+
className: h("border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
|
|
83
|
+
...n
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function v({ className: t, ...n }) {
|
|
87
|
+
return /* @__PURE__ */ e(u.Title, {
|
|
88
|
+
className: h("text-pho-primary font-display text-display-sm font-medium text-balance", t),
|
|
89
|
+
...n
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function N({ className: t, ...n }) {
|
|
93
|
+
return /* @__PURE__ */ e(u.Description, {
|
|
94
|
+
className: h("text-pho-description text-display-xs font-normal", t),
|
|
95
|
+
...n
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function z({ children: t, size: n = "md" }) {
|
|
99
|
+
return /* @__PURE__ */ e("span", {
|
|
100
|
+
"aria-hidden": !0,
|
|
101
|
+
className: h("text-pho-secondary mb-1", n === "lg" ? "[&>svg]:size-12" : "[&>svg]:size-8"),
|
|
102
|
+
children: t
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function G({ icon: t, title: n, description: l, consequences: r, warning: a, actions: s, showClose: o = !0, children: i, className: d, ...f }) {
|
|
106
|
+
const p = s == null && o, m = !!(t || n || l || p), g = r != null && r.length > 0, R = g || a != null || i != null || s != null;
|
|
107
|
+
return /* @__PURE__ */ c(y, { children: [/* @__PURE__ */ e(w, {}), /* @__PURE__ */ c(j, {
|
|
108
|
+
className: d,
|
|
109
|
+
...f,
|
|
110
|
+
children: [m && /* @__PURE__ */ c("div", {
|
|
111
|
+
className: "flex flex-col gap-1 px-6 pt-6",
|
|
112
|
+
children: [
|
|
113
|
+
t && /* @__PURE__ */ e(z, { children: t }),
|
|
114
|
+
(n || p) && /* @__PURE__ */ c("div", {
|
|
115
|
+
className: "relative",
|
|
116
|
+
children: [n ? /* @__PURE__ */ e(v, {
|
|
117
|
+
className: p ? "pr-12" : void 0,
|
|
118
|
+
children: n
|
|
119
|
+
}) : /* @__PURE__ */ e("div", {
|
|
120
|
+
className: "h-[1.625rem]",
|
|
121
|
+
"aria-hidden": "true"
|
|
122
|
+
}), p && /* @__PURE__ */ e(x, { render: /* @__PURE__ */ e(C, { className: "absolute top-1/2 right-0 z-10 -translate-y-1/2" }) })]
|
|
123
|
+
}),
|
|
124
|
+
l && /* @__PURE__ */ e(N, { children: l })
|
|
125
|
+
]
|
|
126
|
+
}), R && /* @__PURE__ */ c("div", {
|
|
127
|
+
className: "flex flex-col gap-5 px-6 py-5",
|
|
128
|
+
children: [
|
|
129
|
+
g && /* @__PURE__ */ e("ul", {
|
|
130
|
+
className: "text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium",
|
|
131
|
+
children: r.map((A, E) => /* @__PURE__ */ e("li", {
|
|
132
|
+
className: "relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current",
|
|
133
|
+
children: A
|
|
134
|
+
}, E))
|
|
135
|
+
}),
|
|
136
|
+
a != null && /* @__PURE__ */ e("p", {
|
|
137
|
+
className: "text-pho-error text-display-xs font-medium",
|
|
138
|
+
children: a
|
|
139
|
+
}),
|
|
140
|
+
i,
|
|
141
|
+
s != null && /* @__PURE__ */ e("div", {
|
|
142
|
+
className: "flex items-center justify-end gap-2",
|
|
143
|
+
children: s
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
})]
|
|
147
|
+
})] });
|
|
148
|
+
}
|
|
149
|
+
function T({ className: t, ...n }) {
|
|
150
|
+
return /* @__PURE__ */ e(u.Popup, {
|
|
151
|
+
className: h("border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8", "transition-[opacity,scale] duration-200 ease-out", "data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0", "data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150", t),
|
|
152
|
+
...n
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function J({ icon: t, title: n, description: l, actions: r, showClose: a = !0, children: s, className: o, ...i }) {
|
|
156
|
+
const d = r == null && a;
|
|
157
|
+
return /* @__PURE__ */ c(y, { children: [/* @__PURE__ */ e(w, {}), /* @__PURE__ */ c(T, {
|
|
158
|
+
className: o,
|
|
159
|
+
...i,
|
|
160
|
+
children: [
|
|
161
|
+
!!(t || n || l || d) && /* @__PURE__ */ c("div", {
|
|
162
|
+
className: "flex shrink-0 flex-col gap-1 px-6 pt-6",
|
|
163
|
+
children: [
|
|
164
|
+
t && /* @__PURE__ */ e(z, { children: t }),
|
|
165
|
+
(n || d) && /* @__PURE__ */ c("div", {
|
|
166
|
+
className: "relative",
|
|
167
|
+
children: [n ? /* @__PURE__ */ e(v, {
|
|
168
|
+
className: d ? "pr-12" : void 0,
|
|
169
|
+
children: n
|
|
170
|
+
}) : /* @__PURE__ */ e("div", {
|
|
171
|
+
className: "h-[1.625rem]",
|
|
172
|
+
"aria-hidden": "true"
|
|
173
|
+
}), d && /* @__PURE__ */ e(x, { render: /* @__PURE__ */ e(C, { className: "absolute top-1/2 right-0 z-10 -translate-y-1/2" }) })]
|
|
174
|
+
}),
|
|
175
|
+
l && /* @__PURE__ */ e(N, { children: l })
|
|
176
|
+
]
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ e("div", {
|
|
179
|
+
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-5",
|
|
180
|
+
children: s
|
|
181
|
+
}),
|
|
182
|
+
r != null && /* @__PURE__ */ e("div", {
|
|
183
|
+
className: "flex shrink-0 items-center justify-end gap-2 px-6 pb-5",
|
|
184
|
+
children: r
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
})] });
|
|
188
|
+
}
|
|
189
|
+
function H({ className: t, ...n }) {
|
|
190
|
+
return /* @__PURE__ */ e(u.Popup, {
|
|
191
|
+
className: h("bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none", "transition-opacity duration-200 ease-out", "data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0", t),
|
|
192
|
+
...n
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function K({ icon: t, title: n, description: l, actions: r, showClose: a = !0, children: s, className: o, ...i }) {
|
|
196
|
+
const d = r == null && a;
|
|
197
|
+
return /* @__PURE__ */ e(y, { children: /* @__PURE__ */ c(H, {
|
|
198
|
+
className: o,
|
|
199
|
+
...i,
|
|
200
|
+
children: [d && /* @__PURE__ */ e(x, { render: /* @__PURE__ */ e(C, { className: "fixed top-4 right-4 z-10" }) }), /* @__PURE__ */ e("div", {
|
|
201
|
+
className: "flex min-h-full items-center justify-center p-6",
|
|
202
|
+
children: /* @__PURE__ */ c("div", {
|
|
203
|
+
className: "flex w-full max-w-md flex-col gap-5",
|
|
204
|
+
children: [
|
|
205
|
+
(t || n || l) && /* @__PURE__ */ c("div", {
|
|
206
|
+
className: "flex flex-col gap-1",
|
|
207
|
+
children: [
|
|
208
|
+
t && /* @__PURE__ */ e(z, {
|
|
209
|
+
size: "lg",
|
|
210
|
+
children: t
|
|
211
|
+
}),
|
|
212
|
+
n && /* @__PURE__ */ e(v, { children: n }),
|
|
213
|
+
l && /* @__PURE__ */ e(N, { children: l })
|
|
214
|
+
]
|
|
215
|
+
}),
|
|
216
|
+
s,
|
|
217
|
+
r != null && /* @__PURE__ */ e("div", {
|
|
218
|
+
className: "flex items-center justify-end gap-2",
|
|
219
|
+
children: r
|
|
220
|
+
})
|
|
221
|
+
]
|
|
222
|
+
})
|
|
223
|
+
})]
|
|
224
|
+
}) });
|
|
225
|
+
}
|
|
226
|
+
var Z = {
|
|
227
|
+
Root: V,
|
|
228
|
+
Trigger: M,
|
|
229
|
+
Portal: y,
|
|
230
|
+
Backdrop: w,
|
|
231
|
+
Popup: j,
|
|
232
|
+
InsetPopup: T,
|
|
233
|
+
FullscreenPopup: H,
|
|
234
|
+
Title: v,
|
|
235
|
+
Description: N,
|
|
236
|
+
Close: x,
|
|
237
|
+
Action: $,
|
|
238
|
+
Content: G,
|
|
239
|
+
InsetContent: J,
|
|
240
|
+
FullscreenContent: K
|
|
241
|
+
};
|
|
242
|
+
export {
|
|
243
|
+
Y as n,
|
|
244
|
+
Z as t
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
//# sourceMappingURL=dialog--PQoodig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog--PQoodig.js","names":[],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { cn } from \"../../utils/cn\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { CloseButton } from \"../button/close-button\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/* ========================== Async pending context ========================== */\n\n/** Imperative actions exposed by Base UI's `actionsRef`. */\ninterface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface DialogPendingContextValue {\n /** True while a `Dialog.Action` promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the dialog imperatively (used by `Dialog.Action` on resolve). */\n close: () => void;\n}\n\nconst DialogPendingContext = createContext<DialogPendingContextValue | null>(\n null,\n);\n\n/**\n * Whether the surrounding dialog has a `Dialog.Action` promise in flight —\n * use it to disable secondary actions (Cancel etc.) while work is pending.\n * Returns `false` outside a `Dialog.Root`.\n */\nexport function useDialogPending(): boolean {\n return useContext(DialogPendingContext)?.pending ?? false;\n}\n\ntype RootProps = ComponentProps<typeof BaseDialog.Root>;\n\n/**\n * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is\n * pending, every close request (outside press, Escape, `Dialog.Close`) is\n * cancelled so the dialog stays open until the work settles. Props pass\n * through to Base UI's `Dialog.Root` unchanged.\n */\nfunction Root({ onOpenChange, actionsRef, ...props }: RootProps) {\n const [pending, setPending] = useState(false);\n // Guard reads a ref so a resolve → close() in the same tick isn't blocked\n // by a not-yet-flushed state update.\n const pendingRef = useRef(false);\n const internalActionsRef = useRef<RootActions | null>(null);\n\n // Keep a caller-supplied actionsRef working alongside our internal one.\n useEffect(() => {\n if (!actionsRef) return;\n actionsRef.current = internalActionsRef.current;\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback<NonNullable<RootProps[\"onOpenChange\"]>>(\n (open, eventDetails) => {\n if (!open && pendingRef.current) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<DialogPendingContextValue>(\n () => ({\n pending,\n beginPending: () => {\n pendingRef.current = true;\n setPending(true);\n },\n endPending: () => {\n pendingRef.current = false;\n setPending(false);\n },\n close: () => internalActionsRef.current?.close(),\n }),\n [pending],\n );\n\n return (\n <DialogPendingContext.Provider value={contextValue}>\n <BaseDialog.Root\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </DialogPendingContext.Provider>\n );\n}\n\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\n/* ============================== Dialog.Action ============================== */\n\nexport interface DialogActionProps extends Omit<ButtonProps, \"onClick\"> {\n /**\n * Confirm handler. Return a promise to keep the dialog open while it runs:\n * the button shows `loading`, all dismissal is locked, and the dialog\n * closes when the promise resolves. On rejection the dialog stays open —\n * surface errors inside the handler. A non-promise return closes\n * immediately, like `Dialog.Close`.\n */\n onClick?: (\n event: ReactMouseEvent<HTMLButtonElement>,\n ) => void | Promise<unknown>;\n}\n\nfunction isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\n/**\n * The confirm button of an action row, with native promise support — a\n * `Button` that runs its (possibly async) `onClick` and closes the dialog\n * when the work settles successfully.\n */\nfunction Action({ onClick, loading, disabled, ...props }: DialogActionProps) {\n const pendingContext = useContext(DialogPendingContext);\n const [busy, setBusy] = useState(false);\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>) {\n if (busy || loading) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n pendingContext?.close();\n return;\n }\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n pendingContext?.close();\n },\n (error: unknown) => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.error(\"Dialog.Action: async onClick rejected —\", error);\n }\n },\n );\n }\n\n const inert = busy || loading;\n return (\n <Button\n {...props}\n disabled={disabled || inert}\n loading={inert}\n onClick={handleClick}\n />\n );\n}\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none\",\n // Opacity + scale only — leave translate centering alone (no transition-all).\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Header icon chrome: secondary ink, a hair of extra air before the title.\n * Panel dialogs use 32px (`size-8`); fullscreen gates step up to 48px\n * (`size-12`) so the glyph reads at viewport scale.\n */\nfunction DialogHeaderIcon({\n children,\n size = \"md\",\n}: {\n children: ReactNode;\n size?: \"md\" | \"lg\";\n}) {\n return (\n <span\n aria-hidden\n className={cn(\n \"text-pho-secondary mb-1\",\n size === \"lg\" ? \"[&>svg]:size-12\" : \"[&>svg]:size-8\",\n )}\n >\n {children}\n </span>\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — typically a Tabler outline icon.\n * Rendered aria-hidden in secondary ink at 32px (`[&>svg]:size-8`). Pass a\n * styled node to override the ink; the size is owned by the slot.\n */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Consequence bullets rendered as a list at the top of the body — one item\n * per outcome (what is deleted, what survives, who loses access). Use on\n * destructive confirms where the one-line description undersells the\n * impact; keep each item to a single short sentence. Wrap the load-bearing\n * figure in `<strong>` (\"<strong>3 members</strong> lose access\") — the\n * list styles it (secondary ink, medium weight); no classes needed.\n */\n consequences?: ReactNode[];\n /**\n * Final cautionary line under `consequences` — error ink at description\n * size (e.g. \"It cannot be undone. Please be certain.\"). Reserve it for\n * irreversible actions; keep it short.\n */\n warning?: ReactNode;\n /**\n * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is\n * set, the header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close) and optional action row. For\n * full control, compose the parts directly (`Dialog.Portal` /\n * `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n icon,\n title,\n description,\n consequences,\n warning,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n const hasConsequences = consequences != null && consequences.length > 0;\n const hasBody =\n hasConsequences || warning != null || children != null || actions != null;\n\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n // Title row height = title only. Close is out of flow, centered\n // on the row, and may paint outside it (no clip, no stretch).\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {hasBody && (\n <div className=\"flex flex-col gap-5 px-6 py-5\">\n {hasConsequences && (\n <ul className=\"text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium\">\n {consequences.map((item, index) => (\n // Hand-drawn marker: a 4px dot on the first line's center —\n // quieter than the browser disc, ink tracks the text.\n <li\n key={index}\n className=\"relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current\"\n >\n {item}\n </li>\n ))}\n </ul>\n )}\n {warning != null && (\n <p className=\"text-pho-error text-display-xs font-medium\">\n {warning}\n </p>\n )}\n {children}\n {actions != null && (\n <div className=\"flex items-center justify-end gap-2\">\n {actions}\n </div>\n )}\n </div>\n )}\n </Popup>\n </Portal>\n );\n}\n\n/* =========================== Dialog.InsetContent =========================== */\n\n/**\n * Near-fullscreen popup — the viewport minus a breathing ring, floating over\n * a backdrop (the page stays visible through the gap, so it dims like any\n * floating layer). Still a card: border, elevation, rounded corners; the\n * scale gesture stays but shrinks to 98% — at this size 95% reads like a jump.\n */\nfunction InsetPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8\",\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface InsetContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Decorative icon above the title — same treatment as `Content`. */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Bottom action row. Iron rule as `Content`: when `actions` is set, the\n * header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience near-fullscreen panel: header pinned on top, body filling and\n * scrolling on its own, optional action row pinned at the bottom. Sits\n * between `Content` (a focused card) and `FullscreenContent` (a page\n * takeover): use it for roomy working surfaces — pickers, editors, previews —\n * that still want the page peeking through an edge.\n */\nfunction InsetContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: InsetContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n\n return (\n <Portal>\n <Backdrop />\n <InsetPopup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-5\">\n {children}\n </div>\n {actions != null && (\n <div className=\"flex shrink-0 items-center justify-end gap-2 px-6 pb-5\">\n {actions}\n </div>\n )}\n </InsetPopup>\n </Portal>\n );\n}\n\n/* ========================= Dialog.FullscreenContent ======================== */\n\n/**\n * Full-viewport popup — a page-surface takeover instead of a floating card.\n * No backdrop: the popup itself is the layer. Fade only; scale is a floating-\n * card gesture and reads wrong at viewport size.\n */\nfunction FullscreenPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none\",\n \"transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface FullscreenContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — same chrome as `Content`, but 48px\n * (`size-12`) for viewport-scale gates.\n */\n icon?: ReactNode;\n /** Heading of the takeover. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Action row under the body. Iron rule as `Content`: when `actions` is set,\n * the corner close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Corner close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience full-screen panel: the whole viewport becomes the dialog, with\n * a centered column at the standalone-flow width (28rem — the same measure as\n * onboarding / invite cards). Use for gates the visitor must deal with before\n * the page behind makes sense (e.g. binding a phone number); prefer `Content`\n * for everything conversational.\n */\nfunction FullscreenContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: FullscreenContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a corner X.\n const showCloseButton = actions == null && showClose;\n\n return (\n <Portal>\n <FullscreenPopup className={className} {...props}>\n {showCloseButton && (\n <Close\n render={<CloseButton className=\"fixed top-4 right-4 z-10\" />}\n />\n )}\n <div className=\"flex min-h-full items-center justify-center p-6\">\n <div className=\"flex w-full max-w-md flex-col gap-5\">\n {(icon || title || description) && (\n <div className=\"flex flex-col gap-1\">\n {icon && <DialogHeaderIcon size=\"lg\">{icon}</DialogHeaderIcon>}\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {children}\n {actions != null && (\n <div className=\"flex items-center justify-end gap-2\">\n {actions}\n </div>\n )}\n </div>\n </div>\n </FullscreenPopup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`\n * adds native promise support: an async confirm keeps the dialog open and\n * undismissable until the work resolves.\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n InsetPopup,\n FullscreenPopup,\n Title,\n Description,\n Close,\n Action,\n Content,\n InsetContent,\n FullscreenContent,\n};\n"],"mappings":";;;;;;AA2CA,IAAM,IAAuB,EAC3B,IACF;AAOA,SAAgB,IAA4B;AAC1C,SAAO,EAAW,CAAoB,GAAG,WAAW;AACtD;AAUA,SAAS,EAAK,EAAE,cAAA,GAAc,YAAA,GAAY,GAAG,EAAA,GAAoB;AAC/D,QAAM,CAAC,GAAS,CAAA,IAAc,EAAS,EAAK,GAGtC,IAAa,EAAO,EAAK,GACzB,IAAqB,EAA2B,IAAI;AAG1D,EAAA,EAAA,MAAgB;AACd,QAAK;AACL,aAAA,EAAW,UAAU,EAAmB,SACxC,MAAa;AACX,QAAA,EAAW,UAAU;AAAA,MACvB;AAAA,EACF,GAAG,CAAC,CAAU,CAAC;AAEf,QAAM,IAAmB,EAAA,CACtB,GAAM,MAAiB;AACtB,QAAI,CAAC,KAAQ,EAAW,SAAS;AAC/B,MAAA,EAAa,OAAO;AACpB;AAAA,IACF;AACA,IAAA,IAAe,GAAM,CAAY;AAAA,EACnC,GACA,CAAC,CAAY,CACf,GAEM,IAAe,EAAA,OACZ;AAAA,IACL,SAAA;AAAA,IACA,cAAA,MAAoB;AAClB,MAAA,EAAW,UAAU,IACrB,EAAW,EAAI;AAAA,IACjB;AAAA,IACA,YAAA,MAAkB;AAChB,MAAA,EAAW,UAAU,IACrB,EAAW,EAAK;AAA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,CAAA;AAEZ;AAQA,IAAa,IAAS;AAAA,EACpB,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,mBAAA;AACF"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as a } from "./cn-DTiB6ek_.js";
|
|
3
|
-
import { n as
|
|
4
|
-
import { d as
|
|
5
|
-
import { t as
|
|
3
|
+
import { n as I, r as N } from "./link-provider-9TFNyDqO.js";
|
|
4
|
+
import { d as E } from "./close-button-B8gF5UNk.js";
|
|
5
|
+
import { t as R } from "./createReactComponent-BqCmnqfX.js";
|
|
6
|
+
import { t as _ } from "./IconArrowUpRight-DGgKzQwV.js";
|
|
6
7
|
import { n as l } from "./avatar-CiAvJNNs.js";
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
key: "svg-0"
|
|
12
|
-
}], ["path", {
|
|
13
|
-
d: "M8 7l9 0l0 9",
|
|
14
|
-
key: "svg-1"
|
|
15
|
-
}]], k = h("outline", "arrow-up-right", "ArrowUpRight", A), w = [
|
|
8
|
+
import { createContext as A, isValidElement as S, useContext as T, useMemo as k } from "react";
|
|
9
|
+
import { Fragment as w, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
10
|
+
import { motion as c } from "motion/react";
|
|
11
|
+
var C = [
|
|
16
12
|
["path", {
|
|
17
13
|
d: "M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
18
14
|
key: "svg-0"
|
|
@@ -25,54 +21,63 @@ var A = [["path", {
|
|
|
25
21
|
d: "M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
26
22
|
key: "svg-2"
|
|
27
23
|
}]
|
|
28
|
-
],
|
|
24
|
+
], D = R("outline", "dots", "Dots", C), u = {
|
|
25
|
+
initial: !1,
|
|
26
|
+
whileTap: { scale: 0.97 },
|
|
27
|
+
transition: {
|
|
28
|
+
type: "spring",
|
|
29
|
+
stiffness: 200,
|
|
30
|
+
damping: 30,
|
|
31
|
+
mass: 0.1
|
|
32
|
+
}
|
|
33
|
+
}, x = "border-pho-secondary bg-pho-page sticky top-0 flex h-dvh w-64 shrink-0 flex-col border-r", g = {
|
|
29
34
|
base: "px-4 pt-5 pb-4",
|
|
30
35
|
sm: "px-3 pt-4 pb-3"
|
|
31
|
-
},
|
|
36
|
+
}, ae = a(x, g.base), B = {
|
|
32
37
|
base: "mb-6 px-2",
|
|
33
38
|
sm: "mb-3 px-0"
|
|
34
|
-
},
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */ t(
|
|
39
|
+
}, O = "outline-pho-brand flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-base transition-colors focus-visible:outline-2 focus-visible:-outline-offset-1", M = "bg-pho-primary text-pho-primary ring-pho-secondary font-medium ring-1 ring-inset *:data-icon:text-pho-primary", L = a("text-pho-secondary *:data-icon:text-pho-secondary", "hover:bg-pho-primary hover:text-pho-primary hover:*:data-icon:text-pho-primary"), b = A("base");
|
|
40
|
+
function z({ className: r, inset: e = "base", ...o }) {
|
|
41
|
+
return /* @__PURE__ */ t(b.Provider, {
|
|
37
42
|
value: e,
|
|
38
43
|
children: /* @__PURE__ */ t("aside", {
|
|
39
|
-
className: a(
|
|
44
|
+
className: a(x, g[e], r),
|
|
40
45
|
...o,
|
|
41
46
|
"data-inset": e
|
|
42
47
|
})
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
|
-
function
|
|
50
|
+
function F({ className: r, ...e }) {
|
|
46
51
|
return /* @__PURE__ */ t("div", {
|
|
47
|
-
className: a("flex items-center gap-2.5",
|
|
52
|
+
className: a("flex items-center gap-2.5", B[T(b)], r),
|
|
48
53
|
...e
|
|
49
54
|
});
|
|
50
55
|
}
|
|
51
|
-
function
|
|
56
|
+
function V({ className: r, ...e }) {
|
|
52
57
|
return /* @__PURE__ */ t("nav", {
|
|
53
58
|
className: a("flex flex-1 flex-col gap-6 overflow-y-auto", r),
|
|
54
59
|
...e
|
|
55
60
|
});
|
|
56
61
|
}
|
|
57
|
-
function
|
|
62
|
+
function U({ className: r, ...e }) {
|
|
58
63
|
return /* @__PURE__ */ t("div", {
|
|
59
64
|
className: r,
|
|
60
65
|
...e
|
|
61
66
|
});
|
|
62
67
|
}
|
|
63
|
-
function
|
|
68
|
+
function j({ className: r, ...e }) {
|
|
64
69
|
return /* @__PURE__ */ t("div", {
|
|
65
70
|
className: a("text-pho-description mb-2 px-2 text-xs font-normal", r),
|
|
66
71
|
...e
|
|
67
72
|
});
|
|
68
73
|
}
|
|
69
|
-
function
|
|
74
|
+
function G({ className: r, columns: e, ...o }) {
|
|
70
75
|
return /* @__PURE__ */ t("ul", {
|
|
71
76
|
className: a("m-0 list-none p-0 *:m-0", e ? "grid grid-cols-2 gap-x-2 gap-y-0.5" : "flex flex-col gap-0.5", r),
|
|
72
77
|
...o
|
|
73
78
|
});
|
|
74
79
|
}
|
|
75
|
-
function
|
|
80
|
+
function H({ className: r, ...e }) {
|
|
76
81
|
return /* @__PURE__ */ t("div", {
|
|
77
82
|
className: a("mt-4 flex flex-col gap-0.5", r),
|
|
78
83
|
...e
|
|
@@ -81,59 +86,62 @@ function V({ className: r, ...e }) {
|
|
|
81
86
|
function p(r) {
|
|
82
87
|
if (r == null || r === !1) return null;
|
|
83
88
|
let e = null;
|
|
84
|
-
return
|
|
89
|
+
return N(r) ? e = /* @__PURE__ */ t(r, {}) : S(r) && (e = r), e == null ? null : /* @__PURE__ */ t("span", {
|
|
85
90
|
"data-icon": !0,
|
|
86
91
|
className: "pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-4 [&>svg]:shrink-0",
|
|
87
92
|
children: e
|
|
88
93
|
});
|
|
89
94
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
95
|
+
function P({ icon: r, active: e, className: o, children: i, href: s, external: m, ...d }) {
|
|
96
|
+
const f = I(), y = k(() => c.create(f), [f]), h = a(O, e ? M : L, o), v = /* @__PURE__ */ t("span", {
|
|
92
97
|
className: "min-w-0 flex-1 truncate",
|
|
93
98
|
children: i
|
|
94
99
|
});
|
|
95
|
-
return s !== void 0 ? /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
|
|
100
|
+
return s !== void 0 ? /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(y, {
|
|
96
101
|
href: s,
|
|
97
102
|
"aria-current": e ? "page" : void 0,
|
|
98
|
-
...
|
|
103
|
+
...m && {
|
|
99
104
|
target: "_blank",
|
|
100
105
|
rel: "noopener noreferrer"
|
|
101
106
|
},
|
|
107
|
+
...d,
|
|
108
|
+
className: h,
|
|
102
109
|
...u,
|
|
103
|
-
className: d,
|
|
104
110
|
children: [
|
|
105
111
|
p(r),
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
v,
|
|
113
|
+
m && /* @__PURE__ */ n(w, { children: [p(/* @__PURE__ */ t(_, { "aria-hidden": !0 })), /* @__PURE__ */ t("span", {
|
|
108
114
|
className: "sr-only",
|
|
109
115
|
children: "(opens in a new tab)"
|
|
110
116
|
})] })
|
|
111
117
|
]
|
|
112
|
-
}) }) : /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
|
|
118
|
+
}) }) : /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(c.button, {
|
|
113
119
|
type: "button",
|
|
114
120
|
"aria-current": e ? "page" : void 0,
|
|
121
|
+
...d,
|
|
122
|
+
className: h,
|
|
115
123
|
...u,
|
|
116
|
-
|
|
117
|
-
children: [p(r), m]
|
|
124
|
+
children: [p(r), v]
|
|
118
125
|
}) });
|
|
119
126
|
}
|
|
120
|
-
var
|
|
121
|
-
function
|
|
127
|
+
var W = "group outline-pho-brand flex w-full cursor-pointer items-center gap-2 rounded-base p-2 text-left focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
128
|
+
function q(r) {
|
|
122
129
|
const e = r.split(/\s+/).filter(Boolean);
|
|
123
130
|
return ((e[0]?.[0] ?? r[0] ?? "?") + (e.length >= 2 ? e[e.length - 1]?.[0] ?? "" : "")).toUpperCase();
|
|
124
131
|
}
|
|
125
|
-
function
|
|
126
|
-
return /* @__PURE__ */ n(
|
|
132
|
+
function J({ name: r, avatarSrc: e, initials: o, className: i, ...s }) {
|
|
133
|
+
return /* @__PURE__ */ n(c.button, {
|
|
127
134
|
type: "button",
|
|
128
|
-
className: a(
|
|
135
|
+
className: a(W, i),
|
|
129
136
|
...s,
|
|
137
|
+
...u,
|
|
130
138
|
children: [
|
|
131
139
|
/* @__PURE__ */ n(l.Root, {
|
|
132
140
|
size: "xs",
|
|
133
141
|
children: [e && /* @__PURE__ */ t(l.Image, {
|
|
134
142
|
src: e,
|
|
135
143
|
alt: ""
|
|
136
|
-
}), /* @__PURE__ */ t(l.Fallback, { children: o ??
|
|
144
|
+
}), /* @__PURE__ */ t(l.Fallback, { children: o ?? q(r) })]
|
|
137
145
|
}),
|
|
138
146
|
/* @__PURE__ */ t("span", {
|
|
139
147
|
className: "text-pho-primary min-w-0 flex-1 truncate text-base",
|
|
@@ -141,37 +149,37 @@ function P({ name: r, avatarSrc: e, initials: o, className: i, ...s }) {
|
|
|
141
149
|
}),
|
|
142
150
|
/* @__PURE__ */ t("span", {
|
|
143
151
|
"aria-hidden": !0,
|
|
144
|
-
className:
|
|
152
|
+
className: E({
|
|
145
153
|
variant: "outlined",
|
|
146
154
|
size: "sm",
|
|
147
155
|
shape: "circle",
|
|
148
|
-
className: "group-hover:bg-pho-primary-hover group-hover:text-pho-secondary-hover group-data-[popup-open]:bg-pho-primary-hover group-data-[popup-open]:text-pho-secondary-hover p-1
|
|
156
|
+
className: "group-hover:bg-pho-primary-hover group-hover:text-pho-secondary-hover group-data-[popup-open]:bg-pho-primary-hover group-data-[popup-open]:text-pho-secondary-hover p-1"
|
|
149
157
|
}),
|
|
150
|
-
children: /* @__PURE__ */ t(
|
|
158
|
+
children: /* @__PURE__ */ t(D, { className: "size-4" })
|
|
151
159
|
})
|
|
152
160
|
]
|
|
153
161
|
});
|
|
154
162
|
}
|
|
155
|
-
var
|
|
156
|
-
Root:
|
|
157
|
-
Header:
|
|
158
|
-
Nav:
|
|
159
|
-
Group:
|
|
160
|
-
GroupLabel:
|
|
161
|
-
List:
|
|
162
|
-
Item:
|
|
163
|
-
Footer:
|
|
164
|
-
AccountRow:
|
|
163
|
+
var oe = {
|
|
164
|
+
Root: z,
|
|
165
|
+
Header: F,
|
|
166
|
+
Nav: V,
|
|
167
|
+
Group: U,
|
|
168
|
+
GroupLabel: j,
|
|
169
|
+
List: G,
|
|
170
|
+
Item: P,
|
|
171
|
+
Footer: H,
|
|
172
|
+
AccountRow: J
|
|
165
173
|
};
|
|
166
174
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
x as a,
|
|
176
|
+
oe as c,
|
|
177
|
+
L as i,
|
|
178
|
+
O as n,
|
|
179
|
+
ae as o,
|
|
180
|
+
M as r,
|
|
181
|
+
g as s,
|
|
182
|
+
B as t
|
|
175
183
|
};
|
|
176
184
|
|
|
177
|
-
//# sourceMappingURL=sidebar-
|
|
185
|
+
//# sourceMappingURL=sidebar-DLYTxo2j.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-DLYTxo2j.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.44.0_react@19.2.7/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs","../../src/sections/sidebar/sidebar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.44.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-2\" }]];\nconst IconDots = createReactComponent(\"outline\", \"dots\", \"Dots\", __iconNode);\n\nexport { __iconNode, IconDots as default };\n//# sourceMappingURL=IconDots.mjs.map\n","import {\n createContext,\n isValidElement,\n useContext,\n useMemo,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type ComponentProps,\n type ComponentType,\n type FC,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { IconArrowUpRight, IconDots } from \"@tabler/icons-react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../../utils/cn\";\nimport { isReactComponent } from \"../../utils/is-react-component\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\nimport { Avatar } from \"../../components/avatar\";\nimport { buttonVariants } from \"../../components/button\";\n\n/** Same press compression as `Button` — transform-only, every interactive row. */\nconst SIDEBAR_PRESS_SCALE = 0.97;\n/** Framer source transition shared with `Button`: `spring-physics 200 30 0.1`. */\nconst SIDEBAR_PRESS_SPRING = {\n type: \"spring\",\n stiffness: 200,\n damping: 30,\n mass: 0.1,\n} as const;\nconst SIDEBAR_PRESS_MOTION = {\n initial: false as const,\n whileTap: { scale: SIDEBAR_PRESS_SCALE },\n transition: SIDEBAR_PRESS_SPRING,\n};\n\n/**\n * Sidebar — Pho's first SECTION: a composed app rail, not a micro component.\n * It encodes the navigation rail used across Photon surfaces (the Pho docs\n * site, the dashboard): a sticky full-height column with a brand header, a\n * scrollable stack of titled nav groups, and a pinned footer that usually\n * carries the account row.\n *\n * Sections stay presentational — no router, no data fetching, no theme\n * plumbing. Links render through the host's `LinkProvider` (same contract as\n * `ButtonLink`), state arrives via props (`active`), and interactive footers\n * compose with other Pho parts (e.g. wrap `Sidebar.AccountRow` in a\n * `Menu.Trigger render={...}` to open an account menu).\n *\n * `Root` takes `inset` (`base` | `sm`, default `base`) for the rail's outer\n * padding and header spacing — prefer that over host-app class overrides.\n */\n\n/* ------------------------------- class map ------------------------------- */\n\n/** The rail itself — sticky, full-height, hairline right edge (no inset). */\nexport const SIDEBAR_ROOT =\n \"border-pho-secondary bg-pho-page sticky top-0 flex h-dvh w-64 shrink-0 flex-col border-r\";\n\n/** Outer inset on `Root` — `base` is the docs/default rail; `sm` is tighter. */\nexport const SIDEBAR_ROOT_INSET = {\n base: \"px-4 pt-5 pb-4\",\n sm: \"px-3 pt-4 pb-3\",\n} as const;\n\n/** `SIDEBAR_ROOT` with the default `base` inset — one string for docs chrome. */\nexport const SIDEBAR_ROOT_BASE = cn(SIDEBAR_ROOT, SIDEBAR_ROOT_INSET.base);\n\n/** Header spacing paired with `Root`'s `inset`. */\nexport const SIDEBAR_HEADER_INSET = {\n base: \"mb-6 px-2\",\n sm: \"mb-3 px-0\",\n} as const;\n\nexport type SidebarInset = keyof typeof SIDEBAR_ROOT_INSET;\n\n/** A nav row at rest and on hover. Active/inactive inks split below. */\nexport const SIDEBAR_ITEM =\n \"outline-pho-brand flex min-h-9 w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left text-base transition-colors focus-visible:outline-2 focus-visible:-outline-offset-1\";\n\n/**\n * Selected row — lifted onto the primary surface with the site hairline.\n * The icon carries the same ink as the label so the pair reads as one unit.\n */\nexport const SIDEBAR_ITEM_ACTIVE =\n \"bg-pho-primary text-pho-primary ring-pho-secondary font-medium ring-1 ring-inset *:data-icon:text-pho-primary\";\n\n/**\n * Resting row — secondary ink (75%). Hover lifts onto the primary surface\n * (same plane as the active chip, without the ring) so the wash stays quiet\n * on `pho-page`. Icon tracks the label's ink at every state.\n */\nexport const SIDEBAR_ITEM_INACTIVE = cn(\n \"text-pho-secondary *:data-icon:text-pho-secondary\",\n \"hover:bg-pho-primary hover:text-pho-primary hover:*:data-icon:text-pho-primary\",\n);\n\nconst SidebarInsetContext = createContext<SidebarInset>(\"base\");\n\n/* --------------------------------- frame --------------------------------- */\n\ninterface RootProps extends ComponentProps<\"aside\"> {\n /** Outer padding + header spacing. Defaults to `base`. */\n inset?: SidebarInset;\n ref?: Ref<HTMLElement>;\n}\n\n/** The rail — a sticky, full-height `<aside>` with the hairline right edge. */\nfunction Root({ className, inset = \"base\", ...props }: RootProps) {\n return (\n <SidebarInsetContext.Provider value={inset}>\n <aside\n className={cn(SIDEBAR_ROOT, SIDEBAR_ROOT_INSET[inset], className)}\n {...props}\n data-inset={inset}\n />\n </SidebarInsetContext.Provider>\n );\n}\n\n/** Brand slot at the top of the rail — logo, wordmark, workspace switcher. */\nfunction Header({ className, ...props }: ComponentProps<\"div\">) {\n const inset = useContext(SidebarInsetContext);\n return (\n <div\n className={cn(\n \"flex items-center gap-2.5\",\n SIDEBAR_HEADER_INSET[inset],\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The scrollable middle — a stack of `Sidebar.Group`s. */\nfunction Nav({ className, ...props }: ComponentProps<\"nav\">) {\n return (\n <nav\n className={cn(\"flex flex-1 flex-col gap-6 overflow-y-auto\", className)}\n {...props}\n />\n );\n}\n\n/** One titled cluster of nav rows: a `GroupLabel` followed by a `List`. */\nfunction Group({ className, ...props }: ComponentProps<\"div\">) {\n return <div className={className} {...props} />;\n}\n\n/** The cluster's caption — description ink, regular weight. */\nfunction GroupLabel({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"text-pho-description mb-2 px-2 text-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface ListProps extends ComponentProps<\"ul\"> {\n /** Lay the rows out in two columns — for long, flat registries. */\n columns?: boolean;\n}\n\n/** The rows of a group. `columns` switches to a two-column grid. */\nfunction List({ className, columns, ...props }: ListProps) {\n return (\n <ul\n className={cn(\n // list-none/m-0/p-0 shield the rail from host prose styles.\n \"m-0 list-none p-0 *:m-0\",\n columns\n ? \"grid grid-cols-2 gap-x-2 gap-y-0.5\"\n : \"flex flex-col gap-0.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Pinned bottom cluster — docs link, account row, theme toggle. */\nfunction Footer({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div className={cn(\"mt-4 flex flex-col gap-0.5\", className)} {...props} />\n );\n}\n\n/* --------------------------------- item ---------------------------------- */\n\n/** An icon slot — a component (`IconBook`) or element (`<IconBook />`). */\ntype Slottable = ReactNode | FC<{ className?: string }>;\n\nfunction renderIcon(icon: Slottable): ReactNode {\n if (icon == null || icon === false) return null;\n let content: ReactNode = null;\n if (isReactComponent(icon)) {\n const Icon = icon;\n content = <Icon />;\n } else if (isValidElement(icon)) {\n content = icon;\n }\n if (content == null) return null;\n return (\n <span\n data-icon\n className=\"pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-4 [&>svg]:shrink-0\"\n >\n {content}\n </span>\n );\n}\n\ninterface ItemBaseProps {\n /** Slot before the label — a component (`IconBook`) or element. */\n icon?: Slottable;\n /** Marks the row as the current destination (adds `aria-current=\"page\"`). */\n active?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * DOM handlers whose React signatures clash with Motion's gesture props.\n * Same omit list as `Button` — rows render through `motion.*`.\n */\ntype MotionHandlerConflicts =\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onDragEnter\"\n | \"onDragExit\"\n | \"onDragLeave\"\n | \"onDragOver\"\n | \"onDrop\";\n\nexport interface SidebarItemLinkProps\n extends\n ItemBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ItemBaseProps | MotionHandlerConflicts\n > {\n /** Destination — rendered through the host's `LinkProvider`. */\n href: string;\n /** Leaves the app: opens in a new tab and renders a ↗ cue. */\n external?: boolean;\n}\n\nexport interface SidebarItemButtonProps\n extends\n ItemBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ItemBaseProps | MotionHandlerConflicts\n > {\n href?: undefined;\n external?: undefined;\n}\n\nexport type SidebarItemProps = SidebarItemLinkProps | SidebarItemButtonProps;\n\n/**\n * A nav row — a link when `href` is given (rendered through the host's\n * `LinkProvider`), otherwise a button. `active` lifts the row onto the\n * primary surface; `external` opens a new tab and appends a ↗ cue.\n */\nfunction Item({\n icon,\n active,\n className,\n children,\n href,\n external,\n ...rest\n}: SidebarItemProps) {\n const Link = useLinkComponent();\n // Same bridge as `ButtonLink` — host `LinkProvider` + Motion press scale.\n const MotionLink = useMemo(\n () =>\n motion.create(Link as unknown as ComponentType<Record<string, unknown>>),\n [Link],\n );\n const rowClass = cn(\n SIDEBAR_ITEM,\n active ? SIDEBAR_ITEM_ACTIVE : SIDEBAR_ITEM_INACTIVE,\n className,\n );\n const label = <span className=\"min-w-0 flex-1 truncate\">{children}</span>;\n\n if (href !== undefined) {\n return (\n <li>\n <MotionLink\n href={href}\n aria-current={active ? \"page\" : undefined}\n {...(external && { target: \"_blank\", rel: \"noopener noreferrer\" })}\n {...(rest as AnchorHTMLAttributes<HTMLAnchorElement>)}\n className={rowClass}\n {...SIDEBAR_PRESS_MOTION}\n >\n {renderIcon(icon)}\n {label}\n {external && (\n <>\n {renderIcon(<IconArrowUpRight aria-hidden />)}\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </MotionLink>\n </li>\n );\n }\n\n return (\n <li>\n <motion.button\n type=\"button\"\n aria-current={active ? \"page\" : undefined}\n {...(rest as Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n MotionHandlerConflicts\n >)}\n className={rowClass}\n {...SIDEBAR_PRESS_MOTION}\n >\n {renderIcon(icon)}\n {label}\n </motion.button>\n </li>\n );\n}\n\n/* ------------------------------ account row ------------------------------ */\n\n/**\n * Whole-row account trigger. The row itself stays visually quiet — it only\n * carries the `group` state (hover/press/popup-open) and the focus ring;\n * all visual feedback renders on the ⋯ circle via `group-*` classes.\n */\nconst ACCOUNT_ROW =\n \"group outline-pho-brand flex w-full cursor-pointer items-center gap-2 rounded-base p-2 text-left focus-visible:outline-2 focus-visible:outline-offset-2\";\n\n/** Avatar initials: first + last word initial, else the first character. */\nfunction initialsFrom(name: string): string {\n const words = name.split(/\\s+/).filter(Boolean);\n const first = words[0]?.[0] ?? name[0] ?? \"?\";\n const last = words.length >= 2 ? (words[words.length - 1]?.[0] ?? \"\") : \"\";\n return (first + last).toUpperCase();\n}\n\nexport interface SidebarAccountRowProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"children\" | MotionHandlerConflicts\n> {\n /** Display name — also the source for fallback initials. */\n name: string;\n /** Avatar image URL; falls back to initials while loading or on error. */\n avatarSrc?: string;\n /** Override the derived initials. */\n initials?: string;\n ref?: Ref<HTMLButtonElement>;\n}\n\n/**\n * The account chip pinned to the rail's footer — an xs avatar, the name, and\n * a decorative ⋯ circle. The WHOLE row is one button, but the row is only the\n * control — the circle is the indicator: hover, press, and menu-open feedback\n * all render on the ⋯ (a span wearing the stock secondary-circle button\n * classes), driven by the row's `group` state, so it reads as a button\n * without nesting one.\n *\n * It renders a plain `<button>` and forwards every prop, so it slots straight\n * into a menu: `<Menu.Trigger render={<Sidebar.AccountRow name=\"…\" />} />` —\n * Base UI's `data-popup-open` / `data-pressed` states light up the circle.\n */\nfunction AccountRow({\n name,\n avatarSrc,\n initials,\n className,\n ...props\n}: SidebarAccountRowProps) {\n return (\n <motion.button\n type=\"button\"\n className={cn(ACCOUNT_ROW, className)}\n {...props}\n {...SIDEBAR_PRESS_MOTION}\n >\n <Avatar.Root size=\"xs\">\n {avatarSrc && <Avatar.Image src={avatarSrc} alt=\"\" />}\n <Avatar.Fallback>{initials ?? initialsFrom(name)}</Avatar.Fallback>\n </Avatar.Root>\n <span className=\"text-pho-primary min-w-0 flex-1 truncate text-base\">\n {name}\n </span>\n <span\n aria-hidden\n className={buttonVariants({\n variant: \"outlined\",\n size: \"sm\",\n shape: \"circle\",\n // Hover / open washes stay on the ⋯; press scale lives on the row\n // (same as Button / Sidebar.Item) so the circle does not double-scale.\n className:\n \"group-hover:bg-pho-primary-hover group-hover:text-pho-secondary-hover group-data-[popup-open]:bg-pho-primary-hover group-data-[popup-open]:text-pho-secondary-hover p-1\",\n })}\n >\n <IconDots className=\"size-4\" />\n </span>\n </motion.button>\n );\n}\n\n/* -------------------------------- assembly ------------------------------- */\n\n/**\n * The composed sidebar rail. Assemble the frame parts and fill them with\n * rows; wire interactivity by composing other Pho parts around them:\n *\n * ```tsx\n * <Sidebar.Root>\n * <Sidebar.Header>…brand…</Sidebar.Header>\n * <Sidebar.Nav>\n * <Sidebar.Group>\n * <Sidebar.GroupLabel>Pages</Sidebar.GroupLabel>\n * <Sidebar.List>\n * <Sidebar.Item href=\"/\" icon={IconHome} active>\n * Overview\n * </Sidebar.Item>\n * </Sidebar.List>\n * </Sidebar.Group>\n * </Sidebar.Nav>\n * <Sidebar.Footer>\n * <Menu.Root>\n * <Menu.Trigger render={<Sidebar.AccountRow name=\"Ada Lovelace\" />} />\n * …\n * </Menu.Root>\n * </Sidebar.Footer>\n * </Sidebar.Root>\n * ```\n */\nexport const Sidebar = {\n Root,\n Header,\n Nav,\n Group,\n GroupLabel,\n List,\n Item,\n Footer,\n AccountRow,\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AASA,IAAM,IAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAsC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuC,KAAO;AAAA,EAAQ,CAAC;AAAC,GACzO,IAAW,EAAqB,WAAW,QAA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