@ucdjs-internal/shared-ui 0.1.6 → 0.1.8
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/shiki-code.d.mts +2 -2
- package/dist/components/shiki-code.mjs +1 -3
- package/dist/components/theme-toggle.d.mts +3 -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/components.d.mts +30 -0
- package/dist/components.mjs +30 -0
- package/dist/hooks/index.mjs +2 -3
- 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 +2 -3
- package/dist/lib/theme-script.mjs +1 -2
- package/dist/lib/utils.mjs +1 -3
- package/dist/ui/alert-dialog.d.mts +17 -17
- package/dist/ui/alert-dialog.mjs +12 -13
- package/dist/ui/avatar.d.mts +11 -11
- package/dist/ui/avatar.mjs +7 -8
- package/dist/ui/badge.d.mts +4 -4
- package/dist/ui/badge.mjs +1 -3
- package/dist/ui/breadcrumb.d.mts +7 -7
- package/dist/ui/breadcrumb.mjs +2 -3
- package/dist/ui/button.d.mts +8 -8
- package/dist/ui/button.mjs +4 -6
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/card.mjs +2 -3
- package/dist/ui/checkbox.d.mts +5 -5
- package/dist/ui/checkbox.mjs +5 -7
- package/dist/ui/collapsible.d.mts +7 -7
- package/dist/ui/collapsible.mjs +6 -8
- package/dist/ui/combobox.d.mts +20 -20
- package/dist/ui/combobox.mjs +21 -23
- package/dist/ui/command.d.mts +55 -16
- package/dist/ui/command.mjs +327 -89
- package/dist/ui/context-menu.d.mts +24 -24
- package/dist/ui/context-menu.mjs +20 -21
- package/dist/ui/dialog.d.mts +17 -15
- package/dist/ui/dialog.mjs +52 -42
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/dropdown-menu.mjs +2 -3
- package/dist/ui/field.d.mts +13 -13
- package/dist/ui/field.mjs +1 -3
- package/dist/ui/input-group.d.mts +10 -10
- package/dist/ui/input-group.mjs +2 -3
- package/dist/ui/input.d.mts +2 -2
- package/dist/ui/input.mjs +5 -6
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/label.mjs +2 -3
- package/dist/ui/scroll-area.d.mts +6 -6
- package/dist/ui/scroll-area.mjs +9 -10
- package/dist/ui/select.d.mts +14 -14
- package/dist/ui/select.mjs +18 -19
- package/dist/ui/separator.d.mts +5 -5
- package/dist/ui/separator.mjs +4 -6
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sheet.mjs +2 -3
- package/dist/ui/sidebar.d.mts +23 -23
- package/dist/ui/sidebar.mjs +4 -6
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/skeleton.mjs +1 -3
- package/dist/ui/table.d.mts +9 -9
- package/dist/ui/table.mjs +2 -3
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/textarea.mjs +2 -3
- package/dist/ui/tooltip.d.mts +8 -8
- package/dist/ui/tooltip.mjs +9 -11
- package/dist/vscode/syntaxes/ucd.tmLanguage.mjs +1 -2
- package/package.json +22 -44
- package/dist/components/index.d.mts +0 -3
- package/dist/components/index.mjs +0 -4
- 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.d.mts
CHANGED
|
@@ -1,55 +1,94 @@
|
|
|
1
|
-
import { Dialog } from "./dialog.mjs";
|
|
2
|
-
import { pkg } from "../vendor/cmdk/index.mjs";
|
|
3
1
|
import * as React from "react";
|
|
4
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Command, CommandAction, createCommandPalette, useCommandActions, useCommandShortcutDefault } from "@cmdi/base-ui";
|
|
5
4
|
|
|
6
5
|
//#region src/ui/command.d.ts
|
|
7
|
-
declare function
|
|
6
|
+
declare function CommandRoot({
|
|
8
7
|
className,
|
|
9
8
|
...props
|
|
10
|
-
}: React.ComponentProps<typeof
|
|
9
|
+
}: React.ComponentProps<typeof Command>): _$react_jsx_runtime0.JSX.Element;
|
|
10
|
+
declare function CommandDialogRoot({
|
|
11
|
+
children,
|
|
12
|
+
open,
|
|
13
|
+
onOpenChange,
|
|
14
|
+
defaultOpen,
|
|
15
|
+
className,
|
|
16
|
+
overlayClassName,
|
|
17
|
+
contentClassName,
|
|
18
|
+
palette,
|
|
19
|
+
value,
|
|
20
|
+
defaultValue,
|
|
21
|
+
filter,
|
|
22
|
+
shouldFilter,
|
|
23
|
+
loop,
|
|
24
|
+
onValueChange,
|
|
25
|
+
label
|
|
26
|
+
}: React.ComponentProps<typeof Command.Dialog>): _$react_jsx_runtime0.JSX.Element;
|
|
11
27
|
declare function CommandDialog({
|
|
12
28
|
title,
|
|
13
|
-
description,
|
|
29
|
+
description: _description,
|
|
14
30
|
children,
|
|
15
31
|
className,
|
|
32
|
+
overlayClassName,
|
|
33
|
+
contentClassName,
|
|
34
|
+
palette,
|
|
16
35
|
showCloseButton,
|
|
17
36
|
...props
|
|
18
|
-
}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
37
|
+
}: Omit<React.ComponentProps<typeof Command.Dialog>, "children" | "label"> & {
|
|
19
38
|
title?: string;
|
|
20
39
|
description?: string;
|
|
21
40
|
className?: string;
|
|
41
|
+
palette?: string;
|
|
22
42
|
showCloseButton?: boolean;
|
|
23
43
|
children: React.ReactNode;
|
|
24
|
-
}): react_jsx_runtime0.JSX.Element;
|
|
44
|
+
}): _$react_jsx_runtime0.JSX.Element;
|
|
25
45
|
declare function CommandInput({
|
|
26
46
|
className,
|
|
27
47
|
...props
|
|
28
|
-
}: React.ComponentProps<typeof
|
|
48
|
+
}: React.ComponentProps<typeof Command.Input>): _$react_jsx_runtime0.JSX.Element;
|
|
29
49
|
declare function CommandList({
|
|
30
50
|
className,
|
|
31
51
|
...props
|
|
32
|
-
}: React.ComponentProps<typeof
|
|
52
|
+
}: React.ComponentProps<typeof Command.List>): _$react_jsx_runtime0.JSX.Element;
|
|
33
53
|
declare function CommandEmpty({
|
|
34
54
|
className,
|
|
35
55
|
...props
|
|
36
|
-
}: React.ComponentProps<typeof
|
|
56
|
+
}: React.ComponentProps<typeof Command.Empty>): _$react_jsx_runtime0.JSX.Element;
|
|
37
57
|
declare function CommandGroup({
|
|
38
58
|
className,
|
|
39
59
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof
|
|
60
|
+
}: React.ComponentProps<typeof Command.Group>): _$react_jsx_runtime0.JSX.Element;
|
|
41
61
|
declare function CommandSeparator({
|
|
42
62
|
className,
|
|
43
63
|
...props
|
|
44
|
-
}: React.ComponentProps<typeof
|
|
64
|
+
}: React.ComponentProps<typeof Command.Separator>): _$react_jsx_runtime0.JSX.Element;
|
|
45
65
|
declare function CommandItem({
|
|
46
66
|
className,
|
|
47
67
|
children,
|
|
48
68
|
...props
|
|
49
|
-
}: React.ComponentProps<typeof
|
|
69
|
+
}: React.ComponentProps<typeof Command.Item>): _$react_jsx_runtime0.JSX.Element;
|
|
70
|
+
declare function CommandLoading({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<typeof Command.Loading>): _$react_jsx_runtime0.JSX.Element;
|
|
74
|
+
declare function CommandActions({
|
|
75
|
+
className,
|
|
76
|
+
...props
|
|
77
|
+
}: React.ComponentProps<typeof Command.Actions>): _$react_jsx_runtime0.JSX.Element;
|
|
50
78
|
declare function CommandShortcut({
|
|
51
79
|
className,
|
|
52
80
|
...props
|
|
53
|
-
}: React.ComponentProps<"span">): react_jsx_runtime0.JSX.Element;
|
|
81
|
+
}: React.ComponentProps<"span">): _$react_jsx_runtime0.JSX.Element;
|
|
82
|
+
declare const Command$1: typeof CommandRoot & {
|
|
83
|
+
Dialog: typeof CommandDialogRoot;
|
|
84
|
+
Input: typeof CommandInput;
|
|
85
|
+
List: typeof CommandList;
|
|
86
|
+
Empty: typeof CommandEmpty;
|
|
87
|
+
Group: typeof CommandGroup;
|
|
88
|
+
Separator: typeof CommandSeparator;
|
|
89
|
+
Item: typeof CommandItem;
|
|
90
|
+
Loading: typeof CommandLoading;
|
|
91
|
+
Actions: typeof CommandActions;
|
|
92
|
+
};
|
|
54
93
|
//#endregion
|
|
55
|
-
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
94
|
+
export { Command$1 as Command, type CommandAction, CommandActions, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, createCommandPalette, useCommandActions, useCommandShortcutDefault };
|
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, 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, {
|
|
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, {
|
|
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, {
|
|
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.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.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.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.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.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.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.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.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$1 = 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$1 as Command, CommandActions, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, createCommandPalette, useCommandActions, useCommandShortcutDefault };
|