@health-samurai/react-components 0.0.0-alpha.1 → 0.0.0-alpha.3
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/dist/bundle.css +100 -7
- package/dist/src/components/code-editor/index.js +53 -29
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor.stories.js +22 -7
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/copy-icon.js +11 -4
- package/dist/src/components/copy-icon.js.map +1 -1
- package/dist/src/components/request-line-editor.js +56 -14
- package/dist/src/components/request-line-editor.js.map +1 -1
- package/dist/src/components/request-line-editor.stories.js +71 -22
- package/dist/src/components/request-line-editor.stories.js.map +1 -1
- package/dist/src/global.d.js +2 -0
- package/dist/src/global.d.js.map +1 -0
- package/dist/src/index.css +6 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +52 -50
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.stories.js +8 -5
- package/dist/src/index.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.js +34 -5
- package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.stories.js +68 -3
- package/dist/src/shadcn/components/ui/accordion.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.js +61 -14
- package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js +39 -4
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.js +24 -8
- package/dist/src/shadcn/components/ui/alert.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.stories.js +57 -3
- package/dist/src/shadcn/components/ui/alert.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.js +6 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.js.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.js +12 -3
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.js +17 -4
- package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.stories.js +69 -3
- package/dist/src/shadcn/components/ui/avatar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.js +13 -6
- package/dist/src/shadcn/components/ui/badge.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.stories.js +55 -3
- package/dist/src/shadcn/components/ui/badge.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.js +56 -11
- package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js +69 -4
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.js +23 -13
- package/dist/src/shadcn/components/ui/button.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.stories.js +190 -10
- package/dist/src/shadcn/components/ui/button.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.js +76 -33
- package/dist/src/shadcn/components/ui/calendar.js.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.stories.js +12 -5
- package/dist/src/shadcn/components/ui/calendar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.js +38 -9
- package/dist/src/shadcn/components/ui/card.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.stories.js +91 -6
- package/dist/src/shadcn/components/ui/card.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.js +99 -39
- package/dist/src/shadcn/components/ui/carousel.js.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.stories.js +30 -6
- package/dist/src/shadcn/components/ui/carousel.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/chart.js +119 -55
- package/dist/src/shadcn/components/ui/chart.js.map +1 -1
- package/dist/src/shadcn/components/ui/chart.stories.js +72 -12
- package/dist/src/shadcn/components/ui/chart.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.js +15 -2
- package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.js +79 -4
- package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/collapsible.js +13 -3
- package/dist/src/shadcn/components/ui/collapsible.js.map +1 -1
- package/dist/src/shadcn/components/ui/collapsible.stories.js +54 -6
- package/dist/src/shadcn/components/ui/collapsible.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.js +77 -12
- package/dist/src/shadcn/components/ui/command.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.stories.js +88 -4
- package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.js +107 -17
- package/dist/src/shadcn/components/ui/context-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.stories.js +101 -3
- package/dist/src/shadcn/components/ui/context-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.js +69 -12
- package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.stories.js +82 -6
- package/dist/src/shadcn/components/ui/dialog.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.js +62 -12
- package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.stories.js +154 -21
- package/dist/src/shadcn/components/ui/drawer.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js +107 -17
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js +119 -4
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/form.js +59 -18
- package/dist/src/shadcn/components/ui/form.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.stories.js +45 -11
- package/dist/src/shadcn/components/ui/form.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.js +21 -4
- package/dist/src/shadcn/components/ui/hover-card.js.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.stories.js +51 -5
- package/dist/src/shadcn/components/ui/hover-card.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.js +35 -7
- package/dist/src/shadcn/components/ui/input-otp.js.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.stories.js +35 -3
- package/dist/src/shadcn/components/ui/input-otp.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +59 -40
- package/dist/src/shadcn/components/ui/input.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.stories.js +391 -23
- package/dist/src/shadcn/components/ui/input.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/label.js +8 -2
- package/dist/src/shadcn/components/ui/label.js.map +1 -1
- package/dist/src/shadcn/components/ui/label.stories.js +18 -4
- package/dist/src/shadcn/components/ui/label.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.js +116 -19
- package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.stories.js +216 -3
- package/dist/src/shadcn/components/ui/menubar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/navigation-menu.js +62 -10
- package/dist/src/shadcn/components/ui/navigation-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/navigation-menu.stories.js +263 -11
- package/dist/src/shadcn/components/ui/navigation-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.js +73 -16
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.stories.js +41 -3
- package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/popover.js +24 -5
- package/dist/src/shadcn/components/ui/popover.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.stories.js +99 -6
- package/dist/src/shadcn/components/ui/popover.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.js +14 -2
- package/dist/src/shadcn/components/ui/progress.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.stories.js +12 -8
- package/dist/src/shadcn/components/ui/progress.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.js +20 -3
- package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.js +48 -4
- package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.js +22 -4
- package/dist/src/shadcn/components/ui/resizable.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.stories.js +49 -3
- package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.js +27 -5
- package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.stories.js +30 -5
- package/dist/src/shadcn/components/ui/scroll-area.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.js +98 -19
- package/dist/src/shadcn/components/ui/select.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.js +84 -5
- package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/separator.js +10 -2
- package/dist/src/shadcn/components/ui/separator.js.map +1 -1
- package/dist/src/shadcn/components/ui/separator.stories.js +43 -3
- package/dist/src/shadcn/components/ui/separator.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/sheet.js +69 -16
- package/dist/src/shadcn/components/ui/sheet.js.map +1 -1
- package/dist/src/shadcn/components/ui/sheet.stories.js +77 -6
- package/dist/src/shadcn/components/ui/sheet.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.js +305 -79
- package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.stories.js +321 -59
- package/dist/src/shadcn/components/ui/sidebar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.js +7 -2
- package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.stories.js +22 -3
- package/dist/src/shadcn/components/ui/skeleton.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/slider.js +41 -7
- package/dist/src/shadcn/components/ui/slider.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.stories.js +11 -3
- package/dist/src/shadcn/components/ui/slider.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.js +10 -4
- package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.js +14 -9
- package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/switch.js +12 -2
- package/dist/src/shadcn/components/ui/switch.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.stories.js +16 -4
- package/dist/src/shadcn/components/ui/switch.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.js +47 -10
- package/dist/src/shadcn/components/ui/table.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.stories.js +72 -11
- package/dist/src/shadcn/components/ui/table.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.d.ts +9 -5
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.js +76 -18
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts +6 -0
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js +221 -10
- package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.js +7 -2
- package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.stories.js +6 -3
- package/dist/src/shadcn/components/ui/textarea.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.js +29 -8
- package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.stories.js +30 -3
- package/dist/src/shadcn/components/ui/toggle-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.js +16 -7
- package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.stories.js +9 -3
- package/dist/src/shadcn/components/ui/toggle.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.js +27 -5
- package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.stories.js +20 -4
- package/dist/src/shadcn/components/ui/tooltip.stories.js.map +1 -1
- package/dist/src/shadcn/hooks/use-mobile.js +4 -3
- package/dist/src/shadcn/hooks/use-mobile.js.map +1 -1
- package/dist/src/shadcn/lib/utils.js +1 -0
- package/dist/src/shadcn/lib/utils.js.map +1 -1
- package/package.json +8 -4
- package/src/index.css +6 -0
- package/src/index.tsx +1 -0
- package/src/shadcn/components/ui/aspect-ratio.tsx +1 -0
- package/src/shadcn/components/ui/calendar.tsx +1 -0
- package/src/shadcn/components/ui/chart.tsx +1 -0
- package/src/shadcn/components/ui/checkbox.tsx +1 -0
- package/src/shadcn/components/ui/context-menu.tsx +1 -0
- package/src/shadcn/components/ui/drawer.tsx +1 -0
- package/src/shadcn/components/ui/form.tsx +1 -0
- package/src/shadcn/components/ui/hover-card.tsx +1 -0
- package/src/shadcn/components/ui/label.tsx +1 -0
- package/src/shadcn/components/ui/popover.tsx +1 -0
- package/src/shadcn/components/ui/radio-group.tsx +1 -0
- package/src/shadcn/components/ui/scroll-area.tsx +1 -0
- package/src/shadcn/components/ui/separator.tsx +1 -0
- package/src/shadcn/components/ui/sidebar.tsx +1 -0
- package/src/shadcn/components/ui/slider.tsx +1 -0
- package/src/shadcn/components/ui/switch.tsx +1 -0
- package/src/shadcn/components/ui/tabs.stories.tsx +57 -0
- package/src/shadcn/components/ui/tabs.tsx +77 -26
- package/src/shadcn/components/ui/tooltip.tsx +1 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
4
|
import { cva } from "class-variance-authority";
|
|
4
5
|
import { PanelLeftIcon } from "lucide-react";
|
|
5
6
|
import * as React from "react";
|
|
6
|
-
import { Button } from "
|
|
7
|
-
import { Input } from "
|
|
8
|
-
import { Separator } from "
|
|
9
|
-
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle
|
|
10
|
-
import { Skeleton } from "
|
|
11
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger
|
|
12
|
-
import { useIsMobile } from "
|
|
13
|
-
import { cn } from "
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
import { Input } from "./input.js";
|
|
9
|
+
import { Separator } from "./separator.js";
|
|
10
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.js";
|
|
11
|
+
import { Skeleton } from "./skeleton.js";
|
|
12
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
13
|
+
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
14
|
+
import { cn } from "../../lib/utils.js";
|
|
14
15
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
15
16
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
16
17
|
const SIDEBAR_WIDTH = "13.75rem";
|
|
17
18
|
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
18
19
|
const SIDEBAR_WIDTH_ICON = "3.125rem";
|
|
19
20
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
20
|
-
const SidebarContext = React.createContext(null);
|
|
21
|
+
const SidebarContext = /*#__PURE__*/ React.createContext(null);
|
|
21
22
|
function useSidebar() {
|
|
22
23
|
const context = React.useContext(SidebarContext);
|
|
23
24
|
if (!context) {
|
|
@@ -32,184 +33,409 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
32
33
|
// We use openProp and setOpenProp for control from outside the component.
|
|
33
34
|
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
34
35
|
const open = openProp ?? _open;
|
|
35
|
-
const setOpen = React.useCallback((value)
|
|
36
|
+
const setOpen = React.useCallback((value)=>{
|
|
36
37
|
const openState = typeof value === "function" ? value(open) : value;
|
|
37
38
|
if (setOpenProp) {
|
|
38
39
|
setOpenProp(openState);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
40
|
+
} else {
|
|
41
41
|
_setOpen(openState);
|
|
42
42
|
}
|
|
43
43
|
// This sets the cookie to keep the sidebar state.
|
|
44
44
|
// biome-ignore lint/suspicious/noDocumentCookie: FIXME: unchanged shadcn
|
|
45
45
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
46
|
-
}, [
|
|
46
|
+
}, [
|
|
47
|
+
setOpenProp,
|
|
48
|
+
open
|
|
49
|
+
]);
|
|
47
50
|
// Helper to toggle the sidebar.
|
|
48
51
|
// biome-ignore lint/correctness/useExhaustiveDependencies: FIXME: unchanged shadcn
|
|
49
|
-
const toggleSidebar = React.useCallback(()
|
|
50
|
-
return isMobile ? setOpenMobile((open)
|
|
51
|
-
}, [
|
|
52
|
+
const toggleSidebar = React.useCallback(()=>{
|
|
53
|
+
return isMobile ? setOpenMobile((open)=>!open) : setOpen((open)=>!open);
|
|
54
|
+
}, [
|
|
55
|
+
isMobile,
|
|
56
|
+
setOpen,
|
|
57
|
+
setOpenMobile
|
|
58
|
+
]);
|
|
52
59
|
// Adds a keyboard shortcut to toggle the sidebar.
|
|
53
|
-
React.useEffect(()
|
|
54
|
-
const handleKeyDown = (event)
|
|
55
|
-
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
56
|
-
(event.metaKey || event.ctrlKey)) {
|
|
60
|
+
React.useEffect(()=>{
|
|
61
|
+
const handleKeyDown = (event)=>{
|
|
62
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
57
63
|
event.preventDefault();
|
|
58
64
|
toggleSidebar();
|
|
59
65
|
}
|
|
60
66
|
};
|
|
61
67
|
window.addEventListener("keydown", handleKeyDown);
|
|
62
|
-
return ()
|
|
63
|
-
}, [
|
|
68
|
+
return ()=>window.removeEventListener("keydown", handleKeyDown);
|
|
69
|
+
}, [
|
|
70
|
+
toggleSidebar
|
|
71
|
+
]);
|
|
64
72
|
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
65
73
|
// This makes it easier to style the sidebar with Tailwind classes.
|
|
66
74
|
const state = open ? "expanded" : "collapsed";
|
|
67
75
|
// biome-ignore lint/correctness/useExhaustiveDependencies: FIXME: unchanged shadcn
|
|
68
|
-
const contextValue = React.useMemo(()
|
|
76
|
+
const contextValue = React.useMemo(()=>({
|
|
77
|
+
state,
|
|
78
|
+
open,
|
|
79
|
+
setOpen,
|
|
80
|
+
isMobile,
|
|
81
|
+
openMobile,
|
|
82
|
+
setOpenMobile,
|
|
83
|
+
toggleSidebar
|
|
84
|
+
}), [
|
|
69
85
|
state,
|
|
70
86
|
open,
|
|
71
87
|
setOpen,
|
|
72
88
|
isMobile,
|
|
73
89
|
openMobile,
|
|
74
90
|
setOpenMobile,
|
|
75
|
-
toggleSidebar
|
|
76
|
-
|
|
77
|
-
return
|
|
91
|
+
toggleSidebar
|
|
92
|
+
]);
|
|
93
|
+
return /*#__PURE__*/ _jsx(SidebarContext.Provider, {
|
|
94
|
+
value: contextValue,
|
|
95
|
+
children: /*#__PURE__*/ _jsx(TooltipProvider, {
|
|
96
|
+
delayDuration: 0,
|
|
97
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
98
|
+
"data-slot": "sidebar-wrapper",
|
|
99
|
+
style: {
|
|
78
100
|
"--sidebar-width": SIDEBAR_WIDTH,
|
|
79
101
|
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
80
|
-
...style
|
|
81
|
-
},
|
|
102
|
+
...style
|
|
103
|
+
},
|
|
104
|
+
className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full box-content", className),
|
|
105
|
+
...props,
|
|
106
|
+
children: children
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
});
|
|
82
110
|
}
|
|
83
111
|
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }) {
|
|
84
112
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
85
113
|
if (collapsible === "none") {
|
|
86
|
-
return
|
|
114
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
115
|
+
"data-slot": "sidebar",
|
|
116
|
+
className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
|
|
117
|
+
...props,
|
|
118
|
+
children: children
|
|
119
|
+
});
|
|
87
120
|
}
|
|
88
121
|
if (isMobile) {
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
122
|
+
return /*#__PURE__*/ _jsx(Sheet, {
|
|
123
|
+
open: openMobile,
|
|
124
|
+
onOpenChange: setOpenMobile,
|
|
125
|
+
...props,
|
|
126
|
+
children: /*#__PURE__*/ _jsxs(SheetContent, {
|
|
127
|
+
"data-sidebar": "sidebar",
|
|
128
|
+
"data-slot": "sidebar",
|
|
129
|
+
"data-mobile": "true",
|
|
130
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
131
|
+
style: {
|
|
132
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
133
|
+
},
|
|
134
|
+
side: side,
|
|
135
|
+
children: [
|
|
136
|
+
/*#__PURE__*/ _jsxs(SheetHeader, {
|
|
137
|
+
className: "sr-only",
|
|
138
|
+
children: [
|
|
139
|
+
/*#__PURE__*/ _jsx(SheetTitle, {
|
|
140
|
+
children: "Sidebar"
|
|
141
|
+
}),
|
|
142
|
+
/*#__PURE__*/ _jsx(SheetDescription, {
|
|
143
|
+
children: "Displays the mobile sidebar."
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
}),
|
|
147
|
+
/*#__PURE__*/ _jsx("div", {
|
|
148
|
+
className: "flex h-full w-full flex-col",
|
|
149
|
+
children: children
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
})
|
|
153
|
+
});
|
|
92
154
|
}
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
155
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
156
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
157
|
+
"data-state": state,
|
|
158
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
159
|
+
"data-variant": variant,
|
|
160
|
+
"data-side": side,
|
|
161
|
+
"data-slot": "sidebar",
|
|
162
|
+
children: [
|
|
163
|
+
/*#__PURE__*/ _jsx("div", {
|
|
164
|
+
"data-slot": "sidebar-gap",
|
|
165
|
+
className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-120 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
166
|
+
}),
|
|
167
|
+
/*#__PURE__*/ _jsx("div", {
|
|
168
|
+
"data-slot": "sidebar-container",
|
|
169
|
+
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-120 ease-linear md:flex box-content", side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", // Adjust the padding for floating and inset variants.
|
|
170
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
171
|
+
...props,
|
|
172
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
173
|
+
"data-sidebar": "sidebar",
|
|
174
|
+
"data-slot": "sidebar-inner",
|
|
175
|
+
className: "bg-bg-primary group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
176
|
+
children: children
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
102
181
|
}
|
|
103
182
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
104
183
|
const { toggleSidebar } = useSidebar();
|
|
105
|
-
return
|
|
184
|
+
return /*#__PURE__*/ _jsxs(Button, {
|
|
185
|
+
"data-sidebar": "trigger",
|
|
186
|
+
"data-slot": "sidebar-trigger",
|
|
187
|
+
variant: "ghost",
|
|
188
|
+
size: "small",
|
|
189
|
+
className: cn("size-7", className),
|
|
190
|
+
onClick: (event)=>{
|
|
106
191
|
onClick?.(event);
|
|
107
192
|
toggleSidebar();
|
|
108
|
-
},
|
|
193
|
+
},
|
|
194
|
+
...props,
|
|
195
|
+
children: [
|
|
196
|
+
/*#__PURE__*/ _jsx(PanelLeftIcon, {}),
|
|
197
|
+
/*#__PURE__*/ _jsx("span", {
|
|
198
|
+
className: "sr-only",
|
|
199
|
+
children: "Toggle Sidebar"
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
});
|
|
109
203
|
}
|
|
110
204
|
function SidebarRail({ className, ...props }) {
|
|
111
205
|
const { toggleSidebar } = useSidebar();
|
|
112
|
-
return
|
|
206
|
+
return /*#__PURE__*/ _jsx("button", {
|
|
207
|
+
"data-sidebar": "rail",
|
|
208
|
+
"data-slot": "sidebar-rail",
|
|
209
|
+
"aria-label": "Toggle Sidebar",
|
|
210
|
+
tabIndex: -1,
|
|
211
|
+
onClick: toggleSidebar,
|
|
212
|
+
title: "Toggle Sidebar",
|
|
213
|
+
className: cn("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className),
|
|
214
|
+
...props
|
|
215
|
+
});
|
|
113
216
|
}
|
|
114
217
|
function SidebarInset({ className, ...props }) {
|
|
115
|
-
return
|
|
218
|
+
return /*#__PURE__*/ _jsx("main", {
|
|
219
|
+
"data-slot": "sidebar-inset",
|
|
220
|
+
className: cn("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", "peer-has-data-[sidebar-mode=hover]:fixed peer-has-data-[sidebar-mode=hover]:h-full peer-has-data-[sidebar-mode=hover]:grow", "peer-has-data-[sidebar-mode=hover]:left-(--sidebar-width-icon)", className),
|
|
221
|
+
...props
|
|
222
|
+
});
|
|
116
223
|
}
|
|
117
224
|
function SidebarInput({ className, ...props }) {
|
|
118
|
-
return
|
|
225
|
+
return /*#__PURE__*/ _jsx(Input, {
|
|
226
|
+
"data-slot": "sidebar-input",
|
|
227
|
+
"data-sidebar": "input",
|
|
228
|
+
className: cn("bg-background h-8 w-full shadow-none", className),
|
|
229
|
+
...props
|
|
230
|
+
});
|
|
119
231
|
}
|
|
120
232
|
function SidebarHeader({ className, ...props }) {
|
|
121
|
-
return
|
|
233
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
234
|
+
"data-slot": "sidebar-header",
|
|
235
|
+
"data-sidebar": "header",
|
|
236
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
237
|
+
...props
|
|
238
|
+
});
|
|
122
239
|
}
|
|
123
240
|
function SidebarFooter({ className, ...props }) {
|
|
124
|
-
return
|
|
241
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
242
|
+
"data-slot": "sidebar-footer",
|
|
243
|
+
"data-sidebar": "footer",
|
|
244
|
+
className: cn("flex flex-col gap-2 p-2 pb-3", className),
|
|
245
|
+
...props
|
|
246
|
+
});
|
|
125
247
|
}
|
|
126
248
|
function SidebarSeparator({ className, ...props }) {
|
|
127
|
-
return
|
|
249
|
+
return /*#__PURE__*/ _jsx(Separator, {
|
|
250
|
+
"data-slot": "sidebar-separator",
|
|
251
|
+
"data-sidebar": "separator",
|
|
252
|
+
className: cn("border-border-secondary w-auto", className),
|
|
253
|
+
...props
|
|
254
|
+
});
|
|
128
255
|
}
|
|
129
256
|
function SidebarContent({ className, ...props }) {
|
|
130
|
-
return
|
|
257
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
258
|
+
"data-slot": "sidebar-content",
|
|
259
|
+
"data-sidebar": "content",
|
|
260
|
+
className: cn("flex min-h-0 flex-1 flex-col gap-1 p-2 pt-3 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
|
|
261
|
+
...props
|
|
262
|
+
});
|
|
131
263
|
}
|
|
132
264
|
function SidebarGroup({ className, ...props }) {
|
|
133
|
-
return
|
|
265
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
266
|
+
"data-slot": "sidebar-group",
|
|
267
|
+
"data-sidebar": "group",
|
|
268
|
+
className: cn("relative flex w-full min-w-0 flex-col", className),
|
|
269
|
+
...props
|
|
270
|
+
});
|
|
134
271
|
}
|
|
135
272
|
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
136
273
|
const Comp = asChild ? Slot : "div";
|
|
137
|
-
return
|
|
274
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
275
|
+
"data-slot": "sidebar-group-label",
|
|
276
|
+
"data-sidebar": "group-label",
|
|
277
|
+
className: cn("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 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", className),
|
|
278
|
+
...props
|
|
279
|
+
});
|
|
138
280
|
}
|
|
139
281
|
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
140
282
|
const Comp = asChild ? Slot : "button";
|
|
141
|
-
return
|
|
142
|
-
|
|
143
|
-
"
|
|
283
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
284
|
+
"data-slot": "sidebar-group-action",
|
|
285
|
+
"data-sidebar": "group-action",
|
|
286
|
+
className: cn("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 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", // Increases the hit area of the button on mobile.
|
|
287
|
+
"after:absolute after:-inset-2 md:after:hidden", "group-data-[collapsible=icon]:hidden", className),
|
|
288
|
+
...props
|
|
289
|
+
});
|
|
144
290
|
}
|
|
145
291
|
function SidebarGroupContent({ className, ...props }) {
|
|
146
|
-
return
|
|
292
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
293
|
+
"data-slot": "sidebar-group-content",
|
|
294
|
+
"data-sidebar": "group-content",
|
|
295
|
+
className: cn("w-full text-sm", className),
|
|
296
|
+
...props
|
|
297
|
+
});
|
|
147
298
|
}
|
|
148
299
|
function SidebarMenu({ className, ...props }) {
|
|
149
|
-
return
|
|
300
|
+
return /*#__PURE__*/ _jsx("ul", {
|
|
301
|
+
"data-slot": "sidebar-menu",
|
|
302
|
+
"data-sidebar": "menu",
|
|
303
|
+
className: cn("flex w-full min-w-0 flex-col gap-0.5", className),
|
|
304
|
+
...props
|
|
305
|
+
});
|
|
150
306
|
}
|
|
151
307
|
function SidebarMenuItem({ className, ...props }) {
|
|
152
|
-
return
|
|
308
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
309
|
+
"data-slot": "sidebar-menu-item",
|
|
310
|
+
"data-sidebar": "menu-item",
|
|
311
|
+
className: cn("group/menu-item relative", className),
|
|
312
|
+
...props
|
|
313
|
+
});
|
|
153
314
|
}
|
|
154
315
|
const sidebarMenuButtonVariants = cva(cn("typo-body text-text-secondary flex items-center gap-2 overflow-hidden rounded-lg py-2 px-[0.44rem] outline-hidden ", "ring-sidebar-ring transition-all focus-visible:ring-2 active:bg-bg-quaternary disabled:pointer-events-none", "disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50", "data-[active=true]:bg-bg-brand-secondary data-[active=true]:text-text-primary data-[state=open]:hover:bg-sidebar-accent", "data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:py-2! group-data-[collapsible=icon]:px-[0.44rem]!", "[&>span:last-child]:truncate [&>svg]:size-5 [&>svg]:shrink-0 hover:bg-bg-secondary hover:text-text-primary", "data-[active=true]:[&>svg]:text-text-brand-primary w-full"), {
|
|
155
316
|
variants: {
|
|
156
317
|
variant: {
|
|
157
318
|
default: "",
|
|
158
|
-
outline: "shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
319
|
+
outline: "shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
159
320
|
},
|
|
160
321
|
size: {
|
|
161
322
|
default: "",
|
|
162
323
|
sm: "",
|
|
163
|
-
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
164
|
-
}
|
|
324
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
325
|
+
}
|
|
165
326
|
},
|
|
166
327
|
defaultVariants: {
|
|
167
328
|
variant: "default",
|
|
168
|
-
size: "default"
|
|
169
|
-
}
|
|
329
|
+
size: "default"
|
|
330
|
+
}
|
|
170
331
|
});
|
|
171
332
|
function SidebarMenuButton({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
172
333
|
const Comp = asChild ? Slot : "button";
|
|
173
334
|
const { isMobile, state } = useSidebar();
|
|
174
|
-
const button =
|
|
335
|
+
const button = /*#__PURE__*/ _jsx(Comp, {
|
|
336
|
+
"data-slot": "sidebar-menu-button",
|
|
337
|
+
"data-sidebar": "menu-button",
|
|
338
|
+
"data-size": size,
|
|
339
|
+
"data-active": isActive,
|
|
340
|
+
className: cn(sidebarMenuButtonVariants({
|
|
341
|
+
variant,
|
|
342
|
+
size
|
|
343
|
+
}), className),
|
|
344
|
+
...props
|
|
345
|
+
});
|
|
175
346
|
if (!tooltip) {
|
|
176
347
|
return button;
|
|
177
348
|
}
|
|
178
349
|
if (typeof tooltip === "string") {
|
|
179
350
|
tooltip = {
|
|
180
|
-
children: tooltip
|
|
351
|
+
children: tooltip
|
|
181
352
|
};
|
|
182
353
|
}
|
|
183
|
-
return
|
|
354
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
355
|
+
children: [
|
|
356
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
357
|
+
asChild: true,
|
|
358
|
+
children: button
|
|
359
|
+
}),
|
|
360
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
361
|
+
side: "right",
|
|
362
|
+
align: "center",
|
|
363
|
+
hidden: state !== "collapsed" || isMobile,
|
|
364
|
+
...tooltip
|
|
365
|
+
})
|
|
366
|
+
]
|
|
367
|
+
});
|
|
184
368
|
}
|
|
185
369
|
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
186
370
|
const Comp = asChild ? Slot : "button";
|
|
187
|
-
return
|
|
188
|
-
|
|
189
|
-
"
|
|
190
|
-
|
|
371
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
372
|
+
"data-slot": "sidebar-menu-action",
|
|
373
|
+
"data-sidebar": "menu-action",
|
|
374
|
+
className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button: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 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", // Increases the hit area of the button on mobile.
|
|
375
|
+
"after:absolute after:-inset-2 md:after:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", showOnHover && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0", className),
|
|
376
|
+
...props
|
|
377
|
+
});
|
|
191
378
|
}
|
|
192
379
|
function SidebarMenuBadge({ className, ...props }) {
|
|
193
|
-
return
|
|
380
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
381
|
+
"data-slot": "sidebar-menu-badge",
|
|
382
|
+
"data-sidebar": "menu-badge",
|
|
383
|
+
className: cn("text-sidebar-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", "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", className),
|
|
384
|
+
...props
|
|
385
|
+
});
|
|
194
386
|
}
|
|
195
387
|
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
196
388
|
// Random width between 50 to 90%.
|
|
197
|
-
const width = React.useMemo(()
|
|
389
|
+
const width = React.useMemo(()=>{
|
|
198
390
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
199
391
|
}, []);
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
|
|
392
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
393
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
394
|
+
"data-sidebar": "menu-skeleton",
|
|
395
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
396
|
+
...props,
|
|
397
|
+
children: [
|
|
398
|
+
showIcon && /*#__PURE__*/ _jsx(Skeleton, {
|
|
399
|
+
className: "size-4 rounded-md",
|
|
400
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
401
|
+
}),
|
|
402
|
+
/*#__PURE__*/ _jsx(Skeleton, {
|
|
403
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
404
|
+
"data-sidebar": "menu-skeleton-text",
|
|
405
|
+
style: {
|
|
406
|
+
"--skeleton-width": width
|
|
407
|
+
}
|
|
408
|
+
})
|
|
409
|
+
]
|
|
410
|
+
});
|
|
203
411
|
}
|
|
204
412
|
function SidebarMenuSub({ className, ...props }) {
|
|
205
|
-
return
|
|
413
|
+
return /*#__PURE__*/ _jsx("ul", {
|
|
414
|
+
"data-slot": "sidebar-menu-sub",
|
|
415
|
+
"data-sidebar": "menu-sub",
|
|
416
|
+
className: cn("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", className),
|
|
417
|
+
...props
|
|
418
|
+
});
|
|
206
419
|
}
|
|
207
420
|
function SidebarMenuSubItem({ className, ...props }) {
|
|
208
|
-
return
|
|
421
|
+
return /*#__PURE__*/ _jsx("li", {
|
|
422
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
423
|
+
"data-sidebar": "menu-sub-item",
|
|
424
|
+
className: cn("group/menu-sub-item relative", className),
|
|
425
|
+
...props
|
|
426
|
+
});
|
|
209
427
|
}
|
|
210
428
|
function SidebarMenuSubButton({ asChild = false, size = "md", isActive = false, className, ...props }) {
|
|
211
429
|
const Comp = asChild ? Slot : "a";
|
|
212
|
-
return
|
|
430
|
+
return /*#__PURE__*/ _jsx(Comp, {
|
|
431
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
432
|
+
"data-sidebar": "menu-sub-button",
|
|
433
|
+
"data-size": size,
|
|
434
|
+
"data-active": isActive,
|
|
435
|
+
className: cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent 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 focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", size === "sm" && "text-xs", size === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", className),
|
|
436
|
+
...props
|
|
437
|
+
});
|
|
213
438
|
}
|
|
214
|
-
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar
|
|
439
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
440
|
+
|
|
215
441
|
//# sourceMappingURL=sidebar.js.map
|