@photon-ai/pho-ui 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js +11 -0
- package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js.map +1 -0
- package/dist/chunks/IconArrowUpRight-DGgKzQwV.js +14 -0
- package/dist/chunks/IconArrowUpRight-DGgKzQwV.js.map +1 -0
- package/dist/chunks/IconChevronLeft-CSWMKQ4C.js +11 -0
- package/dist/chunks/IconChevronLeft-CSWMKQ4C.js.map +1 -0
- package/dist/chunks/IconInfoCircle-L0zfhg7R.js +21 -0
- package/dist/chunks/IconInfoCircle-L0zfhg7R.js.map +1 -0
- package/dist/chunks/animated-height-DhNSac85.js +50 -0
- package/dist/chunks/animated-height-DhNSac85.js.map +1 -0
- package/dist/chunks/basic-page-D1zm81YS.js +481 -0
- package/dist/chunks/basic-page-D1zm81YS.js.map +1 -0
- package/dist/chunks/{close-button-B8gF5UNk.js → button-X5wsWvRa.js} +127 -147
- package/dist/chunks/button-X5wsWvRa.js.map +1 -0
- package/dist/chunks/close-button-xadxp0j8.js +29 -0
- package/dist/chunks/close-button-xadxp0j8.js.map +1 -0
- package/dist/chunks/combobox-rLdS6fl-.js +117 -0
- package/dist/chunks/combobox-rLdS6fl-.js.map +1 -0
- package/dist/chunks/dialog-Caze1vkf.js +252 -0
- package/dist/chunks/dialog-Caze1vkf.js.map +1 -0
- package/dist/chunks/error-DR6G2LmG.js +251 -0
- package/dist/chunks/error-DR6G2LmG.js.map +1 -0
- package/dist/chunks/{input-CxS7ndpb.js → input-D3XQcC4J.js} +29 -31
- package/dist/chunks/input-D3XQcC4J.js.map +1 -0
- package/dist/chunks/{menu-BSXds3Rt.js → menu-BC-9IP29.js} +39 -39
- package/dist/chunks/menu-BC-9IP29.js.map +1 -0
- package/dist/chunks/popover-EL1SE1kj.js +46 -0
- package/dist/chunks/popover-EL1SE1kj.js.map +1 -0
- package/dist/chunks/{sidebar-DGpEKxOn.js → sidebar-DDJC1MeD.js} +72 -64
- package/dist/chunks/sidebar-DDJC1MeD.js.map +1 -0
- package/dist/components/button.js +13 -12
- package/dist/components/combobox.js +2 -114
- package/dist/components/command.js +242 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/error.js +13 -0
- package/dist/components/input.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/notification.js +27 -39
- package/dist/components/notification.js.map +1 -1
- package/dist/components/phone-input.js +17001 -0
- package/dist/components/phone-input.js.map +1 -0
- package/dist/components/popover.js +2 -43
- package/dist/components/toast.js.map +1 -1
- package/dist/index.js +62 -50
- package/dist/primitives.js +1 -1
- package/dist/sections/basic-page.js +1 -1
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/command/command.d.ts +114 -0
- package/dist/src/components/command/index.d.ts +1 -0
- package/dist/src/components/dialog/dialog.d.ts +89 -1
- package/dist/src/components/drawer/drawer.d.ts +2 -2
- package/dist/src/components/error/error.d.ts +56 -0
- package/dist/src/components/error/index.d.ts +2 -0
- package/dist/src/components/error/problem.d.ts +80 -0
- package/dist/src/components/notification/notification.d.ts +1 -1
- package/dist/src/components/phone-input/country-alpha3.d.ts +250 -0
- package/dist/src/components/phone-input/country-search.d.ts +8 -0
- package/dist/src/components/phone-input/index.d.ts +1 -0
- package/dist/src/components/phone-input/phone-input.d.ts +47 -0
- package/dist/src/components/toast/toast.d.ts +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/sections/basic-page/basic-page.d.ts +165 -45
- package/dist/src/sections/sidebar/sidebar.d.ts +8 -3
- package/dist/src/utils/animated-height.d.ts +13 -0
- package/package.json +16 -5
- package/src/styles/theme.css +27 -0
- package/dist/chunks/basic-page-4_GZOvRr.js +0 -255
- package/dist/chunks/basic-page-4_GZOvRr.js.map +0 -1
- package/dist/chunks/close-button-B8gF5UNk.js.map +0 -1
- package/dist/chunks/dialog-Ba0UUE5g.js +0 -155
- package/dist/chunks/dialog-Ba0UUE5g.js.map +0 -1
- package/dist/chunks/input-CxS7ndpb.js.map +0 -1
- package/dist/chunks/menu-BSXds3Rt.js.map +0 -1
- package/dist/chunks/sidebar-DGpEKxOn.js.map +0 -1
- package/dist/components/alert-dialog.js +0 -59
- package/dist/components/alert-dialog.js.map +0 -1
- package/dist/components/combobox.js.map +0 -1
- package/dist/components/popover.js.map +0 -1
- package/dist/src/components/alert-dialog/alert-dialog.d.ts +0 -41
- package/dist/src/components/alert-dialog/index.d.ts +0 -1
|
@@ -1,117 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
-
import { Combobox as r } from "@base-ui/react/combobox";
|
|
6
|
-
var i = r.Root, s = r.Value, p = r.Portal, c = r.Group, l = r.Collection;
|
|
7
|
-
function h({ className: e, ...t }) {
|
|
8
|
-
return /* @__PURE__ */ n(r.InputGroup, {
|
|
9
|
-
className: o("relative flex items-center", e),
|
|
10
|
-
...t
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
function u({ className: e, ...t }) {
|
|
14
|
-
return /* @__PURE__ */ n(r.Input, {
|
|
15
|
-
className: o("bg-pho-primary ring-pho-primary text-pho-primary placeholder:text-pho-placeholder focus-visible:ring-pho-brand text-md rounded-base w-full px-3 py-2 ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-base", e),
|
|
16
|
-
...t
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function m({ className: e, ...t }) {
|
|
20
|
-
return /* @__PURE__ */ n(r.Clear, {
|
|
21
|
-
className: o("combobox-clear text-pho-secondary hover:text-pho-secondary-hover absolute right-2.5 flex cursor-pointer items-center [&>svg]:size-4", e),
|
|
22
|
-
...t
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function d({ className: e, ...t }) {
|
|
26
|
-
return /* @__PURE__ */ n(r.Trigger, {
|
|
27
|
-
className: o("text-pho-secondary hover:text-pho-secondary-hover absolute right-2.5 flex cursor-pointer items-center [&>svg]:size-4", e),
|
|
28
|
-
...t
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function g({ className: e, sideOffset: t = 6, ...a }) {
|
|
32
|
-
return /* @__PURE__ */ n(r.Positioner, {
|
|
33
|
-
sideOffset: t,
|
|
34
|
-
className: o("z-50 outline-none", e),
|
|
35
|
-
...a
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function x({ className: e, ...t }) {
|
|
39
|
-
return /* @__PURE__ */ n(r.Popup, {
|
|
40
|
-
className: o("bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base w-[var(--anchor-width)] max-w-[var(--available-width)] origin-[var(--transform-origin)] p-1 ring-1 transition-[transform,opacity] duration-150 ease-out outline-none ring-inset", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", e),
|
|
41
|
-
...t
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function y({ className: e, ...t }) {
|
|
45
|
-
return /* @__PURE__ */ n(r.List, {
|
|
46
|
-
className: o("max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain", e),
|
|
47
|
-
...t
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function b({ className: e, ...t }) {
|
|
51
|
-
return /* @__PURE__ */ n(r.Empty, {
|
|
52
|
-
className: o("text-pho-description px-2.5 py-6 text-center text-base empty:m-0 empty:p-0", e),
|
|
53
|
-
...t
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function f({ className: e, ...t }) {
|
|
57
|
-
return /* @__PURE__ */ n(r.Item, {
|
|
58
|
-
className: o("text-pho-secondary grid cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 rounded-[calc(var(--radius-base)-4px)] py-1.5 pr-2.5 pl-2 text-base outline-none select-none", "data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary", e),
|
|
59
|
-
...t
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function v({ className: e, ...t }) {
|
|
63
|
-
return /* @__PURE__ */ n(r.ItemIndicator, {
|
|
64
|
-
className: o("text-pho-brand col-start-1 flex items-center [&>svg]:size-4", e),
|
|
65
|
-
...t
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function N({ className: e, ...t }) {
|
|
69
|
-
return /* @__PURE__ */ n(r.GroupLabel, {
|
|
70
|
-
className: o("text-pho-secondary px-2.5 py-1.5 text-xs font-medium", e),
|
|
71
|
-
...t
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function C({ className: e, ...t }) {
|
|
75
|
-
return /* @__PURE__ */ n(r.Chips, {
|
|
76
|
-
className: o("bg-pho-primary ring-pho-primary focus-within:ring-pho-brand rounded-base flex flex-wrap items-center gap-1.5 p-1.5 ring-1 ring-inset focus-within:ring-2", e),
|
|
77
|
-
...t
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function w({ className: e, ...t }) {
|
|
81
|
-
return /* @__PURE__ */ n(r.Chip, {
|
|
82
|
-
className: o("bg-pho-secondary text-pho-secondary data-[highlighted]:bg-pho-inverse data-[highlighted]:text-pho-inverse flex items-center gap-1 rounded-sm py-0.5 pr-1 pl-2 text-base", e),
|
|
83
|
-
...t
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function I({ className: e, ...t }) {
|
|
87
|
-
return /* @__PURE__ */ n(r.ChipRemove, {
|
|
88
|
-
className: o("text-pho-secondary hover:text-pho-secondary-hover in-data-[highlighted]:text-pho-inverse flex cursor-pointer items-center rounded-sm [&>svg]:size-3.5", e),
|
|
89
|
-
...t
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
var R = {
|
|
93
|
-
Root: i,
|
|
94
|
-
Value: s,
|
|
95
|
-
InputGroup: h,
|
|
96
|
-
Input: u,
|
|
97
|
-
Trigger: d,
|
|
98
|
-
Clear: m,
|
|
99
|
-
Portal: p,
|
|
100
|
-
Positioner: g,
|
|
101
|
-
Popup: x,
|
|
102
|
-
List: y,
|
|
103
|
-
Collection: l,
|
|
104
|
-
Empty: b,
|
|
105
|
-
Item: f,
|
|
106
|
-
ItemIndicator: v,
|
|
107
|
-
Group: c,
|
|
108
|
-
GroupLabel: N,
|
|
109
|
-
Chips: C,
|
|
110
|
-
Chip: w,
|
|
111
|
-
ChipRemove: I
|
|
112
|
-
};
|
|
2
|
+
import { t } from "../chunks/combobox-rLdS6fl-.js";
|
|
113
3
|
export {
|
|
114
|
-
|
|
4
|
+
t as Combobox
|
|
115
5
|
};
|
|
116
|
-
|
|
117
|
-
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as l } from "../chunks/cn-DTiB6ek_.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-DhNSac85.js";
|
|
6
|
+
import { t as N } from "../chunks/dialog-Caze1vkf.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 = {
|
|
12
|
+
type: "spring",
|
|
13
|
+
stiffness: 640,
|
|
14
|
+
damping: 50
|
|
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
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function F({ className: t, ...e }) {
|
|
28
|
+
return /* @__PURE__ */ n("div", {
|
|
29
|
+
className: l("border-pho-secondary relative flex items-center border-b", t),
|
|
30
|
+
...e
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
var C = typeof window > "u" ? D : W;
|
|
34
|
+
function U(t, e) {
|
|
35
|
+
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
36
|
+
}
|
|
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,
|
|
45
|
+
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
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
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]
|
|
110
|
+
}) });
|
|
111
|
+
}
|
|
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),
|
|
115
|
+
...e
|
|
116
|
+
});
|
|
117
|
+
}
|
|
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),
|
|
121
|
+
...e
|
|
122
|
+
});
|
|
123
|
+
}
|
|
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),
|
|
127
|
+
...e
|
|
128
|
+
});
|
|
129
|
+
}
|
|
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
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function z() {
|
|
137
|
+
return /* @__PURE__ */ n(V, {
|
|
138
|
+
"aria-hidden": !0,
|
|
139
|
+
className: "text-pho-description size-4 shrink-0"
|
|
140
|
+
});
|
|
141
|
+
}
|
|
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, {
|
|
144
|
+
"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
|
|
152
|
+
}) : null,
|
|
153
|
+
/* @__PURE__ */ y("span", {
|
|
154
|
+
className: "text-md flex min-w-0 flex-1 items-center gap-1 overflow-hidden",
|
|
155
|
+
children: [/* @__PURE__ */ n("span", {
|
|
156
|
+
className: "text-pho-primary truncate",
|
|
157
|
+
children: c
|
|
158
|
+
}), (u ?? []).map((R, T) => /* @__PURE__ */ y("span", {
|
|
159
|
+
className: "text-pho-description flex shrink-0 items-center gap-0.5",
|
|
160
|
+
children: [/* @__PURE__ */ n($, {
|
|
161
|
+
"aria-hidden": !0,
|
|
162
|
+
className: "size-4 shrink-0"
|
|
163
|
+
}), R]
|
|
164
|
+
}, T))]
|
|
165
|
+
}),
|
|
166
|
+
o != null && o !== "" ? /* @__PURE__ */ n("span", {
|
|
167
|
+
className: "text-pho-description shrink-0 text-xs",
|
|
168
|
+
children: o
|
|
169
|
+
}) : 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
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ n("span", {
|
|
178
|
+
className: "min-w-0 flex-1",
|
|
179
|
+
children: /* @__PURE__ */ n(H, {
|
|
180
|
+
level: e,
|
|
181
|
+
children: c
|
|
182
|
+
})
|
|
183
|
+
}),
|
|
184
|
+
b ? /* @__PURE__ */ n(z, {}) : null,
|
|
185
|
+
s
|
|
186
|
+
] }) : s
|
|
187
|
+
});
|
|
188
|
+
return p ? M : /* @__PURE__ */ n(G.div, {
|
|
189
|
+
layout: "position",
|
|
190
|
+
layoutId: typeof d == "string" ? d : void 0,
|
|
191
|
+
initial: !1,
|
|
192
|
+
transition: i ? { duration: 0 } : L,
|
|
193
|
+
children: M
|
|
194
|
+
});
|
|
195
|
+
}
|
|
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),
|
|
199
|
+
...e
|
|
200
|
+
});
|
|
201
|
+
}
|
|
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),
|
|
205
|
+
...e
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function ne({ open: t, onOpenChange: e, label: r, className: a, children: c, ...u }) {
|
|
209
|
+
return /* @__PURE__ */ n(N.Root, {
|
|
210
|
+
open: t,
|
|
211
|
+
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
|
|
219
|
+
})
|
|
220
|
+
})] })
|
|
221
|
+
});
|
|
222
|
+
}
|
|
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
|
|
236
|
+
};
|
|
237
|
+
export {
|
|
238
|
+
pe as Command,
|
|
239
|
+
k as useCommandState
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +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,WAAW;AAAA,EACX,SAAS;AACX;AAEA,SAAS,EAAK,EACZ,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACuC;AAG1C,QAAM,IAAkB,EAAM;AAC9B,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,WAAW,EACT,qFACA,CACF;AAAA,IACA,GAAI;AAAA,cAEJ,gBAAA,EAAC,GAAD;AAAA,MAAa,IAAI;AAAA,MAAkB,UAAA;AAAA,IAAsB,CAAA;AAAA,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A,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,cACxC,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,gBAEA,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,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as a } from "../chunks/cn-DTiB6ek_.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-
|
|
4
|
+
import { a as b, c as x, n as M, o as h, r as N, t as s } from "../chunks/menu-BC-9IP29.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { Fragment as P, jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
7
7
|
import { Separator as S } from "@base-ui/react/separator";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","names":[],"sources":["../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Root = BaseDrawer.Root;\nconst Trigger = BaseDrawer.Trigger;\nconst Portal = BaseDrawer.Portal;\nconst Close = BaseDrawer.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Backdrop>) {\n return (\n <BaseDrawer.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-300 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Viewport>) {\n return (\n <BaseDrawer.Viewport\n className={cn(\n \"fixed inset-0 z-50 flex items-stretch justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDrawer.Popup>) {\n return (\n <BaseDrawer.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow; hairline edge is the\n // site card stroke (border-pho-secondary), not the interactive edge.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl h-full w-[22rem] max-w-[calc(100vw-3rem)] overflow-y-auto overscroll-contain border-l p-6 outline-none\",\n \"[transform:translateX(var(--drawer-swipe-movement-x,0px))] transition-transform duration-300 ease-out\",\n \"data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Content>) {\n return (\n <BaseDrawer.Content\n className={cn(\"flex h-full flex-col\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDrawer.Title>) {\n return (\n <BaseDrawer.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Description>) {\n return (\n <BaseDrawer.Description\n className={cn(\n \"text-pho-description text-display-xs mt-1 font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Drawer built on Base UI `Drawer` — a panel that slides in from the edge\n * (here, the right) with swipe-to-dismiss. Use it for secondary tasks and\n * navigation that should keep page context; for a
|
|
1
|
+
{"version":3,"file":"drawer.js","names":[],"sources":["../../src/components/drawer/drawer.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Root = BaseDrawer.Root;\nconst Trigger = BaseDrawer.Trigger;\nconst Portal = BaseDrawer.Portal;\nconst Close = BaseDrawer.Close;\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Backdrop>) {\n return (\n <BaseDrawer.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-300 ease-out\",\n \"data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Viewport({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Viewport>) {\n return (\n <BaseDrawer.Viewport\n className={cn(\n \"fixed inset-0 z-50 flex items-stretch justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDrawer.Popup>) {\n return (\n <BaseDrawer.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow; hairline edge is the\n // site card stroke (border-pho-secondary), not the interactive edge.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl h-full w-[22rem] max-w-[calc(100vw-3rem)] overflow-y-auto overscroll-contain border-l p-6 outline-none\",\n \"[transform:translateX(var(--drawer-swipe-movement-x,0px))] transition-transform duration-300 ease-out\",\n \"data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full data-[swiping]:duration-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Content({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Content>) {\n return (\n <BaseDrawer.Content\n className={cn(\"flex h-full flex-col\", className)}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDrawer.Title>) {\n return (\n <BaseDrawer.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDrawer.Description>) {\n return (\n <BaseDrawer.Description\n className={cn(\n \"text-pho-description text-display-xs mt-1 font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Drawer built on Base UI `Drawer` — a panel that slides in from the edge\n * (here, the right) with swipe-to-dismiss. Use it for secondary tasks and\n * navigation that should keep page context; for a decision or a centered modal\n * use `Dialog`. Compose `Drawer.Portal`\n * → `Backdrop` → `Viewport` → `Popup` → `Content`.\n */\nexport const Drawer = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Viewport,\n Popup,\n Content,\n Title,\n Description,\n Close,\n};\n"],"mappings":";;;;;AAYA,IAAM,IAAO,EAAW,MAClB,IAAU,EAAW,SACrB,IAAS,EAAW,QACpB,IAAQ,EAAW;AAEzB,SAAS,EAAS,EAChB,WAAA,GACA,GAAG,EAAA,GACuC;AAC1C,SACE,gBAAA,EAAC,EAAW,UAAZ;AAAA,IACE,WAAW,EACT,8EACA,2FACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAS,EAChB,WAAA,GACA,GAAG,EAAA,GACuC;AAC1C,SACE,gBAAA,EAAC,EAAW,UAAZ;AAAA,IACE,WAAW,EACT,qDACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA+C;AAC5E,SACE,gBAAA,EAAC,EAAW,OAAZ;AAAA,IACE,WAAW,EAGT,4JACA,yGACA,yGACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAQ,EACf,WAAA,GACA,GAAG,EAAA,GACsC;AACzC,SACE,gBAAA,EAAC,EAAW,SAAZ;AAAA,IACE,WAAW,EAAG,wBAAwB,CAAS;AAAA,IAC/C,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,WAAA,GAAW,GAAG,EAAA,GAA+C;AAC5E,SACE,gBAAA,EAAC,EAAW,OAAZ;AAAA,IACE,WAAW,EACT,0EACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAY,EACnB,WAAA,GACA,GAAG,EAAA,GAC0C;AAC7C,SACE,gBAAA,EAAC,EAAW,aAAZ;AAAA,IACE,WAAW,EACT,yDACA,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AASA,IAAa,IAAS;AAAA,EACpB,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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-DR6G2LmG.js";
|
|
3
|
+
export {
|
|
4
|
+
l as Error,
|
|
5
|
+
o as ErrorView,
|
|
6
|
+
E as GENERIC_ERROR_TITLE,
|
|
7
|
+
t as capitalizeFirst,
|
|
8
|
+
a as describeError,
|
|
9
|
+
i as httpReasonPhrase,
|
|
10
|
+
p as httpStatusExplanation,
|
|
11
|
+
s as isProblem,
|
|
12
|
+
e as parseProblem
|
|
13
|
+
};
|
package/dist/components/input.js
CHANGED
package/dist/components/menu.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t } from "../chunks/cn-DTiB6ek_.js";
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
3
|
+
import { t as y } from "../chunks/resolve-variant-CcD8iG5l.js";
|
|
4
|
+
import { t as d } from "../chunks/createReactComponent-BqCmnqfX.js";
|
|
5
|
+
import { t as n } from "../chunks/IconInfoCircle-L0zfhg7R.js";
|
|
5
6
|
import { t as N } from "../chunks/IconX-pZ9vrtSr.js";
|
|
6
7
|
import "react";
|
|
7
8
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
@@ -18,26 +19,13 @@ var k = [
|
|
|
18
19
|
d: "M12 16h.01",
|
|
19
20
|
key: "svg-2"
|
|
20
21
|
}]
|
|
21
|
-
], c =
|
|
22
|
+
], c = d("outline", "alert-circle", "AlertCircle", k), C = [["path", {
|
|
22
23
|
d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
|
|
23
24
|
key: "svg-0"
|
|
24
25
|
}], ["path", {
|
|
25
26
|
d: "M9 12l2 2l4 -4",
|
|
26
27
|
key: "svg-1"
|
|
27
|
-
}]], I =
|
|
28
|
-
["path", {
|
|
29
|
-
d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",
|
|
30
|
-
key: "svg-0"
|
|
31
|
-
}],
|
|
32
|
-
["path", {
|
|
33
|
-
d: "M12 9h.01",
|
|
34
|
-
key: "svg-1"
|
|
35
|
-
}],
|
|
36
|
-
["path", {
|
|
37
|
-
d: "M11 12h1v4h1",
|
|
38
|
-
key: "svg-2"
|
|
39
|
-
}]
|
|
40
|
-
], l = s("outline", "info-circle", "InfoCircle", w), M = {
|
|
28
|
+
}]], I = d("outline", "circle-check", "CircleCheck", C), w = {
|
|
41
29
|
brand: {
|
|
42
30
|
classes: "text-pho-brand",
|
|
43
31
|
description: "Informational / product update (default)"
|
|
@@ -58,23 +46,23 @@ var k = [
|
|
|
58
46
|
classes: "text-pho-error",
|
|
59
47
|
description: "Something went wrong"
|
|
60
48
|
}
|
|
61
|
-
},
|
|
62
|
-
brand:
|
|
63
|
-
gray:
|
|
49
|
+
}, A = {
|
|
50
|
+
brand: n,
|
|
51
|
+
gray: n,
|
|
64
52
|
success: I,
|
|
65
53
|
warning: c,
|
|
66
54
|
error: c
|
|
67
|
-
},
|
|
68
|
-
function
|
|
69
|
-
const
|
|
55
|
+
}, l = "cursor-pointer text-base font-medium outline-pho-brand transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2";
|
|
56
|
+
function _({ color: a = "brand", title: p, description: r, confirmLabel: i, onConfirm: h, dismissLabel: m = "Dismiss", onClose: s, icon: u, className: f, ref: v, ...x }) {
|
|
57
|
+
const g = u ?? A[a], b = !!i;
|
|
70
58
|
return /* @__PURE__ */ o("div", {
|
|
71
|
-
ref:
|
|
72
|
-
...
|
|
73
|
-
className: t("ring-pho-secondary bg-pho-primary shadow-pho-lg rounded-base relative flex w-full max-w-sm gap-4 p-4 ring-1 ring-inset",
|
|
59
|
+
ref: v,
|
|
60
|
+
...x,
|
|
61
|
+
className: t("ring-pho-secondary bg-pho-primary shadow-pho-lg rounded-base relative flex w-full max-w-sm gap-4 p-4 ring-1 ring-inset", f),
|
|
74
62
|
children: [
|
|
75
|
-
/* @__PURE__ */ e(
|
|
63
|
+
/* @__PURE__ */ e(g, {
|
|
76
64
|
"aria-hidden": "true",
|
|
77
|
-
className: t("mt-0.5 size-5 shrink-0",
|
|
65
|
+
className: t("mt-0.5 size-5 shrink-0", y(w, a))
|
|
78
66
|
}),
|
|
79
67
|
/* @__PURE__ */ o("div", {
|
|
80
68
|
className: "flex flex-1 flex-col gap-3 pr-6",
|
|
@@ -87,24 +75,24 @@ function A({ color: i = "brand", title: p, description: r, confirmLabel: n, onCo
|
|
|
87
75
|
className: "text-pho-description text-base",
|
|
88
76
|
children: r
|
|
89
77
|
})]
|
|
90
|
-
}),
|
|
78
|
+
}), b && /* @__PURE__ */ o("div", {
|
|
91
79
|
className: "flex gap-4",
|
|
92
80
|
children: [/* @__PURE__ */ e("button", {
|
|
93
81
|
type: "button",
|
|
94
82
|
onClick: h,
|
|
95
|
-
className: t(
|
|
96
|
-
children:
|
|
83
|
+
className: t(l, "text-pho-brand hover:underline"),
|
|
84
|
+
children: i
|
|
97
85
|
}), /* @__PURE__ */ e("button", {
|
|
98
86
|
type: "button",
|
|
99
|
-
onClick:
|
|
100
|
-
className: t(
|
|
101
|
-
children:
|
|
87
|
+
onClick: s,
|
|
88
|
+
className: t(l, "text-pho-secondary hover:text-pho-secondary-hover"),
|
|
89
|
+
children: m
|
|
102
90
|
})]
|
|
103
91
|
})]
|
|
104
92
|
}),
|
|
105
|
-
|
|
93
|
+
s && /* @__PURE__ */ e("button", {
|
|
106
94
|
type: "button",
|
|
107
|
-
onClick:
|
|
95
|
+
onClick: s,
|
|
108
96
|
"aria-label": "Dismiss",
|
|
109
97
|
className: "text-pho-secondary hover:text-pho-secondary-hover hover:bg-pho-ghost-hover outline-pho-brand absolute top-2.5 right-2.5 flex size-6 cursor-pointer items-center justify-center rounded-sm transition focus-visible:outline-2 [&>svg]:size-4",
|
|
110
98
|
children: /* @__PURE__ */ e(N, { "aria-hidden": "true" })
|
|
@@ -112,10 +100,10 @@ function A({ color: i = "brand", title: p, description: r, confirmLabel: n, onCo
|
|
|
112
100
|
]
|
|
113
101
|
});
|
|
114
102
|
}
|
|
115
|
-
|
|
103
|
+
_.displayName = "Notification";
|
|
116
104
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
105
|
+
w as NOTIFICATION_COLORS,
|
|
106
|
+
_ as Notification
|
|
119
107
|
};
|
|
120
108
|
|
|
121
109
|
//# sourceMappingURL=notification.js.map
|