@constructive-io/ui 0.4.1 → 0.6.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 +17 -22
- package/dist/components/alert-dialog.cjs +333 -0
- package/dist/components/alert-dialog.cjs.map +1 -0
- package/dist/components/alert-dialog.d.cts +32 -0
- package/dist/components/alert-dialog.d.ts +16 -15
- package/dist/components/alert-dialog.js +89 -102
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +119 -0
- package/dist/components/alert.cjs.map +1 -0
- package/dist/components/alert.d.cts +19 -0
- package/dist/components/alert.d.ts +10 -5
- package/dist/components/alert.js +62 -6
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-bar.cjs +367 -0
- package/dist/components/app-bar.cjs.map +1 -0
- package/dist/components/app-bar.d.cts +26 -0
- package/dist/components/app-bar.d.ts +26 -0
- package/dist/components/app-bar.js +344 -0
- package/dist/components/app-bar.js.map +1 -0
- package/dist/components/app-shell.cjs +1792 -0
- package/dist/components/app-shell.cjs.map +1 -0
- package/dist/components/app-shell.d.cts +106 -0
- package/dist/components/app-shell.d.ts +106 -0
- package/dist/components/app-shell.js +1771 -0
- package/dist/components/app-shell.js.map +1 -0
- package/dist/components/autocomplete.cjs +418 -0
- package/dist/components/autocomplete.cjs.map +1 -0
- package/dist/components/autocomplete.d.cts +28 -0
- package/dist/components/autocomplete.d.ts +15 -15
- package/dist/components/autocomplete.js +9 -30
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +51 -0
- package/dist/components/avatar.cjs.map +1 -0
- package/dist/components/avatar.d.cts +12 -0
- package/dist/components/avatar.d.ts +3 -4
- package/dist/components/avatar.js +11 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +66 -0
- package/dist/components/badge.cjs.map +1 -0
- package/dist/components/badge.d.cts +15 -0
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +118 -0
- package/dist/components/breadcrumb.cjs.map +1 -0
- package/dist/components/breadcrumb.d.cts +14 -0
- package/dist/components/breadcrumb.d.ts +9 -9
- package/dist/components/breadcrumb.js +19 -83
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.cjs +169 -0
- package/dist/components/button.cjs.map +1 -0
- package/dist/components/button.d.cts +20 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +105 -21
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +85 -0
- package/dist/components/calendar-rac.cjs.map +1 -0
- package/dist/components/calendar-rac.d.cts +13 -0
- package/dist/components/calendar-rac.d.ts +3 -3
- package/dist/components/card.cjs +99 -0
- package/dist/components/card.cjs.map +1 -0
- package/dist/components/card.d.cts +18 -0
- package/dist/components/card.d.ts +7 -8
- package/dist/components/card.js +23 -8
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox-group.cjs +18 -0
- package/dist/components/checkbox-group.cjs.map +1 -0
- package/dist/components/checkbox-group.d.cts +7 -0
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox.cjs +121 -0
- package/dist/components/checkbox.cjs.map +1 -0
- package/dist/components/checkbox.d.cts +8 -0
- package/dist/components/checkbox.d.ts +3 -3
- package/dist/components/checkbox.js +73 -41
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +127 -0
- package/dist/components/collapsible.cjs.map +1 -0
- package/dist/components/collapsible.d.cts +44 -0
- package/dist/components/collapsible.d.ts +8 -18
- package/dist/components/collapsible.js +7 -27
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +551 -0
- package/dist/components/combobox.cjs.map +1 -0
- package/dist/components/combobox.d.cts +43 -0
- package/dist/components/combobox.d.ts +17 -18
- package/dist/components/combobox.js +37 -48
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +236 -0
- package/dist/components/command.cjs.map +1 -0
- package/dist/components/command.d.cts +23 -0
- package/dist/components/command.d.ts +14 -15
- package/dist/components/command.js +5 -38
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +431 -0
- package/dist/components/dialog.cjs.map +1 -0
- package/dist/components/dialog.d.cts +30 -0
- package/dist/components/dialog.d.ts +13 -18
- package/dist/components/dialog.js +75 -119
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +121 -0
- package/dist/components/dock.cjs.map +1 -0
- package/dist/components/dock.d.cts +30 -0
- package/dist/components/dock.d.ts +1 -2
- package/dist/components/dock.js +7 -5
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +149 -0
- package/dist/components/drawer.cjs.map +1 -0
- package/dist/components/drawer.d.cts +15 -0
- package/dist/components/drawer.d.ts +10 -11
- package/dist/components/drawer.js +11 -40
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +292 -0
- package/dist/components/dropdown-menu.cjs.map +1 -0
- package/dist/components/dropdown-menu.d.cts +52 -0
- package/dist/components/dropdown-menu.d.ts +23 -21
- package/dist/components/dropdown-menu.js +67 -191
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +106 -0
- package/dist/components/empty.cjs.map +1 -0
- package/dist/components/empty.d.cts +15 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.js +99 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.cjs +295 -0
- package/dist/components/field.cjs.map +1 -0
- package/dist/components/field.d.cts +46 -0
- package/dist/components/field.d.ts +34 -39
- package/dist/components/field.js +220 -72
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +176 -0
- package/dist/components/flickering-grid.cjs.map +1 -0
- package/dist/components/flickering-grid.d.cts +15 -0
- package/dist/components/flickering-grid.js +25 -2
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +194 -0
- package/dist/components/flow-zoom-panel.cjs.map +1 -0
- package/dist/components/flow-zoom-panel.d.cts +12 -0
- package/dist/components/flow-zoom-panel.d.ts +12 -0
- package/dist/components/flow-zoom-panel.js +173 -0
- package/dist/components/flow-zoom-panel.js.map +1 -0
- package/dist/components/form-control.cjs +193 -0
- package/dist/components/form-control.cjs.map +1 -0
- package/dist/components/form-control.d.cts +14 -0
- package/dist/components/form-control.d.ts +1 -2
- package/dist/components/form-control.js +2 -4
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +208 -0
- package/dist/components/form.cjs.map +1 -0
- package/dist/components/form.d.cts +36 -0
- package/dist/components/form.d.ts +7 -8
- package/dist/components/input-group.cjs +184 -0
- package/dist/components/input-group.cjs.map +1 -0
- package/dist/components/input-group.d.cts +17 -0
- package/dist/components/input-group.d.ts +6 -7
- package/dist/components/input-group.js +3 -2
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.cjs +62 -0
- package/dist/components/input.cjs.map +1 -0
- package/dist/components/input.d.cts +10 -0
- package/dist/components/input.d.ts +1 -2
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/json-input.cjs +351 -0
- package/dist/components/json-input.cjs.map +1 -0
- package/dist/components/json-input.d.cts +25 -0
- package/dist/components/json-input.d.ts +3 -3
- package/dist/components/json-input.js +89 -112
- package/dist/components/json-input.js.map +1 -1
- package/dist/components/label.cjs +29 -0
- package/dist/components/label.cjs.map +1 -0
- package/dist/components/label.d.cts +10 -0
- package/dist/components/label.d.ts +1 -2
- package/dist/components/motion-grid.cjs +108 -0
- package/dist/components/motion-grid.cjs.map +1 -0
- package/dist/components/motion-grid.d.cts +19 -0
- package/dist/components/motion-grid.d.ts +1 -2
- package/dist/components/motion-grid.js +9 -4
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +796 -0
- package/dist/components/multi-select.cjs.map +1 -0
- package/dist/components/multi-select.d.cts +198 -0
- package/dist/components/multi-select.js +54 -162
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +19 -0
- package/dist/components/page-header.cjs.map +1 -0
- package/dist/components/page-header.d.cts +17 -0
- package/dist/components/page-header.d.ts +2 -2
- package/dist/components/pagination.cjs +295 -0
- package/dist/components/pagination.cjs.map +1 -0
- package/dist/components/pagination.d.cts +18 -0
- package/dist/components/pagination.d.ts +7 -8
- package/dist/components/pagination.js +152 -29
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.cjs +140 -0
- package/dist/components/popover.cjs.map +1 -0
- package/dist/components/popover.d.cts +39 -0
- package/dist/components/popover.d.ts +13 -9
- package/dist/components/popover.js +56 -132
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.cjs +109 -0
- package/dist/components/portal.cjs.map +1 -0
- package/dist/components/portal.d.cts +117 -0
- package/dist/components/portal.d.ts +16 -7
- package/dist/components/portal.js +13 -8
- package/dist/components/portal.js.map +1 -1
- package/dist/components/progress.cjs +31 -0
- package/dist/components/progress.cjs.map +1 -0
- package/dist/components/progress.d.cts +9 -0
- package/dist/components/progress.d.ts +1 -2
- package/dist/components/progress.js +1 -2
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +144 -0
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
- package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
- package/dist/components/progressive-blur-scroll-container.d.ts +2 -2
- package/dist/components/progressive-blur.cjs +70 -0
- package/dist/components/progressive-blur.cjs.map +1 -0
- package/dist/components/progressive-blur.d.cts +16 -0
- package/dist/components/progressive-blur.d.ts +2 -2
- package/dist/components/radio-group.cjs +52 -0
- package/dist/components/radio-group.cjs.map +1 -0
- package/dist/components/radio-group.d.cts +10 -0
- package/dist/components/radio-group.d.ts +3 -3
- package/dist/components/radio-group.js +21 -10
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +420 -0
- package/dist/components/record-picker.cjs.map +1 -0
- package/dist/components/record-picker.d.cts +16 -0
- package/dist/components/record-picker.d.ts +2 -2
- package/dist/components/record-picker.js +76 -43
- package/dist/components/record-picker.js.map +1 -1
- package/dist/components/resizable.cjs +76 -0
- package/dist/components/resizable.cjs.map +1 -0
- package/dist/components/resizable.d.cts +10 -0
- package/dist/components/resizable.d.ts +3 -4
- package/dist/components/responsive-diagram.cjs +67 -0
- package/dist/components/responsive-diagram.cjs.map +1 -0
- package/dist/components/responsive-diagram.d.cts +10 -0
- package/dist/components/responsive-diagram.d.ts +2 -2
- package/dist/components/scroll-area.cjs +92 -0
- package/dist/components/scroll-area.cjs.map +1 -0
- package/dist/components/scroll-area.d.cts +11 -0
- package/dist/components/scroll-area.d.ts +5 -6
- package/dist/components/select.cjs +329 -0
- package/dist/components/select.cjs.map +1 -0
- package/dist/components/select.d.cts +46 -0
- package/dist/components/select.d.ts +13 -14
- package/dist/components/select.js +76 -67
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +26 -0
- package/dist/components/separator.cjs.map +1 -0
- package/dist/components/separator.d.cts +10 -0
- package/dist/components/separator.d.ts +1 -2
- package/dist/components/sheet.cjs +489 -0
- package/dist/components/sheet.cjs.map +1 -0
- package/dist/components/sheet.d.cts +107 -0
- package/dist/components/sheet.d.ts +14 -19
- package/dist/components/sheet.js +119 -264
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.cjs +1300 -0
- package/dist/components/sidebar.cjs.map +1 -0
- package/dist/components/sidebar.d.cts +70 -0
- package/dist/components/sidebar.d.ts +32 -39
- package/dist/components/sidebar.js +401 -362
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.cjs +36 -0
- package/dist/components/skeleton.cjs.map +1 -0
- package/dist/components/skeleton.d.cts +10 -0
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +19 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/sonner.cjs +25 -0
- package/dist/components/sonner.cjs.map +1 -0
- package/dist/components/sonner.d.cts +10 -0
- package/dist/components/sonner.d.ts +2 -2
- package/dist/components/stack/index.cjs +1516 -0
- package/dist/components/stack/index.cjs.map +1 -0
- package/dist/components/stack/index.d.cts +672 -0
- package/dist/components/stack/index.d.ts +36 -38
- package/dist/components/stack/index.js +42 -31
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/stepper.cjs +314 -0
- package/dist/components/stepper.cjs.map +1 -0
- package/dist/components/stepper.d.cts +31 -0
- package/dist/components/stepper.d.ts +9 -8
- package/dist/components/stepper.js +22 -15
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +46 -0
- package/dist/components/switch.cjs.map +1 -0
- package/dist/components/switch.d.cts +7 -0
- package/dist/components/switch.d.ts +1 -2
- package/dist/components/switch.js +9 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +133 -0
- package/dist/components/table.cjs.map +1 -0
- package/dist/components/table.d.cts +22 -0
- package/dist/components/table.d.ts +19 -12
- package/dist/components/table.js +72 -13
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +53 -0
- package/dist/components/tabs.cjs.map +1 -0
- package/dist/components/tabs.d.cts +9 -0
- package/dist/components/tabs.d.ts +4 -5
- package/dist/components/tabs.js +2 -2
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +451 -0
- package/dist/components/tags.cjs.map +1 -0
- package/dist/components/tags.d.cts +40 -0
- package/dist/components/tags.d.ts +10 -10
- package/dist/components/tags.js +129 -154
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +56 -0
- package/dist/components/textarea.cjs.map +1 -0
- package/dist/components/textarea.d.cts +9 -0
- package/dist/components/textarea.d.ts +1 -2
- package/dist/components/toast/index.cjs +612 -0
- package/dist/components/toast/index.cjs.map +1 -0
- package/dist/components/toast/index.d.cts +52 -0
- package/dist/components/toast/index.js +90 -127
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/tooltip.cjs +92 -0
- package/dist/components/tooltip.cjs.map +1 -0
- package/dist/components/tooltip.d.cts +28 -0
- package/dist/components/tooltip.d.ts +5 -6
- package/dist/components/tooltip.js +23 -130
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +197 -0
- package/dist/components/unlink-button.cjs.map +1 -0
- package/dist/components/unlink-button.d.cts +14 -0
- package/dist/components/unlink-button.d.ts +2 -2
- package/dist/components/unlink-button.js +105 -21
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/index.cjs +2074 -2723
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +492 -904
- package/dist/index.d.ts +492 -904
- package/dist/index.js +1897 -2569
- package/dist/index.js.map +1 -1
- package/package.json +286 -45
- package/src/styles/globals.css +155 -203
- package/dist/components/org-chart/index.d.ts +0 -54
- package/dist/components/org-chart/index.js +0 -861
- package/dist/components/org-chart/index.js.map +0 -1
|
@@ -0,0 +1,1771 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React5 from 'react';
|
|
3
|
+
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
4
|
+
import { mergeProps } from '@base-ui/react/merge-props';
|
|
5
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
6
|
+
import { ChevronRightIcon, ChevronsUpDownIcon, PanelLeftIcon, X } from 'lucide-react';
|
|
7
|
+
import { clsx } from 'clsx';
|
|
8
|
+
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
10
|
+
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
11
|
+
import { cva } from 'class-variance-authority';
|
|
12
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
13
|
+
import { AnimatePresence, motion } from 'motion/react';
|
|
14
|
+
import { ModalPortalScope, useFloatingOverlayPortalProps, useRootPortalContainer } from '@constructive-io/ui/portal';
|
|
15
|
+
import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
|
|
16
|
+
import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
|
|
17
|
+
import { Collapsible as Collapsible$1 } from '@base-ui/react/collapsible';
|
|
18
|
+
import { Menu } from '@base-ui/react/menu';
|
|
19
|
+
|
|
20
|
+
function cn(...inputs) {
|
|
21
|
+
return twMerge(clsx(inputs));
|
|
22
|
+
}
|
|
23
|
+
function Breadcrumb({ ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
25
|
+
}
|
|
26
|
+
function BreadcrumbList({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
"ol",
|
|
29
|
+
{
|
|
30
|
+
"data-slot": "breadcrumb-list",
|
|
31
|
+
className: cn(
|
|
32
|
+
"text-muted-foreground/50 flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
33
|
+
className
|
|
34
|
+
),
|
|
35
|
+
...props
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex items-center gap-1.5", className), ...props });
|
|
41
|
+
}
|
|
42
|
+
function BreadcrumbLink({
|
|
43
|
+
asChild,
|
|
44
|
+
render,
|
|
45
|
+
className,
|
|
46
|
+
children,
|
|
47
|
+
...props
|
|
48
|
+
}) {
|
|
49
|
+
const childRender = render === void 0 && asChild && React5.isValidElement(children) ? children : void 0;
|
|
50
|
+
return useRender({
|
|
51
|
+
defaultTagName: "a",
|
|
52
|
+
props: mergeProps(
|
|
53
|
+
{
|
|
54
|
+
className: cn("text-muted-foreground/60 transition-colors hover:text-foreground", className),
|
|
55
|
+
children: childRender ? void 0 : children
|
|
56
|
+
},
|
|
57
|
+
props
|
|
58
|
+
),
|
|
59
|
+
render: render ?? childRender,
|
|
60
|
+
state: {
|
|
61
|
+
slot: "breadcrumb-link"
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
"span",
|
|
68
|
+
{
|
|
69
|
+
"data-slot": "breadcrumb-page",
|
|
70
|
+
role: "link",
|
|
71
|
+
"aria-disabled": "true",
|
|
72
|
+
"aria-current": "page",
|
|
73
|
+
className: cn("text-foreground font-normal", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className, ...props, children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, { size: 16 }) });
|
|
80
|
+
}
|
|
81
|
+
function Separator({ className, orientation = "horizontal", decorative: _decorative, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
Separator$1,
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "separator-root",
|
|
86
|
+
orientation,
|
|
87
|
+
className: cn("bg-border shrink-0", orientation === "horizontal" ? "h-px w-full" : "h-full w-px", className),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
var MOBILE_BREAKPOINT = 768;
|
|
93
|
+
function useIsMobile() {
|
|
94
|
+
const [isMobile, setIsMobile] = React5.useState(false);
|
|
95
|
+
React5.useEffect(() => {
|
|
96
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
97
|
+
const onChange = () => {
|
|
98
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
99
|
+
};
|
|
100
|
+
mql.addEventListener("change", onChange);
|
|
101
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
102
|
+
return () => mql.removeEventListener("change", onChange);
|
|
103
|
+
}, []);
|
|
104
|
+
return isMobile;
|
|
105
|
+
}
|
|
106
|
+
function composeRefs(...refs) {
|
|
107
|
+
return (node) => {
|
|
108
|
+
refs.forEach((ref) => {
|
|
109
|
+
if (typeof ref === "function") {
|
|
110
|
+
ref(node);
|
|
111
|
+
} else if (ref != null) {
|
|
112
|
+
ref.current = node;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function mergeProps2(slotProps, childProps) {
|
|
118
|
+
const overrideProps = { ...childProps };
|
|
119
|
+
for (const propName in childProps) {
|
|
120
|
+
if (propName === "ref") continue;
|
|
121
|
+
const slotPropValue = slotProps[propName];
|
|
122
|
+
const childPropValue = childProps[propName];
|
|
123
|
+
if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
124
|
+
overrideProps[propName] = (...args) => {
|
|
125
|
+
childPropValue(...args);
|
|
126
|
+
slotPropValue(...args);
|
|
127
|
+
};
|
|
128
|
+
} else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
|
|
129
|
+
overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
|
|
130
|
+
} else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
|
|
131
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return { ...slotProps, ...overrideProps };
|
|
135
|
+
}
|
|
136
|
+
function isSlottable(child) {
|
|
137
|
+
return React5.isValidElement(child);
|
|
138
|
+
}
|
|
139
|
+
var Slot = React5.forwardRef((props, forwardedRef) => {
|
|
140
|
+
const { children, ...slotProps } = props;
|
|
141
|
+
if (isSlottable(children)) {
|
|
142
|
+
const childProps = children.props;
|
|
143
|
+
const childRef = childProps.ref;
|
|
144
|
+
return React5.cloneElement(children, {
|
|
145
|
+
...mergeProps2(slotProps, childProps),
|
|
146
|
+
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (React5.Children.count(children) > 1) {
|
|
150
|
+
const childrenArray = React5.Children.toArray(children);
|
|
151
|
+
const slottableChild = childrenArray.find(
|
|
152
|
+
(child) => React5.isValidElement(child) && child.type === Slottable
|
|
153
|
+
);
|
|
154
|
+
if (slottableChild) {
|
|
155
|
+
const newElement = slottableChild.props.children;
|
|
156
|
+
if (isSlottable(newElement)) {
|
|
157
|
+
const newElementProps = newElement.props;
|
|
158
|
+
const newChildren = childrenArray.map((child) => {
|
|
159
|
+
if (child === slottableChild) {
|
|
160
|
+
return React5.Children.count(newElementProps.children) > 1 ? React5.Children.only(null) : newElementProps.children;
|
|
161
|
+
}
|
|
162
|
+
return child;
|
|
163
|
+
});
|
|
164
|
+
const childRef = newElementProps.ref;
|
|
165
|
+
return React5.cloneElement(newElement, {
|
|
166
|
+
...mergeProps2(slotProps, newElementProps),
|
|
167
|
+
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
|
|
168
|
+
children: newChildren
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
174
|
+
});
|
|
175
|
+
Slot.displayName = "Slot";
|
|
176
|
+
function Slottable({ children }) {
|
|
177
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
178
|
+
}
|
|
179
|
+
var buttonVariants = cva(
|
|
180
|
+
"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
181
|
+
{
|
|
182
|
+
defaultVariants: {
|
|
183
|
+
size: "default",
|
|
184
|
+
static: false,
|
|
185
|
+
variant: "default"
|
|
186
|
+
},
|
|
187
|
+
variants: {
|
|
188
|
+
static: {
|
|
189
|
+
false: "motion-safe:active:not-disabled:scale-[0.96]",
|
|
190
|
+
true: null
|
|
191
|
+
},
|
|
192
|
+
size: {
|
|
193
|
+
default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
194
|
+
icon: "size-10 pointer-coarse:size-11",
|
|
195
|
+
"icon-lg": "size-11",
|
|
196
|
+
"icon-sm": "size-8 pointer-coarse:size-11",
|
|
197
|
+
"icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
|
|
198
|
+
"icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4',
|
|
199
|
+
lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
|
|
200
|
+
sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
201
|
+
xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
|
|
202
|
+
xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*="size-"])]:size-3.5'
|
|
203
|
+
},
|
|
204
|
+
variant: {
|
|
205
|
+
default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
206
|
+
destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
207
|
+
"destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
|
|
208
|
+
ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
|
|
209
|
+
link: "border-transparent underline-offset-4 hover:underline",
|
|
210
|
+
outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
|
|
211
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
var Button = React5.forwardRef(
|
|
217
|
+
({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
|
|
218
|
+
const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
|
|
219
|
+
const Comp = asChild ? Slot : "button";
|
|
220
|
+
if (asChild) {
|
|
221
|
+
const SlottedComp = Comp;
|
|
222
|
+
return /* @__PURE__ */ jsx(
|
|
223
|
+
SlottedComp,
|
|
224
|
+
{
|
|
225
|
+
ref,
|
|
226
|
+
className: buttonClasses,
|
|
227
|
+
"data-slot": "button",
|
|
228
|
+
...props,
|
|
229
|
+
children
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
Button.displayName = "Button";
|
|
237
|
+
|
|
238
|
+
// src/lib/motion/motion-config.ts
|
|
239
|
+
var easings = {
|
|
240
|
+
/** Physical feel for exit animations */
|
|
241
|
+
physicalExit: [0.4, 0, 0.6, 1]
|
|
242
|
+
};
|
|
243
|
+
var durations = {
|
|
244
|
+
/** Quick transitions (tooltips, small elements) */
|
|
245
|
+
fast: 0.15,
|
|
246
|
+
/** Standard UI transitions (modals, panels) */
|
|
247
|
+
normal: 0.2};
|
|
248
|
+
function useControllableState({
|
|
249
|
+
prop,
|
|
250
|
+
defaultProp,
|
|
251
|
+
onChange
|
|
252
|
+
}) {
|
|
253
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultProp);
|
|
254
|
+
const isControlled = prop !== void 0;
|
|
255
|
+
const value = isControlled ? prop : uncontrolledValue;
|
|
256
|
+
const onChangeRef = useRef(onChange);
|
|
257
|
+
useEffect(() => {
|
|
258
|
+
onChangeRef.current = onChange;
|
|
259
|
+
}, [onChange]);
|
|
260
|
+
const setValue = useCallback(
|
|
261
|
+
(newValue) => {
|
|
262
|
+
if (!isControlled) {
|
|
263
|
+
setUncontrolledValue(newValue);
|
|
264
|
+
}
|
|
265
|
+
onChangeRef.current?.(newValue);
|
|
266
|
+
},
|
|
267
|
+
[isControlled]
|
|
268
|
+
);
|
|
269
|
+
return [value, setValue];
|
|
270
|
+
}
|
|
271
|
+
var SheetStackContext = React5.createContext(void 0);
|
|
272
|
+
var SHEET_INDENT = 24;
|
|
273
|
+
var useSheetStack = () => {
|
|
274
|
+
return React5.useContext(SheetStackContext);
|
|
275
|
+
};
|
|
276
|
+
var SheetNestingContext = React5.createContext({
|
|
277
|
+
level: 0,
|
|
278
|
+
parentSheetId: null
|
|
279
|
+
});
|
|
280
|
+
var useSheetNesting = () => React5.useContext(SheetNestingContext);
|
|
281
|
+
var SheetContext = React5.createContext(void 0);
|
|
282
|
+
var useSheet = () => {
|
|
283
|
+
const context = React5.useContext(SheetContext);
|
|
284
|
+
if (!context) {
|
|
285
|
+
throw new Error("useSheet must be used within a Sheet");
|
|
286
|
+
}
|
|
287
|
+
return context;
|
|
288
|
+
};
|
|
289
|
+
function Sheet({
|
|
290
|
+
children,
|
|
291
|
+
sheetId: providedId,
|
|
292
|
+
open: openProp,
|
|
293
|
+
defaultOpen = false,
|
|
294
|
+
onOpenChange,
|
|
295
|
+
modal,
|
|
296
|
+
...props
|
|
297
|
+
}) {
|
|
298
|
+
const [isOpen, setIsOpen] = useControllableState({
|
|
299
|
+
prop: openProp,
|
|
300
|
+
defaultProp: defaultOpen,
|
|
301
|
+
onChange: onOpenChange
|
|
302
|
+
});
|
|
303
|
+
const sheetStack = useSheetStack();
|
|
304
|
+
const nesting = useSheetNesting();
|
|
305
|
+
const generatedId = React5.useId();
|
|
306
|
+
const sheetId = providedId ?? `sheet-${generatedId.replace(/:/g, "")}`;
|
|
307
|
+
const depth = nesting.level;
|
|
308
|
+
const close = React5.useCallback(() => {
|
|
309
|
+
setIsOpen(false);
|
|
310
|
+
}, [setIsOpen]);
|
|
311
|
+
const registerSheet = sheetStack?.registerSheet;
|
|
312
|
+
const unregisterSheet = sheetStack?.unregisterSheet;
|
|
313
|
+
React5.useEffect(() => {
|
|
314
|
+
if (registerSheet && isOpen) {
|
|
315
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
316
|
+
document.activeElement.blur();
|
|
317
|
+
}
|
|
318
|
+
registerSheet({ id: sheetId, depth, close });
|
|
319
|
+
return () => unregisterSheet?.(sheetId);
|
|
320
|
+
}
|
|
321
|
+
}, [isOpen, sheetId, depth, close, registerSheet, unregisterSheet]);
|
|
322
|
+
const handleOpenChange = React5.useCallback((open, _eventDetails) => {
|
|
323
|
+
setIsOpen(open);
|
|
324
|
+
}, [setIsOpen]);
|
|
325
|
+
const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
|
|
326
|
+
const isTopSheet = sheetStack?.isTopSheet(sheetId) ?? true;
|
|
327
|
+
const isNested = depth > 0;
|
|
328
|
+
return /* @__PURE__ */ jsx(SheetNestingContext.Provider, { value: { level: depth + 1, parentSheetId: sheetId }, children: /* @__PURE__ */ jsx(SheetContext.Provider, { value: { isOpen, sheetId, depth, sheetsAbove, isTopSheet, close }, children: /* @__PURE__ */ jsx(
|
|
329
|
+
Dialog.Root,
|
|
330
|
+
{
|
|
331
|
+
"data-slot": "sheet",
|
|
332
|
+
...props,
|
|
333
|
+
open: isOpen,
|
|
334
|
+
modal: isNested ? false : modal,
|
|
335
|
+
onOpenChange: handleOpenChange,
|
|
336
|
+
children
|
|
337
|
+
}
|
|
338
|
+
) }) });
|
|
339
|
+
}
|
|
340
|
+
function SheetPortal({ forceMount: _forceMount, container: containerProp, ...props }) {
|
|
341
|
+
const rootContainer = useRootPortalContainer();
|
|
342
|
+
const container = containerProp === void 0 ? rootContainer ?? void 0 : containerProp;
|
|
343
|
+
const style = {
|
|
344
|
+
...props.style ?? {},
|
|
345
|
+
["--z-layer-floating"]: "var(--z-layer-floating-elevated)"
|
|
346
|
+
};
|
|
347
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, { "data-slot": "sheet-portal", container, ...props, style });
|
|
348
|
+
}
|
|
349
|
+
var sheetVariants = cva("fixed flex flex-col gap-3 bg-background p-4 shadow-lg", {
|
|
350
|
+
variants: {
|
|
351
|
+
side: {
|
|
352
|
+
top: "inset-x-0 top-0 border-b",
|
|
353
|
+
bottom: "inset-x-0 bottom-0 border-t",
|
|
354
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
355
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
defaultVariants: {
|
|
359
|
+
side: "right"
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
var NESTED_SHEET_WIDTH = 448;
|
|
363
|
+
var SHEET_STACK_GAP = 0;
|
|
364
|
+
function getPushOffset(side, sheetsAbove, stackMode = "cascade", collapseBaseSize = NESTED_SHEET_WIDTH) {
|
|
365
|
+
if (sheetsAbove === 0) {
|
|
366
|
+
return { x: 0, y: 0 };
|
|
367
|
+
}
|
|
368
|
+
if (stackMode === "collapse") {
|
|
369
|
+
const baseOffset = collapseBaseSize + SHEET_STACK_GAP;
|
|
370
|
+
const offset2 = baseOffset + (sheetsAbove - 1) * SHEET_INDENT;
|
|
371
|
+
switch (side) {
|
|
372
|
+
case "right":
|
|
373
|
+
return { x: -offset2 };
|
|
374
|
+
case "left":
|
|
375
|
+
return { x: offset2 };
|
|
376
|
+
case "top":
|
|
377
|
+
return { y: offset2 };
|
|
378
|
+
case "bottom":
|
|
379
|
+
return { y: -offset2 };
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const offset = sheetsAbove * SHEET_INDENT;
|
|
383
|
+
switch (side) {
|
|
384
|
+
case "right":
|
|
385
|
+
return { x: -offset };
|
|
386
|
+
case "left":
|
|
387
|
+
return { x: offset };
|
|
388
|
+
case "top":
|
|
389
|
+
return { y: offset };
|
|
390
|
+
case "bottom":
|
|
391
|
+
return { y: -offset };
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
function getInitialPosition(side) {
|
|
395
|
+
switch (side) {
|
|
396
|
+
case "right":
|
|
397
|
+
return { x: "100%" };
|
|
398
|
+
case "left":
|
|
399
|
+
return { x: "-100%" };
|
|
400
|
+
case "top":
|
|
401
|
+
return { y: "-100%" };
|
|
402
|
+
case "bottom":
|
|
403
|
+
return { y: "100%" };
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function getExitPosition(side) {
|
|
407
|
+
switch (side) {
|
|
408
|
+
case "right":
|
|
409
|
+
return { x: "100%" };
|
|
410
|
+
case "left":
|
|
411
|
+
return { x: "-100%" };
|
|
412
|
+
case "top":
|
|
413
|
+
return { y: "-100%" };
|
|
414
|
+
case "bottom":
|
|
415
|
+
return { y: "100%" };
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
var defaultSheetTransition = {
|
|
419
|
+
type: "tween",
|
|
420
|
+
duration: durations.normal,
|
|
421
|
+
ease: [0.32, 0.72, 0, 1]
|
|
422
|
+
// Custom ease-out for snappy feel
|
|
423
|
+
};
|
|
424
|
+
function SheetContent({
|
|
425
|
+
side = "right",
|
|
426
|
+
className,
|
|
427
|
+
transition = defaultSheetTransition,
|
|
428
|
+
overlay = true,
|
|
429
|
+
showClose = true,
|
|
430
|
+
children,
|
|
431
|
+
forceMount: _forceMount,
|
|
432
|
+
onInteractOutside: _onInteractOutside,
|
|
433
|
+
onPointerDownOutside: _onPointerDownOutside,
|
|
434
|
+
onEscapeKeyDown: _onEscapeKeyDown,
|
|
435
|
+
onFocusOutside: _onFocusOutside,
|
|
436
|
+
...props
|
|
437
|
+
}) {
|
|
438
|
+
const { isOpen, depth, sheetId } = useSheet();
|
|
439
|
+
const sheetStack = useSheetStack();
|
|
440
|
+
const sheetsAbove = sheetStack?.getSheetsAbove(sheetId) ?? 0;
|
|
441
|
+
const stackMode = sheetStack?.stackMode ?? "cascade";
|
|
442
|
+
const resolvedSide = side ?? "right";
|
|
443
|
+
const zIndex = `calc(var(--z-layer-modal-content) + ${depth * 10})`;
|
|
444
|
+
const topSheetId = sheetStack?.sheets[sheetStack.sheets.length - 1]?.id;
|
|
445
|
+
const topSheetSize = topSheetId ? sheetStack?.getSheetSize(topSheetId) : void 0;
|
|
446
|
+
const collapseBaseSize = topSheetSize ? resolvedSide === "left" || resolvedSide === "right" ? topSheetSize.width : topSheetSize.height : void 0;
|
|
447
|
+
const pushOffset = getPushOffset(resolvedSide, sheetsAbove, stackMode, collapseBaseSize ?? NESTED_SHEET_WIDTH);
|
|
448
|
+
const contentRef = React5.useRef(null);
|
|
449
|
+
React5.useLayoutEffect(() => {
|
|
450
|
+
if (!isOpen) return;
|
|
451
|
+
if (!sheetStack) return;
|
|
452
|
+
const el = contentRef.current;
|
|
453
|
+
if (!el) return;
|
|
454
|
+
let rafId = 0;
|
|
455
|
+
const update = () => {
|
|
456
|
+
const rect = el.getBoundingClientRect();
|
|
457
|
+
sheetStack.setSheetSize(sheetId, { width: rect.width, height: rect.height });
|
|
458
|
+
};
|
|
459
|
+
update();
|
|
460
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
461
|
+
const ro = new ResizeObserver(() => {
|
|
462
|
+
cancelAnimationFrame(rafId);
|
|
463
|
+
rafId = requestAnimationFrame(update);
|
|
464
|
+
});
|
|
465
|
+
ro.observe(el);
|
|
466
|
+
return () => {
|
|
467
|
+
cancelAnimationFrame(rafId);
|
|
468
|
+
ro.disconnect();
|
|
469
|
+
};
|
|
470
|
+
}, [isOpen, sheetId, sheetStack]);
|
|
471
|
+
const animatePosition = {
|
|
472
|
+
x: pushOffset.x ?? 0,
|
|
473
|
+
y: pushOffset.y ?? 0
|
|
474
|
+
};
|
|
475
|
+
const exitTransition = {
|
|
476
|
+
type: "tween",
|
|
477
|
+
duration: durations.normal,
|
|
478
|
+
ease: easings.physicalExit
|
|
479
|
+
};
|
|
480
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsxs(SheetPortal, { "data-slot": "sheet-portal", children: [
|
|
481
|
+
overlay && depth === 0 && /* @__PURE__ */ jsx(
|
|
482
|
+
Dialog.Backdrop,
|
|
483
|
+
{
|
|
484
|
+
"data-slot": "sheet-overlay",
|
|
485
|
+
render: /* @__PURE__ */ jsx(
|
|
486
|
+
motion.div,
|
|
487
|
+
{
|
|
488
|
+
className: "fixed inset-0 bg-black/80",
|
|
489
|
+
initial: { opacity: 0 },
|
|
490
|
+
animate: { opacity: 1 },
|
|
491
|
+
exit: { opacity: 0 },
|
|
492
|
+
transition: { duration: durations.fast, ease: "easeOut" },
|
|
493
|
+
style: { zIndex: "var(--z-layer-modal-backdrop)" }
|
|
494
|
+
},
|
|
495
|
+
"sheet-overlay"
|
|
496
|
+
)
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
/* @__PURE__ */ jsxs(
|
|
500
|
+
Dialog.Popup,
|
|
501
|
+
{
|
|
502
|
+
"data-slot": "sheet-content",
|
|
503
|
+
"data-sheet-depth": depth,
|
|
504
|
+
"data-sheet-id": sheetId,
|
|
505
|
+
...props,
|
|
506
|
+
render: /* @__PURE__ */ jsx(
|
|
507
|
+
motion.div,
|
|
508
|
+
{
|
|
509
|
+
ref: contentRef,
|
|
510
|
+
variants: {
|
|
511
|
+
initial: getInitialPosition(resolvedSide),
|
|
512
|
+
animate: animatePosition,
|
|
513
|
+
exit: {
|
|
514
|
+
...getExitPosition(resolvedSide),
|
|
515
|
+
transition: exitTransition
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
initial: "initial",
|
|
519
|
+
animate: "animate",
|
|
520
|
+
exit: "exit",
|
|
521
|
+
transition,
|
|
522
|
+
style: { zIndex },
|
|
523
|
+
className: cn(sheetVariants({ side: resolvedSide }), className)
|
|
524
|
+
},
|
|
525
|
+
`sheet-content-${sheetId}`
|
|
526
|
+
),
|
|
527
|
+
children: [
|
|
528
|
+
/* @__PURE__ */ jsx(ModalPortalScope, { children }),
|
|
529
|
+
showClose && /* @__PURE__ */ jsxs(
|
|
530
|
+
Dialog.Close,
|
|
531
|
+
{
|
|
532
|
+
"data-slot": "sheet-close",
|
|
533
|
+
className: "ring-offset-background focus:ring-ring data-[open]:bg-secondary absolute top-4 right-4\n rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2\n focus:outline-none disabled:pointer-events-none",
|
|
534
|
+
children: [
|
|
535
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
536
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
537
|
+
]
|
|
538
|
+
}
|
|
539
|
+
)
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
)
|
|
543
|
+
] }) });
|
|
544
|
+
}
|
|
545
|
+
function SheetHeader({ className, ...props }) {
|
|
546
|
+
return /* @__PURE__ */ jsx(
|
|
547
|
+
"div",
|
|
548
|
+
{
|
|
549
|
+
"data-slot": "sheet-header",
|
|
550
|
+
className: cn("flex flex-col space-y-2 pb-4 text-center sm:text-left", className),
|
|
551
|
+
...props
|
|
552
|
+
}
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
function SheetTitle({ className, ...props }) {
|
|
556
|
+
return /* @__PURE__ */ jsx(
|
|
557
|
+
Dialog.Title,
|
|
558
|
+
{
|
|
559
|
+
"data-slot": "sheet-title",
|
|
560
|
+
className: cn("text-foreground text-lg font-semibold", className),
|
|
561
|
+
...props
|
|
562
|
+
}
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
function SheetDescription({ className, ...props }) {
|
|
566
|
+
return /* @__PURE__ */ jsx(
|
|
567
|
+
Dialog.Description,
|
|
568
|
+
{
|
|
569
|
+
"data-slot": "sheet-description",
|
|
570
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
571
|
+
...props
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
function TooltipProvider({ delay = 0, delayDuration, ...props }) {
|
|
576
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Provider, { "data-slot": "tooltip-provider", delay: delayDuration ?? delay, ...props });
|
|
577
|
+
}
|
|
578
|
+
function Tooltip({ delayDuration: _delayDuration, ...props }) {
|
|
579
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Root, { "data-slot": "tooltip", ...props });
|
|
580
|
+
}
|
|
581
|
+
function TooltipTrigger({ delay = 0, asChild, children, render, ...props }) {
|
|
582
|
+
const childRender = render === void 0 && asChild && React5.isValidElement(children) ? children : void 0;
|
|
583
|
+
return /* @__PURE__ */ jsx(
|
|
584
|
+
Tooltip$1.Trigger,
|
|
585
|
+
{
|
|
586
|
+
"data-slot": "tooltip-trigger",
|
|
587
|
+
delay,
|
|
588
|
+
render: render ?? childRender,
|
|
589
|
+
...props,
|
|
590
|
+
children: childRender ? void 0 : children
|
|
591
|
+
}
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
function TooltipContent({
|
|
595
|
+
className,
|
|
596
|
+
sideOffset = 4,
|
|
597
|
+
showArrow = false,
|
|
598
|
+
side = "top",
|
|
599
|
+
align = "center",
|
|
600
|
+
children,
|
|
601
|
+
...props
|
|
602
|
+
}) {
|
|
603
|
+
const { container, zIndexClass } = useFloatingOverlayPortalProps();
|
|
604
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { container, children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, { side, align, sideOffset, className: zIndexClass, children: /* @__PURE__ */ jsxs(
|
|
605
|
+
Tooltip$1.Popup,
|
|
606
|
+
{
|
|
607
|
+
"data-slot": "tooltip-content",
|
|
608
|
+
className: cn(
|
|
609
|
+
`bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1
|
|
610
|
+
text-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
|
|
611
|
+
data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
|
|
612
|
+
data-[side=bottom]:data-starting-style:-translate-y-2
|
|
613
|
+
data-[side=left]:data-starting-style:translate-x-2
|
|
614
|
+
data-[side=right]:data-starting-style:-translate-x-2
|
|
615
|
+
data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
|
|
616
|
+
className
|
|
617
|
+
),
|
|
618
|
+
...props,
|
|
619
|
+
role: "tooltip",
|
|
620
|
+
children: [
|
|
621
|
+
children,
|
|
622
|
+
showArrow && /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
) }) });
|
|
626
|
+
}
|
|
627
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
628
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
629
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
630
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
631
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
632
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
633
|
+
var SidebarContext = React5.createContext(null);
|
|
634
|
+
function useSidebar() {
|
|
635
|
+
const context = React5.useContext(SidebarContext);
|
|
636
|
+
if (!context) {
|
|
637
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
638
|
+
}
|
|
639
|
+
return context;
|
|
640
|
+
}
|
|
641
|
+
function SidebarProvider({
|
|
642
|
+
defaultOpen = true,
|
|
643
|
+
open: openProp,
|
|
644
|
+
onOpenChange: setOpenProp,
|
|
645
|
+
className,
|
|
646
|
+
style,
|
|
647
|
+
children,
|
|
648
|
+
...props
|
|
649
|
+
}) {
|
|
650
|
+
const isMobile = useIsMobile();
|
|
651
|
+
const sidebarId = React5.useId();
|
|
652
|
+
const [openMobile, setOpenMobile] = React5.useState(false);
|
|
653
|
+
const [_open, _setOpen] = React5.useState(defaultOpen);
|
|
654
|
+
const open = openProp ?? _open;
|
|
655
|
+
const setOpen = React5.useCallback(
|
|
656
|
+
(value) => {
|
|
657
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
658
|
+
if (setOpenProp) {
|
|
659
|
+
setOpenProp(openState);
|
|
660
|
+
} else {
|
|
661
|
+
_setOpen(openState);
|
|
662
|
+
}
|
|
663
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
664
|
+
},
|
|
665
|
+
[open, setOpenProp]
|
|
666
|
+
);
|
|
667
|
+
const toggleSidebar = React5.useCallback(() => {
|
|
668
|
+
return isMobile ? setOpenMobile((currentOpen) => !currentOpen) : setOpen((currentOpen) => !currentOpen);
|
|
669
|
+
}, [isMobile, setOpen]);
|
|
670
|
+
React5.useEffect(() => {
|
|
671
|
+
const handleKeyDown = (event) => {
|
|
672
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
673
|
+
event.preventDefault();
|
|
674
|
+
toggleSidebar();
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
678
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
679
|
+
}, [toggleSidebar]);
|
|
680
|
+
const state = open ? "expanded" : "collapsed";
|
|
681
|
+
const contextValue = React5.useMemo(
|
|
682
|
+
() => ({
|
|
683
|
+
sidebarId,
|
|
684
|
+
state,
|
|
685
|
+
open,
|
|
686
|
+
setOpen,
|
|
687
|
+
isMobile,
|
|
688
|
+
openMobile,
|
|
689
|
+
setOpenMobile,
|
|
690
|
+
toggleSidebar
|
|
691
|
+
}),
|
|
692
|
+
[sidebarId, state, open, setOpen, isMobile, openMobile, toggleSidebar]
|
|
693
|
+
);
|
|
694
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delay: 0, children: /* @__PURE__ */ jsx(
|
|
695
|
+
"div",
|
|
696
|
+
{
|
|
697
|
+
"data-slot": "sidebar-wrapper",
|
|
698
|
+
style: {
|
|
699
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
700
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
701
|
+
...style
|
|
702
|
+
},
|
|
703
|
+
className: cn("group/sidebar-wrapper flex min-h-dvh w-full has-data-[variant=inset]:bg-sidebar", className),
|
|
704
|
+
...props,
|
|
705
|
+
children
|
|
706
|
+
}
|
|
707
|
+
) }) });
|
|
708
|
+
}
|
|
709
|
+
function Sidebar({
|
|
710
|
+
side = "left",
|
|
711
|
+
variant = "sidebar",
|
|
712
|
+
collapsible = "offcanvas",
|
|
713
|
+
className,
|
|
714
|
+
children,
|
|
715
|
+
dir,
|
|
716
|
+
...props
|
|
717
|
+
}) {
|
|
718
|
+
const { isMobile, sidebarId, state, openMobile, setOpenMobile } = useSidebar();
|
|
719
|
+
if (collapsible === "none") {
|
|
720
|
+
return /* @__PURE__ */ jsx(
|
|
721
|
+
"div",
|
|
722
|
+
{
|
|
723
|
+
id: sidebarId,
|
|
724
|
+
"data-slot": "sidebar",
|
|
725
|
+
className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
|
|
726
|
+
...props,
|
|
727
|
+
children
|
|
728
|
+
}
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
if (isMobile) {
|
|
732
|
+
return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
|
|
733
|
+
SheetContent,
|
|
734
|
+
{
|
|
735
|
+
id: sidebarId,
|
|
736
|
+
dir,
|
|
737
|
+
"data-sidebar": "sidebar",
|
|
738
|
+
"data-slot": "sidebar",
|
|
739
|
+
"data-mobile": "true",
|
|
740
|
+
className: `w-(--sidebar-width) bg-sidebar pt-[env(safe-area-inset-top)]
|
|
741
|
+
pb-[env(safe-area-inset-bottom)] text-sidebar-foreground [&_[data-sidebar=header]]:pr-12
|
|
742
|
+
[&>[data-slot=sheet-close]]:top-[calc(env(safe-area-inset-top)+0.5rem)]
|
|
743
|
+
[&>[data-slot=sheet-close]]:right-2 [&>[data-slot=sheet-close]]:flex
|
|
744
|
+
[&>[data-slot=sheet-close]]:size-10 [&>[data-slot=sheet-close]]:items-center
|
|
745
|
+
[&>[data-slot=sheet-close]]:justify-center [&>[data-slot=sheet-close]]:rounded-lg
|
|
746
|
+
[&>[data-slot=sheet-close]]:opacity-100 pointer-coarse:[&>[data-slot=sheet-close]]:size-11`,
|
|
747
|
+
style: {
|
|
748
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
749
|
+
},
|
|
750
|
+
side,
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
|
|
753
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
|
|
754
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
755
|
+
] }),
|
|
756
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
|
|
757
|
+
]
|
|
758
|
+
}
|
|
759
|
+
) });
|
|
760
|
+
}
|
|
761
|
+
return /* @__PURE__ */ jsxs(
|
|
762
|
+
"div",
|
|
763
|
+
{
|
|
764
|
+
id: sidebarId,
|
|
765
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
766
|
+
"data-state": state,
|
|
767
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
768
|
+
"data-variant": variant,
|
|
769
|
+
"data-side": side,
|
|
770
|
+
"data-slot": "sidebar",
|
|
771
|
+
children: [
|
|
772
|
+
/* @__PURE__ */ jsx(
|
|
773
|
+
"div",
|
|
774
|
+
{
|
|
775
|
+
"data-slot": "sidebar-gap",
|
|
776
|
+
className: cn(
|
|
777
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear motion-reduce:transition-none",
|
|
778
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
779
|
+
"group-data-[side=right]:rotate-180",
|
|
780
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
781
|
+
)
|
|
782
|
+
}
|
|
783
|
+
),
|
|
784
|
+
/* @__PURE__ */ jsx(
|
|
785
|
+
"div",
|
|
786
|
+
{
|
|
787
|
+
"data-slot": "sidebar-container",
|
|
788
|
+
"data-side": side,
|
|
789
|
+
className: cn(
|
|
790
|
+
`fixed inset-y-0 z-10 hidden h-dvh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear
|
|
791
|
+
data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]
|
|
792
|
+
data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]
|
|
793
|
+
motion-reduce:transition-none md:flex`,
|
|
794
|
+
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
|
|
795
|
+
group-data-[side=right]:border-l`,
|
|
796
|
+
className
|
|
797
|
+
),
|
|
798
|
+
...props,
|
|
799
|
+
children: /* @__PURE__ */ jsx(
|
|
800
|
+
"div",
|
|
801
|
+
{
|
|
802
|
+
"data-sidebar": "sidebar",
|
|
803
|
+
"data-slot": "sidebar-inner",
|
|
804
|
+
className: "flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg\n group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1\n group-data-[variant=floating]:ring-sidebar-border",
|
|
805
|
+
children
|
|
806
|
+
}
|
|
807
|
+
)
|
|
808
|
+
}
|
|
809
|
+
)
|
|
810
|
+
]
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
815
|
+
const { isMobile, open, openMobile, sidebarId, toggleSidebar } = useSidebar();
|
|
816
|
+
return /* @__PURE__ */ jsxs(
|
|
817
|
+
Button,
|
|
818
|
+
{
|
|
819
|
+
"aria-controls": sidebarId,
|
|
820
|
+
"aria-expanded": isMobile ? openMobile : open,
|
|
821
|
+
"data-sidebar": "trigger",
|
|
822
|
+
"data-slot": "sidebar-trigger",
|
|
823
|
+
variant: "ghost",
|
|
824
|
+
size: "icon-sm",
|
|
825
|
+
className: cn(className),
|
|
826
|
+
onClick: (event) => {
|
|
827
|
+
onClick?.(event);
|
|
828
|
+
toggleSidebar();
|
|
829
|
+
},
|
|
830
|
+
...props,
|
|
831
|
+
children: [
|
|
832
|
+
/* @__PURE__ */ jsx(PanelLeftIcon, {}),
|
|
833
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
834
|
+
]
|
|
835
|
+
}
|
|
836
|
+
);
|
|
837
|
+
}
|
|
838
|
+
function SidebarRail({ className, ...props }) {
|
|
839
|
+
const { toggleSidebar } = useSidebar();
|
|
840
|
+
return /* @__PURE__ */ jsx(
|
|
841
|
+
"button",
|
|
842
|
+
{
|
|
843
|
+
type: "button",
|
|
844
|
+
"data-sidebar": "rail",
|
|
845
|
+
"data-slot": "sidebar-rail",
|
|
846
|
+
"aria-label": "Toggle Sidebar",
|
|
847
|
+
tabIndex: -1,
|
|
848
|
+
onClick: toggleSidebar,
|
|
849
|
+
title: "Toggle Sidebar",
|
|
850
|
+
className: cn(
|
|
851
|
+
`absolute inset-y-0 z-20 hidden w-4 transition-[transform,background-color] duration-200 ease-linear group-data-[side=left]:-right-4
|
|
852
|
+
group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-px
|
|
853
|
+
hover:after:bg-sidebar-border motion-reduce:transition-none sm:flex ltr:-translate-x-1/2 rtl:translate-x-1/2`,
|
|
854
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
855
|
+
`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize
|
|
856
|
+
[[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,
|
|
857
|
+
`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:start-full
|
|
858
|
+
hover:group-data-[collapsible=offcanvas]:bg-sidebar`,
|
|
859
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
860
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
861
|
+
className
|
|
862
|
+
),
|
|
863
|
+
...props
|
|
864
|
+
}
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
function SidebarInset({ className, ...props }) {
|
|
868
|
+
return /* @__PURE__ */ jsx(
|
|
869
|
+
"main",
|
|
870
|
+
{
|
|
871
|
+
"data-slot": "sidebar-inset",
|
|
872
|
+
className: cn(
|
|
873
|
+
`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2
|
|
874
|
+
md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl
|
|
875
|
+
md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,
|
|
876
|
+
className
|
|
877
|
+
),
|
|
878
|
+
...props
|
|
879
|
+
}
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
function SidebarHeader({ className, ...props }) {
|
|
883
|
+
return /* @__PURE__ */ jsx(
|
|
884
|
+
"div",
|
|
885
|
+
{
|
|
886
|
+
"data-slot": "sidebar-header",
|
|
887
|
+
"data-sidebar": "header",
|
|
888
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
889
|
+
...props
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
function SidebarFooter({ className, ...props }) {
|
|
894
|
+
return /* @__PURE__ */ jsx(
|
|
895
|
+
"div",
|
|
896
|
+
{
|
|
897
|
+
"data-slot": "sidebar-footer",
|
|
898
|
+
"data-sidebar": "footer",
|
|
899
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
900
|
+
...props
|
|
901
|
+
}
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
function SidebarSeparator({ className, ...props }) {
|
|
905
|
+
return /* @__PURE__ */ jsx(
|
|
906
|
+
Separator,
|
|
907
|
+
{
|
|
908
|
+
"data-slot": "sidebar-separator",
|
|
909
|
+
"data-sidebar": "separator",
|
|
910
|
+
className: cn("mx-2 w-auto bg-sidebar-border", className),
|
|
911
|
+
...props
|
|
912
|
+
}
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
function SidebarContent({ className, ...props }) {
|
|
916
|
+
return /* @__PURE__ */ jsx(
|
|
917
|
+
"div",
|
|
918
|
+
{
|
|
919
|
+
"data-slot": "sidebar-content",
|
|
920
|
+
"data-sidebar": "content",
|
|
921
|
+
className: cn(
|
|
922
|
+
"scrollbar-hide flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
923
|
+
className
|
|
924
|
+
),
|
|
925
|
+
...props
|
|
926
|
+
}
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
function SidebarGroup({ className, ...props }) {
|
|
930
|
+
return /* @__PURE__ */ jsx(
|
|
931
|
+
"div",
|
|
932
|
+
{
|
|
933
|
+
"data-slot": "sidebar-group",
|
|
934
|
+
"data-sidebar": "group",
|
|
935
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
936
|
+
...props
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
function SidebarGroupLabel({
|
|
941
|
+
className,
|
|
942
|
+
render,
|
|
943
|
+
...props
|
|
944
|
+
}) {
|
|
945
|
+
return useRender({
|
|
946
|
+
defaultTagName: "div",
|
|
947
|
+
props: mergeProps(
|
|
948
|
+
{
|
|
949
|
+
className: cn(
|
|
950
|
+
`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70
|
|
951
|
+
ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear
|
|
952
|
+
group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2
|
|
953
|
+
motion-reduce:transition-none [&>svg]:size-4 [&>svg]:shrink-0`,
|
|
954
|
+
className
|
|
955
|
+
)
|
|
956
|
+
},
|
|
957
|
+
props
|
|
958
|
+
),
|
|
959
|
+
render,
|
|
960
|
+
state: {
|
|
961
|
+
slot: "sidebar-group-label",
|
|
962
|
+
sidebar: "group-label"
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
967
|
+
return /* @__PURE__ */ jsx(
|
|
968
|
+
"div",
|
|
969
|
+
{
|
|
970
|
+
"data-slot": "sidebar-group-content",
|
|
971
|
+
"data-sidebar": "group-content",
|
|
972
|
+
className: cn("w-full text-sm", className),
|
|
973
|
+
...props
|
|
974
|
+
}
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
function SidebarMenu({ className, ...props }) {
|
|
978
|
+
return /* @__PURE__ */ jsx(
|
|
979
|
+
"ul",
|
|
980
|
+
{
|
|
981
|
+
"data-slot": "sidebar-menu",
|
|
982
|
+
"data-sidebar": "menu",
|
|
983
|
+
className: cn("flex w-full min-w-0 flex-col gap-0", className),
|
|
984
|
+
...props
|
|
985
|
+
}
|
|
986
|
+
);
|
|
987
|
+
}
|
|
988
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
989
|
+
return /* @__PURE__ */ jsx(
|
|
990
|
+
"li",
|
|
991
|
+
{
|
|
992
|
+
"data-slot": "sidebar-menu-item",
|
|
993
|
+
"data-sidebar": "menu-item",
|
|
994
|
+
className: cn("group/menu-item relative", className),
|
|
995
|
+
...props
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
}
|
|
999
|
+
var sidebarMenuButtonVariants = cva(
|
|
1000
|
+
`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm
|
|
1001
|
+
ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8
|
|
1002
|
+
group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent
|
|
1003
|
+
hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent
|
|
1004
|
+
active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50
|
|
1005
|
+
aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent
|
|
1006
|
+
data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium
|
|
1007
|
+
data-active:text-sidebar-accent-foreground pointer-coarse:min-h-11 motion-reduce:transition-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
1008
|
+
[&>span:last-child]:truncate`,
|
|
1009
|
+
{
|
|
1010
|
+
variants: {
|
|
1011
|
+
variant: {
|
|
1012
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
1013
|
+
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
|
|
1014
|
+
},
|
|
1015
|
+
size: {
|
|
1016
|
+
default: "h-8 text-sm",
|
|
1017
|
+
sm: "h-7 text-xs",
|
|
1018
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
defaultVariants: {
|
|
1022
|
+
variant: "default",
|
|
1023
|
+
size: "default"
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
function SidebarMenuButton({
|
|
1028
|
+
render,
|
|
1029
|
+
isActive = false,
|
|
1030
|
+
variant = "default",
|
|
1031
|
+
size = "default",
|
|
1032
|
+
tooltip,
|
|
1033
|
+
className,
|
|
1034
|
+
...props
|
|
1035
|
+
}) {
|
|
1036
|
+
const { isMobile, state } = useSidebar();
|
|
1037
|
+
const component = useRender({
|
|
1038
|
+
defaultTagName: "button",
|
|
1039
|
+
props: mergeProps(
|
|
1040
|
+
{
|
|
1041
|
+
className: cn(sidebarMenuButtonVariants({ variant, size }), className)
|
|
1042
|
+
},
|
|
1043
|
+
props
|
|
1044
|
+
),
|
|
1045
|
+
render: !tooltip ? render : /* @__PURE__ */ jsx(TooltipTrigger, { render }),
|
|
1046
|
+
state: {
|
|
1047
|
+
slot: "sidebar-menu-button",
|
|
1048
|
+
sidebar: "menu-button",
|
|
1049
|
+
size,
|
|
1050
|
+
active: isActive
|
|
1051
|
+
}
|
|
1052
|
+
});
|
|
1053
|
+
if (!tooltip) {
|
|
1054
|
+
return component;
|
|
1055
|
+
}
|
|
1056
|
+
const tooltipProps = typeof tooltip === "string" ? { children: tooltip } : tooltip;
|
|
1057
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
1058
|
+
component,
|
|
1059
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltipProps })
|
|
1060
|
+
] });
|
|
1061
|
+
}
|
|
1062
|
+
function SidebarMenuAction({
|
|
1063
|
+
className,
|
|
1064
|
+
render,
|
|
1065
|
+
showOnHover = false,
|
|
1066
|
+
...props
|
|
1067
|
+
}) {
|
|
1068
|
+
return useRender({
|
|
1069
|
+
defaultTagName: "button",
|
|
1070
|
+
props: mergeProps(
|
|
1071
|
+
{
|
|
1072
|
+
className: cn(
|
|
1073
|
+
`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0
|
|
1074
|
+
text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform
|
|
1075
|
+
group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground
|
|
1076
|
+
peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5
|
|
1077
|
+
peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent
|
|
1078
|
+
hover:text-sidebar-accent-foreground focus-visible:ring-2 motion-reduce:transition-none md:after:hidden
|
|
1079
|
+
[&>svg]:size-4 [&>svg]:shrink-0`,
|
|
1080
|
+
showOnHover && `group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100
|
|
1081
|
+
peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,
|
|
1082
|
+
className
|
|
1083
|
+
)
|
|
1084
|
+
},
|
|
1085
|
+
props
|
|
1086
|
+
),
|
|
1087
|
+
render,
|
|
1088
|
+
state: {
|
|
1089
|
+
slot: "sidebar-menu-action",
|
|
1090
|
+
sidebar: "menu-action"
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
1095
|
+
return /* @__PURE__ */ jsx(
|
|
1096
|
+
"div",
|
|
1097
|
+
{
|
|
1098
|
+
"data-slot": "sidebar-menu-badge",
|
|
1099
|
+
"data-sidebar": "menu-badge",
|
|
1100
|
+
className: cn(
|
|
1101
|
+
`pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1
|
|
1102
|
+
text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden
|
|
1103
|
+
peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5
|
|
1104
|
+
peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1
|
|
1105
|
+
peer-data-active/menu-button:text-sidebar-accent-foreground`,
|
|
1106
|
+
className
|
|
1107
|
+
),
|
|
1108
|
+
...props
|
|
1109
|
+
}
|
|
1110
|
+
);
|
|
1111
|
+
}
|
|
1112
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
1113
|
+
return /* @__PURE__ */ jsx(
|
|
1114
|
+
"ul",
|
|
1115
|
+
{
|
|
1116
|
+
"data-slot": "sidebar-menu-sub",
|
|
1117
|
+
"data-sidebar": "menu-sub",
|
|
1118
|
+
className: cn(
|
|
1119
|
+
`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5
|
|
1120
|
+
group-data-[collapsible=icon]:hidden`,
|
|
1121
|
+
className
|
|
1122
|
+
),
|
|
1123
|
+
...props
|
|
1124
|
+
}
|
|
1125
|
+
);
|
|
1126
|
+
}
|
|
1127
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
1128
|
+
return /* @__PURE__ */ jsx(
|
|
1129
|
+
"li",
|
|
1130
|
+
{
|
|
1131
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
1132
|
+
"data-sidebar": "menu-sub-item",
|
|
1133
|
+
className: cn("group/menu-sub-item relative", className),
|
|
1134
|
+
...props
|
|
1135
|
+
}
|
|
1136
|
+
);
|
|
1137
|
+
}
|
|
1138
|
+
function SidebarMenuSubButton({
|
|
1139
|
+
render,
|
|
1140
|
+
size = "md",
|
|
1141
|
+
isActive = false,
|
|
1142
|
+
className,
|
|
1143
|
+
...props
|
|
1144
|
+
}) {
|
|
1145
|
+
return useRender({
|
|
1146
|
+
defaultTagName: "a",
|
|
1147
|
+
props: mergeProps(
|
|
1148
|
+
{
|
|
1149
|
+
className: cn(
|
|
1150
|
+
`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2
|
|
1151
|
+
text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden
|
|
1152
|
+
hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent
|
|
1153
|
+
active:text-sidebar-accent-foreground aria-disabled:pointer-events-none aria-disabled:opacity-50
|
|
1154
|
+
data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent
|
|
1155
|
+
data-active:text-sidebar-accent-foreground pointer-coarse:min-h-11 [&>span:last-child]:truncate [&>svg]:size-4
|
|
1156
|
+
[&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,
|
|
1157
|
+
className
|
|
1158
|
+
)
|
|
1159
|
+
},
|
|
1160
|
+
props
|
|
1161
|
+
),
|
|
1162
|
+
render,
|
|
1163
|
+
state: {
|
|
1164
|
+
slot: "sidebar-menu-sub-button",
|
|
1165
|
+
sidebar: "menu-sub-button",
|
|
1166
|
+
size,
|
|
1167
|
+
active: isActive
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
function createAppLink(renderLink, props) {
|
|
1172
|
+
return renderLink ? renderLink(props) : /* @__PURE__ */ jsx("a", { ...props });
|
|
1173
|
+
}
|
|
1174
|
+
function AppBar({
|
|
1175
|
+
breadcrumbs = [],
|
|
1176
|
+
renderLink,
|
|
1177
|
+
leading,
|
|
1178
|
+
search,
|
|
1179
|
+
actions,
|
|
1180
|
+
toggleLabel = "Toggle navigation",
|
|
1181
|
+
className,
|
|
1182
|
+
render,
|
|
1183
|
+
...props
|
|
1184
|
+
}) {
|
|
1185
|
+
const content = /* @__PURE__ */ jsxs("div", { className: "flex h-[var(--app-bar-height,3.5rem)] w-full min-w-0 items-center gap-2 px-3 sm:px-4", children: [
|
|
1186
|
+
/* @__PURE__ */ jsx(SidebarTrigger, { "aria-label": toggleLabel, className: "-ms-1 shrink-0" }),
|
|
1187
|
+
(leading || breadcrumbs.length > 0) && /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mr-1 hidden h-4 self-center sm:block" }),
|
|
1188
|
+
leading,
|
|
1189
|
+
breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Breadcrumb, { className: "min-w-0 flex-1 sm:flex-none", children: /* @__PURE__ */ jsx(BreadcrumbList, { className: "flex-nowrap text-sm text-muted-foreground", children: breadcrumbs.map((item, index) => {
|
|
1190
|
+
const current = item.current ?? index === breadcrumbs.length - 1;
|
|
1191
|
+
const breadcrumbContent = current || !item.href ? /* @__PURE__ */ jsx(
|
|
1192
|
+
BreadcrumbPage,
|
|
1193
|
+
{
|
|
1194
|
+
className: "block max-w-48 truncate font-semibold text-foreground sm:max-w-56",
|
|
1195
|
+
title: typeof item.label === "string" ? item.label : void 0,
|
|
1196
|
+
children: item.label
|
|
1197
|
+
}
|
|
1198
|
+
) : /* @__PURE__ */ jsx(
|
|
1199
|
+
BreadcrumbLink,
|
|
1200
|
+
{
|
|
1201
|
+
className: "hover:text-foreground",
|
|
1202
|
+
title: typeof item.label === "string" ? item.label : void 0,
|
|
1203
|
+
render: createAppLink(renderLink, {
|
|
1204
|
+
href: item.href,
|
|
1205
|
+
children: item.label
|
|
1206
|
+
})
|
|
1207
|
+
}
|
|
1208
|
+
);
|
|
1209
|
+
return /* @__PURE__ */ jsxs(React5.Fragment, { children: [
|
|
1210
|
+
index > 0 && /* @__PURE__ */ jsx(
|
|
1211
|
+
BreadcrumbSeparator,
|
|
1212
|
+
{
|
|
1213
|
+
className: "text-muted-foreground/70 hidden sm:block"
|
|
1214
|
+
}
|
|
1215
|
+
),
|
|
1216
|
+
/* @__PURE__ */ jsx(BreadcrumbItem, { className: cn("min-w-0", !current && "hidden sm:flex"), children: breadcrumbContent })
|
|
1217
|
+
] }, item.id);
|
|
1218
|
+
}) }) }),
|
|
1219
|
+
search && /* @__PURE__ */ jsx("div", { className: "ml-auto min-w-0", children: search }),
|
|
1220
|
+
actions && /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center gap-2", !search && "ml-auto"), children: actions })
|
|
1221
|
+
] });
|
|
1222
|
+
return useRender({
|
|
1223
|
+
defaultTagName: "header",
|
|
1224
|
+
props: mergeProps(
|
|
1225
|
+
{
|
|
1226
|
+
className: cn("sticky top-0 z-30 flex w-full shrink-0 items-center border-b bg-background", className),
|
|
1227
|
+
children: content
|
|
1228
|
+
},
|
|
1229
|
+
props
|
|
1230
|
+
),
|
|
1231
|
+
render,
|
|
1232
|
+
state: {
|
|
1233
|
+
slot: "app-bar"
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
function Avatar({ className, ...props }) {
|
|
1238
|
+
return /* @__PURE__ */ jsx(
|
|
1239
|
+
Avatar$1.Root,
|
|
1240
|
+
{
|
|
1241
|
+
"data-slot": "avatar",
|
|
1242
|
+
className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
|
|
1243
|
+
...props
|
|
1244
|
+
}
|
|
1245
|
+
);
|
|
1246
|
+
}
|
|
1247
|
+
function AvatarImage({ className, ...props }) {
|
|
1248
|
+
return /* @__PURE__ */ jsx(
|
|
1249
|
+
Avatar$1.Image,
|
|
1250
|
+
{
|
|
1251
|
+
"data-slot": "avatar-image",
|
|
1252
|
+
className: cn(
|
|
1253
|
+
"aspect-square size-full outline outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10",
|
|
1254
|
+
className
|
|
1255
|
+
),
|
|
1256
|
+
...props
|
|
1257
|
+
}
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
function AvatarFallback({ className, delayMs, delay, ...props }) {
|
|
1261
|
+
return /* @__PURE__ */ jsx(
|
|
1262
|
+
Avatar$1.Fallback,
|
|
1263
|
+
{
|
|
1264
|
+
"data-slot": "avatar-fallback",
|
|
1265
|
+
delay: delay ?? delayMs,
|
|
1266
|
+
className: cn("bg-secondary flex size-full items-center justify-center rounded-[inherit] text-xs", className),
|
|
1267
|
+
...props
|
|
1268
|
+
}
|
|
1269
|
+
);
|
|
1270
|
+
}
|
|
1271
|
+
function Collapsible({
|
|
1272
|
+
className,
|
|
1273
|
+
...props
|
|
1274
|
+
}) {
|
|
1275
|
+
return /* @__PURE__ */ jsx(
|
|
1276
|
+
Collapsible$1.Root,
|
|
1277
|
+
{
|
|
1278
|
+
"data-slot": "collapsible",
|
|
1279
|
+
className: cn("group/collapsible", className),
|
|
1280
|
+
...props
|
|
1281
|
+
}
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
var CollapsibleTrigger = React5.forwardRef(({ className, asChild, nativeButton, children, render, ...props }, ref) => {
|
|
1285
|
+
const triggerClassName = cn(
|
|
1286
|
+
"group/trigger flex w-full cursor-pointer items-center justify-between text-sm font-medium outline-none transition-colors",
|
|
1287
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
|
1288
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
1289
|
+
"[&_[data-slot=collapsible-icon]]:transition-transform [&_[data-slot=collapsible-icon]]:duration-200",
|
|
1290
|
+
"[&[data-panel-open]_[data-slot=collapsible-icon]]:rotate-180",
|
|
1291
|
+
className
|
|
1292
|
+
);
|
|
1293
|
+
const childRender = render === void 0 && asChild && React5.isValidElement(children) ? children : void 0;
|
|
1294
|
+
return /* @__PURE__ */ jsx(
|
|
1295
|
+
Collapsible$1.Trigger,
|
|
1296
|
+
{
|
|
1297
|
+
ref,
|
|
1298
|
+
"data-slot": "collapsible-trigger",
|
|
1299
|
+
nativeButton: nativeButton ?? (childRender ? true : void 0),
|
|
1300
|
+
className: triggerClassName,
|
|
1301
|
+
render: render ?? childRender,
|
|
1302
|
+
...props,
|
|
1303
|
+
children: childRender ? void 0 : children
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
1306
|
+
});
|
|
1307
|
+
CollapsibleTrigger.displayName = "CollapsibleTrigger";
|
|
1308
|
+
var CollapsiblePanel = React5.forwardRef(
|
|
1309
|
+
({ className, innerClassName, children, ...props }, ref) => {
|
|
1310
|
+
return /* @__PURE__ */ jsx(
|
|
1311
|
+
Collapsible$1.Panel,
|
|
1312
|
+
{
|
|
1313
|
+
ref,
|
|
1314
|
+
"data-slot": "collapsible-panel",
|
|
1315
|
+
className: cn(
|
|
1316
|
+
"h-[var(--collapsible-panel-height)] overflow-hidden text-sm",
|
|
1317
|
+
"origin-top transition-[opacity,transform] duration-200 ease-out motion-reduce:transition-none",
|
|
1318
|
+
"data-[ending-style]:translate-y-1 data-[ending-style]:opacity-0 data-[starting-style]:translate-y-1 data-[starting-style]:opacity-0",
|
|
1319
|
+
className
|
|
1320
|
+
),
|
|
1321
|
+
...props,
|
|
1322
|
+
children: /* @__PURE__ */ jsx(
|
|
1323
|
+
"div",
|
|
1324
|
+
{
|
|
1325
|
+
"data-slot": "collapsible-panel-content",
|
|
1326
|
+
className: cn("py-4", innerClassName),
|
|
1327
|
+
children
|
|
1328
|
+
}
|
|
1329
|
+
)
|
|
1330
|
+
}
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
);
|
|
1334
|
+
CollapsiblePanel.displayName = "CollapsiblePanel";
|
|
1335
|
+
var DropdownMenuGroupContext = React5.createContext(false);
|
|
1336
|
+
function DropdownMenu({ ...props }) {
|
|
1337
|
+
return /* @__PURE__ */ jsx(Menu.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1338
|
+
}
|
|
1339
|
+
function DropdownMenuPortal({ ...props }) {
|
|
1340
|
+
const { container } = useFloatingOverlayPortalProps();
|
|
1341
|
+
return /* @__PURE__ */ jsx(Menu.Portal, { "data-slot": "dropdown-menu-portal", container, ...props });
|
|
1342
|
+
}
|
|
1343
|
+
function DropdownMenuTrigger({ asChild, children, render, nativeButton, ...props }) {
|
|
1344
|
+
const childRender = render === void 0 && asChild && React5.isValidElement(children) ? children : void 0;
|
|
1345
|
+
return /* @__PURE__ */ jsx(
|
|
1346
|
+
Menu.Trigger,
|
|
1347
|
+
{
|
|
1348
|
+
"data-slot": "dropdown-menu-trigger",
|
|
1349
|
+
nativeButton: nativeButton ?? (childRender ? true : void 0),
|
|
1350
|
+
render: render ?? childRender,
|
|
1351
|
+
...props,
|
|
1352
|
+
children: childRender ? void 0 : children
|
|
1353
|
+
}
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1356
|
+
function DropdownMenuContent({
|
|
1357
|
+
className,
|
|
1358
|
+
sideOffset = 4,
|
|
1359
|
+
side = "bottom",
|
|
1360
|
+
align = "start",
|
|
1361
|
+
onPointerDown: _onPointerDown,
|
|
1362
|
+
onPointerDownOutside: _onPointerDownOutside,
|
|
1363
|
+
onCloseAutoFocus: _onCloseAutoFocus,
|
|
1364
|
+
forceMount: _forceMount,
|
|
1365
|
+
...props
|
|
1366
|
+
}) {
|
|
1367
|
+
const { zIndexClass } = useFloatingOverlayPortalProps();
|
|
1368
|
+
return /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(Menu.Positioner, { side, align, sideOffset, className: zIndexClass, children: /* @__PURE__ */ jsx(
|
|
1369
|
+
Menu.Popup,
|
|
1370
|
+
{
|
|
1371
|
+
"data-slot": "dropdown-menu-content",
|
|
1372
|
+
className: cn(
|
|
1373
|
+
`bg-popover text-popover-foreground origin-(--transform-origin) min-w-40 overflow-hidden rounded-md border p-1
|
|
1374
|
+
shadow-lg transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
|
|
1375
|
+
data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
|
|
1376
|
+
data-[side=bottom]:data-starting-style:-translate-y-2
|
|
1377
|
+
data-[side=left]:data-starting-style:translate-x-2
|
|
1378
|
+
data-[side=right]:data-starting-style:-translate-x-2
|
|
1379
|
+
data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
|
|
1380
|
+
className
|
|
1381
|
+
),
|
|
1382
|
+
...props
|
|
1383
|
+
}
|
|
1384
|
+
) }) });
|
|
1385
|
+
}
|
|
1386
|
+
function DropdownMenuGroup({ ...props }) {
|
|
1387
|
+
return /* @__PURE__ */ jsx(DropdownMenuGroupContext.Provider, { value: true, children: /* @__PURE__ */ jsx(Menu.Group, { "data-slot": "dropdown-menu-group", ...props }) });
|
|
1388
|
+
}
|
|
1389
|
+
function DropdownMenuItem({
|
|
1390
|
+
className,
|
|
1391
|
+
inset,
|
|
1392
|
+
variant = "default",
|
|
1393
|
+
asChild,
|
|
1394
|
+
children,
|
|
1395
|
+
render,
|
|
1396
|
+
...props
|
|
1397
|
+
}) {
|
|
1398
|
+
const childRender = render === void 0 && asChild && React5.isValidElement(children) ? children : void 0;
|
|
1399
|
+
const itemClassName = cn(
|
|
1400
|
+
`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive
|
|
1401
|
+
data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/40
|
|
1402
|
+
data-[variant=destructive]:data-[highlighted]:text-destructive
|
|
1403
|
+
data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default items-center gap-2 pointer-coarse:min-h-11
|
|
1404
|
+
rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none
|
|
1405
|
+
data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,
|
|
1406
|
+
className
|
|
1407
|
+
);
|
|
1408
|
+
return /* @__PURE__ */ jsx(
|
|
1409
|
+
Menu.Item,
|
|
1410
|
+
{
|
|
1411
|
+
"data-slot": "dropdown-menu-item",
|
|
1412
|
+
"data-inset": inset,
|
|
1413
|
+
"data-variant": variant,
|
|
1414
|
+
className: itemClassName,
|
|
1415
|
+
render: render ?? childRender,
|
|
1416
|
+
...props,
|
|
1417
|
+
children: childRender ? void 0 : children
|
|
1418
|
+
}
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
function DropdownMenuLabel({
|
|
1422
|
+
className,
|
|
1423
|
+
inset,
|
|
1424
|
+
...props
|
|
1425
|
+
}) {
|
|
1426
|
+
const isGrouped = React5.useContext(DropdownMenuGroupContext);
|
|
1427
|
+
const labelProps = {
|
|
1428
|
+
"data-slot": "dropdown-menu-label",
|
|
1429
|
+
"data-inset": inset,
|
|
1430
|
+
className: cn("text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8", className),
|
|
1431
|
+
...props
|
|
1432
|
+
};
|
|
1433
|
+
if (isGrouped) {
|
|
1434
|
+
return /* @__PURE__ */ jsx(Menu.GroupLabel, { ...labelProps });
|
|
1435
|
+
}
|
|
1436
|
+
return /* @__PURE__ */ jsx("div", { ...labelProps });
|
|
1437
|
+
}
|
|
1438
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
1439
|
+
return /* @__PURE__ */ jsx(
|
|
1440
|
+
Menu.Separator,
|
|
1441
|
+
{
|
|
1442
|
+
"data-slot": "dropdown-menu-separator",
|
|
1443
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
1444
|
+
...props
|
|
1445
|
+
}
|
|
1446
|
+
);
|
|
1447
|
+
}
|
|
1448
|
+
function initials(name) {
|
|
1449
|
+
const parts = name.trim().split(/\s+/).filter(Boolean).slice(0, 2);
|
|
1450
|
+
return parts.map((part) => part[0]?.toUpperCase()).join("") || "U";
|
|
1451
|
+
}
|
|
1452
|
+
function navigationLink(renderLink, item, children, onAcceptedNavigation) {
|
|
1453
|
+
return createAppLink(renderLink, {
|
|
1454
|
+
href: item.href,
|
|
1455
|
+
children,
|
|
1456
|
+
"aria-current": item.isActive ? "page" : void 0,
|
|
1457
|
+
"aria-disabled": item.disabled || void 0,
|
|
1458
|
+
tabIndex: item.disabled ? -1 : void 0,
|
|
1459
|
+
onClick: (event) => {
|
|
1460
|
+
if (item.disabled) {
|
|
1461
|
+
event.preventDefault();
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.target && event.currentTarget.target !== "_self") return;
|
|
1465
|
+
onAcceptedNavigation?.();
|
|
1466
|
+
}
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1469
|
+
function NavigationGroup({ group, renderLink }) {
|
|
1470
|
+
const { isMobile, setOpenMobile } = useSidebar();
|
|
1471
|
+
const closeMobileNavigation = React5.useCallback(() => {
|
|
1472
|
+
if (isMobile) setOpenMobile(false);
|
|
1473
|
+
}, [isMobile, setOpenMobile]);
|
|
1474
|
+
return /* @__PURE__ */ jsxs(SidebarGroup, { children: [
|
|
1475
|
+
group.label && /* @__PURE__ */ jsx(SidebarGroupLabel, { children: group.label }),
|
|
1476
|
+
/* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: group.items.map((item) => {
|
|
1477
|
+
const Icon = item.icon;
|
|
1478
|
+
const itemContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1479
|
+
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
|
|
1480
|
+
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
1481
|
+
] });
|
|
1482
|
+
if (!item.children?.length) {
|
|
1483
|
+
return /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [
|
|
1484
|
+
/* @__PURE__ */ jsx(
|
|
1485
|
+
SidebarMenuButton,
|
|
1486
|
+
{
|
|
1487
|
+
isActive: item.isActive,
|
|
1488
|
+
tooltip: typeof item.label === "string" ? item.label : void 0,
|
|
1489
|
+
render: navigationLink(renderLink, item, itemContent, closeMobileNavigation)
|
|
1490
|
+
}
|
|
1491
|
+
),
|
|
1492
|
+
item.badge && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: item.badge })
|
|
1493
|
+
] }, item.id);
|
|
1494
|
+
}
|
|
1495
|
+
const hasActiveChild = item.children.some((child) => child.isActive);
|
|
1496
|
+
return /* @__PURE__ */ jsxs(
|
|
1497
|
+
Collapsible,
|
|
1498
|
+
{
|
|
1499
|
+
defaultOpen: item.defaultOpen ?? item.isActive ?? hasActiveChild,
|
|
1500
|
+
render: /* @__PURE__ */ jsx(SidebarMenuItem, {}),
|
|
1501
|
+
children: [
|
|
1502
|
+
/* @__PURE__ */ jsx(
|
|
1503
|
+
SidebarMenuButton,
|
|
1504
|
+
{
|
|
1505
|
+
isActive: item.isActive,
|
|
1506
|
+
tooltip: typeof item.label === "string" ? item.label : void 0,
|
|
1507
|
+
render: navigationLink(renderLink, item, itemContent, closeMobileNavigation)
|
|
1508
|
+
}
|
|
1509
|
+
),
|
|
1510
|
+
/* @__PURE__ */ jsx(
|
|
1511
|
+
SidebarMenuAction,
|
|
1512
|
+
{
|
|
1513
|
+
render: /* @__PURE__ */ jsx(
|
|
1514
|
+
CollapsibleTrigger,
|
|
1515
|
+
{
|
|
1516
|
+
"aria-label": item.toggleLabel ?? (typeof item.label === "string" ? `Toggle ${item.label}` : "Toggle navigation group")
|
|
1517
|
+
}
|
|
1518
|
+
),
|
|
1519
|
+
className: "aria-expanded:rotate-90",
|
|
1520
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
1521
|
+
}
|
|
1522
|
+
),
|
|
1523
|
+
/* @__PURE__ */ jsx(CollapsiblePanel, { innerClassName: "py-0", children: /* @__PURE__ */ jsx(SidebarMenuSub, { children: item.children.map((child) => /* @__PURE__ */ jsx(SidebarMenuSubItem, { children: /* @__PURE__ */ jsx(
|
|
1524
|
+
SidebarMenuSubButton,
|
|
1525
|
+
{
|
|
1526
|
+
isActive: child.isActive,
|
|
1527
|
+
render: navigationLink(
|
|
1528
|
+
renderLink,
|
|
1529
|
+
child,
|
|
1530
|
+
child.label,
|
|
1531
|
+
closeMobileNavigation
|
|
1532
|
+
)
|
|
1533
|
+
}
|
|
1534
|
+
) }, child.id)) }) })
|
|
1535
|
+
]
|
|
1536
|
+
},
|
|
1537
|
+
item.id
|
|
1538
|
+
);
|
|
1539
|
+
}) }) })
|
|
1540
|
+
] });
|
|
1541
|
+
}
|
|
1542
|
+
function AccountMenu({ account, renderLink }) {
|
|
1543
|
+
const { isMobile } = useSidebar();
|
|
1544
|
+
return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
1545
|
+
/* @__PURE__ */ jsxs(
|
|
1546
|
+
DropdownMenuTrigger,
|
|
1547
|
+
{
|
|
1548
|
+
render: /* @__PURE__ */ jsx(
|
|
1549
|
+
SidebarMenuButton,
|
|
1550
|
+
{
|
|
1551
|
+
size: "lg",
|
|
1552
|
+
className: "aria-expanded:bg-sidebar-accent aria-expanded:text-sidebar-accent-foreground"
|
|
1553
|
+
}
|
|
1554
|
+
),
|
|
1555
|
+
children: [
|
|
1556
|
+
/* @__PURE__ */ jsxs(Avatar, { children: [
|
|
1557
|
+
account.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: account.avatarUrl, alt: account.avatarAlt ?? account.name }),
|
|
1558
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: account.fallback ?? initials(account.name) })
|
|
1559
|
+
] }),
|
|
1560
|
+
/* @__PURE__ */ jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
|
|
1561
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: account.name, children: account.name }),
|
|
1562
|
+
account.secondaryLabel && /* @__PURE__ */ jsx("span", { className: "truncate text-xs", title: account.secondaryLabel, children: account.secondaryLabel })
|
|
1563
|
+
] }),
|
|
1564
|
+
/* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "ml-auto" })
|
|
1565
|
+
]
|
|
1566
|
+
}
|
|
1567
|
+
),
|
|
1568
|
+
/* @__PURE__ */ jsxs(
|
|
1569
|
+
DropdownMenuContent,
|
|
1570
|
+
{
|
|
1571
|
+
className: "min-w-56 rounded-lg",
|
|
1572
|
+
side: isMobile ? "bottom" : "right",
|
|
1573
|
+
align: "end",
|
|
1574
|
+
sideOffset: 4,
|
|
1575
|
+
children: [
|
|
1576
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, { className: "p-0 font-normal", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
|
|
1577
|
+
/* @__PURE__ */ jsxs(Avatar, { children: [
|
|
1578
|
+
account.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, { src: account.avatarUrl, alt: account.avatarAlt ?? account.name }),
|
|
1579
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: account.fallback ?? initials(account.name) })
|
|
1580
|
+
] }),
|
|
1581
|
+
/* @__PURE__ */ jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
|
|
1582
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: account.name, children: account.name }),
|
|
1583
|
+
account.secondaryLabel && /* @__PURE__ */ jsx("span", { className: "truncate text-xs", title: account.secondaryLabel, children: account.secondaryLabel })
|
|
1584
|
+
] })
|
|
1585
|
+
] }) }) }),
|
|
1586
|
+
account.actionGroups?.map((group) => /* @__PURE__ */ jsxs(React5.Fragment, { children: [
|
|
1587
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
1588
|
+
/* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
1589
|
+
group.label && /* @__PURE__ */ jsx(DropdownMenuLabel, { children: group.label }),
|
|
1590
|
+
group.actions.map((action) => {
|
|
1591
|
+
const Icon = action.icon;
|
|
1592
|
+
const actionContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1593
|
+
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
|
|
1594
|
+
/* @__PURE__ */ jsx("span", { children: action.label })
|
|
1595
|
+
] });
|
|
1596
|
+
if (action.href) {
|
|
1597
|
+
return /* @__PURE__ */ jsx(
|
|
1598
|
+
DropdownMenuItem,
|
|
1599
|
+
{
|
|
1600
|
+
disabled: action.disabled,
|
|
1601
|
+
variant: action.variant,
|
|
1602
|
+
render: createAppLink(renderLink, {
|
|
1603
|
+
href: action.href,
|
|
1604
|
+
children: actionContent
|
|
1605
|
+
})
|
|
1606
|
+
},
|
|
1607
|
+
action.id
|
|
1608
|
+
);
|
|
1609
|
+
}
|
|
1610
|
+
return /* @__PURE__ */ jsx(
|
|
1611
|
+
DropdownMenuItem,
|
|
1612
|
+
{
|
|
1613
|
+
disabled: action.disabled,
|
|
1614
|
+
variant: action.variant,
|
|
1615
|
+
onClick: action.onSelect,
|
|
1616
|
+
children: actionContent
|
|
1617
|
+
},
|
|
1618
|
+
action.id
|
|
1619
|
+
);
|
|
1620
|
+
})
|
|
1621
|
+
] })
|
|
1622
|
+
] }, group.id))
|
|
1623
|
+
]
|
|
1624
|
+
}
|
|
1625
|
+
)
|
|
1626
|
+
] }) }) });
|
|
1627
|
+
}
|
|
1628
|
+
function Brand({ brand, renderLink }) {
|
|
1629
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1630
|
+
brand.logo && /* @__PURE__ */ jsx("div", { className: "bg-primary text-primary-foreground flex size-8 shrink-0 items-center justify-center rounded-lg shadow-xs", children: brand.logo }),
|
|
1631
|
+
/* @__PURE__ */ jsxs("div", { className: "grid min-w-0 flex-1 text-left text-sm leading-tight", children: [
|
|
1632
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-medium", title: typeof brand.name === "string" ? brand.name : void 0, children: brand.name }),
|
|
1633
|
+
brand.description && /* @__PURE__ */ jsx(
|
|
1634
|
+
"span",
|
|
1635
|
+
{
|
|
1636
|
+
className: "text-muted-foreground truncate text-xs",
|
|
1637
|
+
title: typeof brand.description === "string" ? brand.description : void 0,
|
|
1638
|
+
children: brand.description
|
|
1639
|
+
}
|
|
1640
|
+
)
|
|
1641
|
+
] })
|
|
1642
|
+
] });
|
|
1643
|
+
return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(
|
|
1644
|
+
SidebarMenuButton,
|
|
1645
|
+
{
|
|
1646
|
+
size: "lg",
|
|
1647
|
+
render: brand.href ? createAppLink(renderLink, { href: brand.href, children: content }) : /* @__PURE__ */ jsx("div", { children: content })
|
|
1648
|
+
}
|
|
1649
|
+
) }) });
|
|
1650
|
+
}
|
|
1651
|
+
function AppShell({
|
|
1652
|
+
children,
|
|
1653
|
+
navigation,
|
|
1654
|
+
brand,
|
|
1655
|
+
account,
|
|
1656
|
+
breadcrumbs,
|
|
1657
|
+
renderLink,
|
|
1658
|
+
barLeading,
|
|
1659
|
+
barSearch,
|
|
1660
|
+
barActions,
|
|
1661
|
+
barProps,
|
|
1662
|
+
barPlacement = "top",
|
|
1663
|
+
headerHeight = "3.5rem",
|
|
1664
|
+
sidebarWidth,
|
|
1665
|
+
sidebarProps,
|
|
1666
|
+
sidebarFooter,
|
|
1667
|
+
contentFooter,
|
|
1668
|
+
defaultSidebarOpen = true,
|
|
1669
|
+
sidebarOpen,
|
|
1670
|
+
onSidebarOpenChange,
|
|
1671
|
+
contentClassName,
|
|
1672
|
+
contentProps,
|
|
1673
|
+
className,
|
|
1674
|
+
style,
|
|
1675
|
+
render,
|
|
1676
|
+
...props
|
|
1677
|
+
}) {
|
|
1678
|
+
const mainGroups = navigation.filter((group) => group.placement !== "footer");
|
|
1679
|
+
const footerGroups = navigation.filter((group) => group.placement === "footer");
|
|
1680
|
+
const hasFooter = footerGroups.length > 0 || Boolean(account) || Boolean(sidebarFooter);
|
|
1681
|
+
const { className: sidebarClassName, collapsible, ...resolvedSidebarProps } = sidebarProps ?? {};
|
|
1682
|
+
const contentBar = barPlacement === "content";
|
|
1683
|
+
const appBar = /* @__PURE__ */ jsx(
|
|
1684
|
+
AppBar,
|
|
1685
|
+
{
|
|
1686
|
+
breadcrumbs,
|
|
1687
|
+
renderLink,
|
|
1688
|
+
leading: barLeading,
|
|
1689
|
+
search: barSearch,
|
|
1690
|
+
actions: barActions,
|
|
1691
|
+
...barProps
|
|
1692
|
+
}
|
|
1693
|
+
);
|
|
1694
|
+
const sidebar = /* @__PURE__ */ jsxs(
|
|
1695
|
+
Sidebar,
|
|
1696
|
+
{
|
|
1697
|
+
collapsible: collapsible ?? "icon",
|
|
1698
|
+
...resolvedSidebarProps,
|
|
1699
|
+
className: cn(
|
|
1700
|
+
contentBar ? "h-dvh!" : "top-(--app-bar-height) h-[calc(100dvh-var(--app-bar-height))]!",
|
|
1701
|
+
sidebarClassName
|
|
1702
|
+
),
|
|
1703
|
+
children: [
|
|
1704
|
+
brand && /* @__PURE__ */ jsx(SidebarHeader, { className: contentBar ? "pt-5 pb-2" : void 0, children: /* @__PURE__ */ jsx(Brand, { brand, renderLink }) }),
|
|
1705
|
+
/* @__PURE__ */ jsx(SidebarContent, { className: contentBar ? "px-1" : void 0, children: mainGroups.map((group) => /* @__PURE__ */ jsx(NavigationGroup, { group, renderLink }, group.id)) }),
|
|
1706
|
+
hasFooter && /* @__PURE__ */ jsxs(SidebarFooter, { className: contentBar ? "p-0" : void 0, children: [
|
|
1707
|
+
!contentBar ? /* @__PURE__ */ jsx(SidebarSeparator, {}) : null,
|
|
1708
|
+
footerGroups.map((group) => /* @__PURE__ */ jsx(NavigationGroup, { group, renderLink }, group.id)),
|
|
1709
|
+
sidebarFooter,
|
|
1710
|
+
account && /* @__PURE__ */ jsx("div", { className: contentBar ? "border-t p-2" : void 0, children: /* @__PURE__ */ jsx(AccountMenu, { account, renderLink }) })
|
|
1711
|
+
] }),
|
|
1712
|
+
/* @__PURE__ */ jsx(SidebarRail, {})
|
|
1713
|
+
]
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1716
|
+
const mainColumn = /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
1717
|
+
contentBar ? appBar : null,
|
|
1718
|
+
/* @__PURE__ */ jsx(
|
|
1719
|
+
SidebarInset,
|
|
1720
|
+
{
|
|
1721
|
+
...contentProps,
|
|
1722
|
+
className: cn(
|
|
1723
|
+
"min-w-0 flex-1 overflow-auto",
|
|
1724
|
+
contentFooter && "pb-[calc(4.5rem+env(safe-area-inset-bottom))] md:pb-0",
|
|
1725
|
+
contentClassName
|
|
1726
|
+
),
|
|
1727
|
+
children
|
|
1728
|
+
}
|
|
1729
|
+
),
|
|
1730
|
+
contentFooter
|
|
1731
|
+
] });
|
|
1732
|
+
const content = /* @__PURE__ */ jsxs(
|
|
1733
|
+
SidebarProvider,
|
|
1734
|
+
{
|
|
1735
|
+
className: "min-h-0 flex-1 flex-col",
|
|
1736
|
+
defaultOpen: defaultSidebarOpen,
|
|
1737
|
+
open: sidebarOpen,
|
|
1738
|
+
onOpenChange: onSidebarOpenChange,
|
|
1739
|
+
style: sidebarWidth ? { "--sidebar-width": sidebarWidth } : void 0,
|
|
1740
|
+
children: [
|
|
1741
|
+
!contentBar ? appBar : null,
|
|
1742
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1", children: [
|
|
1743
|
+
sidebar,
|
|
1744
|
+
mainColumn
|
|
1745
|
+
] })
|
|
1746
|
+
]
|
|
1747
|
+
}
|
|
1748
|
+
);
|
|
1749
|
+
return useRender({
|
|
1750
|
+
defaultTagName: "div",
|
|
1751
|
+
props: mergeProps(
|
|
1752
|
+
{
|
|
1753
|
+
className: cn("flex min-h-dvh w-full flex-col bg-background", className),
|
|
1754
|
+
style: {
|
|
1755
|
+
"--app-bar-height": headerHeight,
|
|
1756
|
+
...style
|
|
1757
|
+
},
|
|
1758
|
+
children: content
|
|
1759
|
+
},
|
|
1760
|
+
props
|
|
1761
|
+
),
|
|
1762
|
+
render,
|
|
1763
|
+
state: {
|
|
1764
|
+
slot: "app-shell"
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
export { AppShell };
|
|
1770
|
+
//# sourceMappingURL=app-shell.js.map
|
|
1771
|
+
//# sourceMappingURL=app-shell.js.map
|