@szum-tech/design-system 3.15.0 → 3.16.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/dist/{chunk-3MH6P44N.js → chunk-3DP3VMPN.js} +1 -1
- package/dist/{chunk-XJIUGEPN.js → chunk-A72LE53B.js} +1 -1
- package/dist/{chunk-UIOBJSKZ.cjs → chunk-DUAM4RTP.cjs} +1 -1
- package/dist/{chunk-XY3ZNUWR.cjs → chunk-F7NFSDOD.cjs} +17 -4
- package/dist/{chunk-DTYX7CYN.cjs → chunk-HPICKLBZ.cjs} +2 -2
- package/dist/chunk-KTAIBRTH.cjs +10 -0
- package/dist/{chunk-KGGCA634.js → chunk-L2TRMQNN.js} +1 -1
- package/dist/{chunk-PTZVUZNQ.cjs → chunk-MFTNHVPZ.cjs} +556 -5
- package/dist/chunk-NXEZE7LG.js +15 -0
- package/dist/{chunk-OH323B3O.js → chunk-OIM2X2NK.js} +531 -5
- package/dist/chunk-OXZQGDTR.js +208 -0
- package/dist/{chunk-4IGU5SVP.js → chunk-P4IL77YC.js} +16 -4
- package/dist/{chunk-CAIAZGSW.cjs → chunk-RKFU4DS3.cjs} +2 -2
- package/dist/chunk-SHPJGB2L.cjs +19 -0
- package/dist/{chunk-CFJ44JVK.cjs → chunk-UNOMGKAZ.cjs} +2 -2
- package/dist/{chunk-Q2MJKFIE.js → chunk-WCQ5WKCQ.js} +1 -1
- package/dist/chunk-X7WREEFD.js +8 -0
- package/dist/chunk-YBFG2IRJ.cjs +225 -0
- package/dist/components/badge-overflow/index.cjs +2 -2
- package/dist/components/badge-overflow/index.js +1 -1
- package/dist/components/button/index.cjs +19 -16
- package/dist/components/button/index.js +18 -15
- package/dist/components/carousel/index.cjs +20 -17
- package/dist/components/carousel/index.js +18 -15
- package/dist/components/collapsible/index.cjs +18 -0
- package/dist/components/collapsible/index.d.cts +12 -0
- package/dist/components/collapsible/index.d.ts +12 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/color-picker/index.cjs +29 -26
- package/dist/components/color-picker/index.js +18 -15
- package/dist/components/dropdown-menu/index.cjs +71 -0
- package/dist/components/dropdown-menu/index.d.cts +67 -0
- package/dist/components/dropdown-menu/index.d.ts +67 -0
- package/dist/components/dropdown-menu/index.js +2 -0
- package/dist/components/field/index.cjs +12 -12
- package/dist/components/field/index.js +2 -2
- package/dist/components/index.cjs +332 -149
- package/dist/components/index.d.cts +6 -1
- package/dist/components/index.d.ts +6 -1
- package/dist/components/index.js +18 -15
- package/dist/components/item/index.cjs +12 -12
- package/dist/components/item/index.js +2 -2
- package/dist/components/masonry/index.cjs +4 -4
- package/dist/components/masonry/index.js +2 -2
- package/dist/components/separator/index.cjs +2 -2
- package/dist/components/separator/index.js +1 -1
- package/dist/components/sidebar/index.cjs +148 -0
- package/dist/components/sidebar/index.d.cts +135 -0
- package/dist/components/sidebar/index.d.ts +135 -0
- package/dist/components/sidebar/index.js +43 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +7 -0
- package/dist/components/skeleton/index.d.ts +7 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/stepper/index.cjs +37 -34
- package/dist/components/stepper/index.js +18 -15
- package/dist/components/timeline/index.cjs +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toaster/index.cjs +20 -17
- package/dist/components/toaster/index.js +18 -15
- package/dist/components/tooltip/index.d.cts +2 -4
- package/dist/components/tooltip/index.d.ts +2 -4
- package/dist/hooks/index.cjs +8 -4
- package/dist/hooks/index.d.cts +3 -1
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/index.js +1 -1
- package/dist/tooltip-content-DqtogPBq.d.cts +8 -0
- package/dist/tooltip-content-DqtogPBq.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { useDirection, useComposedRefs as useComposedRefs$1 } from './chunk-VK2FJ65F.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Popover, PopoverTrigger, PopoverContent } from './chunk-IZU3KULT.js';
|
|
2
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-U7XZJQ4O.js';
|
|
4
3
|
import { Select, SelectContent, SelectItem } from './chunk-XKCLVPUC.js';
|
|
4
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from './chunk-H5NHGMSQ.js';
|
|
5
|
+
import { Skeleton } from './chunk-X7WREEFD.js';
|
|
6
|
+
import { Spinner } from './chunk-P5IUC7HJ.js';
|
|
5
7
|
import { Input } from './chunk-S3ZUFD6U.js';
|
|
6
|
-
import {
|
|
8
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-IZU3KULT.js';
|
|
9
|
+
import { Separator } from './chunk-A72LE53B.js';
|
|
10
|
+
import { useComposedRefs, useIsMobile } from './chunk-P4IL77YC.js';
|
|
7
11
|
import { useLazyRef, useAsRef, useIsomorphicLayoutEffect } from './chunk-G24PWQKG.js';
|
|
8
12
|
import { cn } from './chunk-ZD2QRAOX.js';
|
|
9
13
|
import * as React16 from 'react';
|
|
10
14
|
import { Slot as Slot$1 } from '@radix-ui/react-slot';
|
|
11
15
|
import { Direction, Slot, Slider } from 'radix-ui';
|
|
12
16
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
-
import { PipetteIcon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon } from 'lucide-react';
|
|
17
|
+
import { PipetteIcon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, PanelLeftIcon } from 'lucide-react';
|
|
14
18
|
import { cva } from 'class-variance-authority';
|
|
15
19
|
import { Toaster as Toaster$1 } from 'sonner';
|
|
16
20
|
export { toast } from 'sonner';
|
|
@@ -2183,6 +2187,528 @@ var Toaster = ({ theme = "system", ...props }) => {
|
|
|
2183
2187
|
}
|
|
2184
2188
|
);
|
|
2185
2189
|
};
|
|
2190
|
+
|
|
2191
|
+
// src/components/sidebar/sidebar.constants.ts
|
|
2192
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
2193
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
2194
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
2195
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
2196
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
2197
|
+
var SIDEBAR_ROOT_NAME = "SidebarProvider";
|
|
2198
|
+
var SidebarContext = React16.createContext(null);
|
|
2199
|
+
function useSidebarContext(consumerName) {
|
|
2200
|
+
const context = React16.useContext(SidebarContext);
|
|
2201
|
+
if (!context) {
|
|
2202
|
+
throw new Error(`\`${consumerName}\` must be used within \`${SIDEBAR_ROOT_NAME}\``);
|
|
2203
|
+
}
|
|
2204
|
+
return context;
|
|
2205
|
+
}
|
|
2206
|
+
function useSidebar() {
|
|
2207
|
+
return useSidebarContext("useSidebar");
|
|
2208
|
+
}
|
|
2209
|
+
function SidebarProvider({
|
|
2210
|
+
defaultOpen = true,
|
|
2211
|
+
open: openProp,
|
|
2212
|
+
onOpenChange: setOpenProp,
|
|
2213
|
+
className,
|
|
2214
|
+
style,
|
|
2215
|
+
children,
|
|
2216
|
+
...props
|
|
2217
|
+
}) {
|
|
2218
|
+
const isMobile = useIsMobile();
|
|
2219
|
+
const [openMobile, setOpenMobile] = React16.useState(false);
|
|
2220
|
+
const [_open, _setOpen] = React16.useState(defaultOpen);
|
|
2221
|
+
const open = openProp ?? _open;
|
|
2222
|
+
const setOpen = React16.useCallback(
|
|
2223
|
+
(value) => {
|
|
2224
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
2225
|
+
if (setOpenProp) {
|
|
2226
|
+
setOpenProp(openState);
|
|
2227
|
+
} else {
|
|
2228
|
+
_setOpen(openState);
|
|
2229
|
+
}
|
|
2230
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
2231
|
+
},
|
|
2232
|
+
[setOpenProp, open]
|
|
2233
|
+
);
|
|
2234
|
+
const toggleSidebar = React16.useCallback(() => {
|
|
2235
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
2236
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
2237
|
+
React16.useEffect(() => {
|
|
2238
|
+
const handleKeyDown = (event) => {
|
|
2239
|
+
if (event.key === "b" && (event.metaKey || event.ctrlKey)) {
|
|
2240
|
+
event.preventDefault();
|
|
2241
|
+
toggleSidebar();
|
|
2242
|
+
}
|
|
2243
|
+
};
|
|
2244
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
2245
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2246
|
+
}, [toggleSidebar]);
|
|
2247
|
+
const state = open ? "expanded" : "collapsed";
|
|
2248
|
+
const contextValue = React16.useMemo(
|
|
2249
|
+
() => ({ state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar }),
|
|
2250
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
2251
|
+
);
|
|
2252
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
2253
|
+
"div",
|
|
2254
|
+
{
|
|
2255
|
+
"data-slot": "sidebar-wrapper",
|
|
2256
|
+
style: {
|
|
2257
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
2258
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
2259
|
+
...style
|
|
2260
|
+
},
|
|
2261
|
+
className: cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", className),
|
|
2262
|
+
...props,
|
|
2263
|
+
children
|
|
2264
|
+
}
|
|
2265
|
+
) });
|
|
2266
|
+
}
|
|
2267
|
+
function Sidebar({
|
|
2268
|
+
side = "left",
|
|
2269
|
+
variant = "sidebar",
|
|
2270
|
+
collapsible = "offcanvas",
|
|
2271
|
+
className,
|
|
2272
|
+
children,
|
|
2273
|
+
dir,
|
|
2274
|
+
...props
|
|
2275
|
+
}) {
|
|
2276
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebarContext("Sidebar");
|
|
2277
|
+
if (collapsible === "none") {
|
|
2278
|
+
return /* @__PURE__ */ jsx(
|
|
2279
|
+
"div",
|
|
2280
|
+
{
|
|
2281
|
+
"data-slot": "sidebar",
|
|
2282
|
+
className: cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", className),
|
|
2283
|
+
...props,
|
|
2284
|
+
children
|
|
2285
|
+
}
|
|
2286
|
+
);
|
|
2287
|
+
}
|
|
2288
|
+
if (isMobile) {
|
|
2289
|
+
return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
|
|
2290
|
+
SheetContent,
|
|
2291
|
+
{
|
|
2292
|
+
dir,
|
|
2293
|
+
"data-sidebar": "sidebar",
|
|
2294
|
+
"data-slot": "sidebar",
|
|
2295
|
+
"data-mobile": "true",
|
|
2296
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0",
|
|
2297
|
+
style: { "--sidebar-width": SIDEBAR_WIDTH_MOBILE },
|
|
2298
|
+
side,
|
|
2299
|
+
showCloseButton: false,
|
|
2300
|
+
children: [
|
|
2301
|
+
/* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
|
|
2302
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
|
|
2303
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
2304
|
+
] }),
|
|
2305
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
|
|
2306
|
+
]
|
|
2307
|
+
}
|
|
2308
|
+
) });
|
|
2309
|
+
}
|
|
2310
|
+
return /* @__PURE__ */ jsxs(
|
|
2311
|
+
"div",
|
|
2312
|
+
{
|
|
2313
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
2314
|
+
"data-state": state,
|
|
2315
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
2316
|
+
"data-variant": variant,
|
|
2317
|
+
"data-side": side,
|
|
2318
|
+
"data-slot": "sidebar",
|
|
2319
|
+
children: [
|
|
2320
|
+
/* @__PURE__ */ jsx(
|
|
2321
|
+
"div",
|
|
2322
|
+
{
|
|
2323
|
+
"data-slot": "sidebar-gap",
|
|
2324
|
+
className: cn(
|
|
2325
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
2326
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
2327
|
+
"group-data-[side=right]:rotate-180",
|
|
2328
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
2329
|
+
)
|
|
2330
|
+
}
|
|
2331
|
+
),
|
|
2332
|
+
/* @__PURE__ */ jsx(
|
|
2333
|
+
"div",
|
|
2334
|
+
{
|
|
2335
|
+
"data-slot": "sidebar-container",
|
|
2336
|
+
"data-side": side,
|
|
2337
|
+
className: cn(
|
|
2338
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
|
|
2339
|
+
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",
|
|
2340
|
+
className
|
|
2341
|
+
),
|
|
2342
|
+
...props,
|
|
2343
|
+
children: /* @__PURE__ */ jsx(
|
|
2344
|
+
"div",
|
|
2345
|
+
{
|
|
2346
|
+
"data-sidebar": "sidebar",
|
|
2347
|
+
"data-slot": "sidebar-inner",
|
|
2348
|
+
className: "bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1",
|
|
2349
|
+
children
|
|
2350
|
+
}
|
|
2351
|
+
)
|
|
2352
|
+
}
|
|
2353
|
+
)
|
|
2354
|
+
]
|
|
2355
|
+
}
|
|
2356
|
+
);
|
|
2357
|
+
}
|
|
2358
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
2359
|
+
const { toggleSidebar } = useSidebarContext("SidebarTrigger");
|
|
2360
|
+
return /* @__PURE__ */ jsxs(
|
|
2361
|
+
Button,
|
|
2362
|
+
{
|
|
2363
|
+
"data-sidebar": "trigger",
|
|
2364
|
+
"data-slot": "sidebar-trigger",
|
|
2365
|
+
variant: "ghost",
|
|
2366
|
+
size: "icon-sm",
|
|
2367
|
+
className: cn(className),
|
|
2368
|
+
onClick: (event) => {
|
|
2369
|
+
onClick?.(event);
|
|
2370
|
+
toggleSidebar();
|
|
2371
|
+
},
|
|
2372
|
+
...props,
|
|
2373
|
+
children: [
|
|
2374
|
+
/* @__PURE__ */ jsx(PanelLeftIcon, { className: "cn-rtl-flip" }),
|
|
2375
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
2376
|
+
]
|
|
2377
|
+
}
|
|
2378
|
+
);
|
|
2379
|
+
}
|
|
2380
|
+
function SidebarRail({ className, ...props }) {
|
|
2381
|
+
const { toggleSidebar } = useSidebarContext("SidebarRail");
|
|
2382
|
+
return /* @__PURE__ */ jsx(
|
|
2383
|
+
"button",
|
|
2384
|
+
{
|
|
2385
|
+
"data-sidebar": "rail",
|
|
2386
|
+
"data-slot": "sidebar-rail",
|
|
2387
|
+
"aria-label": "Toggle Sidebar",
|
|
2388
|
+
tabIndex: -1,
|
|
2389
|
+
onClick: toggleSidebar,
|
|
2390
|
+
title: "Toggle Sidebar",
|
|
2391
|
+
className: cn(
|
|
2392
|
+
"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
|
|
2393
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
2394
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
2395
|
+
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
2396
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
2397
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
2398
|
+
className
|
|
2399
|
+
),
|
|
2400
|
+
...props
|
|
2401
|
+
}
|
|
2402
|
+
);
|
|
2403
|
+
}
|
|
2404
|
+
function SidebarInset({ className, ...props }) {
|
|
2405
|
+
return /* @__PURE__ */ jsx(
|
|
2406
|
+
"main",
|
|
2407
|
+
{
|
|
2408
|
+
"data-slot": "sidebar-inset",
|
|
2409
|
+
className: cn(
|
|
2410
|
+
"bg-background relative flex w-full flex-1 flex-col md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
2411
|
+
className
|
|
2412
|
+
),
|
|
2413
|
+
...props
|
|
2414
|
+
}
|
|
2415
|
+
);
|
|
2416
|
+
}
|
|
2417
|
+
function SidebarInput({ className, ...props }) {
|
|
2418
|
+
return /* @__PURE__ */ jsx(
|
|
2419
|
+
Input,
|
|
2420
|
+
{
|
|
2421
|
+
"data-slot": "sidebar-input",
|
|
2422
|
+
"data-sidebar": "input",
|
|
2423
|
+
className: cn("bg-background h-8 w-full shadow-none", className),
|
|
2424
|
+
...props
|
|
2425
|
+
}
|
|
2426
|
+
);
|
|
2427
|
+
}
|
|
2428
|
+
function SidebarHeader({ className, ...props }) {
|
|
2429
|
+
return /* @__PURE__ */ jsx(
|
|
2430
|
+
"div",
|
|
2431
|
+
{
|
|
2432
|
+
"data-slot": "sidebar-header",
|
|
2433
|
+
"data-sidebar": "header",
|
|
2434
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
2435
|
+
...props
|
|
2436
|
+
}
|
|
2437
|
+
);
|
|
2438
|
+
}
|
|
2439
|
+
function SidebarFooter({ className, ...props }) {
|
|
2440
|
+
return /* @__PURE__ */ jsx(
|
|
2441
|
+
"div",
|
|
2442
|
+
{
|
|
2443
|
+
"data-slot": "sidebar-footer",
|
|
2444
|
+
"data-sidebar": "footer",
|
|
2445
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
2446
|
+
...props
|
|
2447
|
+
}
|
|
2448
|
+
);
|
|
2449
|
+
}
|
|
2450
|
+
function SidebarSeparator({ className, ...props }) {
|
|
2451
|
+
return /* @__PURE__ */ jsx(
|
|
2452
|
+
Separator,
|
|
2453
|
+
{
|
|
2454
|
+
"data-slot": "sidebar-separator",
|
|
2455
|
+
"data-sidebar": "separator",
|
|
2456
|
+
className: cn("bg-sidebar-border mx-2 w-auto", className),
|
|
2457
|
+
...props
|
|
2458
|
+
}
|
|
2459
|
+
);
|
|
2460
|
+
}
|
|
2461
|
+
function SidebarContent({ className, ...props }) {
|
|
2462
|
+
return /* @__PURE__ */ jsx(
|
|
2463
|
+
"div",
|
|
2464
|
+
{
|
|
2465
|
+
"data-slot": "sidebar-content",
|
|
2466
|
+
"data-sidebar": "content",
|
|
2467
|
+
className: cn(
|
|
2468
|
+
"no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
2469
|
+
className
|
|
2470
|
+
),
|
|
2471
|
+
...props
|
|
2472
|
+
}
|
|
2473
|
+
);
|
|
2474
|
+
}
|
|
2475
|
+
function SidebarGroup({ className, ...props }) {
|
|
2476
|
+
return /* @__PURE__ */ jsx(
|
|
2477
|
+
"div",
|
|
2478
|
+
{
|
|
2479
|
+
"data-slot": "sidebar-group",
|
|
2480
|
+
"data-sidebar": "group",
|
|
2481
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
2482
|
+
...props
|
|
2483
|
+
}
|
|
2484
|
+
);
|
|
2485
|
+
}
|
|
2486
|
+
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
2487
|
+
const Comp = asChild ? Slot$1 : "div";
|
|
2488
|
+
return /* @__PURE__ */ jsx(
|
|
2489
|
+
Comp,
|
|
2490
|
+
{
|
|
2491
|
+
"data-slot": "sidebar-group-label",
|
|
2492
|
+
"data-sidebar": "group-label",
|
|
2493
|
+
className: cn(
|
|
2494
|
+
"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2495
|
+
className
|
|
2496
|
+
),
|
|
2497
|
+
...props
|
|
2498
|
+
}
|
|
2499
|
+
);
|
|
2500
|
+
}
|
|
2501
|
+
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
2502
|
+
const Comp = asChild ? Slot$1 : "button";
|
|
2503
|
+
return /* @__PURE__ */ jsx(
|
|
2504
|
+
Comp,
|
|
2505
|
+
{
|
|
2506
|
+
"data-slot": "sidebar-group-action",
|
|
2507
|
+
"data-sidebar": "group-action",
|
|
2508
|
+
className: cn(
|
|
2509
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2510
|
+
className
|
|
2511
|
+
),
|
|
2512
|
+
...props
|
|
2513
|
+
}
|
|
2514
|
+
);
|
|
2515
|
+
}
|
|
2516
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
2517
|
+
return /* @__PURE__ */ jsx(
|
|
2518
|
+
"div",
|
|
2519
|
+
{
|
|
2520
|
+
"data-slot": "sidebar-group-content",
|
|
2521
|
+
"data-sidebar": "group-content",
|
|
2522
|
+
className: cn("w-full text-sm", className),
|
|
2523
|
+
...props
|
|
2524
|
+
}
|
|
2525
|
+
);
|
|
2526
|
+
}
|
|
2527
|
+
function SidebarMenu({ className, ...props }) {
|
|
2528
|
+
return /* @__PURE__ */ jsx(
|
|
2529
|
+
"ul",
|
|
2530
|
+
{
|
|
2531
|
+
"data-slot": "sidebar-menu",
|
|
2532
|
+
"data-sidebar": "menu",
|
|
2533
|
+
className: cn("flex w-full min-w-0 flex-col gap-0", className),
|
|
2534
|
+
...props
|
|
2535
|
+
}
|
|
2536
|
+
);
|
|
2537
|
+
}
|
|
2538
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
2539
|
+
return /* @__PURE__ */ jsx(
|
|
2540
|
+
"li",
|
|
2541
|
+
{
|
|
2542
|
+
"data-slot": "sidebar-menu-item",
|
|
2543
|
+
"data-sidebar": "menu-item",
|
|
2544
|
+
className: cn("group/menu-item relative", className),
|
|
2545
|
+
...props
|
|
2546
|
+
}
|
|
2547
|
+
);
|
|
2548
|
+
}
|
|
2549
|
+
var sidebarMenuButtonVariants = cva(
|
|
2550
|
+
"peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[state-open]:hover:bg-sidebar-accent data-[state-open]:hover:text-sidebar-accent-foreground data-[state-active]:bg-sidebar-accent data-[state-active]:font-medium data-[state-active]:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
|
|
2551
|
+
{
|
|
2552
|
+
variants: {
|
|
2553
|
+
variant: {
|
|
2554
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
2555
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
2556
|
+
},
|
|
2557
|
+
size: {
|
|
2558
|
+
default: "h-8 text-sm",
|
|
2559
|
+
sm: "h-7 text-xs",
|
|
2560
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
2561
|
+
}
|
|
2562
|
+
},
|
|
2563
|
+
defaultVariants: {
|
|
2564
|
+
variant: "default",
|
|
2565
|
+
size: "default"
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
);
|
|
2569
|
+
function SidebarMenuButton({
|
|
2570
|
+
asChild = false,
|
|
2571
|
+
isActive = false,
|
|
2572
|
+
variant = "default",
|
|
2573
|
+
size = "default",
|
|
2574
|
+
tooltip,
|
|
2575
|
+
className,
|
|
2576
|
+
...props
|
|
2577
|
+
}) {
|
|
2578
|
+
const Comp = asChild ? Slot$1 : "button";
|
|
2579
|
+
const { isMobile, state } = useSidebarContext("SidebarMenuButton");
|
|
2580
|
+
const button = /* @__PURE__ */ jsx(
|
|
2581
|
+
Comp,
|
|
2582
|
+
{
|
|
2583
|
+
"data-slot": "sidebar-menu-button",
|
|
2584
|
+
"data-sidebar": "menu-button",
|
|
2585
|
+
"data-size": size,
|
|
2586
|
+
"data-active": isActive,
|
|
2587
|
+
className: cn(sidebarMenuButtonVariants({ variant, size }), className),
|
|
2588
|
+
...props
|
|
2589
|
+
}
|
|
2590
|
+
);
|
|
2591
|
+
if (!tooltip) {
|
|
2592
|
+
return button;
|
|
2593
|
+
}
|
|
2594
|
+
if (typeof tooltip === "string") {
|
|
2595
|
+
tooltip = { children: tooltip };
|
|
2596
|
+
}
|
|
2597
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
2598
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
|
|
2599
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", align: "center", hidden: state !== "collapsed" || isMobile, ...tooltip })
|
|
2600
|
+
] });
|
|
2601
|
+
}
|
|
2602
|
+
function SidebarMenuAction({
|
|
2603
|
+
className,
|
|
2604
|
+
asChild = false,
|
|
2605
|
+
showOnHover = false,
|
|
2606
|
+
...props
|
|
2607
|
+
}) {
|
|
2608
|
+
const Comp = asChild ? Slot$1 : "button";
|
|
2609
|
+
return /* @__PURE__ */ jsx(
|
|
2610
|
+
Comp,
|
|
2611
|
+
{
|
|
2612
|
+
"data-slot": "sidebar-menu-action",
|
|
2613
|
+
"data-sidebar": "menu-action",
|
|
2614
|
+
className: cn(
|
|
2615
|
+
"text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded p-0 outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2616
|
+
showOnHover && "peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",
|
|
2617
|
+
className
|
|
2618
|
+
),
|
|
2619
|
+
...props
|
|
2620
|
+
}
|
|
2621
|
+
);
|
|
2622
|
+
}
|
|
2623
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
2624
|
+
return /* @__PURE__ */ jsx(
|
|
2625
|
+
"div",
|
|
2626
|
+
{
|
|
2627
|
+
"data-slot": "sidebar-menu-badge",
|
|
2628
|
+
"data-sidebar": "menu-badge",
|
|
2629
|
+
className: cn(
|
|
2630
|
+
"text-sidebar-foreground peer-hover/menu-button:text-sidebar-accent-foreground peer-data-active/menu-button:text-sidebar-accent-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none group-data-[collapsible=icon]:hidden peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1",
|
|
2631
|
+
className
|
|
2632
|
+
),
|
|
2633
|
+
...props
|
|
2634
|
+
}
|
|
2635
|
+
);
|
|
2636
|
+
}
|
|
2637
|
+
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
2638
|
+
const [width] = React16.useState(() => {
|
|
2639
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
2640
|
+
});
|
|
2641
|
+
return /* @__PURE__ */ jsxs(
|
|
2642
|
+
"div",
|
|
2643
|
+
{
|
|
2644
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
2645
|
+
"data-sidebar": "menu-skeleton",
|
|
2646
|
+
className: cn("flex h-8 items-center gap-2 rounded px-2", className),
|
|
2647
|
+
...props,
|
|
2648
|
+
children: [
|
|
2649
|
+
showIcon && /* @__PURE__ */ jsx(Skeleton, { className: "size-4 rounded", "data-sidebar": "menu-skeleton-icon" }),
|
|
2650
|
+
/* @__PURE__ */ jsx(
|
|
2651
|
+
Skeleton,
|
|
2652
|
+
{
|
|
2653
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
2654
|
+
"data-sidebar": "menu-skeleton-text",
|
|
2655
|
+
style: {
|
|
2656
|
+
"--skeleton-width": width
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
)
|
|
2660
|
+
]
|
|
2661
|
+
}
|
|
2662
|
+
);
|
|
2663
|
+
}
|
|
2664
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
2665
|
+
return /* @__PURE__ */ jsx(
|
|
2666
|
+
"ul",
|
|
2667
|
+
{
|
|
2668
|
+
"data-slot": "sidebar-menu-sub",
|
|
2669
|
+
"data-sidebar": "menu-sub",
|
|
2670
|
+
className: cn(
|
|
2671
|
+
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
|
|
2672
|
+
className
|
|
2673
|
+
),
|
|
2674
|
+
...props
|
|
2675
|
+
}
|
|
2676
|
+
);
|
|
2677
|
+
}
|
|
2678
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
2679
|
+
return /* @__PURE__ */ jsx(
|
|
2680
|
+
"li",
|
|
2681
|
+
{
|
|
2682
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
2683
|
+
"data-sidebar": "menu-sub-item",
|
|
2684
|
+
className: cn("group/menu-sub-item relative", className),
|
|
2685
|
+
...props
|
|
2686
|
+
}
|
|
2687
|
+
);
|
|
2688
|
+
}
|
|
2689
|
+
function SidebarMenuSubButton({
|
|
2690
|
+
asChild = false,
|
|
2691
|
+
size = "md",
|
|
2692
|
+
isActive = false,
|
|
2693
|
+
className,
|
|
2694
|
+
...props
|
|
2695
|
+
}) {
|
|
2696
|
+
const Comp = asChild ? Slot$1 : "a";
|
|
2697
|
+
return /* @__PURE__ */ jsx(
|
|
2698
|
+
Comp,
|
|
2699
|
+
{
|
|
2700
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
2701
|
+
"data-sidebar": "menu-sub-button",
|
|
2702
|
+
"data-size": size,
|
|
2703
|
+
"data-active": isActive,
|
|
2704
|
+
className: cn(
|
|
2705
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[state=active]:bg-sidebar-accent data-[state=active]:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded px-2 outline-hidden group-data-[collapsible=icon]:hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
2706
|
+
className
|
|
2707
|
+
),
|
|
2708
|
+
...props
|
|
2709
|
+
}
|
|
2710
|
+
);
|
|
2711
|
+
}
|
|
2186
2712
|
var buttonVariants = cva(
|
|
2187
2713
|
[
|
|
2188
2714
|
"inline-flex shrink-0 items-center justify-center gap-2 rounded text-sm font-medium whitespace-nowrap transition-all outline-none",
|
|
@@ -2296,4 +2822,4 @@ function ButtonContent({
|
|
|
2296
2822
|
] });
|
|
2297
2823
|
}
|
|
2298
2824
|
|
|
2299
|
-
export { Button, ColorPicker, ColorPickerAlphaSlider, ColorPickerArea, ColorPickerContent, ColorPickerEyeDropper, ColorPickerFormatSelect, ColorPickerHueSlider, ColorPickerInput, ColorPickerSwatch, ColorPickerTrigger, Stepper, StepperActivationMode, StepperContent, StepperDataState, StepperDescription, StepperFocusIntent, StepperIndicator, StepperItem, StepperNav, StepperNavigationDirection, StepperNextTrigger, StepperOrientation, StepperPanel, StepperPrevTrigger, StepperTitle, StepperTrigger, Toaster, useColorPickerStore, useStepperContext, useStepperFocusContext, useStepperItemContext };
|
|
2825
|
+
export { Button, ColorPicker, ColorPickerAlphaSlider, ColorPickerArea, ColorPickerContent, ColorPickerEyeDropper, ColorPickerFormatSelect, ColorPickerHueSlider, ColorPickerInput, ColorPickerSwatch, ColorPickerTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Stepper, StepperActivationMode, StepperContent, StepperDataState, StepperDescription, StepperFocusIntent, StepperIndicator, StepperItem, StepperNav, StepperNavigationDirection, StepperNextTrigger, StepperOrientation, StepperPanel, StepperPrevTrigger, StepperTitle, StepperTrigger, Toaster, useColorPickerStore, useSidebar, useSidebarContext, useStepperContext, useStepperFocusContext, useStepperItemContext };
|