@nocoo/basalt 3.2.0 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +25 -19
  2. package/ai/COMPATIBILITY.md +41 -36
  3. package/ai/DESIGN.md +73 -56
  4. package/ai/INTEGRATION.md +819 -825
  5. package/ai/RECIPES.md +334 -135
  6. package/ai/USAGE.md +2 -2
  7. package/ai/registry.json +454 -97
  8. package/ai/sources.json +2 -2
  9. package/dist/assets/brand-mark.js +1 -2
  10. package/dist/charts/area.js +1 -2
  11. package/dist/charts/bar.js +1 -2
  12. package/dist/charts/bullet.js +1 -2
  13. package/dist/charts/chart-colors.js +1 -2
  14. package/dist/charts/charts.js +1 -2
  15. package/dist/charts/config.js +1 -2
  16. package/dist/charts/custom-chart.js +1 -2
  17. package/dist/charts/date-navigation.js +1 -2
  18. package/dist/charts/donut.js +1 -2
  19. package/dist/charts/frame.js +3 -4
  20. package/dist/charts/frame.js.map +1 -1
  21. package/dist/charts/funnel.js +1 -2
  22. package/dist/charts/gauge.js +1 -2
  23. package/dist/charts/grouped-bar.js +1 -2
  24. package/dist/charts/heatmap-calendar.js +7 -11
  25. package/dist/charts/heatmap-calendar.js.map +1 -1
  26. package/dist/charts/heatmap-matrix.js +4 -5
  27. package/dist/charts/heatmap-matrix.js.map +1 -1
  28. package/dist/charts/item-list.js +1 -2
  29. package/dist/charts/legend.js +1 -2
  30. package/dist/charts/line.js +1 -2
  31. package/dist/charts/palette.js +1 -2
  32. package/dist/charts/radar.js +1 -2
  33. package/dist/charts/sample.js +1 -2
  34. package/dist/charts/sankey.js +1 -2
  35. package/dist/charts/series.js +1 -2
  36. package/dist/charts/slot-bar.js +1 -2
  37. package/dist/charts/sparkline.js +1 -2
  38. package/dist/charts/stacked-bar.js +1 -2
  39. package/dist/charts/stat-card.js +1 -2
  40. package/dist/charts/timeline.js +1 -2
  41. package/dist/charts/timeseries.js +1 -2
  42. package/dist/charts/tooltip.js +31 -27
  43. package/dist/charts/tooltip.js.map +1 -1
  44. package/dist/components/accordion.js +1 -2
  45. package/dist/components/alert-dialog.js +1 -2
  46. package/dist/components/app-header.js +2 -3
  47. package/dist/components/app-header.js.map +1 -1
  48. package/dist/components/app-shell.js +2 -3
  49. package/dist/components/app-shell.js.map +1 -1
  50. package/dist/components/approval-card.js +1 -2
  51. package/dist/components/autocomplete.js +1 -2
  52. package/dist/components/avatar.js +1 -2
  53. package/dist/components/badge.js +1 -2
  54. package/dist/components/banner.js +1 -2
  55. package/dist/components/basalt-mark.js +1 -2
  56. package/dist/components/battery-meter.js +1 -2
  57. package/dist/components/breadcrumbs.js +1 -2
  58. package/dist/components/button.d.ts +1 -1
  59. package/dist/components/button.js +3 -3
  60. package/dist/components/button.js.map +1 -1
  61. package/dist/components/chat-bubble.js +1 -2
  62. package/dist/components/chat-composer.js +2 -3
  63. package/dist/components/chat-composer.js.map +1 -1
  64. package/dist/components/chat-header.js +1 -2
  65. package/dist/components/chat-inbox.js +1 -2
  66. package/dist/components/chat-markdown.js +1 -2
  67. package/dist/components/chat-message.js +2 -3
  68. package/dist/components/chat-message.js.map +1 -1
  69. package/dist/components/checkbox.js +1 -2
  70. package/dist/components/clipboard-text.js +1 -2
  71. package/dist/components/code.js +2 -3
  72. package/dist/components/code.js.map +1 -1
  73. package/dist/components/collapsible.js +1 -2
  74. package/dist/components/collapsible.js.map +1 -1
  75. package/dist/components/combobox.js +1 -2
  76. package/dist/components/command-palette.js +3 -4
  77. package/dist/components/command-palette.js.map +1 -1
  78. package/dist/components/confirm-dialog.js +3 -12
  79. package/dist/components/confirm-dialog.js.map +1 -1
  80. package/dist/components/context-cards.js +2 -3
  81. package/dist/components/context-cards.js.map +1 -1
  82. package/dist/components/context-menu.js +2 -3
  83. package/dist/components/context-menu.js.map +1 -1
  84. package/dist/components/data-table.js +129 -131
  85. package/dist/components/data-table.js.map +1 -1
  86. package/dist/components/date-picker.js +7 -18
  87. package/dist/components/date-picker.js.map +1 -1
  88. package/dist/components/delete-resource.js +1 -2
  89. package/dist/components/description-list.js +1 -2
  90. package/dist/components/dialog.js +1 -2
  91. package/dist/components/diff-table.js +2 -3
  92. package/dist/components/diff-table.js.map +1 -1
  93. package/dist/components/dock.js +1 -2
  94. package/dist/components/dock.js.map +1 -1
  95. package/dist/components/dropdown-menu.js +2 -3
  96. package/dist/components/dropdown-menu.js.map +1 -1
  97. package/dist/components/editable-nav-item.js +3 -4
  98. package/dist/components/editable-nav-item.js.map +1 -1
  99. package/dist/components/empty.js +1 -2
  100. package/dist/components/fab.js +1 -2
  101. package/dist/components/field.js +1 -2
  102. package/dist/components/file-dropzone.js +2 -3
  103. package/dist/components/file-dropzone.js.map +1 -1
  104. package/dist/components/filter-bar.js +2 -3
  105. package/dist/components/filter-bar.js.map +1 -1
  106. package/dist/components/flow.js +1 -2
  107. package/dist/components/grid.js +1 -2
  108. package/dist/components/hover-card.js +1 -2
  109. package/dist/components/icon-picker.js +4 -5
  110. package/dist/components/icon-picker.js.map +1 -1
  111. package/dist/components/inline-editable.js +2 -3
  112. package/dist/components/inline-editable.js.map +1 -1
  113. package/dist/components/input-area.js +1 -2
  114. package/dist/components/input-group.js +4 -5
  115. package/dist/components/input-group.js.map +1 -1
  116. package/dist/components/input.js +1 -2
  117. package/dist/components/label.js +1 -2
  118. package/dist/components/layer-card.js +3 -3
  119. package/dist/components/layer-card.js.map +1 -1
  120. package/dist/components/link.js +2 -3
  121. package/dist/components/link.js.map +1 -1
  122. package/dist/components/loader.js +1 -2
  123. package/dist/components/loading-screen.js +1 -2
  124. package/dist/components/menu-bar.js +3 -4
  125. package/dist/components/menu-bar.js.map +1 -1
  126. package/dist/components/meter.js +1 -2
  127. package/dist/components/multi-select.js +2 -3
  128. package/dist/components/multi-select.js.map +1 -1
  129. package/dist/components/navigation-menu.js +1 -2
  130. package/dist/components/overlay.d.ts +3 -6
  131. package/dist/components/overlay.js +4 -5
  132. package/dist/components/overlay.js.map +1 -1
  133. package/dist/components/page-header.js +1 -2
  134. package/dist/components/pagination.js +1 -2
  135. package/dist/components/popover.js +1 -2
  136. package/dist/components/prompt-bar.js +1 -2
  137. package/dist/components/radio.js +2 -7
  138. package/dist/components/radio.js.map +1 -1
  139. package/dist/components/recommendation-card.js +1 -2
  140. package/dist/components/resource-list.js +1 -2
  141. package/dist/components/responsive-master-detail.js +3 -4
  142. package/dist/components/responsive-master-detail.js.map +1 -1
  143. package/dist/components/scroll-area.js +2 -3
  144. package/dist/components/scroll-area.js.map +1 -1
  145. package/dist/components/section-rule.js +1 -2
  146. package/dist/components/segment-control.js +2 -3
  147. package/dist/components/segment-control.js.map +1 -1
  148. package/dist/components/select.js +2 -3
  149. package/dist/components/select.js.map +1 -1
  150. package/dist/components/sensitive-input.js +2 -3
  151. package/dist/components/sensitive-input.js.map +1 -1
  152. package/dist/components/separator.js +1 -2
  153. package/dist/components/sheet.js +1 -2
  154. package/dist/components/sidebar.d.ts +53 -19
  155. package/dist/components/sidebar.js +201 -100
  156. package/dist/components/sidebar.js.map +1 -1
  157. package/dist/components/skeleton-line.js +1 -2
  158. package/dist/components/slider.js +1 -2
  159. package/dist/components/stat-strip.js +1 -2
  160. package/dist/components/switch.js +1 -2
  161. package/dist/components/table-of-contents.js +1 -2
  162. package/dist/components/table-pager.js +1 -2
  163. package/dist/components/table.js +2 -3
  164. package/dist/components/table.js.map +1 -1
  165. package/dist/components/tabs.js +2 -3
  166. package/dist/components/tabs.js.map +1 -1
  167. package/dist/components/tag-badge.js +1 -2
  168. package/dist/components/tag-color-picker.js +3 -4
  169. package/dist/components/tag-color-picker.js.map +1 -1
  170. package/dist/components/text.js +1 -2
  171. package/dist/components/theme-toggle.js +1 -2
  172. package/dist/components/thinking.js +1 -2
  173. package/dist/components/toast.js +2 -3
  174. package/dist/components/toast.js.map +1 -1
  175. package/dist/components/toggle-group.js +1 -2
  176. package/dist/components/toggle.js +1 -2
  177. package/dist/components/tool-chips.js +1 -2
  178. package/dist/components/toolbar.js +9 -10
  179. package/dist/components/toolbar.js.map +1 -1
  180. package/dist/components/tooltip.js +1 -2
  181. package/dist/components/typeahead-field.js +6 -21
  182. package/dist/components/typeahead-field.js.map +1 -1
  183. package/dist/components/upload-queue.js +1 -2
  184. package/dist/index.d.ts +1 -1
  185. package/dist/index.js +11 -11
  186. package/dist/models/agent-feedback.js +1 -2
  187. package/dist/models/avatar.js +1 -2
  188. package/dist/models/code.js +1 -2
  189. package/dist/models/context-cards.js +1 -2
  190. package/dist/models/diff-table.js +1 -2
  191. package/dist/models/recommendation.js +1 -2
  192. package/dist/providers/accent.js +2 -7
  193. package/dist/providers/accent.js.map +1 -1
  194. package/dist/providers/link.js +1 -2
  195. package/dist/providers/theme.js +2 -7
  196. package/dist/providers/theme.js.map +1 -1
  197. package/dist/styles/base.css +71 -0
  198. package/dist/styles/standalone.css +127 -98
  199. package/dist/styles/tailwind.css +10 -2
  200. package/dist/styles/tokens.css +55 -7
  201. package/dist/utils/cn.js +1 -2
  202. package/dist/utils/control-surface.js +1 -2
  203. package/dist/utils/navigation.d.ts +2 -2
  204. package/dist/utils/navigation.js +2 -3
  205. package/dist/utils/navigation.js.map +1 -1
  206. package/dist/utils/preference-store.js +1 -2
  207. package/dist/utils/selection-indicator.js +1 -2
  208. package/dist/utils/use-checkable-group.js +1 -2
  209. package/dist/utils/use-hover-highlight.js +2 -3
  210. package/dist/utils/use-hover-highlight.js.map +1 -1
  211. package/dist/viewmodels/use-approval-card.js +11 -13
  212. package/dist/viewmodels/use-approval-card.js.map +1 -1
  213. package/dist/viewmodels/use-chat-composer.js +1 -2
  214. package/dist/viewmodels/use-chat-message.js +1 -2
  215. package/dist/viewmodels/use-code-block.js +1 -2
  216. package/dist/viewmodels/use-code-block.js.map +1 -1
  217. package/dist/viewmodels/use-context-cards.js +1 -2
  218. package/dist/viewmodels/use-diff-table.js +1 -2
  219. package/dist/viewmodels/use-diff-table.js.map +1 -1
  220. package/dist/viewmodels/use-loader.js +1 -2
  221. package/dist/viewmodels/use-recommendation-card.js +1 -2
  222. package/dist/viewmodels/use-recommendation-card.js.map +1 -1
  223. package/dist/viewmodels/use-thinking.js +1 -2
  224. package/dist/viewmodels/use-tool-chips.js +1 -2
  225. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
- import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode, type RefObject } from "react";
1
+ import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode, type RefObject } from "react";
2
+ import { type ButtonProps } from "./button.js";
2
3
  export type SidebarSide = "left" | "right";
3
4
  export interface SidebarContextValue {
4
5
  /**
@@ -102,11 +103,34 @@ export type SidebarProps = HTMLAttributes<HTMLElement> & {
102
103
  * @default false
103
104
  */
104
105
  collapsed?: boolean;
106
+ /**
107
+ * Show the resize handle for an expanded provider-backed sidebar.
108
+ * @default true
109
+ */
110
+ resizable?: boolean;
105
111
  };
106
- export declare function Sidebar({ collapsed: collapsedProp, className, children, onMouseEnter, onMouseLeave, style, ...props }: SidebarProps): import("react").JSX.Element;
112
+ export declare function Sidebar({ collapsed: collapsedProp, resizable, className, children, onMouseEnter, onMouseLeave, style, ...props }: SidebarProps): import("react").JSX.Element;
107
113
  export interface SidebarHeaderProps extends HTMLAttributes<HTMLDivElement> {
108
114
  }
109
115
  export declare function SidebarHeader({ className, ...props }: SidebarHeaderProps): import("react").JSX.Element;
116
+ export interface SidebarBrandProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
117
+ /** Brand mark rendered in the fixed collapsed-rail slot. */
118
+ logo: ReactNode;
119
+ /** Product or workspace name. */
120
+ name: ReactNode;
121
+ /** Optional version or release metadata, rendered at the auxiliary type size. */
122
+ version?: ReactNode;
123
+ /** Optional trailing action, conventionally a `SidebarToggle`. */
124
+ action?: ReactNode;
125
+ }
126
+ export declare function SidebarBrand({ logo, name, version, action, className, ...props }: SidebarBrandProps): import("react").JSX.Element;
127
+ export interface SidebarToggleProps extends Omit<ButtonProps, "children" | "size" | "aria-expanded"> {
128
+ /** Accessible label while the sidebar is collapsed. @default "Expand sidebar" */
129
+ expandLabel?: string;
130
+ /** Accessible label while the sidebar is expanded. @default "Collapse sidebar" */
131
+ collapseLabel?: string;
132
+ }
133
+ export declare function SidebarToggle({ "aria-label": ariaLabel, expandLabel, collapseLabel, onClick, variant, ...props }: SidebarToggleProps): import("react").JSX.Element;
110
134
  /**
111
135
  * Props for `SidebarSearch`. Renders a native `<button>` element and accepts all standard button HTML attributes and click handlers.
112
136
  */
@@ -124,25 +148,34 @@ export declare function SidebarNav({ className, ...props }: SidebarNavProps): im
124
148
  export interface SidebarPartitionProps extends HTMLAttributes<HTMLParagraphElement> {
125
149
  }
126
150
  export declare function SidebarPartition({ className, ...props }: SidebarPartitionProps): import("react").JSX.Element;
127
- export type SidebarItemProps = ButtonHTMLAttributes<HTMLButtonElement> & {
128
- /**
129
- * Mark the item as the current page.
130
- * @default false
131
- */
151
+ type SidebarRowProps = {
152
+ /** Mark the item as the current page. @default false */
132
153
  active?: boolean;
154
+ /** Item content. */
155
+ children?: ReactNode;
156
+ /** Additional CSS classes. */
157
+ className?: string;
133
158
  };
134
- export declare function SidebarItem({ active, className, ...props }: SidebarItemProps): import("react").JSX.Element;
135
- /**
136
- * Props for `SidebarIconItem`. Accepts standard button HTML attributes. The caller is responsible for providing accessible labeling via `aria-label` or `aria-labelledby` as icon buttons do not automatically generate accessible names.
137
- */
138
- export interface SidebarIconItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
139
- /**
140
- * Mark the icon button as active page item.
141
- * @default false
142
- */
143
- active?: boolean;
144
- }
145
- export declare function SidebarIconItem({ active, className, ...props }: SidebarIconItemProps): import("react").JSX.Element;
159
+ type SidebarButtonRowProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className" | "disabled"> & SidebarRowProps & {
160
+ asChild?: false;
161
+ disabled?: boolean;
162
+ href?: never;
163
+ };
164
+ type SidebarSlotRowProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className" | "disabled"> & SidebarRowProps & {
165
+ /** Render the item onto its single enabled child element. */
166
+ asChild: true;
167
+ disabled?: never;
168
+ href?: never;
169
+ };
170
+ type SidebarLinkRowProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children" | "className" | "href"> & SidebarRowProps & {
171
+ /** Application route interpreted by LinkProvider. */
172
+ href: string;
173
+ asChild?: never;
174
+ };
175
+ export type SidebarItemProps = SidebarButtonRowProps | SidebarSlotRowProps | SidebarLinkRowProps;
176
+ export declare function SidebarItem(props: SidebarItemProps): import("react").JSX.Element;
177
+ export type SidebarIconItemProps = SidebarButtonRowProps | SidebarSlotRowProps | SidebarLinkRowProps;
178
+ export declare function SidebarIconItem(props: SidebarIconItemProps): import("react").JSX.Element;
146
179
  /**
147
180
  * Props for `SidebarGroup`. Uncontrolled collapsible section that accepts only the documented properties. It does not accept controlled open props or arbitrary DOM attributes.
148
181
  */
@@ -193,3 +226,4 @@ export interface ContentIslandProps extends HTMLAttributes<HTMLDivElement> {
193
226
  mobileSurface?: "inset" | "edge-to-edge";
194
227
  }
195
228
  export declare function ContentIsland({ mobileSurface, className, ...props }: ContentIslandProps): import("react").JSX.Element;
229
+ export {};
@@ -2,36 +2,40 @@
2
2
  import { cn as e } from "../utils/cn.js";
3
3
  import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
4
  import { FOCUS_INSET as n, OVERLAY_LAYER as r, OVERLAY_MOTION as i } from "./overlay.js";
5
- import { Dialog as a, DialogOverlay as o, DialogPortal as s } from "./dialog.js";
6
- import { Collapsible as c, CollapsibleContent as l, CollapsibleTrigger as u } from "./collapsible.js";
7
- import { useHoverHighlight as d } from "../utils/use-hover-highlight.js";
8
- import { SkeletonLine as f } from "./skeleton-line.js";
9
- import { NAV_ITEM_CLASS as p, NAV_LIST_CLASS as m, NAV_ROW_CLASS as h } from "../utils/navigation.js";
10
- import { createContext as g, useCallback as _, useContext as v, useLayoutEffect as y, useRef as b, useState as x } from "react";
11
- import { ChevronUp as S, Search as C } from "lucide-react";
12
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
13
- import * as E from "@radix-ui/react-dialog";
14
- //#region src/components/sidebar.tsx
15
- var D = g(null);
16
- function O() {
17
- let e = v(D);
5
+ import { Button as a } from "./button.js";
6
+ import { Dialog as o, DialogOverlay as s, DialogPortal as c } from "./dialog.js";
7
+ import { Collapsible as l, CollapsibleContent as u, CollapsibleTrigger as d } from "./collapsible.js";
8
+ import { useHoverHighlight as f } from "../utils/use-hover-highlight.js";
9
+ import { Tooltip as p, TooltipContent as m, TooltipProvider as h, TooltipTrigger as g } from "./tooltip.js";
10
+ import { SkeletonLine as _ } from "./skeleton-line.js";
11
+ import { Link as v } from "./link.js";
12
+ import { NAV_ITEM_CLASS as y, NAV_LIST_CLASS as b, NAV_ROW_CLASS as x } from "../utils/navigation.js";
13
+ import { createContext as S, useCallback as C, useContext as w, useLayoutEffect as T, useRef as E, useState as D } from "react";
14
+ import { Slot as O } from "@radix-ui/react-slot";
15
+ import { ChevronUp as k, PanelLeft as A, Search as j } from "lucide-react";
16
+ import { jsx as M, jsxs as N } from "react/jsx-runtime";
17
+ import * as P from "@radix-ui/react-dialog";
18
+ // src/components/sidebar.tsx
19
+ var F = S(null);
20
+ function I() {
21
+ let e = w(F);
18
22
  if (!e) throw Error("useSidebar must be used within SidebarProvider");
19
23
  return e;
20
24
  }
21
- function k({ collapsed: e, defaultCollapsed: t = !1, onCollapsedChange: n, side: r = "left", loading: i = !1, peek: a = !1, overlay: o = !1, defaultWidth: s = 260, children: c }) {
22
- let [l, u] = x(t), [d, f] = x(!1), [p, m] = x(() => A(s)), h = _((e) => {
23
- m(A(e));
24
- }, []), g = b(null), v = b(e ?? t), S = b(o), C = e ?? l;
25
- y(() => {
26
- o && !C && (v.current || !S.current) && document.activeElement instanceof HTMLElement && (g.current = document.activeElement), v.current = C, S.current = o;
25
+ function L({ collapsed: e, defaultCollapsed: t = !1, onCollapsedChange: n, side: r = "left", loading: i = !1, peek: a = !1, overlay: o = !1, defaultWidth: s = 260, children: c }) {
26
+ let [l, u] = D(t), [d, f] = D(!1), [p, m] = D(() => R(s)), h = C((e) => {
27
+ m(R(e));
28
+ }, []), g = E(null), _ = E(e ?? t), v = E(o), y = e ?? l;
29
+ T(() => {
30
+ o && !y && (_.current || !v.current) && document.activeElement instanceof HTMLElement && (g.current = document.activeElement), _.current = y, v.current = o;
27
31
  });
28
- let T = _((t) => {
32
+ let b = C((t) => {
29
33
  !t && document.activeElement instanceof HTMLElement && (g.current = document.activeElement), e === void 0 && u(t), n?.(t);
30
34
  }, [e, n]);
31
- return /* @__PURE__ */ w(D.Provider, {
35
+ return /* @__PURE__ */ M(F.Provider, {
32
36
  value: {
33
- collapsed: C,
34
- setCollapsed: T,
37
+ collapsed: y,
38
+ setCollapsed: b,
35
39
  side: r,
36
40
  loading: i,
37
41
  peek: a,
@@ -45,11 +49,11 @@ function k({ collapsed: e, defaultCollapsed: t = !1, onCollapsedChange: n, side:
45
49
  children: c
46
50
  });
47
51
  }
48
- function A(e) {
52
+ function R(e) {
49
53
  return Math.min(400, Math.max(180, e));
50
54
  }
51
- function j({ side: t, width: n, onWidth: r }) {
52
- return /* @__PURE__ */ w("div", {
55
+ function z({ side: t, width: n, onWidth: r }) {
56
+ return /* @__PURE__ */ M("div", {
53
57
  role: "separator",
54
58
  "aria-orientation": "vertical",
55
59
  "aria-valuenow": n,
@@ -62,7 +66,7 @@ function j({ side: t, width: n, onWidth: r }) {
62
66
  e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId);
63
67
  let i = e.clientX, a = n, o = e.currentTarget, s = (e) => {
64
68
  let n = t === "right" ? i - e.clientX : e.clientX - i;
65
- r(A(a + n));
69
+ r(R(a + n));
66
70
  }, c = () => {
67
71
  o.removeEventListener("pointermove", s), o.removeEventListener("pointerup", c), o.removeEventListener("pointercancel", c);
68
72
  };
@@ -72,47 +76,47 @@ function j({ side: t, width: n, onWidth: r }) {
72
76
  if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
73
77
  e.preventDefault();
74
78
  let i = e.key === "ArrowRight" ? 1 : -1;
75
- r(A(n + (t === "right" ? -i * 8 : i * 8)));
79
+ r(R(n + (t === "right" ? -i * 8 : i * 8)));
76
80
  }
77
81
  });
78
82
  }
79
- function M({ collapsed: n, className: c, children: l, onMouseEnter: u, onMouseLeave: d, style: p, ...m }) {
80
- let h = v(D), g = h ? h.collapsed && !(h.peek && h.peeking) : n ?? !1, _ = h?.side ?? "left", y = h?.overlay ?? !1, b = h?.width ?? 260, x = h?.loading ? /* @__PURE__ */ T("div", {
81
- className: "flex flex-col gap-basalt-space-lg p-basalt-space-lg",
83
+ function B({ collapsed: n, resizable: a = !0, className: l, children: u, onMouseEnter: d, onMouseLeave: f, style: p, ...m }) {
84
+ let h = w(F), g = h ? h.collapsed && !(h.peek && h.peeking) : n ?? !1, v = h?.side ?? "left", y = h?.overlay ?? !1, b = h?.width ?? 260, x = h?.loading ? /* @__PURE__ */ N("div", {
85
+ className: "flex flex-col gap-basalt-space-lg px-basalt-layout-lg py-basalt-space-lg",
82
86
  role: "status",
83
87
  "aria-live": "polite",
84
88
  children: [
85
- /* @__PURE__ */ w(f, {}),
86
- /* @__PURE__ */ w(f, {}),
87
- /* @__PURE__ */ w(f, {})
89
+ /* @__PURE__ */ M(_, {}),
90
+ /* @__PURE__ */ M(_, {}),
91
+ /* @__PURE__ */ M(_, {})
88
92
  ]
89
- }) : l, S = h && !g ? /* @__PURE__ */ w(j, {
90
- side: _,
93
+ }) : u, S = h && a && !g ? /* @__PURE__ */ M(z, {
94
+ side: v,
91
95
  width: h.width,
92
96
  onWidth: h.setWidth
93
- }) : null, C = e(t, "relative flex shrink-0 flex-col bg-basalt-background text-basalt-base text-basalt-foreground", i, c);
94
- return y && h ? /* @__PURE__ */ w(a, {
97
+ }) : null, C = e(t, "relative flex shrink-0 flex-col bg-basalt-background text-basalt-base text-basalt-foreground", i, l);
98
+ return y && h ? /* @__PURE__ */ M(o, {
95
99
  open: !h.collapsed,
96
100
  onOpenChange: (e) => h.setCollapsed(!e),
97
- children: /* @__PURE__ */ T(s, { children: [/* @__PURE__ */ w(o, {}), /* @__PURE__ */ T(E.Content, {
101
+ children: /* @__PURE__ */ N(c, { children: [/* @__PURE__ */ M(s, {}), /* @__PURE__ */ N(P.Content, {
98
102
  "data-basalt-sidebar": "",
99
103
  "aria-label": "Sidebar",
100
104
  "data-overlay": "",
101
- "data-side": _,
105
+ "data-side": v,
102
106
  "aria-busy": h.loading || void 0,
103
- onMouseEnter: u,
104
- onMouseLeave: d,
107
+ onMouseEnter: d,
108
+ onMouseLeave: f,
105
109
  ref: (e) => {
106
110
  e && document.activeElement instanceof HTMLElement && !e.contains(document.activeElement) && (h.lastFocusRef.current = document.activeElement);
107
111
  },
108
112
  onOpenAutoFocus: (e) => {
109
113
  let t = "relatedTarget" in e ? e.relatedTarget : null;
110
- t instanceof HTMLElement && (h.lastFocusRef.current = t);
114
+ t instanceof HTMLElement && (h.lastFocusRef.current = t), e.target instanceof HTMLElement && (e.preventDefault(), e.target.focus());
111
115
  },
112
116
  onCloseAutoFocus: (e) => {
113
117
  e.preventDefault(), h.lastFocusRef.current?.focus();
114
118
  },
115
- className: e(C, r, "fixed inset-y-0 overflow-hidden shadow-md", _ === "right" ? "right-0" : "left-0"),
119
+ className: e(C, r, "fixed inset-y-0 overflow-hidden shadow-md", v === "right" ? "right-0" : "left-0"),
116
120
  style: {
117
121
  width: b,
118
122
  ...p
@@ -120,18 +124,18 @@ function M({ collapsed: n, className: c, children: l, onMouseEnter: u, onMouseLe
120
124
  ...m,
121
125
  children: [x, S]
122
126
  })] })
123
- }) : /* @__PURE__ */ T("aside", {
127
+ }) : /* @__PURE__ */ N("aside", {
124
128
  "data-basalt-sidebar": "",
125
129
  "data-collapsed": g ? "" : void 0,
126
- "data-side": _,
130
+ "data-side": v,
127
131
  "aria-busy": h?.loading || void 0,
128
132
  onMouseEnter: (e) => {
129
- h?.peek && h.collapsed && h.setPeeking(!0), u?.(e);
133
+ h?.peek && h.collapsed && h.setPeeking(!0), d?.(e);
130
134
  },
131
135
  onMouseLeave: (e) => {
132
- h?.peek && h.setPeeking(!1), d?.(e);
136
+ h?.peek && h.setPeeking(!1), f?.(e);
133
137
  },
134
- className: e(C, "sticky overflow-hidden transition-[width] basalt-motion duration-basalt-normal ease-basalt", _ === "right" ? "order-last" : void 0, g && "w-basalt-rail"),
138
+ className: e(C, "sticky overflow-hidden transition-[width] basalt-motion duration-basalt-normal ease-basalt", v === "right" ? "order-last" : void 0, g && "w-basalt-rail"),
135
139
  style: g ? p : {
136
140
  width: b,
137
141
  ...p
@@ -140,121 +144,219 @@ function M({ collapsed: n, className: c, children: l, onMouseEnter: u, onMouseLe
140
144
  children: [x, S]
141
145
  });
142
146
  }
143
- var N = "min-h-[calc(var(--basalt-line-row)+2*var(--basalt-space-lg))] py-basalt-space-lg";
144
- function P({ className: t, ...n }) {
145
- return /* @__PURE__ */ w("div", {
147
+ var V = "min-h-[calc(var(--basalt-line-row)+2*var(--basalt-space-lg))] py-basalt-space-lg";
148
+ function H({ className: t, ...n }) {
149
+ return /* @__PURE__ */ M("div", {
146
150
  "data-slot": "sidebar-header",
147
- className: e("flex h-basalt-14 shrink-0 items-center gap-basalt-row-gap px-basalt-nav-inset", t),
151
+ className: e("flex h-basalt-14 shrink-0 items-center gap-basalt-row-gap px-basalt-layout-lg", t),
148
152
  ...n
149
153
  });
150
154
  }
151
- function F({ shortcut: n = "⌘K", className: r, children: i, ...a }) {
152
- return /* @__PURE__ */ T("button", {
155
+ function U({ logo: t, name: n, version: r, action: i, className: a, ...o }) {
156
+ return /* @__PURE__ */ N("div", {
157
+ "data-slot": "sidebar-brand",
158
+ className: e("relative flex h-full min-w-0 flex-1 items-center gap-basalt-row-gap", a),
159
+ ...o,
160
+ children: [
161
+ /* @__PURE__ */ M("span", {
162
+ "data-slot": "sidebar-brand-logo",
163
+ className: "flex w-basalt-sidebar-brand-slot shrink-0 items-center justify-center",
164
+ children: t
165
+ }),
166
+ /* @__PURE__ */ N("div", {
167
+ className: "flex min-w-0 flex-1 items-center gap-basalt-row-gap overflow-hidden whitespace-nowrap",
168
+ children: [/* @__PURE__ */ M("span", {
169
+ className: "min-w-0 flex-1 truncate text-basalt-base font-semibold",
170
+ children: n
171
+ }), r == null ? null : /* @__PURE__ */ M("span", {
172
+ className: "shrink-0 text-basalt-sm text-basalt-muted-foreground",
173
+ children: r
174
+ })]
175
+ }),
176
+ i ? /* @__PURE__ */ M("div", {
177
+ "data-slot": "sidebar-brand-action",
178
+ className: "basalt-sidebar-brand-action",
179
+ children: i
180
+ }) : null
181
+ ]
182
+ });
183
+ }
184
+ function W({ "aria-label": e, expandLabel: t = "Expand sidebar", collapseLabel: n = "Collapse sidebar", onClick: r, variant: i = "ghost", ...o }) {
185
+ let { collapsed: s, setCollapsed: c, side: l } = I(), u = e ?? (s ? t : n);
186
+ return /* @__PURE__ */ M(h, { children: /* @__PURE__ */ N(p, { children: [/* @__PURE__ */ M(g, {
187
+ asChild: !0,
188
+ children: /* @__PURE__ */ M(a, {
189
+ ...o,
190
+ variant: i,
191
+ size: "icon-sm",
192
+ "aria-expanded": !s,
193
+ "aria-label": u,
194
+ onClick: (e) => {
195
+ r?.(e), e.defaultPrevented || c(!s);
196
+ },
197
+ children: /* @__PURE__ */ M(A, { "aria-hidden": "true" })
198
+ })
199
+ }), /* @__PURE__ */ M(m, {
200
+ side: l === "right" ? "left" : "right",
201
+ children: u
202
+ })] }) });
203
+ }
204
+ function G({ shortcut: n = "⌘K", className: r, children: i, ...a }) {
205
+ return /* @__PURE__ */ N("button", {
153
206
  type: "button",
154
- className: e(t, h, N, "w-full cursor-pointer bg-basalt-secondary transition-colors basalt-motion hover:bg-basalt-hover", r),
207
+ className: e(t, x, V, "w-full cursor-pointer bg-basalt-secondary transition-colors basalt-motion hover:bg-basalt-hover", r),
155
208
  ...a,
156
209
  children: [
157
- /* @__PURE__ */ w(C, {
210
+ /* @__PURE__ */ M(j, {
158
211
  className: "h-basalt-4 w-basalt-4 text-basalt-muted-foreground",
159
212
  strokeWidth: 1.5
160
213
  }),
161
- /* @__PURE__ */ w("span", {
214
+ /* @__PURE__ */ M("span", {
162
215
  className: "flex-1 text-left text-basalt-base text-basalt-muted-foreground",
163
216
  children: i
164
217
  }),
165
- /* @__PURE__ */ w("kbd", {
218
+ /* @__PURE__ */ M("kbd", {
166
219
  className: "pointer-events-none hidden rounded-basalt-sm border border-basalt-border bg-basalt-card px-basalt-space-md py-basalt-space-xs text-basalt-sm font-medium text-basalt-muted-foreground sm:inline-block",
167
220
  children: n
168
221
  })
169
222
  ]
170
223
  });
171
224
  }
172
- function I({ className: t, ...n }) {
173
- let r = d(void 0, { restoreOnPointerLeave: !1 });
174
- return /* @__PURE__ */ w("nav", {
225
+ function K({ className: t, ...n }) {
226
+ let r = f(void 0, { restoreOnPointerLeave: !1 });
227
+ return /* @__PURE__ */ M("nav", {
175
228
  ref: r,
176
229
  "data-slot": "sidebar-nav",
177
- className: e(m, "min-h-0 flex-1 flex-col overflow-y-auto overscroll-y-contain", t),
230
+ className: e(b, "basalt-sidebar-nav min-h-0 flex-1 flex-col overflow-y-auto overscroll-y-contain", t),
178
231
  ...n
179
232
  });
180
233
  }
181
- function L({ className: t, ...n }) {
182
- return /* @__PURE__ */ w("p", {
234
+ function q({ className: t, ...n }) {
235
+ return /* @__PURE__ */ M("p", {
183
236
  "data-slot": "sidebar-partition",
184
237
  className: e("shrink-0 px-basalt-row-x pt-basalt-layout pb-basalt-space-lg text-basalt-sm font-semibold tracking-wide text-basalt-foreground uppercase", t),
185
238
  ...n
186
239
  });
187
240
  }
188
- function R({ active: t = !1, className: n, ...r }) {
189
- return /* @__PURE__ */ w("button", {
190
- type: "button",
191
- "aria-current": t ? "page" : void 0,
241
+ function J(e) {
242
+ if (e.asChild && e.disabled) throw Error("Sidebar asChild rows do not support disabled; use a native button row");
243
+ }
244
+ function Y(t) {
245
+ J(t);
246
+ let n = e(y, V, "w-full text-inherit no-underline hover:no-underline", t.className);
247
+ if (typeof t.href == "string") {
248
+ let { href: e, active: r = !1, children: i, className: a, ...o } = t;
249
+ return /* @__PURE__ */ M(v, {
250
+ ...o,
251
+ href: e,
252
+ "aria-current": r ? "page" : void 0,
253
+ "data-basalt-hover-item": "",
254
+ "data-sidebar-row": "",
255
+ "data-hover-selected": r,
256
+ className: n,
257
+ children: i
258
+ });
259
+ }
260
+ let { asChild: r = !1, type: i = "button", active: a = !1, children: o, className: s, ...c } = t, l = {
261
+ "aria-current": a ? "page" : void 0,
192
262
  "data-basalt-hover-item": "",
193
263
  "data-sidebar-row": "",
194
- "data-hover-selected": t,
195
- className: e(p, N, "w-full", n),
196
- ...r
264
+ "data-hover-selected": a,
265
+ className: n
266
+ };
267
+ return r ? /* @__PURE__ */ M(O, {
268
+ ...c,
269
+ ...l,
270
+ children: o
271
+ }) : /* @__PURE__ */ M("button", {
272
+ ...c,
273
+ type: i,
274
+ ...l,
275
+ children: o
197
276
  });
198
277
  }
199
- function z({ active: t = !1, className: n, ...r }) {
200
- return /* @__PURE__ */ w("button", {
201
- type: "button",
202
- "aria-current": t ? "page" : void 0,
278
+ function X(t) {
279
+ J(t);
280
+ let n = e(y, V, "relative w-basalt-control justify-center text-inherit no-underline hover:no-underline", t.className);
281
+ if (typeof t.href == "string") {
282
+ let { href: e, active: r = !1, children: i, className: a, ...o } = t;
283
+ return /* @__PURE__ */ M(v, {
284
+ ...o,
285
+ href: e,
286
+ "aria-current": r ? "page" : void 0,
287
+ "data-basalt-hover-item": "",
288
+ "data-sidebar-row": "",
289
+ "data-hover-selected": r,
290
+ className: n,
291
+ children: i
292
+ });
293
+ }
294
+ let { asChild: r = !1, type: i = "button", active: a = !1, children: o, className: s, ...c } = t, l = {
295
+ "aria-current": a ? "page" : void 0,
203
296
  "data-basalt-hover-item": "",
204
297
  "data-sidebar-row": "",
205
- "data-hover-selected": t,
206
- className: e(p, N, "relative w-basalt-control justify-center", n),
207
- ...r
298
+ "data-hover-selected": a,
299
+ className: n
300
+ };
301
+ return r ? /* @__PURE__ */ M(O, {
302
+ ...c,
303
+ ...l,
304
+ children: o
305
+ }) : /* @__PURE__ */ M("button", {
306
+ ...c,
307
+ type: i,
308
+ ...l,
309
+ children: o
208
310
  });
209
311
  }
210
- function B({ label: t, defaultOpen: r = !0, children: a }) {
211
- let [o, s] = x(r);
212
- return /* @__PURE__ */ T(c, {
312
+ function Z({ label: t, defaultOpen: r = !0, children: a }) {
313
+ let [o, s] = D(r);
314
+ return /* @__PURE__ */ N(l, {
213
315
  open: o,
214
316
  onOpenChange: s,
215
317
  "data-slot": "sidebar-group",
216
318
  className: "shrink-0 pt-basalt-layout-sm",
217
- children: [/* @__PURE__ */ w(u, {
319
+ children: [/* @__PURE__ */ M(d, {
218
320
  asChild: !0,
219
- children: /* @__PURE__ */ T("button", {
321
+ children: /* @__PURE__ */ N("button", {
220
322
  type: "button",
221
323
  "data-slot": "sidebar-group-label",
222
324
  className: e("flex w-full cursor-pointer items-center justify-between gap-basalt-row-gap rounded-basalt-md px-basalt-row-x py-basalt-space-lg text-left text-basalt-sm font-semibold leading-basalt-row tracking-wide text-basalt-muted-foreground uppercase transition-colors basalt-motion hover:text-basalt-foreground", n),
223
- children: [/* @__PURE__ */ w("span", {
325
+ children: [/* @__PURE__ */ M("span", {
224
326
  className: "min-w-0 truncate",
225
327
  children: t
226
- }), /* @__PURE__ */ w(S, {
328
+ }), /* @__PURE__ */ M(k, {
227
329
  className: e("h-basalt-4 w-basalt-4 text-basalt-muted-foreground transition-transform basalt-motion duration-basalt-normal", i, !o && "rotate-180"),
228
330
  strokeWidth: 1.5
229
331
  })]
230
332
  })
231
- }), /* @__PURE__ */ w(l, {
333
+ }), /* @__PURE__ */ M(u, {
232
334
  unstyled: !0,
233
- children: /* @__PURE__ */ w("div", {
335
+ children: /* @__PURE__ */ M("div", {
234
336
  className: "flex flex-col gap-basalt-nav-gap pt-basalt-nav-gap",
235
337
  children: a
236
338
  })
237
339
  })]
238
340
  });
239
341
  }
240
- function V({ className: t, ...n }) {
241
- return /* @__PURE__ */ w("div", {
342
+ function Q({ className: t, ...n }) {
343
+ return /* @__PURE__ */ M("div", {
242
344
  "data-slot": "sidebar-footer",
243
- className: e("flex shrink-0 flex-col gap-basalt-content-gap px-basalt-nav-inset py-basalt-nav-inset", t),
345
+ className: e("flex shrink-0 flex-col gap-basalt-content-gap px-basalt-layout-lg pt-basalt-space-lg pb-basalt-layout", t),
244
346
  ...n
245
347
  });
246
348
  }
247
- function H({ name: t, email: n, avatar: r, action: i, className: a }) {
248
- return /* @__PURE__ */ T("div", {
349
+ function $({ name: t, email: n, avatar: r, action: i, className: a }) {
350
+ return /* @__PURE__ */ N("div", {
249
351
  className: e("flex items-center gap-basalt-space-lg", a),
250
352
  children: [
251
353
  r,
252
- /* @__PURE__ */ T("div", {
354
+ /* @__PURE__ */ N("div", {
253
355
  className: "min-w-0 flex-1",
254
- children: [/* @__PURE__ */ w("p", {
356
+ children: [/* @__PURE__ */ M("p", {
255
357
  className: "truncate text-basalt-base font-medium text-basalt-foreground",
256
358
  children: t
257
- }), n ? /* @__PURE__ */ w("p", {
359
+ }), n ? /* @__PURE__ */ M("p", {
258
360
  className: "truncate text-basalt-sm text-basalt-muted-foreground",
259
361
  children: n
260
362
  }) : null]
@@ -263,15 +365,14 @@ function H({ name: t, email: n, avatar: r, action: i, className: a }) {
263
365
  ]
264
366
  });
265
367
  }
266
- function U({ mobileSurface: t = "inset", className: n, ...r }) {
267
- return /* @__PURE__ */ w("div", {
368
+ function ee({ mobileSurface: t = "inset", className: n, ...r }) {
369
+ return /* @__PURE__ */ M("div", {
268
370
  "data-basalt-surface-root": "",
269
371
  "data-basalt-island": t,
270
372
  className: e("min-h-0 min-w-0 flex-1 bg-basalt-card text-basalt-card-foreground md:rounded-basalt-island md:p-basalt-layout-lg lg:px-basalt-layout-xl", t === "inset" ? "rounded-basalt-lg p-basalt-layout shadow-sm ring-1 ring-basalt-border/40" : "md:shadow-sm md:ring-1 md:ring-basalt-border/40", n),
271
373
  ...r
272
374
  });
273
375
  }
274
- //#endregion
275
- export { U as ContentIsland, M as Sidebar, V as SidebarFooter, B as SidebarGroup, P as SidebarHeader, z as SidebarIconItem, R as SidebarItem, I as SidebarNav, L as SidebarPartition, k as SidebarProvider, F as SidebarSearch, H as SidebarUser, O as useSidebar };
376
+ export { ee as ContentIsland, B as Sidebar, U as SidebarBrand, Q as SidebarFooter, Z as SidebarGroup, H as SidebarHeader, X as SidebarIconItem, Y as SidebarItem, K as SidebarNav, q as SidebarPartition, L as SidebarProvider, G as SidebarSearch, W as SidebarToggle, $ as SidebarUser, I as useSidebar };
276
377
 
277
378
  //# sourceMappingURL=sidebar.js.map