@arolariu/components 0.2.0 → 0.3.0

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 (282) hide show
  1. package/changelog.md +11 -0
  2. package/dist/components/ui/accordion.d.ts +4 -4
  3. package/dist/components/ui/accordion.d.ts.map +1 -1
  4. package/dist/components/ui/accordion.js +19 -27
  5. package/dist/components/ui/accordion.js.map +1 -1
  6. package/dist/components/ui/alert-dialog.d.ts +17 -11
  7. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  8. package/dist/components/ui/alert-dialog.js +38 -61
  9. package/dist/components/ui/alert-dialog.js.map +1 -1
  10. package/dist/components/ui/alert.d.ts +4 -5
  11. package/dist/components/ui/alert.d.ts.map +1 -1
  12. package/dist/components/ui/alert.js +17 -20
  13. package/dist/components/ui/alert.js.map +1 -1
  14. package/dist/components/ui/aspect-ratio.d.ts +1 -2
  15. package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
  16. package/dist/components/ui/aspect-ratio.js +1 -8
  17. package/dist/components/ui/aspect-ratio.js.map +1 -1
  18. package/dist/components/ui/avatar.d.ts +3 -3
  19. package/dist/components/ui/avatar.d.ts.map +1 -1
  20. package/dist/components/ui/avatar.js +16 -19
  21. package/dist/components/ui/avatar.js.map +1 -1
  22. package/dist/components/ui/badge.d.ts +3 -3
  23. package/dist/components/ui/badge.d.ts.map +1 -1
  24. package/dist/components/ui/badge.js +7 -10
  25. package/dist/components/ui/badge.js.map +1 -1
  26. package/dist/components/ui/breadcrumb.d.ts +16 -8
  27. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  28. package/dist/components/ui/breadcrumb.js +28 -35
  29. package/dist/components/ui/breadcrumb.js.map +1 -1
  30. package/dist/components/ui/button-group.d.ts +13 -0
  31. package/dist/components/ui/button-group.d.ts.map +1 -0
  32. package/dist/components/ui/button-group.js +47 -0
  33. package/dist/components/ui/button-group.js.map +1 -0
  34. package/dist/components/ui/button.d.ts +3 -2
  35. package/dist/components/ui/button.d.ts.map +1 -1
  36. package/dist/components/ui/button.js +15 -14
  37. package/dist/components/ui/button.js.map +1 -1
  38. package/dist/components/ui/calendar.d.ts.map +1 -1
  39. package/dist/components/ui/calendar.js +20 -20
  40. package/dist/components/ui/calendar.js.map +1 -1
  41. package/dist/components/ui/card.d.ts +7 -8
  42. package/dist/components/ui/card.d.ts.map +1 -1
  43. package/dist/components/ui/card.js +31 -44
  44. package/dist/components/ui/card.js.map +1 -1
  45. package/dist/components/ui/carousel.d.ts +5 -6
  46. package/dist/components/ui/carousel.d.ts.map +1 -1
  47. package/dist/components/ui/carousel.js +30 -21
  48. package/dist/components/ui/carousel.js.map +1 -1
  49. package/dist/components/ui/chart.d.ts +35 -27
  50. package/dist/components/ui/chart.d.ts.map +1 -1
  51. package/dist/components/ui/chart.js +28 -26
  52. package/dist/components/ui/chart.js.map +1 -1
  53. package/dist/components/ui/checkbox.d.ts +1 -1
  54. package/dist/components/ui/checkbox.d.ts.map +1 -1
  55. package/dist/components/ui/checkbox.js +10 -12
  56. package/dist/components/ui/checkbox.js.map +1 -1
  57. package/dist/components/ui/collapsible.d.ts +3 -4
  58. package/dist/components/ui/collapsible.d.ts.map +1 -1
  59. package/dist/components/ui/collapsible.js +3 -20
  60. package/dist/components/ui/collapsible.js.map +1 -1
  61. package/dist/components/ui/command.d.ts +78 -16
  62. package/dist/components/ui/command.d.ts.map +1 -1
  63. package/dist/components/ui/command.js +47 -72
  64. package/dist/components/ui/command.js.map +1 -1
  65. package/dist/components/ui/context-menu.d.ts +21 -19
  66. package/dist/components/ui/context-menu.d.ts.map +1 -1
  67. package/dist/components/ui/context-menu.js +57 -101
  68. package/dist/components/ui/context-menu.js.map +1 -1
  69. package/dist/components/ui/dialog.d.ts +16 -12
  70. package/dist/components/ui/dialog.d.ts.map +1 -1
  71. package/dist/components/ui/dialog.js +36 -64
  72. package/dist/components/ui/dialog.js.map +1 -1
  73. package/dist/components/ui/drawer.d.ts +19 -10
  74. package/dist/components/ui/drawer.d.ts.map +1 -1
  75. package/dist/components/ui/drawer.js +32 -57
  76. package/dist/components/ui/drawer.js.map +1 -1
  77. package/dist/components/ui/dropdown-menu.d.ts +21 -19
  78. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  79. package/dist/components/ui/dropdown-menu.js +64 -108
  80. package/dist/components/ui/dropdown-menu.js.map +1 -1
  81. package/dist/components/ui/dropdrawer.d.ts +1 -1
  82. package/dist/components/ui/dropdrawer.d.ts.map +1 -1
  83. package/dist/components/ui/dropdrawer.js +2 -5
  84. package/dist/components/ui/dropdrawer.js.map +1 -1
  85. package/dist/components/ui/empty.d.ts +13 -0
  86. package/dist/components/ui/empty.d.ts.map +1 -0
  87. package/dist/components/ui/empty.js +65 -0
  88. package/dist/components/ui/empty.js.map +1 -0
  89. package/dist/components/ui/field.d.ts +25 -0
  90. package/dist/components/ui/field.d.ts.map +1 -0
  91. package/dist/components/ui/field.js +135 -0
  92. package/dist/components/ui/field.js.map +1 -0
  93. package/dist/components/ui/form.d.ts +5 -6
  94. package/dist/components/ui/form.d.ts.map +1 -1
  95. package/dist/components/ui/form.js +28 -27
  96. package/dist/components/ui/form.js.map +1 -1
  97. package/dist/components/ui/hover-card.d.ts +3 -3
  98. package/dist/components/ui/hover-card.d.ts.map +1 -1
  99. package/dist/components/ui/hover-card.js +11 -25
  100. package/dist/components/ui/hover-card.js.map +1 -1
  101. package/dist/components/ui/input-group.d.ts +17 -0
  102. package/dist/components/ui/input-group.d.ts.map +1 -0
  103. package/dist/components/ui/input-group.js +91 -0
  104. package/dist/components/ui/input-group.js.map +1 -0
  105. package/dist/components/ui/input-otp.d.ts +30 -7
  106. package/dist/components/ui/input-otp.d.ts.map +1 -1
  107. package/dist/components/ui/input-otp.js +23 -26
  108. package/dist/components/ui/input-otp.js.map +1 -1
  109. package/dist/components/ui/input.d.ts +1 -1
  110. package/dist/components/ui/input.d.ts.map +1 -1
  111. package/dist/components/ui/input.js +6 -7
  112. package/dist/components/ui/input.js.map +1 -1
  113. package/dist/components/ui/item.d.ts +24 -0
  114. package/dist/components/ui/item.d.ts.map +1 -0
  115. package/dist/components/ui/item.js +122 -0
  116. package/dist/components/ui/item.js.map +1 -0
  117. package/dist/components/ui/kbd.d.ts +5 -0
  118. package/dist/components/ui/kbd.d.ts.map +1 -0
  119. package/dist/components/ui/kbd.js +21 -0
  120. package/dist/components/ui/kbd.js.map +1 -0
  121. package/dist/components/ui/label.d.ts +2 -1
  122. package/dist/components/ui/label.d.ts.map +1 -1
  123. package/dist/components/ui/label.js +8 -7
  124. package/dist/components/ui/label.js.map +1 -1
  125. package/dist/components/ui/menubar.d.ts +18 -16
  126. package/dist/components/ui/menubar.d.ts.map +1 -1
  127. package/dist/components/ui/menubar.js +73 -93
  128. package/dist/components/ui/menubar.js.map +1 -1
  129. package/dist/components/ui/navigation-menu.d.ts +8 -10
  130. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  131. package/dist/components/ui/navigation-menu.js +37 -55
  132. package/dist/components/ui/navigation-menu.js.map +1 -1
  133. package/dist/components/ui/pagination.d.ts +24 -9
  134. package/dist/components/ui/pagination.d.ts.map +1 -1
  135. package/dist/components/ui/pagination.js +33 -45
  136. package/dist/components/ui/pagination.js.map +1 -1
  137. package/dist/components/ui/popover.d.ts +4 -4
  138. package/dist/components/ui/popover.d.ts.map +1 -1
  139. package/dist/components/ui/popover.js +9 -25
  140. package/dist/components/ui/popover.js.map +1 -1
  141. package/dist/components/ui/progress.d.ts +1 -1
  142. package/dist/components/ui/progress.d.ts.map +1 -1
  143. package/dist/components/ui/progress.js +5 -7
  144. package/dist/components/ui/progress.js.map +1 -1
  145. package/dist/components/ui/radio-group.d.ts +2 -2
  146. package/dist/components/ui/radio-group.d.ts.map +1 -1
  147. package/dist/components/ui/radio-group.js +16 -19
  148. package/dist/components/ui/radio-group.js.map +1 -1
  149. package/dist/components/ui/resizable.d.ts +20 -5
  150. package/dist/components/ui/resizable.d.ts.map +1 -1
  151. package/dist/components/ui/resizable.js +9 -21
  152. package/dist/components/ui/resizable.js.map +1 -1
  153. package/dist/components/ui/scroll-area.d.ts +2 -2
  154. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  155. package/dist/components/ui/scroll-area.js +12 -16
  156. package/dist/components/ui/scroll-area.js.map +1 -1
  157. package/dist/components/ui/select.d.ts +10 -12
  158. package/dist/components/ui/select.d.ts.map +1 -1
  159. package/dist/components/ui/select.js +54 -77
  160. package/dist/components/ui/select.js.map +1 -1
  161. package/dist/components/ui/separator.d.ts +1 -1
  162. package/dist/components/ui/separator.d.ts.map +1 -1
  163. package/dist/components/ui/separator.js +6 -7
  164. package/dist/components/ui/separator.js.map +1 -1
  165. package/dist/components/ui/sheet.d.ts +23 -11
  166. package/dist/components/ui/sheet.d.ts.map +1 -1
  167. package/dist/components/ui/sheet.js +54 -66
  168. package/dist/components/ui/sheet.js.map +1 -1
  169. package/dist/components/ui/sidebar.d.ts +34 -38
  170. package/dist/components/ui/sidebar.d.ts.map +1 -1
  171. package/dist/components/ui/sidebar.js +113 -122
  172. package/dist/components/ui/sidebar.js.map +1 -1
  173. package/dist/components/ui/skeleton.d.ts +1 -1
  174. package/dist/components/ui/skeleton.d.ts.map +1 -1
  175. package/dist/components/ui/skeleton.js +1 -2
  176. package/dist/components/ui/skeleton.js.map +1 -1
  177. package/dist/components/ui/slider.d.ts +1 -1
  178. package/dist/components/ui/slider.d.ts.map +1 -1
  179. package/dist/components/ui/slider.js +11 -30
  180. package/dist/components/ui/slider.js.map +1 -1
  181. package/dist/components/ui/sonner.d.ts +4 -2
  182. package/dist/components/ui/sonner.d.ts.map +1 -1
  183. package/dist/components/ui/sonner.js +7 -4
  184. package/dist/components/ui/sonner.js.map +1 -1
  185. package/dist/components/ui/spinner.d.ts +4 -0
  186. package/dist/components/ui/spinner.d.ts.map +1 -0
  187. package/dist/components/ui/spinner.js +16 -0
  188. package/dist/components/ui/spinner.js.map +1 -0
  189. package/dist/components/ui/switch.d.ts +2 -2
  190. package/dist/components/ui/switch.d.ts.map +1 -1
  191. package/dist/components/ui/switch.js +7 -9
  192. package/dist/components/ui/switch.js.map +1 -1
  193. package/dist/components/ui/table.d.ts +8 -8
  194. package/dist/components/ui/table.d.ts.map +1 -1
  195. package/dist/components/ui/table.js +36 -45
  196. package/dist/components/ui/table.js.map +1 -1
  197. package/dist/components/ui/tabs.d.ts +4 -4
  198. package/dist/components/ui/tabs.d.ts.map +1 -1
  199. package/dist/components/ui/tabs.js +17 -26
  200. package/dist/components/ui/tabs.js.map +1 -1
  201. package/dist/components/ui/textarea.d.ts +1 -1
  202. package/dist/components/ui/textarea.d.ts.map +1 -1
  203. package/dist/components/ui/textarea.js +6 -7
  204. package/dist/components/ui/textarea.js.map +1 -1
  205. package/dist/components/ui/toggle-group.d.ts +8 -3
  206. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  207. package/dist/components/ui/toggle-group.js +11 -15
  208. package/dist/components/ui/toggle-group.js.map +1 -1
  209. package/dist/components/ui/toggle.d.ts +4 -1
  210. package/dist/components/ui/toggle.d.ts.map +1 -1
  211. package/dist/components/ui/toggle.js +7 -8
  212. package/dist/components/ui/toggle.js.map +1 -1
  213. package/dist/components/ui/tooltip.d.ts +4 -4
  214. package/dist/components/ui/tooltip.d.ts.map +1 -1
  215. package/dist/components/ui/tooltip.js +13 -38
  216. package/dist/components/ui/tooltip.js.map +1 -1
  217. package/dist/components/ui/typewriter.d.ts.map +1 -1
  218. package/dist/components/ui/typewriter.js +2 -6
  219. package/dist/components/ui/typewriter.js.map +1 -1
  220. package/dist/index.css +839 -1126
  221. package/dist/index.css.map +1 -1
  222. package/dist/index.d.ts +9 -3
  223. package/dist/index.d.ts.map +1 -1
  224. package/dist/index.js +9 -3
  225. package/package.json +37 -2
  226. package/src/components/ui/accordion.tsx +43 -44
  227. package/src/components/ui/alert-dialog.tsx +88 -99
  228. package/src/components/ui/alert.tsx +23 -25
  229. package/src/components/ui/aspect-ratio.tsx +1 -9
  230. package/src/components/ui/avatar.tsx +29 -24
  231. package/src/components/ui/badge.tsx +8 -16
  232. package/src/components/ui/breadcrumb.tsx +70 -73
  233. package/src/components/ui/button-group.tsx +69 -0
  234. package/src/components/ui/button.tsx +18 -24
  235. package/src/components/ui/calendar.tsx +20 -22
  236. package/src/components/ui/card.tsx +52 -71
  237. package/src/components/ui/carousel.tsx +145 -133
  238. package/src/components/ui/chart.tsx +173 -183
  239. package/src/components/ui/checkbox.tsx +18 -18
  240. package/src/components/ui/collapsible.tsx +3 -25
  241. package/src/components/ui/command.tsx +100 -99
  242. package/src/components/ui/context-menu.tsx +150 -193
  243. package/src/components/ui/dialog.tsx +75 -110
  244. package/src/components/ui/drawer.tsx +74 -102
  245. package/src/components/ui/dropdown-menu.tsx +153 -200
  246. package/src/components/ui/dropdrawer.tsx +0 -5
  247. package/src/components/ui/empty.tsx +86 -0
  248. package/src/components/ui/field.tsx +198 -0
  249. package/src/components/ui/form.tsx +47 -48
  250. package/src/components/ui/hover-card.tsx +18 -37
  251. package/src/components/ui/input-group.tsx +145 -0
  252. package/src/components/ui/input-otp.tsx +49 -59
  253. package/src/components/ui/input.tsx +5 -6
  254. package/src/components/ui/item.tsx +163 -0
  255. package/src/components/ui/kbd.tsx +31 -0
  256. package/src/components/ui/label.tsx +14 -12
  257. package/src/components/ui/menubar.tsx +178 -201
  258. package/src/components/ui/navigation-menu.tsx +85 -100
  259. package/src/components/ui/pagination.tsx +74 -85
  260. package/src/components/ui/popover.tsx +19 -38
  261. package/src/components/ui/progress.tsx +15 -14
  262. package/src/components/ui/radio-group.tsx +19 -13
  263. package/src/components/ui/resizable.tsx +23 -37
  264. package/src/components/ui/scroll-area.tsx +32 -35
  265. package/src/components/ui/select.tsx +112 -127
  266. package/src/components/ui/separator.tsx +17 -19
  267. package/src/components/ui/sheet.tsx +87 -108
  268. package/src/components/ui/sidebar.tsx +262 -271
  269. package/src/components/ui/skeleton.tsx +2 -3
  270. package/src/components/ui/slider.tsx +10 -36
  271. package/src/components/ui/sonner.tsx +15 -9
  272. package/src/components/ui/spinner.tsx +18 -0
  273. package/src/components/ui/switch.tsx +18 -17
  274. package/src/components/ui/table.tsx +66 -71
  275. package/src/components/ui/tabs.tsx +36 -36
  276. package/src/components/ui/textarea.tsx +5 -4
  277. package/src/components/ui/toggle-group.tsx +21 -34
  278. package/src/components/ui/toggle.tsx +14 -16
  279. package/src/components/ui/tooltip.tsx +19 -43
  280. package/src/components/ui/typewriter.tsx +3 -4
  281. package/src/index.css +6 -6
  282. package/src/index.ts +43 -4
@@ -1,103 +1,92 @@
1
1
  "use client";
2
2
 
3
- import {ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon} from "lucide-react";
3
+ import {ChevronLeft, ChevronRight, MoreHorizontal} from "lucide-react";
4
4
  import * as React from "react";
5
5
 
6
- import {Button, buttonVariants} from "@/components/ui/button";
6
+ import {ButtonProps, buttonVariants} from "@/components/ui/button";
7
7
  import {cn} from "@/lib/utilities";
8
8
 
9
- function Pagination({className, ...props}: React.ComponentProps<"nav">) {
10
- return (
11
- <nav
12
- role='navigation'
13
- aria-label='pagination'
14
- data-slot='pagination'
15
- className={cn("mx-auto flex w-full justify-center", className)}
16
- {...props}
17
- />
18
- );
19
- }
9
+ const Pagination = ({className, ...props}: React.ComponentProps<"nav">) => (
10
+ <nav
11
+ role='navigation'
12
+ aria-label='pagination'
13
+ className={cn("mx-auto flex w-full justify-center", className)}
14
+ {...props}
15
+ />
16
+ );
17
+ Pagination.displayName = "Pagination";
20
18
 
21
- function PaginationContent({className, ...props}: React.ComponentProps<"ul">) {
22
- return (
23
- <ul
24
- data-slot='pagination-content'
25
- className={cn("flex flex-row items-center gap-1", className)}
26
- {...props}
27
- />
28
- );
29
- }
19
+ const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<"ul">>(({className, ...props}, ref) => (
20
+ <ul
21
+ ref={ref}
22
+ className={cn("flex flex-row items-center gap-1", className)}
23
+ {...props}
24
+ />
25
+ ));
26
+ PaginationContent.displayName = "PaginationContent";
30
27
 
31
- function PaginationItem({...props}: React.ComponentProps<"li">) {
32
- return (
33
- <li
34
- data-slot='pagination-item'
35
- {...props}
36
- />
37
- );
38
- }
28
+ const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<"li">>(({className, ...props}, ref) => (
29
+ <li
30
+ ref={ref}
31
+ className={cn("", className)}
32
+ {...props}
33
+ />
34
+ ));
35
+ PaginationItem.displayName = "PaginationItem";
39
36
 
40
37
  type PaginationLinkProps = {
41
38
  isActive?: boolean;
42
- } & Pick<React.ComponentProps<typeof Button>, "size">
39
+ } & Pick<ButtonProps, "size">
43
40
  & React.ComponentProps<"a">;
44
41
 
45
- function PaginationLink({className, isActive, size = "icon", children, ...props}: PaginationLinkProps) {
46
- return (
47
- <a
48
- aria-current={isActive ? "page" : undefined}
49
- data-slot='pagination-link'
50
- data-active={isActive}
51
- className={cn(
52
- buttonVariants({
53
- variant: isActive ? "outline" : "ghost",
54
- size,
55
- }),
56
- className,
57
- )}
58
- {...props}>
59
- {children ?? <span className='sr-only'>Pagination link</span>}
60
- </a>
61
- );
62
- }
42
+ const PaginationLink = ({className, isActive, size = "icon", ...props}: PaginationLinkProps) => (
43
+ <a
44
+ aria-current={isActive ? "page" : undefined}
45
+ className={cn(
46
+ buttonVariants({
47
+ variant: isActive ? "outline" : "ghost",
48
+ size,
49
+ }),
50
+ className,
51
+ )}
52
+ {...props}
53
+ />
54
+ );
55
+ PaginationLink.displayName = "PaginationLink";
63
56
 
64
- function PaginationPrevious({className, ...props}: React.ComponentProps<typeof PaginationLink>) {
65
- return (
66
- <PaginationLink
67
- aria-label='Go to previous page'
68
- size='default'
69
- className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
70
- {...props}>
71
- <ChevronLeftIcon />
72
- <span className='hidden sm:block'>Previous</span>
73
- </PaginationLink>
74
- );
75
- }
57
+ const PaginationPrevious = ({className, ...props}: React.ComponentProps<typeof PaginationLink>) => (
58
+ <PaginationLink
59
+ aria-label='Go to previous page'
60
+ size='default'
61
+ className={cn("gap-1 pl-2.5", className)}
62
+ {...props}>
63
+ <ChevronLeft className='h-4 w-4' />
64
+ <span>Previous</span>
65
+ </PaginationLink>
66
+ );
67
+ PaginationPrevious.displayName = "PaginationPrevious";
76
68
 
77
- function PaginationNext({className, ...props}: React.ComponentProps<typeof PaginationLink>) {
78
- return (
79
- <PaginationLink
80
- aria-label='Go to next page'
81
- size='default'
82
- className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
83
- {...props}>
84
- <span className='hidden sm:block'>Next</span>
85
- <ChevronRightIcon />
86
- </PaginationLink>
87
- );
88
- }
69
+ const PaginationNext = ({className, ...props}: React.ComponentProps<typeof PaginationLink>) => (
70
+ <PaginationLink
71
+ aria-label='Go to next page'
72
+ size='default'
73
+ className={cn("gap-1 pr-2.5", className)}
74
+ {...props}>
75
+ <span>Next</span>
76
+ <ChevronRight className='h-4 w-4' />
77
+ </PaginationLink>
78
+ );
79
+ PaginationNext.displayName = "PaginationNext";
89
80
 
90
- function PaginationEllipsis({className, ...props}: React.ComponentProps<"span">) {
91
- return (
92
- <span
93
- aria-hidden
94
- data-slot='pagination-ellipsis'
95
- className={cn("flex size-9 items-center justify-center", className)}
96
- {...props}>
97
- <MoreHorizontalIcon className='size-4' />
98
- <span className='sr-only'>More pages</span>
99
- </span>
100
- );
101
- }
81
+ const PaginationEllipsis = ({className, ...props}: React.ComponentProps<"span">) => (
82
+ <span
83
+ aria-hidden
84
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
85
+ {...props}>
86
+ <MoreHorizontal className='h-4 w-4' />
87
+ <span className='sr-only'>More pages</span>
88
+ </span>
89
+ );
90
+ PaginationEllipsis.displayName = "PaginationEllipsis";
102
91
 
103
92
  export {Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious};
@@ -5,48 +5,29 @@ import * as React from "react";
5
5
 
6
6
  import {cn} from "@/lib/utilities";
7
7
 
8
- function Popover({...props}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
9
- return (
10
- <PopoverPrimitive.Root
11
- data-slot='popover'
12
- {...props}
13
- />
14
- );
15
- }
8
+ const Popover = PopoverPrimitive.Root;
16
9
 
17
- function PopoverTrigger({...props}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
18
- return (
19
- <PopoverPrimitive.Trigger
20
- data-slot='popover-trigger'
21
- {...props}
22
- />
23
- );
24
- }
10
+ const PopoverTrigger = PopoverPrimitive.Trigger;
25
11
 
26
- function PopoverContent({className, align = "center", sideOffset = 4, ...props}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
27
- return (
28
- <PopoverPrimitive.Portal>
29
- <PopoverPrimitive.Content
30
- data-slot='popover-content'
31
- align={align}
32
- sideOffset={sideOffset}
33
- className={cn(
34
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border border-neutral-200 bg-white p-4 text-neutral-950 shadow-md outline-hidden dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
35
- className,
36
- )}
37
- {...props}
38
- />
39
- </PopoverPrimitive.Portal>
40
- );
41
- }
12
+ const PopoverAnchor = PopoverPrimitive.Anchor;
42
13
 
43
- function PopoverAnchor({...props}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
44
- return (
45
- <PopoverPrimitive.Anchor
46
- data-slot='popover-anchor'
14
+ const PopoverContent = React.forwardRef<
15
+ React.ElementRef<typeof PopoverPrimitive.Content>,
16
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
17
+ >(({className, align = "center", sideOffset = 4, ...props}, ref) => (
18
+ <PopoverPrimitive.Portal>
19
+ <PopoverPrimitive.Content
20
+ ref={ref}
21
+ align={align}
22
+ sideOffset={sideOffset}
23
+ className={cn(
24
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-[--radix-popover-content-transform-origin] rounded-md border border-neutral-200 bg-white p-4 text-neutral-950 shadow-md outline-none dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
25
+ className,
26
+ )}
47
27
  {...props}
48
28
  />
49
- );
50
- }
29
+ </PopoverPrimitive.Portal>
30
+ ));
31
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
51
32
 
52
33
  export {Popover, PopoverAnchor, PopoverContent, PopoverTrigger};
@@ -5,19 +5,20 @@ import * as React from "react";
5
5
 
6
6
  import {cn} from "@/lib/utilities";
7
7
 
8
- function Progress({className, value, ...props}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
9
- return (
10
- <ProgressPrimitive.Root
11
- data-slot='progress'
12
- className={cn("relative h-2 w-full overflow-hidden rounded-full bg-neutral-900/20 dark:bg-neutral-50/20", className)}
13
- {...props}>
14
- <ProgressPrimitive.Indicator
15
- data-slot='progress-indicator'
16
- className='h-full w-full flex-1 bg-neutral-900 transition-all dark:bg-neutral-50'
17
- style={{transform: `translateX(-${100 - (value || 0)}%)`}}
18
- />
19
- </ProgressPrimitive.Root>
20
- );
21
- }
8
+ const Progress = React.forwardRef<
9
+ React.ElementRef<typeof ProgressPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
11
+ >(({className, value, ...props}, ref) => (
12
+ <ProgressPrimitive.Root
13
+ ref={ref}
14
+ className={cn("relative h-2 w-full overflow-hidden rounded-full bg-neutral-900/20 dark:bg-neutral-50/20", className)}
15
+ {...props}>
16
+ <ProgressPrimitive.Indicator
17
+ className='h-full w-full flex-1 bg-neutral-900 transition-all dark:bg-neutral-50'
18
+ style={{transform: `translateX(-${100 - (value || 0)}%)`}}
19
+ />
20
+ </ProgressPrimitive.Root>
21
+ ));
22
+ Progress.displayName = ProgressPrimitive.Root.displayName;
22
23
 
23
24
  export {Progress};
@@ -1,37 +1,43 @@
1
1
  "use client";
2
2
 
3
3
  import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
4
- import {CircleIcon} from "lucide-react";
4
+ import {Circle} from "lucide-react";
5
5
  import * as React from "react";
6
6
 
7
7
  import {cn} from "@/lib/utilities";
8
8
 
9
- function RadioGroup({className, ...props}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
9
+ const RadioGroup = React.forwardRef<
10
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
11
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
12
+ >(({className, ...props}, ref) => {
10
13
  return (
11
14
  <RadioGroupPrimitive.Root
12
- data-slot='radio-group'
13
- className={cn("grid gap-3", className)}
15
+ className={cn("grid gap-2", className)}
14
16
  {...props}
17
+ ref={ref}
15
18
  />
16
19
  );
17
- }
20
+ });
21
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
18
22
 
19
- function RadioGroupItem({className, ...props}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
23
+ const RadioGroupItem = React.forwardRef<
24
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
25
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
26
+ >(({className, ...props}, ref) => {
20
27
  return (
21
28
  <RadioGroupPrimitive.Item
22
- data-slot='radio-group-item'
29
+ ref={ref}
23
30
  className={cn(
24
- "aspect-square size-4 shrink-0 rounded-full border border-neutral-200 text-neutral-900 shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-neutral-950 focus-visible:ring-[3px] focus-visible:ring-neutral-950/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-red-500 aria-invalid:ring-red-500/20 dark:border-neutral-800 dark:bg-neutral-200/30 dark:dark:bg-neutral-800/30 dark:text-neutral-50 dark:focus-visible:border-neutral-300 dark:focus-visible:ring-neutral-300/50 dark:aria-invalid:border-red-900 dark:aria-invalid:ring-red-500/40 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40",
31
+ "aspect-square h-4 w-4 rounded-full border border-neutral-200 border-neutral-900 text-neutral-900 shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:cursor-not-allowed disabled:opacity-50 dark:border-neutral-50 dark:border-neutral-800 dark:text-neutral-50 dark:focus-visible:ring-neutral-300",
25
32
  className,
26
33
  )}
27
34
  {...props}>
28
- <RadioGroupPrimitive.Indicator
29
- data-slot='radio-group-indicator'
30
- className='relative flex items-center justify-center'>
31
- <CircleIcon className='fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2' />
35
+ <RadioGroupPrimitive.Indicator className='flex items-center justify-center'>
36
+ <Circle className='fill-primary h-3.5 w-3.5' />
32
37
  </RadioGroupPrimitive.Indicator>
33
38
  </RadioGroupPrimitive.Item>
34
39
  );
35
- }
40
+ });
41
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
36
42
 
37
43
  export {RadioGroup, RadioGroupItem};
@@ -1,52 +1,38 @@
1
1
  "use client";
2
2
 
3
- import {GripVerticalIcon} from "lucide-react";
4
- import * as React from "react";
3
+ import {GripVertical} from "lucide-react";
5
4
  import * as ResizablePrimitive from "react-resizable-panels";
6
5
 
7
6
  import {cn} from "@/lib/utilities";
8
7
 
9
- function ResizablePanelGroup({className, ...props}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
10
- return (
11
- <ResizablePrimitive.PanelGroup
12
- data-slot='resizable-panel-group'
13
- className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)}
14
- {...props}
15
- />
16
- );
17
- }
8
+ const ResizablePanelGroup = ({className, ...props}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
9
+ <ResizablePrimitive.PanelGroup
10
+ className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)}
11
+ {...props}
12
+ />
13
+ );
18
14
 
19
- function ResizablePanel({...props}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
20
- return (
21
- <ResizablePrimitive.Panel
22
- data-slot='resizable-panel'
23
- {...props}
24
- />
25
- );
26
- }
15
+ const ResizablePanel = ResizablePrimitive.Panel;
27
16
 
28
- function ResizableHandle({
17
+ const ResizableHandle = ({
29
18
  withHandle,
30
19
  className,
31
20
  ...props
32
21
  }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
33
22
  withHandle?: boolean;
34
- }) {
35
- return (
36
- <ResizablePrimitive.PanelResizeHandle
37
- data-slot='resizable-handle'
38
- className={cn(
39
- "relative flex w-px items-center justify-center bg-neutral-200 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 dark:bg-neutral-800 dark:focus-visible:ring-neutral-300 [&[data-panel-group-direction=vertical]>div]:rotate-90",
40
- className,
41
- )}
42
- {...props}>
43
- {Boolean(withHandle) && (
44
- <div className='z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-neutral-200 dark:bg-neutral-800'>
45
- <GripVerticalIcon className='size-2.5' />
46
- </div>
47
- )}
48
- </ResizablePrimitive.PanelResizeHandle>
49
- );
50
- }
23
+ }) => (
24
+ <ResizablePrimitive.PanelResizeHandle
25
+ className={cn(
26
+ "relative flex w-px items-center justify-center bg-neutral-200 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-neutral-950 focus-visible:ring-offset-1 focus-visible:outline-none data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 dark:bg-neutral-800 dark:focus-visible:ring-neutral-300 [&[data-panel-group-direction=vertical]>div]:rotate-90",
27
+ className,
28
+ )}
29
+ {...props}>
30
+ {withHandle && (
31
+ <div className='z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-neutral-200 bg-neutral-200 dark:border-neutral-800 dark:bg-neutral-800'>
32
+ <GripVertical className='h-2.5 w-2.5' />
33
+ </div>
34
+ )}
35
+ </ResizablePrimitive.PanelResizeHandle>
36
+ );
51
37
 
52
38
  export {ResizableHandle, ResizablePanel, ResizablePanelGroup};
@@ -5,41 +5,38 @@ import * as React from "react";
5
5
 
6
6
  import {cn} from "@/lib/utilities";
7
7
 
8
- function ScrollArea({className, children, ...props}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
9
- return (
10
- <ScrollAreaPrimitive.Root
11
- data-slot='scroll-area'
12
- className={cn("relative", className)}
13
- {...props}>
14
- <ScrollAreaPrimitive.Viewport
15
- data-slot='scroll-area-viewport'
16
- className='size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-neutral-950/50 focus-visible:outline-1 dark:focus-visible:ring-neutral-300/50'>
17
- {children}
18
- </ScrollAreaPrimitive.Viewport>
19
- <ScrollBar />
20
- <ScrollAreaPrimitive.Corner />
21
- </ScrollAreaPrimitive.Root>
22
- );
23
- }
8
+ const ScrollArea = React.forwardRef<
9
+ React.ElementRef<typeof ScrollAreaPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
11
+ >(({className, children, ...props}, ref) => (
12
+ <ScrollAreaPrimitive.Root
13
+ ref={ref}
14
+ className={cn("relative overflow-hidden", className)}
15
+ {...props}>
16
+ <ScrollAreaPrimitive.Viewport className='h-full w-full rounded-[inherit]'>{children}</ScrollAreaPrimitive.Viewport>
17
+ <ScrollBar />
18
+ <ScrollAreaPrimitive.Corner />
19
+ </ScrollAreaPrimitive.Root>
20
+ ));
21
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
24
22
 
25
- function ScrollBar({className, orientation = "vertical", ...props}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
26
- return (
27
- <ScrollAreaPrimitive.ScrollAreaScrollbar
28
- data-slot='scroll-area-scrollbar'
29
- orientation={orientation}
30
- className={cn(
31
- "flex touch-none p-px transition-colors select-none",
32
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
33
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
34
- className,
35
- )}
36
- {...props}>
37
- <ScrollAreaPrimitive.ScrollAreaThumb
38
- data-slot='scroll-area-thumb'
39
- className='relative flex-1 rounded-full bg-neutral-200 dark:bg-neutral-800'
40
- />
41
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
42
- );
43
- }
23
+ const ScrollBar = React.forwardRef<
24
+ React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
25
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
26
+ >(({className, orientation = "vertical", ...props}, ref) => (
27
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
28
+ ref={ref}
29
+ orientation={orientation}
30
+ className={cn(
31
+ "flex touch-none transition-colors select-none",
32
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
33
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
34
+ className,
35
+ )}
36
+ {...props}>
37
+ <ScrollAreaPrimitive.ScrollAreaThumb className='relative flex-1 rounded-full bg-neutral-200 dark:bg-neutral-800' />
38
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
39
+ ));
40
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
44
41
 
45
42
  export {ScrollArea, ScrollBar};