@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
@@ -1,15 +1,14 @@
1
- "use client";
2
1
  import { cn } from "../lib/utils.mjs";
3
- import { buttonVariants } from "../variants/button.mjs";
2
+ import { Button } from "./button.mjs";
4
3
  import { XIcon } from "lucide-react";
4
+ import { Dialog as Dialog$1 } from "radix-ui";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import * as DialogPrimitive from "@radix-ui/react-dialog";
7
6
  //#region src/components/dialog.tsx
8
7
  /**
9
8
  * @since 0.3.16-canary.0
10
9
  */
11
10
  function Dialog({ ...props }) {
12
- return /* @__PURE__ */ jsx(DialogPrimitive.Root, {
11
+ return /* @__PURE__ */ jsx(Dialog$1.Root, {
13
12
  "data-slot": "dialog",
14
13
  ...props
15
14
  });
@@ -18,7 +17,7 @@ function Dialog({ ...props }) {
18
17
  * @since 0.3.16-canary.0
19
18
  */
20
19
  function DialogTrigger({ ...props }) {
21
- return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
20
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
22
21
  "data-slot": "dialog-trigger",
23
22
  ...props
24
23
  });
@@ -26,38 +25,38 @@ function DialogTrigger({ ...props }) {
26
25
  /**
27
26
  * @since 0.3.16-canary.0
28
27
  */
29
- function DialogContent({ children, className, classNames, ...props }) {
30
- return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [/* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
31
- className: cn("fixed inset-0 z-50", "bg-black/40 backdrop-blur-sm", "ease-gentle data-open:animate-in data-open:duration-300 data-open:fade-in-0", "data-closed:animate-out data-closed:duration-200 data-closed:fade-out-0", "motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0", classNames?.overlay),
32
- "data-slot": "dialog-overlay"
33
- }), /* @__PURE__ */ jsx(DialogPrimitive.Content, {
34
- className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto] justify-items-center overflow-auto", "sm:grid-rows-[1fr_auto_3fr] sm:p-4", "ease-gentle data-open:animate-in data-open:duration-300", "max-sm:data-open:animation-duration-380 max-sm:data-open:slide-in-from-bottom", "sm:data-open:fade-in-0 sm:data-open:zoom-in-95", "data-closed:animate-out data-closed:duration-200", "max-sm:data-closed:animation-duration-280 max-sm:data-closed:slide-out-to-bottom", "sm:data-closed:fade-out-0 sm:data-closed:zoom-out-95", "motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0", classNames?.wrapper),
35
- "data-slot": "dialog-content-wrapper",
36
- ...props,
37
- children: /* @__PURE__ */ jsxs("div", {
38
- className: cn("relative row-start-2 flex w-full flex-col", "rounded-t-2xl border", "bg-popover text-popover-foreground shadow-lg", "sm:max-w-lg sm:rounded-2xl", classNames?.content, className),
28
+ function DialogContent({ children, className, showCloseButton = true, ...props }) {
29
+ return /* @__PURE__ */ jsxs(Dialog$1.Portal, {
30
+ "data-slot": "dialog-portal",
31
+ children: [/* @__PURE__ */ jsx(Dialog$1.Overlay, {
32
+ className: "fixed inset-0 isolate 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",
33
+ "data-slot": "dialog-overlay"
34
+ }), /* @__PURE__ */ jsxs(Dialog$1.Content, {
35
+ className: cn("fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-6 overflow-y-auto rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 ease-ui outline-none sm:max-w-md 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),
39
36
  "data-slot": "dialog-content",
40
- children: [children, /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
41
- className: buttonVariants({
42
- className: ["absolute top-2.5 right-2.5 size-7", classNames?.close],
43
- size: "icon",
44
- variant: "ghost"
45
- }),
37
+ ...props,
38
+ children: [children, showCloseButton ? /* @__PURE__ */ jsx(Dialog$1.Close, {
39
+ asChild: true,
46
40
  "data-slot": "dialog-close",
47
- children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
48
- className: "sr-only",
49
- children: "Close"
50
- })]
51
- })]
52
- })
53
- })] });
41
+ children: /* @__PURE__ */ jsxs(Button, {
42
+ className: "absolute top-4 right-4",
43
+ size: "icon-sm",
44
+ variant: "ghost",
45
+ children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
46
+ className: "sr-only",
47
+ children: "Close"
48
+ })]
49
+ })
50
+ }) : null]
51
+ })]
52
+ });
54
53
  }
55
54
  /**
56
55
  * @since 0.3.16-canary.0
57
56
  */
58
57
  function DialogHeader({ className, ...props }) {
59
- return /* @__PURE__ */ jsx("header", {
60
- className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-2 text-center", "sm:text-left", className),
58
+ return /* @__PURE__ */ jsx("div", {
59
+ className: cn("flex shrink-0 flex-col gap-2", className),
61
60
  "data-slot": "dialog-header",
62
61
  ...props
63
62
  });
@@ -66,8 +65,8 @@ function DialogHeader({ className, ...props }) {
66
65
  * @since 0.3.16-canary.0
67
66
  */
68
67
  function DialogBody({ className, ...props }) {
69
- return /* @__PURE__ */ jsx("main", {
70
- className: cn("overflow-auto", "px-6 py-2", className),
68
+ return /* @__PURE__ */ jsx("div", {
69
+ className: cn("-mx-6 min-h-0 flex-1 overflow-y-auto px-6", className),
71
70
  "data-slot": "dialog-body",
72
71
  ...props
73
72
  });
@@ -75,19 +74,26 @@ function DialogBody({ className, ...props }) {
75
74
  /**
76
75
  * @since 0.3.16-canary.0
77
76
  */
78
- function DialogFooter({ className, ...props }) {
79
- return /* @__PURE__ */ jsx("footer", {
80
- className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-6", "sm:flex-row sm:justify-end", className),
77
+ function DialogFooter({ children, className, showCloseButton = false, ...props }) {
78
+ return /* @__PURE__ */ jsxs("div", {
79
+ className: cn("flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
81
80
  "data-slot": "dialog-footer",
82
- ...props
81
+ ...props,
82
+ children: [children, showCloseButton ? /* @__PURE__ */ jsx(Dialog$1.Close, {
83
+ asChild: true,
84
+ children: /* @__PURE__ */ jsx(Button, {
85
+ variant: "outline",
86
+ children: "Close"
87
+ })
88
+ }) : null]
83
89
  });
84
90
  }
85
91
  /**
86
92
  * @since 0.3.16-canary.0
87
93
  */
88
94
  function DialogTitle({ className, ...props }) {
89
- return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
90
- className: cn("text-lg leading-none font-semibold tracking-tight", className),
95
+ return /* @__PURE__ */ jsx(Dialog$1.Title, {
96
+ className: cn("font-heading leading-none font-medium", className),
91
97
  "data-slot": "dialog-title",
92
98
  ...props
93
99
  });
@@ -96,8 +102,8 @@ function DialogTitle({ className, ...props }) {
96
102
  * @since 0.3.16-canary.0
97
103
  */
98
104
  function DialogDescription({ className, ...props }) {
99
- return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
100
- className: cn("text-sm text-muted-foreground", className),
105
+ return /* @__PURE__ */ jsx(Dialog$1.Description, {
106
+ className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
101
107
  "data-slot": "dialog-description",
102
108
  ...props
103
109
  });
@@ -105,13 +111,8 @@ function DialogDescription({ className, ...props }) {
105
111
  /**
106
112
  * @since 0.3.16-canary.0
107
113
  */
108
- function DialogClose({ className, size, variant, ...props }) {
109
- return /* @__PURE__ */ jsx(DialogPrimitive.Close, {
110
- className: buttonVariants({
111
- className,
112
- size,
113
- variant
114
- }),
114
+ function DialogClose({ ...props }) {
115
+ return /* @__PURE__ */ jsx(Dialog$1.Close, {
115
116
  "data-slot": "dialog-close",
116
117
  ...props
117
118
  });
@@ -0,0 +1,24 @@
1
+ import { Direction } from "radix-ui";
2
+ import { ComponentProps } from "react";
3
+
4
+ //#region src/components/direction.d.ts
5
+ /**
6
+ * @since 0.4.0-canary.4
7
+ */
8
+ type DirectionProviderProps = ComponentProps<typeof Direction.DirectionProvider> & {
9
+ direction?: ComponentProps<typeof Direction.DirectionProvider>["dir"];
10
+ };
11
+ /**
12
+ * @since 0.4.0-canary.4
13
+ */
14
+ declare function DirectionProvider({
15
+ dir,
16
+ direction,
17
+ children
18
+ }: DirectionProviderProps): import("react").JSX.Element;
19
+ /**
20
+ * @since 0.4.0-canary.4
21
+ */
22
+ declare const useDirection: typeof Direction.useDirection;
23
+ //#endregion
24
+ export { DirectionProvider, type DirectionProviderProps, useDirection };
@@ -0,0 +1,18 @@
1
+ import { Direction } from "radix-ui";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/direction.tsx
4
+ /**
5
+ * @since 0.4.0-canary.4
6
+ */
7
+ function DirectionProvider({ dir, direction, children }) {
8
+ return /* @__PURE__ */ jsx(Direction.DirectionProvider, {
9
+ dir: direction ?? dir,
10
+ children
11
+ });
12
+ }
13
+ /**
14
+ * @since 0.4.0-canary.4
15
+ */
16
+ const useDirection = Direction.useDirection;
17
+ //#endregion
18
+ export { DirectionProvider, useDirection };
@@ -28,20 +28,13 @@ declare function DrawerTrigger({
28
28
  /**
29
29
  * @since 0.3.16-canary.0
30
30
  */
31
- interface DrawerContentProps extends ComponentProps<typeof Drawer$1.Content> {
32
- classNames?: {
33
- content?: string;
34
- handle?: string;
35
- overlay?: string;
36
- };
37
- }
31
+ type DrawerContentProps = ComponentProps<typeof Drawer$1.Content>;
38
32
  /**
39
33
  * @since 0.3.16-canary.0
40
34
  */
41
35
  declare function DrawerContent({
42
36
  children,
43
37
  className,
44
- classNames,
45
38
  ...props
46
39
  }: DrawerContentProps): JSX.Element;
47
40
  /**
@@ -55,17 +48,6 @@ declare function DrawerHeader({
55
48
  className,
56
49
  ...props
57
50
  }: DrawerHeaderProps): JSX.Element;
58
- /**
59
- * @since 0.3.16-canary.0
60
- */
61
- type DrawerBodyProps = ComponentProps<"div">;
62
- /**
63
- * @since 0.3.16-canary.0
64
- */
65
- declare function DrawerBody({
66
- className,
67
- ...props
68
- }: DrawerBodyProps): JSX.Element;
69
51
  /**
70
52
  * @since 0.3.16-canary.0
71
53
  */
@@ -116,4 +98,4 @@ declare function DrawerClose({
116
98
  ...props
117
99
  }: DrawerCloseProps): JSX.Element;
118
100
  //#endregion
119
- export { Drawer, DrawerBody, type DrawerBodyProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };
101
+ export { Drawer, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  import { cn } from "../lib/utils.mjs";
3
2
  import { buttonVariants } from "../variants/button.mjs";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -26,23 +25,26 @@ function DrawerTrigger({ ...props }) {
26
25
  /**
27
26
  * @since 0.3.16-canary.0
28
27
  */
29
- function DrawerContent({ children, className, classNames, ...props }) {
30
- return /* @__PURE__ */ jsxs(Drawer$1.Portal, { children: [/* @__PURE__ */ jsx(Drawer$1.Overlay, {
31
- className: cn("fixed inset-0 z-50", "bg-black/50", classNames?.overlay),
32
- "data-slot": "drawer-overlay"
33
- }), /* @__PURE__ */ jsxs(Drawer$1.Content, {
34
- className: cn("group/drawer-content fixed z-50 flex h-auto flex-col", "bg-background", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-2xl", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-2xl", "data-[vaul-drawer-direction=left]:sm:max-w-sm", "data-[vaul-drawer-direction=right]:sm:max-w-sm", classNames?.content, className),
35
- "data-slot": "drawer-content",
36
- ...props,
37
- children: [/* @__PURE__ */ jsx("div", { className: cn("hidden", "mx-auto mt-4 h-1.5 w-12 shrink-0", "rounded-full", "bg-muted", "group-data-[vaul-drawer-direction=bottom]/drawer-content:block", classNames?.handle) }), children]
38
- })] });
28
+ function DrawerContent({ children, className, ...props }) {
29
+ return /* @__PURE__ */ jsxs(Drawer$1.Portal, {
30
+ "data-slot": "drawer-portal",
31
+ children: [/* @__PURE__ */ jsx(Drawer$1.Overlay, {
32
+ 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-panel-in data-open:fade-in-0 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-panel-out data-closed:fade-out-0",
33
+ "data-slot": "drawer-overlay"
34
+ }), /* @__PURE__ */ jsxs(Drawer$1.Content, {
35
+ className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", className),
36
+ "data-slot": "drawer-content",
37
+ ...props,
38
+ children: [/* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 hidden h-1.5 w-25 shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
39
+ })]
40
+ });
39
41
  }
40
42
  /**
41
43
  * @since 0.3.16-canary.0
42
44
  */
43
45
  function DrawerHeader({ className, ...props }) {
44
46
  return /* @__PURE__ */ jsx("div", {
45
- className: cn("flex flex-col gap-1.5", "p-4", className),
47
+ className: cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className),
46
48
  "data-slot": "drawer-header",
47
49
  ...props
48
50
  });
@@ -50,19 +52,9 @@ function DrawerHeader({ className, ...props }) {
50
52
  /**
51
53
  * @since 0.3.16-canary.0
52
54
  */
53
- function DrawerBody({ className, ...props }) {
54
- return /* @__PURE__ */ jsx("main", {
55
- className: cn("overflow-auto", "px-6 py-2", className),
56
- "data-slot": "drawer-body",
57
- ...props
58
- });
59
- }
60
- /**
61
- * @since 0.3.16-canary.0
62
- */
63
55
  function DrawerFooter({ className, ...props }) {
64
56
  return /* @__PURE__ */ jsx("div", {
65
- className: cn("flex flex-col gap-2", "mt-auto p-4", className),
57
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
66
58
  "data-slot": "drawer-footer",
67
59
  ...props
68
60
  });
@@ -72,7 +64,7 @@ function DrawerFooter({ className, ...props }) {
72
64
  */
73
65
  function DrawerTitle({ className, ...props }) {
74
66
  return /* @__PURE__ */ jsx(Drawer$1.Title, {
75
- className: cn("font-semibold text-foreground", className),
67
+ className: cn("font-heading font-medium text-foreground", className),
76
68
  "data-slot": "drawer-title",
77
69
  ...props
78
70
  });
@@ -102,4 +94,4 @@ function DrawerClose({ className, size, variant, ...props }) {
102
94
  });
103
95
  }
104
96
  //#endregion
105
- export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
97
+ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
@@ -1,11 +1,11 @@
1
+ import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
1
2
  import { ComponentProps, JSX } from "react";
2
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
3
 
4
4
  //#region src/components/dropdown-menu.d.ts
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
8
- type DropdownMenuProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
8
+ type DropdownMenuProps = ComponentProps<typeof DropdownMenu$1.Root>;
9
9
  /**
10
10
  * @since 0.3.16-canary.0
11
11
  */
@@ -15,7 +15,7 @@ declare function DropdownMenu({
15
15
  /**
16
16
  * @since 0.3.16-canary.0
17
17
  */
18
- type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
18
+ type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenu$1.Trigger>;
19
19
  /**
20
20
  * @since 0.3.16-canary.0
21
21
  */
@@ -25,7 +25,7 @@ declare function DropdownMenuTrigger({
25
25
  /**
26
26
  * @since 0.3.16-canary.0
27
27
  */
28
- type DropdownMenuGroupProps = ComponentProps<typeof DropdownMenuPrimitive.Group>;
28
+ type DropdownMenuGroupProps = ComponentProps<typeof DropdownMenu$1.Group>;
29
29
  /**
30
30
  * @since 0.3.16-canary.0
31
31
  */
@@ -35,7 +35,7 @@ declare function DropdownMenuGroup({
35
35
  /**
36
36
  * @since 0.3.16-canary.0
37
37
  */
38
- type DropdownMenuSubProps = ComponentProps<typeof DropdownMenuPrimitive.Sub>;
38
+ type DropdownMenuSubProps = ComponentProps<typeof DropdownMenu$1.Sub>;
39
39
  /**
40
40
  * @since 0.3.16-canary.0
41
41
  */
@@ -45,7 +45,7 @@ declare function DropdownMenuSub({
45
45
  /**
46
46
  * @since 0.3.16-canary.0
47
47
  */
48
- type DropdownMenuRadioGroupProps = ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;
48
+ type DropdownMenuRadioGroupProps = ComponentProps<typeof DropdownMenu$1.RadioGroup>;
49
49
  /**
50
50
  * @since 0.3.16-canary.0
51
51
  */
@@ -55,7 +55,7 @@ declare function DropdownMenuRadioGroup({
55
55
  /**
56
56
  * @since 0.3.16-canary.0
57
57
  */
58
- interface DropdownMenuSubTriggerProps extends ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> {
58
+ interface DropdownMenuSubTriggerProps extends ComponentProps<typeof DropdownMenu$1.SubTrigger> {
59
59
  inset?: boolean;
60
60
  }
61
61
  /**
@@ -70,7 +70,7 @@ declare function DropdownMenuSubTrigger({
70
70
  /**
71
71
  * @since 0.3.16-canary.0
72
72
  */
73
- type DropdownMenuSubContentProps = ComponentProps<typeof DropdownMenuPrimitive.SubContent>;
73
+ type DropdownMenuSubContentProps = ComponentProps<typeof DropdownMenu$1.SubContent>;
74
74
  /**
75
75
  * @since 0.3.16-canary.0
76
76
  */
@@ -81,11 +81,12 @@ declare function DropdownMenuSubContent({
81
81
  /**
82
82
  * @since 0.3.16-canary.0
83
83
  */
84
- type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content>;
84
+ type DropdownMenuContentProps = ComponentProps<typeof DropdownMenu$1.Content>;
85
85
  /**
86
86
  * @since 0.3.16-canary.0
87
87
  */
88
88
  declare function DropdownMenuContent({
89
+ align,
89
90
  className,
90
91
  sideOffset,
91
92
  ...props
@@ -93,7 +94,7 @@ declare function DropdownMenuContent({
93
94
  /**
94
95
  * @since 0.3.16-canary.0
95
96
  */
96
- interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenuPrimitive.Item> {
97
+ interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenu$1.Item> {
97
98
  inset?: boolean;
98
99
  variant?: "default" | "destructive";
99
100
  }
@@ -109,7 +110,9 @@ declare function DropdownMenuItem({
109
110
  /**
110
111
  * @since 0.3.16-canary.0
111
112
  */
112
- type DropdownMenuCheckboxItemProps = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
113
+ interface DropdownMenuCheckboxItemProps extends ComponentProps<typeof DropdownMenu$1.CheckboxItem> {
114
+ inset?: boolean;
115
+ }
113
116
  /**
114
117
  * @since 0.3.16-canary.0
115
118
  */
@@ -117,24 +120,28 @@ declare function DropdownMenuCheckboxItem({
117
120
  checked,
118
121
  children,
119
122
  className,
123
+ inset,
120
124
  ...props
121
125
  }: DropdownMenuCheckboxItemProps): JSX.Element;
122
126
  /**
123
127
  * @since 0.3.16-canary.0
124
128
  */
125
- type DropdownMenuRadioItemProps = ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;
129
+ interface DropdownMenuRadioItemProps extends ComponentProps<typeof DropdownMenu$1.RadioItem> {
130
+ inset?: boolean;
131
+ }
126
132
  /**
127
133
  * @since 0.3.16-canary.0
128
134
  */
129
135
  declare function DropdownMenuRadioItem({
130
136
  children,
131
137
  className,
138
+ inset,
132
139
  ...props
133
140
  }: DropdownMenuRadioItemProps): JSX.Element;
134
141
  /**
135
142
  * @since 0.3.16-canary.0
136
143
  */
137
- interface DropdownMenuLabelProps extends ComponentProps<typeof DropdownMenuPrimitive.Label> {
144
+ interface DropdownMenuLabelProps extends ComponentProps<typeof DropdownMenu$1.Label> {
138
145
  inset?: boolean;
139
146
  }
140
147
  /**
@@ -148,7 +155,7 @@ declare function DropdownMenuLabel({
148
155
  /**
149
156
  * @since 0.3.16-canary.0
150
157
  */
151
- type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenuPrimitive.Separator>;
158
+ type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenu$1.Separator>;
152
159
  /**
153
160
  * @since 0.3.16-canary.0
154
161
  */
@@ -170,7 +177,7 @@ declare function DropdownMenuShortcut({
170
177
  /**
171
178
  * @since 0.3.16-canary.0
172
179
  */
173
- type DropdownMenuArrowProps = ComponentProps<typeof DropdownMenuPrimitive.Arrow>;
180
+ type DropdownMenuArrowProps = ComponentProps<typeof DropdownMenu$1.Arrow>;
174
181
  /**
175
182
  * @since 0.3.16-canary.0
176
183
  */