@leonardaustin/ui 0.25.0 → 0.26.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 (279) hide show
  1. package/README.md +11 -0
  2. package/dist/components/app-shell/AppShell.d.ts +3 -3
  3. package/dist/components/app-shell/AppShell.js +82 -0
  4. package/dist/components/app-shell/AuthLayout.d.ts +3 -3
  5. package/dist/components/app-shell/AuthLayout.js +16 -0
  6. package/dist/components/app-shell/BackLink.d.ts +3 -3
  7. package/dist/components/app-shell/BackLink.js +19 -0
  8. package/dist/components/app-shell/BottomNav.d.ts +3 -2
  9. package/dist/components/app-shell/BottomNav.js +37 -0
  10. package/dist/components/app-shell/Breadcrumbs.d.ts +3 -2
  11. package/dist/components/app-shell/Breadcrumbs.js +46 -0
  12. package/dist/components/app-shell/CommandPalette.d.ts +3 -2
  13. package/dist/components/app-shell/CommandPalette.js +119 -0
  14. package/dist/components/app-shell/MobileDrawer.d.ts +3 -3
  15. package/dist/components/app-shell/MobileDrawer.js +128 -0
  16. package/dist/components/app-shell/Sidebar.d.ts +3 -3
  17. package/dist/components/app-shell/Sidebar.js +355 -0
  18. package/dist/components/app-shell/ThemeMenu.d.ts +3 -2
  19. package/dist/components/app-shell/ThemeMenu.js +273 -0
  20. package/dist/components/app-shell/TopBar.d.ts +3 -3
  21. package/dist/components/app-shell/TopBar.js +129 -0
  22. package/dist/components/app-shell/commandPaletteEvents.js +16 -0
  23. package/dist/components/app-shell/navigation.js +21 -0
  24. package/dist/components/app-shell/themeMenuEvents.js +7 -0
  25. package/dist/components/charts/AreaChart.d.ts +4 -3
  26. package/dist/components/charts/AreaChart.js +217 -0
  27. package/dist/components/charts/BarChart.d.ts +4 -3
  28. package/dist/components/charts/BarChart.js +91 -0
  29. package/dist/components/charts/DonutChart.d.ts +4 -3
  30. package/dist/components/charts/DonutChart.js +172 -0
  31. package/dist/components/charts/RadarChart.d.ts +4 -3
  32. package/dist/components/charts/RadarChart.js +142 -0
  33. package/dist/components/charts/RadialBarChart.d.ts +4 -3
  34. package/dist/components/charts/RadialBarChart.js +219 -0
  35. package/dist/components/charts/SparkLine.d.ts +4 -3
  36. package/dist/components/charts/SparkLine.js +39 -0
  37. package/dist/components/charts/StackedBarChart.d.ts +4 -3
  38. package/dist/components/charts/StackedBarChart.js +249 -0
  39. package/dist/components/charts/VerticalBarChart.d.ts +4 -3
  40. package/dist/components/charts/VerticalBarChart.js +143 -0
  41. package/dist/components/charts/chartUtils.js +68 -0
  42. package/dist/components/tables/ColumnPicker.d.ts +3 -3
  43. package/dist/components/tables/ColumnPicker.js +59 -0
  44. package/dist/components/tables/Pagination.d.ts +3 -3
  45. package/dist/components/tables/Pagination.js +56 -0
  46. package/dist/components/tables/ResourceTable.d.ts +3 -3
  47. package/dist/components/tables/ResourceTable.js +88 -0
  48. package/dist/components/tables/Table.js +95 -0
  49. package/dist/components/tables/sortRows.js +11 -0
  50. package/dist/components/ui/Accordion.d.ts +2 -1
  51. package/dist/components/ui/Accordion.js +35 -0
  52. package/dist/components/ui/Alert.d.ts +3 -2
  53. package/dist/components/ui/Alert.js +51 -0
  54. package/dist/components/ui/AttachmentList.d.ts +5 -5
  55. package/dist/components/ui/AttachmentList.js +90 -0
  56. package/dist/components/ui/AudioPlayer.d.ts +5 -2
  57. package/dist/components/ui/AudioPlayer.js +447 -0
  58. package/dist/components/ui/AuthCard.d.ts +3 -3
  59. package/dist/components/ui/AuthCard.js +39 -0
  60. package/dist/components/ui/AuthorByline.d.ts +3 -3
  61. package/dist/components/ui/AuthorByline.js +23 -0
  62. package/dist/components/ui/Avatar.d.ts +3 -2
  63. package/dist/components/ui/Avatar.js +36 -0
  64. package/dist/components/ui/Badge.d.ts +3 -2
  65. package/dist/components/ui/Badge.js +47 -0
  66. package/dist/components/ui/Button.d.ts +3 -3
  67. package/dist/components/ui/Button.js +83 -0
  68. package/dist/components/ui/Calendar.d.ts +3 -3
  69. package/dist/components/ui/Calendar.js +344 -0
  70. package/dist/components/ui/CalendarGrid.d.ts +3 -2
  71. package/dist/components/ui/CalendarGrid.js +136 -0
  72. package/dist/components/ui/Card.d.ts +6 -5
  73. package/dist/components/ui/Card.js +53 -0
  74. package/dist/components/ui/CharacterCount.d.ts +3 -3
  75. package/dist/components/ui/CharacterCount.js +27 -0
  76. package/dist/components/ui/Checkbox.d.ts +10 -8
  77. package/dist/components/ui/Checkbox.js +52 -0
  78. package/dist/components/ui/CodeInput.d.ts +7 -4
  79. package/dist/components/ui/CodeInput.js +96 -0
  80. package/dist/components/ui/Combobox.d.ts +8 -6
  81. package/dist/components/ui/Combobox.js +213 -0
  82. package/dist/components/ui/CopyButton.d.ts +1 -1
  83. package/dist/components/ui/CopyButton.js +57 -0
  84. package/dist/components/ui/DangerZone.d.ts +3 -3
  85. package/dist/components/ui/DangerZone.js +23 -0
  86. package/dist/components/ui/DatePartsInput.d.ts +6 -4
  87. package/dist/components/ui/DatePartsInput.js +138 -0
  88. package/dist/components/ui/DatePicker.d.ts +9 -4
  89. package/dist/components/ui/DatePicker.js +84 -0
  90. package/dist/components/ui/DateRangePicker.d.ts +7 -4
  91. package/dist/components/ui/DateRangePicker.js +143 -0
  92. package/dist/components/ui/DateTimePicker.d.ts +7 -4
  93. package/dist/components/ui/DateTimePicker.js +267 -0
  94. package/dist/components/ui/DetailPanel.d.ts +3 -3
  95. package/dist/components/ui/DetailPanel.js +183 -0
  96. package/dist/components/ui/Dialog.d.ts +3 -3
  97. package/dist/components/ui/Dialog.js +411 -0
  98. package/dist/components/ui/DialogActions.d.ts +3 -3
  99. package/dist/components/ui/DialogActions.js +35 -0
  100. package/dist/components/ui/Disclosure.d.ts +3 -3
  101. package/dist/components/ui/Disclosure.js +45 -0
  102. package/dist/components/ui/DividerLabel.d.ts +3 -3
  103. package/dist/components/ui/DividerLabel.js +20 -0
  104. package/dist/components/ui/DropdownMenu.d.ts +3 -3
  105. package/dist/components/ui/DropdownMenu.js +229 -0
  106. package/dist/components/ui/EmptyState.d.ts +3 -3
  107. package/dist/components/ui/EmptyState.js +31 -0
  108. package/dist/components/ui/ErrorBoundary.js +46 -0
  109. package/dist/components/ui/FieldContext.js +8 -0
  110. package/dist/components/ui/Fieldset.d.ts +2 -2
  111. package/dist/components/ui/Fieldset.js +39 -0
  112. package/dist/components/ui/FilterButton.d.ts +4 -7
  113. package/dist/components/ui/FilterButton.js +17 -0
  114. package/dist/components/ui/FilterDropdown.d.ts +4 -4
  115. package/dist/components/ui/FilterDropdown.js +18 -0
  116. package/dist/components/ui/FormField.d.ts +4 -4
  117. package/dist/components/ui/FormField.js +68 -0
  118. package/dist/components/ui/Grid.d.ts +1 -1
  119. package/dist/components/ui/Grid.js +19 -0
  120. package/dist/components/ui/GridItem.d.ts +1 -1
  121. package/dist/components/ui/GridItem.js +16 -0
  122. package/dist/components/ui/Inline.d.ts +1 -1
  123. package/dist/components/ui/Inline.js +24 -0
  124. package/dist/components/ui/Kbd.d.ts +3 -2
  125. package/dist/components/ui/Kbd.js +13 -0
  126. package/dist/components/ui/ListItemLink.d.ts +3 -3
  127. package/dist/components/ui/ListItemLink.js +44 -0
  128. package/dist/components/ui/LoadingSpinner.d.ts +3 -2
  129. package/dist/components/ui/LoadingSpinner.js +19 -0
  130. package/dist/components/ui/MessageBubble.d.ts +2 -2
  131. package/dist/components/ui/MessageBubble.js +41 -0
  132. package/dist/components/ui/MetadataGrid.d.ts +5 -3
  133. package/dist/components/ui/MetadataGrid.js +76 -0
  134. package/dist/components/ui/MetricCard.d.ts +3 -3
  135. package/dist/components/ui/MetricCard.js +51 -0
  136. package/dist/components/ui/NavTabs.d.ts +2 -2
  137. package/dist/components/ui/NavTabs.js +29 -0
  138. package/dist/components/ui/OAuthButton.d.ts +2 -2
  139. package/dist/components/ui/OAuthButton.js +55 -0
  140. package/dist/components/ui/OverlineLabel.d.ts +3 -3
  141. package/dist/components/ui/OverlineLabel.js +13 -0
  142. package/dist/components/ui/PageHeader.d.ts +3 -3
  143. package/dist/components/ui/PageHeader.js +33 -0
  144. package/dist/components/ui/PageSection.d.ts +3 -3
  145. package/dist/components/ui/PageSection.js +31 -0
  146. package/dist/components/ui/PaginationBar.d.ts +3 -3
  147. package/dist/components/ui/PaginationBar.js +62 -0
  148. package/dist/components/ui/PasswordInput.d.ts +3 -3
  149. package/dist/components/ui/PasswordInput.js +62 -0
  150. package/dist/components/ui/PasswordRequirements.d.ts +3 -2
  151. package/dist/components/ui/PasswordRequirements.js +34 -0
  152. package/dist/components/ui/Popover.d.ts +3 -3
  153. package/dist/components/ui/Popover.js +53 -0
  154. package/dist/components/ui/ProfileHeader.d.ts +3 -3
  155. package/dist/components/ui/ProfileHeader.js +54 -0
  156. package/dist/components/ui/ProgressBar.d.ts +3 -3
  157. package/dist/components/ui/ProgressBar.js +42 -0
  158. package/dist/components/ui/ProseContent.d.ts +3 -3
  159. package/dist/components/ui/ProseContent.js +13 -0
  160. package/dist/components/ui/QrCode.d.ts +3 -3
  161. package/dist/components/ui/QrCode.js +47 -0
  162. package/dist/components/ui/Radio.d.ts +9 -6
  163. package/dist/components/ui/Radio.js +58 -0
  164. package/dist/components/ui/RadioPill.d.ts +7 -4
  165. package/dist/components/ui/RadioPill.js +53 -0
  166. package/dist/components/ui/ReorderList.d.ts +3 -3
  167. package/dist/components/ui/ReorderList.js +123 -0
  168. package/dist/components/ui/SearchInput.d.ts +7 -5
  169. package/dist/components/ui/SearchInput.js +49 -0
  170. package/dist/components/ui/SectionHeader.d.ts +3 -3
  171. package/dist/components/ui/SectionHeader.js +13 -0
  172. package/dist/components/ui/Select.d.ts +4 -4
  173. package/dist/components/ui/Select.js +117 -0
  174. package/dist/components/ui/SelectDropdown.d.ts +8 -3
  175. package/dist/components/ui/SelectDropdown.js +206 -0
  176. package/dist/components/ui/SettingRow.d.ts +5 -5
  177. package/dist/components/ui/SettingRow.js +25 -0
  178. package/dist/components/ui/SideSheet.d.ts +3 -3
  179. package/dist/components/ui/SideSheet.js +164 -0
  180. package/dist/components/ui/Skeleton.d.ts +3 -3
  181. package/dist/components/ui/Skeleton.js +18 -0
  182. package/dist/components/ui/Slider.d.ts +11 -6
  183. package/dist/components/ui/Slider.js +58 -0
  184. package/dist/components/ui/SplitPaneLayout.d.ts +5 -5
  185. package/dist/components/ui/SplitPaneLayout.js +22 -0
  186. package/dist/components/ui/Stack.d.ts +1 -1
  187. package/dist/components/ui/Stack.js +18 -0
  188. package/dist/components/ui/StatusDot.d.ts +3 -2
  189. package/dist/components/ui/StatusDot.js +24 -0
  190. package/dist/components/ui/StepProgress.d.ts +3 -2
  191. package/dist/components/ui/StepProgress.js +33 -0
  192. package/dist/components/ui/Tabs.d.ts +5 -5
  193. package/dist/components/ui/Tabs.js +63 -0
  194. package/dist/components/ui/TextInput.d.ts +3 -3
  195. package/dist/components/ui/TextInput.js +57 -0
  196. package/dist/components/ui/Textarea.d.ts +3 -3
  197. package/dist/components/ui/Textarea.js +59 -0
  198. package/dist/components/ui/ThemePreview.d.ts +3 -3
  199. package/dist/components/ui/ThemePreview.js +28 -0
  200. package/dist/components/ui/TimeInput.d.ts +7 -6
  201. package/dist/components/ui/TimeInput.js +22 -0
  202. package/dist/components/ui/Timeline.d.ts +3 -2
  203. package/dist/components/ui/Timeline.js +29 -0
  204. package/dist/components/ui/Toast.js +121 -0
  205. package/dist/components/ui/Toggle.d.ts +5 -3
  206. package/dist/components/ui/Toggle.js +34 -0
  207. package/dist/components/ui/Toolbar.d.ts +3 -3
  208. package/dist/components/ui/Toolbar.js +70 -0
  209. package/dist/components/ui/Tooltip.js +91 -0
  210. package/dist/components/ui/TranscriptLine.d.ts +3 -3
  211. package/dist/components/ui/TranscriptLine.js +40 -0
  212. package/dist/components/ui/UploadDropzone.d.ts +3 -5
  213. package/dist/components/ui/UploadDropzone.js +55 -0
  214. package/dist/components/ui/badgeColors.js +5 -0
  215. package/dist/components/ui/calendar/AgendaView.js +140 -0
  216. package/dist/components/ui/calendar/MonthView.js +321 -0
  217. package/dist/components/ui/calendar/TimeGrid.js +501 -0
  218. package/dist/components/ui/calendar/TimelineView.js +311 -0
  219. package/dist/components/ui/calendar/context.js +10 -0
  220. package/dist/components/ui/calendar/items.js +152 -0
  221. package/dist/components/ui/calendar/types.js +38 -0
  222. package/dist/components/ui/calendar/useGridInteraction.js +393 -0
  223. package/dist/components/ui/useFieldControl.d.ts +1 -1
  224. package/dist/components/ui/useFieldControl.js +17 -0
  225. package/dist/config/theme.js +219 -0
  226. package/dist/core.css +2933 -0
  227. package/dist/hooks/useAnchoredPopup.js +162 -0
  228. package/dist/hooks/useApplyTheme.js +16 -0
  229. package/dist/hooks/useControllableState.d.ts +14 -0
  230. package/dist/hooks/useControllableState.js +10 -0
  231. package/dist/hooks/useDismiss.js +24 -0
  232. package/dist/hooks/useFocusTrap.js +42 -0
  233. package/dist/hooks/useOverlayStack.js +23 -0
  234. package/dist/hooks/usePopover.js +47 -0
  235. package/dist/hooks/usePortalContainer.js +14 -0
  236. package/dist/hooks/useSettings.js +8 -0
  237. package/dist/hooks/useTheme.js +8 -0
  238. package/dist/hooks/useTypeahead.js +19 -0
  239. package/dist/index.js +133 -12884
  240. package/dist/lib/anchorPlacement.js +75 -0
  241. package/dist/lib/calendar.js +666 -0
  242. package/dist/lib/cn.js +228 -0
  243. package/dist/lib/codeInput.js +51 -0
  244. package/dist/lib/dateParts.js +31 -0
  245. package/dist/lib/dialogDrag.js +45 -0
  246. package/dist/lib/dialogResize.js +47 -0
  247. package/dist/lib/formatDate.js +29 -0
  248. package/dist/lib/formatMediaTime.js +7 -0
  249. package/dist/lib/layout.js +29 -0
  250. package/dist/lib/math.js +6 -0
  251. package/dist/lib/mergeRefs.d.ts +6 -0
  252. package/dist/lib/mergeRefs.js +17 -0
  253. package/dist/lib/months.js +30 -0
  254. package/dist/lib/overlayStack.js +47 -0
  255. package/dist/lib/panelResize.js +8 -0
  256. package/dist/lib/passwordRequirements.js +23 -0
  257. package/dist/lib/qrCode.js +570 -0
  258. package/dist/lib/tones.js +104 -0
  259. package/dist/lib/typeahead.js +31 -0
  260. package/dist/providers/ControlSizeContext.js +9 -0
  261. package/dist/providers/ControlSizeProvider.js +11 -0
  262. package/dist/providers/SettingsContext.js +53 -0
  263. package/dist/providers/SettingsProvider.js +249 -0
  264. package/dist/providers/ThemeContext.js +5 -0
  265. package/dist/providers/ThemeProvider.js +17 -0
  266. package/dist/providers/accentColors.js +75 -0
  267. package/dist/providers/themeClasses.d.ts +1 -0
  268. package/dist/providers/themeClasses.js +20 -0
  269. package/dist/styles.css +228 -176
  270. package/dist/themes/cyber-brutal-dark.css +53 -0
  271. package/dist/themes/cyber-brutal-light.css +75 -0
  272. package/dist/themes/glass-dark.css +217 -0
  273. package/dist/themes/glass-light.css +215 -0
  274. package/dist/themes/hashi.css +66 -0
  275. package/dist/themes/light-inverted.css +32 -0
  276. package/dist/themes/light.css +1 -0
  277. package/dist/themes/monokai.css +51 -0
  278. package/dist/themes/solarized.css +55 -0
  279. package/package.json +3 -1
package/README.md CHANGED
@@ -15,6 +15,17 @@ Import the stylesheet once:
15
15
  import "@leonardaustin/ui/styles.css";
16
16
  ```
17
17
 
18
+ ### Per-theme stylesheets
19
+
20
+ To load selected themes, import the core sheet first. It includes the default
21
+ dark theme. Add one stylesheet for each additional theme your app offers.
22
+
23
+ ```tsx
24
+ import "@leonardaustin/ui/core.css";
25
+ import "@leonardaustin/ui/themes/light.css";
26
+ import "@leonardaustin/ui/themes/glass-dark.css";
27
+ ```
28
+
18
29
  Wrap applications with the providers when using the built-in theme controls:
19
30
 
20
31
  ```tsx
@@ -1,8 +1,8 @@
1
- import { type ReactNode } from "react";
1
+ import { type ComponentPropsWithRef, type ReactNode } from "react";
2
2
  import type { CommandPaletteShortcut } from "./commandPaletteEvents";
3
3
  import type { AppShellNavigate } from "./navigation";
4
4
  import type { AppShellAccount, AppShellBrand, AppShellBreadcrumbOptions, AppShellNavItem, AppShellNavSection, AppShellTopBarNavItem } from "./types";
5
- export interface AppShellProps {
5
+ export interface AppShellProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
6
6
  /** Routed page content, rendered inside the `#main-content` <main>. */
7
7
  children?: ReactNode;
8
8
  /** Titled groups of nav items for the sidebar; also the mobile drawer items and the default command palette items. */
@@ -65,4 +65,4 @@ export interface AppShellProps {
65
65
  * `commandShortcut` (default ⌘K) whose searchable items default to the
66
66
  * flattened `navSections` (override via `commandItems`).
67
67
  */
68
- export declare function AppShell({ children, navSections, brand, accounts, bottomNavItems, commandItems, breadcrumbs, initialAccountIndex, onAccountChange, onSignOut, signOutPath, signOutLabel, settingsPath, settingsLabel, onOpenSettings, showCommandPalette, showCommandTrigger, commandTriggerLabel, commandShortcut, sidebarHeaderActions, topBarActions, topBarNavItems, topBarNavLabel, currentPath, onNavigate, mainClassName, className, }: AppShellProps): import("react/jsx-runtime").JSX.Element;
68
+ export declare function AppShell({ children, navSections, brand, accounts, bottomNavItems, commandItems, breadcrumbs, initialAccountIndex, onAccountChange, onSignOut, signOutPath, signOutLabel, settingsPath, settingsLabel, onOpenSettings, showCommandPalette, showCommandTrigger, commandTriggerLabel, commandShortcut, sidebarHeaderActions, topBarActions, topBarNavItems, topBarNavLabel, currentPath, onNavigate, mainClassName, className, ref, ...rest }: AppShellProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,82 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { BottomNav as t } from "./BottomNav.js";
3
+ import { CommandPalette as n } from "./CommandPalette.js";
4
+ import { MobileDrawer as r } from "./MobileDrawer.js";
5
+ import { Sidebar as i } from "./Sidebar.js";
6
+ import { TopBar as a } from "./TopBar.js";
7
+ import { useMemo as o, useState as s } from "react";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ //#region src/components/app-shell/AppShell.tsx
10
+ function u({ children: u, navSections: d, brand: f, accounts: p, bottomNavItems: m = [], commandItems: h, breadcrumbs: g, initialAccountIndex: _, onAccountChange: v, onSignOut: y, signOutPath: b, signOutLabel: x, settingsPath: S, settingsLabel: C, onOpenSettings: w, showCommandPalette: T = !0, showCommandTrigger: E = !0, commandTriggerLabel: D, commandShortcut: O, sidebarHeaderActions: k, topBarActions: A, topBarNavItems: j, topBarNavLabel: M, currentPath: N, onNavigate: P, mainClassName: F, className: I, ref: L, ...R }) {
11
+ let [z, B] = s(!1), V = o(() => d.flatMap((e) => e.items), [d]), H = h ?? V;
12
+ return /* @__PURE__ */ l("div", {
13
+ ref: L,
14
+ ...R,
15
+ className: e("ui-glass-shell bg-bg-primary flex h-svh overflow-hidden", I),
16
+ children: [
17
+ /* @__PURE__ */ c("a", {
18
+ href: "#main-content",
19
+ className: "skip-link",
20
+ children: "Skip to content"
21
+ }),
22
+ /* @__PURE__ */ c(i, {
23
+ navSections: d,
24
+ brand: f,
25
+ accounts: p,
26
+ initialAccountIndex: _,
27
+ onAccountChange: v,
28
+ onSignOut: y,
29
+ signOutPath: b,
30
+ signOutLabel: x,
31
+ settingsPath: S,
32
+ settingsLabel: C,
33
+ onOpenSettings: w,
34
+ currentPath: N,
35
+ onNavigate: P,
36
+ headerActions: k
37
+ }),
38
+ /* @__PURE__ */ l("div", {
39
+ className: "flex min-w-0 flex-1 flex-col",
40
+ children: [/* @__PURE__ */ c(a, {
41
+ onMobileMenuToggle: () => B(!0),
42
+ breadcrumbs: g,
43
+ showCommandTrigger: T && E,
44
+ commandTriggerLabel: D,
45
+ commandShortcut: O,
46
+ actions: A,
47
+ navItems: j,
48
+ navLabel: M,
49
+ currentPath: N,
50
+ onNavigate: P
51
+ }), /* @__PURE__ */ c("main", {
52
+ id: "main-content",
53
+ className: e("flex-1 overflow-y-auto p-4 pb-20 md:p-6 md:pb-6", F),
54
+ children: u
55
+ })]
56
+ }),
57
+ /* @__PURE__ */ c(t, {
58
+ items: m,
59
+ currentPath: N,
60
+ onNavigate: P
61
+ }),
62
+ /* @__PURE__ */ c(r, {
63
+ open: z,
64
+ onClose: () => B(!1),
65
+ items: V,
66
+ topBarNavItems: j,
67
+ topBarNavLabel: M,
68
+ brand: f,
69
+ currentPath: N,
70
+ onNavigate: P,
71
+ headerActions: k
72
+ }),
73
+ T && H.length > 0 && /* @__PURE__ */ c(n, {
74
+ items: H,
75
+ shortcut: O,
76
+ onNavigate: P
77
+ })
78
+ ]
79
+ });
80
+ }
81
+ //#endregion
82
+ export { u as AppShell };
@@ -1,8 +1,8 @@
1
- import type { ReactNode } from "react";
2
- export interface AuthLayoutProps {
1
+ import type { ComponentPropsWithRef, ReactNode } from "react";
2
+ export interface AuthLayoutProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
3
3
  /** Content centered on the page, typically an auth card. */
4
4
  children?: ReactNode;
5
5
  /** Extra classes for the full-page wrapper. */
6
6
  className?: string;
7
7
  }
8
- export declare function AuthLayout({ children, className }: AuthLayoutProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function AuthLayout({ children, className, ref, ...rest }: AuthLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region src/components/app-shell/AuthLayout.tsx
4
+ function r({ children: r, className: i, ref: a, ...o }) {
5
+ return /* @__PURE__ */ n("div", {
6
+ ref: a,
7
+ ...o,
8
+ className: e("ui-glass-shell bg-bg-primary relative flex min-h-svh items-center justify-center p-4", i),
9
+ children: [/* @__PURE__ */ t("div", {
10
+ className: "pointer-events-none absolute inset-0 opacity-30",
11
+ style: { background: "radial-gradient(ellipse at 50% 30%, var(--accent-muted) 0%, transparent 60%)" }
12
+ }), r]
13
+ });
14
+ }
15
+ //#endregion
16
+ export { r as AuthLayout };
@@ -1,6 +1,6 @@
1
- import type { ReactNode } from "react";
1
+ import type { ComponentPropsWithRef, ReactNode } from "react";
2
2
  import { type AppShellNavigate } from "./navigation";
3
- export interface BackLinkProps {
3
+ export interface BackLinkProps extends Omit<ComponentPropsWithRef<"a">, "children" | "href"> {
4
4
  /** Destination path, used as the link `href`. */
5
5
  to: string;
6
6
  /** Link text shown after the arrow icon. */
@@ -10,4 +10,4 @@ export interface BackLinkProps {
10
10
  /** Extra classes for the link. */
11
11
  className?: string;
12
12
  }
13
- export declare function BackLink({ to, children, onNavigate, className, }: BackLinkProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function BackLink({ to, children, onNavigate, className, onClick, ref, ...rest }: BackLinkProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { handleAppShellNavigate as t } from "./navigation.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { ArrowLeft as i } from "lucide-react";
5
+ //#region src/components/app-shell/BackLink.tsx
6
+ function a({ to: a, children: o, onNavigate: s, className: c, onClick: l, ref: u, ...d }) {
7
+ return /* @__PURE__ */ r("a", {
8
+ ref: u,
9
+ ...d,
10
+ href: a,
11
+ onClick: (e) => {
12
+ l?.(e), !e.defaultPrevented && t(e, a, s);
13
+ },
14
+ className: e("inline-flex items-center gap-1.5", "text-text-tertiary text-xs", "hover:text-text-primary transition-colors duration-[100ms]", c),
15
+ children: [/* @__PURE__ */ n(i, { className: "h-3.5 w-3.5" }), o]
16
+ });
17
+ }
18
+ //#endregion
19
+ export { a as BackLink };
@@ -1,6 +1,7 @@
1
+ import type { ComponentPropsWithRef } from "react";
1
2
  import { type AppShellNavigate } from "./navigation";
2
3
  import type { AppShellNavItem } from "./types";
3
- export interface BottomNavProps {
4
+ export interface BottomNavProps extends ComponentPropsWithRef<"nav"> {
4
5
  /**
5
6
  * Destinations, shown as icon-over-label links in order. Each item's
6
7
  * `shortLabel` is shown instead of `label` when set. Renders nothing when
@@ -23,4 +24,4 @@ export interface BottomNavProps {
23
24
  /** Additional utility classes for the `<nav>` element. */
24
25
  className?: string;
25
26
  }
26
- export declare function BottomNav({ items, currentPath, onNavigate, className, }: BottomNavProps): import("react/jsx-runtime").JSX.Element | null;
27
+ export declare function BottomNav({ items, currentPath, onNavigate, className, style, ref, ...rest }: BottomNavProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,37 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { handleAppShellNavigate as t, isAppShellPathActive as n } from "./navigation.js";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ //#region src/components/app-shell/BottomNav.tsx
5
+ function a({ items: a, currentPath: o, onNavigate: s, className: c, style: l, ref: u, ...d }) {
6
+ return a.length === 0 ? null : /* @__PURE__ */ r("nav", {
7
+ ref: u,
8
+ ...d,
9
+ className: e("ui-glass ui-glass-chrome bg-bg-secondary border-border font-navigation fixed right-0 bottom-0 left-0 z-30 border-t md:hidden", c),
10
+ style: {
11
+ height: "var(--bottomnav-height)",
12
+ ...l
13
+ },
14
+ children: /* @__PURE__ */ r("ul", {
15
+ className: "flex h-full items-center justify-around",
16
+ children: a.map((a) => {
17
+ let c = n(a, o);
18
+ return /* @__PURE__ */ r("li", { children: /* @__PURE__ */ i("a", {
19
+ href: a.path,
20
+ onClick: (e) => t(e, a.path, s),
21
+ "aria-current": c ? "page" : void 0,
22
+ "aria-label": a.shortLabel && a.shortLabel !== a.label ? `${a.shortLabel}, ${a.label}` : void 0,
23
+ className: e("font-navigation flex h-full w-14 flex-col items-center justify-center gap-0.5", "cursor-pointer transition-colors duration-[100ms]", c ? "text-accent-fg" : "text-text-tertiary"),
24
+ children: [/* @__PURE__ */ r(a.icon, {
25
+ className: "h-5 w-5",
26
+ "aria-hidden": "true"
27
+ }), /* @__PURE__ */ r("span", {
28
+ className: "text-2xs",
29
+ children: a.shortLabel ?? a.label
30
+ })]
31
+ }) }, a.path);
32
+ })
33
+ })
34
+ });
35
+ }
36
+ //#endregion
37
+ export { a as BottomNav };
@@ -1,6 +1,7 @@
1
+ import type { ComponentPropsWithRef } from "react";
1
2
  import { type AppShellNavigate } from "./navigation";
2
3
  import type { AppShellBreadcrumbOptions } from "./types";
3
- export interface BreadcrumbsProps extends AppShellBreadcrumbOptions {
4
+ export interface BreadcrumbsProps extends AppShellBreadcrumbOptions, ComponentPropsWithRef<"nav"> {
4
5
  /** Pathname to build the trail from, one crumb per segment after the home crumb. Defaults to "/". Any query string is ignored. */
5
6
  currentPath?: string;
6
7
  /** Called with the crumb path on a plain left-click, for client-side routing. */
@@ -8,4 +9,4 @@ export interface BreadcrumbsProps extends AppShellBreadcrumbOptions {
8
9
  /** Extra classes for the `<nav>`. */
9
10
  className?: string;
10
11
  }
11
- export declare function Breadcrumbs({ homeLabel, labels, parents, currentPath, onNavigate, className, }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Breadcrumbs({ homeLabel, labels, parents, currentPath, onNavigate, className, ref, ...rest }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,46 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { handleAppShellNavigate as t } from "./navigation.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { ChevronRight as i } from "lucide-react";
5
+ //#region src/components/app-shell/Breadcrumbs.tsx
6
+ function a(e) {
7
+ return e.charAt(0).toUpperCase() + e.slice(1);
8
+ }
9
+ function o({ homeLabel: o = "Dashboard", labels: s = {}, parents: c = {}, currentPath: l = "/", onNavigate: u, className: d, ref: f, ...p }) {
10
+ let m = l.split("?")[0].split("/").filter(Boolean), h = [{
11
+ label: o,
12
+ path: "/"
13
+ }, ...m.map((e, t) => {
14
+ let n = m[t - 1];
15
+ return {
16
+ label: s[e] || c[n] || a(e),
17
+ path: "/" + m.slice(0, t + 1).join("/")
18
+ };
19
+ })];
20
+ return /* @__PURE__ */ n("nav", {
21
+ ref: f,
22
+ ...p,
23
+ "aria-label": "Breadcrumb",
24
+ className: e("font-navigation flex items-center gap-1 text-xs", d),
25
+ children: /* @__PURE__ */ n("ol", {
26
+ className: "flex items-center gap-1",
27
+ children: h.map((a, o) => {
28
+ let s = o === h.length - 1;
29
+ return /* @__PURE__ */ r("li", {
30
+ className: "flex items-center gap-1",
31
+ children: [o > 0 && /* @__PURE__ */ n(i, { className: "text-text-tertiary h-3 w-3" }), s ? /* @__PURE__ */ n("span", {
32
+ className: "text-text-primary font-medium",
33
+ children: a.label
34
+ }) : /* @__PURE__ */ n("a", {
35
+ href: a.path,
36
+ onClick: (e) => t(e, a.path, u),
37
+ className: e("text-text-tertiary hover:text-text-primary cursor-pointer transition-colors duration-[100ms]"),
38
+ children: a.label
39
+ })]
40
+ }, a.path);
41
+ })
42
+ })
43
+ });
44
+ }
45
+ //#endregion
46
+ export { o as Breadcrumbs };
@@ -1,7 +1,8 @@
1
+ import { type ComponentPropsWithRef } from "react";
1
2
  import { type CommandPaletteShortcut } from "./commandPaletteEvents";
2
3
  import { type AppShellNavigate } from "./navigation";
3
4
  import type { AppShellNavItem } from "./types";
4
- export interface CommandPaletteProps {
5
+ export interface CommandPaletteProps extends Omit<ComponentPropsWithRef<"div">, "children" | "onSelect"> {
5
6
  /** Pages to search. Matches on label, path, and `keywords`. */
6
7
  items: AppShellNavItem[];
7
8
  /** Name of the `document` CustomEvent that opens the palette. Defaults to the one fired by `openCommandPalette()`. */
@@ -22,4 +23,4 @@ export interface CommandPaletteProps {
22
23
  * `shortcut` (default ⌘K), or when the `eventName` CustomEvent is dispatched on
23
24
  * `document` (see openCommandPalette()); the shortcut also toggles it closed.
24
25
  */
25
- export declare function CommandPalette({ items, eventName, shortcut, placeholder, emptyLabel, onNavigate, onSelect, }: CommandPaletteProps): import("react/jsx-runtime").JSX.Element | null;
26
+ export declare function CommandPalette({ items, eventName, shortcut, placeholder, emptyLabel, onNavigate, onSelect, className, onKeyDown, ref, ...rest }: CommandPaletteProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,119 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { mergeRefs as t } from "../../lib/mergeRefs.js";
3
+ import { navigateToPath as n } from "./navigation.js";
4
+ import { useFocusTrap as r } from "../../hooks/useFocusTrap.js";
5
+ import { useOverlayEscape as i } from "../../hooks/useOverlayStack.js";
6
+ import { COMMAND_PALETTE_EVENT as a, DEFAULT_COMMAND_PALETTE_SHORTCUT as o, matchesCommandPaletteShortcut as s } from "./commandPaletteEvents.js";
7
+ import { useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
8
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
+ import { Search as g } from "lucide-react";
10
+ //#region src/components/app-shell/CommandPalette.tsx
11
+ function _(e, t) {
12
+ let n = t.toLowerCase();
13
+ return [
14
+ e.label,
15
+ e.path,
16
+ ...e.keywords ?? []
17
+ ].some((e) => e.toLowerCase().includes(n));
18
+ }
19
+ function v({ items: v, eventName: y = a, shortcut: b = o, placeholder: x = "Search pages...", emptyLabel: S = "No results found", onNavigate: C, onSelect: w, className: T, onKeyDown: E, ref: D, ...O }) {
20
+ let [k, A] = p(!1), [j, M] = p(""), [N, P] = p(0), F = f(null), I = f(null), L = d(() => t(I, D), [D]), R = u();
21
+ r(I, k), i(k, () => A(!1), I);
22
+ let z = v.filter((e) => _(e, j)), B = c(() => {
23
+ A(!0), M(""), P(0), setTimeout(() => F.current?.focus(), 0);
24
+ }, []);
25
+ l(() => {
26
+ let e = (e) => {
27
+ s(e, b) && (e.preventDefault(), k ? A(!1) : B());
28
+ }, t = () => {
29
+ k || B();
30
+ };
31
+ return document.addEventListener("keydown", e), document.addEventListener(y, t), () => {
32
+ document.removeEventListener("keydown", e), document.removeEventListener(y, t);
33
+ };
34
+ }, [
35
+ y,
36
+ k,
37
+ B,
38
+ b
39
+ ]);
40
+ function V(e) {
41
+ M(e), P(0);
42
+ }
43
+ function H(e) {
44
+ w?.(e), n(e.path, C), A(!1);
45
+ }
46
+ function U(e) {
47
+ E?.(e), !e.defaultPrevented && (e.key === "ArrowDown" ? (e.preventDefault(), P((e) => Math.min(e + 1, z.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), P((e) => Math.max(e - 1, 0))) : e.key === "Enter" && z[N] && H(z[N]));
48
+ }
49
+ return k ? /* @__PURE__ */ h("div", {
50
+ className: "fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",
51
+ children: [/* @__PURE__ */ m("div", {
52
+ className: "bg-bg-overlay fixed inset-0",
53
+ onClick: () => A(!1)
54
+ }), /* @__PURE__ */ h("div", {
55
+ ...O,
56
+ ref: L,
57
+ role: "dialog",
58
+ "aria-modal": "true",
59
+ "aria-label": "Command palette",
60
+ className: e("ui-glass ui-glass-popover bg-bg-secondary border-border animate-scale-in relative z-50 mx-4 w-full max-w-[520px] overflow-hidden rounded-xl border shadow-lg", T),
61
+ onKeyDown: U,
62
+ children: [/* @__PURE__ */ h("div", {
63
+ className: "border-border flex items-center gap-3 border-b px-4",
64
+ children: [
65
+ /* @__PURE__ */ m(g, { className: "text-text-tertiary h-4 w-4 shrink-0" }),
66
+ /* @__PURE__ */ m("input", {
67
+ ref: F,
68
+ type: "text",
69
+ role: "combobox",
70
+ "aria-expanded": z.length > 0,
71
+ "aria-controls": R,
72
+ "aria-activedescendant": z[N] ? `${R}-${N}` : void 0,
73
+ "aria-autocomplete": "list",
74
+ "aria-label": "Search pages",
75
+ value: j,
76
+ onChange: (e) => V(e.target.value),
77
+ placeholder: x,
78
+ className: "text-text-primary placeholder:text-text-placeholder h-11 flex-1 bg-transparent text-sm focus:outline-none"
79
+ }),
80
+ /* @__PURE__ */ m("kbd", {
81
+ className: "text-2xs bg-bg-tertiary text-text-tertiary border-border hidden items-center rounded border px-1.5 py-0.5 font-mono font-medium sm:inline-flex",
82
+ children: "Esc"
83
+ })
84
+ ]
85
+ }), /* @__PURE__ */ m("ul", {
86
+ id: R,
87
+ role: "listbox",
88
+ "aria-label": "Pages",
89
+ className: "max-h-[320px] overflow-y-auto px-2 py-2",
90
+ children: z.length === 0 ? /* @__PURE__ */ m("li", {
91
+ className: "text-text-tertiary px-3 py-6 text-center text-xs",
92
+ children: S
93
+ }) : z.map((t, n) => /* @__PURE__ */ h("li", {
94
+ id: `${R}-${n}`,
95
+ role: "option",
96
+ "aria-selected": n === N,
97
+ onClick: () => H(t),
98
+ className: e("flex h-9 w-full cursor-pointer items-center gap-3 rounded-md px-3 text-left", "transition-colors duration-[100ms]", n === N ? "bg-accent-muted text-accent-fg" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
99
+ children: [
100
+ /* @__PURE__ */ m("span", {
101
+ className: "shrink-0 opacity-60",
102
+ children: /* @__PURE__ */ m(t.icon, { className: "h-4 w-4" })
103
+ }),
104
+ /* @__PURE__ */ m("span", {
105
+ className: "min-w-0 flex-1 text-xs font-medium",
106
+ children: t.label
107
+ }),
108
+ t.badge && /* @__PURE__ */ m("span", {
109
+ className: "shrink-0",
110
+ children: t.badge
111
+ })
112
+ ]
113
+ }, t.path))
114
+ })]
115
+ })]
116
+ }) : null;
117
+ }
118
+ //#endregion
119
+ export { v as CommandPalette };
@@ -1,7 +1,7 @@
1
- import { type ReactNode } from "react";
1
+ import { type ComponentPropsWithRef, type ReactNode } from "react";
2
2
  import { type AppShellNavigate } from "./navigation";
3
3
  import type { AppShellBrand, AppShellNavItem, AppShellTopBarNavItem } from "./types";
4
- export interface MobileDrawerProps {
4
+ export interface MobileDrawerProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
5
5
  /** Whether the drawer is shown. It renders nothing when `false`. Hidden at the `md` breakpoint and above. */
6
6
  open: boolean;
7
7
  /**
@@ -43,4 +43,4 @@ export interface MobileDrawerProps {
43
43
  /** Additional utility classes for the drawer panel. */
44
44
  className?: string;
45
45
  }
46
- export declare function MobileDrawer({ open, onClose, items, topBarNavItems, topBarNavLabel, brand, currentPath, onNavigate, headerActions, className, }: MobileDrawerProps): import("react/jsx-runtime").JSX.Element | null;
46
+ export declare function MobileDrawer({ open, onClose, items, topBarNavItems, topBarNavLabel, brand, currentPath, onNavigate, headerActions, className, ref, ...rest }: MobileDrawerProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,128 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { mergeRefs as t } from "../../lib/mergeRefs.js";
3
+ import { handleAppShellNavigate as n, isAppShellPathActive as r } from "./navigation.js";
4
+ import { useFocusTrap as i } from "../../hooks/useFocusTrap.js";
5
+ import { OverlayContext as a, useBodyScrollLock as o, useOverlayEscape as s } from "../../hooks/useOverlayStack.js";
6
+ import { PortalContainerContext as c, usePortalContainerRef as l } from "../../hooks/usePortalContainer.js";
7
+ import { useMemo as u, useRef as d } from "react";
8
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
9
+ import { X as h } from "lucide-react";
10
+ //#region src/components/app-shell/MobileDrawer.tsx
11
+ function g({ brand: e }) {
12
+ let t = e.icon;
13
+ return e.logo ? /* @__PURE__ */ p(f, { children: e.logo }) : /* @__PURE__ */ m("div", {
14
+ className: "flex items-center gap-2",
15
+ children: [t && /* @__PURE__ */ p(t, { className: "text-accent h-4.5 w-4.5" }), /* @__PURE__ */ p("span", {
16
+ className: "text-text-primary text-sm font-semibold",
17
+ children: e.name
18
+ })]
19
+ });
20
+ }
21
+ function _({ open: f, onClose: _, items: v, topBarNavItems: y = [], topBarNavLabel: b = "Primary", brand: x, currentPath: S, onNavigate: C, headerActions: w, className: T, ref: E, ...D }) {
22
+ let O = d(null), [k, A] = l(O), j = u(() => t(A, E), [A, E]);
23
+ i(O, f);
24
+ let M = s(f, () => _(), O);
25
+ if (o(f, O), !f) return null;
26
+ let N = y.length > 0;
27
+ return /* @__PURE__ */ p(a.Provider, {
28
+ value: M,
29
+ children: /* @__PURE__ */ p(c.Provider, {
30
+ value: k,
31
+ children: /* @__PURE__ */ m("div", {
32
+ className: "fixed inset-0 z-40 md:hidden",
33
+ children: [/* @__PURE__ */ p("div", {
34
+ className: "bg-bg-overlay fixed inset-0",
35
+ onClick: _
36
+ }), /* @__PURE__ */ m("div", {
37
+ ...D,
38
+ ref: j,
39
+ role: "dialog",
40
+ "aria-modal": "true",
41
+ "aria-label": "Navigation",
42
+ className: e("ui-glass ui-glass-chrome bg-bg-sidebar border-border animate-slide-in-left fixed inset-y-0 left-0 z-50 flex w-64 flex-col border-r", T),
43
+ children: [
44
+ /* @__PURE__ */ m("div", {
45
+ className: "border-border flex h-11 items-center justify-between border-b px-4",
46
+ children: [/* @__PURE__ */ p(g, { brand: x }), /* @__PURE__ */ p("button", {
47
+ type: "button",
48
+ onClick: _,
49
+ className: "text-text-tertiary hover:text-text-primary flex h-7 w-7 cursor-pointer items-center justify-center rounded",
50
+ "aria-label": "Close menu",
51
+ children: /* @__PURE__ */ p(h, { className: "h-4 w-4" })
52
+ })]
53
+ }),
54
+ w && /* @__PURE__ */ p("div", {
55
+ className: "border-border border-b px-4 py-2",
56
+ children: w
57
+ }),
58
+ /* @__PURE__ */ m("nav", {
59
+ className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-2",
60
+ children: [N && /* @__PURE__ */ m("div", {
61
+ className: "border-border mb-2 border-b pb-2",
62
+ children: [/* @__PURE__ */ p("div", {
63
+ className: "text-text-tertiary px-3 py-1 text-2xs font-medium uppercase",
64
+ children: b
65
+ }), /* @__PURE__ */ p("ul", {
66
+ className: "space-y-0.5",
67
+ "aria-label": b,
68
+ children: y.map((t) => {
69
+ let i = t.icon, a = r(t, S), o = t.rel ?? (t.target === "_blank" ? "noreferrer" : void 0);
70
+ return /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m("a", {
71
+ href: t.href ?? t.path,
72
+ target: t.target,
73
+ rel: o,
74
+ onClick: (e) => {
75
+ if (t.reloadDocument) {
76
+ _();
77
+ return;
78
+ }
79
+ n(e, t.path, C, _);
80
+ },
81
+ "aria-current": a ? "page" : void 0,
82
+ className: e("flex h-10 items-center gap-3 rounded-md px-3", "cursor-pointer transition-colors duration-[100ms]", a ? "bg-accent-muted text-accent-fg" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
83
+ children: [
84
+ i && /* @__PURE__ */ p(i, { className: "h-4 w-4" }),
85
+ /* @__PURE__ */ p("span", {
86
+ className: "min-w-0 flex-1 text-sm",
87
+ children: t.label
88
+ }),
89
+ t.badge && /* @__PURE__ */ p("span", {
90
+ className: "shrink-0",
91
+ children: t.badge
92
+ })
93
+ ]
94
+ }) }, `${t.label}-${t.path}`);
95
+ })
96
+ })]
97
+ }), /* @__PURE__ */ p("ul", {
98
+ className: "space-y-0.5",
99
+ children: v.map((t) => {
100
+ let i = r(t, S);
101
+ return /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m("a", {
102
+ href: t.path,
103
+ onClick: (e) => n(e, t.path, C, _),
104
+ "aria-current": i ? "page" : void 0,
105
+ className: e("flex h-10 items-center gap-3 rounded-md px-3", "cursor-pointer transition-colors duration-[100ms]", i ? "bg-accent-muted text-accent-fg" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
106
+ children: [
107
+ /* @__PURE__ */ p(t.icon, { className: "h-4 w-4" }),
108
+ /* @__PURE__ */ p("span", {
109
+ className: "min-w-0 flex-1 text-sm",
110
+ children: t.label
111
+ }),
112
+ t.badge && /* @__PURE__ */ p("span", {
113
+ className: "shrink-0",
114
+ children: t.badge
115
+ })
116
+ ]
117
+ }) }, t.path);
118
+ })
119
+ })]
120
+ })
121
+ ]
122
+ })]
123
+ })
124
+ })
125
+ });
126
+ }
127
+ //#endregion
128
+ export { _ as MobileDrawer };
@@ -1,7 +1,7 @@
1
- import { type ReactNode } from "react";
1
+ import { type ComponentPropsWithRef, type ReactNode } from "react";
2
2
  import { type AppShellNavigate } from "./navigation";
3
3
  import type { AppShellAccount, AppShellBrand, AppShellNavSection } from "./types";
4
- export interface SidebarProps {
4
+ export interface SidebarProps extends Omit<ComponentPropsWithRef<"aside">, "children"> {
5
5
  navSections: AppShellNavSection[];
6
6
  brand: AppShellBrand;
7
7
  accounts?: AppShellAccount[];
@@ -18,4 +18,4 @@ export interface SidebarProps {
18
18
  headerActions?: ReactNode;
19
19
  className?: string;
20
20
  }
21
- export declare function Sidebar({ navSections, brand, accounts, initialAccountIndex, onAccountChange, onSignOut, signOutPath, signOutLabel, settingsPath, settingsLabel, onOpenSettings, currentPath, onNavigate, headerActions, className, }: SidebarProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function Sidebar({ navSections, brand, accounts, initialAccountIndex, onAccountChange, onSignOut, signOutPath, signOutLabel, settingsPath, settingsLabel, onOpenSettings, currentPath, onNavigate, headerActions, className, style, ref, ...rest }: SidebarProps): import("react/jsx-runtime").JSX.Element;