@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.
- package/README.md +25 -19
- package/ai/COMPATIBILITY.md +41 -36
- package/ai/DESIGN.md +73 -56
- package/ai/INTEGRATION.md +819 -825
- package/ai/RECIPES.md +334 -135
- package/ai/USAGE.md +2 -2
- package/ai/registry.json +454 -97
- package/ai/sources.json +2 -2
- package/dist/assets/brand-mark.js +1 -2
- package/dist/charts/area.js +1 -2
- package/dist/charts/bar.js +1 -2
- package/dist/charts/bullet.js +1 -2
- package/dist/charts/chart-colors.js +1 -2
- package/dist/charts/charts.js +1 -2
- package/dist/charts/config.js +1 -2
- package/dist/charts/custom-chart.js +1 -2
- package/dist/charts/date-navigation.js +1 -2
- package/dist/charts/donut.js +1 -2
- package/dist/charts/frame.js +3 -4
- package/dist/charts/frame.js.map +1 -1
- package/dist/charts/funnel.js +1 -2
- package/dist/charts/gauge.js +1 -2
- package/dist/charts/grouped-bar.js +1 -2
- package/dist/charts/heatmap-calendar.js +7 -11
- package/dist/charts/heatmap-calendar.js.map +1 -1
- package/dist/charts/heatmap-matrix.js +4 -5
- package/dist/charts/heatmap-matrix.js.map +1 -1
- package/dist/charts/item-list.js +1 -2
- package/dist/charts/legend.js +1 -2
- package/dist/charts/line.js +1 -2
- package/dist/charts/palette.js +1 -2
- package/dist/charts/radar.js +1 -2
- package/dist/charts/sample.js +1 -2
- package/dist/charts/sankey.js +1 -2
- package/dist/charts/series.js +1 -2
- package/dist/charts/slot-bar.js +1 -2
- package/dist/charts/sparkline.js +1 -2
- package/dist/charts/stacked-bar.js +1 -2
- package/dist/charts/stat-card.js +1 -2
- package/dist/charts/timeline.js +1 -2
- package/dist/charts/timeseries.js +1 -2
- package/dist/charts/tooltip.js +31 -27
- package/dist/charts/tooltip.js.map +1 -1
- package/dist/components/accordion.js +1 -2
- package/dist/components/alert-dialog.js +1 -2
- package/dist/components/app-header.js +2 -3
- package/dist/components/app-header.js.map +1 -1
- package/dist/components/app-shell.js +2 -3
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/approval-card.js +1 -2
- package/dist/components/autocomplete.js +1 -2
- package/dist/components/avatar.js +1 -2
- package/dist/components/badge.js +1 -2
- package/dist/components/banner.js +1 -2
- package/dist/components/basalt-mark.js +1 -2
- package/dist/components/battery-meter.js +1 -2
- package/dist/components/breadcrumbs.js +1 -2
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +3 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/chat-bubble.js +1 -2
- package/dist/components/chat-composer.js +2 -3
- package/dist/components/chat-composer.js.map +1 -1
- package/dist/components/chat-header.js +1 -2
- package/dist/components/chat-inbox.js +1 -2
- package/dist/components/chat-markdown.js +1 -2
- package/dist/components/chat-message.js +2 -3
- package/dist/components/chat-message.js.map +1 -1
- package/dist/components/checkbox.js +1 -2
- package/dist/components/clipboard-text.js +1 -2
- package/dist/components/code.js +2 -3
- package/dist/components/code.js.map +1 -1
- package/dist/components/collapsible.js +1 -2
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.js +1 -2
- package/dist/components/command-palette.js +3 -4
- package/dist/components/command-palette.js.map +1 -1
- package/dist/components/confirm-dialog.js +3 -12
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/context-cards.js +2 -3
- package/dist/components/context-cards.js.map +1 -1
- package/dist/components/context-menu.js +2 -3
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table.js +129 -131
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +7 -18
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/delete-resource.js +1 -2
- package/dist/components/description-list.js +1 -2
- package/dist/components/dialog.js +1 -2
- package/dist/components/diff-table.js +2 -3
- package/dist/components/diff-table.js.map +1 -1
- package/dist/components/dock.js +1 -2
- package/dist/components/dock.js.map +1 -1
- package/dist/components/dropdown-menu.js +2 -3
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editable-nav-item.js +3 -4
- package/dist/components/editable-nav-item.js.map +1 -1
- package/dist/components/empty.js +1 -2
- package/dist/components/fab.js +1 -2
- package/dist/components/field.js +1 -2
- package/dist/components/file-dropzone.js +2 -3
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/filter-bar.js +2 -3
- package/dist/components/filter-bar.js.map +1 -1
- package/dist/components/flow.js +1 -2
- package/dist/components/grid.js +1 -2
- package/dist/components/hover-card.js +1 -2
- package/dist/components/icon-picker.js +4 -5
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/inline-editable.js +2 -3
- package/dist/components/inline-editable.js.map +1 -1
- package/dist/components/input-area.js +1 -2
- package/dist/components/input-group.js +4 -5
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.js +1 -2
- package/dist/components/label.js +1 -2
- package/dist/components/layer-card.js +3 -3
- package/dist/components/layer-card.js.map +1 -1
- package/dist/components/link.js +2 -3
- package/dist/components/link.js.map +1 -1
- package/dist/components/loader.js +1 -2
- package/dist/components/loading-screen.js +1 -2
- package/dist/components/menu-bar.js +3 -4
- package/dist/components/menu-bar.js.map +1 -1
- package/dist/components/meter.js +1 -2
- package/dist/components/multi-select.js +2 -3
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/navigation-menu.js +1 -2
- package/dist/components/overlay.d.ts +3 -6
- package/dist/components/overlay.js +4 -5
- package/dist/components/overlay.js.map +1 -1
- package/dist/components/page-header.js +1 -2
- package/dist/components/pagination.js +1 -2
- package/dist/components/popover.js +1 -2
- package/dist/components/prompt-bar.js +1 -2
- package/dist/components/radio.js +2 -7
- package/dist/components/radio.js.map +1 -1
- package/dist/components/recommendation-card.js +1 -2
- package/dist/components/resource-list.js +1 -2
- package/dist/components/responsive-master-detail.js +3 -4
- package/dist/components/responsive-master-detail.js.map +1 -1
- package/dist/components/scroll-area.js +2 -3
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/section-rule.js +1 -2
- package/dist/components/segment-control.js +2 -3
- package/dist/components/segment-control.js.map +1 -1
- package/dist/components/select.js +2 -3
- package/dist/components/select.js.map +1 -1
- package/dist/components/sensitive-input.js +2 -3
- package/dist/components/sensitive-input.js.map +1 -1
- package/dist/components/separator.js +1 -2
- package/dist/components/sheet.js +1 -2
- package/dist/components/sidebar.d.ts +53 -19
- package/dist/components/sidebar.js +201 -100
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton-line.js +1 -2
- package/dist/components/slider.js +1 -2
- package/dist/components/stat-strip.js +1 -2
- package/dist/components/switch.js +1 -2
- package/dist/components/table-of-contents.js +1 -2
- package/dist/components/table-pager.js +1 -2
- package/dist/components/table.js +2 -3
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +2 -3
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag-badge.js +1 -2
- package/dist/components/tag-color-picker.js +3 -4
- package/dist/components/tag-color-picker.js.map +1 -1
- package/dist/components/text.js +1 -2
- package/dist/components/theme-toggle.js +1 -2
- package/dist/components/thinking.js +1 -2
- package/dist/components/toast.js +2 -3
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +1 -2
- package/dist/components/toggle.js +1 -2
- package/dist/components/tool-chips.js +1 -2
- package/dist/components/toolbar.js +9 -10
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.js +1 -2
- package/dist/components/typeahead-field.js +6 -21
- package/dist/components/typeahead-field.js.map +1 -1
- package/dist/components/upload-queue.js +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -11
- package/dist/models/agent-feedback.js +1 -2
- package/dist/models/avatar.js +1 -2
- package/dist/models/code.js +1 -2
- package/dist/models/context-cards.js +1 -2
- package/dist/models/diff-table.js +1 -2
- package/dist/models/recommendation.js +1 -2
- package/dist/providers/accent.js +2 -7
- package/dist/providers/accent.js.map +1 -1
- package/dist/providers/link.js +1 -2
- package/dist/providers/theme.js +2 -7
- package/dist/providers/theme.js.map +1 -1
- package/dist/styles/base.css +71 -0
- package/dist/styles/standalone.css +127 -98
- package/dist/styles/tailwind.css +10 -2
- package/dist/styles/tokens.css +55 -7
- package/dist/utils/cn.js +1 -2
- package/dist/utils/control-surface.js +1 -2
- package/dist/utils/navigation.d.ts +2 -2
- package/dist/utils/navigation.js +2 -3
- package/dist/utils/navigation.js.map +1 -1
- package/dist/utils/preference-store.js +1 -2
- package/dist/utils/selection-indicator.js +1 -2
- package/dist/utils/use-checkable-group.js +1 -2
- package/dist/utils/use-hover-highlight.js +2 -3
- package/dist/utils/use-hover-highlight.js.map +1 -1
- package/dist/viewmodels/use-approval-card.js +11 -13
- package/dist/viewmodels/use-approval-card.js.map +1 -1
- package/dist/viewmodels/use-chat-composer.js +1 -2
- package/dist/viewmodels/use-chat-message.js +1 -2
- package/dist/viewmodels/use-code-block.js +1 -2
- package/dist/viewmodels/use-code-block.js.map +1 -1
- package/dist/viewmodels/use-context-cards.js +1 -2
- package/dist/viewmodels/use-diff-table.js +1 -2
- package/dist/viewmodels/use-diff-table.js.map +1 -1
- package/dist/viewmodels/use-loader.js +1 -2
- package/dist/viewmodels/use-recommendation-card.js +1 -2
- package/dist/viewmodels/use-recommendation-card.js.map +1 -1
- package/dist/viewmodels/use-thinking.js +1 -2
- package/dist/viewmodels/use-tool-chips.js +1 -2
- 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
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
22
|
-
let [l, u] =
|
|
23
|
-
m(
|
|
24
|
-
}, []), g =
|
|
25
|
-
|
|
26
|
-
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
|
|
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__ */
|
|
35
|
+
return /* @__PURE__ */ M(F.Provider, {
|
|
32
36
|
value: {
|
|
33
|
-
collapsed:
|
|
34
|
-
setCollapsed:
|
|
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
|
|
52
|
+
function R(e) {
|
|
49
53
|
return Math.min(400, Math.max(180, e));
|
|
50
54
|
}
|
|
51
|
-
function
|
|
52
|
-
return /* @__PURE__ */
|
|
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(
|
|
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(
|
|
79
|
+
r(R(n + (t === "right" ? -i * 8 : i * 8)));
|
|
76
80
|
}
|
|
77
81
|
});
|
|
78
82
|
}
|
|
79
|
-
function
|
|
80
|
-
let h =
|
|
81
|
-
className: "flex flex-col gap-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__ */
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ M(_, {}),
|
|
90
|
+
/* @__PURE__ */ M(_, {}),
|
|
91
|
+
/* @__PURE__ */ M(_, {})
|
|
88
92
|
]
|
|
89
|
-
}) :
|
|
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,
|
|
94
|
-
return y && h ? /* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
104
|
-
onMouseLeave:
|
|
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",
|
|
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__ */
|
|
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),
|
|
133
|
+
h?.peek && h.collapsed && h.setPeeking(!0), d?.(e);
|
|
130
134
|
},
|
|
131
135
|
onMouseLeave: (e) => {
|
|
132
|
-
h?.peek && h.setPeeking(!1),
|
|
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",
|
|
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
|
|
144
|
-
function
|
|
145
|
-
return /* @__PURE__ */
|
|
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-
|
|
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
|
|
152
|
-
return /* @__PURE__ */
|
|
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,
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
173
|
-
let r =
|
|
174
|
-
return /* @__PURE__ */
|
|
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(
|
|
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
|
|
182
|
-
return /* @__PURE__ */
|
|
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
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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":
|
|
195
|
-
className:
|
|
196
|
-
|
|
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
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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":
|
|
206
|
-
className:
|
|
207
|
-
|
|
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
|
|
211
|
-
let [o, s] =
|
|
212
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
319
|
+
children: [/* @__PURE__ */ M(d, {
|
|
218
320
|
asChild: !0,
|
|
219
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
325
|
+
children: [/* @__PURE__ */ M("span", {
|
|
224
326
|
className: "min-w-0 truncate",
|
|
225
327
|
children: t
|
|
226
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
333
|
+
}), /* @__PURE__ */ M(u, {
|
|
232
334
|
unstyled: !0,
|
|
233
|
-
children: /* @__PURE__ */
|
|
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
|
|
241
|
-
return /* @__PURE__ */
|
|
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-
|
|
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
|
|
248
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
354
|
+
/* @__PURE__ */ N("div", {
|
|
253
355
|
className: "min-w-0 flex-1",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ M("p", {
|
|
255
357
|
className: "truncate text-basalt-base font-medium text-basalt-foreground",
|
|
256
358
|
children: t
|
|
257
|
-
}), n ? /* @__PURE__ */
|
|
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
|
|
267
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
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
|