@hot-updater/console 0.28.0 → 0.29.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/.output/nitro.json +17 -0
- package/.output/public/apple-touch-icon.png +0 -0
- package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/.output/public/assets/main-Dlx8-qN-.js +61 -0
- package/.output/public/assets/routes-DB0tWmiJ.js +10 -0
- package/.output/public/assets/styles-Bfxg4M1x.css +2 -0
- package/.output/public/favicon-16x16.png +0 -0
- package/.output/public/favicon-32x32.png +0 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/logo.svg +1 -0
- package/.output/public/manifest.json +30 -0
- package/.output/public/robots.txt +3 -0
- package/.output/server/_chunks/ssr-renderer.mjs +15 -0
- package/.output/server/_libs/@floating-ui/core+[...].mjs +698 -0
- package/.output/server/_libs/@floating-ui/dom+[...].mjs +644 -0
- package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +839 -0
- package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +2093 -0
- package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +287 -0
- package/.output/server/_libs/@radix-ui/react-select+[...].mjs +1003 -0
- package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +196 -0
- package/.output/server/_libs/@tanstack/form-core+[...].mjs +2396 -0
- package/.output/server/_libs/@tanstack/react-form+[...].mjs +298 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +13068 -0
- package/.output/server/_libs/@tanstack/react-table+[...].mjs +2372 -0
- package/.output/server/_libs/chownr.mjs +60 -0
- package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
- package/.output/server/_libs/core-util-is.mjs +67 -0
- package/.output/server/_libs/dayjs.mjs +408 -0
- package/.output/server/_libs/h3+rou3+srvx.mjs +1158 -0
- package/.output/server/_libs/hookable.mjs +41 -0
- package/.output/server/_libs/immediate.mjs +57 -0
- package/.output/server/_libs/inherits.mjs +39 -0
- package/.output/server/_libs/isaacs__fs-minipass+minipass.mjs +1120 -0
- package/.output/server/_libs/isarray.mjs +10 -0
- package/.output/server/_libs/jszip+[...].mjs +8311 -0
- package/.output/server/_libs/lucide-react.mjs +371 -0
- package/.output/server/_libs/minizlib.mjs +345 -0
- package/.output/server/_libs/next-themes.mjs +49 -0
- package/.output/server/_libs/radix-ui__number.mjs +6 -0
- package/.output/server/_libs/radix-ui__primitive.mjs +9 -0
- package/.output/server/_libs/radix-ui__react-arrow.mjs +23 -0
- package/.output/server/_libs/radix-ui__react-collection.mjs +78 -0
- package/.output/server/_libs/radix-ui__react-direction.mjs +11 -0
- package/.output/server/_libs/radix-ui__react-label.mjs +22 -0
- package/.output/server/_libs/radix-ui__react-separator.mjs +31 -0
- package/.output/server/_libs/radix-ui__react-slider.mjs +451 -0
- package/.output/server/_libs/radix-ui__react-switch.mjs +118 -0
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +491 -0
- package/.output/server/_libs/semver.mjs +1339 -0
- package/.output/server/_libs/sonner.mjs +908 -0
- package/.output/server/_libs/tailwind-merge.mjs +1962 -0
- package/.output/server/_libs/tanstack__history.mjs +322 -0
- package/.output/server/_libs/tanstack__query-core.mjs +2073 -0
- package/.output/server/_libs/tanstack__react-query.mjs +146 -0
- package/.output/server/_libs/tanstack__router-core.mjs +6 -0
- package/.output/server/_libs/tar.mjs +1996 -0
- package/.output/server/_libs/ufo.mjs +64 -0
- package/.output/server/_runtime.mjs +26 -0
- package/.output/server/_ssr/api-rpc-D3ZehMIN.mjs +217 -0
- package/.output/server/_ssr/config.server-JUYQ7UbI.mjs +26 -0
- package/.output/server/_ssr/deleteBundle-DWUxu9-K.mjs +22 -0
- package/.output/server/_ssr/extract-timestamp-from-uuidv7-B90UBADU.mjs +24 -0
- package/.output/server/_ssr/promoteBundle-DtMHuubR.mjs +1571 -0
- package/.output/server/_ssr/router-pgc7NX76.mjs +250 -0
- package/.output/server/_ssr/routes-PqTTQSoI.mjs +1833 -0
- package/.output/server/_ssr/sidebar-DXng0IOP.mjs +439 -0
- package/.output/server/_ssr/ssr.mjs +5050 -0
- package/.output/server/_ssr/start-DQK0r85G.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-DTbQVOpU.mjs +17 -0
- package/.output/server/index.mjs +417 -0
- package/.output/server/node_modules/tslib/modules/index.js +70 -0
- package/.output/server/node_modules/tslib/modules/package.json +3 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/package.json +9 -0
- package/README.md +191 -2
- package/package.json +77 -50
- package/dist/.gitkeep +0 -0
- package/dist/assets/favicon-BkwcEHsj.ico +0 -0
- package/dist/assets/index-DUlKsori.css +0 -1
- package/dist/assets/index-ijmIcyn1.js +0 -27
- package/dist/assets/logo-BYNFyja1.png +0 -0
- package/dist/index.cjs +0 -2129
- package/dist/index.d.cts +0 -218
- package/dist/index.d.ts +0 -218
- package/dist/index.html +0 -14
- package/dist/index.js +0 -2125
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { r as __toESM } from "../_runtime.mjs";
|
|
2
|
+
import { A as Slot, P as require_jsx_runtime, d as Description, f as Overlay, h as Title, l as Close, m as Root, p as Portal, u as Content } from "../_libs/@radix-ui/react-alert-dialog+[...].mjs";
|
|
3
|
+
import { u as require_react } from "../_libs/@floating-ui/react-dom+[...].mjs";
|
|
4
|
+
import { a as PanelLeft, t as X } from "../_libs/lucide-react.mjs";
|
|
5
|
+
import { n as clsx, t as cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
6
|
+
import { t as Root$1 } from "../_libs/radix-ui__react-separator.mjs";
|
|
7
|
+
import { a as Root3, i as Provider, n as Content2, o as Trigger, r as Portal$1, t as Arrow2 } from "../_libs/radix-ui__react-tooltip.mjs";
|
|
8
|
+
import { t as twMerge } from "../_libs/tailwind-merge.mjs";
|
|
9
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/sidebar-DXng0IOP.js
|
|
10
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
11
|
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
12
|
+
function cn(...inputs) {
|
|
13
|
+
return twMerge(clsx(inputs));
|
|
14
|
+
}
|
|
15
|
+
var buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none", {
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
19
|
+
outline: "border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
20
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
21
|
+
ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
22
|
+
destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
|
|
23
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
default: "h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
27
|
+
xs: "h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",
|
|
28
|
+
sm: "h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
29
|
+
lg: "h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",
|
|
30
|
+
icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
|
|
31
|
+
"icon-xs": "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
|
|
32
|
+
"icon-sm": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
33
|
+
"icon-lg": "size-8 [&_svg:not([class*='size-'])]:size-4"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "default",
|
|
38
|
+
size: "default"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(asChild ? Slot : "button", {
|
|
43
|
+
"data-slot": "button",
|
|
44
|
+
"data-variant": variant,
|
|
45
|
+
"data-size": size,
|
|
46
|
+
className: cn(buttonVariants({
|
|
47
|
+
variant,
|
|
48
|
+
size,
|
|
49
|
+
className
|
|
50
|
+
})),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function Input({ className, type, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
|
|
56
|
+
type,
|
|
57
|
+
"data-slot": "input",
|
|
58
|
+
className: cn("bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-md border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function Separator$1({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root$1, {
|
|
64
|
+
"data-slot": "separator",
|
|
65
|
+
decorative,
|
|
66
|
+
orientation,
|
|
67
|
+
className: cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch", className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function Sheet({ ...props }) {
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root, {
|
|
73
|
+
"data-slot": "sheet",
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function SheetPortal({ ...props }) {
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
|
|
79
|
+
"data-slot": "sheet-portal",
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function SheetOverlay({ className, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay, {
|
|
85
|
+
"data-slot": "sheet-overlay",
|
|
86
|
+
className: cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50", className),
|
|
87
|
+
...props
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function SheetContent({ className, children, side = "right", showCloseButton = true, ...props }) {
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetPortal, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetOverlay, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, {
|
|
92
|
+
"data-slot": "sheet-content",
|
|
93
|
+
"data-side": side,
|
|
94
|
+
className: cn("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col bg-clip-padding text-xs/relaxed shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className),
|
|
95
|
+
...props,
|
|
96
|
+
children: [children, showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
|
|
97
|
+
"data-slot": "sheet-close",
|
|
98
|
+
asChild: true,
|
|
99
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, {
|
|
100
|
+
variant: "ghost",
|
|
101
|
+
className: "absolute top-4 right-4",
|
|
102
|
+
size: "icon-sm",
|
|
103
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
104
|
+
className: "sr-only",
|
|
105
|
+
children: "Close"
|
|
106
|
+
})]
|
|
107
|
+
})
|
|
108
|
+
})]
|
|
109
|
+
})] });
|
|
110
|
+
}
|
|
111
|
+
function SheetHeader({ className, ...props }) {
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
113
|
+
"data-slot": "sheet-header",
|
|
114
|
+
className: cn("gap-1.5 p-6 flex flex-col", className),
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function SheetTitle({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, {
|
|
120
|
+
"data-slot": "sheet-title",
|
|
121
|
+
className: cn("text-foreground text-sm font-medium", className),
|
|
122
|
+
...props
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function SheetDescription({ className, ...props }) {
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
|
|
127
|
+
"data-slot": "sheet-description",
|
|
128
|
+
className: cn("text-muted-foreground text-xs/relaxed", className),
|
|
129
|
+
...props
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function Skeleton({ className, ...props }) {
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
134
|
+
"data-slot": "skeleton",
|
|
135
|
+
className: cn("bg-muted rounded-md animate-pulse", className),
|
|
136
|
+
...props
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, {
|
|
141
|
+
"data-slot": "tooltip-provider",
|
|
142
|
+
delayDuration,
|
|
143
|
+
...props
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function Tooltip$1({ ...props }) {
|
|
147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root3, {
|
|
148
|
+
"data-slot": "tooltip",
|
|
149
|
+
...props
|
|
150
|
+
}) });
|
|
151
|
+
}
|
|
152
|
+
function TooltipTrigger({ ...props }) {
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {
|
|
154
|
+
"data-slot": "tooltip-trigger",
|
|
155
|
+
...props
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$1, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content2, {
|
|
160
|
+
"data-slot": "tooltip-content",
|
|
161
|
+
sideOffset,
|
|
162
|
+
className: cn("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs **:data-[slot=kbd]:rounded-md bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)", className),
|
|
163
|
+
...props,
|
|
164
|
+
children: [children, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow2, { className: "size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%_-_2px)]" })]
|
|
165
|
+
}) });
|
|
166
|
+
}
|
|
167
|
+
var MOBILE_BREAKPOINT = 768;
|
|
168
|
+
function useIsMobile() {
|
|
169
|
+
const [isMobile, setIsMobile] = import_react.useState(void 0);
|
|
170
|
+
import_react.useEffect(() => {
|
|
171
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
172
|
+
const onChange = () => {
|
|
173
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
174
|
+
};
|
|
175
|
+
mql.addEventListener("change", onChange);
|
|
176
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
177
|
+
return () => mql.removeEventListener("change", onChange);
|
|
178
|
+
}, []);
|
|
179
|
+
return !!isMobile;
|
|
180
|
+
}
|
|
181
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
182
|
+
var SIDEBAR_COOKIE_MAX_AGE = 3600 * 24 * 7;
|
|
183
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
184
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
185
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
186
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
187
|
+
var SidebarContext = import_react.createContext(null);
|
|
188
|
+
function useSidebar() {
|
|
189
|
+
const context = import_react.useContext(SidebarContext);
|
|
190
|
+
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
191
|
+
return context;
|
|
192
|
+
}
|
|
193
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
194
|
+
const isMobile = useIsMobile();
|
|
195
|
+
const [openMobile, setOpenMobile] = import_react.useState(false);
|
|
196
|
+
const [_open, _setOpen] = import_react.useState(defaultOpen);
|
|
197
|
+
const open = openProp ?? _open;
|
|
198
|
+
const setOpen = import_react.useCallback((value) => {
|
|
199
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
200
|
+
if (setOpenProp) setOpenProp(openState);
|
|
201
|
+
else _setOpen(openState);
|
|
202
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
203
|
+
}, [setOpenProp, open]);
|
|
204
|
+
const toggleSidebar = import_react.useCallback(() => {
|
|
205
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
206
|
+
}, [
|
|
207
|
+
isMobile,
|
|
208
|
+
setOpen,
|
|
209
|
+
setOpenMobile
|
|
210
|
+
]);
|
|
211
|
+
import_react.useEffect(() => {
|
|
212
|
+
const handleKeyDown = (event) => {
|
|
213
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
214
|
+
event.preventDefault();
|
|
215
|
+
toggleSidebar();
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
219
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
220
|
+
}, [toggleSidebar]);
|
|
221
|
+
const state = open ? "expanded" : "collapsed";
|
|
222
|
+
const contextValue = import_react.useMemo(() => ({
|
|
223
|
+
state,
|
|
224
|
+
open,
|
|
225
|
+
setOpen,
|
|
226
|
+
isMobile,
|
|
227
|
+
openMobile,
|
|
228
|
+
setOpenMobile,
|
|
229
|
+
toggleSidebar
|
|
230
|
+
}), [
|
|
231
|
+
state,
|
|
232
|
+
open,
|
|
233
|
+
setOpen,
|
|
234
|
+
isMobile,
|
|
235
|
+
openMobile,
|
|
236
|
+
setOpenMobile,
|
|
237
|
+
toggleSidebar
|
|
238
|
+
]);
|
|
239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidebarContext.Provider, {
|
|
240
|
+
value: contextValue,
|
|
241
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
242
|
+
"data-slot": "sidebar-wrapper",
|
|
243
|
+
style: {
|
|
244
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
245
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
246
|
+
...style
|
|
247
|
+
},
|
|
248
|
+
className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", className),
|
|
249
|
+
...props,
|
|
250
|
+
children
|
|
251
|
+
})
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offExamples", className, children, ...props }) {
|
|
255
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
256
|
+
if (collapsible === "none") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
257
|
+
"data-slot": "sidebar",
|
|
258
|
+
className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
|
|
259
|
+
...props,
|
|
260
|
+
children
|
|
261
|
+
});
|
|
262
|
+
if (isMobile) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Sheet, {
|
|
263
|
+
open: openMobile,
|
|
264
|
+
onOpenChange: setOpenMobile,
|
|
265
|
+
...props,
|
|
266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetContent, {
|
|
267
|
+
"data-sidebar": "sidebar",
|
|
268
|
+
"data-slot": "sidebar",
|
|
269
|
+
"data-mobile": "true",
|
|
270
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
271
|
+
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
272
|
+
side,
|
|
273
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SheetHeader, {
|
|
274
|
+
className: "sr-only",
|
|
275
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetTitle, { children: "Sidebar" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })]
|
|
276
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
277
|
+
className: "flex h-full w-full flex-col",
|
|
278
|
+
children
|
|
279
|
+
})]
|
|
280
|
+
})
|
|
281
|
+
});
|
|
282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
283
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
284
|
+
"data-state": state,
|
|
285
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
286
|
+
"data-variant": variant,
|
|
287
|
+
"data-side": side,
|
|
288
|
+
"data-slot": "sidebar",
|
|
289
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
290
|
+
"data-slot": "sidebar-gap",
|
|
291
|
+
className: cn("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent", "group-data-[collapsible=offExamples]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
292
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
293
|
+
"data-slot": "sidebar-container",
|
|
294
|
+
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", side === "left" ? "left-0 group-data-[collapsible=offExamples]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offExamples]:right-[calc(var(--sidebar-width)*-1)]", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
295
|
+
...props,
|
|
296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
297
|
+
"data-sidebar": "sidebar",
|
|
298
|
+
"data-slot": "sidebar-inner",
|
|
299
|
+
className: "bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",
|
|
300
|
+
children
|
|
301
|
+
})
|
|
302
|
+
})]
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
306
|
+
const { toggleSidebar } = useSidebar();
|
|
307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, {
|
|
308
|
+
"data-sidebar": "trigger",
|
|
309
|
+
"data-slot": "sidebar-trigger",
|
|
310
|
+
variant: "ghost",
|
|
311
|
+
size: "icon-sm",
|
|
312
|
+
className: cn(className),
|
|
313
|
+
onClick: (event) => {
|
|
314
|
+
onClick?.(event);
|
|
315
|
+
toggleSidebar();
|
|
316
|
+
},
|
|
317
|
+
...props,
|
|
318
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelLeft, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
319
|
+
className: "sr-only",
|
|
320
|
+
children: "Toggle Sidebar"
|
|
321
|
+
})]
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
function SidebarInset({ className, ...props }) {
|
|
325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("main", {
|
|
326
|
+
"data-slot": "sidebar-inset",
|
|
327
|
+
className: cn("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col", className),
|
|
328
|
+
...props
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
function SidebarHeader({ className, ...props }) {
|
|
332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
333
|
+
"data-slot": "sidebar-header",
|
|
334
|
+
"data-sidebar": "header",
|
|
335
|
+
className: cn("gap-2 p-2 flex flex-col", className),
|
|
336
|
+
...props
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function SidebarFooter({ className, ...props }) {
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
341
|
+
"data-slot": "sidebar-footer",
|
|
342
|
+
"data-sidebar": "footer",
|
|
343
|
+
className: cn("gap-2 p-2 flex flex-col", className),
|
|
344
|
+
...props
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
function SidebarContent({ className, ...props }) {
|
|
348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
349
|
+
"data-slot": "sidebar-content",
|
|
350
|
+
"data-sidebar": "content",
|
|
351
|
+
className: cn("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
|
|
352
|
+
...props
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
function SidebarGroup({ className, ...props }) {
|
|
356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
357
|
+
"data-slot": "sidebar-group",
|
|
358
|
+
"data-sidebar": "group",
|
|
359
|
+
className: cn("px-2 py-1 relative flex w-full min-w-0 flex-col", className),
|
|
360
|
+
...props
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(asChild ? Slot : "div", {
|
|
365
|
+
"data-slot": "sidebar-group-label",
|
|
366
|
+
"data-sidebar": "group-label",
|
|
367
|
+
className: cn("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0", className),
|
|
368
|
+
...props
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
373
|
+
"data-slot": "sidebar-group-content",
|
|
374
|
+
"data-sidebar": "group-content",
|
|
375
|
+
className: cn("text-xs w-full", className),
|
|
376
|
+
...props
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
function SidebarMenu({ className, ...props }) {
|
|
380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
|
|
381
|
+
"data-slot": "sidebar-menu",
|
|
382
|
+
"data-sidebar": "menu",
|
|
383
|
+
className: cn("gap-px flex w-full min-w-0 flex-col", className),
|
|
384
|
+
...props
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", {
|
|
389
|
+
"data-slot": "sidebar-menu-item",
|
|
390
|
+
"data-sidebar": "menu-item",
|
|
391
|
+
className: cn("group/menu-item relative", className),
|
|
392
|
+
...props
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
var sidebarMenuButtonVariants = cva("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
396
|
+
variants: {
|
|
397
|
+
variant: {
|
|
398
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
399
|
+
outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
400
|
+
},
|
|
401
|
+
size: {
|
|
402
|
+
default: "h-8 text-xs",
|
|
403
|
+
sm: "h-7 text-xs",
|
|
404
|
+
lg: "h-12 text-xs group-data-[collapsible=icon]:p-0!"
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
defaultVariants: {
|
|
408
|
+
variant: "default",
|
|
409
|
+
size: "default"
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
function SidebarMenuButton({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
413
|
+
const Comp = asChild ? Slot : "button";
|
|
414
|
+
const { isMobile, state } = useSidebar();
|
|
415
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, {
|
|
416
|
+
"data-slot": "sidebar-menu-button",
|
|
417
|
+
"data-sidebar": "menu-button",
|
|
418
|
+
"data-size": size,
|
|
419
|
+
"data-active": isActive,
|
|
420
|
+
className: cn(sidebarMenuButtonVariants({
|
|
421
|
+
variant,
|
|
422
|
+
size
|
|
423
|
+
}), className),
|
|
424
|
+
...props
|
|
425
|
+
});
|
|
426
|
+
if (!tooltip) return button;
|
|
427
|
+
if (typeof tooltip === "string") tooltip = { children: tooltip };
|
|
428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tooltip$1, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger, {
|
|
429
|
+
asChild: true,
|
|
430
|
+
children: button
|
|
431
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, {
|
|
432
|
+
side: "right",
|
|
433
|
+
align: "center",
|
|
434
|
+
hidden: state !== "collapsed" || isMobile,
|
|
435
|
+
...tooltip
|
|
436
|
+
})] });
|
|
437
|
+
}
|
|
438
|
+
//#endregion
|
|
439
|
+
export { Tooltip$1 as C, cn as D, TooltipTrigger as E, Skeleton as S, TooltipProvider as T, SidebarMenu as _, SheetContent as a, SidebarProvider as b, SheetTitle as c, SidebarFooter as d, SidebarGroup as f, SidebarInset as g, SidebarHeader as h, Sheet as i, Sidebar as l, SidebarGroupLabel as m, Input as n, SheetDescription as o, SidebarGroupContent as p, Separator$1 as r, SheetHeader as s, Button as t, SidebarContent as u, SidebarMenuButton as v, TooltipContent as w, SidebarTrigger as x, SidebarMenuItem as y };
|