@codefast/ui 0.0.50 → 0.0.52

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 (281) hide show
  1. package/dist/{chunk-ZTEJNUH6.js → chunk-46W6RAYD.js} +1 -1
  2. package/dist/chunk-46W6RAYD.js.map +1 -0
  3. package/dist/{chunk-CERSQE5J.js → chunk-4JHGPRLG.js} +1 -1
  4. package/dist/chunk-4JHGPRLG.js.map +1 -0
  5. package/dist/{chunk-I6QCJDIF.mjs → chunk-5RENVAXH.mjs} +1 -1
  6. package/dist/chunk-5RENVAXH.mjs.map +1 -0
  7. package/dist/{chunk-47CSACCM.mjs → chunk-7ABWX5CF.mjs} +2 -2
  8. package/dist/chunk-7ABWX5CF.mjs.map +1 -0
  9. package/dist/{chunk-XHNT6PVI.mjs → chunk-BM5KYF6Y.mjs} +1 -1
  10. package/dist/chunk-BM5KYF6Y.mjs.map +1 -0
  11. package/dist/{chunk-P5AV3QU7.mjs → chunk-BNKSZEF2.mjs} +1 -1
  12. package/dist/chunk-BNKSZEF2.mjs.map +1 -0
  13. package/dist/{chunk-SDGUDONZ.js → chunk-DCDB56BO.js} +1 -1
  14. package/dist/chunk-DCDB56BO.js.map +1 -0
  15. package/dist/{chunk-6FL3EBDQ.mjs → chunk-HMD2ZU33.mjs} +1 -1
  16. package/dist/chunk-HMD2ZU33.mjs.map +1 -0
  17. package/dist/{chunk-JOBEKA4M.mjs → chunk-K63K4LTH.mjs} +2 -2
  18. package/dist/chunk-K63K4LTH.mjs.map +1 -0
  19. package/dist/{chunk-VXPAGNPJ.js → chunk-LJSD47ZL.js} +1 -1
  20. package/dist/chunk-LJSD47ZL.js.map +1 -0
  21. package/dist/{chunk-GDMHMSJ2.mjs → chunk-MFYACCZV.mjs} +1 -1
  22. package/dist/chunk-MFYACCZV.mjs.map +1 -0
  23. package/dist/{chunk-LG7ACTRE.js → chunk-PRCS3RWN.js} +1 -1
  24. package/dist/chunk-PRCS3RWN.js.map +1 -0
  25. package/dist/{chunk-OP6Q7VT5.js → chunk-RHFF4JNH.js} +1 -1
  26. package/dist/chunk-RHFF4JNH.js.map +1 -0
  27. package/dist/{chunk-SCPFGC2X.js → chunk-SCXRD727.js} +1 -1
  28. package/dist/chunk-SCXRD727.js.map +1 -0
  29. package/dist/{chunk-X3LRJQM3.js → chunk-VZVI3OHH.js} +2 -2
  30. package/dist/chunk-VZVI3OHH.js.map +1 -0
  31. package/dist/{chunk-UYRRHPPH.js → chunk-X4BEEJEW.js} +2 -2
  32. package/dist/chunk-X4BEEJEW.js.map +1 -0
  33. package/dist/{chunk-PWF46YXQ.mjs → chunk-Y2GMHG3Z.mjs} +1 -1
  34. package/dist/chunk-Y2GMHG3Z.mjs.map +1 -0
  35. package/dist/{chunk-MU2MZ434.mjs → chunk-ZIB4ZTST.mjs} +1 -1
  36. package/dist/chunk-ZIB4ZTST.mjs.map +1 -0
  37. package/dist/plugin/animate.plugin.js +1 -1
  38. package/dist/plugin/animate.plugin.mjs +1 -1
  39. package/dist/react/accordion.js.map +1 -1
  40. package/dist/react/accordion.mjs.map +1 -1
  41. package/dist/react/alert-dialog.js +1 -1
  42. package/dist/react/alert-dialog.js.map +1 -1
  43. package/dist/react/alert-dialog.mjs +1 -1
  44. package/dist/react/alert-dialog.mjs.map +1 -1
  45. package/dist/react/alert.js.map +1 -1
  46. package/dist/react/alert.mjs.map +1 -1
  47. package/dist/react/aspect-ratio.d.mts +1 -1
  48. package/dist/react/aspect-ratio.d.ts +1 -1
  49. package/dist/react/aspect-ratio.js.map +1 -1
  50. package/dist/react/aspect-ratio.mjs.map +1 -1
  51. package/dist/react/avatar.js.map +1 -1
  52. package/dist/react/avatar.mjs.map +1 -1
  53. package/dist/react/badge.js.map +1 -1
  54. package/dist/react/badge.mjs.map +1 -1
  55. package/dist/react/blockquote.js.map +1 -1
  56. package/dist/react/blockquote.mjs.map +1 -1
  57. package/dist/react/box.js.map +1 -1
  58. package/dist/react/box.mjs.map +1 -1
  59. package/dist/react/breadcrumb.js.map +1 -1
  60. package/dist/react/breadcrumb.mjs.map +1 -1
  61. package/dist/react/button.js +1 -1
  62. package/dist/react/button.mjs +1 -1
  63. package/dist/react/calendar.js +1 -1
  64. package/dist/react/calendar.js.map +1 -1
  65. package/dist/react/calendar.mjs +1 -1
  66. package/dist/react/calendar.mjs.map +1 -1
  67. package/dist/react/card.js.map +1 -1
  68. package/dist/react/card.mjs.map +1 -1
  69. package/dist/react/carousel.js +1 -1
  70. package/dist/react/carousel.js.map +1 -1
  71. package/dist/react/carousel.mjs +1 -1
  72. package/dist/react/carousel.mjs.map +1 -1
  73. package/dist/react/checkbox-cards.js +1 -1
  74. package/dist/react/checkbox-cards.js.map +1 -1
  75. package/dist/react/checkbox-cards.mjs +1 -1
  76. package/dist/react/checkbox-cards.mjs.map +1 -1
  77. package/dist/react/checkbox-group.js +1 -1
  78. package/dist/react/checkbox-group.js.map +1 -1
  79. package/dist/react/checkbox-group.mjs +1 -1
  80. package/dist/react/checkbox-group.mjs.map +1 -1
  81. package/dist/react/checkbox-group.primitive.js +1 -1
  82. package/dist/react/checkbox-group.primitive.mjs +1 -1
  83. package/dist/react/checkbox.js.map +1 -1
  84. package/dist/react/checkbox.mjs.map +1 -1
  85. package/dist/react/code.js.map +1 -1
  86. package/dist/react/code.mjs.map +1 -1
  87. package/dist/react/collapsible.js.map +1 -1
  88. package/dist/react/collapsible.mjs.map +1 -1
  89. package/dist/react/command.d.mts +8 -8
  90. package/dist/react/command.d.ts +8 -8
  91. package/dist/react/command.js +1 -1
  92. package/dist/react/command.js.map +1 -1
  93. package/dist/react/command.mjs +1 -1
  94. package/dist/react/command.mjs.map +1 -1
  95. package/dist/react/container.js.map +1 -1
  96. package/dist/react/container.mjs.map +1 -1
  97. package/dist/react/context-menu.js.map +1 -1
  98. package/dist/react/context-menu.mjs.map +1 -1
  99. package/dist/react/data-table.d.mts +1 -1
  100. package/dist/react/data-table.d.ts +1 -1
  101. package/dist/react/data-table.js +1 -1
  102. package/dist/react/data-table.js.map +1 -1
  103. package/dist/react/data-table.mjs +1 -1
  104. package/dist/react/data-table.mjs.map +1 -1
  105. package/dist/react/dialog.js +1 -1
  106. package/dist/react/dialog.mjs +1 -1
  107. package/dist/react/drawer.js.map +1 -1
  108. package/dist/react/drawer.mjs.map +1 -1
  109. package/dist/react/dropdown-menu.js +1 -1
  110. package/dist/react/dropdown-menu.mjs +1 -1
  111. package/dist/react/em.js.map +1 -1
  112. package/dist/react/em.mjs.map +1 -1
  113. package/dist/react/form.js +1 -1
  114. package/dist/react/form.js.map +1 -1
  115. package/dist/react/form.mjs +1 -1
  116. package/dist/react/form.mjs.map +1 -1
  117. package/dist/react/heading.js.map +1 -1
  118. package/dist/react/heading.mjs.map +1 -1
  119. package/dist/react/hover-card.js.map +1 -1
  120. package/dist/react/hover-card.mjs.map +1 -1
  121. package/dist/react/input-otp.js.map +1 -1
  122. package/dist/react/input-otp.mjs.map +1 -1
  123. package/dist/react/input.js.map +1 -1
  124. package/dist/react/input.mjs.map +1 -1
  125. package/dist/react/kbd.js.map +1 -1
  126. package/dist/react/kbd.mjs.map +1 -1
  127. package/dist/react/label.js +1 -1
  128. package/dist/react/label.mjs +1 -1
  129. package/dist/react/menubar.js.map +1 -1
  130. package/dist/react/menubar.mjs.map +1 -1
  131. package/dist/react/navigation-menu.js.map +1 -1
  132. package/dist/react/navigation-menu.mjs.map +1 -1
  133. package/dist/react/pagination.js +1 -1
  134. package/dist/react/pagination.js.map +1 -1
  135. package/dist/react/pagination.mjs +1 -1
  136. package/dist/react/pagination.mjs.map +1 -1
  137. package/dist/react/popover.js.map +1 -1
  138. package/dist/react/popover.mjs.map +1 -1
  139. package/dist/react/pre.js.map +1 -1
  140. package/dist/react/pre.mjs.map +1 -1
  141. package/dist/react/progress.js.map +1 -1
  142. package/dist/react/progress.mjs.map +1 -1
  143. package/dist/react/quote.js.map +1 -1
  144. package/dist/react/quote.mjs.map +1 -1
  145. package/dist/react/radio-cards.js.map +1 -1
  146. package/dist/react/radio-cards.mjs.map +1 -1
  147. package/dist/react/radio-group.js.map +1 -1
  148. package/dist/react/radio-group.mjs.map +1 -1
  149. package/dist/react/radio.js.map +1 -1
  150. package/dist/react/radio.mjs.map +1 -1
  151. package/dist/react/resizable.js.map +1 -1
  152. package/dist/react/resizable.mjs.map +1 -1
  153. package/dist/react/scroll-area.js.map +1 -1
  154. package/dist/react/scroll-area.mjs.map +1 -1
  155. package/dist/react/section.js.map +1 -1
  156. package/dist/react/section.mjs.map +1 -1
  157. package/dist/react/select.js +1 -1
  158. package/dist/react/select.mjs +1 -1
  159. package/dist/react/separator.js.map +1 -1
  160. package/dist/react/separator.mjs.map +1 -1
  161. package/dist/react/sheet.js +1 -1
  162. package/dist/react/sheet.js.map +1 -1
  163. package/dist/react/sheet.mjs +1 -1
  164. package/dist/react/sheet.mjs.map +1 -1
  165. package/dist/react/skeleton.js.map +1 -1
  166. package/dist/react/skeleton.mjs.map +1 -1
  167. package/dist/react/slider.js.map +1 -1
  168. package/dist/react/slider.mjs.map +1 -1
  169. package/dist/react/sonner.js.map +1 -1
  170. package/dist/react/sonner.mjs.map +1 -1
  171. package/dist/react/spinner.js +1 -1
  172. package/dist/react/spinner.mjs +1 -1
  173. package/dist/react/strong.js.map +1 -1
  174. package/dist/react/strong.mjs.map +1 -1
  175. package/dist/react/switch.js.map +1 -1
  176. package/dist/react/switch.mjs.map +1 -1
  177. package/dist/react/table.js.map +1 -1
  178. package/dist/react/table.mjs.map +1 -1
  179. package/dist/react/tabs.js.map +1 -1
  180. package/dist/react/tabs.mjs.map +1 -1
  181. package/dist/react/text.js.map +1 -1
  182. package/dist/react/text.mjs.map +1 -1
  183. package/dist/react/textarea.js.map +1 -1
  184. package/dist/react/textarea.mjs.map +1 -1
  185. package/dist/react/toggle-group.js +1 -1
  186. package/dist/react/toggle-group.js.map +1 -1
  187. package/dist/react/toggle-group.mjs +1 -1
  188. package/dist/react/toggle-group.mjs.map +1 -1
  189. package/dist/react/toggle.js +1 -1
  190. package/dist/react/toggle.mjs +1 -1
  191. package/dist/react/tooltip.js.map +1 -1
  192. package/dist/react/tooltip.mjs.map +1 -1
  193. package/dist/styles.css.map +1 -1
  194. package/dist/tailwind.config.js +1 -1
  195. package/dist/tailwind.config.js.map +1 -1
  196. package/dist/tailwind.config.mjs +1 -1
  197. package/dist/tailwind.config.mjs.map +1 -1
  198. package/package.json +6 -6
  199. package/plugin/animate.plugin.ts +2 -5
  200. package/src/react/accordion.tsx +36 -60
  201. package/src/react/alert-dialog.tsx +57 -125
  202. package/src/react/alert.tsx +16 -42
  203. package/src/react/aspect-ratio.tsx +2 -4
  204. package/src/react/avatar.tsx +15 -43
  205. package/src/react/badge.tsx +3 -8
  206. package/src/react/blockquote.tsx +5 -8
  207. package/src/react/box.tsx +4 -6
  208. package/src/react/breadcrumb.tsx +17 -50
  209. package/src/react/button.tsx +5 -20
  210. package/src/react/calendar.tsx +5 -22
  211. package/src/react/card.tsx +22 -56
  212. package/src/react/carousel.tsx +20 -76
  213. package/src/react/checkbox-cards.tsx +28 -55
  214. package/src/react/checkbox-group.primitive.tsx +24 -78
  215. package/src/react/checkbox-group.tsx +26 -49
  216. package/src/react/checkbox.tsx +15 -19
  217. package/src/react/code.tsx +4 -6
  218. package/src/react/collapsible.tsx +19 -29
  219. package/src/react/command.tsx +69 -134
  220. package/src/react/container.tsx +5 -9
  221. package/src/react/context-menu.tsx +146 -224
  222. package/src/react/data-table.tsx +16 -44
  223. package/src/react/dialog.tsx +45 -90
  224. package/src/react/drawer.tsx +44 -91
  225. package/src/react/dropdown-menu.tsx +126 -194
  226. package/src/react/em.tsx +4 -6
  227. package/src/react/form.tsx +49 -84
  228. package/src/react/heading.tsx +4 -6
  229. package/src/react/hover-card.tsx +22 -38
  230. package/src/react/input-otp.tsx +26 -37
  231. package/src/react/input.tsx +6 -16
  232. package/src/react/kbd.tsx +14 -16
  233. package/src/react/label.tsx +11 -12
  234. package/src/react/menubar.tsx +129 -208
  235. package/src/react/navigation-menu.tsx +105 -147
  236. package/src/react/pagination.tsx +18 -50
  237. package/src/react/popover.tsx +25 -40
  238. package/src/react/pre.tsx +4 -6
  239. package/src/react/progress.tsx +15 -22
  240. package/src/react/quote.tsx +4 -6
  241. package/src/react/radio-cards.tsx +7 -27
  242. package/src/react/radio-group.tsx +7 -27
  243. package/src/react/radio.tsx +14 -18
  244. package/src/react/resizable.tsx +2 -7
  245. package/src/react/scroll-area.tsx +30 -52
  246. package/src/react/section.tsx +4 -6
  247. package/src/react/select.tsx +108 -161
  248. package/src/react/separator.tsx +3 -12
  249. package/src/react/sheet.tsx +21 -71
  250. package/src/react/skeleton.tsx +1 -6
  251. package/src/react/slider.tsx +20 -27
  252. package/src/react/sonner.tsx +2 -4
  253. package/src/react/spinner.tsx +2 -7
  254. package/src/react/strong.tsx +4 -6
  255. package/src/react/switch.tsx +12 -14
  256. package/src/react/table.tsx +37 -82
  257. package/src/react/tabs.tsx +34 -44
  258. package/src/react/text.tsx +5 -8
  259. package/src/react/textarea.tsx +12 -14
  260. package/src/react/toggle-group.tsx +16 -57
  261. package/src/react/toggle.tsx +8 -15
  262. package/src/react/tooltip.tsx +24 -39
  263. package/tailwind.config.ts +2 -2
  264. package/dist/chunk-47CSACCM.mjs.map +0 -1
  265. package/dist/chunk-6FL3EBDQ.mjs.map +0 -1
  266. package/dist/chunk-CERSQE5J.js.map +0 -1
  267. package/dist/chunk-GDMHMSJ2.mjs.map +0 -1
  268. package/dist/chunk-I6QCJDIF.mjs.map +0 -1
  269. package/dist/chunk-JOBEKA4M.mjs.map +0 -1
  270. package/dist/chunk-LG7ACTRE.js.map +0 -1
  271. package/dist/chunk-MU2MZ434.mjs.map +0 -1
  272. package/dist/chunk-OP6Q7VT5.js.map +0 -1
  273. package/dist/chunk-P5AV3QU7.mjs.map +0 -1
  274. package/dist/chunk-PWF46YXQ.mjs.map +0 -1
  275. package/dist/chunk-SCPFGC2X.js.map +0 -1
  276. package/dist/chunk-SDGUDONZ.js.map +0 -1
  277. package/dist/chunk-UYRRHPPH.js.map +0 -1
  278. package/dist/chunk-VXPAGNPJ.js.map +0 -1
  279. package/dist/chunk-X3LRJQM3.js.map +0 -1
  280. package/dist/chunk-XHNT6PVI.mjs.map +0 -1
  281. package/dist/chunk-ZTEJNUH6.js.map +0 -1
@@ -13,9 +13,9 @@ interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
13
13
  separator?: React.ReactNode;
14
14
  }
15
15
 
16
- const Breadcrumb = React.forwardRef<BreadcrumbElement, BreadcrumbProps>(
17
- ({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />,
18
- );
16
+ const Breadcrumb = React.forwardRef<BreadcrumbElement, BreadcrumbProps>(({ ...props }, ref) => (
17
+ <nav ref={ref} aria-label="breadcrumb" {...props} />
18
+ ));
19
19
 
20
20
  Breadcrumb.displayName = 'Breadcrumb';
21
21
 
@@ -26,10 +26,7 @@ Breadcrumb.displayName = 'Breadcrumb';
26
26
  type BreadcrumbListElement = HTMLOListElement;
27
27
  type BreadcrumbListProps = React.OlHTMLAttributes<HTMLOListElement>;
28
28
 
29
- const BreadcrumbList = React.forwardRef<
30
- BreadcrumbListElement,
31
- BreadcrumbListProps
32
- >(({ className, ...props }, ref) => (
29
+ const BreadcrumbList = React.forwardRef<BreadcrumbListElement, BreadcrumbListProps>(({ className, ...props }, ref) => (
33
30
  <ol
34
31
  ref={ref}
35
32
  className={cn(
@@ -49,15 +46,8 @@ BreadcrumbList.displayName = 'BreadcrumbList';
49
46
  type BreadcrumbItemElement = HTMLLIElement;
50
47
  type BreadcrumbItemProps = React.LiHTMLAttributes<HTMLLIElement>;
51
48
 
52
- const BreadcrumbItem = React.forwardRef<
53
- BreadcrumbItemElement,
54
- BreadcrumbItemProps
55
- >(({ className, ...props }, ref) => (
56
- <li
57
- ref={ref}
58
- className={cn('inline-flex items-center gap-1.5', className)}
59
- {...props}
60
- />
49
+ const BreadcrumbItem = React.forwardRef<BreadcrumbItemElement, BreadcrumbItemProps>(({ className, ...props }, ref) => (
50
+ <li ref={ref} className={cn('inline-flex items-center gap-1.5', className)} {...props} />
61
51
  ));
62
52
 
63
53
  BreadcrumbItem.displayName = 'BreadcrumbItem';
@@ -68,25 +58,17 @@ BreadcrumbItem.displayName = 'BreadcrumbItem';
68
58
 
69
59
  type BreadcrumbLinkElement = HTMLAnchorElement;
70
60
 
71
- interface BreadcrumbLinkProps
72
- extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
61
+ interface BreadcrumbLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
73
62
  asChild?: boolean;
74
63
  }
75
64
 
76
- const BreadcrumbLink = React.forwardRef<
77
- BreadcrumbLinkElement,
78
- BreadcrumbLinkProps
79
- >(({ asChild, className, ...props }, ref) => {
80
- const Component = asChild ? Slot : 'a';
65
+ const BreadcrumbLink = React.forwardRef<BreadcrumbLinkElement, BreadcrumbLinkProps>(
66
+ ({ asChild, className, ...props }, ref) => {
67
+ const Component = asChild ? Slot : 'a';
81
68
 
82
- return (
83
- <Component
84
- ref={ref}
85
- className={cn('transition', 'hover:text-foreground', className)}
86
- {...props}
87
- />
88
- );
89
- });
69
+ return <Component ref={ref} className={cn('transition', 'hover:text-foreground', className)} {...props} />;
70
+ },
71
+ );
90
72
 
91
73
  BreadcrumbLink.displayName = 'BreadcrumbLink';
92
74
 
@@ -97,10 +79,7 @@ BreadcrumbLink.displayName = 'BreadcrumbLink';
97
79
  type BreadcrumbPageElement = HTMLSpanElement;
98
80
  type BreadcrumbPageProps = React.HTMLAttributes<HTMLSpanElement>;
99
81
 
100
- const BreadcrumbPage = React.forwardRef<
101
- BreadcrumbPageElement,
102
- BreadcrumbPageProps
103
- >(({ className, ...props }, ref) => (
82
+ const BreadcrumbPage = React.forwardRef<BreadcrumbPageElement, BreadcrumbPageProps>(({ className, ...props }, ref) => (
104
83
  <span
105
84
  ref={ref}
106
85
  role="link"
@@ -119,18 +98,9 @@ BreadcrumbPage.displayName = 'BreadcrumbPage';
119
98
 
120
99
  type BreadcrumbSeparatorProps = React.LiHTMLAttributes<HTMLLIElement>;
121
100
 
122
- function BreadcrumbSeparator({
123
- children,
124
- className,
125
- ...props
126
- }: BreadcrumbSeparatorProps): React.JSX.Element {
101
+ function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): React.JSX.Element {
127
102
  return (
128
- <li
129
- role="presentation"
130
- aria-hidden="true"
131
- className={cn('[&>svg]:size-3.5', className)}
132
- {...props}
133
- >
103
+ <li role="presentation" aria-hidden="true" className={cn('[&>svg]:size-3.5', className)} {...props}>
134
104
  {children ?? <ChevronRightIcon />}
135
105
  </li>
136
106
  );
@@ -142,10 +112,7 @@ function BreadcrumbSeparator({
142
112
 
143
113
  type BreadcrumbEllipsisProps = React.HTMLAttributes<HTMLSpanElement>;
144
114
 
145
- function BreadcrumbEllipsis({
146
- className,
147
- ...props
148
- }: BreadcrumbEllipsisProps): React.JSX.Element {
115
+ function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): React.JSX.Element {
149
116
  return (
150
117
  <span
151
118
  role="presentation"
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { Fragment } from 'react';
3
3
  import { Slot } from '@radix-ui/react-slot';
4
- import { type VariantProps } from 'cva';
5
4
  import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
6
5
  import { cva } from '../lib/utils';
7
6
  import { Spinner } from './spinner';
7
+ import type { VariantProps } from 'cva';
8
8
 
9
9
  /* -----------------------------------------------------------------------------
10
10
  * Variant: Button
@@ -15,14 +15,12 @@ const buttonVariants = cva({
15
15
  variants: {
16
16
  variant: {
17
17
  default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',
18
- destructive:
19
- 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
18
+ destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
20
19
  ghost: 'text-foreground hover:bg-accent hover:text-accent-foreground',
21
20
  link: 'text-primary underline-offset-4 hover:underline',
22
21
  outline:
23
22
  'border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground border shadow-sm',
24
- secondary:
25
- 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
23
+ secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
26
24
  },
27
25
  size: {
28
26
  default: 'h-10 px-4 gap-2',
@@ -53,25 +51,12 @@ type ButtonVariantsProps = VariantProps<typeof buttonVariants>;
53
51
 
54
52
  type ButtonElement = HTMLButtonElement;
55
53
 
56
- interface ButtonProps
57
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
58
- ButtonVariantsProps {
54
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ButtonVariantsProps {
59
55
  asChild?: boolean;
60
56
  }
61
57
 
62
58
  const Button = React.forwardRef<ButtonElement, ButtonProps>(
63
- (
64
- {
65
- children,
66
- className,
67
- variant,
68
- size,
69
- loading = false,
70
- asChild = false,
71
- ...props
72
- },
73
- ref,
74
- ) => {
59
+ ({ children, className, variant, size, loading = false, asChild = false, ...props }, ref) => {
75
60
  const Component = asChild ? Slot : 'button';
76
61
  const ComponentLoading = asChild ? 'span' : Fragment;
77
62
  const disabled = loading || props.disabled;
@@ -1,12 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import {
5
- type DateRange,
6
- DayPicker,
7
- type DayPickerProps,
8
- type StyledComponent,
9
- } from 'react-day-picker';
4
+ import { type DateRange, DayPicker, type DayPickerProps, type StyledComponent } from 'react-day-picker';
10
5
  import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons';
11
6
  import { cn } from '../lib/utils';
12
7
  import { buttonVariants } from './button';
@@ -15,28 +10,17 @@ import { buttonVariants } from './button';
15
10
  * Component: Calendar
16
11
  * -------------------------------------------------------------------------- */
17
12
 
18
- function ChevronLeft({
19
- children: _,
20
- ...props
21
- }: StyledComponent): React.JSX.Element {
13
+ function ChevronLeft({ children: _, ...props }: StyledComponent): React.JSX.Element {
22
14
  return <ChevronLeftIcon className="size-4" {...props} />;
23
15
  }
24
16
 
25
- function ChevronRight({
26
- children: _,
27
- ...props
28
- }: StyledComponent): React.JSX.Element {
17
+ function ChevronRight({ children: _, ...props }: StyledComponent): React.JSX.Element {
29
18
  return <ChevronRightIcon className="size-4" {...props} />;
30
19
  }
31
20
 
32
21
  type CalendarProps = DayPickerProps;
33
22
 
34
- function Calendar({
35
- className,
36
- classNames,
37
- showOutsideDays = true,
38
- ...props
39
- }: CalendarProps): React.JSX.Element {
23
+ function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps): React.JSX.Element {
40
24
  return (
41
25
  <DayPicker
42
26
  showOutsideDays={showOutsideDays}
@@ -75,8 +59,7 @@ function Calendar({
75
59
  day_outside:
76
60
  'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',
77
61
  day_disabled: 'text-muted-foreground opacity-50',
78
- day_range_middle:
79
- 'aria-selected:bg-accent aria-selected:text-accent-foreground',
62
+ day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',
80
63
  day_hidden: 'invisible',
81
64
  ...classNames,
82
65
  }}
@@ -8,18 +8,9 @@ import { cn } from '../lib/utils';
8
8
  type CardElement = HTMLDivElement;
9
9
  type CardProps = React.HTMLAttributes<HTMLDivElement>;
10
10
 
11
- const Card = React.forwardRef<CardElement, CardProps>(
12
- ({ className, ...props }, ref) => (
13
- <div
14
- ref={ref}
15
- className={cn(
16
- 'bg-card text-card-foreground rounded-lg border shadow-sm',
17
- className,
18
- )}
19
- {...props}
20
- />
21
- ),
22
- );
11
+ const Card = React.forwardRef<CardElement, CardProps>(({ className, ...props }, ref) => (
12
+ <div ref={ref} className={cn('bg-card text-card-foreground rounded-lg border shadow-sm', className)} {...props} />
13
+ ));
23
14
 
24
15
  Card.displayName = 'Card';
25
16
 
@@ -30,15 +21,9 @@ Card.displayName = 'Card';
30
21
  type CardHeaderElement = HTMLDivElement;
31
22
  type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
32
23
 
33
- const CardHeader = React.forwardRef<CardHeaderElement, CardHeaderProps>(
34
- ({ className, ...props }, ref) => (
35
- <div
36
- ref={ref}
37
- className={cn('flex flex-col space-y-1.5 p-6', className)}
38
- {...props}
39
- />
40
- ),
41
- );
24
+ const CardHeader = React.forwardRef<CardHeaderElement, CardHeaderProps>(({ className, ...props }, ref) => (
25
+ <div ref={ref} className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />
26
+ ));
42
27
 
43
28
  CardHeader.displayName = 'CardHeader';
44
29
 
@@ -49,17 +34,11 @@ CardHeader.displayName = 'CardHeader';
49
34
  type CardTitleElement = HTMLParagraphElement;
50
35
  type CardTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
51
36
 
52
- const CardTitle = React.forwardRef<CardTitleElement, CardTitleProps>(
53
- ({ children, className, ...props }, ref) => (
54
- <h3
55
- ref={ref}
56
- className={cn('font-semibold leading-none tracking-tight', className)}
57
- {...props}
58
- >
59
- {children}
60
- </h3>
61
- ),
62
- );
37
+ const CardTitle = React.forwardRef<CardTitleElement, CardTitleProps>(({ children, className, ...props }, ref) => (
38
+ <h3 ref={ref} className={cn('font-semibold leading-none tracking-tight', className)} {...props}>
39
+ {children}
40
+ </h3>
41
+ ));
63
42
 
64
43
  CardTitle.displayName = 'CardTitle';
65
44
 
@@ -70,16 +49,11 @@ CardTitle.displayName = 'CardTitle';
70
49
  type CardDescriptionElement = HTMLParagraphElement;
71
50
  type CardDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
72
51
 
73
- const CardDescription = React.forwardRef<
74
- CardDescriptionElement,
75
- CardDescriptionProps
76
- >(({ className, ...props }, ref) => (
77
- <p
78
- ref={ref}
79
- className={cn('text-muted-foreground text-sm', className)}
80
- {...props}
81
- />
82
- ));
52
+ const CardDescription = React.forwardRef<CardDescriptionElement, CardDescriptionProps>(
53
+ ({ className, ...props }, ref) => (
54
+ <p ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
55
+ ),
56
+ );
83
57
 
84
58
  CardDescription.displayName = 'CardDescription';
85
59
 
@@ -90,11 +64,9 @@ CardDescription.displayName = 'CardDescription';
90
64
  type CardContentElement = HTMLDivElement;
91
65
  type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
92
66
 
93
- const CardContent = React.forwardRef<CardContentElement, CardContentProps>(
94
- ({ className, ...props }, ref) => (
95
- <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
96
- ),
97
- );
67
+ const CardContent = React.forwardRef<CardContentElement, CardContentProps>(({ className, ...props }, ref) => (
68
+ <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
69
+ ));
98
70
 
99
71
  CardContent.displayName = 'CardContent';
100
72
 
@@ -105,15 +77,9 @@ CardContent.displayName = 'CardContent';
105
77
  type CardFooterElement = HTMLDivElement;
106
78
  type CardFooterProps = React.HTMLAttributes<HTMLDivElement>;
107
79
 
108
- const CardFooter = React.forwardRef<CardFooterElement, CardFooterProps>(
109
- ({ className, ...props }, ref) => (
110
- <div
111
- ref={ref}
112
- className={cn('flex items-center p-6 pt-0', className)}
113
- {...props}
114
- />
115
- ),
116
- );
80
+ const CardFooter = React.forwardRef<CardFooterElement, CardFooterProps>(({ className, ...props }, ref) => (
81
+ <div ref={ref} className={cn('flex items-center p-6 pt-0', className)} {...props} />
82
+ ));
117
83
 
118
84
  CardFooter.displayName = 'CardFooter';
119
85
 
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import useEmblaCarousel, {
5
- type UseEmblaCarouselType,
6
- } from 'embla-carousel-react';
4
+ import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
7
5
  import { ArrowLeftIcon, ArrowRightIcon } from '@radix-ui/react-icons';
8
- import { createContextScope, type Scope } from '@radix-ui/react-context';
6
+ import { createContextScope } from '@radix-ui/react-context';
9
7
  import { cn } from '../lib/utils';
10
- import { Button, type ButtonProps } from './button';
8
+ import { Button } from './button';
9
+ import type { ButtonProps } from './button';
10
+ import type { Scope } from '@radix-ui/react-context';
11
11
 
12
12
  /* -----------------------------------------------------------------------------
13
13
  * Context: Carousel
@@ -40,8 +40,7 @@ type CarouselContextValue = {
40
40
  canScrollNext: boolean;
41
41
  } & BaseCarouselProps;
42
42
 
43
- const [CarouselProvider, useCarouselContext] =
44
- createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);
43
+ const [CarouselProvider, useCarouselContext] = createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);
45
44
 
46
45
  /* -----------------------------------------------------------------------------
47
46
  * Component: Carousel
@@ -52,16 +51,7 @@ type CarouselProps = React.HTMLAttributes<HTMLDivElement> & BaseCarouselProps;
52
51
 
53
52
  const Carousel = React.forwardRef<CarouselElement, CarouselProps>(
54
53
  (
55
- {
56
- __scopeCarousel,
57
- children,
58
- orientation,
59
- opts,
60
- setApi,
61
- plugins,
62
- className,
63
- ...props
64
- }: ScopedProps<CarouselProps>,
54
+ { __scopeCarousel, children, orientation, opts, setApi, plugins, className, ...props }: ScopedProps<CarouselProps>,
65
55
  ref,
66
56
  ) => {
67
57
  const [carouselRef, api] = useEmblaCarousel(
@@ -133,9 +123,7 @@ const Carousel = React.forwardRef<CarouselElement, CarouselProps>(
133
123
  carouselRef={carouselRef}
134
124
  api={api}
135
125
  opts={opts}
136
- orientation={
137
- orientation ?? (opts?.axis === 'y' ? 'vertical' : 'horizontal')
138
- }
126
+ orientation={orientation ?? (opts?.axis === 'y' ? 'vertical' : 'horizontal')}
139
127
  scrollPrev={scrollPrev}
140
128
  scrollNext={scrollNext}
141
129
  canScrollPrev={canScrollPrev}
@@ -167,28 +155,15 @@ const CAROUSEL_CONTENT_NAME = 'CarouselContent';
167
155
  type CarouselContentElement = HTMLDivElement;
168
156
  type CarouselContentProps = React.HTMLAttributes<HTMLDivElement>;
169
157
 
170
- const CarouselContent = React.forwardRef<
171
- CarouselContentElement,
172
- CarouselContentProps
173
- >(
174
- (
175
- { __scopeCarousel, className, ...props }: ScopedProps<CarouselContentProps>,
176
- ref,
177
- ) => {
178
- const { carouselRef, orientation } = useCarouselContext(
179
- CAROUSEL_CONTENT_NAME,
180
- __scopeCarousel,
181
- );
158
+ const CarouselContent = React.forwardRef<CarouselContentElement, CarouselContentProps>(
159
+ ({ __scopeCarousel, className, ...props }: ScopedProps<CarouselContentProps>, ref) => {
160
+ const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);
182
161
 
183
162
  return (
184
163
  <div ref={carouselRef} className="overflow-hidden">
185
164
  <div
186
165
  ref={ref}
187
- className={cn(
188
- 'flex',
189
- orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
190
- className,
191
- )}
166
+ className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}
192
167
  {...props}
193
168
  />
194
169
  </div>
@@ -208,25 +183,15 @@ type CarouselItemElement = HTMLDivElement;
208
183
  type CarouselItemProps = React.HTMLAttributes<HTMLDivElement>;
209
184
 
210
185
  const CarouselItem = React.forwardRef<CarouselItemElement, CarouselItemProps>(
211
- (
212
- { __scopeCarousel, className, ...props }: ScopedProps<CarouselItemProps>,
213
- ref,
214
- ) => {
215
- const { orientation } = useCarouselContext(
216
- CAROUSEL_ITEM_NAME,
217
- __scopeCarousel,
218
- );
186
+ ({ __scopeCarousel, className, ...props }: ScopedProps<CarouselItemProps>, ref) => {
187
+ const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);
219
188
 
220
189
  return (
221
190
  <div
222
191
  ref={ref}
223
192
  role="group"
224
193
  aria-roledescription="slide"
225
- className={cn(
226
- 'min-w-0 shrink-0 grow-0 basis-full',
227
- orientation === 'horizontal' ? 'pl-4' : 'pt-4',
228
- className,
229
- )}
194
+ className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}
230
195
  {...props}
231
196
  />
232
197
  );
@@ -244,24 +209,12 @@ const CAROUSEL_PREVIOUS_NAME = 'CarouselPrevious';
244
209
  type CarouselPreviousElement = HTMLButtonElement;
245
210
  type CarouselPreviousProps = ButtonProps;
246
211
 
247
- const CarouselPrevious = React.forwardRef<
248
- CarouselPreviousElement,
249
- CarouselPreviousProps
250
- >(
212
+ const CarouselPrevious = React.forwardRef<CarouselPreviousElement, CarouselPreviousProps>(
251
213
  (
252
- {
253
- __scopeCarousel,
254
- className,
255
- variant = 'outline',
256
- size = 'icon',
257
- ...props
258
- }: ScopedProps<CarouselPreviousProps>,
214
+ { __scopeCarousel, className, variant = 'outline', size = 'icon', ...props }: ScopedProps<CarouselPreviousProps>,
259
215
  ref,
260
216
  ) => {
261
- const { orientation, scrollPrev, canScrollPrev } = useCarouselContext(
262
- CAROUSEL_PREVIOUS_NAME,
263
- __scopeCarousel,
264
- );
217
+ const { orientation, scrollPrev, canScrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);
265
218
 
266
219
  return (
267
220
  <Button
@@ -299,19 +252,10 @@ type CarouselNextProps = ButtonProps;
299
252
 
300
253
  const CarouselNext = React.forwardRef<CarouselNextElement, CarouselNextProps>(
301
254
  (
302
- {
303
- __scopeCarousel,
304
- className,
305
- variant = 'outline',
306
- size = 'icon',
307
- ...props
308
- }: ScopedProps<CarouselNextProps>,
255
+ { __scopeCarousel, className, variant = 'outline', size = 'icon', ...props }: ScopedProps<CarouselNextProps>,
309
256
  ref,
310
257
  ) => {
311
- const { orientation, scrollNext, canScrollNext } = useCarouselContext(
312
- CAROUSEL_NEXT_NAME,
313
- __scopeCarousel,
314
- );
258
+ const { orientation, scrollNext, canScrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);
315
259
 
316
260
  return (
317
261
  <Button
@@ -9,24 +9,11 @@ import * as CheckboxGroupPrimitive from './checkbox-group.primitive';
9
9
  * Component: CheckboxCards
10
10
  * -------------------------------------------------------------------------- */
11
11
 
12
- type CheckboxCardsElement = React.ElementRef<
13
- typeof CheckboxGroupPrimitive.Root
14
- >;
15
- type CheckboxCardsProps = React.ComponentPropsWithoutRef<
16
- typeof CheckboxGroupPrimitive.Root
17
- >;
12
+ type CheckboxCardsElement = React.ElementRef<typeof CheckboxGroupPrimitive.Root>;
13
+ type CheckboxCardsProps = React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Root>;
18
14
 
19
- const CheckboxCards = React.forwardRef<
20
- CheckboxCardsElement,
21
- CheckboxCardsProps
22
- >(({ className, ...props }, ref) => {
23
- return (
24
- <CheckboxGroupPrimitive.Root
25
- className={cn('grid gap-2', className)}
26
- {...props}
27
- ref={ref}
28
- />
29
- );
15
+ const CheckboxCards = React.forwardRef<CheckboxCardsElement, CheckboxCardsProps>(({ className, ...props }, ref) => {
16
+ return <CheckboxGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref} />;
30
17
  });
31
18
 
32
19
  CheckboxCards.displayName = CheckboxGroupPrimitive.Root.displayName;
@@ -35,42 +22,33 @@ CheckboxCards.displayName = CheckboxGroupPrimitive.Root.displayName;
35
22
  * Component: CheckboxCardsItem
36
23
  * -------------------------------------------------------------------------- */
37
24
 
38
- type CheckboxCardsItemElement = React.ElementRef<
39
- typeof CheckboxGroupPrimitive.Item
40
- >;
25
+ type CheckboxCardsItemElement = React.ElementRef<typeof CheckboxGroupPrimitive.Item>;
41
26
 
42
- interface CheckboxCardsItemProps
43
- extends React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Item> {
27
+ interface CheckboxCardsItemProps extends React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Item> {
44
28
  checkboxClassName?: string;
45
29
  }
46
30
 
47
- const CheckboxCardsItem = React.forwardRef<
48
- CheckboxCardsItemElement,
49
- CheckboxCardsItemProps
50
- >(({ children, className, checkboxClassName, ...props }, ref) => {
51
- return (
52
- <label
53
- className={cn(
54
- 'flex items-center justify-center gap-4 rounded-md border p-4',
55
- className,
56
- )}
57
- >
58
- {children}
59
- <CheckboxGroupPrimitive.Item
60
- ref={ref}
61
- className={cn(
62
- 'border-input aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 cursor-pointer rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
63
- checkboxClassName,
64
- )}
65
- {...props}
66
- >
67
- <CheckboxGroupPrimitive.CheckboxGroupIndicator className="flex size-full items-center justify-center text-current">
68
- <CheckIcon className="size-3.5" />
69
- </CheckboxGroupPrimitive.CheckboxGroupIndicator>
70
- </CheckboxGroupPrimitive.Item>
71
- </label>
72
- );
73
- });
31
+ const CheckboxCardsItem = React.forwardRef<CheckboxCardsItemElement, CheckboxCardsItemProps>(
32
+ ({ children, className, checkboxClassName, ...props }, ref) => {
33
+ return (
34
+ <label className={cn('flex items-center justify-center gap-4 rounded-md border p-4', className)}>
35
+ {children}
36
+ <CheckboxGroupPrimitive.Item
37
+ ref={ref}
38
+ className={cn(
39
+ 'border-input aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 cursor-pointer rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
40
+ checkboxClassName,
41
+ )}
42
+ {...props}
43
+ >
44
+ <CheckboxGroupPrimitive.CheckboxGroupIndicator className="flex size-full items-center justify-center text-current">
45
+ <CheckIcon className="size-3.5" />
46
+ </CheckboxGroupPrimitive.CheckboxGroupIndicator>
47
+ </CheckboxGroupPrimitive.Item>
48
+ </label>
49
+ );
50
+ },
51
+ );
74
52
 
75
53
  CheckboxCardsItem.displayName = CheckboxGroupPrimitive.Item.displayName;
76
54
 
@@ -78,9 +56,4 @@ CheckboxCardsItem.displayName = CheckboxGroupPrimitive.Item.displayName;
78
56
  * Exports
79
57
  * -------------------------------------------------------------------------- */
80
58
 
81
- export {
82
- CheckboxCards,
83
- CheckboxCardsItem,
84
- type CheckboxCardsProps,
85
- type CheckboxCardsItemProps,
86
- };
59
+ export { CheckboxCards, CheckboxCardsItem, type CheckboxCardsProps, type CheckboxCardsItemProps };