@photon-ai/pho-ui 4.13.1 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{basic-page-6dDfY33L.js → basic-page-BHK781ky.js} +85 -82
- package/dist/chunks/basic-page-BHK781ky.js.map +1 -0
- package/dist/chunks/filter-bar-yEcG2pBm.js +287 -0
- package/dist/chunks/filter-bar-yEcG2pBm.js.map +1 -0
- package/dist/chunks/select-COFV0NLb.js +109 -0
- package/dist/chunks/select-COFV0NLb.js.map +1 -0
- package/dist/components/command.js +222 -3
- package/dist/components/command.js.map +1 -0
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/scope.js +342 -258
- package/dist/components/scope.js.map +1 -1
- package/dist/components/select.js +2 -106
- package/dist/index.js +2 -2
- package/dist/sections/basic-page.js +1 -1
- package/dist/src/components/filter-bar/filter-bar.d.ts +10 -6
- package/dist/src/components/scope/index.d.ts +1 -1
- package/dist/src/components/scope/scope.d.ts +19 -1
- package/package.json +1 -1
- package/dist/chunks/basic-page-6dDfY33L.js.map +0 -1
- package/dist/chunks/command-kB5bMvM1.js +0 -225
- package/dist/chunks/command-kB5bMvM1.js.map +0 -1
- package/dist/chunks/filter-bar-DuZXXvdm.js +0 -258
- package/dist/chunks/filter-bar-DuZXXvdm.js.map +0 -1
- package/dist/components/select.js.map +0 -1
package/dist/components/scope.js
CHANGED
|
@@ -1,272 +1,310 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import { revealIn as
|
|
4
|
-
import { u as
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { t as d } from "../chunks/cn-ChIgwEl3.js";
|
|
3
|
+
import { revealIn as st } from "../motion.js";
|
|
4
|
+
import { u as at } from "../chunks/button-C9VqBBIr.js";
|
|
5
|
+
import { t as ye } from "../chunks/IconCheck-D2WuculQ.js";
|
|
6
|
+
import { t as it } from "../chunks/IconChevronDown-CZilB71T.js";
|
|
7
|
+
import { t as ct } from "../chunks/close-button-GvqWbLl0.js";
|
|
8
|
+
import { r as ce } from "../chunks/checkbox-CwvoEJhd.js";
|
|
9
|
+
import { t as I } from "../chunks/skeleton-DwjSl4vC.js";
|
|
10
|
+
import { t as dt } from "../chunks/ghost-search-8PzP73zS.js";
|
|
11
|
+
import { t as A } from "../chunks/tooltip-BTF7GChl.js";
|
|
12
|
+
import { t as p } from "../chunks/select-COFV0NLb.js";
|
|
13
|
+
import { useEffect as Ne, useId as ut, useLayoutEffect as pt, useMemo as G, useRef as S, useState as X } from "react";
|
|
14
|
+
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
15
|
+
import { AnimatePresence as H, motion as y, useReducedMotion as ht } from "motion/react";
|
|
16
|
+
import { Field as ft } from "@base-ui/react/field";
|
|
17
|
+
import { Tooltip as mt } from "@base-ui/react/tooltip";
|
|
18
|
+
var vt = "group/scope relative w-full min-w-0 overflow-clip rounded-base border border-pho-secondary bg-pho-primary [--scope-inset:var(--choice-card-inset,0.75rem)]", Se = "px-[var(--scope-inset)]", gt = "flex min-h-11 items-center gap-3 border-b border-pho-secondary px-[var(--scope-inset)]", bt = "text-pho-secondary hover:bg-pho-ghost-hover hover:text-pho-secondary-hover data-[popup-open]:bg-pho-ghost-hover outline-pho-brand shrink-0 gap-1.5 rounded-full py-1.5 pr-2 pl-3 font-medium focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-solid", de = "custom", Ce = "grid grid-cols-1 group-data-[wide]/scope:grid-cols-[fit-content(45%)_minmax(0,1fr)] group-data-[wide]/scope:gap-x-4", Oe = "col-span-full grid grid-cols-subgrid border-t border-pho-secondary first:border-t-0", Ee = "group col-span-full flex min-w-0 cursor-pointer flex-col gap-y-0.5 px-[var(--scope-inset)] py-2 transition-colors select-none hover:bg-pho-primary-hover group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-transparent", wt = "col-span-full flex min-w-0 flex-col gap-y-0.5 px-[var(--scope-inset)] py-2 group-data-[wide]/scope:grid group-data-[wide]/scope:grid-cols-subgrid group-data-[wide]/scope:items-center", ke = "group col-span-full flex h-8 min-w-0 cursor-pointer items-center gap-2 border-b border-pho-secondary bg-pho-page px-[var(--scope-inset)] text-xs font-medium text-pho-secondary select-none data-[disabled]:cursor-not-allowed", Ie = "line-clamp-2 min-w-0 pl-6 text-xs text-pho-description group-data-[wide]/scope:block group-data-[wide]/scope:truncate group-data-[wide]/scope:pl-0", Re = "flex w-full min-w-0 items-center gap-3 py-2.5 pr-2 pl-[var(--scope-inset)] text-left outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-2", xt = 34, yt = 18;
|
|
19
|
+
function Nt(r) {
|
|
20
|
+
const [s, m] = X({
|
|
17
21
|
wide: !0,
|
|
18
22
|
roomy: !0
|
|
23
|
+
}), i = S({
|
|
24
|
+
face: 0,
|
|
25
|
+
list: 0,
|
|
26
|
+
bones: 0
|
|
19
27
|
});
|
|
20
|
-
return
|
|
28
|
+
return pt(() => {
|
|
21
29
|
const o = r.current;
|
|
22
30
|
if (o == null) return;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
const c = () => {
|
|
32
|
+
i.current.face = o.clientHeight;
|
|
33
|
+
const C = o.querySelector("[data-scope-list]");
|
|
34
|
+
C != null && (i.current.list = C.offsetHeight);
|
|
35
|
+
const z = o.querySelector("[data-scope-bones]");
|
|
36
|
+
z != null && (i.current.bones = z.offsetHeight);
|
|
37
|
+
const L = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16, W = o.getBoundingClientRect().width, u = {
|
|
38
|
+
wide: W >= xt * L,
|
|
39
|
+
roomy: W >= yt * L
|
|
27
40
|
};
|
|
28
|
-
|
|
41
|
+
m((g) => g.wide === u.wide && g.roomy === u.roomy ? g : u);
|
|
29
42
|
};
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
return
|
|
33
|
-
}, [r]),
|
|
43
|
+
c();
|
|
44
|
+
const _ = new ResizeObserver(c);
|
|
45
|
+
return _.observe(o), () => _.disconnect();
|
|
46
|
+
}, [r]), {
|
|
47
|
+
...s,
|
|
48
|
+
heights: i
|
|
49
|
+
};
|
|
34
50
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
for (const
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
label:
|
|
51
|
+
function St(r) {
|
|
52
|
+
const s = [], m = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const i of r) {
|
|
54
|
+
const o = i.group ?? null;
|
|
55
|
+
let c = m.get(o);
|
|
56
|
+
c || (c = {
|
|
57
|
+
label: o,
|
|
42
58
|
items: []
|
|
43
|
-
},
|
|
59
|
+
}, m.set(o, c), s.push(c)), c.items.push(i);
|
|
44
60
|
}
|
|
45
|
-
return [...
|
|
61
|
+
return [...s.filter((i) => i.label === null), ...s.filter((i) => i.label !== null)];
|
|
46
62
|
}
|
|
47
|
-
function
|
|
63
|
+
function ze(r) {
|
|
48
64
|
return r.toLowerCase().replace(/[.:\-_/]/g, " ");
|
|
49
65
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
66
|
+
function Ct(r) {
|
|
67
|
+
return ze(r).split(/\s+/).filter(Boolean);
|
|
52
68
|
}
|
|
53
|
-
function
|
|
54
|
-
const
|
|
55
|
-
return r.every((
|
|
69
|
+
function Pe(r, ...s) {
|
|
70
|
+
const m = ze(s.filter(Boolean).join(" "));
|
|
71
|
+
return r.every((i) => m.includes(i));
|
|
56
72
|
}
|
|
57
|
-
function
|
|
73
|
+
function $e(r) {
|
|
58
74
|
return r.label ?? r.value;
|
|
59
75
|
}
|
|
60
|
-
function
|
|
61
|
-
if (r.length !==
|
|
62
|
-
const
|
|
63
|
-
return
|
|
76
|
+
function _e(r, s) {
|
|
77
|
+
if (r.length !== s.length) return !1;
|
|
78
|
+
const m = new Set(r);
|
|
79
|
+
return s.every((i) => m.has(i));
|
|
80
|
+
}
|
|
81
|
+
function J(r, s) {
|
|
82
|
+
return {
|
|
83
|
+
...r,
|
|
84
|
+
initial: {
|
|
85
|
+
...r.initial,
|
|
86
|
+
height: s
|
|
87
|
+
},
|
|
88
|
+
exit: { opacity: 0 }
|
|
89
|
+
};
|
|
64
90
|
}
|
|
65
|
-
function
|
|
91
|
+
function Ot(r) {
|
|
66
92
|
if (!(r instanceof Element)) return !1;
|
|
67
|
-
const
|
|
68
|
-
return
|
|
93
|
+
const s = r.closest("[data-scope-description]");
|
|
94
|
+
return s == null ? !1 : s.scrollWidth > s.clientWidth + 1 || s.scrollHeight > s.clientHeight + 1;
|
|
69
95
|
}
|
|
70
|
-
function
|
|
71
|
-
const [
|
|
72
|
-
for (const e of O) e !==
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
const
|
|
77
|
-
for (const
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
function Et({ items: r, value: s, defaultValue: m, onValueChange: i, all: o, presets: c, placeholder: _ = "Search", collapsible: C = !1, open: z, defaultOpen: L = !1, onOpenChange: W, loading: u = !1, disabled: g = !1, className: Te, ref: B, ...Me }) {
|
|
97
|
+
const [De, Ae] = X(m ?? []), O = s ?? De, [Ge, He] = X(L), E = C ? z ?? Ge : !0, [F, T] = X(""), Le = ht(), ue = S(null), { wide: We, roomy: Be, heights: V } = Nt(ue), v = ut(), pe = `${v}-list`, he = S(null), fe = S(null), q = S(null), me = G(() => mt.createHandle(), []), U = G(() => St(r), [r]), j = G(() => new Set(r.map((e) => e.value)), [r]), Fe = G(() => new Map(r.map((e, t) => [e.value, t])), [r]), Ve = G(() => new Map(U.map((e, t) => [e.label, t])), [U]), Z = S([]);
|
|
98
|
+
for (const e of O) e !== o?.value && !j.has(e) && !Z.current.includes(e) && Z.current.push(e);
|
|
99
|
+
const k = Z.current.filter((e) => !j.has(e)), f = o?.value, M = new Set(O), N = f !== void 0 && M.has(f), K = (e) => N ? j.has(e) : M.has(e), R = r.filter((e) => K(e.value)).length, ee = k.filter((e) => M.has(e)).length, Y = (e) => {
|
|
100
|
+
s === void 0 && Ae(e), i?.(e);
|
|
101
|
+
}, te = (e) => Y([...r.filter((t) => e.has(t.value)).map((t) => t.value), ...k.filter((t) => e.has(t))]), qe = () => N ? new Set(r.map((e) => e.value)) : new Set(O.filter((e) => e !== f)), ne = (e, t) => {
|
|
102
|
+
const a = qe();
|
|
103
|
+
for (const h of e) t ? a.add(h) : a.delete(h);
|
|
104
|
+
te(a);
|
|
105
|
+
}, Ue = (e) => {
|
|
106
|
+
f === void 0 ? ne(r.map((t) => t.value), e) : e ? Y([f]) : te(new Set(r.map((t) => t.value)));
|
|
107
|
+
}, re = (e) => e.filter((t) => t === f || j.has(t)), P = u || r.length === 0 ? void 0 : c?.find((e) => {
|
|
108
|
+
const t = re(e.value);
|
|
109
|
+
return t.length > 0 && _e(t, re(O));
|
|
110
|
+
}), je = (e) => {
|
|
111
|
+
const t = re(e.value);
|
|
112
|
+
f !== void 0 && t.includes(f) ? Y([f]) : te(/* @__PURE__ */ new Set([...t, ...k.filter((a) => M.has(a))]));
|
|
113
|
+
}, ve = (e) => {
|
|
114
|
+
z === void 0 && He(e), W?.(e);
|
|
115
|
+
}, Ke = () => {
|
|
116
|
+
q.current = "search", ve(!0);
|
|
117
|
+
}, Ye = () => {
|
|
118
|
+
q.current = "summary", T(""), ve(!1);
|
|
119
|
+
}, oe = S(O);
|
|
120
|
+
oe.current = O;
|
|
121
|
+
const ge = S(E ? O : null);
|
|
122
|
+
Ne(() => {
|
|
123
|
+
ge.current = E ? oe.current : null, E || T("");
|
|
124
|
+
}, [E]);
|
|
125
|
+
const be = () => {
|
|
126
|
+
const e = ge.current;
|
|
127
|
+
e != null && !_e(e, oe.current) && Y([...e]), Ye();
|
|
96
128
|
};
|
|
97
|
-
|
|
98
|
-
const e =
|
|
129
|
+
Ne(() => {
|
|
130
|
+
const e = q.current;
|
|
99
131
|
if (e == null) return;
|
|
100
|
-
|
|
101
|
-
let
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
132
|
+
q.current = null;
|
|
133
|
+
let t = 0, a = 0;
|
|
134
|
+
const h = () => {
|
|
135
|
+
const w = e === "search" ? he.current : fe.current;
|
|
136
|
+
w != null && (w.focus({ preventScroll: !0 }), document.activeElement !== w && a++ < 5 && (t = requestAnimationFrame(h)));
|
|
105
137
|
};
|
|
106
|
-
return
|
|
107
|
-
}, [
|
|
108
|
-
const
|
|
109
|
-
e.key === "Enter" && e.preventDefault(), e.key === "Escape" && (
|
|
110
|
-
},
|
|
138
|
+
return t = requestAnimationFrame(h), () => cancelAnimationFrame(t);
|
|
139
|
+
}, [E]);
|
|
140
|
+
const Qe = (e) => {
|
|
141
|
+
e.key === "Enter" && e.preventDefault(), e.key === "Escape" && (F !== "" ? (e.preventDefault(), T("")) : C && !g && (e.preventDefault(), be()));
|
|
142
|
+
}, le = Ct(F), Q = le.length > 0, we = U.map((e) => ({
|
|
111
143
|
...e,
|
|
112
|
-
items:
|
|
113
|
-
})).filter((e) => e.items.length > 0),
|
|
114
|
-
if (
|
|
115
|
-
title:
|
|
116
|
-
detail:
|
|
144
|
+
items: Q ? e.items.filter((t) => Pe(le, e.label, t.value, t.label, t.description)) : e.items
|
|
145
|
+
})).filter((e) => e.items.length > 0), se = Q ? k.filter((e) => Pe(le, e)) : k, D = N || r.length === 0 ? null : `${R} of ${r.length}`, ae = (() => {
|
|
146
|
+
if (N && o) return {
|
|
147
|
+
title: o.label,
|
|
148
|
+
detail: o.description ?? ""
|
|
117
149
|
};
|
|
118
|
-
if (
|
|
119
|
-
title:
|
|
120
|
-
detail:
|
|
150
|
+
if (P && ee === 0) return {
|
|
151
|
+
title: P.label,
|
|
152
|
+
detail: P.description ?? D ?? ""
|
|
153
|
+
};
|
|
154
|
+
if (o && f === void 0 && r.length > 0 && R === r.length && ee === 0) return {
|
|
155
|
+
title: o.label,
|
|
156
|
+
detail: o.description ?? D ?? ""
|
|
121
157
|
};
|
|
122
158
|
const e = [];
|
|
123
|
-
for (const
|
|
124
|
-
const
|
|
125
|
-
|
|
159
|
+
for (const t of U) {
|
|
160
|
+
const a = t.items.filter((h) => K(h.value));
|
|
161
|
+
t.label !== null && t.items.length > 1 && a.length === t.items.length ? e.push(t.label) : e.push(...a.map($e));
|
|
126
162
|
}
|
|
127
|
-
return e.push(...
|
|
163
|
+
return e.push(...k.filter((t) => M.has(t))), {
|
|
128
164
|
title: e.length > 0 ? e.join(", ") : "None",
|
|
129
|
-
detail:
|
|
165
|
+
detail: D ?? ""
|
|
130
166
|
};
|
|
131
|
-
})(),
|
|
132
|
-
const
|
|
133
|
-
return /* @__PURE__ */ l(
|
|
134
|
-
...
|
|
135
|
-
className:
|
|
167
|
+
})(), $ = g || u, b = st(Le), ie = (e, t = !1) => {
|
|
168
|
+
const a = t ? `${v}-r${k.indexOf(e.value)}` : `${v}-i${Fe.get(e.value)}`, h = `${a}-name`, w = `${a}-description`;
|
|
169
|
+
return /* @__PURE__ */ l(y.label, {
|
|
170
|
+
...b,
|
|
171
|
+
className: d(Ee, "overflow-hidden"),
|
|
136
172
|
"data-scope-row": "",
|
|
137
|
-
"data-disabled":
|
|
173
|
+
"data-disabled": $ || void 0,
|
|
138
174
|
children: [/* @__PURE__ */ l("span", {
|
|
139
175
|
className: "flex min-w-0 items-center gap-2",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ n(ce, {
|
|
141
177
|
size: "sm",
|
|
142
|
-
checked:
|
|
143
|
-
disabled:
|
|
144
|
-
"aria-labelledby":
|
|
145
|
-
"aria-describedby": e.description ?
|
|
146
|
-
onCheckedChange: (
|
|
147
|
-
}), /* @__PURE__ */
|
|
148
|
-
id:
|
|
149
|
-
className:
|
|
150
|
-
children:
|
|
178
|
+
checked: K(e.value),
|
|
179
|
+
disabled: $,
|
|
180
|
+
"aria-labelledby": h,
|
|
181
|
+
"aria-describedby": e.description ? w : void 0,
|
|
182
|
+
onCheckedChange: (x) => ne([e.value], x)
|
|
183
|
+
}), /* @__PURE__ */ n("span", {
|
|
184
|
+
id: h,
|
|
185
|
+
className: d("truncate text-base", t ? "text-pho-description" : "text-pho-secondary"),
|
|
186
|
+
children: $e(e)
|
|
151
187
|
})]
|
|
152
|
-
}), e.description ? /* @__PURE__ */
|
|
153
|
-
handle:
|
|
188
|
+
}), e.description ? /* @__PURE__ */ n(A.Trigger, {
|
|
189
|
+
handle: me,
|
|
154
190
|
payload: e.description,
|
|
155
|
-
render: /* @__PURE__ */
|
|
156
|
-
id:
|
|
191
|
+
render: /* @__PURE__ */ n("span", {
|
|
192
|
+
id: w,
|
|
157
193
|
"data-scope-description": "",
|
|
158
|
-
className:
|
|
194
|
+
className: Ie
|
|
159
195
|
}),
|
|
160
196
|
children: e.description
|
|
161
197
|
}) : null]
|
|
162
198
|
}, e.value);
|
|
163
|
-
},
|
|
164
|
-
if (e.label === null) return e.items.map((
|
|
165
|
-
const
|
|
166
|
-
return /* @__PURE__ */ l(
|
|
167
|
-
...
|
|
199
|
+
}, Je = (e) => {
|
|
200
|
+
if (e.label === null) return e.items.map((x) => ie(x));
|
|
201
|
+
const t = `${v}-g${Ve.get(e.label)}`, a = e.items.map((x) => x.value), h = a.filter(K).length, w = h === a.length;
|
|
202
|
+
return /* @__PURE__ */ l(y.div, {
|
|
203
|
+
...b,
|
|
168
204
|
role: "group",
|
|
169
|
-
"aria-labelledby":
|
|
170
|
-
className:
|
|
205
|
+
"aria-labelledby": t,
|
|
206
|
+
className: d(Oe, "overflow-hidden"),
|
|
171
207
|
children: [/* @__PURE__ */ l("label", {
|
|
172
|
-
className:
|
|
173
|
-
"data-disabled":
|
|
208
|
+
className: ke,
|
|
209
|
+
"data-disabled": $ || void 0,
|
|
174
210
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ n(ce, {
|
|
176
212
|
size: "sm",
|
|
177
|
-
checked:
|
|
178
|
-
indeterminate:
|
|
179
|
-
disabled:
|
|
180
|
-
"aria-labelledby":
|
|
181
|
-
onCheckedChange: (
|
|
213
|
+
checked: w,
|
|
214
|
+
indeterminate: h > 0 && !w,
|
|
215
|
+
disabled: $,
|
|
216
|
+
"aria-labelledby": t,
|
|
217
|
+
onCheckedChange: (x) => ne(a, x)
|
|
182
218
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
id:
|
|
219
|
+
/* @__PURE__ */ n("span", {
|
|
220
|
+
id: t,
|
|
185
221
|
className: "truncate",
|
|
186
222
|
children: e.label
|
|
187
223
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ n("span", {
|
|
189
225
|
className: "text-pho-description tabular-nums",
|
|
190
|
-
children:
|
|
226
|
+
children: a.length
|
|
191
227
|
})
|
|
192
228
|
]
|
|
193
|
-
}), /* @__PURE__ */
|
|
229
|
+
}), /* @__PURE__ */ n(H, {
|
|
194
230
|
initial: !1,
|
|
195
|
-
children: e.items.map((
|
|
231
|
+
children: e.items.map((x) => ie(x))
|
|
196
232
|
})]
|
|
197
233
|
}, `group:${e.label}`);
|
|
198
|
-
},
|
|
199
|
-
...
|
|
234
|
+
}, Xe = se.length > 0 ? /* @__PURE__ */ l(y.div, {
|
|
235
|
+
...b,
|
|
200
236
|
role: "group",
|
|
201
|
-
"aria-labelledby": `${
|
|
202
|
-
className:
|
|
237
|
+
"aria-labelledby": `${v}-retired`,
|
|
238
|
+
className: d(Oe, "overflow-hidden"),
|
|
203
239
|
children: [/* @__PURE__ */ l("div", {
|
|
204
|
-
className:
|
|
205
|
-
children: [/* @__PURE__ */
|
|
240
|
+
className: d(ke, "cursor-default"),
|
|
241
|
+
children: [/* @__PURE__ */ n("span", {
|
|
206
242
|
"aria-hidden": !0,
|
|
207
243
|
className: "size-4 shrink-0"
|
|
208
|
-
}), /* @__PURE__ */
|
|
209
|
-
id: `${
|
|
244
|
+
}), /* @__PURE__ */ n("span", {
|
|
245
|
+
id: `${v}-retired`,
|
|
210
246
|
className: "truncate",
|
|
211
247
|
children: "No longer offered"
|
|
212
248
|
})]
|
|
213
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ n(H, {
|
|
214
250
|
initial: !1,
|
|
215
|
-
children:
|
|
251
|
+
children: se.map((e) => ie({ value: e }, !0))
|
|
216
252
|
})]
|
|
217
|
-
}, "retired") : null,
|
|
218
|
-
...
|
|
219
|
-
className:
|
|
253
|
+
}, "retired") : null, Ze = o ? /* @__PURE__ */ l(y.label, {
|
|
254
|
+
...b,
|
|
255
|
+
className: d(Ee, "overflow-hidden"),
|
|
220
256
|
"data-scope-row": "",
|
|
221
|
-
"data-disabled":
|
|
257
|
+
"data-disabled": $ || N && r.length === 0 || void 0,
|
|
222
258
|
children: [/* @__PURE__ */ l("span", {
|
|
223
259
|
className: "flex min-w-0 items-center gap-2",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ n(ce, {
|
|
225
261
|
size: "sm",
|
|
226
|
-
checked:
|
|
227
|
-
indeterminate:
|
|
228
|
-
disabled:
|
|
229
|
-
"aria-labelledby": `${
|
|
230
|
-
"aria-describedby":
|
|
231
|
-
onCheckedChange: (e) =>
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
-
id: `${
|
|
262
|
+
checked: f === void 0 ? r.length > 0 && R === r.length : N,
|
|
263
|
+
indeterminate: f === void 0 ? R > 0 && R < r.length : !N && R + ee > 0,
|
|
264
|
+
disabled: $ || N && r.length === 0,
|
|
265
|
+
"aria-labelledby": `${v}-all`,
|
|
266
|
+
"aria-describedby": o.description ? `${v}-all-description` : void 0,
|
|
267
|
+
onCheckedChange: (e) => Ue(e)
|
|
268
|
+
}), /* @__PURE__ */ n("span", {
|
|
269
|
+
id: `${v}-all`,
|
|
234
270
|
className: "text-pho-primary truncate text-base font-medium",
|
|
235
|
-
children:
|
|
271
|
+
children: o.label
|
|
236
272
|
})]
|
|
237
|
-
}),
|
|
238
|
-
id: `${
|
|
239
|
-
className:
|
|
240
|
-
children:
|
|
273
|
+
}), o.description ? /* @__PURE__ */ n("span", {
|
|
274
|
+
id: `${v}-all-description`,
|
|
275
|
+
className: Ie,
|
|
276
|
+
children: o.description
|
|
241
277
|
}) : null]
|
|
242
|
-
}, "all") : null,
|
|
243
|
-
...
|
|
244
|
-
className:
|
|
278
|
+
}, "all") : null, et = Q && we.length === 0 && se.length === 0 ? /* @__PURE__ */ n(y.p, {
|
|
279
|
+
...b,
|
|
280
|
+
className: d("text-pho-description col-span-full overflow-hidden text-center text-base", Se),
|
|
245
281
|
children: /* @__PURE__ */ l("span", {
|
|
246
282
|
className: "block py-6",
|
|
247
283
|
children: [
|
|
248
284
|
"Nothing matches “",
|
|
249
|
-
|
|
285
|
+
F,
|
|
250
286
|
"”."
|
|
251
287
|
]
|
|
252
288
|
})
|
|
253
|
-
}, "nothing") : null,
|
|
254
|
-
...
|
|
255
|
-
id:
|
|
256
|
-
|
|
257
|
-
|
|
289
|
+
}, "nothing") : null, tt = /* @__PURE__ */ n(y.div, {
|
|
290
|
+
...J(b, V.current.bones),
|
|
291
|
+
id: pe,
|
|
292
|
+
"data-scope-list": "",
|
|
293
|
+
className: d(Ce, "overflow-hidden"),
|
|
294
|
+
children: /* @__PURE__ */ l(H, {
|
|
258
295
|
initial: !1,
|
|
259
296
|
children: [
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
297
|
+
Q ? null : Ze,
|
|
298
|
+
we.map(Je),
|
|
299
|
+
Xe,
|
|
300
|
+
et
|
|
264
301
|
]
|
|
265
302
|
})
|
|
266
|
-
}, "list"),
|
|
267
|
-
...
|
|
303
|
+
}, "list"), nt = /* @__PURE__ */ n(y.div, {
|
|
304
|
+
...J(b, V.current.list),
|
|
305
|
+
"data-scope-bones": "",
|
|
268
306
|
"aria-hidden": !0,
|
|
269
|
-
className:
|
|
307
|
+
className: d(Ce, "overflow-hidden"),
|
|
270
308
|
children: [
|
|
271
309
|
{
|
|
272
310
|
band: !1,
|
|
@@ -293,84 +331,129 @@ function fn({ items: r, value: a, defaultValue: p, onValueChange: o, all: s, pla
|
|
|
293
331
|
name: "w-24",
|
|
294
332
|
text: "w-60"
|
|
295
333
|
}
|
|
296
|
-
].map((e,
|
|
297
|
-
className:
|
|
298
|
-
children: [/* @__PURE__ */
|
|
299
|
-
},
|
|
300
|
-
className:
|
|
334
|
+
].map((e, t) => e.band ? /* @__PURE__ */ l("div", {
|
|
335
|
+
className: d("border-pho-secondary bg-pho-page col-span-full flex h-8 items-center gap-2 border-y", Se),
|
|
336
|
+
children: [/* @__PURE__ */ n(I, { className: "size-4 rounded-sm" }), /* @__PURE__ */ n(I, { className: d("h-3", e.name) })]
|
|
337
|
+
}, t) : /* @__PURE__ */ l("div", {
|
|
338
|
+
className: wt,
|
|
301
339
|
children: [/* @__PURE__ */ l("span", {
|
|
302
340
|
className: "flex h-5 min-w-0 items-center gap-2",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
304
|
-
}), /* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ n(I, { className: "size-4 shrink-0 rounded-sm" }), /* @__PURE__ */ n(I, { className: d("h-3.5 max-w-full", e.name) })]
|
|
342
|
+
}), /* @__PURE__ */ n("span", {
|
|
305
343
|
className: "flex h-4.5 items-center pl-6 group-data-[wide]/scope:pl-0",
|
|
306
|
-
children: /* @__PURE__ */
|
|
344
|
+
children: /* @__PURE__ */ n(I, { className: d("h-3 max-w-full", e.text) })
|
|
307
345
|
})]
|
|
308
|
-
},
|
|
309
|
-
}, "bones"),
|
|
310
|
-
|
|
346
|
+
}, t))
|
|
347
|
+
}, "bones"), rt = c != null && c.length > 0 ? /* @__PURE__ */ n(ft.Root, {
|
|
348
|
+
className: "contents",
|
|
349
|
+
children: /* @__PURE__ */ l(p.Root, {
|
|
350
|
+
items: [...c.map((e, t) => ({
|
|
351
|
+
value: `preset:${t}`,
|
|
352
|
+
label: e.label
|
|
353
|
+
})), {
|
|
354
|
+
value: de,
|
|
355
|
+
label: "Custom"
|
|
356
|
+
}],
|
|
357
|
+
value: P ? `preset:${c.indexOf(P)}` : de,
|
|
358
|
+
onValueChange: (e) => {
|
|
359
|
+
const t = c[Number(String(e).slice(7))];
|
|
360
|
+
t != null && t !== P && je(t);
|
|
361
|
+
},
|
|
362
|
+
disabled: g || u,
|
|
363
|
+
children: [/* @__PURE__ */ l(p.Trigger, {
|
|
364
|
+
variant: "inline",
|
|
365
|
+
"aria-label": "Preset",
|
|
366
|
+
className: d(bt, C ? "-mr-1" : "-mr-2"),
|
|
367
|
+
children: [/* @__PURE__ */ n(p.Value, {}), /* @__PURE__ */ n(p.Icon, { children: /* @__PURE__ */ n(it, {}) })]
|
|
368
|
+
}), /* @__PURE__ */ n(p.Portal, { children: /* @__PURE__ */ n(p.Positioner, {
|
|
369
|
+
align: "end",
|
|
370
|
+
children: /* @__PURE__ */ n(p.Popup, { children: /* @__PURE__ */ l(p.List, { children: [c.map((e, t) => /* @__PURE__ */ l(p.Item, {
|
|
371
|
+
value: `preset:${t}`,
|
|
372
|
+
children: [
|
|
373
|
+
/* @__PURE__ */ n(p.ItemIndicator, { children: /* @__PURE__ */ n(ye, {}) }),
|
|
374
|
+
/* @__PURE__ */ n(p.ItemText, { children: e.label }),
|
|
375
|
+
e.description ? /* @__PURE__ */ n("span", {
|
|
376
|
+
className: "text-pho-description col-start-2 text-xs",
|
|
377
|
+
children: e.description
|
|
378
|
+
}) : null
|
|
379
|
+
]
|
|
380
|
+
}, t)), /* @__PURE__ */ l(p.Item, {
|
|
381
|
+
value: de,
|
|
382
|
+
disabled: !0,
|
|
383
|
+
children: [/* @__PURE__ */ n(p.ItemIndicator, { children: /* @__PURE__ */ n(ye, {}) }), /* @__PURE__ */ n(p.ItemText, { children: "Custom" })]
|
|
384
|
+
})] }) })
|
|
385
|
+
}) })]
|
|
386
|
+
})
|
|
387
|
+
}) : null, ot = /* @__PURE__ */ l(y.div, {
|
|
388
|
+
...J(b, V.current.face),
|
|
311
389
|
className: "overflow-hidden",
|
|
312
390
|
children: [/* @__PURE__ */ l("div", {
|
|
313
|
-
className:
|
|
314
|
-
children: [
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
391
|
+
className: gt,
|
|
392
|
+
children: [
|
|
393
|
+
/* @__PURE__ */ n(dt, {
|
|
394
|
+
ref: he,
|
|
395
|
+
value: F,
|
|
396
|
+
onChange: T,
|
|
397
|
+
onClear: () => T(""),
|
|
398
|
+
onKeyDown: Qe,
|
|
399
|
+
placeholder: _,
|
|
400
|
+
"aria-label": _,
|
|
401
|
+
"aria-controls": u ? void 0 : pe,
|
|
402
|
+
disabled: u,
|
|
403
|
+
trailing: D != null && !u ? /* @__PURE__ */ n("span", {
|
|
404
|
+
className: "hidden group-data-[roomy]/scope:inline",
|
|
405
|
+
children: D
|
|
406
|
+
}) : void 0,
|
|
407
|
+
autoComplete: "off",
|
|
408
|
+
spellCheck: !1
|
|
409
|
+
}),
|
|
410
|
+
rt,
|
|
411
|
+
C ? /* @__PURE__ */ n(ct, {
|
|
412
|
+
size: "sm",
|
|
413
|
+
label: "Cancel",
|
|
414
|
+
disabled: g,
|
|
415
|
+
onClick: be,
|
|
416
|
+
className: "-mr-2 shrink-0 focus-visible:-outline-offset-2"
|
|
417
|
+
}) : null
|
|
418
|
+
]
|
|
419
|
+
}), /* @__PURE__ */ n(H, {
|
|
338
420
|
initial: !1,
|
|
339
|
-
|
|
421
|
+
mode: "popLayout",
|
|
422
|
+
children: u ? nt : tt
|
|
340
423
|
})]
|
|
341
|
-
}, "picker"),
|
|
424
|
+
}, "picker"), xe = u ? /* @__PURE__ */ l("span", {
|
|
342
425
|
className: "flex min-w-0 flex-1 flex-col",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
426
|
+
children: [/* @__PURE__ */ n("span", {
|
|
344
427
|
className: "flex h-5 items-center",
|
|
345
|
-
children: /* @__PURE__ */
|
|
346
|
-
}), /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ n(I, { className: "h-3.5 w-48 max-w-full" })
|
|
429
|
+
}), /* @__PURE__ */ n("span", {
|
|
347
430
|
className: "flex h-4.5 items-center",
|
|
348
|
-
children: /* @__PURE__ */
|
|
431
|
+
children: /* @__PURE__ */ n(I, { className: "h-3 w-16" })
|
|
349
432
|
})]
|
|
350
433
|
}) : /* @__PURE__ */ l("span", {
|
|
351
434
|
className: "flex min-w-0 flex-1 flex-col",
|
|
352
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ n("span", {
|
|
353
436
|
className: "text-pho-primary truncate text-base",
|
|
354
|
-
children:
|
|
355
|
-
}),
|
|
437
|
+
children: ae.title
|
|
438
|
+
}), ae.detail ? /* @__PURE__ */ n("span", {
|
|
356
439
|
className: "text-pho-description truncate text-xs tabular-nums",
|
|
357
|
-
children:
|
|
440
|
+
children: ae.detail
|
|
358
441
|
}) : null]
|
|
359
|
-
}),
|
|
360
|
-
...
|
|
442
|
+
}), lt = /* @__PURE__ */ n(y.div, {
|
|
443
|
+
...J(b, V.current.face),
|
|
361
444
|
className: "overflow-hidden",
|
|
362
|
-
children:
|
|
363
|
-
className:
|
|
364
|
-
children:
|
|
445
|
+
children: g || u ? /* @__PURE__ */ n("div", {
|
|
446
|
+
className: Re,
|
|
447
|
+
children: xe
|
|
365
448
|
}) : /* @__PURE__ */ l("button", {
|
|
366
|
-
ref:
|
|
449
|
+
ref: fe,
|
|
367
450
|
type: "button",
|
|
368
451
|
"aria-expanded": !1,
|
|
369
|
-
className:
|
|
370
|
-
onClick:
|
|
371
|
-
children: [
|
|
452
|
+
className: d(Re, "group hover:bg-pho-primary-hover cursor-pointer transition-colors"),
|
|
453
|
+
onClick: Ke,
|
|
454
|
+
children: [xe, /* @__PURE__ */ n("span", {
|
|
372
455
|
"aria-hidden": !0,
|
|
373
|
-
className:
|
|
456
|
+
className: at({
|
|
374
457
|
variant: "ghost",
|
|
375
458
|
size: "sm",
|
|
376
459
|
className: "group-hover:bg-pho-ghost-hover group-hover:text-pho-secondary-hover pointer-events-none shrink-0"
|
|
@@ -381,28 +464,29 @@ function fn({ items: r, value: a, defaultValue: p, onValueChange: o, all: s, pla
|
|
|
381
464
|
}, "folded");
|
|
382
465
|
return /* @__PURE__ */ l("div", {
|
|
383
466
|
role: "group",
|
|
384
|
-
"aria-busy":
|
|
467
|
+
"aria-busy": u || void 0,
|
|
385
468
|
"data-scope": "",
|
|
386
|
-
"data-open":
|
|
387
|
-
"data-wide":
|
|
388
|
-
"data-roomy":
|
|
389
|
-
className:
|
|
390
|
-
...
|
|
469
|
+
"data-open": E ? "" : void 0,
|
|
470
|
+
"data-wide": We ? "" : void 0,
|
|
471
|
+
"data-roomy": Be ? "" : void 0,
|
|
472
|
+
className: d(vt, Te),
|
|
473
|
+
...Me,
|
|
391
474
|
ref: (e) => {
|
|
392
|
-
|
|
475
|
+
ue.current = e, typeof B == "function" ? B(e) : B != null && (B.current = e);
|
|
393
476
|
},
|
|
394
|
-
children: [/* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ n(H, {
|
|
395
478
|
initial: !1,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
479
|
+
mode: "popLayout",
|
|
480
|
+
children: E ? ot : lt
|
|
481
|
+
}), /* @__PURE__ */ n(A.Root, {
|
|
482
|
+
handle: me,
|
|
483
|
+
onOpenChange: (e, t) => {
|
|
484
|
+
e && !Ot(t.event?.target) && t.cancel();
|
|
401
485
|
},
|
|
402
|
-
children: ({ payload: e }) => /* @__PURE__ */
|
|
486
|
+
children: ({ payload: e }) => /* @__PURE__ */ n(A.Portal, { children: /* @__PURE__ */ n(A.Positioner, {
|
|
403
487
|
side: "top",
|
|
404
488
|
align: "start",
|
|
405
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ n(A.Popup, {
|
|
406
490
|
className: "max-w-80 font-normal",
|
|
407
491
|
children: e
|
|
408
492
|
})
|
|
@@ -410,9 +494,9 @@ function fn({ items: r, value: a, defaultValue: p, onValueChange: o, all: s, pla
|
|
|
410
494
|
})]
|
|
411
495
|
});
|
|
412
496
|
}
|
|
413
|
-
|
|
497
|
+
Et.displayName = "Scope";
|
|
414
498
|
export {
|
|
415
|
-
|
|
499
|
+
Et as Scope
|
|
416
500
|
};
|
|
417
501
|
|
|
418
502
|
//# sourceMappingURL=scope.js.map
|