@nqlib/nqui 0.4.0 → 0.4.2
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/INSTALLATION.md +215 -0
- package/README.md +2 -1
- package/dist/command-palette-BuYcxPCc.cjs +5 -0
- package/dist/command-palette-dEJ9aEk4.js +694 -0
- package/dist/command.cjs.js +1 -1
- package/dist/command.es.js +1 -1
- package/dist/components/custom/enhanced-badge.d.ts +1 -1
- package/dist/components/custom/enhanced-button.d.ts +6 -1
- package/dist/components/custom/enhanced-button.d.ts.map +1 -1
- package/dist/components/custom/enhanced-checkbox.d.ts +11 -0
- package/dist/components/custom/enhanced-checkbox.d.ts.map +1 -1
- package/dist/components/custom/enhanced-radio-group.d.ts +13 -4
- package/dist/components/custom/enhanced-radio-group.d.ts.map +1 -1
- package/dist/components/custom/enhanced-sonner.d.ts +5 -6
- package/dist/components/custom/enhanced-sonner.d.ts.map +1 -1
- package/dist/components/custom/enhanced-tabs.d.ts.map +1 -1
- package/dist/components/error-boundary.d.ts +20 -0
- package/dist/components/error-boundary.d.ts.map +1 -0
- package/dist/components/index.d.ts +102 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +4 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts +3 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/debug-panel-AjzBdMMz.js +9198 -0
- package/dist/debug-panel-NaOmD68t.cjs +171 -0
- package/dist/debug.cjs.js +1 -0
- package/dist/debug.es.js +7 -0
- package/dist/drawer-Cqq0Ozb2.cjs +1 -0
- package/dist/{drawer-CU4lkcz7.js → drawer-pUXPg3lF.js} +2 -2
- package/dist/drawer.cjs.js +1 -1
- package/dist/drawer.es.js +1 -1
- package/dist/entries/debug.d.ts +14 -0
- package/dist/entries/debug.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-scroll-spy.d.ts.map +1 -1
- package/dist/index-CI756mSv.cjs +41 -0
- package/dist/index-CgfzsUO6.js +1069 -0
- package/dist/index.d.ts +2 -98
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/nqui.cjs.js +42 -212
- package/dist/nqui.es.js +8589 -17780
- package/dist/sonner-BtzU00r3.js +248 -0
- package/dist/sonner-Dfk26eds.cjs +54 -0
- package/dist/sonner.cjs.js +1 -1
- package/dist/sonner.es.js +1 -1
- package/dist/styles.css +3 -0
- package/docs/components/README.md +99 -1
- package/docs/components/nqui-card.md +7 -0
- package/docs/components/nqui-checkbox.md +23 -1
- package/docs/components/nqui-radio-group.md +45 -2
- package/docs/components/nqui-tabs.md +11 -1
- package/docs/nqui-skills/SKILL.md +95 -0
- package/docs/nqui-skills/design-system.md +130 -0
- package/docs/nqui-skills/rules/composition.md +183 -0
- package/docs/nqui-skills/rules/forms.md +190 -0
- package/docs/nqui-skills/rules/icons.md +158 -0
- package/docs/nqui-skills/rules/styling.md +192 -0
- package/package.json +23 -10
- package/scripts/cli.js +1 -0
- package/scripts/download-skills.js +91 -0
- package/scripts/examples/nextjs-layout-sidebar.tsx +100 -0
- package/scripts/examples/nextjs-page-sidebar.tsx +81 -0
- package/scripts/examples/vite-app.tsx +135 -0
- package/scripts/examples/vite-main.tsx +17 -0
- package/scripts/examples.js +92 -6
- package/scripts/generate-docs.js +169 -0
- package/scripts/init-css.js +34 -14
- package/scripts/init-cursor.js +8 -0
- package/scripts/post-install.js +41 -9
- package/scripts/resolve-target-dir.js +20 -1
- package/scripts/wizard.js +12 -7
- package/dist/command-palette-UHk8zZOg.cjs +0 -45
- package/dist/command-palette-d-TrdBsM.js +0 -1778
- package/dist/drawer-BcIxWRN8.cjs +0 -1
- package/dist/sonner-Co6YpYVs.js +0 -546
- package/dist/sonner-DbQhVp8m.cjs +0 -330
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { Command as h } from "cmdk";
|
|
4
|
+
import { c as l } from "./utils-B6yFEsav.js";
|
|
5
|
+
import { B as w } from "./button-nJvDl3w8.js";
|
|
6
|
+
import { HugeiconsIcon as _ } from "@hugeicons/react";
|
|
7
|
+
import { Cancel01Icon as X, SearchIcon as ee, Tick02Icon as te } from "@hugeicons/core-free-icons";
|
|
8
|
+
import { c as oe, a as ae, u as ne, b as k, d as R, P as D, e as b, f as I, g as re, h as se, R as ie, i as le, F as de, D as ce } from "./index-CgfzsUO6.js";
|
|
9
|
+
import { createSlot as ue } from "@radix-ui/react-slot";
|
|
10
|
+
import { cva as M } from "class-variance-authority";
|
|
11
|
+
import { s as pe, S as ge, i as fe } from "./keyboard-pkY42Y3a.js";
|
|
12
|
+
var N = "Dialog", [F, et] = oe(N), [me, u] = F(N), G = (e) => {
|
|
13
|
+
const {
|
|
14
|
+
__scopeDialog: t,
|
|
15
|
+
children: a,
|
|
16
|
+
open: n,
|
|
17
|
+
defaultOpen: s,
|
|
18
|
+
onOpenChange: r,
|
|
19
|
+
modal: c = !0
|
|
20
|
+
} = e, d = i.useRef(null), f = i.useRef(null), [v, g] = ne({
|
|
21
|
+
prop: n,
|
|
22
|
+
defaultProp: s ?? !1,
|
|
23
|
+
onChange: r,
|
|
24
|
+
caller: N
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ o(
|
|
27
|
+
me,
|
|
28
|
+
{
|
|
29
|
+
scope: t,
|
|
30
|
+
triggerRef: d,
|
|
31
|
+
contentRef: f,
|
|
32
|
+
contentId: k(),
|
|
33
|
+
titleId: k(),
|
|
34
|
+
descriptionId: k(),
|
|
35
|
+
open: v,
|
|
36
|
+
onOpenChange: g,
|
|
37
|
+
onOpenToggle: i.useCallback(() => g((x) => !x), [g]),
|
|
38
|
+
modal: c,
|
|
39
|
+
children: a
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
G.displayName = N;
|
|
44
|
+
var W = "DialogTrigger", $ = i.forwardRef(
|
|
45
|
+
(e, t) => {
|
|
46
|
+
const { __scopeDialog: a, ...n } = e, s = u(W, a), r = R(t, s.triggerRef);
|
|
47
|
+
return /* @__PURE__ */ o(
|
|
48
|
+
D.button,
|
|
49
|
+
{
|
|
50
|
+
type: "button",
|
|
51
|
+
"aria-haspopup": "dialog",
|
|
52
|
+
"aria-expanded": s.open,
|
|
53
|
+
"aria-controls": s.contentId,
|
|
54
|
+
"data-state": O(s.open),
|
|
55
|
+
...n,
|
|
56
|
+
ref: r,
|
|
57
|
+
onClick: b(e.onClick, s.onOpenToggle)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
$.displayName = W;
|
|
63
|
+
var E = "DialogPortal", [he, L] = F(E, {
|
|
64
|
+
forceMount: void 0
|
|
65
|
+
}), B = (e) => {
|
|
66
|
+
const { __scopeDialog: t, forceMount: a, children: n, container: s } = e, r = u(E, t);
|
|
67
|
+
return /* @__PURE__ */ o(he, { scope: t, forceMount: a, children: i.Children.map(n, (c) => /* @__PURE__ */ o(I, { present: a || r.open, children: /* @__PURE__ */ o(re, { asChild: !0, container: s, children: c }) })) });
|
|
68
|
+
};
|
|
69
|
+
B.displayName = E;
|
|
70
|
+
var y = "DialogOverlay", j = i.forwardRef(
|
|
71
|
+
(e, t) => {
|
|
72
|
+
const a = L(y, e.__scopeDialog), { forceMount: n = a.forceMount, ...s } = e, r = u(y, e.__scopeDialog);
|
|
73
|
+
return r.modal ? /* @__PURE__ */ o(I, { present: n || r.open, children: /* @__PURE__ */ o(xe, { ...s, ref: t }) }) : null;
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
j.displayName = y;
|
|
77
|
+
var ve = ue("DialogOverlay.RemoveScroll"), xe = i.forwardRef(
|
|
78
|
+
(e, t) => {
|
|
79
|
+
const { __scopeDialog: a, ...n } = e, s = u(y, a);
|
|
80
|
+
return (
|
|
81
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
82
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
83
|
+
/* @__PURE__ */ o(ie, { as: ve, allowPinchZoom: !0, shards: [s.contentRef], children: /* @__PURE__ */ o(
|
|
84
|
+
D.div,
|
|
85
|
+
{
|
|
86
|
+
"data-state": O(s.open),
|
|
87
|
+
...n,
|
|
88
|
+
ref: t,
|
|
89
|
+
style: { pointerEvents: "auto", ...n.style }
|
|
90
|
+
}
|
|
91
|
+
) })
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
), m = "DialogContent", V = i.forwardRef(
|
|
95
|
+
(e, t) => {
|
|
96
|
+
const a = L(m, e.__scopeDialog), { forceMount: n = a.forceMount, ...s } = e, r = u(m, e.__scopeDialog);
|
|
97
|
+
return /* @__PURE__ */ o(I, { present: n || r.open, children: r.modal ? /* @__PURE__ */ o(be, { ...s, ref: t }) : /* @__PURE__ */ o(De, { ...s, ref: t }) });
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
V.displayName = m;
|
|
101
|
+
var be = i.forwardRef(
|
|
102
|
+
(e, t) => {
|
|
103
|
+
const a = u(m, e.__scopeDialog), n = i.useRef(null), s = R(t, a.contentRef, n);
|
|
104
|
+
return i.useEffect(() => {
|
|
105
|
+
const r = n.current;
|
|
106
|
+
if (r) return se(r);
|
|
107
|
+
}, []), /* @__PURE__ */ o(
|
|
108
|
+
H,
|
|
109
|
+
{
|
|
110
|
+
...e,
|
|
111
|
+
ref: s,
|
|
112
|
+
trapFocus: a.open,
|
|
113
|
+
disableOutsidePointerEvents: !0,
|
|
114
|
+
onCloseAutoFocus: b(e.onCloseAutoFocus, (r) => {
|
|
115
|
+
r.preventDefault(), a.triggerRef.current?.focus();
|
|
116
|
+
}),
|
|
117
|
+
onPointerDownOutside: b(e.onPointerDownOutside, (r) => {
|
|
118
|
+
const c = r.detail.originalEvent, d = c.button === 0 && c.ctrlKey === !0;
|
|
119
|
+
(c.button === 2 || d) && r.preventDefault();
|
|
120
|
+
}),
|
|
121
|
+
onFocusOutside: b(
|
|
122
|
+
e.onFocusOutside,
|
|
123
|
+
(r) => r.preventDefault()
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
), De = i.forwardRef(
|
|
129
|
+
(e, t) => {
|
|
130
|
+
const a = u(m, e.__scopeDialog), n = i.useRef(!1), s = i.useRef(!1);
|
|
131
|
+
return /* @__PURE__ */ o(
|
|
132
|
+
H,
|
|
133
|
+
{
|
|
134
|
+
...e,
|
|
135
|
+
ref: t,
|
|
136
|
+
trapFocus: !1,
|
|
137
|
+
disableOutsidePointerEvents: !1,
|
|
138
|
+
onCloseAutoFocus: (r) => {
|
|
139
|
+
e.onCloseAutoFocus?.(r), r.defaultPrevented || (n.current || a.triggerRef.current?.focus(), r.preventDefault()), n.current = !1, s.current = !1;
|
|
140
|
+
},
|
|
141
|
+
onInteractOutside: (r) => {
|
|
142
|
+
e.onInteractOutside?.(r), r.defaultPrevented || (n.current = !0, r.detail.originalEvent.type === "pointerdown" && (s.current = !0));
|
|
143
|
+
const c = r.target;
|
|
144
|
+
a.triggerRef.current?.contains(c) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && s.current && r.preventDefault();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
), H = i.forwardRef(
|
|
150
|
+
(e, t) => {
|
|
151
|
+
const { __scopeDialog: a, trapFocus: n, onOpenAutoFocus: s, onCloseAutoFocus: r, ...c } = e, d = u(m, a), f = i.useRef(null), v = R(t, f);
|
|
152
|
+
return le(), /* @__PURE__ */ p(z, { children: [
|
|
153
|
+
/* @__PURE__ */ o(
|
|
154
|
+
de,
|
|
155
|
+
{
|
|
156
|
+
asChild: !0,
|
|
157
|
+
loop: !0,
|
|
158
|
+
trapped: n,
|
|
159
|
+
onMountAutoFocus: s,
|
|
160
|
+
onUnmountAutoFocus: r,
|
|
161
|
+
children: /* @__PURE__ */ o(
|
|
162
|
+
ce,
|
|
163
|
+
{
|
|
164
|
+
role: "dialog",
|
|
165
|
+
id: d.contentId,
|
|
166
|
+
"aria-describedby": d.descriptionId,
|
|
167
|
+
"aria-labelledby": d.titleId,
|
|
168
|
+
"data-state": O(d.open),
|
|
169
|
+
...c,
|
|
170
|
+
ref: v,
|
|
171
|
+
onDismiss: () => d.onOpenChange(!1)
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ p(z, { children: [
|
|
177
|
+
/* @__PURE__ */ o(Ce, { titleId: d.titleId }),
|
|
178
|
+
/* @__PURE__ */ o(Ne, { contentRef: f, descriptionId: d.descriptionId })
|
|
179
|
+
] })
|
|
180
|
+
] });
|
|
181
|
+
}
|
|
182
|
+
), P = "DialogTitle", K = i.forwardRef(
|
|
183
|
+
(e, t) => {
|
|
184
|
+
const { __scopeDialog: a, ...n } = e, s = u(P, a);
|
|
185
|
+
return /* @__PURE__ */ o(D.h2, { id: s.titleId, ...n, ref: t });
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
K.displayName = P;
|
|
189
|
+
var q = "DialogDescription", U = i.forwardRef(
|
|
190
|
+
(e, t) => {
|
|
191
|
+
const { __scopeDialog: a, ...n } = e, s = u(q, a);
|
|
192
|
+
return /* @__PURE__ */ o(D.p, { id: s.descriptionId, ...n, ref: t });
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
U.displayName = q;
|
|
196
|
+
var Y = "DialogClose", Z = i.forwardRef(
|
|
197
|
+
(e, t) => {
|
|
198
|
+
const { __scopeDialog: a, ...n } = e, s = u(Y, a);
|
|
199
|
+
return /* @__PURE__ */ o(
|
|
200
|
+
D.button,
|
|
201
|
+
{
|
|
202
|
+
type: "button",
|
|
203
|
+
...n,
|
|
204
|
+
ref: t,
|
|
205
|
+
onClick: b(e.onClick, () => s.onOpenChange(!1))
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
Z.displayName = Y;
|
|
211
|
+
function O(e) {
|
|
212
|
+
return e ? "open" : "closed";
|
|
213
|
+
}
|
|
214
|
+
var J = "DialogTitleWarning", [tt, Q] = ae(J, {
|
|
215
|
+
contentName: m,
|
|
216
|
+
titleName: P,
|
|
217
|
+
docsSlug: "dialog"
|
|
218
|
+
}), Ce = ({ titleId: e }) => {
|
|
219
|
+
const t = Q(J), a = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
220
|
+
|
|
221
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
222
|
+
|
|
223
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
224
|
+
return i.useEffect(() => {
|
|
225
|
+
e && (document.getElementById(e) || console.error(a));
|
|
226
|
+
}, [a, e]), null;
|
|
227
|
+
}, ye = "DialogDescriptionWarning", Ne = ({ contentRef: e, descriptionId: t }) => {
|
|
228
|
+
const n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q(ye).contentName}}.`;
|
|
229
|
+
return i.useEffect(() => {
|
|
230
|
+
const s = e.current?.getAttribute("aria-describedby");
|
|
231
|
+
t && s && (document.getElementById(t) || console.warn(n));
|
|
232
|
+
}, [n, e, t]), null;
|
|
233
|
+
}, ke = G, we = $, _e = B, Re = j, Ie = V, Ee = K, Pe = U, T = Z;
|
|
234
|
+
function Oe({
|
|
235
|
+
...e
|
|
236
|
+
}) {
|
|
237
|
+
return /* @__PURE__ */ o(ke, { "data-slot": "dialog", ...e });
|
|
238
|
+
}
|
|
239
|
+
function ot({
|
|
240
|
+
...e
|
|
241
|
+
}) {
|
|
242
|
+
return /* @__PURE__ */ o(we, { "data-slot": "dialog-trigger", ...e });
|
|
243
|
+
}
|
|
244
|
+
function Te({
|
|
245
|
+
...e
|
|
246
|
+
}) {
|
|
247
|
+
return /* @__PURE__ */ o(_e, { "data-slot": "dialog-portal", ...e });
|
|
248
|
+
}
|
|
249
|
+
function at({
|
|
250
|
+
...e
|
|
251
|
+
}) {
|
|
252
|
+
return /* @__PURE__ */ o(T, { "data-slot": "dialog-close", ...e });
|
|
253
|
+
}
|
|
254
|
+
function Se({
|
|
255
|
+
className: e,
|
|
256
|
+
...t
|
|
257
|
+
}) {
|
|
258
|
+
return /* @__PURE__ */ o(
|
|
259
|
+
Re,
|
|
260
|
+
{
|
|
261
|
+
"data-slot": "dialog-overlay",
|
|
262
|
+
className: l("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-[var(--z-modal-backdrop)]", e),
|
|
263
|
+
...t
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
function Ae({
|
|
268
|
+
className: e,
|
|
269
|
+
children: t,
|
|
270
|
+
showCloseButton: a = !0,
|
|
271
|
+
...n
|
|
272
|
+
}) {
|
|
273
|
+
return /* @__PURE__ */ p(Te, { children: [
|
|
274
|
+
/* @__PURE__ */ o(Se, {}),
|
|
275
|
+
/* @__PURE__ */ p(
|
|
276
|
+
Ie,
|
|
277
|
+
{
|
|
278
|
+
"data-slot": "dialog-content",
|
|
279
|
+
className: l(
|
|
280
|
+
"bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-[var(--z-modal)] w-full -translate-x-1/2 -translate-y-1/2",
|
|
281
|
+
e
|
|
282
|
+
),
|
|
283
|
+
...n,
|
|
284
|
+
children: [
|
|
285
|
+
t,
|
|
286
|
+
a && /* @__PURE__ */ o(T, { "data-slot": "dialog-close", asChild: !0, children: /* @__PURE__ */ p(w, { variant: "ghost", className: "absolute top-2 right-2", size: "icon", children: [
|
|
287
|
+
/* @__PURE__ */ o(_, { icon: X, strokeWidth: 2 }),
|
|
288
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
289
|
+
] }) })
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
] });
|
|
294
|
+
}
|
|
295
|
+
function ze({ className: e, ...t }) {
|
|
296
|
+
return /* @__PURE__ */ o(
|
|
297
|
+
"div",
|
|
298
|
+
{
|
|
299
|
+
"data-slot": "dialog-header",
|
|
300
|
+
className: l("gap-1 flex flex-col", e),
|
|
301
|
+
...t
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
function nt({
|
|
306
|
+
className: e,
|
|
307
|
+
showCloseButton: t = !1,
|
|
308
|
+
children: a,
|
|
309
|
+
...n
|
|
310
|
+
}) {
|
|
311
|
+
return /* @__PURE__ */ p(
|
|
312
|
+
"div",
|
|
313
|
+
{
|
|
314
|
+
"data-slot": "dialog-footer",
|
|
315
|
+
className: l(
|
|
316
|
+
"gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
317
|
+
e
|
|
318
|
+
),
|
|
319
|
+
...n,
|
|
320
|
+
children: [
|
|
321
|
+
a,
|
|
322
|
+
t && /* @__PURE__ */ o(T, { asChild: !0, children: /* @__PURE__ */ o(w, { variant: "outline", children: "Close" }) })
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
function Me({
|
|
328
|
+
className: e,
|
|
329
|
+
...t
|
|
330
|
+
}) {
|
|
331
|
+
return /* @__PURE__ */ o(
|
|
332
|
+
Ee,
|
|
333
|
+
{
|
|
334
|
+
"data-slot": "dialog-title",
|
|
335
|
+
className: l("text-sm font-medium", e),
|
|
336
|
+
...t
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
function Fe({
|
|
341
|
+
className: e,
|
|
342
|
+
...t
|
|
343
|
+
}) {
|
|
344
|
+
return /* @__PURE__ */ o(
|
|
345
|
+
Pe,
|
|
346
|
+
{
|
|
347
|
+
"data-slot": "dialog-description",
|
|
348
|
+
className: l("text-muted-foreground *:[a]:hover:text-foreground text-xs *:[a]:underline *:[a]:underline-offset-3", e),
|
|
349
|
+
...t
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
function Ge({ className: e, ...t }) {
|
|
354
|
+
return /* @__PURE__ */ o(
|
|
355
|
+
"div",
|
|
356
|
+
{
|
|
357
|
+
"data-slot": "input-group",
|
|
358
|
+
role: "group",
|
|
359
|
+
className: l(
|
|
360
|
+
"border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-lg border transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",
|
|
361
|
+
e
|
|
362
|
+
),
|
|
363
|
+
...t
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
const We = M(
|
|
368
|
+
"text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none",
|
|
369
|
+
{
|
|
370
|
+
variants: {
|
|
371
|
+
align: {
|
|
372
|
+
"inline-start": "pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first",
|
|
373
|
+
"inline-end": "pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last",
|
|
374
|
+
"block-start": "px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start",
|
|
375
|
+
"block-end": "px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
defaultVariants: {
|
|
379
|
+
align: "inline-start"
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
function $e({
|
|
384
|
+
className: e,
|
|
385
|
+
align: t = "inline-start",
|
|
386
|
+
...a
|
|
387
|
+
}) {
|
|
388
|
+
return /* @__PURE__ */ o(
|
|
389
|
+
"div",
|
|
390
|
+
{
|
|
391
|
+
role: "group",
|
|
392
|
+
"data-slot": "input-group-addon",
|
|
393
|
+
"data-align": t,
|
|
394
|
+
className: l(We({ align: t }), e),
|
|
395
|
+
onClick: (n) => {
|
|
396
|
+
n.target.closest("button") || n.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
397
|
+
},
|
|
398
|
+
...a
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
const Le = M(
|
|
403
|
+
"gap-2 text-sm flex items-center shadow-none",
|
|
404
|
+
{
|
|
405
|
+
variants: {
|
|
406
|
+
size: {
|
|
407
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
408
|
+
sm: "",
|
|
409
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
410
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
defaultVariants: {
|
|
414
|
+
size: "xs"
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
function rt({
|
|
419
|
+
className: e,
|
|
420
|
+
type: t = "button",
|
|
421
|
+
variant: a = "ghost",
|
|
422
|
+
size: n = "xs",
|
|
423
|
+
...s
|
|
424
|
+
}) {
|
|
425
|
+
return /* @__PURE__ */ o(
|
|
426
|
+
w,
|
|
427
|
+
{
|
|
428
|
+
type: t,
|
|
429
|
+
"data-size": n,
|
|
430
|
+
variant: a,
|
|
431
|
+
className: l(Le({ size: n }), e),
|
|
432
|
+
...s
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
function st({ className: e, ...t }) {
|
|
437
|
+
return /* @__PURE__ */ o(
|
|
438
|
+
"span",
|
|
439
|
+
{
|
|
440
|
+
className: l(
|
|
441
|
+
"text-muted-foreground gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none",
|
|
442
|
+
e
|
|
443
|
+
),
|
|
444
|
+
...t
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function it({
|
|
449
|
+
className: e,
|
|
450
|
+
...t
|
|
451
|
+
}) {
|
|
452
|
+
return /* @__PURE__ */ o(
|
|
453
|
+
"input",
|
|
454
|
+
{
|
|
455
|
+
"data-slot": "input-group-control",
|
|
456
|
+
className: l(
|
|
457
|
+
"flex h-7 w-full rounded-none border-0 bg-transparent px-3 py-1.5 text-sm shadow-none ring-0 outline-none file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent dark:placeholder:text-muted-foreground/70 flex-1",
|
|
458
|
+
e
|
|
459
|
+
),
|
|
460
|
+
...t
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
function lt({
|
|
465
|
+
className: e,
|
|
466
|
+
...t
|
|
467
|
+
}) {
|
|
468
|
+
return /* @__PURE__ */ o(
|
|
469
|
+
"textarea",
|
|
470
|
+
{
|
|
471
|
+
"data-slot": "input-group-control",
|
|
472
|
+
className: l(
|
|
473
|
+
"flex h-auto w-full min-h-[2.5rem] rounded-none resize-none border-0 bg-transparent px-3 py-1.5 text-sm shadow-none ring-0 outline-none placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent dark:placeholder:text-muted-foreground/70",
|
|
474
|
+
e
|
|
475
|
+
),
|
|
476
|
+
...t
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
function Be({
|
|
481
|
+
className: e,
|
|
482
|
+
...t
|
|
483
|
+
}) {
|
|
484
|
+
return /* @__PURE__ */ o(
|
|
485
|
+
h,
|
|
486
|
+
{
|
|
487
|
+
"data-slot": "command",
|
|
488
|
+
className: l(
|
|
489
|
+
"bg-popover text-popover-foreground rounded-xl p-1 flex size-full flex-col overflow-hidden",
|
|
490
|
+
e
|
|
491
|
+
),
|
|
492
|
+
...t
|
|
493
|
+
}
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
function je({
|
|
497
|
+
title: e = "Command Palette",
|
|
498
|
+
description: t = "Search for a command to run...",
|
|
499
|
+
children: a,
|
|
500
|
+
className: n,
|
|
501
|
+
showCloseButton: s = !1,
|
|
502
|
+
...r
|
|
503
|
+
}) {
|
|
504
|
+
return /* @__PURE__ */ p(Oe, { ...r, children: [
|
|
505
|
+
/* @__PURE__ */ p(ze, { className: "sr-only", children: [
|
|
506
|
+
/* @__PURE__ */ o(Me, { children: e }),
|
|
507
|
+
/* @__PURE__ */ o(Fe, { children: t })
|
|
508
|
+
] }),
|
|
509
|
+
/* @__PURE__ */ o(
|
|
510
|
+
Ae,
|
|
511
|
+
{
|
|
512
|
+
className: l("rounded-xl! p-0 overflow-hidden p-0", n),
|
|
513
|
+
showCloseButton: s,
|
|
514
|
+
children: a
|
|
515
|
+
}
|
|
516
|
+
)
|
|
517
|
+
] });
|
|
518
|
+
}
|
|
519
|
+
function dt({
|
|
520
|
+
className: e,
|
|
521
|
+
...t
|
|
522
|
+
}) {
|
|
523
|
+
return /* @__PURE__ */ o("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: /* @__PURE__ */ p(Ge, { className: "bg-input/20 dark:bg-input/30", children: [
|
|
524
|
+
/* @__PURE__ */ o(
|
|
525
|
+
h.Input,
|
|
526
|
+
{
|
|
527
|
+
"data-slot": "command-input",
|
|
528
|
+
className: l(
|
|
529
|
+
"w-full text-xs outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
530
|
+
e
|
|
531
|
+
),
|
|
532
|
+
...t
|
|
533
|
+
}
|
|
534
|
+
),
|
|
535
|
+
/* @__PURE__ */ o($e, { children: /* @__PURE__ */ o(_, { icon: ee, strokeWidth: 2, className: "size-3.5 shrink-0 opacity-50" }) })
|
|
536
|
+
] }) });
|
|
537
|
+
}
|
|
538
|
+
function ct({
|
|
539
|
+
className: e,
|
|
540
|
+
...t
|
|
541
|
+
}) {
|
|
542
|
+
return /* @__PURE__ */ o(
|
|
543
|
+
h.List,
|
|
544
|
+
{
|
|
545
|
+
"data-slot": "command-list",
|
|
546
|
+
className: l(
|
|
547
|
+
"no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",
|
|
548
|
+
e
|
|
549
|
+
),
|
|
550
|
+
...t
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
function ut({
|
|
555
|
+
className: e,
|
|
556
|
+
...t
|
|
557
|
+
}) {
|
|
558
|
+
return /* @__PURE__ */ o(
|
|
559
|
+
h.Empty,
|
|
560
|
+
{
|
|
561
|
+
"data-slot": "command-empty",
|
|
562
|
+
className: l("py-6 text-center text-xs", e),
|
|
563
|
+
...t
|
|
564
|
+
}
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
function pt({
|
|
568
|
+
className: e,
|
|
569
|
+
...t
|
|
570
|
+
}) {
|
|
571
|
+
return /* @__PURE__ */ o(
|
|
572
|
+
h.Group,
|
|
573
|
+
{
|
|
574
|
+
"data-slot": "command-group",
|
|
575
|
+
className: l("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", e),
|
|
576
|
+
...t
|
|
577
|
+
}
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
function gt({
|
|
581
|
+
className: e,
|
|
582
|
+
...t
|
|
583
|
+
}) {
|
|
584
|
+
return /* @__PURE__ */ o(
|
|
585
|
+
h.Separator,
|
|
586
|
+
{
|
|
587
|
+
"data-slot": "command-separator",
|
|
588
|
+
className: l("bg-border/50 -mx-1 my-1 h-px", e),
|
|
589
|
+
...t
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
function ft({
|
|
594
|
+
className: e,
|
|
595
|
+
children: t,
|
|
596
|
+
...a
|
|
597
|
+
}) {
|
|
598
|
+
return /* @__PURE__ */ p(
|
|
599
|
+
h.Item,
|
|
600
|
+
{
|
|
601
|
+
"data-slot": "command-item",
|
|
602
|
+
className: l(
|
|
603
|
+
"data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs outline-hidden select-none [&_svg:not([class*='size-'])]:size-3.5 [[data-slot=dialog-content]_&]:rounded-md group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
604
|
+
e
|
|
605
|
+
),
|
|
606
|
+
...a,
|
|
607
|
+
children: [
|
|
608
|
+
t,
|
|
609
|
+
/* @__PURE__ */ o(_, { icon: te, strokeWidth: 2, className: "ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
function mt({
|
|
615
|
+
className: e,
|
|
616
|
+
...t
|
|
617
|
+
}) {
|
|
618
|
+
return /* @__PURE__ */ o(
|
|
619
|
+
"span",
|
|
620
|
+
{
|
|
621
|
+
"data-slot": "command-shortcut",
|
|
622
|
+
className: l("text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-[0.625rem] tracking-widest", e),
|
|
623
|
+
...t
|
|
624
|
+
}
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
function ht({
|
|
628
|
+
title: e = "Command Palette",
|
|
629
|
+
description: t = "Search for a command to run...",
|
|
630
|
+
shortcutEnabled: a = !0,
|
|
631
|
+
open: n,
|
|
632
|
+
onOpenChange: s,
|
|
633
|
+
children: r,
|
|
634
|
+
...c
|
|
635
|
+
}) {
|
|
636
|
+
const [d, f] = i.useState(!1), v = n !== void 0, g = v ? n : d, x = v ? s : f, S = i.useRef(g);
|
|
637
|
+
return i.useEffect(() => {
|
|
638
|
+
S.current = g;
|
|
639
|
+
}, [g]), i.useEffect(() => {
|
|
640
|
+
if (!a) return;
|
|
641
|
+
const A = (C) => {
|
|
642
|
+
pe(C.target) || C.key === ge.commandPalette && fe(C) && (C.preventDefault(), x?.(!S.current));
|
|
643
|
+
};
|
|
644
|
+
return window.addEventListener("keydown", A), () => window.removeEventListener("keydown", A);
|
|
645
|
+
}, [a, x]), /* @__PURE__ */ o(
|
|
646
|
+
je,
|
|
647
|
+
{
|
|
648
|
+
...c,
|
|
649
|
+
title: e,
|
|
650
|
+
description: t,
|
|
651
|
+
open: g,
|
|
652
|
+
onOpenChange: x,
|
|
653
|
+
children: /* @__PURE__ */ o(Be, { children: r })
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
}
|
|
657
|
+
export {
|
|
658
|
+
st as A,
|
|
659
|
+
lt as B,
|
|
660
|
+
Be as C,
|
|
661
|
+
Pe as D,
|
|
662
|
+
Ge as I,
|
|
663
|
+
Re as O,
|
|
664
|
+
_e as P,
|
|
665
|
+
ke as R,
|
|
666
|
+
we as T,
|
|
667
|
+
tt as W,
|
|
668
|
+
je as a,
|
|
669
|
+
dt as b,
|
|
670
|
+
ct as c,
|
|
671
|
+
ut as d,
|
|
672
|
+
pt as e,
|
|
673
|
+
ft as f,
|
|
674
|
+
mt as g,
|
|
675
|
+
gt as h,
|
|
676
|
+
ht as i,
|
|
677
|
+
et as j,
|
|
678
|
+
Ie as k,
|
|
679
|
+
Ee as l,
|
|
680
|
+
T as m,
|
|
681
|
+
it as n,
|
|
682
|
+
$e as o,
|
|
683
|
+
rt as p,
|
|
684
|
+
Oe as q,
|
|
685
|
+
ot as r,
|
|
686
|
+
at as s,
|
|
687
|
+
Ae as t,
|
|
688
|
+
ze as u,
|
|
689
|
+
nt as v,
|
|
690
|
+
Me as w,
|
|
691
|
+
Fe as x,
|
|
692
|
+
Se as y,
|
|
693
|
+
Te as z
|
|
694
|
+
};
|
package/dist/command.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./command-palette-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./command-palette-BuYcxPCc.cjs");exports.Command=m.Command;exports.CommandDialog=m.CommandDialog;exports.CommandEmpty=m.CommandEmpty;exports.CommandGroup=m.CommandGroup;exports.CommandInput=m.CommandInput;exports.CommandItem=m.CommandItem;exports.CommandList=m.CommandList;exports.CommandPalette=m.CommandPalette;exports.CommandSeparator=m.CommandSeparator;exports.CommandShortcut=m.CommandShortcut;
|
package/dist/command.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as o, a as d, d as n, e as s, b as C, f as t, c as e, i as r, h as p, g as i } from "./command-palette-
|
|
1
|
+
import { C as o, a as d, d as n, e as s, b as C, f as t, c as e, i as r, h as p, g as i } from "./command-palette-dEJ9aEk4.js";
|
|
2
2
|
export {
|
|
3
3
|
o as Command,
|
|
4
4
|
d as CommandDialog,
|