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

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 +60 -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 +24 -11
  26. package/dist/components/chart.d.mts +8 -3
  27. package/dist/components/chart.mjs +21 -15
  28. package/dist/components/checkbox-cards.mjs +4 -4
  29. package/dist/components/checkbox-group.mjs +3 -4
  30. package/dist/components/checkbox.d.mts +2 -2
  31. package/dist/components/checkbox.mjs +6 -7
  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 +38 -56
  174. package/src/components/chart.tsx +41 -92
  175. package/src/components/checkbox-cards.tsx +10 -30
  176. package/src/components/checkbox-group.tsx +5 -28
  177. package/src/components/checkbox.tsx +5 -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 +36 -59
  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 +50 -0
  226. package/src/css/foundation/motion.css +36 -0
  227. package/src/css/foundation/source.css +3 -0
  228. package/src/css/foundation/tokens.css +71 -0
  229. package/src/css/foundation/variants.css +113 -0
  230. package/src/css/preset.css +5 -214
  231. package/src/css/style.css +1 -1
  232. package/src/hooks/use-animated-value.ts +1 -7
  233. package/src/hooks/use-copy-to-clipboard.ts +1 -6
  234. package/src/hooks/use-is-mobile.ts +0 -2
  235. package/src/hooks/use-media-query.ts +0 -2
  236. package/src/hooks/use-mutation-observer.ts +0 -3
  237. package/src/hooks/use-pagination.ts +0 -2
  238. package/src/index.ts +39 -80
  239. package/src/primitives/checkbox-group.tsx +25 -39
  240. package/src/primitives/input-number.tsx +17 -63
  241. package/src/primitives/input.tsx +8 -24
  242. package/src/primitives/progress-circle.tsx +13 -43
  243. package/src/variants/alert.ts +3 -14
  244. package/src/variants/badge.ts +8 -35
  245. package/src/variants/button-group.ts +5 -18
  246. package/src/variants/button.ts +21 -58
  247. package/src/variants/empty.ts +2 -11
  248. package/src/variants/field.ts +6 -19
  249. package/src/variants/input-group.ts +12 -64
  250. package/src/variants/input-number.ts +65 -0
  251. package/src/variants/item.ts +10 -32
  252. package/src/variants/navigation-menu.ts +1 -8
  253. package/src/variants/progress-circle.ts +1 -2
  254. package/src/variants/scroll-area.ts +3 -9
  255. package/src/variants/separator.ts +6 -7
  256. package/src/variants/sheet.ts +6 -39
  257. package/src/variants/sidebar.ts +7 -27
  258. package/src/variants/tabs.ts +34 -0
  259. package/src/variants/toggle.ts +9 -28
  260. /package/src/css/{amber.css → themes/amber.css} +0 -0
  261. /package/src/css/{blue.css → themes/blue.css} +0 -0
  262. /package/src/css/{cyan.css → themes/cyan.css} +0 -0
  263. /package/src/css/{emerald.css → themes/emerald.css} +0 -0
  264. /package/src/css/{fuchsia.css → themes/fuchsia.css} +0 -0
  265. /package/src/css/{gray.css → themes/gray.css} +0 -0
  266. /package/src/css/{green.css → themes/green.css} +0 -0
  267. /package/src/css/{indigo.css → themes/indigo.css} +0 -0
  268. /package/src/css/{lime.css → themes/lime.css} +0 -0
  269. /package/src/css/{neutral.css → themes/neutral.css} +0 -0
  270. /package/src/css/{orange.css → themes/orange.css} +0 -0
  271. /package/src/css/{pink.css → themes/pink.css} +0 -0
  272. /package/src/css/{purple.css → themes/purple.css} +0 -0
  273. /package/src/css/{red.css → themes/red.css} +0 -0
  274. /package/src/css/{rose.css → themes/rose.css} +0 -0
  275. /package/src/css/{sky.css → themes/sky.css} +0 -0
  276. /package/src/css/{slate.css → themes/slate.css} +0 -0
  277. /package/src/css/{stone.css → themes/stone.css} +0 -0
  278. /package/src/css/{teal.css → themes/teal.css} +0 -0
  279. /package/src/css/{violet.css → themes/violet.css} +0 -0
  280. /package/src/css/{yellow.css → themes/yellow.css} +0 -0
  281. /package/src/css/{zinc.css → themes/zinc.css} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # @codefast/ui
2
2
 
3
+ ## 0.4.0-canary.4
4
+
5
+ ### Minor Changes
6
+
7
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`8fdbf99`](https://github.com/codefastlabs/codefast/commit/8fdbf99e9b889e6937aca721a3f439cc25b6ea4b) Thanks [@thevuong](https://github.com/thevuong)! - Add `--ease-exit` motion token and apply asymmetric enter/exit easing across overlay, popup, accordion, and sidebar components, syncing dialog overlay durations with content.
8
+
9
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`377224b`](https://github.com/codefastlabs/codefast/commit/377224bc337ca15ee4cfcfc1ddd9667bfce96b04) Thanks [@thevuong](https://github.com/thevuong)! - Add semantic motion duration tokens (`menu`, `popup`, `overlay`, `panel`, `expand`) and retune component timings for snappier feedback — menus 150/100ms, popovers 200/120ms, dialogs 220/150ms, sheets and drawers 320/220ms, accordion 200/150ms.
10
+
11
+ ### Patch Changes
12
+
13
+ - [`6685ce3`](https://github.com/codefastlabs/codefast/commit/6685ce3db5042d0c1b90bda98d5d1517eeade1d2) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): update source file patterns in preset.css
14
+
15
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`eecb986`](https://github.com/codefastlabs/codefast/commit/eecb9862353b93f76a03a75015a3b7c4e0ba948d) Thanks [@thevuong](https://github.com/thevuong)! - chore(deps): update catalog dependencies — radix-ui 1.5.0, react-hook-form 7.78.0, TanStack Router/Start patches, hono 4.12.25, oxfmt 0.54 / oxlint 1.69, knip 6.16, turbo 2.9.17-canary.7 — and bump pnpm to 11.5.2
16
+
17
+ - [`451da65`](https://github.com/codefastlabs/codefast/commit/451da65cf5b55cf982b0cb72396d7e08cbeab4ec) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): remove "use client" directive from multiple components
18
+
19
+ - [`b4ac0df`](https://github.com/codefastlabs/codefast/commit/b4ac0df0ed6073915c5b3502af60bb65489bc1fc) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): replace @radix-ui/react-context with radix-ui package
20
+
21
+ - [`06ab079`](https://github.com/codefastlabs/codefast/commit/06ab079012d82e8bd37f47a9978a98c446b6b0c9) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): adjust border radius in input group styles
22
+
23
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`48c6661`](https://github.com/codefastlabs/codefast/commit/48c66618f88d4fa93c769e9ede2776f5c8075aa2) Thanks [@thevuong](https://github.com/thevuong)! - fix(ui): align ContextMenuSubTrigger spacing with ContextMenuItem so submenu trigger icons sit correctly
24
+
25
+ - [`c2e6f73`](https://github.com/codefastlabs/codefast/commit/c2e6f73d39912a9675f53233ce3464f76ad00b1b) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): streamline component styling and className usage
26
+
27
+ - [`801ac83`](https://github.com/codefastlabs/codefast/commit/801ac83659e00c84cf0d0dc4b1e2a632f7f26e20) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): enhance InputGroup component structure and styling
28
+
29
+ - [`dfcd7ef`](https://github.com/codefastlabs/codefast/commit/dfcd7ef01c224e5fa4f30b760daedda85b35dd55) Thanks [@thevuong](https://github.com/thevuong)! - feat(ui): enhance InputNumber component with new split variant and additional functionality
30
+
31
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`480292c`](https://github.com/codefastlabs/codefast/commit/480292c36615c682f58e88fdb3136781620b98c0) Thanks [@thevuong](https://github.com/thevuong)! - refactor(navigation-menu): pass the trigger `className` to `navigationMenuTriggerVariants` as a `ClassValue` array instead of pre-merging with `cn`, letting the variant resolver handle merging in one pass
32
+
33
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`391f4c7`](https://github.com/codefastlabs/codefast/commit/391f4c768a589eb47808ba8f1dcfe7c60ba2bfe5) Thanks [@thevuong](https://github.com/thevuong)! - Fix navigation menu viewport scale animation by replacing the invalid `origin-top-center` class with `origin-[top_center]`.
34
+
35
+ - [`2425b93`](https://github.com/codefastlabs/codefast/commit/2425b9310ee6bf62c7b74a85516808f7159bf152) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): update component styling for consistency and clarity
36
+
37
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`fa338d6`](https://github.com/codefastlabs/codefast/commit/fa338d61fbfafb94beaa4d05d93d01e2c005cc91) Thanks [@thevuong](https://github.com/thevuong)! - Normalize import statement order and package.json key order repo-wide via the new oxfmt `sortImports`/`sortPackageJson` settings — purely mechanical, no runtime behavior change.
38
+
39
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`68bc271`](https://github.com/codefastlabs/codefast/commit/68bc271a3f9864c68045ee495f510c19f3ac1c80) Thanks [@thevuong](https://github.com/thevuong)! - fix(ui): restore side-scoped slide animations on popover, hover-card, select, and tooltip
40
+
41
+ Reinstate ease-snappy easing with distinct open/close durations, scope slide-in
42
+ classes under data-open (and data-delayed-open for tooltip), and bring back
43
+ directional slide-out on close — matching the previously restored context menu,
44
+ dropdown menu, and menubar motion.
45
+
46
+ - [`2247289`](https://github.com/codefastlabs/codefast/commit/2247289ccc8c983a5cf8dd4689d185eab6f6adb3) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): enhance BreadcrumbSeparator component styling and props
47
+
48
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`b66cb9d`](https://github.com/codefastlabs/codefast/commit/b66cb9debecb933f84ab1b4c711a01430823b641) Thanks [@thevuong](https://github.com/thevuong)! - Scope overlay enter/exit timing with `animation-duration-*` utilities (no more implicit all-property transitions from `duration-*`), make the navigation menu viewport size transition explicit, and fix the input OTP caret blink speed so the intended 1s duration actually applies.
49
+
50
+ - [`0636d46`](https://github.com/codefastlabs/codefast/commit/0636d46e54366a690fb8b9a85bb3adafe3e73fbc) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): replace `react-day-picker` with `@daypicker/react`
51
+
52
+ - [`ae3240a`](https://github.com/codefastlabs/codefast/commit/ae3240a4a8f026aa4f5d04fd270022139fc77433) Thanks [@thevuong](https://github.com/thevuong)! - feat(ui): export DirectionProvider to propagate reading direction
53
+
54
+ - [`09c3782`](https://github.com/codefastlabs/codefast/commit/09c3782ad73a5d5d76e678d9d71ab22135cebd5a) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): simplify DirectionProvider and useDirection
55
+
56
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`95b0ec4`](https://github.com/codefastlabs/codefast/commit/95b0ec41b5223ee48aeb6d82213f6b6d5c5cdd1e) Thanks [@thevuong](https://github.com/thevuong)! - Tune dialog, alert-dialog, drawer, and sheet overlay animations with asymmetric open/close durations and gentle easing.
57
+
58
+ - [#495](https://github.com/codefastlabs/codefast/pull/495) [`c60a41f`](https://github.com/codefastlabs/codefast/commit/c60a41f28af1e51d29331c3716ec5023e41b617a) Thanks [@thevuong](https://github.com/thevuong)! - refactor(ui): drop redundant single-arg `cn(className)` in Breadcrumb, CalendarRoot, AlertDialogAction/Cancel, and SidebarTrigger — `className` already forwards through `...props`, so the extra destructure and wrapper added nothing
59
+
60
+ - Updated dependencies [[`fa338d6`](https://github.com/codefastlabs/codefast/commit/fa338d61fbfafb94beaa4d05d93d01e2c005cc91), [`b097689`](https://github.com/codefastlabs/codefast/commit/b0976892cae3433670837aee0872262d38be0f45), [`7a4f8c3`](https://github.com/codefastlabs/codefast/commit/7a4f8c3b487526a319c6808d1164ba1c8168e9b6)]:
61
+ - @codefast/tailwind-variants@0.4.0-canary.4
62
+
3
63
  ## 0.3.16-canary.3
4
64
 
5
65
  ### Patch Changes
package/README.md CHANGED
@@ -86,7 +86,7 @@ Import the palette and the preset **after** `tailwindcss` so Tailwind isn't dupl
86
86
  @import "tailwindcss";
87
87
 
88
88
  /* @codefast/ui tokens + preset */
89
- @import "@codefast/ui/css/slate.css";
89
+ @import "@codefast/ui/css/themes/slate.css";
90
90
  @import "@codefast/ui/css/preset.css";
91
91
  ```
92
92
 
@@ -110,7 +110,7 @@ Make sure your bundler can process CSS `@import` (Vite and Next.js do this out o
110
110
 
111
111
  ### Theme palettes
112
112
 
113
- Replace `slate.css` with any of the palettes below:
113
+ Replace `themes/slate.css` with any palette under `@codefast/ui/css/themes/`:
114
114
 
115
115
  ```
116
116
  amber · blue · cyan · emerald · fuchsia · gray · green · indigo · lime · neutral
@@ -134,7 +134,7 @@ Pair with [`@codefast/theme`](../theme/README.md) for SSR-safe theme management
134
134
  Override CSS custom properties after the imports:
135
135
 
136
136
  ```css
137
- @import "@codefast/ui/css/slate.css";
137
+ @import "@codefast/ui/css/themes/slate.css";
138
138
  @import "@codefast/ui/css/preset.css";
139
139
 
140
140
  :root {
@@ -258,7 +258,7 @@ All components are also re-exported from the root entry `@codefast/ui`.
258
258
  | `Alert` | `@codefast/ui/alert` | Inline status message. |
259
259
  | `Avatar` | `@codefast/ui/avatar` | User avatar with fallback. |
260
260
  | `Badge` | `@codefast/ui/badge` | Status pill. |
261
- | `Calendar` | `@codefast/ui/calendar` | Date picker (react-day-picker). |
261
+ | `Calendar` | `@codefast/ui/calendar` | Date picker (@daypicker/react). |
262
262
  | `Carousel` | `@codefast/ui/carousel` | Slider (embla-carousel). |
263
263
  | `Chart` | `@codefast/ui/chart` | Responsive charts (recharts). |
264
264
  | `Collapsible` | `@codefast/ui/collapsible` | Expand/collapse primitive. |
@@ -298,7 +298,9 @@ Low-level building blocks, used internally by the styled components, exposed for
298
298
  | `@codefast/ui/primitives/checkbox-group` | Controlled checkbox-group state machine. |
299
299
  | `@codefast/ui/primitives/progress-circle` | Math + a11y primitive for circular progress. |
300
300
  | `@codefast/ui/lib/utils` | `cn()` — classname merge helper used by every component. |
301
- | `@codefast/ui/css/*` | Palette + preset CSS files (see [Styling](#styling)). |
301
+ | `@codefast/ui/css/themes/*` | Theme palette CSS files (see [Styling](#styling)). |
302
+ | `@codefast/ui/css/preset.css` | Tailwind preset: variants, `cf-*` utilities, base layer. |
303
+ | `@codefast/ui/css/style.css` | Bundled Tailwind + default palette + preset. |
302
304
 
303
305
  ```tsx
304
306
  import { cn } from "@codefast/ui/lib/utils";
@@ -312,32 +314,32 @@ const classes = cn("rounded-md px-3 py-1", disabled && "opacity-50");
312
314
 
313
315
  If you ship TanStack Start behind **[Nitro](https://v3.nitro.build/)** and **Vite 8 (Rolldown)**, you may hit a server-side `TypeError` referencing `__extends` or `__toESM(...).default` during route loaders or SSR. It originates from CJS `tslib` usage inside overlay-related dependencies (Dialog, Sheet, Menu, …) that reach for `react-remove-scroll-bar` and friends.
314
316
 
315
- **Preferred fix** — make Nitro pick ESM entry points from those packages:
317
+ **Fix** — make Nitro resolve the ESM entry points of those packages via the `module` export condition. Pass it to the `nitro` plugin so the server build picks ESM over CJS:
316
318
 
317
319
  ```ts
318
320
  // vite.config.ts
319
321
  import { defineConfig } from "vite";
322
+ import { nitro } from "nitro/vite";
320
323
 
321
324
  export default defineConfig({
322
- nitro: {
323
- exportConditions: ["import", "module", "default"],
324
- },
325
- // plugins: [tanstackStart(), nitro(), …],
325
+ plugins: [
326
+ // tanstackStart(),
327
+ nitro({ exportConditions: ["module"] }),
328
+ ],
326
329
  });
327
330
  ```
328
331
 
329
- **Fallback** alias `tslib` to its ESM build:
332
+ Keep the client `resolve.conditions` aligned with the server so both sides resolve the same entry points — a mismatch can otherwise surface as a hydration warning:
330
333
 
331
334
  ```ts
332
335
  export default defineConfig({
333
336
  resolve: {
334
- alias: { tslib: "tslib/tslib.es6.mjs" },
337
+ conditions: ["module"],
335
338
  },
339
+ // …
336
340
  });
337
341
  ```
338
342
 
339
- > Don't use `nitro.alias` for the bare specifier `tslib`. In Nitro v3 that option is for unenv path overrides, not npm package names, and produces broken resolutions.
340
-
341
343
  ---
342
344
 
343
345
  ## Troubleshooting
@@ -347,7 +349,7 @@ export default defineConfig({
347
349
  | Components render unstyled | Make sure CSS imports run before the first component mounts (import from the app entry). |
348
350
  | Tailwind output is duplicated | Use the palette + `preset.css` import — don't also import `css/style.css` in the same app. |
349
351
  | Dark mode doesn't apply | Add the `dark` class to `<html>` (or any ancestor). See [Dark mode](#dark-mode). |
350
- | `Cannot destructure property '__extends'` in SSR | Set `nitro.exportConditions: ["import", "module", "default"]` (see above). |
352
+ | `Cannot destructure property '__extends'` in SSR | Pass `exportConditions: ["module"]` to the `nitro` plugin (see above). |
351
353
  | Missing font or radius after palette switch | Re-import the palette **before** `preset.css`. Preset depends on palette variables being defined. |
352
354
 
353
355
  ---
@@ -390,7 +392,16 @@ Adding a component:
390
392
  4. Add tests under `src/components/__tests__` (unit + `jest-axe` if interactive).
391
393
  5. Run `pnpm --filter @codefast/ui build` to verify `tsdown` picks up the new entry.
392
394
 
393
- CSS entry exports under `@codefast/ui/css/*` are sourced directly from `src/css/*`.
395
+ CSS exports under `@codefast/ui/css/*` map to `src/css/`:
396
+
397
+ ```
398
+ css/
399
+ ├── style.css # Tailwind + themes/neutral + preset
400
+ ├── preset.css # Aggregates foundation + utilities
401
+ ├── foundation/ # source, variants, tokens, motion, base
402
+ ├── utilities/ # shared + component utilities referenced in TSX
403
+ └── themes/ # amber.css … zinc.css
404
+ ```
394
405
 
395
406
  ---
396
407
 
@@ -1,22 +1,22 @@
1
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
2
- import { Slot } from "@radix-ui/react-slot";
1
+ import { Accordion as Accordion$1 } from "radix-ui";
3
2
  import { ComponentProps, JSX } from "react";
4
3
 
5
4
  //#region src/components/accordion.d.ts
6
5
  /**
7
6
  * @since 0.3.16-canary.0
8
7
  */
9
- type AccordionProps = ComponentProps<typeof AccordionPrimitive.Root>;
8
+ type AccordionProps = ComponentProps<typeof Accordion$1.Root>;
10
9
  /**
11
10
  * @since 0.3.16-canary.0
12
11
  */
13
12
  declare function Accordion({
13
+ className,
14
14
  ...props
15
15
  }: AccordionProps): JSX.Element;
16
16
  /**
17
17
  * @since 0.3.16-canary.0
18
18
  */
19
- type AccordionItemProps = ComponentProps<typeof AccordionPrimitive.Item>;
19
+ type AccordionItemProps = ComponentProps<typeof Accordion$1.Item>;
20
20
  /**
21
21
  * @since 0.3.16-canary.0
22
22
  */
@@ -27,22 +27,7 @@ declare function AccordionItem({
27
27
  /**
28
28
  * @since 0.3.16-canary.0
29
29
  */
30
- interface AccordionIconProps extends ComponentProps<typeof Slot> {
31
- asChild?: boolean;
32
- className?: string;
33
- }
34
- /**
35
- * @since 0.3.16-canary.0
36
- */
37
- declare function AccordionIcon({
38
- asChild,
39
- className,
40
- ...props
41
- }: AccordionIconProps): JSX.Element;
42
- /**
43
- * @since 0.3.16-canary.0
44
- */
45
- type AccordionTriggerProps = ComponentProps<typeof AccordionPrimitive.Trigger>;
30
+ type AccordionTriggerProps = ComponentProps<typeof Accordion$1.Trigger>;
46
31
  /**
47
32
  * @since 0.3.16-canary.0
48
33
  */
@@ -54,7 +39,7 @@ declare function AccordionTrigger({
54
39
  /**
55
40
  * @since 0.3.16-canary.0
56
41
  */
57
- type AccordionContentProps = ComponentProps<typeof AccordionPrimitive.Content>;
42
+ type AccordionContentProps = ComponentProps<typeof Accordion$1.Content>;
58
43
  /**
59
44
  * @since 0.3.16-canary.0
60
45
  */
@@ -64,4 +49,4 @@ declare function AccordionContent({
64
49
  ...props
65
50
  }: AccordionContentProps): JSX.Element;
66
51
  //#endregion
67
- export { Accordion, AccordionContent, type AccordionContentProps, AccordionIcon, type AccordionIconProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
52
+ export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps };
@@ -1,15 +1,14 @@
1
- "use client";
2
1
  import { cn } from "../lib/utils.mjs";
3
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
4
- import { Slot } from "@radix-ui/react-slot";
5
- import { ChevronDownIcon } from "lucide-react";
6
- import { jsx } from "react/jsx-runtime";
2
+ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
3
+ import { Accordion as Accordion$1 } from "radix-ui";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
7
5
  //#region src/components/accordion.tsx
8
6
  /**
9
7
  * @since 0.3.16-canary.0
10
8
  */
11
- function Accordion({ ...props }) {
12
- return /* @__PURE__ */ jsx(AccordionPrimitive.Root, {
9
+ function Accordion({ className, ...props }) {
10
+ return /* @__PURE__ */ jsx(Accordion$1.Root, {
11
+ className: cn("flex w-full flex-col", className),
13
12
  "data-slot": "accordion",
14
13
  ...props
15
14
  });
@@ -18,8 +17,8 @@ function Accordion({ ...props }) {
18
17
  * @since 0.3.16-canary.0
19
18
  */
20
19
  function AccordionItem({ className, ...props }) {
21
- return /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
22
- className: cn("border-b", "last:border-b-0", className),
20
+ return /* @__PURE__ */ jsx(Accordion$1.Item, {
21
+ className: cn("not-last:border-b", className),
23
22
  "data-slot": "accordion-item",
24
23
  ...props
25
24
  });
@@ -27,26 +26,24 @@ function AccordionItem({ className, ...props }) {
27
26
  /**
28
27
  * @since 0.3.16-canary.0
29
28
  */
30
- function AccordionIcon({ asChild, className, ...props }) {
31
- return /* @__PURE__ */ jsx(asChild ? Slot : ChevronDownIcon, {
32
- "aria-hidden": true,
33
- className: cn("size-4 shrink-0 text-muted-foreground", "translate-y-0.5 transition-transform duration-300 ease-spring", "motion-reduce:transition-none motion-reduce:duration-0", className),
34
- "data-slot": "accordion-icon",
35
- ...props
36
- });
37
- }
38
- /**
39
- * @since 0.3.16-canary.0
40
- */
41
29
  function AccordionTrigger({ children, className, ...props }) {
42
- return /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
30
+ return /* @__PURE__ */ jsx(Accordion$1.Header, {
43
31
  className: "flex",
44
- "data-slot": "accordion-trigger-wrapper",
45
- children: /* @__PURE__ */ jsx(AccordionPrimitive.Trigger, {
46
- className: cn("group/accordion-trigger flex grow items-start justify-between gap-4 py-4", "rounded-md outline-hidden", "text-left text-sm font-medium", "hover:not-disabled:underline", "focus-visible:ring-3 focus-visible:ring-ring/50", "disabled:opacity-50", "[&[data-state=open]>svg]:rotate-180", className),
32
+ children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
33
+ className: cn("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground", className),
47
34
  "data-slot": "accordion-trigger",
48
35
  ...props,
49
- children
36
+ children: [
37
+ children,
38
+ /* @__PURE__ */ jsx(ChevronDownIcon, {
39
+ className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden",
40
+ "data-slot": "accordion-trigger-icon"
41
+ }),
42
+ /* @__PURE__ */ jsx(ChevronUpIcon, {
43
+ className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline",
44
+ "data-slot": "accordion-trigger-icon"
45
+ })
46
+ ]
50
47
  })
51
48
  });
52
49
  }
@@ -54,15 +51,15 @@ function AccordionTrigger({ children, className, ...props }) {
54
51
  * @since 0.3.16-canary.0
55
52
  */
56
53
  function AccordionContent({ children, className, ...props }) {
57
- return /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
58
- className: cn("overflow-hidden", "data-open:animate-collapsible-down data-open:ease-snappy", "data-closed:animate-collapsible-up data-closed:ease-snappy", "motion-reduce:animate-none motion-reduce:transition-none"),
54
+ return /* @__PURE__ */ jsx(Accordion$1.Content, {
55
+ className: "overflow-hidden text-sm ease-snappy data-open:animate-accordion-down data-open:animation-duration-expand-in data-closed:animate-accordion-up data-closed:ease-exit data-closed:animation-duration-expand-out",
59
56
  "data-slot": "accordion-content",
60
57
  ...props,
61
58
  children: /* @__PURE__ */ jsx("div", {
62
- className: cn("pt-0 pb-4", "text-sm", className),
59
+ className: cn("h-(--radix-accordion-content-height) pt-0 pb-4 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", className),
63
60
  children
64
61
  })
65
62
  });
66
63
  }
67
64
  //#endregion
68
- export { Accordion, AccordionContent, AccordionIcon, AccordionItem, AccordionTrigger };
65
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
@@ -1,13 +1,12 @@
1
- import { VariantProps } from "../lib/utils.mjs";
2
- import { buttonVariants } from "../variants/button.mjs";
3
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
1
+ import { ButtonProps } from "./button.mjs";
2
+ import { AlertDialog as AlertDialog$1 } from "radix-ui";
4
3
  import { ComponentProps, JSX } from "react";
5
4
 
6
5
  //#region src/components/alert-dialog.d.ts
7
6
  /**
8
7
  * @since 0.3.16-canary.0
9
8
  */
10
- type AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root>;
9
+ type AlertDialogProps = ComponentProps<typeof AlertDialog$1.Root>;
11
10
  /**
12
11
  * @since 0.3.16-canary.0
13
12
  */
@@ -17,7 +16,7 @@ declare function AlertDialog({
17
16
  /**
18
17
  * @since 0.3.16-canary.0
19
18
  */
20
- type AlertDialogTriggerProps = ComponentProps<typeof AlertDialogPrimitive.Trigger>;
19
+ type AlertDialogTriggerProps = ComponentProps<typeof AlertDialog$1.Trigger>;
21
20
  /**
22
21
  * @since 0.3.16-canary.0
23
22
  */
@@ -27,20 +26,15 @@ declare function AlertDialogTrigger({
27
26
  /**
28
27
  * @since 0.3.16-canary.0
29
28
  */
30
- interface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimitive.Content> {
31
- classNames?: {
32
- content?: string;
33
- overlay?: string;
34
- wrapper?: string;
35
- };
29
+ interface AlertDialogContentProps extends ComponentProps<typeof AlertDialog$1.Content> {
30
+ size?: "default" | "sm";
36
31
  }
37
32
  /**
38
33
  * @since 0.3.16-canary.0
39
34
  */
40
35
  declare function AlertDialogContent({
41
- children,
42
36
  className,
43
- classNames,
37
+ size,
44
38
  ...props
45
39
  }: AlertDialogContentProps): JSX.Element;
46
40
  /**
@@ -57,6 +51,21 @@ declare function AlertDialogHeader({
57
51
  /**
58
52
  * @since 0.3.16-canary.0
59
53
  */
54
+ type AlertDialogMediaProps = ComponentProps<"div">;
55
+ /**
56
+ * @since 0.3.16-canary.0
57
+ */
58
+ declare function AlertDialogMedia({
59
+ className,
60
+ ...props
61
+ }: AlertDialogMediaProps): JSX.Element;
62
+ /**
63
+ * Optional scrollable region for long content. When used, the Header and Footer
64
+ * stay pinned (shrink-0) and only this body scrolls; without it, the whole
65
+ * Content scrolls via its own max-height. A codefast enhancement over radix-vega.
66
+ *
67
+ * @since 0.3.16-canary.0
68
+ */
60
69
  type AlertDialogBodyProps = ComponentProps<"div">;
61
70
  /**
62
71
  * @since 0.3.16-canary.0
@@ -79,7 +88,7 @@ declare function AlertDialogFooter({
79
88
  /**
80
89
  * @since 0.3.16-canary.0
81
90
  */
82
- type AlertDialogTitleProps = ComponentProps<typeof AlertDialogPrimitive.Title>;
91
+ type AlertDialogTitleProps = ComponentProps<typeof AlertDialog$1.Title>;
83
92
  /**
84
93
  * @since 0.3.16-canary.0
85
94
  */
@@ -90,7 +99,7 @@ declare function AlertDialogTitle({
90
99
  /**
91
100
  * @since 0.3.16-canary.0
92
101
  */
93
- type AlertDialogDescriptionProps = ComponentProps<typeof AlertDialogPrimitive.Description>;
102
+ type AlertDialogDescriptionProps = ComponentProps<typeof AlertDialog$1.Description>;
94
103
  /**
95
104
  * @since 0.3.16-canary.0
96
105
  */
@@ -101,15 +110,11 @@ declare function AlertDialogDescription({
101
110
  /**
102
111
  * @since 0.3.16-canary.0
103
112
  */
104
- interface AlertDialogActionProps extends ComponentProps<typeof AlertDialogPrimitive.Action> {
105
- size?: VariantProps<typeof buttonVariants>["size"];
106
- variant?: VariantProps<typeof buttonVariants>["variant"];
107
- }
113
+ interface AlertDialogActionProps extends ComponentProps<typeof AlertDialog$1.Action>, Pick<ButtonProps, "size" | "variant"> {}
108
114
  /**
109
115
  * @since 0.3.16-canary.0
110
116
  */
111
117
  declare function AlertDialogAction({
112
- className,
113
118
  size,
114
119
  variant,
115
120
  ...props
@@ -117,18 +122,14 @@ declare function AlertDialogAction({
117
122
  /**
118
123
  * @since 0.3.16-canary.0
119
124
  */
120
- interface AlertDialogCancelProps extends ComponentProps<typeof AlertDialogPrimitive.Cancel> {
121
- size?: VariantProps<typeof buttonVariants>["size"];
122
- variant?: VariantProps<typeof buttonVariants>["variant"];
123
- }
125
+ interface AlertDialogCancelProps extends ComponentProps<typeof AlertDialog$1.Cancel>, Pick<ButtonProps, "size" | "variant"> {}
124
126
  /**
125
127
  * @since 0.3.16-canary.0
126
128
  */
127
129
  declare function AlertDialogCancel({
128
- className,
129
130
  size,
130
131
  variant,
131
132
  ...props
132
133
  }: AlertDialogCancelProps): JSX.Element;
133
134
  //#endregion
134
- export { AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogBody, type AlertDialogBodyProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps };
135
+ export { AlertDialog, AlertDialogAction, type AlertDialogActionProps, AlertDialogBody, type AlertDialogBodyProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogMedia, type AlertDialogMediaProps, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps };
@@ -1,14 +1,13 @@
1
- "use client";
2
1
  import { cn } from "../lib/utils.mjs";
3
- import { buttonVariants } from "../variants/button.mjs";
2
+ import { Button } from "./button.mjs";
3
+ import { AlertDialog as AlertDialog$1 } from "radix-ui";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
6
5
  //#region src/components/alert-dialog.tsx
7
6
  /**
8
7
  * @since 0.3.16-canary.0
9
8
  */
10
9
  function AlertDialog({ ...props }) {
11
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, {
10
+ return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
12
11
  "data-slot": "alert-dialog",
13
12
  ...props
14
13
  });
@@ -17,7 +16,7 @@ function AlertDialog({ ...props }) {
17
16
  * @since 0.3.16-canary.0
18
17
  */
19
18
  function AlertDialogTrigger({ ...props }) {
20
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, {
19
+ return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
21
20
  "data-slot": "alert-dialog-trigger",
22
21
  ...props
23
22
  });
@@ -25,27 +24,26 @@ function AlertDialogTrigger({ ...props }) {
25
24
  /**
26
25
  * @since 0.3.16-canary.0
27
26
  */
28
- function AlertDialogContent({ children, className, classNames, ...props }) {
29
- return /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { children: [/* @__PURE__ */ jsx(AlertDialogPrimitive.Overlay, {
30
- className: cn("fixed inset-0 z-50", "bg-black/50", "ease-ui data-open:animate-in data-open:fade-in-0", "data-closed:animate-out data-closed:fade-out-0", "motion-reduce:animate-none motion-reduce:transition-none", classNames?.overlay),
31
- "data-slot": "alert-dialog-overlay"
32
- }), /* @__PURE__ */ jsx(AlertDialogPrimitive.Content, {
33
- className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto_1fr] justify-items-center overflow-auto p-8", "sm:grid-rows-[1fr_auto_3fr] sm:p-4", "ease-ui data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none motion-reduce:transition-none", classNames?.wrapper),
34
- "data-slot": "alert-dialog-content-wrapper",
35
- ...props,
36
- children: /* @__PURE__ */ jsx("div", {
37
- className: cn("relative row-start-2 flex w-full max-w-lg flex-col", "rounded-2xl border", "bg-popover text-popover-foreground shadow-lg", classNames?.content, className),
27
+ function AlertDialogContent({ className, size = "default", ...props }) {
28
+ return /* @__PURE__ */ jsxs(AlertDialog$1.Portal, {
29
+ "data-slot": "alert-dialog-portal",
30
+ children: [/* @__PURE__ */ jsx(AlertDialog$1.Overlay, {
31
+ className: "fixed inset-0 z-50 bg-black/10 ease-gentle supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:animation-duration-overlay-in data-open:fade-in-0 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-overlay-out data-closed:fade-out-0",
32
+ "data-slot": "alert-dialog-overlay"
33
+ }), /* @__PURE__ */ jsx(AlertDialog$1.Content, {
34
+ className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-full -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-y-auto rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 ease-ui outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:animation-duration-overlay-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-overlay-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
35
+ "data-size": size,
38
36
  "data-slot": "alert-dialog-content",
39
- children
40
- })
41
- })] });
37
+ ...props
38
+ })]
39
+ });
42
40
  }
43
41
  /**
44
42
  * @since 0.3.16-canary.0
45
43
  */
46
44
  function AlertDialogHeader({ className, ...props }) {
47
45
  return /* @__PURE__ */ jsx("div", {
48
- className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center", "sm:text-left", className),
46
+ className: cn("grid shrink-0 grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className),
49
47
  "data-slot": "alert-dialog-header",
50
48
  ...props
51
49
  });
@@ -53,9 +51,19 @@ function AlertDialogHeader({ className, ...props }) {
53
51
  /**
54
52
  * @since 0.3.16-canary.0
55
53
  */
54
+ function AlertDialogMedia({ className, ...props }) {
55
+ return /* @__PURE__ */ jsx("div", {
56
+ className: cn("mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", className),
57
+ "data-slot": "alert-dialog-media",
58
+ ...props
59
+ });
60
+ }
61
+ /**
62
+ * @since 0.3.16-canary.0
63
+ */
56
64
  function AlertDialogBody({ className, ...props }) {
57
- return /* @__PURE__ */ jsx("main", {
58
- className: cn("overflow-auto", "px-6 py-2", className),
65
+ return /* @__PURE__ */ jsx("div", {
66
+ className: cn("-mx-6 min-h-0 flex-1 overflow-y-auto px-6", className),
59
67
  "data-slot": "alert-dialog-body",
60
68
  ...props
61
69
  });
@@ -65,7 +73,7 @@ function AlertDialogBody({ className, ...props }) {
65
73
  */
66
74
  function AlertDialogFooter({ className, ...props }) {
67
75
  return /* @__PURE__ */ jsx("div", {
68
- className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6", "sm:flex-row sm:justify-end", className),
76
+ className: cn("flex shrink-0 flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
69
77
  "data-slot": "alert-dialog-footer",
70
78
  ...props
71
79
  });
@@ -74,8 +82,8 @@ function AlertDialogFooter({ className, ...props }) {
74
82
  * @since 0.3.16-canary.0
75
83
  */
76
84
  function AlertDialogTitle({ className, ...props }) {
77
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, {
78
- className: cn("text-lg leading-none font-semibold tracking-tight", className),
85
+ return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
86
+ className: cn("font-heading text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
79
87
  "data-slot": "alert-dialog-title",
80
88
  ...props
81
89
  });
@@ -84,8 +92,8 @@ function AlertDialogTitle({ className, ...props }) {
84
92
  * @since 0.3.16-canary.0
85
93
  */
86
94
  function AlertDialogDescription({ className, ...props }) {
87
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, {
88
- className: cn("text-sm text-muted-foreground", className),
95
+ return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
96
+ className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
89
97
  "data-slot": "alert-dialog-description",
90
98
  ...props
91
99
  });
@@ -93,30 +101,30 @@ function AlertDialogDescription({ className, ...props }) {
93
101
  /**
94
102
  * @since 0.3.16-canary.0
95
103
  */
96
- function AlertDialogAction({ className, size, variant, ...props }) {
97
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, {
98
- className: buttonVariants({
99
- className,
100
- size,
101
- variant
102
- }),
103
- "data-slot": "alert-dialog-action",
104
- ...props
104
+ function AlertDialogAction({ size = "default", variant = "default", ...props }) {
105
+ return /* @__PURE__ */ jsx(Button, {
106
+ asChild: true,
107
+ size,
108
+ variant,
109
+ children: /* @__PURE__ */ jsx(AlertDialog$1.Action, {
110
+ "data-slot": "alert-dialog-action",
111
+ ...props
112
+ })
105
113
  });
106
114
  }
107
115
  /**
108
116
  * @since 0.3.16-canary.0
109
117
  */
110
- function AlertDialogCancel({ className, size, variant, ...props }) {
111
- return /* @__PURE__ */ jsx(AlertDialogPrimitive.Cancel, {
112
- className: buttonVariants({
113
- className,
114
- size,
115
- variant
116
- }),
117
- "data-slot": "alert-dialog-cancel",
118
- ...props
118
+ function AlertDialogCancel({ size = "default", variant = "outline", ...props }) {
119
+ return /* @__PURE__ */ jsx(Button, {
120
+ asChild: true,
121
+ size,
122
+ variant,
123
+ children: /* @__PURE__ */ jsx(AlertDialog$1.Cancel, {
124
+ "data-slot": "alert-dialog-cancel",
125
+ ...props
126
+ })
119
127
  });
120
128
  }
121
129
  //#endregion
122
- export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger };
130
+ export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogTitle, AlertDialogTrigger };