@nocoo/basalt 2.2.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/ai/COMPATIBILITY.md +11 -1
- package/ai/DESIGN.md +398 -0
- package/ai/INTEGRATION.md +255 -129
- package/ai/RECIPES.md +51 -26
- package/ai/USAGE.md +4 -4
- package/ai/registry.json +3018 -271
- package/dist/charts/config.d.ts +11 -11
- package/dist/charts/config.js +4 -4
- package/dist/charts/config.js.map +1 -1
- package/dist/charts/date-navigation.js +10 -10
- package/dist/charts/date-navigation.js.map +1 -1
- package/dist/charts/donut.js +1 -1
- package/dist/charts/donut.js.map +1 -1
- package/dist/charts/frame.d.ts +1 -1
- package/dist/charts/frame.js +4 -4
- package/dist/charts/frame.js.map +1 -1
- package/dist/charts/gauge.js +5 -5
- package/dist/charts/gauge.js.map +1 -1
- package/dist/charts/heatmap-calendar.js +11 -11
- package/dist/charts/heatmap-calendar.js.map +1 -1
- package/dist/charts/heatmap-matrix.js +8 -8
- package/dist/charts/heatmap-matrix.js.map +1 -1
- package/dist/charts/item-list.js +1 -1
- package/dist/charts/item-list.js.map +1 -1
- package/dist/charts/legend.js +19 -19
- package/dist/charts/legend.js.map +1 -1
- package/dist/charts/palette.js +2 -2
- package/dist/charts/palette.js.map +1 -1
- package/dist/charts/slot-bar.js +2 -2
- package/dist/charts/slot-bar.js.map +1 -1
- package/dist/charts/sparkline.js +38 -23
- package/dist/charts/sparkline.js.map +1 -1
- package/dist/charts/stat-card.d.ts +2 -2
- package/dist/charts/stat-card.js +61 -58
- package/dist/charts/stat-card.js.map +1 -1
- package/dist/charts/timeline.js +18 -9
- package/dist/charts/timeline.js.map +1 -1
- package/dist/charts/tooltip.js +16 -16
- package/dist/charts/tooltip.js.map +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +4 -4
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/app-header.js +8 -8
- package/dist/components/app-header.js.map +1 -1
- package/dist/components/app-shell.js +1 -1
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/approval-card.d.ts +13 -0
- package/dist/components/approval-card.js +161 -0
- package/dist/components/approval-card.js.map +1 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.js +39 -18
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +8 -8
- package/dist/components/badge.js.map +1 -1
- package/dist/components/banner.d.ts +2 -2
- package/dist/components/banner.js +9 -8
- package/dist/components/banner.js.map +1 -1
- package/dist/components/basalt-mark.js +1 -1
- package/dist/components/basalt-mark.js.map +1 -1
- package/dist/components/battery-meter.js +5 -5
- package/dist/components/battery-meter.js.map +1 -1
- package/dist/components/breadcrumbs.js +6 -6
- package/dist/components/breadcrumbs.js.map +1 -1
- package/dist/components/button.js +10 -10
- package/dist/components/button.js.map +1 -1
- package/dist/components/chat-bubble.js +4 -3
- package/dist/components/chat-bubble.js.map +1 -1
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/chat-composer.js +126 -60
- package/dist/components/chat-composer.js.map +1 -1
- package/dist/components/chat-header.js +6 -6
- package/dist/components/chat-header.js.map +1 -1
- package/dist/components/chat-inbox.js +34 -30
- package/dist/components/chat-inbox.js.map +1 -1
- package/dist/components/chat-markdown.d.ts +8 -0
- package/dist/components/chat-markdown.js +122 -0
- package/dist/components/chat-markdown.js.map +1 -0
- package/dist/components/chat-message.d.ts +26 -0
- package/dist/components/chat-message.js +145 -0
- package/dist/components/chat-message.js.map +1 -0
- package/dist/components/checkbox.js +11 -11
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/clipboard-text.js +3 -3
- package/dist/components/clipboard-text.js.map +1 -1
- package/dist/components/code.d.ts +22 -20
- package/dist/components/code.js +94 -32
- package/dist/components/code.js.map +1 -1
- package/dist/components/collapsible.js +8 -4
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/command-palette.js +73 -47
- package/dist/components/command-palette.js.map +1 -1
- package/dist/components/context-cards.d.ts +15 -0
- package/dist/components/context-cards.js +148 -0
- package/dist/components/context-cards.js.map +1 -0
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/context-menu.js +18 -14
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table.d.ts +14 -2
- package/dist/components/data-table.js +185 -135
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +13 -13
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/delete-resource.js +1 -1
- package/dist/components/delete-resource.js.map +1 -1
- package/dist/components/description-list.js +3 -3
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.js +8 -8
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/diff-table.d.ts +15 -0
- package/dist/components/diff-table.js +151 -0
- package/dist/components/diff-table.js.map +1 -0
- package/dist/components/dock.js +2 -2
- package/dist/components/dock.js.map +1 -1
- package/dist/components/dropdown-menu.js +23 -18
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editable-nav-item.js +63 -58
- package/dist/components/editable-nav-item.js.map +1 -1
- package/dist/components/empty.js +6 -6
- package/dist/components/empty.js.map +1 -1
- package/dist/components/fab.js +1 -1
- package/dist/components/fab.js.map +1 -1
- package/dist/components/field.js +3 -3
- package/dist/components/field.js.map +1 -1
- package/dist/components/file-dropzone.js +7 -7
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/filter-bar.js +6 -6
- package/dist/components/filter-bar.js.map +1 -1
- package/dist/components/flow.js +4 -3
- package/dist/components/flow.js.map +1 -1
- package/dist/components/grid.d.ts +3 -1
- package/dist/components/grid.js +15 -8
- package/dist/components/grid.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/icon-picker.d.ts +8 -2
- package/dist/components/icon-picker.js +75 -47
- package/dist/components/icon-picker.js.map +1 -1
- package/dist/components/inline-editable.js +6 -6
- package/dist/components/inline-editable.js.map +1 -1
- package/dist/components/input-area.js +3 -3
- package/dist/components/input-area.js.map +1 -1
- package/dist/components/input-group.js +5 -5
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.js +4 -4
- package/dist/components/input.js.map +1 -1
- package/dist/components/label.js +3 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/layer-card.d.ts +9 -4
- package/dist/components/layer-card.js +72 -67
- package/dist/components/layer-card.js.map +1 -1
- package/dist/components/loader.d.ts +16 -10
- package/dist/components/loader.js +46 -53
- package/dist/components/loader.js.map +1 -1
- package/dist/components/loading-screen.js +3 -3
- package/dist/components/loading-screen.js.map +1 -1
- package/dist/components/menu-bar.js +32 -27
- package/dist/components/menu-bar.js.map +1 -1
- package/dist/components/meter.d.ts +5 -5
- package/dist/components/meter.js +25 -12
- package/dist/components/meter.js.map +1 -1
- package/dist/components/multi-select.js +66 -62
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +22 -8
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/overlay.js +2 -2
- package/dist/components/overlay.js.map +1 -1
- package/dist/components/page-header.d.ts +3 -1
- package/dist/components/page-header.js +12 -12
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.js +3 -3
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +18 -23
- package/dist/components/popover.js.map +1 -1
- package/dist/components/prompt-bar.d.ts +16 -0
- package/dist/components/prompt-bar.js +49 -0
- package/dist/components/prompt-bar.js.map +1 -0
- package/dist/components/radio.js +9 -9
- package/dist/components/radio.js.map +1 -1
- package/dist/components/recommendation-card.d.ts +13 -0
- package/dist/components/recommendation-card.js +123 -0
- package/dist/components/recommendation-card.js.map +1 -0
- package/dist/components/resource-list.js +1 -1
- package/dist/components/resource-list.js.map +1 -1
- package/dist/components/responsive-master-detail.js +4 -4
- package/dist/components/responsive-master-detail.js.map +1 -1
- package/dist/components/scroll-area.js +3 -3
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/section-rule.d.ts +5 -3
- package/dist/components/section-rule.js +12 -12
- package/dist/components/section-rule.js.map +1 -1
- package/dist/components/segment-control.js +3 -3
- package/dist/components/segment-control.js.map +1 -1
- package/dist/components/select.js +47 -32
- package/dist/components/select.js.map +1 -1
- package/dist/components/sensitive-input.js +17 -19
- package/dist/components/sensitive-input.js.map +1 -1
- package/dist/components/sheet.d.ts +4 -4
- package/dist/components/sheet.js +11 -10
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +149 -137
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton-line.d.ts +1 -1
- package/dist/components/skeleton-line.js +2 -2
- package/dist/components/skeleton-line.js.map +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slider.js.map +1 -1
- package/dist/components/stat-strip.js +5 -4
- package/dist/components/stat-strip.js.map +1 -1
- package/dist/components/switch.js +6 -6
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table-of-contents.js +5 -5
- package/dist/components/table-of-contents.js.map +1 -1
- package/dist/components/table-pager.js +2 -2
- package/dist/components/table-pager.js.map +1 -1
- package/dist/components/table.d.ts +39 -2
- package/dist/components/table.js +48 -17
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +7 -6
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag-badge.d.ts +10 -10
- package/dist/components/tag-badge.js +11 -11
- package/dist/components/tag-badge.js.map +1 -1
- package/dist/components/tag-color-picker.d.ts +8 -1
- package/dist/components/tag-color-picker.js +33 -25
- package/dist/components/tag-color-picker.js.map +1 -1
- package/dist/components/text.js +5 -5
- package/dist/components/text.js.map +1 -1
- package/dist/components/theme-toggle.js +1 -1
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/thinking.d.ts +16 -0
- package/dist/components/thinking.js +85 -0
- package/dist/components/thinking.js.map +1 -0
- package/dist/components/toast.js +25 -20
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toggle-group.js +6 -5
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +6 -6
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/tool-chips.d.ts +12 -0
- package/dist/components/tool-chips.js +138 -0
- package/dist/components/tool-chips.js.map +1 -0
- package/dist/components/toolbar.js +3 -3
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/typeahead-field.js +59 -56
- package/dist/components/typeahead-field.js.map +1 -1
- package/dist/components/upload-queue.js +15 -14
- package/dist/components/upload-queue.js.map +1 -1
- package/dist/models/agent-feedback.d.ts +44 -0
- package/dist/models/agent-feedback.js +28 -0
- package/dist/models/agent-feedback.js.map +1 -0
- package/dist/models/avatar.d.ts +2 -0
- package/dist/models/avatar.js +15 -0
- package/dist/models/avatar.js.map +1 -0
- package/dist/models/code.d.ts +6 -0
- package/dist/models/code.js +24 -0
- package/dist/models/code.js.map +1 -0
- package/dist/models/context-cards.d.ts +13 -0
- package/dist/models/context-cards.js +17 -0
- package/dist/models/context-cards.js.map +1 -0
- package/dist/models/diff-table.d.ts +12 -0
- package/dist/models/diff-table.js +9 -0
- package/dist/models/diff-table.js.map +1 -0
- package/dist/models/recommendation.d.ts +26 -0
- package/dist/models/recommendation.js +23 -0
- package/dist/models/recommendation.js.map +1 -0
- package/dist/styles/base.css +14 -2
- package/dist/styles/standalone.css +1901 -943
- package/dist/styles/tailwind.css +180 -13
- package/dist/styles/tokens.css +681 -20
- package/dist/utils/cn.js +25 -4
- package/dist/utils/cn.js.map +1 -1
- package/dist/utils/control-surface.d.ts +1 -1
- package/dist/utils/control-surface.js +1 -1
- package/dist/utils/control-surface.js.map +1 -1
- package/dist/utils/navigation.d.ts +3 -0
- package/dist/utils/navigation.js +8 -0
- package/dist/utils/navigation.js.map +1 -0
- package/dist/utils/selection-indicator.d.ts +1 -1
- package/dist/utils/selection-indicator.js +49 -72
- package/dist/utils/selection-indicator.js.map +1 -1
- package/dist/utils/use-hover-highlight.d.ts +4 -0
- package/dist/utils/use-hover-highlight.js +82 -0
- package/dist/utils/use-hover-highlight.js.map +1 -0
- package/dist/viewmodels/use-approval-card.d.ts +20 -0
- package/dist/viewmodels/use-approval-card.js +83 -0
- package/dist/viewmodels/use-approval-card.js.map +1 -0
- package/dist/viewmodels/use-chat-composer.d.ts +16 -0
- package/dist/viewmodels/use-chat-composer.js +34 -0
- package/dist/viewmodels/use-chat-composer.js.map +1 -0
- package/dist/viewmodels/use-chat-message.d.ts +16 -0
- package/dist/viewmodels/use-chat-message.js +26 -0
- package/dist/viewmodels/use-chat-message.js.map +1 -0
- package/dist/viewmodels/use-code-block.d.ts +8 -0
- package/dist/viewmodels/use-code-block.js +38 -0
- package/dist/viewmodels/use-code-block.js.map +1 -0
- package/dist/viewmodels/use-context-cards.d.ts +17 -0
- package/dist/viewmodels/use-context-cards.js +18 -0
- package/dist/viewmodels/use-context-cards.js.map +1 -0
- package/dist/viewmodels/use-diff-table.d.ts +16 -0
- package/dist/viewmodels/use-diff-table.js +42 -0
- package/dist/viewmodels/use-diff-table.js.map +1 -0
- package/dist/viewmodels/use-loader.d.ts +4 -0
- package/dist/viewmodels/use-loader.js +22 -0
- package/dist/viewmodels/use-loader.js.map +1 -0
- package/dist/viewmodels/use-recommendation-card.d.ts +17 -0
- package/dist/viewmodels/use-recommendation-card.js +41 -0
- package/dist/viewmodels/use-recommendation-card.js.map +1 -0
- package/dist/viewmodels/use-thinking.d.ts +13 -0
- package/dist/viewmodels/use-thinking.js +18 -0
- package/dist/viewmodels/use-thinking.js.map +1 -0
- package/dist/viewmodels/use-tool-chips.d.ts +10 -0
- package/dist/viewmodels/use-tool-chips.js +20 -0
- package/dist/viewmodels/use-tool-chips.js.map +1 -0
- package/package.json +28 -26
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../utils/cn.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
3
|
+
import { controlSurfaceClass as t } from "../utils/control-surface.js";
|
|
4
|
+
import { Button as n } from "./button.js";
|
|
5
|
+
import { Input as r } from "./input.js";
|
|
6
|
+
import * as i from "react";
|
|
7
|
+
import { Eye as a, EyeOff as o } from "lucide-react";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/sensitive-input.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let [_, v] = r.useState(!1);
|
|
15
|
-
return /* @__PURE__ */ s("div", {
|
|
16
|
-
className: "relative",
|
|
17
|
-
children: [/* @__PURE__ */ o(n, {
|
|
10
|
+
var l = i.forwardRef(({ className: l, revealLabel: u, hideLabel: d, disabled: f, size: p = "default", passwordManagerIgnore: m = !1, ...h }, g) => {
|
|
11
|
+
let [_, v] = i.useState(!1);
|
|
12
|
+
return /* @__PURE__ */ c("div", {
|
|
13
|
+
className: t("flex focus-within:border-basalt-ring has-[input[aria-invalid=true]]:border-basalt-destructive"),
|
|
14
|
+
children: [/* @__PURE__ */ s(r, {
|
|
18
15
|
ref: g,
|
|
19
16
|
type: _ ? "text" : "password",
|
|
20
17
|
size: p,
|
|
21
18
|
passwordManagerIgnore: m,
|
|
22
|
-
className: e("
|
|
19
|
+
className: e("min-w-0 flex-1 border-0 bg-transparent shadow-none", l),
|
|
23
20
|
disabled: f,
|
|
24
21
|
...h
|
|
25
|
-
}), /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ s(n, {
|
|
26
23
|
type: "button",
|
|
27
24
|
variant: "ghost",
|
|
28
|
-
|
|
25
|
+
size: p === "default" ? "icon" : p,
|
|
26
|
+
className: "basalt-action-icon basalt-action-inset shrink-0",
|
|
29
27
|
"aria-label": _ ? d : u,
|
|
30
28
|
disabled: f,
|
|
31
29
|
onClick: () => v((e) => !e),
|
|
32
|
-
children:
|
|
33
|
-
className: "h-4 w-4",
|
|
30
|
+
children: s(_ ? o : a, {
|
|
31
|
+
className: "h-basalt-4 w-basalt-4",
|
|
34
32
|
"aria-hidden": "true"
|
|
35
33
|
})
|
|
36
34
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensitive-input.js","names":["React","
|
|
1
|
+
{"version":3,"file":"sensitive-input.js","names":["React","SensitiveInput","props","revealed","setRevealed","controlSurfaceClass","Input","cn","className","Button","size","hideLabel","revealLabel","value","jsx","EyeOff","Eye"],"sources":["../../src/components/sensitive-input.tsx"],"sourcesContent":["import { Eye, EyeOff } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { controlSurfaceClass } from \"../utils/control-surface\";\nimport { Button } from \"./button\";\nimport { Input, type InputSize } from \"./input\";\n\nexport type SensitiveInputProps = Omit<React.ComponentProps<\"input\">, \"type\" | \"size\"> & {\n\t/**\n\t * Accessible label for the reveal action.\n\t */\n\trevealLabel: string;\n\t/**\n\t * Accessible label for the hide action.\n\t */\n\thideLabel: string;\n\t/**\n\t * The visual size of the field.\n\t * @default default\n\t */\n\tsize?: InputSize;\n\t/**\n\t * Ignore password managers on this field.\n\t * @default false\n\t */\n\tpasswordManagerIgnore?: boolean;\n};\n\nexport const SensitiveInput = React.forwardRef<HTMLInputElement, SensitiveInputProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\trevealLabel,\n\t\t\thideLabel,\n\t\t\tdisabled,\n\t\t\tsize = \"default\",\n\t\t\tpasswordManagerIgnore = false,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst [revealed, setRevealed] = React.useState(false);\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={controlSurfaceClass(\n\t\t\t\t\t\"flex focus-within:border-basalt-ring has-[input[aria-invalid=true]]:border-basalt-destructive\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<Input\n\t\t\t\t\tref={ref}\n\t\t\t\t\ttype={revealed ? \"text\" : \"password\"}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tpasswordManagerIgnore={passwordManagerIgnore}\n\t\t\t\t\tclassName={cn(\"min-w-0 flex-1 border-0 bg-transparent shadow-none\", className)}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize={size === \"default\" ? \"icon\" : size}\n\t\t\t\t\tclassName=\"basalt-action-icon basalt-action-inset shrink-0\"\n\t\t\t\t\taria-label={revealed ? hideLabel : revealLabel}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tonClick={() => setRevealed((value) => !value)}\n\t\t\t\t>\n\t\t\t\t\t{revealed ? (\n\t\t\t\t\t\t<EyeOff className=\"h-basalt-4 w-basalt-4\" aria-hidden=\"true\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Eye className=\"h-basalt-4 w-basalt-4\" aria-hidden=\"true\" />\n\t\t\t\t\t)}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t},\n);\nSensitiveInput.displayName = \"SensitiveInput\";\n"],"mappings":";;;;;;;;;AA4BA,IAAaC,IAAiBD,EAAM,YAElC,EACC,cACA,gBACA,cACA,aACA,UAAO,WACP,2BAAwB,IACxB,GAAGE,KAEJ,MACI;CACJ,IAAM,CAACC,GAAUC,KAAeJ,EAAM,SAAS,EAAK;CACpD,OACC,kBAAC,OAAD;EACC,WAAWK,EACV,+FACD;EAHD,UAAA,CAKC,kBAACC,GAAD;GACM;GACL,MAAMH,IAAW,SAAS;GACpB;GACiB;GACvB,WAAWI,EAAG,sDAAsDC,CAAS;GACnE;GACV,GAAIN;EACJ,CAAA,GACD,kBAACO,GAAD;GACC,MAAK;GACL,SAAQ;GACR,MAAMC,MAAS,YAAY,SAASA;GACpC,WAAU;GACV,cAAYP,IAAWQ,IAAYC;GACzB;GACV,eAAeR,GAAa,MAAU,CAACS,CAAK;GAE3C,UACAC,EADAX,IACCY,IAEAC,GAFD;IAAQ,WAAU;IAAwB,eAAY;GAAQ,CAEH;EAErD,CAAA,CACJ;;AAEP,CACD;AACA,EAAe,cAAc"}
|
|
@@ -64,10 +64,10 @@ export interface SheetDescriptionProps extends Omit<RadixDialogDescriptionProps,
|
|
|
64
64
|
}
|
|
65
65
|
export declare const SheetDescription: React.ForwardRefExoticComponent<SheetDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
66
66
|
declare const SIDE: {
|
|
67
|
-
readonly right: "fixed inset-y-0 right-0 basalt-ui flex h-full w-80 flex-col gap-
|
|
68
|
-
readonly left: "fixed inset-y-0 left-0 basalt-ui flex h-full w-80 flex-col gap-
|
|
69
|
-
readonly top: "fixed inset-x-0 top-0 basalt-ui flex h-80 w-full flex-col gap-
|
|
70
|
-
readonly bottom: "fixed inset-x-0 bottom-0 basalt-ui flex h-80 w-full flex-col gap-
|
|
67
|
+
readonly right: "fixed inset-y-0 right-0 basalt-ui flex h-full w-basalt-80 flex-col gap-basalt-space-lg border-l border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg";
|
|
68
|
+
readonly left: "fixed inset-y-0 left-0 basalt-ui flex h-full w-basalt-80 flex-col gap-basalt-space-lg border-r border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg";
|
|
69
|
+
readonly top: "fixed inset-x-0 top-0 basalt-ui flex h-basalt-80 w-full flex-col gap-basalt-space-lg border-b border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg";
|
|
70
|
+
readonly bottom: "fixed inset-x-0 bottom-0 basalt-ui flex h-basalt-80 w-full flex-col gap-basalt-space-lg border-t border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg";
|
|
71
71
|
};
|
|
72
72
|
export type SheetSide = keyof typeof SIDE;
|
|
73
73
|
export interface SheetContentProps extends Omit<RadixDialogContentProps, "side" | "asChild" | "forceMount" | "trapFocus" | "onOpenAutoFocus" | "onCloseAutoFocus" | "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside"> {
|
package/dist/components/sheet.js
CHANGED
|
@@ -8,31 +8,32 @@ import * as s from "@radix-ui/react-dialog";
|
|
|
8
8
|
//#region src/components/sheet.tsx
|
|
9
9
|
var c = s.Root, l = s.Trigger, u = s.Close, d = i.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.Title, {
|
|
10
10
|
ref: r,
|
|
11
|
-
className: e("text-lg font-semibold leading-
|
|
11
|
+
className: e("text-basalt-lg font-semibold leading-basalt-tight tracking-tight", t),
|
|
12
12
|
...n
|
|
13
13
|
}));
|
|
14
14
|
d.displayName = s.Title.displayName;
|
|
15
15
|
var f = i.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.Description, {
|
|
16
16
|
ref: r,
|
|
17
|
-
className: e("text-
|
|
17
|
+
className: e("text-basalt-base leading-[var(--basalt-line-body)] text-basalt-muted-foreground", t),
|
|
18
18
|
...n
|
|
19
19
|
}));
|
|
20
20
|
f.displayName = s.Description.displayName;
|
|
21
21
|
var p = {
|
|
22
|
-
right: `fixed inset-y-0 right-0 ${t} flex h-full w-80 flex-col gap-
|
|
23
|
-
left: `fixed inset-y-0 left-0 ${t} flex h-full w-80 flex-col gap-
|
|
24
|
-
top: `fixed inset-x-0 top-0 ${t} flex h-80 w-full flex-col gap-
|
|
25
|
-
bottom: `fixed inset-x-0 bottom-0 ${t} flex h-80 w-full flex-col gap-
|
|
22
|
+
right: `fixed inset-y-0 right-0 ${t} flex h-full w-basalt-80 flex-col gap-basalt-space-lg border-l border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`,
|
|
23
|
+
left: `fixed inset-y-0 left-0 ${t} flex h-full w-basalt-80 flex-col gap-basalt-space-lg border-r border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`,
|
|
24
|
+
top: `fixed inset-x-0 top-0 ${t} flex h-basalt-80 w-full flex-col gap-basalt-space-lg border-b border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`,
|
|
25
|
+
bottom: `fixed inset-x-0 bottom-0 ${t} flex h-basalt-80 w-full flex-col gap-basalt-space-lg border-t border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`
|
|
26
26
|
}, m = i.forwardRef(({ className: t, side: i = "right", children: c, ...l }, u) => /* @__PURE__ */ o(s.Portal, {
|
|
27
27
|
forceMount: l.forceMount,
|
|
28
28
|
children: [/* @__PURE__ */ a(s.Overlay, {
|
|
29
29
|
forceMount: l.forceMount,
|
|
30
|
-
className: e("fixed inset-0 bg-
|
|
30
|
+
className: e("basalt-sheet-overlay fixed inset-0 bg-basalt-backdrop/50", n, r)
|
|
31
31
|
}), /* @__PURE__ */ a(s.Content, {
|
|
32
32
|
ref: u,
|
|
33
33
|
"data-basalt-sheet": "",
|
|
34
|
+
"data-side": i,
|
|
34
35
|
"data-basalt-surface-root": "",
|
|
35
|
-
className: e(n, r, p[i], t),
|
|
36
|
+
className: e(n, r, "max-h-dvh max-w-full", p[i], t),
|
|
36
37
|
...l,
|
|
37
38
|
style: {
|
|
38
39
|
boxSizing: "border-box",
|
|
@@ -43,12 +44,12 @@ var p = {
|
|
|
43
44
|
}));
|
|
44
45
|
m.displayName = "SheetContent";
|
|
45
46
|
var h = ({ className: t, ...n }) => /* @__PURE__ */ a("div", {
|
|
46
|
-
className: e("flex flex-col space-y-
|
|
47
|
+
className: e("flex flex-col space-y-basalt-space-lg text-left", t),
|
|
47
48
|
...n
|
|
48
49
|
});
|
|
49
50
|
h.displayName = "SheetHeader";
|
|
50
51
|
var g = ({ className: t, ...n }) => /* @__PURE__ */ a("div", {
|
|
51
|
-
className: e("flex flex-col-reverse gap-
|
|
52
|
+
className: e("flex flex-col-reverse gap-basalt-space-lg sm:flex-row sm:justify-end", t),
|
|
52
53
|
...n
|
|
53
54
|
});
|
|
54
55
|
g.displayName = "SheetFooter";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":["React","DialogPrimitive","Sheet","SheetTrigger","SheetClose","SheetTitle","props","cn","className","SheetDescription","SIDE","BASALT_UI_CLASS","SheetContent","OVERLAY_LAYER","OVERLAY_MOTION","side","SheetHeader","SheetFooter"],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { OVERLAY_LAYER, OVERLAY_MOTION } from \"./overlay\";\n\ntype RadixDialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;\ntype RadixDialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\ntype RadixDialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\ntype RadixDialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\ntype RadixDialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\ntype RadixDialogDescriptionProps = React.ComponentPropsWithoutRef<\n\ttypeof DialogPrimitive.Description\n>;\n\nexport interface SheetProps\n\textends Omit<RadixDialogProps, \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"modal\"> {\n\t/**\n\t * Controlled open state of the sheet drawer.\n\t */\n\topen?: RadixDialogProps[\"open\"];\n\t/**\n\t * Uncontrolled default open state of the sheet on initial render.\n\t * @default false\n\t */\n\tdefaultOpen?: RadixDialogProps[\"defaultOpen\"];\n\t/**\n\t * Callback invoked when the open state changes.\n\t */\n\tonOpenChange?: RadixDialogProps[\"onOpenChange\"];\n\t/**\n\t * Whether the sheet renders modally, preventing outside interaction and hiding background content from screen readers.\n\t * @default true\n\t */\n\tmodal?: RadixDialogProps[\"modal\"];\n}\n\nexport const Sheet: React.FC<SheetProps> = DialogPrimitive.Root;\n\nexport interface SheetTriggerProps extends Omit<RadixDialogTriggerProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogTriggerProps[\"asChild\"];\n}\n\nexport const SheetTrigger = DialogPrimitive.Trigger;\n\nexport interface SheetCloseProps extends Omit<RadixDialogCloseProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Close forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogCloseProps[\"asChild\"];\n}\n\nexport const SheetClose = DialogPrimitive.Close;\n\nexport interface SheetTitleProps extends Omit<RadixDialogTitleProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered heading element to the child element, merging props and behavior.\n\t * Title forwards ref to HTMLHeadingElement and inherits native h2 attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogTitleProps[\"asChild\"];\n}\n\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Title>,\n\tSheetTitleProps\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n\t\t{...props}\n\t/>\n));\nSheetTitle.displayName = DialogPrimitive.Title.displayName;\n\nexport interface SheetDescriptionProps extends Omit<RadixDialogDescriptionProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered paragraph element to the child element, merging props and behavior.\n\t * Description forwards ref to HTMLParagraphElement and inherits native p attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogDescriptionProps[\"asChild\"];\n}\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Description>,\n\tSheetDescriptionProps\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cn(\"text-sm text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nSheetDescription.displayName = DialogPrimitive.Description.displayName;\n\nconst SIDE = {\n\tright: `fixed inset-y-0 right-0 ${BASALT_UI_CLASS} flex h-full w-80 flex-col gap-3 border-l border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n\tleft: `fixed inset-y-0 left-0 ${BASALT_UI_CLASS} flex h-full w-80 flex-col gap-3 border-r border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n\ttop: `fixed inset-x-0 top-0 ${BASALT_UI_CLASS} flex h-80 w-full flex-col gap-3 border-b border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n\tbottom: `fixed inset-x-0 bottom-0 ${BASALT_UI_CLASS} flex h-80 w-full flex-col gap-3 border-t border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n} as const;\n\nexport type SheetSide = keyof typeof SIDE;\n\nexport interface SheetContentProps\n\textends Omit<\n\t\tRadixDialogContentProps,\n\t\t| \"side\"\n\t\t| \"asChild\"\n\t\t| \"forceMount\"\n\t\t| \"trapFocus\"\n\t\t| \"onOpenAutoFocus\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Edge of the screen where the drawer panel is positioned and anchored.\n\t * @default \"right\"\n\t */\n\tside?: SheetSide;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogContentProps[\"asChild\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.\n\t */\n\tforceMount?: RadixDialogContentProps[\"forceMount\"];\n\t/**\n\t * Event handler called when auto-focusing the first element on open. Can be prevented with event.preventDefault().\n\t */\n\tonOpenAutoFocus?: RadixDialogContentProps[\"onOpenAutoFocus\"];\n\t/**\n\t * Event handler called when restoring focus on close. Can be prevented with event.preventDefault().\n\t */\n\tonCloseAutoFocus?: RadixDialogContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Event handler called when the Escape key is pressed. Can be prevented with event.preventDefault().\n\t */\n\tonEscapeKeyDown?: RadixDialogContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Event handler called when a pointer event occurs outside the sheet bounds.\n\t */\n\tonPointerDownOutside?: RadixDialogContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Event handler called when focus moves outside the sheet bounds.\n\t */\n\tonFocusOutside?: RadixDialogContentProps[\"onFocusOutside\"];\n\t/**\n\t * Event handler called when any interaction (pointer or focus) occurs outside the sheet bounds.\n\t */\n\tonInteractOutside?: RadixDialogContentProps[\"onInteractOutside\"];\n}\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Content>,\n\tSheetContentProps\n>(({ className, side = \"right\", children, ...props }, ref) => (\n\t<DialogPrimitive.Portal forceMount={props.forceMount}>\n\t\t<DialogPrimitive.Overlay\n\t\t\tforceMount={props.forceMount}\n\t\t\tclassName={cn(\"fixed inset-0 bg-black/50 backdrop-blur-xs\", OVERLAY_LAYER, OVERLAY_MOTION)}\n\t\t/>\n\t\t<DialogPrimitive.Content\n\t\t\tref={ref}\n\t\t\tdata-basalt-sheet=\"\"\n\t\t\tdata-basalt-surface-root=\"\"\n\t\t\tclassName={cn(OVERLAY_LAYER, OVERLAY_MOTION, SIDE[side], className)}\n\t\t\t{...props}\n\t\t\tstyle={{ boxSizing: \"border-box\", ...props.style }}\n\t\t>\n\t\t\t{children}\n\t\t</DialogPrimitive.Content>\n\t</DialogPrimitive.Portal>\n));\nSheetContent.displayName = \"SheetContent\";\n\nexport interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const SheetHeader = ({ className, ...props }: SheetHeaderProps) => (\n\t<div className={cn(\"flex flex-col space-y-2 text-left\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nexport interface SheetFooterProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const SheetFooter = ({ className, ...props }: SheetFooterProps) => (\n\t<div\n\t\tclassName={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t\t{...props}\n\t/>\n);\nSheetFooter.displayName = \"SheetFooter\";\n"],"mappings":";;;;;;;;AAqCA,IAAaE,IAA8BD,EAAgB,MAW9CE,IAAeF,EAAgB,SAW/BG,IAAaH,EAAgB,OAW7BI,IAAaL,EAAM,YAG7B,EAAE,cAAW,GAAGM,KAAS,MAC3B,kBAACL,EAAgB,OAAjB;CACM;CACL,WAAWM,EAAG,qDAAqDC,CAAS;CAC5E,GAAIF;AACJ,CAAA,CACD;AACD,EAAW,cAAcL,EAAgB,MAAM;AAW/C,IAAaQ,IAAmBT,EAAM,YAGnC,EAAE,cAAW,GAAGM,KAAS,MAC3B,kBAACL,EAAgB,aAAjB;CACM;CACL,WAAWM,EAAG,wCAAwCC,CAAS;CAC/D,GAAIF;AACJ,CAAA,CACD;AACD,EAAiB,cAAcL,EAAgB,YAAY;AAE3D,IAAMS,IAAO;CACZ,OAAO,2BAA2BC,EAAgB;CAClD,MAAM,0BAA0BA,EAAgB;CAChD,KAAK,yBAAyBA,EAAgB;CAC9C,QAAQ,4BAA4BA,EAAgB;AACrD,GA8DaC,IAAeZ,EAAM,YAG/B,EAAE,cAAW,UAAO,SAAS,aAAU,GAAGM,KAAS,MACrD,kBAACL,EAAgB,QAAjB;CAAwB,YAAYK,EAAM;CAA1C,UAAA,CACC,kBAACL,EAAgB,SAAjB;EACC,YAAYK,EAAM;EAClB,WAAWC,EAAG,8CAA8CM,GAAeC,CAAc;CACzF,CAAA,GACD,kBAACb,EAAgB,SAAjB;EACM;EACL,qBAAkB;EAClB,4BAAyB;EACzB,WAAWM,EAAGM,GAAeC,GAAgBJ,EAAKK,IAAOP,CAAS;EAClE,GAAIF;EACJ,OAAO;GAAE,WAAW;GAAc,GAAGA,EAAM;EAAM;EAEhD;CACuB,CAAA,CACF;AACxB,CAAA,CAAA;AACD,EAAa,cAAc;AAI3B,IAAaU,KAAe,EAAE,cAAW,GAAGV,QAC3C,kBAAC,OAAD;CAAK,WAAWC,EAAG,qCAAqCC,CAAS;CAAG,GAAIF;AAAQ,CAAA;AAEjF,EAAY,cAAc;AAI1B,IAAaW,KAAe,EAAE,cAAW,GAAGX,QAC3C,kBAAC,OAAD;CACC,WAAWC,EAAG,0DAA0DC,CAAS;CACjF,GAAIF;AACJ,CAAA;AAEF,EAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"sheet.js","names":["React","DialogPrimitive","Sheet","SheetTrigger","SheetClose","SheetTitle","props","cn","className","SheetDescription","SIDE","BASALT_UI_CLASS","SheetContent","OVERLAY_LAYER","OVERLAY_MOTION","side","SheetHeader","SheetFooter"],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { OVERLAY_LAYER, OVERLAY_MOTION } from \"./overlay\";\n\ntype RadixDialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;\ntype RadixDialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\ntype RadixDialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\ntype RadixDialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\ntype RadixDialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\ntype RadixDialogDescriptionProps = React.ComponentPropsWithoutRef<\n\ttypeof DialogPrimitive.Description\n>;\n\nexport interface SheetProps\n\textends Omit<RadixDialogProps, \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"modal\"> {\n\t/**\n\t * Controlled open state of the sheet drawer.\n\t */\n\topen?: RadixDialogProps[\"open\"];\n\t/**\n\t * Uncontrolled default open state of the sheet on initial render.\n\t * @default false\n\t */\n\tdefaultOpen?: RadixDialogProps[\"defaultOpen\"];\n\t/**\n\t * Callback invoked when the open state changes.\n\t */\n\tonOpenChange?: RadixDialogProps[\"onOpenChange\"];\n\t/**\n\t * Whether the sheet renders modally, preventing outside interaction and hiding background content from screen readers.\n\t * @default true\n\t */\n\tmodal?: RadixDialogProps[\"modal\"];\n}\n\nexport const Sheet: React.FC<SheetProps> = DialogPrimitive.Root;\n\nexport interface SheetTriggerProps extends Omit<RadixDialogTriggerProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogTriggerProps[\"asChild\"];\n}\n\nexport const SheetTrigger = DialogPrimitive.Trigger;\n\nexport interface SheetCloseProps extends Omit<RadixDialogCloseProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Close forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogCloseProps[\"asChild\"];\n}\n\nexport const SheetClose = DialogPrimitive.Close;\n\nexport interface SheetTitleProps extends Omit<RadixDialogTitleProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered heading element to the child element, merging props and behavior.\n\t * Title forwards ref to HTMLHeadingElement and inherits native h2 attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogTitleProps[\"asChild\"];\n}\n\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Title>,\n\tSheetTitleProps\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cn(\"text-basalt-lg font-semibold leading-basalt-tight tracking-tight\", className)}\n\t\t{...props}\n\t/>\n));\nSheetTitle.displayName = DialogPrimitive.Title.displayName;\n\nexport interface SheetDescriptionProps extends Omit<RadixDialogDescriptionProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered paragraph element to the child element, merging props and behavior.\n\t * Description forwards ref to HTMLParagraphElement and inherits native p attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogDescriptionProps[\"asChild\"];\n}\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Description>,\n\tSheetDescriptionProps\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"text-basalt-base leading-[var(--basalt-line-body)] text-basalt-muted-foreground\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nSheetDescription.displayName = DialogPrimitive.Description.displayName;\n\nconst SIDE = {\n\tright: `fixed inset-y-0 right-0 ${BASALT_UI_CLASS} flex h-full w-basalt-80 flex-col gap-basalt-space-lg border-l border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`,\n\tleft: `fixed inset-y-0 left-0 ${BASALT_UI_CLASS} flex h-full w-basalt-80 flex-col gap-basalt-space-lg border-r border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`,\n\ttop: `fixed inset-x-0 top-0 ${BASALT_UI_CLASS} flex h-basalt-80 w-full flex-col gap-basalt-space-lg border-b border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`,\n\tbottom: `fixed inset-x-0 bottom-0 ${BASALT_UI_CLASS} flex h-basalt-80 w-full flex-col gap-basalt-space-lg border-t border-basalt-border p-basalt-card sm:p-basalt-card-lg text-basalt-base text-basalt-foreground shadow-lg`,\n} as const;\n\nexport type SheetSide = keyof typeof SIDE;\n\nexport interface SheetContentProps\n\textends Omit<\n\t\tRadixDialogContentProps,\n\t\t| \"side\"\n\t\t| \"asChild\"\n\t\t| \"forceMount\"\n\t\t| \"trapFocus\"\n\t\t| \"onOpenAutoFocus\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Edge of the screen where the drawer panel is positioned and anchored.\n\t * @default \"right\"\n\t */\n\tside?: SheetSide;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogContentProps[\"asChild\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.\n\t */\n\tforceMount?: RadixDialogContentProps[\"forceMount\"];\n\t/**\n\t * Event handler called when auto-focusing the first element on open. Can be prevented with event.preventDefault().\n\t */\n\tonOpenAutoFocus?: RadixDialogContentProps[\"onOpenAutoFocus\"];\n\t/**\n\t * Event handler called when restoring focus on close. Can be prevented with event.preventDefault().\n\t */\n\tonCloseAutoFocus?: RadixDialogContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Event handler called when the Escape key is pressed. Can be prevented with event.preventDefault().\n\t */\n\tonEscapeKeyDown?: RadixDialogContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Event handler called when a pointer event occurs outside the sheet bounds.\n\t */\n\tonPointerDownOutside?: RadixDialogContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Event handler called when focus moves outside the sheet bounds.\n\t */\n\tonFocusOutside?: RadixDialogContentProps[\"onFocusOutside\"];\n\t/**\n\t * Event handler called when any interaction (pointer or focus) occurs outside the sheet bounds.\n\t */\n\tonInteractOutside?: RadixDialogContentProps[\"onInteractOutside\"];\n}\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Content>,\n\tSheetContentProps\n>(({ className, side = \"right\", children, ...props }, ref) => (\n\t<DialogPrimitive.Portal forceMount={props.forceMount}>\n\t\t<DialogPrimitive.Overlay\n\t\t\tforceMount={props.forceMount}\n\t\t\tclassName={cn(\n\t\t\t\t\"basalt-sheet-overlay fixed inset-0 bg-basalt-backdrop/50\",\n\t\t\t\tOVERLAY_LAYER,\n\t\t\t\tOVERLAY_MOTION,\n\t\t\t)}\n\t\t/>\n\t\t<DialogPrimitive.Content\n\t\t\tref={ref}\n\t\t\tdata-basalt-sheet=\"\"\n\t\t\tdata-side={side}\n\t\t\tdata-basalt-surface-root=\"\"\n\t\t\tclassName={cn(OVERLAY_LAYER, OVERLAY_MOTION, \"max-h-dvh max-w-full\", SIDE[side], className)}\n\t\t\t{...props}\n\t\t\tstyle={{ boxSizing: \"border-box\", ...props.style }}\n\t\t>\n\t\t\t{children}\n\t\t</DialogPrimitive.Content>\n\t</DialogPrimitive.Portal>\n));\nSheetContent.displayName = \"SheetContent\";\n\nexport interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const SheetHeader = ({ className, ...props }: SheetHeaderProps) => (\n\t<div className={cn(\"flex flex-col space-y-basalt-space-lg text-left\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nexport interface SheetFooterProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const SheetFooter = ({ className, ...props }: SheetFooterProps) => (\n\t<div\n\t\tclassName={cn(\n\t\t\t\"flex flex-col-reverse gap-basalt-space-lg sm:flex-row sm:justify-end\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\nSheetFooter.displayName = \"SheetFooter\";\n"],"mappings":";;;;;;;;AAqCA,IAAaE,IAA8BD,EAAgB,MAW9CE,IAAeF,EAAgB,SAW/BG,IAAaH,EAAgB,OAW7BI,IAAaL,EAAM,YAG7B,EAAE,cAAW,GAAGM,KAAS,MAC3B,kBAACL,EAAgB,OAAjB;CACM;CACL,WAAWM,EAAG,oEAAoEC,CAAS;CAC3F,GAAIF;AACJ,CAAA,CACD;AACD,EAAW,cAAcL,EAAgB,MAAM;AAW/C,IAAaQ,IAAmBT,EAAM,YAGnC,EAAE,cAAW,GAAGM,KAAS,MAC3B,kBAACL,EAAgB,aAAjB;CACM;CACL,WAAWM,EACV,mFACAC,CACD;CACA,GAAIF;AACJ,CAAA,CACD;AACD,EAAiB,cAAcL,EAAgB,YAAY;AAE3D,IAAMS,IAAO;CACZ,OAAO,2BAA2BC,EAAgB;CAClD,MAAM,0BAA0BA,EAAgB;CAChD,KAAK,yBAAyBA,EAAgB;CAC9C,QAAQ,4BAA4BA,EAAgB;AACrD,GA8DaC,IAAeZ,EAAM,YAG/B,EAAE,cAAW,UAAO,SAAS,aAAU,GAAGM,KAAS,MACrD,kBAACL,EAAgB,QAAjB;CAAwB,YAAYK,EAAM;CAA1C,UAAA,CACC,kBAACL,EAAgB,SAAjB;EACC,YAAYK,EAAM;EAClB,WAAWC,EACV,4DACAM,GACAC,CACD;CACA,CAAA,GACD,kBAACb,EAAgB,SAAjB;EACM;EACL,qBAAkB;EAClB,aAAWc;EACX,4BAAyB;EACzB,WAAWR,EAAGM,GAAeC,GAAgB,wBAAwBJ,EAAKK,IAAOP,CAAS;EAC1F,GAAIF;EACJ,OAAO;GAAE,WAAW;GAAc,GAAGA,EAAM;EAAM;EAEhD;CACuB,CAAA,CACF;AACxB,CAAA,CAAA;AACD,EAAa,cAAc;AAI3B,IAAaU,KAAe,EAAE,cAAW,GAAGV,QAC3C,kBAAC,OAAD;CAAK,WAAWC,EAAG,mDAAmDC,CAAS;CAAG,GAAIF;AAAQ,CAAA;AAE/F,EAAY,cAAc;AAI1B,IAAaW,KAAe,EAAE,cAAW,GAAGX,QAC3C,kBAAC,OAAD;CACC,WAAWC,EACV,wEACAC,CACD;CACA,GAAIF;AACJ,CAAA;AAEF,EAAY,cAAc"}
|
|
@@ -1,53 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../utils/cn.js";
|
|
3
3
|
import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
|
|
4
|
-
import {
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { Collapsible as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
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";
|
|
12
14
|
//#region src/components/sidebar.tsx
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
let e =
|
|
15
|
+
var D = g(null);
|
|
16
|
+
function O() {
|
|
17
|
+
let e = v(D);
|
|
16
18
|
if (!e) throw Error("useSidebar must be used within SidebarProvider");
|
|
17
19
|
return e;
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
let [l, u] =
|
|
21
|
-
|
|
22
|
-
}, []),
|
|
23
|
-
|
|
24
|
-
o && !
|
|
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
27
|
});
|
|
26
|
-
let
|
|
27
|
-
!t && document.activeElement instanceof HTMLElement && (
|
|
28
|
+
let T = _((t) => {
|
|
29
|
+
!t && document.activeElement instanceof HTMLElement && (g.current = document.activeElement), e === void 0 && u(t), n?.(t);
|
|
28
30
|
}, [e, n]);
|
|
29
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ w(D.Provider, {
|
|
30
32
|
value: {
|
|
31
|
-
collapsed:
|
|
32
|
-
setCollapsed:
|
|
33
|
+
collapsed: C,
|
|
34
|
+
setCollapsed: T,
|
|
33
35
|
side: r,
|
|
34
36
|
loading: i,
|
|
35
37
|
peek: a,
|
|
36
38
|
peeking: d,
|
|
37
|
-
setPeeking:
|
|
39
|
+
setPeeking: f,
|
|
38
40
|
overlay: o,
|
|
39
|
-
width:
|
|
40
|
-
setWidth:
|
|
41
|
-
lastFocusRef:
|
|
41
|
+
width: p,
|
|
42
|
+
setWidth: h,
|
|
43
|
+
lastFocusRef: g
|
|
42
44
|
},
|
|
43
45
|
children: c
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
|
-
function
|
|
48
|
+
function A(e) {
|
|
47
49
|
return Math.min(400, Math.max(180, e));
|
|
48
50
|
}
|
|
49
|
-
function
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
+
function j({ side: t, width: n, onWidth: r }) {
|
|
52
|
+
return /* @__PURE__ */ w("div", {
|
|
51
53
|
role: "separator",
|
|
52
54
|
"aria-orientation": "vertical",
|
|
53
55
|
"aria-valuenow": n,
|
|
@@ -55,12 +57,12 @@ function E({ side: t, width: n, onWidth: r }) {
|
|
|
55
57
|
"aria-valuemax": 400,
|
|
56
58
|
"aria-label": "Resize sidebar",
|
|
57
59
|
tabIndex: 0,
|
|
58
|
-
className: e("absolute top-0 h-full w-1 cursor-col-resize bg-transparent", t === "right" ? "left-0" : "right-0"),
|
|
60
|
+
className: e("absolute top-0 h-full w-basalt-1 cursor-col-resize bg-transparent", t === "right" ? "left-0" : "right-0"),
|
|
59
61
|
onPointerDown: (e) => {
|
|
60
62
|
e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId);
|
|
61
63
|
let i = e.clientX, a = n, o = e.currentTarget, s = (e) => {
|
|
62
64
|
let n = t === "right" ? i - e.clientX : e.clientX - i;
|
|
63
|
-
r(
|
|
65
|
+
r(A(a + n));
|
|
64
66
|
}, c = () => {
|
|
65
67
|
o.removeEventListener("pointermove", s), o.removeEventListener("pointerup", c), o.removeEventListener("pointercancel", c);
|
|
66
68
|
};
|
|
@@ -70,180 +72,190 @@ function E({ side: t, width: n, onWidth: r }) {
|
|
|
70
72
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
71
73
|
e.preventDefault();
|
|
72
74
|
let i = e.key === "ArrowRight" ? 1 : -1;
|
|
73
|
-
r(
|
|
75
|
+
r(A(n + (t === "right" ? -i * 8 : i * 8)));
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
className: "flex flex-col gap-
|
|
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",
|
|
80
82
|
role: "status",
|
|
81
83
|
"aria-live": "polite",
|
|
82
84
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ w(f, {}),
|
|
86
|
+
/* @__PURE__ */ w(f, {}),
|
|
87
|
+
/* @__PURE__ */ w(f, {})
|
|
86
88
|
]
|
|
87
|
-
}) : l,
|
|
88
|
-
side:
|
|
89
|
-
width:
|
|
90
|
-
onWidth:
|
|
91
|
-
}) : null,
|
|
92
|
-
return
|
|
93
|
-
open: !
|
|
94
|
-
onOpenChange: (e) =>
|
|
95
|
-
children: /* @__PURE__ */
|
|
89
|
+
}) : l, S = h && !g ? /* @__PURE__ */ w(j, {
|
|
90
|
+
side: _,
|
|
91
|
+
width: h.width,
|
|
92
|
+
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, {
|
|
95
|
+
open: !h.collapsed,
|
|
96
|
+
onOpenChange: (e) => h.setCollapsed(!e),
|
|
97
|
+
children: /* @__PURE__ */ T(s, { children: [/* @__PURE__ */ w(o, {}), /* @__PURE__ */ T(E.Content, {
|
|
96
98
|
"data-basalt-sidebar": "",
|
|
97
99
|
"aria-label": "Sidebar",
|
|
98
100
|
"data-overlay": "",
|
|
99
|
-
"data-side":
|
|
100
|
-
"aria-busy":
|
|
101
|
-
onMouseEnter:
|
|
102
|
-
onMouseLeave:
|
|
101
|
+
"data-side": _,
|
|
102
|
+
"aria-busy": h.loading || void 0,
|
|
103
|
+
onMouseEnter: u,
|
|
104
|
+
onMouseLeave: d,
|
|
103
105
|
ref: (e) => {
|
|
104
|
-
e && document.activeElement instanceof HTMLElement && !e.contains(document.activeElement) && (
|
|
106
|
+
e && document.activeElement instanceof HTMLElement && !e.contains(document.activeElement) && (h.lastFocusRef.current = document.activeElement);
|
|
105
107
|
},
|
|
106
108
|
onOpenAutoFocus: (e) => {
|
|
107
109
|
let t = "relatedTarget" in e ? e.relatedTarget : null;
|
|
108
|
-
t instanceof HTMLElement && (
|
|
110
|
+
t instanceof HTMLElement && (h.lastFocusRef.current = t);
|
|
109
111
|
},
|
|
110
112
|
onCloseAutoFocus: (e) => {
|
|
111
|
-
e.preventDefault(),
|
|
113
|
+
e.preventDefault(), h.lastFocusRef.current?.focus();
|
|
112
114
|
},
|
|
113
|
-
className: e(
|
|
115
|
+
className: e(C, r, "fixed inset-y-0 overflow-hidden shadow-md", _ === "right" ? "right-0" : "left-0"),
|
|
114
116
|
style: {
|
|
115
|
-
width:
|
|
116
|
-
...
|
|
117
|
+
width: b,
|
|
118
|
+
...p
|
|
117
119
|
},
|
|
118
|
-
...
|
|
119
|
-
children: [
|
|
120
|
+
...m,
|
|
121
|
+
children: [x, S]
|
|
120
122
|
})] })
|
|
121
|
-
}) : /* @__PURE__ */
|
|
123
|
+
}) : /* @__PURE__ */ T("aside", {
|
|
122
124
|
"data-basalt-sidebar": "",
|
|
123
|
-
"data-collapsed":
|
|
124
|
-
"data-side":
|
|
125
|
-
"aria-busy":
|
|
125
|
+
"data-collapsed": g ? "" : void 0,
|
|
126
|
+
"data-side": _,
|
|
127
|
+
"aria-busy": h?.loading || void 0,
|
|
126
128
|
onMouseEnter: (e) => {
|
|
127
|
-
|
|
129
|
+
h?.peek && h.collapsed && h.setPeeking(!0), u?.(e);
|
|
128
130
|
},
|
|
129
131
|
onMouseLeave: (e) => {
|
|
130
|
-
|
|
132
|
+
h?.peek && h.setPeeking(!1), d?.(e);
|
|
131
133
|
},
|
|
132
|
-
className: e(
|
|
133
|
-
style:
|
|
134
|
-
width:
|
|
135
|
-
...
|
|
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"),
|
|
135
|
+
style: g ? p : {
|
|
136
|
+
width: b,
|
|
137
|
+
...p
|
|
136
138
|
},
|
|
137
|
-
...
|
|
138
|
-
children: [
|
|
139
|
+
...m,
|
|
140
|
+
children: [x, S]
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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", {
|
|
146
|
+
"data-slot": "sidebar-header",
|
|
147
|
+
className: e("flex h-basalt-14 shrink-0 items-center gap-basalt-row-gap px-basalt-nav-inset", t),
|
|
144
148
|
...n
|
|
145
149
|
});
|
|
146
150
|
}
|
|
147
|
-
function
|
|
148
|
-
return /* @__PURE__ */
|
|
151
|
+
function F({ shortcut: n = "⌘K", className: r, children: i, ...a }) {
|
|
152
|
+
return /* @__PURE__ */ T("button", {
|
|
149
153
|
type: "button",
|
|
150
|
-
className: e(t, "
|
|
154
|
+
className: e(t, h, N, "w-full cursor-pointer bg-basalt-secondary transition-colors basalt-motion hover:bg-basalt-hover", r),
|
|
151
155
|
...a,
|
|
152
156
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
className: "h-4 w-4 text-basalt-muted-foreground",
|
|
157
|
+
/* @__PURE__ */ w(C, {
|
|
158
|
+
className: "h-basalt-4 w-basalt-4 text-basalt-muted-foreground",
|
|
155
159
|
strokeWidth: 1.5
|
|
156
160
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
className: "flex-1 text-left text-
|
|
161
|
+
/* @__PURE__ */ w("span", {
|
|
162
|
+
className: "flex-1 text-left text-basalt-base text-basalt-muted-foreground",
|
|
159
163
|
children: i
|
|
160
164
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
className: "pointer-events-none hidden rounded-sm border border-basalt-border bg-basalt-card px-
|
|
165
|
+
/* @__PURE__ */ w("kbd", {
|
|
166
|
+
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-xs font-medium text-basalt-muted-foreground sm:inline-block",
|
|
163
167
|
children: n
|
|
164
168
|
})
|
|
165
169
|
]
|
|
166
170
|
});
|
|
167
171
|
}
|
|
168
|
-
function
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
function I({ className: t, ...n }) {
|
|
173
|
+
let r = d(void 0, { restoreOnPointerLeave: !1 });
|
|
174
|
+
return /* @__PURE__ */ w("nav", {
|
|
175
|
+
ref: r,
|
|
176
|
+
"data-slot": "sidebar-nav",
|
|
177
|
+
className: e(m, "min-h-0 flex-1 flex-col overflow-y-auto overscroll-y-contain", t),
|
|
171
178
|
...n
|
|
172
179
|
});
|
|
173
180
|
}
|
|
174
|
-
function
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
|
|
181
|
+
function L({ className: t, ...n }) {
|
|
182
|
+
return /* @__PURE__ */ w("p", {
|
|
183
|
+
"data-slot": "sidebar-partition",
|
|
184
|
+
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),
|
|
177
185
|
...n
|
|
178
186
|
});
|
|
179
187
|
}
|
|
180
|
-
function
|
|
181
|
-
return /* @__PURE__ */
|
|
188
|
+
function R({ active: t = !1, className: n, ...r }) {
|
|
189
|
+
return /* @__PURE__ */ w("button", {
|
|
182
190
|
type: "button",
|
|
183
191
|
"aria-current": t ? "page" : void 0,
|
|
184
|
-
|
|
192
|
+
"data-basalt-hover-item": "",
|
|
193
|
+
"data-sidebar-row": "",
|
|
194
|
+
"data-hover-selected": t,
|
|
195
|
+
className: e(p, N, "w-full", n),
|
|
185
196
|
...r
|
|
186
197
|
});
|
|
187
198
|
}
|
|
188
|
-
function
|
|
189
|
-
return /* @__PURE__ */
|
|
199
|
+
function z({ active: t = !1, className: n, ...r }) {
|
|
200
|
+
return /* @__PURE__ */ w("button", {
|
|
190
201
|
type: "button",
|
|
191
202
|
"aria-current": t ? "page" : void 0,
|
|
192
|
-
|
|
203
|
+
"data-basalt-hover-item": "",
|
|
204
|
+
"data-sidebar-row": "",
|
|
205
|
+
"data-hover-selected": t,
|
|
206
|
+
className: e(p, N, "relative w-basalt-control justify-center", n),
|
|
193
207
|
...r
|
|
194
208
|
});
|
|
195
209
|
}
|
|
196
|
-
function
|
|
197
|
-
let [
|
|
198
|
-
return /* @__PURE__ */
|
|
199
|
-
open:
|
|
200
|
-
onOpenChange:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
})
|
|
217
|
-
})]
|
|
218
|
-
})
|
|
210
|
+
function B({ label: t, defaultOpen: r = !0, children: a }) {
|
|
211
|
+
let [o, s] = x(r);
|
|
212
|
+
return /* @__PURE__ */ T(c, {
|
|
213
|
+
open: o,
|
|
214
|
+
onOpenChange: s,
|
|
215
|
+
"data-slot": "sidebar-group",
|
|
216
|
+
className: "shrink-0 pt-basalt-layout-sm",
|
|
217
|
+
children: [/* @__PURE__ */ w(u, {
|
|
218
|
+
asChild: !0,
|
|
219
|
+
children: /* @__PURE__ */ T("button", {
|
|
220
|
+
type: "button",
|
|
221
|
+
"data-slot": "sidebar-group-label",
|
|
222
|
+
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-xs 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", {
|
|
224
|
+
className: "min-w-0 truncate",
|
|
225
|
+
children: t
|
|
226
|
+
}), /* @__PURE__ */ w(S, {
|
|
227
|
+
className: e("h-basalt-4 w-basalt-4 text-basalt-muted-foreground transition-transform basalt-motion duration-basalt-normal", i, !o && "rotate-180"),
|
|
228
|
+
strokeWidth: 1.5
|
|
229
|
+
})]
|
|
219
230
|
})
|
|
220
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ w(l, {
|
|
221
232
|
unstyled: !0,
|
|
222
|
-
children: /* @__PURE__ */
|
|
223
|
-
className: "flex flex-col gap-
|
|
224
|
-
children:
|
|
233
|
+
children: /* @__PURE__ */ w("div", {
|
|
234
|
+
className: "flex flex-col gap-basalt-nav-gap pt-basalt-nav-gap",
|
|
235
|
+
children: a
|
|
225
236
|
})
|
|
226
237
|
})]
|
|
227
238
|
});
|
|
228
239
|
}
|
|
229
|
-
function
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
|
|
240
|
+
function V({ className: t, ...n }) {
|
|
241
|
+
return /* @__PURE__ */ w("div", {
|
|
242
|
+
"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),
|
|
232
244
|
...n
|
|
233
245
|
});
|
|
234
246
|
}
|
|
235
|
-
function
|
|
236
|
-
return /* @__PURE__ */
|
|
237
|
-
className: e("flex items-center gap-
|
|
247
|
+
function H({ name: t, email: n, avatar: r, action: i, className: a }) {
|
|
248
|
+
return /* @__PURE__ */ T("div", {
|
|
249
|
+
className: e("flex items-center gap-basalt-space-lg", a),
|
|
238
250
|
children: [
|
|
239
251
|
r,
|
|
240
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ T("div", {
|
|
241
253
|
className: "min-w-0 flex-1",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
-
className: "truncate text-
|
|
254
|
+
children: [/* @__PURE__ */ w("p", {
|
|
255
|
+
className: "truncate text-basalt-base font-medium text-basalt-foreground",
|
|
244
256
|
children: t
|
|
245
|
-
}), n ? /* @__PURE__ */
|
|
246
|
-
className: "truncate text-
|
|
257
|
+
}), n ? /* @__PURE__ */ w("p", {
|
|
258
|
+
className: "truncate text-basalt-sm text-basalt-muted-foreground",
|
|
247
259
|
children: n
|
|
248
260
|
}) : null]
|
|
249
261
|
}),
|
|
@@ -251,15 +263,15 @@ function I({ name: t, email: n, avatar: r, action: i, className: a }) {
|
|
|
251
263
|
]
|
|
252
264
|
});
|
|
253
265
|
}
|
|
254
|
-
function
|
|
255
|
-
return /* @__PURE__ */
|
|
266
|
+
function U({ mobileSurface: t = "inset", className: n, ...r }) {
|
|
267
|
+
return /* @__PURE__ */ w("div", {
|
|
256
268
|
"data-basalt-surface-root": "",
|
|
257
269
|
"data-basalt-island": t,
|
|
258
|
-
className: e("min-h-0 min-w-0 flex-1 bg-basalt-card text-basalt-card-foreground md:rounded-basalt-island md:p-
|
|
270
|
+
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),
|
|
259
271
|
...r
|
|
260
272
|
});
|
|
261
273
|
}
|
|
262
274
|
//#endregion
|
|
263
|
-
export {
|
|
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 };
|
|
264
276
|
|
|
265
277
|
//# sourceMappingURL=sidebar.js.map
|