@enya-learning/nova 0.5.0 → 0.7.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/chunks/dist-i6l6wqicjhnap81o.js +37 -0
- package/dist/chunks/{dist-o8x0ip0z71xkr2oh.js.map → dist-i6l6wqicjhnap81o.js.map} +1 -1
- package/dist/chunks/utils-chr77evsz8gs6wle.js +10 -0
- package/dist/chunks/{utils-kyb5nny4y41y7hd8.js.map → utils-chr77evsz8gs6wle.js.map} +1 -1
- package/dist/chunks/{vendor-styling-eeiy57tyznmxsfky.js → vendor-styling-bq164a52kub0yzw7.js} +84 -81
- package/dist/chunks/{vendor-styling-eeiy57tyznmxsfky.js.map → vendor-styling-bq164a52kub0yzw7.js.map} +1 -1
- package/dist/chunks/{vendor-utils-egkaeebaqpft6cxj.js → vendor-utils-dzqqqwem43r86lbz.js} +48 -48
- package/dist/chunks/{vendor-utils-egkaeebaqpft6cxj.js.map → vendor-utils-dzqqqwem43r86lbz.js.map} +1 -1
- package/dist/components/accordion.js +24 -21
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +3 -3
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.js +2 -2
- package/dist/components/aspect-ratio.js +1 -1
- package/dist/components/avatar.js +24 -24
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +13 -13
- 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 +29 -25
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.js +4 -4
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.js +12 -12
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +540 -535
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +93 -85
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/chart.js +1462 -1457
- 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 +67 -54
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.js +104 -97
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +41 -37
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/dialog.js +26 -25
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +3 -3
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +40 -36
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.js +3 -3
- package/dist/components/empty.js.map +1 -1
- package/dist/components/enya-logo.js +88 -78
- package/dist/components/enya-logo.js.map +1 -1
- package/dist/components/field.js +3 -3
- 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/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.js +15 -15
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.js +81 -79
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.js +2 -2
- package/dist/components/input.js.map +1 -1
- package/dist/components/item.js +36 -36
- 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/label.js +1 -1
- package/dist/components/menubar.js +53 -52
- 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 +23 -21
- 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/popover.js +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.js +5 -5
- 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 +120 -117
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.js +65 -58
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/sheet.js +23 -22
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +84 -80
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.js +2 -2
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js +8 -8
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sonner.js +229 -215
- 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 +6 -6
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js +15 -15
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +16 -16
- 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 +2 -2
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +8 -8
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tooltip.js +6 -6
- package/dist/components/tooltip.js.map +1 -1
- package/dist/index.js +31 -16
- 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 +4 -0
- package/dist/styles/nova-binding.css +264 -266
- package/dist/styles/nova.css +158 -49
- package/dist/styles/typography.css +3 -123
- package/dist/utils.js +1 -1
- package/package.json +29 -12
- package/src/eslint/no-primitive-colors.js +2 -2
- package/src/eslint/no-primitive-colors.test.ts +1 -1
- package/dist/chunks/dist-o8x0ip0z71xkr2oh.js +0 -37
- package/dist/chunks/utils-kyb5nny4y41y7hd8.js +0 -10
- package/dist/styles/theme-nova.css +0 -197
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as I } from "../chunks/utils-
|
|
3
|
-
import { InputGroup as
|
|
4
|
-
import { a as
|
|
5
|
-
import { Dialog as
|
|
2
|
+
import { t as I } from "../chunks/utils-chr77evsz8gs6wle.js";
|
|
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
|
+
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;
|
|
11
12
|
function le(e, t, r, i, a, o, d) {
|
|
12
|
-
if (o === t.length) return a === e.length ? pe :
|
|
13
|
+
if (o === t.length) return a === e.length ? pe : Be;
|
|
13
14
|
var m = `${a},${o}`;
|
|
14
15
|
if (d[m] !== void 0) return d[m];
|
|
15
|
-
for (var g = i.charAt(o), c = r.indexOf(g, a), p = 0, h, S, x, R; c >= 0; ) h = le(e, t, r, i, c + 1, o + 1, d), h > p && (c === a ? h *= pe :
|
|
16
|
+
for (var g = i.charAt(o), c = r.indexOf(g, a), p = 0, h, S, x, R; c >= 0; ) h = le(e, t, r, i, c + 1, o + 1, d), h > p && (c === a ? h *= pe : Ge.test(e.charAt(c - 1)) ? (h *= qe, x = e.slice(a, c - 1).match(He), x && a > 0 && (h *= Math.pow(re, x.length))) : Ue.test(e.charAt(c - 1)) ? (h *= Te, R = e.slice(a, c - 1).match(be), R && a > 0 && (h *= Math.pow(re, R.length))) : (h *= We, a > 0 && (h *= Math.pow(re, c - a))), e.charAt(c) !== t.charAt(o) && (h *= _e)), (h < te && r.charAt(c - 1) === i.charAt(o + 1) || i.charAt(o + 1) === i.charAt(o) && r.charAt(c - 1) !== i.charAt(o)) && (S = le(e, t, r, i, c + 1, o + 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__ */
|
|
33
|
+
function Xe(e) {
|
|
34
|
+
const t = /* @__PURE__ */ Qe(e), r = l.forwardRef((i, a) => {
|
|
34
35
|
let { children: o, ...d } = i;
|
|
35
|
-
|
|
36
|
-
const m = l.Children.toArray(o), g = m.find(
|
|
36
|
+
ye(o) && typeof _ == "function" && (o = _(o._payload));
|
|
37
|
+
const m = l.Children.toArray(o), 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, {
|
|
@@ -51,22 +52,22 @@ function Je(e) {
|
|
|
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
57
|
let { children: a, ...o } = r;
|
|
57
|
-
if (
|
|
58
|
-
const d =
|
|
58
|
+
if (ye(a) && typeof _ == "function" && (a = _(a._payload)), l.isValidElement(a)) {
|
|
59
|
+
const d = nt(a), m = rt(o, a.props);
|
|
59
60
|
return a.type !== l.Fragment && (m.ref = i ? O(i, d) : d), l.cloneElement(a, m);
|
|
60
61
|
}
|
|
61
62
|
return l.Children.count(a) > 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
73
|
const a = e[i], o = t[i];
|
|
@@ -83,7 +84,7 @@ function tt(e, t) {
|
|
|
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,7 +107,7 @@ var $ = [
|
|
|
106
107
|
"svg",
|
|
107
108
|
"ul"
|
|
108
109
|
].reduce((e, t) => {
|
|
109
|
-
const r = /* @__PURE__ */
|
|
110
|
+
const r = /* @__PURE__ */ Xe(`Primitive.${t}`), i = l.forwardRef((a, o) => {
|
|
110
111
|
const { asChild: d, ...m } = a, g = d ? r : t;
|
|
111
112
|
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ w(g, {
|
|
112
113
|
...m,
|
|
@@ -117,7 +118,7 @@ var $ = [
|
|
|
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"])`, ae = "cmdk-item-select", L = "data-value", at = (e, t, r) => Ye(e, t, r), xe = l.createContext(void 0), T = () => l.useContext(xe), Ee = l.createContext(void 0), oe = () => 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()), a = V(() => /* @__PURE__ */ new Map()), o = V(() => /* @__PURE__ */ new Map()), d = V(() => /* @__PURE__ */ new Set()), m =
|
|
134
|
+
}), i = V(() => /* @__PURE__ */ new Set()), a = V(() => /* @__PURE__ */ new Map()), o = 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();
|
|
@@ -198,7 +199,7 @@ 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 : at;
|
|
202
203
|
return n ? v(n, r.current.search, s) : 0;
|
|
203
204
|
}
|
|
204
205
|
function Z() {
|
|
@@ -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} > *`));
|
|
@@ -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) => {
|
|
@@ -323,15 +324,15 @@ var $ = [
|
|
|
323
324
|
"cmdk-label": "",
|
|
324
325
|
htmlFor: Y.inputId,
|
|
325
326
|
id: Y.labelId,
|
|
326
|
-
style:
|
|
327
|
-
}, g), B(e, (n) => l.createElement(
|
|
328
|
-
}),
|
|
327
|
+
style: bt
|
|
328
|
+
}, g), B(e, (n) => l.createElement(Ee.Provider, { value: E }, l.createElement(xe.Provider, { value: Y }, n))));
|
|
329
|
+
}), ot = l.forwardRef((e, t) => {
|
|
329
330
|
var r, i;
|
|
330
|
-
let a = F(), o = l.useRef(null), d = l.useContext(
|
|
331
|
+
let a = F(), o = 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
333
|
if (!c) return m.item(a, d?.id);
|
|
333
334
|
}, [c]);
|
|
334
|
-
let p =
|
|
335
|
+
let p = Ie(a, o, [
|
|
335
336
|
e.value,
|
|
336
337
|
e.children,
|
|
337
338
|
o
|
|
@@ -366,9 +367,9 @@ var $ = [
|
|
|
366
367
|
onPointerMove: D || m.getDisablePointerSelection() ? void 0 : G,
|
|
367
368
|
onClick: D ? void 0 : R
|
|
368
369
|
}, e.children);
|
|
369
|
-
}),
|
|
370
|
+
}), it = l.forwardRef((e, t) => {
|
|
370
371
|
let { heading: r, children: i, forceMount: a, ...o } = e, d = F(), m = l.useRef(null), g = l.useRef(null), c = F(), p = T(), h = A((x) => a || p.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(d) : !0);
|
|
371
|
-
P(() => p.group(d), []),
|
|
372
|
+
P(() => p.group(d), []), Ie(d, m, [
|
|
372
373
|
e.value,
|
|
373
374
|
e.heading,
|
|
374
375
|
g
|
|
@@ -392,8 +393,8 @@ var $ = [
|
|
|
392
393
|
"cmdk-group-items": "",
|
|
393
394
|
role: "group",
|
|
394
395
|
"aria-labelledby": r ? c : void 0
|
|
395
|
-
}, l.createElement(
|
|
396
|
-
}),
|
|
396
|
+
}, l.createElement(Ce.Provider, { value: S }, x))));
|
|
397
|
+
}), ut = l.forwardRef((e, t) => {
|
|
397
398
|
let { alwaysRender: r, ...i } = e, a = l.useRef(null), o = A((d) => !d.search);
|
|
398
399
|
return !r && !o ? null : l.createElement($.div, {
|
|
399
400
|
ref: O(a, t),
|
|
@@ -401,7 +402,7 @@ var $ = [
|
|
|
401
402
|
"cmdk-separator": "",
|
|
402
403
|
role: "separator"
|
|
403
404
|
});
|
|
404
|
-
}),
|
|
405
|
+
}), ct = l.forwardRef((e, t) => {
|
|
405
406
|
let { onValueChange: r, ...i } = e, a = e.value != null, o = oe(), d = A((c) => c.search), m = A((c) => c.selectedItemId), g = T();
|
|
406
407
|
return l.useEffect(() => {
|
|
407
408
|
e.value != null && o.setState("search", e.value);
|
|
@@ -425,7 +426,7 @@ var $ = [
|
|
|
425
426
|
a || o.setState("search", c.target.value), r?.(c.target.value);
|
|
426
427
|
}
|
|
427
428
|
});
|
|
428
|
-
}),
|
|
429
|
+
}), dt = l.forwardRef((e, t) => {
|
|
429
430
|
let { children: r, label: i = "Suggestions", ...a } = e, o = l.useRef(null), d = l.useRef(null), m = A((c) => c.selectedItemId), g = T();
|
|
430
431
|
return l.useEffect(() => {
|
|
431
432
|
if (d.current && o.current) {
|
|
@@ -452,28 +453,28 @@ var $ = [
|
|
|
452
453
|
ref: O(d, g.listInnerRef),
|
|
453
454
|
"cmdk-list-sizer": ""
|
|
454
455
|
}, c)));
|
|
455
|
-
}),
|
|
456
|
+
}), st = l.forwardRef((e, t) => {
|
|
456
457
|
let { open: r, onOpenChange: i, overlayClassName: a, contentClassName: o, container: d, ...m } = e;
|
|
457
|
-
return l.createElement(
|
|
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
463
|
className: a
|
|
463
|
-
}), l.createElement(
|
|
464
|
+
}), l.createElement(Pe, {
|
|
464
465
|
"aria-label": e.label,
|
|
465
466
|
"cmdk-dialog": "",
|
|
466
467
|
className: o
|
|
467
|
-
}, l.createElement(
|
|
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
|
+
}) : null), ft = l.forwardRef((e, t) => {
|
|
477
478
|
let { progress: r, children: i, label: a = "Loading...", ...o } = e;
|
|
478
479
|
return l.createElement($.div, {
|
|
479
480
|
ref: t,
|
|
@@ -485,31 +486,31 @@ var $ = [
|
|
|
485
486
|
"aria-valuemax": 100,
|
|
486
487
|
"aria-label": a
|
|
487
488
|
}, B(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
|
|
488
|
-
}), M = Object.assign(
|
|
489
|
-
List:
|
|
490
|
-
Item:
|
|
491
|
-
Input:
|
|
492
|
-
Group:
|
|
493
|
-
Separator:
|
|
494
|
-
Dialog:
|
|
495
|
-
Empty:
|
|
496
|
-
Loading:
|
|
489
|
+
}), M = Object.assign(ke, {
|
|
490
|
+
List: dt,
|
|
491
|
+
Item: ot,
|
|
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;
|
|
@@ -524,7 +525,7 @@ function A(e) {
|
|
|
524
525
|
let t = oe(), r = () => e(t.snapshot());
|
|
525
526
|
return l.useSyncExternalStore(t.subscribe, r, r);
|
|
526
527
|
}
|
|
527
|
-
function
|
|
528
|
+
function Ie(e, t, r, i = []) {
|
|
528
529
|
let a = l.useRef(), o = T();
|
|
529
530
|
return P(() => {
|
|
530
531
|
var d;
|
|
@@ -538,7 +539,7 @@ function Se(e, t, r, i = []) {
|
|
|
538
539
|
o.value(e, m, g), (d = t.current) == null || d.setAttribute(L, m), a.current = m;
|
|
539
540
|
}), a;
|
|
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();
|
|
@@ -546,14 +547,14 @@ var vt = () => {
|
|
|
546
547
|
r.current.set(i, a), 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(
|
|
575
|
+
function $t({ title: e = "Command Palette", description: t = "Search for a command to run...", children: r, className: i, showCloseButton: a = !1, ...o }) {
|
|
576
|
+
return /* @__PURE__ */ W(je, {
|
|
576
577
|
...o,
|
|
577
|
-
children: [/* @__PURE__ */ W(
|
|
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
583
|
showCloseButton: a,
|
|
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
|