@photon-ai/pho-ui 2.2.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.
Files changed (69) hide show
  1. package/dist/chunks/basic-page-c_7Ii5Fr.js +1117 -0
  2. package/dist/chunks/basic-page-c_7Ii5Fr.js.map +1 -0
  3. package/dist/chunks/{button-BmhyLgy5.js → button-DNNs5RsT.js} +6 -6
  4. package/dist/chunks/{button-BmhyLgy5.js.map → button-DNNs5RsT.js.map} +1 -1
  5. package/dist/chunks/{dialog-DtFO7oy0.js → dialog-8SRNi_rv.js} +3 -3
  6. package/dist/chunks/{dialog-DtFO7oy0.js.map → dialog-8SRNi_rv.js.map} +1 -1
  7. package/dist/chunks/{error-Da7P5WZi.js → error-Crs-wqMC.js} +14 -14
  8. package/dist/chunks/{error-Da7P5WZi.js.map → error-Crs-wqMC.js.map} +1 -1
  9. package/dist/chunks/form-AiHbbw4m.js +17 -0
  10. package/dist/chunks/form-AiHbbw4m.js.map +1 -0
  11. package/dist/chunks/{input-QSAUO30c.js → input-DjvZoF8v.js} +48 -43
  12. package/dist/chunks/input-DjvZoF8v.js.map +1 -0
  13. package/dist/chunks/{input-group-5AtpIhC_.js → input-group-fc9_jD4d.js} +44 -38
  14. package/dist/chunks/input-group-fc9_jD4d.js.map +1 -0
  15. package/dist/chunks/kbd-DNI10uy7.js +18 -0
  16. package/dist/chunks/kbd-DNI10uy7.js.map +1 -0
  17. package/dist/chunks/{menu-Cgj3lq9z.js → menu-BQeprfxB.js} +5 -5
  18. package/dist/chunks/{menu-Cgj3lq9z.js.map → menu-BQeprfxB.js.map} +1 -1
  19. package/dist/chunks/scroll-area-Bu7egArU.js +166 -0
  20. package/dist/chunks/scroll-area-Bu7egArU.js.map +1 -0
  21. package/dist/chunks/sidebar-DvB-G0BP.js +231 -0
  22. package/dist/chunks/sidebar-DvB-G0BP.js.map +1 -0
  23. package/dist/chunks/toast-DoXaRPIZ.js +167 -0
  24. package/dist/chunks/toast-DoXaRPIZ.js.map +1 -0
  25. package/dist/components/button.js +1 -1
  26. package/dist/components/command.js +125 -172
  27. package/dist/components/command.js.map +1 -1
  28. package/dist/components/context-menu.js +23 -23
  29. package/dist/components/dialog.js +1 -1
  30. package/dist/components/error.js +1 -1
  31. package/dist/components/field.js +12 -5
  32. package/dist/components/field.js.map +1 -1
  33. package/dist/components/form.js +2 -14
  34. package/dist/components/input-group.js +1 -1
  35. package/dist/components/input.js +1 -1
  36. package/dist/components/kbd.js +2 -15
  37. package/dist/components/menu.js +1 -1
  38. package/dist/components/phone-input.js +1 -1
  39. package/dist/components/scroll-area.js +3 -2
  40. package/dist/components/toast.js +3 -57
  41. package/dist/index.js +65 -58
  42. package/dist/primitives.js +3 -3
  43. package/dist/sections/basic-page.js +15 -8
  44. package/dist/sections/sidebar.js +1 -1
  45. package/dist/src/components/command/command.d.ts +5 -4
  46. package/dist/src/components/field/field.d.ts +9 -0
  47. package/dist/src/components/input/input.d.ts +10 -1
  48. package/dist/src/components/input-group/input-group.d.ts +9 -2
  49. package/dist/src/components/scroll-area/index.d.ts +1 -0
  50. package/dist/src/components/scroll-area/scroll-area-edges.d.ts +11 -1
  51. package/dist/src/components/scroll-area/scroll-area.d.ts +15 -2
  52. package/dist/src/components/toast/index.d.ts +1 -1
  53. package/dist/src/components/toast/toast.d.ts +22 -7
  54. package/dist/src/sections/basic-page/basic-page.d.ts +210 -30
  55. package/dist/src/sections/basic-page/index.d.ts +1 -1
  56. package/dist/src/sections/sidebar/sidebar.d.ts +33 -3
  57. package/package.json +1 -1
  58. package/src/styles/pho.css +19 -0
  59. package/dist/chunks/basic-page-CB36yrpL.js +0 -643
  60. package/dist/chunks/basic-page-CB36yrpL.js.map +0 -1
  61. package/dist/chunks/input-QSAUO30c.js.map +0 -1
  62. package/dist/chunks/input-group-5AtpIhC_.js.map +0 -1
  63. package/dist/chunks/scroll-area-Cw4JFqNG.js +0 -152
  64. package/dist/chunks/scroll-area-Cw4JFqNG.js.map +0 -1
  65. package/dist/chunks/sidebar-BETMObNj.js +0 -186
  66. package/dist/chunks/sidebar-BETMObNj.js.map +0 -1
  67. package/dist/components/form.js.map +0 -1
  68. package/dist/components/kbd.js.map +0 -1
  69. package/dist/components/toast.js.map +0 -1
@@ -1,242 +1,195 @@
1
1
  "use client";
2
- import { t as l } from "../chunks/cn-ChIgwEl3.js";
3
- import { t as V } from "../chunks/IconArrowUpRight-DGgKzQwV.js";
4
- import { t as $ } from "../chunks/IconChevronLeft-CSWMKQ4C.js";
5
- import { t as q } from "../chunks/animated-height-C2eQstGy.js";
6
- import { t as N } from "../chunks/dialog-DtFO7oy0.js";
7
- import { useEffect as D, useId as A, useLayoutEffect as W, useRef as I } from "react";
8
- import { Fragment as P, jsx as n, jsxs as y } from "react/jsx-runtime";
9
- import { LayoutGroup as B, animate as j, motion as G, useMotionValue as E, useReducedMotion as O } from "motion/react";
10
- import { Command as f, useCommandState as k } from "cmdk";
11
- var L = {
2
+ import { t as a } from "../chunks/cn-ChIgwEl3.js";
3
+ import { t as z } from "../chunks/IconArrowUpRight-DGgKzQwV.js";
4
+ import { t as M } from "../chunks/IconChevronLeft-CSWMKQ4C.js";
5
+ import { t as O } from "../chunks/animated-height-C2eQstGy.js";
6
+ import { t as d } from "../chunks/dialog-8SRNi_rv.js";
7
+ import { useEffect as P, useId as D, useLayoutEffect as V, useRef as $ } from "react";
8
+ import { Fragment as w, jsx as t, jsxs as u } from "react/jsx-runtime";
9
+ import { LayoutGroup as A, motion as x, useReducedMotion as F } from "motion/react";
10
+ import { Command as i, useCommandState as R } from "cmdk";
11
+ var H = {
12
12
  type: "spring",
13
13
  stiffness: 640,
14
14
  damping: 50
15
15
  };
16
- function _({ className: t, children: e, ...r }) {
17
- const a = A();
18
- return /* @__PURE__ */ n(f, {
19
- className: l("bg-pho-primary text-pho-primary flex w-full flex-col overflow-hidden outline-none", t),
20
- ...r,
21
- children: /* @__PURE__ */ n(B, {
22
- id: a,
23
- children: e
16
+ function k({ shouldFilter: r = !1, className: e, children: n, ...l }) {
17
+ const s = D();
18
+ return /* @__PURE__ */ t(i, {
19
+ className: a("bg-pho-primary text-pho-primary flex w-full flex-col overflow-hidden outline-none", e),
20
+ shouldFilter: r,
21
+ ...l,
22
+ children: /* @__PURE__ */ t(A, {
23
+ id: s,
24
+ children: n
24
25
  })
25
26
  });
26
27
  }
27
- function F({ className: t, ...e }) {
28
- return /* @__PURE__ */ n("div", {
29
- className: l("border-pho-secondary relative flex items-center border-b", t),
28
+ function T({ className: r, ...e }) {
29
+ return /* @__PURE__ */ t("div", {
30
+ className: a("border-pho-secondary relative flex items-center border-b", r),
30
31
  ...e
31
32
  });
32
33
  }
33
- var C = typeof window > "u" ? D : W;
34
- function U(t, e) {
35
- typeof t == "function" ? t(e) : t && (t.current = e);
34
+ var B = typeof window > "u" ? P : V;
35
+ function U(r, e) {
36
+ typeof r == "function" ? r(e) : r && (r.current = e);
36
37
  }
37
- function J({ className: t, value: e, ref: r, ...a }) {
38
- const c = I(null), u = k((o) => o.search);
39
- return C(() => {
40
- const o = c.current;
41
- e == null || o == null || e === u || (Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(o, e), o.dispatchEvent(new Event("input", { bubbles: !0 })));
42
- }, [e, u]), /* @__PURE__ */ n(f.Input, {
43
- className: l("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", t),
44
- ...a,
38
+ function W({ className: r, value: e, ref: n, ...l }) {
39
+ const s = $(null), c = R((o) => o.search);
40
+ return B(() => {
41
+ const o = s.current;
42
+ e == null || o == null || e === c || (Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(o, e), o.dispatchEvent(new Event("input", { bubbles: !0 })));
43
+ }, [e, c]), /* @__PURE__ */ t(i.Input, {
44
+ className: a("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),
45
+ ...l,
45
46
  ref: (o) => {
46
- c.current = o, U(r, o);
47
- }
48
- });
49
- }
50
- function K() {
51
- const t = I(null), e = k((s) => s.value), r = k((s) => s.search), a = E(0), c = E(0), u = E(0), o = I(!1), b = I(null);
52
- return C(() => {
53
- const s = t.current, d = s?.closest("[cmdk-list]");
54
- if (!s || !d) return;
55
- const g = () => {
56
- const i = d.querySelector('[cmdk-item][aria-selected="true"]');
57
- if (!i) {
58
- d.querySelector("[cmdk-item]") || (o.current = !1, u.set(0));
59
- return;
60
- }
61
- const v = b.current !== r;
62
- if (v && i !== d.querySelector('[cmdk-item]:not([aria-disabled="true"])'))
63
- return;
64
- let x = 0, m = i;
65
- for (; m && m !== d; )
66
- x += m.offsetTop, m = m.offsetParent instanceof HTMLElement ? m.offsetParent : null;
67
- if (s.style.left = `${i.offsetLeft}px`, s.style.width = `${i.offsetWidth}px`, b.current = r, !o.current || v) {
68
- o.current = !0, a.jump(x), c.jump(i.offsetHeight), u.set(1);
69
- return;
70
- }
71
- j(a, x, L), j(c, i.offsetHeight, L);
72
- };
73
- g();
74
- const p = s.parentElement;
75
- if (!p) return;
76
- const h = new ResizeObserver(g);
77
- h.observe(p);
78
- for (const i of p.children) i !== s && h.observe(i);
79
- const w = new MutationObserver(() => {
80
- for (const i of p.children) i !== s && h.observe(i);
81
- g();
82
- });
83
- return w.observe(p, { childList: !0 }), () => {
84
- h.disconnect(), w.disconnect();
85
- };
86
- }, [
87
- e,
88
- r,
89
- a,
90
- c,
91
- u
92
- ]), /* @__PURE__ */ n(G.div, {
93
- ref: t,
94
- "aria-hidden": !0,
95
- "data-command-selection": "",
96
- className: "bg-pho-ghost-hover pointer-events-none absolute -z-10 rounded-[calc(var(--radius-base)-4px)]",
97
- style: {
98
- top: a,
99
- height: c,
100
- opacity: u
47
+ s.current = o, U(n, o);
101
48
  }
102
49
  });
103
50
  }
104
- function Q({ className: t, children: e, ...r }) {
105
- const a = O();
106
- return /* @__PURE__ */ n(q, { children: /* @__PURE__ */ y(f.List, {
107
- className: l("relative isolate max-h-[min(24rem,60vh)] overflow-y-auto overscroll-contain p-1", t),
108
- ...r,
109
- children: [a ? null : /* @__PURE__ */ n(K, {}), e]
51
+ function q({ className: r, children: e, ...n }) {
52
+ return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(x.div, {
53
+ layoutScroll: !0,
54
+ className: "max-h-[min(24rem,60vh)] scroll-py-1 overflow-y-auto overscroll-contain",
55
+ children: /* @__PURE__ */ t(i.List, {
56
+ className: a("relative isolate p-1", r),
57
+ ...n,
58
+ children: e
59
+ })
110
60
  }) });
111
61
  }
112
- function X({ className: t, ...e }) {
113
- return /* @__PURE__ */ n(f.Empty, {
114
- className: l("text-pho-description px-2.5 py-6 text-center text-base", t),
62
+ function J({ className: r, ...e }) {
63
+ return /* @__PURE__ */ t(i.Empty, {
64
+ className: a("text-pho-description px-2.5 py-6 text-center text-base", r),
115
65
  ...e
116
66
  });
117
67
  }
118
- function Y({ className: t, ...e }) {
119
- return /* @__PURE__ */ n(f.Group, {
120
- className: l("[&_[cmdk-group-heading]]:text-pho-secondary [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs", t),
68
+ function K({ className: r, ...e }) {
69
+ return /* @__PURE__ */ t(i.Group, {
70
+ className: a("[&_[cmdk-group-heading]]:text-pho-secondary [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs", r),
121
71
  ...e
122
72
  });
123
73
  }
124
- function S({ className: t, ...e }) {
125
- return /* @__PURE__ */ n("span", {
126
- className: l("text-pho-secondary flex size-4 shrink-0 items-center justify-center [&>svg]:size-4", t),
74
+ function f({ className: r, ...e }) {
75
+ return /* @__PURE__ */ t("span", {
76
+ className: a("text-pho-secondary flex size-4 shrink-0 items-center justify-center [&>svg]:size-4", r),
127
77
  ...e
128
78
  });
129
79
  }
130
- function H({ className: t, level: e = "item", ...r }) {
131
- return /* @__PURE__ */ n("span", {
132
- className: l("text-md block truncate", e === "item" && "text-pho-primary", t),
133
- ...r
80
+ function E({ className: r, level: e = "item", ...n }) {
81
+ return /* @__PURE__ */ t("span", {
82
+ className: a("text-md block truncate", e === "item" && "text-pho-primary", r),
83
+ ...n
134
84
  });
135
85
  }
136
- function z() {
137
- return /* @__PURE__ */ n(V, {
86
+ function I() {
87
+ return /* @__PURE__ */ t(z, {
138
88
  "aria-hidden": !0,
139
89
  className: "text-pho-description size-4 shrink-0"
140
90
  });
141
91
  }
142
- function Z({ className: t, level: e = "item", icon: r, iconSlot: a, title: c, path: u, scope: o, external: b, children: s, value: d, ...g }) {
143
- const p = O(), h = typeof d == "string" ? d.trim() : "", w = k((R) => R.value), i = h !== "" && w === h, v = c != null, x = e === "result", m = x && (r != null || a), M = /* @__PURE__ */ n(f.Item, {
92
+ function Q({ className: r, level: e = "item", icon: n, iconSlot: l, title: s, path: c, scope: o, external: y, children: m, value: p, ...L }) {
93
+ const G = F(), g = typeof p == "string" ? p.trim() : "", S = R((h) => h.value), _ = g !== "" && S === g, b = s != null, N = e === "result", C = N && (n != null || l), v = /* @__PURE__ */ t(i.Item, {
144
94
  "data-level": e,
145
- value: d,
146
- className: l("text-pho-secondary flex cursor-pointer items-center gap-2 rounded-[calc(var(--radius-base)-4px)] py-2 pr-2.5 text-base outline-none select-none", e === "subsubitem" ? "pl-6" : "pl-2", "data-[selected=true]:text-pho-primary", p && "data-[selected=true]:bg-pho-ghost-hover", "data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", t),
147
- ...g,
148
- children: v && x ? /* @__PURE__ */ y(P, { children: [
149
- m ? /* @__PURE__ */ n(S, {
150
- "aria-hidden": r == null ? !0 : void 0,
151
- children: r ?? null
95
+ value: p,
96
+ className: a("text-pho-secondary flex cursor-pointer items-center gap-2 rounded-[calc(var(--radius-base)-4px)] py-2 pr-2.5 text-base outline-none select-none", 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),
97
+ ...L,
98
+ children: b && N ? /* @__PURE__ */ u(w, { children: [
99
+ C ? /* @__PURE__ */ t(f, {
100
+ "aria-hidden": n == null ? !0 : void 0,
101
+ children: n ?? null
152
102
  }) : null,
153
- /* @__PURE__ */ y("span", {
103
+ /* @__PURE__ */ u("span", {
154
104
  className: "text-md flex min-w-0 flex-1 items-center gap-1 overflow-hidden",
155
- children: [/* @__PURE__ */ n("span", {
105
+ children: [/* @__PURE__ */ t("span", {
156
106
  className: "text-pho-primary truncate",
157
- children: c
158
- }), (u ?? []).map((R, T) => /* @__PURE__ */ y("span", {
107
+ children: s
108
+ }), (c ?? []).map((h, j) => /* @__PURE__ */ u("span", {
159
109
  className: "text-pho-description flex shrink-0 items-center gap-0.5",
160
- children: [/* @__PURE__ */ n($, {
110
+ children: [/* @__PURE__ */ t(M, {
161
111
  "aria-hidden": !0,
162
112
  className: "size-4 shrink-0"
163
- }), R]
164
- }, T))]
113
+ }), h]
114
+ }, j))]
165
115
  }),
166
- o != null && o !== "" ? /* @__PURE__ */ n("span", {
116
+ o != null && o !== "" ? /* @__PURE__ */ t("span", {
167
117
  className: "text-pho-description shrink-0 text-xs",
168
118
  children: o
169
119
  }) : null,
170
- b ? /* @__PURE__ */ n(z, {}) : null,
171
- s
172
- ] }) : v ? /* @__PURE__ */ y(P, { children: [
173
- /* @__PURE__ */ n(S, {
174
- "aria-hidden": r == null ? !0 : void 0,
175
- children: r ?? null
120
+ y ? /* @__PURE__ */ t(I, {}) : null,
121
+ m
122
+ ] }) : b ? /* @__PURE__ */ u(w, { children: [
123
+ /* @__PURE__ */ t(f, {
124
+ "aria-hidden": n == null ? !0 : void 0,
125
+ children: n ?? null
176
126
  }),
177
- /* @__PURE__ */ n("span", {
127
+ /* @__PURE__ */ t("span", {
178
128
  className: "min-w-0 flex-1",
179
- children: /* @__PURE__ */ n(H, {
129
+ children: /* @__PURE__ */ t(E, {
180
130
  level: e,
181
- children: c
131
+ children: s
182
132
  })
183
133
  }),
184
- b ? /* @__PURE__ */ n(z, {}) : null,
185
- s
186
- ] }) : s
134
+ y ? /* @__PURE__ */ t(I, {}) : null,
135
+ m
136
+ ] }) : m
187
137
  });
188
- return p ? M : /* @__PURE__ */ n(G.div, {
138
+ return G ? v : /* @__PURE__ */ t(x.div, {
189
139
  layout: "position",
190
- layoutId: typeof d == "string" ? d : void 0,
140
+ layoutId: typeof p == "string" ? p : void 0,
191
141
  initial: !1,
192
- transition: i ? { duration: 0 } : L,
193
- children: M
142
+ transition: _ ? { duration: 0 } : H,
143
+ children: v
194
144
  });
195
145
  }
196
- function ee({ className: t, ...e }) {
197
- return /* @__PURE__ */ n(f.Separator, {
198
- className: l("-mx-1 my-1 h-px bg-[var(--border-color-pho-secondary)]", t),
146
+ function X({ className: r, ...e }) {
147
+ return /* @__PURE__ */ t(i.Separator, {
148
+ className: a("-mx-1 my-1 h-px bg-[var(--border-color-pho-secondary)]", r),
199
149
  ...e
200
150
  });
201
151
  }
202
- function te({ className: t, ...e }) {
203
- return /* @__PURE__ */ n(f.Loading, {
204
- className: l("text-pho-description px-2.5 py-1.5 text-base", t),
152
+ function Y({ className: r, ...e }) {
153
+ return /* @__PURE__ */ t(i.Loading, {
154
+ className: a("text-pho-description px-2.5 py-1.5 text-base", r),
205
155
  ...e
206
156
  });
207
157
  }
208
- function ne({ open: t, onOpenChange: e, label: r, className: a, children: c, ...u }) {
209
- return /* @__PURE__ */ n(N.Root, {
210
- open: t,
158
+ function Z({ open: r, onOpenChange: e, label: n, className: l, children: s, ...c }) {
159
+ return /* @__PURE__ */ t(d.Root, {
160
+ open: r,
211
161
  onOpenChange: e,
212
- children: /* @__PURE__ */ y(N.Portal, { children: [/* @__PURE__ */ n(N.Backdrop, {}), /* @__PURE__ */ n(N.Popup, {
213
- "aria-label": r,
214
- className: l("top-[max(4rem,18vh)] max-w-xl translate-y-0 overflow-hidden p-0", a),
215
- children: /* @__PURE__ */ n(_, {
216
- label: r,
217
- ...u,
218
- children: c
162
+ children: /* @__PURE__ */ u(d.Portal, { children: [/* @__PURE__ */ t(d.Backdrop, {}), /* @__PURE__ */ t(d.Popup, {
163
+ "aria-label": n,
164
+ className: a("top-[max(4rem,18vh)] max-w-xl translate-y-0 overflow-hidden p-0", l),
165
+ children: /* @__PURE__ */ t(x.div, {
166
+ layoutRoot: !0,
167
+ children: /* @__PURE__ */ t(k, {
168
+ label: n,
169
+ ...c,
170
+ children: s
171
+ })
219
172
  })
220
173
  })] })
221
174
  });
222
175
  }
223
- var pe = {
224
- Root: _,
225
- InputGroup: F,
226
- Input: J,
227
- List: Q,
228
- Empty: X,
229
- Group: Y,
230
- Item: Z,
231
- ItemIcon: S,
232
- ItemTitle: H,
233
- Separator: ee,
234
- Loading: te,
235
- Dialog: ne
176
+ var ce = {
177
+ Root: k,
178
+ InputGroup: T,
179
+ Input: W,
180
+ List: q,
181
+ Empty: J,
182
+ Group: K,
183
+ Item: Q,
184
+ ItemIcon: f,
185
+ ItemTitle: E,
186
+ Separator: X,
187
+ Loading: Y,
188
+ Dialog: Z
236
189
  };
237
190
  export {
238
- pe as Command,
239
- k as useCommandState
191
+ ce as Command,
192
+ R as useCommandState
240
193
  };
241
194
 
242
195
  //# sourceMappingURL=command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","names":[],"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 { Command as CommandPrimitive, useCommandState } from \"cmdk\";\nimport {\n animate,\n LayoutGroup,\n motion,\n useMotionValue,\n useReducedMotion,\n} from \"motion/react\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\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 = {\n type: \"spring\",\n stiffness: 640,\n damping: 50,\n} as const;\n\nfunction Root({\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 {...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\n/**\n * The selection highlight, decoupled from the rows. Rendered once per list as\n * an absolutely-positioned layer sitting on the selected row's *final* layout\n * position (`offsetTop` ignores in-flight FLIP transforms).\n *\n * The invariant (learned the hard way): the highlight must sit exactly on the\n * selected row at every moment. So when the list reflows (search change) the\n * pill *snaps* to the re-anchored row — which itself skips its travel\n * animation (see `Item`) — and the highlight simply *is* on the new content.\n * Only selection moves within a stable list (arrow keys / hover) glide.\n */\nfunction SelectionPill() {\n const pillRef = useRef<HTMLDivElement>(null);\n const selectedValue = useCommandState((state) => state.value);\n const search = useCommandState((state) => state.search);\n const top = useMotionValue(0);\n const height = useMotionValue(0);\n const opacity = useMotionValue(0);\n const visibleRef = useRef(false);\n const measuredSearchRef = useRef<string | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n const pill = pillRef.current;\n const list = pill?.closest<HTMLElement>(\"[cmdk-list]\");\n if (!pill || !list) return;\n\n const measure = () => {\n const row = list.querySelector<HTMLElement>(\n '[cmdk-item][aria-selected=\"true\"]',\n );\n if (!row) {\n // Hide only when the list truly has no rows (empty state). A missing\n // selected row while rows exist is the mid-cascade moment before\n // cmdk re-anchors to the first row — hold position until the\n // follow-up pass instead of blinking out and snapping back in.\n if (!list.querySelector(\"[cmdk-item]\")) {\n visibleRef.current = false;\n opacity.set(0);\n }\n return;\n }\n const reflowed = measuredSearchRef.current !== search;\n if (reflowed) {\n // After a search change cmdk always re-anchors selection to the first\n // enabled row. A selected row anywhere else is the *old* value still\n // mid-cascade (its twin can exist in the new tree, e.g. a search\n // result reverting to its idle group row) — measuring it would send\n // the pill on a long flight. Hold; the corrective pass lands here.\n const firstEnabledRow = list.querySelector<HTMLElement>(\n '[cmdk-item]:not([aria-disabled=\"true\"])',\n );\n if (row !== firstEnabledRow) return;\n }\n // Layout-space position relative to the list (offsetTop is unaffected\n // by the rows' FLIP transforms, so this is the settled target).\n let nextTop = 0;\n let node: HTMLElement | null = row;\n while (node && node !== list) {\n nextTop += node.offsetTop;\n node =\n node.offsetParent instanceof HTMLElement ? node.offsetParent : null;\n }\n pill.style.left = `${row.offsetLeft}px`;\n pill.style.width = `${row.offsetWidth}px`;\n // Snap on (re)appearance and on list reflows (search changed): the\n // re-anchored row appears in place, and the highlight must be on it in\n // the same frame. Glide only for selection moves in a stable list.\n measuredSearchRef.current = search;\n if (!visibleRef.current || reflowed) {\n visibleRef.current = true;\n top.jump(nextTop);\n height.jump(row.offsetHeight);\n opacity.set(1);\n return;\n }\n animate(top, nextTop, ROW_MOVE_SPRING);\n animate(height, row.offsetHeight, ROW_MOVE_SPRING);\n };\n\n measure();\n\n // Re-measure when content reflows without a selection change (rows\n // entering / leaving above the selected row shift its slot). The list\n // box itself is height-capped — observe its content children so inner\n // reflows still fire once the outer size stops changing.\n const listEl = pill.parentElement;\n if (!listEl) return;\n const observer = new ResizeObserver(measure);\n observer.observe(listEl);\n for (const child of listEl.children) {\n if (child !== pill) observer.observe(child);\n }\n const mutations = new MutationObserver(() => {\n for (const child of listEl.children) {\n if (child !== pill) observer.observe(child);\n }\n measure();\n });\n mutations.observe(listEl, { childList: true });\n return () => {\n observer.disconnect();\n mutations.disconnect();\n };\n }, [selectedValue, search, top, height, opacity]);\n\n return (\n <motion.div\n ref={pillRef}\n aria-hidden\n data-command-selection=\"\"\n className=\"bg-pho-ghost-hover pointer-events-none absolute -z-10 rounded-[calc(var(--radius-base)-4px)]\"\n style={{ top, height, opacity }}\n />\n );\n}\n\nfunction List({\n className,\n children,\n ...props\n}: ComponentProps<typeof CommandPrimitive.List>) {\n const reduceMotion = useReducedMotion();\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 <CommandPrimitive.List\n className={cn(\n // relative anchors the pill's offset math; isolate keeps its\n // negative z-index below the rows but above the panel background.\n \"relative isolate max-h-[min(24rem,60vh)] overflow-y-auto overscroll-contain p-1\",\n className,\n )}\n {...props}\n >\n {reduceMotion ? null : <SelectionPill />}\n {children}\n </CommandPrimitive.List>\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\";\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 /** 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`, secondary ink. */\nfunction ItemIcon({ className, ...props }: ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-pho-secondary flex size-4 shrink-0 items-center justify-center [&>svg]:size-4\",\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 ...props\n}: ComponentProps<\"span\"> & { level?: CommandItemLevel }) {\n return (\n <span\n className={cn(\n \"text-md block truncate\",\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 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 value={value}\n className={cn(\n \"text-pho-secondary flex cursor-pointer items-center gap-2 rounded-[calc(var(--radius-base)-4px)] py-2 pr-2.5 text-base outline-none select-none\",\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). The\n // ghost wash comes from the list's SelectionPill overlay; fall back\n // to a static background when motion is off (no pill rendered).\n \"data-[selected=true]:text-pho-primary\",\n reduceMotion && \"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 aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n ) : null}\n {/* Same text-md line box as idle ItemTitle so row height matches (36px). */}\n <span className=\"text-md flex min-w-0 flex-1 items-center gap-1 overflow-hidden\">\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 aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n <span className=\"min-w-0 flex-1\">\n <ItemTitle level={level}>{title}</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 highlight (which also\n // snaps on reflow — see SelectionPill) is never sitting on empty space\n // 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 <Root label={label} {...props}>\n {children}\n </Root>\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). By\n * default cmdk filters and ranks items for you; pass `shouldFilter={false}`\n * to render your own result set (e.g. hierarchy-preserving navigation).\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":";;;;;;;;;;AA2BA,IAAM,IAAkB;AAAA,EACtB,MAAM;AAAA,EACN,WA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,IAAa,EAAE,UAAU,EAAE,IAAI;AAAA,IAE1C,UAAA;AAAA,EACS,CAAA;AAEhB;AAEA,SAAS,GAAU,EACjB,WAAA,GACA,GAAG,EAAA,GACiD;AACpD,SACE,gBAAA,EAAC,EAAiB,WAAlB;AAAA,IACE,WAAW,EACT,0DACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,GAAQ,EACf,WAAA,GACA,GAAG,EAAA,GAC+C;AAClD,SACE,gBAAA,EAAC,EAAiB,SAAlB;AAAA,IACE,WAAW,EAAG,gDAAgD,CAAS;AAAA,IACvE,GAAI;AAAA,EACL,CAAA;AAEL;AAsBA,SAAS,GAAO,EACd,MAAA,GACA,cAAA,GACA,OAAA,GACA,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACkB;AACrB,SACE,gBAAA,EAAC,EAAU,MAAX;AAAA,IAAsB,MAAA;AAAA,IAAoB,cAAA;AAAA,IACxC,UAAA,gBAAA,EAAC,EAAU,QAAX,EAAA,UAAA,CACE,gBAAA,EAAC,EAAU,UAAX,CAAqB,CAAA,GACrB,gBAAA,EAAC,EAAU,OAAX;AAAA,MACE,cAAY;AAAA,MAGZ,WAAW,EACT,mEACA,CACF;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAa,OAAA;AAAA,QAAO,GAAI;AAAA,QACrB,UAAA;AAAA,MACG,CAAA;AAAA,IACS,CAAA,CACD,EAAA,CAAA;AAAA,EACJ,CAAA;AAEpB;AAYA,IAAa,KAAU;AAAA,EACrB,MAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AACF"}
1
+ {"version":3,"file":"command.js","names":[],"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 { 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 { 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 = {\n type: \"spring\",\n stiffness: 640,\n damping: 50,\n} as const;\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\";\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 /** 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`, secondary ink. */\nfunction ItemIcon({ className, ...props }: ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-pho-secondary flex size-4 shrink-0 items-center justify-center [&>svg]:size-4\",\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 ...props\n}: ComponentProps<\"span\"> & { level?: CommandItemLevel }) {\n return (\n <span\n className={cn(\n \"text-md block truncate\",\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 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 value={value}\n className={cn(\n \"text-pho-secondary flex cursor-pointer items-center gap-2 rounded-[calc(var(--radius-base)-4px)] py-2 pr-2.5 text-base outline-none select-none\",\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 aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n ) : null}\n {/* Same text-md line box as idle ItemTitle so row height matches (36px). */}\n <span className=\"text-md flex min-w-0 flex-1 items-center gap-1 overflow-hidden\">\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 aria-hidden={icon == null ? true : undefined}>\n {icon ?? null}\n </ItemIcon>\n <span className=\"min-w-0 flex-1\">\n <ItemTitle level={level}>{title}</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":";;;;;;;;;;AAqBA,IAAM,IAAkB;AAAA,EACtB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AACX;AAEA,SAAS,EAAK,EAMZ,cAAA,IAAe,IACf,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACuC;AAG1C,QAAM,IAAkB,EAAM;AAC9B,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAW,EACT,qFACA,CACF;AAAA,IACc,cAAA;AAAA,IACd,GAAI;AAAA,IAEJ,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAa,IAAI;AAAA,MAAkB,UAAA;AAAA,IAAsB,CA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IACG,CAAA,CACD,EAAA,CAAA;AAAA,EACJ,CAAA;AAEpB;AAaA,IAAa,KAAU;AAAA,EACrB,MAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AACF"}
@@ -1,60 +1,60 @@
1
1
  "use client";
2
- import { t as a } from "../chunks/cn-ChIgwEl3.js";
2
+ import { t } from "../chunks/cn-ChIgwEl3.js";
3
3
  import { t as v } from "../chunks/resolve-variant-CcD8iG5l.js";
4
- import { a as b, c as x, n as M, o as h, r as N, t as s } from "../chunks/menu-Cgj3lq9z.js";
4
+ import { a as b, c as x, n as M, o as h, r as N, t as i } from "../chunks/menu-BQeprfxB.js";
5
5
  import "react";
6
- import { Fragment as P, jsx as t, jsxs as i } from "react/jsx-runtime";
6
+ import { Fragment as P, jsx as a, jsxs as s } from "react/jsx-runtime";
7
7
  import { Separator as S } from "@base-ui/react/separator";
8
8
  import { ContextMenu as e } from "@base-ui/react/context-menu";
9
9
  var R = x(e.Root), y = e.Trigger, G = e.Portal, I = e.Group, T = e.RadioGroup, C = e.SubmenuRoot;
10
10
  function E({ className: r, ...o }) {
11
- return /* @__PURE__ */ t(e.Positioner, {
12
- className: a("z-50", r),
11
+ return /* @__PURE__ */ a(e.Positioner, {
12
+ className: t("z-50", r),
13
13
  ...o
14
14
  });
15
15
  }
16
16
  function U({ className: r, ...o }) {
17
- return /* @__PURE__ */ t(e.Popup, {
18
- className: a(N, r),
17
+ return /* @__PURE__ */ a(e.Popup, {
18
+ className: t(N, r),
19
19
  ...o
20
20
  });
21
21
  }
22
- function _({ className: r, color: o = "default", onClick: p, closeOnClick: u = !0, loading: m = !1, disabled: l = !1, children: c, ...d }) {
22
+ function _({ className: r, color: o = "default", onClick: m, closeOnClick: u = !0, loading: p = !1, disabled: l = !1, children: c, ...d }) {
23
23
  const { inert: n, blocked: f, handleClick: g } = h({
24
- onClick: p,
24
+ onClick: m,
25
25
  closeOnClick: u,
26
- loading: m,
26
+ loading: p,
27
27
  disabled: l
28
28
  });
29
- return /* @__PURE__ */ i(e.Item, {
30
- className: a(s, v(M, o), r),
29
+ return /* @__PURE__ */ s(e.Item, {
30
+ className: t(i, v(M, o), r),
31
31
  closeOnClick: u,
32
32
  disabled: f,
33
33
  "data-loading": n || void 0,
34
34
  "aria-busy": n || void 0,
35
35
  onClick: g,
36
36
  ...d,
37
- children: [n ? /* @__PURE__ */ i(P, { children: [/* @__PURE__ */ t(b, {}), /* @__PURE__ */ t("output", {
37
+ children: [n ? /* @__PURE__ */ s(P, { children: [/* @__PURE__ */ a(b, {}), /* @__PURE__ */ a("output", {
38
38
  className: "sr-only",
39
39
  "aria-live": "polite"
40
40
  })] }) : null, c]
41
41
  });
42
42
  }
43
43
  function L({ className: r, ...o }) {
44
- return /* @__PURE__ */ t(e.GroupLabel, {
45
- className: a("text-pho-secondary px-2.5 py-1.5 text-xs font-medium", r),
44
+ return /* @__PURE__ */ a(e.GroupLabel, {
45
+ className: t("text-pho-secondary px-2.5 py-1.5 text-xs font-medium", r),
46
46
  ...o
47
47
  });
48
48
  }
49
- function j({ className: r, ...o }) {
50
- return /* @__PURE__ */ t(S, {
51
- className: a("-mx-1.5 my-1.5 h-px bg-[var(--border-color-pho-secondary)]", r),
49
+ function $({ className: r, ...o }) {
50
+ return /* @__PURE__ */ a(S, {
51
+ className: t("-mx-1.5 my-1.5 h-px bg-[var(--border-color-pho-secondary)]", r),
52
52
  ...o
53
53
  });
54
54
  }
55
- function k({ className: r, ...o }) {
56
- return /* @__PURE__ */ t(e.SubmenuTrigger, {
57
- className: a(s, "data-[popup-open]:bg-pho-ghost-hover", r),
55
+ function j({ className: r, ...o }) {
56
+ return /* @__PURE__ */ a(e.SubmenuTrigger, {
57
+ className: t(i, "data-[popup-open]:bg-pho-ghost-hover", r),
58
58
  ...o
59
59
  });
60
60
  }
@@ -67,9 +67,9 @@ var q = {
67
67
  Item: _,
68
68
  Group: I,
69
69
  GroupLabel: L,
70
- Separator: j,
70
+ Separator: $,
71
71
  SubmenuRoot: C,
72
- SubmenuTrigger: k,
72
+ SubmenuTrigger: j,
73
73
  RadioGroup: T
74
74
  };
75
75
  export {
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { n as i, t as o } from "../chunks/dialog-DtFO7oy0.js";
2
+ import { n as i, t as o } from "../chunks/dialog-8SRNi_rv.js";
3
3
  export {
4
4
  o as Dialog,
5
5
  i as useDialogPending
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a, c as s, i as t, l as e, n as o, o as i, r as E, s as p, t as l } from "../chunks/error-Da7P5WZi.js";
2
+ import { a, c as s, i as t, l as e, n as o, o as i, r as E, s as p, t as l } from "../chunks/error-Crs-wqMC.js";
3
3
  export {
4
4
  l as Error,
5
5
  o as ErrorView,