@suzumiyaaoba/mdxr 0.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/LICENSE +21 -0
- package/README.md +56 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +2902 -0
- package/dist/components.d.mts +791 -0
- package/dist/components.mjs +2 -0
- package/dist/config-SI9IyFiC.mjs +184 -0
- package/dist/doc-context-CEqzMYKv.d.mts +568 -0
- package/dist/index.d.mts +20 -0
- package/dist/index.mjs +4 -0
- package/dist/ui-GKFD0mx5.mjs +15986 -0
- package/package.json +131 -0
- package/skill/SKILL.md +49 -0
- package/skill/references/components/charts.md +172 -0
- package/skill/references/components/document.md +98 -0
- package/skill/references/components/forms.md +35 -0
- package/skill/references/components/investigation.md +198 -0
- package/skill/references/components/layout.md +68 -0
- package/skill/references/components/output.md +158 -0
- package/skill/references/components/planning.md +155 -0
- package/skill/references/components/reports.md +252 -0
- package/skill/references/components/shadcn.md +19 -0
- package/skill/references/components.md +186 -0
- package/skill/references/extending.md +48 -0
- package/src/ask-sheet.ts +40 -0
- package/src/assets/css.ts +392 -0
- package/src/assets/scripts.ts +78 -0
- package/src/catalog.ts +287 -0
- package/src/cli.ts +178 -0
- package/src/client/doc-events.ts +1108 -0
- package/src/client/entry.ts +27 -0
- package/src/client-js.ts +47 -0
- package/src/component-map.ts +47 -0
- package/src/components/ui/accordion.tsx +77 -0
- package/src/components/ui/alert-dialog.tsx +185 -0
- package/src/components/ui/alert.tsx +76 -0
- package/src/components/ui/aspect-ratio.tsx +22 -0
- package/src/components/ui/attachment.tsx +208 -0
- package/src/components/ui/avatar.tsx +106 -0
- package/src/components/ui/badge.tsx +52 -0
- package/src/components/ui/breadcrumb.tsx +121 -0
- package/src/components/ui/bubble.tsx +128 -0
- package/src/components/ui/button-group.tsx +88 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/calendar.tsx +226 -0
- package/src/components/ui/card.tsx +102 -0
- package/src/components/ui/carousel.tsx +246 -0
- package/src/components/ui/chart.tsx +379 -0
- package/src/components/ui/checkbox.tsx +27 -0
- package/src/components/ui/collapsible.tsx +19 -0
- package/src/components/ui/combobox.tsx +298 -0
- package/src/components/ui/command.tsx +193 -0
- package/src/components/ui/context-menu.tsx +271 -0
- package/src/components/ui/dialog.tsx +159 -0
- package/src/components/ui/direction.tsx +4 -0
- package/src/components/ui/drawer.tsx +227 -0
- package/src/components/ui/dropdown-menu.tsx +269 -0
- package/src/components/ui/empty.tsx +104 -0
- package/src/components/ui/field.tsx +237 -0
- package/src/components/ui/fieldset.tsx +32 -0
- package/src/components/ui/frame.tsx +87 -0
- package/src/components/ui/hover-card.tsx +50 -0
- package/src/components/ui/input-group.tsx +159 -0
- package/src/components/ui/input-otp.tsx +83 -0
- package/src/components/ui/input.tsx +19 -0
- package/src/components/ui/item.tsx +202 -0
- package/src/components/ui/kbd.tsx +26 -0
- package/src/components/ui/label.tsx +19 -0
- package/src/components/ui/marker.tsx +71 -0
- package/src/components/ui/menubar.tsx +284 -0
- package/src/components/ui/message-scroller.tsx +128 -0
- package/src/components/ui/message.tsx +91 -0
- package/src/components/ui/meter.tsx +80 -0
- package/src/components/ui/native-select.tsx +64 -0
- package/src/components/ui/navigation-menu.tsx +170 -0
- package/src/components/ui/pagination.tsx +133 -0
- package/src/components/ui/popover.tsx +87 -0
- package/src/components/ui/progress.tsx +82 -0
- package/src/components/ui/questionnaire.tsx +328 -0
- package/src/components/ui/radio-group.tsx +35 -0
- package/src/components/ui/resizable.tsx +49 -0
- package/src/components/ui/scroll-area.tsx +50 -0
- package/src/components/ui/select.tsx +201 -0
- package/src/components/ui/separator.tsx +22 -0
- package/src/components/ui/sheet.tsx +135 -0
- package/src/components/ui/sidebar.tsx +730 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +51 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/table.tsx +113 -0
- package/src/components/ui/tabs.tsx +82 -0
- package/src/components/ui/textarea.tsx +17 -0
- package/src/components/ui/toast.tsx +229 -0
- package/src/components/ui/toggle-group.tsx +87 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +65 -0
- package/src/components.ts +78 -0
- package/src/config.ts +56 -0
- package/src/define.ts +122 -0
- package/src/doc-context.ts +20 -0
- package/src/editor.ts +94 -0
- package/src/format-error.ts +78 -0
- package/src/guards.ts +84 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/html.ts +91 -0
- package/src/hydrate/export-index.ts +232 -0
- package/src/hydrate/import-scan.ts +169 -0
- package/src/hydrate/plugins.ts +118 -0
- package/src/hydrate/runtime-module.ts +145 -0
- package/src/hydrate-runtime.ts +67 -0
- package/src/hydrate.ts +147 -0
- package/src/index.ts +16 -0
- package/src/init.ts +57 -0
- package/src/langs.ts +148 -0
- package/src/lines.ts +53 -0
- package/src/load-user-module.ts +191 -0
- package/src/mdx.ts +248 -0
- package/src/paths.ts +36 -0
- package/src/rehype/shiki.ts +533 -0
- package/src/remark/alerts.ts +53 -0
- package/src/remark/ast.ts +96 -0
- package/src/remark/callouts.ts +25 -0
- package/src/remark/code-file.ts +85 -0
- package/src/remark/code-meta.ts +21 -0
- package/src/remark/directives.ts +170 -0
- package/src/remark/file-paths.ts +64 -0
- package/src/remark/headings.ts +131 -0
- package/src/remark/no-js.ts +40 -0
- package/src/render.ts +337 -0
- package/src/serve.ts +322 -0
- package/src/styles/globals.css +134 -0
- package/src/styles/shadcn.css +641 -0
- package/src/tailwind.ts +119 -0
- package/src/ui/approvals.tsx +76 -0
- package/src/ui/ask-question.tsx +386 -0
- package/src/ui/ask.tsx +206 -0
- package/src/ui/attrs.ts +51 -0
- package/src/ui/audit.tsx +139 -0
- package/src/ui/bar-chart.tsx +334 -0
- package/src/ui/benchmarks.tsx +143 -0
- package/src/ui/bits.tsx +537 -0
- package/src/ui/board.tsx +173 -0
- package/src/ui/bridge.tsx +207 -0
- package/src/ui/bumps.tsx +178 -0
- package/src/ui/callout.tsx +106 -0
- package/src/ui/changes.tsx +89 -0
- package/src/ui/chart-bits.tsx +52 -0
- package/src/ui/chart.ts +577 -0
- package/src/ui/checks.tsx +203 -0
- package/src/ui/child-index.tsx +44 -0
- package/src/ui/children.ts +43 -0
- package/src/ui/chips.tsx +49 -0
- package/src/ui/cmd.tsx +27 -0
- package/src/ui/columns.tsx +31 -0
- package/src/ui/comments.tsx +544 -0
- package/src/ui/compare.tsx +67 -0
- package/src/ui/decision.tsx +79 -0
- package/src/ui/deps.tsx +78 -0
- package/src/ui/details.tsx +43 -0
- package/src/ui/diff-parse.ts +307 -0
- package/src/ui/diff.tsx +458 -0
- package/src/ui/diffstat.tsx +58 -0
- package/src/ui/due.tsx +65 -0
- package/src/ui/effort.tsx +29 -0
- package/src/ui/endpoints.tsx +118 -0
- package/src/ui/envvars.tsx +96 -0
- package/src/ui/figure.tsx +37 -0
- package/src/ui/file-icon.ts +1020 -0
- package/src/ui/file-link.ts +32 -0
- package/src/ui/file-ref.tsx +39 -0
- package/src/ui/files.tsx +112 -0
- package/src/ui/findings.tsx +85 -0
- package/src/ui/flow.tsx +73 -0
- package/src/ui/funnel.tsx +121 -0
- package/src/ui/gantt.tsx +443 -0
- package/src/ui/gauges.tsx +135 -0
- package/src/ui/glossary.tsx +29 -0
- package/src/ui/graph-layout.ts +149 -0
- package/src/ui/graph-specs.tsx +102 -0
- package/src/ui/graph.tsx +278 -0
- package/src/ui/grid.tsx +119 -0
- package/src/ui/hypothesis.tsx +94 -0
- package/src/ui/icon.tsx +80 -0
- package/src/ui/incident.tsx +130 -0
- package/src/ui/index.ts +342 -0
- package/src/ui/ins-del.tsx +41 -0
- package/src/ui/json.tsx +190 -0
- package/src/ui/layout.ts +9 -0
- package/src/ui/line-chart.tsx +251 -0
- package/src/ui/matrix.tsx +208 -0
- package/src/ui/meta.tsx +73 -0
- package/src/ui/option.tsx +64 -0
- package/src/ui/owner.tsx +40 -0
- package/src/ui/packages.tsx +104 -0
- package/src/ui/pathway.tsx +96 -0
- package/src/ui/phase.tsx +41 -0
- package/src/ui/pie-chart.tsx +170 -0
- package/src/ui/plan.tsx +77 -0
- package/src/ui/pre.tsx +175 -0
- package/src/ui/priority.tsx +51 -0
- package/src/ui/props.tsx +77 -0
- package/src/ui/quadrant.tsx +172 -0
- package/src/ui/radar.tsx +200 -0
- package/src/ui/ref.tsx +160 -0
- package/src/ui/release.tsx +178 -0
- package/src/ui/req.tsx +42 -0
- package/src/ui/review.tsx +133 -0
- package/src/ui/risk.tsx +67 -0
- package/src/ui/sankey.tsx +287 -0
- package/src/ui/scatter.tsx +237 -0
- package/src/ui/schema.tsx +113 -0
- package/src/ui/score.tsx +105 -0
- package/src/ui/search.tsx +120 -0
- package/src/ui/series.tsx +38 -0
- package/src/ui/severity.tsx +69 -0
- package/src/ui/shadcn.tsx +216 -0
- package/src/ui/spark.tsx +86 -0
- package/src/ui/stack.tsx +57 -0
- package/src/ui/stats.tsx +63 -0
- package/src/ui/status-badge.tsx +66 -0
- package/src/ui/statuspage.tsx +238 -0
- package/src/ui/steps.tsx +74 -0
- package/src/ui/summary.tsx +41 -0
- package/src/ui/symbol-ref.tsx +73 -0
- package/src/ui/terminal.tsx +117 -0
- package/src/ui/tests.tsx +218 -0
- package/src/ui/timeline.tsx +63 -0
- package/src/ui/toc.tsx +56 -0
- package/src/ui/tones.ts +187 -0
- package/src/ui/trace.tsx +69 -0
- package/src/ui/tree.tsx +281 -0
- package/src/ui/treemap.tsx +128 -0
- package/src/ui/venn.tsx +258 -0
- package/src/ui/verdict.tsx +78 -0
- package/src/ui/waterfall.tsx +142 -0
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import type { VariantProps } from "class-variance-authority";
|
|
7
|
+
import { cn } from "cn";
|
|
8
|
+
import { PanelLeftIcon } from "lucide-react";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
|
|
11
|
+
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
12
|
+
import { Button } from "./button.js";
|
|
13
|
+
import { Input } from "./input.js";
|
|
14
|
+
import { Separator } from "./separator.js";
|
|
15
|
+
import {
|
|
16
|
+
Sheet,
|
|
17
|
+
SheetContent,
|
|
18
|
+
SheetDescription,
|
|
19
|
+
SheetHeader,
|
|
20
|
+
SheetTitle,
|
|
21
|
+
} from "./sheet.js";
|
|
22
|
+
import { Skeleton } from "./skeleton.js";
|
|
23
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
24
|
+
|
|
25
|
+
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
26
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
27
|
+
const SIDEBAR_WIDTH = "16rem";
|
|
28
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
29
|
+
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
30
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
31
|
+
|
|
32
|
+
// `style` can't name `--*` custom properties in its type, so the mobile
|
|
33
|
+
// width goes through a string-keyed record instead.
|
|
34
|
+
const MOBILE_WIDTH_STYLE: Record<string, string> = {
|
|
35
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
interface SidebarContextProps {
|
|
39
|
+
state: "expanded" | "collapsed";
|
|
40
|
+
open: boolean;
|
|
41
|
+
setOpen: (open: boolean) => void;
|
|
42
|
+
openMobile: boolean;
|
|
43
|
+
setOpenMobile: (open: boolean) => void;
|
|
44
|
+
isMobile: boolean;
|
|
45
|
+
toggleSidebar: () => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const SidebarContext = React.createContext<SidebarContextProps | null>(null);
|
|
49
|
+
|
|
50
|
+
function useSidebar() {
|
|
51
|
+
const context = React.useContext(SidebarContext);
|
|
52
|
+
if (!context) {
|
|
53
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return context;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function SidebarProvider({
|
|
60
|
+
defaultOpen = true,
|
|
61
|
+
open: openProp,
|
|
62
|
+
onOpenChange: setOpenProp,
|
|
63
|
+
className,
|
|
64
|
+
style,
|
|
65
|
+
children,
|
|
66
|
+
...props
|
|
67
|
+
}: React.ComponentProps<"div"> & {
|
|
68
|
+
defaultOpen?: boolean;
|
|
69
|
+
open?: boolean;
|
|
70
|
+
onOpenChange?: (open: boolean) => void;
|
|
71
|
+
}) {
|
|
72
|
+
const isMobile = useIsMobile();
|
|
73
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
74
|
+
|
|
75
|
+
// This is the internal state of the sidebar.
|
|
76
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
77
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
78
|
+
const open = openProp ?? _open;
|
|
79
|
+
const setOpen = React.useCallback(
|
|
80
|
+
(value: boolean | ((value: boolean) => boolean)) => {
|
|
81
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
82
|
+
if (setOpenProp) {
|
|
83
|
+
setOpenProp(openState);
|
|
84
|
+
} else {
|
|
85
|
+
_setOpen(openState);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// This sets the cookie to keep the sidebar state.
|
|
89
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
90
|
+
},
|
|
91
|
+
[setOpenProp, open]
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
// Helper to toggle the sidebar.
|
|
95
|
+
const toggleSidebar = React.useCallback(() => {
|
|
96
|
+
isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
97
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
98
|
+
|
|
99
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
100
|
+
React.useEffect(() => {
|
|
101
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
102
|
+
if (
|
|
103
|
+
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
104
|
+
(event.metaKey || event.ctrlKey)
|
|
105
|
+
) {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
toggleSidebar();
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
112
|
+
return () => {
|
|
113
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
114
|
+
};
|
|
115
|
+
}, [toggleSidebar]);
|
|
116
|
+
|
|
117
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
118
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
119
|
+
const state = open ? "expanded" : "collapsed";
|
|
120
|
+
|
|
121
|
+
const contextValue = React.useMemo<SidebarContextProps>(
|
|
122
|
+
() => ({
|
|
123
|
+
isMobile,
|
|
124
|
+
open,
|
|
125
|
+
openMobile,
|
|
126
|
+
setOpen,
|
|
127
|
+
setOpenMobile,
|
|
128
|
+
state,
|
|
129
|
+
toggleSidebar,
|
|
130
|
+
}),
|
|
131
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<SidebarContext.Provider value={contextValue}>
|
|
136
|
+
<div
|
|
137
|
+
data-slot="sidebar-wrapper"
|
|
138
|
+
style={
|
|
139
|
+
{
|
|
140
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
141
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
142
|
+
...style,
|
|
143
|
+
} as React.CSSProperties
|
|
144
|
+
}
|
|
145
|
+
className={cn(
|
|
146
|
+
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
147
|
+
className
|
|
148
|
+
)}
|
|
149
|
+
{...props}
|
|
150
|
+
>
|
|
151
|
+
{children}
|
|
152
|
+
</div>
|
|
153
|
+
</SidebarContext.Provider>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function Sidebar({
|
|
158
|
+
side = "left",
|
|
159
|
+
variant = "sidebar",
|
|
160
|
+
collapsible = "offcanvas",
|
|
161
|
+
className,
|
|
162
|
+
children,
|
|
163
|
+
dir,
|
|
164
|
+
...props
|
|
165
|
+
}: React.ComponentProps<"div"> & {
|
|
166
|
+
side?: "left" | "right";
|
|
167
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
168
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
169
|
+
}) {
|
|
170
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
171
|
+
|
|
172
|
+
if (collapsible === "none") {
|
|
173
|
+
return (
|
|
174
|
+
<div
|
|
175
|
+
data-slot="sidebar"
|
|
176
|
+
className={cn(
|
|
177
|
+
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
178
|
+
className
|
|
179
|
+
)}
|
|
180
|
+
{...props}
|
|
181
|
+
>
|
|
182
|
+
{children}
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (isMobile) {
|
|
188
|
+
return (
|
|
189
|
+
<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
|
190
|
+
<SheetContent
|
|
191
|
+
dir={dir}
|
|
192
|
+
data-sidebar="sidebar"
|
|
193
|
+
data-slot="sidebar"
|
|
194
|
+
data-mobile="true"
|
|
195
|
+
className="bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden"
|
|
196
|
+
style={MOBILE_WIDTH_STYLE}
|
|
197
|
+
side={side}
|
|
198
|
+
>
|
|
199
|
+
<SheetHeader className="sr-only">
|
|
200
|
+
<SheetTitle>Sidebar</SheetTitle>
|
|
201
|
+
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
|
|
202
|
+
</SheetHeader>
|
|
203
|
+
<div className="flex h-full w-full flex-col">{children}</div>
|
|
204
|
+
</SheetContent>
|
|
205
|
+
</Sheet>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<div
|
|
211
|
+
className="group peer text-sidebar-foreground hidden md:block"
|
|
212
|
+
data-state={state}
|
|
213
|
+
data-collapsible={state === "collapsed" ? collapsible : ""}
|
|
214
|
+
data-variant={variant}
|
|
215
|
+
data-side={side}
|
|
216
|
+
data-slot="sidebar"
|
|
217
|
+
>
|
|
218
|
+
{/* This is what handles the sidebar gap on desktop */}
|
|
219
|
+
<div
|
|
220
|
+
data-slot="sidebar-gap"
|
|
221
|
+
className={cn(
|
|
222
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
223
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
224
|
+
"group-data-[side=right]:rotate-180",
|
|
225
|
+
variant === "floating" || variant === "inset"
|
|
226
|
+
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
|
|
227
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
228
|
+
)}
|
|
229
|
+
/>
|
|
230
|
+
<div
|
|
231
|
+
data-slot="sidebar-container"
|
|
232
|
+
data-side={side}
|
|
233
|
+
className={cn(
|
|
234
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
|
|
235
|
+
// Adjust the padding for floating and inset variants.
|
|
236
|
+
variant === "floating" || variant === "inset"
|
|
237
|
+
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
|
|
238
|
+
: "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
239
|
+
className
|
|
240
|
+
)}
|
|
241
|
+
{...props}
|
|
242
|
+
>
|
|
243
|
+
<div
|
|
244
|
+
data-sidebar="sidebar"
|
|
245
|
+
data-slot="sidebar-inner"
|
|
246
|
+
className="bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1"
|
|
247
|
+
>
|
|
248
|
+
{children}
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function SidebarTrigger({
|
|
256
|
+
className,
|
|
257
|
+
onClick,
|
|
258
|
+
...props
|
|
259
|
+
}: React.ComponentProps<typeof Button>) {
|
|
260
|
+
const { toggleSidebar } = useSidebar();
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<Button
|
|
264
|
+
data-sidebar="trigger"
|
|
265
|
+
data-slot="sidebar-trigger"
|
|
266
|
+
variant="ghost"
|
|
267
|
+
size="icon-sm"
|
|
268
|
+
className={cn(className)}
|
|
269
|
+
onClick={(event) => {
|
|
270
|
+
onClick?.(event);
|
|
271
|
+
toggleSidebar();
|
|
272
|
+
}}
|
|
273
|
+
{...props}
|
|
274
|
+
>
|
|
275
|
+
<PanelLeftIcon />
|
|
276
|
+
<span className="sr-only">Toggle Sidebar</span>
|
|
277
|
+
</Button>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
|
|
282
|
+
const { toggleSidebar } = useSidebar();
|
|
283
|
+
|
|
284
|
+
return (
|
|
285
|
+
<button
|
|
286
|
+
data-sidebar="rail"
|
|
287
|
+
data-slot="sidebar-rail"
|
|
288
|
+
aria-label="Toggle Sidebar"
|
|
289
|
+
tabIndex={-1}
|
|
290
|
+
onClick={toggleSidebar}
|
|
291
|
+
title="Toggle Sidebar"
|
|
292
|
+
className={cn(
|
|
293
|
+
"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
|
|
294
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
295
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
296
|
+
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
297
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
298
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
299
|
+
className
|
|
300
|
+
)}
|
|
301
|
+
{...props}
|
|
302
|
+
/>
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
|
|
307
|
+
return (
|
|
308
|
+
<main
|
|
309
|
+
data-slot="sidebar-inset"
|
|
310
|
+
className={cn(
|
|
311
|
+
"bg-background relative flex w-full flex-1 flex-col md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
312
|
+
className
|
|
313
|
+
)}
|
|
314
|
+
{...props}
|
|
315
|
+
/>
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function SidebarInput({
|
|
320
|
+
className,
|
|
321
|
+
...props
|
|
322
|
+
}: React.ComponentProps<typeof Input>) {
|
|
323
|
+
return (
|
|
324
|
+
<Input
|
|
325
|
+
data-slot="sidebar-input"
|
|
326
|
+
data-sidebar="input"
|
|
327
|
+
className={cn("bg-background h-8 w-full shadow-none", className)}
|
|
328
|
+
{...props}
|
|
329
|
+
/>
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
334
|
+
return (
|
|
335
|
+
<div
|
|
336
|
+
data-slot="sidebar-header"
|
|
337
|
+
data-sidebar="header"
|
|
338
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
339
|
+
{...props}
|
|
340
|
+
/>
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
345
|
+
return (
|
|
346
|
+
<div
|
|
347
|
+
data-slot="sidebar-footer"
|
|
348
|
+
data-sidebar="footer"
|
|
349
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
350
|
+
{...props}
|
|
351
|
+
/>
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function SidebarSeparator({
|
|
356
|
+
className,
|
|
357
|
+
...props
|
|
358
|
+
}: React.ComponentProps<typeof Separator>) {
|
|
359
|
+
return (
|
|
360
|
+
<Separator
|
|
361
|
+
data-slot="sidebar-separator"
|
|
362
|
+
data-sidebar="separator"
|
|
363
|
+
className={cn("bg-sidebar-border mx-2 w-auto", className)}
|
|
364
|
+
{...props}
|
|
365
|
+
/>
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
370
|
+
return (
|
|
371
|
+
<div
|
|
372
|
+
data-slot="sidebar-content"
|
|
373
|
+
data-sidebar="content"
|
|
374
|
+
className={cn(
|
|
375
|
+
"no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
376
|
+
className
|
|
377
|
+
)}
|
|
378
|
+
{...props}
|
|
379
|
+
/>
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
384
|
+
return (
|
|
385
|
+
<div
|
|
386
|
+
data-slot="sidebar-group"
|
|
387
|
+
data-sidebar="group"
|
|
388
|
+
className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
|
|
389
|
+
{...props}
|
|
390
|
+
/>
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function SidebarGroupLabel({
|
|
395
|
+
className,
|
|
396
|
+
render,
|
|
397
|
+
...props
|
|
398
|
+
}: useRender.ComponentProps<"div"> & React.ComponentProps<"div">) {
|
|
399
|
+
return useRender({
|
|
400
|
+
defaultTagName: "div",
|
|
401
|
+
props: mergeProps<"div">(
|
|
402
|
+
{
|
|
403
|
+
className: cn(
|
|
404
|
+
"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
405
|
+
className
|
|
406
|
+
),
|
|
407
|
+
},
|
|
408
|
+
props
|
|
409
|
+
),
|
|
410
|
+
render,
|
|
411
|
+
state: {
|
|
412
|
+
sidebar: "group-label",
|
|
413
|
+
slot: "sidebar-group-label",
|
|
414
|
+
},
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function SidebarGroupAction({
|
|
419
|
+
className,
|
|
420
|
+
render,
|
|
421
|
+
...props
|
|
422
|
+
}: useRender.ComponentProps<"button"> & React.ComponentProps<"button">) {
|
|
423
|
+
return useRender({
|
|
424
|
+
defaultTagName: "button",
|
|
425
|
+
props: mergeProps<"button">(
|
|
426
|
+
{
|
|
427
|
+
className: cn(
|
|
428
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
|
|
429
|
+
className
|
|
430
|
+
),
|
|
431
|
+
},
|
|
432
|
+
props
|
|
433
|
+
),
|
|
434
|
+
render,
|
|
435
|
+
state: {
|
|
436
|
+
sidebar: "group-action",
|
|
437
|
+
slot: "sidebar-group-action",
|
|
438
|
+
},
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function SidebarGroupContent({
|
|
443
|
+
className,
|
|
444
|
+
...props
|
|
445
|
+
}: React.ComponentProps<"div">) {
|
|
446
|
+
return (
|
|
447
|
+
<div
|
|
448
|
+
data-slot="sidebar-group-content"
|
|
449
|
+
data-sidebar="group-content"
|
|
450
|
+
className={cn("w-full text-sm", className)}
|
|
451
|
+
{...props}
|
|
452
|
+
/>
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
|
|
457
|
+
return (
|
|
458
|
+
<ul
|
|
459
|
+
data-slot="sidebar-menu"
|
|
460
|
+
data-sidebar="menu"
|
|
461
|
+
className={cn("flex w-full min-w-0 flex-col gap-0", className)}
|
|
462
|
+
{...props}
|
|
463
|
+
/>
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
468
|
+
return (
|
|
469
|
+
<li
|
|
470
|
+
data-slot="sidebar-menu-item"
|
|
471
|
+
data-sidebar="menu-item"
|
|
472
|
+
className={cn("group/menu-item relative", className)}
|
|
473
|
+
{...props}
|
|
474
|
+
/>
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
const sidebarMenuButtonVariants = cva(
|
|
479
|
+
"peer/menu-button group/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:font-medium [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
|
|
480
|
+
{
|
|
481
|
+
defaultVariants: {
|
|
482
|
+
size: "default",
|
|
483
|
+
variant: "default",
|
|
484
|
+
},
|
|
485
|
+
variants: {
|
|
486
|
+
size: {
|
|
487
|
+
default: "h-8 text-sm",
|
|
488
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
|
|
489
|
+
sm: "h-7 text-xs",
|
|
490
|
+
},
|
|
491
|
+
variant: {
|
|
492
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
493
|
+
outline:
|
|
494
|
+
"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
|
|
495
|
+
},
|
|
496
|
+
},
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
|
|
500
|
+
function SidebarMenuButton({
|
|
501
|
+
render,
|
|
502
|
+
isActive = false,
|
|
503
|
+
variant = "default",
|
|
504
|
+
size = "default",
|
|
505
|
+
tooltip,
|
|
506
|
+
className,
|
|
507
|
+
...props
|
|
508
|
+
}: useRender.ComponentProps<"button"> &
|
|
509
|
+
React.ComponentProps<"button"> & {
|
|
510
|
+
isActive?: boolean;
|
|
511
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
512
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>) {
|
|
513
|
+
const { isMobile, state } = useSidebar();
|
|
514
|
+
const comp = useRender({
|
|
515
|
+
defaultTagName: "button",
|
|
516
|
+
props: mergeProps<"button">(
|
|
517
|
+
{
|
|
518
|
+
className: cn(sidebarMenuButtonVariants({ size, variant }), className),
|
|
519
|
+
},
|
|
520
|
+
props
|
|
521
|
+
),
|
|
522
|
+
render: tooltip ? <TooltipTrigger render={render} /> : render,
|
|
523
|
+
state: {
|
|
524
|
+
active: isActive,
|
|
525
|
+
sidebar: "menu-button",
|
|
526
|
+
size,
|
|
527
|
+
slot: "sidebar-menu-button",
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
if (!tooltip) {
|
|
532
|
+
return comp;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
if (typeof tooltip === "string") {
|
|
536
|
+
tooltip = {
|
|
537
|
+
children: tooltip,
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return (
|
|
542
|
+
<Tooltip>
|
|
543
|
+
{comp}
|
|
544
|
+
<TooltipContent
|
|
545
|
+
side="right"
|
|
546
|
+
align="center"
|
|
547
|
+
hidden={state !== "collapsed" || isMobile}
|
|
548
|
+
{...tooltip}
|
|
549
|
+
/>
|
|
550
|
+
</Tooltip>
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
function SidebarMenuAction({
|
|
555
|
+
className,
|
|
556
|
+
render,
|
|
557
|
+
showOnHover = false,
|
|
558
|
+
...props
|
|
559
|
+
}: useRender.ComponentProps<"button"> &
|
|
560
|
+
React.ComponentProps<"button"> & {
|
|
561
|
+
showOnHover?: boolean;
|
|
562
|
+
}) {
|
|
563
|
+
return useRender({
|
|
564
|
+
defaultTagName: "button",
|
|
565
|
+
props: mergeProps<"button">(
|
|
566
|
+
{
|
|
567
|
+
className: cn(
|
|
568
|
+
"text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
|
|
569
|
+
showOnHover &&
|
|
570
|
+
"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",
|
|
571
|
+
className
|
|
572
|
+
),
|
|
573
|
+
},
|
|
574
|
+
props
|
|
575
|
+
),
|
|
576
|
+
render,
|
|
577
|
+
state: {
|
|
578
|
+
sidebar: "menu-action",
|
|
579
|
+
slot: "sidebar-menu-action",
|
|
580
|
+
},
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function SidebarMenuBadge({
|
|
585
|
+
className,
|
|
586
|
+
...props
|
|
587
|
+
}: React.ComponentProps<"div">) {
|
|
588
|
+
return (
|
|
589
|
+
<div
|
|
590
|
+
data-slot="sidebar-menu-badge"
|
|
591
|
+
data-sidebar="menu-badge"
|
|
592
|
+
className={cn(
|
|
593
|
+
"text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1",
|
|
594
|
+
className
|
|
595
|
+
)}
|
|
596
|
+
{...props}
|
|
597
|
+
/>
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
function SidebarMenuSkeleton({
|
|
602
|
+
className,
|
|
603
|
+
showIcon = false,
|
|
604
|
+
...props
|
|
605
|
+
}: React.ComponentProps<"div"> & {
|
|
606
|
+
showIcon?: boolean;
|
|
607
|
+
}) {
|
|
608
|
+
// Pseudo-random width between 50 to 90%, derived from useId so SSR and
|
|
609
|
+
// hydration compute the same value (Math.random would mismatch).
|
|
610
|
+
const id = React.useId();
|
|
611
|
+
const [width] = React.useState(() => {
|
|
612
|
+
let hash = 0;
|
|
613
|
+
for (const c of id) {
|
|
614
|
+
hash = (hash * 31 + c.charCodeAt(0)) | 0;
|
|
615
|
+
}
|
|
616
|
+
return `${(Math.abs(hash) % 40) + 50}%`;
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
return (
|
|
620
|
+
<div
|
|
621
|
+
data-slot="sidebar-menu-skeleton"
|
|
622
|
+
data-sidebar="menu-skeleton"
|
|
623
|
+
className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
|
|
624
|
+
{...props}
|
|
625
|
+
>
|
|
626
|
+
{showIcon && (
|
|
627
|
+
<Skeleton
|
|
628
|
+
className="size-4 rounded-md"
|
|
629
|
+
data-sidebar="menu-skeleton-icon"
|
|
630
|
+
/>
|
|
631
|
+
)}
|
|
632
|
+
<Skeleton
|
|
633
|
+
className="h-4 max-w-(--skeleton-width) flex-1"
|
|
634
|
+
data-sidebar="menu-skeleton-text"
|
|
635
|
+
style={
|
|
636
|
+
{
|
|
637
|
+
"--skeleton-width": width,
|
|
638
|
+
} as React.CSSProperties
|
|
639
|
+
}
|
|
640
|
+
/>
|
|
641
|
+
</div>
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
|
|
646
|
+
return (
|
|
647
|
+
<ul
|
|
648
|
+
data-slot="sidebar-menu-sub"
|
|
649
|
+
data-sidebar="menu-sub"
|
|
650
|
+
className={cn(
|
|
651
|
+
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
|
|
652
|
+
className
|
|
653
|
+
)}
|
|
654
|
+
{...props}
|
|
655
|
+
/>
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
function SidebarMenuSubItem({
|
|
660
|
+
className,
|
|
661
|
+
...props
|
|
662
|
+
}: React.ComponentProps<"li">) {
|
|
663
|
+
return (
|
|
664
|
+
<li
|
|
665
|
+
data-slot="sidebar-menu-sub-item"
|
|
666
|
+
data-sidebar="menu-sub-item"
|
|
667
|
+
className={cn("group/menu-sub-item relative", className)}
|
|
668
|
+
{...props}
|
|
669
|
+
/>
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
function SidebarMenuSubButton({
|
|
674
|
+
render,
|
|
675
|
+
size = "md",
|
|
676
|
+
isActive = false,
|
|
677
|
+
className,
|
|
678
|
+
...props
|
|
679
|
+
}: useRender.ComponentProps<"a"> &
|
|
680
|
+
React.ComponentProps<"a"> & {
|
|
681
|
+
size?: "sm" | "md";
|
|
682
|
+
isActive?: boolean;
|
|
683
|
+
}) {
|
|
684
|
+
return useRender({
|
|
685
|
+
defaultTagName: "a",
|
|
686
|
+
props: mergeProps<"a">(
|
|
687
|
+
{
|
|
688
|
+
className: cn(
|
|
689
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden group-data-[collapsible=icon]:hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
690
|
+
className
|
|
691
|
+
),
|
|
692
|
+
},
|
|
693
|
+
props
|
|
694
|
+
),
|
|
695
|
+
render,
|
|
696
|
+
state: {
|
|
697
|
+
active: isActive,
|
|
698
|
+
sidebar: "menu-sub-button",
|
|
699
|
+
size,
|
|
700
|
+
slot: "sidebar-menu-sub-button",
|
|
701
|
+
},
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
export {
|
|
706
|
+
Sidebar,
|
|
707
|
+
SidebarContent,
|
|
708
|
+
SidebarFooter,
|
|
709
|
+
SidebarGroup,
|
|
710
|
+
SidebarGroupAction,
|
|
711
|
+
SidebarGroupContent,
|
|
712
|
+
SidebarGroupLabel,
|
|
713
|
+
SidebarHeader,
|
|
714
|
+
SidebarInput,
|
|
715
|
+
SidebarInset,
|
|
716
|
+
SidebarMenu,
|
|
717
|
+
SidebarMenuAction,
|
|
718
|
+
SidebarMenuBadge,
|
|
719
|
+
SidebarMenuButton,
|
|
720
|
+
SidebarMenuItem,
|
|
721
|
+
SidebarMenuSkeleton,
|
|
722
|
+
SidebarMenuSub,
|
|
723
|
+
SidebarMenuSubButton,
|
|
724
|
+
SidebarMenuSubItem,
|
|
725
|
+
SidebarProvider,
|
|
726
|
+
SidebarRail,
|
|
727
|
+
SidebarSeparator,
|
|
728
|
+
SidebarTrigger,
|
|
729
|
+
useSidebar,
|
|
730
|
+
};
|