@enya-learning/nova 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -10
- package/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -1
- package/dist/components/accordion.js +23 -20
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +2 -2
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/avatar.js +24 -24
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +12 -12
- package/dist/components/badge.js.map +1 -1
- package/dist/components/box.js +16 -0
- package/dist/components/box.js.map +1 -0
- package/dist/components/breadcrumb.js +28 -24
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.js +2 -2
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.js +10 -10
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +491 -487
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/carousel.js +105 -98
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/chart.js +2 -2
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.js +7 -6
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.js +64 -51
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.js +167 -160
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +40 -36
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/dialog.js +25 -24
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +39 -35
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/heading.js +39 -0
- package/dist/components/heading.js.map +1 -0
- package/dist/components/input-group.js +14 -14
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.js +28 -27
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.js +34 -34
- package/dist/components/item.js.map +1 -1
- package/dist/components/kbd.js +7 -7
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/menubar.js +52 -51
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/native-select.js +21 -19
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/navigation-menu.js +21 -19
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/pagination.js +33 -30
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/progress.js +4 -4
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js +14 -14
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/resizable.js +1 -1
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/select.js +64 -57
- package/dist/components/select.js.map +1 -1
- package/dist/components/sheet.js +22 -21
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +83 -79
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js +7 -7
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sonner.js +137 -121
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.js +10 -8
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/switch.js +5 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js +14 -14
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +15 -15
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.js +47 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/textarea.js +5 -5
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +7 -7
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tooltip.js +5 -5
- package/dist/components/tooltip.js.map +1 -1
- package/dist/index.js +22 -14
- package/dist/src/components/box/box.d.ts +7 -0
- package/dist/src/components/box/index.d.ts +1 -0
- package/dist/src/components/heading/heading.d.ts +15 -0
- package/dist/src/components/heading/index.d.ts +1 -0
- package/dist/src/components/spinner/spinner.d.ts +2 -1
- package/dist/src/components/text/index.d.ts +1 -0
- package/dist/src/components/text/text.d.ts +13 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/styles/nova-binding.css +264 -266
- package/dist/styles/nova.css +158 -49
- package/dist/styles/typography.css +3 -123
- package/package.json +15 -2
- package/src/eslint/no-primitive-colors.js +2 -2
- package/dist/styles/theme-nova.css +0 -197
|
@@ -1,89 +1,90 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as I } from "../chunks/utils-kyb5nny4y41y7hd8.js";
|
|
3
|
-
import { InputGroup as
|
|
4
|
-
import { a as
|
|
5
|
-
import { Dialog as
|
|
3
|
+
import { InputGroup as Ae, InputGroupAddon as $e } from "./input-group.js";
|
|
4
|
+
import { a as De, i as Ne, l as F, n as Pe, o as Me, u as O } from "../chunks/dist-fahbq1psobj0ox6s.js";
|
|
5
|
+
import { Dialog as je, DialogContent as Le, DialogDescription as Ve, DialogHeader as Fe, DialogTitle as Oe } from "./dialog.js";
|
|
6
6
|
import { jsx as w, jsxs as W } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
7
|
+
import { HugeiconsIcon as he } from "@hugeicons/react";
|
|
8
|
+
import { CheckIcon as ze, SearchIcon as Ke } from "@hugeicons/core-free-icons";
|
|
8
9
|
import * as l from "react";
|
|
9
10
|
import "react-dom";
|
|
10
|
-
var pe = 1,
|
|
11
|
-
function le(e, t, r, i,
|
|
12
|
-
if (
|
|
13
|
-
var m = `${
|
|
11
|
+
var pe = 1, Te = 0.9, qe = 0.8, We = 0.17, te = 0.1, re = 0.999, _e = 0.9999, Be = 0.99, Ge = /[\\\/_+.#"@\[\(\{&]/, He = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, be = /[\s-]/g;
|
|
12
|
+
function le(e, t, r, i, o, a, d) {
|
|
13
|
+
if (a === t.length) return o === e.length ? pe : Be;
|
|
14
|
+
var m = `${o},${a}`;
|
|
14
15
|
if (d[m] !== void 0) return d[m];
|
|
15
|
-
for (var g = i.charAt(
|
|
16
|
+
for (var g = i.charAt(a), c = r.indexOf(g, o), p = 0, h, S, x, R; c >= 0; ) h = le(e, t, r, i, c + 1, a + 1, d), h > p && (c === o ? h *= pe : Ge.test(e.charAt(c - 1)) ? (h *= qe, x = e.slice(o, c - 1).match(He), x && o > 0 && (h *= Math.pow(re, x.length))) : Ue.test(e.charAt(c - 1)) ? (h *= Te, R = e.slice(o, c - 1).match(be), R && o > 0 && (h *= Math.pow(re, R.length))) : (h *= We, o > 0 && (h *= Math.pow(re, c - o))), e.charAt(c) !== t.charAt(a) && (h *= _e)), (h < te && r.charAt(c - 1) === i.charAt(a + 1) || i.charAt(a + 1) === i.charAt(a) && r.charAt(c - 1) !== i.charAt(a)) && (S = le(e, t, r, i, c + 1, a + 2, d), S * te > h && (h = S * te)), h > p && (p = h), c = r.indexOf(g, c + 1);
|
|
16
17
|
return d[m] = p, p;
|
|
17
18
|
}
|
|
18
19
|
function ve(e) {
|
|
19
|
-
return e.toLowerCase().replace(
|
|
20
|
+
return e.toLowerCase().replace(be, " ");
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function Ye(e, t, r) {
|
|
22
23
|
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, le(e, t, ve(e), ve(t), 0, 0, {});
|
|
23
24
|
}
|
|
24
|
-
var
|
|
25
|
-
function
|
|
25
|
+
var Ze = /* @__PURE__ */ Symbol.for("react.lazy"), _ = l[" use ".trim().toString()];
|
|
26
|
+
function Je(e) {
|
|
26
27
|
return typeof e == "object" && e !== null && "then" in e;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof ===
|
|
29
|
+
function ye(e) {
|
|
30
|
+
return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === Ze && "_payload" in e && Je(e._payload);
|
|
30
31
|
}
|
|
31
32
|
// @__NO_SIDE_EFFECTS__
|
|
32
|
-
function
|
|
33
|
-
const t = /* @__PURE__ */
|
|
34
|
-
let { children:
|
|
35
|
-
|
|
36
|
-
const m = l.Children.toArray(
|
|
33
|
+
function Xe(e) {
|
|
34
|
+
const t = /* @__PURE__ */ Qe(e), r = l.forwardRef((i, o) => {
|
|
35
|
+
let { children: a, ...d } = i;
|
|
36
|
+
ye(a) && typeof _ == "function" && (a = _(a._payload));
|
|
37
|
+
const m = l.Children.toArray(a), g = m.find(tt);
|
|
37
38
|
if (g) {
|
|
38
39
|
const c = g.props.children, p = m.map((h) => h === g ? l.Children.count(c) > 1 ? l.Children.only(null) : l.isValidElement(c) ? c.props.children : null : h);
|
|
39
40
|
return /* @__PURE__ */ w(t, {
|
|
40
41
|
...d,
|
|
41
|
-
ref:
|
|
42
|
+
ref: o,
|
|
42
43
|
children: l.isValidElement(c) ? l.cloneElement(c, void 0, p) : null
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
return /* @__PURE__ */ w(t, {
|
|
46
47
|
...d,
|
|
47
|
-
ref:
|
|
48
|
-
children:
|
|
48
|
+
ref: o,
|
|
49
|
+
children: a
|
|
49
50
|
});
|
|
50
51
|
});
|
|
51
52
|
return r.displayName = `${e}.Slot`, r;
|
|
52
53
|
}
|
|
53
54
|
// @__NO_SIDE_EFFECTS__
|
|
54
|
-
function
|
|
55
|
+
function Qe(e) {
|
|
55
56
|
const t = l.forwardRef((r, i) => {
|
|
56
|
-
let { children:
|
|
57
|
-
if (
|
|
58
|
-
const d =
|
|
59
|
-
return
|
|
57
|
+
let { children: o, ...a } = r;
|
|
58
|
+
if (ye(o) && typeof _ == "function" && (o = _(o._payload)), l.isValidElement(o)) {
|
|
59
|
+
const d = nt(o), m = rt(a, o.props);
|
|
60
|
+
return o.type !== l.Fragment && (m.ref = i ? O(i, d) : d), l.cloneElement(o, m);
|
|
60
61
|
}
|
|
61
|
-
return l.Children.count(
|
|
62
|
+
return l.Children.count(o) > 1 ? l.Children.only(null) : null;
|
|
62
63
|
});
|
|
63
64
|
return t.displayName = `${e}.SlotClone`, t;
|
|
64
65
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
67
|
-
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId ===
|
|
66
|
+
var et = /* @__PURE__ */ Symbol("radix.slottable");
|
|
67
|
+
function tt(e) {
|
|
68
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === et;
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function rt(e, t) {
|
|
70
71
|
const r = { ...t };
|
|
71
72
|
for (const i in t) {
|
|
72
|
-
const
|
|
73
|
-
/^on[A-Z]/.test(i) ?
|
|
74
|
-
const m =
|
|
75
|
-
return
|
|
76
|
-
} :
|
|
77
|
-
...
|
|
78
|
-
...
|
|
79
|
-
} : i === "className" && (r[i] = [
|
|
73
|
+
const o = e[i], a = t[i];
|
|
74
|
+
/^on[A-Z]/.test(i) ? o && a ? r[i] = (...d) => {
|
|
75
|
+
const m = a(...d);
|
|
76
|
+
return o(...d), m;
|
|
77
|
+
} : o && (r[i] = o) : i === "style" ? r[i] = {
|
|
78
|
+
...o,
|
|
79
|
+
...a
|
|
80
|
+
} : i === "className" && (r[i] = [o, a].filter(Boolean).join(" "));
|
|
80
81
|
}
|
|
81
82
|
return {
|
|
82
83
|
...e,
|
|
83
84
|
...r
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function nt(e) {
|
|
87
88
|
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
88
89
|
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
89
90
|
}
|
|
@@ -106,18 +107,18 @@ var $ = [
|
|
|
106
107
|
"svg",
|
|
107
108
|
"ul"
|
|
108
109
|
].reduce((e, t) => {
|
|
109
|
-
const r = /* @__PURE__ */
|
|
110
|
-
const { asChild: d, ...m } =
|
|
110
|
+
const r = /* @__PURE__ */ Xe(`Primitive.${t}`), i = l.forwardRef((o, a) => {
|
|
111
|
+
const { asChild: d, ...m } = o, g = d ? r : t;
|
|
111
112
|
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ w(g, {
|
|
112
113
|
...m,
|
|
113
|
-
ref:
|
|
114
|
+
ref: a
|
|
114
115
|
});
|
|
115
116
|
});
|
|
116
117
|
return i.displayName = `Primitive.${t}`, {
|
|
117
118
|
...e,
|
|
118
119
|
[t]: i
|
|
119
120
|
};
|
|
120
|
-
}, {}), K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]',
|
|
121
|
+
}, {}), K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', lt = '[cmdk-group-heading=""]', we = '[cmdk-item=""]', ge = `${we}:not([aria-disabled="true"])`, oe = "cmdk-item-select", L = "data-value", ot = (e, t, r) => Ye(e, t, r), xe = l.createContext(void 0), T = () => l.useContext(xe), Ee = l.createContext(void 0), ae = () => l.useContext(Ee), Ce = l.createContext(void 0), ke = l.forwardRef((e, t) => {
|
|
121
122
|
let r = V(() => {
|
|
122
123
|
var n, s;
|
|
123
124
|
return {
|
|
@@ -130,7 +131,7 @@ var $ = [
|
|
|
130
131
|
groups: /* @__PURE__ */ new Set()
|
|
131
132
|
}
|
|
132
133
|
};
|
|
133
|
-
}), i = V(() => /* @__PURE__ */ new Set()),
|
|
134
|
+
}), i = V(() => /* @__PURE__ */ new Set()), o = V(() => /* @__PURE__ */ new Map()), a = V(() => /* @__PURE__ */ new Map()), d = V(() => /* @__PURE__ */ new Set()), m = Se(e), { label: g, children: c, value: p, onValueChange: h, filter: S, shouldFilter: x, loop: R, disablePointerSelection: G = !1, vimBindings: D = !0, ...q } = e, H = F(), ie = F(), U = F(), N = l.useRef(null), y = gt();
|
|
134
135
|
P(() => {
|
|
135
136
|
if (p !== void 0) {
|
|
136
137
|
let n = p.trim();
|
|
@@ -169,24 +170,24 @@ var $ = [
|
|
|
169
170
|
}), []), Y = l.useMemo(() => ({
|
|
170
171
|
value: (n, s, f) => {
|
|
171
172
|
var u;
|
|
172
|
-
s !== ((u =
|
|
173
|
+
s !== ((u = a.current.get(n)) == null ? void 0 : u.value) && (a.current.set(n, {
|
|
173
174
|
value: s,
|
|
174
175
|
keywords: f
|
|
175
176
|
}), r.current.filtered.items.set(n, ue(s, f)), y(2, () => {
|
|
176
177
|
Z(), E.emit();
|
|
177
178
|
}));
|
|
178
179
|
},
|
|
179
|
-
item: (n, s) => (i.current.add(n), s && (
|
|
180
|
+
item: (n, s) => (i.current.add(n), s && (o.current.has(s) ? o.current.get(s).add(n) : o.current.set(s, /* @__PURE__ */ new Set([n]))), y(3, () => {
|
|
180
181
|
X(), Z(), r.current.value || J(), E.emit();
|
|
181
182
|
}), () => {
|
|
182
|
-
|
|
183
|
+
a.current.delete(n), i.current.delete(n), r.current.filtered.items.delete(n);
|
|
183
184
|
let f = j();
|
|
184
185
|
y(4, () => {
|
|
185
186
|
X(), f?.getAttribute("id") === n && J(), E.emit();
|
|
186
187
|
});
|
|
187
188
|
}),
|
|
188
|
-
group: (n) => (
|
|
189
|
-
|
|
189
|
+
group: (n) => (o.current.has(n) || o.current.set(n, /* @__PURE__ */ new Set()), () => {
|
|
190
|
+
a.current.delete(n), o.current.delete(n);
|
|
190
191
|
}),
|
|
191
192
|
filter: () => m.current.shouldFilter,
|
|
192
193
|
label: g || e["aria-label"],
|
|
@@ -198,14 +199,14 @@ var $ = [
|
|
|
198
199
|
}), []);
|
|
199
200
|
function ue(n, s) {
|
|
200
201
|
var f, u;
|
|
201
|
-
let v = (u = (f = m.current) == null ? void 0 : f.filter) != null ? u :
|
|
202
|
+
let v = (u = (f = m.current) == null ? void 0 : f.filter) != null ? u : ot;
|
|
202
203
|
return n ? v(n, r.current.search, s) : 0;
|
|
203
204
|
}
|
|
204
205
|
function Z() {
|
|
205
206
|
if (!r.current.search || m.current.shouldFilter === !1) return;
|
|
206
207
|
let n = r.current.filtered.items, s = [];
|
|
207
208
|
r.current.filtered.groups.forEach((u) => {
|
|
208
|
-
let v =
|
|
209
|
+
let v = o.current.get(u), b = 0;
|
|
209
210
|
v.forEach((C) => {
|
|
210
211
|
let k = n.get(C);
|
|
211
212
|
b = Math.max(k, b);
|
|
@@ -214,8 +215,8 @@ var $ = [
|
|
|
214
215
|
let f = N.current;
|
|
215
216
|
z().sort((u, v) => {
|
|
216
217
|
var b, C;
|
|
217
|
-
let k = u.getAttribute("id"),
|
|
218
|
-
return ((b = n.get(
|
|
218
|
+
let k = u.getAttribute("id"), Re = v.getAttribute("id");
|
|
219
|
+
return ((b = n.get(Re)) != null ? b : 0) - ((C = n.get(k)) != null ? C : 0);
|
|
219
220
|
}).forEach((u) => {
|
|
220
221
|
let v = u.closest(ne);
|
|
221
222
|
v ? v.appendChild(u.parentElement === v ? u : u.closest(`${ne} > *`)) : f.appendChild(u.parentElement === f ? u : u.closest(`${ne} > *`));
|
|
@@ -238,10 +239,10 @@ var $ = [
|
|
|
238
239
|
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
239
240
|
let v = 0;
|
|
240
241
|
for (let b of i.current) {
|
|
241
|
-
let C = ue((s = (n =
|
|
242
|
+
let C = ue((s = (n = a.current.get(b)) == null ? void 0 : n.value) != null ? s : "", (u = (f = a.current.get(b)) == null ? void 0 : f.keywords) != null ? u : []);
|
|
242
243
|
r.current.filtered.items.set(b, C), C > 0 && v++;
|
|
243
244
|
}
|
|
244
|
-
for (let [b, C] of
|
|
245
|
+
for (let [b, C] of o.current) for (let k of C) if (r.current.filtered.items.get(k) > 0) {
|
|
245
246
|
r.current.filtered.groups.add(b);
|
|
246
247
|
break;
|
|
247
248
|
}
|
|
@@ -250,11 +251,11 @@ var $ = [
|
|
|
250
251
|
function ce() {
|
|
251
252
|
var n, s, f;
|
|
252
253
|
let u = j();
|
|
253
|
-
u && (((n = u.parentElement) == null ? void 0 : n.firstChild) === u && ((f = (s = u.closest(K)) == null ? void 0 : s.querySelector(
|
|
254
|
+
u && (((n = u.parentElement) == null ? void 0 : n.firstChild) === u && ((f = (s = u.closest(K)) == null ? void 0 : s.querySelector(lt)) == null || f.scrollIntoView({ block: "nearest" })), u.scrollIntoView({ block: "nearest" }));
|
|
254
255
|
}
|
|
255
256
|
function j() {
|
|
256
257
|
var n;
|
|
257
|
-
return (n = N.current) == null ? void 0 : n.querySelector(`${
|
|
258
|
+
return (n = N.current) == null ? void 0 : n.querySelector(`${we}[aria-selected="true"]`);
|
|
258
259
|
}
|
|
259
260
|
function z() {
|
|
260
261
|
var n;
|
|
@@ -271,7 +272,7 @@ var $ = [
|
|
|
271
272
|
}
|
|
272
273
|
function de(n) {
|
|
273
274
|
let s = j(), f = s?.closest(K), u;
|
|
274
|
-
for (; f && !u; ) f = n > 0 ?
|
|
275
|
+
for (; f && !u; ) f = n > 0 ? pt(f, K) : vt(f, K), u = f?.querySelector(ge);
|
|
275
276
|
u ? E.setState("value", u.getAttribute(L)) : ee(n);
|
|
276
277
|
}
|
|
277
278
|
let se = () => Q(z().length - 1), me = (n) => {
|
|
@@ -313,7 +314,7 @@ var $ = [
|
|
|
313
314
|
n.preventDefault();
|
|
314
315
|
let u = j();
|
|
315
316
|
if (u) {
|
|
316
|
-
let v = new Event(
|
|
317
|
+
let v = new Event(oe);
|
|
317
318
|
u.dispatchEvent(v);
|
|
318
319
|
}
|
|
319
320
|
}
|
|
@@ -323,22 +324,22 @@ var $ = [
|
|
|
323
324
|
"cmdk-label": "",
|
|
324
325
|
htmlFor: Y.inputId,
|
|
325
326
|
id: Y.labelId,
|
|
326
|
-
style:
|
|
327
|
-
}, g), B(e, (n) => l.createElement(
|
|
327
|
+
style: bt
|
|
328
|
+
}, g), B(e, (n) => l.createElement(Ee.Provider, { value: E }, l.createElement(xe.Provider, { value: Y }, n))));
|
|
328
329
|
}), at = l.forwardRef((e, t) => {
|
|
329
330
|
var r, i;
|
|
330
|
-
let
|
|
331
|
+
let o = F(), a = l.useRef(null), d = l.useContext(Ce), m = T(), g = Se(e), c = (i = (r = g.current) == null ? void 0 : r.forceMount) != null ? i : d?.forceMount;
|
|
331
332
|
P(() => {
|
|
332
|
-
if (!c) return m.item(
|
|
333
|
+
if (!c) return m.item(o, d?.id);
|
|
333
334
|
}, [c]);
|
|
334
|
-
let p =
|
|
335
|
+
let p = Ie(o, a, [
|
|
335
336
|
e.value,
|
|
336
337
|
e.children,
|
|
337
|
-
|
|
338
|
-
], e.keywords), h =
|
|
338
|
+
a
|
|
339
|
+
], e.keywords), h = ae(), S = A((y) => y.value && y.value === p.current), x = A((y) => c || m.filter() === !1 ? !0 : y.search ? y.filtered.items.get(o) > 0 : !0);
|
|
339
340
|
l.useEffect(() => {
|
|
340
|
-
let y =
|
|
341
|
-
if (!(!y || e.disabled)) return y.addEventListener(
|
|
341
|
+
let y = a.current;
|
|
342
|
+
if (!(!y || e.disabled)) return y.addEventListener(oe, R), () => y.removeEventListener(oe, R);
|
|
342
343
|
}, [
|
|
343
344
|
x,
|
|
344
345
|
e.onSelect,
|
|
@@ -354,9 +355,9 @@ var $ = [
|
|
|
354
355
|
if (!x) return null;
|
|
355
356
|
let { disabled: D, value: q, onSelect: H, forceMount: ie, keywords: U, ...N } = e;
|
|
356
357
|
return l.createElement($.div, {
|
|
357
|
-
ref: O(
|
|
358
|
+
ref: O(a, t),
|
|
358
359
|
...N,
|
|
359
|
-
id:
|
|
360
|
+
id: o,
|
|
360
361
|
"cmdk-item": "",
|
|
361
362
|
role: "option",
|
|
362
363
|
"aria-disabled": !!D,
|
|
@@ -366,20 +367,20 @@ var $ = [
|
|
|
366
367
|
onPointerMove: D || m.getDisablePointerSelection() ? void 0 : G,
|
|
367
368
|
onClick: D ? void 0 : R
|
|
368
369
|
}, e.children);
|
|
369
|
-
}),
|
|
370
|
-
let { heading: r, children: i, forceMount:
|
|
371
|
-
P(() => p.group(d), []),
|
|
370
|
+
}), it = l.forwardRef((e, t) => {
|
|
371
|
+
let { heading: r, children: i, forceMount: o, ...a } = e, d = F(), m = l.useRef(null), g = l.useRef(null), c = F(), p = T(), h = A((x) => o || p.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(d) : !0);
|
|
372
|
+
P(() => p.group(d), []), Ie(d, m, [
|
|
372
373
|
e.value,
|
|
373
374
|
e.heading,
|
|
374
375
|
g
|
|
375
376
|
]);
|
|
376
377
|
let S = l.useMemo(() => ({
|
|
377
378
|
id: d,
|
|
378
|
-
forceMount:
|
|
379
|
-
}), [
|
|
379
|
+
forceMount: o
|
|
380
|
+
}), [o]);
|
|
380
381
|
return l.createElement($.div, {
|
|
381
382
|
ref: O(m, t),
|
|
382
|
-
...
|
|
383
|
+
...a,
|
|
383
384
|
"cmdk-group": "",
|
|
384
385
|
role: "presentation",
|
|
385
386
|
hidden: h ? void 0 : !0
|
|
@@ -392,19 +393,19 @@ var $ = [
|
|
|
392
393
|
"cmdk-group-items": "",
|
|
393
394
|
role: "group",
|
|
394
395
|
"aria-labelledby": r ? c : void 0
|
|
395
|
-
}, l.createElement(
|
|
396
|
-
}),
|
|
397
|
-
let { alwaysRender: r, ...i } = e,
|
|
398
|
-
return !r && !
|
|
399
|
-
ref: O(
|
|
396
|
+
}, l.createElement(Ce.Provider, { value: S }, x))));
|
|
397
|
+
}), ut = l.forwardRef((e, t) => {
|
|
398
|
+
let { alwaysRender: r, ...i } = e, o = l.useRef(null), a = A((d) => !d.search);
|
|
399
|
+
return !r && !a ? null : l.createElement($.div, {
|
|
400
|
+
ref: O(o, t),
|
|
400
401
|
...i,
|
|
401
402
|
"cmdk-separator": "",
|
|
402
403
|
role: "separator"
|
|
403
404
|
});
|
|
404
|
-
}),
|
|
405
|
-
let { onValueChange: r, ...i } = e,
|
|
405
|
+
}), ct = l.forwardRef((e, t) => {
|
|
406
|
+
let { onValueChange: r, ...i } = e, o = e.value != null, a = ae(), d = A((c) => c.search), m = A((c) => c.selectedItemId), g = T();
|
|
406
407
|
return l.useEffect(() => {
|
|
407
|
-
e.value != null &&
|
|
408
|
+
e.value != null && a.setState("search", e.value);
|
|
408
409
|
}, [e.value]), l.createElement($.input, {
|
|
409
410
|
ref: t,
|
|
410
411
|
...i,
|
|
@@ -420,16 +421,16 @@ var $ = [
|
|
|
420
421
|
"aria-activedescendant": m,
|
|
421
422
|
id: g.inputId,
|
|
422
423
|
type: "text",
|
|
423
|
-
value:
|
|
424
|
+
value: o ? e.value : d,
|
|
424
425
|
onChange: (c) => {
|
|
425
|
-
|
|
426
|
+
o || a.setState("search", c.target.value), r?.(c.target.value);
|
|
426
427
|
}
|
|
427
428
|
});
|
|
428
|
-
}),
|
|
429
|
-
let { children: r, label: i = "Suggestions", ...
|
|
429
|
+
}), dt = l.forwardRef((e, t) => {
|
|
430
|
+
let { children: r, label: i = "Suggestions", ...o } = e, a = l.useRef(null), d = l.useRef(null), m = A((c) => c.selectedItemId), g = T();
|
|
430
431
|
return l.useEffect(() => {
|
|
431
|
-
if (d.current &&
|
|
432
|
-
let c = d.current, p =
|
|
432
|
+
if (d.current && a.current) {
|
|
433
|
+
let c = d.current, p = a.current, h, S = new ResizeObserver(() => {
|
|
433
434
|
h = requestAnimationFrame(() => {
|
|
434
435
|
let x = c.offsetHeight;
|
|
435
436
|
p.style.setProperty("--cmdk-list-height", x.toFixed(1) + "px");
|
|
@@ -440,8 +441,8 @@ var $ = [
|
|
|
440
441
|
};
|
|
441
442
|
}
|
|
442
443
|
}, []), l.createElement($.div, {
|
|
443
|
-
ref: O(
|
|
444
|
-
...
|
|
444
|
+
ref: O(a, t),
|
|
445
|
+
...o,
|
|
445
446
|
"cmdk-list": "",
|
|
446
447
|
role: "listbox",
|
|
447
448
|
tabIndex: -1,
|
|
@@ -452,64 +453,64 @@ var $ = [
|
|
|
452
453
|
ref: O(d, g.listInnerRef),
|
|
453
454
|
"cmdk-list-sizer": ""
|
|
454
455
|
}, c)));
|
|
455
|
-
}),
|
|
456
|
-
let { open: r, onOpenChange: i, overlayClassName:
|
|
457
|
-
return l.createElement(
|
|
456
|
+
}), st = l.forwardRef((e, t) => {
|
|
457
|
+
let { open: r, onOpenChange: i, overlayClassName: o, contentClassName: a, container: d, ...m } = e;
|
|
458
|
+
return l.createElement(Me, {
|
|
458
459
|
open: r,
|
|
459
460
|
onOpenChange: i
|
|
460
|
-
}, l.createElement(
|
|
461
|
+
}, l.createElement(De, { container: d }, l.createElement(Ne, {
|
|
461
462
|
"cmdk-overlay": "",
|
|
462
|
-
className:
|
|
463
|
-
}), l.createElement(
|
|
463
|
+
className: o
|
|
464
|
+
}), l.createElement(Pe, {
|
|
464
465
|
"aria-label": e.label,
|
|
465
466
|
"cmdk-dialog": "",
|
|
466
|
-
className:
|
|
467
|
-
}, l.createElement(
|
|
467
|
+
className: a
|
|
468
|
+
}, l.createElement(ke, {
|
|
468
469
|
ref: t,
|
|
469
470
|
...m
|
|
470
471
|
}))));
|
|
471
|
-
}),
|
|
472
|
+
}), mt = l.forwardRef((e, t) => A((r) => r.filtered.count === 0) ? l.createElement($.div, {
|
|
472
473
|
ref: t,
|
|
473
474
|
...e,
|
|
474
475
|
"cmdk-empty": "",
|
|
475
476
|
role: "presentation"
|
|
476
|
-
}) : null),
|
|
477
|
-
let { progress: r, children: i, label:
|
|
477
|
+
}) : null), ft = l.forwardRef((e, t) => {
|
|
478
|
+
let { progress: r, children: i, label: o = "Loading...", ...a } = e;
|
|
478
479
|
return l.createElement($.div, {
|
|
479
480
|
ref: t,
|
|
480
|
-
...
|
|
481
|
+
...a,
|
|
481
482
|
"cmdk-loading": "",
|
|
482
483
|
role: "progressbar",
|
|
483
484
|
"aria-valuenow": r,
|
|
484
485
|
"aria-valuemin": 0,
|
|
485
486
|
"aria-valuemax": 100,
|
|
486
|
-
"aria-label":
|
|
487
|
+
"aria-label": o
|
|
487
488
|
}, B(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
|
|
488
|
-
}), M = Object.assign(
|
|
489
|
-
List:
|
|
489
|
+
}), M = Object.assign(ke, {
|
|
490
|
+
List: dt,
|
|
490
491
|
Item: at,
|
|
491
|
-
Input:
|
|
492
|
-
Group:
|
|
493
|
-
Separator:
|
|
494
|
-
Dialog:
|
|
495
|
-
Empty:
|
|
496
|
-
Loading:
|
|
492
|
+
Input: ct,
|
|
493
|
+
Group: it,
|
|
494
|
+
Separator: ut,
|
|
495
|
+
Dialog: st,
|
|
496
|
+
Empty: mt,
|
|
497
|
+
Loading: ft
|
|
497
498
|
});
|
|
498
|
-
function
|
|
499
|
+
function pt(e, t) {
|
|
499
500
|
let r = e.nextElementSibling;
|
|
500
501
|
for (; r; ) {
|
|
501
502
|
if (r.matches(t)) return r;
|
|
502
503
|
r = r.nextElementSibling;
|
|
503
504
|
}
|
|
504
505
|
}
|
|
505
|
-
function
|
|
506
|
+
function vt(e, t) {
|
|
506
507
|
let r = e.previousElementSibling;
|
|
507
508
|
for (; r; ) {
|
|
508
509
|
if (r.matches(t)) return r;
|
|
509
510
|
r = r.previousElementSibling;
|
|
510
511
|
}
|
|
511
512
|
}
|
|
512
|
-
function
|
|
513
|
+
function Se(e) {
|
|
513
514
|
let t = l.useRef(e);
|
|
514
515
|
return P(() => {
|
|
515
516
|
t.current = e;
|
|
@@ -521,39 +522,39 @@ function V(e) {
|
|
|
521
522
|
return t.current === void 0 && (t.current = e()), t;
|
|
522
523
|
}
|
|
523
524
|
function A(e) {
|
|
524
|
-
let t =
|
|
525
|
+
let t = ae(), r = () => e(t.snapshot());
|
|
525
526
|
return l.useSyncExternalStore(t.subscribe, r, r);
|
|
526
527
|
}
|
|
527
|
-
function
|
|
528
|
-
let
|
|
528
|
+
function Ie(e, t, r, i = []) {
|
|
529
|
+
let o = l.useRef(), a = T();
|
|
529
530
|
return P(() => {
|
|
530
531
|
var d;
|
|
531
532
|
let m = (() => {
|
|
532
533
|
var c;
|
|
533
534
|
for (let p of r) {
|
|
534
535
|
if (typeof p == "string") return p.trim();
|
|
535
|
-
if (typeof p == "object" && "current" in p) return p.current ? (c = p.current.textContent) == null ? void 0 : c.trim() :
|
|
536
|
+
if (typeof p == "object" && "current" in p) return p.current ? (c = p.current.textContent) == null ? void 0 : c.trim() : o.current;
|
|
536
537
|
}
|
|
537
538
|
})(), g = i.map((c) => c.trim());
|
|
538
|
-
|
|
539
|
-
}),
|
|
539
|
+
a.value(e, m, g), (d = t.current) == null || d.setAttribute(L, m), o.current = m;
|
|
540
|
+
}), o;
|
|
540
541
|
}
|
|
541
|
-
var
|
|
542
|
+
var gt = () => {
|
|
542
543
|
let [e, t] = l.useState(), r = V(() => /* @__PURE__ */ new Map());
|
|
543
544
|
return P(() => {
|
|
544
545
|
r.current.forEach((i) => i()), r.current = /* @__PURE__ */ new Map();
|
|
545
|
-
}, [e]), (i,
|
|
546
|
-
r.current.set(i,
|
|
546
|
+
}, [e]), (i, o) => {
|
|
547
|
+
r.current.set(i, o), t({});
|
|
547
548
|
};
|
|
548
549
|
};
|
|
549
|
-
function
|
|
550
|
+
function ht(e) {
|
|
550
551
|
let t = e.type;
|
|
551
552
|
return typeof t == "function" ? t(e.props) : "render" in t ? t.render(e.props) : e;
|
|
552
553
|
}
|
|
553
554
|
function B({ asChild: e, children: t }, r) {
|
|
554
|
-
return e && l.isValidElement(t) ? l.cloneElement(
|
|
555
|
+
return e && l.isValidElement(t) ? l.cloneElement(ht(t), { ref: t.ref }, r(t.props.children)) : r(t);
|
|
555
556
|
}
|
|
556
|
-
var
|
|
557
|
+
var bt = {
|
|
557
558
|
position: "absolute",
|
|
558
559
|
width: "1px",
|
|
559
560
|
height: "1px",
|
|
@@ -564,77 +565,83 @@ var ht = {
|
|
|
564
565
|
whiteSpace: "nowrap",
|
|
565
566
|
borderWidth: "0"
|
|
566
567
|
};
|
|
567
|
-
function
|
|
568
|
+
function At({ className: e, ...t }) {
|
|
568
569
|
return /* @__PURE__ */ w(M, {
|
|
569
570
|
"data-slot": "command",
|
|
570
571
|
className: I("flex size-full flex-col overflow-hidden rounded-4xl bg-popover p-1 text-popover-foreground", e),
|
|
571
572
|
...t
|
|
572
573
|
});
|
|
573
574
|
}
|
|
574
|
-
function
|
|
575
|
-
return /* @__PURE__ */ W(
|
|
576
|
-
...
|
|
577
|
-
children: [/* @__PURE__ */ W(
|
|
575
|
+
function $t({ title: e = "Command Palette", description: t = "Search for a command to run...", children: r, className: i, showCloseButton: o = !1, ...a }) {
|
|
576
|
+
return /* @__PURE__ */ W(je, {
|
|
577
|
+
...a,
|
|
578
|
+
children: [/* @__PURE__ */ W(Fe, {
|
|
578
579
|
className: "sr-only",
|
|
579
|
-
children: [/* @__PURE__ */ w(
|
|
580
|
-
}), /* @__PURE__ */ w(
|
|
580
|
+
children: [/* @__PURE__ */ w(Oe, { children: e }), /* @__PURE__ */ w(Ve, { children: t })]
|
|
581
|
+
}), /* @__PURE__ */ w(Le, {
|
|
581
582
|
className: I("top-1/3 translate-y-0 overflow-hidden rounded-4xl! p-0", i),
|
|
582
|
-
showCloseButton:
|
|
583
|
+
showCloseButton: o,
|
|
583
584
|
children: r
|
|
584
585
|
})]
|
|
585
586
|
});
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
+
function Dt({ className: e, ...t }) {
|
|
588
589
|
return /* @__PURE__ */ w("div", {
|
|
589
590
|
"data-slot": "command-input-wrapper",
|
|
590
591
|
className: "p-1 pb-0",
|
|
591
|
-
children: /* @__PURE__ */ W(
|
|
592
|
-
className: "h-9 bg-
|
|
592
|
+
children: /* @__PURE__ */ W(Ae, {
|
|
593
|
+
className: "h-9 bg-border/30",
|
|
593
594
|
children: [/* @__PURE__ */ w(M.Input, {
|
|
594
595
|
"data-slot": "command-input",
|
|
595
596
|
className: I("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
596
597
|
...t
|
|
597
|
-
}), /* @__PURE__ */ w(
|
|
598
|
+
}), /* @__PURE__ */ w($e, { children: /* @__PURE__ */ w(he, {
|
|
599
|
+
icon: Ke,
|
|
600
|
+
className: "size-4 shrink-0 opacity-50"
|
|
601
|
+
}) })]
|
|
598
602
|
})
|
|
599
603
|
});
|
|
600
604
|
}
|
|
601
|
-
function
|
|
605
|
+
function Nt({ className: e, ...t }) {
|
|
602
606
|
return /* @__PURE__ */ w(M.List, {
|
|
603
607
|
"data-slot": "command-list",
|
|
604
608
|
className: I("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", e),
|
|
605
609
|
...t
|
|
606
610
|
});
|
|
607
611
|
}
|
|
608
|
-
function
|
|
612
|
+
function Pt({ className: e, ...t }) {
|
|
609
613
|
return /* @__PURE__ */ w(M.Empty, {
|
|
610
614
|
"data-slot": "command-empty",
|
|
611
615
|
className: I("py-6 text-center text-sm", e),
|
|
612
616
|
...t
|
|
613
617
|
});
|
|
614
618
|
}
|
|
615
|
-
function
|
|
619
|
+
function Mt({ className: e, ...t }) {
|
|
616
620
|
return /* @__PURE__ */ w(M.Group, {
|
|
617
621
|
"data-slot": "command-group",
|
|
618
622
|
className: I("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-3 **:[[cmdk-group-heading]]:py-2 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", e),
|
|
619
623
|
...t
|
|
620
624
|
});
|
|
621
625
|
}
|
|
622
|
-
function
|
|
626
|
+
function jt({ className: e, ...t }) {
|
|
623
627
|
return /* @__PURE__ */ w(M.Separator, {
|
|
624
628
|
"data-slot": "command-separator",
|
|
625
629
|
className: I("my-1 h-px bg-border/50", e),
|
|
626
630
|
...t
|
|
627
631
|
});
|
|
628
632
|
}
|
|
629
|
-
function
|
|
633
|
+
function Lt({ className: e, children: t, ...r }) {
|
|
630
634
|
return /* @__PURE__ */ W(M.Item, {
|
|
631
635
|
"data-slot": "command-item",
|
|
632
|
-
className: I("group/command-item relative flex cursor-default items-center gap-2 rounded-lg px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-2xl data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", e),
|
|
636
|
+
className: I("group/command-item relative flex cursor-default items-center gap-2 rounded-lg px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-2xl data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-surface-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", e),
|
|
633
637
|
...r,
|
|
634
|
-
children: [t, /* @__PURE__ */ w(
|
|
638
|
+
children: [t, /* @__PURE__ */ w(he, {
|
|
639
|
+
icon: ze,
|
|
640
|
+
className: "ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"
|
|
641
|
+
})]
|
|
635
642
|
});
|
|
636
643
|
}
|
|
637
|
-
function
|
|
644
|
+
function Vt({ className: e, ...t }) {
|
|
638
645
|
return /* @__PURE__ */ w("span", {
|
|
639
646
|
"data-slot": "command-shortcut",
|
|
640
647
|
className: I("ms-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", e),
|
|
@@ -642,15 +649,15 @@ function jt({ className: e, ...t }) {
|
|
|
642
649
|
});
|
|
643
650
|
}
|
|
644
651
|
export {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
652
|
+
At as Command,
|
|
653
|
+
$t as CommandDialog,
|
|
654
|
+
Pt as CommandEmpty,
|
|
655
|
+
Mt as CommandGroup,
|
|
656
|
+
Dt as CommandInput,
|
|
657
|
+
Lt as CommandItem,
|
|
658
|
+
Nt as CommandList,
|
|
659
|
+
jt as CommandSeparator,
|
|
660
|
+
Vt as CommandShortcut
|
|
654
661
|
};
|
|
655
662
|
|
|
656
663
|
//# sourceMappingURL=command.js.map
|