@ucdjs-internal/shared-ui 0.1.6 → 0.1.7
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 +0 -3
- package/dist/components/index.d.mts +2 -1
- package/dist/components/index.mjs +2 -2
- package/dist/components/shiki-code.mjs +1 -3
- package/dist/components/theme-toggle.mjs +1 -3
- package/dist/components/ucd-logo.d.mts +10 -0
- package/dist/components/ucd-logo.mjs +61 -0
- package/dist/hooks/index.mjs +1 -2
- package/dist/hooks/use-clipboard.mjs +2 -4
- package/dist/hooks/use-mobile.mjs +1 -3
- package/dist/hooks/use-theme.mjs +1 -3
- package/dist/index.mjs +1 -2
- package/dist/lib/theme-script.mjs +1 -2
- package/dist/lib/utils.mjs +1 -3
- package/dist/ui/alert-dialog.mjs +2 -3
- package/dist/ui/avatar.mjs +2 -3
- package/dist/ui/badge.mjs +1 -3
- package/dist/ui/breadcrumb.mjs +2 -3
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/button.mjs +1 -3
- package/dist/ui/card.mjs +2 -3
- package/dist/ui/checkbox.mjs +1 -3
- package/dist/ui/collapsible.mjs +1 -3
- package/dist/ui/combobox.mjs +1 -3
- package/dist/ui/command.d.mts +52 -13
- package/dist/ui/command.mjs +327 -89
- package/dist/ui/context-menu.mjs +2 -3
- package/dist/ui/dialog.d.mts +2 -0
- package/dist/ui/dialog.mjs +41 -31
- package/dist/ui/dropdown-menu.mjs +2 -3
- package/dist/ui/field.mjs +1 -3
- package/dist/ui/input-group.mjs +2 -3
- package/dist/ui/input.mjs +2 -3
- package/dist/ui/label.mjs +2 -3
- package/dist/ui/scroll-area.mjs +2 -3
- package/dist/ui/select.mjs +2 -3
- package/dist/ui/separator.mjs +1 -3
- package/dist/ui/sheet.mjs +2 -3
- package/dist/ui/sidebar.d.mts +1 -1
- package/dist/ui/sidebar.mjs +3 -5
- package/dist/ui/skeleton.mjs +1 -3
- package/dist/ui/table.mjs +2 -3
- package/dist/ui/textarea.mjs +2 -3
- package/dist/ui/tooltip.mjs +1 -3
- package/dist/vscode/syntaxes/ucd.tmLanguage.mjs +1 -2
- package/package.json +15 -15
- package/dist/vendor/cmdk/command-score.mjs +0 -62
- package/dist/vendor/cmdk/index.d.mts +0 -181
- package/dist/vendor/cmdk/index.mjs +0 -713
package/dist/ui/command.mjs
CHANGED
|
@@ -1,13 +1,52 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.mjs";
|
|
2
2
|
import { InputGroup, InputGroupAddon } from "./input-group.mjs";
|
|
3
3
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./dialog.mjs";
|
|
4
|
-
import
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { c } from "react/compiler-runtime";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import { SearchIcon } from "lucide-react";
|
|
8
|
+
import { Command as Command$1, createCommandPalette, useCommandActions, useCommandShortcutDefault } from "@cmdi/base-ui";
|
|
9
9
|
//#region src/ui/command.tsx
|
|
10
|
-
|
|
10
|
+
const commandRootClassName = "bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden";
|
|
11
|
+
const commandDialogOverlayClassName = "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50";
|
|
12
|
+
const commandDialogContentClassName = "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 fixed top-1/3 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 translate-y-0 gap-4 overflow-hidden rounded-xl p-0 text-sm ring-1 duration-100 outline-none sm:max-w-sm";
|
|
13
|
+
const commandItemClassName = "data-selected:bg-muted data-selected:text-foreground data-selected:**:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
14
|
+
const commandActionsClassName = [
|
|
15
|
+
"**:[[cmd-item]]:data-selected:bg-muted",
|
|
16
|
+
"**:[[cmd-item]]:data-selected:text-foreground",
|
|
17
|
+
"**:[[cmd-item]]:relative",
|
|
18
|
+
"**:[[cmd-item]]:flex",
|
|
19
|
+
"**:[[cmd-item]]:cursor-default",
|
|
20
|
+
"**:[[cmd-item]]:items-center",
|
|
21
|
+
"**:[[cmd-item]]:gap-2",
|
|
22
|
+
"**:[[cmd-item]]:rounded-sm",
|
|
23
|
+
"**:[[cmd-item]]:px-2",
|
|
24
|
+
"**:[[cmd-item]]:py-1.5",
|
|
25
|
+
"**:[[cmd-item]]:text-sm",
|
|
26
|
+
"**:[[cmd-item]]:outline-hidden",
|
|
27
|
+
"**:[[cmd-item]]:select-none",
|
|
28
|
+
"**:[[cmd-item]]:data-[disabled=true]:pointer-events-none",
|
|
29
|
+
"**:[[cmd-item]]:data-[disabled=true]:opacity-50",
|
|
30
|
+
"**:[[cmd-item]]:[&_svg:not([class*='size-'])]:size-4",
|
|
31
|
+
"**:[[cmd-item]]:[&_svg]:pointer-events-none",
|
|
32
|
+
"**:[[cmd-item]]:[&_svg]:shrink-0",
|
|
33
|
+
"**:[[cmd-item]>[data-slot='shortcut']]:text-muted-foreground",
|
|
34
|
+
"**:[[cmd-item]>[data-slot='shortcut']]:ml-auto",
|
|
35
|
+
"**:[[cmd-item]>[data-slot='shortcut']]:text-xs",
|
|
36
|
+
"**:[[cmd-item]>[data-slot='shortcut']]:tracking-widest"
|
|
37
|
+
].join(" ");
|
|
38
|
+
function usePaletteId(palette) {
|
|
39
|
+
const $ = c(2);
|
|
40
|
+
const t0 = React.useId();
|
|
41
|
+
let t1;
|
|
42
|
+
if ($[0] !== t0) {
|
|
43
|
+
t1 = t0.replaceAll(":", "");
|
|
44
|
+
$[0] = t0;
|
|
45
|
+
$[1] = t1;
|
|
46
|
+
} else t1 = $[1];
|
|
47
|
+
return palette ?? `command-${t1}`;
|
|
48
|
+
}
|
|
49
|
+
function CommandRoot(t0) {
|
|
11
50
|
const $ = c(8);
|
|
12
51
|
let className;
|
|
13
52
|
let props;
|
|
@@ -22,13 +61,13 @@ function Command(t0) {
|
|
|
22
61
|
}
|
|
23
62
|
let t1;
|
|
24
63
|
if ($[3] !== className) {
|
|
25
|
-
t1 = cn(
|
|
64
|
+
t1 = cn(commandRootClassName, className);
|
|
26
65
|
$[3] = className;
|
|
27
66
|
$[4] = t1;
|
|
28
67
|
} else t1 = $[4];
|
|
29
68
|
let t2;
|
|
30
69
|
if ($[5] !== props || $[6] !== t1) {
|
|
31
|
-
t2 = /* @__PURE__ */ jsx(
|
|
70
|
+
t2 = /* @__PURE__ */ jsx(Command$1, {
|
|
32
71
|
"data-slot": "command",
|
|
33
72
|
className: t1,
|
|
34
73
|
...props
|
|
@@ -39,86 +78,216 @@ function Command(t0) {
|
|
|
39
78
|
} else t2 = $[7];
|
|
40
79
|
return t2;
|
|
41
80
|
}
|
|
81
|
+
function CommandDialogRoot(t0) {
|
|
82
|
+
const $ = c(26);
|
|
83
|
+
const { children, open, onOpenChange, defaultOpen, className, overlayClassName, contentClassName, palette, value, defaultValue, filter, shouldFilter, loop, onValueChange, label } = t0;
|
|
84
|
+
let t1;
|
|
85
|
+
if ($[0] !== overlayClassName) {
|
|
86
|
+
t1 = cn(commandDialogOverlayClassName, overlayClassName);
|
|
87
|
+
$[0] = overlayClassName;
|
|
88
|
+
$[1] = t1;
|
|
89
|
+
} else t1 = $[1];
|
|
90
|
+
let t2;
|
|
91
|
+
if ($[2] !== contentClassName) {
|
|
92
|
+
t2 = cn(commandDialogContentClassName, contentClassName);
|
|
93
|
+
$[2] = contentClassName;
|
|
94
|
+
$[3] = t2;
|
|
95
|
+
} else t2 = $[3];
|
|
96
|
+
const t3 = usePaletteId(palette);
|
|
97
|
+
let t4;
|
|
98
|
+
if ($[4] !== className) {
|
|
99
|
+
t4 = cn(commandRootClassName, className);
|
|
100
|
+
$[4] = className;
|
|
101
|
+
$[5] = t4;
|
|
102
|
+
} else t4 = $[5];
|
|
103
|
+
let t5;
|
|
104
|
+
if ($[6] !== children || $[7] !== defaultValue || $[8] !== filter || $[9] !== label || $[10] !== loop || $[11] !== onValueChange || $[12] !== shouldFilter || $[13] !== t3 || $[14] !== t4 || $[15] !== value) {
|
|
105
|
+
t5 = /* @__PURE__ */ jsx(Command$1, {
|
|
106
|
+
"data-slot": "command-dialog",
|
|
107
|
+
palette: t3,
|
|
108
|
+
value,
|
|
109
|
+
defaultValue,
|
|
110
|
+
filter,
|
|
111
|
+
shouldFilter,
|
|
112
|
+
loop,
|
|
113
|
+
onValueChange,
|
|
114
|
+
label,
|
|
115
|
+
className: t4,
|
|
116
|
+
children
|
|
117
|
+
});
|
|
118
|
+
$[6] = children;
|
|
119
|
+
$[7] = defaultValue;
|
|
120
|
+
$[8] = filter;
|
|
121
|
+
$[9] = label;
|
|
122
|
+
$[10] = loop;
|
|
123
|
+
$[11] = onValueChange;
|
|
124
|
+
$[12] = shouldFilter;
|
|
125
|
+
$[13] = t3;
|
|
126
|
+
$[14] = t4;
|
|
127
|
+
$[15] = value;
|
|
128
|
+
$[16] = t5;
|
|
129
|
+
} else t5 = $[16];
|
|
130
|
+
let t6;
|
|
131
|
+
if ($[17] !== t1 || $[18] !== t2 || $[19] !== t5) {
|
|
132
|
+
t6 = /* @__PURE__ */ jsx(DialogContent, {
|
|
133
|
+
overlayClassName: t1,
|
|
134
|
+
className: t2,
|
|
135
|
+
showCloseButton: false,
|
|
136
|
+
children: t5
|
|
137
|
+
});
|
|
138
|
+
$[17] = t1;
|
|
139
|
+
$[18] = t2;
|
|
140
|
+
$[19] = t5;
|
|
141
|
+
$[20] = t6;
|
|
142
|
+
} else t6 = $[20];
|
|
143
|
+
let t7;
|
|
144
|
+
if ($[21] !== defaultOpen || $[22] !== onOpenChange || $[23] !== open || $[24] !== t6) {
|
|
145
|
+
t7 = /* @__PURE__ */ jsx(Dialog, {
|
|
146
|
+
open,
|
|
147
|
+
onOpenChange,
|
|
148
|
+
defaultOpen,
|
|
149
|
+
children: t6
|
|
150
|
+
});
|
|
151
|
+
$[21] = defaultOpen;
|
|
152
|
+
$[22] = onOpenChange;
|
|
153
|
+
$[23] = open;
|
|
154
|
+
$[24] = t6;
|
|
155
|
+
$[25] = t7;
|
|
156
|
+
} else t7 = $[25];
|
|
157
|
+
return t7;
|
|
158
|
+
}
|
|
42
159
|
function CommandDialog(t0) {
|
|
43
|
-
const $ = c(
|
|
160
|
+
const $ = c(43);
|
|
44
161
|
let children;
|
|
45
162
|
let className;
|
|
163
|
+
let contentClassName;
|
|
164
|
+
let overlayClassName;
|
|
165
|
+
let palette;
|
|
46
166
|
let props;
|
|
47
167
|
let t1;
|
|
48
168
|
let t2;
|
|
49
169
|
let t3;
|
|
50
170
|
if ($[0] !== t0) {
|
|
51
|
-
({title: t1, description: t2, children, className, showCloseButton: t3, ...props} = t0);
|
|
171
|
+
({title: t1, description: t2, children, className, overlayClassName, contentClassName, palette, showCloseButton: t3, ...props} = t0);
|
|
52
172
|
$[0] = t0;
|
|
53
173
|
$[1] = children;
|
|
54
174
|
$[2] = className;
|
|
55
|
-
$[3] =
|
|
56
|
-
$[4] =
|
|
57
|
-
$[5] =
|
|
58
|
-
$[6] =
|
|
175
|
+
$[3] = contentClassName;
|
|
176
|
+
$[4] = overlayClassName;
|
|
177
|
+
$[5] = palette;
|
|
178
|
+
$[6] = props;
|
|
179
|
+
$[7] = t1;
|
|
180
|
+
$[8] = t2;
|
|
181
|
+
$[9] = t3;
|
|
59
182
|
} else {
|
|
60
183
|
children = $[1];
|
|
61
184
|
className = $[2];
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
185
|
+
contentClassName = $[3];
|
|
186
|
+
overlayClassName = $[4];
|
|
187
|
+
palette = $[5];
|
|
188
|
+
props = $[6];
|
|
189
|
+
t1 = $[7];
|
|
190
|
+
t2 = $[8];
|
|
191
|
+
t3 = $[9];
|
|
66
192
|
}
|
|
67
193
|
const title = t1 === void 0 ? "Command Palette" : t1;
|
|
68
|
-
const
|
|
194
|
+
const _description = t2 === void 0 ? "Search for a command to run..." : t2;
|
|
69
195
|
const showCloseButton = t3 === void 0 ? false : t3;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
$[7] = title;
|
|
74
|
-
$[8] = t4;
|
|
75
|
-
} else t4 = $[8];
|
|
76
|
-
let t5;
|
|
77
|
-
if ($[9] !== description) {
|
|
78
|
-
t5 = /* @__PURE__ */ jsx(DialogDescription, { children: description });
|
|
79
|
-
$[9] = description;
|
|
80
|
-
$[10] = t5;
|
|
81
|
-
} else t5 = $[10];
|
|
82
|
-
let t6;
|
|
83
|
-
if ($[11] !== t4 || $[12] !== t5) {
|
|
84
|
-
t6 = /* @__PURE__ */ jsxs(DialogHeader, {
|
|
85
|
-
className: "sr-only",
|
|
86
|
-
children: [t4, t5]
|
|
87
|
-
});
|
|
88
|
-
$[11] = t4;
|
|
89
|
-
$[12] = t5;
|
|
90
|
-
$[13] = t6;
|
|
91
|
-
} else t6 = $[13];
|
|
196
|
+
const t4 = props.open;
|
|
197
|
+
const t5 = props.onOpenChange;
|
|
198
|
+
const t6 = props.defaultOpen;
|
|
92
199
|
let t7;
|
|
93
|
-
if ($[
|
|
94
|
-
t7 =
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
} else t7 = $[
|
|
200
|
+
if ($[10] !== title) {
|
|
201
|
+
t7 = /* @__PURE__ */ jsx(DialogTitle, { children: title });
|
|
202
|
+
$[10] = title;
|
|
203
|
+
$[11] = t7;
|
|
204
|
+
} else t7 = $[11];
|
|
98
205
|
let t8;
|
|
99
|
-
if ($[
|
|
100
|
-
t8 = /* @__PURE__ */ jsx(
|
|
101
|
-
|
|
102
|
-
|
|
206
|
+
if ($[12] !== _description) {
|
|
207
|
+
t8 = /* @__PURE__ */ jsx(DialogDescription, { children: _description });
|
|
208
|
+
$[12] = _description;
|
|
209
|
+
$[13] = t8;
|
|
210
|
+
} else t8 = $[13];
|
|
211
|
+
let t9;
|
|
212
|
+
if ($[14] !== t7 || $[15] !== t8) {
|
|
213
|
+
t9 = /* @__PURE__ */ jsxs(DialogHeader, {
|
|
214
|
+
className: "sr-only",
|
|
215
|
+
children: [t7, t8]
|
|
216
|
+
});
|
|
217
|
+
$[14] = t7;
|
|
218
|
+
$[15] = t8;
|
|
219
|
+
$[16] = t9;
|
|
220
|
+
} else t9 = $[16];
|
|
221
|
+
let t10;
|
|
222
|
+
if ($[17] !== overlayClassName) {
|
|
223
|
+
t10 = cn(commandDialogOverlayClassName, overlayClassName);
|
|
224
|
+
$[17] = overlayClassName;
|
|
225
|
+
$[18] = t10;
|
|
226
|
+
} else t10 = $[18];
|
|
227
|
+
let t11;
|
|
228
|
+
if ($[19] !== className || $[20] !== contentClassName) {
|
|
229
|
+
t11 = cn(commandDialogContentClassName, contentClassName, className);
|
|
230
|
+
$[19] = className;
|
|
231
|
+
$[20] = contentClassName;
|
|
232
|
+
$[21] = t11;
|
|
233
|
+
} else t11 = $[21];
|
|
234
|
+
const t12 = usePaletteId(palette);
|
|
235
|
+
let t13;
|
|
236
|
+
if ($[22] !== children || $[23] !== props.defaultValue || $[24] !== props.filter || $[25] !== props.loop || $[26] !== props.onValueChange || $[27] !== props.shouldFilter || $[28] !== props.value || $[29] !== t12 || $[30] !== title) {
|
|
237
|
+
t13 = /* @__PURE__ */ jsx(Command$1, {
|
|
238
|
+
"data-slot": "command-dialog",
|
|
239
|
+
palette: t12,
|
|
240
|
+
value: props.value,
|
|
241
|
+
defaultValue: props.defaultValue,
|
|
242
|
+
filter: props.filter,
|
|
243
|
+
shouldFilter: props.shouldFilter,
|
|
244
|
+
loop: props.loop,
|
|
245
|
+
onValueChange: props.onValueChange,
|
|
246
|
+
label: title,
|
|
247
|
+
className: commandRootClassName,
|
|
103
248
|
children
|
|
104
249
|
});
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
250
|
+
$[22] = children;
|
|
251
|
+
$[23] = props.defaultValue;
|
|
252
|
+
$[24] = props.filter;
|
|
253
|
+
$[25] = props.loop;
|
|
254
|
+
$[26] = props.onValueChange;
|
|
255
|
+
$[27] = props.shouldFilter;
|
|
256
|
+
$[28] = props.value;
|
|
257
|
+
$[29] = t12;
|
|
258
|
+
$[30] = title;
|
|
259
|
+
$[31] = t13;
|
|
260
|
+
} else t13 = $[31];
|
|
261
|
+
let t14;
|
|
262
|
+
if ($[32] !== showCloseButton || $[33] !== t10 || $[34] !== t11 || $[35] !== t13) {
|
|
263
|
+
t14 = /* @__PURE__ */ jsx(DialogContent, {
|
|
264
|
+
overlayClassName: t10,
|
|
265
|
+
className: t11,
|
|
266
|
+
showCloseButton,
|
|
267
|
+
children: t13
|
|
268
|
+
});
|
|
269
|
+
$[32] = showCloseButton;
|
|
270
|
+
$[33] = t10;
|
|
271
|
+
$[34] = t11;
|
|
272
|
+
$[35] = t13;
|
|
273
|
+
$[36] = t14;
|
|
274
|
+
} else t14 = $[36];
|
|
275
|
+
let t15;
|
|
276
|
+
if ($[37] !== props.defaultOpen || $[38] !== props.onOpenChange || $[39] !== props.open || $[40] !== t14 || $[41] !== t9) {
|
|
277
|
+
t15 = /* @__PURE__ */ jsxs(Dialog, {
|
|
278
|
+
open: t4,
|
|
279
|
+
onOpenChange: t5,
|
|
280
|
+
defaultOpen: t6,
|
|
281
|
+
children: [t9, t14]
|
|
115
282
|
});
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
|
|
121
|
-
|
|
283
|
+
$[37] = props.defaultOpen;
|
|
284
|
+
$[38] = props.onOpenChange;
|
|
285
|
+
$[39] = props.open;
|
|
286
|
+
$[40] = t14;
|
|
287
|
+
$[41] = t9;
|
|
288
|
+
$[42] = t15;
|
|
289
|
+
} else t15 = $[42];
|
|
290
|
+
return t15;
|
|
122
291
|
}
|
|
123
292
|
function CommandInput(t0) {
|
|
124
293
|
const $ = c(11);
|
|
@@ -141,7 +310,7 @@ function CommandInput(t0) {
|
|
|
141
310
|
} else t1 = $[4];
|
|
142
311
|
let t2;
|
|
143
312
|
if ($[5] !== props || $[6] !== t1) {
|
|
144
|
-
t2 = /* @__PURE__ */ jsx(
|
|
313
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Input, {
|
|
145
314
|
"data-slot": "command-input",
|
|
146
315
|
className: t1,
|
|
147
316
|
...props
|
|
@@ -185,13 +354,13 @@ function CommandList(t0) {
|
|
|
185
354
|
}
|
|
186
355
|
let t1;
|
|
187
356
|
if ($[3] !== className) {
|
|
188
|
-
t1 = cn("no-scrollbar max-h-72 scroll-py-1
|
|
357
|
+
t1 = cn("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className);
|
|
189
358
|
$[3] = className;
|
|
190
359
|
$[4] = t1;
|
|
191
360
|
} else t1 = $[4];
|
|
192
361
|
let t2;
|
|
193
362
|
if ($[5] !== props || $[6] !== t1) {
|
|
194
|
-
t2 = /* @__PURE__ */ jsx(
|
|
363
|
+
t2 = /* @__PURE__ */ jsx(Command$1.List, {
|
|
195
364
|
"data-slot": "command-list",
|
|
196
365
|
className: t1,
|
|
197
366
|
...props
|
|
@@ -223,7 +392,7 @@ function CommandEmpty(t0) {
|
|
|
223
392
|
} else t1 = $[4];
|
|
224
393
|
let t2;
|
|
225
394
|
if ($[5] !== props || $[6] !== t1) {
|
|
226
|
-
t2 = /* @__PURE__ */ jsx(
|
|
395
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
227
396
|
"data-slot": "command-empty",
|
|
228
397
|
className: t1,
|
|
229
398
|
...props
|
|
@@ -249,13 +418,13 @@ function CommandGroup(t0) {
|
|
|
249
418
|
}
|
|
250
419
|
let t1;
|
|
251
420
|
if ($[3] !== className) {
|
|
252
|
-
t1 = cn("text-foreground **:[[
|
|
421
|
+
t1 = cn("text-foreground **:[[cmd-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmd-group-heading]]:px-2 **:[[cmd-group-heading]]:py-1.5 **:[[cmd-group-heading]]:text-xs **:[[cmd-group-heading]]:font-medium", className);
|
|
253
422
|
$[3] = className;
|
|
254
423
|
$[4] = t1;
|
|
255
424
|
} else t1 = $[4];
|
|
256
425
|
let t2;
|
|
257
426
|
if ($[5] !== props || $[6] !== t1) {
|
|
258
|
-
t2 = /* @__PURE__ */ jsx(
|
|
427
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Group, {
|
|
259
428
|
"data-slot": "command-group",
|
|
260
429
|
className: t1,
|
|
261
430
|
...props
|
|
@@ -287,7 +456,7 @@ function CommandSeparator(t0) {
|
|
|
287
456
|
} else t1 = $[4];
|
|
288
457
|
let t2;
|
|
289
458
|
if ($[5] !== props || $[6] !== t1) {
|
|
290
|
-
t2 = /* @__PURE__ */ jsx(
|
|
459
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Separator, {
|
|
291
460
|
"data-slot": "command-separator",
|
|
292
461
|
className: t1,
|
|
293
462
|
...props
|
|
@@ -299,7 +468,7 @@ function CommandSeparator(t0) {
|
|
|
299
468
|
return t2;
|
|
300
469
|
}
|
|
301
470
|
function CommandItem(t0) {
|
|
302
|
-
const $ = c(
|
|
471
|
+
const $ = c(10);
|
|
303
472
|
let children;
|
|
304
473
|
let className;
|
|
305
474
|
let props;
|
|
@@ -316,29 +485,88 @@ function CommandItem(t0) {
|
|
|
316
485
|
}
|
|
317
486
|
let t1;
|
|
318
487
|
if ($[4] !== className) {
|
|
319
|
-
t1 = cn(
|
|
488
|
+
t1 = cn(commandItemClassName, className);
|
|
320
489
|
$[4] = className;
|
|
321
490
|
$[5] = t1;
|
|
322
491
|
} else t1 = $[5];
|
|
323
492
|
let t2;
|
|
324
|
-
if ($[6]
|
|
325
|
-
t2 = /* @__PURE__ */ jsx(
|
|
326
|
-
$[6] = t2;
|
|
327
|
-
} else t2 = $[6];
|
|
328
|
-
let t3;
|
|
329
|
-
if ($[7] !== children || $[8] !== props || $[9] !== t1) {
|
|
330
|
-
t3 = /* @__PURE__ */ jsxs(pkg.Item, {
|
|
493
|
+
if ($[6] !== children || $[7] !== props || $[8] !== t1) {
|
|
494
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Item, {
|
|
331
495
|
"data-slot": "command-item",
|
|
332
496
|
className: t1,
|
|
333
497
|
...props,
|
|
334
|
-
children
|
|
498
|
+
children
|
|
335
499
|
});
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
} else
|
|
341
|
-
return
|
|
500
|
+
$[6] = children;
|
|
501
|
+
$[7] = props;
|
|
502
|
+
$[8] = t1;
|
|
503
|
+
$[9] = t2;
|
|
504
|
+
} else t2 = $[9];
|
|
505
|
+
return t2;
|
|
506
|
+
}
|
|
507
|
+
function CommandLoading(t0) {
|
|
508
|
+
const $ = c(8);
|
|
509
|
+
let className;
|
|
510
|
+
let props;
|
|
511
|
+
if ($[0] !== t0) {
|
|
512
|
+
({className, ...props} = t0);
|
|
513
|
+
$[0] = t0;
|
|
514
|
+
$[1] = className;
|
|
515
|
+
$[2] = props;
|
|
516
|
+
} else {
|
|
517
|
+
className = $[1];
|
|
518
|
+
props = $[2];
|
|
519
|
+
}
|
|
520
|
+
let t1;
|
|
521
|
+
if ($[3] !== className) {
|
|
522
|
+
t1 = cn("py-6 text-center text-sm", className);
|
|
523
|
+
$[3] = className;
|
|
524
|
+
$[4] = t1;
|
|
525
|
+
} else t1 = $[4];
|
|
526
|
+
let t2;
|
|
527
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
528
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Loading, {
|
|
529
|
+
"data-slot": "command-loading",
|
|
530
|
+
className: t1,
|
|
531
|
+
...props
|
|
532
|
+
});
|
|
533
|
+
$[5] = props;
|
|
534
|
+
$[6] = t1;
|
|
535
|
+
$[7] = t2;
|
|
536
|
+
} else t2 = $[7];
|
|
537
|
+
return t2;
|
|
538
|
+
}
|
|
539
|
+
function CommandActions(t0) {
|
|
540
|
+
const $ = c(8);
|
|
541
|
+
let className;
|
|
542
|
+
let props;
|
|
543
|
+
if ($[0] !== t0) {
|
|
544
|
+
({className, ...props} = t0);
|
|
545
|
+
$[0] = t0;
|
|
546
|
+
$[1] = className;
|
|
547
|
+
$[2] = props;
|
|
548
|
+
} else {
|
|
549
|
+
className = $[1];
|
|
550
|
+
props = $[2];
|
|
551
|
+
}
|
|
552
|
+
let t1;
|
|
553
|
+
if ($[3] !== className) {
|
|
554
|
+
t1 = cn(commandActionsClassName, className);
|
|
555
|
+
$[3] = className;
|
|
556
|
+
$[4] = t1;
|
|
557
|
+
} else t1 = $[4];
|
|
558
|
+
let t2;
|
|
559
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
560
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Actions, {
|
|
561
|
+
"data-slot": "command-actions",
|
|
562
|
+
className: t1,
|
|
563
|
+
...props
|
|
564
|
+
});
|
|
565
|
+
$[5] = props;
|
|
566
|
+
$[6] = t1;
|
|
567
|
+
$[7] = t2;
|
|
568
|
+
} else t2 = $[7];
|
|
569
|
+
return t2;
|
|
342
570
|
}
|
|
343
571
|
function CommandShortcut(t0) {
|
|
344
572
|
const $ = c(8);
|
|
@@ -372,6 +600,16 @@ function CommandShortcut(t0) {
|
|
|
372
600
|
} else t2 = $[7];
|
|
373
601
|
return t2;
|
|
374
602
|
}
|
|
375
|
-
|
|
603
|
+
const Command = Object.assign(CommandRoot, {
|
|
604
|
+
Dialog: CommandDialogRoot,
|
|
605
|
+
Input: CommandInput,
|
|
606
|
+
List: CommandList,
|
|
607
|
+
Empty: CommandEmpty,
|
|
608
|
+
Group: CommandGroup,
|
|
609
|
+
Separator: CommandSeparator,
|
|
610
|
+
Item: CommandItem,
|
|
611
|
+
Loading: CommandLoading,
|
|
612
|
+
Actions: CommandActions
|
|
613
|
+
});
|
|
376
614
|
//#endregion
|
|
377
|
-
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
615
|
+
export { Command, CommandActions, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, createCommandPalette, useCommandActions, useCommandShortcutDefault };
|
package/dist/ui/context-menu.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.mjs";
|
|
2
|
+
import "react";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
5
6
|
import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
|
|
6
|
-
|
|
7
7
|
//#region src/ui/context-menu.tsx
|
|
8
8
|
function ContextMenu(t0) {
|
|
9
9
|
const $ = c(4);
|
|
@@ -514,6 +514,5 @@ function ContextMenuShortcut(t0) {
|
|
|
514
514
|
} else t2 = $[7];
|
|
515
515
|
return t2;
|
|
516
516
|
}
|
|
517
|
-
|
|
518
517
|
//#endregion
|
|
519
|
-
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
518
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
package/dist/ui/dialog.d.mts
CHANGED
|
@@ -21,10 +21,12 @@ declare function DialogOverlay({
|
|
|
21
21
|
}: Dialog$1.Backdrop.Props): react_jsx_runtime0.JSX.Element;
|
|
22
22
|
declare function DialogContent({
|
|
23
23
|
className,
|
|
24
|
+
overlayClassName,
|
|
24
25
|
children,
|
|
25
26
|
showCloseButton,
|
|
26
27
|
...props
|
|
27
28
|
}: Dialog$1.Popup.Props & {
|
|
29
|
+
overlayClassName?: string;
|
|
28
30
|
showCloseButton?: boolean;
|
|
29
31
|
}): react_jsx_runtime0.JSX.Element;
|
|
30
32
|
declare function DialogHeader({
|
package/dist/ui/dialog.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.mjs";
|
|
2
2
|
import { Button } from "./button.mjs";
|
|
3
|
+
import "react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { XIcon } from "lucide-react";
|
|
6
7
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
7
|
-
|
|
8
8
|
//#region src/ui/dialog.tsx
|
|
9
9
|
function Dialog(t0) {
|
|
10
10
|
const $ = c(4);
|
|
@@ -115,38 +115,42 @@ function DialogOverlay(t0) {
|
|
|
115
115
|
return t2;
|
|
116
116
|
}
|
|
117
117
|
function DialogContent(t0) {
|
|
118
|
-
const $ = c(
|
|
118
|
+
const $ = c(20);
|
|
119
119
|
let children;
|
|
120
120
|
let className;
|
|
121
|
+
let overlayClassName;
|
|
121
122
|
let props;
|
|
122
123
|
let t1;
|
|
123
124
|
if ($[0] !== t0) {
|
|
124
|
-
({className, children, showCloseButton: t1, ...props} = t0);
|
|
125
|
+
({className, overlayClassName, children, showCloseButton: t1, ...props} = t0);
|
|
125
126
|
$[0] = t0;
|
|
126
127
|
$[1] = children;
|
|
127
128
|
$[2] = className;
|
|
128
|
-
$[3] =
|
|
129
|
-
$[4] =
|
|
129
|
+
$[3] = overlayClassName;
|
|
130
|
+
$[4] = props;
|
|
131
|
+
$[5] = t1;
|
|
130
132
|
} else {
|
|
131
133
|
children = $[1];
|
|
132
134
|
className = $[2];
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
overlayClassName = $[3];
|
|
136
|
+
props = $[4];
|
|
137
|
+
t1 = $[5];
|
|
135
138
|
}
|
|
136
139
|
const showCloseButton = t1 === void 0 ? true : t1;
|
|
137
140
|
let t2;
|
|
138
|
-
if ($[
|
|
139
|
-
t2 = /* @__PURE__ */ jsx(DialogOverlay, {});
|
|
140
|
-
$[
|
|
141
|
-
|
|
141
|
+
if ($[6] !== overlayClassName) {
|
|
142
|
+
t2 = /* @__PURE__ */ jsx(DialogOverlay, { className: overlayClassName });
|
|
143
|
+
$[6] = overlayClassName;
|
|
144
|
+
$[7] = t2;
|
|
145
|
+
} else t2 = $[7];
|
|
142
146
|
let t3;
|
|
143
|
-
if ($[
|
|
147
|
+
if ($[8] !== className) {
|
|
144
148
|
t3 = cn("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-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none", className);
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
} else t3 = $[
|
|
149
|
+
$[8] = className;
|
|
150
|
+
$[9] = t3;
|
|
151
|
+
} else t3 = $[9];
|
|
148
152
|
let t4;
|
|
149
|
-
if ($[
|
|
153
|
+
if ($[10] !== showCloseButton) {
|
|
150
154
|
t4 = showCloseButton && /* @__PURE__ */ jsxs(Dialog$1.Close, {
|
|
151
155
|
"data-slot": "dialog-close",
|
|
152
156
|
render: /* @__PURE__ */ jsx(Button, {
|
|
@@ -159,24 +163,31 @@ function DialogContent(t0) {
|
|
|
159
163
|
children: "Close"
|
|
160
164
|
})]
|
|
161
165
|
});
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
} else t4 = $[
|
|
166
|
+
$[10] = showCloseButton;
|
|
167
|
+
$[11] = t4;
|
|
168
|
+
} else t4 = $[11];
|
|
165
169
|
let t5;
|
|
166
|
-
if ($[
|
|
167
|
-
t5 = /* @__PURE__ */ jsxs(
|
|
170
|
+
if ($[12] !== children || $[13] !== props || $[14] !== t3 || $[15] !== t4) {
|
|
171
|
+
t5 = /* @__PURE__ */ jsxs(Dialog$1.Popup, {
|
|
168
172
|
"data-slot": "dialog-content",
|
|
169
173
|
className: t3,
|
|
170
174
|
...props,
|
|
171
175
|
children: [children, t4]
|
|
172
|
-
})
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
} else t5 = $[
|
|
179
|
-
|
|
176
|
+
});
|
|
177
|
+
$[12] = children;
|
|
178
|
+
$[13] = props;
|
|
179
|
+
$[14] = t3;
|
|
180
|
+
$[15] = t4;
|
|
181
|
+
$[16] = t5;
|
|
182
|
+
} else t5 = $[16];
|
|
183
|
+
let t6;
|
|
184
|
+
if ($[17] !== t2 || $[18] !== t5) {
|
|
185
|
+
t6 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t2, t5] });
|
|
186
|
+
$[17] = t2;
|
|
187
|
+
$[18] = t5;
|
|
188
|
+
$[19] = t6;
|
|
189
|
+
} else t6 = $[19];
|
|
190
|
+
return t6;
|
|
180
191
|
}
|
|
181
192
|
function DialogHeader(t0) {
|
|
182
193
|
const $ = c(8);
|
|
@@ -325,6 +336,5 @@ function DialogDescription(t0) {
|
|
|
325
336
|
} else t2 = $[7];
|
|
326
337
|
return t2;
|
|
327
338
|
}
|
|
328
|
-
|
|
329
339
|
//#endregion
|
|
330
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
340
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|