@arolariu/components 0.0.31 → 0.0.33
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/LICENSE +21 -0
- package/changelog.md +14 -0
- package/dist/cjs/components/ui/alert-dialog.cjs.map +1 -1
- package/dist/cjs/components/ui/alert.cjs +1 -1
- package/dist/cjs/components/ui/alert.cjs.map +1 -1
- package/dist/cjs/components/ui/aspect-ratio.cjs.map +1 -1
- package/dist/cjs/components/ui/avatar.cjs.map +1 -1
- package/dist/cjs/components/ui/badge.cjs.map +1 -1
- package/dist/cjs/components/ui/breadcrumb.cjs.map +1 -1
- package/dist/cjs/components/ui/button.cjs.map +1 -1
- package/dist/cjs/components/ui/calendar.cjs.map +1 -1
- package/dist/cjs/components/ui/card.cjs.map +1 -1
- package/dist/cjs/components/ui/carousel.cjs.map +1 -1
- package/dist/cjs/components/ui/chart.cjs.map +1 -1
- package/dist/cjs/components/ui/checkbox.cjs.map +1 -1
- package/dist/cjs/components/ui/collapsible.cjs.map +1 -1
- package/dist/cjs/components/ui/command.cjs.map +1 -1
- package/dist/cjs/components/ui/context-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/drawer.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/form.cjs.map +1 -1
- package/dist/cjs/components/ui/hover-card.cjs.map +1 -1
- package/dist/cjs/components/ui/input-otp.cjs.map +1 -1
- package/dist/cjs/components/ui/input.cjs.map +1 -1
- package/dist/cjs/components/ui/label.cjs.map +1 -1
- package/dist/cjs/components/ui/menubar.cjs.map +1 -1
- package/dist/cjs/components/ui/navigation-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/pagination.cjs.map +1 -1
- package/dist/cjs/components/ui/popover.cjs.map +1 -1
- package/dist/cjs/components/ui/progress.cjs.map +1 -1
- package/dist/cjs/components/ui/radio-group.cjs.map +1 -1
- package/dist/cjs/components/ui/resizable.cjs.map +1 -1
- package/dist/cjs/components/ui/scroll-area.cjs.map +1 -1
- package/dist/cjs/components/ui/select.cjs.map +1 -1
- package/dist/cjs/components/ui/separator.cjs.map +1 -1
- package/dist/cjs/components/ui/sheet.cjs.map +1 -1
- package/dist/cjs/components/ui/sidebar.cjs.map +1 -1
- package/dist/cjs/components/ui/skeleton.cjs.map +1 -1
- package/dist/cjs/components/ui/slider.cjs.map +1 -1
- package/dist/cjs/components/ui/sonner.cjs +1 -1
- package/dist/cjs/components/ui/sonner.cjs.map +1 -1
- package/dist/cjs/components/ui/switch.cjs.map +1 -1
- package/dist/cjs/components/ui/table.cjs.map +1 -1
- package/dist/cjs/components/ui/tabs.cjs.map +1 -1
- package/dist/cjs/components/ui/textarea.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle-group.cjs.map +1 -1
- package/dist/cjs/components/ui/toggle.cjs.map +1 -1
- package/dist/cjs/components/ui/tooltip.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.css +1 -0
- package/dist/cjs/node_modules/sonner/dist/index.cjs +1 -1
- package/dist/cjs/node_modules/sonner/dist/index.cjs.map +1 -1
- package/dist/esm/components/ui/alert-dialog.js.map +1 -1
- package/dist/esm/components/ui/alert.js +8 -8
- package/dist/esm/components/ui/alert.js.map +1 -1
- package/dist/esm/components/ui/aspect-ratio.js.map +1 -1
- package/dist/esm/components/ui/avatar.js.map +1 -1
- package/dist/esm/components/ui/badge.js.map +1 -1
- package/dist/esm/components/ui/breadcrumb.js.map +1 -1
- package/dist/esm/components/ui/button.js.map +1 -1
- package/dist/esm/components/ui/calendar.js.map +1 -1
- package/dist/esm/components/ui/card.js.map +1 -1
- package/dist/esm/components/ui/carousel.js.map +1 -1
- package/dist/esm/components/ui/chart.js.map +1 -1
- package/dist/esm/components/ui/checkbox.js.map +1 -1
- package/dist/esm/components/ui/collapsible.js.map +1 -1
- package/dist/esm/components/ui/command.js.map +1 -1
- package/dist/esm/components/ui/context-menu.js.map +1 -1
- package/dist/esm/components/ui/drawer.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
- package/dist/esm/components/ui/form.js.map +1 -1
- package/dist/esm/components/ui/hover-card.js.map +1 -1
- package/dist/esm/components/ui/input-otp.js.map +1 -1
- package/dist/esm/components/ui/input.js.map +1 -1
- package/dist/esm/components/ui/label.js.map +1 -1
- package/dist/esm/components/ui/menubar.js.map +1 -1
- package/dist/esm/components/ui/navigation-menu.js.map +1 -1
- package/dist/esm/components/ui/pagination.js.map +1 -1
- package/dist/esm/components/ui/popover.js.map +1 -1
- package/dist/esm/components/ui/progress.js.map +1 -1
- package/dist/esm/components/ui/radio-group.js.map +1 -1
- package/dist/esm/components/ui/resizable.js.map +1 -1
- package/dist/esm/components/ui/scroll-area.js.map +1 -1
- package/dist/esm/components/ui/select.js.map +1 -1
- package/dist/esm/components/ui/separator.js.map +1 -1
- package/dist/esm/components/ui/sheet.js.map +1 -1
- package/dist/esm/components/ui/sidebar.js.map +1 -1
- package/dist/esm/components/ui/skeleton.js.map +1 -1
- package/dist/esm/components/ui/slider.js.map +1 -1
- package/dist/esm/components/ui/sonner.js +3 -1
- package/dist/esm/components/ui/sonner.js.map +1 -1
- package/dist/esm/components/ui/switch.js.map +1 -1
- package/dist/esm/components/ui/table.js.map +1 -1
- package/dist/esm/components/ui/tabs.js.map +1 -1
- package/dist/esm/components/ui/textarea.js.map +1 -1
- package/dist/esm/components/ui/toggle-group.js.map +1 -1
- package/dist/esm/components/ui/toggle.js.map +1 -1
- package/dist/esm/components/ui/tooltip.js.map +1 -1
- package/dist/esm/index.css +1 -0
- package/dist/esm/index.js +296 -293
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/node_modules/sonner/dist/index.js +4 -4
- package/dist/esm/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +300 -0
- package/dist/types/components/ui/alert.d.ts.map +1 -1
- package/dist/types/components/ui/form.d.ts.map +1 -1
- package/dist/types/components/ui/sonner.d.ts +2 -2
- package/dist/types/components/ui/sonner.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/package.json +77 -45
- package/src/components/ui/alert-dialog.tsx +160 -160
- package/src/components/ui/alert.tsx +2 -0
- package/src/components/ui/aspect-ratio.tsx +12 -12
- package/src/components/ui/avatar.tsx +52 -52
- package/src/components/ui/badge.tsx +47 -47
- package/src/components/ui/breadcrumb.tsx +116 -116
- package/src/components/ui/button.tsx +60 -60
- package/src/components/ui/calendar.tsx +75 -75
- package/src/components/ui/card.tsx +79 -79
- package/src/components/ui/carousel.tsx +240 -240
- package/src/components/ui/chart.tsx +352 -352
- package/src/components/ui/checkbox.tsx +31 -31
- package/src/components/ui/collapsible.tsx +34 -34
- package/src/components/ui/command.tsx +176 -176
- package/src/components/ui/context-menu.tsx +254 -254
- package/src/components/ui/drawer.tsx +137 -137
- package/src/components/ui/dropdown-menu.tsx +259 -259
- package/src/components/ui/form.tsx +173 -173
- package/src/components/ui/hover-card.tsx +41 -41
- package/src/components/ui/input-otp.tsx +77 -77
- package/src/components/ui/input.tsx +22 -22
- package/src/components/ui/label.tsx +23 -23
- package/src/components/ui/menubar.tsx +278 -278
- package/src/components/ui/navigation-menu.tsx +170 -170
- package/src/components/ui/pagination.tsx +128 -128
- package/src/components/ui/popover.tsx +47 -47
- package/src/components/ui/progress.tsx +30 -30
- package/src/components/ui/radio-group.tsx +44 -44
- package/src/components/ui/resizable.tsx +55 -55
- package/src/components/ui/scroll-area.tsx +57 -57
- package/src/components/ui/select.tsx +183 -183
- package/src/components/ui/separator.tsx +27 -27
- package/src/components/ui/sheet.tsx +144 -144
- package/src/components/ui/sidebar.tsx +725 -725
- package/src/components/ui/skeleton.tsx +17 -17
- package/src/components/ui/slider.tsx +62 -62
- package/src/components/ui/sonner.tsx +2 -2
- package/src/components/ui/switch.tsx +30 -30
- package/src/components/ui/table.tsx +118 -118
- package/src/components/ui/tabs.tsx +65 -65
- package/src/components/ui/textarea.tsx +19 -19
- package/src/components/ui/toggle-group.tsx +72 -72
- package/src/components/ui/toggle.tsx +46 -46
- package/src/components/ui/tooltip.tsx +60 -60
- package/src/index.css +3 -107
- package/src/index.ts +3 -1
- package/tailwind.config.mjs +67 -0
- package/tsconfig.json +4 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
5
|
-
import { CheckIcon } from "lucide-react";
|
|
6
|
-
import { cn } from "./../../lib/utils";
|
|
7
|
-
|
|
8
|
-
function Checkbox({
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<CheckboxPrimitive.Root
|
|
14
|
-
data-slot="checkbox"
|
|
15
|
-
className={cn(
|
|
16
|
-
"peer border-neutral-200 data-[state=checked]:bg-neutral-900 data-[state=checked]:text-neutral-50 data-[state=checked]:border-neutral-900 focus-visible:border-neutral-950 focus-visible:ring-neutral-950/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:text-neutral-900 dark:data-[state=checked]:border-neutral-50 dark:focus-visible:border-neutral-300 dark:focus-visible:ring-neutral-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
>
|
|
21
|
-
<CheckboxPrimitive.Indicator
|
|
22
|
-
data-slot="checkbox-indicator"
|
|
23
|
-
className="flex items-center justify-center text-current transition-none"
|
|
24
|
-
>
|
|
25
|
-
<CheckIcon className="size-3.5" />
|
|
26
|
-
</CheckboxPrimitive.Indicator>
|
|
27
|
-
</CheckboxPrimitive.Root>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Checkbox };
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
6
|
+
import { cn } from "./../../lib/utils";
|
|
7
|
+
|
|
8
|
+
function Checkbox({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<CheckboxPrimitive.Root
|
|
14
|
+
data-slot="checkbox"
|
|
15
|
+
className={cn(
|
|
16
|
+
"peer border-neutral-200 data-[state=checked]:bg-neutral-900 data-[state=checked]:text-neutral-50 data-[state=checked]:border-neutral-900 focus-visible:border-neutral-950 focus-visible:ring-neutral-950/50 aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-800 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:text-neutral-900 dark:data-[state=checked]:border-neutral-50 dark:focus-visible:border-neutral-300 dark:focus-visible:ring-neutral-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<CheckboxPrimitive.Indicator
|
|
22
|
+
data-slot="checkbox-indicator"
|
|
23
|
+
className="flex items-center justify-center text-current transition-none"
|
|
24
|
+
>
|
|
25
|
+
<CheckIcon className="size-3.5" />
|
|
26
|
+
</CheckboxPrimitive.Indicator>
|
|
27
|
+
</CheckboxPrimitive.Root>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Checkbox };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
|
|
5
|
-
|
|
6
|
-
function Collapsible({
|
|
7
|
-
...props
|
|
8
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
9
|
-
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function CollapsibleTrigger({
|
|
13
|
-
...props
|
|
14
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
15
|
-
return (
|
|
16
|
-
<CollapsiblePrimitive.CollapsibleTrigger
|
|
17
|
-
data-slot="collapsible-trigger"
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function CollapsibleContent({
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
26
|
-
return (
|
|
27
|
-
<CollapsiblePrimitive.CollapsibleContent
|
|
28
|
-
data-slot="collapsible-content"
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
|
|
5
|
+
|
|
6
|
+
function Collapsible({
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
9
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function CollapsibleTrigger({
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
15
|
+
return (
|
|
16
|
+
<CollapsiblePrimitive.CollapsibleTrigger
|
|
17
|
+
data-slot="collapsible-trigger"
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function CollapsibleContent({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
26
|
+
return (
|
|
27
|
+
<CollapsiblePrimitive.CollapsibleContent
|
|
28
|
+
data-slot="collapsible-content"
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
-
import { SearchIcon } from "lucide-react";
|
|
6
|
-
import { cn } from "./../../lib/utils";
|
|
7
|
-
import {
|
|
8
|
-
Dialog,
|
|
9
|
-
DialogContent,
|
|
10
|
-
DialogDescription,
|
|
11
|
-
DialogHeader,
|
|
12
|
-
DialogTitle,
|
|
13
|
-
} from "./dialog";
|
|
14
|
-
|
|
15
|
-
function Command({
|
|
16
|
-
className,
|
|
17
|
-
...props
|
|
18
|
-
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
19
|
-
return (
|
|
20
|
-
<CommandPrimitive
|
|
21
|
-
data-slot="command"
|
|
22
|
-
className={cn(
|
|
23
|
-
"bg-white text-neutral-950 flex h-full w-full flex-col overflow-hidden rounded-md dark:bg-neutral-950 dark:text-neutral-50",
|
|
24
|
-
className
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function CommandDialog({
|
|
32
|
-
title = "Command Palette",
|
|
33
|
-
description = "Search for a command to run...",
|
|
34
|
-
children,
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof Dialog> & {
|
|
37
|
-
title?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
}) {
|
|
40
|
-
return (
|
|
41
|
-
<Dialog {...props}>
|
|
42
|
-
<DialogHeader className="sr-only">
|
|
43
|
-
<DialogTitle>{title}</DialogTitle>
|
|
44
|
-
<DialogDescription>{description}</DialogDescription>
|
|
45
|
-
</DialogHeader>
|
|
46
|
-
<DialogContent className="overflow-hidden p-0">
|
|
47
|
-
<Command className="[&_[cmdk-group-heading]]:text-neutral-500 **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 dark:[&_[cmdk-group-heading]]:text-neutral-400">
|
|
48
|
-
{children}
|
|
49
|
-
</Command>
|
|
50
|
-
</DialogContent>
|
|
51
|
-
</Dialog>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function CommandInput({
|
|
56
|
-
className,
|
|
57
|
-
...props
|
|
58
|
-
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
data-slot="command-input-wrapper"
|
|
62
|
-
className="flex h-9 items-center gap-2 border-b px-3"
|
|
63
|
-
>
|
|
64
|
-
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
65
|
-
<CommandPrimitive.Input
|
|
66
|
-
data-slot="command-input"
|
|
67
|
-
className={cn(
|
|
68
|
-
"placeholder:text-neutral-500 flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-neutral-400",
|
|
69
|
-
className
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function CommandList({
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
81
|
-
return (
|
|
82
|
-
<CommandPrimitive.List
|
|
83
|
-
data-slot="command-list"
|
|
84
|
-
className={cn(
|
|
85
|
-
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
86
|
-
className
|
|
87
|
-
)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function CommandEmpty({
|
|
94
|
-
...props
|
|
95
|
-
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
96
|
-
return (
|
|
97
|
-
<CommandPrimitive.Empty
|
|
98
|
-
data-slot="command-empty"
|
|
99
|
-
className="py-6 text-center text-sm"
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function CommandGroup({
|
|
106
|
-
className,
|
|
107
|
-
...props
|
|
108
|
-
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
109
|
-
return (
|
|
110
|
-
<CommandPrimitive.Group
|
|
111
|
-
data-slot="command-group"
|
|
112
|
-
className={cn(
|
|
113
|
-
"text-neutral-950 [&_[cmdk-group-heading]]:text-neutral-500 overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium dark:text-neutral-50 dark:[&_[cmdk-group-heading]]:text-neutral-400",
|
|
114
|
-
className
|
|
115
|
-
)}
|
|
116
|
-
{...props}
|
|
117
|
-
/>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function CommandSeparator({
|
|
122
|
-
className,
|
|
123
|
-
...props
|
|
124
|
-
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
125
|
-
return (
|
|
126
|
-
<CommandPrimitive.Separator
|
|
127
|
-
data-slot="command-separator"
|
|
128
|
-
className={cn("bg-neutral-200 -mx-1 h-px dark:bg-neutral-800", className)}
|
|
129
|
-
{...props}
|
|
130
|
-
/>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function CommandItem({
|
|
135
|
-
className,
|
|
136
|
-
...props
|
|
137
|
-
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
138
|
-
return (
|
|
139
|
-
<CommandPrimitive.Item
|
|
140
|
-
data-slot="command-item"
|
|
141
|
-
className={cn(
|
|
142
|
-
"data-[selected=true]:bg-neutral-100 data-[selected=true]:text-neutral-900 [&_svg:not([class*='text-'])]:text-neutral-500 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:data-[selected=true]:bg-neutral-800 dark:data-[selected=true]:text-neutral-50 dark:[&_svg:not([class*='text-'])]:text-neutral-400",
|
|
143
|
-
className
|
|
144
|
-
)}
|
|
145
|
-
{...props}
|
|
146
|
-
/>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function CommandShortcut({
|
|
151
|
-
className,
|
|
152
|
-
...props
|
|
153
|
-
}: React.ComponentProps<"span">) {
|
|
154
|
-
return (
|
|
155
|
-
<span
|
|
156
|
-
data-slot="command-shortcut"
|
|
157
|
-
className={cn(
|
|
158
|
-
"text-neutral-500 ml-auto text-xs tracking-widest dark:text-neutral-400",
|
|
159
|
-
className
|
|
160
|
-
)}
|
|
161
|
-
{...props}
|
|
162
|
-
/>
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export {
|
|
167
|
-
Command,
|
|
168
|
-
CommandDialog,
|
|
169
|
-
CommandInput,
|
|
170
|
-
CommandList,
|
|
171
|
-
CommandEmpty,
|
|
172
|
-
CommandGroup,
|
|
173
|
-
CommandItem,
|
|
174
|
-
CommandShortcut,
|
|
175
|
-
CommandSeparator,
|
|
176
|
-
};
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
+
import { SearchIcon } from "lucide-react";
|
|
6
|
+
import { cn } from "./../../lib/utils";
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
} from "./dialog";
|
|
14
|
+
|
|
15
|
+
function Command({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
19
|
+
return (
|
|
20
|
+
<CommandPrimitive
|
|
21
|
+
data-slot="command"
|
|
22
|
+
className={cn(
|
|
23
|
+
"bg-white text-neutral-950 flex h-full w-full flex-col overflow-hidden rounded-md dark:bg-neutral-950 dark:text-neutral-50",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function CommandDialog({
|
|
32
|
+
title = "Command Palette",
|
|
33
|
+
description = "Search for a command to run...",
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}: React.ComponentProps<typeof Dialog> & {
|
|
37
|
+
title?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
}) {
|
|
40
|
+
return (
|
|
41
|
+
<Dialog {...props}>
|
|
42
|
+
<DialogHeader className="sr-only">
|
|
43
|
+
<DialogTitle>{title}</DialogTitle>
|
|
44
|
+
<DialogDescription>{description}</DialogDescription>
|
|
45
|
+
</DialogHeader>
|
|
46
|
+
<DialogContent className="overflow-hidden p-0">
|
|
47
|
+
<Command className="[&_[cmdk-group-heading]]:text-neutral-500 **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 dark:[&_[cmdk-group-heading]]:text-neutral-400">
|
|
48
|
+
{children}
|
|
49
|
+
</Command>
|
|
50
|
+
</DialogContent>
|
|
51
|
+
</Dialog>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function CommandInput({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
data-slot="command-input-wrapper"
|
|
62
|
+
className="flex h-9 items-center gap-2 border-b px-3"
|
|
63
|
+
>
|
|
64
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
65
|
+
<CommandPrimitive.Input
|
|
66
|
+
data-slot="command-input"
|
|
67
|
+
className={cn(
|
|
68
|
+
"placeholder:text-neutral-500 flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-neutral-400",
|
|
69
|
+
className
|
|
70
|
+
)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function CommandList({
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
81
|
+
return (
|
|
82
|
+
<CommandPrimitive.List
|
|
83
|
+
data-slot="command-list"
|
|
84
|
+
className={cn(
|
|
85
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
86
|
+
className
|
|
87
|
+
)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function CommandEmpty({
|
|
94
|
+
...props
|
|
95
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
96
|
+
return (
|
|
97
|
+
<CommandPrimitive.Empty
|
|
98
|
+
data-slot="command-empty"
|
|
99
|
+
className="py-6 text-center text-sm"
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function CommandGroup({
|
|
106
|
+
className,
|
|
107
|
+
...props
|
|
108
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
109
|
+
return (
|
|
110
|
+
<CommandPrimitive.Group
|
|
111
|
+
data-slot="command-group"
|
|
112
|
+
className={cn(
|
|
113
|
+
"text-neutral-950 [&_[cmdk-group-heading]]:text-neutral-500 overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium dark:text-neutral-50 dark:[&_[cmdk-group-heading]]:text-neutral-400",
|
|
114
|
+
className
|
|
115
|
+
)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function CommandSeparator({
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
125
|
+
return (
|
|
126
|
+
<CommandPrimitive.Separator
|
|
127
|
+
data-slot="command-separator"
|
|
128
|
+
className={cn("bg-neutral-200 -mx-1 h-px dark:bg-neutral-800", className)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function CommandItem({
|
|
135
|
+
className,
|
|
136
|
+
...props
|
|
137
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
138
|
+
return (
|
|
139
|
+
<CommandPrimitive.Item
|
|
140
|
+
data-slot="command-item"
|
|
141
|
+
className={cn(
|
|
142
|
+
"data-[selected=true]:bg-neutral-100 data-[selected=true]:text-neutral-900 [&_svg:not([class*='text-'])]:text-neutral-500 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 dark:data-[selected=true]:bg-neutral-800 dark:data-[selected=true]:text-neutral-50 dark:[&_svg:not([class*='text-'])]:text-neutral-400",
|
|
143
|
+
className
|
|
144
|
+
)}
|
|
145
|
+
{...props}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function CommandShortcut({
|
|
151
|
+
className,
|
|
152
|
+
...props
|
|
153
|
+
}: React.ComponentProps<"span">) {
|
|
154
|
+
return (
|
|
155
|
+
<span
|
|
156
|
+
data-slot="command-shortcut"
|
|
157
|
+
className={cn(
|
|
158
|
+
"text-neutral-500 ml-auto text-xs tracking-widest dark:text-neutral-400",
|
|
159
|
+
className
|
|
160
|
+
)}
|
|
161
|
+
{...props}
|
|
162
|
+
/>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export {
|
|
167
|
+
Command,
|
|
168
|
+
CommandDialog,
|
|
169
|
+
CommandInput,
|
|
170
|
+
CommandList,
|
|
171
|
+
CommandEmpty,
|
|
172
|
+
CommandGroup,
|
|
173
|
+
CommandItem,
|
|
174
|
+
CommandShortcut,
|
|
175
|
+
CommandSeparator,
|
|
176
|
+
};
|