@codefast/ui 0.3.16-canary.2 → 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 (289) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +28 -17
  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 +14 -14
  8. package/dist/components/alert.mjs +17 -28
  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.d.mts +3 -15
  14. package/dist/components/badge.mjs +6 -48
  15. package/dist/components/breadcrumb.d.mts +1 -0
  16. package/dist/components/breadcrumb.mjs +11 -10
  17. package/dist/components/button-group.d.mts +3 -13
  18. package/dist/components/button-group.mjs +9 -31
  19. package/dist/components/button.d.mts +3 -26
  20. package/dist/components/button.mjs +9 -79
  21. package/dist/components/calendar.d.mts +6 -2
  22. package/dist/components/calendar.mjs +41 -44
  23. package/dist/components/card.d.mts +4 -2
  24. package/dist/components/card.mjs +9 -9
  25. package/dist/components/carousel.d.mts +16 -5
  26. package/dist/components/carousel.mjs +24 -11
  27. package/dist/components/chart.d.mts +9 -6
  28. package/dist/components/chart.mjs +21 -15
  29. package/dist/components/checkbox-cards.mjs +4 -4
  30. package/dist/components/checkbox-group.mjs +3 -4
  31. package/dist/components/checkbox.d.mts +2 -2
  32. package/dist/components/checkbox.mjs +6 -7
  33. package/dist/components/collapsible.d.mts +4 -4
  34. package/dist/components/collapsible.mjs +4 -5
  35. package/dist/components/command.d.mts +11 -1
  36. package/dist/components/command.mjs +35 -32
  37. package/dist/components/context-menu.d.mts +22 -15
  38. package/dist/components/context-menu.mjs +44 -39
  39. package/dist/components/dialog.d.mts +19 -23
  40. package/dist/components/dialog.mjs +48 -47
  41. package/dist/components/direction.d.mts +24 -0
  42. package/dist/components/direction.mjs +18 -0
  43. package/dist/components/drawer.d.mts +3 -21
  44. package/dist/components/drawer.mjs +19 -27
  45. package/dist/components/dropdown-menu.d.mts +22 -15
  46. package/dist/components/dropdown-menu.mjs +41 -37
  47. package/dist/components/empty.d.mts +3 -13
  48. package/dist/components/empty.mjs +8 -23
  49. package/dist/components/field.d.mts +3 -14
  50. package/dist/components/field.mjs +14 -44
  51. package/dist/components/form.d.mts +7 -10
  52. package/dist/components/form.mjs +6 -7
  53. package/dist/components/hover-card.d.mts +5 -5
  54. package/dist/components/hover-card.mjs +14 -12
  55. package/dist/components/input-group.d.mts +4 -31
  56. package/dist/components/input-group.mjs +14 -96
  57. package/dist/components/input-number.d.mts +3 -1
  58. package/dist/components/input-number.mjs +50 -28
  59. package/dist/components/input-otp.mjs +9 -7
  60. package/dist/components/input-password.mjs +1 -4
  61. package/dist/components/input-search.mjs +3 -5
  62. package/dist/components/input.mjs +1 -2
  63. package/dist/components/item.d.mts +4 -29
  64. package/dist/components/item.mjs +12 -65
  65. package/dist/components/kbd.mjs +1 -1
  66. package/dist/components/label.d.mts +2 -2
  67. package/dist/components/label.mjs +3 -4
  68. package/dist/components/menubar.d.mts +22 -16
  69. package/dist/components/menubar.mjs +54 -47
  70. package/dist/components/native-select.d.mts +5 -1
  71. package/dist/components/native-select.mjs +9 -6
  72. package/dist/components/navigation-menu.d.mts +30 -13
  73. package/dist/components/navigation-menu.mjs +35 -32
  74. package/dist/components/pagination.d.mts +7 -1
  75. package/dist/components/pagination.mjs +27 -12
  76. package/dist/components/popover.d.mts +40 -7
  77. package/dist/components/popover.mjs +46 -14
  78. package/dist/components/progress-circle.d.mts +3 -47
  79. package/dist/components/progress-circle.mjs +2 -48
  80. package/dist/components/progress.d.mts +2 -2
  81. package/dist/components/progress.mjs +5 -6
  82. package/dist/components/radio-cards.d.mts +3 -3
  83. package/dist/components/radio-cards.mjs +11 -11
  84. package/dist/components/radio-group.d.mts +3 -3
  85. package/dist/components/radio-group.mjs +9 -9
  86. package/dist/components/radio.mjs +2 -3
  87. package/dist/components/resizable.mjs +3 -8
  88. package/dist/components/scroll-area.d.mts +8 -24
  89. package/dist/components/scroll-area.mjs +16 -70
  90. package/dist/components/select.d.mts +14 -14
  91. package/dist/components/select.mjs +47 -47
  92. package/dist/components/separator.d.mts +4 -19
  93. package/dist/components/separator.mjs +6 -27
  94. package/dist/components/sheet.d.mts +18 -31
  95. package/dist/components/sheet.mjs +46 -87
  96. package/dist/components/sidebar.d.mts +3 -19
  97. package/dist/components/sidebar.mjs +48 -84
  98. package/dist/components/skeleton.mjs +1 -1
  99. package/dist/components/slider.d.mts +2 -2
  100. package/dist/components/slider.mjs +9 -11
  101. package/dist/components/sonner.mjs +11 -3
  102. package/dist/components/spinner.mjs +6 -7
  103. package/dist/components/switch.d.mts +5 -2
  104. package/dist/components/switch.mjs +7 -7
  105. package/dist/components/table.mjs +10 -10
  106. package/dist/components/tabs.d.mts +8 -5
  107. package/dist/components/tabs.mjs +18 -12
  108. package/dist/components/textarea.mjs +1 -1
  109. package/dist/components/toggle-group.d.mts +11 -7
  110. package/dist/components/toggle-group.mjs +20 -21
  111. package/dist/components/toggle.d.mts +4 -24
  112. package/dist/components/toggle.mjs +6 -45
  113. package/dist/components/tooltip.d.mts +7 -6
  114. package/dist/components/tooltip.mjs +19 -17
  115. package/dist/hooks/use-animated-value.mjs +0 -1
  116. package/dist/hooks/use-copy-to-clipboard.mjs +0 -1
  117. package/dist/hooks/use-is-mobile.mjs +0 -1
  118. package/dist/hooks/use-media-query.mjs +0 -1
  119. package/dist/hooks/use-mutation-observer.mjs +0 -1
  120. package/dist/hooks/use-pagination.mjs +0 -1
  121. package/dist/index.d.mts +38 -21
  122. package/dist/index.mjs +40 -23
  123. package/dist/lib/utils.d.mts +1 -12
  124. package/dist/lib/utils.mjs +1 -9
  125. package/dist/primitives/checkbox-group.d.mts +9 -11
  126. package/dist/primitives/checkbox-group.mjs +14 -19
  127. package/dist/primitives/input-number.d.mts +3 -4
  128. package/dist/primitives/input-number.mjs +3 -5
  129. package/dist/primitives/input.d.mts +4 -5
  130. package/dist/primitives/input.mjs +2 -3
  131. package/dist/primitives/progress-circle.d.mts +3 -4
  132. package/dist/primitives/progress-circle.mjs +2 -3
  133. package/dist/variants/alert.d.mts +18 -0
  134. package/dist/variants/alert.mjs +15 -0
  135. package/dist/variants/badge.d.mts +22 -0
  136. package/dist/variants/badge.mjs +19 -0
  137. package/dist/variants/button-group.d.mts +18 -0
  138. package/dist/variants/button-group.mjs +15 -0
  139. package/dist/variants/button.d.mts +32 -0
  140. package/dist/variants/button.mjs +34 -0
  141. package/dist/variants/empty.d.mts +18 -0
  142. package/dist/variants/empty.mjs +15 -0
  143. package/dist/variants/field.d.mts +19 -0
  144. package/dist/variants/field.mjs +16 -0
  145. package/dist/variants/input-group.d.mts +43 -0
  146. package/dist/variants/input-group.mjs +34 -0
  147. package/dist/variants/input-number.d.mts +45 -0
  148. package/dist/variants/input-number.mjs +40 -0
  149. package/dist/variants/item.d.mts +38 -0
  150. package/dist/variants/item.mjs +38 -0
  151. package/dist/variants/navigation-menu.d.mts +13 -0
  152. package/dist/variants/navigation-menu.mjs +8 -0
  153. package/dist/variants/progress-circle.d.mts +52 -0
  154. package/dist/variants/progress-circle.mjs +45 -0
  155. package/dist/variants/scroll-area.d.mts +24 -0
  156. package/dist/variants/scroll-area.mjs +58 -0
  157. package/dist/variants/separator.d.mts +23 -0
  158. package/dist/variants/separator.mjs +25 -0
  159. package/dist/variants/sheet.d.mts +20 -0
  160. package/dist/variants/sheet.mjs +17 -0
  161. package/dist/variants/sidebar.d.mts +23 -0
  162. package/dist/variants/sidebar.mjs +25 -0
  163. package/dist/variants/tabs.d.mts +18 -0
  164. package/dist/variants/tabs.mjs +15 -0
  165. package/dist/variants/toggle.d.mts +23 -0
  166. package/dist/variants/toggle.mjs +25 -0
  167. package/package.json +186 -55
  168. package/src/components/accordion.tsx +114 -0
  169. package/src/components/alert-dialog.tsx +298 -0
  170. package/src/components/alert.tsx +94 -0
  171. package/src/components/aspect-ratio.tsx +25 -0
  172. package/src/components/avatar.tsx +171 -0
  173. package/src/components/badge.tsx +35 -0
  174. package/src/components/breadcrumb.tsx +191 -0
  175. package/src/components/button-group.tsx +97 -0
  176. package/src/components/button.tsx +55 -0
  177. package/src/components/calendar.tsx +222 -0
  178. package/src/components/card.tsx +169 -0
  179. package/src/components/carousel.tsx +349 -0
  180. package/src/components/chart.tsx +536 -0
  181. package/src/components/checkbox-cards.tsx +72 -0
  182. package/src/components/checkbox-group.tsx +60 -0
  183. package/src/components/checkbox.tsx +44 -0
  184. package/src/components/collapsible.tsx +57 -0
  185. package/src/components/command.tsx +298 -0
  186. package/src/components/context-menu.tsx +410 -0
  187. package/src/components/dialog.tsx +243 -0
  188. package/src/components/direction.tsx +32 -0
  189. package/src/components/drawer.tsx +209 -0
  190. package/src/components/dropdown-menu.tsx +419 -0
  191. package/src/components/empty.tsx +155 -0
  192. package/src/components/field.tsx +329 -0
  193. package/src/components/form.tsx +258 -0
  194. package/src/components/hover-card.tsx +93 -0
  195. package/src/components/input-group.tsx +185 -0
  196. package/src/components/input-number.tsx +141 -0
  197. package/src/components/input-otp.tsx +132 -0
  198. package/src/components/input-password.tsx +50 -0
  199. package/src/components/input-search.tsx +81 -0
  200. package/src/components/input.tsx +36 -0
  201. package/src/components/item.tsx +266 -0
  202. package/src/components/kbd.tsx +47 -0
  203. package/src/components/label.tsx +36 -0
  204. package/src/components/menubar.tsx +440 -0
  205. package/src/components/native-select.tsx +87 -0
  206. package/src/components/navigation-menu.tsx +235 -0
  207. package/src/components/pagination.tsx +198 -0
  208. package/src/components/popover.tsx +170 -0
  209. package/src/components/progress-circle.tsx +185 -0
  210. package/src/components/progress.tsx +41 -0
  211. package/src/components/radio-cards.tsx +66 -0
  212. package/src/components/radio-group.tsx +59 -0
  213. package/src/components/radio.tsx +40 -0
  214. package/src/components/resizable.tsx +78 -0
  215. package/src/components/scroll-area.tsx +95 -0
  216. package/src/components/select.tsx +296 -0
  217. package/src/components/separator.tsx +60 -0
  218. package/src/components/sheet.tsx +241 -0
  219. package/src/components/sidebar.tsx +926 -0
  220. package/src/components/skeleton.tsx +35 -0
  221. package/src/components/slider.tsx +66 -0
  222. package/src/components/sonner.tsx +57 -0
  223. package/src/components/spinner.tsx +66 -0
  224. package/src/components/switch.tsx +44 -0
  225. package/src/components/table.tsx +183 -0
  226. package/src/components/tabs.tsx +110 -0
  227. package/src/components/textarea.tsx +35 -0
  228. package/src/components/toggle-group.tsx +137 -0
  229. package/src/components/toggle.tsx +30 -0
  230. package/src/components/tooltip.tsx +115 -0
  231. package/src/css/foundation/base.css +50 -0
  232. package/src/css/foundation/motion.css +36 -0
  233. package/src/css/foundation/source.css +3 -0
  234. package/src/css/foundation/tokens.css +71 -0
  235. package/src/css/foundation/variants.css +113 -0
  236. package/src/css/preset.css +5 -195
  237. package/src/css/style.css +1 -1
  238. package/src/css/{amber.css → themes/amber.css} +59 -22
  239. package/src/css/{blue.css → themes/blue.css} +59 -22
  240. package/src/css/{cyan.css → themes/cyan.css} +59 -22
  241. package/src/css/{emerald.css → themes/emerald.css} +59 -22
  242. package/src/css/{fuchsia.css → themes/fuchsia.css} +59 -22
  243. package/src/css/{gray.css → themes/gray.css} +59 -22
  244. package/src/css/{green.css → themes/green.css} +59 -22
  245. package/src/css/{indigo.css → themes/indigo.css} +59 -22
  246. package/src/css/{lime.css → themes/lime.css} +59 -22
  247. package/src/css/{neutral.css → themes/neutral.css} +59 -22
  248. package/src/css/{orange.css → themes/orange.css} +59 -22
  249. package/src/css/{pink.css → themes/pink.css} +59 -22
  250. package/src/css/{purple.css → themes/purple.css} +59 -22
  251. package/src/css/{red.css → themes/red.css} +59 -22
  252. package/src/css/{rose.css → themes/rose.css} +59 -22
  253. package/src/css/{sky.css → themes/sky.css} +59 -22
  254. package/src/css/{slate.css → themes/slate.css} +59 -22
  255. package/src/css/{stone.css → themes/stone.css} +59 -22
  256. package/src/css/{teal.css → themes/teal.css} +59 -22
  257. package/src/css/{violet.css → themes/violet.css} +59 -22
  258. package/src/css/{yellow.css → themes/yellow.css} +59 -22
  259. package/src/css/{zinc.css → themes/zinc.css} +59 -22
  260. package/src/hooks/use-animated-value.ts +91 -0
  261. package/src/hooks/use-copy-to-clipboard.ts +58 -0
  262. package/src/hooks/use-is-mobile.ts +25 -0
  263. package/src/hooks/use-media-query.ts +69 -0
  264. package/src/hooks/use-mutation-observer.ts +51 -0
  265. package/src/hooks/use-pagination.ts +164 -0
  266. package/src/index.ts +679 -0
  267. package/src/lib/utils.ts +5 -0
  268. package/src/primitives/checkbox-group.tsx +346 -0
  269. package/src/primitives/input-number.tsx +967 -0
  270. package/src/primitives/input.tsx +227 -0
  271. package/src/primitives/progress-circle.tsx +507 -0
  272. package/src/variants/alert.ts +34 -0
  273. package/src/variants/badge.ts +39 -0
  274. package/src/variants/button-group.ts +36 -0
  275. package/src/variants/button.ts +56 -0
  276. package/src/variants/empty.ts +34 -0
  277. package/src/variants/field.ts +37 -0
  278. package/src/variants/input-group.ts +80 -0
  279. package/src/variants/input-number.ts +65 -0
  280. package/src/variants/item.ts +68 -0
  281. package/src/variants/navigation-menu.ts +25 -0
  282. package/src/variants/progress-circle.ts +46 -0
  283. package/src/variants/scroll-area.ts +73 -0
  284. package/src/variants/separator.ts +40 -0
  285. package/src/variants/sheet.ts +37 -0
  286. package/src/variants/sidebar.ts +41 -0
  287. package/src/variants/tabs.ts +34 -0
  288. package/src/variants/toggle.ts +40 -0
  289. package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +0 -6
@@ -1,69 +1,24 @@
1
- "use client";
2
- import { cn, tv } from "../lib/utils.mjs";
3
- import { buttonVariants } from "./button.mjs";
1
+ import { cn } from "../lib/utils.mjs";
2
+ import { buttonVariants } from "../variants/button.mjs";
3
+ import { sheetContentVariants } from "../variants/sheet.mjs";
4
4
  import { XIcon } from "lucide-react";
5
+ import { Dialog } from "radix-ui";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import * as SheetPrimitive from "@radix-ui/react-dialog";
7
7
  //#region src/components/sheet.tsx
8
8
  /**
9
9
  * @since 0.3.16-canary.0
10
10
  */
11
- const sheetContentVariants = tv({
12
- base: [
13
- "fixed z-50 flex flex-col overflow-auto",
14
- "bg-background shadow-lg",
15
- "ease-ui data-open:animate-in data-open:animation-duration-500",
16
- "data-closed:animate-out data-closed:animation-duration-500"
17
- ],
18
- defaultVariants: { side: "right" },
19
- variants: { side: {
20
- bottom: [
21
- "max-h-[80vh]",
22
- "inset-x-0 bottom-0",
23
- "border-t",
24
- "data-open:slide-in-from-bottom",
25
- "data-closed:slide-out-to-bottom"
26
- ],
27
- left: [
28
- "h-full w-3/4",
29
- "inset-y-0 left-0",
30
- "border-r",
31
- "sm:max-w-sm",
32
- "data-open:slide-in-from-left",
33
- "data-closed:slide-out-to-left"
34
- ],
35
- right: [
36
- "h-full w-3/4",
37
- "inset-y-0 right-0",
38
- "border-l",
39
- "sm:max-w-sm",
40
- "data-open:slide-in-from-right",
41
- "data-closed:slide-out-to-right"
42
- ],
43
- top: [
44
- "max-h-[80vh]",
45
- "inset-x-0 top-0",
46
- "border-b",
47
- "data-open:slide-in-from-top",
48
- "data-closed:slide-out-to-top"
49
- ]
50
- } }
51
- });
52
- /**
53
- * @since 0.3.16-canary.0
54
- */
55
- function Sheet({ children, ...props }) {
56
- return /* @__PURE__ */ jsx(SheetPrimitive.Root, {
11
+ function Sheet({ ...props }) {
12
+ return /* @__PURE__ */ jsx(Dialog.Root, {
57
13
  "data-slot": "sheet",
58
- ...props,
59
- children
14
+ ...props
60
15
  });
61
16
  }
62
17
  /**
63
18
  * @since 0.3.16-canary.0
64
19
  */
65
20
  function SheetTrigger({ ...props }) {
66
- return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, {
21
+ return /* @__PURE__ */ jsx(Dialog.Trigger, {
67
22
  "data-slot": "sheet-trigger",
68
23
  ...props
69
24
  });
@@ -71,37 +26,41 @@ function SheetTrigger({ ...props }) {
71
26
  /**
72
27
  * @since 0.3.16-canary.0
73
28
  */
74
- function SheetContent({ children, className, classNames, side = "right", ...props }) {
75
- return /* @__PURE__ */ jsxs(SheetPrimitive.Portal, { children: [/* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
76
- className: cn("fixed inset-0 z-50", "bg-black/50", "ease-ui data-open:animate-in data-open:animation-duration-500 data-open:fade-in-0", "data-closed:animate-out data-closed:animation-duration-500 data-closed:fade-out-0", classNames?.overlay),
77
- "data-slot": "sheet-overlay"
78
- }), /* @__PURE__ */ jsxs(SheetPrimitive.Content, {
79
- className: sheetContentVariants({
80
- className: [classNames?.content, className],
81
- side
82
- }),
83
- "data-slot": "sheet-content",
84
- ...props,
85
- children: [children, /* @__PURE__ */ jsxs(SheetPrimitive.Close, {
86
- className: buttonVariants({
87
- className: ["absolute top-4 right-4 size-7", classNames?.close],
88
- size: "icon",
89
- variant: "ghost"
29
+ function SheetContent({ children, className, showCloseButton = true, side = "right", ...props }) {
30
+ return /* @__PURE__ */ jsxs(Dialog.Portal, {
31
+ "data-slot": "sheet-portal",
32
+ children: [/* @__PURE__ */ jsx(Dialog.Overlay, {
33
+ 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",
34
+ "data-slot": "sheet-overlay"
35
+ }), /* @__PURE__ */ jsxs(Dialog.Content, {
36
+ className: sheetContentVariants({
37
+ className,
38
+ side
90
39
  }),
91
- "data-slot": "sheet-close",
92
- children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
93
- className: "sr-only",
94
- children: "Close"
95
- })]
40
+ "data-side": side,
41
+ "data-slot": "sheet-content",
42
+ ...props,
43
+ children: [children, showCloseButton ? /* @__PURE__ */ jsxs(Dialog.Close, {
44
+ className: buttonVariants({
45
+ className: "absolute top-4 right-4",
46
+ size: "icon-sm",
47
+ variant: "ghost"
48
+ }),
49
+ "data-slot": "sheet-close",
50
+ children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
51
+ className: "sr-only",
52
+ children: "Close"
53
+ })]
54
+ }) : null]
96
55
  })]
97
- })] });
56
+ });
98
57
  }
99
58
  /**
100
59
  * @since 0.3.16-canary.0
101
60
  */
102
61
  function SheetHeader({ className, ...props }) {
103
- return /* @__PURE__ */ jsx("header", {
104
- className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center", "sm:text-left", className),
62
+ return /* @__PURE__ */ jsx("div", {
63
+ className: cn("flex shrink-0 flex-col gap-1.5 p-4", className),
105
64
  "data-slot": "sheet-header",
106
65
  ...props
107
66
  });
@@ -110,8 +69,8 @@ function SheetHeader({ className, ...props }) {
110
69
  * @since 0.3.16-canary.0
111
70
  */
112
71
  function SheetBody({ className, ...props }) {
113
- return /* @__PURE__ */ jsx("main", {
114
- className: cn("overflow-auto", "px-6 py-2", className),
72
+ return /* @__PURE__ */ jsx("div", {
73
+ className: cn("min-h-0 flex-1 overflow-y-auto px-4", className),
115
74
  "data-slot": "sheet-body",
116
75
  ...props
117
76
  });
@@ -120,8 +79,8 @@ function SheetBody({ className, ...props }) {
120
79
  * @since 0.3.16-canary.0
121
80
  */
122
81
  function SheetFooter({ className, ...props }) {
123
- return /* @__PURE__ */ jsx("footer", {
124
- className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6", "sm:flex-row sm:justify-end", className),
82
+ return /* @__PURE__ */ jsx("div", {
83
+ className: cn("mt-auto flex shrink-0 flex-col gap-2 p-4", className),
125
84
  "data-slot": "sheet-footer",
126
85
  ...props
127
86
  });
@@ -130,8 +89,8 @@ function SheetFooter({ className, ...props }) {
130
89
  * @since 0.3.16-canary.0
131
90
  */
132
91
  function SheetTitle({ className, ...props }) {
133
- return /* @__PURE__ */ jsx(SheetPrimitive.Title, {
134
- className: cn("text-lg font-semibold text-foreground", className),
92
+ return /* @__PURE__ */ jsx(Dialog.Title, {
93
+ className: cn("font-heading font-medium text-foreground", className),
135
94
  "data-slot": "sheet-title",
136
95
  ...props
137
96
  });
@@ -140,7 +99,7 @@ function SheetTitle({ className, ...props }) {
140
99
  * @since 0.3.16-canary.0
141
100
  */
142
101
  function SheetDescription({ className, ...props }) {
143
- return /* @__PURE__ */ jsx(SheetPrimitive.Description, {
102
+ return /* @__PURE__ */ jsx(Dialog.Description, {
144
103
  className: cn("text-sm text-muted-foreground", className),
145
104
  "data-slot": "sheet-description",
146
105
  ...props
@@ -149,8 +108,8 @@ function SheetDescription({ className, ...props }) {
149
108
  /**
150
109
  * @since 0.3.16-canary.0
151
110
  */
152
- function SheetClose({ className, size, variant = "outline", ...props }) {
153
- return /* @__PURE__ */ jsx(SheetPrimitive.Close, {
111
+ function SheetClose({ className, size, variant, ...props }) {
112
+ return /* @__PURE__ */ jsx(Dialog.Close, {
154
113
  className: buttonVariants({
155
114
  className,
156
115
  size,
@@ -161,4 +120,4 @@ function SheetClose({ className, size, variant = "outline", ...props }) {
161
120
  });
162
121
  }
163
122
  //#endregion
164
- export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, sheetContentVariants };
123
+ export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -1,26 +1,11 @@
1
- import { VariantProps } from "../lib/utils.mjs";
2
1
  import { Button } from "./button.mjs";
3
2
  import { Separator } from "./separator.mjs";
4
3
  import { Input } from "./input.mjs";
5
4
  import { TooltipContent } from "./tooltip.mjs";
6
- import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
5
+ import { SidebarMenuButtonVariants } from "../variants/sidebar.mjs";
7
6
  import { ComponentProps, Dispatch, JSX, SetStateAction } from "react";
8
7
 
9
8
  //#region src/components/sidebar.d.ts
10
- /**
11
- * @since 0.3.16-canary.0
12
- */
13
- declare const sidebarMenuButtonVariants: _$_codefast_tailwind_variants0.VariantResolver<{
14
- size: {
15
- sm: string[];
16
- md: string[];
17
- lg: string[];
18
- };
19
- variant: {
20
- default: string;
21
- outline: string[];
22
- };
23
- }, Record<string, never>>;
24
9
  interface SidebarContextValue {
25
10
  isMobile: boolean;
26
11
  open: boolean;
@@ -78,7 +63,6 @@ type SidebarTriggerProps = ComponentProps<typeof Button>;
78
63
  * @since 0.3.16-canary.0
79
64
  */
80
65
  declare function SidebarTrigger({
81
- className,
82
66
  onClick,
83
67
  ...props
84
68
  }: SidebarTriggerProps): JSX.Element;
@@ -234,7 +218,7 @@ declare function SidebarMenuItem({
234
218
  /**
235
219
  * @since 0.3.16-canary.0
236
220
  */
237
- interface SidebarMenuButtonProps extends ComponentProps<"button">, VariantProps<typeof sidebarMenuButtonVariants> {
221
+ interface SidebarMenuButtonProps extends ComponentProps<"button">, SidebarMenuButtonVariants {
238
222
  asChild?: boolean;
239
223
  isActive?: boolean;
240
224
  tooltip?: ComponentProps<typeof TooltipContent> | string;
@@ -333,4 +317,4 @@ declare function SidebarMenuSubButton({
333
317
  ...props
334
318
  }: SidebarMenuSubButtonProps): JSX.Element;
335
319
  //#endregion
336
- export { Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, type SidebarGroupContentProps, SidebarGroupLabel, type SidebarGroupLabelProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInput, type SidebarInputProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, type SidebarMenuBadgeProps, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarMenuSubItemProps, type SidebarMenuSubProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, type SidebarRailProps, SidebarSeparator, type SidebarSeparatorProps, SidebarTrigger, type SidebarTriggerProps, sidebarMenuButtonVariants, useSidebar };
320
+ export { Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, type SidebarGroupContentProps, SidebarGroupLabel, type SidebarGroupLabelProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInput, type SidebarInputProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, type SidebarMenuBadgeProps, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarMenuSubItemProps, type SidebarMenuSubProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, type SidebarRailProps, SidebarSeparator, type SidebarSeparatorProps, SidebarTrigger, type SidebarTriggerProps, useSidebar };
@@ -1,62 +1,25 @@
1
- "use client";
2
- import { cn, tv } from "../lib/utils.mjs";
1
+ import { cn } from "../lib/utils.mjs";
3
2
  import { Button } from "./button.mjs";
4
- import { Separator } from "./separator.mjs";
3
+ import { Separator as Separator$1 } from "./separator.mjs";
5
4
  import { Input } from "./input.mjs";
6
5
  import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.mjs";
7
6
  import { Skeleton } from "./skeleton.mjs";
8
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.mjs";
7
+ import { Tooltip as Tooltip$1, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.mjs";
9
8
  import { useIsMobile } from "../hooks/use-is-mobile.mjs";
10
- import { Slot } from "@radix-ui/react-slot";
9
+ import { sidebarMenuButtonVariants } from "../variants/sidebar.mjs";
11
10
  import { PanelLeftIcon } from "lucide-react";
11
+ import { Slot } from "radix-ui";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  import { useCallback, useEffect, useState } from "react";
14
- import { createContext } from "@radix-ui/react-context";
14
+ import { Context } from "radix-ui/internal";
15
15
  //#region src/components/sidebar.tsx
16
- /**
17
- * @since 0.3.16-canary.0
18
- */
19
- const sidebarMenuButtonVariants = tv({
20
- base: [
21
- "peer/menu-button flex w-full items-center gap-2 overflow-hidden p-2",
22
- "rounded-md ring-sidebar-ring outline-hidden",
23
- "text-left text-sm",
24
- "transition-[width,height,padding]",
25
- "group-has-data-[sidebar=menu-action]/menu-item:pr-8",
26
- "group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",
27
- "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
28
- "focus-visible:ring-3",
29
- "active:bg-sidebar-accent active:text-sidebar-accent-foreground",
30
- "disabled:pointer-events-none disabled:opacity-50",
31
- "aria-disabled:pointer-events-none aria-disabled:opacity-50",
32
- "data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground",
33
- "data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground",
34
- "[&>span:last-child]:truncate",
35
- "[&>svg]:size-4 [&>svg]:shrink-0"
36
- ],
37
- defaultVariants: {
38
- size: "md",
39
- variant: "default"
40
- },
41
- variants: {
42
- size: {
43
- sm: ["h-7", "text-xs"],
44
- md: ["h-8", "text-sm"],
45
- lg: ["h-12 text-sm", "group-data-[collapsible=icon]:p-0!"]
46
- },
47
- variant: {
48
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
49
- outline: ["bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))]", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"]
50
- }
51
- }
52
- });
53
16
  const SIDEBAR_COOKIE_NAME = "sidebar_state";
54
17
  const SIDEBAR_COOKIE_MAX_AGE = 3600 * 24 * 7;
55
18
  const SIDEBAR_WIDTH = "16rem";
56
19
  const SIDEBAR_WIDTH_MOBILE = "18rem";
57
20
  const SIDEBAR_WIDTH_ICON = "3.0625rem";
58
21
  const SIDEBAR_KEYBOARD_SHORTCUT = "b";
59
- const [SidebarContextProvider, useSidebar] = createContext("SidebarProvider");
22
+ const [SidebarContextProvider, useSidebar] = Context.createContext("SidebarProvider");
60
23
  /**
61
24
  * @since 0.3.16-canary.0
62
25
  */
@@ -98,7 +61,7 @@ function SidebarProvider({ children, className, defaultOpen = true, onOpenChange
98
61
  children: /* @__PURE__ */ jsx(TooltipProvider, {
99
62
  delayDuration: 0,
100
63
  children: /* @__PURE__ */ jsx("div", {
101
- className: cn("group/sidebar-wrapper flex min-h-svh w-full", "has-data-[variant=inset]:bg-sidebar", className),
64
+ className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
102
65
  "data-slot": "sidebar-wrapper",
103
66
  style: {
104
67
  "--sidebar-width": SIDEBAR_WIDTH,
@@ -118,7 +81,7 @@ const SIDEBAR_NAME = "Sidebar";
118
81
  function Sidebar({ children, className, collapsible = "offcanvas", side = "left", variant = "sidebar", ...props }) {
119
82
  const { isMobile, openMobile, setOpenMobile, state } = useSidebar(SIDEBAR_NAME);
120
83
  if (collapsible === "none") return /* @__PURE__ */ jsx("div", {
121
- className: cn("flex h-full w-(--sidebar-width) flex-col", "bg-sidebar text-sidebar-foreground", className),
84
+ className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
122
85
  "data-slot": "sidebar",
123
86
  ...props,
124
87
  children
@@ -128,7 +91,7 @@ function Sidebar({ children, className, collapsible = "offcanvas", side = "left"
128
91
  onOpenChange: setOpenMobile,
129
92
  ...props,
130
93
  children: /* @__PURE__ */ jsxs(SheetContent, {
131
- className: cn("w-(--sidebar-width) p-0", "bg-sidebar text-sidebar-foreground", "[&>button]:hidden"),
94
+ className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
132
95
  "data-mobile": "true",
133
96
  "data-sidebar": "sidebar",
134
97
  "data-slot": "sidebar",
@@ -144,21 +107,22 @@ function Sidebar({ children, className, collapsible = "offcanvas", side = "left"
144
107
  })
145
108
  });
146
109
  return /* @__PURE__ */ jsxs("div", {
147
- className: cn("group peer hidden", "text-sidebar-foreground", "md:block", className),
110
+ className: cn("group peer hidden text-sidebar-foreground md:block", className),
148
111
  "data-collapsible": state === "collapsed" ? collapsible : "",
149
112
  "data-side": side,
150
113
  "data-slot": "sidebar",
151
114
  "data-state": state,
152
115
  "data-variant": variant,
153
116
  children: [/* @__PURE__ */ jsx("div", {
154
- className: cn("relative", "w-(--sidebar-width)", "bg-transparent", "transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-side-right:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"),
117
+ className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-gentle group-data-[collapsible=offcanvas]:w-0 group-data-side-right:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"),
155
118
  "data-slot": "sidebar-gap"
156
119
  }), /* @__PURE__ */ jsx("div", {
157
- className: cn("fixed inset-y-0 z-10 hidden", "h-svh w-(--sidebar-width)", "transition-[left,right,width] duration-200 ease-linear", "md:flex", side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-side-right:border-l group-data-side-left:border-r", className),
120
+ className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-gentle md:flex data-side-right:right-0 data-side-right:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] data-side-left:left-0 data-side-left:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-side-right:border-l group-data-side-left:border-r", className),
121
+ "data-side": side,
158
122
  "data-slot": "sidebar-container",
159
123
  ...props,
160
124
  children: /* @__PURE__ */ jsx("div", {
161
- className: cn("flex h-full w-full flex-col", "bg-sidebar", "group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm"),
125
+ className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",
162
126
  "data-sidebar": "sidebar",
163
127
  "data-slot": "sidebar-inner",
164
128
  children
@@ -170,20 +134,19 @@ const SIDEBAR_TRIGGER_NAME = "SidebarTrigger";
170
134
  /**
171
135
  * @since 0.3.16-canary.0
172
136
  */
173
- function SidebarTrigger({ className, onClick, ...props }) {
137
+ function SidebarTrigger({ onClick, ...props }) {
174
138
  const { toggleSidebar } = useSidebar(SIDEBAR_TRIGGER_NAME);
175
139
  return /* @__PURE__ */ jsxs(Button, {
176
- className: cn("size-7", className),
177
140
  "data-sidebar": "trigger",
178
141
  "data-slot": "sidebar-trigger",
179
- size: "icon",
142
+ size: "icon-sm",
180
143
  variant: "ghost",
181
144
  onClick: (event) => {
182
145
  onClick?.(event);
183
146
  toggleSidebar();
184
147
  },
185
148
  ...props,
186
- children: [/* @__PURE__ */ jsx(PanelLeftIcon, {}), /* @__PURE__ */ jsx("span", {
149
+ children: [/* @__PURE__ */ jsx(PanelLeftIcon, { className: "rtl:rotate-180" }), /* @__PURE__ */ jsx("span", {
187
150
  className: "sr-only",
188
151
  children: "Toggle Sidebar"
189
152
  })]
@@ -196,7 +159,7 @@ const SIDEBAR_RAIL_NAME = "SidebarRail";
196
159
  function SidebarRail({ className, ...props }) {
197
160
  const { toggleSidebar } = useSidebar(SIDEBAR_RAIL_NAME);
198
161
  return /* @__PURE__ */ jsx("button", {
199
- className: cn("absolute inset-y-0 z-20 hidden", "w-4 -translate-x-1/2 transition-all ease-linear", "in-data-side-right:cursor-e-resize", "in-data-side-left:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0", "group-data-side-right:left-0", "group-data-side-left:-right-4", "after:absolute after:inset-y-0 after:left-1/2 after:w-0.5", "group-data-[collapsible=offcanvas]:after:left-full", "hover:group-data-[collapsible=offcanvas]:bg-sidebar", "hover:after:bg-sidebar-border", "sm:flex", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", "[[data-side=right][data-state=collapsed]_&]:cursor-w-resize", className),
162
+ className: cn("absolute inset-y-0 z-20 hidden w-4 transition-all ease-gentle group-data-[collapsible=offcanvas]:translate-x-0 group-data-side-right:left-0 group-data-side-left:-right-4 after:absolute after:inset-y-0 after:inset-s-1/2 after:w-0.5 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar hover:after:bg-sidebar-border in-data-side-right:cursor-e-resize in-data-side-left:cursor-w-resize sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2 [[data-side=left][data-collapsible=offcanvas]_&]:-right-2 [[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-collapsible=offcanvas]_&]:-left-2 [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", className),
200
163
  "data-sidebar": "rail",
201
164
  "data-slot": "sidebar-rail",
202
165
  title: "Toggle Sidebar",
@@ -210,7 +173,7 @@ function SidebarRail({ className, ...props }) {
210
173
  */
211
174
  function SidebarInset({ className, ...props }) {
212
175
  return /* @__PURE__ */ jsx("main", {
213
- className: cn("relative flex w-full min-w-0 flex-1 flex-col", "bg-background", "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm", "md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className),
176
+ className: cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-collapsed:ml-2", className),
214
177
  "data-slot": "sidebar-inset",
215
178
  ...props
216
179
  });
@@ -220,7 +183,7 @@ function SidebarInset({ className, ...props }) {
220
183
  */
221
184
  function SidebarInput({ className, ...props }) {
222
185
  return /* @__PURE__ */ jsx(Input, {
223
- className: cn("h-8 w-full", "bg-background shadow-none", className),
186
+ className: cn("h-8 w-full bg-background shadow-none", className),
224
187
  "data-sidebar": "input",
225
188
  "data-slot": "sidebar-input",
226
189
  ...props
@@ -231,7 +194,7 @@ function SidebarInput({ className, ...props }) {
231
194
  */
232
195
  function SidebarHeader({ className, ...props }) {
233
196
  return /* @__PURE__ */ jsx("div", {
234
- className: cn("flex flex-col gap-2", "p-2", className),
197
+ className: cn("flex flex-col gap-2 p-2", className),
235
198
  "data-sidebar": "header",
236
199
  "data-slot": "sidebar-header",
237
200
  ...props
@@ -242,7 +205,7 @@ function SidebarHeader({ className, ...props }) {
242
205
  */
243
206
  function SidebarFooter({ className, ...props }) {
244
207
  return /* @__PURE__ */ jsx("div", {
245
- className: cn("flex flex-col gap-2", "p-2", className),
208
+ className: cn("flex flex-col gap-2 p-2", className),
246
209
  "data-sidebar": "footer",
247
210
  "data-slot": "sidebar-footer",
248
211
  ...props
@@ -252,8 +215,8 @@ function SidebarFooter({ className, ...props }) {
252
215
  * @since 0.3.16-canary.0
253
216
  */
254
217
  function SidebarSeparator({ className, ...props }) {
255
- return /* @__PURE__ */ jsx(Separator, {
256
- className: cn("mx-2 w-auto", "bg-sidebar-border", className),
218
+ return /* @__PURE__ */ jsx(Separator$1, {
219
+ className: cn("mx-2 w-auto bg-sidebar-border", className),
257
220
  "data-sidebar": "separator",
258
221
  "data-slot": "sidebar-separator",
259
222
  ...props
@@ -264,7 +227,7 @@ function SidebarSeparator({ className, ...props }) {
264
227
  */
265
228
  function SidebarContent({ className, ...props }) {
266
229
  return /* @__PURE__ */ jsx("div", {
267
- className: cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto", "group-data-[collapsible=icon]:overflow-hidden", className),
230
+ className: cn("flex min-h-0 flex-1 scrollbar-none flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
268
231
  "data-sidebar": "content",
269
232
  "data-slot": "sidebar-content",
270
233
  ...props
@@ -275,7 +238,7 @@ function SidebarContent({ className, ...props }) {
275
238
  */
276
239
  function SidebarGroup({ className, ...props }) {
277
240
  return /* @__PURE__ */ jsx("div", {
278
- className: cn("relative flex w-full min-w-0 flex-col", "p-2", className),
241
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
279
242
  "data-sidebar": "group",
280
243
  "data-slot": "sidebar-group",
281
244
  ...props
@@ -285,8 +248,8 @@ function SidebarGroup({ className, ...props }) {
285
248
  * @since 0.3.16-canary.0
286
249
  */
287
250
  function SidebarGroupLabel({ asChild = false, className, ...props }) {
288
- return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
289
- className: cn("flex h-8 shrink-0 items-center px-2", "rounded-md ring-sidebar-ring outline-hidden", "truncate text-xs font-medium text-sidebar-foreground/70", "transition-[margin,opacity] duration-200 ease-linear", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", "focus-visible:ring-3", "[&>svg]:size-4 [&>svg]:shrink-0", className),
251
+ return /* @__PURE__ */ jsx(asChild ? Slot.Root : "div", {
252
+ className: cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-gentle group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", className),
290
253
  "data-sidebar": "group-label",
291
254
  "data-slot": "sidebar-group-label",
292
255
  ...props
@@ -296,8 +259,8 @@ function SidebarGroupLabel({ asChild = false, className, ...props }) {
296
259
  * @since 0.3.16-canary.0
297
260
  */
298
261
  function SidebarGroupAction({ asChild = false, className, ...props }) {
299
- return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
300
- className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center p-0", "rounded-md ring-sidebar-ring outline-hidden", "text-sidebar-foreground", "transition-transform", "group-data-[collapsible=icon]:hidden", "after:absolute after:-inset-2", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", "focus-visible:ring-3", "md:after:hidden", "[&>svg]:size-4 [&>svg]:shrink-0", className),
262
+ return /* @__PURE__ */ jsx(asChild ? Slot.Root : "button", {
263
+ className: cn("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", className),
301
264
  "data-sidebar": "group-action",
302
265
  "data-slot": "sidebar-group-action",
303
266
  ...props
@@ -308,7 +271,7 @@ function SidebarGroupAction({ asChild = false, className, ...props }) {
308
271
  */
309
272
  function SidebarGroupContent({ className, ...props }) {
310
273
  return /* @__PURE__ */ jsx("div", {
311
- className: cn("w-full", "text-sm", className),
274
+ className: cn("w-full text-sm", className),
312
275
  "data-sidebar": "group-content",
313
276
  "data-slot": "sidebar-group-content",
314
277
  ...props
@@ -340,14 +303,15 @@ const SIDEBAR_MENU_BUTTON_NAME = "SidebarMenuButton";
340
303
  /**
341
304
  * @since 0.3.16-canary.0
342
305
  */
343
- function SidebarMenuButton({ asChild = false, className, isActive = false, size = "md", tooltip, variant = "default", ...props }) {
344
- const Component = asChild ? Slot : "button";
306
+ function SidebarMenuButton({ asChild = false, className, isActive = false, size = "default", tooltip, variant = "default", ...props }) {
307
+ const Component = asChild ? Slot.Root : "button";
345
308
  const { isMobile, state } = useSidebar(SIDEBAR_MENU_BUTTON_NAME);
346
309
  const button = /* @__PURE__ */ jsx(Component, {
347
- className: cn(sidebarMenuButtonVariants({
310
+ className: sidebarMenuButtonVariants({
348
311
  size,
349
- variant
350
- }), className),
312
+ variant,
313
+ className
314
+ }),
351
315
  "data-active": isActive,
352
316
  "data-sidebar": "menu-button",
353
317
  "data-size": size,
@@ -356,7 +320,7 @@ function SidebarMenuButton({ asChild = false, className, isActive = false, size
356
320
  });
357
321
  if (!tooltip) return button;
358
322
  if (typeof tooltip === "string") tooltip = { children: tooltip };
359
- return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
323
+ return /* @__PURE__ */ jsxs(Tooltip$1, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
360
324
  asChild: true,
361
325
  children: button
362
326
  }), /* @__PURE__ */ jsx(TooltipContent, {
@@ -370,8 +334,8 @@ function SidebarMenuButton({ asChild = false, className, isActive = false, size
370
334
  * @since 0.3.16-canary.0
371
335
  */
372
336
  function SidebarMenuAction({ asChild = false, className, showOnHover = false, ...props }) {
373
- return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
374
- className: cn("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center p-0", "rounded-md ring-sidebar-ring outline-hidden", "text-sidebar-foreground", "transition-transform", "group-data-[collapsible=icon]:hidden", "peer-hover/menu-button:text-sidebar-accent-foreground", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "peer-data-[size=sm]/menu-button:top-1", "after:absolute after:-inset-2", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", "focus-visible:ring-3", "md:after:hidden", "[&>svg]:size-4 [&>svg]:shrink-0", showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground md:opacity-0 data-open:opacity-100", className),
337
+ return /* @__PURE__ */ jsx(asChild ? Slot.Root : "button", {
338
+ className: cn("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0", showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0", className),
375
339
  "data-sidebar": "menu-action",
376
340
  "data-slot": "sidebar-menu-action",
377
341
  ...props
@@ -382,7 +346,7 @@ function SidebarMenuAction({ asChild = false, className, showOnHover = false, ..
382
346
  */
383
347
  function SidebarMenuBadge({ className, ...props }) {
384
348
  return /* @__PURE__ */ jsx("div", {
385
- className: cn("absolute right-1 flex h-5 min-w-5 items-center justify-center px-1", "rounded-md", "text-xs font-medium text-sidebar-foreground tabular-nums", "pointer-events-none select-none", "group-data-[collapsible=icon]:hidden", "peer-hover/menu-button:text-sidebar-accent-foreground", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "peer-data-[size=sm]/menu-button:top-1", "peer-data-active/menu-button:text-sidebar-accent-foreground", className),
349
+ className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground", className),
386
350
  "data-sidebar": "menu-badge",
387
351
  "data-slot": "sidebar-menu-badge",
388
352
  ...props
@@ -394,12 +358,12 @@ function SidebarMenuBadge({ className, ...props }) {
394
358
  function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
395
359
  const [width] = useState(() => `${String(Math.floor(Math.random() * 40) + 50)}%`);
396
360
  return /* @__PURE__ */ jsxs("div", {
397
- className: cn("flex h-8 items-center gap-2 px-2", "rounded-md", className),
361
+ className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
398
362
  "data-sidebar": "menu-skeleton",
399
363
  "data-slot": "sidebar-menu-skeleton",
400
364
  ...props,
401
365
  children: [showIcon ? /* @__PURE__ */ jsx(Skeleton, {
402
- className: cn("size-4", "rounded-md"),
366
+ className: "size-4 rounded-md",
403
367
  "data-sidebar": "menu-skeleton-icon"
404
368
  }) : null, /* @__PURE__ */ jsx(Skeleton, {
405
369
  className: "h-4 max-w-(--skeleton-width) flex-1",
@@ -413,7 +377,7 @@ function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
413
377
  */
414
378
  function SidebarMenuSub({ className, ...props }) {
415
379
  return /* @__PURE__ */ jsx("ul", {
416
- className: cn("mx-3.5 flex min-w-0 flex-col gap-1 px-2.5 py-0.5", "border-l border-sidebar-border", "translate-x-px", "group-data-[collapsible=icon]:hidden", className),
380
+ className: cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden", className),
417
381
  "data-sidebar": "menu-sub",
418
382
  "data-slot": "sidebar-menu-sub",
419
383
  ...props
@@ -434,8 +398,8 @@ function SidebarMenuSubItem({ className, ...props }) {
434
398
  * @since 0.3.16-canary.0
435
399
  */
436
400
  function SidebarMenuSubButton({ asChild = false, className, isActive = false, size = "md", ...props }) {
437
- return /* @__PURE__ */ jsx(asChild ? Slot : "a", {
438
- className: cn("flex h-7 min-w-0 items-center gap-2 overflow-hidden px-2", "rounded-md ring-sidebar-ring outline-hidden", "text-sidebar-foreground", "-translate-x-px", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", "focus-visible:ring-3", "active:bg-sidebar-accent active:text-sidebar-accent-foreground", "disabled:pointer-events-none disabled:opacity-50", "aria-disabled:pointer-events-none aria-disabled:opacity-50", "data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground", "group-data-[collapsible=icon]:hidden", "[&>span:last-child]:truncate", "[&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", size === "sm" && "text-xs", size === "md" && "text-sm", className),
401
+ return /* @__PURE__ */ jsx(asChild ? Slot.Root : "a", {
402
+ className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", className),
439
403
  "data-active": isActive,
440
404
  "data-sidebar": "menu-sub-button",
441
405
  "data-size": size,
@@ -444,4 +408,4 @@ function SidebarMenuSubButton({ asChild = false, className, isActive = false, si
444
408
  });
445
409
  }
446
410
  //#endregion
447
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, sidebarMenuButtonVariants, useSidebar };
411
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
@@ -6,7 +6,7 @@ import { jsx } from "react/jsx-runtime";
6
6
  */
7
7
  function Skeleton({ className, ...props }) {
8
8
  return /* @__PURE__ */ jsx("div", {
9
- className: cn("rounded-lg", "bg-muted", "animate-pulse", className),
9
+ className: cn("animate-shimmer rounded-md bg-linear-to-r from-muted via-white/15 to-muted bg-size-[400%_100%]", className),
10
10
  "data-slot": "skeleton",
11
11
  ...props
12
12
  });
@@ -1,11 +1,11 @@
1
+ import { Slider as Slider$1 } from "radix-ui";
1
2
  import { ComponentProps, JSX } from "react";
2
- import * as SliderPrimitive from "@radix-ui/react-slider";
3
3
 
4
4
  //#region src/components/slider.d.ts
5
5
  /**
6
6
  * @since 0.3.16-canary.0
7
7
  */
8
- type SliderProps = ComponentProps<typeof SliderPrimitive.Root>;
8
+ type SliderProps = ComponentProps<typeof Slider$1.Root>;
9
9
  /**
10
10
  * @since 0.3.16-canary.0
11
11
  */