@health-samurai/react-components 0.0.0-alpha.1 → 0.0.0-alpha.3

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 (251) hide show
  1. package/dist/bundle.css +100 -7
  2. package/dist/src/components/code-editor/index.js +53 -29
  3. package/dist/src/components/code-editor/index.js.map +1 -1
  4. package/dist/src/components/code-editor.stories.js +22 -7
  5. package/dist/src/components/code-editor.stories.js.map +1 -1
  6. package/dist/src/components/copy-icon.js +11 -4
  7. package/dist/src/components/copy-icon.js.map +1 -1
  8. package/dist/src/components/request-line-editor.js +56 -14
  9. package/dist/src/components/request-line-editor.js.map +1 -1
  10. package/dist/src/components/request-line-editor.stories.js +71 -22
  11. package/dist/src/components/request-line-editor.stories.js.map +1 -1
  12. package/dist/src/global.d.js +2 -0
  13. package/dist/src/global.d.js.map +1 -0
  14. package/dist/src/index.css +6 -0
  15. package/dist/src/index.d.ts +1 -0
  16. package/dist/src/index.d.ts.map +1 -1
  17. package/dist/src/index.js +52 -50
  18. package/dist/src/index.js.map +1 -1
  19. package/dist/src/index.stories.js +8 -5
  20. package/dist/src/index.stories.js.map +1 -1
  21. package/dist/src/shadcn/components/ui/accordion.js +34 -5
  22. package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
  23. package/dist/src/shadcn/components/ui/accordion.stories.js +68 -3
  24. package/dist/src/shadcn/components/ui/accordion.stories.js.map +1 -1
  25. package/dist/src/shadcn/components/ui/alert-dialog.js +61 -14
  26. package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
  27. package/dist/src/shadcn/components/ui/alert-dialog.stories.js +39 -4
  28. package/dist/src/shadcn/components/ui/alert-dialog.stories.js.map +1 -1
  29. package/dist/src/shadcn/components/ui/alert.js +24 -8
  30. package/dist/src/shadcn/components/ui/alert.js.map +1 -1
  31. package/dist/src/shadcn/components/ui/alert.stories.js +57 -3
  32. package/dist/src/shadcn/components/ui/alert.stories.js.map +1 -1
  33. package/dist/src/shadcn/components/ui/aspect-ratio.d.ts.map +1 -1
  34. package/dist/src/shadcn/components/ui/aspect-ratio.js +6 -1
  35. package/dist/src/shadcn/components/ui/aspect-ratio.js.map +1 -1
  36. package/dist/src/shadcn/components/ui/aspect-ratio.stories.js +12 -3
  37. package/dist/src/shadcn/components/ui/aspect-ratio.stories.js.map +1 -1
  38. package/dist/src/shadcn/components/ui/avatar.js +17 -4
  39. package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
  40. package/dist/src/shadcn/components/ui/avatar.stories.js +69 -3
  41. package/dist/src/shadcn/components/ui/avatar.stories.js.map +1 -1
  42. package/dist/src/shadcn/components/ui/badge.js +13 -6
  43. package/dist/src/shadcn/components/ui/badge.js.map +1 -1
  44. package/dist/src/shadcn/components/ui/badge.stories.js +55 -3
  45. package/dist/src/shadcn/components/ui/badge.stories.js.map +1 -1
  46. package/dist/src/shadcn/components/ui/breadcrumb.js +56 -11
  47. package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
  48. package/dist/src/shadcn/components/ui/breadcrumb.stories.js +69 -4
  49. package/dist/src/shadcn/components/ui/breadcrumb.stories.js.map +1 -1
  50. package/dist/src/shadcn/components/ui/button.js +23 -13
  51. package/dist/src/shadcn/components/ui/button.js.map +1 -1
  52. package/dist/src/shadcn/components/ui/button.stories.js +190 -10
  53. package/dist/src/shadcn/components/ui/button.stories.js.map +1 -1
  54. package/dist/src/shadcn/components/ui/calendar.d.ts.map +1 -1
  55. package/dist/src/shadcn/components/ui/calendar.js +76 -33
  56. package/dist/src/shadcn/components/ui/calendar.js.map +1 -1
  57. package/dist/src/shadcn/components/ui/calendar.stories.js +12 -5
  58. package/dist/src/shadcn/components/ui/calendar.stories.js.map +1 -1
  59. package/dist/src/shadcn/components/ui/card.js +38 -9
  60. package/dist/src/shadcn/components/ui/card.js.map +1 -1
  61. package/dist/src/shadcn/components/ui/card.stories.js +91 -6
  62. package/dist/src/shadcn/components/ui/card.stories.js.map +1 -1
  63. package/dist/src/shadcn/components/ui/carousel.js +99 -39
  64. package/dist/src/shadcn/components/ui/carousel.js.map +1 -1
  65. package/dist/src/shadcn/components/ui/carousel.stories.js +30 -6
  66. package/dist/src/shadcn/components/ui/carousel.stories.js.map +1 -1
  67. package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
  68. package/dist/src/shadcn/components/ui/chart.js +119 -55
  69. package/dist/src/shadcn/components/ui/chart.js.map +1 -1
  70. package/dist/src/shadcn/components/ui/chart.stories.js +72 -12
  71. package/dist/src/shadcn/components/ui/chart.stories.js.map +1 -1
  72. package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
  73. package/dist/src/shadcn/components/ui/checkbox.js +15 -2
  74. package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
  75. package/dist/src/shadcn/components/ui/checkbox.stories.js +79 -4
  76. package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
  77. package/dist/src/shadcn/components/ui/collapsible.js +13 -3
  78. package/dist/src/shadcn/components/ui/collapsible.js.map +1 -1
  79. package/dist/src/shadcn/components/ui/collapsible.stories.js +54 -6
  80. package/dist/src/shadcn/components/ui/collapsible.stories.js.map +1 -1
  81. package/dist/src/shadcn/components/ui/command.js +77 -12
  82. package/dist/src/shadcn/components/ui/command.js.map +1 -1
  83. package/dist/src/shadcn/components/ui/command.stories.js +88 -4
  84. package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
  85. package/dist/src/shadcn/components/ui/context-menu.d.ts.map +1 -1
  86. package/dist/src/shadcn/components/ui/context-menu.js +107 -17
  87. package/dist/src/shadcn/components/ui/context-menu.js.map +1 -1
  88. package/dist/src/shadcn/components/ui/context-menu.stories.js +101 -3
  89. package/dist/src/shadcn/components/ui/context-menu.stories.js.map +1 -1
  90. package/dist/src/shadcn/components/ui/dialog.js +69 -12
  91. package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
  92. package/dist/src/shadcn/components/ui/dialog.stories.js +82 -6
  93. package/dist/src/shadcn/components/ui/dialog.stories.js.map +1 -1
  94. package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
  95. package/dist/src/shadcn/components/ui/drawer.js +62 -12
  96. package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
  97. package/dist/src/shadcn/components/ui/drawer.stories.js +154 -21
  98. package/dist/src/shadcn/components/ui/drawer.stories.js.map +1 -1
  99. package/dist/src/shadcn/components/ui/dropdown-menu.js +107 -17
  100. package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
  101. package/dist/src/shadcn/components/ui/dropdown-menu.stories.js +119 -4
  102. package/dist/src/shadcn/components/ui/dropdown-menu.stories.js.map +1 -1
  103. package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
  104. package/dist/src/shadcn/components/ui/form.js +59 -18
  105. package/dist/src/shadcn/components/ui/form.js.map +1 -1
  106. package/dist/src/shadcn/components/ui/form.stories.js +45 -11
  107. package/dist/src/shadcn/components/ui/form.stories.js.map +1 -1
  108. package/dist/src/shadcn/components/ui/hover-card.d.ts.map +1 -1
  109. package/dist/src/shadcn/components/ui/hover-card.js +21 -4
  110. package/dist/src/shadcn/components/ui/hover-card.js.map +1 -1
  111. package/dist/src/shadcn/components/ui/hover-card.stories.js +51 -5
  112. package/dist/src/shadcn/components/ui/hover-card.stories.js.map +1 -1
  113. package/dist/src/shadcn/components/ui/input-otp.js +35 -7
  114. package/dist/src/shadcn/components/ui/input-otp.js.map +1 -1
  115. package/dist/src/shadcn/components/ui/input-otp.stories.js +35 -3
  116. package/dist/src/shadcn/components/ui/input-otp.stories.js.map +1 -1
  117. package/dist/src/shadcn/components/ui/input.js +59 -40
  118. package/dist/src/shadcn/components/ui/input.js.map +1 -1
  119. package/dist/src/shadcn/components/ui/input.stories.js +391 -23
  120. package/dist/src/shadcn/components/ui/input.stories.js.map +1 -1
  121. package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
  122. package/dist/src/shadcn/components/ui/label.js +8 -2
  123. package/dist/src/shadcn/components/ui/label.js.map +1 -1
  124. package/dist/src/shadcn/components/ui/label.stories.js +18 -4
  125. package/dist/src/shadcn/components/ui/label.stories.js.map +1 -1
  126. package/dist/src/shadcn/components/ui/menubar.js +116 -19
  127. package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
  128. package/dist/src/shadcn/components/ui/menubar.stories.js +216 -3
  129. package/dist/src/shadcn/components/ui/menubar.stories.js.map +1 -1
  130. package/dist/src/shadcn/components/ui/navigation-menu.js +62 -10
  131. package/dist/src/shadcn/components/ui/navigation-menu.js.map +1 -1
  132. package/dist/src/shadcn/components/ui/navigation-menu.stories.js +263 -11
  133. package/dist/src/shadcn/components/ui/navigation-menu.stories.js.map +1 -1
  134. package/dist/src/shadcn/components/ui/pagination.js +73 -16
  135. package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
  136. package/dist/src/shadcn/components/ui/pagination.stories.js +41 -3
  137. package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -1
  138. package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
  139. package/dist/src/shadcn/components/ui/popover.js +24 -5
  140. package/dist/src/shadcn/components/ui/popover.js.map +1 -1
  141. package/dist/src/shadcn/components/ui/popover.stories.js +99 -6
  142. package/dist/src/shadcn/components/ui/popover.stories.js.map +1 -1
  143. package/dist/src/shadcn/components/ui/progress.js +14 -2
  144. package/dist/src/shadcn/components/ui/progress.js.map +1 -1
  145. package/dist/src/shadcn/components/ui/progress.stories.js +12 -8
  146. package/dist/src/shadcn/components/ui/progress.stories.js.map +1 -1
  147. package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
  148. package/dist/src/shadcn/components/ui/radio-group.js +20 -3
  149. package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
  150. package/dist/src/shadcn/components/ui/radio-group.stories.js +48 -4
  151. package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
  152. package/dist/src/shadcn/components/ui/resizable.js +22 -4
  153. package/dist/src/shadcn/components/ui/resizable.js.map +1 -1
  154. package/dist/src/shadcn/components/ui/resizable.stories.js +49 -3
  155. package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -1
  156. package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
  157. package/dist/src/shadcn/components/ui/scroll-area.js +27 -5
  158. package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
  159. package/dist/src/shadcn/components/ui/scroll-area.stories.js +30 -5
  160. package/dist/src/shadcn/components/ui/scroll-area.stories.js.map +1 -1
  161. package/dist/src/shadcn/components/ui/select.js +98 -19
  162. package/dist/src/shadcn/components/ui/select.js.map +1 -1
  163. package/dist/src/shadcn/components/ui/select.stories.js +84 -5
  164. package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
  165. package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
  166. package/dist/src/shadcn/components/ui/separator.js +10 -2
  167. package/dist/src/shadcn/components/ui/separator.js.map +1 -1
  168. package/dist/src/shadcn/components/ui/separator.stories.js +43 -3
  169. package/dist/src/shadcn/components/ui/separator.stories.js.map +1 -1
  170. package/dist/src/shadcn/components/ui/sheet.js +69 -16
  171. package/dist/src/shadcn/components/ui/sheet.js.map +1 -1
  172. package/dist/src/shadcn/components/ui/sheet.stories.js +77 -6
  173. package/dist/src/shadcn/components/ui/sheet.stories.js.map +1 -1
  174. package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
  175. package/dist/src/shadcn/components/ui/sidebar.js +305 -79
  176. package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
  177. package/dist/src/shadcn/components/ui/sidebar.stories.js +321 -59
  178. package/dist/src/shadcn/components/ui/sidebar.stories.js.map +1 -1
  179. package/dist/src/shadcn/components/ui/skeleton.js +7 -2
  180. package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
  181. package/dist/src/shadcn/components/ui/skeleton.stories.js +22 -3
  182. package/dist/src/shadcn/components/ui/skeleton.stories.js.map +1 -1
  183. package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
  184. package/dist/src/shadcn/components/ui/slider.js +41 -7
  185. package/dist/src/shadcn/components/ui/slider.js.map +1 -1
  186. package/dist/src/shadcn/components/ui/slider.stories.js +11 -3
  187. package/dist/src/shadcn/components/ui/slider.stories.js.map +1 -1
  188. package/dist/src/shadcn/components/ui/sonner.js +10 -4
  189. package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
  190. package/dist/src/shadcn/components/ui/sonner.stories.js +14 -9
  191. package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
  192. package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
  193. package/dist/src/shadcn/components/ui/switch.js +12 -2
  194. package/dist/src/shadcn/components/ui/switch.js.map +1 -1
  195. package/dist/src/shadcn/components/ui/switch.stories.js +16 -4
  196. package/dist/src/shadcn/components/ui/switch.stories.js.map +1 -1
  197. package/dist/src/shadcn/components/ui/table.js +47 -10
  198. package/dist/src/shadcn/components/ui/table.js.map +1 -1
  199. package/dist/src/shadcn/components/ui/table.stories.js +72 -11
  200. package/dist/src/shadcn/components/ui/table.stories.js.map +1 -1
  201. package/dist/src/shadcn/components/ui/tabs.d.ts +9 -5
  202. package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
  203. package/dist/src/shadcn/components/ui/tabs.js +76 -18
  204. package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
  205. package/dist/src/shadcn/components/ui/tabs.stories.d.ts +6 -0
  206. package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
  207. package/dist/src/shadcn/components/ui/tabs.stories.js +221 -10
  208. package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
  209. package/dist/src/shadcn/components/ui/textarea.js +7 -2
  210. package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
  211. package/dist/src/shadcn/components/ui/textarea.stories.js +6 -3
  212. package/dist/src/shadcn/components/ui/textarea.stories.js.map +1 -1
  213. package/dist/src/shadcn/components/ui/toggle-group.js +29 -8
  214. package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
  215. package/dist/src/shadcn/components/ui/toggle-group.stories.js +30 -3
  216. package/dist/src/shadcn/components/ui/toggle-group.stories.js.map +1 -1
  217. package/dist/src/shadcn/components/ui/toggle.js +16 -7
  218. package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
  219. package/dist/src/shadcn/components/ui/toggle.stories.js +9 -3
  220. package/dist/src/shadcn/components/ui/toggle.stories.js.map +1 -1
  221. package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
  222. package/dist/src/shadcn/components/ui/tooltip.js +27 -5
  223. package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
  224. package/dist/src/shadcn/components/ui/tooltip.stories.js +20 -4
  225. package/dist/src/shadcn/components/ui/tooltip.stories.js.map +1 -1
  226. package/dist/src/shadcn/hooks/use-mobile.js +4 -3
  227. package/dist/src/shadcn/hooks/use-mobile.js.map +1 -1
  228. package/dist/src/shadcn/lib/utils.js +1 -0
  229. package/dist/src/shadcn/lib/utils.js.map +1 -1
  230. package/package.json +8 -4
  231. package/src/index.css +6 -0
  232. package/src/index.tsx +1 -0
  233. package/src/shadcn/components/ui/aspect-ratio.tsx +1 -0
  234. package/src/shadcn/components/ui/calendar.tsx +1 -0
  235. package/src/shadcn/components/ui/chart.tsx +1 -0
  236. package/src/shadcn/components/ui/checkbox.tsx +1 -0
  237. package/src/shadcn/components/ui/context-menu.tsx +1 -0
  238. package/src/shadcn/components/ui/drawer.tsx +1 -0
  239. package/src/shadcn/components/ui/form.tsx +1 -0
  240. package/src/shadcn/components/ui/hover-card.tsx +1 -0
  241. package/src/shadcn/components/ui/label.tsx +1 -0
  242. package/src/shadcn/components/ui/popover.tsx +1 -0
  243. package/src/shadcn/components/ui/radio-group.tsx +1 -0
  244. package/src/shadcn/components/ui/scroll-area.tsx +1 -0
  245. package/src/shadcn/components/ui/separator.tsx +1 -0
  246. package/src/shadcn/components/ui/sidebar.tsx +1 -0
  247. package/src/shadcn/components/ui/slider.tsx +1 -0
  248. package/src/shadcn/components/ui/switch.tsx +1 -0
  249. package/src/shadcn/components/ui/tabs.stories.tsx +57 -0
  250. package/src/shadcn/components/ui/tabs.tsx +77 -26
  251. package/src/shadcn/components/ui/tooltip.tsx +1 -0
@@ -1,23 +1,24 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { Slot } from "@radix-ui/react-slot";
3
4
  import { cva } from "class-variance-authority";
4
5
  import { PanelLeftIcon } from "lucide-react";
5
6
  import * as React from "react";
6
- import { Button } from "#shadcn/components/ui/button";
7
- import { Input } from "#shadcn/components/ui/input";
8
- import { Separator } from "#shadcn/components/ui/separator";
9
- import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "#shadcn/components/ui/sheet";
10
- import { Skeleton } from "#shadcn/components/ui/skeleton";
11
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "#shadcn/components/ui/tooltip";
12
- import { useIsMobile } from "#shadcn/hooks/use-mobile";
13
- import { cn } from "#shadcn/lib/utils";
7
+ import { Button } from "./button.js";
8
+ import { Input } from "./input.js";
9
+ import { Separator } from "./separator.js";
10
+ import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.js";
11
+ import { Skeleton } from "./skeleton.js";
12
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
13
+ import { useIsMobile } from "../../hooks/use-mobile.js";
14
+ import { cn } from "../../lib/utils.js";
14
15
  const SIDEBAR_COOKIE_NAME = "sidebar_state";
15
16
  const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
16
17
  const SIDEBAR_WIDTH = "13.75rem";
17
18
  const SIDEBAR_WIDTH_MOBILE = "18rem";
18
19
  const SIDEBAR_WIDTH_ICON = "3.125rem";
19
20
  const SIDEBAR_KEYBOARD_SHORTCUT = "b";
20
- const SidebarContext = React.createContext(null);
21
+ const SidebarContext = /*#__PURE__*/ React.createContext(null);
21
22
  function useSidebar() {
22
23
  const context = React.useContext(SidebarContext);
23
24
  if (!context) {
@@ -32,184 +33,409 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
32
33
  // We use openProp and setOpenProp for control from outside the component.
33
34
  const [_open, _setOpen] = React.useState(defaultOpen);
34
35
  const open = openProp ?? _open;
35
- const setOpen = React.useCallback((value) => {
36
+ const setOpen = React.useCallback((value)=>{
36
37
  const openState = typeof value === "function" ? value(open) : value;
37
38
  if (setOpenProp) {
38
39
  setOpenProp(openState);
39
- }
40
- else {
40
+ } else {
41
41
  _setOpen(openState);
42
42
  }
43
43
  // This sets the cookie to keep the sidebar state.
44
44
  // biome-ignore lint/suspicious/noDocumentCookie: FIXME: unchanged shadcn
45
45
  document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
46
- }, [setOpenProp, open]);
46
+ }, [
47
+ setOpenProp,
48
+ open
49
+ ]);
47
50
  // Helper to toggle the sidebar.
48
51
  // biome-ignore lint/correctness/useExhaustiveDependencies: FIXME: unchanged shadcn
49
- const toggleSidebar = React.useCallback(() => {
50
- return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
51
- }, [isMobile, setOpen, setOpenMobile]);
52
+ const toggleSidebar = React.useCallback(()=>{
53
+ return isMobile ? setOpenMobile((open)=>!open) : setOpen((open)=>!open);
54
+ }, [
55
+ isMobile,
56
+ setOpen,
57
+ setOpenMobile
58
+ ]);
52
59
  // Adds a keyboard shortcut to toggle the sidebar.
53
- React.useEffect(() => {
54
- const handleKeyDown = (event) => {
55
- if (event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
56
- (event.metaKey || event.ctrlKey)) {
60
+ React.useEffect(()=>{
61
+ const handleKeyDown = (event)=>{
62
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
57
63
  event.preventDefault();
58
64
  toggleSidebar();
59
65
  }
60
66
  };
61
67
  window.addEventListener("keydown", handleKeyDown);
62
- return () => window.removeEventListener("keydown", handleKeyDown);
63
- }, [toggleSidebar]);
68
+ return ()=>window.removeEventListener("keydown", handleKeyDown);
69
+ }, [
70
+ toggleSidebar
71
+ ]);
64
72
  // We add a state so that we can do data-state="expanded" or "collapsed".
65
73
  // This makes it easier to style the sidebar with Tailwind classes.
66
74
  const state = open ? "expanded" : "collapsed";
67
75
  // biome-ignore lint/correctness/useExhaustiveDependencies: FIXME: unchanged shadcn
68
- const contextValue = React.useMemo(() => ({
76
+ const contextValue = React.useMemo(()=>({
77
+ state,
78
+ open,
79
+ setOpen,
80
+ isMobile,
81
+ openMobile,
82
+ setOpenMobile,
83
+ toggleSidebar
84
+ }), [
69
85
  state,
70
86
  open,
71
87
  setOpen,
72
88
  isMobile,
73
89
  openMobile,
74
90
  setOpenMobile,
75
- toggleSidebar,
76
- }), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
77
- return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx(TooltipProvider, { delayDuration: 0, children: _jsx("div", { "data-slot": "sidebar-wrapper", style: {
91
+ toggleSidebar
92
+ ]);
93
+ return /*#__PURE__*/ _jsx(SidebarContext.Provider, {
94
+ value: contextValue,
95
+ children: /*#__PURE__*/ _jsx(TooltipProvider, {
96
+ delayDuration: 0,
97
+ children: /*#__PURE__*/ _jsx("div", {
98
+ "data-slot": "sidebar-wrapper",
99
+ style: {
78
100
  "--sidebar-width": SIDEBAR_WIDTH,
79
101
  "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
80
- ...style,
81
- }, className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full box-content", className), ...props, children: children }) }) }));
102
+ ...style
103
+ },
104
+ className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full box-content", className),
105
+ ...props,
106
+ children: children
107
+ })
108
+ })
109
+ });
82
110
  }
83
111
  function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }) {
84
112
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
85
113
  if (collapsible === "none") {
86
- return (_jsx("div", { "data-slot": "sidebar", className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className), ...props, children: children }));
114
+ return /*#__PURE__*/ _jsx("div", {
115
+ "data-slot": "sidebar",
116
+ className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
117
+ ...props,
118
+ children: children
119
+ });
87
120
  }
88
121
  if (isMobile) {
89
- return (_jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: _jsxs(SheetContent, { "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden", style: {
90
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE,
91
- }, side: side, children: [_jsxs(SheetHeader, { className: "sr-only", children: [_jsx(SheetTitle, { children: "Sidebar" }), _jsx(SheetDescription, { children: "Displays the mobile sidebar." })] }), _jsx("div", { className: "flex h-full w-full flex-col", children: children })] }) }));
122
+ return /*#__PURE__*/ _jsx(Sheet, {
123
+ open: openMobile,
124
+ onOpenChange: setOpenMobile,
125
+ ...props,
126
+ children: /*#__PURE__*/ _jsxs(SheetContent, {
127
+ "data-sidebar": "sidebar",
128
+ "data-slot": "sidebar",
129
+ "data-mobile": "true",
130
+ className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
131
+ style: {
132
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
133
+ },
134
+ side: side,
135
+ children: [
136
+ /*#__PURE__*/ _jsxs(SheetHeader, {
137
+ className: "sr-only",
138
+ children: [
139
+ /*#__PURE__*/ _jsx(SheetTitle, {
140
+ children: "Sidebar"
141
+ }),
142
+ /*#__PURE__*/ _jsx(SheetDescription, {
143
+ children: "Displays the mobile sidebar."
144
+ })
145
+ ]
146
+ }),
147
+ /*#__PURE__*/ _jsx("div", {
148
+ className: "flex h-full w-full flex-col",
149
+ children: children
150
+ })
151
+ ]
152
+ })
153
+ });
92
154
  }
93
- return (_jsxs("div", { className: "group peer text-sidebar-foreground hidden md:block", "data-state": state, "data-collapsible": state === "collapsed" ? collapsible : "", "data-variant": variant, "data-side": side, "data-slot": "sidebar", children: [_jsx("div", { "data-slot": "sidebar-gap", className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-120 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset"
94
- ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
95
- : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)") }), _jsx("div", { "data-slot": "sidebar-container", className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-120 ease-linear md:flex box-content", side === "left"
96
- ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
97
- : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
98
- // Adjust the padding for floating and inset variants.
99
- variant === "floating" || variant === "inset"
100
- ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
101
- : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "bg-bg-primary group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm", children: children }) })] }));
155
+ return /*#__PURE__*/ _jsxs("div", {
156
+ className: "group peer text-sidebar-foreground hidden md:block",
157
+ "data-state": state,
158
+ "data-collapsible": state === "collapsed" ? collapsible : "",
159
+ "data-variant": variant,
160
+ "data-side": side,
161
+ "data-slot": "sidebar",
162
+ children: [
163
+ /*#__PURE__*/ _jsx("div", {
164
+ "data-slot": "sidebar-gap",
165
+ className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-120 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)")
166
+ }),
167
+ /*#__PURE__*/ _jsx("div", {
168
+ "data-slot": "sidebar-container",
169
+ className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-120 ease-linear md:flex box-content", 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)]", // Adjust the padding for floating and inset variants.
170
+ 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=left]:border-r group-data-[side=right]:border-l", className),
171
+ ...props,
172
+ children: /*#__PURE__*/ _jsx("div", {
173
+ "data-sidebar": "sidebar",
174
+ "data-slot": "sidebar-inner",
175
+ className: "bg-bg-primary group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
176
+ children: children
177
+ })
178
+ })
179
+ ]
180
+ });
102
181
  }
103
182
  function SidebarTrigger({ className, onClick, ...props }) {
104
183
  const { toggleSidebar } = useSidebar();
105
- return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "small", className: cn("size-7", className), onClick: (event) => {
184
+ return /*#__PURE__*/ _jsxs(Button, {
185
+ "data-sidebar": "trigger",
186
+ "data-slot": "sidebar-trigger",
187
+ variant: "ghost",
188
+ size: "small",
189
+ className: cn("size-7", className),
190
+ onClick: (event)=>{
106
191
  onClick?.(event);
107
192
  toggleSidebar();
108
- }, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
193
+ },
194
+ ...props,
195
+ children: [
196
+ /*#__PURE__*/ _jsx(PanelLeftIcon, {}),
197
+ /*#__PURE__*/ _jsx("span", {
198
+ className: "sr-only",
199
+ children: "Toggle Sidebar"
200
+ })
201
+ ]
202
+ });
109
203
  }
110
204
  function SidebarRail({ className, ...props }) {
111
205
  const { toggleSidebar } = useSidebar();
112
- return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className), ...props }));
206
+ return /*#__PURE__*/ _jsx("button", {
207
+ "data-sidebar": "rail",
208
+ "data-slot": "sidebar-rail",
209
+ "aria-label": "Toggle Sidebar",
210
+ tabIndex: -1,
211
+ onClick: toggleSidebar,
212
+ title: "Toggle Sidebar",
213
+ className: cn("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className),
214
+ ...props
215
+ });
113
216
  }
114
217
  function SidebarInset({ className, ...props }) {
115
- return (_jsx("main", { "data-slot": "sidebar-inset", className: cn("bg-background relative flex w-full flex-1 flex-col", "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", "peer-has-data-[sidebar-mode=hover]:fixed peer-has-data-[sidebar-mode=hover]:h-full peer-has-data-[sidebar-mode=hover]:grow", "peer-has-data-[sidebar-mode=hover]:left-(--sidebar-width-icon)", className), ...props }));
218
+ return /*#__PURE__*/ _jsx("main", {
219
+ "data-slot": "sidebar-inset",
220
+ className: cn("bg-background relative flex w-full flex-1 flex-col", "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", "peer-has-data-[sidebar-mode=hover]:fixed peer-has-data-[sidebar-mode=hover]:h-full peer-has-data-[sidebar-mode=hover]:grow", "peer-has-data-[sidebar-mode=hover]:left-(--sidebar-width-icon)", className),
221
+ ...props
222
+ });
116
223
  }
117
224
  function SidebarInput({ className, ...props }) {
118
- return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn("bg-background h-8 w-full shadow-none", className), ...props }));
225
+ return /*#__PURE__*/ _jsx(Input, {
226
+ "data-slot": "sidebar-input",
227
+ "data-sidebar": "input",
228
+ className: cn("bg-background h-8 w-full shadow-none", className),
229
+ ...props
230
+ });
119
231
  }
120
232
  function SidebarHeader({ className, ...props }) {
121
- return (_jsx("div", { "data-slot": "sidebar-header", "data-sidebar": "header", className: cn("flex flex-col gap-2 p-2", className), ...props }));
233
+ return /*#__PURE__*/ _jsx("div", {
234
+ "data-slot": "sidebar-header",
235
+ "data-sidebar": "header",
236
+ className: cn("flex flex-col gap-2 p-2", className),
237
+ ...props
238
+ });
122
239
  }
123
240
  function SidebarFooter({ className, ...props }) {
124
- return (_jsx("div", { "data-slot": "sidebar-footer", "data-sidebar": "footer", className: cn("flex flex-col gap-2 p-2 pb-3", className), ...props }));
241
+ return /*#__PURE__*/ _jsx("div", {
242
+ "data-slot": "sidebar-footer",
243
+ "data-sidebar": "footer",
244
+ className: cn("flex flex-col gap-2 p-2 pb-3", className),
245
+ ...props
246
+ });
125
247
  }
126
248
  function SidebarSeparator({ className, ...props }) {
127
- return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn("border-border-secondary w-auto", className), ...props }));
249
+ return /*#__PURE__*/ _jsx(Separator, {
250
+ "data-slot": "sidebar-separator",
251
+ "data-sidebar": "separator",
252
+ className: cn("border-border-secondary w-auto", className),
253
+ ...props
254
+ });
128
255
  }
129
256
  function SidebarContent({ className, ...props }) {
130
- return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn("flex min-h-0 flex-1 flex-col gap-1 p-2 pt-3 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className), ...props }));
257
+ return /*#__PURE__*/ _jsx("div", {
258
+ "data-slot": "sidebar-content",
259
+ "data-sidebar": "content",
260
+ className: cn("flex min-h-0 flex-1 flex-col gap-1 p-2 pt-3 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
261
+ ...props
262
+ });
131
263
  }
132
264
  function SidebarGroup({ className, ...props }) {
133
- return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn("relative flex w-full min-w-0 flex-col", className), ...props }));
265
+ return /*#__PURE__*/ _jsx("div", {
266
+ "data-slot": "sidebar-group",
267
+ "data-sidebar": "group",
268
+ className: cn("relative flex w-full min-w-0 flex-col", className),
269
+ ...props
270
+ });
134
271
  }
135
272
  function SidebarGroupLabel({ className, asChild = false, ...props }) {
136
273
  const Comp = asChild ? Slot : "div";
137
- return (_jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", className), ...props }));
274
+ return /*#__PURE__*/ _jsx(Comp, {
275
+ "data-slot": "sidebar-group-label",
276
+ "data-sidebar": "group-label",
277
+ className: cn("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", className),
278
+ ...props
279
+ });
138
280
  }
139
281
  function SidebarGroupAction({ className, asChild = false, ...props }) {
140
282
  const Comp = asChild ? Slot : "button";
141
- return (_jsx(Comp, { "data-slot": "sidebar-group-action", "data-sidebar": "group-action", className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
142
- // Increases the hit area of the button on mobile.
143
- "after:absolute after:-inset-2 md:after:hidden", "group-data-[collapsible=icon]:hidden", className), ...props }));
283
+ return /*#__PURE__*/ _jsx(Comp, {
284
+ "data-slot": "sidebar-group-action",
285
+ "data-sidebar": "group-action",
286
+ className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", // Increases the hit area of the button on mobile.
287
+ "after:absolute after:-inset-2 md:after:hidden", "group-data-[collapsible=icon]:hidden", className),
288
+ ...props
289
+ });
144
290
  }
145
291
  function SidebarGroupContent({ className, ...props }) {
146
- return (_jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn("w-full text-sm", className), ...props }));
292
+ return /*#__PURE__*/ _jsx("div", {
293
+ "data-slot": "sidebar-group-content",
294
+ "data-sidebar": "group-content",
295
+ className: cn("w-full text-sm", className),
296
+ ...props
297
+ });
147
298
  }
148
299
  function SidebarMenu({ className, ...props }) {
149
- return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn("flex w-full min-w-0 flex-col gap-0.5", className), ...props }));
300
+ return /*#__PURE__*/ _jsx("ul", {
301
+ "data-slot": "sidebar-menu",
302
+ "data-sidebar": "menu",
303
+ className: cn("flex w-full min-w-0 flex-col gap-0.5", className),
304
+ ...props
305
+ });
150
306
  }
151
307
  function SidebarMenuItem({ className, ...props }) {
152
- return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn("group/menu-item relative", className), ...props }));
308
+ return /*#__PURE__*/ _jsx("li", {
309
+ "data-slot": "sidebar-menu-item",
310
+ "data-sidebar": "menu-item",
311
+ className: cn("group/menu-item relative", className),
312
+ ...props
313
+ });
153
314
  }
154
315
  const sidebarMenuButtonVariants = cva(cn("typo-body text-text-secondary flex items-center gap-2 overflow-hidden rounded-lg py-2 px-[0.44rem] outline-hidden ", "ring-sidebar-ring transition-all focus-visible:ring-2 active:bg-bg-quaternary disabled:pointer-events-none", "disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50", "data-[active=true]:bg-bg-brand-secondary data-[active=true]:text-text-primary data-[state=open]:hover:bg-sidebar-accent", "data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:py-2! group-data-[collapsible=icon]:px-[0.44rem]!", "[&>span:last-child]:truncate [&>svg]:size-5 [&>svg]:shrink-0 hover:bg-bg-secondary hover:text-text-primary", "data-[active=true]:[&>svg]:text-text-brand-primary w-full"), {
155
316
  variants: {
156
317
  variant: {
157
318
  default: "",
158
- outline: "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))]",
319
+ outline: "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))]"
159
320
  },
160
321
  size: {
161
322
  default: "",
162
323
  sm: "",
163
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
164
- },
324
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
325
+ }
165
326
  },
166
327
  defaultVariants: {
167
328
  variant: "default",
168
- size: "default",
169
- },
329
+ size: "default"
330
+ }
170
331
  });
171
332
  function SidebarMenuButton({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
172
333
  const Comp = asChild ? Slot : "button";
173
334
  const { isMobile, state } = useSidebar();
174
- const button = (_jsx(Comp, { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-size": size, "data-active": isActive, className: cn(sidebarMenuButtonVariants({ variant, size }), className), ...props }));
335
+ const button = /*#__PURE__*/ _jsx(Comp, {
336
+ "data-slot": "sidebar-menu-button",
337
+ "data-sidebar": "menu-button",
338
+ "data-size": size,
339
+ "data-active": isActive,
340
+ className: cn(sidebarMenuButtonVariants({
341
+ variant,
342
+ size
343
+ }), className),
344
+ ...props
345
+ });
175
346
  if (!tooltip) {
176
347
  return button;
177
348
  }
178
349
  if (typeof tooltip === "string") {
179
350
  tooltip = {
180
- children: tooltip,
351
+ children: tooltip
181
352
  };
182
353
  }
183
- return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltip })] }));
354
+ return /*#__PURE__*/ _jsxs(Tooltip, {
355
+ children: [
356
+ /*#__PURE__*/ _jsx(TooltipTrigger, {
357
+ asChild: true,
358
+ children: button
359
+ }),
360
+ /*#__PURE__*/ _jsx(TooltipContent, {
361
+ side: "right",
362
+ align: "center",
363
+ hidden: state !== "collapsed" || isMobile,
364
+ ...tooltip
365
+ })
366
+ ]
367
+ });
184
368
  }
185
369
  function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
186
370
  const Comp = asChild ? Slot : "button";
187
- return (_jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
188
- // Increases the hit area of the button on mobile.
189
- "after:absolute after:-inset-2 md:after:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", showOnHover &&
190
- "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0", className), ...props }));
371
+ return /*#__PURE__*/ _jsx(Comp, {
372
+ "data-slot": "sidebar-menu-action",
373
+ "data-sidebar": "menu-action",
374
+ className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", // Increases the hit area of the button on mobile.
375
+ "after:absolute after:-inset-2 md:after:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", showOnHover && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0", className),
376
+ ...props
377
+ });
191
378
  }
192
379
  function SidebarMenuBadge({ className, ...props }) {
193
- return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", className: cn("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none", "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", className), ...props }));
380
+ return /*#__PURE__*/ _jsx("div", {
381
+ "data-slot": "sidebar-menu-badge",
382
+ "data-sidebar": "menu-badge",
383
+ className: cn("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none", "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", className),
384
+ ...props
385
+ });
194
386
  }
195
387
  function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
196
388
  // Random width between 50 to 90%.
197
- const width = React.useMemo(() => {
389
+ const width = React.useMemo(()=>{
198
390
  return `${Math.floor(Math.random() * 40) + 50}%`;
199
391
  }, []);
200
- return (_jsxs("div", { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton", className: cn("flex h-8 items-center gap-2 rounded-md px-2", className), ...props, children: [showIcon && (_jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" })), _jsx(Skeleton, { className: "h-4 max-w-(--skeleton-width) flex-1", "data-sidebar": "menu-skeleton-text", style: {
201
- "--skeleton-width": width,
202
- } })] }));
392
+ return /*#__PURE__*/ _jsxs("div", {
393
+ "data-slot": "sidebar-menu-skeleton",
394
+ "data-sidebar": "menu-skeleton",
395
+ className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
396
+ ...props,
397
+ children: [
398
+ showIcon && /*#__PURE__*/ _jsx(Skeleton, {
399
+ className: "size-4 rounded-md",
400
+ "data-sidebar": "menu-skeleton-icon"
401
+ }),
402
+ /*#__PURE__*/ _jsx(Skeleton, {
403
+ className: "h-4 max-w-(--skeleton-width) flex-1",
404
+ "data-sidebar": "menu-skeleton-text",
405
+ style: {
406
+ "--skeleton-width": width
407
+ }
408
+ })
409
+ ]
410
+ });
203
411
  }
204
412
  function SidebarMenuSub({ className, ...props }) {
205
- return (_jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5", "group-data-[collapsible=icon]:hidden", className), ...props }));
413
+ return /*#__PURE__*/ _jsx("ul", {
414
+ "data-slot": "sidebar-menu-sub",
415
+ "data-sidebar": "menu-sub",
416
+ className: cn("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5", "group-data-[collapsible=icon]:hidden", className),
417
+ ...props
418
+ });
206
419
  }
207
420
  function SidebarMenuSubItem({ className, ...props }) {
208
- return (_jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn("group/menu-sub-item relative", className), ...props }));
421
+ return /*#__PURE__*/ _jsx("li", {
422
+ "data-slot": "sidebar-menu-sub-item",
423
+ "data-sidebar": "menu-sub-item",
424
+ className: cn("group/menu-sub-item relative", className),
425
+ ...props
426
+ });
209
427
  }
210
428
  function SidebarMenuSubButton({ asChild = false, size = "md", isActive = false, className, ...props }) {
211
429
  const Comp = asChild ? Slot : "a";
212
- return (_jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", size === "sm" && "text-xs", size === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", className), ...props }));
430
+ return /*#__PURE__*/ _jsx(Comp, {
431
+ "data-slot": "sidebar-menu-sub-button",
432
+ "data-sidebar": "menu-sub-button",
433
+ "data-size": size,
434
+ "data-active": isActive,
435
+ className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", size === "sm" && "text-xs", size === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", className),
436
+ ...props
437
+ });
213
438
  }
214
- 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, };
439
+ 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 };
440
+
215
441
  //# sourceMappingURL=sidebar.js.map