@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,4 +1,16 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Yellow theme
3
+ *
4
+ * Color tokens for the yellow palette across the light (`:root`),
5
+ * `.dark`, and system-preference variants. Trailing comments note the source
6
+ * palette swatch for each value.
7
+ * ------------------------------------------------------------------------- */
8
+
1
9
  :root {
10
+ /* ----------------------------------------------------------------------
11
+ * Surfaces & semantic colors
12
+ * ---------------------------------------------------------------------- */
13
+
2
14
  --background: oklch(1 0 0); /* --color-zinc-50 */
3
15
  --foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
4
16
 
@@ -22,10 +34,18 @@
22
34
  --card: oklch(1 0 0); /* --color-zinc-50 */
23
35
  --card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
24
36
 
37
+ /* ----------------------------------------------------------------------
38
+ * Form & focus
39
+ * ---------------------------------------------------------------------- */
40
+
25
41
  --border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
26
42
  --input: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
27
43
  --ring: oklch(0.852 0.199 91.936); /* --color-yellow-400 */
28
44
 
45
+ /* ----------------------------------------------------------------------
46
+ * Sidebar
47
+ * ---------------------------------------------------------------------- */
48
+
29
49
  --sidebar: oklch(0.985 0 0); /* --color-zinc-50 */
30
50
  --sidebar-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
31
51
  --sidebar-primary: oklch(0.681 0.162 75.834); /* --color-yellow-600 */
@@ -35,6 +55,10 @@
35
55
  --sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
36
56
  --sidebar-ring: oklch(0.852 0.199 91.936); /* --color-yellow-400 */
37
57
 
58
+ /* ----------------------------------------------------------------------
59
+ * Charts
60
+ * ---------------------------------------------------------------------- */
61
+
38
62
  --chart-1: oklch(0.905 0.182 98.111); /* --color-yellow-300 */
39
63
  --chart-2: oklch(0.795 0.184 86.047); /* --color-yellow-500 */
40
64
  --chart-3: oklch(0.681 0.162 75.834); /* --color-yellow-600 */
@@ -43,6 +67,8 @@
43
67
  }
44
68
 
45
69
  .dark {
70
+ /* Dark variant — overrides the light tokens above. */
71
+
46
72
  --background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
47
73
  --foreground: oklch(0.985 0 0); /* --color-zinc-50 */
48
74
 
@@ -85,8 +111,11 @@
85
111
  --chart-4: oklch(0.554 0.135 66.442); /* --color-yellow-700 */
86
112
  --chart-5: oklch(0.476 0.114 61.907); /* --color-yellow-800 */
87
113
  }
114
+
88
115
  @media (prefers-color-scheme: dark) {
89
116
  :root:not(.light) {
117
+ /* System-preference dark — applied when no explicit .light is set. */
118
+
90
119
  --background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
91
120
  --foreground: oklch(0.985 0 0); /* --color-zinc-50 */
92
121
 
@@ -1,4 +1,16 @@
1
+ /* -------------------------------------------------------------------------
2
+ * Zinc theme
3
+ *
4
+ * Color tokens for the zinc palette across the light (`:root`),
5
+ * `.dark`, and system-preference variants. Trailing comments note the source
6
+ * palette swatch for each value.
7
+ * ------------------------------------------------------------------------- */
8
+
1
9
  :root {
10
+ /* ----------------------------------------------------------------------
11
+ * Surfaces & semantic colors
12
+ * ---------------------------------------------------------------------- */
13
+
2
14
  --background: oklch(1 0 0); /* --color-zinc-50 */
3
15
  --foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
4
16
 
@@ -22,10 +34,18 @@
22
34
  --card: oklch(1 0 0); /* --color-zinc-50 */
23
35
  --card-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
24
36
 
37
+ /* ----------------------------------------------------------------------
38
+ * Form & focus
39
+ * ---------------------------------------------------------------------- */
40
+
25
41
  --border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
26
42
  --input: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
27
43
  --ring: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
28
44
 
45
+ /* ----------------------------------------------------------------------
46
+ * Sidebar
47
+ * ---------------------------------------------------------------------- */
48
+
29
49
  --sidebar: oklch(0.985 0 0); /* --color-zinc-50 */
30
50
  --sidebar-foreground: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
31
51
  --sidebar-primary: oklch(0.21 0.006 285.885); /* --color-zinc-900 */
@@ -35,6 +55,10 @@
35
55
  --sidebar-border: oklch(0.92 0.004 286.32); /* --color-zinc-200 */
36
56
  --sidebar-ring: oklch(0.705 0.015 286.067); /* --color-zinc-400 */
37
57
 
58
+ /* ----------------------------------------------------------------------
59
+ * Charts
60
+ * ---------------------------------------------------------------------- */
61
+
38
62
  --chart-1: oklch(0.646 0.222 41.116); /* --color-orange-600 */
39
63
  --chart-2: oklch(0.6 0.118 184.704); /* --color-teal-600 */
40
64
  --chart-3: oklch(0.398 0.07 227.392); /* --color-cyan-900 */
@@ -43,6 +67,8 @@
43
67
  }
44
68
 
45
69
  .dark {
70
+ /* Dark variant — overrides the light tokens above. */
71
+
46
72
  --background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
47
73
  --foreground: oklch(0.985 0 0); /* --color-zinc-50 */
48
74
 
@@ -85,8 +111,11 @@
85
111
  --chart-4: oklch(0.627 0.265 303.9); /* --color-purple-500 */
86
112
  --chart-5: oklch(0.645 0.246 16.439); /* --color-rose-500 */
87
113
  }
114
+
88
115
  @media (prefers-color-scheme: dark) {
89
116
  :root:not(.light) {
117
+ /* System-preference dark — applied when no explicit .light is set. */
118
+
90
119
  --background: oklch(0.141 0.005 285.823); /* --color-zinc-950 */
91
120
  --foreground: oklch(0.985 0 0); /* --color-zinc-50 */
92
121
 
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  import { useEffect, useRef, useState } from "react";
4
2
 
5
3
  /**
@@ -21,11 +19,7 @@ import { useEffect, useRef, useState } from "react";
21
19
  *
22
20
  * @since 0.3.16-canary.0
23
21
  */
24
- export function useAnimatedValue(
25
- targetValue: null | number,
26
- duration: number,
27
- animate?: boolean,
28
- ): number {
22
+ export function useAnimatedValue(targetValue: null | number, duration: number, animate?: boolean): number {
29
23
  // Default to 0 when targetValue is null
30
24
  const actualTargetValue = targetValue ?? 0;
31
25
 
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  import { useState } from "react";
4
2
 
5
3
  /**
@@ -21,10 +19,7 @@ import { useState } from "react";
21
19
  *
22
20
  * @since 0.3.16-canary.0
23
21
  */
24
- export function useCopyToClipboard({
25
- onCopy,
26
- timeout = 2000,
27
- }: { onCopy?: () => void; timeout?: number } = {}): {
22
+ export function useCopyToClipboard({ onCopy, timeout = 2000 }: { onCopy?: () => void; timeout?: number } = {}): {
28
23
  copyToClipboard: (value: string) => Promise<void>;
29
24
  isCopied: boolean;
30
25
  } {
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  import { useMediaQuery } from "#/hooks/use-media-query";
4
2
 
5
3
  /**
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  import { useEffect, useState } from "react";
4
2
 
5
3
  /**
@@ -1,7 +1,4 @@
1
- "use client";
2
-
3
1
  import type { RefObject } from "react";
4
-
5
2
  import { useEffect } from "react";
6
3
 
7
4
  /**
@@ -1,5 +1,3 @@
1
- "use client";
2
-
3
1
  import { useMemo } from "react";
4
2
 
5
3
  /**
package/src/index.ts CHANGED
@@ -1,19 +1,12 @@
1
- export {
2
- Accordion,
3
- AccordionContent,
4
- AccordionIcon,
5
- AccordionItem,
6
- AccordionTrigger,
7
- } from "#/components/accordion";
1
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "#/components/accordion";
8
2
  export type {
9
3
  AccordionContentProps,
10
- AccordionIconProps,
11
4
  AccordionItemProps,
12
5
  AccordionProps,
13
6
  AccordionTriggerProps,
14
7
  } from "#/components/accordion";
15
- export { Alert, AlertDescription, AlertTitle } from "#/components/alert";
16
- export type { AlertDescriptionProps, AlertProps, AlertTitleProps } from "#/components/alert";
8
+ export { Alert, AlertAction, AlertDescription, AlertTitle } from "#/components/alert";
9
+ export type { AlertActionProps, AlertDescriptionProps, AlertProps, AlertTitleProps } from "#/components/alert";
17
10
  export {
18
11
  AlertDialog,
19
12
  AlertDialogAction,
@@ -23,6 +16,7 @@ export {
23
16
  AlertDialogDescription,
24
17
  AlertDialogFooter,
25
18
  AlertDialogHeader,
19
+ AlertDialogMedia,
26
20
  AlertDialogTitle,
27
21
  AlertDialogTrigger,
28
22
  } from "#/components/alert-dialog";
@@ -34,22 +28,26 @@ export type {
34
28
  AlertDialogDescriptionProps,
35
29
  AlertDialogFooterProps,
36
30
  AlertDialogHeaderProps,
31
+ AlertDialogMediaProps,
37
32
  AlertDialogProps,
38
33
  AlertDialogTitleProps,
39
34
  AlertDialogTriggerProps,
40
35
  } from "#/components/alert-dialog";
41
36
  export { AspectRatio } from "#/components/aspect-ratio";
42
37
  export type { AspectRatioProps } from "#/components/aspect-ratio";
43
- export { Avatar, AvatarFallback, AvatarImage } from "#/components/avatar";
44
- export type { AvatarFallbackProps, AvatarImageProps, AvatarProps } from "#/components/avatar";
38
+ export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from "#/components/avatar";
39
+ export type {
40
+ AvatarBadgeProps,
41
+ AvatarFallbackProps,
42
+ AvatarGroupCountProps,
43
+ AvatarGroupProps,
44
+ AvatarImageProps,
45
+ AvatarProps,
46
+ } from "#/components/avatar";
45
47
  export { Badge } from "#/components/badge";
46
48
  export type { BadgeProps } from "#/components/badge";
47
49
  export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from "#/components/button-group";
48
- export type {
49
- ButtonGroupProps,
50
- ButtonGroupSeparatorProps,
51
- ButtonGroupTextProps,
52
- } from "#/components/button-group";
50
+ export type { ButtonGroupProps, ButtonGroupSeparatorProps, ButtonGroupTextProps } from "#/components/button-group";
53
51
  export {
54
52
  Breadcrumb,
55
53
  BreadcrumbEllipsis,
@@ -71,15 +69,7 @@ export type {
71
69
  export { Button } from "#/components/button";
72
70
  export type { ButtonProps } from "#/components/button";
73
71
  export { Calendar, CalendarDayButton } from "#/components/calendar";
74
- export {
75
- Card,
76
- CardAction,
77
- CardContent,
78
- CardDescription,
79
- CardFooter,
80
- CardHeader,
81
- CardTitle,
82
- } from "#/components/card";
72
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "#/components/card";
83
73
  export type {
84
74
  CardActionProps,
85
75
  CardContentProps,
@@ -130,11 +120,7 @@ export type { CheckboxCardsItemProps, CheckboxCardsProps } from "#/components/ch
130
120
  export { CheckboxGroup, CheckboxGroupItem } from "#/components/checkbox-group";
131
121
  export type { CheckboxGroupItemProps, CheckboxGroupProps } from "#/components/checkbox-group";
132
122
  export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "#/components/collapsible";
133
- export type {
134
- CollapsibleContentProps,
135
- CollapsibleProps,
136
- CollapsibleTriggerProps,
137
- } from "#/components/collapsible";
123
+ export type { CollapsibleContentProps, CollapsibleProps, CollapsibleTriggerProps } from "#/components/collapsible";
138
124
  export {
139
125
  Command,
140
126
  CommandDialog,
@@ -215,9 +201,10 @@ export type {
215
201
  DialogTitleProps,
216
202
  DialogTriggerProps,
217
203
  } from "#/components/dialog";
204
+ export { DirectionProvider, useDirection } from "#/components/direction";
205
+ export type { DirectionProviderProps } from "#/components/direction";
218
206
  export {
219
207
  Drawer,
220
- DrawerBody,
221
208
  DrawerClose,
222
209
  DrawerContent,
223
210
  DrawerDescription,
@@ -227,7 +214,6 @@ export {
227
214
  DrawerTrigger,
228
215
  } from "#/components/drawer";
229
216
  export type {
230
- DrawerBodyProps,
231
217
  DrawerCloseProps,
232
218
  DrawerContentProps,
233
219
  DrawerDescriptionProps,
@@ -271,14 +257,7 @@ export type {
271
257
  DropdownMenuSubTriggerProps,
272
258
  DropdownMenuTriggerProps,
273
259
  } from "#/components/dropdown-menu";
274
- export {
275
- Empty,
276
- EmptyContent,
277
- EmptyDescription,
278
- EmptyHeader,
279
- EmptyMedia,
280
- EmptyTitle,
281
- } from "#/components/empty";
260
+ export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "#/components/empty";
282
261
  export type {
283
262
  EmptyContentProps,
284
263
  EmptyDescriptionProps,
@@ -330,12 +309,7 @@ export type {
330
309
  FormMessageProps,
331
310
  FormProps,
332
311
  } from "#/components/form";
333
- export {
334
- HoverCard,
335
- HoverCardArrow,
336
- HoverCardContent,
337
- HoverCardTrigger,
338
- } from "#/components/hover-card";
312
+ export { HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger } from "#/components/hover-card";
339
313
  export type {
340
314
  HoverCardArrowProps,
341
315
  HoverCardContentProps,
@@ -448,25 +422,25 @@ export type {
448
422
  export {
449
423
  NavigationMenu,
450
424
  NavigationMenuContent,
425
+ NavigationMenuIndicator,
451
426
  NavigationMenuItem,
452
427
  NavigationMenuLink,
453
428
  NavigationMenuList,
454
429
  NavigationMenuTrigger,
430
+ NavigationMenuViewport,
455
431
  } from "#/components/navigation-menu";
456
432
  export type {
457
433
  NavigationMenuContentProps,
434
+ NavigationMenuIndicatorProps,
458
435
  NavigationMenuItemProps,
459
436
  NavigationMenuLinkProps,
460
437
  NavigationMenuListProps,
461
438
  NavigationMenuProps,
462
439
  NavigationMenuTriggerProps,
440
+ NavigationMenuViewportProps,
463
441
  } from "#/components/navigation-menu";
464
442
  export { NativeSelect, NativeSelectOptGroup, NativeSelectOption } from "#/components/native-select";
465
- export type {
466
- NativeSelectOptGroupProps,
467
- NativeSelectOptionProps,
468
- NativeSelectProps,
469
- } from "#/components/native-select";
443
+ export type { NativeSelectOptGroupProps, NativeSelectOptionProps, NativeSelectProps } from "#/components/native-select";
470
444
  export {
471
445
  Pagination,
472
446
  PaginationContent,
@@ -490,13 +464,19 @@ export {
490
464
  PopoverAnchor,
491
465
  PopoverArrow,
492
466
  PopoverContent,
467
+ PopoverDescription,
468
+ PopoverHeader,
469
+ PopoverTitle,
493
470
  PopoverTrigger,
494
471
  } from "#/components/popover";
495
472
  export type {
496
473
  PopoverAnchorProps,
497
474
  PopoverArrowProps,
498
475
  PopoverContentProps,
476
+ PopoverDescriptionProps,
477
+ PopoverHeaderProps,
499
478
  PopoverProps,
479
+ PopoverTitleProps,
500
480
  PopoverTriggerProps,
501
481
  } from "#/components/popover";
502
482
  export { Progress } from "#/components/progress";
@@ -510,11 +490,7 @@ export type { RadioCardsItemProps, RadioCardsProps } from "#/components/radio-ca
510
490
  export { RadioGroup, RadioGroupItem } from "#/components/radio-group";
511
491
  export type { RadioGroupItemProps, RadioGroupProps } from "#/components/radio-group";
512
492
  export { ResizableGroup, ResizablePanel, ResizableSeparator } from "#/components/resizable";
513
- export type {
514
- ResizableGroupProps,
515
- ResizablePanelProps,
516
- ResizableSeparatorProps,
517
- } from "#/components/resizable";
493
+ export type { ResizableGroupProps, ResizablePanelProps, ResizableSeparatorProps } from "#/components/resizable";
518
494
  export { ScrollArea, ScrollAreaScrollbar } from "#/components/scroll-area";
519
495
  export type { ScrollAreaProps, ScrollAreaScrollbarProps } from "#/components/scroll-area";
520
496
  export {
@@ -647,25 +623,14 @@ export type {
647
623
  TableRowProps,
648
624
  } from "#/components/table";
649
625
  export { Tabs, TabsContent, TabsList, TabsTrigger } from "#/components/tabs";
650
- export type {
651
- TabsContentProps,
652
- TabsListProps,
653
- TabsProps,
654
- TabsTriggerProps,
655
- } from "#/components/tabs";
626
+ export type { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps } from "#/components/tabs";
656
627
  export { Textarea } from "#/components/textarea";
657
628
  export type { TextareaProps } from "#/components/textarea";
658
629
  export { Toggle } from "#/components/toggle";
659
630
  export type { ToggleProps } from "#/components/toggle";
660
631
  export { ToggleGroup, ToggleGroupItem } from "#/components/toggle-group";
661
632
  export type { ToggleGroupItemProps, ToggleGroupProps } from "#/components/toggle-group";
662
- export {
663
- Tooltip,
664
- TooltipArrow,
665
- TooltipContent,
666
- TooltipProvider,
667
- TooltipTrigger,
668
- } from "#/components/tooltip";
633
+ export { Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger } from "#/components/tooltip";
669
634
  export type {
670
635
  TooltipArrowProps,
671
636
  TooltipContentProps,
@@ -692,16 +657,8 @@ export { emptyMediaVariants } from "#/variants/empty";
692
657
  export type { EmptyMediaVariants } from "#/variants/empty";
693
658
  export { fieldVariants } from "#/variants/field";
694
659
  export type { FieldVariants } from "#/variants/field";
695
- export {
696
- inputGroupAddonVariants,
697
- inputGroupButtonVariants,
698
- inputGroupVariants,
699
- } from "#/variants/input-group";
700
- export type {
701
- InputGroupAddonVariants,
702
- InputGroupButtonVariants,
703
- InputGroupVariants,
704
- } from "#/variants/input-group";
660
+ export { inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants } from "#/variants/input-group";
661
+ export type { InputGroupAddonVariants, InputGroupButtonVariants, InputGroupVariants } from "#/variants/input-group";
705
662
  export { itemMediaVariants, itemVariants } from "#/variants/item";
706
663
  export type { ItemMediaVariants, ItemVariants } from "#/variants/item";
707
664
  export { navigationMenuTriggerVariants } from "#/variants/navigation-menu";
@@ -716,5 +673,7 @@ export { sheetContentVariants } from "#/variants/sheet";
716
673
  export type { SheetContentVariants } from "#/variants/sheet";
717
674
  export { sidebarMenuButtonVariants } from "#/variants/sidebar";
718
675
  export type { SidebarMenuButtonVariants } from "#/variants/sidebar";
676
+ export { tabsListVariants } from "#/variants/tabs";
677
+ export type { TabsListVariants } from "#/variants/tabs";
719
678
  export { toggleVariants } from "#/variants/toggle";
720
679
  export type { ToggleVariants } from "#/variants/toggle";
@@ -1,13 +1,10 @@
1
- import type { Scope } from "@radix-ui/react-context";
1
+ import { Checkbox as CheckboxPrimitive } from "radix-ui";
2
+ import { Checkbox } from "radix-ui";
3
+ import { Direction } from "radix-ui";
4
+ import { Context } from "radix-ui/internal";
5
+ import { RovingFocus } from "radix-ui/internal";
6
+ import { useControllableState } from "radix-ui/internal";
2
7
  import type { ComponentProps, JSX } from "react";
3
-
4
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
5
- import { createCheckboxScope } from "@radix-ui/react-checkbox";
6
- import { createContextScope } from "@radix-ui/react-context";
7
- import { useDirection } from "@radix-ui/react-direction";
8
- import * as RovingFocusGroup from "@radix-ui/react-roving-focus";
9
- import { createRovingFocusGroupScope } from "@radix-ui/react-roving-focus";
10
- import { useControllableState } from "@radix-ui/react-use-controllable-state";
11
8
  import { useCallback } from "react";
12
9
 
13
10
  /* -----------------------------------------------------------------------------
@@ -23,16 +20,16 @@ type ScopedProps<P> = P & {
23
20
  /**
24
21
  * Optional scope for the CheckboxGroup component
25
22
  */
26
- __scopeCheckboxGroup?: Scope;
23
+ __scopeCheckboxGroup?: Context.Scope;
27
24
  };
28
25
 
29
- const [createCheckboxGroupContext, createCheckboxGroupScope] = createContextScope(
30
- CHECKBOX_GROUP_NAME,
31
- [createRovingFocusGroupScope, createCheckboxScope],
32
- );
26
+ const [createCheckboxGroupContext, createCheckboxGroupScope] = Context.createContextScope(CHECKBOX_GROUP_NAME, [
27
+ RovingFocus.createRovingFocusGroupScope,
28
+ Checkbox.createCheckboxScope,
29
+ ]);
33
30
 
34
- const useRovingFocusGroupScope = createRovingFocusGroupScope();
35
- const useCheckboxScope = createCheckboxScope();
31
+ const useRovingFocusGroupScope = RovingFocus.createRovingFocusGroupScope();
32
+ const useCheckboxScope = Checkbox.createCheckboxScope();
36
33
 
37
34
  /**
38
35
  * Context values shared between CheckboxGroup components
@@ -90,7 +87,7 @@ interface CheckboxGroupBaseProps {
90
87
  /**
91
88
  * Direction for roving focus navigation
92
89
  */
93
- dir?: RovingFocusGroup.RovingFocusGroupProps["dir"];
90
+ dir?: RovingFocus.RovingFocusGroupProps["dir"];
94
91
 
95
92
  /**
96
93
  * Whether the entire checkbox group is disabled
@@ -100,7 +97,7 @@ interface CheckboxGroupBaseProps {
100
97
  /**
101
98
  * Whether focus should loop to the start/end when reaching the boundaries
102
99
  */
103
- loop?: RovingFocusGroup.RovingFocusGroupProps["loop"];
100
+ loop?: RovingFocus.RovingFocusGroupProps["loop"];
104
101
 
105
102
  /**
106
103
  * Name attribute for the checkbox group form field
@@ -116,7 +113,7 @@ interface CheckboxGroupBaseProps {
116
113
  /**
117
114
  * Orientation of the checkbox group (horizontal or vertical)
118
115
  */
119
- orientation?: RovingFocusGroup.RovingFocusGroupProps["orientation"];
116
+ orientation?: RovingFocus.RovingFocusGroupProps["orientation"];
120
117
 
121
118
  /**
122
119
  * Whether at least one checkbox must be selected
@@ -155,14 +152,14 @@ function CheckboxGroup({
155
152
  ...props
156
153
  }: ScopedProps<CheckboxGroupProps>): JSX.Element {
157
154
  /**
158
- * Scope for the RovingFocusGroup component
155
+ * Context.Scope for the RovingFocusGroup component
159
156
  */
160
157
  const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);
161
158
 
162
159
  /**
163
160
  * Direction for layout and navigation
164
161
  */
165
- const direction = useDirection(dir);
162
+ const direction = Direction.useDirection(dir);
166
163
 
167
164
  /**
168
165
  * State for managing selected checkbox values
@@ -215,15 +212,9 @@ function CheckboxGroup({
215
212
  onItemCheck={handleItemCheck}
216
213
  onItemUncheck={handleItemUncheck}
217
214
  >
218
- <RovingFocusGroup.Root
219
- asChild
220
- {...rovingFocusGroupScope}
221
- dir={direction}
222
- loop={loop}
223
- orientation={orientation}
224
- >
215
+ <RovingFocus.Root asChild {...rovingFocusGroupScope} dir={direction} loop={loop} orientation={orientation}>
225
216
  <div data-disabled={disabled ? "" : undefined} dir={direction} role="group" {...props} />
226
- </RovingFocusGroup.Root>
217
+ </RovingFocus.Root>
227
218
  </CheckboxGroupContextProvider>
228
219
  );
229
220
  }
@@ -274,12 +265,12 @@ function CheckboxGroupItem({
274
265
  const isDisabled = context.disabled || disabled;
275
266
 
276
267
  /**
277
- * Scope for the RovingFocusGroup component
268
+ * Context.Scope for the RovingFocusGroup component
278
269
  */
279
270
  const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);
280
271
 
281
272
  /**
282
- * Scope for the Checkbox component
273
+ * Context.Scope for the Checkbox component
283
274
  */
284
275
  const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);
285
276
 
@@ -289,12 +280,7 @@ function CheckboxGroupItem({
289
280
  const checked = context.value?.includes(props.value);
290
281
 
291
282
  return (
292
- <RovingFocusGroup.Item
293
- asChild
294
- {...rovingFocusGroupScope}
295
- active={checked}
296
- focusable={!isDisabled}
297
- >
283
+ <RovingFocus.Item asChild {...rovingFocusGroupScope} active={checked} focusable={!isDisabled}>
298
284
  <CheckboxPrimitive.Root
299
285
  aria-label={props.value}
300
286
  checked={checked}
@@ -311,7 +297,7 @@ function CheckboxGroupItem({
311
297
  }
312
298
  }}
313
299
  />
314
- </RovingFocusGroup.Item>
300
+ </RovingFocus.Item>
315
301
  );
316
302
  }
317
303
 
@@ -336,7 +322,7 @@ function CheckboxGroupIndicator({
336
322
  ...props
337
323
  }: ScopedProps<CheckboxGroupIndicatorProps>): JSX.Element {
338
324
  /**
339
- * Scope for the Checkbox component
325
+ * Context.Scope for the Checkbox component
340
326
  */
341
327
  const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);
342
328