@clasing/ui 0.1.126 → 0.1.128
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/{badge-BnerQ2lF.js → badge-1kvIHznc.js} +1 -1
- package/dist/{badge-Czof3oqL.cjs → badge-P7DTJePf.cjs} +1 -1
- package/dist/{button-DddHyyHa.js → button-BMeBsgLZ.js} +156 -150
- package/dist/{button-Cegl49Yi.cjs → button-Chd1eL4R.cjs} +1 -1
- package/dist/{calendar-DL8gqdRp.cjs → calendar-B1iUTT_d.cjs} +1 -1
- package/dist/{calendar-BAQkzm4v.js → calendar-Bc6nud5f.js} +1 -1
- package/dist/{chip-A32aAc-8.cjs → chip-BtBgM97Y.cjs} +1 -1
- package/dist/{chip-ZZHZ8i1Q.js → chip-DOFVLzAe.js} +1 -1
- package/dist/command-BVqQYgq1.cjs +1 -0
- package/dist/command-DS_uqbdy.js +176 -0
- package/dist/components/accordion.cjs.js +1 -1
- package/dist/components/accordion.es.js +1 -1
- package/dist/components/alert-dialog.cjs.js +1 -1
- package/dist/components/alert-dialog.es.js +1 -1
- package/dist/components/alert.cjs.js +1 -1
- package/dist/components/alert.es.js +1 -1
- package/dist/components/badge.cjs.js +1 -1
- package/dist/components/badge.es.js +1 -1
- package/dist/components/blocks/date-picker.cjs.js +1 -1
- package/dist/components/blocks/date-picker.es.js +2 -2
- package/dist/components/blocks/date-range-picker.cjs.js +1 -1
- package/dist/components/blocks/date-range-picker.es.js +1 -1
- package/dist/components/blocks/interactive-card.cjs.js +1 -1
- package/dist/components/blocks/interactive-card.es.js +2 -2
- package/dist/components/blocks/selectable-chips.cjs.js +1 -1
- package/dist/components/blocks/selectable-chips.es.js +1 -1
- package/dist/components/breadcrumb.cjs.js +1 -1
- package/dist/components/breadcrumb.es.js +1 -1
- package/dist/components/button.cjs.js +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.es.js +1 -1
- package/dist/components/calendar.cjs.js +1 -1
- package/dist/components/calendar.es.js +1 -1
- package/dist/components/checkbox.cjs.js +1 -1
- package/dist/components/checkbox.es.js +1 -1
- package/dist/components/chip.cjs.js +1 -1
- package/dist/components/chip.d.ts +1 -1
- package/dist/components/chip.es.js +1 -1
- package/dist/components/command.cjs.js +1 -1
- package/dist/components/command.es.js +1 -1
- package/dist/components/context-menu.cjs.js +1 -1
- package/dist/components/context-menu.es.js +1 -1
- package/dist/components/dialog.cjs.js +1 -1
- package/dist/components/dialog.es.js +1 -1
- package/dist/components/drawer.cjs.js +1 -3
- package/dist/components/drawer.es.js +58 -1091
- package/dist/components/dropdown-menu.cjs.js +1 -1
- package/dist/components/dropdown-menu.es.js +1 -1
- package/dist/components/icon-component.cjs.js +1 -1
- package/dist/components/icon-component.d.ts +2 -2
- package/dist/components/icon-component.es.js +1 -1
- package/dist/components/input-otp.cjs.js +1 -20
- package/dist/components/input-otp.es.js +37 -225
- package/dist/components/input.cjs.js +1 -1
- package/dist/components/input.d.ts +5 -8
- package/dist/components/input.es.js +1 -1
- package/dist/components/menubar.cjs.js +1 -1
- package/dist/components/menubar.es.js +1 -1
- package/dist/components/multi-select.cjs.js +1 -1
- package/dist/components/multi-select.es.js +3 -3
- package/dist/components/navigation-menu.cjs.js +1 -1
- package/dist/components/navigation-menu.es.js +1 -1
- package/dist/components/phone-input.cjs.js +1 -1
- package/dist/components/phone-input.es.js +4 -4
- package/dist/components/resizable.cjs.js +1 -1
- package/dist/components/resizable.es.js +24 -1527
- package/dist/components/select.cjs.js +1 -1
- package/dist/components/select.es.js +1 -1
- package/dist/components/sheet.cjs.js +1 -1
- package/dist/components/sheet.es.js +1 -1
- package/dist/{dialog-DZpF7OXg.js → dialog-BdbmyluB.js} +1 -1
- package/dist/{dialog-BKm2PZl2.cjs → dialog-DEwsbeqW.cjs} +1 -1
- package/dist/{icon-component-BZ-4FDV6.js → icon-component-DS1KwkwD.js} +11 -10
- package/dist/icon-component-lt1cLU_1.cjs +1 -0
- package/dist/{input-DwPDvbRE.js → input-CToZ7rWo.js} +55 -55
- package/dist/input-DDSu84U-.cjs +1 -0
- package/package.json +1 -1
- package/dist/command-BGCSJ9vX.js +0 -506
- package/dist/command-D9M8dk1M.cjs +0 -1
- package/dist/icon-component-LY_vGYHZ.cjs +0 -1
- package/dist/input-DFPJ_mtM.cjs +0 -1
package/dist/command-BGCSJ9vX.js
DELETED
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
import { j as k } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import * as G from "@radix-ui/react-dialog";
|
|
3
|
-
import * as l from "react";
|
|
4
|
-
import { Primitive as j } from "@radix-ui/react-primitive";
|
|
5
|
-
import { useId as P } from "@radix-ui/react-id";
|
|
6
|
-
import { D as Se, e as Re, h as je, c as De, b as Ae } from "./dialog-DZpF7OXg.js";
|
|
7
|
-
import { c as D } from "./index-CRiPKpXj.js";
|
|
8
|
-
import { I as _e } from "./icon-component-BZ-4FDV6.js";
|
|
9
|
-
var pe = 1, Me = 0.9, Ne = 0.8, $e = 0.17, te = 0.1, re = 0.999, Fe = 0.9999, Ke = 0.99, Pe = /[\\\/_+.#"@\[\(\{&]/, Le = /[\\\/_+.#"@\[\(\{&]/g, qe = /[\s-]/, be = /[\s-]/g;
|
|
10
|
-
function le(e, n, r, d, a, u, s) {
|
|
11
|
-
if (u === n.length) return a === e.length ? pe : Ke;
|
|
12
|
-
var f = `${a},${u}`;
|
|
13
|
-
if (s[f] !== void 0) return s[f];
|
|
14
|
-
for (var b = d.charAt(u), i = r.indexOf(b, a), v = 0, g, I, w, S; i >= 0; ) g = le(e, n, r, d, i + 1, u + 1, s), g > v && (i === a ? g *= pe : Pe.test(e.charAt(i - 1)) ? (g *= Ne, w = e.slice(a, i - 1).match(Le), w && a > 0 && (g *= Math.pow(re, w.length))) : qe.test(e.charAt(i - 1)) ? (g *= Me, S = e.slice(a, i - 1).match(be), S && a > 0 && (g *= Math.pow(re, S.length))) : (g *= $e, a > 0 && (g *= Math.pow(re, i - a))), e.charAt(i) !== n.charAt(u) && (g *= Fe)), (g < te && r.charAt(i - 1) === d.charAt(u + 1) || d.charAt(u + 1) === d.charAt(u) && r.charAt(i - 1) !== d.charAt(u)) && (I = le(e, n, r, d, i + 1, u + 2, s), I * te > g && (g = I * te)), g > v && (v = g), i = r.indexOf(b, i + 1);
|
|
15
|
-
return s[f] = v, v;
|
|
16
|
-
}
|
|
17
|
-
function ve(e) {
|
|
18
|
-
return e.toLowerCase().replace(be, " ");
|
|
19
|
-
}
|
|
20
|
-
function Ve(e, n, r) {
|
|
21
|
-
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, le(e, n, ve(e), ve(n), 0, 0, {});
|
|
22
|
-
}
|
|
23
|
-
function ge(e, n) {
|
|
24
|
-
if (typeof e == "function")
|
|
25
|
-
return e(n);
|
|
26
|
-
e != null && (e.current = n);
|
|
27
|
-
}
|
|
28
|
-
function V(...e) {
|
|
29
|
-
return (n) => {
|
|
30
|
-
let r = !1;
|
|
31
|
-
const d = e.map((a) => {
|
|
32
|
-
const u = ge(a, n);
|
|
33
|
-
return !r && typeof u == "function" && (r = !0), u;
|
|
34
|
-
});
|
|
35
|
-
if (r)
|
|
36
|
-
return () => {
|
|
37
|
-
for (let a = 0; a < d.length; a++) {
|
|
38
|
-
const u = d[a];
|
|
39
|
-
typeof u == "function" ? u() : ge(e[a], null);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
var q = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', ze = '[cmdk-group-heading=""]', xe = '[cmdk-item=""]', he = `${xe}:not([aria-disabled="true"])`, ae = "cmdk-item-select", F = "data-value", Oe = (e, n, r) => Ve(e, n, r), ke = l.createContext(void 0), z = () => l.useContext(ke), ye = l.createContext(void 0), oe = () => l.useContext(ye), we = l.createContext(void 0), Ee = l.forwardRef((e, n) => {
|
|
45
|
-
let r = K(() => {
|
|
46
|
-
var t, c;
|
|
47
|
-
return { search: "", value: (c = (t = e.value) != null ? t : e.defaultValue) != null ? c : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
48
|
-
}), d = K(() => /* @__PURE__ */ new Set()), a = K(() => /* @__PURE__ */ new Map()), u = K(() => /* @__PURE__ */ new Map()), s = K(() => /* @__PURE__ */ new Set()), f = Ce(e), { label: b, children: i, value: v, onValueChange: g, filter: I, shouldFilter: w, loop: S, disablePointerSelection: T = !1, vimBindings: A = !0, ...O } = e, U = P(), ue = P(), W = P(), _ = l.useRef(null), x = Ze();
|
|
49
|
-
M(() => {
|
|
50
|
-
if (v !== void 0) {
|
|
51
|
-
let t = v.trim();
|
|
52
|
-
r.current.value = t, E.emit();
|
|
53
|
-
}
|
|
54
|
-
}, [v]), M(() => {
|
|
55
|
-
x(6, ce);
|
|
56
|
-
}, []);
|
|
57
|
-
let E = l.useMemo(() => ({ subscribe: (t) => (s.current.add(t), () => s.current.delete(t)), snapshot: () => r.current, setState: (t, c, m) => {
|
|
58
|
-
var o, p, h, C;
|
|
59
|
-
if (!Object.is(r.current[t], c)) {
|
|
60
|
-
if (r.current[t] = c, t === "search") Q(), X(), x(1, Y);
|
|
61
|
-
else if (t === "value") {
|
|
62
|
-
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
63
|
-
let y = document.getElementById(W);
|
|
64
|
-
y ? y.focus() : (o = document.getElementById(U)) == null || o.focus();
|
|
65
|
-
}
|
|
66
|
-
if (x(7, () => {
|
|
67
|
-
var y;
|
|
68
|
-
r.current.selectedItemId = (y = $()) == null ? void 0 : y.id, E.emit();
|
|
69
|
-
}), m || x(5, ce), ((p = f.current) == null ? void 0 : p.value) !== void 0) {
|
|
70
|
-
let y = c ?? "";
|
|
71
|
-
(C = (h = f.current).onValueChange) == null || C.call(h, y);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
E.emit();
|
|
76
|
-
}
|
|
77
|
-
}, emit: () => {
|
|
78
|
-
s.current.forEach((t) => t());
|
|
79
|
-
} }), []), J = l.useMemo(() => ({ value: (t, c, m) => {
|
|
80
|
-
var o;
|
|
81
|
-
c !== ((o = u.current.get(t)) == null ? void 0 : o.value) && (u.current.set(t, { value: c, keywords: m }), r.current.filtered.items.set(t, ie(c, m)), x(2, () => {
|
|
82
|
-
X(), E.emit();
|
|
83
|
-
}));
|
|
84
|
-
}, item: (t, c) => (d.current.add(t), c && (a.current.has(c) ? a.current.get(c).add(t) : a.current.set(c, /* @__PURE__ */ new Set([t]))), x(3, () => {
|
|
85
|
-
Q(), X(), r.current.value || Y(), E.emit();
|
|
86
|
-
}), () => {
|
|
87
|
-
u.current.delete(t), d.current.delete(t), r.current.filtered.items.delete(t);
|
|
88
|
-
let m = $();
|
|
89
|
-
x(4, () => {
|
|
90
|
-
Q(), m?.getAttribute("id") === t && Y(), E.emit();
|
|
91
|
-
});
|
|
92
|
-
}), group: (t) => (a.current.has(t) || a.current.set(t, /* @__PURE__ */ new Set()), () => {
|
|
93
|
-
u.current.delete(t), a.current.delete(t);
|
|
94
|
-
}), filter: () => f.current.shouldFilter, label: b || e["aria-label"], getDisablePointerSelection: () => f.current.disablePointerSelection, listId: U, inputId: W, labelId: ue, listInnerRef: _ }), []);
|
|
95
|
-
function ie(t, c) {
|
|
96
|
-
var m, o;
|
|
97
|
-
let p = (o = (m = f.current) == null ? void 0 : m.filter) != null ? o : Oe;
|
|
98
|
-
return t ? p(t, r.current.search, c) : 0;
|
|
99
|
-
}
|
|
100
|
-
function X() {
|
|
101
|
-
if (!r.current.search || f.current.shouldFilter === !1) return;
|
|
102
|
-
let t = r.current.filtered.items, c = [];
|
|
103
|
-
r.current.filtered.groups.forEach((o) => {
|
|
104
|
-
let p = a.current.get(o), h = 0;
|
|
105
|
-
p.forEach((C) => {
|
|
106
|
-
let y = t.get(C);
|
|
107
|
-
h = Math.max(y, h);
|
|
108
|
-
}), c.push([o, h]);
|
|
109
|
-
});
|
|
110
|
-
let m = _.current;
|
|
111
|
-
L().sort((o, p) => {
|
|
112
|
-
var h, C;
|
|
113
|
-
let y = o.getAttribute("id"), B = p.getAttribute("id");
|
|
114
|
-
return ((h = t.get(B)) != null ? h : 0) - ((C = t.get(y)) != null ? C : 0);
|
|
115
|
-
}).forEach((o) => {
|
|
116
|
-
let p = o.closest(ne);
|
|
117
|
-
p ? p.appendChild(o.parentElement === p ? o : o.closest(`${ne} > *`)) : m.appendChild(o.parentElement === m ? o : o.closest(`${ne} > *`));
|
|
118
|
-
}), c.sort((o, p) => p[1] - o[1]).forEach((o) => {
|
|
119
|
-
var p;
|
|
120
|
-
let h = (p = _.current) == null ? void 0 : p.querySelector(`${q}[${F}="${encodeURIComponent(o[0])}"]`);
|
|
121
|
-
h?.parentElement.appendChild(h);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function Y() {
|
|
125
|
-
let t = L().find((m) => m.getAttribute("aria-disabled") !== "true"), c = t?.getAttribute(F);
|
|
126
|
-
E.setState("value", c || void 0);
|
|
127
|
-
}
|
|
128
|
-
function Q() {
|
|
129
|
-
var t, c, m, o;
|
|
130
|
-
if (!r.current.search || f.current.shouldFilter === !1) {
|
|
131
|
-
r.current.filtered.count = d.current.size;
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
135
|
-
let p = 0;
|
|
136
|
-
for (let h of d.current) {
|
|
137
|
-
let C = (c = (t = u.current.get(h)) == null ? void 0 : t.value) != null ? c : "", y = (o = (m = u.current.get(h)) == null ? void 0 : m.keywords) != null ? o : [], B = ie(C, y);
|
|
138
|
-
r.current.filtered.items.set(h, B), B > 0 && p++;
|
|
139
|
-
}
|
|
140
|
-
for (let [h, C] of a.current) for (let y of C) if (r.current.filtered.items.get(y) > 0) {
|
|
141
|
-
r.current.filtered.groups.add(h);
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
r.current.filtered.count = p;
|
|
145
|
-
}
|
|
146
|
-
function ce() {
|
|
147
|
-
var t, c, m;
|
|
148
|
-
let o = $();
|
|
149
|
-
o && (((t = o.parentElement) == null ? void 0 : t.firstChild) === o && ((m = (c = o.closest(q)) == null ? void 0 : c.querySelector(ze)) == null || m.scrollIntoView({ block: "nearest" })), o.scrollIntoView({ block: "nearest" }));
|
|
150
|
-
}
|
|
151
|
-
function $() {
|
|
152
|
-
var t;
|
|
153
|
-
return (t = _.current) == null ? void 0 : t.querySelector(`${xe}[aria-selected="true"]`);
|
|
154
|
-
}
|
|
155
|
-
function L() {
|
|
156
|
-
var t;
|
|
157
|
-
return Array.from(((t = _.current) == null ? void 0 : t.querySelectorAll(he)) || []);
|
|
158
|
-
}
|
|
159
|
-
function Z(t) {
|
|
160
|
-
let c = L()[t];
|
|
161
|
-
c && E.setState("value", c.getAttribute(F));
|
|
162
|
-
}
|
|
163
|
-
function ee(t) {
|
|
164
|
-
var c;
|
|
165
|
-
let m = $(), o = L(), p = o.findIndex((C) => C === m), h = o[p + t];
|
|
166
|
-
(c = f.current) != null && c.loop && (h = p + t < 0 ? o[o.length - 1] : p + t === o.length ? o[0] : o[p + t]), h && E.setState("value", h.getAttribute(F));
|
|
167
|
-
}
|
|
168
|
-
function de(t) {
|
|
169
|
-
let c = $(), m = c?.closest(q), o;
|
|
170
|
-
for (; m && !o; ) m = t > 0 ? Ye(m, q) : Qe(m, q), o = m?.querySelector(he);
|
|
171
|
-
o ? E.setState("value", o.getAttribute(F)) : ee(t);
|
|
172
|
-
}
|
|
173
|
-
let se = () => Z(L().length - 1), me = (t) => {
|
|
174
|
-
t.preventDefault(), t.metaKey ? se() : t.altKey ? de(1) : ee(1);
|
|
175
|
-
}, fe = (t) => {
|
|
176
|
-
t.preventDefault(), t.metaKey ? Z(0) : t.altKey ? de(-1) : ee(-1);
|
|
177
|
-
};
|
|
178
|
-
return l.createElement(j.div, { ref: n, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (t) => {
|
|
179
|
-
var c;
|
|
180
|
-
(c = O.onKeyDown) == null || c.call(O, t);
|
|
181
|
-
let m = t.nativeEvent.isComposing || t.keyCode === 229;
|
|
182
|
-
if (!(t.defaultPrevented || m)) switch (t.key) {
|
|
183
|
-
case "n":
|
|
184
|
-
case "j": {
|
|
185
|
-
A && t.ctrlKey && me(t);
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
case "ArrowDown": {
|
|
189
|
-
me(t);
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
case "p":
|
|
193
|
-
case "k": {
|
|
194
|
-
A && t.ctrlKey && fe(t);
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
case "ArrowUp": {
|
|
198
|
-
fe(t);
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
case "Home": {
|
|
202
|
-
t.preventDefault(), Z(0);
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
case "End": {
|
|
206
|
-
t.preventDefault(), se();
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
case "Enter": {
|
|
210
|
-
t.preventDefault();
|
|
211
|
-
let o = $();
|
|
212
|
-
if (o) {
|
|
213
|
-
let p = new Event(ae);
|
|
214
|
-
o.dispatchEvent(p);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
} }, l.createElement("label", { "cmdk-label": "", htmlFor: J.inputId, id: J.labelId, style: tt }, b), H(e, (t) => l.createElement(ye.Provider, { value: E }, l.createElement(ke.Provider, { value: J }, t))));
|
|
219
|
-
}), Be = l.forwardRef((e, n) => {
|
|
220
|
-
var r, d;
|
|
221
|
-
let a = P(), u = l.useRef(null), s = l.useContext(we), f = z(), b = Ce(e), i = (d = (r = b.current) == null ? void 0 : r.forceMount) != null ? d : s?.forceMount;
|
|
222
|
-
M(() => {
|
|
223
|
-
if (!i) return f.item(a, s?.id);
|
|
224
|
-
}, [i]);
|
|
225
|
-
let v = Ie(a, u, [e.value, e.children, u], e.keywords), g = oe(), I = R((x) => x.value && x.value === v.current), w = R((x) => i || f.filter() === !1 ? !0 : x.search ? x.filtered.items.get(a) > 0 : !0);
|
|
226
|
-
l.useEffect(() => {
|
|
227
|
-
let x = u.current;
|
|
228
|
-
if (!(!x || e.disabled)) return x.addEventListener(ae, S), () => x.removeEventListener(ae, S);
|
|
229
|
-
}, [w, e.onSelect, e.disabled]);
|
|
230
|
-
function S() {
|
|
231
|
-
var x, E;
|
|
232
|
-
T(), (E = (x = b.current).onSelect) == null || E.call(x, v.current);
|
|
233
|
-
}
|
|
234
|
-
function T() {
|
|
235
|
-
g.setState("value", v.current, !0);
|
|
236
|
-
}
|
|
237
|
-
if (!w) return null;
|
|
238
|
-
let { disabled: A, value: O, onSelect: U, forceMount: ue, keywords: W, ..._ } = e;
|
|
239
|
-
return l.createElement(j.div, { ref: V(u, n), ..._, id: a, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!I, "data-disabled": !!A, "data-selected": !!I, onPointerMove: A || f.getDisablePointerSelection() ? void 0 : T, onClick: A ? void 0 : S }, e.children);
|
|
240
|
-
}), Ge = l.forwardRef((e, n) => {
|
|
241
|
-
let { heading: r, children: d, forceMount: a, ...u } = e, s = P(), f = l.useRef(null), b = l.useRef(null), i = P(), v = z(), g = R((w) => a || v.filter() === !1 ? !0 : w.search ? w.filtered.groups.has(s) : !0);
|
|
242
|
-
M(() => v.group(s), []), Ie(s, f, [e.value, e.heading, b]);
|
|
243
|
-
let I = l.useMemo(() => ({ id: s, forceMount: a }), [a]);
|
|
244
|
-
return l.createElement(j.div, { ref: V(f, n), ...u, "cmdk-group": "", role: "presentation", hidden: g ? void 0 : !0 }, r && l.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: i }, r), H(e, (w) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? i : void 0 }, l.createElement(we.Provider, { value: I }, w))));
|
|
245
|
-
}), He = l.forwardRef((e, n) => {
|
|
246
|
-
let { alwaysRender: r, ...d } = e, a = l.useRef(null), u = R((s) => !s.search);
|
|
247
|
-
return !r && !u ? null : l.createElement(j.div, { ref: V(a, n), ...d, "cmdk-separator": "", role: "separator" });
|
|
248
|
-
}), Te = l.forwardRef((e, n) => {
|
|
249
|
-
let { onValueChange: r, ...d } = e, a = e.value != null, u = oe(), s = R((i) => i.search), f = R((i) => i.selectedItemId), b = z();
|
|
250
|
-
return l.useEffect(() => {
|
|
251
|
-
e.value != null && u.setState("search", e.value);
|
|
252
|
-
}, [e.value]), l.createElement(j.input, { ref: n, ...d, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": f, id: b.inputId, type: "text", value: a ? e.value : s, onChange: (i) => {
|
|
253
|
-
a || u.setState("search", i.target.value), r?.(i.target.value);
|
|
254
|
-
} });
|
|
255
|
-
}), Ue = l.forwardRef((e, n) => {
|
|
256
|
-
let { children: r, label: d = "Suggestions", ...a } = e, u = l.useRef(null), s = l.useRef(null), f = R((i) => i.selectedItemId), b = z();
|
|
257
|
-
return l.useEffect(() => {
|
|
258
|
-
if (s.current && u.current) {
|
|
259
|
-
let i = s.current, v = u.current, g, I = new ResizeObserver(() => {
|
|
260
|
-
g = requestAnimationFrame(() => {
|
|
261
|
-
let w = i.offsetHeight;
|
|
262
|
-
v.style.setProperty("--cmdk-list-height", w.toFixed(1) + "px");
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
return I.observe(i), () => {
|
|
266
|
-
cancelAnimationFrame(g), I.unobserve(i);
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
}, []), l.createElement(j.div, { ref: V(u, n), ...a, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": d, id: b.listId }, H(e, (i) => l.createElement("div", { ref: V(s, b.listInnerRef), "cmdk-list-sizer": "" }, i)));
|
|
270
|
-
}), We = l.forwardRef((e, n) => {
|
|
271
|
-
let { open: r, onOpenChange: d, overlayClassName: a, contentClassName: u, container: s, ...f } = e;
|
|
272
|
-
return l.createElement(G.Root, { open: r, onOpenChange: d }, l.createElement(G.Portal, { container: s }, l.createElement(G.Overlay, { "cmdk-overlay": "", className: a }), l.createElement(G.Content, { "aria-label": e.label, "cmdk-dialog": "", className: u }, l.createElement(Ee, { ref: n, ...f }))));
|
|
273
|
-
}), Je = l.forwardRef((e, n) => R((r) => r.filtered.count === 0) ? l.createElement(j.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), Xe = l.forwardRef((e, n) => {
|
|
274
|
-
let { progress: r, children: d, label: a = "Loading...", ...u } = e;
|
|
275
|
-
return l.createElement(j.div, { ref: n, ...u, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": a }, H(e, (s) => l.createElement("div", { "aria-hidden": !0 }, s)));
|
|
276
|
-
}), N = Object.assign(Ee, { List: Ue, Item: Be, Input: Te, Group: Ge, Separator: He, Dialog: We, Empty: Je, Loading: Xe });
|
|
277
|
-
function Ye(e, n) {
|
|
278
|
-
let r = e.nextElementSibling;
|
|
279
|
-
for (; r; ) {
|
|
280
|
-
if (r.matches(n)) return r;
|
|
281
|
-
r = r.nextElementSibling;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
function Qe(e, n) {
|
|
285
|
-
let r = e.previousElementSibling;
|
|
286
|
-
for (; r; ) {
|
|
287
|
-
if (r.matches(n)) return r;
|
|
288
|
-
r = r.previousElementSibling;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
function Ce(e) {
|
|
292
|
-
let n = l.useRef(e);
|
|
293
|
-
return M(() => {
|
|
294
|
-
n.current = e;
|
|
295
|
-
}), n;
|
|
296
|
-
}
|
|
297
|
-
var M = typeof window > "u" ? l.useEffect : l.useLayoutEffect;
|
|
298
|
-
function K(e) {
|
|
299
|
-
let n = l.useRef();
|
|
300
|
-
return n.current === void 0 && (n.current = e()), n;
|
|
301
|
-
}
|
|
302
|
-
function R(e) {
|
|
303
|
-
let n = oe(), r = () => e(n.snapshot());
|
|
304
|
-
return l.useSyncExternalStore(n.subscribe, r, r);
|
|
305
|
-
}
|
|
306
|
-
function Ie(e, n, r, d = []) {
|
|
307
|
-
let a = l.useRef(), u = z();
|
|
308
|
-
return M(() => {
|
|
309
|
-
var s;
|
|
310
|
-
let f = (() => {
|
|
311
|
-
var i;
|
|
312
|
-
for (let v of r) {
|
|
313
|
-
if (typeof v == "string") return v.trim();
|
|
314
|
-
if (typeof v == "object" && "current" in v) return v.current ? (i = v.current.textContent) == null ? void 0 : i.trim() : a.current;
|
|
315
|
-
}
|
|
316
|
-
})(), b = d.map((i) => i.trim());
|
|
317
|
-
u.value(e, f, b), (s = n.current) == null || s.setAttribute(F, f), a.current = f;
|
|
318
|
-
}), a;
|
|
319
|
-
}
|
|
320
|
-
var Ze = () => {
|
|
321
|
-
let [e, n] = l.useState(), r = K(() => /* @__PURE__ */ new Map());
|
|
322
|
-
return M(() => {
|
|
323
|
-
r.current.forEach((d) => d()), r.current = /* @__PURE__ */ new Map();
|
|
324
|
-
}, [e]), (d, a) => {
|
|
325
|
-
r.current.set(d, a), n({});
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
function et(e) {
|
|
329
|
-
let n = e.type;
|
|
330
|
-
return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
|
|
331
|
-
}
|
|
332
|
-
function H({ asChild: e, children: n }, r) {
|
|
333
|
-
return e && l.isValidElement(n) ? l.cloneElement(et(n), { ref: n.ref }, r(n.props.children)) : r(n);
|
|
334
|
-
}
|
|
335
|
-
var tt = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
336
|
-
function rt({
|
|
337
|
-
className: e,
|
|
338
|
-
...n
|
|
339
|
-
}) {
|
|
340
|
-
return /* @__PURE__ */ k.jsx(
|
|
341
|
-
N,
|
|
342
|
-
{
|
|
343
|
-
"data-slot": "command",
|
|
344
|
-
className: D(
|
|
345
|
-
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
346
|
-
e
|
|
347
|
-
),
|
|
348
|
-
...n
|
|
349
|
-
}
|
|
350
|
-
);
|
|
351
|
-
}
|
|
352
|
-
function ct({
|
|
353
|
-
title: e = "Command Palette",
|
|
354
|
-
description: n = "Search for a command to run...",
|
|
355
|
-
children: r,
|
|
356
|
-
className: d,
|
|
357
|
-
showCloseButton: a = !0,
|
|
358
|
-
...u
|
|
359
|
-
}) {
|
|
360
|
-
return /* @__PURE__ */ k.jsxs(Se, { ...u, children: [
|
|
361
|
-
/* @__PURE__ */ k.jsxs(Re, { className: "sr-only", children: [
|
|
362
|
-
/* @__PURE__ */ k.jsx(je, { children: e }),
|
|
363
|
-
/* @__PURE__ */ k.jsx(De, { children: n })
|
|
364
|
-
] }),
|
|
365
|
-
/* @__PURE__ */ k.jsx(
|
|
366
|
-
Ae,
|
|
367
|
-
{
|
|
368
|
-
className: D("overflow-hidden p-0", d),
|
|
369
|
-
showCloseButton: a,
|
|
370
|
-
children: /* @__PURE__ */ k.jsx(rt, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: r })
|
|
371
|
-
}
|
|
372
|
-
)
|
|
373
|
-
] });
|
|
374
|
-
}
|
|
375
|
-
function dt({
|
|
376
|
-
className: e,
|
|
377
|
-
...n
|
|
378
|
-
}) {
|
|
379
|
-
return /* @__PURE__ */ k.jsxs(
|
|
380
|
-
"div",
|
|
381
|
-
{
|
|
382
|
-
"data-slot": "command-input-wrapper",
|
|
383
|
-
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
384
|
-
children: [
|
|
385
|
-
/* @__PURE__ */ k.jsx(
|
|
386
|
-
_e,
|
|
387
|
-
{
|
|
388
|
-
iconName: "IconSearch",
|
|
389
|
-
className: "size-4 shrink-0 opacity-50"
|
|
390
|
-
}
|
|
391
|
-
),
|
|
392
|
-
/* @__PURE__ */ k.jsx(
|
|
393
|
-
N.Input,
|
|
394
|
-
{
|
|
395
|
-
"data-slot": "command-input",
|
|
396
|
-
className: D(
|
|
397
|
-
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
398
|
-
e
|
|
399
|
-
),
|
|
400
|
-
...n
|
|
401
|
-
}
|
|
402
|
-
)
|
|
403
|
-
]
|
|
404
|
-
}
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
function st({
|
|
408
|
-
className: e,
|
|
409
|
-
...n
|
|
410
|
-
}) {
|
|
411
|
-
return /* @__PURE__ */ k.jsx(
|
|
412
|
-
N.List,
|
|
413
|
-
{
|
|
414
|
-
"data-slot": "command-list",
|
|
415
|
-
className: D(
|
|
416
|
-
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
417
|
-
e
|
|
418
|
-
),
|
|
419
|
-
...n
|
|
420
|
-
}
|
|
421
|
-
);
|
|
422
|
-
}
|
|
423
|
-
function mt({
|
|
424
|
-
...e
|
|
425
|
-
}) {
|
|
426
|
-
return /* @__PURE__ */ k.jsx(
|
|
427
|
-
N.Empty,
|
|
428
|
-
{
|
|
429
|
-
"data-slot": "command-empty",
|
|
430
|
-
className: "py-6 text-center text-sm",
|
|
431
|
-
...e
|
|
432
|
-
}
|
|
433
|
-
);
|
|
434
|
-
}
|
|
435
|
-
function ft({
|
|
436
|
-
className: e,
|
|
437
|
-
...n
|
|
438
|
-
}) {
|
|
439
|
-
return /* @__PURE__ */ k.jsx(
|
|
440
|
-
N.Group,
|
|
441
|
-
{
|
|
442
|
-
"data-slot": "command-group",
|
|
443
|
-
className: D(
|
|
444
|
-
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold",
|
|
445
|
-
e
|
|
446
|
-
),
|
|
447
|
-
...n
|
|
448
|
-
}
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
function pt({
|
|
452
|
-
className: e,
|
|
453
|
-
...n
|
|
454
|
-
}) {
|
|
455
|
-
return /* @__PURE__ */ k.jsx(
|
|
456
|
-
N.Separator,
|
|
457
|
-
{
|
|
458
|
-
"data-slot": "command-separator",
|
|
459
|
-
className: D("bg-border -mx-1 h-px", e),
|
|
460
|
-
...n
|
|
461
|
-
}
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
function vt({
|
|
465
|
-
className: e,
|
|
466
|
-
...n
|
|
467
|
-
}) {
|
|
468
|
-
return /* @__PURE__ */ k.jsx(
|
|
469
|
-
N.Item,
|
|
470
|
-
{
|
|
471
|
-
"data-slot": "command-item",
|
|
472
|
-
className: D(
|
|
473
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
474
|
-
e
|
|
475
|
-
),
|
|
476
|
-
...n
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
}
|
|
480
|
-
function gt({
|
|
481
|
-
className: e,
|
|
482
|
-
...n
|
|
483
|
-
}) {
|
|
484
|
-
return /* @__PURE__ */ k.jsx(
|
|
485
|
-
"span",
|
|
486
|
-
{
|
|
487
|
-
"data-slot": "command-shortcut",
|
|
488
|
-
className: D(
|
|
489
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
490
|
-
e
|
|
491
|
-
),
|
|
492
|
-
...n
|
|
493
|
-
}
|
|
494
|
-
);
|
|
495
|
-
}
|
|
496
|
-
export {
|
|
497
|
-
rt as C,
|
|
498
|
-
ct as a,
|
|
499
|
-
mt as b,
|
|
500
|
-
ft as c,
|
|
501
|
-
dt as d,
|
|
502
|
-
vt as e,
|
|
503
|
-
st as f,
|
|
504
|
-
pt as g,
|
|
505
|
-
gt as h
|
|
506
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const y=require("./jsx-runtime-DUiatUiq.cjs"),De=require("@radix-ui/react-dialog"),_e=require("react"),S=require("@radix-ui/react-primitive"),O=require("@radix-ui/react-id"),K=require("./dialog-BKm2PZl2.cjs"),D=require("./index-DoxiiusW.cjs"),Ae=require("./icon-component-LY_vGYHZ.cjs");function be(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const d=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,d.get?d:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const T=be(De),l=be(_e);var ve=1,Pe=.9,Me=.8,Ne=.17,re=.1,ne=.999,$e=.9999,qe=.99,Oe=/[\\\/_+.#"@\[\(\{&]/,Fe=/[\\\/_+.#"@\[\(\{&]/g,Ke=/[\s-]/,ye=/[\s-]/g;function ae(e,n,r,d,a,i,s){if(i===n.length)return a===e.length?ve:qe;var f=`${a},${i}`;if(s[f]!==void 0)return s[f];for(var x=d.charAt(i),u=r.indexOf(x,a),v=0,g,R,w,I;u>=0;)g=ae(e,n,r,d,u+1,i+1,s),g>v&&(u===a?g*=ve:Oe.test(e.charAt(u-1))?(g*=Me,w=e.slice(a,u-1).match(Fe),w&&a>0&&(g*=Math.pow(ne,w.length))):Ke.test(e.charAt(u-1))?(g*=Pe,I=e.slice(a,u-1).match(ye),I&&a>0&&(g*=Math.pow(ne,I.length))):(g*=Ne,a>0&&(g*=Math.pow(ne,u-a))),e.charAt(u)!==n.charAt(i)&&(g*=$e)),(g<re&&r.charAt(u-1)===d.charAt(i+1)||d.charAt(i+1)===d.charAt(i)&&r.charAt(u-1)!==d.charAt(i))&&(R=ae(e,n,r,d,u+1,i+2,s),R*re>g&&(g=R*re)),g>v&&(v=g),u=r.indexOf(x,u+1);return s[f]=v,v}function ge(e){return e.toLowerCase().replace(ye," ")}function Le(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,ae(e,n,ge(e),ge(n),0,0,{})}function he(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function z(...e){return n=>{let r=!1;const d=e.map(a=>{const i=he(a,n);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<d.length;a++){const i=d[a];typeof i=="function"?i():he(e[a],null)}}}}var L='[cmdk-group=""]',le='[cmdk-group-items=""]',ze='[cmdk-group-heading=""]',ke='[cmdk-item=""]',xe=`${ke}:not([aria-disabled="true"])`,oe="cmdk-item-select",$="data-value",Ve=(e,n,r)=>Le(e,n,r),we=l.createContext(void 0),V=()=>l.useContext(we),Ee=l.createContext(void 0),ie=()=>l.useContext(Ee),Ce=l.createContext(void 0),Re=l.forwardRef((e,n)=>{let r=q(()=>{var t,c;return{search:"",value:(c=(t=e.value)!=null?t:e.defaultValue)!=null?c:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),d=q(()=>new Set),a=q(()=>new Map),i=q(()=>new Map),s=q(()=>new Set),f=Ie(e),{label:x,children:u,value:v,onValueChange:g,filter:R,shouldFilter:w,loop:I,disablePointerSelection:U=!1,vimBindings:_=!0,...B}=e,W=O.useId(),ue=O.useId(),J=O.useId(),A=l.useRef(null),b=Ze();P(()=>{if(v!==void 0){let t=v.trim();r.current.value=t,E.emit()}},[v]),P(()=>{b(6,de)},[]);let E=l.useMemo(()=>({subscribe:t=>(s.current.add(t),()=>s.current.delete(t)),snapshot:()=>r.current,setState:(t,c,m)=>{var o,p,h,C;if(!Object.is(r.current[t],c)){if(r.current[t]=c,t==="search")Z(),Y(),b(1,Q);else if(t==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let k=document.getElementById(J);k?k.focus():(o=document.getElementById(W))==null||o.focus()}if(b(7,()=>{var k;r.current.selectedItemId=(k=N())==null?void 0:k.id,E.emit()}),m||b(5,de),((p=f.current)==null?void 0:p.value)!==void 0){let k=c??"";(C=(h=f.current).onValueChange)==null||C.call(h,k);return}}E.emit()}},emit:()=>{s.current.forEach(t=>t())}}),[]),X=l.useMemo(()=>({value:(t,c,m)=>{var o;c!==((o=i.current.get(t))==null?void 0:o.value)&&(i.current.set(t,{value:c,keywords:m}),r.current.filtered.items.set(t,ce(c,m)),b(2,()=>{Y(),E.emit()}))},item:(t,c)=>(d.current.add(t),c&&(a.current.has(c)?a.current.get(c).add(t):a.current.set(c,new Set([t]))),b(3,()=>{Z(),Y(),r.current.value||Q(),E.emit()}),()=>{i.current.delete(t),d.current.delete(t),r.current.filtered.items.delete(t);let m=N();b(4,()=>{Z(),m?.getAttribute("id")===t&&Q(),E.emit()})}),group:t=>(a.current.has(t)||a.current.set(t,new Set),()=>{i.current.delete(t),a.current.delete(t)}),filter:()=>f.current.shouldFilter,label:x||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:W,inputId:J,labelId:ue,listInnerRef:A}),[]);function ce(t,c){var m,o;let p=(o=(m=f.current)==null?void 0:m.filter)!=null?o:Ve;return t?p(t,r.current.search,c):0}function Y(){if(!r.current.search||f.current.shouldFilter===!1)return;let t=r.current.filtered.items,c=[];r.current.filtered.groups.forEach(o=>{let p=a.current.get(o),h=0;p.forEach(C=>{let k=t.get(C);h=Math.max(k,h)}),c.push([o,h])});let m=A.current;F().sort((o,p)=>{var h,C;let k=o.getAttribute("id"),G=p.getAttribute("id");return((h=t.get(G))!=null?h:0)-((C=t.get(k))!=null?C:0)}).forEach(o=>{let p=o.closest(le);p?p.appendChild(o.parentElement===p?o:o.closest(`${le} > *`)):m.appendChild(o.parentElement===m?o:o.closest(`${le} > *`))}),c.sort((o,p)=>p[1]-o[1]).forEach(o=>{var p;let h=(p=A.current)==null?void 0:p.querySelector(`${L}[${$}="${encodeURIComponent(o[0])}"]`);h?.parentElement.appendChild(h)})}function Q(){let t=F().find(m=>m.getAttribute("aria-disabled")!=="true"),c=t?.getAttribute($);E.setState("value",c||void 0)}function Z(){var t,c,m,o;if(!r.current.search||f.current.shouldFilter===!1){r.current.filtered.count=d.current.size;return}r.current.filtered.groups=new Set;let p=0;for(let h of d.current){let C=(c=(t=i.current.get(h))==null?void 0:t.value)!=null?c:"",k=(o=(m=i.current.get(h))==null?void 0:m.keywords)!=null?o:[],G=ce(C,k);r.current.filtered.items.set(h,G),G>0&&p++}for(let[h,C]of a.current)for(let k of C)if(r.current.filtered.items.get(k)>0){r.current.filtered.groups.add(h);break}r.current.filtered.count=p}function de(){var t,c,m;let o=N();o&&(((t=o.parentElement)==null?void 0:t.firstChild)===o&&((m=(c=o.closest(L))==null?void 0:c.querySelector(ze))==null||m.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function N(){var t;return(t=A.current)==null?void 0:t.querySelector(`${ke}[aria-selected="true"]`)}function F(){var t;return Array.from(((t=A.current)==null?void 0:t.querySelectorAll(xe))||[])}function ee(t){let c=F()[t];c&&E.setState("value",c.getAttribute($))}function te(t){var c;let m=N(),o=F(),p=o.findIndex(C=>C===m),h=o[p+t];(c=f.current)!=null&&c.loop&&(h=p+t<0?o[o.length-1]:p+t===o.length?o[0]:o[p+t]),h&&E.setState("value",h.getAttribute($))}function se(t){let c=N(),m=c?.closest(L),o;for(;m&&!o;)m=t>0?Ye(m,L):Qe(m,L),o=m?.querySelector(xe);o?E.setState("value",o.getAttribute($)):te(t)}let me=()=>ee(F().length-1),fe=t=>{t.preventDefault(),t.metaKey?me():t.altKey?se(1):te(1)},pe=t=>{t.preventDefault(),t.metaKey?ee(0):t.altKey?se(-1):te(-1)};return l.createElement(S.Primitive.div,{ref:n,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:t=>{var c;(c=B.onKeyDown)==null||c.call(B,t);let m=t.nativeEvent.isComposing||t.keyCode===229;if(!(t.defaultPrevented||m))switch(t.key){case"n":case"j":{_&&t.ctrlKey&&fe(t);break}case"ArrowDown":{fe(t);break}case"p":case"k":{_&&t.ctrlKey&&pe(t);break}case"ArrowUp":{pe(t);break}case"Home":{t.preventDefault(),ee(0);break}case"End":{t.preventDefault(),me();break}case"Enter":{t.preventDefault();let o=N();if(o){let p=new Event(oe);o.dispatchEvent(p)}}}}},l.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:tt},x),H(e,t=>l.createElement(Ee.Provider,{value:E},l.createElement(we.Provider,{value:X},t))))}),Be=l.forwardRef((e,n)=>{var r,d;let a=O.useId(),i=l.useRef(null),s=l.useContext(Ce),f=V(),x=Ie(e),u=(d=(r=x.current)==null?void 0:r.forceMount)!=null?d:s?.forceMount;P(()=>{if(!u)return f.item(a,s?.id)},[u]);let v=je(a,i,[e.value,e.children,i],e.keywords),g=ie(),R=j(b=>b.value&&b.value===v.current),w=j(b=>u||f.filter()===!1?!0:b.search?b.filtered.items.get(a)>0:!0);l.useEffect(()=>{let b=i.current;if(!(!b||e.disabled))return b.addEventListener(oe,I),()=>b.removeEventListener(oe,I)},[w,e.onSelect,e.disabled]);function I(){var b,E;U(),(E=(b=x.current).onSelect)==null||E.call(b,v.current)}function U(){g.setState("value",v.current,!0)}if(!w)return null;let{disabled:_,value:B,onSelect:W,forceMount:ue,keywords:J,...A}=e;return l.createElement(S.Primitive.div,{ref:z(i,n),...A,id:a,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!R,"data-disabled":!!_,"data-selected":!!R,onPointerMove:_||f.getDisablePointerSelection()?void 0:U,onClick:_?void 0:I},e.children)}),Ge=l.forwardRef((e,n)=>{let{heading:r,children:d,forceMount:a,...i}=e,s=O.useId(),f=l.useRef(null),x=l.useRef(null),u=O.useId(),v=V(),g=j(w=>a||v.filter()===!1?!0:w.search?w.filtered.groups.has(s):!0);P(()=>v.group(s),[]),je(s,f,[e.value,e.heading,x]);let R=l.useMemo(()=>({id:s,forceMount:a}),[a]);return l.createElement(S.Primitive.div,{ref:z(f,n),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},r&&l.createElement("div",{ref:x,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),H(e,w=>l.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},l.createElement(Ce.Provider,{value:R},w))))}),Te=l.forwardRef((e,n)=>{let{alwaysRender:r,...d}=e,a=l.useRef(null),i=j(s=>!s.search);return!r&&!i?null:l.createElement(S.Primitive.div,{ref:z(a,n),...d,"cmdk-separator":"",role:"separator"})}),He=l.forwardRef((e,n)=>{let{onValueChange:r,...d}=e,a=e.value!=null,i=ie(),s=j(u=>u.search),f=j(u=>u.selectedItemId),x=V();return l.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),l.createElement(S.Primitive.input,{ref:n,...d,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":x.listId,"aria-labelledby":x.labelId,"aria-activedescendant":f,id:x.inputId,type:"text",value:a?e.value:s,onChange:u=>{a||i.setState("search",u.target.value),r?.(u.target.value)}})}),Ue=l.forwardRef((e,n)=>{let{children:r,label:d="Suggestions",...a}=e,i=l.useRef(null),s=l.useRef(null),f=j(u=>u.selectedItemId),x=V();return l.useEffect(()=>{if(s.current&&i.current){let u=s.current,v=i.current,g,R=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=u.offsetHeight;v.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return R.observe(u),()=>{cancelAnimationFrame(g),R.unobserve(u)}}},[]),l.createElement(S.Primitive.div,{ref:z(i,n),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":d,id:x.listId},H(e,u=>l.createElement("div",{ref:z(s,x.listInnerRef),"cmdk-list-sizer":""},u)))}),We=l.forwardRef((e,n)=>{let{open:r,onOpenChange:d,overlayClassName:a,contentClassName:i,container:s,...f}=e;return l.createElement(T.Root,{open:r,onOpenChange:d},l.createElement(T.Portal,{container:s},l.createElement(T.Overlay,{"cmdk-overlay":"",className:a}),l.createElement(T.Content,{"aria-label":e.label,"cmdk-dialog":"",className:i},l.createElement(Re,{ref:n,...f}))))}),Je=l.forwardRef((e,n)=>j(r=>r.filtered.count===0)?l.createElement(S.Primitive.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),Xe=l.forwardRef((e,n)=>{let{progress:r,children:d,label:a="Loading...",...i}=e;return l.createElement(S.Primitive.div,{ref:n,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},H(e,s=>l.createElement("div",{"aria-hidden":!0},s)))}),M=Object.assign(Re,{List:Ue,Item:Be,Input:He,Group:Ge,Separator:Te,Dialog:We,Empty:Je,Loading:Xe});function Ye(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function Qe(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function Ie(e){let n=l.useRef(e);return P(()=>{n.current=e}),n}var P=typeof window>"u"?l.useEffect:l.useLayoutEffect;function q(e){let n=l.useRef();return n.current===void 0&&(n.current=e()),n}function j(e){let n=ie(),r=()=>e(n.snapshot());return l.useSyncExternalStore(n.subscribe,r,r)}function je(e,n,r,d=[]){let a=l.useRef(),i=V();return P(()=>{var s;let f=(()=>{var u;for(let v of r){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(u=v.current.textContent)==null?void 0:u.trim():a.current}})(),x=d.map(u=>u.trim());i.value(e,f,x),(s=n.current)==null||s.setAttribute($,f),a.current=f}),a}var Ze=()=>{let[e,n]=l.useState(),r=q(()=>new Map);return P(()=>{r.current.forEach(d=>d()),r.current=new Map},[e]),(d,a)=>{r.current.set(d,a),n({})}};function et(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function H({asChild:e,children:n},r){return e&&l.isValidElement(n)?l.cloneElement(et(n),{ref:n.ref},r(n.props.children)):r(n)}var tt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Se({className:e,...n}){return y.jsxRuntimeExports.jsx(M,{"data-slot":"command",className:D.cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...n})}function rt({title:e="Command Palette",description:n="Search for a command to run...",children:r,className:d,showCloseButton:a=!0,...i}){return y.jsxRuntimeExports.jsxs(K.Dialog,{...i,children:[y.jsxRuntimeExports.jsxs(K.DialogHeader,{className:"sr-only",children:[y.jsxRuntimeExports.jsx(K.DialogTitle,{children:e}),y.jsxRuntimeExports.jsx(K.DialogDescription,{children:n})]}),y.jsxRuntimeExports.jsx(K.DialogContent,{className:D.cn("overflow-hidden p-0",d),showCloseButton:a,children:y.jsxRuntimeExports.jsx(Se,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function nt({className:e,...n}){return y.jsxRuntimeExports.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[y.jsxRuntimeExports.jsx(Ae.IconComponent,{iconName:"IconSearch",className:"size-4 shrink-0 opacity-50"}),y.jsxRuntimeExports.jsx(M.Input,{"data-slot":"command-input",className:D.cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function lt({className:e,...n}){return y.jsxRuntimeExports.jsx(M.List,{"data-slot":"command-list",className:D.cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function at({...e}){return y.jsxRuntimeExports.jsx(M.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function ot({className:e,...n}){return y.jsxRuntimeExports.jsx(M.Group,{"data-slot":"command-group",className:D.cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold",e),...n})}function it({className:e,...n}){return y.jsxRuntimeExports.jsx(M.Separator,{"data-slot":"command-separator",className:D.cn("bg-border -mx-1 h-px",e),...n})}function ut({className:e,...n}){return y.jsxRuntimeExports.jsx(M.Item,{"data-slot":"command-item",className:D.cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function ct({className:e,...n}){return y.jsxRuntimeExports.jsx("span",{"data-slot":"command-shortcut",className:D.cn("text-muted-foreground ml-auto text-xs tracking-widest",e),...n})}exports.Command=Se;exports.CommandDialog=rt;exports.CommandEmpty=at;exports.CommandGroup=ot;exports.CommandInput=nt;exports.CommandItem=ut;exports.CommandList=lt;exports.CommandSeparator=it;exports.CommandShortcut=ct;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const c=require("./jsx-runtime-DUiatUiq.cjs"),a=require("./index-DoxiiusW.cjs"),m=require("@tabler/icons-react"),p=require("react");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=f(m),i=p.forwardRef(({iconName:e,iconText:t,stroke:n="1.5",onClick:r,size:o=24,...l},u)=>{if(e){const s=d[e];return c.jsxRuntimeExports.jsx(s,{role:"img",ref:u,stroke:n,onClick:r,size:o,className:a.cn("pointer-events-none",l.className),...l})}else if(t){const s=t.slice(0,2).toUpperCase();return c.jsxRuntimeExports.jsx("div",{className:"pointer-events-none flex items-center justify-center",style:{width:o,height:o},role:"img",children:c.jsxRuntimeExports.jsx("p",{className:a.cn({"text-label-sm":o<=16,"text-label-md":o>16}),children:s})})}else return console.error(`Icon ${e} not found`),null});i.displayName="IconComponent";const x=i;exports.IconComponent=x;
|
package/dist/input-DFPJ_mtM.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("./jsx-runtime-DUiatUiq.cjs"),N=require("./label-CbzkBbPT.cjs"),d=require("./index-DoxiiusW.cjs"),E=require("./index-C8P6Mn4U.cjs"),y=require("react"),u=require("./icon-component-LY_vGYHZ.cjs");function I(l){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const a in l)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(l,a);Object.defineProperty(r,a,t.get?t:{enumerable:!0,get:()=>l[a]})}}return r.default=l,Object.freeze(r)}const h=I(y),k=E.cva("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex w-full min-w-0 border bg-transparent text-base transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-semibold disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",{variants:{size:{sm:"text-label-md h-8 rounded-sm px-2 py-1",md:"text-label-lg h-12 rounded-md px-3 py-1",lg:"text-label-xl h-16 rounded-lg px-4 py-2"},rounded:{default:"",full:"rounded-full"},state:{default:"",error:"border-destructive ring-destructive/20 dark:ring-destructive/40",success:"border-success ring-success/20 dark:ring-success/40"}},defaultVariants:{size:"md",rounded:"default",state:"default"}});function C({className:l,label:r,helperText:a,error:t,touched:n,iconLeft:c,iconRight:o,type:i="text",size:p,rounded:j,state:R,containerClassName:g,...e}){const[x,v]=h.useState(!1),m=f=>typeof f=="string"?{name:f}:f,b=t&&n?"error":n&&!t&&e.value?"success":"default",w=()=>{v(!x)};return s.jsxRuntimeExports.jsxs("div",{className:d.cn("flex flex-col gap-2",g),children:[r&&s.jsxRuntimeExports.jsx(N.Label,{htmlFor:e.id,className:d.cn({"text-neutral-700":e.disabled}),children:r}),s.jsxRuntimeExports.jsxs("div",{className:"relative w-full",children:[c&&s.jsxRuntimeExports.jsx("span",{className:d.cn("absolute top-1/2 left-3 -translate-y-1/2",{"text-muted-foreground":b==="default","text-destructive":b==="error","text-success-main":b==="success","text-neutral-700":e.disabled}),children:s.jsxRuntimeExports.jsx(u.IconComponent,{iconName:m(c).name,stroke:m(c).stroke,size:20})}),s.jsxRuntimeExports.jsx("input",{type:i==="password"?x?"text":"password":i,"data-slot":"input","aria-describedby":e.id&&a?`${e.id}-helper-text`:void 0,"aria-invalid":!!(t&&n),"aria-errormessage":e.id&&t?`${e.id}-error-text`:void 0,className:d.cn(k({size:p,rounded:j,state:b,className:d.cn("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",c?"pl-10":"",o||i==="password"?"pr-10":"",i==="color"?"h-[50px] p-0":"",l)})),...e}),i==="password"&&s.jsxRuntimeExports.jsx("button",{type:"button",tabIndex:-1,"aria-label":x?"Hide password":"Show password",className:"absolute top-1/2 right-3 -translate-y-1/2 rounded-md p-1 hover:bg-neutral-100/50 focus-visible:ring-[1.5px] focus-visible:ring-offset-1 focus-visible:outline-none",onClick:w,children:s.jsxRuntimeExports.jsx(u.IconComponent,{iconName:x?"IconEyeOff":"IconEye",size:20})}),o&&i!=="password"&&s.jsxRuntimeExports.jsx("span",{className:"absolute top-1/2 right-3 -translate-y-1/2",children:s.jsxRuntimeExports.jsx(u.IconComponent,{iconName:m(o).name,stroke:m(o).stroke,size:20})}),!o&&t&&n&&i!=="password"&&s.jsxRuntimeExports.jsx(u.IconComponent,{iconName:"IconAlertCircleFilled",size:20,className:"text-destructive absolute top-1/2 right-3 -translate-y-1/2"}),!o&&n&&!t&&e.value&&i!=="password"&&s.jsxRuntimeExports.jsx(u.IconComponent,{iconName:"IconCircleCheckFilled",size:20,className:"text-success-main absolute top-1/2 right-3 -translate-y-1/2"})]}),t&&n?s.jsxRuntimeExports.jsx("span",{id:e.id&&`${e.id}-error-text`,"aria-invalid":!0,className:"text-destructive text-label-md",children:t}):a?s.jsxRuntimeExports.jsx("span",{id:e.id&&`${e.id}-helper-text`,className:d.cn("text-label-md",{"text-muted-foreground":!t&&!n,"text-destructive":t&&n,"text-success-main":n&&!t&&e.value!==void 0,"text-neutral-700":e.disabled}),children:a}):null]})}exports.Input=C;
|