@arolariu/components 0.0.35 → 0.0.36

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.
Files changed (220) hide show
  1. package/changelog.md +5 -0
  2. package/dist/cjs/components/ui/accordion.cjs +1 -1
  3. package/dist/cjs/components/ui/accordion.cjs.map +1 -1
  4. package/dist/cjs/components/ui/alert-dialog.cjs +1 -1
  5. package/dist/cjs/components/ui/alert-dialog.cjs.map +1 -1
  6. package/dist/cjs/components/ui/alert.cjs +1 -1
  7. package/dist/cjs/components/ui/alert.cjs.map +1 -1
  8. package/dist/cjs/components/ui/aspect-ratio.cjs.map +1 -1
  9. package/dist/cjs/components/ui/avatar.cjs.map +1 -1
  10. package/dist/cjs/components/ui/badge.cjs +1 -1
  11. package/dist/cjs/components/ui/badge.cjs.map +1 -1
  12. package/dist/cjs/components/ui/breadcrumb.cjs.map +1 -1
  13. package/dist/cjs/components/ui/button.cjs +6 -6
  14. package/dist/cjs/components/ui/button.cjs.map +1 -1
  15. package/dist/cjs/components/ui/card.cjs +13 -3
  16. package/dist/cjs/components/ui/card.cjs.map +1 -1
  17. package/dist/cjs/components/ui/carousel.cjs.map +1 -1
  18. package/dist/cjs/components/ui/chart.cjs.map +1 -1
  19. package/dist/cjs/components/ui/checkbox.cjs +1 -1
  20. package/dist/cjs/components/ui/checkbox.cjs.map +1 -1
  21. package/dist/cjs/components/ui/collapsible.cjs +1 -1
  22. package/dist/cjs/components/ui/collapsible.cjs.map +1 -1
  23. package/dist/cjs/components/ui/command.cjs +2 -2
  24. package/dist/cjs/components/ui/command.cjs.map +1 -1
  25. package/dist/cjs/components/ui/context-menu.cjs +7 -7
  26. package/dist/cjs/components/ui/context-menu.cjs.map +1 -1
  27. package/dist/cjs/components/ui/dialog.cjs +1 -1
  28. package/dist/cjs/components/ui/dialog.cjs.map +1 -1
  29. package/dist/cjs/components/ui/drawer.cjs +3 -3
  30. package/dist/cjs/components/ui/drawer.cjs.map +1 -1
  31. package/dist/cjs/components/ui/dropdown-menu.cjs +7 -7
  32. package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
  33. package/dist/cjs/components/ui/form.cjs +2 -2
  34. package/dist/cjs/components/ui/form.cjs.map +1 -1
  35. package/dist/cjs/components/ui/hover-card.cjs +9 -6
  36. package/dist/cjs/components/ui/hover-card.cjs.map +1 -1
  37. package/dist/cjs/components/ui/input-otp.cjs +2 -3
  38. package/dist/cjs/components/ui/input-otp.cjs.map +1 -1
  39. package/dist/cjs/components/ui/input.cjs +1 -1
  40. package/dist/cjs/components/ui/input.cjs.map +1 -1
  41. package/dist/cjs/components/ui/label.cjs.map +1 -1
  42. package/dist/cjs/components/ui/menubar.cjs +9 -9
  43. package/dist/cjs/components/ui/menubar.cjs.map +1 -1
  44. package/dist/cjs/components/ui/navigation-menu.cjs +5 -5
  45. package/dist/cjs/components/ui/navigation-menu.cjs.map +1 -1
  46. package/dist/cjs/components/ui/pagination.cjs.map +1 -1
  47. package/dist/cjs/components/ui/popover.cjs +1 -1
  48. package/dist/cjs/components/ui/popover.cjs.map +1 -1
  49. package/dist/cjs/components/ui/progress.cjs.map +1 -1
  50. package/dist/cjs/components/ui/radio-group.cjs +1 -1
  51. package/dist/cjs/components/ui/radio-group.cjs.map +1 -1
  52. package/dist/cjs/components/ui/resizable.cjs.map +1 -1
  53. package/dist/cjs/components/ui/scroll-area.cjs +1 -1
  54. package/dist/cjs/components/ui/scroll-area.cjs.map +1 -1
  55. package/dist/cjs/components/ui/select.cjs +6 -5
  56. package/dist/cjs/components/ui/select.cjs.map +1 -1
  57. package/dist/cjs/components/ui/separator.cjs.map +1 -1
  58. package/dist/cjs/components/ui/sheet.cjs +1 -1
  59. package/dist/cjs/components/ui/sheet.cjs.map +1 -1
  60. package/dist/cjs/components/ui/sidebar.cjs +14 -11
  61. package/dist/cjs/components/ui/sidebar.cjs.map +1 -1
  62. package/dist/cjs/components/ui/skeleton.cjs +2 -1
  63. package/dist/cjs/components/ui/skeleton.cjs.map +1 -1
  64. package/dist/cjs/components/ui/slider.cjs +2 -2
  65. package/dist/cjs/components/ui/slider.cjs.map +1 -1
  66. package/dist/cjs/components/ui/sonner.cjs +5 -7
  67. package/dist/cjs/components/ui/sonner.cjs.map +1 -1
  68. package/dist/cjs/components/ui/switch.cjs +2 -2
  69. package/dist/cjs/components/ui/switch.cjs.map +1 -1
  70. package/dist/cjs/components/ui/table.cjs +2 -2
  71. package/dist/cjs/components/ui/table.cjs.map +1 -1
  72. package/dist/cjs/components/ui/tabs.cjs +3 -3
  73. package/dist/cjs/components/ui/tabs.cjs.map +1 -1
  74. package/dist/cjs/components/ui/textarea.cjs +1 -1
  75. package/dist/cjs/components/ui/textarea.cjs.map +1 -1
  76. package/dist/cjs/components/ui/toggle-group.cjs +2 -2
  77. package/dist/cjs/components/ui/toggle-group.cjs.map +1 -1
  78. package/dist/cjs/components/ui/toggle.cjs +2 -2
  79. package/dist/cjs/components/ui/toggle.cjs.map +1 -1
  80. package/dist/cjs/components/ui/tooltip.cjs +1 -1
  81. package/dist/cjs/components/ui/tooltip.cjs.map +1 -1
  82. package/dist/cjs/index.cjs +3 -0
  83. package/dist/cjs/index.css +433 -262
  84. package/dist/esm/components/ui/accordion.js +1 -1
  85. package/dist/esm/components/ui/accordion.js.map +1 -1
  86. package/dist/esm/components/ui/alert-dialog.js +1 -1
  87. package/dist/esm/components/ui/alert-dialog.js.map +1 -1
  88. package/dist/esm/components/ui/alert.js +1 -1
  89. package/dist/esm/components/ui/alert.js.map +1 -1
  90. package/dist/esm/components/ui/aspect-ratio.js.map +1 -1
  91. package/dist/esm/components/ui/avatar.js.map +1 -1
  92. package/dist/esm/components/ui/badge.js +1 -1
  93. package/dist/esm/components/ui/badge.js.map +1 -1
  94. package/dist/esm/components/ui/breadcrumb.js.map +1 -1
  95. package/dist/esm/components/ui/button.js +6 -6
  96. package/dist/esm/components/ui/button.js.map +1 -1
  97. package/dist/esm/components/ui/card.js +11 -4
  98. package/dist/esm/components/ui/card.js.map +1 -1
  99. package/dist/esm/components/ui/carousel.js.map +1 -1
  100. package/dist/esm/components/ui/chart.js.map +1 -1
  101. package/dist/esm/components/ui/checkbox.js +1 -1
  102. package/dist/esm/components/ui/checkbox.js.map +1 -1
  103. package/dist/esm/components/ui/collapsible.js +1 -1
  104. package/dist/esm/components/ui/collapsible.js.map +1 -1
  105. package/dist/esm/components/ui/command.js +2 -2
  106. package/dist/esm/components/ui/command.js.map +1 -1
  107. package/dist/esm/components/ui/context-menu.js +7 -7
  108. package/dist/esm/components/ui/context-menu.js.map +1 -1
  109. package/dist/esm/components/ui/dialog.js +1 -1
  110. package/dist/esm/components/ui/dialog.js.map +1 -1
  111. package/dist/esm/components/ui/drawer.js +3 -3
  112. package/dist/esm/components/ui/drawer.js.map +1 -1
  113. package/dist/esm/components/ui/dropdown-menu.js +7 -7
  114. package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
  115. package/dist/esm/components/ui/form.js +2 -2
  116. package/dist/esm/components/ui/form.js.map +1 -1
  117. package/dist/esm/components/ui/hover-card.js +9 -6
  118. package/dist/esm/components/ui/hover-card.js.map +1 -1
  119. package/dist/esm/components/ui/input-otp.js +2 -3
  120. package/dist/esm/components/ui/input-otp.js.map +1 -1
  121. package/dist/esm/components/ui/input.js +1 -1
  122. package/dist/esm/components/ui/input.js.map +1 -1
  123. package/dist/esm/components/ui/label.js.map +1 -1
  124. package/dist/esm/components/ui/menubar.js +9 -9
  125. package/dist/esm/components/ui/menubar.js.map +1 -1
  126. package/dist/esm/components/ui/navigation-menu.js +5 -5
  127. package/dist/esm/components/ui/navigation-menu.js.map +1 -1
  128. package/dist/esm/components/ui/pagination.js.map +1 -1
  129. package/dist/esm/components/ui/popover.js +1 -1
  130. package/dist/esm/components/ui/popover.js.map +1 -1
  131. package/dist/esm/components/ui/progress.js.map +1 -1
  132. package/dist/esm/components/ui/radio-group.js +1 -1
  133. package/dist/esm/components/ui/radio-group.js.map +1 -1
  134. package/dist/esm/components/ui/resizable.js.map +1 -1
  135. package/dist/esm/components/ui/scroll-area.js +1 -1
  136. package/dist/esm/components/ui/scroll-area.js.map +1 -1
  137. package/dist/esm/components/ui/select.js +6 -5
  138. package/dist/esm/components/ui/select.js.map +1 -1
  139. package/dist/esm/components/ui/separator.js.map +1 -1
  140. package/dist/esm/components/ui/sheet.js +1 -1
  141. package/dist/esm/components/ui/sheet.js.map +1 -1
  142. package/dist/esm/components/ui/sidebar.js +14 -11
  143. package/dist/esm/components/ui/sidebar.js.map +1 -1
  144. package/dist/esm/components/ui/skeleton.js +2 -1
  145. package/dist/esm/components/ui/skeleton.js.map +1 -1
  146. package/dist/esm/components/ui/slider.js +2 -2
  147. package/dist/esm/components/ui/slider.js.map +1 -1
  148. package/dist/esm/components/ui/sonner.js +5 -7
  149. package/dist/esm/components/ui/sonner.js.map +1 -1
  150. package/dist/esm/components/ui/switch.js +2 -2
  151. package/dist/esm/components/ui/switch.js.map +1 -1
  152. package/dist/esm/components/ui/table.js +2 -2
  153. package/dist/esm/components/ui/table.js.map +1 -1
  154. package/dist/esm/components/ui/tabs.js +3 -3
  155. package/dist/esm/components/ui/tabs.js.map +1 -1
  156. package/dist/esm/components/ui/textarea.js +1 -1
  157. package/dist/esm/components/ui/textarea.js.map +1 -1
  158. package/dist/esm/components/ui/toggle-group.js +2 -2
  159. package/dist/esm/components/ui/toggle-group.js.map +1 -1
  160. package/dist/esm/components/ui/toggle.js +2 -2
  161. package/dist/esm/components/ui/toggle.js.map +1 -1
  162. package/dist/esm/components/ui/tooltip.js +1 -1
  163. package/dist/esm/components/ui/tooltip.js.map +1 -1
  164. package/dist/esm/index.css +433 -262
  165. package/dist/esm/index.js +2 -1
  166. package/dist/index.css +433 -262
  167. package/dist/index.js +2 -1
  168. package/dist/types/components/ui/card.d.ts +2 -1
  169. package/dist/types/components/ui/form.d.ts +1 -1
  170. package/dist/types/components/ui/select.d.ts +3 -1
  171. package/dist/types/components/ui/sidebar.d.ts +5 -6
  172. package/dist/types/index.d.ts +1 -1
  173. package/package.json +461 -462
  174. package/src/components/ui/accordion.tsx +3 -2
  175. package/src/components/ui/alert-dialog.tsx +160 -160
  176. package/src/components/ui/alert.tsx +3 -2
  177. package/src/components/ui/aspect-ratio.tsx +12 -12
  178. package/src/components/ui/avatar.tsx +53 -52
  179. package/src/components/ui/badge.tsx +48 -47
  180. package/src/components/ui/breadcrumb.tsx +117 -116
  181. package/src/components/ui/button.tsx +61 -60
  182. package/src/components/ui/card.tsx +97 -79
  183. package/src/components/ui/carousel.tsx +241 -240
  184. package/src/components/ui/chart.tsx +353 -352
  185. package/src/components/ui/checkbox.tsx +32 -31
  186. package/src/components/ui/collapsible.tsx +34 -34
  187. package/src/components/ui/command.tsx +177 -176
  188. package/src/components/ui/context-menu.tsx +255 -254
  189. package/src/components/ui/dialog.tsx +3 -2
  190. package/src/components/ui/drawer.tsx +138 -137
  191. package/src/components/ui/dropdown-menu.tsx +260 -259
  192. package/src/components/ui/form.tsx +174 -173
  193. package/src/components/ui/hover-card.tsx +44 -41
  194. package/src/components/ui/input-otp.tsx +77 -77
  195. package/src/components/ui/input.tsx +23 -22
  196. package/src/components/ui/label.tsx +24 -23
  197. package/src/components/ui/menubar.tsx +279 -278
  198. package/src/components/ui/navigation-menu.tsx +171 -170
  199. package/src/components/ui/pagination.tsx +129 -128
  200. package/src/components/ui/popover.tsx +48 -47
  201. package/src/components/ui/progress.tsx +31 -30
  202. package/src/components/ui/radio-group.tsx +45 -44
  203. package/src/components/ui/resizable.tsx +56 -55
  204. package/src/components/ui/scroll-area.tsx +58 -57
  205. package/src/components/ui/select.tsx +191 -183
  206. package/src/components/ui/separator.tsx +28 -27
  207. package/src/components/ui/sheet.tsx +145 -144
  208. package/src/components/ui/sidebar.tsx +729 -725
  209. package/src/components/ui/skeleton.tsx +19 -17
  210. package/src/components/ui/slider.tsx +63 -62
  211. package/src/components/ui/sonner.tsx +8 -12
  212. package/src/components/ui/switch.tsx +31 -30
  213. package/src/components/ui/table.tsx +119 -118
  214. package/src/components/ui/tabs.tsx +66 -65
  215. package/src/components/ui/textarea.tsx +20 -19
  216. package/src/components/ui/toggle-group.tsx +73 -72
  217. package/src/components/ui/toggle.tsx +47 -46
  218. package/src/components/ui/tooltip.tsx +61 -60
  219. package/src/index.css +75 -42
  220. package/src/index.ts +331 -330
@@ -1,31 +1,32 @@
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-2xs transition-shadow outline-hidden 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
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ function Checkbox({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
13
+ return (
14
+ <CheckboxPrimitive.Root
15
+ data-slot="checkbox"
16
+ className={cn(
17
+ "peer border-neutral-200 dark:bg-neutral-200/30 data-[state=checked]:bg-neutral-900 data-[state=checked]:text-neutral-50 dark:data-[state=checked]:bg-neutral-900 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:dark:bg-neutral-800/30 dark:data-[state=checked]:bg-neutral-50 dark:data-[state=checked]:text-neutral-900 dark:dark:data-[state=checked]:bg-neutral-50 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",
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ <CheckboxPrimitive.Indicator
23
+ data-slot="checkbox-indicator"
24
+ className="flex items-center justify-center text-current transition-none"
25
+ >
26
+ <CheckIcon className="size-3.5" />
27
+ </CheckboxPrimitive.Indicator>
28
+ </CheckboxPrimitive.Root>
29
+ );
30
+ }
31
+
32
+ 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,177 @@
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-xs 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
+
7
+ import { cn } from "@/lib/utils";
8
+ import {
9
+ Dialog,
10
+ DialogContent,
11
+ DialogDescription,
12
+ DialogHeader,
13
+ DialogTitle,
14
+ } from "@/components/ui/dialog";
15
+
16
+ function Command({
17
+ className,
18
+ ...props
19
+ }: React.ComponentProps<typeof CommandPrimitive>) {
20
+ return (
21
+ <CommandPrimitive
22
+ data-slot="command"
23
+ className={cn(
24
+ "bg-white text-neutral-950 flex h-full w-full flex-col overflow-hidden rounded-md dark:bg-neutral-950 dark:text-neutral-50",
25
+ className
26
+ )}
27
+ {...props}
28
+ />
29
+ );
30
+ }
31
+
32
+ function CommandDialog({
33
+ title = "Command Palette",
34
+ description = "Search for a command to run...",
35
+ children,
36
+ ...props
37
+ }: React.ComponentProps<typeof Dialog> & {
38
+ title?: string;
39
+ description?: string;
40
+ }) {
41
+ return (
42
+ <Dialog {...props}>
43
+ <DialogHeader className="sr-only">
44
+ <DialogTitle>{title}</DialogTitle>
45
+ <DialogDescription>{description}</DialogDescription>
46
+ </DialogHeader>
47
+ <DialogContent className="overflow-hidden p-0">
48
+ <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">
49
+ {children}
50
+ </Command>
51
+ </DialogContent>
52
+ </Dialog>
53
+ );
54
+ }
55
+
56
+ function CommandInput({
57
+ className,
58
+ ...props
59
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
60
+ return (
61
+ <div
62
+ data-slot="command-input-wrapper"
63
+ className="flex h-9 items-center gap-2 border-b px-3"
64
+ >
65
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
66
+ <CommandPrimitive.Input
67
+ data-slot="command-input"
68
+ className={cn(
69
+ "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",
70
+ className
71
+ )}
72
+ {...props}
73
+ />
74
+ </div>
75
+ );
76
+ }
77
+
78
+ function CommandList({
79
+ className,
80
+ ...props
81
+ }: React.ComponentProps<typeof CommandPrimitive.List>) {
82
+ return (
83
+ <CommandPrimitive.List
84
+ data-slot="command-list"
85
+ className={cn(
86
+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
87
+ className
88
+ )}
89
+ {...props}
90
+ />
91
+ );
92
+ }
93
+
94
+ function CommandEmpty({
95
+ ...props
96
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
97
+ return (
98
+ <CommandPrimitive.Empty
99
+ data-slot="command-empty"
100
+ className="py-6 text-center text-sm"
101
+ {...props}
102
+ />
103
+ );
104
+ }
105
+
106
+ function CommandGroup({
107
+ className,
108
+ ...props
109
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
110
+ return (
111
+ <CommandPrimitive.Group
112
+ data-slot="command-group"
113
+ className={cn(
114
+ "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",
115
+ className
116
+ )}
117
+ {...props}
118
+ />
119
+ );
120
+ }
121
+
122
+ function CommandSeparator({
123
+ className,
124
+ ...props
125
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
126
+ return (
127
+ <CommandPrimitive.Separator
128
+ data-slot="command-separator"
129
+ className={cn("bg-neutral-200 -mx-1 h-px dark:bg-neutral-800", className)}
130
+ {...props}
131
+ />
132
+ );
133
+ }
134
+
135
+ function CommandItem({
136
+ className,
137
+ ...props
138
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) {
139
+ return (
140
+ <CommandPrimitive.Item
141
+ data-slot="command-item"
142
+ className={cn(
143
+ "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",
144
+ className
145
+ )}
146
+ {...props}
147
+ />
148
+ );
149
+ }
150
+
151
+ function CommandShortcut({
152
+ className,
153
+ ...props
154
+ }: React.ComponentProps<"span">) {
155
+ return (
156
+ <span
157
+ data-slot="command-shortcut"
158
+ className={cn(
159
+ "text-neutral-500 ml-auto text-xs tracking-widest dark:text-neutral-400",
160
+ className
161
+ )}
162
+ {...props}
163
+ />
164
+ );
165
+ }
166
+
167
+ export {
168
+ Command,
169
+ CommandDialog,
170
+ CommandInput,
171
+ CommandList,
172
+ CommandEmpty,
173
+ CommandGroup,
174
+ CommandItem,
175
+ CommandShortcut,
176
+ CommandSeparator,
177
+ };