@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
@@ -0,0 +1,355 @@
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, navigateToPath as i } from "./navigation.js";
4
+ import { usePortalContainer as a } from "../../hooks/usePortalContainer.js";
5
+ import { accentItems as o } from "../../config/theme.js";
6
+ import { useAnchoredPopup as s } from "../../hooks/useAnchoredPopup.js";
7
+ import { useDismiss as c } from "../../hooks/useDismiss.js";
8
+ import { useSettings as l } from "../../hooks/useSettings.js";
9
+ import { Avatar as u } from "../ui/Avatar.js";
10
+ import { useToast as d } from "../ui/Toast.js";
11
+ import { useCallback as f, useMemo as p, useRef as m, useState as h } from "react";
12
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
13
+ import { Accessibility as y, Check as b, ChevronDown as x, ChevronsUpDown as S, LogOut as C, Monitor as w, Moon as T, Settings as E, Sun as D } from "lucide-react";
14
+ import { createPortal as O } from "react-dom";
15
+ //#region src/components/app-shell/Sidebar.tsx
16
+ var k = 140, A = 400, j = 48, M = {
17
+ side: "right",
18
+ align: "end",
19
+ gap: 6
20
+ };
21
+ function N({ item: t, collapsed: i, currentPath: a, onNavigate: o }) {
22
+ let s = r(t, a);
23
+ return /* @__PURE__ */ v("a", {
24
+ href: t.path,
25
+ onClick: (e) => n(e, t.path, o),
26
+ "aria-current": s ? "page" : void 0,
27
+ className: e("font-navigation relative flex items-center gap-2 rounded px-2", "cursor-pointer transition-colors duration-[100ms]", i ? "mx-auto w-[2em] justify-center" : "", s ? "bg-accent-muted text-accent-fg" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
28
+ style: { height: "2em" },
29
+ title: i ? t.label : void 0,
30
+ children: [
31
+ s && /* @__PURE__ */ _("div", {
32
+ className: "bg-accent absolute left-0 w-0.5 rounded-md",
33
+ style: {
34
+ top: "0.3em",
35
+ bottom: "0.3em"
36
+ }
37
+ }),
38
+ /* @__PURE__ */ _("span", {
39
+ className: "shrink-0",
40
+ children: /* @__PURE__ */ _(t.icon, { className: "h-3.5 w-3.5" })
41
+ }),
42
+ !i && /* @__PURE__ */ _("span", {
43
+ className: "min-w-0 flex-1 truncate text-xs",
44
+ children: t.label
45
+ }),
46
+ !i && t.badge && /* @__PURE__ */ _("span", {
47
+ className: "ml-auto shrink-0",
48
+ children: t.badge
49
+ })
50
+ ]
51
+ });
52
+ }
53
+ function P({ brand: t, collapsed: n }) {
54
+ let r = t.icon, i = t.name.trim().charAt(0).toUpperCase();
55
+ return t.logo && !n ? /* @__PURE__ */ _("div", {
56
+ className: "flex min-w-0 items-center gap-2 px-2",
57
+ children: t.logo
58
+ }) : /* @__PURE__ */ v("div", {
59
+ className: e("flex min-w-0 items-center gap-2 px-2", n && "mx-auto justify-center px-0"),
60
+ children: [r ? /* @__PURE__ */ _(r, { className: "text-accent h-3.5 w-3.5 shrink-0" }) : n && i && /* @__PURE__ */ _("span", {
61
+ className: "text-accent-fg shrink-0 text-xs font-bold",
62
+ children: i
63
+ }), !n && /* @__PURE__ */ _("span", {
64
+ className: "text-text-primary truncate text-xs font-semibold",
65
+ children: t.name
66
+ })]
67
+ });
68
+ }
69
+ function F(e) {
70
+ return e.role ?? e.email;
71
+ }
72
+ function I({ collapsed: t, accounts: n, initialAccountIndex: r = 0, onAccountChange: o, onSignOut: l, signOutPath: d, signOutLabel: p = "Sign out", onNavigate: y }) {
73
+ let [x, w] = h(!1), T = a(), [E, D] = h(() => Math.min(r, Math.max(n.length - 1, 0))), k = m(null), A = m(null), j = f(() => w(!1), []);
74
+ c(x, j, [A], [k]), s(x, k, A, {
75
+ ...M,
76
+ onAnchorHidden: j
77
+ });
78
+ let N = n[E] ?? n[0], P = !!(l || d);
79
+ function I() {
80
+ w(!x);
81
+ }
82
+ function L(e, t) {
83
+ D(t), o?.(e, t), w(!1);
84
+ }
85
+ function R() {
86
+ w(!1), l ? l() : d && i(d, y);
87
+ }
88
+ return N ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("button", {
89
+ type: "button",
90
+ ref: k,
91
+ onClick: I,
92
+ className: e("font-navigation flex w-full cursor-pointer items-center gap-2 rounded px-2 transition-colors duration-[100ms]", "text-text-secondary hover:text-text-primary hover:bg-bg-hover", t && "justify-center px-0"),
93
+ style: { height: "2.5em" },
94
+ title: t ? N.name : void 0,
95
+ children: [/* @__PURE__ */ _(u, {
96
+ name: N.name,
97
+ src: N.avatarSrc,
98
+ size: "sm"
99
+ }), !t && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
100
+ className: "min-w-0 flex-1 text-left",
101
+ children: [/* @__PURE__ */ _("p", {
102
+ className: "text-text-primary truncate text-xs leading-tight font-medium",
103
+ children: N.name
104
+ }), F(N) && /* @__PURE__ */ _("p", {
105
+ className: "text-2xs text-text-tertiary truncate leading-tight",
106
+ children: F(N)
107
+ })]
108
+ }), /* @__PURE__ */ _(S, { className: "text-text-tertiary h-3 w-3 shrink-0" })] })]
109
+ }), x && O(/* @__PURE__ */ v("div", {
110
+ ref: A,
111
+ className: "ui-glass ui-glass-popover bg-bg-tertiary border-border-strong animate-scale-in fixed top-0 left-0 z-[100] w-56 rounded-md border py-1 shadow-lg",
112
+ children: [
113
+ /* @__PURE__ */ _("p", {
114
+ className: "text-2xs-f text-text-tertiary font-label px-3 py-1.5 font-semibold tracking-wider uppercase",
115
+ children: "Accounts"
116
+ }),
117
+ n.map((e, t) => /* @__PURE__ */ v("button", {
118
+ type: "button",
119
+ onClick: () => L(e, t),
120
+ className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-8 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
121
+ children: [
122
+ /* @__PURE__ */ _(u, {
123
+ name: e.name,
124
+ src: e.avatarSrc,
125
+ size: "sm"
126
+ }),
127
+ /* @__PURE__ */ v("div", {
128
+ className: "min-w-0 flex-1 text-left",
129
+ children: [/* @__PURE__ */ _("p", {
130
+ className: "text-text-primary truncate text-xs leading-tight",
131
+ children: e.name
132
+ }), e.email && /* @__PURE__ */ _("p", {
133
+ className: "text-2xs text-text-tertiary truncate leading-tight",
134
+ children: e.email
135
+ })]
136
+ }),
137
+ t === E && /* @__PURE__ */ _(b, { className: "text-accent h-3.5 w-3.5 shrink-0" })
138
+ ]
139
+ }, `${e.name}-${e.email ?? t}`)),
140
+ P && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", { className: "border-border my-1 border-t" }), /* @__PURE__ */ v("button", {
141
+ type: "button",
142
+ onClick: R,
143
+ className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
144
+ children: [/* @__PURE__ */ _(C, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ _("span", { children: p })]
145
+ })] })
146
+ ]
147
+ }), T ?? document.body)] }) : null;
148
+ }
149
+ function L({ collapsed: t, settingsPath: n, settingsLabel: r = "All Settings", onOpenSettings: u, onNavigate: p }) {
150
+ let [x, S] = h(!1), C = a(), k = m(null), A = m(null), { accentColor: j, setAccentColor: N, reducedMotion: P, setReducedMotion: F, colorMode: I, setColorMode: L } = l(), { toast: R } = d(), z = !!(n || u), B = f(() => S(!1), []);
151
+ c(x, B, [A], [k]), s(x, k, A, {
152
+ ...M,
153
+ onAnchorHidden: B
154
+ });
155
+ function V() {
156
+ S(!x);
157
+ }
158
+ function H() {
159
+ S(!1), u ? u() : n && i(n, p);
160
+ }
161
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("button", {
162
+ type: "button",
163
+ ref: k,
164
+ onClick: V,
165
+ className: e("font-navigation relative flex w-full items-center gap-2 rounded px-2", "cursor-pointer transition-colors duration-[100ms]", t ? "mx-auto w-[2em] justify-center" : "", x ? "bg-accent-muted text-accent-fg" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
166
+ style: { height: "2em" },
167
+ title: t ? "Settings" : void 0,
168
+ children: [/* @__PURE__ */ _(E, { className: "h-3.5 w-3.5 shrink-0" }), !t && /* @__PURE__ */ _("span", {
169
+ className: "truncate text-xs",
170
+ children: "Settings"
171
+ })]
172
+ }), x && O(/* @__PURE__ */ v("div", {
173
+ ref: A,
174
+ className: "ui-glass ui-glass-popover bg-bg-tertiary border-border-strong animate-scale-in fixed top-0 left-0 z-[100] w-64 rounded-md border py-1 shadow-lg",
175
+ children: [
176
+ /* @__PURE__ */ _("p", {
177
+ className: "text-2xs-f text-text-tertiary font-label px-3 py-1.5 font-semibold tracking-wider uppercase",
178
+ children: "Mode"
179
+ }),
180
+ [
181
+ {
182
+ value: "dark",
183
+ label: "Dark",
184
+ Icon: T
185
+ },
186
+ {
187
+ value: "light",
188
+ label: "Light",
189
+ Icon: D
190
+ },
191
+ {
192
+ value: "system",
193
+ label: "System",
194
+ Icon: w
195
+ }
196
+ ].map(({ value: e, label: t, Icon: n }) => /* @__PURE__ */ v("button", {
197
+ type: "button",
198
+ onClick: () => L(e),
199
+ className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
200
+ children: [
201
+ /* @__PURE__ */ _(n, { className: "h-3.5 w-3.5 shrink-0" }),
202
+ /* @__PURE__ */ _("span", {
203
+ className: "flex-1 text-left",
204
+ children: t
205
+ }),
206
+ I === e && /* @__PURE__ */ _(b, { className: "text-accent h-3.5 w-3.5 shrink-0" })
207
+ ]
208
+ }, e)),
209
+ /* @__PURE__ */ _("div", { className: "border-border my-1 border-t" }),
210
+ /* @__PURE__ */ _("p", {
211
+ className: "text-2xs-f text-text-tertiary font-label px-3 py-1.5 font-semibold tracking-wider uppercase",
212
+ children: "Accent"
213
+ }),
214
+ /* @__PURE__ */ _("div", {
215
+ className: "flex flex-wrap gap-1.5 px-3 pb-2",
216
+ children: o.map((t) => /* @__PURE__ */ _("button", {
217
+ type: "button",
218
+ onClick: () => N(t.value),
219
+ className: e("h-5 w-5 cursor-pointer rounded-full transition-transform duration-[100ms] hover:scale-110", j === t.value && "ring-offset-bg-tertiary scale-110 ring-2 ring-offset-1"),
220
+ style: {
221
+ backgroundColor: t.color,
222
+ ...j === t.value ? { "--utility-ring-color": t.color } : {}
223
+ },
224
+ title: t.value.charAt(0).toUpperCase() + t.value.slice(1)
225
+ }, t.value))
226
+ }),
227
+ /* @__PURE__ */ _("div", { className: "border-border my-1 border-t" }),
228
+ /* @__PURE__ */ v("button", {
229
+ type: "button",
230
+ onClick: () => {
231
+ F(!P), R("info", P ? "Animations enabled" : "Animations disabled");
232
+ },
233
+ className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
234
+ children: [
235
+ /* @__PURE__ */ _(y, { className: "h-3.5 w-3.5 shrink-0" }),
236
+ /* @__PURE__ */ _("span", {
237
+ className: "flex-1 text-left",
238
+ children: "Reduced Motion"
239
+ }),
240
+ P && /* @__PURE__ */ _(b, { className: "text-accent h-3.5 w-3.5 shrink-0" })
241
+ ]
242
+ }),
243
+ z && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", { className: "border-border my-1 border-t" }), /* @__PURE__ */ v("button", {
244
+ type: "button",
245
+ onClick: H,
246
+ className: "text-text-secondary hover:text-text-primary hover:bg-bg-hover font-navigation flex h-7 w-full cursor-pointer items-center gap-2.5 px-3 text-xs transition-colors duration-[100ms]",
247
+ children: [/* @__PURE__ */ _(E, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ _("span", {
248
+ className: "flex-1 text-left",
249
+ children: r
250
+ })]
251
+ })] })
252
+ ]
253
+ }), C ?? document.body)] });
254
+ }
255
+ function R({ navSections: n, brand: r, accounts: i = [], initialAccountIndex: a, onAccountChange: o, onSignOut: s, signOutPath: c, signOutLabel: u, settingsPath: d, settingsLabel: g, onOpenSettings: y, currentPath: b, onNavigate: S, headerActions: C, className: w, style: T, ref: E, ...D }) {
256
+ let { sidebarCollapsed: O, sidebarWidth: M, setSidebarWidth: F } = l(), [R, z] = h(/* @__PURE__ */ new Set()), B = m(null), V = p(() => t(B, E), [E]), H = m(!1), [U, W] = h(!1), G = f((e) => {
257
+ if (O) return;
258
+ e.preventDefault(), H.current = !0, W(!0), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
259
+ let t = (e) => {
260
+ if (!H.current || !B.current) return;
261
+ let t = B.current.getBoundingClientRect(), n = e.clientX - t.left;
262
+ F(Math.max(k, Math.min(n, A)));
263
+ }, n = () => {
264
+ H.current = !1, W(!1), document.body.style.cursor = "", document.body.style.userSelect = "", document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
265
+ };
266
+ document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
267
+ }, [O, F]);
268
+ function K(e) {
269
+ z((t) => {
270
+ let n = new Set(t);
271
+ return n.has(e) ? n.delete(e) : n.add(e), n;
272
+ });
273
+ }
274
+ return /* @__PURE__ */ v("aside", {
275
+ ...D,
276
+ ref: V,
277
+ className: e("ui-glass ui-glass-chrome bg-bg-secondary relative hidden shrink-0 flex-col border-r md:flex", !U && "transition-[width] duration-[200ms] ease-out", "border-border", w),
278
+ style: {
279
+ width: O ? j : M,
280
+ ...T
281
+ },
282
+ children: [
283
+ !O && /* @__PURE__ */ _("div", {
284
+ onMouseDown: G,
285
+ className: "hover:bg-accent/30 active:bg-accent/50 absolute top-0 right-0 bottom-0 z-10 w-1 cursor-col-resize"
286
+ }),
287
+ /* @__PURE__ */ _("div", {
288
+ className: "border-border flex shrink-0 items-center border-b px-2",
289
+ style: { height: "var(--topbar-height)" },
290
+ children: /* @__PURE__ */ _(P, {
291
+ brand: r,
292
+ collapsed: O
293
+ })
294
+ }),
295
+ !O && C && /* @__PURE__ */ _("div", {
296
+ className: "border-border shrink-0 border-b px-2 py-2",
297
+ children: C
298
+ }),
299
+ /* @__PURE__ */ _("nav", {
300
+ className: "flex-1 overflow-y-auto px-2 py-2",
301
+ children: n.map((t, n) => {
302
+ let r = R.has(t.title);
303
+ return /* @__PURE__ */ v("div", {
304
+ className: "mb-4",
305
+ children: [O ? n > 0 && /* @__PURE__ */ _("hr", { className: "border-border mx-auto my-1.5 w-4/5" }) : /* @__PURE__ */ v("button", {
306
+ type: "button",
307
+ onClick: () => K(t.title),
308
+ className: "text-2xs-f text-text-tertiary hover:text-text-secondary font-label flex w-full cursor-pointer items-center gap-1 px-2 text-left font-semibold tracking-wider uppercase",
309
+ style: {
310
+ paddingTop: "0.35em",
311
+ paddingBottom: "0.35em"
312
+ },
313
+ children: [/* @__PURE__ */ _("span", {
314
+ className: "min-w-0 flex-1",
315
+ children: t.title
316
+ }), /* @__PURE__ */ _(x, { className: e("h-3 w-3 shrink-0 transition-transform", r && "-rotate-90") })]
317
+ }), (!r || O) && /* @__PURE__ */ _("ul", {
318
+ className: "flex flex-col gap-1",
319
+ children: t.items.map((e) => /* @__PURE__ */ _("li", { children: /* @__PURE__ */ _(N, {
320
+ item: e,
321
+ collapsed: O,
322
+ currentPath: b,
323
+ onNavigate: S
324
+ }) }, e.path))
325
+ })]
326
+ }, t.title);
327
+ })
328
+ }),
329
+ /* @__PURE__ */ v("div", {
330
+ className: "shrink-0 px-2 py-1.5",
331
+ children: [/* @__PURE__ */ _(L, {
332
+ collapsed: O,
333
+ settingsPath: d,
334
+ settingsLabel: g,
335
+ onOpenSettings: y,
336
+ onNavigate: S
337
+ }), i.length > 0 && /* @__PURE__ */ _("div", {
338
+ className: "border-border mt-2 border-t pt-2",
339
+ children: /* @__PURE__ */ _(I, {
340
+ collapsed: O,
341
+ accounts: i,
342
+ initialAccountIndex: a,
343
+ onAccountChange: o,
344
+ onSignOut: s,
345
+ signOutPath: c,
346
+ signOutLabel: u,
347
+ onNavigate: S
348
+ })
349
+ })]
350
+ })
351
+ ]
352
+ });
353
+ }
354
+ //#endregion
355
+ export { R as Sidebar };
@@ -1,4 +1,5 @@
1
- export interface ThemeMenuProps {
1
+ import { type ComponentPropsWithRef } from "react";
2
+ export interface ThemeMenuProps extends Omit<ComponentPropsWithRef<"button">, "children"> {
2
3
  /** Extra classes for the trigger button. */
3
4
  className?: string;
4
5
  /**
@@ -16,4 +17,4 @@ export interface ThemeMenuProps {
16
17
  * apply immediately; "Save for theme" persists them as overrides for the
17
18
  * active theme.
18
19
  */
19
- export declare function ThemeMenu({ className, respondToOpenEvent, }: ThemeMenuProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function ThemeMenu({ className, respondToOpenEvent, onClick, ref, ...rest }: ThemeMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,273 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { mergeRefs as t } from "../../lib/mergeRefs.js";
3
+ import { usePortalContainer as n } from "../../hooks/usePortalContainer.js";
4
+ import { accentItems as r, darkThemes as i, fontOptions as a, lightThemes as o, themeItems as s } from "../../config/theme.js";
5
+ import { useAnchoredPopup as ee } from "../../hooks/useAnchoredPopup.js";
6
+ import { useDismiss as te } from "../../hooks/useDismiss.js";
7
+ import { useSettings as c } from "../../hooks/useSettings.js";
8
+ import { useToast as l } from "../ui/Toast.js";
9
+ import { useApplyTheme as u } from "../../hooks/useApplyTheme.js";
10
+ import { Button as d } from "../ui/Button.js";
11
+ import { SectionHeader as f } from "../ui/SectionHeader.js";
12
+ import { SelectDropdown as p } from "../ui/SelectDropdown.js";
13
+ import { Slider as m } from "../ui/Slider.js";
14
+ import { ThemePreview as h } from "../ui/ThemePreview.js";
15
+ import { Toggle as g } from "../ui/Toggle.js";
16
+ import { THEME_MENU_EVENT as _ } from "./themeMenuEvents.js";
17
+ import { useCallback as v, useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
18
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
19
+ import { Monitor as E, Moon as D, Palette as ne, Sun as O } from "lucide-react";
20
+ import { createPortal as re } from "react-dom";
21
+ //#region src/components/app-shell/ThemeMenu.tsx
22
+ var k = [
23
+ {
24
+ value: "dark",
25
+ label: "Dark",
26
+ Icon: D
27
+ },
28
+ {
29
+ value: "light",
30
+ label: "Light",
31
+ Icon: O
32
+ },
33
+ {
34
+ value: "system",
35
+ label: "System",
36
+ Icon: E
37
+ }
38
+ ];
39
+ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j }) {
40
+ let [M, N] = S(!1), P = n(), [F, I] = S(!1), L = x(null), R = b(() => t(L, A), [A]), z = x(null), B = c(), V = u(), { toast: H } = l(), U = v(() => {
41
+ N(!1), I(!1);
42
+ }, []);
43
+ te(M, U, [z], [L], { outsideClick: !F }), ee(M, L, z, {
44
+ side: "bottom",
45
+ align: "end",
46
+ gap: 6,
47
+ onAnchorHidden: F ? void 0 : U
48
+ });
49
+ function W() {
50
+ if (M) {
51
+ U();
52
+ return;
53
+ }
54
+ N(!0);
55
+ }
56
+ y(() => {
57
+ if (!D) return;
58
+ let e = () => {
59
+ N(!0), I(!0);
60
+ };
61
+ return document.addEventListener(_, e), () => document.removeEventListener(_, e);
62
+ }, [D]);
63
+ let { colorMode: G, setColorMode: K, preferredDarkTheme: q, preferredLightTheme: J, accentColor: Y, setAccentColor: X, fontSize: ie, setFontSize: ae, uiFont: oe, setUiFont: se, headingFont: ce, setHeadingFont: le, proseFont: ue, setProseFont: de, codeFont: fe, setCodeFont: pe, borderRadius: me, setBorderRadius: he, borderWidth: ge, setBorderWidth: _e, tracking: ve, setTracking: ye, lineHeight: be, setLineHeight: xe, density: Se, setDensity: Z, reducedMotion: Ce, setReducedMotion: we, saveThemeCustomization: Te, resetThemeCustomization: Ee, hasThemeOverrides: De, isCustomized: Q, resolvedTheme: $ } = B;
64
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
65
+ type: "button",
66
+ ...j,
67
+ ref: R,
68
+ onClick: (e) => {
69
+ O?.(e), !e.defaultPrevented && W();
70
+ },
71
+ "aria-label": "Theme settings",
72
+ "aria-haspopup": "dialog",
73
+ "aria-expanded": M,
74
+ title: "Theme",
75
+ className: e("flex h-7 w-7 cursor-pointer items-center justify-center rounded transition-colors duration-[100ms]", M ? "text-accent-fg bg-accent-muted" : "text-text-tertiary hover:text-text-primary hover:bg-bg-hover", E),
76
+ children: /* @__PURE__ */ w(ne, { className: "h-4 w-4" })
77
+ }), M && re(/* @__PURE__ */ w("div", {
78
+ ref: z,
79
+ role: "dialog",
80
+ "aria-label": "Theme settings",
81
+ className: "ui-theme-menu ui-glass ui-glass-popover bg-bg-tertiary border-border-strong animate-scale-in fixed top-0 left-0 z-[100] flex w-80 flex-col overflow-y-auto rounded-md border p-3 shadow-lg",
82
+ style: { maxHeight: "80vh" },
83
+ children: /* @__PURE__ */ T("div", {
84
+ className: "space-y-4",
85
+ children: [
86
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(f, {
87
+ as: "h3",
88
+ border: !1,
89
+ className: "mb-2",
90
+ children: "Mode"
91
+ }), /* @__PURE__ */ w("div", {
92
+ className: "bg-bg-secondary border-border flex gap-1 rounded-md border p-1.5",
93
+ children: k.map(({ value: t, label: n, Icon: r }) => /* @__PURE__ */ T("button", {
94
+ type: "button",
95
+ onClick: () => K(t),
96
+ className: e("font-navigation flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded px-2 py-1 text-xs transition-colors duration-[100ms]", G === t ? "bg-accent-muted text-accent-fg" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover"),
97
+ children: [/* @__PURE__ */ w(r, { className: "h-3.5 w-3.5" }), n]
98
+ }, t))
99
+ })] }),
100
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(f, {
101
+ as: "h3",
102
+ border: !1,
103
+ className: "mb-2",
104
+ children: "Dark themes"
105
+ }), /* @__PURE__ */ w("div", {
106
+ className: "grid grid-cols-2 gap-2",
107
+ children: i.map((e) => /* @__PURE__ */ w(h, {
108
+ label: e.label,
109
+ icon: e.icon,
110
+ preview: e.preview,
111
+ active: q === e.value,
112
+ onClick: () => V(e.value)
113
+ }, e.value))
114
+ })] }),
115
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(f, {
116
+ as: "h3",
117
+ border: !1,
118
+ className: "mb-2",
119
+ children: "Light themes"
120
+ }), /* @__PURE__ */ w("div", {
121
+ className: "grid grid-cols-2 gap-2",
122
+ children: o.map((e) => /* @__PURE__ */ w(h, {
123
+ label: e.label,
124
+ icon: e.icon,
125
+ preview: e.preview,
126
+ active: J === e.value,
127
+ onClick: () => V(e.value)
128
+ }, e.value))
129
+ })] }),
130
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(f, {
131
+ as: "h3",
132
+ border: !1,
133
+ className: "mb-2",
134
+ children: "Accent"
135
+ }), /* @__PURE__ */ w("div", {
136
+ className: "flex flex-wrap gap-1.5",
137
+ children: r.map((t) => /* @__PURE__ */ w("button", {
138
+ type: "button",
139
+ onClick: () => X(t.value),
140
+ className: e("h-6 w-6 cursor-pointer rounded-full transition-transform duration-[100ms] hover:scale-110", Y === t.value && "ring-offset-bg-tertiary scale-110 ring-2 ring-offset-1"),
141
+ style: {
142
+ backgroundColor: t.color,
143
+ ...Y === t.value ? { "--utility-ring-color": t.color } : {}
144
+ },
145
+ title: t.value.charAt(0).toUpperCase() + t.value.slice(1),
146
+ "aria-label": t.value
147
+ }, t.value))
148
+ })] }),
149
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(f, {
150
+ as: "h3",
151
+ border: !1,
152
+ className: "mb-2",
153
+ children: "Fonts"
154
+ }), /* @__PURE__ */ T("div", {
155
+ className: "grid grid-cols-2 gap-2",
156
+ children: [
157
+ /* @__PURE__ */ w(p, {
158
+ label: "UI / Body",
159
+ size: "sm",
160
+ options: a,
161
+ value: oe,
162
+ onValueChange: (e) => se(e)
163
+ }),
164
+ /* @__PURE__ */ w(p, {
165
+ label: "Headings",
166
+ size: "sm",
167
+ options: a,
168
+ value: ce,
169
+ onValueChange: (e) => le(e)
170
+ }),
171
+ /* @__PURE__ */ w(p, {
172
+ label: "Prose",
173
+ size: "sm",
174
+ options: a,
175
+ value: ue,
176
+ onValueChange: (e) => de(e)
177
+ }),
178
+ /* @__PURE__ */ w(p, {
179
+ label: "Code",
180
+ size: "sm",
181
+ options: a,
182
+ value: fe,
183
+ onValueChange: (e) => pe(e)
184
+ })
185
+ ]
186
+ })] }),
187
+ /* @__PURE__ */ T("div", {
188
+ className: "space-y-3",
189
+ children: [
190
+ /* @__PURE__ */ w(m, {
191
+ label: "Font size",
192
+ min: 11,
193
+ max: 18,
194
+ value: ie,
195
+ onValueChange: ae,
196
+ showValue: !0
197
+ }),
198
+ /* @__PURE__ */ w(m, {
199
+ label: "Corner radius",
200
+ min: 0,
201
+ max: 16,
202
+ value: me,
203
+ onValueChange: he,
204
+ showValue: !0
205
+ }),
206
+ /* @__PURE__ */ w(m, {
207
+ label: "Border width",
208
+ min: 1,
209
+ max: 3,
210
+ value: ge,
211
+ onValueChange: _e,
212
+ showValue: !0
213
+ }),
214
+ /* @__PURE__ */ w(m, {
215
+ label: "Letter spacing",
216
+ min: 0,
217
+ max: .3,
218
+ step: .01,
219
+ value: ve,
220
+ onValueChange: ye,
221
+ showValue: !0
222
+ }),
223
+ /* @__PURE__ */ w(m, {
224
+ label: "Line height",
225
+ min: 1.2,
226
+ max: 2,
227
+ step: .05,
228
+ value: be,
229
+ onValueChange: xe,
230
+ showValue: !0
231
+ }),
232
+ /* @__PURE__ */ w(m, {
233
+ label: "Density",
234
+ min: .18,
235
+ max: .32,
236
+ step: .01,
237
+ value: Se,
238
+ onValueChange: Z,
239
+ showValue: !0
240
+ })
241
+ ]
242
+ }),
243
+ /* @__PURE__ */ w(g, {
244
+ label: "Reduced motion",
245
+ checked: Ce,
246
+ onCheckedChange: we
247
+ }),
248
+ /* @__PURE__ */ T("div", {
249
+ className: "border-border flex items-center gap-2 border-t pt-3",
250
+ children: [/* @__PURE__ */ w(d, {
251
+ variant: "primary",
252
+ size: "sm",
253
+ disabled: !Q,
254
+ onClick: () => {
255
+ Te(), H("success", `Saved customization for ${s.find((e) => e.value === $)?.label ?? $}`);
256
+ },
257
+ children: "Save for theme"
258
+ }), /* @__PURE__ */ w(d, {
259
+ variant: "secondary",
260
+ size: "sm",
261
+ disabled: !De && !Q,
262
+ onClick: () => {
263
+ Ee(), H("info", "Reset to theme defaults");
264
+ },
265
+ children: "Reset"
266
+ })]
267
+ })
268
+ ]
269
+ })
270
+ }), P ?? document.body)] });
271
+ }
272
+ //#endregion
273
+ export { A as ThemeMenu };
@@ -1,8 +1,8 @@
1
- import type { ReactNode } from "react";
1
+ import type { ComponentPropsWithRef, ReactNode } from "react";
2
2
  import { type CommandPaletteShortcut } from "./commandPaletteEvents";
3
3
  import { type AppShellNavigate } from "./navigation";
4
4
  import type { AppShellBreadcrumbOptions, AppShellTopBarNavItem } from "./types";
5
- export interface TopBarProps {
5
+ export interface TopBarProps extends Omit<ComponentPropsWithRef<"header">, "children"> {
6
6
  /** Called when the menu button (shown below the `md` breakpoint) is clicked. */
7
7
  onMobileMenuToggle?: () => void;
8
8
  /** Breadcrumb label options. Pass `false` to hide breadcrumbs; ignored when `navItems` is non-empty. */
@@ -26,4 +26,4 @@ export interface TopBarProps {
26
26
  /** Extra content rendered at the right of the bar, before the search button. */
27
27
  actions?: ReactNode;
28
28
  }
29
- export declare function TopBar({ onMobileMenuToggle, breadcrumbs, navItems, navLabel, showCommandTrigger, commandTriggerLabel, commandShortcut, currentPath, onNavigate, onCommandTrigger, actions, }: TopBarProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function TopBar({ onMobileMenuToggle, breadcrumbs, navItems, navLabel, showCommandTrigger, commandTriggerLabel, commandShortcut, currentPath, onNavigate, onCommandTrigger, actions, className, style, ref, ...rest }: TopBarProps): import("react/jsx-runtime").JSX.Element;