@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,116 +1,117 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { Slot } from "@radix-ui/react-slot";
5
- import { ChevronRight, MoreHorizontal } from "lucide-react";
6
- import { cn } from "./../../lib/utils";
7
-
8
- function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
9
- return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />;
10
- }
11
-
12
- function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
13
- return (
14
- <ol
15
- data-slot="breadcrumb-list"
16
- className={cn(
17
- "text-neutral-500 flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5 dark:text-neutral-400",
18
- className
19
- )}
20
- {...props}
21
- />
22
- );
23
- }
24
-
25
- function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
26
- return (
27
- <li
28
- data-slot="breadcrumb-item"
29
- className={cn("inline-flex items-center gap-1.5", className)}
30
- {...props}
31
- />
32
- );
33
- }
34
-
35
- function BreadcrumbLink({
36
- asChild,
37
- className,
38
- ...props
39
- }: React.ComponentProps<"a"> & {
40
- asChild?: boolean;
41
- }) {
42
- const Comp = asChild ? Slot : "a";
43
-
44
- return (
45
- <Comp
46
- data-slot="breadcrumb-link"
47
- className={cn(
48
- "hover:text-neutral-950 transition-colors dark:hover:text-neutral-50",
49
- className
50
- )}
51
- {...props}
52
- />
53
- );
54
- }
55
-
56
- function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
57
- return (
58
- <span
59
- data-slot="breadcrumb-page"
60
- role="link"
61
- aria-disabled="true"
62
- aria-current="page"
63
- className={cn(
64
- "text-neutral-950 font-normal dark:text-neutral-50",
65
- className
66
- )}
67
- {...props}
68
- />
69
- );
70
- }
71
-
72
- function BreadcrumbSeparator({
73
- children,
74
- className,
75
- ...props
76
- }: React.ComponentProps<"li">) {
77
- return (
78
- <li
79
- data-slot="breadcrumb-separator"
80
- role="presentation"
81
- aria-hidden="true"
82
- className={cn("[&>svg]:size-3.5", className)}
83
- {...props}
84
- >
85
- {children ?? <ChevronRight />}
86
- </li>
87
- );
88
- }
89
-
90
- function BreadcrumbEllipsis({
91
- className,
92
- ...props
93
- }: React.ComponentProps<"span">) {
94
- return (
95
- <span
96
- data-slot="breadcrumb-ellipsis"
97
- role="presentation"
98
- aria-hidden="true"
99
- className={cn("flex size-9 items-center justify-center", className)}
100
- {...props}
101
- >
102
- <MoreHorizontal className="size-4" />
103
- <span className="sr-only">More</span>
104
- </span>
105
- );
106
- }
107
-
108
- export {
109
- Breadcrumb,
110
- BreadcrumbList,
111
- BreadcrumbItem,
112
- BreadcrumbLink,
113
- BreadcrumbPage,
114
- BreadcrumbSeparator,
115
- BreadcrumbEllipsis,
116
- };
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { Slot } from "@radix-ui/react-slot";
5
+ import { ChevronRight, MoreHorizontal } from "lucide-react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
10
+ return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />;
11
+ }
12
+
13
+ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
14
+ return (
15
+ <ol
16
+ data-slot="breadcrumb-list"
17
+ className={cn(
18
+ "text-neutral-500 flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5 dark:text-neutral-400",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ );
24
+ }
25
+
26
+ function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
27
+ return (
28
+ <li
29
+ data-slot="breadcrumb-item"
30
+ className={cn("inline-flex items-center gap-1.5", className)}
31
+ {...props}
32
+ />
33
+ );
34
+ }
35
+
36
+ function BreadcrumbLink({
37
+ asChild,
38
+ className,
39
+ ...props
40
+ }: React.ComponentProps<"a"> & {
41
+ asChild?: boolean;
42
+ }) {
43
+ const Comp = asChild ? Slot : "a";
44
+
45
+ return (
46
+ <Comp
47
+ data-slot="breadcrumb-link"
48
+ className={cn(
49
+ "hover:text-neutral-950 transition-colors dark:hover:text-neutral-50",
50
+ className
51
+ )}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
58
+ return (
59
+ <span
60
+ data-slot="breadcrumb-page"
61
+ role="link"
62
+ aria-disabled="true"
63
+ aria-current="page"
64
+ className={cn(
65
+ "text-neutral-950 font-normal dark:text-neutral-50",
66
+ className
67
+ )}
68
+ {...props}
69
+ />
70
+ );
71
+ }
72
+
73
+ function BreadcrumbSeparator({
74
+ children,
75
+ className,
76
+ ...props
77
+ }: React.ComponentProps<"li">) {
78
+ return (
79
+ <li
80
+ data-slot="breadcrumb-separator"
81
+ role="presentation"
82
+ aria-hidden="true"
83
+ className={cn("[&>svg]:size-3.5", className)}
84
+ {...props}
85
+ >
86
+ {children ?? <ChevronRight />}
87
+ </li>
88
+ );
89
+ }
90
+
91
+ function BreadcrumbEllipsis({
92
+ className,
93
+ ...props
94
+ }: React.ComponentProps<"span">) {
95
+ return (
96
+ <span
97
+ data-slot="breadcrumb-ellipsis"
98
+ role="presentation"
99
+ aria-hidden="true"
100
+ className={cn("flex size-9 items-center justify-center", className)}
101
+ {...props}
102
+ >
103
+ <MoreHorizontal className="size-4" />
104
+ <span className="sr-only">More</span>
105
+ </span>
106
+ );
107
+ }
108
+
109
+ export {
110
+ Breadcrumb,
111
+ BreadcrumbList,
112
+ BreadcrumbItem,
113
+ BreadcrumbLink,
114
+ BreadcrumbPage,
115
+ BreadcrumbSeparator,
116
+ BreadcrumbEllipsis,
117
+ };
@@ -1,60 +1,61 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { Slot } from "@radix-ui/react-slot";
5
- import { cva, type VariantProps } from "class-variance-authority";
6
- import { cn } from "./../../lib/utils";
7
-
8
- const buttonVariants = cva(
9
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-neutral-950 focus-visible:ring-neutral-950/50 focus-visible:ring-[3px] aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 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",
10
- {
11
- variants: {
12
- variant: {
13
- default:
14
- "bg-neutral-900 text-neutral-50 shadow-2xs hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90",
15
- destructive:
16
- "bg-red-500 text-white shadow-2xs hover:bg-red-500/90 focus-visible:ring-red-500/20 dark:focus-visible:ring-red-500/40 dark:bg-red-900 dark:hover:bg-red-900/90 dark:focus-visible:ring-red-900/20 dark:dark:focus-visible:ring-red-900/40",
17
- outline:
18
- "border border-neutral-200 bg-white shadow-2xs hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
19
- secondary:
20
- "bg-neutral-100 text-neutral-900 shadow-2xs hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",
21
- ghost:
22
- "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
23
- link: "text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50",
24
- },
25
- size: {
26
- default: "h-9 px-4 py-2 has-[>svg]:px-3",
27
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
28
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
29
- icon: "size-9",
30
- },
31
- },
32
- defaultVariants: {
33
- variant: "default",
34
- size: "default",
35
- },
36
- }
37
- );
38
-
39
- function Button({
40
- className,
41
- variant,
42
- size,
43
- asChild = false,
44
- ...props
45
- }: React.ComponentProps<"button"> &
46
- VariantProps<typeof buttonVariants> & {
47
- asChild?: boolean;
48
- }) {
49
- const Comp = asChild ? Slot : "button";
50
-
51
- return (
52
- <Comp
53
- data-slot="button"
54
- className={cn(buttonVariants({ variant, size, className }))}
55
- {...props}
56
- />
57
- );
58
- }
59
-
60
- export { Button, buttonVariants };
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { Slot } from "@radix-ui/react-slot";
5
+ import { cva, type VariantProps } from "class-variance-authority";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ const buttonVariants = cva(
10
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-neutral-950 focus-visible:ring-neutral-950/50 focus-visible:ring-[3px] aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 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",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default:
15
+ "bg-neutral-900 text-neutral-50 shadow-xs hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90",
16
+ destructive:
17
+ "bg-red-500 text-white shadow-xs hover:bg-red-500/90 focus-visible:ring-red-500/20 dark:focus-visible:ring-red-500/40 dark:bg-red-500/60 dark:bg-red-900 dark:hover:bg-red-900/90 dark:focus-visible:ring-red-900/20 dark:dark:focus-visible:ring-red-900/40 dark:dark:bg-red-900/60",
18
+ outline:
19
+ "border bg-white shadow-xs hover:bg-neutral-100 hover:text-neutral-900 dark:bg-neutral-200/30 dark:border-neutral-200 dark:hover:bg-neutral-200/50 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:dark:bg-neutral-800/30 dark:dark:border-neutral-800 dark:dark:hover:bg-neutral-800/50",
20
+ secondary:
21
+ "bg-neutral-100 text-neutral-900 shadow-xs hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",
22
+ ghost:
23
+ "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-100/50 dark:hover:bg-neutral-800 dark:hover:text-neutral-50 dark:dark:hover:bg-neutral-800/50",
24
+ link: "text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50",
25
+ },
26
+ size: {
27
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
28
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
29
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
30
+ icon: "size-9",
31
+ },
32
+ },
33
+ defaultVariants: {
34
+ variant: "default",
35
+ size: "default",
36
+ },
37
+ }
38
+ );
39
+
40
+ function Button({
41
+ className,
42
+ variant,
43
+ size,
44
+ asChild = false,
45
+ ...props
46
+ }: React.ComponentProps<"button"> &
47
+ VariantProps<typeof buttonVariants> & {
48
+ asChild?: boolean;
49
+ }) {
50
+ const Comp = asChild ? Slot : "button";
51
+
52
+ return (
53
+ <Comp
54
+ data-slot="button"
55
+ className={cn(buttonVariants({ variant, size, className }))}
56
+ {...props}
57
+ />
58
+ );
59
+ }
60
+
61
+ export { Button, buttonVariants };
@@ -1,79 +1,97 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { cn } from "./../../lib/utils";
5
-
6
- function Card({ className, ...props }: React.ComponentProps<"div">) {
7
- return (
8
- <div
9
- data-slot="card"
10
- className={cn(
11
- "bg-white text-neutral-950 flex flex-col gap-6 rounded-xl border border-neutral-200 py-6 shadow-xs dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
12
- className
13
- )}
14
- {...props}
15
- />
16
- );
17
- }
18
-
19
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
20
- return (
21
- <div
22
- data-slot="card-header"
23
- className={cn("flex flex-col gap-1.5 px-6", className)}
24
- {...props}
25
- />
26
- );
27
- }
28
-
29
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
30
- return (
31
- <div
32
- data-slot="card-title"
33
- className={cn("leading-none font-semibold", className)}
34
- {...props}
35
- />
36
- );
37
- }
38
-
39
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
40
- return (
41
- <div
42
- data-slot="card-description"
43
- className={cn(
44
- "text-neutral-500 text-sm dark:text-neutral-400",
45
- className
46
- )}
47
- {...props}
48
- />
49
- );
50
- }
51
-
52
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
53
- return (
54
- <div
55
- data-slot="card-content"
56
- className={cn("px-6", className)}
57
- {...props}
58
- />
59
- );
60
- }
61
-
62
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
63
- return (
64
- <div
65
- data-slot="card-footer"
66
- className={cn("flex items-center px-6", className)}
67
- {...props}
68
- />
69
- );
70
- }
71
-
72
- export {
73
- Card,
74
- CardHeader,
75
- CardFooter,
76
- CardTitle,
77
- CardDescription,
78
- CardContent,
79
- };
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ function Card({ className, ...props }: React.ComponentProps<"div">) {
8
+ return (
9
+ <div
10
+ data-slot="card"
11
+ className={cn(
12
+ "bg-white text-neutral-950 flex flex-col gap-6 rounded-xl border border-neutral-200 py-6 shadow-sm dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
13
+ className
14
+ )}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
21
+ return (
22
+ <div
23
+ data-slot="card-header"
24
+ className={cn(
25
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
26
+ className
27
+ )}
28
+ {...props}
29
+ />
30
+ );
31
+ }
32
+
33
+ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
34
+ return (
35
+ <div
36
+ data-slot="card-title"
37
+ className={cn("leading-none font-semibold", className)}
38
+ {...props}
39
+ />
40
+ );
41
+ }
42
+
43
+ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
44
+ return (
45
+ <div
46
+ data-slot="card-description"
47
+ className={cn(
48
+ "text-neutral-500 text-sm dark:text-neutral-400",
49
+ className
50
+ )}
51
+ {...props}
52
+ />
53
+ );
54
+ }
55
+
56
+ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
57
+ return (
58
+ <div
59
+ data-slot="card-action"
60
+ className={cn(
61
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
62
+ className
63
+ )}
64
+ {...props}
65
+ />
66
+ );
67
+ }
68
+
69
+ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
70
+ return (
71
+ <div
72
+ data-slot="card-content"
73
+ className={cn("px-6", className)}
74
+ {...props}
75
+ />
76
+ );
77
+ }
78
+
79
+ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
80
+ return (
81
+ <div
82
+ data-slot="card-footer"
83
+ className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
84
+ {...props}
85
+ />
86
+ );
87
+ }
88
+
89
+ export {
90
+ Card,
91
+ CardHeader,
92
+ CardFooter,
93
+ CardTitle,
94
+ CardAction,
95
+ CardDescription,
96
+ CardContent,
97
+ };