@photon-ai/pho-ui 2.3.0 → 2.4.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/basic-page-c_7Ii5Fr.js +1117 -0
- package/dist/chunks/basic-page-c_7Ii5Fr.js.map +1 -0
- package/dist/chunks/{dialog-fWS3A3Z-.js → dialog-8SRNi_rv.js} +2 -2
- package/dist/chunks/{dialog-fWS3A3Z-.js.map → dialog-8SRNi_rv.js.map} +1 -1
- package/dist/chunks/{input-CCd6XK7Z.js → input-DjvZoF8v.js} +45 -41
- package/dist/chunks/input-DjvZoF8v.js.map +1 -0
- package/dist/chunks/{input-group-5AtpIhC_.js → input-group-fc9_jD4d.js} +44 -38
- package/dist/chunks/input-group-fc9_jD4d.js.map +1 -0
- package/dist/chunks/kbd-DNI10uy7.js +18 -0
- package/dist/chunks/kbd-DNI10uy7.js.map +1 -0
- package/dist/chunks/{scroll-area-DkZHKfqH.js → scroll-area-Bu7egArU.js} +40 -26
- package/dist/chunks/scroll-area-Bu7egArU.js.map +1 -0
- package/dist/chunks/sidebar-DvB-G0BP.js +231 -0
- package/dist/chunks/sidebar-DvB-G0BP.js.map +1 -0
- package/dist/chunks/toast-DoXaRPIZ.js +167 -0
- package/dist/chunks/toast-DoXaRPIZ.js.map +1 -0
- package/dist/components/command.js +125 -172
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/kbd.js +2 -15
- package/dist/components/phone-input.js +1 -1
- package/dist/components/scroll-area.js +3 -2
- package/dist/components/toast.js +3 -57
- package/dist/index.js +65 -58
- package/dist/primitives.js +1 -1
- package/dist/sections/basic-page.js +15 -8
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/command/command.d.ts +5 -4
- package/dist/src/components/input/input.d.ts +10 -1
- package/dist/src/components/input-group/input-group.d.ts +9 -2
- package/dist/src/components/scroll-area/index.d.ts +1 -0
- package/dist/src/components/scroll-area/scroll-area-edges.d.ts +6 -0
- package/dist/src/components/scroll-area/scroll-area.d.ts +15 -2
- package/dist/src/components/toast/index.d.ts +1 -1
- package/dist/src/components/toast/toast.d.ts +22 -7
- package/dist/src/sections/basic-page/basic-page.d.ts +105 -2
- package/dist/src/sections/basic-page/index.d.ts +1 -1
- package/dist/src/sections/sidebar/sidebar.d.ts +33 -3
- package/package.json +1 -1
- package/src/styles/pho.css +19 -0
- package/dist/chunks/basic-page-BkLG3Ybg.js +0 -942
- package/dist/chunks/basic-page-BkLG3Ybg.js.map +0 -1
- package/dist/chunks/input-CCd6XK7Z.js.map +0 -1
- package/dist/chunks/input-group-5AtpIhC_.js.map +0 -1
- package/dist/chunks/scroll-area-DkZHKfqH.js.map +0 -1
- package/dist/chunks/sidebar-Dt1F_CEP.js +0 -186
- package/dist/chunks/sidebar-Dt1F_CEP.js.map +0 -1
- package/dist/components/kbd.js.map +0 -1
- package/dist/components/toast.js.map +0 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as n } from "./cn-ChIgwEl3.js";
|
|
3
|
+
import { n as R, r as E } from "./link-provider-9TFNyDqO.js";
|
|
4
|
+
import { a as S, u as _ } from "./button-DNNs5RsT.js";
|
|
5
|
+
import { t as g } from "./createReactComponent-BqCmnqfX.js";
|
|
6
|
+
import { t as A } from "./IconArrowUpRight-DGgKzQwV.js";
|
|
7
|
+
import { n as d } from "./avatar-BkmGDIqf.js";
|
|
8
|
+
import { t as u } from "./scroll-area-Bu7egArU.js";
|
|
9
|
+
import { t as k } from "./kbd-DNI10uy7.js";
|
|
10
|
+
import { createContext as w, isValidElement as C, useContext as T, useMemo as M } from "react";
|
|
11
|
+
import { Fragment as B, jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
12
|
+
import { motion as h } from "motion/react";
|
|
13
|
+
var D = [
|
|
14
|
+
["path", {
|
|
15
|
+
d: "M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
16
|
+
key: "svg-0"
|
|
17
|
+
}],
|
|
18
|
+
["path", {
|
|
19
|
+
d: "M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
20
|
+
key: "svg-1"
|
|
21
|
+
}],
|
|
22
|
+
["path", {
|
|
23
|
+
d: "M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
24
|
+
key: "svg-2"
|
|
25
|
+
}]
|
|
26
|
+
], O = g("outline", "dots", "Dots", D), z = [["path", {
|
|
27
|
+
d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",
|
|
28
|
+
key: "svg-0"
|
|
29
|
+
}], ["path", {
|
|
30
|
+
d: "M21 21l-6 -6",
|
|
31
|
+
key: "svg-1"
|
|
32
|
+
}]], F = g("outline", "search", "Search", z), f = {
|
|
33
|
+
initial: !1,
|
|
34
|
+
whileTap: { scale: 0.97 },
|
|
35
|
+
transition: {
|
|
36
|
+
type: "spring",
|
|
37
|
+
stiffness: 200,
|
|
38
|
+
damping: 30,
|
|
39
|
+
mass: 0.1
|
|
40
|
+
}
|
|
41
|
+
}, b = "border-pho-secondary bg-pho-page sticky top-0 flex h-dvh w-64 shrink-0 flex-col border-r", y = {
|
|
42
|
+
base: "px-4 pt-5 pb-4",
|
|
43
|
+
sm: "px-3 pt-4 pb-3"
|
|
44
|
+
}, ue = n(b, y.base), K = {
|
|
45
|
+
base: "mb-6 px-2",
|
|
46
|
+
sm: "mb-3 px-0"
|
|
47
|
+
}, L = "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", V = "bg-pho-primary text-pho-primary ring-pho-secondary font-medium ring-1 ring-inset *:data-icon:text-pho-primary", j = n("text-pho-secondary *:data-icon:text-pho-secondary", "hover:bg-pho-primary hover:text-pho-primary hover:*:data-icon:text-pho-primary"), N = w("base");
|
|
48
|
+
function U({ className: a, inset: e = "base", ...r }) {
|
|
49
|
+
return /* @__PURE__ */ t(N.Provider, {
|
|
50
|
+
value: e,
|
|
51
|
+
children: /* @__PURE__ */ t("aside", {
|
|
52
|
+
className: n(b, y[e], a),
|
|
53
|
+
...r,
|
|
54
|
+
"data-inset": e
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function G({ className: a, ...e }) {
|
|
59
|
+
const r = T(N);
|
|
60
|
+
return /* @__PURE__ */ t("div", {
|
|
61
|
+
className: n("flex items-center gap-2.5 [&:has(+nav)]:mb-0", K[r], a),
|
|
62
|
+
...e
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function H({ label: a = "Search", kbd: e = "⌘K", className: r, ...o }) {
|
|
66
|
+
return /* @__PURE__ */ t(S, {
|
|
67
|
+
variant: "outlined",
|
|
68
|
+
shape: "square",
|
|
69
|
+
size: "md",
|
|
70
|
+
"aria-keyshortcuts": e === "⌘K" ? "Meta+K Control+K" : void 0,
|
|
71
|
+
prefix: /* @__PURE__ */ t(F, { "aria-hidden": !0 }),
|
|
72
|
+
suffix: /* @__PURE__ */ t(k, {
|
|
73
|
+
keys: e,
|
|
74
|
+
className: "pointer-events-none"
|
|
75
|
+
}),
|
|
76
|
+
className: n("hover:ring-pho-secondary min-h-9 w-full justify-start gap-2 rounded-sm px-2 py-1.5 has-[[data-icon=prefix]]:pl-2 has-[[data-icon=suffix]]:pr-2 [&>[data-text]]:min-w-0 [&>[data-text]]:flex-1 [&>[data-text]]:truncate [&>[data-text]]:px-0 [&>[data-text]]:text-left", r),
|
|
77
|
+
...o,
|
|
78
|
+
children: a
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function P({ scroll: a = !0, inset: e, insetTop: r = e ?? 24, insetBottom: o = e ?? 16, className: s, style: l, children: p, ...c }) {
|
|
82
|
+
return a ? /* @__PURE__ */ t("nav", {
|
|
83
|
+
className: n("flex min-h-0 flex-1 flex-col", s),
|
|
84
|
+
style: l,
|
|
85
|
+
...c,
|
|
86
|
+
children: /* @__PURE__ */ i(u.Root, {
|
|
87
|
+
className: "min-h-0 flex-1",
|
|
88
|
+
children: [/* @__PURE__ */ t(u.Viewport, { children: /* @__PURE__ */ t(u.Content, {
|
|
89
|
+
inset: e,
|
|
90
|
+
insetTop: r,
|
|
91
|
+
insetBottom: o,
|
|
92
|
+
className: "flex flex-col gap-6",
|
|
93
|
+
children: p
|
|
94
|
+
}) }), /* @__PURE__ */ t(u.Scrollbar, { children: /* @__PURE__ */ t(u.Thumb, {}) })]
|
|
95
|
+
})
|
|
96
|
+
}) : /* @__PURE__ */ t("nav", {
|
|
97
|
+
className: n("flex flex-col gap-6", s),
|
|
98
|
+
style: {
|
|
99
|
+
paddingTop: r ?? e,
|
|
100
|
+
paddingBottom: o ?? e,
|
|
101
|
+
...l
|
|
102
|
+
},
|
|
103
|
+
...c,
|
|
104
|
+
children: p
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function $({ className: a, ...e }) {
|
|
108
|
+
return /* @__PURE__ */ t("div", {
|
|
109
|
+
className: a,
|
|
110
|
+
...e
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function q({ className: a, ...e }) {
|
|
114
|
+
return /* @__PURE__ */ t("div", {
|
|
115
|
+
className: n("text-pho-description mb-2 px-2 text-xs font-normal", a),
|
|
116
|
+
...e
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function W({ className: a, columns: e, ...r }) {
|
|
120
|
+
return /* @__PURE__ */ t("ul", {
|
|
121
|
+
className: n("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", a),
|
|
122
|
+
...r
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function J({ className: a, ...e }) {
|
|
126
|
+
return /* @__PURE__ */ t("div", {
|
|
127
|
+
className: n("mt-4 flex flex-col gap-0.5 [nav~&]:mt-0", a),
|
|
128
|
+
...e
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function m(a) {
|
|
132
|
+
if (a == null || a === !1) return null;
|
|
133
|
+
let e = null;
|
|
134
|
+
return E(a) ? e = /* @__PURE__ */ t(a, {}) : C(a) && (e = a), e == null ? null : /* @__PURE__ */ t("span", {
|
|
135
|
+
"data-icon": !0,
|
|
136
|
+
className: "pointer-events-none inline-flex shrink-0 items-center [&>svg]:size-4 [&>svg]:shrink-0",
|
|
137
|
+
children: e
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function Q({ icon: a, active: e, className: r, children: o, href: s, external: l, ...p }) {
|
|
141
|
+
const c = R(), I = M(() => h.create(c), [c]), x = n(L, e ? V : j, r), v = /* @__PURE__ */ t("span", {
|
|
142
|
+
className: "min-w-0 flex-1 truncate",
|
|
143
|
+
children: o
|
|
144
|
+
});
|
|
145
|
+
return s !== void 0 ? /* @__PURE__ */ t("li", { children: /* @__PURE__ */ i(I, {
|
|
146
|
+
href: s,
|
|
147
|
+
"aria-current": e ? "page" : void 0,
|
|
148
|
+
...l && {
|
|
149
|
+
target: "_blank",
|
|
150
|
+
rel: "noopener noreferrer"
|
|
151
|
+
},
|
|
152
|
+
...p,
|
|
153
|
+
className: x,
|
|
154
|
+
...f,
|
|
155
|
+
children: [
|
|
156
|
+
m(a),
|
|
157
|
+
v,
|
|
158
|
+
l && /* @__PURE__ */ i(B, { children: [m(/* @__PURE__ */ t(A, { "aria-hidden": !0 })), /* @__PURE__ */ t("span", {
|
|
159
|
+
className: "sr-only",
|
|
160
|
+
children: "(opens in a new tab)"
|
|
161
|
+
})] })
|
|
162
|
+
]
|
|
163
|
+
}) }) : /* @__PURE__ */ t("li", { children: /* @__PURE__ */ i(h.button, {
|
|
164
|
+
type: "button",
|
|
165
|
+
"aria-current": e ? "page" : void 0,
|
|
166
|
+
...p,
|
|
167
|
+
className: x,
|
|
168
|
+
...f,
|
|
169
|
+
children: [m(a), v]
|
|
170
|
+
}) });
|
|
171
|
+
}
|
|
172
|
+
var X = "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";
|
|
173
|
+
function Y(a) {
|
|
174
|
+
const e = a.split(/\s+/).filter(Boolean);
|
|
175
|
+
return ((e[0]?.[0] ?? a[0] ?? "?") + (e.length >= 2 ? e[e.length - 1]?.[0] ?? "" : "")).toUpperCase();
|
|
176
|
+
}
|
|
177
|
+
function Z({ name: a, avatarSrc: e, initials: r, className: o, ...s }) {
|
|
178
|
+
return /* @__PURE__ */ i(h.button, {
|
|
179
|
+
type: "button",
|
|
180
|
+
className: n(X, o),
|
|
181
|
+
...s,
|
|
182
|
+
...f,
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ i(d.Root, {
|
|
185
|
+
size: "xs",
|
|
186
|
+
children: [e && /* @__PURE__ */ t(d.Image, {
|
|
187
|
+
src: e,
|
|
188
|
+
alt: ""
|
|
189
|
+
}), /* @__PURE__ */ t(d.Fallback, { children: r ?? Y(a) })]
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ t("span", {
|
|
192
|
+
className: "text-pho-primary min-w-0 flex-1 truncate text-base",
|
|
193
|
+
children: a
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ t("span", {
|
|
196
|
+
"aria-hidden": !0,
|
|
197
|
+
className: _({
|
|
198
|
+
variant: "outlined",
|
|
199
|
+
size: "sm",
|
|
200
|
+
shape: "circle",
|
|
201
|
+
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"
|
|
202
|
+
}),
|
|
203
|
+
children: /* @__PURE__ */ t(O, { className: "size-4" })
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
var de = {
|
|
209
|
+
Root: U,
|
|
210
|
+
Header: G,
|
|
211
|
+
Search: H,
|
|
212
|
+
Nav: P,
|
|
213
|
+
Group: $,
|
|
214
|
+
GroupLabel: q,
|
|
215
|
+
List: W,
|
|
216
|
+
Item: Q,
|
|
217
|
+
Footer: J,
|
|
218
|
+
AccountRow: Z
|
|
219
|
+
};
|
|
220
|
+
export {
|
|
221
|
+
b as a,
|
|
222
|
+
de as c,
|
|
223
|
+
j as i,
|
|
224
|
+
L as n,
|
|
225
|
+
ue as o,
|
|
226
|
+
V as r,
|
|
227
|
+
y as s,
|
|
228
|
+
K as t
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
//# sourceMappingURL=sidebar-DvB-G0BP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-DvB-G0BP.js","names":["__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconDots.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs","../../src/sections/sidebar/sidebar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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","/**\n * @license @tabler/icons-react v3.46.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\": \"M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 21l-6 -6\", \"key\": \"svg-1\" }]];\nconst IconSearch = createReactComponent(\"outline\", \"search\", \"Search\", __iconNode);\n\nexport { __iconNode, IconSearch as default };\n//# sourceMappingURL=IconSearch.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 { IconSearch } from \"@tabler/icons-react\";\nimport { Button } from \"../../components/button\";\nimport { Kbd } from \"../../components/kbd\";\nimport { ScrollArea } from \"../../components/scroll-area\";\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 [&:has(+nav)]:mb-0\",\n SIDEBAR_HEADER_INSET[inset],\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * The rail's search row — an outlined button dressed to `Item` metrics so\n * its label lines up with the rows below, the shortcut at the trailing\n * edge. The press is the Button's own; wire `onClick` (and a global ⌘K)\n * to a `Command.Dialog`.\n */\nfunction Search({\n label = \"Search\",\n kbd = \"⌘K\",\n className,\n ...props\n}: Omit<ComponentProps<typeof Button>, \"children\" | \"variant\" | \"size\"> & {\n label?: ReactNode;\n kbd?: string;\n}) {\n return (\n <Button\n variant=\"outlined\"\n shape=\"square\"\n size=\"md\"\n aria-keyshortcuts={kbd === \"⌘K\" ? \"Meta+K Control+K\" : undefined}\n prefix={<IconSearch aria-hidden />}\n suffix={<Kbd keys={kbd} className=\"pointer-events-none\" />}\n className={cn(\n \"hover:ring-pho-secondary min-h-9 w-full justify-start gap-2 rounded-sm px-2 py-1.5 has-[[data-icon=prefix]]:pl-2 has-[[data-icon=suffix]]:pr-2 [&>[data-text]]:min-w-0 [&>[data-text]]:flex-1 [&>[data-text]]:truncate [&>[data-text]]:px-0 [&>[data-text]]:text-left\",\n className,\n )}\n {...props}\n >\n {label}\n </Button>\n );\n}\n\n/**\n * The scrollable middle — a stack of `Sidebar.Group`s in a `ScrollArea`\n * (overlay scrollbar, edge fade). Pass `scroll={false}` where a parent\n * scrolls the whole rail as one column (a narrow-viewport drawer) — the\n * nav is then a plain stack at its natural height.\n *\n * The nav owns its breathing room toward its neighbors as a resting inset\n * (a scroll view's safe-area padding): 24px above, 16px below by default —\n * rows stand clear of the ends at rest and scroll through the gap, under\n * the edge fade, instead of clipping at a dead margin. `inset` /\n * `insetTop` / `insetBottom` override it; the same values become plain\n * padding when `scroll={false}`, so both modes keep one geometry. A\n * `Header` right before the nav and a `Footer` after it drop their own\n * margins — the gap lives here, not on the neighbors.\n */\nfunction Nav({\n scroll = true,\n inset,\n insetTop = inset ?? 24,\n insetBottom = inset ?? 16,\n className,\n style,\n children,\n ...props\n}: ComponentProps<\"nav\"> & {\n scroll?: boolean;\n inset?: number | string;\n insetTop?: number | string;\n insetBottom?: number | string;\n}) {\n if (!scroll) {\n return (\n <nav\n className={cn(\"flex flex-col gap-6\", className)}\n style={{\n paddingTop: insetTop ?? inset,\n paddingBottom: insetBottom ?? inset,\n ...style,\n }}\n {...props}\n >\n {children}\n </nav>\n );\n }\n return (\n <nav\n className={cn(\"flex min-h-0 flex-1 flex-col\", className)}\n style={style}\n {...props}\n >\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content\n inset={inset}\n insetTop={insetTop}\n insetBottom={insetBottom}\n className=\"flex flex-col gap-6\"\n >\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </nav>\n );\n}\n\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\n className={cn(\"mt-4 flex flex-col gap-0.5 [nav~&]:mt-0\", className)}\n {...props}\n />\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 Search,\n Nav,\n Group,\n GroupLabel,\n List,\n Item,\n Footer,\n AccountRow,\n};\n"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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as n } from "./cn-ChIgwEl3.js";
|
|
3
|
+
import { n as y } from "./spinner-BzLUo4Xk.js";
|
|
4
|
+
import { a as _ } from "./button-DNNs5RsT.js";
|
|
5
|
+
import { t as i } from "./createReactComponent-BqCmnqfX.js";
|
|
6
|
+
import { t as b } from "./IconX-pZ9vrtSr.js";
|
|
7
|
+
import "./scroll-area-Bu7egArU.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
import { AnimatePresence as w, motion as k, useReducedMotion as z } from "motion/react";
|
|
11
|
+
import { Toast as o } from "@base-ui/react/toast";
|
|
12
|
+
var T = [["path", {
|
|
13
|
+
d: "M14.897 1a4 4 0 0 1 2.664 1.016l.165 .156l4.1 4.1a4 4 0 0 1 1.168 2.605l.006 .227v5.794a4 4 0 0 1 -1.016 2.664l-.156 .165l-4.1 4.1a4 4 0 0 1 -2.603 1.168l-.227 .006h-5.795a3.999 3.999 0 0 1 -2.664 -1.017l-.165 -.156l-4.1 -4.1a4 4 0 0 1 -1.168 -2.604l-.006 -.227v-5.794a4 4 0 0 1 1.016 -2.664l.156 -.165l4.1 -4.1a4 4 0 0 1 2.605 -1.168l.227 -.006h5.793zm-2.887 14l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z",
|
|
14
|
+
key: "svg-0"
|
|
15
|
+
}]], N = i("filled", "alert-octagon-filled", "AlertOctagonFilled", T), C = [["path", {
|
|
16
|
+
d: "M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z",
|
|
17
|
+
key: "svg-0"
|
|
18
|
+
}]], A = i("filled", "alert-triangle-filled", "AlertTriangleFilled", C), M = [["path", {
|
|
19
|
+
d: "M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z",
|
|
20
|
+
key: "svg-0"
|
|
21
|
+
}]], P = i("filled", "circle-check-filled", "CircleCheckFilled", M), F = [["path", {
|
|
22
|
+
d: "M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z",
|
|
23
|
+
key: "svg-0"
|
|
24
|
+
}]], I = i("filled", "info-circle-filled", "InfoCircleFilled", F), Y = {
|
|
25
|
+
duration: 0.2,
|
|
26
|
+
ease: "easeOut"
|
|
27
|
+
}, c = o.Provider, d = o.Portal, p = o.Action, S = o.useToastManager, X = o.createToastManager, $ = {
|
|
28
|
+
success: P,
|
|
29
|
+
error: N,
|
|
30
|
+
warning: A,
|
|
31
|
+
info: I
|
|
32
|
+
}, O = {
|
|
33
|
+
success: "bg-[color-mix(in_oklab,var(--text-color-pho-success)_7%,transparent)]",
|
|
34
|
+
error: "bg-[color-mix(in_oklab,var(--text-color-pho-error)_7%,transparent)]",
|
|
35
|
+
warning: "bg-[color-mix(in_oklab,var(--text-color-pho-warning)_7%,transparent)]",
|
|
36
|
+
info: "bg-[color-mix(in_oklab,var(--text-color-pho-brand)_7%,transparent)]"
|
|
37
|
+
};
|
|
38
|
+
function m({ className: a, ...e }) {
|
|
39
|
+
return /* @__PURE__ */ t(o.Viewport, {
|
|
40
|
+
className: n("fixed right-4 bottom-4 z-50 flex w-[calc(100%-2rem)] outline-none sm:w-[22rem]", a),
|
|
41
|
+
...e
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function h({ className: a, ...e }) {
|
|
45
|
+
return /* @__PURE__ */ t(o.Root, {
|
|
46
|
+
className: n("bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base absolute right-0 bottom-0 w-full origin-bottom ring-1 select-none ring-inset", "[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]", "[--offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--gap)*-1+var(--toast-swipe-movement-y,0px))]", "[z-index:calc(1000-var(--toast-index))] h-[var(--height)]", "[transform:translateX(var(--toast-swipe-movement-x,0px))_translateY(calc(var(--toast-swipe-movement-y,0px)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]", "[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s,box-shadow_0.2s_ease-out]", "after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']", "data-[expanded]:h-[var(--toast-height)] data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x,0px))_translateY(var(--offset-y))]", "data-[limited]:opacity-0", "data-[starting-style]:[transform:translateY(150%)]", "data-[ending-style]:opacity-0", "[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]", "data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)+150%))]", "data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)-150%))]", "data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)-150%))_translateY(var(--offset-y))]", "data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)+150%))_translateY(var(--offset-y))]", "data-[swiping]:[transition:none]", "data-[type=success]:[&_[data-toast-icon]]:text-pho-success data-[type=success]:[&_[data-toast-title]]:text-pho-success data-[type=success]:[&_[data-toast-action]]:text-pho-success data-[type=success]:[&_[data-toast-close]]:text-pho-success data-[type=success]:ring-[color-mix(in_oklab,var(--text-color-pho-success)_45%,transparent)] data-[type=success]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-success)_45%,transparent)]", "data-[type=error]:[&_[data-toast-icon]]:text-pho-error data-[type=error]:[&_[data-toast-title]]:text-pho-error data-[type=error]:[&_[data-toast-action]]:text-pho-error data-[type=error]:[&_[data-toast-close]]:text-pho-error data-[type=error]:ring-[color-mix(in_oklab,var(--text-color-pho-error)_45%,transparent)] data-[type=error]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-error)_45%,transparent)]", "data-[type=warning]:[&_[data-toast-icon]]:text-pho-warning data-[type=warning]:[&_[data-toast-title]]:text-pho-warning data-[type=warning]:[&_[data-toast-action]]:text-pho-warning data-[type=warning]:[&_[data-toast-close]]:text-pho-warning data-[type=warning]:ring-[color-mix(in_oklab,var(--text-color-pho-warning)_45%,transparent)] data-[type=warning]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-warning)_45%,transparent)]", "data-[type=info]:[&_[data-toast-icon]]:text-pho-brand data-[type=info]:[&_[data-toast-title]]:text-pho-brand data-[type=info]:[&_[data-toast-action]]:text-pho-brand data-[type=info]:[&_[data-toast-close]]:text-pho-brand data-[type=info]:ring-[color-mix(in_oklab,var(--text-color-pho-brand)_45%,transparent)] data-[type=info]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-brand)_45%,transparent)]", a),
|
|
47
|
+
...e
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function v({ className: a, ...e }) {
|
|
51
|
+
return /* @__PURE__ */ t(o.Content, {
|
|
52
|
+
className: n("isolate flex flex-col p-4 pr-10 transition-opacity [transition-duration:250ms]", "data-[behind]:pointer-events-none data-[behind]:opacity-0 data-[expanded]:pointer-events-auto data-[expanded]:opacity-100", a),
|
|
53
|
+
...e
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function u({ className: a, ...e }) {
|
|
57
|
+
return /* @__PURE__ */ t(o.Title, {
|
|
58
|
+
"data-toast-title": !0,
|
|
59
|
+
className: n("text-pho-primary text-md font-medium", a),
|
|
60
|
+
...e
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function f({ className: a, ...e }) {
|
|
64
|
+
return /* @__PURE__ */ t(o.Description, {
|
|
65
|
+
className: n("text-pho-description text-md", a),
|
|
66
|
+
...e
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function x({ className: a, ...e }) {
|
|
70
|
+
return /* @__PURE__ */ t(o.Close, {
|
|
71
|
+
"data-toast-close": !0,
|
|
72
|
+
className: n("text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4", a),
|
|
73
|
+
...e
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function R({ type: a }) {
|
|
77
|
+
if (a === "loading") return /* @__PURE__ */ t(y, {
|
|
78
|
+
"aria-hidden": !0,
|
|
79
|
+
className: "mb-2 size-6 shrink-0"
|
|
80
|
+
});
|
|
81
|
+
const e = a != null ? $[a] : void 0;
|
|
82
|
+
return e == null ? null : /* @__PURE__ */ t(e, {
|
|
83
|
+
"aria-hidden": !0,
|
|
84
|
+
"data-toast-icon": !0,
|
|
85
|
+
className: "mb-2 size-6 shrink-0"
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function j() {
|
|
89
|
+
const { toasts: a, close: e } = o.useToastManager(), s = z() ? "blur(0px)" : "blur(1px)";
|
|
90
|
+
return a.map((r) => /* @__PURE__ */ l(h, {
|
|
91
|
+
toast: r,
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ t("div", {
|
|
94
|
+
"aria-hidden": !0,
|
|
95
|
+
className: n("pointer-events-none absolute inset-0 rounded-[inherit] transition-colors duration-200 ease-out", r.type != null ? O[r.type] : void 0)
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ t(v, { children: /* @__PURE__ */ t("span", {
|
|
98
|
+
className: "grid",
|
|
99
|
+
children: /* @__PURE__ */ t(w, {
|
|
100
|
+
initial: !1,
|
|
101
|
+
children: /* @__PURE__ */ l(k.div, {
|
|
102
|
+
className: "flex min-w-0 flex-col [grid-area:1/1]",
|
|
103
|
+
initial: {
|
|
104
|
+
opacity: 0,
|
|
105
|
+
filter: s
|
|
106
|
+
},
|
|
107
|
+
animate: {
|
|
108
|
+
opacity: 1,
|
|
109
|
+
filter: "blur(0px)"
|
|
110
|
+
},
|
|
111
|
+
exit: {
|
|
112
|
+
opacity: 0,
|
|
113
|
+
filter: s
|
|
114
|
+
},
|
|
115
|
+
transition: Y,
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ t(R, { type: r.type }),
|
|
118
|
+
/* @__PURE__ */ t(u, { children: r.title }),
|
|
119
|
+
/* @__PURE__ */ t(f, { children: r.description }),
|
|
120
|
+
r.actionProps != null ? /* @__PURE__ */ t(p, {
|
|
121
|
+
"data-toast-action": !0,
|
|
122
|
+
render: /* @__PURE__ */ t(_, {
|
|
123
|
+
variant: "outlined",
|
|
124
|
+
size: "sm"
|
|
125
|
+
}),
|
|
126
|
+
className: "mt-2 self-start",
|
|
127
|
+
onClick: (g) => {
|
|
128
|
+
r.actionProps?.onClick?.(g), e(r.id);
|
|
129
|
+
},
|
|
130
|
+
children: r.actionProps.children
|
|
131
|
+
}) : null
|
|
132
|
+
]
|
|
133
|
+
}, `${r.type ?? ""}|${String(r.title ?? "")}`)
|
|
134
|
+
})
|
|
135
|
+
}) }),
|
|
136
|
+
/* @__PURE__ */ t(x, {
|
|
137
|
+
"aria-label": "Dismiss",
|
|
138
|
+
children: /* @__PURE__ */ t(b, {})
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
}, r.id));
|
|
142
|
+
}
|
|
143
|
+
function K({ children: a, toastManager: e }) {
|
|
144
|
+
return /* @__PURE__ */ l(c, {
|
|
145
|
+
toastManager: e,
|
|
146
|
+
children: [a, /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(j, {}) }) })]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
var Q = {
|
|
150
|
+
Provider: c,
|
|
151
|
+
Portal: d,
|
|
152
|
+
Viewport: m,
|
|
153
|
+
Root: h,
|
|
154
|
+
Content: v,
|
|
155
|
+
Title: u,
|
|
156
|
+
Description: f,
|
|
157
|
+
Close: x,
|
|
158
|
+
Action: p,
|
|
159
|
+
useToastManager: S,
|
|
160
|
+
createToastManager: X
|
|
161
|
+
};
|
|
162
|
+
export {
|
|
163
|
+
K as n,
|
|
164
|
+
Q as t
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=toast-DoXaRPIZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-DoXaRPIZ.js","names":["__iconNode","__iconNode","__iconNode"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertOctagonFilled.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangleFilled.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconCircleCheckFilled.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircleFilled.mjs","../../src/components/toast/toast.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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\": \"M14.897 1a4 4 0 0 1 2.664 1.016l.165 .156l4.1 4.1a4 4 0 0 1 1.168 2.605l.006 .227v5.794a4 4 0 0 1 -1.016 2.664l-.156 .165l-4.1 4.1a4 4 0 0 1 -2.603 1.168l-.227 .006h-5.795a3.999 3.999 0 0 1 -2.664 -1.017l-.165 -.156l-4.1 -4.1a4 4 0 0 1 -1.168 -2.604l-.006 -.227v-5.794a4 4 0 0 1 1.016 -2.664l.156 -.165l4.1 -4.1a4 4 0 0 1 2.605 -1.168l.227 -.006h5.793zm-2.887 14l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -8a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z\", \"key\": \"svg-0\" }]];\nconst IconAlertOctagonFilled = createReactComponent(\"filled\", \"alert-octagon-filled\", \"AlertOctagonFilled\", __iconNode);\n\nexport { __iconNode, IconAlertOctagonFilled as default };\n//# sourceMappingURL=IconAlertOctagonFilled.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.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\": \"M12 1.67c.955 0 1.845 .467 2.39 1.247l.105 .16l8.114 13.548a2.914 2.914 0 0 1 -2.307 4.363l-.195 .008h-16.225a2.914 2.914 0 0 1 -2.582 -4.2l.099 -.185l8.11 -13.538a2.914 2.914 0 0 1 2.491 -1.403zm.01 13.33l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-.01 -7a1 1 0 0 0 -.993 .883l-.007 .117v4l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-4l-.007 -.117a1 1 0 0 0 -.993 -.883z\", \"key\": \"svg-0\" }]];\nconst IconAlertTriangleFilled = createReactComponent(\"filled\", \"alert-triangle-filled\", \"AlertTriangleFilled\", __iconNode);\n\nexport { __iconNode, IconAlertTriangleFilled as default };\n//# sourceMappingURL=IconAlertTriangleFilled.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.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\": \"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z\", \"key\": \"svg-0\" }]];\nconst IconCircleCheckFilled = createReactComponent(\"filled\", \"circle-check-filled\", \"CircleCheckFilled\", __iconNode);\n\nexport { __iconNode, IconCircleCheckFilled as default };\n//# sourceMappingURL=IconCircleCheckFilled.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.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\": \"M12 2c5.523 0 10 4.477 10 10a10 10 0 0 1 -19.995 .324l-.005 -.324l.004 -.28c.148 -5.393 4.566 -9.72 9.996 -9.72zm0 9h-1l-.117 .007a1 1 0 0 0 0 1.986l.117 .007v3l.007 .117a1 1 0 0 0 .876 .876l.117 .007h1l.117 -.007a1 1 0 0 0 .876 -.876l.007 -.117l-.007 -.117a1 1 0 0 0 -.764 -.857l-.112 -.02l-.117 -.006v-3l-.007 -.117a1 1 0 0 0 -.876 -.876l-.117 -.007zm.01 -3l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z\", \"key\": \"svg-0\" }]];\nconst IconInfoCircleFilled = createReactComponent(\"filled\", \"info-circle-filled\", \"InfoCircleFilled\", __iconNode);\n\nexport { __iconNode, IconInfoCircleFilled as default };\n//# sourceMappingURL=IconInfoCircleFilled.mjs.map\n","import { type ComponentProps, type ElementType, type ReactNode } from \"react\";\nimport { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport {\n IconAlertOctagonFilled,\n IconAlertTriangleFilled,\n IconCircleCheckFilled,\n IconInfoCircleFilled,\n IconX,\n type Icon,\n} from \"@tabler/icons-react\";\nimport { BLUR_MAX_PX } from \"../scroll-area\";\nimport { Button } from \"../button\";\nimport { Spinner } from \"../spinner\";\nimport { cn } from \"../../utils/cn\";\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/** The system's swap: fade through the 1px soft focus, ease-out. */\nconst FACE_SWAP = { duration: 0.2, ease: \"easeOut\" } as const;\n\nconst Provider = BaseToast.Provider;\nconst Portal = BaseToast.Portal;\nconst Action = BaseToast.Action;\n\n/** Imperative toast API: `const toast = useToastManager(); toast.add({ title })`. */\nconst useToastManager = BaseToast.useToastManager;\nconst createToastManager = BaseToast.createToastManager;\n\n/**\n * Status glyphs per toast `type` (Kumo's set in Tabler's hand): the glyph\n * and the title take the status ink, the hairline tints with it, and a\n * translucent wash of the same ink sits over the surface. `info` speaks\n * in the brand ink — Pho has no separate info hue. `loading` is what\n * `manager.promise` shows while the work runs.\n */\nconst TOAST_ICONS: Record<string, Icon> = {\n success: IconCircleCheckFilled,\n error: IconAlertOctagonFilled,\n warning: IconAlertTriangleFilled,\n info: IconInfoCircleFilled,\n};\n\nconst TOAST_WASH: Record<string, string> = {\n success:\n \"bg-[color-mix(in_oklab,var(--text-color-pho-success)_7%,transparent)]\",\n error: \"bg-[color-mix(in_oklab,var(--text-color-pho-error)_7%,transparent)]\",\n warning:\n \"bg-[color-mix(in_oklab,var(--text-color-pho-warning)_7%,transparent)]\",\n info: \"bg-[color-mix(in_oklab,var(--text-color-pho-brand)_7%,transparent)]\",\n};\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Viewport>) {\n return (\n <BaseToast.Viewport\n // The stack's anchor box; the cards position themselves absolutely\n // against its bottom edge, and hovering any card expands the stack.\n className={cn(\n \"fixed right-4 bottom-4 z-50 flex w-[calc(100%-2rem)] outline-none sm:w-[22rem]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Root({ className, ...props }: StyledProps<typeof BaseToast.Root>) {\n return (\n <BaseToast.Root\n className={cn(\n // Floating layer: keeps its elevation shadow, sits on the card surface\n // with the site hairline (ring-pho-secondary).\n \"bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base absolute right-0 bottom-0 w-full origin-bottom ring-1 select-none ring-inset\",\n // Kumo's stack math on Base UI's variables: a 12px gap folded into\n // the expanded offsets, a 12px peek and −10% scale per depth at\n // rest, the newest card on top.\n \"[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]\",\n \"[--offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--gap)*-1+var(--toast-swipe-movement-y,0px))]\",\n \"[z-index:calc(1000-var(--toast-index))] h-[var(--height)]\",\n \"[transform:translateX(var(--toast-swipe-movement-x,0px))_translateY(calc(var(--toast-swipe-movement-y,0px)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))]\",\n \"[transition:transform_0.5s_cubic-bezier(0.22,1,0.36,1),opacity_0.5s,height_0.15s,box-shadow_0.2s_ease-out]\",\n // Invisible bridge below each card so the hover survives the gaps.\n \"after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']\",\n // Hovering (or focusing) the stack expands it into a true list.\n \"data-[expanded]:h-[var(--toast-height)] data-[expanded]:[transform:translateX(var(--toast-swipe-movement-x,0px))_translateY(var(--offset-y))]\",\n // Beyond the provider's limit a card parks invisibly until room frees.\n \"data-[limited]:opacity-0\",\n // In from below; out along the swipe, or back down when timed out.\n \"data-[starting-style]:[transform:translateY(150%)]\",\n \"data-[ending-style]:opacity-0\",\n \"[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]\",\n \"data-[ending-style]:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)+150%))]\",\n \"data-[ending-style]:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y,0px)-150%))]\",\n \"data-[ending-style]:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)-150%))_translateY(var(--offset-y))]\",\n \"data-[ending-style]:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x,0px)+150%))_translateY(var(--offset-y))]\",\n \"data-[swiping]:[transition:none]\",\n // Status inks: hairline, glyph, and title tint together per type.\n \"data-[type=success]:[&_[data-toast-icon]]:text-pho-success data-[type=success]:[&_[data-toast-title]]:text-pho-success data-[type=success]:[&_[data-toast-action]]:text-pho-success data-[type=success]:[&_[data-toast-close]]:text-pho-success data-[type=success]:ring-[color-mix(in_oklab,var(--text-color-pho-success)_45%,transparent)] data-[type=success]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-success)_45%,transparent)]\",\n \"data-[type=error]:[&_[data-toast-icon]]:text-pho-error data-[type=error]:[&_[data-toast-title]]:text-pho-error data-[type=error]:[&_[data-toast-action]]:text-pho-error data-[type=error]:[&_[data-toast-close]]:text-pho-error data-[type=error]:ring-[color-mix(in_oklab,var(--text-color-pho-error)_45%,transparent)] data-[type=error]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-error)_45%,transparent)]\",\n \"data-[type=warning]:[&_[data-toast-icon]]:text-pho-warning data-[type=warning]:[&_[data-toast-title]]:text-pho-warning data-[type=warning]:[&_[data-toast-action]]:text-pho-warning data-[type=warning]:[&_[data-toast-close]]:text-pho-warning data-[type=warning]:ring-[color-mix(in_oklab,var(--text-color-pho-warning)_45%,transparent)] data-[type=warning]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-warning)_45%,transparent)]\",\n \"data-[type=info]:[&_[data-toast-icon]]:text-pho-brand data-[type=info]:[&_[data-toast-title]]:text-pho-brand data-[type=info]:[&_[data-toast-action]]:text-pho-brand data-[type=info]:[&_[data-toast-close]]:text-pho-brand data-[type=info]:ring-[color-mix(in_oklab,var(--text-color-pho-brand)_45%,transparent)] data-[type=info]:[&_[data-toast-action]]:ring-[color-mix(in_oklab,var(--text-color-pho-brand)_45%,transparent)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Content>) {\n return (\n <BaseToast.Content\n // Cards behind the front one show only their peeking edge — the\n // words appear when the stack expands.\n className={cn(\n \"isolate flex flex-col p-4 pr-10 transition-opacity [transition-duration:250ms]\",\n \"data-[behind]:pointer-events-none data-[behind]:opacity-0 data-[expanded]:pointer-events-auto data-[expanded]:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseToast.Title>) {\n return (\n <BaseToast.Title\n data-toast-title\n className={cn(\"text-pho-primary text-md font-medium\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseToast.Description>) {\n return (\n <BaseToast.Description\n className={cn(\"text-pho-description text-md\", className)}\n {...props}\n />\n );\n}\n\nfunction Close({ className, ...props }: StyledProps<typeof BaseToast.Close>) {\n return (\n <BaseToast.Close\n data-toast-close\n className={cn(\n \"text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * The status glyph for a typed toast — its own row above the title, the\n * Dialog header's arrangement at card scale, an 8px breath before the\n * title. `loading` shows the spinner.\n */\nfunction TypeIcon({ type }: { type?: string }) {\n if (type === \"loading\") {\n return <Spinner aria-hidden className=\"mb-2 size-6 shrink-0\" />;\n }\n const Glyph = type != null ? TOAST_ICONS[type] : undefined;\n if (Glyph == null) return null;\n return <Glyph aria-hidden data-toast-icon className=\"mb-2 size-6 shrink-0\" />;\n}\n\nfunction ToastyList() {\n const { toasts, close } = BaseToast.useToastManager();\n const reduceMotion = useReducedMotion();\n const blurAway = reduceMotion ? \"blur(0px)\" : `blur(${BLUR_MAX_PX}px)`;\n return toasts.map((toast) => (\n <Root key={toast.id} toast={toast}>\n {/* The status wash: a breath of the status ink over the surface. */}\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-0 rounded-[inherit] transition-colors duration-200 ease-out\",\n toast.type != null ? TOAST_WASH[toast.type] : undefined,\n )}\n />\n <Content>\n {/* One grid cell, faces stacked: when a promise walks the card\n from loading to its outcome, the old face fades out through\n the system's soft focus exactly where the new one fades in —\n the values ride each face, so the goer keeps its words. */}\n <span className=\"grid\">\n <AnimatePresence initial={false}>\n <motion.div\n key={`${toast.type ?? \"\"}|${String(toast.title ?? \"\")}`}\n className=\"flex min-w-0 flex-col [grid-area:1/1]\"\n initial={{ opacity: 0, filter: blurAway }}\n animate={{ opacity: 1, filter: \"blur(0px)\" }}\n exit={{ opacity: 0, filter: blurAway }}\n transition={FACE_SWAP}\n >\n <TypeIcon type={toast.type} />\n <Title>{toast.title}</Title>\n <Description>{toast.description}</Description>\n {toast.actionProps != null ? (\n <Action\n data-toast-action\n render={<Button variant=\"outlined\" size=\"sm\" />}\n className=\"mt-2 self-start\"\n onClick={(event) => {\n toast.actionProps?.onClick?.(event);\n close(toast.id);\n }}\n >\n {toast.actionProps.children}\n </Action>\n ) : null}\n </motion.div>\n </AnimatePresence>\n </span>\n </Content>\n <Close aria-label=\"Dismiss\">\n <IconX />\n </Close>\n </Root>\n ));\n}\n\n/**\n * Toasty — the whole toast system in one wrapper, Kumo-shaped: provider,\n * portal, viewport, and the stacked card list with status variants. Wrap\n * the app once and call `Toast.useToastManager().add({ title, type })`\n * from any child; pass a `toastManager` from `createToastManager()` so\n * code outside the tree (a form's auto-save, a query cache) can speak\n * through the same lane. `manager.promise` shows loading → success/error\n * with the matching glyphs.\n */\nexport function Toasty({\n children,\n toastManager,\n}: {\n children?: ReactNode;\n toastManager?: ComponentProps<typeof BaseToast.Provider>[\"toastManager\"];\n}) {\n return (\n <Provider toastManager={toastManager}>\n {children}\n <Portal>\n <Viewport>\n <ToastyList />\n </Viewport>\n </Portal>\n </Provider>\n );\n}\n\n/**\n * Toast built on Base UI `Toast` — transient, non-blocking notifications\n * in a sonner-style stack, styled after Cloudflare's Kumo: at rest the\n * cards collapse into a peek (12px rise and −10% scale per depth, words\n * hidden behind the front card), expand into a true list with a 12px gap\n * on hover or focus, swipe to dismiss, three visible at most. `type`\n * (`success` / `error` / `warning` / `info` / `loading`) tints hairline,\n * glyph, and title together. Reach for `Toasty` unless you need to\n * compose the parts yourself.\n */\nexport const Toast = {\n Provider,\n Portal,\n Viewport,\n Root,\n Content,\n Title,\n Description,\n Close,\n Action,\n useToastManager,\n createToastManager,\n};\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;AASA,IAAMA,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAujB,KAAO;AAAQ,CAAC,CAAC,GACtmB,IAAyB,EAAqB,UAAU,wBAAwB,sBAAsBA,CAAU,GCDhHC,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAA0Z,KAAO;AAAQ,CAAC,CAAC,GACzc,IAA0B,EAAqB,UAAU,yBAAyB,uBAAuBA,CAAU,GCDnHC,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAgS,KAAO;AAAQ,CAAC,CAAC,GAC/U,IAAwB,EAAqB,UAAU,uBAAuB,qBAAqBA,CAAU,GCD7G,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAA6b,KAAO;AAAQ,CAAC,CAAC,GAC5e,IAAuB,EAAqB,UAAU,sBAAsB,oBAAoB,CAAU,GCe1G,IAAY;AAAA,EAAE,UAAU;AAAA,EAAK,MAAM;AAAU,GAE7C,IAAW,EAAU,UACrB,IAAS,EAAU,QACnB,IAAS,EAAU,QAGnB,IAAkB,EAAU,iBAC5B,IAAqB,EAAU,oBAS/B,IAAoC;AAAA,EACxC,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR,GAEM,IAAqC;AAAA,EACzC,SACE;AA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