@codefast/ui 0.3.16-canary.3 → 0.4.0-canary.5

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/CHANGELOG.md +112 -0
  2. package/README.md +27 -16
  3. package/dist/components/accordion.d.mts +7 -22
  4. package/dist/components/accordion.mjs +26 -29
  5. package/dist/components/alert-dialog.d.mts +27 -26
  6. package/dist/components/alert-dialog.mjs +53 -45
  7. package/dist/components/alert.d.mts +12 -2
  8. package/dist/components/alert.mjs +15 -6
  9. package/dist/components/aspect-ratio.d.mts +2 -2
  10. package/dist/components/aspect-ratio.mjs +2 -3
  11. package/dist/components/avatar.d.mts +41 -5
  12. package/dist/components/avatar.mjs +40 -10
  13. package/dist/components/badge.mjs +4 -4
  14. package/dist/components/breadcrumb.d.mts +1 -0
  15. package/dist/components/breadcrumb.mjs +11 -10
  16. package/dist/components/button-group.d.mts +1 -1
  17. package/dist/components/button-group.mjs +6 -7
  18. package/dist/components/button.d.mts +0 -1
  19. package/dist/components/button.mjs +7 -7
  20. package/dist/components/calendar.d.mts +6 -2
  21. package/dist/components/calendar.mjs +39 -43
  22. package/dist/components/card.d.mts +4 -2
  23. package/dist/components/card.mjs +9 -9
  24. package/dist/components/carousel.d.mts +16 -4
  25. package/dist/components/carousel.mjs +25 -12
  26. package/dist/components/chart.d.mts +8 -3
  27. package/dist/components/chart.mjs +21 -15
  28. package/dist/components/checkbox-cards.mjs +6 -6
  29. package/dist/components/checkbox-group.mjs +6 -7
  30. package/dist/components/checkbox.d.mts +2 -2
  31. package/dist/components/checkbox.mjs +8 -9
  32. package/dist/components/collapsible.d.mts +4 -4
  33. package/dist/components/collapsible.mjs +4 -5
  34. package/dist/components/command.d.mts +11 -1
  35. package/dist/components/command.mjs +35 -32
  36. package/dist/components/context-menu.d.mts +22 -15
  37. package/dist/components/context-menu.mjs +44 -39
  38. package/dist/components/dialog.d.mts +19 -23
  39. package/dist/components/dialog.mjs +48 -47
  40. package/dist/components/direction.d.mts +24 -0
  41. package/dist/components/direction.mjs +18 -0
  42. package/dist/components/drawer.d.mts +2 -20
  43. package/dist/components/drawer.mjs +17 -25
  44. package/dist/components/dropdown-menu.d.mts +22 -15
  45. package/dist/components/dropdown-menu.mjs +41 -37
  46. package/dist/components/empty.mjs +5 -5
  47. package/dist/components/field.d.mts +1 -1
  48. package/dist/components/field.mjs +11 -12
  49. package/dist/components/form.d.mts +6 -7
  50. package/dist/components/form.mjs +6 -7
  51. package/dist/components/hover-card.d.mts +5 -5
  52. package/dist/components/hover-card.mjs +14 -12
  53. package/dist/components/input-group.d.mts +1 -1
  54. package/dist/components/input-group.mjs +12 -7
  55. package/dist/components/input-number.d.mts +3 -1
  56. package/dist/components/input-number.mjs +49 -27
  57. package/dist/components/input-otp.mjs +9 -7
  58. package/dist/components/input-password.mjs +1 -4
  59. package/dist/components/input-search.mjs +3 -5
  60. package/dist/components/input.mjs +1 -2
  61. package/dist/components/item.mjs +9 -9
  62. package/dist/components/kbd.mjs +1 -1
  63. package/dist/components/label.d.mts +2 -2
  64. package/dist/components/label.mjs +3 -4
  65. package/dist/components/menubar.d.mts +22 -16
  66. package/dist/components/menubar.mjs +54 -47
  67. package/dist/components/native-select.d.mts +5 -1
  68. package/dist/components/native-select.mjs +9 -6
  69. package/dist/components/navigation-menu.d.mts +30 -8
  70. package/dist/components/navigation-menu.mjs +33 -23
  71. package/dist/components/pagination.d.mts +6 -0
  72. package/dist/components/pagination.mjs +26 -11
  73. package/dist/components/popover.d.mts +40 -7
  74. package/dist/components/popover.mjs +46 -14
  75. package/dist/components/progress-circle.d.mts +1 -1
  76. package/dist/components/progress-circle.mjs +1 -2
  77. package/dist/components/progress.d.mts +2 -2
  78. package/dist/components/progress.mjs +5 -6
  79. package/dist/components/radio-cards.d.mts +3 -3
  80. package/dist/components/radio-cards.mjs +11 -11
  81. package/dist/components/radio-group.d.mts +3 -3
  82. package/dist/components/radio-group.mjs +9 -9
  83. package/dist/components/radio.mjs +2 -3
  84. package/dist/components/resizable.mjs +3 -8
  85. package/dist/components/scroll-area.d.mts +5 -5
  86. package/dist/components/scroll-area.mjs +13 -10
  87. package/dist/components/select.d.mts +14 -14
  88. package/dist/components/select.mjs +47 -47
  89. package/dist/components/separator.d.mts +2 -2
  90. package/dist/components/separator.mjs +3 -4
  91. package/dist/components/sheet.d.mts +13 -14
  92. package/dist/components/sheet.mjs +41 -39
  93. package/dist/components/sidebar.d.mts +2 -3
  94. package/dist/components/sidebar.mjs +46 -46
  95. package/dist/components/skeleton.mjs +1 -1
  96. package/dist/components/slider.d.mts +2 -2
  97. package/dist/components/slider.mjs +9 -11
  98. package/dist/components/sonner.mjs +11 -3
  99. package/dist/components/spinner.mjs +6 -7
  100. package/dist/components/switch.d.mts +5 -2
  101. package/dist/components/switch.mjs +7 -7
  102. package/dist/components/table.mjs +10 -10
  103. package/dist/components/tabs.d.mts +8 -5
  104. package/dist/components/tabs.mjs +18 -12
  105. package/dist/components/textarea.mjs +1 -1
  106. package/dist/components/toggle-group.d.mts +9 -6
  107. package/dist/components/toggle-group.mjs +19 -20
  108. package/dist/components/toggle.d.mts +2 -3
  109. package/dist/components/toggle.mjs +4 -6
  110. package/dist/components/tooltip.d.mts +7 -6
  111. package/dist/components/tooltip.mjs +19 -17
  112. package/dist/hooks/use-animated-value.mjs +0 -1
  113. package/dist/hooks/use-copy-to-clipboard.mjs +0 -1
  114. package/dist/hooks/use-is-mobile.mjs +0 -1
  115. package/dist/hooks/use-media-query.mjs +0 -1
  116. package/dist/hooks/use-mutation-observer.mjs +0 -1
  117. package/dist/hooks/use-pagination.mjs +0 -1
  118. package/dist/index.d.mts +15 -13
  119. package/dist/index.mjs +18 -16
  120. package/dist/primitives/checkbox-group.d.mts +9 -10
  121. package/dist/primitives/checkbox-group.mjs +14 -19
  122. package/dist/primitives/input-number.d.mts +3 -3
  123. package/dist/primitives/input-number.mjs +3 -5
  124. package/dist/primitives/input.d.mts +4 -4
  125. package/dist/primitives/input.mjs +2 -3
  126. package/dist/primitives/progress-circle.d.mts +3 -3
  127. package/dist/primitives/progress-circle.mjs +2 -3
  128. package/dist/variants/alert.d.mts +1 -1
  129. package/dist/variants/alert.mjs +3 -13
  130. package/dist/variants/badge.d.mts +6 -4
  131. package/dist/variants/badge.mjs +7 -34
  132. package/dist/variants/button-group.d.mts +2 -2
  133. package/dist/variants/button-group.mjs +3 -14
  134. package/dist/variants/button.d.mts +12 -10
  135. package/dist/variants/button.mjs +15 -57
  136. package/dist/variants/empty.d.mts +1 -1
  137. package/dist/variants/empty.mjs +2 -7
  138. package/dist/variants/field.d.mts +3 -3
  139. package/dist/variants/field.mjs +4 -22
  140. package/dist/variants/input-group.d.mts +9 -9
  141. package/dist/variants/input-group.mjs +11 -70
  142. package/dist/variants/input-number.d.mts +45 -0
  143. package/dist/variants/input-number.mjs +40 -0
  144. package/dist/variants/item.d.mts +5 -4
  145. package/dist/variants/item.mjs +9 -31
  146. package/dist/variants/navigation-menu.d.mts +1 -1
  147. package/dist/variants/navigation-menu.mjs +1 -5
  148. package/dist/variants/progress-circle.d.mts +1 -1
  149. package/dist/variants/progress-circle.mjs +1 -5
  150. package/dist/variants/scroll-area.d.mts +2 -2
  151. package/dist/variants/scroll-area.mjs +3 -8
  152. package/dist/variants/separator.mjs +6 -6
  153. package/dist/variants/sheet.d.mts +4 -4
  154. package/dist/variants/sheet.mjs +5 -38
  155. package/dist/variants/sidebar.d.mts +4 -4
  156. package/dist/variants/sidebar.mjs +6 -23
  157. package/dist/variants/tabs.d.mts +18 -0
  158. package/dist/variants/tabs.mjs +15 -0
  159. package/dist/variants/toggle.d.mts +4 -4
  160. package/dist/variants/toggle.mjs +9 -27
  161. package/package.json +27 -44
  162. package/src/components/accordion.tsx +26 -68
  163. package/src/components/alert-dialog.tsx +70 -86
  164. package/src/components/alert.tsx +27 -19
  165. package/src/components/aspect-ratio.tsx +1 -4
  166. package/src/components/avatar.tsx +99 -12
  167. package/src/components/badge.tsx +5 -8
  168. package/src/components/breadcrumb.tsx +18 -24
  169. package/src/components/button-group.tsx +10 -20
  170. package/src/components/button.tsx +8 -19
  171. package/src/components/calendar.tsx +77 -132
  172. package/src/components/card.tsx +16 -22
  173. package/src/components/carousel.tsx +40 -58
  174. package/src/components/chart.tsx +41 -92
  175. package/src/components/checkbox-cards.tsx +11 -30
  176. package/src/components/checkbox-group.tsx +6 -28
  177. package/src/components/checkbox.tsx +6 -26
  178. package/src/components/collapsible.tsx +1 -4
  179. package/src/components/command.tsx +52 -65
  180. package/src/components/context-menu.tsx +46 -125
  181. package/src/components/dialog.tsx +49 -101
  182. package/src/components/direction.tsx +32 -0
  183. package/src/components/drawer.tsx +17 -79
  184. package/src/components/dropdown-menu.tsx +39 -118
  185. package/src/components/empty.tsx +6 -20
  186. package/src/components/field.tsx +19 -52
  187. package/src/components/form.tsx +19 -61
  188. package/src/components/hover-card.tsx +4 -27
  189. package/src/components/input-group.tsx +13 -52
  190. package/src/components/input-number.tsx +55 -75
  191. package/src/components/input-otp.tsx +19 -38
  192. package/src/components/input-password.tsx +5 -29
  193. package/src/components/input-search.tsx +6 -23
  194. package/src/components/input.tsx +1 -17
  195. package/src/components/item.tsx +17 -31
  196. package/src/components/kbd.tsx +2 -14
  197. package/src/components/label.tsx +2 -10
  198. package/src/components/menubar.tsx +34 -125
  199. package/src/components/native-select.tsx +21 -30
  200. package/src/components/navigation-menu.tsx +34 -94
  201. package/src/components/pagination.tsx +28 -34
  202. package/src/components/popover.tsx +66 -35
  203. package/src/components/progress-circle.tsx +7 -25
  204. package/src/components/progress.tsx +3 -16
  205. package/src/components/radio-cards.tsx +8 -27
  206. package/src/components/radio-group.tsx +7 -27
  207. package/src/components/radio.tsx +3 -24
  208. package/src/components/resizable.tsx +5 -26
  209. package/src/components/scroll-area.tsx +12 -32
  210. package/src/components/select.tsx +37 -60
  211. package/src/components/separator.tsx +4 -18
  212. package/src/components/sheet.tsx +37 -74
  213. package/src/components/sidebar.tsx +47 -177
  214. package/src/components/skeleton.tsx +1 -3
  215. package/src/components/slider.tsx +7 -36
  216. package/src/components/sonner.tsx +16 -6
  217. package/src/components/spinner.tsx +6 -15
  218. package/src/components/switch.tsx +8 -30
  219. package/src/components/table.tsx +18 -35
  220. package/src/components/tabs.tsx +16 -34
  221. package/src/components/textarea.tsx +1 -15
  222. package/src/components/toggle-group.tsx +34 -38
  223. package/src/components/toggle.tsx +4 -13
  224. package/src/components/tooltip.tsx +11 -37
  225. package/src/css/foundation/base.css +74 -0
  226. package/src/css/foundation/motion.css +69 -0
  227. package/src/css/foundation/source.css +10 -0
  228. package/src/css/foundation/tokens.css +107 -0
  229. package/src/css/foundation/variants.css +121 -0
  230. package/src/css/preset.css +13 -214
  231. package/src/css/style.css +9 -1
  232. package/src/css/{amber.css → themes/amber.css} +29 -0
  233. package/src/css/{blue.css → themes/blue.css} +29 -0
  234. package/src/css/{cyan.css → themes/cyan.css} +29 -0
  235. package/src/css/{emerald.css → themes/emerald.css} +29 -0
  236. package/src/css/{fuchsia.css → themes/fuchsia.css} +29 -0
  237. package/src/css/{gray.css → themes/gray.css} +29 -0
  238. package/src/css/{green.css → themes/green.css} +29 -0
  239. package/src/css/{indigo.css → themes/indigo.css} +29 -0
  240. package/src/css/{lime.css → themes/lime.css} +29 -0
  241. package/src/css/{neutral.css → themes/neutral.css} +29 -0
  242. package/src/css/{orange.css → themes/orange.css} +29 -0
  243. package/src/css/{pink.css → themes/pink.css} +29 -0
  244. package/src/css/{purple.css → themes/purple.css} +29 -0
  245. package/src/css/{red.css → themes/red.css} +29 -0
  246. package/src/css/{rose.css → themes/rose.css} +29 -0
  247. package/src/css/{sky.css → themes/sky.css} +29 -0
  248. package/src/css/{slate.css → themes/slate.css} +29 -0
  249. package/src/css/{stone.css → themes/stone.css} +29 -0
  250. package/src/css/{teal.css → themes/teal.css} +29 -0
  251. package/src/css/{violet.css → themes/violet.css} +29 -0
  252. package/src/css/{yellow.css → themes/yellow.css} +29 -0
  253. package/src/css/{zinc.css → themes/zinc.css} +29 -0
  254. package/src/hooks/use-animated-value.ts +1 -7
  255. package/src/hooks/use-copy-to-clipboard.ts +1 -6
  256. package/src/hooks/use-is-mobile.ts +0 -2
  257. package/src/hooks/use-media-query.ts +0 -2
  258. package/src/hooks/use-mutation-observer.ts +0 -3
  259. package/src/hooks/use-pagination.ts +0 -2
  260. package/src/index.ts +39 -80
  261. package/src/primitives/checkbox-group.tsx +25 -39
  262. package/src/primitives/input-number.tsx +17 -63
  263. package/src/primitives/input.tsx +8 -24
  264. package/src/primitives/progress-circle.tsx +13 -43
  265. package/src/variants/alert.ts +3 -14
  266. package/src/variants/badge.ts +8 -35
  267. package/src/variants/button-group.ts +5 -18
  268. package/src/variants/button.ts +21 -58
  269. package/src/variants/empty.ts +2 -11
  270. package/src/variants/field.ts +6 -19
  271. package/src/variants/input-group.ts +12 -64
  272. package/src/variants/input-number.ts +65 -0
  273. package/src/variants/item.ts +10 -32
  274. package/src/variants/navigation-menu.ts +1 -8
  275. package/src/variants/progress-circle.ts +1 -2
  276. package/src/variants/scroll-area.ts +3 -9
  277. package/src/variants/separator.ts +6 -7
  278. package/src/variants/sheet.ts +6 -39
  279. package/src/variants/sidebar.ts +7 -27
  280. package/src/variants/tabs.ts +34 -0
  281. package/src/variants/toggle.ts +9 -28
@@ -1,9 +1,8 @@
1
+ import { ChevronDownIcon } from "lucide-react";
2
+ import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
1
3
  import type { ComponentProps, JSX } from "react";
2
4
 
3
5
  import { cn } from "#/lib/utils";
4
- import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
5
- import { ChevronDownIcon } from "lucide-react";
6
-
7
6
  import { navigationMenuTriggerVariants } from "#/variants/navigation-menu";
8
7
 
9
8
  /* -----------------------------------------------------------------------------
@@ -20,18 +19,10 @@ interface NavigationMenuProps extends ComponentProps<typeof NavigationMenuPrimit
20
19
  /**
21
20
  * @since 0.3.16-canary.0
22
21
  */
23
- function NavigationMenu({
24
- children,
25
- className,
26
- viewport = true,
27
- ...props
28
- }: NavigationMenuProps): JSX.Element {
22
+ function NavigationMenu({ children, className, viewport = true, ...props }: NavigationMenuProps): JSX.Element {
29
23
  return (
30
24
  <NavigationMenuPrimitive.Root
31
- className={cn(
32
- "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
33
- className,
34
- )}
25
+ className={cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className)}
35
26
  data-slot="navigation-menu"
36
27
  data-viewport={viewport}
37
28
  {...props}
@@ -54,14 +45,10 @@ type NavigationMenuListProps = ComponentProps<typeof NavigationMenuPrimitive.Lis
54
45
  /**
55
46
  * @since 0.3.16-canary.0
56
47
  */
57
- function NavigationMenuList({
58
- children,
59
- className,
60
- ...props
61
- }: NavigationMenuListProps): JSX.Element {
48
+ function NavigationMenuList({ children, className, ...props }: NavigationMenuListProps): JSX.Element {
62
49
  return (
63
50
  <NavigationMenuPrimitive.List
64
- className={cn("flex flex-1 items-center justify-center gap-1", "list-none", className)}
51
+ className={cn("group flex flex-1 list-none items-center justify-center gap-0", className)}
65
52
  data-slot="navigation-menu-list"
66
53
  {...props}
67
54
  >
@@ -85,11 +72,7 @@ type NavigationMenuItemProps = ComponentProps<typeof NavigationMenuPrimitive.Ite
85
72
  */
86
73
  function NavigationMenuItem({ className, ...props }: NavigationMenuItemProps): JSX.Element {
87
74
  return (
88
- <NavigationMenuPrimitive.Item
89
- className={cn("group-data-[viewport=false]/navigation-menu:relative", className)}
90
- data-slot="navigation-menu-item"
91
- {...props}
92
- />
75
+ <NavigationMenuPrimitive.Item className={cn("relative", className)} data-slot="navigation-menu-item" {...props} />
93
76
  );
94
77
  }
95
78
 
@@ -105,27 +88,17 @@ type NavigationMenuTriggerProps = ComponentProps<typeof NavigationMenuPrimitive.
105
88
  /**
106
89
  * @since 0.3.16-canary.0
107
90
  */
108
- function NavigationMenuTrigger({
109
- children,
110
- className,
111
- ...props
112
- }: NavigationMenuTriggerProps): JSX.Element {
91
+ function NavigationMenuTrigger({ children, className, ...props }: NavigationMenuTriggerProps): JSX.Element {
113
92
  return (
114
93
  <NavigationMenuPrimitive.Trigger
115
- className={navigationMenuTriggerVariants({ className })}
94
+ className={navigationMenuTriggerVariants({ className: ["group", className] })}
116
95
  data-slot="navigation-menu-trigger"
117
96
  {...props}
118
97
  >
119
- {children}
98
+ {children}{" "}
120
99
  <ChevronDownIcon
121
100
  aria-hidden="true"
122
- className={cn(
123
- "relative top-px",
124
- "ml-1 size-3",
125
- "transition-transform duration-300 ease-spring",
126
- "motion-reduce:transition-none motion-reduce:duration-0",
127
- "group-data-open/navigation-menu-trigger:rotate-180",
128
- )}
101
+ className="relative top-px ms-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180"
129
102
  />
130
103
  </NavigationMenuPrimitive.Trigger>
131
104
  );
@@ -147,20 +120,7 @@ function NavigationMenuContent({ className, ...props }: NavigationMenuContentPro
147
120
  return (
148
121
  <NavigationMenuPrimitive.Content
149
122
  className={cn(
150
- "top-0 left-0",
151
- "w-full",
152
- "group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-2 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:p-1 group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow",
153
- "group-data-[viewport=true]/navigation-menu:p-2",
154
- "data-[motion=from-end]:slide-in-from-right-52",
155
- "data-[motion=from-start]:slide-in-from-left-52",
156
- "data-[motion=to-end]:slide-out-to-right-52",
157
- "data-[motion=to-start]:slide-out-to-left-52",
158
- "ease-snappy data-[motion^=from-]:animate-in data-[motion^=from-]:duration-200 data-[motion^=from-]:fade-in-0",
159
- "data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out-0",
160
- "motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0",
161
- "md:absolute md:w-auto",
162
- "group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95",
163
- "group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95",
123
+ "start-0 top-0 w-full p-2 pe-2.5 ease-snappy group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:animation-duration-300 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:ease-exit data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none md:absolute md:w-auto group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 data-closed:ease-exit group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95",
164
124
  className,
165
125
  )}
166
126
  data-slot="navigation-menu-content"
@@ -185,20 +145,7 @@ function NavigationMenuLink({ className, ...props }: NavigationMenuLinkProps): J
185
145
  return (
186
146
  <NavigationMenuPrimitive.Link
187
147
  className={cn(
188
- "flex flex-col gap-1",
189
- "p-2",
190
- "rounded-sm outline-hidden",
191
- "text-sm",
192
- "transition-colors duration-150 ease-snappy",
193
- "motion-reduce:transition-none motion-reduce:duration-0",
194
- "hover:bg-accent hover:text-accent-foreground",
195
- "focus:bg-accent focus:text-accent-foreground",
196
- "data-active:bg-accent/50 data-active:text-accent-foreground",
197
- "data-active:hover:bg-accent",
198
- "data-active:focus:bg-accent",
199
- "data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80",
200
- "[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
201
- "[&_svg:not([class*='text-'])]:text-muted-foreground",
148
+ "flex items-center gap-1.5 rounded-md p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 data-[active=true]:bg-muted/50 data-[active=true]:hover:bg-muted data-[active=true]:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
202
149
  className,
203
150
  )}
204
151
  data-slot="navigation-menu-link"
@@ -211,23 +158,20 @@ function NavigationMenuLink({ className, ...props }: NavigationMenuLinkProps): J
211
158
  * Component: NavigationMenuViewport
212
159
  * -------------------------------------------------------------------------- */
213
160
 
161
+ /**
162
+ * @since 0.4.0-canary.4
163
+ */
214
164
  type NavigationMenuViewportProps = ComponentProps<typeof NavigationMenuPrimitive.Viewport>;
215
165
 
166
+ /**
167
+ * @since 0.4.0-canary.4
168
+ */
216
169
  function NavigationMenuViewport({ className, ...props }: NavigationMenuViewportProps): JSX.Element {
217
170
  return (
218
- <div className={cn("absolute top-full left-0 z-30 flex justify-center", "perspective-distant")}>
171
+ <div className="absolute start-0 top-full isolate z-50 flex justify-center">
219
172
  <NavigationMenuPrimitive.Viewport
220
173
  className={cn(
221
- "relative",
222
- "mt-2 min-h-[calc(var(--radix-navigation-menu-viewport-height)+2px)] w-full overflow-hidden",
223
- "rounded-lg border",
224
- "bg-popover text-popover-foreground shadow-lg",
225
- "transition-[width,height] duration-300 ease-snappy",
226
- "motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0",
227
- "sm:min-w-[calc(var(--radix-navigation-menu-viewport-width)+2px)]",
228
- "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-90",
229
- "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
230
- "origin-[top_center]",
174
+ "relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full origin-[top_center] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 transition-[width,height] duration-100 ease-snappy md:w-(--radix-navigation-menu-viewport-width) data-open:animate-in data-open:animation-duration-100 data-open:zoom-in-90 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-100 data-closed:zoom-out-90",
231
175
  className,
232
176
  )}
233
177
  data-slot="navigation-menu-viewport"
@@ -241,33 +185,25 @@ function NavigationMenuViewport({ className, ...props }: NavigationMenuViewportP
241
185
  * Component: NavigationMenuIndicator
242
186
  * -------------------------------------------------------------------------- */
243
187
 
188
+ /**
189
+ * @since 0.4.0-canary.4
190
+ */
244
191
  type NavigationMenuIndicatorProps = ComponentProps<typeof NavigationMenuPrimitive.Indicator>;
245
192
 
246
- function NavigationMenuIndicator({
247
- className,
248
- ...props
249
- }: NavigationMenuIndicatorProps): JSX.Element {
193
+ /**
194
+ * @since 0.4.0-canary.4
195
+ */
196
+ function NavigationMenuIndicator({ className, ...props }: NavigationMenuIndicatorProps): JSX.Element {
250
197
  return (
251
198
  <NavigationMenuPrimitive.Indicator
252
199
  className={cn(
253
- "top-full z-10 flex h-2 items-center justify-center overflow-hidden",
254
- "ease-snappy data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0",
255
- "data-[state=visible]:animate-in data-[state=visible]:fade-in-0",
256
- "motion-reduce:animate-none motion-reduce:transition-none",
200
+ "top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-hidden:animate-out data-hidden:fade-out data-visible:animate-in data-visible:fade-in",
257
201
  className,
258
202
  )}
259
203
  data-slot="navigation-menu-indicator"
260
204
  {...props}
261
205
  >
262
- <div
263
- className={cn(
264
- "relative top-[60%]",
265
- "size-2.5",
266
- "rounded-tl-xs",
267
- "bg-popover text-popover-foreground",
268
- "rotate-45",
269
- )}
270
- />
206
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-ss-sm bg-border shadow-md" />
271
207
  </NavigationMenuPrimitive.Indicator>
272
208
  );
273
209
  }
@@ -279,17 +215,21 @@ function NavigationMenuIndicator({
279
215
  export {
280
216
  NavigationMenu,
281
217
  NavigationMenuContent,
218
+ NavigationMenuIndicator,
282
219
  NavigationMenuItem,
283
220
  NavigationMenuLink,
284
221
  NavigationMenuList,
285
222
  NavigationMenuTrigger,
223
+ NavigationMenuViewport,
286
224
  };
287
225
 
288
226
  export type {
289
227
  NavigationMenuContentProps,
228
+ NavigationMenuIndicatorProps,
290
229
  NavigationMenuItemProps,
291
230
  NavigationMenuLinkProps,
292
231
  NavigationMenuListProps,
293
232
  NavigationMenuProps,
294
233
  NavigationMenuTriggerProps,
234
+ NavigationMenuViewportProps,
295
235
  };
@@ -1,9 +1,8 @@
1
- import type { VariantProps } from "#/lib/utils";
1
+ import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
2
2
  import type { ComponentProps, JSX } from "react";
3
3
 
4
+ import type { VariantProps } from "#/lib/utils";
4
5
  import { cn } from "#/lib/utils";
5
- import { ChevronLeftIcon, ChevronRightIcon, EllipsisIcon } from "lucide-react";
6
-
7
6
  import { buttonVariants } from "#/variants/button";
8
7
 
9
8
  /* -----------------------------------------------------------------------------
@@ -22,7 +21,7 @@ function Pagination({ className, ...props }: PaginationProps): JSX.Element {
22
21
  return (
23
22
  <nav
24
23
  aria-label="pagination"
25
- className={cn("flex w-full justify-center", "mx-auto", className)}
24
+ className={cn("mx-auto flex w-full justify-center", className)}
26
25
  data-slot="pagination"
27
26
  {...props}
28
27
  />
@@ -42,13 +41,7 @@ type PaginationContentProps = ComponentProps<"ul">;
42
41
  * @since 0.3.16-canary.0
43
42
  */
44
43
  function PaginationContent({ className, ...props }: PaginationContentProps): JSX.Element {
45
- return (
46
- <ul
47
- className={cn("flex flex-row items-center gap-1", className)}
48
- data-slot="pagination-content"
49
- {...props}
50
- />
51
- );
44
+ return <ul className={cn("flex items-center gap-1", className)} data-slot="pagination-content" {...props} />;
52
45
  }
53
46
 
54
47
  /* -----------------------------------------------------------------------------
@@ -74,25 +67,19 @@ function PaginationItem(props: PaginationItemProps): JSX.Element {
74
67
  /**
75
68
  * @since 0.3.16-canary.0
76
69
  */
77
- interface PaginationLinkProps
78
- extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
70
+ interface PaginationLinkProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
79
71
  isActive?: boolean;
80
72
  }
81
73
 
82
74
  /**
83
75
  * @since 0.3.16-canary.0
84
76
  */
85
- function PaginationLink({
86
- children,
87
- className,
88
- isActive,
89
- size = "icon",
90
- ...props
91
- }: PaginationLinkProps): JSX.Element {
77
+ function PaginationLink({ children, className, isActive, size = "icon", ...props }: PaginationLinkProps): JSX.Element {
92
78
  return (
93
79
  <a
94
80
  aria-current={isActive ? "page" : undefined}
95
81
  className={buttonVariants({ className, size, variant: isActive ? "outline" : "ghost" })}
82
+ data-active={isActive}
96
83
  data-slot="pagination-link"
97
84
  {...props}
98
85
  >
@@ -108,24 +95,25 @@ function PaginationLink({
108
95
  /**
109
96
  * @since 0.3.16-canary.0
110
97
  */
111
- interface PaginationPreviousProps
112
- extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
98
+ interface PaginationPreviousProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
113
99
  isActive?: boolean;
100
+ text?: string;
114
101
  }
115
102
 
116
103
  /**
117
104
  * @since 0.3.16-canary.0
118
105
  */
119
- function PaginationPrevious({ ...props }: PaginationPreviousProps): JSX.Element {
106
+ function PaginationPrevious({ className, text = "Previous", ...props }: PaginationPreviousProps): JSX.Element {
120
107
  return (
121
108
  <PaginationLink
122
109
  aria-label="Go to previous page"
110
+ className={cn("ps-2!", className)}
123
111
  data-slot="pagination-previous"
124
- size="md"
112
+ size="default"
125
113
  {...props}
126
114
  >
127
- <ChevronLeftIcon className="size-4" />
128
- <span>Previous</span>
115
+ <ChevronLeftIcon className="rtl:rotate-180" data-icon="inline-start" />
116
+ <span className="hidden sm:block">{text}</span>
129
117
  </PaginationLink>
130
118
  );
131
119
  }
@@ -137,19 +125,25 @@ function PaginationPrevious({ ...props }: PaginationPreviousProps): JSX.Element
137
125
  /**
138
126
  * @since 0.3.16-canary.0
139
127
  */
140
- interface PaginationNextProps
141
- extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
128
+ interface PaginationNextProps extends ComponentProps<"a">, Pick<VariantProps<typeof buttonVariants>, "size"> {
142
129
  isActive?: boolean;
130
+ text?: string;
143
131
  }
144
132
 
145
133
  /**
146
134
  * @since 0.3.16-canary.0
147
135
  */
148
- function PaginationNext({ ...props }: PaginationNextProps): JSX.Element {
136
+ function PaginationNext({ className, text = "Next", ...props }: PaginationNextProps): JSX.Element {
149
137
  return (
150
- <PaginationLink aria-label="Go to next page" data-slot="pagination-next" size="md" {...props}>
151
- <span>Next</span>
152
- <ChevronRightIcon />
138
+ <PaginationLink
139
+ aria-label="Go to next page"
140
+ className={cn("pe-2!", className)}
141
+ data-slot="pagination-next"
142
+ size="default"
143
+ {...props}
144
+ >
145
+ <span className="hidden sm:block">{text}</span>
146
+ <ChevronRightIcon className="rtl:rotate-180" data-icon="inline-end" />
153
147
  </PaginationLink>
154
148
  );
155
149
  }
@@ -170,11 +164,11 @@ function PaginationEllipsis({ className, ...props }: PaginationEllipsisProps): J
170
164
  return (
171
165
  <span
172
166
  aria-hidden
173
- className={cn("flex size-10 items-center justify-center", className)}
167
+ className={cn("flex size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4", className)}
174
168
  data-slot="pagination-ellipsis"
175
169
  {...props}
176
170
  >
177
- <EllipsisIcon className="size-4" />
171
+ <MoreHorizontalIcon />
178
172
  <span className="sr-only">More pages</span>
179
173
  </span>
180
174
  );
@@ -1,9 +1,7 @@
1
- "use client";
2
-
1
+ import { Popover as PopoverPrimitive } from "radix-ui";
3
2
  import type { ComponentProps, JSX } from "react";
4
3
 
5
4
  import { cn } from "#/lib/utils";
6
- import * as PopoverPrimitive from "@radix-ui/react-popover";
7
5
 
8
6
  /* -----------------------------------------------------------------------------
9
7
  * Component: Popover
@@ -65,34 +63,13 @@ type PopoverContentProps = ComponentProps<typeof PopoverPrimitive.Content>;
65
63
  /**
66
64
  * @since 0.3.16-canary.0
67
65
  */
68
- function PopoverContent({
69
- align = "center",
70
- className,
71
- sideOffset = 4,
72
- ...props
73
- }: PopoverContentProps): JSX.Element {
66
+ function PopoverContent({ align = "center", className, sideOffset = 4, ...props }: PopoverContentProps): JSX.Element {
74
67
  return (
75
- <PopoverPrimitive.Portal>
68
+ <PopoverPrimitive.Portal data-slot="popover-portal">
76
69
  <PopoverPrimitive.Content
77
70
  align={align}
78
71
  className={cn(
79
- "z-50",
80
- "min-w-32 p-4",
81
- "rounded-lg border",
82
- "bg-popover shadow-lg outline-hidden",
83
- "text-popover-foreground",
84
- "ease-snappy data-open:animate-in data-open:duration-200 data-open:fade-in-0 data-open:zoom-in-95",
85
- "data-open:data-side-top:slide-in-from-bottom-2",
86
- "data-open:data-side-right:slide-in-from-left-2",
87
- "data-open:data-side-bottom:slide-in-from-top-2",
88
- "data-open:data-side-left:slide-in-from-right-2",
89
- "data-closed:animate-out data-closed:duration-150 data-closed:fade-out-0 data-closed:zoom-out-95",
90
- "data-closed:data-side-top:slide-out-to-bottom-2",
91
- "data-closed:data-side-right:slide-out-to-left-2",
92
- "data-closed:data-side-bottom:slide-out-to-top-2",
93
- "data-closed:data-side-left:slide-out-to-right-2",
94
- "motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0",
95
- "origin-(--radix-popover-content-transform-origin)",
72
+ "z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden ease-snappy data-open:animate-in data-open:animation-duration-popup-in data-open:fade-in-0 data-open:zoom-in-95 data-open:data-side-top:slide-in-from-bottom-2 data-open:data-side-right:slide-in-from-left-2 data-open:data-side-bottom:slide-in-from-top-2 data-open:data-side-left:slide-in-from-right-2 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-popup-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:data-side-top:slide-out-to-bottom-2 data-closed:data-side-right:slide-out-to-left-2 data-closed:data-side-bottom:slide-out-to-top-2 data-closed:data-side-left:slide-out-to-right-2",
96
73
  className,
97
74
  )}
98
75
  data-slot="popover-content"
@@ -116,24 +93,78 @@ type PopoverArrowProps = ComponentProps<typeof PopoverPrimitive.Arrow>;
116
93
  * @since 0.3.16-canary.0
117
94
  */
118
95
  function PopoverArrow({ className, ...props }: PopoverArrowProps): JSX.Element {
119
- return (
120
- <PopoverPrimitive.Arrow
121
- className={cn("fill-popover", className)}
122
- data-slot="popover-arrow"
123
- {...props}
124
- />
125
- );
96
+ return <PopoverPrimitive.Arrow className={cn("fill-popover", className)} data-slot="popover-arrow" {...props} />;
97
+ }
98
+
99
+ /* -----------------------------------------------------------------------------
100
+ * Component: PopoverHeader
101
+ * -------------------------------------------------------------------------- */
102
+
103
+ /**
104
+ * @since 0.3.16-canary.0
105
+ */
106
+ type PopoverHeaderProps = ComponentProps<"div">;
107
+
108
+ /**
109
+ * @since 0.3.16-canary.0
110
+ */
111
+ function PopoverHeader({ className, ...props }: PopoverHeaderProps): JSX.Element {
112
+ return <div className={cn("flex flex-col gap-1 text-sm", className)} data-slot="popover-header" {...props} />;
113
+ }
114
+
115
+ /* -----------------------------------------------------------------------------
116
+ * Component: PopoverTitle
117
+ * -------------------------------------------------------------------------- */
118
+
119
+ /**
120
+ * @since 0.3.16-canary.0
121
+ */
122
+ type PopoverTitleProps = ComponentProps<"div">;
123
+
124
+ /**
125
+ * @since 0.3.16-canary.0
126
+ */
127
+ function PopoverTitle({ className, ...props }: PopoverTitleProps): JSX.Element {
128
+ return <div className={cn("font-medium", className)} data-slot="popover-title" {...props} />;
129
+ }
130
+
131
+ /* -----------------------------------------------------------------------------
132
+ * Component: PopoverDescription
133
+ * -------------------------------------------------------------------------- */
134
+
135
+ /**
136
+ * @since 0.3.16-canary.0
137
+ */
138
+ type PopoverDescriptionProps = ComponentProps<"p">;
139
+
140
+ /**
141
+ * @since 0.3.16-canary.0
142
+ */
143
+ function PopoverDescription({ className, ...props }: PopoverDescriptionProps): JSX.Element {
144
+ return <p className={cn("text-muted-foreground", className)} data-slot="popover-description" {...props} />;
126
145
  }
127
146
 
128
147
  /* -----------------------------------------------------------------------------
129
148
  * Exports
130
149
  * -------------------------------------------------------------------------- */
131
150
 
132
- export { Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger };
151
+ export {
152
+ Popover,
153
+ PopoverAnchor,
154
+ PopoverArrow,
155
+ PopoverContent,
156
+ PopoverDescription,
157
+ PopoverHeader,
158
+ PopoverTitle,
159
+ PopoverTrigger,
160
+ };
133
161
  export type {
134
162
  PopoverAnchorProps,
135
163
  PopoverArrowProps,
136
164
  PopoverContentProps,
165
+ PopoverDescriptionProps,
166
+ PopoverHeaderProps,
137
167
  PopoverProps,
168
+ PopoverTitleProps,
138
169
  PopoverTriggerProps,
139
170
  };
@@ -1,14 +1,10 @@
1
- "use client";
2
-
3
- import type { ProgressCircleVariants } from "#/variants/progress-circle";
4
1
  import type { ComponentProps, CSSProperties, JSX } from "react";
5
-
6
2
  import { useCallback, useMemo } from "react";
7
3
 
8
- import { progressCircleVariants } from "#/variants/progress-circle";
9
-
10
4
  import { useAnimatedValue } from "#/hooks/use-animated-value";
11
5
  import * as ProgressCirclePrimitive from "#/primitives/progress-circle";
6
+ import type { ProgressCircleVariants } from "#/variants/progress-circle";
7
+ import { progressCircleVariants } from "#/variants/progress-circle";
12
8
 
13
9
  /* -------------------------------------------------------------------------------------------------
14
10
  * Component: ProgressCircle
@@ -18,9 +14,7 @@ import * as ProgressCirclePrimitive from "#/primitives/progress-circle";
18
14
  * @since 0.3.16-canary.0
19
15
  */
20
16
  interface ProgressCircleProps
21
- extends
22
- Omit<ComponentProps<typeof ProgressCirclePrimitive.Provider>, "children" | "size">,
23
- ProgressCircleVariants {
17
+ extends Omit<ComponentProps<typeof ProgressCirclePrimitive.Provider>, "children" | "size">, ProgressCircleVariants {
24
18
  /**
25
19
  * Enables animation effect when value changes
26
20
  */
@@ -112,10 +106,7 @@ function ProgressCircle({
112
106
  [strokeWidth, thickness, actualSize],
113
107
  );
114
108
 
115
- const slots = useMemo(
116
- () => progressCircleVariants({ size, thickness, variant }),
117
- [variant, size, thickness],
118
- );
109
+ const slots = useMemo(() => progressCircleVariants({ size, thickness, variant }), [variant, size, thickness]);
119
110
 
120
111
  const shouldShowLabel = showValue || Boolean(customLabel);
121
112
 
@@ -128,19 +119,10 @@ function ProgressCircle({
128
119
  }, [customLabel, displayValue]);
129
120
 
130
121
  return (
131
- <ProgressCirclePrimitive.Provider
132
- size={actualSize}
133
- strokeWidth={actualThickness}
134
- value={value}
135
- {...props}
136
- >
137
- <ProgressCirclePrimitive.Root
138
- className={slots.root({ className: [className, classNames?.root] })}
139
- >
122
+ <ProgressCirclePrimitive.Provider size={actualSize} strokeWidth={actualThickness} value={value} {...props}>
123
+ <ProgressCirclePrimitive.Root className={slots.root({ className: [className, classNames?.root] })}>
140
124
  <ProgressCirclePrimitive.SVG className={slots.svg({ className: classNames?.svg })}>
141
- <ProgressCirclePrimitive.Track
142
- className={slots.track({ className: classNames?.track })}
143
- />
125
+ <ProgressCirclePrimitive.Track className={slots.track({ className: classNames?.track })} />
144
126
  <ProgressCirclePrimitive.Indicator
145
127
  className={slots.indicator({ className: classNames?.indicator })}
146
128
  style={
@@ -1,9 +1,7 @@
1
- "use client";
2
-
1
+ import { Progress as ProgressPrimitive } from "radix-ui";
3
2
  import type { ComponentProps, JSX } from "react";
4
3
 
5
4
  import { cn } from "#/lib/utils";
6
- import * as ProgressPrimitive from "@radix-ui/react-progress";
7
5
 
8
6
  /* -----------------------------------------------------------------------------
9
7
  * Component: Progress
@@ -20,23 +18,12 @@ type ProgressProps = ComponentProps<typeof ProgressPrimitive.Root>;
20
18
  function Progress({ className, value, ...props }: ProgressProps): JSX.Element {
21
19
  return (
22
20
  <ProgressPrimitive.Root
23
- className={cn(
24
- "relative",
25
- "h-2 w-full overflow-hidden",
26
- "rounded-full",
27
- "bg-primary/20",
28
- className,
29
- )}
21
+ className={cn("relative flex h-1.5 w-full items-center overflow-x-hidden rounded-full bg-muted", className)}
30
22
  data-slot="progress"
31
23
  {...props}
32
24
  >
33
25
  <ProgressPrimitive.Indicator
34
- className={cn(
35
- "size-full flex-1",
36
- "bg-primary",
37
- "transition-[transform] duration-500 ease-gentle",
38
- "motion-reduce:transition-none motion-reduce:duration-0",
39
- )}
26
+ className="size-full flex-1 bg-primary transition-all"
40
27
  data-slot="progress-indicator"
41
28
  style={{
42
29
  transform: `translateX(-${(100 - (value ?? 0)).toString()}%)`,
@@ -1,11 +1,8 @@
1
- "use client";
2
-
1
+ import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
3
2
  import type { ComponentProps, JSX } from "react";
4
3
 
5
- import { cn } from "#/lib/utils";
6
- import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
7
-
8
4
  import { Label } from "#/components/label";
5
+ import { cn } from "#/lib/utils";
9
6
 
10
7
  /* -----------------------------------------------------------------------------
11
8
  * Component: RadioCards
@@ -38,39 +35,23 @@ type RadioCardsItemProps = ComponentProps<typeof RadioGroupPrimitive.Item>;
38
35
  function RadioCardsItem({ children, className, ...props }: RadioCardsItemProps): JSX.Element {
39
36
  return (
40
37
  <Label
41
- className={cn(
42
- "flex items-start gap-3",
43
- "p-3",
44
- "rounded-lg border border-input",
45
- "transition",
46
- "hover:not-has-disabled:not-has-aria-checked:bg-secondary",
47
- "has-focus-visible:border-ring",
48
- "has-disabled:opacity-50",
49
- "has-aria-checked:border-primary has-aria-checked:bg-primary/10",
50
- )}
38
+ className="flex items-start gap-3 rounded-md border border-input p-3 transition has-focus-visible:border-ring has-disabled:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5"
51
39
  data-slot="radio-card"
52
40
  >
53
41
  <RadioGroupPrimitive.Item
54
42
  className={cn(
55
- "peer flex size-4 shrink-0 items-center justify-center",
56
- "rounded-full border border-input shadow-xs outline-hidden",
57
- "text-primary-foreground",
58
- "transition",
59
- "focus-visible:ring-3 focus-visible:ring-ring/50",
60
- "focus-visible:not-aria-checked:border-ring",
61
- "aria-checked:border-primary aria-checked:bg-primary",
62
- "focus-visible:aria-checked:ring-primary/20",
63
- "dark:bg-input/30",
64
- "dark:focus-visible:aria-checked:ring-primary/40",
43
+ "peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
65
44
  className,
66
45
  )}
67
46
  data-slot="radio-card-item"
68
47
  {...props}
69
48
  >
70
49
  <RadioGroupPrimitive.Indicator
71
- className={cn("size-1", "rounded-full", "bg-background")}
50
+ className="flex size-4 items-center justify-center"
72
51
  data-slot="radio-card-indicator"
73
- />
52
+ >
53
+ <span className="absolute start-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 animate-in rounded-full bg-primary-foreground duration-control-indicator ease-spring zoom-in-50 rtl:translate-x-1/2" />
54
+ </RadioGroupPrimitive.Indicator>
74
55
  </RadioGroupPrimitive.Item>
75
56
  {children}
76
57
  </Label>