@photon-ai/pho-ui 4.26.0 → 4.27.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/README.md +2 -2
- package/dist/chunks/{avatar-PgBOfszL.js → avatar-BJvgi8ON.js} +24 -30
- package/dist/chunks/avatar-BJvgi8ON.js.map +1 -0
- package/dist/chunks/{basic-page-aep8pM4s.js → basic-page-DSPzDKrZ.js} +79 -82
- package/dist/chunks/basic-page-DSPzDKrZ.js.map +1 -0
- package/dist/chunks/{box-search-CMl5bQ7Y.js → box-search-DD2EPtDy.js} +18 -19
- package/dist/chunks/box-search-DD2EPtDy.js.map +1 -0
- package/dist/chunks/{calendar-DDWITGo4.js → calendar-s-QRks1Z.js} +66 -69
- package/dist/chunks/calendar-s-QRks1Z.js.map +1 -0
- package/dist/chunks/{chat-D98GCjbe.js → chat-D6SGRahp.js} +226 -276
- package/dist/chunks/chat-D6SGRahp.js.map +1 -0
- package/dist/chunks/{checkbox-D8smFViR.js → checkbox-B3fVczYP.js} +2 -2
- package/dist/chunks/checkbox-B3fVczYP.js.map +1 -0
- package/dist/chunks/{close-button-Ck4rY1Fp.js → close-button-Bwv_OoCZ.js} +2 -2
- package/dist/chunks/close-button-Bwv_OoCZ.js.map +1 -0
- package/dist/chunks/{code-block-CthLWfxd.js → code-block-CiZWZBO2.js} +169 -238
- package/dist/chunks/code-block-CiZWZBO2.js.map +1 -0
- package/dist/chunks/copy-button-DNNZu6r4.js +69 -0
- package/dist/chunks/copy-button-DNNZu6r4.js.map +1 -0
- package/dist/chunks/{data-table-C1tLUdw0.js → data-table-CshUlqIu.js} +11 -12
- package/dist/chunks/data-table-CshUlqIu.js.map +1 -0
- package/dist/chunks/{date-picker-D-sWo3i8.js → date-picker-BaAkim2u.js} +126 -151
- package/dist/chunks/date-picker-BaAkim2u.js.map +1 -0
- package/dist/chunks/{description-list-DcTvBHzI.js → description-list-VTNz1MmJ.js} +2 -2
- package/dist/chunks/{description-list-DcTvBHzI.js.map → description-list-VTNz1MmJ.js.map} +1 -1
- package/dist/chunks/{dialog-H72fZGtf.js → dialog-C116Qr0w.js} +2 -2
- package/dist/chunks/{dialog-H72fZGtf.js.map → dialog-C116Qr0w.js.map} +1 -1
- package/dist/chunks/{filter-bar-D_sBAT5Y.js → filter-bar-DI5JO1Cd.js} +63 -72
- package/dist/chunks/filter-bar-DI5JO1Cd.js.map +1 -0
- package/dist/chunks/{ghost-search-CMUI2UH0.js → ghost-search-DhADxaWi.js} +11 -12
- package/dist/chunks/ghost-search-DhADxaWi.js.map +1 -0
- package/dist/chunks/icons-eq5FZ3Yc.js +1254 -0
- package/dist/chunks/icons-eq5FZ3Yc.js.map +1 -0
- package/dist/chunks/{input-DWnb33UF.js → input-hrrPhzXp.js} +37 -56
- package/dist/chunks/input-hrrPhzXp.js.map +1 -0
- package/dist/chunks/{select-Dux2SBVc.js → select-DlyDd7AB.js} +10 -10
- package/dist/chunks/select-DlyDd7AB.js.map +1 -0
- package/dist/chunks/{sidebar-ttBkgGRh.js → sidebar-DTRcoxrB.js} +95 -111
- package/dist/chunks/sidebar-DTRcoxrB.js.map +1 -0
- package/dist/chunks/{toast-Cbnn8lcA.js → toast-Btwu5Kjk.js} +7 -7
- package/dist/chunks/toast-Btwu5Kjk.js.map +1 -0
- package/dist/chunks/{trace-ClMpG82z.js → trace-CKYAff2U.js} +498 -607
- package/dist/chunks/trace-CKYAff2U.js.map +1 -0
- package/dist/components/avatar.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/command.js +36 -37
- package/dist/components/command.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/error.js +252 -11
- package/dist/components/error.js.map +1 -0
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/notification.js +27 -34
- package/dist/components/notification.js.map +1 -1
- package/dist/components/phone-input.js +3 -4
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/scope.js +52 -53
- package/dist/components/scope.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/theme-toggle.js +69 -95
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/icons.js +235 -78
- package/dist/icons.js.map +1 -1
- package/dist/index.js +158 -158
- package/dist/sections/basic-page.js +2 -2
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/avatar/avatar.d.ts +1 -1
- package/dist/src/components/notification/notification.d.ts +2 -2
- package/dist/src/components/trace/decorations.d.ts +3 -3
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/photon/icons.d.ts +315 -0
- package/dist/src/icons/photon/index.d.ts +2 -0
- package/dist/src/icons/photon/photon-icon.d.ts +51 -0
- package/package.json +5 -3
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js +0 -14
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +0 -1
- package/dist/chunks/IconCheck-DwSMn1wK.js +0 -11
- package/dist/chunks/IconCheck-DwSMn1wK.js.map +0 -1
- package/dist/chunks/IconChevronDown-Cd68NnX2.js +0 -11
- package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +0 -1
- package/dist/chunks/IconChevronLeft-CptqhdxO.js +0 -11
- package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +0 -1
- package/dist/chunks/IconChevronRight-BNkXCTk6.js +0 -11
- package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +0 -1
- package/dist/chunks/IconChevronUp-Bxllwz8J.js +0 -11
- package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +0 -1
- package/dist/chunks/IconInfoCircle-CTAynhe8.js +0 -21
- package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +0 -1
- package/dist/chunks/IconSearch-DkcWWZ1H.js +0 -14
- package/dist/chunks/IconSearch-DkcWWZ1H.js.map +0 -1
- package/dist/chunks/IconX-DnPlFC68.js +0 -14
- package/dist/chunks/IconX-DnPlFC68.js.map +0 -1
- package/dist/chunks/avatar-PgBOfszL.js.map +0 -1
- package/dist/chunks/basic-page-aep8pM4s.js.map +0 -1
- package/dist/chunks/box-search-CMl5bQ7Y.js.map +0 -1
- package/dist/chunks/calendar-DDWITGo4.js.map +0 -1
- package/dist/chunks/chat-D98GCjbe.js.map +0 -1
- package/dist/chunks/checkbox-D8smFViR.js.map +0 -1
- package/dist/chunks/close-button-Ck4rY1Fp.js.map +0 -1
- package/dist/chunks/code-block-CthLWfxd.js.map +0 -1
- package/dist/chunks/copy-button-BLvirhXk.js +0 -76
- package/dist/chunks/copy-button-BLvirhXk.js.map +0 -1
- package/dist/chunks/data-table-C1tLUdw0.js.map +0 -1
- package/dist/chunks/date-picker-D-sWo3i8.js.map +0 -1
- package/dist/chunks/error-BT71wcUd.js +0 -270
- package/dist/chunks/error-BT71wcUd.js.map +0 -1
- package/dist/chunks/filter-bar-D_sBAT5Y.js.map +0 -1
- package/dist/chunks/ghost-search-CMUI2UH0.js.map +0 -1
- package/dist/chunks/input-DWnb33UF.js.map +0 -1
- package/dist/chunks/select-Dux2SBVc.js.map +0 -1
- package/dist/chunks/sidebar-ttBkgGRh.js.map +0 -1
- package/dist/chunks/toast-Cbnn8lcA.js.map +0 -1
- package/dist/chunks/trace-ClMpG82z.js.map +0 -1
|
@@ -2,51 +2,50 @@
|
|
|
2
2
|
import { t as s } from "../chunks/cn-CPbhpG1q.js";
|
|
3
3
|
import { t as m } from "../chunks/resolve-variant-CcD8iG5l.js";
|
|
4
4
|
import { SPRING_SETTLE as P } from "../motion.js";
|
|
5
|
-
import {
|
|
6
|
-
import { t as V } from "../chunks/IconChevronLeft-CptqhdxO.js";
|
|
5
|
+
import { N as j, et as V } from "../chunks/icons-eq5FZ3Yc.js";
|
|
7
6
|
import { t as Z } from "../chunks/animated-height-zr7BmFY1.js";
|
|
8
|
-
import { t as u } from "../chunks/dialog-
|
|
9
|
-
import { useEffect as $, useId as z, useLayoutEffect as
|
|
7
|
+
import { t as u } from "../chunks/dialog-C116Qr0w.js";
|
|
8
|
+
import { useEffect as $, useId as z, useLayoutEffect as F, useRef as H } from "react";
|
|
10
9
|
import { Fragment as E, jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
11
|
-
import { LayoutGroup as
|
|
12
|
-
import { Command as c, useCommandState as
|
|
13
|
-
var
|
|
14
|
-
function
|
|
10
|
+
import { LayoutGroup as A, motion as g, useReducedMotion as B } from "motion/react";
|
|
11
|
+
import { Command as c, useCommandState as k } from "cmdk";
|
|
12
|
+
var W = P;
|
|
13
|
+
function L({ shouldFilter: r = !1, className: e, children: n, ...o }) {
|
|
15
14
|
const i = z();
|
|
16
15
|
return /* @__PURE__ */ t(c, {
|
|
17
16
|
className: s("bg-pho-primary text-pho-primary flex w-full flex-col overflow-hidden outline-none", e),
|
|
18
17
|
shouldFilter: r,
|
|
19
18
|
...o,
|
|
20
|
-
children: /* @__PURE__ */ t(
|
|
19
|
+
children: /* @__PURE__ */ t(A, {
|
|
21
20
|
id: i,
|
|
22
21
|
children: n
|
|
23
22
|
})
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function q({ className: r, ...e }) {
|
|
27
26
|
return /* @__PURE__ */ t("div", {
|
|
28
27
|
className: s("border-pho-secondary relative flex items-center border-b", r),
|
|
29
28
|
...e
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
|
-
var
|
|
33
|
-
function
|
|
31
|
+
var J = typeof window > "u" ? $ : F;
|
|
32
|
+
function K(r, e) {
|
|
34
33
|
typeof r == "function" ? r(e) : r && (r.current = e);
|
|
35
34
|
}
|
|
36
|
-
function
|
|
37
|
-
const i =
|
|
38
|
-
return
|
|
35
|
+
function Q({ className: r, value: e, ref: n, ...o }) {
|
|
36
|
+
const i = H(null), l = k((a) => a.search);
|
|
37
|
+
return J(() => {
|
|
39
38
|
const a = i.current;
|
|
40
39
|
e == null || a == null || e === l || (Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(a, e), a.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
41
40
|
}, [e, l]), /* @__PURE__ */ t(c.Input, {
|
|
42
41
|
className: s("text-pho-primary placeholder:text-pho-placeholder text-display-xs w-full bg-transparent px-3 py-3 outline-none disabled:cursor-not-allowed disabled:opacity-50", r),
|
|
43
42
|
...o,
|
|
44
43
|
ref: (a) => {
|
|
45
|
-
i.current = a,
|
|
44
|
+
i.current = a, K(n, a);
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
|
-
function
|
|
48
|
+
function U({ className: r, children: e, ...n }) {
|
|
50
49
|
return /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(g.div, {
|
|
51
50
|
layoutScroll: !0,
|
|
52
51
|
className: "max-h-[min(24rem,60vh)] scroll-py-1 overflow-y-auto overscroll-contain",
|
|
@@ -78,7 +77,7 @@ var ee = {
|
|
|
78
77
|
classes: "gap-2 py-2 pr-2.5 text-base",
|
|
79
78
|
description: "Default palette row"
|
|
80
79
|
}
|
|
81
|
-
},
|
|
80
|
+
}, R = {
|
|
82
81
|
sm: {
|
|
83
82
|
classes: "text-sm",
|
|
84
83
|
description: "Compact row title"
|
|
@@ -103,39 +102,39 @@ function y({ className: r, size: e = "md", ...n }) {
|
|
|
103
102
|
...n
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
|
-
function
|
|
105
|
+
function _({ className: r, level: e = "item", size: n = "md", ...o }) {
|
|
107
106
|
return /* @__PURE__ */ t("span", {
|
|
108
|
-
className: s("block truncate", m(
|
|
107
|
+
className: s("block truncate", m(R, n), e === "item" && "text-pho-primary", r),
|
|
109
108
|
...o
|
|
110
109
|
});
|
|
111
110
|
}
|
|
112
111
|
function S() {
|
|
113
|
-
return /* @__PURE__ */ t(
|
|
112
|
+
return /* @__PURE__ */ t(V, {
|
|
114
113
|
"aria-hidden": !0,
|
|
115
114
|
className: "text-pho-description size-4 shrink-0"
|
|
116
115
|
});
|
|
117
116
|
}
|
|
118
117
|
function re({ className: r, level: e = "item", size: n = "md", icon: o, iconSlot: i, title: l, path: a, scope: h, external: I, children: f, value: p, ...C }) {
|
|
119
|
-
const T = B(),
|
|
118
|
+
const T = B(), N = typeof p == "string" ? p.trim() : "", G = k((x) => x.value), M = N !== "" && G === N, v = l != null, b = e === "result", D = b && (o != null || i), w = /* @__PURE__ */ t(c.Item, {
|
|
120
119
|
"data-level": e,
|
|
121
120
|
"data-size": n,
|
|
122
121
|
value: p,
|
|
123
122
|
className: s("text-pho-secondary flex cursor-pointer items-center rounded-[calc(var(--radius-base)-4px)] outline-none select-none", m(ee, n), e === "subsubitem" ? "pl-6" : "pl-2", "data-[selected=true]:text-pho-primary data-[selected=true]:bg-pho-ghost-hover", "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", r),
|
|
124
123
|
...C,
|
|
125
|
-
children:
|
|
124
|
+
children: v && b ? /* @__PURE__ */ d(E, { children: [
|
|
126
125
|
D ? /* @__PURE__ */ t(y, {
|
|
127
126
|
size: n,
|
|
128
127
|
"aria-hidden": o == null ? !0 : void 0,
|
|
129
128
|
children: o ?? null
|
|
130
129
|
}) : null,
|
|
131
130
|
/* @__PURE__ */ d("span", {
|
|
132
|
-
className: s("flex min-w-0 flex-1 items-center gap-1 overflow-hidden", m(
|
|
131
|
+
className: s("flex min-w-0 flex-1 items-center gap-1 overflow-hidden", m(R, n)),
|
|
133
132
|
children: [/* @__PURE__ */ t("span", {
|
|
134
133
|
className: "text-pho-primary truncate",
|
|
135
134
|
children: l
|
|
136
135
|
}), (a ?? []).map((x, O) => /* @__PURE__ */ d("span", {
|
|
137
136
|
className: "text-pho-description flex shrink-0 items-center gap-0.5",
|
|
138
|
-
children: [/* @__PURE__ */ t(
|
|
137
|
+
children: [/* @__PURE__ */ t(j, {
|
|
139
138
|
"aria-hidden": !0,
|
|
140
139
|
className: "size-4 shrink-0"
|
|
141
140
|
}), x]
|
|
@@ -147,7 +146,7 @@ function re({ className: r, level: e = "item", size: n = "md", icon: o, iconSlot
|
|
|
147
146
|
}) : null,
|
|
148
147
|
I ? /* @__PURE__ */ t(S, {}) : null,
|
|
149
148
|
f
|
|
150
|
-
] }) :
|
|
149
|
+
] }) : v ? /* @__PURE__ */ d(E, { children: [
|
|
151
150
|
/* @__PURE__ */ t(y, {
|
|
152
151
|
size: n,
|
|
153
152
|
"aria-hidden": o == null ? !0 : void 0,
|
|
@@ -155,7 +154,7 @@ function re({ className: r, level: e = "item", size: n = "md", icon: o, iconSlot
|
|
|
155
154
|
}),
|
|
156
155
|
/* @__PURE__ */ t("span", {
|
|
157
156
|
className: "min-w-0 flex-1",
|
|
158
|
-
children: /* @__PURE__ */ t(
|
|
157
|
+
children: /* @__PURE__ */ t(_, {
|
|
159
158
|
level: e,
|
|
160
159
|
size: n,
|
|
161
160
|
children: l
|
|
@@ -169,7 +168,7 @@ function re({ className: r, level: e = "item", size: n = "md", icon: o, iconSlot
|
|
|
169
168
|
layout: "position",
|
|
170
169
|
layoutId: typeof p == "string" ? p : void 0,
|
|
171
170
|
initial: !1,
|
|
172
|
-
transition: M ? { duration: 0 } :
|
|
171
|
+
transition: M ? { duration: 0 } : W,
|
|
173
172
|
children: w
|
|
174
173
|
});
|
|
175
174
|
}
|
|
@@ -194,7 +193,7 @@ function se({ open: r, onOpenChange: e, label: n, className: o, children: i, ...
|
|
|
194
193
|
className: s("top-[max(4rem,18vh)] max-w-xl translate-y-0 overflow-hidden p-0", o),
|
|
195
194
|
children: /* @__PURE__ */ t(g.div, {
|
|
196
195
|
layoutRoot: !0,
|
|
197
|
-
children: /* @__PURE__ */ t(
|
|
196
|
+
children: /* @__PURE__ */ t(L, {
|
|
198
197
|
label: n,
|
|
199
198
|
...l,
|
|
200
199
|
children: i
|
|
@@ -203,23 +202,23 @@ function se({ open: r, onOpenChange: e, label: n, className: o, children: i, ...
|
|
|
203
202
|
})] })
|
|
204
203
|
});
|
|
205
204
|
}
|
|
206
|
-
var
|
|
207
|
-
Root:
|
|
208
|
-
InputGroup:
|
|
209
|
-
Input:
|
|
210
|
-
List:
|
|
205
|
+
var xe = {
|
|
206
|
+
Root: L,
|
|
207
|
+
InputGroup: q,
|
|
208
|
+
Input: Q,
|
|
209
|
+
List: U,
|
|
211
210
|
Empty: X,
|
|
212
211
|
Group: Y,
|
|
213
212
|
Item: re,
|
|
214
213
|
ItemIcon: y,
|
|
215
|
-
ItemTitle:
|
|
214
|
+
ItemTitle: _,
|
|
216
215
|
Separator: ne,
|
|
217
216
|
Loading: oe,
|
|
218
217
|
Dialog: se
|
|
219
218
|
};
|
|
220
219
|
export {
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
xe as Command,
|
|
221
|
+
k as useCommandState
|
|
223
222
|
};
|
|
224
223
|
|
|
225
224
|
//# sourceMappingURL=command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","names":["CommandPrimitive","_Fragment","PhoDialog","cn","resolveVariant","SPRING_SETTLE","IconArrowUpRight","IconChevronLeft","AnimatedHeight","Dialog$1","useEffect","useId","useLayoutEffect","useRef","Fragment$1","jsx","jsxs","LayoutGroup","motion","useReducedMotion","Command$1","useCommandState","ROW_MOVE_SPRING","Root","shouldFilter","className","children","props","layoutNamespace","InputGroup","useIsomorphicLayoutEffect","assignRef","ref","value","Input","consumerRef","inputRef","search","state","input","node","List","Empty","Group","ITEM_SIZES","ITEM_TITLE_SIZES","ITEM_ICON_SIZES","ItemIcon","size","ItemTitle","level","ExternalGlyph","Item","icon","iconSlot","title","path","scope","external","reduceMotion","trimmedValue","selectedValue","isSelected","structured","isResult","showResultIcon","row","segment","index","Separator","Loading","Dialog","open","onOpenChange","label","Command"],"sources":["../../src/components/command/command.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n type ComponentProps,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { IconArrowUpRight, IconChevronLeft } from \"@tabler/icons-react\";\nimport { SPRING_SETTLE } from \"../../motion\";\nimport { Command as CommandPrimitive, useCommandState } from \"cmdk\";\nimport { LayoutGroup, motion, useReducedMotion } from \"motion/react\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport { Dialog as PhoDialog } from \"../dialog\";\n\n/**\n * Spring for row moves (FLIP / shared-layout) — same feel as\n * `AnimatedHeight`: quick and critically damped, so rows glide to their new\n * slot without overshooting into neighbours.\n */\nconst ROW_MOVE_SPRING = SPRING_SETTLE;\n\nfunction Root({\n // Filtering is yours by default: filter in render (state above the\n // palette) so the rows' FLIP diff can glide survivors to their slots.\n // cmdk's built-in matcher reorders DOM imperatively — invisible to the\n // layout pass — so it is opt-in: pass `shouldFilter` to hand matching\n // and ranking back to cmdk at the cost of the animation.\n shouldFilter = false,\n className,\n children,\n ...props\n}: ComponentProps<typeof CommandPrimitive>) {\n // Namespace row layoutIds per palette instance — the docs page mounts the\n // inline demo and the dialog demo at once, with identical item values.\n const layoutNamespace = useId();\n return (\n <CommandPrimitive\n className={cn(\n \"bg-pho-primary text-pho-primary flex w-full flex-col overflow-hidden outline-none\",\n className,\n )}\n shouldFilter={shouldFilter}\n {...props}\n >\n <LayoutGroup id={layoutNamespace}>{children}</LayoutGroup>\n </CommandPrimitive>\n );\n}\n\n/**\n * The input row — a bottom hairline separates it from the list. Position\n * leading icons absolutely and pad the input (`pl-9`), mirroring\n * `Autocomplete.InputGroup`.\n */\nfunction InputGroup({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"border-pho-secondary relative flex items-center border-b\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** SSR-safe layout effect (same pattern cmdk uses internally). */\nconst useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref) ref.current = value;\n}\n\nfunction Input({\n className,\n value,\n ref: consumerRef,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Input>) {\n const inputRef = useRef<HTMLInputElement>(null);\n const search = useCommandState((state) => state.search);\n\n // cmdk stays uncontrolled here on purpose. Its controlled path syncs the\n // `value` prop into the search store through a passive effect — one painted\n // frame late — so on that stale frame the old row is still \"selected\" while\n // the list has already reflowed, and the selection pill visibly rides it\n // before snapping to the re-selected first row. Uncontrolled keystrokes\n // update search + first-row selection synchronously (pre-paint), killing\n // that frame in both directions (typing and clearing).\n //\n // The consumer-facing API is still controlled: external `value` changes\n // (programmatic reset, initial query) are replayed through the native input\n // path below so store, display, and selection take the same sync route.\n useIsomorphicLayoutEffect(() => {\n const input = inputRef.current;\n if (value == null || input == null || value === search) return;\n const setNativeValue = Object.getOwnPropertyDescriptor(\n HTMLInputElement.prototype,\n \"value\",\n )?.set;\n setNativeValue?.call(input, value);\n input.dispatchEvent(new Event(\"input\", { bubbles: true }));\n }, [value, search]);\n\n return (\n <CommandPrimitive.Input\n className={cn(\n // Borderless inside the palette surface — the InputGroup hairline\n // carries the edge. display-xs (18px) keeps iOS from zooming in.\n \"text-pho-primary placeholder:text-pho-placeholder text-display-xs w-full bg-transparent px-3 py-3 outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n ref={(node) => {\n inputRef.current = node;\n assignRef(consumerRef, node);\n }}\n />\n );\n}\n\nfunction List({\n className,\n children,\n ...props\n}: ComponentProps<typeof CommandPrimitive.List>) {\n return (\n // Same spring as the onboarding / invite Card shell — list height glides\n // when idle ↔ search (or filter) changes instead of jumping.\n <AnimatedHeight>\n {/* The scroller is a motion element with layoutScroll so the rows'\n FLIP projections account for its scroll offset — without it,\n scrolling reads as a layout change and every row glides to\n compensate. scroll-py keeps a breath above and below the row\n being scrolled into view. */}\n <motion.div\n layoutScroll\n className=\"max-h-[min(24rem,60vh)] scroll-py-1 overflow-y-auto overscroll-contain\"\n >\n <CommandPrimitive.List\n className={cn(\"relative isolate p-1\", className)}\n {...props}\n >\n {children}\n </CommandPrimitive.List>\n </motion.div>\n </AnimatedHeight>\n );\n}\n\nfunction Empty({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n className={cn(\n \"text-pho-description px-2.5 py-6 text-center text-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Group({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n className={cn(\n // cmdk renders the `heading` prop in a [cmdk-group-heading] wrapper —\n // typography mirrors `Autocomplete.GroupLabel`.\n \"[&_[cmdk-group-heading]]:text-pho-secondary [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Row layout mode:\n * - `item` / `subitem` / `subsubitem` — idle hierarchy (icon column + indent)\n * - `result` — flat search hit (breadcrumb + trailing scope)\n */\nexport type CommandItemLevel = \"item\" | \"subitem\" | \"subsubitem\" | \"result\";\nexport type CommandItemSize = \"sm\" | \"md\";\n\nconst ITEM_SIZES = {\n sm: {\n classes: \"gap-1.5 py-1 pr-2 text-sm\",\n description: \"Compact rows for filter lists and dense pickers\",\n },\n md: {\n classes: \"gap-2 py-2 pr-2.5 text-base\",\n description: \"Default palette row\",\n },\n} as const satisfies VariantMap;\n\nconst ITEM_TITLE_SIZES = {\n sm: { classes: \"text-sm\", description: \"Compact row title\" },\n md: { classes: \"text-md\", description: \"Default row title\" },\n} as const satisfies VariantMap;\n\nconst ITEM_ICON_SIZES = {\n sm: {\n classes: \"size-3.5 [&>svg]:size-3.5\",\n description: \"Compact leading glyph\",\n },\n md: {\n classes: \"size-4 [&>svg]:size-4\",\n description: \"Default leading glyph\",\n },\n} as const satisfies VariantMap;\n\ntype ItemPrimitiveProps = ComponentProps<typeof CommandPrimitive.Item>;\n\nexport interface CommandItemProps extends Omit<\n ItemPrimitiveProps,\n \"children\" | \"title\"\n> {\n /**\n * Row depth / mode in the palette:\n * - `item` — page / top destination (icon + title)\n * - `subitem` — section under an item (label aligns with the item title)\n * - `subsubitem` — row under a section (one step deeper)\n * - `result` — flat search hit (`title` + `path` crumbs + `scope`)\n */\n level?: CommandItemLevel;\n /**\n * Leading glyph. On idle `item` rows (and reserved for sub-levels). On\n * `result` rows, pass the resolved icon (self → parent → grandparent).\n */\n icon?: ReactNode;\n /**\n * When `level=\"result\"`, force the icon column so labels align across the\n * list even if this row's `icon` is empty. Set true when any sibling result\n * has an icon; omit when the whole result set is icon-less.\n */\n iconSlot?: boolean;\n /**\n * Row density. `sm` tightens padding and type for chip popovers\n * (Filter Bar options). Palette destinations stay `md`.\n * @default \"md\"\n */\n size?: CommandItemSize;\n /** Primary label. Prefer this over free-form children for the shared layout. */\n title?: ReactNode;\n /**\n * Ancestors after `title` for `level=\"result\"` — parent → page\n * (e.g. `[\"Agent profile\", \"Settings\"]` → `Name < Agent profile < Settings`).\n */\n path?: ReactNode[];\n /**\n * Trailing scope for `level=\"result\"` — `Project` vs `Personal`, not a nav group.\n */\n scope?: ReactNode;\n /** Shows a trailing external-link glyph (opens outside the app). */\n external?: boolean;\n /**\n * Free-form content. When `title` is set, rendered after the label stack.\n * When `title` is omitted, becomes the row body (legacy / simple items).\n */\n children?: ReactNode;\n}\n\n/** Leading icon column — `size-4` at `md`, tighter at `sm`. */\nfunction ItemIcon({\n className,\n size = \"md\",\n ...props\n}: ComponentProps<\"span\"> & { size?: CommandItemSize }) {\n return (\n <span\n className={cn(\n \"text-pho-secondary flex shrink-0 items-center justify-center\",\n resolveVariant(ITEM_ICON_SIZES, size),\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Primary label — medium + primary ink on `item` rows. */\nfunction ItemTitle({\n className,\n level = \"item\",\n size = \"md\",\n ...props\n}: ComponentProps<\"span\"> & {\n level?: CommandItemLevel;\n size?: CommandItemSize;\n}) {\n return (\n <span\n className={cn(\n \"block truncate\",\n resolveVariant(ITEM_TITLE_SIZES, size),\n level === \"item\" && \"text-pho-primary\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * One selectable row. Idle palettes use `level` + `icon` / `title`\n * (item → subitem → subsubitem). Searching uses `level=\"result\"` with `path`\n * crumbs and a trailing `scope` (Project / Personal). No description line —\n * match via `keywords` / aliases instead.\n */\nfunction ExternalGlyph() {\n return (\n <IconArrowUpRight\n aria-hidden\n className=\"text-pho-description size-4 shrink-0\"\n />\n );\n}\n\nfunction Item({\n className,\n level = \"item\",\n size = \"md\",\n icon,\n iconSlot,\n title,\n path,\n scope,\n external,\n children,\n value,\n ...props\n}: CommandItemProps) {\n const reduceMotion = useReducedMotion();\n // cmdk registers `value.trim()` and exposes the selected one as\n // `state.value` — mirrors cmdk's own `data-selected` computation.\n const trimmedValue = typeof value === \"string\" ? value.trim() : \"\";\n const selectedValue = useCommandState((state) => state.value);\n const isSelected = trimmedValue !== \"\" && selectedValue === trimmedValue;\n const structured = title != null;\n const isResult = level === \"result\";\n // Reserve the icon column when the row has an icon, or when the list asks\n // for alignment (`iconSlot`) even if this row's glyph is empty.\n const showResultIcon = isResult && (icon != null || iconSlot);\n\n const row = (\n <CommandPrimitive.Item\n data-level={level}\n data-size={size}\n value={value}\n className={cn(\n \"text-pho-secondary flex cursor-pointer items-center rounded-[calc(var(--radius-base)-4px)] outline-none select-none\",\n resolveVariant(ITEM_SIZES, size),\n // subsubitem steps in; item/subitem share the base gutter.\n level === \"subsubitem\" ? \"pl-6\" : \"pl-2\",\n // Secondary at rest; selection lifts to primary ink (Menu idiom).\n // The wash lands with it instantly — stepping through rows is a\n // snap, not a flight.\n \"data-[selected=true]:text-pho-primary data-[selected=true]:bg-pho-ghost-hover\",\n \"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50\",\n className,\n )}\n {...props}\n >\n {structured && isResult ? (\n <>\n {showResultIcon ? (\n <ItemIcon size={size} aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n ) : null}\n {/* Same title size as idle ItemTitle so row height matches. */}\n <span\n className={cn(\n \"flex min-w-0 flex-1 items-center gap-1 overflow-hidden\",\n resolveVariant(ITEM_TITLE_SIZES, size),\n )}\n >\n <span className=\"text-pho-primary truncate\">{title}</span>\n {(path ?? []).map((segment, index) => (\n <span\n key={index}\n className=\"text-pho-description flex shrink-0 items-center gap-0.5\"\n >\n <IconChevronLeft aria-hidden className=\"size-4 shrink-0\" />\n {segment}\n </span>\n ))}\n </span>\n {scope != null && scope !== \"\" ? (\n <span className=\"text-pho-description shrink-0 text-xs\">\n {scope}\n </span>\n ) : null}\n {external ? <ExternalGlyph /> : null}\n {children}\n </>\n ) : structured ? (\n <>\n {/* Icon column always reserved so subitem labels share the item title edge. */}\n <ItemIcon size={size} aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n <span className=\"min-w-0 flex-1\">\n <ItemTitle level={level} size={size}>\n {title}\n </ItemTitle>\n </span>\n {external ? <ExternalGlyph /> : null}\n {children}\n </>\n ) : (\n children\n )}\n </CommandPrimitive.Item>\n );\n\n if (reduceMotion) return row;\n\n return (\n // FLIP wrapper: rows that stay mounted glide when neighbours enter or\n // leave, and a row remounting elsewhere with the same `value` (idle group\n // ↔ flat search result) inherits the old bounds via its layoutId and\n // slides to the new slot — the iOS list-diff feel. Rows without a match\n // simply appear / disappear so the whole list never swarms.\n //\n // The selected row is the exception: it skips the travel and appears at\n // its final slot immediately, so the selection wash is never sitting on\n // empty space waiting for its row to fly in.\n <motion.div\n layout=\"position\"\n layoutId={typeof value === \"string\" ? value : undefined}\n initial={false}\n transition={isSelected ? { duration: 0 } : ROW_MOVE_SPRING}\n >\n {row}\n </motion.div>\n );\n}\n\nfunction Separator({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n className={cn(\n \"-mx-1 my-1 h-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Loading({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Loading>) {\n return (\n <CommandPrimitive.Loading\n className={cn(\"text-pho-description px-2.5 py-1.5 text-base\", className)}\n {...props}\n />\n );\n}\n\ntype DialogRootProps = ComponentProps<typeof PhoDialog.Root>;\n\ninterface CommandDialogProps extends ComponentProps<typeof CommandPrimitive> {\n /** Controlled dialog state — pass straight through to `Dialog.Root`. */\n open?: DialogRootProps[\"open\"];\n onOpenChange?: DialogRootProps[\"onOpenChange\"];\n /** Accessible name for the palette (dialog and command menu). */\n label?: string;\n /** Extra classes for the dialog panel (not the command root). */\n className?: string;\n}\n\n/**\n * A command palette in a modal — Pho's `Dialog` overlay (Base UI) around a\n * `Command.Root`, raised above center. We deliberately skip cmdk's own\n * `Command.Dialog` (Radix) so overlays stay on one primitive stack.\n *\n * List height springs via `AnimatedHeight` (same feel as the Card shell on\n * onboarding / invite) — the input row stays put while results resize.\n */\nfunction Dialog({\n open,\n onOpenChange,\n label,\n className,\n children,\n ...props\n}: CommandDialogProps) {\n return (\n <PhoDialog.Root open={open} onOpenChange={onOpenChange}>\n <PhoDialog.Portal>\n <PhoDialog.Backdrop />\n <PhoDialog.Popup\n aria-label={label}\n // Palette sits above center so the list grows downward from a\n // stable top edge instead of jumping around it.\n className={cn(\n \"top-[max(4rem,18vh)] max-w-xl translate-y-0 overflow-hidden p-0\",\n className,\n )}\n >\n {/* The popup is position: fixed; layout animations inside a fixed\n element need a layoutRoot to project against, or their\n measurements drift with the page scroll. */}\n <motion.div layoutRoot>\n <Root label={label} {...props}>\n {children}\n </Root>\n </motion.div>\n </PhoDialog.Popup>\n </PhoDialog.Portal>\n </PhoDialog.Root>\n );\n}\n\n/**\n * Command menu built on `cmdk` — a filterable list of actions driven from a\n * single input, keyboard-first. Compose inline (`Command.Root`) or as a\n * ⌘K-style modal palette (`Command.Dialog`, which owns the overlay).\n * Filtering is yours by default — filter in render so the rows' diff can\n * glide; pass `shouldFilter` to hand matching and ranking to cmdk (its\n * imperative reorder skips the animation).\n *\n * Rows share one layout via `Command.Item` `level` — idle\n * `item` → `subitem` → `subsubitem`, or flat `result` while searching.\n */\nexport const Command = {\n Root,\n InputGroup,\n Input,\n List,\n Empty,\n Group,\n Item,\n ItemIcon,\n ItemTitle,\n Separator,\n Loading,\n Dialog,\n};\n\n/** Re-export of cmdk's state selector hook (search, value, filtered counts). */\nexport { useCommandState };\n"],"mappings":";;;;;;;;;;;;AAuBA,IAAMsB,IAAkBjB;AAExB,SAASkB,EAAK,EAMZ,cAAAC,IAAe,IACf,WAAAC,GACA,UAAAC,GACA,GAAGC,EAAA,GACuC;AAG1C,QAAMC,IAAkBjB,EAAM;AAC9B,SACE,gBAAAI,EAACf,GAAD;AAAA,IACE,WAAWG,EACT,qFACAsB,CACF;AAAA,IACc,cAAAD;AAAA,IACd,GAAIG;AAAA,IAEJ,UAAA,gBAAAZ,EAACE,GAAD;AAAA,MAAa,IAAIW;AAAA,MAAkB,UAAAF;AAAA,IAAsB,CAAA;AAAA,EACzC,CAAA;AAEtB;AAOA,SAASG,EAAW,EAAE,WAAAJ,GAAW,GAAGE,EAAA,GAAgC;AAClE,SACE,gBAAAZ,EAAC,OAAD;AAAA,IACE,WAAWZ,EACT,4DACAsB,CACF;AAAA,IACA,GAAIE;AAAA,EACL,CAAA;AAEL;AAGA,IAAMG,IACJ,OAAO,SAAW,MAAcpB,IAAYE;AAE9C,SAASmB,EAAaC,GAAyBC,GAAiB;AAC9D,EAAI,OAAOD,KAAQ,aAAYA,EAAIC,CAAK,IAC/BD,MAAKA,EAAI,UAAUC;AAC9B;AAEA,SAASC,EAAM,EACb,WAAAT,GACA,OAAAQ,GACA,KAAKE,GACL,GAAGR,EAAA,GAC6C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,IACvE,GAAIE;AAAA,EACL,CAAA;AAEL;AAsBA,SAAS4C,GAAO,EACd,MAAAC,GACA,cAAAC,GACA,OAAAC,GACA,WAAAjD,GACA,UAAAC,GACA,GAAGC,EAAA,GACkB;AACrB,SACE,gBAAAZ,EAACb,EAAU,MAAX;AAAA,IAAsB,MAAAsE;AAAA,IAAoB,cAAAC;AAAA,IACxC,UAAA,gBAAAzD,EAACd,EAAU,QAAX,EAAA,UAAA,CACE,gBAAAa,EAACb,EAAU,UAAX,CAAqB,CAAA,GACrB,gBAAAa,EAACb,EAAU,OAAX;AAAA,MACE,cAAYwE;AAAA,MAGZ,WAAWvE,EACT,mEACAsB,CACF;AAAA,MAKA,UAAA,gBAAAV,EAACG,EAAO,KAAR;AAAA,QAAY,YAAA;AAAA,QACV,UAAA,gBAAAH,EAACQ,GAAD;AAAA,UAAa,OAAAmD;AAAA,UAAO,GAAI/C;AAAA,UACrB,UAAAD;AAAA,QACG,CAAA;AAAA,MACI,CAAA;AAAA,IACG,CAAA,CACD,EAAA,CAAA;AAAA,EACJ,CAAA;AAEpB;AAaA,IAAaiD,KAAU;AAAA,EACrB,MAAApD;AAAA,EACA,YAAAM;AAAA,EACA,OAAAK;AAAA,EACA,MAAAO;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAS;AAAA,EACA,UAAAL;AAAA,EACA,WAAAE;AAAA,EACA,WAAAoB;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"command.js","names":["CommandPrimitive","_Fragment","PhoDialog","cn","resolveVariant","SPRING_SETTLE","ChevronLeftIcon","ExternalLinkIcon","AnimatedHeight","Dialog$1","useEffect","useId","useLayoutEffect","useRef","Fragment$1","jsx","jsxs","LayoutGroup","motion","useReducedMotion","Command$1","useCommandState","ROW_MOVE_SPRING","Root","shouldFilter","className","children","props","layoutNamespace","InputGroup","useIsomorphicLayoutEffect","assignRef","ref","value","Input","consumerRef","inputRef","search","state","input","node","List","Empty","Group","ITEM_SIZES","ITEM_TITLE_SIZES","ITEM_ICON_SIZES","ItemIcon","size","ItemTitle","level","ExternalGlyph","Item","icon","iconSlot","title","path","scope","external","reduceMotion","trimmedValue","selectedValue","isSelected","structured","isResult","showResultIcon","row","segment","index","Separator","Loading","Dialog","open","onOpenChange","label","Command"],"sources":["../../src/components/command/command.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n type ComponentProps,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { ChevronLeftIcon, ExternalLinkIcon } from \"../../icons/photon\";\nimport { SPRING_SETTLE } from \"../../motion\";\nimport { Command as CommandPrimitive, useCommandState } from \"cmdk\";\nimport { LayoutGroup, motion, useReducedMotion } from \"motion/react\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport { Dialog as PhoDialog } from \"../dialog\";\n\n/**\n * Spring for row moves (FLIP / shared-layout) — same feel as\n * `AnimatedHeight`: quick and critically damped, so rows glide to their new\n * slot without overshooting into neighbours.\n */\nconst ROW_MOVE_SPRING = SPRING_SETTLE;\n\nfunction Root({\n // Filtering is yours by default: filter in render (state above the\n // palette) so the rows' FLIP diff can glide survivors to their slots.\n // cmdk's built-in matcher reorders DOM imperatively — invisible to the\n // layout pass — so it is opt-in: pass `shouldFilter` to hand matching\n // and ranking back to cmdk at the cost of the animation.\n shouldFilter = false,\n className,\n children,\n ...props\n}: ComponentProps<typeof CommandPrimitive>) {\n // Namespace row layoutIds per palette instance — the docs page mounts the\n // inline demo and the dialog demo at once, with identical item values.\n const layoutNamespace = useId();\n return (\n <CommandPrimitive\n className={cn(\n \"bg-pho-primary text-pho-primary flex w-full flex-col overflow-hidden outline-none\",\n className,\n )}\n shouldFilter={shouldFilter}\n {...props}\n >\n <LayoutGroup id={layoutNamespace}>{children}</LayoutGroup>\n </CommandPrimitive>\n );\n}\n\n/**\n * The input row — a bottom hairline separates it from the list. Position\n * leading icons absolutely and pad the input (`pl-9`), mirroring\n * `Autocomplete.InputGroup`.\n */\nfunction InputGroup({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"border-pho-secondary relative flex items-center border-b\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** SSR-safe layout effect (same pattern cmdk uses internally). */\nconst useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref) ref.current = value;\n}\n\nfunction Input({\n className,\n value,\n ref: consumerRef,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Input>) {\n const inputRef = useRef<HTMLInputElement>(null);\n const search = useCommandState((state) => state.search);\n\n // cmdk stays uncontrolled here on purpose. Its controlled path syncs the\n // `value` prop into the search store through a passive effect — one painted\n // frame late — so on that stale frame the old row is still \"selected\" while\n // the list has already reflowed, and the selection pill visibly rides it\n // before snapping to the re-selected first row. Uncontrolled keystrokes\n // update search + first-row selection synchronously (pre-paint), killing\n // that frame in both directions (typing and clearing).\n //\n // The consumer-facing API is still controlled: external `value` changes\n // (programmatic reset, initial query) are replayed through the native input\n // path below so store, display, and selection take the same sync route.\n useIsomorphicLayoutEffect(() => {\n const input = inputRef.current;\n if (value == null || input == null || value === search) return;\n const setNativeValue = Object.getOwnPropertyDescriptor(\n HTMLInputElement.prototype,\n \"value\",\n )?.set;\n setNativeValue?.call(input, value);\n input.dispatchEvent(new Event(\"input\", { bubbles: true }));\n }, [value, search]);\n\n return (\n <CommandPrimitive.Input\n className={cn(\n // Borderless inside the palette surface — the InputGroup hairline\n // carries the edge. display-xs (18px) keeps iOS from zooming in.\n \"text-pho-primary placeholder:text-pho-placeholder text-display-xs w-full bg-transparent px-3 py-3 outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n ref={(node) => {\n inputRef.current = node;\n assignRef(consumerRef, node);\n }}\n />\n );\n}\n\nfunction List({\n className,\n children,\n ...props\n}: ComponentProps<typeof CommandPrimitive.List>) {\n return (\n // Same spring as the onboarding / invite Card shell — list height glides\n // when idle ↔ search (or filter) changes instead of jumping.\n <AnimatedHeight>\n {/* The scroller is a motion element with layoutScroll so the rows'\n FLIP projections account for its scroll offset — without it,\n scrolling reads as a layout change and every row glides to\n compensate. scroll-py keeps a breath above and below the row\n being scrolled into view. */}\n <motion.div\n layoutScroll\n className=\"max-h-[min(24rem,60vh)] scroll-py-1 overflow-y-auto overscroll-contain\"\n >\n <CommandPrimitive.List\n className={cn(\"relative isolate p-1\", className)}\n {...props}\n >\n {children}\n </CommandPrimitive.List>\n </motion.div>\n </AnimatedHeight>\n );\n}\n\nfunction Empty({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n className={cn(\n \"text-pho-description px-2.5 py-6 text-center text-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Group({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n className={cn(\n // cmdk renders the `heading` prop in a [cmdk-group-heading] wrapper —\n // typography mirrors `Autocomplete.GroupLabel`.\n \"[&_[cmdk-group-heading]]:text-pho-secondary [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Row layout mode:\n * - `item` / `subitem` / `subsubitem` — idle hierarchy (icon column + indent)\n * - `result` — flat search hit (breadcrumb + trailing scope)\n */\nexport type CommandItemLevel = \"item\" | \"subitem\" | \"subsubitem\" | \"result\";\nexport type CommandItemSize = \"sm\" | \"md\";\n\nconst ITEM_SIZES = {\n sm: {\n classes: \"gap-1.5 py-1 pr-2 text-sm\",\n description: \"Compact rows for filter lists and dense pickers\",\n },\n md: {\n classes: \"gap-2 py-2 pr-2.5 text-base\",\n description: \"Default palette row\",\n },\n} as const satisfies VariantMap;\n\nconst ITEM_TITLE_SIZES = {\n sm: { classes: \"text-sm\", description: \"Compact row title\" },\n md: { classes: \"text-md\", description: \"Default row title\" },\n} as const satisfies VariantMap;\n\nconst ITEM_ICON_SIZES = {\n sm: {\n classes: \"size-3.5 [&>svg]:size-3.5\",\n description: \"Compact leading glyph\",\n },\n md: {\n classes: \"size-4 [&>svg]:size-4\",\n description: \"Default leading glyph\",\n },\n} as const satisfies VariantMap;\n\ntype ItemPrimitiveProps = ComponentProps<typeof CommandPrimitive.Item>;\n\nexport interface CommandItemProps extends Omit<\n ItemPrimitiveProps,\n \"children\" | \"title\"\n> {\n /**\n * Row depth / mode in the palette:\n * - `item` — page / top destination (icon + title)\n * - `subitem` — section under an item (label aligns with the item title)\n * - `subsubitem` — row under a section (one step deeper)\n * - `result` — flat search hit (`title` + `path` crumbs + `scope`)\n */\n level?: CommandItemLevel;\n /**\n * Leading glyph. On idle `item` rows (and reserved for sub-levels). On\n * `result` rows, pass the resolved icon (self → parent → grandparent).\n */\n icon?: ReactNode;\n /**\n * When `level=\"result\"`, force the icon column so labels align across the\n * list even if this row's `icon` is empty. Set true when any sibling result\n * has an icon; omit when the whole result set is icon-less.\n */\n iconSlot?: boolean;\n /**\n * Row density. `sm` tightens padding and type for chip popovers\n * (Filter Bar options). Palette destinations stay `md`.\n * @default \"md\"\n */\n size?: CommandItemSize;\n /** Primary label. Prefer this over free-form children for the shared layout. */\n title?: ReactNode;\n /**\n * Ancestors after `title` for `level=\"result\"` — parent → page\n * (e.g. `[\"Agent profile\", \"Settings\"]` → `Name < Agent profile < Settings`).\n */\n path?: ReactNode[];\n /**\n * Trailing scope for `level=\"result\"` — `Project` vs `Personal`, not a nav group.\n */\n scope?: ReactNode;\n /** Shows a trailing external-link glyph (opens outside the app). */\n external?: boolean;\n /**\n * Free-form content. When `title` is set, rendered after the label stack.\n * When `title` is omitted, becomes the row body (legacy / simple items).\n */\n children?: ReactNode;\n}\n\n/** Leading icon column — `size-4` at `md`, tighter at `sm`. */\nfunction ItemIcon({\n className,\n size = \"md\",\n ...props\n}: ComponentProps<\"span\"> & { size?: CommandItemSize }) {\n return (\n <span\n className={cn(\n \"text-pho-secondary flex shrink-0 items-center justify-center\",\n resolveVariant(ITEM_ICON_SIZES, size),\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Primary label — medium + primary ink on `item` rows. */\nfunction ItemTitle({\n className,\n level = \"item\",\n size = \"md\",\n ...props\n}: ComponentProps<\"span\"> & {\n level?: CommandItemLevel;\n size?: CommandItemSize;\n}) {\n return (\n <span\n className={cn(\n \"block truncate\",\n resolveVariant(ITEM_TITLE_SIZES, size),\n level === \"item\" && \"text-pho-primary\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * One selectable row. Idle palettes use `level` + `icon` / `title`\n * (item → subitem → subsubitem). Searching uses `level=\"result\"` with `path`\n * crumbs and a trailing `scope` (Project / Personal). No description line —\n * match via `keywords` / aliases instead.\n */\nfunction ExternalGlyph() {\n return (\n <ExternalLinkIcon\n aria-hidden\n className=\"text-pho-description size-4 shrink-0\"\n />\n );\n}\n\nfunction Item({\n className,\n level = \"item\",\n size = \"md\",\n icon,\n iconSlot,\n title,\n path,\n scope,\n external,\n children,\n value,\n ...props\n}: CommandItemProps) {\n const reduceMotion = useReducedMotion();\n // cmdk registers `value.trim()` and exposes the selected one as\n // `state.value` — mirrors cmdk's own `data-selected` computation.\n const trimmedValue = typeof value === \"string\" ? value.trim() : \"\";\n const selectedValue = useCommandState((state) => state.value);\n const isSelected = trimmedValue !== \"\" && selectedValue === trimmedValue;\n const structured = title != null;\n const isResult = level === \"result\";\n // Reserve the icon column when the row has an icon, or when the list asks\n // for alignment (`iconSlot`) even if this row's glyph is empty.\n const showResultIcon = isResult && (icon != null || iconSlot);\n\n const row = (\n <CommandPrimitive.Item\n data-level={level}\n data-size={size}\n value={value}\n className={cn(\n \"text-pho-secondary flex cursor-pointer items-center rounded-[calc(var(--radius-base)-4px)] outline-none select-none\",\n resolveVariant(ITEM_SIZES, size),\n // subsubitem steps in; item/subitem share the base gutter.\n level === \"subsubitem\" ? \"pl-6\" : \"pl-2\",\n // Secondary at rest; selection lifts to primary ink (Menu idiom).\n // The wash lands with it instantly — stepping through rows is a\n // snap, not a flight.\n \"data-[selected=true]:text-pho-primary data-[selected=true]:bg-pho-ghost-hover\",\n \"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50\",\n className,\n )}\n {...props}\n >\n {structured && isResult ? (\n <>\n {showResultIcon ? (\n <ItemIcon size={size} aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n ) : null}\n {/* Same title size as idle ItemTitle so row height matches. */}\n <span\n className={cn(\n \"flex min-w-0 flex-1 items-center gap-1 overflow-hidden\",\n resolveVariant(ITEM_TITLE_SIZES, size),\n )}\n >\n <span className=\"text-pho-primary truncate\">{title}</span>\n {(path ?? []).map((segment, index) => (\n <span\n key={index}\n className=\"text-pho-description flex shrink-0 items-center gap-0.5\"\n >\n <ChevronLeftIcon aria-hidden className=\"size-4 shrink-0\" />\n {segment}\n </span>\n ))}\n </span>\n {scope != null && scope !== \"\" ? (\n <span className=\"text-pho-description shrink-0 text-xs\">\n {scope}\n </span>\n ) : null}\n {external ? <ExternalGlyph /> : null}\n {children}\n </>\n ) : structured ? (\n <>\n {/* Icon column always reserved so subitem labels share the item title edge. */}\n <ItemIcon size={size} aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n <span className=\"min-w-0 flex-1\">\n <ItemTitle level={level} size={size}>\n {title}\n </ItemTitle>\n </span>\n {external ? <ExternalGlyph /> : null}\n {children}\n </>\n ) : (\n children\n )}\n </CommandPrimitive.Item>\n );\n\n if (reduceMotion) return row;\n\n return (\n // FLIP wrapper: rows that stay mounted glide when neighbours enter or\n // leave, and a row remounting elsewhere with the same `value` (idle group\n // ↔ flat search result) inherits the old bounds via its layoutId and\n // slides to the new slot — the iOS list-diff feel. Rows without a match\n // simply appear / disappear so the whole list never swarms.\n //\n // The selected row is the exception: it skips the travel and appears at\n // its final slot immediately, so the selection wash is never sitting on\n // empty space waiting for its row to fly in.\n <motion.div\n layout=\"position\"\n layoutId={typeof value === \"string\" ? value : undefined}\n initial={false}\n transition={isSelected ? { duration: 0 } : ROW_MOVE_SPRING}\n >\n {row}\n </motion.div>\n );\n}\n\nfunction Separator({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n className={cn(\n \"-mx-1 my-1 h-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Loading({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Loading>) {\n return (\n <CommandPrimitive.Loading\n className={cn(\"text-pho-description px-2.5 py-1.5 text-base\", className)}\n {...props}\n />\n );\n}\n\ntype DialogRootProps = ComponentProps<typeof PhoDialog.Root>;\n\ninterface CommandDialogProps extends ComponentProps<typeof CommandPrimitive> {\n /** Controlled dialog state — pass straight through to `Dialog.Root`. */\n open?: DialogRootProps[\"open\"];\n onOpenChange?: DialogRootProps[\"onOpenChange\"];\n /** Accessible name for the palette (dialog and command menu). */\n label?: string;\n /** Extra classes for the dialog panel (not the command root). */\n className?: string;\n}\n\n/**\n * A command palette in a modal — Pho's `Dialog` overlay (Base UI) around a\n * `Command.Root`, raised above center. We deliberately skip cmdk's own\n * `Command.Dialog` (Radix) so overlays stay on one primitive stack.\n *\n * List height springs via `AnimatedHeight` (same feel as the Card shell on\n * onboarding / invite) — the input row stays put while results resize.\n */\nfunction Dialog({\n open,\n onOpenChange,\n label,\n className,\n children,\n ...props\n}: CommandDialogProps) {\n return (\n <PhoDialog.Root open={open} onOpenChange={onOpenChange}>\n <PhoDialog.Portal>\n <PhoDialog.Backdrop />\n <PhoDialog.Popup\n aria-label={label}\n // Palette sits above center so the list grows downward from a\n // stable top edge instead of jumping around it.\n className={cn(\n \"top-[max(4rem,18vh)] max-w-xl translate-y-0 overflow-hidden p-0\",\n className,\n )}\n >\n {/* The popup is position: fixed; layout animations inside a fixed\n element need a layoutRoot to project against, or their\n measurements drift with the page scroll. */}\n <motion.div layoutRoot>\n <Root label={label} {...props}>\n {children}\n </Root>\n </motion.div>\n </PhoDialog.Popup>\n </PhoDialog.Portal>\n </PhoDialog.Root>\n );\n}\n\n/**\n * Command menu built on `cmdk` — a filterable list of actions driven from a\n * single input, keyboard-first. Compose inline (`Command.Root`) or as a\n * ⌘K-style modal palette (`Command.Dialog`, which owns the overlay).\n * Filtering is yours by default — filter in render so the rows' diff can\n * glide; pass `shouldFilter` to hand matching and ranking to cmdk (its\n * imperative reorder skips the animation).\n *\n * Rows share one layout via `Command.Item` `level` — idle\n * `item` → `subitem` → `subsubitem`, or flat `result` while searching.\n */\nexport const Command = {\n Root,\n InputGroup,\n Input,\n List,\n Empty,\n Group,\n Item,\n ItemIcon,\n ItemTitle,\n Separator,\n Loading,\n Dialog,\n};\n\n/** Re-export of cmdk's state selector hook (search, value, filtered counts). */\nexport { useCommandState };\n"],"mappings":";;;;;;;;;;;AAuBA,IAAMsB,IAAkBjB;AAExB,SAASkB,EAAK,EAMZ,cAAAC,IAAe,IACf,WAAAC,GACA,UAAAC,GACA,GAAGC,EAAA,GACuC;AAG1C,QAAMC,IAAkBjB,EAAM;AAC9B,SACE,gBAAAI,EAACf,GAAD;AAAA,IACE,WAAWG,EACT,qFACAsB,CACF;AAAA,IACc,cAAAD;AAAA,IACd,GAAIG;AAAA,IAEJ,UAAA,gBAAAZ,EAACE,GAAD;AAAA,MAAa,IAAIW;AAAA,MAAkB,UAAAF;AAAA,IAAsB,CAAA;AAAA,EACzC,CAAA;AAEtB;AAOA,SAASG,EAAW,EAAE,WAAAJ,GAAW,GAAGE,EAAA,GAAgC;AAClE,SACE,gBAAAZ,EAAC,OAAD;AAAA,IACE,WAAWZ,EACT,4DACAsB,CACF;AAAA,IACA,GAAIE;AAAA,EACL,CAA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import { a as e, i as t, n as r, r as o, t as s } from "../chunks/data-table-
|
|
2
|
+
import { a as e, i as t, n as r, r as o, t as s } from "../chunks/data-table-CshUlqIu.js";
|
|
3
3
|
import { r as c } from "../chunks/chrome-Dyvv0FVf.js";
|
|
4
|
-
import { t as T } from "../chunks/ghost-search-
|
|
4
|
+
import { t as T } from "../chunks/ghost-search-DhADxaWi.js";
|
|
5
5
|
export {
|
|
6
6
|
c as DATA_TABLE_SURFACE,
|
|
7
7
|
s as DataTable,
|
package/dist/components/error.js
CHANGED
|
@@ -1,14 +1,255 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { t as p } from "../chunks/cn-CPbhpG1q.js";
|
|
3
|
+
import { a as E, o as R } from "../chunks/button-KM0lAQ4x.js";
|
|
4
|
+
import { Wn as S, _t as C } from "../chunks/icons-eq5FZ3Yc.js";
|
|
5
|
+
import { t as g } from "../chunks/IconAlertCircleFilled-D6mUlVaE.js";
|
|
6
|
+
import { t as P } from "../chunks/IconAlertTriangleFilled-QV-gsVQW.js";
|
|
7
|
+
import { t as l } from "../chunks/popover-Dtp9C6Qg.js";
|
|
8
|
+
import { i as _ } from "../chunks/status-view-Buhh1UBJ.js";
|
|
9
|
+
import { useEffect as A, useRef as L, useState as z } from "react";
|
|
10
|
+
import { Fragment as c, jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
11
|
+
function f(t) {
|
|
12
|
+
if (typeof t != "object" || t === null) return !1;
|
|
13
|
+
const e = t;
|
|
14
|
+
return typeof e.title == "string" && typeof e.status == "number" && Number.isInteger(e.status) && e.status >= 400 && e.status <= 599 && (e.code === void 0 || typeof e.code == "string");
|
|
15
|
+
}
|
|
16
|
+
function k(t) {
|
|
17
|
+
let e = t;
|
|
18
|
+
for (let n = 0; n < 8 && typeof e == "object" && e !== null; n++) {
|
|
19
|
+
if (f(e)) return e;
|
|
20
|
+
const i = e.problem;
|
|
21
|
+
if (f(i)) return i;
|
|
22
|
+
e = e.cause;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var D = "Something went wrong.", h = {
|
|
27
|
+
400: "Bad Request",
|
|
28
|
+
401: "Unauthorized",
|
|
29
|
+
403: "Forbidden",
|
|
30
|
+
404: "Not Found",
|
|
31
|
+
408: "Request Timeout",
|
|
32
|
+
409: "Conflict",
|
|
33
|
+
410: "Gone",
|
|
34
|
+
413: "Payload Too Large",
|
|
35
|
+
415: "Unsupported Media Type",
|
|
36
|
+
422: "Unprocessable Entity",
|
|
37
|
+
429: "Too Many Requests",
|
|
38
|
+
500: "Internal Server Error",
|
|
39
|
+
501: "Not Implemented",
|
|
40
|
+
502: "Bad Gateway",
|
|
41
|
+
503: "Service Unavailable",
|
|
42
|
+
504: "Gateway Timeout"
|
|
43
|
+
}, F = {
|
|
44
|
+
400: "The request was malformed or incomplete.",
|
|
45
|
+
401: "You need to sign in again.",
|
|
46
|
+
403: "You don't have permission to do that.",
|
|
47
|
+
404: "The requested resource was not found.",
|
|
48
|
+
408: "The request timed out before the server responded.",
|
|
49
|
+
409: "The request conflicts with the current state.",
|
|
50
|
+
410: "That resource is no longer available.",
|
|
51
|
+
413: "The request was too large for the server to accept.",
|
|
52
|
+
415: "That media type isn't supported.",
|
|
53
|
+
422: "The request was understood but couldn't be processed.",
|
|
54
|
+
429: "Request rate limit exceeded. Wait a moment before trying again.",
|
|
55
|
+
500: "The server hit an unexpected error.",
|
|
56
|
+
501: "The server doesn't support that operation.",
|
|
57
|
+
502: "The gateway got an invalid response from an upstream server.",
|
|
58
|
+
503: "The service is temporarily unavailable.",
|
|
59
|
+
504: "The gateway timed out waiting for an upstream server."
|
|
60
|
+
};
|
|
61
|
+
function $(t) {
|
|
62
|
+
return typeof t.code == "string" && t.code !== "";
|
|
63
|
+
}
|
|
64
|
+
function v(t, e) {
|
|
65
|
+
if (h[t]) return h[t];
|
|
66
|
+
if (e && e !== "Something went wrong." && e !== "Request failed") return e.replace(/\.$/, "");
|
|
67
|
+
}
|
|
68
|
+
function j(t) {
|
|
69
|
+
return F[t] ?? "The request failed with an unexpected status.";
|
|
70
|
+
}
|
|
71
|
+
function u(t) {
|
|
72
|
+
if (!t) return t;
|
|
73
|
+
const e = t.charAt(0), n = e.toUpperCase();
|
|
74
|
+
return e === n ? t : n + t.slice(1);
|
|
75
|
+
}
|
|
76
|
+
function y(t) {
|
|
77
|
+
const e = k(t);
|
|
78
|
+
if (e == null) return { title: D };
|
|
79
|
+
const n = [e.detail, e.remediation?.action].filter((i) => typeof i == "string" && i !== "").join(" ") || void 0;
|
|
80
|
+
return !$(e) && n == null ? {
|
|
81
|
+
title: u(v(e.status, e.title) ?? "Something went wrong."),
|
|
82
|
+
description: j(e.status),
|
|
83
|
+
requestId: e.requestId,
|
|
84
|
+
problem: e
|
|
85
|
+
} : {
|
|
86
|
+
title: u(e.title || "Something went wrong."),
|
|
87
|
+
description: n ? u(n) : void 0,
|
|
88
|
+
documentation: e.remediation?.documentation,
|
|
89
|
+
requestId: e.requestId,
|
|
90
|
+
problem: e
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function d(t) {
|
|
94
|
+
return typeof t == "string" ? u(t) : t;
|
|
95
|
+
}
|
|
96
|
+
var T = "Learn more", B = "Try again";
|
|
97
|
+
function U({ error: t, children: e, className: n, ...i }) {
|
|
98
|
+
if (t == null && e == null) return null;
|
|
99
|
+
const o = y(t);
|
|
100
|
+
return /* @__PURE__ */ s("div", {
|
|
101
|
+
role: "alert",
|
|
102
|
+
className: p("text-pho-error flex min-w-0 items-start gap-1.5 text-base", n),
|
|
103
|
+
...i,
|
|
104
|
+
children: [/* @__PURE__ */ r("span", {
|
|
105
|
+
"aria-hidden": !0,
|
|
106
|
+
className: "flex h-[1lh] shrink-0 items-center",
|
|
107
|
+
children: /* @__PURE__ */ r(g, { className: "size-4" })
|
|
108
|
+
}), /* @__PURE__ */ s("span", {
|
|
109
|
+
className: "min-w-0",
|
|
110
|
+
children: [
|
|
111
|
+
d(e ?? o.description ?? o.title),
|
|
112
|
+
o.documentation != null && /* @__PURE__ */ s(c, { children: [" ", /* @__PURE__ */ r("a", {
|
|
113
|
+
href: o.documentation,
|
|
114
|
+
target: "_blank",
|
|
115
|
+
rel: "noreferrer",
|
|
116
|
+
className: "font-medium underline underline-offset-2",
|
|
117
|
+
children: T
|
|
118
|
+
})] }),
|
|
119
|
+
" ",
|
|
120
|
+
/* @__PURE__ */ r(W, { copy: o })
|
|
121
|
+
]
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
U.displayName = "Error";
|
|
126
|
+
function O({ children: t, className: e, ...n }) {
|
|
127
|
+
const i = t != null && t !== !1 && t !== "";
|
|
128
|
+
return /* @__PURE__ */ r("output", {
|
|
129
|
+
className: i ? p("text-pho-warning flex min-w-0 items-start gap-1.5 text-base", e) : "sr-only",
|
|
130
|
+
...n,
|
|
131
|
+
children: i && /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ r("span", {
|
|
132
|
+
"aria-hidden": !0,
|
|
133
|
+
className: "flex h-[1lh] shrink-0 items-center",
|
|
134
|
+
children: /* @__PURE__ */ r(P, { className: "size-4" })
|
|
135
|
+
}), /* @__PURE__ */ r("span", {
|
|
136
|
+
className: "min-w-0",
|
|
137
|
+
children: d(t)
|
|
138
|
+
})] })
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
O.displayName = "Warning";
|
|
142
|
+
function W({ copy: t }) {
|
|
143
|
+
const { problem: e, requestId: n } = t;
|
|
144
|
+
if (e == null && n == null) return null;
|
|
145
|
+
let i = null;
|
|
146
|
+
if (e != null)
|
|
147
|
+
if (e.code) i = `${e.status} ${e.code}`;
|
|
148
|
+
else {
|
|
149
|
+
const o = v(e.status, e.title);
|
|
150
|
+
i = o ? `${e.status} ${o}` : String(e.status);
|
|
151
|
+
}
|
|
152
|
+
return /* @__PURE__ */ s(l.Root, { children: [/* @__PURE__ */ r(l.Trigger, {
|
|
153
|
+
openOnHover: !0,
|
|
154
|
+
delay: 150,
|
|
155
|
+
"aria-label": "Error details",
|
|
156
|
+
className: "outline-pho-brand inline-flex size-4 shrink-0 translate-y-[3px] cursor-help items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-2",
|
|
157
|
+
children: /* @__PURE__ */ r(C, { className: "size-3.5" })
|
|
158
|
+
}), /* @__PURE__ */ r(l.Portal, { children: /* @__PURE__ */ r(l.Positioner, {
|
|
159
|
+
align: "start",
|
|
160
|
+
children: /* @__PURE__ */ s(l.Popup, {
|
|
161
|
+
className: "text-pho-error",
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ s(l.Title, {
|
|
164
|
+
className: "text-pho-error flex items-start gap-1.5",
|
|
165
|
+
children: [/* @__PURE__ */ r("span", {
|
|
166
|
+
"aria-hidden": !0,
|
|
167
|
+
className: "flex h-[1lh] shrink-0 items-center",
|
|
168
|
+
children: /* @__PURE__ */ r(g, { className: "size-4" })
|
|
169
|
+
}), t.title]
|
|
170
|
+
}),
|
|
171
|
+
t.description != null && /* @__PURE__ */ r(l.Description, {
|
|
172
|
+
className: "text-pho-error",
|
|
173
|
+
children: t.description
|
|
174
|
+
}),
|
|
175
|
+
(i != null || n != null) && /* @__PURE__ */ s("div", {
|
|
176
|
+
className: "text-pho-error mt-1 font-mono text-[10px] leading-snug",
|
|
177
|
+
children: [i != null && /* @__PURE__ */ r("p", { children: i }), n != null && /* @__PURE__ */ r(b, {
|
|
178
|
+
requestId: n,
|
|
179
|
+
className: "mt-0"
|
|
180
|
+
})]
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
})
|
|
184
|
+
}) })] });
|
|
185
|
+
}
|
|
186
|
+
function b({ requestId: t, className: e }) {
|
|
187
|
+
const [n, i] = z(!1), o = L(null);
|
|
188
|
+
return A(() => () => {
|
|
189
|
+
o.current && clearTimeout(o.current);
|
|
190
|
+
}, []), /* @__PURE__ */ s("span", {
|
|
191
|
+
className: p("mt-1 block font-mono text-[10px] leading-snug", e),
|
|
192
|
+
children: [
|
|
193
|
+
"Request ID:",
|
|
194
|
+
" ",
|
|
195
|
+
/* @__PURE__ */ r("button", {
|
|
196
|
+
type: "button",
|
|
197
|
+
className: "outline-pho-brand inline cursor-pointer underline-offset-2 select-all hover:underline focus-visible:underline focus-visible:outline-2 focus-visible:-outline-offset-1",
|
|
198
|
+
"aria-label": n ? "Request ID copied" : `Copy request ID ${t}`,
|
|
199
|
+
onClick: async () => {
|
|
200
|
+
try {
|
|
201
|
+
await navigator.clipboard.writeText(t);
|
|
202
|
+
} catch {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
i(!0), o.current && clearTimeout(o.current), o.current = setTimeout(() => i(!1), 1500);
|
|
206
|
+
},
|
|
207
|
+
children: t
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ r("output", {
|
|
210
|
+
className: "sr-only",
|
|
211
|
+
"aria-live": "polite",
|
|
212
|
+
children: n ? "Copied" : ""
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function G({ error: t, title: e, description: n, icon: i, onRetry: o, actions: N, size: w = "base", ...x }) {
|
|
218
|
+
if (t == null && e == null) return null;
|
|
219
|
+
const a = y(t), m = d(n ?? a.description), q = m != null || a.requestId != null ? /* @__PURE__ */ s(c, { children: [m, a.requestId != null && /* @__PURE__ */ r(b, { requestId: a.requestId })] }) : void 0, I = N ?? (o != null || a.documentation != null ? /* @__PURE__ */ s(c, { children: [o != null && /* @__PURE__ */ r(E, {
|
|
220
|
+
size: "sm",
|
|
221
|
+
onClick: o,
|
|
222
|
+
children: B
|
|
223
|
+
}), a.documentation != null && /* @__PURE__ */ r(R, {
|
|
224
|
+
size: "sm",
|
|
225
|
+
variant: "outlined",
|
|
226
|
+
href: a.documentation,
|
|
227
|
+
target: "_blank",
|
|
228
|
+
rel: "noreferrer",
|
|
229
|
+
children: T
|
|
230
|
+
})] }) : void 0);
|
|
231
|
+
return /* @__PURE__ */ r(_, {
|
|
232
|
+
role: "alert",
|
|
233
|
+
size: w,
|
|
234
|
+
icon: i ?? /* @__PURE__ */ r(S, {}),
|
|
235
|
+
title: d(e ?? a.title),
|
|
236
|
+
description: q,
|
|
237
|
+
actions: I,
|
|
238
|
+
...x
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
G.displayName = "ErrorView";
|
|
3
242
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
243
|
+
U as Error,
|
|
244
|
+
G as ErrorView,
|
|
245
|
+
D as GENERIC_ERROR_TITLE,
|
|
246
|
+
O as Warning,
|
|
247
|
+
u as capitalizeFirst,
|
|
248
|
+
y as describeError,
|
|
249
|
+
v as httpReasonPhrase,
|
|
250
|
+
j as httpStatusExplanation,
|
|
251
|
+
f as isProblem,
|
|
252
|
+
k as parseProblem
|
|
14
253
|
};
|
|
254
|
+
|
|
255
|
+
//# sourceMappingURL=error.js.map
|