@arcadeai/design-system 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/dist/check-CxcShTlQ.js +11 -0
- package/dist/chevron-down-D_a-ccxi.js +11 -0
- package/dist/chevron-right-DriXIqe5.js +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +195 -0
- package/dist/components/ui/atoms/accordion.d.ts +7 -0
- package/dist/components/ui/atoms/accordion.js +289 -0
- package/dist/components/ui/atoms/alert.d.ts +9 -0
- package/dist/components/ui/atoms/alert.js +66 -0
- package/dist/components/ui/atoms/avatar.d.ts +6 -0
- package/dist/components/ui/atoms/avatar.js +130 -0
- package/dist/components/ui/atoms/badge.d.ts +9 -0
- package/dist/components/ui/atoms/badge.js +41 -0
- package/dist/components/ui/atoms/breadcrumb.d.ts +11 -0
- package/dist/components/ui/atoms/breadcrumb.js +115 -0
- package/dist/components/ui/atoms/button.d.ts +10 -0
- package/dist/components/ui/atoms/button.js +51 -0
- package/dist/components/ui/atoms/card.d.ts +9 -0
- package/dist/components/ui/atoms/card.js +90 -0
- package/dist/components/ui/atoms/chart.d.ts +68 -0
- package/dist/components/ui/atoms/chart.js +10477 -0
- package/dist/components/ui/atoms/collapsible.d.ts +5 -0
- package/dist/components/ui/atoms/collapsible.js +34 -0
- package/dist/components/ui/atoms/command.d.ts +18 -0
- package/dist/components/ui/atoms/command.js +490 -0
- package/dist/components/ui/atoms/dialog.d.ts +15 -0
- package/dist/components/ui/atoms/dialog.js +135 -0
- package/dist/components/ui/atoms/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/atoms/dropdown-menu.js +1035 -0
- package/dist/components/ui/atoms/form.d.ts +24 -0
- package/dist/components/ui/atoms/form.js +297 -0
- package/dist/components/ui/atoms/hover-card.d.ts +6 -0
- package/dist/components/ui/atoms/hover-card.js +211 -0
- package/dist/components/ui/atoms/index.d.ts +33 -0
- package/dist/components/ui/atoms/index.js +195 -0
- package/dist/components/ui/atoms/input.d.ts +3 -0
- package/dist/components/ui/atoms/input.js +21 -0
- package/dist/components/ui/atoms/label.d.ts +4 -0
- package/dist/components/ui/atoms/label.js +36 -0
- package/dist/components/ui/atoms/popover.d.ts +7 -0
- package/dist/components/ui/atoms/popover.js +266 -0
- package/dist/components/ui/atoms/progress.d.ts +4 -0
- package/dist/components/ui/atoms/progress.js +107 -0
- package/dist/components/ui/atoms/resizable.d.ts +8 -0
- package/dist/components/ui/atoms/resizable.js +1564 -0
- package/dist/components/ui/atoms/scroll-area.d.ts +5 -0
- package/dist/components/ui/atoms/scroll-area.js +580 -0
- package/dist/components/ui/atoms/select.d.ts +15 -0
- package/dist/components/ui/atoms/select.js +1000 -0
- package/dist/components/ui/atoms/separator.d.ts +4 -0
- package/dist/components/ui/atoms/separator.js +44 -0
- package/dist/components/ui/atoms/sheet.d.ts +14 -0
- package/dist/components/ui/atoms/sheet.js +127 -0
- package/dist/components/ui/atoms/sidebar.d.ts +69 -0
- package/dist/components/ui/atoms/sidebar.js +602 -0
- package/dist/components/ui/atoms/skeleton.d.ts +2 -0
- package/dist/components/ui/atoms/skeleton.js +15 -0
- package/dist/components/ui/atoms/slider.d.ts +4 -0
- package/dist/components/ui/atoms/slider.js +484 -0
- package/dist/components/ui/atoms/sonner.d.ts +3 -0
- package/dist/components/ui/atoms/sonner.js +788 -0
- package/dist/components/ui/atoms/switch.d.ts +4 -0
- package/dist/components/ui/atoms/switch.js +155 -0
- package/dist/components/ui/atoms/table.d.ts +10 -0
- package/dist/components/ui/atoms/table.js +114 -0
- package/dist/components/ui/atoms/tabs.d.ts +7 -0
- package/dist/components/ui/atoms/tabs.js +218 -0
- package/dist/components/ui/atoms/textarea.d.ts +3 -0
- package/dist/components/ui/atoms/textarea.js +18 -0
- package/dist/components/ui/atoms/toggle.d.ts +9 -0
- package/dist/components/ui/atoms/toggle.js +70 -0
- package/dist/components/ui/atoms/tooltip.d.ts +7 -0
- package/dist/components/ui/atoms/tooltip.js +376 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +195 -0
- package/dist/createLucideIcon-B6fy1GTR.js +94 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/index-BAhNQL1u.js +675 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-C9KW2H79.js +36 -0
- package/dist/index-CB1Wkg0G.js +83 -0
- package/dist/index-CHDs-SiB.js +27 -0
- package/dist/index-CJFGOBPb.js +122 -0
- package/dist/index-CL4N9wMT.js +259 -0
- package/dist/index-CuMpq4Un.js +47 -0
- package/dist/index-CxK6rt_N.js +119 -0
- package/dist/index-D2uXV4lz.js +181 -0
- package/dist/index-DLeNytVF.js +9 -0
- package/dist/index-DYfkNB0n.js +54 -0
- package/dist/index-DdnpnyX2.js +34 -0
- package/dist/index-DuekHEmj.js +6 -0
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/index-Dy7YuPrV.js +1532 -0
- package/dist/index-QMp1pYFl.js +145 -0
- package/dist/index-UFb2E87s.js +70 -0
- package/dist/index-nluJZSbA.js +31 -0
- package/dist/index-p7nYL7BU.js +71 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-umR1UobZ.js +13 -0
- package/dist/index.css +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +4 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +195 -0
- package/dist/utils-Dy2WjYNJ.js +2744 -0
- package/package.json +100 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
2
|
+
declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { R as t, C as a, a as e } from "../../../index-CxK6rt_N.js";
|
|
3
|
+
function n({
|
|
4
|
+
...l
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ o(t, { "data-slot": "collapsible", ...l });
|
|
7
|
+
}
|
|
8
|
+
function s({
|
|
9
|
+
...l
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ o(
|
|
12
|
+
a,
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "collapsible-trigger",
|
|
15
|
+
...l
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function p({
|
|
20
|
+
...l
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ o(
|
|
23
|
+
e,
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "collapsible-content",
|
|
26
|
+
...l
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
n as Collapsible,
|
|
32
|
+
p as CollapsibleContent,
|
|
33
|
+
s as CollapsibleTrigger
|
|
34
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import { Dialog } from './dialog';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { jsx as C, jsxs as ne } from "react/jsx-runtime";
|
|
2
|
+
import { R as Se, P as Ie, O as Re, a as _e } from "../../../index-CL4N9wMT.js";
|
|
3
|
+
import * as l from "react";
|
|
4
|
+
import { P as _ } from "../../../index-C9KW2H79.js";
|
|
5
|
+
import { u as K } from "../../../index-umR1UobZ.js";
|
|
6
|
+
import { b as V } from "../../../index-CB1Wkg0G.js";
|
|
7
|
+
import { Dialog as Ae, DialogHeader as De, DialogTitle as Me, DialogDescription as Ne, DialogContent as $e } from "./dialog.js";
|
|
8
|
+
import { c as A } from "../../../utils-Dy2WjYNJ.js";
|
|
9
|
+
import { c as je } from "../../../createLucideIcon-B6fy1GTR.js";
|
|
10
|
+
/**
|
|
11
|
+
* @license lucide-react v0.522.0 - ISC
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the ISC license.
|
|
14
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
const Pe = [
|
|
17
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
18
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
19
|
+
], Fe = je("search", Pe);
|
|
20
|
+
var pe = 1, Ke = 0.9, Le = 0.8, qe = 0.17, ee = 0.1, te = 0.999, Ve = 0.9999, ze = 0.99, Oe = /[\\\/_+.#"@\[\(\{&]/, Be = /[\\\/_+.#"@\[\(\{&]/g, Ge = /[\s-]/, he = /[\s-]/g;
|
|
21
|
+
function le(e, n, r, s, o, i, d) {
|
|
22
|
+
if (i === n.length) return o === e.length ? pe : ze;
|
|
23
|
+
var f = `${o},${i}`;
|
|
24
|
+
if (d[f] !== void 0) return d[f];
|
|
25
|
+
for (var b = s.charAt(i), u = r.indexOf(b, o), v = 0, g, S, y, I; u >= 0; ) g = le(e, n, r, s, u + 1, i + 1, d), g > v && (u === o ? g *= pe : Oe.test(e.charAt(u - 1)) ? (g *= Le, y = e.slice(o, u - 1).match(Be), y && o > 0 && (g *= Math.pow(te, y.length))) : Ge.test(e.charAt(u - 1)) ? (g *= Ke, I = e.slice(o, u - 1).match(he), I && o > 0 && (g *= Math.pow(te, I.length))) : (g *= qe, o > 0 && (g *= Math.pow(te, u - o))), e.charAt(u) !== n.charAt(i) && (g *= Ve)), (g < ee && r.charAt(u - 1) === s.charAt(i + 1) || s.charAt(i + 1) === s.charAt(i) && r.charAt(u - 1) !== s.charAt(i)) && (S = le(e, n, r, s, u + 1, i + 2, d), S * ee > g && (g = S * ee)), g > v && (v = g), u = r.indexOf(b, u + 1);
|
|
26
|
+
return d[f] = v, v;
|
|
27
|
+
}
|
|
28
|
+
function ve(e) {
|
|
29
|
+
return e.toLowerCase().replace(he, " ");
|
|
30
|
+
}
|
|
31
|
+
function He(e, n, r) {
|
|
32
|
+
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, le(e, n, ve(e), ve(n), 0, 0, {});
|
|
33
|
+
}
|
|
34
|
+
var q = '[cmdk-group=""]', re = '[cmdk-group-items=""]', Te = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', ge = `${be}:not([aria-disabled="true"])`, ae = "cmdk-item-select", P = "data-value", Ue = (e, n, r) => He(e, n, r), xe = l.createContext(void 0), z = () => l.useContext(xe), ke = l.createContext(void 0), oe = () => l.useContext(ke), ye = l.createContext(void 0), we = l.forwardRef((e, n) => {
|
|
35
|
+
let r = F(() => {
|
|
36
|
+
var t, c;
|
|
37
|
+
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() } };
|
|
38
|
+
}), s = F(() => /* @__PURE__ */ new Set()), o = F(() => /* @__PURE__ */ new Map()), i = F(() => /* @__PURE__ */ new Map()), d = F(() => /* @__PURE__ */ new Set()), f = Ee(e), { label: b, children: u, value: v, onValueChange: g, filter: S, shouldFilter: y, loop: I, disablePointerSelection: H = !1, vimBindings: D = !0, ...O } = e, T = K(), ue = K(), U = K(), M = l.useRef(null), x = lt();
|
|
39
|
+
N(() => {
|
|
40
|
+
if (v !== void 0) {
|
|
41
|
+
let t = v.trim();
|
|
42
|
+
r.current.value = t, w.emit();
|
|
43
|
+
}
|
|
44
|
+
}, [v]), N(() => {
|
|
45
|
+
x(6, ce);
|
|
46
|
+
}, []);
|
|
47
|
+
let w = l.useMemo(() => ({ subscribe: (t) => (d.current.add(t), () => d.current.delete(t)), snapshot: () => r.current, setState: (t, c, m) => {
|
|
48
|
+
var a, p, h, E;
|
|
49
|
+
if (!Object.is(r.current[t], c)) {
|
|
50
|
+
if (r.current[t] = c, t === "search") Y(), J(), x(1, X);
|
|
51
|
+
else if (t === "value") {
|
|
52
|
+
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
53
|
+
let k = document.getElementById(U);
|
|
54
|
+
k ? k.focus() : (a = document.getElementById(T)) == null || a.focus();
|
|
55
|
+
}
|
|
56
|
+
if (x(7, () => {
|
|
57
|
+
var k;
|
|
58
|
+
r.current.selectedItemId = (k = j()) == null ? void 0 : k.id, w.emit();
|
|
59
|
+
}), m || x(5, ce), ((p = f.current) == null ? void 0 : p.value) !== void 0) {
|
|
60
|
+
let k = c ?? "";
|
|
61
|
+
(E = (h = f.current).onValueChange) == null || E.call(h, k);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
w.emit();
|
|
66
|
+
}
|
|
67
|
+
}, emit: () => {
|
|
68
|
+
d.current.forEach((t) => t());
|
|
69
|
+
} }), []), W = l.useMemo(() => ({ value: (t, c, m) => {
|
|
70
|
+
var a;
|
|
71
|
+
c !== ((a = i.current.get(t)) == null ? void 0 : a.value) && (i.current.set(t, { value: c, keywords: m }), r.current.filtered.items.set(t, ie(c, m)), x(2, () => {
|
|
72
|
+
J(), w.emit();
|
|
73
|
+
}));
|
|
74
|
+
}, item: (t, c) => (s.current.add(t), c && (o.current.has(c) ? o.current.get(c).add(t) : o.current.set(c, /* @__PURE__ */ new Set([t]))), x(3, () => {
|
|
75
|
+
Y(), J(), r.current.value || X(), w.emit();
|
|
76
|
+
}), () => {
|
|
77
|
+
i.current.delete(t), s.current.delete(t), r.current.filtered.items.delete(t);
|
|
78
|
+
let m = j();
|
|
79
|
+
x(4, () => {
|
|
80
|
+
Y(), (m == null ? void 0 : m.getAttribute("id")) === t && X(), w.emit();
|
|
81
|
+
});
|
|
82
|
+
}), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
|
|
83
|
+
i.current.delete(t), o.current.delete(t);
|
|
84
|
+
}), filter: () => f.current.shouldFilter, label: b || e["aria-label"], getDisablePointerSelection: () => f.current.disablePointerSelection, listId: T, inputId: U, labelId: ue, listInnerRef: M }), []);
|
|
85
|
+
function ie(t, c) {
|
|
86
|
+
var m, a;
|
|
87
|
+
let p = (a = (m = f.current) == null ? void 0 : m.filter) != null ? a : Ue;
|
|
88
|
+
return t ? p(t, r.current.search, c) : 0;
|
|
89
|
+
}
|
|
90
|
+
function J() {
|
|
91
|
+
if (!r.current.search || f.current.shouldFilter === !1) return;
|
|
92
|
+
let t = r.current.filtered.items, c = [];
|
|
93
|
+
r.current.filtered.groups.forEach((a) => {
|
|
94
|
+
let p = o.current.get(a), h = 0;
|
|
95
|
+
p.forEach((E) => {
|
|
96
|
+
let k = t.get(E);
|
|
97
|
+
h = Math.max(k, h);
|
|
98
|
+
}), c.push([a, h]);
|
|
99
|
+
});
|
|
100
|
+
let m = M.current;
|
|
101
|
+
L().sort((a, p) => {
|
|
102
|
+
var h, E;
|
|
103
|
+
let k = a.getAttribute("id"), B = p.getAttribute("id");
|
|
104
|
+
return ((h = t.get(B)) != null ? h : 0) - ((E = t.get(k)) != null ? E : 0);
|
|
105
|
+
}).forEach((a) => {
|
|
106
|
+
let p = a.closest(re);
|
|
107
|
+
p ? p.appendChild(a.parentElement === p ? a : a.closest(`${re} > *`)) : m.appendChild(a.parentElement === m ? a : a.closest(`${re} > *`));
|
|
108
|
+
}), c.sort((a, p) => p[1] - a[1]).forEach((a) => {
|
|
109
|
+
var p;
|
|
110
|
+
let h = (p = M.current) == null ? void 0 : p.querySelector(`${q}[${P}="${encodeURIComponent(a[0])}"]`);
|
|
111
|
+
h == null || h.parentElement.appendChild(h);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function X() {
|
|
115
|
+
let t = L().find((m) => m.getAttribute("aria-disabled") !== "true"), c = t == null ? void 0 : t.getAttribute(P);
|
|
116
|
+
w.setState("value", c || void 0);
|
|
117
|
+
}
|
|
118
|
+
function Y() {
|
|
119
|
+
var t, c, m, a;
|
|
120
|
+
if (!r.current.search || f.current.shouldFilter === !1) {
|
|
121
|
+
r.current.filtered.count = s.current.size;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
125
|
+
let p = 0;
|
|
126
|
+
for (let h of s.current) {
|
|
127
|
+
let E = (c = (t = i.current.get(h)) == null ? void 0 : t.value) != null ? c : "", k = (a = (m = i.current.get(h)) == null ? void 0 : m.keywords) != null ? a : [], B = ie(E, k);
|
|
128
|
+
r.current.filtered.items.set(h, B), B > 0 && p++;
|
|
129
|
+
}
|
|
130
|
+
for (let [h, E] of o.current) for (let k of E) if (r.current.filtered.items.get(k) > 0) {
|
|
131
|
+
r.current.filtered.groups.add(h);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
r.current.filtered.count = p;
|
|
135
|
+
}
|
|
136
|
+
function ce() {
|
|
137
|
+
var t, c, m;
|
|
138
|
+
let a = j();
|
|
139
|
+
a && (((t = a.parentElement) == null ? void 0 : t.firstChild) === a && ((m = (c = a.closest(q)) == null ? void 0 : c.querySelector(Te)) == null || m.scrollIntoView({ block: "nearest" })), a.scrollIntoView({ block: "nearest" }));
|
|
140
|
+
}
|
|
141
|
+
function j() {
|
|
142
|
+
var t;
|
|
143
|
+
return (t = M.current) == null ? void 0 : t.querySelector(`${be}[aria-selected="true"]`);
|
|
144
|
+
}
|
|
145
|
+
function L() {
|
|
146
|
+
var t;
|
|
147
|
+
return Array.from(((t = M.current) == null ? void 0 : t.querySelectorAll(ge)) || []);
|
|
148
|
+
}
|
|
149
|
+
function Q(t) {
|
|
150
|
+
let c = L()[t];
|
|
151
|
+
c && w.setState("value", c.getAttribute(P));
|
|
152
|
+
}
|
|
153
|
+
function Z(t) {
|
|
154
|
+
var c;
|
|
155
|
+
let m = j(), a = L(), p = a.findIndex((E) => E === m), h = a[p + t];
|
|
156
|
+
(c = f.current) != null && c.loop && (h = p + t < 0 ? a[a.length - 1] : p + t === a.length ? a[0] : a[p + t]), h && w.setState("value", h.getAttribute(P));
|
|
157
|
+
}
|
|
158
|
+
function de(t) {
|
|
159
|
+
let c = j(), m = c == null ? void 0 : c.closest(q), a;
|
|
160
|
+
for (; m && !a; ) m = t > 0 ? rt(m, q) : nt(m, q), a = m == null ? void 0 : m.querySelector(ge);
|
|
161
|
+
a ? w.setState("value", a.getAttribute(P)) : Z(t);
|
|
162
|
+
}
|
|
163
|
+
let se = () => Q(L().length - 1), me = (t) => {
|
|
164
|
+
t.preventDefault(), t.metaKey ? se() : t.altKey ? de(1) : Z(1);
|
|
165
|
+
}, fe = (t) => {
|
|
166
|
+
t.preventDefault(), t.metaKey ? Q(0) : t.altKey ? de(-1) : Z(-1);
|
|
167
|
+
};
|
|
168
|
+
return l.createElement(_.div, { ref: n, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (t) => {
|
|
169
|
+
var c;
|
|
170
|
+
(c = O.onKeyDown) == null || c.call(O, t);
|
|
171
|
+
let m = t.nativeEvent.isComposing || t.keyCode === 229;
|
|
172
|
+
if (!(t.defaultPrevented || m)) switch (t.key) {
|
|
173
|
+
case "n":
|
|
174
|
+
case "j": {
|
|
175
|
+
D && t.ctrlKey && me(t);
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case "ArrowDown": {
|
|
179
|
+
me(t);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "p":
|
|
183
|
+
case "k": {
|
|
184
|
+
D && t.ctrlKey && fe(t);
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
case "ArrowUp": {
|
|
188
|
+
fe(t);
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
case "Home": {
|
|
192
|
+
t.preventDefault(), Q(0);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
case "End": {
|
|
196
|
+
t.preventDefault(), se();
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
case "Enter": {
|
|
200
|
+
t.preventDefault();
|
|
201
|
+
let a = j();
|
|
202
|
+
if (a) {
|
|
203
|
+
let p = new Event(ae);
|
|
204
|
+
a.dispatchEvent(p);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
} }, l.createElement("label", { "cmdk-label": "", htmlFor: W.inputId, id: W.labelId, style: ot }, b), G(e, (t) => l.createElement(ke.Provider, { value: w }, l.createElement(xe.Provider, { value: W }, t))));
|
|
209
|
+
}), We = l.forwardRef((e, n) => {
|
|
210
|
+
var r, s;
|
|
211
|
+
let o = K(), i = l.useRef(null), d = l.useContext(ye), f = z(), b = Ee(e), u = (s = (r = b.current) == null ? void 0 : r.forceMount) != null ? s : d == null ? void 0 : d.forceMount;
|
|
212
|
+
N(() => {
|
|
213
|
+
if (!u) return f.item(o, d == null ? void 0 : d.id);
|
|
214
|
+
}, [u]);
|
|
215
|
+
let v = Ce(o, i, [e.value, e.children, i], e.keywords), g = oe(), S = R((x) => x.value && x.value === v.current), y = R((x) => u || f.filter() === !1 ? !0 : x.search ? x.filtered.items.get(o) > 0 : !0);
|
|
216
|
+
l.useEffect(() => {
|
|
217
|
+
let x = i.current;
|
|
218
|
+
if (!(!x || e.disabled)) return x.addEventListener(ae, I), () => x.removeEventListener(ae, I);
|
|
219
|
+
}, [y, e.onSelect, e.disabled]);
|
|
220
|
+
function I() {
|
|
221
|
+
var x, w;
|
|
222
|
+
H(), (w = (x = b.current).onSelect) == null || w.call(x, v.current);
|
|
223
|
+
}
|
|
224
|
+
function H() {
|
|
225
|
+
g.setState("value", v.current, !0);
|
|
226
|
+
}
|
|
227
|
+
if (!y) return null;
|
|
228
|
+
let { disabled: D, value: O, onSelect: T, forceMount: ue, keywords: U, ...M } = e;
|
|
229
|
+
return l.createElement(_.div, { ref: V(i, n), ...M, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!D, "aria-selected": !!S, "data-disabled": !!D, "data-selected": !!S, onPointerMove: D || f.getDisablePointerSelection() ? void 0 : H, onClick: D ? void 0 : I }, e.children);
|
|
230
|
+
}), Je = l.forwardRef((e, n) => {
|
|
231
|
+
let { heading: r, children: s, forceMount: o, ...i } = e, d = K(), f = l.useRef(null), b = l.useRef(null), u = K(), v = z(), g = R((y) => o || v.filter() === !1 ? !0 : y.search ? y.filtered.groups.has(d) : !0);
|
|
232
|
+
N(() => v.group(d), []), Ce(d, f, [e.value, e.heading, b]);
|
|
233
|
+
let S = l.useMemo(() => ({ id: d, forceMount: o }), [o]);
|
|
234
|
+
return l.createElement(_.div, { ref: V(f, n), ...i, "cmdk-group": "", role: "presentation", hidden: g ? void 0 : !0 }, r && l.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, r), G(e, (y) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? u : void 0 }, l.createElement(ye.Provider, { value: S }, y))));
|
|
235
|
+
}), Xe = l.forwardRef((e, n) => {
|
|
236
|
+
let { alwaysRender: r, ...s } = e, o = l.useRef(null), i = R((d) => !d.search);
|
|
237
|
+
return !r && !i ? null : l.createElement(_.div, { ref: V(o, n), ...s, "cmdk-separator": "", role: "separator" });
|
|
238
|
+
}), Ye = l.forwardRef((e, n) => {
|
|
239
|
+
let { onValueChange: r, ...s } = e, o = e.value != null, i = oe(), d = R((u) => u.search), f = R((u) => u.selectedItemId), b = z();
|
|
240
|
+
return l.useEffect(() => {
|
|
241
|
+
e.value != null && i.setState("search", e.value);
|
|
242
|
+
}, [e.value]), l.createElement(_.input, { ref: n, ...s, "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: o ? e.value : d, onChange: (u) => {
|
|
243
|
+
o || i.setState("search", u.target.value), r == null || r(u.target.value);
|
|
244
|
+
} });
|
|
245
|
+
}), Qe = l.forwardRef((e, n) => {
|
|
246
|
+
let { children: r, label: s = "Suggestions", ...o } = e, i = l.useRef(null), d = l.useRef(null), f = R((u) => u.selectedItemId), b = z();
|
|
247
|
+
return l.useEffect(() => {
|
|
248
|
+
if (d.current && i.current) {
|
|
249
|
+
let u = d.current, v = i.current, g, S = new ResizeObserver(() => {
|
|
250
|
+
g = requestAnimationFrame(() => {
|
|
251
|
+
let y = u.offsetHeight;
|
|
252
|
+
v.style.setProperty("--cmdk-list-height", y.toFixed(1) + "px");
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
return S.observe(u), () => {
|
|
256
|
+
cancelAnimationFrame(g), S.unobserve(u);
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}, []), l.createElement(_.div, { ref: V(i, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": s, id: b.listId }, G(e, (u) => l.createElement("div", { ref: V(d, b.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
260
|
+
}), Ze = l.forwardRef((e, n) => {
|
|
261
|
+
let { open: r, onOpenChange: s, overlayClassName: o, contentClassName: i, container: d, ...f } = e;
|
|
262
|
+
return l.createElement(Se, { open: r, onOpenChange: s }, l.createElement(Ie, { container: d }, l.createElement(Re, { "cmdk-overlay": "", className: o }), l.createElement(_e, { "aria-label": e.label, "cmdk-dialog": "", className: i }, l.createElement(we, { ref: n, ...f }))));
|
|
263
|
+
}), et = l.forwardRef((e, n) => R((r) => r.filtered.count === 0) ? l.createElement(_.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), tt = l.forwardRef((e, n) => {
|
|
264
|
+
let { progress: r, children: s, label: o = "Loading...", ...i } = e;
|
|
265
|
+
return l.createElement(_.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, G(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
|
|
266
|
+
}), $ = Object.assign(we, { List: Qe, Item: We, Input: Ye, Group: Je, Separator: Xe, Dialog: Ze, Empty: et, Loading: tt });
|
|
267
|
+
function rt(e, n) {
|
|
268
|
+
let r = e.nextElementSibling;
|
|
269
|
+
for (; r; ) {
|
|
270
|
+
if (r.matches(n)) return r;
|
|
271
|
+
r = r.nextElementSibling;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
function nt(e, n) {
|
|
275
|
+
let r = e.previousElementSibling;
|
|
276
|
+
for (; r; ) {
|
|
277
|
+
if (r.matches(n)) return r;
|
|
278
|
+
r = r.previousElementSibling;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function Ee(e) {
|
|
282
|
+
let n = l.useRef(e);
|
|
283
|
+
return N(() => {
|
|
284
|
+
n.current = e;
|
|
285
|
+
}), n;
|
|
286
|
+
}
|
|
287
|
+
var N = typeof window > "u" ? l.useEffect : l.useLayoutEffect;
|
|
288
|
+
function F(e) {
|
|
289
|
+
let n = l.useRef();
|
|
290
|
+
return n.current === void 0 && (n.current = e()), n;
|
|
291
|
+
}
|
|
292
|
+
function R(e) {
|
|
293
|
+
let n = oe(), r = () => e(n.snapshot());
|
|
294
|
+
return l.useSyncExternalStore(n.subscribe, r, r);
|
|
295
|
+
}
|
|
296
|
+
function Ce(e, n, r, s = []) {
|
|
297
|
+
let o = l.useRef(), i = z();
|
|
298
|
+
return N(() => {
|
|
299
|
+
var d;
|
|
300
|
+
let f = (() => {
|
|
301
|
+
var u;
|
|
302
|
+
for (let v of r) {
|
|
303
|
+
if (typeof v == "string") return v.trim();
|
|
304
|
+
if (typeof v == "object" && "current" in v) return v.current ? (u = v.current.textContent) == null ? void 0 : u.trim() : o.current;
|
|
305
|
+
}
|
|
306
|
+
})(), b = s.map((u) => u.trim());
|
|
307
|
+
i.value(e, f, b), (d = n.current) == null || d.setAttribute(P, f), o.current = f;
|
|
308
|
+
}), o;
|
|
309
|
+
}
|
|
310
|
+
var lt = () => {
|
|
311
|
+
let [e, n] = l.useState(), r = F(() => /* @__PURE__ */ new Map());
|
|
312
|
+
return N(() => {
|
|
313
|
+
r.current.forEach((s) => s()), r.current = /* @__PURE__ */ new Map();
|
|
314
|
+
}, [e]), (s, o) => {
|
|
315
|
+
r.current.set(s, o), n({});
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
function at(e) {
|
|
319
|
+
let n = e.type;
|
|
320
|
+
return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
|
|
321
|
+
}
|
|
322
|
+
function G({ asChild: e, children: n }, r) {
|
|
323
|
+
return e && l.isValidElement(n) ? l.cloneElement(at(n), { ref: n.ref }, r(n.props.children)) : r(n);
|
|
324
|
+
}
|
|
325
|
+
var ot = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
326
|
+
function ut({
|
|
327
|
+
className: e,
|
|
328
|
+
...n
|
|
329
|
+
}) {
|
|
330
|
+
return /* @__PURE__ */ C(
|
|
331
|
+
$,
|
|
332
|
+
{
|
|
333
|
+
className: A(
|
|
334
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
335
|
+
e
|
|
336
|
+
),
|
|
337
|
+
"data-slot": "command",
|
|
338
|
+
...n
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
function gt({
|
|
343
|
+
title: e = "Command Palette",
|
|
344
|
+
description: n = "Search for a command to run...",
|
|
345
|
+
children: r,
|
|
346
|
+
className: s,
|
|
347
|
+
showCloseButton: o = !0,
|
|
348
|
+
...i
|
|
349
|
+
}) {
|
|
350
|
+
return /* @__PURE__ */ ne(Ae, { ...i, children: [
|
|
351
|
+
/* @__PURE__ */ ne(De, { className: "sr-only", children: [
|
|
352
|
+
/* @__PURE__ */ C(Me, { children: e }),
|
|
353
|
+
/* @__PURE__ */ C(Ne, { children: n })
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ C(
|
|
356
|
+
$e,
|
|
357
|
+
{
|
|
358
|
+
className: A("overflow-hidden p-0", s),
|
|
359
|
+
showCloseButton: o,
|
|
360
|
+
children: /* @__PURE__ */ C(ut, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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 })
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
] });
|
|
364
|
+
}
|
|
365
|
+
function ht({
|
|
366
|
+
className: e,
|
|
367
|
+
...n
|
|
368
|
+
}) {
|
|
369
|
+
return /* @__PURE__ */ ne(
|
|
370
|
+
"div",
|
|
371
|
+
{
|
|
372
|
+
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
373
|
+
"data-slot": "command-input-wrapper",
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ C(Fe, { className: "size-4 shrink-0 opacity-50" }),
|
|
376
|
+
/* @__PURE__ */ C(
|
|
377
|
+
$.Input,
|
|
378
|
+
{
|
|
379
|
+
className: A(
|
|
380
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
381
|
+
e
|
|
382
|
+
),
|
|
383
|
+
"data-slot": "command-input",
|
|
384
|
+
...n
|
|
385
|
+
}
|
|
386
|
+
)
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
function bt({
|
|
392
|
+
className: e,
|
|
393
|
+
...n
|
|
394
|
+
}) {
|
|
395
|
+
return /* @__PURE__ */ C(
|
|
396
|
+
$.List,
|
|
397
|
+
{
|
|
398
|
+
className: A(
|
|
399
|
+
"max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",
|
|
400
|
+
e
|
|
401
|
+
),
|
|
402
|
+
"data-slot": "command-list",
|
|
403
|
+
...n
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
function xt({
|
|
408
|
+
...e
|
|
409
|
+
}) {
|
|
410
|
+
return /* @__PURE__ */ C(
|
|
411
|
+
$.Empty,
|
|
412
|
+
{
|
|
413
|
+
className: "py-6 text-center text-sm",
|
|
414
|
+
"data-slot": "command-empty",
|
|
415
|
+
...e
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
function kt({
|
|
420
|
+
className: e,
|
|
421
|
+
...n
|
|
422
|
+
}) {
|
|
423
|
+
return /* @__PURE__ */ C(
|
|
424
|
+
$.Group,
|
|
425
|
+
{
|
|
426
|
+
className: A(
|
|
427
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
|
|
428
|
+
e
|
|
429
|
+
),
|
|
430
|
+
"data-slot": "command-group",
|
|
431
|
+
...n
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
function yt({
|
|
436
|
+
className: e,
|
|
437
|
+
...n
|
|
438
|
+
}) {
|
|
439
|
+
return /* @__PURE__ */ C(
|
|
440
|
+
$.Separator,
|
|
441
|
+
{
|
|
442
|
+
className: A("-mx-1 h-px bg-border", e),
|
|
443
|
+
"data-slot": "command-separator",
|
|
444
|
+
...n
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function wt({
|
|
449
|
+
className: e,
|
|
450
|
+
...n
|
|
451
|
+
}) {
|
|
452
|
+
return /* @__PURE__ */ C(
|
|
453
|
+
$.Item,
|
|
454
|
+
{
|
|
455
|
+
className: A(
|
|
456
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
457
|
+
e
|
|
458
|
+
),
|
|
459
|
+
"data-slot": "command-item",
|
|
460
|
+
...n
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
function Et({
|
|
465
|
+
className: e,
|
|
466
|
+
...n
|
|
467
|
+
}) {
|
|
468
|
+
return /* @__PURE__ */ C(
|
|
469
|
+
"span",
|
|
470
|
+
{
|
|
471
|
+
className: A(
|
|
472
|
+
"ml-auto text-muted-foreground text-xs tracking-widest",
|
|
473
|
+
e
|
|
474
|
+
),
|
|
475
|
+
"data-slot": "command-shortcut",
|
|
476
|
+
...n
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
export {
|
|
481
|
+
ut as Command,
|
|
482
|
+
gt as CommandDialog,
|
|
483
|
+
xt as CommandEmpty,
|
|
484
|
+
kt as CommandGroup,
|
|
485
|
+
ht as CommandInput,
|
|
486
|
+
wt as CommandItem,
|
|
487
|
+
bt as CommandList,
|
|
488
|
+
yt as CommandSeparator,
|
|
489
|
+
Et as CommandShortcut
|
|
490
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|