@ucdjs-internal/shared-ui 0.1.5 → 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 +4 -0
- package/dist/components/index.mjs +4 -0
- package/dist/components/shiki-code.d.mts +1 -1
- package/dist/components/shiki-code.mjs +4 -4
- package/dist/components/theme-toggle.d.mts +2 -1
- package/dist/components/theme-toggle.mjs +23 -4
- package/dist/components/ucd-logo.d.mts +10 -0
- package/dist/components/ucd-logo.mjs +61 -0
- package/dist/hooks/index.d.mts +2 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/hooks/use-clipboard.d.mts +28 -0
- package/dist/hooks/use-clipboard.mjs +60 -0
- package/dist/hooks/use-mobile.mjs +1 -3
- package/dist/hooks/use-theme.mjs +6 -8
- 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 +1 -3
- package/dist/ui/avatar.mjs +1 -3
- package/dist/ui/badge.d.mts +1 -1
- package/dist/ui/badge.mjs +1 -3
- package/dist/ui/breadcrumb.mjs +1 -3
- package/dist/ui/button.d.mts +2 -2
- package/dist/ui/button.mjs +1 -3
- package/dist/ui/card.mjs +1 -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 -90
- package/dist/ui/context-menu.mjs +1 -3
- package/dist/ui/dialog.d.mts +2 -0
- package/dist/ui/dialog.mjs +40 -31
- package/dist/ui/dropdown-menu.mjs +1 -3
- package/dist/ui/field.d.mts +1 -1
- package/dist/ui/field.mjs +1 -3
- package/dist/ui/input-group.mjs +1 -3
- package/dist/ui/input.mjs +1 -3
- package/dist/ui/label.mjs +1 -3
- package/dist/ui/scroll-area.mjs +1 -3
- package/dist/ui/select.mjs +1 -3
- package/dist/ui/separator.mjs +1 -3
- package/dist/ui/sheet.mjs +1 -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 +1 -3
- package/dist/ui/textarea.mjs +1 -3
- package/dist/ui/tooltip.mjs +1 -3
- package/dist/vscode/syntaxes/ucd.tmLanguage.mjs +42 -0
- package/package.json +19 -20
- 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
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Command as Command$1, 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$1>): 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$1.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$1.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
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$1.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$1.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$1.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$1.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$1.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$1.Item>): react_jsx_runtime0.JSX.Element;
|
|
70
|
+
declare function CommandLoading({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<typeof Command$1.Loading>): react_jsx_runtime0.JSX.Element;
|
|
74
|
+
declare function CommandActions({
|
|
75
|
+
className,
|
|
76
|
+
...props
|
|
77
|
+
}: React.ComponentProps<typeof Command$1.Actions>): react_jsx_runtime0.JSX.Element;
|
|
50
78
|
declare function CommandShortcut({
|
|
51
79
|
className,
|
|
52
80
|
...props
|
|
53
81
|
}: React.ComponentProps<"span">): react_jsx_runtime0.JSX.Element;
|
|
82
|
+
declare const Command: 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, type CommandAction, CommandActions, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, createCommandPalette, useCommandActions, useCommandShortcutDefault };
|
package/dist/ui/command.mjs
CHANGED
|
@@ -1,14 +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
|
|
5
|
-
import "react";
|
|
4
|
+
import * as React from "react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { c } from "react/compiler-runtime";
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { SearchIcon } from "lucide-react";
|
|
8
|
+
import { Command as Command$1, createCommandPalette, useCommandActions, useCommandShortcutDefault } from "@cmdi/base-ui";
|
|
10
9
|
//#region src/ui/command.tsx
|
|
11
|
-
|
|
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) {
|
|
12
50
|
const $ = c(8);
|
|
13
51
|
let className;
|
|
14
52
|
let props;
|
|
@@ -23,13 +61,13 @@ function Command(t0) {
|
|
|
23
61
|
}
|
|
24
62
|
let t1;
|
|
25
63
|
if ($[3] !== className) {
|
|
26
|
-
t1 = cn(
|
|
64
|
+
t1 = cn(commandRootClassName, className);
|
|
27
65
|
$[3] = className;
|
|
28
66
|
$[4] = t1;
|
|
29
67
|
} else t1 = $[4];
|
|
30
68
|
let t2;
|
|
31
69
|
if ($[5] !== props || $[6] !== t1) {
|
|
32
|
-
t2 = /* @__PURE__ */ jsx(
|
|
70
|
+
t2 = /* @__PURE__ */ jsx(Command$1, {
|
|
33
71
|
"data-slot": "command",
|
|
34
72
|
className: t1,
|
|
35
73
|
...props
|
|
@@ -40,86 +78,216 @@ function Command(t0) {
|
|
|
40
78
|
} else t2 = $[7];
|
|
41
79
|
return t2;
|
|
42
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
|
+
}
|
|
43
159
|
function CommandDialog(t0) {
|
|
44
|
-
const $ = c(
|
|
160
|
+
const $ = c(43);
|
|
45
161
|
let children;
|
|
46
162
|
let className;
|
|
163
|
+
let contentClassName;
|
|
164
|
+
let overlayClassName;
|
|
165
|
+
let palette;
|
|
47
166
|
let props;
|
|
48
167
|
let t1;
|
|
49
168
|
let t2;
|
|
50
169
|
let t3;
|
|
51
170
|
if ($[0] !== t0) {
|
|
52
|
-
({title: t1, description: t2, children, className, showCloseButton: t3, ...props} = t0);
|
|
171
|
+
({title: t1, description: t2, children, className, overlayClassName, contentClassName, palette, showCloseButton: t3, ...props} = t0);
|
|
53
172
|
$[0] = t0;
|
|
54
173
|
$[1] = children;
|
|
55
174
|
$[2] = className;
|
|
56
|
-
$[3] =
|
|
57
|
-
$[4] =
|
|
58
|
-
$[5] =
|
|
59
|
-
$[6] =
|
|
175
|
+
$[3] = contentClassName;
|
|
176
|
+
$[4] = overlayClassName;
|
|
177
|
+
$[5] = palette;
|
|
178
|
+
$[6] = props;
|
|
179
|
+
$[7] = t1;
|
|
180
|
+
$[8] = t2;
|
|
181
|
+
$[9] = t3;
|
|
60
182
|
} else {
|
|
61
183
|
children = $[1];
|
|
62
184
|
className = $[2];
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
185
|
+
contentClassName = $[3];
|
|
186
|
+
overlayClassName = $[4];
|
|
187
|
+
palette = $[5];
|
|
188
|
+
props = $[6];
|
|
189
|
+
t1 = $[7];
|
|
190
|
+
t2 = $[8];
|
|
191
|
+
t3 = $[9];
|
|
67
192
|
}
|
|
68
193
|
const title = t1 === void 0 ? "Command Palette" : t1;
|
|
69
|
-
const
|
|
194
|
+
const _description = t2 === void 0 ? "Search for a command to run..." : t2;
|
|
70
195
|
const showCloseButton = t3 === void 0 ? false : t3;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
$[7] = title;
|
|
75
|
-
$[8] = t4;
|
|
76
|
-
} else t4 = $[8];
|
|
77
|
-
let t5;
|
|
78
|
-
if ($[9] !== description) {
|
|
79
|
-
t5 = /* @__PURE__ */ jsx(DialogDescription, { children: description });
|
|
80
|
-
$[9] = description;
|
|
81
|
-
$[10] = t5;
|
|
82
|
-
} else t5 = $[10];
|
|
83
|
-
let t6;
|
|
84
|
-
if ($[11] !== t4 || $[12] !== t5) {
|
|
85
|
-
t6 = /* @__PURE__ */ jsxs(DialogHeader, {
|
|
86
|
-
className: "sr-only",
|
|
87
|
-
children: [t4, t5]
|
|
88
|
-
});
|
|
89
|
-
$[11] = t4;
|
|
90
|
-
$[12] = t5;
|
|
91
|
-
$[13] = t6;
|
|
92
|
-
} else t6 = $[13];
|
|
196
|
+
const t4 = props.open;
|
|
197
|
+
const t5 = props.onOpenChange;
|
|
198
|
+
const t6 = props.defaultOpen;
|
|
93
199
|
let t7;
|
|
94
|
-
if ($[
|
|
95
|
-
t7 =
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
} else t7 = $[
|
|
200
|
+
if ($[10] !== title) {
|
|
201
|
+
t7 = /* @__PURE__ */ jsx(DialogTitle, { children: title });
|
|
202
|
+
$[10] = title;
|
|
203
|
+
$[11] = t7;
|
|
204
|
+
} else t7 = $[11];
|
|
99
205
|
let t8;
|
|
100
|
-
if ($[
|
|
101
|
-
t8 = /* @__PURE__ */ jsx(
|
|
102
|
-
|
|
103
|
-
|
|
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,
|
|
104
248
|
children
|
|
105
249
|
});
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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]
|
|
116
282
|
});
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
|
|
122
|
-
|
|
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;
|
|
123
291
|
}
|
|
124
292
|
function CommandInput(t0) {
|
|
125
293
|
const $ = c(11);
|
|
@@ -142,7 +310,7 @@ function CommandInput(t0) {
|
|
|
142
310
|
} else t1 = $[4];
|
|
143
311
|
let t2;
|
|
144
312
|
if ($[5] !== props || $[6] !== t1) {
|
|
145
|
-
t2 = /* @__PURE__ */ jsx(
|
|
313
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Input, {
|
|
146
314
|
"data-slot": "command-input",
|
|
147
315
|
className: t1,
|
|
148
316
|
...props
|
|
@@ -186,13 +354,13 @@ function CommandList(t0) {
|
|
|
186
354
|
}
|
|
187
355
|
let t1;
|
|
188
356
|
if ($[3] !== className) {
|
|
189
|
-
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);
|
|
190
358
|
$[3] = className;
|
|
191
359
|
$[4] = t1;
|
|
192
360
|
} else t1 = $[4];
|
|
193
361
|
let t2;
|
|
194
362
|
if ($[5] !== props || $[6] !== t1) {
|
|
195
|
-
t2 = /* @__PURE__ */ jsx(
|
|
363
|
+
t2 = /* @__PURE__ */ jsx(Command$1.List, {
|
|
196
364
|
"data-slot": "command-list",
|
|
197
365
|
className: t1,
|
|
198
366
|
...props
|
|
@@ -224,7 +392,7 @@ function CommandEmpty(t0) {
|
|
|
224
392
|
} else t1 = $[4];
|
|
225
393
|
let t2;
|
|
226
394
|
if ($[5] !== props || $[6] !== t1) {
|
|
227
|
-
t2 = /* @__PURE__ */ jsx(
|
|
395
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
228
396
|
"data-slot": "command-empty",
|
|
229
397
|
className: t1,
|
|
230
398
|
...props
|
|
@@ -250,13 +418,13 @@ function CommandGroup(t0) {
|
|
|
250
418
|
}
|
|
251
419
|
let t1;
|
|
252
420
|
if ($[3] !== className) {
|
|
253
|
-
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);
|
|
254
422
|
$[3] = className;
|
|
255
423
|
$[4] = t1;
|
|
256
424
|
} else t1 = $[4];
|
|
257
425
|
let t2;
|
|
258
426
|
if ($[5] !== props || $[6] !== t1) {
|
|
259
|
-
t2 = /* @__PURE__ */ jsx(
|
|
427
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Group, {
|
|
260
428
|
"data-slot": "command-group",
|
|
261
429
|
className: t1,
|
|
262
430
|
...props
|
|
@@ -288,7 +456,7 @@ function CommandSeparator(t0) {
|
|
|
288
456
|
} else t1 = $[4];
|
|
289
457
|
let t2;
|
|
290
458
|
if ($[5] !== props || $[6] !== t1) {
|
|
291
|
-
t2 = /* @__PURE__ */ jsx(
|
|
459
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Separator, {
|
|
292
460
|
"data-slot": "command-separator",
|
|
293
461
|
className: t1,
|
|
294
462
|
...props
|
|
@@ -300,7 +468,7 @@ function CommandSeparator(t0) {
|
|
|
300
468
|
return t2;
|
|
301
469
|
}
|
|
302
470
|
function CommandItem(t0) {
|
|
303
|
-
const $ = c(
|
|
471
|
+
const $ = c(10);
|
|
304
472
|
let children;
|
|
305
473
|
let className;
|
|
306
474
|
let props;
|
|
@@ -317,29 +485,88 @@ function CommandItem(t0) {
|
|
|
317
485
|
}
|
|
318
486
|
let t1;
|
|
319
487
|
if ($[4] !== className) {
|
|
320
|
-
t1 = cn(
|
|
488
|
+
t1 = cn(commandItemClassName, className);
|
|
321
489
|
$[4] = className;
|
|
322
490
|
$[5] = t1;
|
|
323
491
|
} else t1 = $[5];
|
|
324
492
|
let t2;
|
|
325
|
-
if ($[6]
|
|
326
|
-
t2 = /* @__PURE__ */ jsx(
|
|
327
|
-
$[6] = t2;
|
|
328
|
-
} else t2 = $[6];
|
|
329
|
-
let t3;
|
|
330
|
-
if ($[7] !== children || $[8] !== props || $[9] !== t1) {
|
|
331
|
-
t3 = /* @__PURE__ */ jsxs(pkg.Item, {
|
|
493
|
+
if ($[6] !== children || $[7] !== props || $[8] !== t1) {
|
|
494
|
+
t2 = /* @__PURE__ */ jsx(Command$1.Item, {
|
|
332
495
|
"data-slot": "command-item",
|
|
333
496
|
className: t1,
|
|
334
497
|
...props,
|
|
335
|
-
children
|
|
498
|
+
children
|
|
336
499
|
});
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
} else
|
|
342
|
-
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;
|
|
343
570
|
}
|
|
344
571
|
function CommandShortcut(t0) {
|
|
345
572
|
const $ = c(8);
|
|
@@ -373,6 +600,16 @@ function CommandShortcut(t0) {
|
|
|
373
600
|
} else t2 = $[7];
|
|
374
601
|
return t2;
|
|
375
602
|
}
|
|
376
|
-
|
|
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
|
+
});
|
|
377
614
|
//#endregion
|
|
378
|
-
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
|
@@ -4,7 +4,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
6
6
|
import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
|
|
7
|
-
|
|
8
7
|
//#region src/ui/context-menu.tsx
|
|
9
8
|
function ContextMenu(t0) {
|
|
10
9
|
const $ = c(4);
|
|
@@ -515,6 +514,5 @@ function ContextMenuShortcut(t0) {
|
|
|
515
514
|
} else t2 = $[7];
|
|
516
515
|
return t2;
|
|
517
516
|
}
|
|
518
|
-
|
|
519
517
|
//#endregion
|
|
520
|
-
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({
|