@modern-admin/ui 0.1.0

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 (268) hide show
  1. package/dist/components/accordion.d.ts +7 -0
  2. package/dist/components/accordion.d.ts.map +1 -0
  3. package/dist/components/accordion.jsx +19 -0
  4. package/dist/components/accordion.jsx.map +1 -0
  5. package/dist/components/alert-dialog.d.ts +22 -0
  6. package/dist/components/alert-dialog.d.ts.map +1 -0
  7. package/dist/components/alert-dialog.jsx +27 -0
  8. package/dist/components/alert-dialog.jsx.map +1 -0
  9. package/dist/components/audit-timeline.d.ts +24 -0
  10. package/dist/components/audit-timeline.d.ts.map +1 -0
  11. package/dist/components/audit-timeline.jsx +60 -0
  12. package/dist/components/audit-timeline.jsx.map +1 -0
  13. package/dist/components/avatar.d.ts +6 -0
  14. package/dist/components/avatar.d.ts.map +1 -0
  15. package/dist/components/avatar.jsx +10 -0
  16. package/dist/components/avatar.jsx.map +1 -0
  17. package/dist/components/badge.d.ts +10 -0
  18. package/dist/components/badge.d.ts.map +1 -0
  19. package/dist/components/badge.jsx +19 -0
  20. package/dist/components/badge.jsx.map +1 -0
  21. package/dist/components/breadcrumb.d.ts +17 -0
  22. package/dist/components/breadcrumb.d.ts.map +1 -0
  23. package/dist/components/breadcrumb.jsx +27 -0
  24. package/dist/components/breadcrumb.jsx.map +1 -0
  25. package/dist/components/button.d.ts +12 -0
  26. package/dist/components/button.d.ts.map +1 -0
  27. package/dist/components/button.jsx +37 -0
  28. package/dist/components/button.jsx.map +1 -0
  29. package/dist/components/calendar.d.ts +9 -0
  30. package/dist/components/calendar.d.ts.map +1 -0
  31. package/dist/components/calendar.jsx +102 -0
  32. package/dist/components/calendar.jsx.map +1 -0
  33. package/dist/components/card.d.ts +8 -0
  34. package/dist/components/card.d.ts.map +1 -0
  35. package/dist/components/card.jsx +18 -0
  36. package/dist/components/card.jsx.map +1 -0
  37. package/dist/components/chart.d.ts +97 -0
  38. package/dist/components/chart.d.ts.map +1 -0
  39. package/dist/components/chart.jsx +233 -0
  40. package/dist/components/chart.jsx.map +1 -0
  41. package/dist/components/checkbox.d.ts +4 -0
  42. package/dist/components/checkbox.d.ts.map +1 -0
  43. package/dist/components/checkbox.jsx +11 -0
  44. package/dist/components/checkbox.jsx.map +1 -0
  45. package/dist/components/combobox.d.ts +46 -0
  46. package/dist/components/combobox.d.ts.map +1 -0
  47. package/dist/components/combobox.jsx +145 -0
  48. package/dist/components/combobox.jsx.map +1 -0
  49. package/dist/components/command.d.ts +80 -0
  50. package/dist/components/command.d.ts.map +1 -0
  51. package/dist/components/command.jsx +32 -0
  52. package/dist/components/command.jsx.map +1 -0
  53. package/dist/components/date-picker.d.ts +24 -0
  54. package/dist/components/date-picker.d.ts.map +1 -0
  55. package/dist/components/date-picker.jsx +149 -0
  56. package/dist/components/date-picker.jsx.map +1 -0
  57. package/dist/components/date-range-input.d.ts +22 -0
  58. package/dist/components/date-range-input.d.ts.map +1 -0
  59. package/dist/components/date-range-input.jsx +202 -0
  60. package/dist/components/date-range-input.jsx.map +1 -0
  61. package/dist/components/dialog.d.ts +19 -0
  62. package/dist/components/dialog.d.ts.map +1 -0
  63. package/dist/components/dialog.jsx +30 -0
  64. package/dist/components/dialog.jsx.map +1 -0
  65. package/dist/components/diff-view.d.ts +24 -0
  66. package/dist/components/diff-view.d.ts.map +1 -0
  67. package/dist/components/diff-view.jsx +69 -0
  68. package/dist/components/diff-view.jsx.map +1 -0
  69. package/dist/components/dropdown-menu.d.ts +27 -0
  70. package/dist/components/dropdown-menu.d.ts.map +1 -0
  71. package/dist/components/dropdown-menu.jsx +48 -0
  72. package/dist/components/dropdown-menu.jsx.map +1 -0
  73. package/dist/components/empty.d.ts +15 -0
  74. package/dist/components/empty.d.ts.map +1 -0
  75. package/dist/components/empty.jsx +27 -0
  76. package/dist/components/empty.jsx.map +1 -0
  77. package/dist/components/field.d.ts +23 -0
  78. package/dist/components/field.d.ts.map +1 -0
  79. package/dist/components/field.jsx +60 -0
  80. package/dist/components/field.jsx.map +1 -0
  81. package/dist/components/file-input.d.ts +50 -0
  82. package/dist/components/file-input.d.ts.map +1 -0
  83. package/dist/components/file-input.jsx +104 -0
  84. package/dist/components/file-input.jsx.map +1 -0
  85. package/dist/components/form.d.ts +20 -0
  86. package/dist/components/form.d.ts.map +1 -0
  87. package/dist/components/form.jsx +66 -0
  88. package/dist/components/form.jsx.map +1 -0
  89. package/dist/components/info-tooltip.d.ts +11 -0
  90. package/dist/components/info-tooltip.d.ts.map +1 -0
  91. package/dist/components/info-tooltip.jsx +17 -0
  92. package/dist/components/info-tooltip.jsx.map +1 -0
  93. package/dist/components/input.d.ts +13 -0
  94. package/dist/components/input.d.ts.map +1 -0
  95. package/dist/components/input.jsx +19 -0
  96. package/dist/components/input.jsx.map +1 -0
  97. package/dist/components/json-editor.d.ts +23 -0
  98. package/dist/components/json-editor.d.ts.map +1 -0
  99. package/dist/components/json-editor.jsx +143 -0
  100. package/dist/components/json-editor.jsx.map +1 -0
  101. package/dist/components/kbd.d.ts +15 -0
  102. package/dist/components/kbd.d.ts.map +1 -0
  103. package/dist/components/kbd.jsx +23 -0
  104. package/dist/components/kbd.jsx.map +1 -0
  105. package/dist/components/key-value-editor.d.ts +92 -0
  106. package/dist/components/key-value-editor.d.ts.map +1 -0
  107. package/dist/components/key-value-editor.jsx +187 -0
  108. package/dist/components/key-value-editor.jsx.map +1 -0
  109. package/dist/components/keyboard-shortcuts-help.d.ts +17 -0
  110. package/dist/components/keyboard-shortcuts-help.d.ts.map +1 -0
  111. package/dist/components/keyboard-shortcuts-help.jsx +97 -0
  112. package/dist/components/keyboard-shortcuts-help.jsx.map +1 -0
  113. package/dist/components/label.d.ts +5 -0
  114. package/dist/components/label.d.ts.map +1 -0
  115. package/dist/components/label.jsx +8 -0
  116. package/dist/components/label.jsx.map +1 -0
  117. package/dist/components/media-preview.d.ts +30 -0
  118. package/dist/components/media-preview.d.ts.map +1 -0
  119. package/dist/components/media-preview.jsx +189 -0
  120. package/dist/components/media-preview.jsx.map +1 -0
  121. package/dist/components/multi-file-input.d.ts +76 -0
  122. package/dist/components/multi-file-input.d.ts.map +1 -0
  123. package/dist/components/multi-file-input.jsx +131 -0
  124. package/dist/components/multi-file-input.jsx.map +1 -0
  125. package/dist/components/password-input.d.ts +10 -0
  126. package/dist/components/password-input.d.ts.map +1 -0
  127. package/dist/components/password-input.jsx +18 -0
  128. package/dist/components/password-input.jsx.map +1 -0
  129. package/dist/components/popover.d.ts +7 -0
  130. package/dist/components/popover.d.ts.map +1 -0
  131. package/dist/components/popover.jsx +11 -0
  132. package/dist/components/popover.jsx.map +1 -0
  133. package/dist/components/revision-timeline.d.ts +30 -0
  134. package/dist/components/revision-timeline.d.ts.map +1 -0
  135. package/dist/components/revision-timeline.jsx +42 -0
  136. package/dist/components/revision-timeline.jsx.map +1 -0
  137. package/dist/components/richtext-editor.d.ts +43 -0
  138. package/dist/components/richtext-editor.d.ts.map +1 -0
  139. package/dist/components/richtext-editor.jsx +319 -0
  140. package/dist/components/richtext-editor.jsx.map +1 -0
  141. package/dist/components/richtext-mode.d.ts +23 -0
  142. package/dist/components/richtext-mode.d.ts.map +1 -0
  143. package/dist/components/richtext-mode.js +36 -0
  144. package/dist/components/richtext-mode.js.map +1 -0
  145. package/dist/components/richtext-render.d.ts +8 -0
  146. package/dist/components/richtext-render.d.ts.map +1 -0
  147. package/dist/components/richtext-render.jsx +33 -0
  148. package/dist/components/richtext-render.jsx.map +1 -0
  149. package/dist/components/richtext-sync.d.ts +37 -0
  150. package/dist/components/richtext-sync.d.ts.map +1 -0
  151. package/dist/components/richtext-sync.js +46 -0
  152. package/dist/components/richtext-sync.js.map +1 -0
  153. package/dist/components/scroll-area.d.ts +5 -0
  154. package/dist/components/scroll-area.d.ts.map +1 -0
  155. package/dist/components/scroll-area.jsx +16 -0
  156. package/dist/components/scroll-area.jsx.map +1 -0
  157. package/dist/components/select.d.ts +36 -0
  158. package/dist/components/select.d.ts.map +1 -0
  159. package/dist/components/select.jsx +87 -0
  160. package/dist/components/select.jsx.map +1 -0
  161. package/dist/components/separator.d.ts +4 -0
  162. package/dist/components/separator.d.ts.map +1 -0
  163. package/dist/components/separator.jsx +6 -0
  164. package/dist/components/separator.jsx.map +1 -0
  165. package/dist/components/sheet.d.ts +29 -0
  166. package/dist/components/sheet.d.ts.map +1 -0
  167. package/dist/components/sheet.jsx +44 -0
  168. package/dist/components/sheet.jsx.map +1 -0
  169. package/dist/components/sidebar.d.ts +70 -0
  170. package/dist/components/sidebar.d.ts.map +1 -0
  171. package/dist/components/sidebar.jsx +245 -0
  172. package/dist/components/sidebar.jsx.map +1 -0
  173. package/dist/components/skeleton.d.ts +3 -0
  174. package/dist/components/skeleton.d.ts.map +1 -0
  175. package/dist/components/skeleton.jsx +6 -0
  176. package/dist/components/skeleton.jsx.map +1 -0
  177. package/dist/components/sonner.d.ts +6 -0
  178. package/dist/components/sonner.d.ts.map +1 -0
  179. package/dist/components/sonner.jsx +29 -0
  180. package/dist/components/sonner.jsx.map +1 -0
  181. package/dist/components/switch.d.ts +4 -0
  182. package/dist/components/switch.d.ts.map +1 -0
  183. package/dist/components/switch.jsx +8 -0
  184. package/dist/components/switch.jsx.map +1 -0
  185. package/dist/components/table.d.ts +10 -0
  186. package/dist/components/table.d.ts.map +1 -0
  187. package/dist/components/table.jsx +21 -0
  188. package/dist/components/table.jsx.map +1 -0
  189. package/dist/components/tabs.d.ts +7 -0
  190. package/dist/components/tabs.d.ts.map +1 -0
  191. package/dist/components/tabs.jsx +14 -0
  192. package/dist/components/tabs.jsx.map +1 -0
  193. package/dist/components/textarea.d.ts +4 -0
  194. package/dist/components/textarea.d.ts.map +1 -0
  195. package/dist/components/textarea.jsx +5 -0
  196. package/dist/components/textarea.jsx.map +1 -0
  197. package/dist/components/tooltip.d.ts +7 -0
  198. package/dist/components/tooltip.d.ts.map +1 -0
  199. package/dist/components/tooltip.jsx +11 -0
  200. package/dist/components/tooltip.jsx.map +1 -0
  201. package/dist/index.d.ts +52 -0
  202. package/dist/index.d.ts.map +1 -0
  203. package/dist/index.js +72 -0
  204. package/dist/index.js.map +1 -0
  205. package/dist/lib/theme.d.ts +11 -0
  206. package/dist/lib/theme.d.ts.map +1 -0
  207. package/dist/lib/theme.js +44 -0
  208. package/dist/lib/theme.js.map +1 -0
  209. package/dist/lib/utils.d.ts +3 -0
  210. package/dist/lib/utils.d.ts.map +1 -0
  211. package/dist/lib/utils.js +6 -0
  212. package/dist/lib/utils.js.map +1 -0
  213. package/dist/styles.css +242 -0
  214. package/package.json +85 -0
  215. package/src/components/accordion.tsx +48 -0
  216. package/src/components/alert-dialog.tsx +113 -0
  217. package/src/components/audit-timeline.tsx +102 -0
  218. package/src/components/avatar.tsx +42 -0
  219. package/src/components/badge.tsx +34 -0
  220. package/src/components/breadcrumb.tsx +99 -0
  221. package/src/components/button.tsx +58 -0
  222. package/src/components/calendar.tsx +176 -0
  223. package/src/components/card.tsx +60 -0
  224. package/src/components/chart.tsx +558 -0
  225. package/src/components/checkbox.tsx +23 -0
  226. package/src/components/combobox.tsx +264 -0
  227. package/src/components/command.tsx +120 -0
  228. package/src/components/date-picker.tsx +221 -0
  229. package/src/components/date-range-input.tsx +295 -0
  230. package/src/components/dialog.tsx +94 -0
  231. package/src/components/diff-view.tsx +182 -0
  232. package/src/components/dropdown-menu.tsx +165 -0
  233. package/src/components/empty.tsx +100 -0
  234. package/src/components/field.tsx +168 -0
  235. package/src/components/file-input.tsx +233 -0
  236. package/src/components/form.tsx +152 -0
  237. package/src/components/info-tooltip.tsx +40 -0
  238. package/src/components/input.tsx +55 -0
  239. package/src/components/json-editor.tsx +210 -0
  240. package/src/components/kbd.tsx +35 -0
  241. package/src/components/key-value-editor.tsx +423 -0
  242. package/src/components/keyboard-shortcuts-help.tsx +136 -0
  243. package/src/components/label.tsx +16 -0
  244. package/src/components/media-preview.tsx +278 -0
  245. package/src/components/multi-file-input.tsx +315 -0
  246. package/src/components/password-input.tsx +50 -0
  247. package/src/components/popover.tsx +26 -0
  248. package/src/components/revision-timeline.tsx +93 -0
  249. package/src/components/richtext-editor.tsx +624 -0
  250. package/src/components/richtext-mode.ts +39 -0
  251. package/src/components/richtext-render.tsx +51 -0
  252. package/src/components/richtext-sync.ts +57 -0
  253. package/src/components/scroll-area.tsx +41 -0
  254. package/src/components/select.tsx +200 -0
  255. package/src/components/separator.tsx +21 -0
  256. package/src/components/sheet.tsx +109 -0
  257. package/src/components/sidebar.tsx +660 -0
  258. package/src/components/skeleton.tsx +9 -0
  259. package/src/components/sonner.tsx +45 -0
  260. package/src/components/switch.tsx +24 -0
  261. package/src/components/table.tsx +93 -0
  262. package/src/components/tabs.tsx +57 -0
  263. package/src/components/textarea.tsx +18 -0
  264. package/src/components/tooltip.tsx +25 -0
  265. package/src/index.ts +342 -0
  266. package/src/lib/theme.ts +45 -0
  267. package/src/lib/utils.ts +6 -0
  268. package/src/styles.css +242 -0
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ /**
4
+ * Thin wrapper around `SelectPrimitive.Root` that suppresses the spurious
5
+ * empty-string callback Radix fires through its hidden bubble-input while
6
+ * `SelectItem` nodes register lazily via Portal after an external `value`
7
+ * change (e.g. `form.reset()` after an async data load). Without this guard
8
+ * the externally-set value is immediately overwritten with `''`.
9
+ *
10
+ * The empty string is never a legitimate choice from a rendered `SelectItem`,
11
+ * so dropping it is always safe. Call sites should NOT add their own
12
+ * `if (v === '') return` guards — this component handles it centrally.
13
+ */
14
+ declare function SelectRoot({ onValueChange, ...props }: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>): React.ReactElement;
15
+ declare namespace SelectRoot {
16
+ var displayName: string;
17
+ }
18
+ export declare const Select: typeof SelectRoot;
19
+ export declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
20
+ export declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
21
+ export declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
22
+ export declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
+ export declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
24
+ export declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
+ export declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
26
+ export declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
27
+ export declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
+ /**
29
+ * Plain native `<select>` styled to match the rest of the kit. Useful when
30
+ * you need a no-JS, SSR-friendly fallback or simple form posts. Most call
31
+ * sites should prefer the Radix-based `Select` family above.
32
+ */
33
+ export type NativeSelectProps = React.SelectHTMLAttributes<HTMLSelectElement>;
34
+ export declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
35
+ export {};
36
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAIzD;;;;;;;;;;GAUG;AACH,iBAAS,UAAU,CAAC,EAClB,aAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,YAAY,CAQlF;kBAXQ,UAAU;;;AAcnB,eAAO,MAAM,MAAM,mBAAa,CAAA;AAChC,eAAO,MAAM,WAAW,yGAAwB,CAAA;AAChD,eAAO,MAAM,WAAW,0GAAwB,CAAA;AAEhD,eAAO,MAAM,aAAa,oKAgCxB,CAAA;AAGF,eAAO,MAAM,oBAAoB,qKAW/B,CAAA;AAGF,eAAO,MAAM,sBAAsB,uKAWjC,CAAA;AAGF,eAAO,MAAM,aAAa,8JA6BxB,CAAA;AAGF,eAAO,MAAM,WAAW,4JAStB,CAAA;AAGF,eAAO,MAAM,UAAU,2JAsBrB,CAAA;AAGF,eAAO,MAAM,eAAe,gKAS1B,CAAA;AAGF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;AAE7E,eAAO,MAAM,YAAY,6FAaxB,CAAA"}
@@ -0,0 +1,87 @@
1
+ import * as React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ import { Check, ChevronDown, ChevronUp } from 'lucide-react';
4
+ import { cn } from '../lib/utils.js';
5
+ /**
6
+ * Thin wrapper around `SelectPrimitive.Root` that suppresses the spurious
7
+ * empty-string callback Radix fires through its hidden bubble-input while
8
+ * `SelectItem` nodes register lazily via Portal after an external `value`
9
+ * change (e.g. `form.reset()` after an async data load). Without this guard
10
+ * the externally-set value is immediately overwritten with `''`.
11
+ *
12
+ * The empty string is never a legitimate choice from a rendered `SelectItem`,
13
+ * so dropping it is always safe. Call sites should NOT add their own
14
+ * `if (v === '') return` guards — this component handles it centrally.
15
+ */
16
+ function SelectRoot({ onValueChange, ...props }) {
17
+ const handleValueChange = React.useCallback((value) => {
18
+ if (value !== '')
19
+ onValueChange?.(value);
20
+ }, [onValueChange]);
21
+ return <SelectPrimitive.Root onValueChange={handleValueChange} {...props}/>;
22
+ }
23
+ SelectRoot.displayName = 'Select';
24
+ export const Select = SelectRoot;
25
+ export const SelectGroup = SelectPrimitive.Group;
26
+ export const SelectValue = SelectPrimitive.Value;
27
+ export const SelectTrigger = React.forwardRef(({ className, children, onMouseEnter, ...props }, ref) => {
28
+ const handleMouseEnter = (e) => {
29
+ // Set native title only when the value span is actually clipped so the
30
+ // tooltip doesn't appear redundantly on short values.
31
+ const valueSpan = e.currentTarget.querySelector('span');
32
+ if (valueSpan && valueSpan.scrollWidth > valueSpan.offsetWidth) {
33
+ e.currentTarget.title = valueSpan.textContent ?? '';
34
+ }
35
+ else {
36
+ e.currentTarget.removeAttribute('title');
37
+ }
38
+ onMouseEnter?.(e);
39
+ };
40
+ return (<SelectPrimitive.Trigger ref={ref} className={cn('flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', className)} onMouseEnter={handleMouseEnter} {...props}>
41
+ {children}
42
+ <SelectPrimitive.Icon asChild>
43
+ <ChevronDown className="h-4 w-4 opacity-50"/>
44
+ </SelectPrimitive.Icon>
45
+ </SelectPrimitive.Trigger>);
46
+ });
47
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
48
+ export const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.ScrollUpButton ref={ref} className={cn('flex cursor-default items-center justify-center py-1', className)} {...props}>
49
+ <ChevronUp className="h-4 w-4"/>
50
+ </SelectPrimitive.ScrollUpButton>));
51
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
52
+ export const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.ScrollDownButton ref={ref} className={cn('flex cursor-default items-center justify-center py-1', className)} {...props}>
53
+ <ChevronDown className="h-4 w-4"/>
54
+ </SelectPrimitive.ScrollDownButton>));
55
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
56
+ export const SelectContent = React.forwardRef(({ className, children, position = 'popper', ...props }, ref) => (<SelectPrimitive.Portal>
57
+ <SelectPrimitive.Content ref={ref} className={cn('relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2', position === 'popper' &&
58
+ 'data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1', className)} position={position} {...props}>
59
+ <SelectScrollUpButton />
60
+ <SelectPrimitive.Viewport className={cn('p-1', position === 'popper' &&
61
+ 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]')}>
62
+ {children}
63
+ </SelectPrimitive.Viewport>
64
+ <SelectScrollDownButton />
65
+ </SelectPrimitive.Content>
66
+ </SelectPrimitive.Portal>));
67
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
68
+ export const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.Label ref={ref} className={cn('px-2 py-1.5 text-sm font-semibold', className)} {...props}/>));
69
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
70
+ export const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (<SelectPrimitive.Item ref={ref} className={cn('relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className)} title={typeof children === 'string' ? children : undefined} {...props}>
71
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
72
+ <SelectPrimitive.ItemIndicator>
73
+ <Check className="h-4 w-4"/>
74
+ </SelectPrimitive.ItemIndicator>
75
+ </span>
76
+ <SelectPrimitive.ItemText>
77
+ <span className="block truncate">{children}</span>
78
+ </SelectPrimitive.ItemText>
79
+ </SelectPrimitive.Item>));
80
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
81
+ export const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (<SelectPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-muted', className)} {...props}/>));
82
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
83
+ export const NativeSelect = React.forwardRef(({ className, children, ...props }, ref) => (<select ref={ref} className={cn('flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className)} {...props}>
84
+ {children}
85
+ </select>));
86
+ NativeSelect.displayName = 'NativeSelect';
87
+ //# sourceMappingURL=select.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.jsx","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC;;;;;;;;;;GAUG;AACH,SAAS,UAAU,CAAC,EAClB,aAAa,EACb,GAAG,KAAK,EACoD;IAC5D,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CACzC,CAAC,KAAa,EAAE,EAAE;QAChB,IAAI,KAAK,KAAK,EAAE;YAAE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,CACrD,IAAI,KAAK,CAAC,EACV,CACH,CAAC,CAAA;AACF,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,SAAS,CAAC,WAAW,CAAA;AASnE,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAC1C,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC1C,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,SAAS,CAAC,CAAC,EAAE,CACX,kNAAkN,EAClN,SAAS,CACV,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,MAAM,CAAC,CACV,CACF,CAAA;AACD,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA"}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
+ export declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ //# sourceMappingURL=separator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAG/D,eAAO,MAAM,SAAS,6JAepB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
+ import { cn } from '../lib/utils.js';
4
+ export const Separator = React.forwardRef(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (<SeparatorPrimitive.Root ref={ref} decorative={decorative} orientation={orientation} className={cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className)} {...props}/>));
5
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
6
+ //# sourceMappingURL=separator.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separator.jsx","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAGvC,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,YAAY,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACjF,CAAC,kBAAkB,CAAC,IAAI,CACtB,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,SAAS,CAAC,CAAC,EAAE,CACX,oBAAoB,EACpB,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,EAC5D,SAAS,CACV,CAAC,CACF,IAAI,KAAK,CAAC,EACV,CACH,CAAC,CAAA;AACF,SAAS,CAAC,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAA"}
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
3
+ import { type VariantProps } from 'class-variance-authority';
4
+ export declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
5
+ export declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ export declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ export declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
8
+ export declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const sheetVariants: (props?: ({
10
+ side?: "top" | "right" | "bottom" | "left" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ export interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
13
+ /** Set to true to suppress the built-in absolute close button (e.g. when
14
+ * the consumer renders its own close control inside the header). */
15
+ hideCloseButton?: boolean;
16
+ }
17
+ export declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
18
+ export declare const SheetHeader: {
19
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
20
+ displayName: string;
21
+ };
22
+ export declare const SheetFooter: {
23
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
24
+ displayName: string;
25
+ };
26
+ export declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
27
+ export declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
28
+ export {};
29
+ //# sourceMappingURL=sheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,eAAO,MAAM,KAAK,sCAAsB,CAAA;AACxC,eAAO,MAAM,YAAY,6GAAyB,CAAA;AAClD,eAAO,MAAM,UAAU,2GAAuB,CAAA;AAC9C,eAAO,MAAM,WAAW,4CAAwB,CAAA;AAEhD,eAAO,MAAM,YAAY,6JAYvB,CAAA;AAGF,QAAA,MAAM,aAAa;;8EAelB,CAAA;AAED,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,EACnE,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC;yEACqE;IACrE,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED,eAAO,MAAM,YAAY,0FAgBvB,CAAA;AAGF,eAAO,MAAM,WAAW;8BAA6B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY;;CAE7G,CAAA;AAGD,eAAO,MAAM,WAAW;8BAA6B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY;;CAK7G,CAAA;AAGD,eAAO,MAAM,UAAU,mKASrB,CAAA;AAGF,eAAO,MAAM,gBAAgB,6KAS3B,CAAA"}
@@ -0,0 +1,44 @@
1
+ // shadcn-style Sheet — side-anchored Dialog. Built on @radix-ui/react-dialog,
2
+ // shares the same primitive as <Dialog>. Variants: top / bottom / left / right.
3
+ import * as React from 'react';
4
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
5
+ import { cva } from 'class-variance-authority';
6
+ import { X } from 'lucide-react';
7
+ import { cn } from '../lib/utils.js';
8
+ export const Sheet = SheetPrimitive.Root;
9
+ export const SheetTrigger = SheetPrimitive.Trigger;
10
+ export const SheetClose = SheetPrimitive.Close;
11
+ export const SheetPortal = SheetPrimitive.Portal;
12
+ export const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Overlay ref={ref} className={cn('fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0', className)} {...props}/>));
13
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
14
+ const sheetVariants = cva('fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', {
15
+ variants: {
16
+ side: {
17
+ top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
18
+ bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
19
+ left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
20
+ right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
21
+ },
22
+ },
23
+ defaultVariants: { side: 'right' },
24
+ });
25
+ export const SheetContent = React.forwardRef(({ side = 'right', className, children, hideCloseButton, ...props }, ref) => (<SheetPortal>
26
+ <SheetOverlay />
27
+ <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
28
+ {children}
29
+ {!hideCloseButton && (<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
30
+ <X className="size-4"/>
31
+ <span className="sr-only">Close</span>
32
+ </SheetPrimitive.Close>)}
33
+ </SheetPrimitive.Content>
34
+ </SheetPortal>));
35
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
36
+ export const SheetHeader = ({ className, ...props }) => (<div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props}/>);
37
+ SheetHeader.displayName = 'SheetHeader';
38
+ export const SheetFooter = ({ className, ...props }) => (<div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props}/>);
39
+ SheetFooter.displayName = 'SheetFooter';
40
+ export const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Title ref={ref} className={cn('text-lg font-semibold text-foreground', className)} {...props}/>));
41
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
42
+ export const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (<SheetPrimitive.Description ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props}/>));
43
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
44
+ //# sourceMappingURL=sheet.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet.jsx","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAEhF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC,MAAM,CAAC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAA;AACxC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,CAAA;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAA;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAA;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAG1C,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClC,CAAC,cAAc,CAAC,OAAO,CACrB,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,SAAS,CAAC,CAAC,EAAE,CACX,wJAAwJ,EACxJ,SAAS,CACV,CAAC,CACF,IAAI,KAAK,CAAC,EACV,CACH,CAAC,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AG,cAAc,CAAC,WAAW,CAAC,WAAW,CAAA"}
@@ -0,0 +1,70 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ import { TooltipContent } from './tooltip.js';
4
+ interface SidebarContextValue {
5
+ state: 'expanded' | 'collapsed';
6
+ open: boolean;
7
+ setOpen(open: boolean): void;
8
+ openMobile: boolean;
9
+ setOpenMobile(open: boolean): void;
10
+ isMobile: boolean;
11
+ toggleSidebar(): void;
12
+ }
13
+ export declare function useSidebar(): SidebarContextValue;
14
+ export interface SidebarProviderProps extends React.HTMLAttributes<HTMLDivElement> {
15
+ defaultOpen?: boolean;
16
+ open?: boolean;
17
+ onOpenChange?(open: boolean): void;
18
+ }
19
+ export declare const SidebarProvider: React.ForwardRefExoticComponent<SidebarProviderProps & React.RefAttributes<HTMLDivElement>>;
20
+ export interface SidebarProps extends React.HTMLAttributes<HTMLDivElement> {
21
+ side?: 'left' | 'right';
22
+ variant?: 'sidebar' | 'floating' | 'inset';
23
+ collapsible?: 'offcanvas' | 'icon' | 'none';
24
+ }
25
+ export declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLDivElement>>;
26
+ export declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("./button.js").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
27
+ export declare const SidebarRail: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
28
+ export declare const SidebarInset: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
29
+ export declare const SidebarInput: React.ForwardRefExoticComponent<Omit<import("./input.js").InputProps & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
30
+ export declare const SidebarHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
31
+ export declare const SidebarFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
32
+ export declare const SidebarSeparator: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
+ export declare const SidebarContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
34
+ export declare const SidebarGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
35
+ export declare const SidebarGroupLabel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
36
+ asChild?: boolean;
37
+ } & React.RefAttributes<HTMLDivElement>>;
38
+ export declare const SidebarGroupAction: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
39
+ asChild?: boolean;
40
+ } & React.RefAttributes<HTMLButtonElement>>;
41
+ export declare const SidebarGroupContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
42
+ export declare const SidebarMenu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & React.RefAttributes<HTMLUListElement>>;
43
+ export declare const SidebarMenuItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
44
+ declare const sidebarMenuButtonVariants: (props?: ({
45
+ variant?: "default" | "outline" | null | undefined;
46
+ size?: "default" | "sm" | "lg" | null | undefined;
47
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
48
+ export interface SidebarMenuButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof sidebarMenuButtonVariants> {
49
+ asChild?: boolean;
50
+ isActive?: boolean;
51
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;
52
+ }
53
+ export declare const SidebarMenuButton: React.ForwardRefExoticComponent<SidebarMenuButtonProps & React.RefAttributes<HTMLButtonElement>>;
54
+ export declare const SidebarMenuAction: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
55
+ asChild?: boolean;
56
+ showOnHover?: boolean;
57
+ } & React.RefAttributes<HTMLButtonElement>>;
58
+ export declare const SidebarMenuBadge: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
59
+ export declare const SidebarMenuSkeleton: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
60
+ showIcon?: boolean;
61
+ } & React.RefAttributes<HTMLDivElement>>;
62
+ export declare const SidebarMenuSub: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & React.RefAttributes<HTMLUListElement>>;
63
+ export declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
64
+ export declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
65
+ asChild?: boolean;
66
+ size?: "sm" | "md";
67
+ isActive?: boolean;
68
+ } & React.RefAttributes<HTMLAnchorElement>>;
69
+ export {};
70
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/components/sidebar.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQjE,OAAO,EAAW,cAAc,EAAmC,MAAM,cAAc,CAAA;AAQvF,UAAU,mBAAmB;IAC3B,KAAK,EAAE,UAAU,GAAG,WAAW,CAAA;IAC/B,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IAC5B,UAAU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ASvB,CAAA;AAGD,eAAO,MAAM,eAAe,2GAS3B,CAAA;AAGD,QAAA,MAAM,yBAAyB;;;8EAiB9B,CAAA;AAED,MAAM,WAAW,sBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,yBAAyB,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,CAAA;CAC/D;AAED,eAAO,MAAM,iBAAiB,kGAuB7B,CAAA;AAGD,eAAO,MAAM,iBAAiB;cAEgC,OAAO;kBAAgB,OAAO;2CAqB1F,CAAA;AAGF,eAAO,MAAM,gBAAgB,6GAkB3B,CAAA;AAGF,eAAO,MAAM,mBAAmB;eAEsB,OAAO;wCAyB3D,CAAA;AAGF,eAAO,MAAM,cAAc,iHAa1B,CAAA;AAGD,eAAO,MAAM,kBAAkB,2GAE9B,CAAA;AAGD,eAAO,MAAM,oBAAoB;cAGnB,OAAO;WACV,IAAI,GAAG,IAAI;eACP,OAAO;2CAoBpB,CAAA"}
@@ -0,0 +1,245 @@
1
+ // shadcn-style Sidebar — collapsible side navigation built on Sheet (mobile)
2
+ // + a CSS-variable-driven layout (desktop). Composed of Provider/Sidebar/
3
+ // Inset + Group/Menu primitives. Faithful port of the canonical recipe at
4
+ // https://ui.shadcn.com/docs/components/sidebar with two project-specific
5
+ // tweaks: state is persisted in localStorage instead of cookies (so the
6
+ // component works in non-SSR Vite apps without server plumbing), and the
7
+ // `width-mobile`/`width-icon` CSS variables are exposed via the @theme
8
+ // block in styles.css. All other class names match the upstream component.
9
+ import * as React from 'react';
10
+ import { Slot } from '@radix-ui/react-slot';
11
+ import { cva } from 'class-variance-authority';
12
+ import { PanelLeft } from 'lucide-react';
13
+ import { cn } from '../lib/utils.js';
14
+ import { Button } from './button.js';
15
+ import { Input } from './input.js';
16
+ import { Separator } from './separator.js';
17
+ import { Sheet, SheetContent, SheetDescription, SheetTitle } from './sheet.js';
18
+ import { Skeleton } from './skeleton.js';
19
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip.js';
20
+ const SIDEBAR_STATE_KEY = 'sidebar:state';
21
+ const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
22
+ const SIDEBAR_WIDTH = '16rem';
23
+ const SIDEBAR_WIDTH_MOBILE = '18rem';
24
+ const SIDEBAR_WIDTH_ICON = '3rem';
25
+ const SidebarContext = React.createContext(null);
26
+ export function useSidebar() {
27
+ const ctx = React.useContext(SidebarContext);
28
+ if (!ctx)
29
+ throw new Error('useSidebar must be used within <SidebarProvider>');
30
+ return ctx;
31
+ }
32
+ function useIsMobile(breakpoint = 768) {
33
+ const [isMobile, setIsMobile] = React.useState(false);
34
+ React.useEffect(() => {
35
+ const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
36
+ const update = () => setIsMobile(mql.matches);
37
+ update();
38
+ mql.addEventListener('change', update);
39
+ return () => mql.removeEventListener('change', update);
40
+ }, [breakpoint]);
41
+ return isMobile;
42
+ }
43
+ export const SidebarProvider = React.forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref) => {
44
+ const isMobile = useIsMobile();
45
+ const [openMobile, setOpenMobile] = React.useState(false);
46
+ const [_open, _setOpen] = React.useState(() => {
47
+ if (typeof localStorage === 'undefined')
48
+ return defaultOpen;
49
+ const v = localStorage.getItem(SIDEBAR_STATE_KEY);
50
+ return v == null ? defaultOpen : v === 'true';
51
+ });
52
+ const open = openProp ?? _open;
53
+ const setOpen = React.useCallback((value) => {
54
+ const next = typeof value === 'function' ? value(open) : value;
55
+ if (setOpenProp)
56
+ setOpenProp(next);
57
+ else
58
+ _setOpen(next);
59
+ if (typeof localStorage !== 'undefined') {
60
+ localStorage.setItem(SIDEBAR_STATE_KEY, String(next));
61
+ }
62
+ }, [setOpenProp, open]);
63
+ const toggleSidebar = React.useCallback(() => {
64
+ if (isMobile)
65
+ setOpenMobile((v) => !v);
66
+ else
67
+ setOpen((v) => !v);
68
+ }, [isMobile, setOpen]);
69
+ React.useEffect(() => {
70
+ const onKey = (e) => {
71
+ if (e.key === SIDEBAR_KEYBOARD_SHORTCUT &&
72
+ (e.metaKey || e.ctrlKey) &&
73
+ !e.shiftKey &&
74
+ !e.altKey) {
75
+ e.preventDefault();
76
+ toggleSidebar();
77
+ }
78
+ };
79
+ window.addEventListener('keydown', onKey);
80
+ return () => window.removeEventListener('keydown', onKey);
81
+ }, [toggleSidebar]);
82
+ const state = open ? 'expanded' : 'collapsed';
83
+ const value = React.useMemo(() => ({
84
+ state,
85
+ open,
86
+ setOpen,
87
+ openMobile,
88
+ setOpenMobile,
89
+ isMobile,
90
+ toggleSidebar,
91
+ }), [state, open, setOpen, openMobile, isMobile, toggleSidebar]);
92
+ return (<SidebarContext.Provider value={value}>
93
+ <TooltipProvider delayDuration={0}>
94
+ <div ref={ref} data-slot="sidebar-wrapper" style={{
95
+ '--sidebar-width': SIDEBAR_WIDTH,
96
+ '--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
97
+ ...style,
98
+ }} className={cn('group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-muted', className)} {...props}>
99
+ {children}
100
+ </div>
101
+ </TooltipProvider>
102
+ </SidebarContext.Provider>);
103
+ });
104
+ SidebarProvider.displayName = 'SidebarProvider';
105
+ export const Sidebar = React.forwardRef(({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }, ref) => {
106
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
107
+ if (collapsible === 'none') {
108
+ return (<div ref={ref} className={cn('flex h-full w-[var(--sidebar-width)] flex-col bg-card text-foreground', className)} {...props}>
109
+ {children}
110
+ </div>);
111
+ }
112
+ if (isMobile) {
113
+ return (<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
114
+ <SheetContent data-sidebar="sidebar" data-mobile="true" side={side} className="w-[var(--sidebar-width)] bg-card p-0 text-foreground [&>button]:hidden" style={{ '--sidebar-width': SIDEBAR_WIDTH_MOBILE }}>
115
+ <SheetTitle className="sr-only">Sidebar</SheetTitle>
116
+ <SheetDescription className="sr-only">Navigation menu</SheetDescription>
117
+ <div className="flex h-full w-full flex-col">{children}</div>
118
+ </SheetContent>
119
+ </Sheet>);
120
+ }
121
+ return (<div ref={ref} className="group peer hidden text-foreground md:block" data-state={state} data-collapsible={state === 'collapsed' ? collapsible : ''} data-variant={variant} data-side={side}>
122
+ {/* Spacer that takes up width in flow */}
123
+ <div className={cn('relative h-svh w-[var(--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'
124
+ ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'
125
+ : 'group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]')}/>
126
+ {/* Actual sidebar — fixed-positioned, width animated */}
127
+ <div className={cn('fixed inset-y-0 z-40 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex', side === 'left'
128
+ ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
129
+ : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]', variant === 'floating' || variant === 'inset'
130
+ ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'
131
+ : 'group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l border-border', className)} {...props}>
132
+ <div data-sidebar="sidebar" className={cn('flex h-full w-full flex-col bg-card group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-border group-data-[variant=floating]:shadow')}>
133
+ {children}
134
+ </div>
135
+ </div>
136
+ </div>);
137
+ });
138
+ Sidebar.displayName = 'Sidebar';
139
+ export const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
140
+ const { toggleSidebar } = useSidebar();
141
+ return (<Button ref={ref} data-sidebar="trigger" variant="ghost" size="icon" className={cn('size-7', className)} onClick={(e) => {
142
+ onClick?.(e);
143
+ toggleSidebar();
144
+ }} {...props}>
145
+ <PanelLeft className="size-4"/>
146
+ <span className="sr-only">Toggle sidebar</span>
147
+ </Button>);
148
+ });
149
+ SidebarTrigger.displayName = 'SidebarTrigger';
150
+ export const SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
151
+ const { toggleSidebar } = useSidebar();
152
+ return (<button ref={ref} type="button" data-sidebar="rail" aria-label="Toggle sidebar" tabIndex={-1} onClick={toggleSidebar} title="Toggle sidebar" className={cn('absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex', '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize', '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize', 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-card', '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2', '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2', className)} {...props}/>);
153
+ });
154
+ SidebarRail.displayName = 'SidebarRail';
155
+ export const SidebarInset = React.forwardRef(({ className, ...props }, ref) => (<main ref={ref} className={cn('relative flex min-h-svh flex-1 flex-col bg-background', 'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow', className)} {...props}/>));
156
+ SidebarInset.displayName = 'SidebarInset';
157
+ export const SidebarInput = React.forwardRef(({ className, ...props }, ref) => (<Input ref={ref} data-sidebar="input" className={cn('h-8 w-full bg-background shadow-none focus-visible:ring-2', className)} {...props}/>));
158
+ SidebarInput.displayName = 'SidebarInput';
159
+ export const SidebarHeader = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="header" className={cn('flex flex-col gap-2 p-2', className)} {...props}/>));
160
+ SidebarHeader.displayName = 'SidebarHeader';
161
+ export const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="footer" className={cn('flex flex-col gap-2 p-2', className)} {...props}/>));
162
+ SidebarFooter.displayName = 'SidebarFooter';
163
+ export const SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => (<Separator ref={ref} data-sidebar="separator" className={cn('mx-2 w-auto bg-border', className)} {...props}/>));
164
+ SidebarSeparator.displayName = 'SidebarSeparator';
165
+ export const SidebarContent = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="content" className={cn('flex py-2 min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden', className)} {...props}/>));
166
+ SidebarContent.displayName = 'SidebarContent';
167
+ export const SidebarGroup = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="group" className={cn('relative flex w-full min-w-0 flex-col px-2 py-1', className)} {...props}/>));
168
+ SidebarGroup.displayName = 'SidebarGroup';
169
+ export const SidebarGroupLabel = React.forwardRef(({ className, asChild, ...props }, ref) => {
170
+ const Comp = asChild ? Slot : 'div';
171
+ return (<Comp ref={ref} data-sidebar="group-label" className={cn('flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-muted-foreground outline-none ring-ring 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}/>);
172
+ });
173
+ SidebarGroupLabel.displayName = 'SidebarGroupLabel';
174
+ export const SidebarGroupAction = React.forwardRef(({ className, asChild, ...props }, ref) => {
175
+ const Comp = asChild ? Slot : 'button';
176
+ return (<Comp ref={ref} data-sidebar="group-action" className={cn('absolute right-3 top-3.5 flex aspect-square w-5 cursor-pointer items-center justify-center rounded-md p-0 text-muted-foreground outline-none ring-ring transition-transform hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className)} {...props}/>);
177
+ });
178
+ SidebarGroupAction.displayName = 'SidebarGroupAction';
179
+ export const SidebarGroupContent = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="group-content" className={cn('w-full text-sm', className)} {...props}/>));
180
+ SidebarGroupContent.displayName = 'SidebarGroupContent';
181
+ export const SidebarMenu = React.forwardRef(({ className, ...props }, ref) => (<ul ref={ref} data-sidebar="menu" className={cn('flex w-full min-w-0 flex-col gap-1', className)} {...props}/>));
182
+ SidebarMenu.displayName = 'SidebarMenu';
183
+ export const SidebarMenuItem = React.forwardRef(({ className, ...props }, ref) => (<li ref={ref} data-sidebar="menu-item" className={cn('group/menu-item relative', className)} {...props}/>));
184
+ SidebarMenuItem.displayName = 'SidebarMenuItem';
185
+ const sidebarMenuButtonVariants = cva('peer/menu-button flex w-full cursor-pointer items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-ring transition-[width,height,padding] hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground 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-accent data-[active=true]:font-medium data-[active=true]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:hover:text-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', {
186
+ variants: {
187
+ variant: {
188
+ default: 'hover:bg-accent hover:text-accent-foreground',
189
+ outline: 'bg-background shadow-[0_0_0_1px_hsl(var(--border))] hover:bg-accent hover:text-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--accent))]',
190
+ },
191
+ size: {
192
+ default: 'h-8 text-sm',
193
+ sm: 'h-7 text-xs',
194
+ lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
195
+ },
196
+ },
197
+ defaultVariants: { variant: 'default', size: 'default' },
198
+ });
199
+ export const SidebarMenuButton = React.forwardRef(({ asChild, isActive, variant, size, tooltip, className, ...props }, ref) => {
200
+ const Comp = asChild ? Slot : 'button';
201
+ const { isMobile, state } = useSidebar();
202
+ const button = (<Comp ref={ref} data-sidebar="menu-button" data-size={size ?? 'default'} data-active={isActive} className={cn(sidebarMenuButtonVariants({ variant, size }), className)} {...props}/>);
203
+ if (!tooltip)
204
+ return button;
205
+ const tooltipProps = typeof tooltip === 'string' ? { children: tooltip } : tooltip;
206
+ return (<Tooltip>
207
+ <TooltipTrigger asChild>{button}</TooltipTrigger>
208
+ <TooltipContent side="right" align="center" hidden={state !== 'collapsed' || isMobile} {...tooltipProps}/>
209
+ </Tooltip>);
210
+ });
211
+ SidebarMenuButton.displayName = 'SidebarMenuButton';
212
+ export const SidebarMenuAction = React.forwardRef(({ className, asChild, showOnHover, ...props }, ref) => {
213
+ const Comp = asChild ? Slot : 'button';
214
+ return (<Comp ref={ref} data-sidebar="menu-action" className={cn('absolute right-1 top-1.5 flex aspect-square w-5 cursor-pointer items-center justify-center rounded-md p-0 text-muted-foreground outline-none ring-ring transition-transform hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0', '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 &&
215
+ 'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-accent-foreground md:opacity-0', className)} {...props}/>);
216
+ });
217
+ SidebarMenuAction.displayName = 'SidebarMenuAction';
218
+ export const SidebarMenuBadge = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="menu-badge" className={cn('pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-muted-foreground', 'peer-hover/menu-button:text-accent-foreground peer-data-[active=true]/menu-button:text-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}/>));
219
+ SidebarMenuBadge.displayName = 'SidebarMenuBadge';
220
+ export const SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...props }, ref) => {
221
+ const id = React.useId();
222
+ // Derive a stable per-instance pseudo-random width (50%..90%) from useId so
223
+ // skeleton rows visually vary without violating component purity.
224
+ const width = React.useMemo(() => {
225
+ let h = 0;
226
+ for (let i = 0; i < id.length; i++)
227
+ h = (h * 31 + id.charCodeAt(i)) | 0;
228
+ return `${50 + (Math.abs(h) % 40)}%`;
229
+ }, [id]);
230
+ return (<div ref={ref} data-sidebar="menu-skeleton" className={cn('flex h-8 items-center gap-2 rounded-md px-2', className)} {...props}>
231
+ {showIcon && <Skeleton className="size-4 rounded-md" data-sidebar="menu-skeleton-icon"/>}
232
+ <Skeleton className="h-4 max-w-[var(--skeleton-width)] flex-1" data-sidebar="menu-skeleton-text" style={{ '--skeleton-width': width }}/>
233
+ </div>);
234
+ });
235
+ SidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';
236
+ export const SidebarMenuSub = React.forwardRef(({ className, ...props }, ref) => (<ul ref={ref} data-sidebar="menu-sub" className={cn('mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-border px-2.5 py-0.5', 'group-data-[collapsible=icon]:hidden', className)} {...props}/>));
237
+ SidebarMenuSub.displayName = 'SidebarMenuSub';
238
+ export const SidebarMenuSubItem = React.forwardRef(({ ...props }, ref) => <li ref={ref} {...props}/>);
239
+ SidebarMenuSubItem.displayName = 'SidebarMenuSubItem';
240
+ export const SidebarMenuSubButton = React.forwardRef(({ asChild, size = 'md', isActive, className, ...props }, ref) => {
241
+ const Comp = asChild ? Slot : 'a';
242
+ return (<Comp ref={ref} data-sidebar="menu-sub-button" data-size={size} data-active={isActive} className={cn('flex h-7 min-w-0 -translate-x-px cursor-pointer items-center gap-2 overflow-hidden rounded-md px-2 text-sm text-foreground outline-none ring-ring hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 active:bg-accent active:text-accent-foreground 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 [&>svg]:text-muted-foreground', 'data-[active=true]:bg-accent data-[active=true]:text-accent-foreground', size === 'sm' && 'text-xs', 'group-data-[collapsible=icon]:hidden', className)} {...props}/>);
243
+ });
244
+ SidebarMenuSubButton.displayName = 'SidebarMenuSubButton';
245
+ //# sourceMappingURL=sidebar.jsx.map