shadcn-glass-ui 2.1.1 → 2.1.4
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/CHANGELOG.md +18 -0
- package/README.md +80 -325
- package/dist/cli/index.cjs +1 -1
- package/dist/components.cjs +4 -4
- package/dist/components.js +1 -1
- package/dist/hooks.cjs +2 -2
- package/dist/index.cjs +1659 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1651 -4
- package/dist/index.js.map +1 -1
- package/dist/r/registry.json +36 -0
- package/dist/r/sidebar-context.json +35 -0
- package/dist/r/sidebar-glass.json +40 -0
- package/dist/r/sidebar-menu.json +39 -0
- package/dist/r/split-layout-accordion.json +24 -0
- package/dist/r/split-layout-context.json +21 -0
- package/dist/r/split-layout-glass.json +25 -0
- package/dist/shadcn-glass-ui.css +1 -1
- package/dist/{theme-context-BHXYJ4RE.cjs → theme-context-Y98bGvcm.cjs} +2 -2
- package/dist/{theme-context-BHXYJ4RE.cjs.map → theme-context-Y98bGvcm.cjs.map} +1 -1
- package/dist/themes.cjs +1 -1
- package/dist/{trust-score-card-glass-CGXmOIfq.cjs → trust-score-card-glass-2rjz00d_.cjs} +47 -5
- package/dist/trust-score-card-glass-2rjz00d_.cjs.map +1 -0
- package/dist/{trust-score-card-glass-L9g0qamo.js → trust-score-card-glass-zjkx4OC2.js} +3 -3
- package/dist/trust-score-card-glass-zjkx4OC2.js.map +1 -0
- package/dist/{use-focus-CeNHOiBa.cjs → use-focus-DbpBEuee.cjs} +2 -2
- package/dist/{use-focus-CeNHOiBa.cjs.map → use-focus-DbpBEuee.cjs.map} +1 -1
- package/dist/{use-wallpaper-tint-Bt2G3g1v.cjs → use-wallpaper-tint-DbawS9zh.cjs} +2 -2
- package/dist/{use-wallpaper-tint-Bt2G3g1v.cjs.map → use-wallpaper-tint-DbawS9zh.cjs.map} +1 -1
- package/dist/{utils-LYxxWvUn.cjs → utils-XlyXIhuP.cjs} +2 -2
- package/dist/{utils-LYxxWvUn.cjs.map → utils-XlyXIhuP.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/docs/GETTING_STARTED.md +3 -3
- package/docs/components/SPLIT_LAYOUT_GLASS.md +607 -0
- package/package.json +1 -2
- package/dist/trust-score-card-glass-CGXmOIfq.cjs.map +0 -1
- package/dist/trust-score-card-glass-L9g0qamo.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { $ as BaseProgressGlass, $t as
|
|
1
|
+
import { $ as BaseProgressGlass, $t as useLayoutEffect2, A as useChartHeight, At as modalSizes, B as adaptEventsOfChild, Bt as DropdownMenuGlassLabel, C as sparklineContainerVariants, Ct as PopoverGlassAnchor, D as Tooltip, Dt as NotificationGlass, E as Cell, Et as PopoverGlassTrigger, F as selectLegendPayload, Ft as DropdownMenuGlass, G as SegmentedControlGlass, Gt as DropdownMenuGlassShortcut, H as isNumber, Ht as DropdownMenuGlassRadioGroup, I as useAppDispatch, It as DropdownMenuGlassCheckboxItem, J as progressSizes, Jt as DropdownMenuGlassSubTrigger, K as RainbowProgressGlass, Kt as DropdownMenuGlassSub, L as useAppSelector, Lt as DropdownMenuGlassContent, M as useMargin, Mt as GlassCard, N as ResponsiveContainer, Nt as cardIntensity, O as setLegendSettings, Ot as notificationVariants, P as useElementOffset, Pt as DropdownGlass, Q as StatusIndicatorGlass, Qt as Presence, R as getUniqPayload, Rt as DropdownMenuGlassGroup, S as sparklineBarVariants, St as PopoverGlass, T as Bar, Tt as PopoverGlassLegacy, U as useLegendPortal, Ut as DropdownMenuGlassRadioItem, V as Symbols, Vt as DropdownMenuGlassPortal, W as Surface, Wt as DropdownMenuGlassSeparator, X as LanguageBarGlass, Xt as ComboBoxGlass, Y as ProfileAvatarGlass, Yt as DropdownMenuGlassTrigger, Z as FlagAlertGlass, Zt as inputVariants, _ as ContributionMetricsGlass, _n as AlertGlassTitle, _t as SliderGlass, a as HeaderBrandingGlass, an as ButtonGlass, at as insightCardVariants, b as AICardGlass, bn as TouchTarget, bt as SkeletonGlass, c as YearCardGlass, cn as badgeVariants, ct as ExpandableHeaderGlass, d as TrustScoreDisplayGlass, dn as AvatarGlassImage, dt as TooltipGlassProvider, en as useCallbackRef, et as ThemeToggleGlass, f as RepositoryMetadataGlass, fn as AvatarGlassSimple, ft as TooltipGlassSimple, g as MetricCardGlass, gn as AlertGlassDescription, gt as TabsGlass, h as MetricsGridGlass, hn as AlertGlass, ht as toggleSizes, i as HeaderNavGlass, in as CheckboxGlass, it as InsightCardGlass, j as useChartWidth, jt as InputGlass, k as setLegendSize, kt as ModalGlass, l as UserStatsLineGlass, ln as AvatarGlass, lt as TooltipGlass, m as RepositoryCardGlass, mn as statusSizes, mt as ToggleGlass, n as ProjectsListGlass, nn as composeEventHandlers, nt as SortDropdownGlass, o as FlagsSectionGlass, on as buttonGlassVariants, ot as insightVariantConfig, p as RepositoryHeaderGlass, pn as avatarSizes, pt as TooltipGlassTrigger, q as ProgressGlass, qt as DropdownMenuGlassSubContent, r as ProfileHeaderGlass, rn as CircularProgressGlass, rt as SearchBoxGlass, s as CareerStatsGlass, sn as BadgeGlass, st as IconButtonGlass, t as TrustScoreCardGlass, tn as useComposedRefs, tt as StatItemGlass, u as UserInfoGlass, un as AvatarGlassFallback, ut as TooltipGlassContent, v as CircularMetricGlass, vn as InteractiveCard, vt as useDirection, w as BarChart, wt as PopoverGlassContent, x as SparklineGlass, xn as alertVariants, xt as skeletonVariants, y as CareerStatsHeaderGlass, yn as FormFieldWrapper, yt as clamp, z as resolveDefaultProps, zt as DropdownMenuGlassItem } from "./trust-score-card-glass-zjkx4OC2.js";
|
|
2
2
|
import { t as cn } from "./utils-CcyeqpKQ.js";
|
|
3
3
|
import { n as useHover, t as useFocus } from "./use-focus-CX0TJJIj.js";
|
|
4
4
|
import { a as getThemeConfig, i as getNextTheme, n as THEME_CONFIG, o as useTheme, r as ThemeProvider, t as THEMES } from "./theme-context-_T5r1KG4.js";
|
|
5
5
|
import { n as useResponsive, t as useWallpaperTint } from "./use-wallpaper-tint-DUgmytlY.js";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
|
-
import { createContext, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
8
|
-
import { Check } from "lucide-react";
|
|
7
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { Check, ChevronDown, Menu, PanelLeft, PanelLeftClose, PanelLeftOpen, X } from "lucide-react";
|
|
9
9
|
import { clsx } from "clsx";
|
|
10
10
|
import { cva } from "class-variance-authority";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Slot, createSlot } from "@radix-ui/react-slot";
|
|
12
13
|
import { createPortal } from "react-dom";
|
|
13
14
|
const stepperRootVariants = cva("flex w-full", {
|
|
14
15
|
variants: { orientation: {
|
|
@@ -370,6 +371,413 @@ const StepperGlass = {
|
|
|
370
371
|
Step: StepperStep,
|
|
371
372
|
Content: StepperContent
|
|
372
373
|
};
|
|
374
|
+
var MOBILE_BREAKPOINT = 768;
|
|
375
|
+
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
376
|
+
var SIDEBAR_COOKIE_MAX_AGE = 3600 * 24 * 7;
|
|
377
|
+
var SidebarContext = createContext(null);
|
|
378
|
+
function useSidebar() {
|
|
379
|
+
const context = useContext(SidebarContext);
|
|
380
|
+
if (!context) throw new Error("useSidebar must be used within SidebarGlass.Provider. Wrap your component tree with <SidebarGlass.Provider>.");
|
|
381
|
+
return context;
|
|
382
|
+
}
|
|
383
|
+
const SidebarProvider = ({ children, open: controlledOpen, onOpenChange, defaultOpen = true, side = "left", variant = "sidebar", collapsible = "offcanvas", cookieName = SIDEBAR_COOKIE_NAME, keyboardShortcut = "b" }) => {
|
|
384
|
+
const [internalOpen, setInternalOpen] = useState(() => {
|
|
385
|
+
if (typeof document !== "undefined") {
|
|
386
|
+
const sidebarCookie = document.cookie.split(";").find((c) => c.trim().startsWith(`${cookieName}=`));
|
|
387
|
+
if (sidebarCookie) return sidebarCookie.split("=")[1] === "true";
|
|
388
|
+
}
|
|
389
|
+
return defaultOpen;
|
|
390
|
+
});
|
|
391
|
+
const isControlled = controlledOpen !== void 0;
|
|
392
|
+
const open = isControlled ? controlledOpen : internalOpen;
|
|
393
|
+
const setOpen = useCallback((value$1) => {
|
|
394
|
+
if (!isControlled) setInternalOpen(value$1);
|
|
395
|
+
onOpenChange?.(value$1);
|
|
396
|
+
if (typeof document !== "undefined") document.cookie = `${cookieName}=${value$1}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
397
|
+
}, [
|
|
398
|
+
isControlled,
|
|
399
|
+
onOpenChange,
|
|
400
|
+
cookieName
|
|
401
|
+
]);
|
|
402
|
+
const [openMobile, setOpenMobile] = useState(false);
|
|
403
|
+
const [isMobile, setIsMobile] = useState(() => {
|
|
404
|
+
if (typeof window === "undefined") return false;
|
|
405
|
+
return window.innerWidth < MOBILE_BREAKPOINT;
|
|
406
|
+
});
|
|
407
|
+
useEffect(() => {
|
|
408
|
+
if (typeof window === "undefined") return;
|
|
409
|
+
const checkMobile = () => {
|
|
410
|
+
const mobile = window.innerWidth < MOBILE_BREAKPOINT;
|
|
411
|
+
setIsMobile(mobile);
|
|
412
|
+
if (!mobile) setOpenMobile(false);
|
|
413
|
+
};
|
|
414
|
+
checkMobile();
|
|
415
|
+
window.addEventListener("resize", checkMobile);
|
|
416
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
417
|
+
}, []);
|
|
418
|
+
const toggleSidebar = useCallback(() => {
|
|
419
|
+
if (isMobile) setOpenMobile((prev) => !prev);
|
|
420
|
+
else setOpen(!open);
|
|
421
|
+
}, [
|
|
422
|
+
isMobile,
|
|
423
|
+
open,
|
|
424
|
+
setOpen
|
|
425
|
+
]);
|
|
426
|
+
useEffect(() => {
|
|
427
|
+
if (!keyboardShortcut) return;
|
|
428
|
+
const handleKeyDown = (e) => {
|
|
429
|
+
if (e.key === keyboardShortcut && (e.metaKey || e.ctrlKey)) {
|
|
430
|
+
e.preventDefault();
|
|
431
|
+
toggleSidebar();
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
435
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
436
|
+
}, [keyboardShortcut, toggleSidebar]);
|
|
437
|
+
const value = useMemo(() => ({
|
|
438
|
+
state: open ? "expanded" : "collapsed",
|
|
439
|
+
open,
|
|
440
|
+
setOpen,
|
|
441
|
+
openMobile,
|
|
442
|
+
setOpenMobile,
|
|
443
|
+
isMobile,
|
|
444
|
+
toggleSidebar,
|
|
445
|
+
side,
|
|
446
|
+
variant,
|
|
447
|
+
collapsible
|
|
448
|
+
}), [
|
|
449
|
+
open,
|
|
450
|
+
setOpen,
|
|
451
|
+
openMobile,
|
|
452
|
+
isMobile,
|
|
453
|
+
toggleSidebar,
|
|
454
|
+
side,
|
|
455
|
+
variant,
|
|
456
|
+
collapsible
|
|
457
|
+
]);
|
|
458
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, {
|
|
459
|
+
value,
|
|
460
|
+
children
|
|
461
|
+
});
|
|
462
|
+
};
|
|
463
|
+
SidebarProvider.displayName = "SidebarGlass.Provider";
|
|
464
|
+
const SidebarRoot = forwardRef(({ children, side: sideProp, variant: variantProp, collapsible: collapsibleProp, className, ...props }, ref) => {
|
|
465
|
+
const context = useSidebar();
|
|
466
|
+
const side = sideProp ?? context.side;
|
|
467
|
+
const variant = variantProp ?? context.variant;
|
|
468
|
+
const collapsible = collapsibleProp ?? context.collapsible;
|
|
469
|
+
const { state, open, openMobile, isMobile, setOpenMobile } = context;
|
|
470
|
+
if (isMobile) return /* @__PURE__ */ jsxs(ModalGlass.Root, {
|
|
471
|
+
open: openMobile,
|
|
472
|
+
onOpenChange: setOpenMobile,
|
|
473
|
+
children: [/* @__PURE__ */ jsx(ModalGlass.Overlay, {}), /* @__PURE__ */ jsx("aside", {
|
|
474
|
+
ref,
|
|
475
|
+
"data-sidebar": "sidebar",
|
|
476
|
+
"data-side": side,
|
|
477
|
+
"data-variant": variant,
|
|
478
|
+
"data-collapsible": collapsible,
|
|
479
|
+
"data-state": "expanded",
|
|
480
|
+
"data-mobile": "true",
|
|
481
|
+
className: cn("fixed inset-y-0 z-50 flex flex-col", "w-[var(--sidebar-width-mobile)]", side === "left" ? "left-0" : "right-0", className),
|
|
482
|
+
style: {
|
|
483
|
+
background: "var(--sidebar-bg)",
|
|
484
|
+
color: "var(--sidebar-foreground)",
|
|
485
|
+
borderRight: side === "left" ? "1px solid var(--sidebar-border)" : void 0,
|
|
486
|
+
borderLeft: side === "right" ? "1px solid var(--sidebar-border)" : void 0,
|
|
487
|
+
backdropFilter: "blur(var(--sidebar-backdrop-blur))",
|
|
488
|
+
WebkitBackdropFilter: "blur(var(--sidebar-backdrop-blur))",
|
|
489
|
+
boxShadow: "var(--sidebar-glow)"
|
|
490
|
+
},
|
|
491
|
+
...props,
|
|
492
|
+
children
|
|
493
|
+
})]
|
|
494
|
+
});
|
|
495
|
+
const width = !open && collapsible !== "none" && collapsible === "icon" ? "var(--sidebar-width-icon)" : "var(--sidebar-width)";
|
|
496
|
+
return /* @__PURE__ */ jsx("aside", {
|
|
497
|
+
ref,
|
|
498
|
+
"data-sidebar": "sidebar",
|
|
499
|
+
"data-side": side,
|
|
500
|
+
"data-variant": variant,
|
|
501
|
+
"data-collapsible": collapsible,
|
|
502
|
+
"data-state": state,
|
|
503
|
+
className: cn("group/sidebar relative flex flex-col", "transition-[width] duration-300 ease-in-out", collapsible === "offcanvas" && !open && "w-0 overflow-hidden", variant === "floating" && "rounded-xl m-2", variant === "inset" && "rounded-xl", className),
|
|
504
|
+
style: {
|
|
505
|
+
width: collapsible === "offcanvas" && !open ? 0 : width,
|
|
506
|
+
background: "var(--sidebar-bg)",
|
|
507
|
+
color: "var(--sidebar-foreground)",
|
|
508
|
+
borderRight: side === "left" && variant !== "floating" ? "1px solid var(--sidebar-border)" : void 0,
|
|
509
|
+
borderLeft: side === "right" && variant !== "floating" ? "1px solid var(--sidebar-border)" : void 0,
|
|
510
|
+
border: variant === "floating" ? "1px solid var(--sidebar-border)" : void 0,
|
|
511
|
+
backdropFilter: "blur(var(--sidebar-backdrop-blur))",
|
|
512
|
+
WebkitBackdropFilter: "blur(var(--sidebar-backdrop-blur))",
|
|
513
|
+
boxShadow: variant === "floating" ? "var(--sidebar-glow)" : void 0
|
|
514
|
+
},
|
|
515
|
+
...props,
|
|
516
|
+
children
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
SidebarRoot.displayName = "SidebarGlass.Root";
|
|
520
|
+
const SidebarHeader = forwardRef(({ children, className, ...props }, ref) => {
|
|
521
|
+
return /* @__PURE__ */ jsx("div", {
|
|
522
|
+
ref,
|
|
523
|
+
"data-sidebar": "header",
|
|
524
|
+
className: cn("flex shrink-0 flex-col gap-2 p-4", "border-b", className),
|
|
525
|
+
style: { borderColor: "var(--sidebar-border)" },
|
|
526
|
+
...props,
|
|
527
|
+
children
|
|
528
|
+
});
|
|
529
|
+
});
|
|
530
|
+
SidebarHeader.displayName = "SidebarGlass.Header";
|
|
531
|
+
const SidebarContent = forwardRef(({ children, className, ...props }, ref) => {
|
|
532
|
+
return /* @__PURE__ */ jsx("div", {
|
|
533
|
+
ref,
|
|
534
|
+
"data-sidebar": "content",
|
|
535
|
+
className: cn("flex flex-1 flex-col gap-4 overflow-auto p-4", "[&::-webkit-scrollbar]:w-1.5", "[&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:rounded-full", "[&::-webkit-scrollbar-thumb]:bg-white/10", className),
|
|
536
|
+
...props,
|
|
537
|
+
children
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
SidebarContent.displayName = "SidebarGlass.Content";
|
|
541
|
+
const SidebarFooter = forwardRef(({ children, className, ...props }, ref) => {
|
|
542
|
+
return /* @__PURE__ */ jsx("div", {
|
|
543
|
+
ref,
|
|
544
|
+
"data-sidebar": "footer",
|
|
545
|
+
className: cn("flex shrink-0 flex-col gap-2 p-4", "border-t", className),
|
|
546
|
+
style: { borderColor: "var(--sidebar-border)" },
|
|
547
|
+
...props,
|
|
548
|
+
children
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
SidebarFooter.displayName = "SidebarGlass.Footer";
|
|
552
|
+
const SidebarRail = forwardRef(({ className, ...props }, ref) => {
|
|
553
|
+
const { toggleSidebar, side } = useSidebar();
|
|
554
|
+
return /* @__PURE__ */ jsx("button", {
|
|
555
|
+
ref,
|
|
556
|
+
"data-sidebar": "rail",
|
|
557
|
+
"aria-label": "Toggle Sidebar",
|
|
558
|
+
tabIndex: -1,
|
|
559
|
+
onClick: toggleSidebar,
|
|
560
|
+
className: cn("absolute inset-y-0 z-20 w-4", "hidden group-hover/sidebar:block", "-translate-x-1/2 transition-all ease-linear", "after:absolute after:inset-y-0 after:left-1/2 after:w-[2px]", "hover:after:bg-[var(--sidebar-border)]", "cursor-col-resize", side === "left" ? "-right-2" : "-left-2", className),
|
|
561
|
+
...props
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
SidebarRail.displayName = "SidebarGlass.Rail";
|
|
565
|
+
const SidebarInset = forwardRef(({ children, className, ...props }, ref) => {
|
|
566
|
+
return /* @__PURE__ */ jsx("main", {
|
|
567
|
+
ref,
|
|
568
|
+
"data-sidebar": "inset",
|
|
569
|
+
className: cn("flex flex-1 flex-col", "min-h-screen", className),
|
|
570
|
+
...props,
|
|
571
|
+
children
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
SidebarInset.displayName = "SidebarGlass.Inset";
|
|
575
|
+
const SidebarTrigger = forwardRef(({ asChild = false, className, children, ...props }, ref) => {
|
|
576
|
+
const { toggleSidebar } = useSidebar();
|
|
577
|
+
return /* @__PURE__ */ jsxs(asChild ? Slot : "button", {
|
|
578
|
+
ref,
|
|
579
|
+
"data-sidebar": "trigger",
|
|
580
|
+
onClick: toggleSidebar,
|
|
581
|
+
className: cn("inline-flex items-center justify-center", "h-9 w-9 rounded-lg", "text-sm font-medium", "transition-colors", "text-[var(--sidebar-foreground)]/60", "hover:bg-[var(--sidebar-accent)]", "hover:text-[var(--sidebar-accent-foreground)]", "focus-visible:outline-none focus-visible:ring-2", "focus-visible:ring-[var(--sidebar-ring)]", "disabled:pointer-events-none disabled:opacity-50", className),
|
|
582
|
+
...props,
|
|
583
|
+
children: [children ?? /* @__PURE__ */ jsx(PanelLeft, { className: "h-6 w-6" }), !children && /* @__PURE__ */ jsx("span", {
|
|
584
|
+
className: "sr-only",
|
|
585
|
+
children: "Toggle Sidebar"
|
|
586
|
+
})]
|
|
587
|
+
});
|
|
588
|
+
});
|
|
589
|
+
SidebarTrigger.displayName = "SidebarGlass.Trigger";
|
|
590
|
+
const SidebarSeparator = forwardRef(({ className, ...props }, ref) => {
|
|
591
|
+
return /* @__PURE__ */ jsx("hr", {
|
|
592
|
+
ref,
|
|
593
|
+
"data-sidebar": "separator",
|
|
594
|
+
className: cn("mx-4 my-2 h-px border-0", className),
|
|
595
|
+
style: { background: "var(--sidebar-border)" },
|
|
596
|
+
...props
|
|
597
|
+
});
|
|
598
|
+
});
|
|
599
|
+
SidebarSeparator.displayName = "SidebarGlass.Separator";
|
|
600
|
+
const SidebarGroup = forwardRef(({ children, className, ...props }, ref) => {
|
|
601
|
+
return /* @__PURE__ */ jsx("div", {
|
|
602
|
+
ref,
|
|
603
|
+
"data-sidebar": "group",
|
|
604
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
605
|
+
...props,
|
|
606
|
+
children
|
|
607
|
+
});
|
|
608
|
+
});
|
|
609
|
+
SidebarGroup.displayName = "SidebarGlass.Group";
|
|
610
|
+
const SidebarGroupLabel = forwardRef(({ children, asChild = false, className, ...props }, ref) => {
|
|
611
|
+
const { state } = useSidebar();
|
|
612
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
|
|
613
|
+
ref,
|
|
614
|
+
"data-sidebar": "group-label",
|
|
615
|
+
"data-state": state,
|
|
616
|
+
className: cn("flex h-8 shrink-0 items-center px-2", "text-xs font-medium text-[var(--sidebar-foreground)]/60", "transition-[margin,opacity] duration-200 ease-linear", "group-data-[state=collapsed]/sidebar:h-0 group-data-[state=collapsed]/sidebar:overflow-hidden", "group-data-[state=collapsed]/sidebar:opacity-0", className),
|
|
617
|
+
...props,
|
|
618
|
+
children
|
|
619
|
+
});
|
|
620
|
+
});
|
|
621
|
+
SidebarGroupLabel.displayName = "SidebarGlass.GroupLabel";
|
|
622
|
+
const SidebarGroupAction = forwardRef(({ asChild = false, className, ...props }, ref) => {
|
|
623
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
624
|
+
ref,
|
|
625
|
+
"data-sidebar": "group-action",
|
|
626
|
+
className: cn("absolute right-2 top-2.5", "flex aspect-square w-5 items-center justify-center", "rounded-md p-0 text-[var(--sidebar-foreground)]/60", "ring-[var(--sidebar-ring)]", "transition-transform hover:bg-[var(--sidebar-accent)]", "hover:text-[var(--sidebar-foreground)]", "focus-visible:outline-none focus-visible:ring-2", "[&>svg]:size-4 [&>svg]:shrink-0", "group-data-[state=collapsed]/sidebar:hidden", "after:absolute after:-inset-2 after:md:hidden", className),
|
|
627
|
+
...props
|
|
628
|
+
});
|
|
629
|
+
});
|
|
630
|
+
SidebarGroupAction.displayName = "SidebarGlass.GroupAction";
|
|
631
|
+
const SidebarGroupContent = forwardRef(({ children, className, ...props }, ref) => {
|
|
632
|
+
return /* @__PURE__ */ jsx("div", {
|
|
633
|
+
ref,
|
|
634
|
+
"data-sidebar": "group-content",
|
|
635
|
+
className: cn("flex flex-col gap-1", className),
|
|
636
|
+
...props,
|
|
637
|
+
children
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
SidebarGroupContent.displayName = "SidebarGlass.GroupContent";
|
|
641
|
+
const SidebarMenu = forwardRef(({ children, className, ...props }, ref) => {
|
|
642
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
643
|
+
ref,
|
|
644
|
+
"data-sidebar": "menu",
|
|
645
|
+
className: cn("flex w-full flex-col gap-1", className),
|
|
646
|
+
...props,
|
|
647
|
+
children
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
SidebarMenu.displayName = "SidebarGlass.Menu";
|
|
651
|
+
const SidebarMenuItem = forwardRef(({ children, className, ...props }, ref) => {
|
|
652
|
+
return /* @__PURE__ */ jsx("li", {
|
|
653
|
+
ref,
|
|
654
|
+
"data-sidebar": "menu-item",
|
|
655
|
+
className: cn("group/menu-item relative text-[var(--sidebar-foreground)]/60", className),
|
|
656
|
+
...props,
|
|
657
|
+
children
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
SidebarMenuItem.displayName = "SidebarGlass.MenuItem";
|
|
661
|
+
var menuButtonSizeClasses = {
|
|
662
|
+
default: "h-8 text-sm",
|
|
663
|
+
sm: "h-7 text-xs",
|
|
664
|
+
lg: "h-10 text-sm group-data-[state=collapsed]/sidebar:!p-0"
|
|
665
|
+
};
|
|
666
|
+
const SidebarMenuButton = forwardRef(({ asChild = false, isActive = false, tooltip, size = "default", variant = "default", className, children, ...props }, ref) => {
|
|
667
|
+
const { state, isMobile } = useSidebar();
|
|
668
|
+
const button = /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
669
|
+
ref,
|
|
670
|
+
"data-sidebar": "menu-button",
|
|
671
|
+
"data-active": isActive,
|
|
672
|
+
"data-size": size,
|
|
673
|
+
className: cn("peer/menu-button flex w-full items-center gap-2", "overflow-hidden rounded-md px-2", "ring-[var(--sidebar-ring)]", "transition-[width,height,padding] duration-200 ease-linear", "focus-visible:outline-none focus-visible:ring-2", "active:bg-[var(--sidebar-accent)] active:text-[var(--sidebar-accent-foreground)]", "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", menuButtonSizeClasses[size], variant === "default" && ["hover:bg-[var(--sidebar-accent)] hover:text-[var(--sidebar-accent-foreground)]"], variant === "outline" && [
|
|
674
|
+
"bg-transparent shadow-none",
|
|
675
|
+
"hover:bg-[var(--sidebar-accent)] hover:text-[var(--sidebar-accent-foreground)]",
|
|
676
|
+
"hover:shadow-[0_0_0_1px_var(--sidebar-border)]"
|
|
677
|
+
], isActive && ["bg-[var(--sidebar-primary)] text-[var(--sidebar-primary-foreground)]", "hover:bg-[var(--sidebar-primary)] hover:text-[var(--sidebar-primary-foreground)]"], "group-data-[state=collapsed]/sidebar:w-8 group-data-[state=collapsed]/sidebar:!px-0", "group-data-[state=collapsed]/sidebar:justify-center", className),
|
|
678
|
+
...props,
|
|
679
|
+
children
|
|
680
|
+
});
|
|
681
|
+
if (!tooltip || isMobile || state === "expanded") return button;
|
|
682
|
+
return /* @__PURE__ */ jsx(TooltipGlassSimple, {
|
|
683
|
+
content: typeof tooltip === "string" ? tooltip : String(tooltip),
|
|
684
|
+
side: "right",
|
|
685
|
+
children: button
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
SidebarMenuButton.displayName = "SidebarGlass.MenuButton";
|
|
689
|
+
const SidebarMenuAction = forwardRef(({ asChild = false, showOnHover = false, className, ...props }, ref) => {
|
|
690
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
691
|
+
ref,
|
|
692
|
+
"data-sidebar": "menu-action",
|
|
693
|
+
className: cn("absolute right-1 top-1.5", "flex aspect-square w-5 items-center justify-center", "rounded-md p-0 text-[var(--sidebar-foreground)]/60", "ring-[var(--sidebar-ring)]", "transition-transform hover:bg-[var(--sidebar-accent)]", "hover:text-[var(--sidebar-foreground)]", "focus-visible:outline-none focus-visible:ring-2", "[&>svg]:size-4 [&>svg]:shrink-0", "group-data-[state=collapsed]/sidebar:hidden", showOnHover && "peer-hover/menu-button:opacity-100 group-focus-within/menu-item:opacity-100", showOnHover && "data-[state=open]:opacity-100 md:opacity-0", "after:absolute after:-inset-2 after:md:hidden", className),
|
|
694
|
+
...props
|
|
695
|
+
});
|
|
696
|
+
});
|
|
697
|
+
SidebarMenuAction.displayName = "SidebarGlass.MenuAction";
|
|
698
|
+
const SidebarMenuBadge = forwardRef(({ children, className, ...props }, ref) => {
|
|
699
|
+
return /* @__PURE__ */ jsx("div", {
|
|
700
|
+
ref,
|
|
701
|
+
"data-sidebar": "menu-badge",
|
|
702
|
+
className: cn("pointer-events-none absolute right-1 flex h-5 min-w-5", "select-none items-center justify-center", "rounded-md px-1 text-xs font-medium tabular-nums", "text-[var(--sidebar-foreground)]/60", "group-data-[state=collapsed]/sidebar:hidden", className),
|
|
703
|
+
...props,
|
|
704
|
+
children
|
|
705
|
+
});
|
|
706
|
+
});
|
|
707
|
+
SidebarMenuBadge.displayName = "SidebarGlass.MenuBadge";
|
|
708
|
+
const SidebarMenuSkeleton = forwardRef(({ showIcon = false, className, ...props }, ref) => {
|
|
709
|
+
const width = "70%";
|
|
710
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
711
|
+
ref,
|
|
712
|
+
"data-sidebar": "menu-skeleton",
|
|
713
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
714
|
+
...props,
|
|
715
|
+
children: [showIcon && /* @__PURE__ */ jsx(SkeletonGlass, { className: "size-4 rounded-md" }), /* @__PURE__ */ jsx(SkeletonGlass, {
|
|
716
|
+
className: "h-4 max-w-[var(--skeleton-width)] flex-1",
|
|
717
|
+
style: { "--skeleton-width": width }
|
|
718
|
+
})]
|
|
719
|
+
});
|
|
720
|
+
});
|
|
721
|
+
SidebarMenuSkeleton.displayName = "SidebarGlass.MenuSkeleton";
|
|
722
|
+
var SidebarMenuSubContext = createContext(null);
|
|
723
|
+
const SidebarMenuSub = forwardRef(({ children, className, ...props }, ref) => {
|
|
724
|
+
return /* @__PURE__ */ jsx(SidebarMenuSubContext.Provider, {
|
|
725
|
+
value: { open: true },
|
|
726
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
727
|
+
ref,
|
|
728
|
+
"data-sidebar": "menu-sub",
|
|
729
|
+
className: cn("flex min-w-0 flex-col gap-1", "mx-3.5 border-l border-[var(--sidebar-border)] px-2.5 py-0.5", "group-data-[state=collapsed]/sidebar:hidden", className),
|
|
730
|
+
...props,
|
|
731
|
+
children
|
|
732
|
+
})
|
|
733
|
+
});
|
|
734
|
+
});
|
|
735
|
+
SidebarMenuSub.displayName = "SidebarGlass.MenuSub";
|
|
736
|
+
const SidebarMenuSubItem = forwardRef(({ children, className, ...props }, ref) => {
|
|
737
|
+
return /* @__PURE__ */ jsx("li", {
|
|
738
|
+
ref,
|
|
739
|
+
"data-sidebar": "menu-sub-item",
|
|
740
|
+
className: cn(className),
|
|
741
|
+
...props,
|
|
742
|
+
children
|
|
743
|
+
});
|
|
744
|
+
});
|
|
745
|
+
SidebarMenuSubItem.displayName = "SidebarGlass.MenuSubItem";
|
|
746
|
+
const SidebarMenuSubButton = forwardRef(({ asChild = false, isActive = false, size = "md", className, ...props }, ref) => {
|
|
747
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "a", {
|
|
748
|
+
ref,
|
|
749
|
+
"data-sidebar": "menu-sub-button",
|
|
750
|
+
"data-active": isActive,
|
|
751
|
+
"data-size": size,
|
|
752
|
+
className: cn("flex min-w-0 items-center gap-2", "-ml-px rounded-md border-l border-transparent", "text-[var(--sidebar-foreground)]/60", "ring-[var(--sidebar-ring)]", "transition-colors", "hover:border-[var(--sidebar-border)]", "hover:bg-[var(--sidebar-accent)]", "hover:text-[var(--sidebar-accent-foreground)]", "focus-visible:outline-none focus-visible:ring-2", "active:bg-[var(--sidebar-accent)] active:text-[var(--sidebar-accent-foreground)]", "disabled:pointer-events-none disabled:opacity-50", "[&>span:last-child]:truncate", "[&>svg]:size-4 [&>svg]:shrink-0", size === "sm" && "h-7 px-2 text-xs", size === "md" && "h-8 px-2 text-sm", isActive && ["border-[var(--sidebar-primary)]", "text-[var(--sidebar-foreground)]"], className),
|
|
753
|
+
...props
|
|
754
|
+
});
|
|
755
|
+
});
|
|
756
|
+
SidebarMenuSubButton.displayName = "SidebarGlass.MenuSubButton";
|
|
757
|
+
const SidebarGlass = {
|
|
758
|
+
Provider: SidebarProvider,
|
|
759
|
+
Root: SidebarRoot,
|
|
760
|
+
Header: SidebarHeader,
|
|
761
|
+
Content: SidebarContent,
|
|
762
|
+
Footer: SidebarFooter,
|
|
763
|
+
Rail: SidebarRail,
|
|
764
|
+
Inset: SidebarInset,
|
|
765
|
+
Trigger: SidebarTrigger,
|
|
766
|
+
Separator: SidebarSeparator,
|
|
767
|
+
Group: SidebarGroup,
|
|
768
|
+
GroupLabel: SidebarGroupLabel,
|
|
769
|
+
GroupAction: SidebarGroupAction,
|
|
770
|
+
GroupContent: SidebarGroupContent,
|
|
771
|
+
Menu: SidebarMenu,
|
|
772
|
+
MenuItem: SidebarMenuItem,
|
|
773
|
+
MenuButton: SidebarMenuButton,
|
|
774
|
+
MenuAction: SidebarMenuAction,
|
|
775
|
+
MenuBadge: SidebarMenuBadge,
|
|
776
|
+
MenuSkeleton: SidebarMenuSkeleton,
|
|
777
|
+
MenuSub: SidebarMenuSub,
|
|
778
|
+
MenuSubItem: SidebarMenuSubItem,
|
|
779
|
+
MenuSubButton: SidebarMenuSubButton
|
|
780
|
+
};
|
|
373
781
|
function _extends$1() {
|
|
374
782
|
return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
|
|
375
783
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -705,6 +1113,1245 @@ function Legend(outsideProps) {
|
|
|
705
1113
|
}))), legendPortal);
|
|
706
1114
|
}
|
|
707
1115
|
Legend.displayName = "Legend";
|
|
1116
|
+
var Primitive = [
|
|
1117
|
+
"a",
|
|
1118
|
+
"button",
|
|
1119
|
+
"div",
|
|
1120
|
+
"form",
|
|
1121
|
+
"h2",
|
|
1122
|
+
"h3",
|
|
1123
|
+
"img",
|
|
1124
|
+
"input",
|
|
1125
|
+
"label",
|
|
1126
|
+
"li",
|
|
1127
|
+
"nav",
|
|
1128
|
+
"ol",
|
|
1129
|
+
"p",
|
|
1130
|
+
"select",
|
|
1131
|
+
"span",
|
|
1132
|
+
"svg",
|
|
1133
|
+
"ul"
|
|
1134
|
+
].reduce((primitive, node) => {
|
|
1135
|
+
const Slot$1 = createSlot(`Primitive.${node}`);
|
|
1136
|
+
const Node = React$1.forwardRef((props, forwardedRef) => {
|
|
1137
|
+
const { asChild, ...primitiveProps } = props;
|
|
1138
|
+
const Comp = asChild ? Slot$1 : node;
|
|
1139
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
1140
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
1141
|
+
...primitiveProps,
|
|
1142
|
+
ref: forwardedRef
|
|
1143
|
+
});
|
|
1144
|
+
});
|
|
1145
|
+
Node.displayName = `Primitive.${node}`;
|
|
1146
|
+
return {
|
|
1147
|
+
...primitive,
|
|
1148
|
+
[node]: Node
|
|
1149
|
+
};
|
|
1150
|
+
}, {});
|
|
1151
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
1152
|
+
let defaultContexts = [];
|
|
1153
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
1154
|
+
const BaseContext = React$1.createContext(defaultContext);
|
|
1155
|
+
const index = defaultContexts.length;
|
|
1156
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
1157
|
+
const Provider = (props) => {
|
|
1158
|
+
const { scope, children, ...context } = props;
|
|
1159
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1160
|
+
const value = React$1.useMemo(() => context, Object.values(context));
|
|
1161
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
1162
|
+
value,
|
|
1163
|
+
children
|
|
1164
|
+
});
|
|
1165
|
+
};
|
|
1166
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
1167
|
+
function useContext2(consumerName, scope) {
|
|
1168
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1169
|
+
const context = React$1.useContext(Context);
|
|
1170
|
+
if (context) return context;
|
|
1171
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
1172
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
1173
|
+
}
|
|
1174
|
+
return [Provider, useContext2];
|
|
1175
|
+
}
|
|
1176
|
+
const createScope = () => {
|
|
1177
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
1178
|
+
return React$1.createContext(defaultContext);
|
|
1179
|
+
});
|
|
1180
|
+
return function useScope(scope) {
|
|
1181
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
1182
|
+
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
1183
|
+
...scope,
|
|
1184
|
+
[scopeName]: contexts
|
|
1185
|
+
} }), [scope, contexts]);
|
|
1186
|
+
};
|
|
1187
|
+
};
|
|
1188
|
+
createScope.scopeName = scopeName;
|
|
1189
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
1190
|
+
}
|
|
1191
|
+
function composeContextScopes(...scopes) {
|
|
1192
|
+
const baseScope = scopes[0];
|
|
1193
|
+
if (scopes.length === 1) return baseScope;
|
|
1194
|
+
const createScope = () => {
|
|
1195
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
1196
|
+
useScope: createScope2(),
|
|
1197
|
+
scopeName: createScope2.scopeName
|
|
1198
|
+
}));
|
|
1199
|
+
return function useComposedScopes(overrideScopes) {
|
|
1200
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
1201
|
+
const currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
1202
|
+
return {
|
|
1203
|
+
...nextScopes2,
|
|
1204
|
+
...currentScope
|
|
1205
|
+
};
|
|
1206
|
+
}, {});
|
|
1207
|
+
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
1208
|
+
};
|
|
1209
|
+
};
|
|
1210
|
+
createScope.scopeName = baseScope.scopeName;
|
|
1211
|
+
return createScope;
|
|
1212
|
+
}
|
|
1213
|
+
function useStateMachine(initialState, machine) {
|
|
1214
|
+
return React$1.useReducer((state, event) => {
|
|
1215
|
+
return machine[state][event] ?? state;
|
|
1216
|
+
}, initialState);
|
|
1217
|
+
}
|
|
1218
|
+
var SCROLL_AREA_NAME = "ScrollArea";
|
|
1219
|
+
var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
|
|
1220
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
1221
|
+
var ScrollArea$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
1222
|
+
const { __scopeScrollArea, type = "hover", dir, scrollHideDelay = 600, ...scrollAreaProps } = props;
|
|
1223
|
+
const [scrollArea, setScrollArea] = React$1.useState(null);
|
|
1224
|
+
const [viewport, setViewport] = React$1.useState(null);
|
|
1225
|
+
const [content, setContent] = React$1.useState(null);
|
|
1226
|
+
const [scrollbarX, setScrollbarX] = React$1.useState(null);
|
|
1227
|
+
const [scrollbarY, setScrollbarY] = React$1.useState(null);
|
|
1228
|
+
const [cornerWidth, setCornerWidth] = React$1.useState(0);
|
|
1229
|
+
const [cornerHeight, setCornerHeight] = React$1.useState(0);
|
|
1230
|
+
const [scrollbarXEnabled, setScrollbarXEnabled] = React$1.useState(false);
|
|
1231
|
+
const [scrollbarYEnabled, setScrollbarYEnabled] = React$1.useState(false);
|
|
1232
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));
|
|
1233
|
+
const direction = useDirection(dir);
|
|
1234
|
+
return /* @__PURE__ */ jsx(ScrollAreaProvider, {
|
|
1235
|
+
scope: __scopeScrollArea,
|
|
1236
|
+
type,
|
|
1237
|
+
dir: direction,
|
|
1238
|
+
scrollHideDelay,
|
|
1239
|
+
scrollArea,
|
|
1240
|
+
viewport,
|
|
1241
|
+
onViewportChange: setViewport,
|
|
1242
|
+
content,
|
|
1243
|
+
onContentChange: setContent,
|
|
1244
|
+
scrollbarX,
|
|
1245
|
+
onScrollbarXChange: setScrollbarX,
|
|
1246
|
+
scrollbarXEnabled,
|
|
1247
|
+
onScrollbarXEnabledChange: setScrollbarXEnabled,
|
|
1248
|
+
scrollbarY,
|
|
1249
|
+
onScrollbarYChange: setScrollbarY,
|
|
1250
|
+
scrollbarYEnabled,
|
|
1251
|
+
onScrollbarYEnabledChange: setScrollbarYEnabled,
|
|
1252
|
+
onCornerWidthChange: setCornerWidth,
|
|
1253
|
+
onCornerHeightChange: setCornerHeight,
|
|
1254
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
1255
|
+
dir: direction,
|
|
1256
|
+
...scrollAreaProps,
|
|
1257
|
+
ref: composedRefs,
|
|
1258
|
+
style: {
|
|
1259
|
+
position: "relative",
|
|
1260
|
+
["--radix-scroll-area-corner-width"]: cornerWidth + "px",
|
|
1261
|
+
["--radix-scroll-area-corner-height"]: cornerHeight + "px",
|
|
1262
|
+
...props.style
|
|
1263
|
+
}
|
|
1264
|
+
})
|
|
1265
|
+
});
|
|
1266
|
+
});
|
|
1267
|
+
ScrollArea$1.displayName = SCROLL_AREA_NAME;
|
|
1268
|
+
var VIEWPORT_NAME = "ScrollAreaViewport";
|
|
1269
|
+
var ScrollAreaViewport = React$1.forwardRef((props, forwardedRef) => {
|
|
1270
|
+
const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
|
|
1271
|
+
const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
|
|
1272
|
+
const composedRefs = useComposedRefs(forwardedRef, React$1.useRef(null), context.onViewportChange);
|
|
1273
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", {
|
|
1274
|
+
dangerouslySetInnerHTML: { __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}` },
|
|
1275
|
+
nonce
|
|
1276
|
+
}), /* @__PURE__ */ jsx(Primitive.div, {
|
|
1277
|
+
"data-radix-scroll-area-viewport": "",
|
|
1278
|
+
...viewportProps,
|
|
1279
|
+
ref: composedRefs,
|
|
1280
|
+
style: {
|
|
1281
|
+
overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
|
|
1282
|
+
overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
|
|
1283
|
+
...props.style
|
|
1284
|
+
},
|
|
1285
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1286
|
+
ref: context.onContentChange,
|
|
1287
|
+
style: {
|
|
1288
|
+
minWidth: "100%",
|
|
1289
|
+
display: "table"
|
|
1290
|
+
},
|
|
1291
|
+
children
|
|
1292
|
+
})
|
|
1293
|
+
})] });
|
|
1294
|
+
});
|
|
1295
|
+
ScrollAreaViewport.displayName = VIEWPORT_NAME;
|
|
1296
|
+
var SCROLLBAR_NAME = "ScrollAreaScrollbar";
|
|
1297
|
+
var ScrollAreaScrollbar = React$1.forwardRef((props, forwardedRef) => {
|
|
1298
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
1299
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1300
|
+
const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
|
|
1301
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
1302
|
+
React$1.useEffect(() => {
|
|
1303
|
+
isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
|
|
1304
|
+
return () => {
|
|
1305
|
+
isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
|
|
1306
|
+
};
|
|
1307
|
+
}, [
|
|
1308
|
+
isHorizontal,
|
|
1309
|
+
onScrollbarXEnabledChange,
|
|
1310
|
+
onScrollbarYEnabledChange
|
|
1311
|
+
]);
|
|
1312
|
+
return context.type === "hover" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarHover, {
|
|
1313
|
+
...scrollbarProps,
|
|
1314
|
+
ref: forwardedRef,
|
|
1315
|
+
forceMount
|
|
1316
|
+
}) : context.type === "scroll" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarScroll, {
|
|
1317
|
+
...scrollbarProps,
|
|
1318
|
+
ref: forwardedRef,
|
|
1319
|
+
forceMount
|
|
1320
|
+
}) : context.type === "auto" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, {
|
|
1321
|
+
...scrollbarProps,
|
|
1322
|
+
ref: forwardedRef,
|
|
1323
|
+
forceMount
|
|
1324
|
+
}) : context.type === "always" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
1325
|
+
...scrollbarProps,
|
|
1326
|
+
ref: forwardedRef
|
|
1327
|
+
}) : null;
|
|
1328
|
+
});
|
|
1329
|
+
ScrollAreaScrollbar.displayName = SCROLLBAR_NAME;
|
|
1330
|
+
var ScrollAreaScrollbarHover = React$1.forwardRef((props, forwardedRef) => {
|
|
1331
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
1332
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1333
|
+
const [visible, setVisible] = React$1.useState(false);
|
|
1334
|
+
React$1.useEffect(() => {
|
|
1335
|
+
const scrollArea = context.scrollArea;
|
|
1336
|
+
let hideTimer = 0;
|
|
1337
|
+
if (scrollArea) {
|
|
1338
|
+
const handlePointerEnter = () => {
|
|
1339
|
+
window.clearTimeout(hideTimer);
|
|
1340
|
+
setVisible(true);
|
|
1341
|
+
};
|
|
1342
|
+
const handlePointerLeave = () => {
|
|
1343
|
+
hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
|
|
1344
|
+
};
|
|
1345
|
+
scrollArea.addEventListener("pointerenter", handlePointerEnter);
|
|
1346
|
+
scrollArea.addEventListener("pointerleave", handlePointerLeave);
|
|
1347
|
+
return () => {
|
|
1348
|
+
window.clearTimeout(hideTimer);
|
|
1349
|
+
scrollArea.removeEventListener("pointerenter", handlePointerEnter);
|
|
1350
|
+
scrollArea.removeEventListener("pointerleave", handlePointerLeave);
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
}, [context.scrollArea, context.scrollHideDelay]);
|
|
1354
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
1355
|
+
present: forceMount || visible,
|
|
1356
|
+
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, {
|
|
1357
|
+
"data-state": visible ? "visible" : "hidden",
|
|
1358
|
+
...scrollbarProps,
|
|
1359
|
+
ref: forwardedRef
|
|
1360
|
+
})
|
|
1361
|
+
});
|
|
1362
|
+
});
|
|
1363
|
+
var ScrollAreaScrollbarScroll = React$1.forwardRef((props, forwardedRef) => {
|
|
1364
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
1365
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1366
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
1367
|
+
const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
|
|
1368
|
+
const [state, send] = useStateMachine("hidden", {
|
|
1369
|
+
hidden: { SCROLL: "scrolling" },
|
|
1370
|
+
scrolling: {
|
|
1371
|
+
SCROLL_END: "idle",
|
|
1372
|
+
POINTER_ENTER: "interacting"
|
|
1373
|
+
},
|
|
1374
|
+
interacting: {
|
|
1375
|
+
SCROLL: "interacting",
|
|
1376
|
+
POINTER_LEAVE: "idle"
|
|
1377
|
+
},
|
|
1378
|
+
idle: {
|
|
1379
|
+
HIDE: "hidden",
|
|
1380
|
+
SCROLL: "scrolling",
|
|
1381
|
+
POINTER_ENTER: "interacting"
|
|
1382
|
+
}
|
|
1383
|
+
});
|
|
1384
|
+
React$1.useEffect(() => {
|
|
1385
|
+
if (state === "idle") {
|
|
1386
|
+
const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
|
|
1387
|
+
return () => window.clearTimeout(hideTimer);
|
|
1388
|
+
}
|
|
1389
|
+
}, [
|
|
1390
|
+
state,
|
|
1391
|
+
context.scrollHideDelay,
|
|
1392
|
+
send
|
|
1393
|
+
]);
|
|
1394
|
+
React$1.useEffect(() => {
|
|
1395
|
+
const viewport = context.viewport;
|
|
1396
|
+
const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
|
|
1397
|
+
if (viewport) {
|
|
1398
|
+
let prevScrollPos = viewport[scrollDirection];
|
|
1399
|
+
const handleScroll = () => {
|
|
1400
|
+
const scrollPos = viewport[scrollDirection];
|
|
1401
|
+
if (prevScrollPos !== scrollPos) {
|
|
1402
|
+
send("SCROLL");
|
|
1403
|
+
debounceScrollEnd();
|
|
1404
|
+
}
|
|
1405
|
+
prevScrollPos = scrollPos;
|
|
1406
|
+
};
|
|
1407
|
+
viewport.addEventListener("scroll", handleScroll);
|
|
1408
|
+
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
1409
|
+
}
|
|
1410
|
+
}, [
|
|
1411
|
+
context.viewport,
|
|
1412
|
+
isHorizontal,
|
|
1413
|
+
send,
|
|
1414
|
+
debounceScrollEnd
|
|
1415
|
+
]);
|
|
1416
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
1417
|
+
present: forceMount || state !== "hidden",
|
|
1418
|
+
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
1419
|
+
"data-state": state === "hidden" ? "hidden" : "visible",
|
|
1420
|
+
...scrollbarProps,
|
|
1421
|
+
ref: forwardedRef,
|
|
1422
|
+
onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
|
|
1423
|
+
onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
|
|
1424
|
+
})
|
|
1425
|
+
});
|
|
1426
|
+
});
|
|
1427
|
+
var ScrollAreaScrollbarAuto = React$1.forwardRef((props, forwardedRef) => {
|
|
1428
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1429
|
+
const { forceMount, ...scrollbarProps } = props;
|
|
1430
|
+
const [visible, setVisible] = React$1.useState(false);
|
|
1431
|
+
const isHorizontal = props.orientation === "horizontal";
|
|
1432
|
+
const handleResize = useDebounceCallback(() => {
|
|
1433
|
+
if (context.viewport) {
|
|
1434
|
+
const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
|
|
1435
|
+
const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
|
|
1436
|
+
setVisible(isHorizontal ? isOverflowX : isOverflowY);
|
|
1437
|
+
}
|
|
1438
|
+
}, 10);
|
|
1439
|
+
useResizeObserver(context.viewport, handleResize);
|
|
1440
|
+
useResizeObserver(context.content, handleResize);
|
|
1441
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
1442
|
+
present: forceMount || visible,
|
|
1443
|
+
children: /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, {
|
|
1444
|
+
"data-state": visible ? "visible" : "hidden",
|
|
1445
|
+
...scrollbarProps,
|
|
1446
|
+
ref: forwardedRef
|
|
1447
|
+
})
|
|
1448
|
+
});
|
|
1449
|
+
});
|
|
1450
|
+
var ScrollAreaScrollbarVisible = React$1.forwardRef((props, forwardedRef) => {
|
|
1451
|
+
const { orientation = "vertical", ...scrollbarProps } = props;
|
|
1452
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1453
|
+
const thumbRef = React$1.useRef(null);
|
|
1454
|
+
const pointerOffsetRef = React$1.useRef(0);
|
|
1455
|
+
const [sizes, setSizes] = React$1.useState({
|
|
1456
|
+
content: 0,
|
|
1457
|
+
viewport: 0,
|
|
1458
|
+
scrollbar: {
|
|
1459
|
+
size: 0,
|
|
1460
|
+
paddingStart: 0,
|
|
1461
|
+
paddingEnd: 0
|
|
1462
|
+
}
|
|
1463
|
+
});
|
|
1464
|
+
const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
|
|
1465
|
+
const commonProps = {
|
|
1466
|
+
...scrollbarProps,
|
|
1467
|
+
sizes,
|
|
1468
|
+
onSizesChange: setSizes,
|
|
1469
|
+
hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
|
|
1470
|
+
onThumbChange: (thumb) => thumbRef.current = thumb,
|
|
1471
|
+
onThumbPointerUp: () => pointerOffsetRef.current = 0,
|
|
1472
|
+
onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos
|
|
1473
|
+
};
|
|
1474
|
+
function getScrollPosition(pointerPos, dir) {
|
|
1475
|
+
return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
|
|
1476
|
+
}
|
|
1477
|
+
if (orientation === "horizontal") return /* @__PURE__ */ jsx(ScrollAreaScrollbarX, {
|
|
1478
|
+
...commonProps,
|
|
1479
|
+
ref: forwardedRef,
|
|
1480
|
+
onThumbPositionChange: () => {
|
|
1481
|
+
if (context.viewport && thumbRef.current) {
|
|
1482
|
+
const scrollPos = context.viewport.scrollLeft;
|
|
1483
|
+
const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
|
|
1484
|
+
thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
|
|
1485
|
+
}
|
|
1486
|
+
},
|
|
1487
|
+
onWheelScroll: (scrollPos) => {
|
|
1488
|
+
if (context.viewport) context.viewport.scrollLeft = scrollPos;
|
|
1489
|
+
},
|
|
1490
|
+
onDragScroll: (pointerPos) => {
|
|
1491
|
+
if (context.viewport) context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
if (orientation === "vertical") return /* @__PURE__ */ jsx(ScrollAreaScrollbarY, {
|
|
1495
|
+
...commonProps,
|
|
1496
|
+
ref: forwardedRef,
|
|
1497
|
+
onThumbPositionChange: () => {
|
|
1498
|
+
if (context.viewport && thumbRef.current) {
|
|
1499
|
+
const scrollPos = context.viewport.scrollTop;
|
|
1500
|
+
const offset = getThumbOffsetFromScroll(scrollPos, sizes);
|
|
1501
|
+
thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
|
|
1502
|
+
}
|
|
1503
|
+
},
|
|
1504
|
+
onWheelScroll: (scrollPos) => {
|
|
1505
|
+
if (context.viewport) context.viewport.scrollTop = scrollPos;
|
|
1506
|
+
},
|
|
1507
|
+
onDragScroll: (pointerPos) => {
|
|
1508
|
+
if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
return null;
|
|
1512
|
+
});
|
|
1513
|
+
var ScrollAreaScrollbarX = React$1.forwardRef((props, forwardedRef) => {
|
|
1514
|
+
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
1515
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1516
|
+
const [computedStyle, setComputedStyle] = React$1.useState();
|
|
1517
|
+
const ref = React$1.useRef(null);
|
|
1518
|
+
const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
|
|
1519
|
+
React$1.useEffect(() => {
|
|
1520
|
+
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
1521
|
+
}, [ref]);
|
|
1522
|
+
return /* @__PURE__ */ jsx(ScrollAreaScrollbarImpl, {
|
|
1523
|
+
"data-orientation": "horizontal",
|
|
1524
|
+
...scrollbarProps,
|
|
1525
|
+
ref: composeRefs,
|
|
1526
|
+
sizes,
|
|
1527
|
+
style: {
|
|
1528
|
+
bottom: 0,
|
|
1529
|
+
left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
1530
|
+
right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
1531
|
+
["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px",
|
|
1532
|
+
...props.style
|
|
1533
|
+
},
|
|
1534
|
+
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
|
|
1535
|
+
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
|
|
1536
|
+
onWheelScroll: (event, maxScrollPos) => {
|
|
1537
|
+
if (context.viewport) {
|
|
1538
|
+
const scrollPos = context.viewport.scrollLeft + event.deltaX;
|
|
1539
|
+
props.onWheelScroll(scrollPos);
|
|
1540
|
+
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1543
|
+
onResize: () => {
|
|
1544
|
+
if (ref.current && context.viewport && computedStyle) onSizesChange({
|
|
1545
|
+
content: context.viewport.scrollWidth,
|
|
1546
|
+
viewport: context.viewport.offsetWidth,
|
|
1547
|
+
scrollbar: {
|
|
1548
|
+
size: ref.current.clientWidth,
|
|
1549
|
+
paddingStart: toInt(computedStyle.paddingLeft),
|
|
1550
|
+
paddingEnd: toInt(computedStyle.paddingRight)
|
|
1551
|
+
}
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
});
|
|
1556
|
+
var ScrollAreaScrollbarY = React$1.forwardRef((props, forwardedRef) => {
|
|
1557
|
+
const { sizes, onSizesChange, ...scrollbarProps } = props;
|
|
1558
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
1559
|
+
const [computedStyle, setComputedStyle] = React$1.useState();
|
|
1560
|
+
const ref = React$1.useRef(null);
|
|
1561
|
+
const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
|
|
1562
|
+
React$1.useEffect(() => {
|
|
1563
|
+
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
|
|
1564
|
+
}, [ref]);
|
|
1565
|
+
return /* @__PURE__ */ jsx(ScrollAreaScrollbarImpl, {
|
|
1566
|
+
"data-orientation": "vertical",
|
|
1567
|
+
...scrollbarProps,
|
|
1568
|
+
ref: composeRefs,
|
|
1569
|
+
sizes,
|
|
1570
|
+
style: {
|
|
1571
|
+
top: 0,
|
|
1572
|
+
right: context.dir === "ltr" ? 0 : void 0,
|
|
1573
|
+
left: context.dir === "rtl" ? 0 : void 0,
|
|
1574
|
+
bottom: "var(--radix-scroll-area-corner-height)",
|
|
1575
|
+
["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px",
|
|
1576
|
+
...props.style
|
|
1577
|
+
},
|
|
1578
|
+
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
|
|
1579
|
+
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
|
|
1580
|
+
onWheelScroll: (event, maxScrollPos) => {
|
|
1581
|
+
if (context.viewport) {
|
|
1582
|
+
const scrollPos = context.viewport.scrollTop + event.deltaY;
|
|
1583
|
+
props.onWheelScroll(scrollPos);
|
|
1584
|
+
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();
|
|
1585
|
+
}
|
|
1586
|
+
},
|
|
1587
|
+
onResize: () => {
|
|
1588
|
+
if (ref.current && context.viewport && computedStyle) onSizesChange({
|
|
1589
|
+
content: context.viewport.scrollHeight,
|
|
1590
|
+
viewport: context.viewport.offsetHeight,
|
|
1591
|
+
scrollbar: {
|
|
1592
|
+
size: ref.current.clientHeight,
|
|
1593
|
+
paddingStart: toInt(computedStyle.paddingTop),
|
|
1594
|
+
paddingEnd: toInt(computedStyle.paddingBottom)
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
});
|
|
1600
|
+
var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
|
|
1601
|
+
var ScrollAreaScrollbarImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
1602
|
+
const { __scopeScrollArea, sizes, hasThumb, onThumbChange, onThumbPointerUp, onThumbPointerDown, onThumbPositionChange, onDragScroll, onWheelScroll, onResize, ...scrollbarProps } = props;
|
|
1603
|
+
const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
|
|
1604
|
+
const [scrollbar, setScrollbar] = React$1.useState(null);
|
|
1605
|
+
const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node));
|
|
1606
|
+
const rectRef = React$1.useRef(null);
|
|
1607
|
+
const prevWebkitUserSelectRef = React$1.useRef("");
|
|
1608
|
+
const viewport = context.viewport;
|
|
1609
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
1610
|
+
const handleWheelScroll = useCallbackRef(onWheelScroll);
|
|
1611
|
+
const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);
|
|
1612
|
+
const handleResize = useDebounceCallback(onResize, 10);
|
|
1613
|
+
function handleDragScroll(event) {
|
|
1614
|
+
if (rectRef.current) onDragScroll({
|
|
1615
|
+
x: event.clientX - rectRef.current.left,
|
|
1616
|
+
y: event.clientY - rectRef.current.top
|
|
1617
|
+
});
|
|
1618
|
+
}
|
|
1619
|
+
React$1.useEffect(() => {
|
|
1620
|
+
const handleWheel = (event) => {
|
|
1621
|
+
const element = event.target;
|
|
1622
|
+
if (scrollbar?.contains(element)) handleWheelScroll(event, maxScrollPos);
|
|
1623
|
+
};
|
|
1624
|
+
document.addEventListener("wheel", handleWheel, { passive: false });
|
|
1625
|
+
return () => document.removeEventListener("wheel", handleWheel, { passive: false });
|
|
1626
|
+
}, [
|
|
1627
|
+
viewport,
|
|
1628
|
+
scrollbar,
|
|
1629
|
+
maxScrollPos,
|
|
1630
|
+
handleWheelScroll
|
|
1631
|
+
]);
|
|
1632
|
+
React$1.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
|
|
1633
|
+
useResizeObserver(scrollbar, handleResize);
|
|
1634
|
+
useResizeObserver(context.content, handleResize);
|
|
1635
|
+
return /* @__PURE__ */ jsx(ScrollbarProvider, {
|
|
1636
|
+
scope: __scopeScrollArea,
|
|
1637
|
+
scrollbar,
|
|
1638
|
+
hasThumb,
|
|
1639
|
+
onThumbChange: useCallbackRef(onThumbChange),
|
|
1640
|
+
onThumbPointerUp: useCallbackRef(onThumbPointerUp),
|
|
1641
|
+
onThumbPositionChange: handleThumbPositionChange,
|
|
1642
|
+
onThumbPointerDown: useCallbackRef(onThumbPointerDown),
|
|
1643
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
1644
|
+
...scrollbarProps,
|
|
1645
|
+
ref: composeRefs,
|
|
1646
|
+
style: {
|
|
1647
|
+
position: "absolute",
|
|
1648
|
+
...scrollbarProps.style
|
|
1649
|
+
},
|
|
1650
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
1651
|
+
if (event.button === 0) {
|
|
1652
|
+
event.target.setPointerCapture(event.pointerId);
|
|
1653
|
+
rectRef.current = scrollbar.getBoundingClientRect();
|
|
1654
|
+
prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
|
|
1655
|
+
document.body.style.webkitUserSelect = "none";
|
|
1656
|
+
if (context.viewport) context.viewport.style.scrollBehavior = "auto";
|
|
1657
|
+
handleDragScroll(event);
|
|
1658
|
+
}
|
|
1659
|
+
}),
|
|
1660
|
+
onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
|
|
1661
|
+
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
|
|
1662
|
+
const element = event.target;
|
|
1663
|
+
if (element.hasPointerCapture(event.pointerId)) element.releasePointerCapture(event.pointerId);
|
|
1664
|
+
document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
|
|
1665
|
+
if (context.viewport) context.viewport.style.scrollBehavior = "";
|
|
1666
|
+
rectRef.current = null;
|
|
1667
|
+
})
|
|
1668
|
+
})
|
|
1669
|
+
});
|
|
1670
|
+
});
|
|
1671
|
+
var THUMB_NAME = "ScrollAreaThumb";
|
|
1672
|
+
var ScrollAreaThumb = React$1.forwardRef((props, forwardedRef) => {
|
|
1673
|
+
const { forceMount, ...thumbProps } = props;
|
|
1674
|
+
const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
|
|
1675
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
1676
|
+
present: forceMount || scrollbarContext.hasThumb,
|
|
1677
|
+
children: /* @__PURE__ */ jsx(ScrollAreaThumbImpl, {
|
|
1678
|
+
ref: forwardedRef,
|
|
1679
|
+
...thumbProps
|
|
1680
|
+
})
|
|
1681
|
+
});
|
|
1682
|
+
});
|
|
1683
|
+
var ScrollAreaThumbImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
1684
|
+
const { __scopeScrollArea, style, ...thumbProps } = props;
|
|
1685
|
+
const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
|
|
1686
|
+
const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
|
|
1687
|
+
const { onThumbPositionChange } = scrollbarContext;
|
|
1688
|
+
const composedRef = useComposedRefs(forwardedRef, (node) => scrollbarContext.onThumbChange(node));
|
|
1689
|
+
const removeUnlinkedScrollListenerRef = React$1.useRef(void 0);
|
|
1690
|
+
const debounceScrollEnd = useDebounceCallback(() => {
|
|
1691
|
+
if (removeUnlinkedScrollListenerRef.current) {
|
|
1692
|
+
removeUnlinkedScrollListenerRef.current();
|
|
1693
|
+
removeUnlinkedScrollListenerRef.current = void 0;
|
|
1694
|
+
}
|
|
1695
|
+
}, 100);
|
|
1696
|
+
React$1.useEffect(() => {
|
|
1697
|
+
const viewport = scrollAreaContext.viewport;
|
|
1698
|
+
if (viewport) {
|
|
1699
|
+
const handleScroll = () => {
|
|
1700
|
+
debounceScrollEnd();
|
|
1701
|
+
if (!removeUnlinkedScrollListenerRef.current) {
|
|
1702
|
+
removeUnlinkedScrollListenerRef.current = addUnlinkedScrollListener(viewport, onThumbPositionChange);
|
|
1703
|
+
onThumbPositionChange();
|
|
1704
|
+
}
|
|
1705
|
+
};
|
|
1706
|
+
onThumbPositionChange();
|
|
1707
|
+
viewport.addEventListener("scroll", handleScroll);
|
|
1708
|
+
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
1709
|
+
}
|
|
1710
|
+
}, [
|
|
1711
|
+
scrollAreaContext.viewport,
|
|
1712
|
+
debounceScrollEnd,
|
|
1713
|
+
onThumbPositionChange
|
|
1714
|
+
]);
|
|
1715
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
1716
|
+
"data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
|
|
1717
|
+
...thumbProps,
|
|
1718
|
+
ref: composedRef,
|
|
1719
|
+
style: {
|
|
1720
|
+
width: "var(--radix-scroll-area-thumb-width)",
|
|
1721
|
+
height: "var(--radix-scroll-area-thumb-height)",
|
|
1722
|
+
...style
|
|
1723
|
+
},
|
|
1724
|
+
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
|
|
1725
|
+
const thumbRect = event.target.getBoundingClientRect();
|
|
1726
|
+
const x = event.clientX - thumbRect.left;
|
|
1727
|
+
const y = event.clientY - thumbRect.top;
|
|
1728
|
+
scrollbarContext.onThumbPointerDown({
|
|
1729
|
+
x,
|
|
1730
|
+
y
|
|
1731
|
+
});
|
|
1732
|
+
}),
|
|
1733
|
+
onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
|
|
1734
|
+
});
|
|
1735
|
+
});
|
|
1736
|
+
ScrollAreaThumb.displayName = THUMB_NAME;
|
|
1737
|
+
var CORNER_NAME = "ScrollAreaCorner";
|
|
1738
|
+
var ScrollAreaCorner = React$1.forwardRef((props, forwardedRef) => {
|
|
1739
|
+
const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
|
|
1740
|
+
const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
|
|
1741
|
+
return context.type !== "scroll" && hasBothScrollbarsVisible ? /* @__PURE__ */ jsx(ScrollAreaCornerImpl, {
|
|
1742
|
+
...props,
|
|
1743
|
+
ref: forwardedRef
|
|
1744
|
+
}) : null;
|
|
1745
|
+
});
|
|
1746
|
+
ScrollAreaCorner.displayName = CORNER_NAME;
|
|
1747
|
+
var ScrollAreaCornerImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
1748
|
+
const { __scopeScrollArea, ...cornerProps } = props;
|
|
1749
|
+
const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
|
|
1750
|
+
const [width, setWidth] = React$1.useState(0);
|
|
1751
|
+
const [height, setHeight] = React$1.useState(0);
|
|
1752
|
+
const hasSize = Boolean(width && height);
|
|
1753
|
+
useResizeObserver(context.scrollbarX, () => {
|
|
1754
|
+
const height2 = context.scrollbarX?.offsetHeight || 0;
|
|
1755
|
+
context.onCornerHeightChange(height2);
|
|
1756
|
+
setHeight(height2);
|
|
1757
|
+
});
|
|
1758
|
+
useResizeObserver(context.scrollbarY, () => {
|
|
1759
|
+
const width2 = context.scrollbarY?.offsetWidth || 0;
|
|
1760
|
+
context.onCornerWidthChange(width2);
|
|
1761
|
+
setWidth(width2);
|
|
1762
|
+
});
|
|
1763
|
+
return hasSize ? /* @__PURE__ */ jsx(Primitive.div, {
|
|
1764
|
+
...cornerProps,
|
|
1765
|
+
ref: forwardedRef,
|
|
1766
|
+
style: {
|
|
1767
|
+
width,
|
|
1768
|
+
height,
|
|
1769
|
+
position: "absolute",
|
|
1770
|
+
right: context.dir === "ltr" ? 0 : void 0,
|
|
1771
|
+
left: context.dir === "rtl" ? 0 : void 0,
|
|
1772
|
+
bottom: 0,
|
|
1773
|
+
...props.style
|
|
1774
|
+
}
|
|
1775
|
+
}) : null;
|
|
1776
|
+
});
|
|
1777
|
+
function toInt(value) {
|
|
1778
|
+
return value ? parseInt(value, 10) : 0;
|
|
1779
|
+
}
|
|
1780
|
+
function getThumbRatio(viewportSize, contentSize) {
|
|
1781
|
+
const ratio = viewportSize / contentSize;
|
|
1782
|
+
return isNaN(ratio) ? 0 : ratio;
|
|
1783
|
+
}
|
|
1784
|
+
function getThumbSize(sizes) {
|
|
1785
|
+
const ratio = getThumbRatio(sizes.viewport, sizes.content);
|
|
1786
|
+
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
1787
|
+
const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
|
|
1788
|
+
return Math.max(thumbSize, 18);
|
|
1789
|
+
}
|
|
1790
|
+
function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
|
|
1791
|
+
const thumbSizePx = getThumbSize(sizes);
|
|
1792
|
+
const thumbCenter = thumbSizePx / 2;
|
|
1793
|
+
const offset = pointerOffset || thumbCenter;
|
|
1794
|
+
const thumbOffsetFromEnd = thumbSizePx - offset;
|
|
1795
|
+
const minPointerPos = sizes.scrollbar.paddingStart + offset;
|
|
1796
|
+
const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
|
|
1797
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
1798
|
+
const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
|
|
1799
|
+
return linearScale([minPointerPos, maxPointerPos], scrollRange)(pointerPos);
|
|
1800
|
+
}
|
|
1801
|
+
function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
|
|
1802
|
+
const thumbSizePx = getThumbSize(sizes);
|
|
1803
|
+
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
|
|
1804
|
+
const scrollbar = sizes.scrollbar.size - scrollbarPadding;
|
|
1805
|
+
const maxScrollPos = sizes.content - sizes.viewport;
|
|
1806
|
+
const maxThumbPos = scrollbar - thumbSizePx;
|
|
1807
|
+
const scrollWithoutMomentum = clamp(scrollPos, dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0]);
|
|
1808
|
+
return linearScale([0, maxScrollPos], [0, maxThumbPos])(scrollWithoutMomentum);
|
|
1809
|
+
}
|
|
1810
|
+
function linearScale(input, output) {
|
|
1811
|
+
return (value) => {
|
|
1812
|
+
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
1813
|
+
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
1814
|
+
return output[0] + ratio * (value - input[0]);
|
|
1815
|
+
};
|
|
1816
|
+
}
|
|
1817
|
+
function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
|
|
1818
|
+
return scrollPos > 0 && scrollPos < maxScrollPos;
|
|
1819
|
+
}
|
|
1820
|
+
var addUnlinkedScrollListener = (node, handler = () => {}) => {
|
|
1821
|
+
let prevPosition = {
|
|
1822
|
+
left: node.scrollLeft,
|
|
1823
|
+
top: node.scrollTop
|
|
1824
|
+
};
|
|
1825
|
+
let rAF = 0;
|
|
1826
|
+
(function loop() {
|
|
1827
|
+
const position = {
|
|
1828
|
+
left: node.scrollLeft,
|
|
1829
|
+
top: node.scrollTop
|
|
1830
|
+
};
|
|
1831
|
+
const isHorizontalScroll = prevPosition.left !== position.left;
|
|
1832
|
+
const isVerticalScroll = prevPosition.top !== position.top;
|
|
1833
|
+
if (isHorizontalScroll || isVerticalScroll) handler();
|
|
1834
|
+
prevPosition = position;
|
|
1835
|
+
rAF = window.requestAnimationFrame(loop);
|
|
1836
|
+
})();
|
|
1837
|
+
return () => window.cancelAnimationFrame(rAF);
|
|
1838
|
+
};
|
|
1839
|
+
function useDebounceCallback(callback, delay) {
|
|
1840
|
+
const handleCallback = useCallbackRef(callback);
|
|
1841
|
+
const debounceTimerRef = React$1.useRef(0);
|
|
1842
|
+
React$1.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
|
|
1843
|
+
return React$1.useCallback(() => {
|
|
1844
|
+
window.clearTimeout(debounceTimerRef.current);
|
|
1845
|
+
debounceTimerRef.current = window.setTimeout(handleCallback, delay);
|
|
1846
|
+
}, [handleCallback, delay]);
|
|
1847
|
+
}
|
|
1848
|
+
function useResizeObserver(element, onResize) {
|
|
1849
|
+
const handleResize = useCallbackRef(onResize);
|
|
1850
|
+
useLayoutEffect2(() => {
|
|
1851
|
+
let rAF = 0;
|
|
1852
|
+
if (element) {
|
|
1853
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
1854
|
+
cancelAnimationFrame(rAF);
|
|
1855
|
+
rAF = window.requestAnimationFrame(handleResize);
|
|
1856
|
+
});
|
|
1857
|
+
resizeObserver.observe(element);
|
|
1858
|
+
return () => {
|
|
1859
|
+
window.cancelAnimationFrame(rAF);
|
|
1860
|
+
resizeObserver.unobserve(element);
|
|
1861
|
+
};
|
|
1862
|
+
}
|
|
1863
|
+
}, [element, handleResize]);
|
|
1864
|
+
}
|
|
1865
|
+
var Root = ScrollArea$1;
|
|
1866
|
+
var Viewport = ScrollAreaViewport;
|
|
1867
|
+
var Corner = ScrollAreaCorner;
|
|
1868
|
+
function ScrollArea({ className, children, ...props }) {
|
|
1869
|
+
return /* @__PURE__ */ jsxs(Root, {
|
|
1870
|
+
"data-slot": "scroll-area",
|
|
1871
|
+
className: cn("relative", className),
|
|
1872
|
+
...props,
|
|
1873
|
+
children: [
|
|
1874
|
+
/* @__PURE__ */ jsx(Viewport, {
|
|
1875
|
+
"data-slot": "scroll-area-viewport",
|
|
1876
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
1877
|
+
children
|
|
1878
|
+
}),
|
|
1879
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
1880
|
+
/* @__PURE__ */ jsx(Corner, {})
|
|
1881
|
+
]
|
|
1882
|
+
});
|
|
1883
|
+
}
|
|
1884
|
+
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
1885
|
+
return /* @__PURE__ */ jsx(ScrollAreaScrollbar, {
|
|
1886
|
+
"data-slot": "scroll-area-scrollbar",
|
|
1887
|
+
orientation,
|
|
1888
|
+
className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", className),
|
|
1889
|
+
...props,
|
|
1890
|
+
children: /* @__PURE__ */ jsx(ScrollAreaThumb, {
|
|
1891
|
+
"data-slot": "scroll-area-thumb",
|
|
1892
|
+
className: "bg-border relative flex-1 rounded-full"
|
|
1893
|
+
})
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1896
|
+
var SplitLayoutContext = createContext(null);
|
|
1897
|
+
function useSplitLayout() {
|
|
1898
|
+
const context = useContext(SplitLayoutContext);
|
|
1899
|
+
if (!context) throw new Error("useSplitLayout must be used within SplitLayoutGlass.Provider. Wrap your component tree with <SplitLayoutGlass.Provider>.");
|
|
1900
|
+
return context;
|
|
1901
|
+
}
|
|
1902
|
+
function useSplitLayoutOptional() {
|
|
1903
|
+
return useContext(SplitLayoutContext);
|
|
1904
|
+
}
|
|
1905
|
+
var BREAKPOINT_VALUES = {
|
|
1906
|
+
sm: 640,
|
|
1907
|
+
md: 768,
|
|
1908
|
+
lg: 1024,
|
|
1909
|
+
xl: 1440,
|
|
1910
|
+
"2xl": 1536
|
|
1911
|
+
};
|
|
1912
|
+
const SplitLayoutProvider = ({ children, selectedKey: controlledSelectedKey, onSelectedKeyChange, defaultSelectedKey = null, open: controlledOpen, onOpenChange, defaultOpen = true, breakpoint = "md", mobileMode = "stack", intensity = "medium", stickyOffset = 24, urlParamName, keyboardShortcut = "b" }) => {
|
|
1913
|
+
const [internalSelectedKey, setInternalSelectedKey] = useState(() => {
|
|
1914
|
+
if (urlParamName && typeof window !== "undefined") {
|
|
1915
|
+
const urlValue = new URLSearchParams(window.location.search).get(urlParamName);
|
|
1916
|
+
if (urlValue) return urlValue;
|
|
1917
|
+
}
|
|
1918
|
+
return defaultSelectedKey;
|
|
1919
|
+
});
|
|
1920
|
+
const isSelectedKeyControlled = controlledSelectedKey !== void 0;
|
|
1921
|
+
const selectedKey = isSelectedKeyControlled ? controlledSelectedKey : internalSelectedKey;
|
|
1922
|
+
const setSelectedKey = useCallback((key) => {
|
|
1923
|
+
if (!isSelectedKeyControlled) setInternalSelectedKey(key);
|
|
1924
|
+
onSelectedKeyChange?.(key);
|
|
1925
|
+
if (urlParamName && typeof window !== "undefined") {
|
|
1926
|
+
const url = new URL(window.location.href);
|
|
1927
|
+
if (key) url.searchParams.set(urlParamName, key);
|
|
1928
|
+
else url.searchParams.delete(urlParamName);
|
|
1929
|
+
window.history.replaceState({}, "", url.toString());
|
|
1930
|
+
}
|
|
1931
|
+
}, [
|
|
1932
|
+
isSelectedKeyControlled,
|
|
1933
|
+
onSelectedKeyChange,
|
|
1934
|
+
urlParamName
|
|
1935
|
+
]);
|
|
1936
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
1937
|
+
const isOpenControlled = controlledOpen !== void 0;
|
|
1938
|
+
const isOpen = isOpenControlled ? controlledOpen : internalOpen;
|
|
1939
|
+
const setIsOpen = useCallback((open) => {
|
|
1940
|
+
if (!isOpenControlled) setInternalOpen(open);
|
|
1941
|
+
onOpenChange?.(open);
|
|
1942
|
+
}, [isOpenControlled, onOpenChange]);
|
|
1943
|
+
const [isMobileOpen, setMobileOpen] = useState(false);
|
|
1944
|
+
const [isMobile, setIsMobile] = useState(() => {
|
|
1945
|
+
if (typeof window === "undefined") return false;
|
|
1946
|
+
return window.innerWidth < BREAKPOINT_VALUES[breakpoint];
|
|
1947
|
+
});
|
|
1948
|
+
useEffect(() => {
|
|
1949
|
+
if (typeof window === "undefined") return;
|
|
1950
|
+
const checkMobile = () => {
|
|
1951
|
+
setIsMobile(window.innerWidth < BREAKPOINT_VALUES[breakpoint]);
|
|
1952
|
+
};
|
|
1953
|
+
checkMobile();
|
|
1954
|
+
window.addEventListener("resize", checkMobile);
|
|
1955
|
+
return () => window.removeEventListener("resize", checkMobile);
|
|
1956
|
+
}, [breakpoint]);
|
|
1957
|
+
const toggle = useCallback(() => {
|
|
1958
|
+
if (isMobile) setMobileOpen((prev) => !prev);
|
|
1959
|
+
else setIsOpen(!isOpen);
|
|
1960
|
+
}, [
|
|
1961
|
+
isMobile,
|
|
1962
|
+
isOpen,
|
|
1963
|
+
setIsOpen
|
|
1964
|
+
]);
|
|
1965
|
+
useEffect(() => {
|
|
1966
|
+
if (!keyboardShortcut) return;
|
|
1967
|
+
const handleKeyDown = (e) => {
|
|
1968
|
+
if (e.key === "Escape" && isMobile && isMobileOpen) {
|
|
1969
|
+
e.preventDefault();
|
|
1970
|
+
setMobileOpen(false);
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
if (e.key === keyboardShortcut && (e.metaKey || e.ctrlKey)) {
|
|
1974
|
+
e.preventDefault();
|
|
1975
|
+
toggle();
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1979
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1980
|
+
}, [
|
|
1981
|
+
keyboardShortcut,
|
|
1982
|
+
isMobile,
|
|
1983
|
+
isMobileOpen,
|
|
1984
|
+
toggle
|
|
1985
|
+
]);
|
|
1986
|
+
const value = useMemo(() => ({
|
|
1987
|
+
selectedKey,
|
|
1988
|
+
setSelectedKey,
|
|
1989
|
+
isOpen,
|
|
1990
|
+
setIsOpen,
|
|
1991
|
+
isMobileOpen,
|
|
1992
|
+
setMobileOpen,
|
|
1993
|
+
isMobile,
|
|
1994
|
+
breakpoint,
|
|
1995
|
+
mobileMode,
|
|
1996
|
+
intensity,
|
|
1997
|
+
stickyOffset,
|
|
1998
|
+
toggle,
|
|
1999
|
+
state: isOpen ? "expanded" : "collapsed",
|
|
2000
|
+
open: isOpen,
|
|
2001
|
+
setOpen: setIsOpen,
|
|
2002
|
+
openMobile: isMobileOpen,
|
|
2003
|
+
setOpenMobile: setMobileOpen,
|
|
2004
|
+
toggleSidebar: toggle
|
|
2005
|
+
}), [
|
|
2006
|
+
selectedKey,
|
|
2007
|
+
setSelectedKey,
|
|
2008
|
+
isOpen,
|
|
2009
|
+
setIsOpen,
|
|
2010
|
+
isMobileOpen,
|
|
2011
|
+
isMobile,
|
|
2012
|
+
breakpoint,
|
|
2013
|
+
mobileMode,
|
|
2014
|
+
intensity,
|
|
2015
|
+
stickyOffset,
|
|
2016
|
+
toggle
|
|
2017
|
+
]);
|
|
2018
|
+
return /* @__PURE__ */ jsx(SplitLayoutContext.Provider, {
|
|
2019
|
+
value,
|
|
2020
|
+
children
|
|
2021
|
+
});
|
|
2022
|
+
};
|
|
2023
|
+
SplitLayoutProvider.displayName = "SplitLayoutGlass.Provider";
|
|
2024
|
+
var SplitLayoutAccordionRoot = forwardRef(({ children, label = "Content accordion", className, ...props }, ref) => {
|
|
2025
|
+
return /* @__PURE__ */ jsx(GlassCard, {
|
|
2026
|
+
asChild: true,
|
|
2027
|
+
intensity: useSplitLayoutOptional()?.intensity ?? "medium",
|
|
2028
|
+
padding: "none",
|
|
2029
|
+
className: cn("divide-y divide-white/10", className),
|
|
2030
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2031
|
+
ref,
|
|
2032
|
+
role: "region",
|
|
2033
|
+
"aria-label": label,
|
|
2034
|
+
"data-split-accordion": "",
|
|
2035
|
+
...props,
|
|
2036
|
+
children
|
|
2037
|
+
})
|
|
2038
|
+
});
|
|
2039
|
+
});
|
|
2040
|
+
SplitLayoutAccordionRoot.displayName = "SplitLayoutAccordion.Root";
|
|
2041
|
+
var SplitLayoutAccordionItem = forwardRef(({ itemKey, trigger, children, disabled = false, className, ...props }, ref) => {
|
|
2042
|
+
const { selectedKey, setSelectedKey } = useSplitLayout();
|
|
2043
|
+
const isExpanded = selectedKey === itemKey;
|
|
2044
|
+
const contentRef = useRef(null);
|
|
2045
|
+
const [contentHeight, setContentHeight] = useState(null);
|
|
2046
|
+
const triggerId = useId();
|
|
2047
|
+
const contentId = useId();
|
|
2048
|
+
useEffect(() => {
|
|
2049
|
+
if (contentRef.current) setContentHeight(contentRef.current.scrollHeight);
|
|
2050
|
+
}, [children, isExpanded]);
|
|
2051
|
+
const handleToggle = useCallback(() => {
|
|
2052
|
+
if (disabled) return;
|
|
2053
|
+
setSelectedKey(isExpanded ? null : itemKey);
|
|
2054
|
+
}, [
|
|
2055
|
+
disabled,
|
|
2056
|
+
isExpanded,
|
|
2057
|
+
itemKey,
|
|
2058
|
+
setSelectedKey
|
|
2059
|
+
]);
|
|
2060
|
+
const handleKeyDown = useCallback((e) => {
|
|
2061
|
+
if (disabled) return;
|
|
2062
|
+
switch (e.key) {
|
|
2063
|
+
case "Enter":
|
|
2064
|
+
case " ":
|
|
2065
|
+
e.preventDefault();
|
|
2066
|
+
handleToggle();
|
|
2067
|
+
break;
|
|
2068
|
+
case "ArrowDown":
|
|
2069
|
+
e.preventDefault();
|
|
2070
|
+
((e.currentTarget.parentElement?.nextElementSibling)?.querySelector("[data-accordion-trigger]"))?.focus();
|
|
2071
|
+
break;
|
|
2072
|
+
case "ArrowUp":
|
|
2073
|
+
e.preventDefault();
|
|
2074
|
+
((e.currentTarget.parentElement?.previousElementSibling)?.querySelector("[data-accordion-trigger]"))?.focus();
|
|
2075
|
+
break;
|
|
2076
|
+
case "Home":
|
|
2077
|
+
e.preventDefault();
|
|
2078
|
+
(e.currentTarget.closest("[data-split-accordion]")?.querySelector("[data-accordion-trigger]"))?.focus();
|
|
2079
|
+
break;
|
|
2080
|
+
case "End": {
|
|
2081
|
+
e.preventDefault();
|
|
2082
|
+
const triggers = e.currentTarget.closest("[data-split-accordion]")?.querySelectorAll("[data-accordion-trigger]");
|
|
2083
|
+
(triggers?.[triggers.length - 1])?.focus();
|
|
2084
|
+
break;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
}, [disabled, handleToggle]);
|
|
2088
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2089
|
+
ref,
|
|
2090
|
+
"data-accordion-item": "",
|
|
2091
|
+
"data-state": isExpanded ? "open" : "closed",
|
|
2092
|
+
"data-disabled": disabled || void 0,
|
|
2093
|
+
className: cn("overflow-hidden", disabled && "opacity-50 cursor-not-allowed", className),
|
|
2094
|
+
...props,
|
|
2095
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
2096
|
+
type: "button",
|
|
2097
|
+
id: triggerId,
|
|
2098
|
+
"data-accordion-trigger": "",
|
|
2099
|
+
"aria-expanded": isExpanded,
|
|
2100
|
+
"aria-controls": contentId,
|
|
2101
|
+
"aria-disabled": disabled,
|
|
2102
|
+
disabled,
|
|
2103
|
+
onClick: handleToggle,
|
|
2104
|
+
onKeyDown: handleKeyDown,
|
|
2105
|
+
className: cn("flex w-full items-center justify-between gap-4", "p-4 text-left", "transition-colors duration-200", "hover:bg-white/5 focus-visible:bg-white/5", "focus:outline-none focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:ring-inset", disabled && "pointer-events-none"),
|
|
2106
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
2107
|
+
className: "flex-1",
|
|
2108
|
+
children: trigger
|
|
2109
|
+
}), /* @__PURE__ */ jsx(ChevronDown, { className: cn("h-4 w-4 shrink-0 text-white/60", "transition-transform duration-300 ease-out", isExpanded && "rotate-180") })]
|
|
2110
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
2111
|
+
id: contentId,
|
|
2112
|
+
ref: contentRef,
|
|
2113
|
+
role: "region",
|
|
2114
|
+
"aria-labelledby": triggerId,
|
|
2115
|
+
"data-accordion-content": "",
|
|
2116
|
+
"data-state": isExpanded ? "open" : "closed",
|
|
2117
|
+
className: cn("overflow-hidden", "transition-[max-height,opacity] duration-300 ease-out"),
|
|
2118
|
+
style: {
|
|
2119
|
+
maxHeight: isExpanded ? contentHeight ?? "auto" : 0,
|
|
2120
|
+
opacity: isExpanded ? 1 : 0
|
|
2121
|
+
},
|
|
2122
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2123
|
+
className: "p-4 pt-0 border-t border-white/5",
|
|
2124
|
+
children
|
|
2125
|
+
})
|
|
2126
|
+
})]
|
|
2127
|
+
});
|
|
2128
|
+
});
|
|
2129
|
+
SplitLayoutAccordionItem.displayName = "SplitLayoutAccordion.Item";
|
|
2130
|
+
const SplitLayoutAccordion = {
|
|
2131
|
+
Root: SplitLayoutAccordionRoot,
|
|
2132
|
+
Item: SplitLayoutAccordionItem
|
|
2133
|
+
};
|
|
2134
|
+
function useGridStyles(config) {
|
|
2135
|
+
const { ratio = {
|
|
2136
|
+
sidebar: 1,
|
|
2137
|
+
main: 2
|
|
2138
|
+
}, minSidebarWidth = "280px", maxSidebarWidth, gap = {
|
|
2139
|
+
mobile: 16,
|
|
2140
|
+
desktop: 24
|
|
2141
|
+
}, stickyOffset = 24 } = config;
|
|
2142
|
+
const gapMobile = typeof gap === "number" ? gap : gap.mobile ?? 16;
|
|
2143
|
+
const gapDesktop = typeof gap === "number" ? gap : gap.desktop ?? 24;
|
|
2144
|
+
const gridTemplate = maxSidebarWidth ? `minmax(${minSidebarWidth}, ${maxSidebarWidth}) ${ratio.main}fr` : `minmax(${minSidebarWidth}, ${ratio.sidebar}fr) ${ratio.main}fr`;
|
|
2145
|
+
return { cssVars: {
|
|
2146
|
+
"--grid-template": gridTemplate,
|
|
2147
|
+
"--sticky-offset": `${stickyOffset}px`,
|
|
2148
|
+
"--sticky-max-height": `calc(100vh - calc(${stickyOffset}px * 2))`,
|
|
2149
|
+
"--gap-mobile": `${gapMobile}px`,
|
|
2150
|
+
"--gap-desktop": `${gapDesktop}px`
|
|
2151
|
+
} };
|
|
2152
|
+
}
|
|
2153
|
+
var SplitLayoutRoot = forwardRef(({ children, ratio = {
|
|
2154
|
+
sidebar: 1,
|
|
2155
|
+
main: 2
|
|
2156
|
+
}, minSidebarWidth = "300px", maxSidebarWidth, gap = {
|
|
2157
|
+
mobile: 16,
|
|
2158
|
+
desktop: 24
|
|
2159
|
+
}, breakpoint: breakpointProp, mobileLayout = "stack", className, ...props }, ref) => {
|
|
2160
|
+
const context = useSplitLayoutOptional();
|
|
2161
|
+
const breakpoint = breakpointProp ?? context?.breakpoint ?? "md";
|
|
2162
|
+
const { cssVars } = useGridStyles({
|
|
2163
|
+
ratio,
|
|
2164
|
+
minSidebarWidth,
|
|
2165
|
+
maxSidebarWidth,
|
|
2166
|
+
gap,
|
|
2167
|
+
stickyOffset: context?.stickyOffset ?? 24
|
|
2168
|
+
});
|
|
2169
|
+
const bp = breakpoint;
|
|
2170
|
+
const gapClasses = {
|
|
2171
|
+
sm: "gap-[var(--gap-mobile)] sm:gap-[var(--gap-desktop)]",
|
|
2172
|
+
md: "gap-[var(--gap-mobile)] md:gap-[var(--gap-desktop)]",
|
|
2173
|
+
lg: "gap-[var(--gap-mobile)] lg:gap-[var(--gap-desktop)]",
|
|
2174
|
+
xl: "gap-[var(--gap-mobile)] xl:gap-[var(--gap-desktop)]",
|
|
2175
|
+
"2xl": "gap-[var(--gap-mobile)] 2xl:gap-[var(--gap-desktop)]"
|
|
2176
|
+
};
|
|
2177
|
+
const gridClasses = {
|
|
2178
|
+
sm: "sm:grid-cols-(--grid-template)",
|
|
2179
|
+
md: "md:grid-cols-(--grid-template)",
|
|
2180
|
+
lg: "lg:grid-cols-(--grid-template)",
|
|
2181
|
+
xl: "xl:grid-cols-(--grid-template)",
|
|
2182
|
+
"2xl": "2xl:grid-cols-(--grid-template)"
|
|
2183
|
+
};
|
|
2184
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2185
|
+
ref,
|
|
2186
|
+
"data-split-layout-root": "",
|
|
2187
|
+
"data-state": context?.state ?? "expanded",
|
|
2188
|
+
className: cn("grid", "items-start", mobileLayout === "stack" && "grid-cols-1", mobileLayout === "main-only" && "grid-cols-1 *:data-split-sidebar:hidden", mobileLayout === "sidebar-only" && "grid-cols-1 *:data-split-main:hidden", gridClasses[bp], gapClasses[bp], className),
|
|
2189
|
+
style: cssVars,
|
|
2190
|
+
...props,
|
|
2191
|
+
children
|
|
2192
|
+
});
|
|
2193
|
+
});
|
|
2194
|
+
SplitLayoutRoot.displayName = "SplitLayoutGlass.Root";
|
|
2195
|
+
var SplitLayoutSidebar = forwardRef(({ children, label = "Sidebar navigation", className, ...props }, ref) => {
|
|
2196
|
+
const context = useSplitLayoutOptional();
|
|
2197
|
+
const breakpoint = context?.breakpoint ?? "md";
|
|
2198
|
+
const intensity = context?.intensity ?? "medium";
|
|
2199
|
+
const bp = breakpoint;
|
|
2200
|
+
return /* @__PURE__ */ jsx(GlassCard, {
|
|
2201
|
+
asChild: true,
|
|
2202
|
+
intensity,
|
|
2203
|
+
padding: "none",
|
|
2204
|
+
className: cn("overflow-hidden rounded-xl", `${bp}:sticky`, `${bp}:top-[var(--sticky-offset)]`, `${bp}:max-h-[var(--sticky-max-height)]`, `${bp}:flex`, `${bp}:flex-col`, className),
|
|
2205
|
+
children: /* @__PURE__ */ jsx("aside", {
|
|
2206
|
+
ref,
|
|
2207
|
+
"data-split-sidebar": "",
|
|
2208
|
+
"aria-label": label,
|
|
2209
|
+
...props,
|
|
2210
|
+
children
|
|
2211
|
+
})
|
|
2212
|
+
});
|
|
2213
|
+
});
|
|
2214
|
+
SplitLayoutSidebar.displayName = "SplitLayoutGlass.Sidebar";
|
|
2215
|
+
var SplitLayoutSidebarHeader = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
2216
|
+
ref,
|
|
2217
|
+
"data-split-sidebar-header": "",
|
|
2218
|
+
className: cn("shrink-0 p-4 border-b border-white/10", className),
|
|
2219
|
+
...props,
|
|
2220
|
+
children
|
|
2221
|
+
}));
|
|
2222
|
+
SplitLayoutSidebarHeader.displayName = "SplitLayoutGlass.SidebarHeader";
|
|
2223
|
+
var SplitLayoutSidebarContent = forwardRef(({ children, scrollable = true, className, ...props }, ref) => {
|
|
2224
|
+
if (scrollable) {
|
|
2225
|
+
const { dir, ...divProps } = props;
|
|
2226
|
+
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
2227
|
+
ref,
|
|
2228
|
+
"data-split-sidebar-content": "",
|
|
2229
|
+
className: cn("flex-1 min-h-0", className),
|
|
2230
|
+
...divProps,
|
|
2231
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2232
|
+
className: "p-4",
|
|
2233
|
+
children
|
|
2234
|
+
})
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2238
|
+
ref,
|
|
2239
|
+
"data-split-sidebar-content": "",
|
|
2240
|
+
className: cn("flex-1 min-h-0 overflow-auto p-4", className),
|
|
2241
|
+
...props,
|
|
2242
|
+
children
|
|
2243
|
+
});
|
|
2244
|
+
});
|
|
2245
|
+
SplitLayoutSidebarContent.displayName = "SplitLayoutGlass.SidebarContent";
|
|
2246
|
+
var SplitLayoutSidebarFooter = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
2247
|
+
ref,
|
|
2248
|
+
"data-split-sidebar-footer": "",
|
|
2249
|
+
className: cn("shrink-0 p-4 border-t border-white/10", className),
|
|
2250
|
+
...props,
|
|
2251
|
+
children
|
|
2252
|
+
}));
|
|
2253
|
+
SplitLayoutSidebarFooter.displayName = "SplitLayoutGlass.SidebarFooter";
|
|
2254
|
+
var SplitLayoutMain = forwardRef(({ children, label = "Main content", className, ...props }, ref) => {
|
|
2255
|
+
const context = useSplitLayoutOptional();
|
|
2256
|
+
const breakpoint = context?.breakpoint ?? "md";
|
|
2257
|
+
const intensity = context?.intensity ?? "medium";
|
|
2258
|
+
const bp = breakpoint;
|
|
2259
|
+
return /* @__PURE__ */ jsx(GlassCard, {
|
|
2260
|
+
asChild: true,
|
|
2261
|
+
intensity,
|
|
2262
|
+
padding: "none",
|
|
2263
|
+
className: cn("overflow-hidden rounded-xl", `${bp}:sticky`, `${bp}:top-[var(--sticky-offset)]`, `${bp}:max-h-[var(--sticky-max-height)]`, `${bp}:flex`, `${bp}:flex-col`, className),
|
|
2264
|
+
children: /* @__PURE__ */ jsx("main", {
|
|
2265
|
+
ref,
|
|
2266
|
+
"data-split-main": "",
|
|
2267
|
+
"aria-label": label,
|
|
2268
|
+
...props,
|
|
2269
|
+
children
|
|
2270
|
+
})
|
|
2271
|
+
});
|
|
2272
|
+
});
|
|
2273
|
+
SplitLayoutMain.displayName = "SplitLayoutGlass.Main";
|
|
2274
|
+
var SplitLayoutMainHeader = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
2275
|
+
ref,
|
|
2276
|
+
"data-split-main-header": "",
|
|
2277
|
+
className: cn("shrink-0 p-6 border-b border-white/10", className),
|
|
2278
|
+
...props,
|
|
2279
|
+
children
|
|
2280
|
+
}));
|
|
2281
|
+
SplitLayoutMainHeader.displayName = "SplitLayoutGlass.MainHeader";
|
|
2282
|
+
var SplitLayoutMainContent = forwardRef(({ children, scrollable = true, className, ...props }, ref) => {
|
|
2283
|
+
if (scrollable) {
|
|
2284
|
+
const { dir, ...divProps } = props;
|
|
2285
|
+
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
2286
|
+
ref,
|
|
2287
|
+
"data-split-main-content": "",
|
|
2288
|
+
className: cn("flex-1 min-h-0", className),
|
|
2289
|
+
...divProps,
|
|
2290
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2291
|
+
className: "p-6",
|
|
2292
|
+
children
|
|
2293
|
+
})
|
|
2294
|
+
});
|
|
2295
|
+
}
|
|
2296
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2297
|
+
ref,
|
|
2298
|
+
"data-split-main-content": "",
|
|
2299
|
+
className: cn("flex-1 min-h-0 overflow-auto p-6", className),
|
|
2300
|
+
...props,
|
|
2301
|
+
children
|
|
2302
|
+
});
|
|
2303
|
+
});
|
|
2304
|
+
SplitLayoutMainContent.displayName = "SplitLayoutGlass.MainContent";
|
|
2305
|
+
var SplitLayoutMainFooter = forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
2306
|
+
ref,
|
|
2307
|
+
"data-split-main-footer": "",
|
|
2308
|
+
className: cn("shrink-0 p-6 border-t border-white/10", className),
|
|
2309
|
+
...props,
|
|
2310
|
+
children
|
|
2311
|
+
}));
|
|
2312
|
+
SplitLayoutMainFooter.displayName = "SplitLayoutGlass.MainFooter";
|
|
2313
|
+
var SplitLayoutTrigger = forwardRef(({ asChild = false, showOnDesktop = false, variant = "menu", className, children, ...props }, ref) => {
|
|
2314
|
+
const { toggle, isOpen, isMobileOpen, isMobile, breakpoint } = useSplitLayout();
|
|
2315
|
+
const currentOpen = isMobile ? isMobileOpen : isOpen;
|
|
2316
|
+
const Icon$1 = variant === "menu" ? currentOpen ? X : Menu : currentOpen ? PanelLeftClose : PanelLeftOpen;
|
|
2317
|
+
const visibilityClass = showOnDesktop ? "" : `${breakpoint}:hidden`;
|
|
2318
|
+
if (asChild) return /* @__PURE__ */ jsx(Slot, {
|
|
2319
|
+
ref,
|
|
2320
|
+
onClick: toggle,
|
|
2321
|
+
"aria-label": currentOpen ? "Close sidebar" : "Open sidebar",
|
|
2322
|
+
"aria-expanded": currentOpen,
|
|
2323
|
+
"data-state": currentOpen ? "open" : "closed",
|
|
2324
|
+
className: cn(visibilityClass, className),
|
|
2325
|
+
...props,
|
|
2326
|
+
children
|
|
2327
|
+
});
|
|
2328
|
+
return /* @__PURE__ */ jsx(ButtonGlass, {
|
|
2329
|
+
ref,
|
|
2330
|
+
variant: "ghost",
|
|
2331
|
+
size: "icon",
|
|
2332
|
+
onClick: toggle,
|
|
2333
|
+
"aria-label": currentOpen ? "Close sidebar" : "Open sidebar",
|
|
2334
|
+
"aria-expanded": currentOpen,
|
|
2335
|
+
"data-state": currentOpen ? "open" : "closed",
|
|
2336
|
+
className: cn(visibilityClass, className),
|
|
2337
|
+
...props,
|
|
2338
|
+
children: children ?? /* @__PURE__ */ jsx(Icon$1, { className: "h-5 w-5" })
|
|
2339
|
+
});
|
|
2340
|
+
});
|
|
2341
|
+
SplitLayoutTrigger.displayName = "SplitLayoutGlass.Trigger";
|
|
2342
|
+
const SplitLayoutGlass = {
|
|
2343
|
+
Provider: SplitLayoutProvider,
|
|
2344
|
+
Root: SplitLayoutRoot,
|
|
2345
|
+
Sidebar: SplitLayoutSidebar,
|
|
2346
|
+
SidebarHeader: SplitLayoutSidebarHeader,
|
|
2347
|
+
SidebarContent: SplitLayoutSidebarContent,
|
|
2348
|
+
SidebarFooter: SplitLayoutSidebarFooter,
|
|
2349
|
+
Main: SplitLayoutMain,
|
|
2350
|
+
MainHeader: SplitLayoutMainHeader,
|
|
2351
|
+
MainContent: SplitLayoutMainContent,
|
|
2352
|
+
MainFooter: SplitLayoutMainFooter,
|
|
2353
|
+
Trigger: SplitLayoutTrigger
|
|
2354
|
+
};
|
|
708
2355
|
var ChartContext = React$1.createContext(null);
|
|
709
2356
|
function useChart() {
|
|
710
2357
|
const context = React$1.useContext(ChartContext);
|
|
@@ -901,6 +2548,6 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
|
901
2548
|
size: "default"
|
|
902
2549
|
}
|
|
903
2550
|
});
|
|
904
|
-
export { AICardGlass, AlertGlass, AlertGlassDescription, AlertGlassTitle, AvatarGlass, AvatarGlassFallback, AvatarGlassImage, AvatarGlassSimple, BadgeGlass, Bar, BarChart, BaseProgressGlass, ButtonGlass, CareerStatsGlass, CareerStatsHeaderGlass, Cell, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CheckboxGlass, CircularMetricGlass, CircularProgressGlass, ComboBoxGlass, ContributionMetricsGlass, DropdownGlass, DropdownMenuGlass, DropdownMenuGlassCheckboxItem, DropdownMenuGlassContent, DropdownMenuGlassGroup, DropdownMenuGlassItem, DropdownMenuGlassLabel, DropdownMenuGlassPortal, DropdownMenuGlassRadioGroup, DropdownMenuGlassRadioItem, DropdownMenuGlassSeparator, DropdownMenuGlassShortcut, DropdownMenuGlassSub, DropdownMenuGlassSubContent, DropdownMenuGlassSubTrigger, DropdownMenuGlassTrigger, ExpandableHeaderGlass, FlagAlertGlass, FlagsSectionGlass, FormFieldWrapper, GlassCard, HeaderBrandingGlass, HeaderNavGlass, IconButtonGlass, InputGlass, InsightCardGlass, InteractiveCard, LanguageBarGlass, MetricCardGlass, MetricsGridGlass, ModalGlass, NotificationGlass, PopoverGlass, PopoverGlassAnchor, PopoverGlassContent, PopoverGlassLegacy, PopoverGlassTrigger, ProfileAvatarGlass, ProfileHeaderGlass, ProgressGlass, ProjectsListGlass, RainbowProgressGlass, RepositoryCardGlass, RepositoryHeaderGlass, RepositoryMetadataGlass, ResponsiveContainer, SearchBoxGlass, SegmentedControlGlass, SkeletonGlass, SliderGlass, SortDropdownGlass, SparklineGlass, StatItemGlass, StatusIndicatorGlass, StepperGlass, THEMES, THEME_CONFIG, TabsGlass, ThemeProvider, ThemeToggleGlass, ToggleGlass, TooltipGlass, TooltipGlassContent, TooltipGlassProvider, TooltipGlassSimple, TooltipGlassTrigger, TouchTarget, TrustScoreCardGlass, TrustScoreDisplayGlass, UserInfoGlass, UserStatsLineGlass, YearCardGlass, alertVariants, avatarSizes, badgeVariants, buttonGlassVariants, cardIntensity, cn, dropdownAlign, getNextTheme, getThemeConfig, inputVariants, insightCardVariants, insightVariantConfig, modalSizes, notificationVariants, progressSizes, alertVariants$1 as shadcnAlertVariants, badgeVariants$1 as shadcnBadgeVariants, buttonVariants as shadcnButtonVariants, skeletonVariants, sparklineBarVariants, sparklineContainerVariants, statusSizes, stepperConnectorVariants, stepperContentVariants, stepperDescriptionVariants, stepperIndicatorVariants, stepperLabelVariants, stepperListVariants, stepperRootVariants, stepperStepContainerVariants, toggleSizes, tooltipPositions, useChart, useFocus, useHover, useResponsive, useTheme, useWallpaperTint };
|
|
2551
|
+
export { AICardGlass, AlertGlass, AlertGlassDescription, AlertGlassTitle, AvatarGlass, AvatarGlassFallback, AvatarGlassImage, AvatarGlassSimple, BadgeGlass, Bar, BarChart, BaseProgressGlass, ButtonGlass, CareerStatsGlass, CareerStatsHeaderGlass, Cell, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, CheckboxGlass, CircularMetricGlass, CircularProgressGlass, ComboBoxGlass, ContributionMetricsGlass, DropdownGlass, DropdownMenuGlass, DropdownMenuGlassCheckboxItem, DropdownMenuGlassContent, DropdownMenuGlassGroup, DropdownMenuGlassItem, DropdownMenuGlassLabel, DropdownMenuGlassPortal, DropdownMenuGlassRadioGroup, DropdownMenuGlassRadioItem, DropdownMenuGlassSeparator, DropdownMenuGlassShortcut, DropdownMenuGlassSub, DropdownMenuGlassSubContent, DropdownMenuGlassSubTrigger, DropdownMenuGlassTrigger, ExpandableHeaderGlass, FlagAlertGlass, FlagsSectionGlass, FormFieldWrapper, GlassCard, HeaderBrandingGlass, HeaderNavGlass, IconButtonGlass, InputGlass, InsightCardGlass, InteractiveCard, LanguageBarGlass, MetricCardGlass, MetricsGridGlass, ModalGlass, NotificationGlass, PopoverGlass, PopoverGlassAnchor, PopoverGlassContent, PopoverGlassLegacy, PopoverGlassTrigger, ProfileAvatarGlass, ProfileHeaderGlass, ProgressGlass, ProjectsListGlass, RainbowProgressGlass, RepositoryCardGlass, RepositoryHeaderGlass, RepositoryMetadataGlass, ResponsiveContainer, SearchBoxGlass, SegmentedControlGlass, SidebarGlass, SkeletonGlass, SliderGlass, SortDropdownGlass, SparklineGlass, SplitLayoutAccordion, SplitLayoutGlass, StatItemGlass, StatusIndicatorGlass, StepperGlass, THEMES, THEME_CONFIG, TabsGlass, ThemeProvider, ThemeToggleGlass, ToggleGlass, TooltipGlass, TooltipGlassContent, TooltipGlassProvider, TooltipGlassSimple, TooltipGlassTrigger, TouchTarget, TrustScoreCardGlass, TrustScoreDisplayGlass, UserInfoGlass, UserStatsLineGlass, YearCardGlass, alertVariants, avatarSizes, badgeVariants, buttonGlassVariants, cardIntensity, cn, dropdownAlign, getNextTheme, getThemeConfig, inputVariants, insightCardVariants, insightVariantConfig, modalSizes, notificationVariants, progressSizes, alertVariants$1 as shadcnAlertVariants, badgeVariants$1 as shadcnBadgeVariants, buttonVariants as shadcnButtonVariants, skeletonVariants, sparklineBarVariants, sparklineContainerVariants, statusSizes, stepperConnectorVariants, stepperContentVariants, stepperDescriptionVariants, stepperIndicatorVariants, stepperLabelVariants, stepperListVariants, stepperRootVariants, stepperStepContainerVariants, toggleSizes, tooltipPositions, useChart, useFocus, useHover, useResponsive, useSidebar, useSplitLayout, useSplitLayoutOptional, useTheme, useWallpaperTint };
|
|
905
2552
|
|
|
906
2553
|
//# sourceMappingURL=index.js.map
|