@kopexa/sidebar 17.1.74 → 17.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -21,6 +21,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // src/index.ts
22
22
  var index_exports = {};
23
23
  __export(index_exports, {
24
+ AppShell: () => AppShell,
25
+ AppShellAside: () => AppShellAside,
26
+ AppShellHeader: () => AppShellHeader,
27
+ AppShellMain: () => AppShellMain,
28
+ AppShellPanelContent: () => AppShellPanelContent,
29
+ AppShellRoot: () => AppShellRoot,
24
30
  Sidebar: () => Sidebar,
25
31
  SidebarContent: () => SidebarContent,
26
32
  SidebarFooter: () => SidebarFooter,
@@ -40,7 +46,23 @@ __export(index_exports, {
40
46
  SidebarRoot: () => SidebarRoot,
41
47
  SidebarSeparator: () => SidebarSeparator,
42
48
  SidebarTrigger: () => SidebarTrigger,
43
- useSidebar: () => useSidebar
49
+ SidebarV2: () => SidebarV2,
50
+ SidebarV2FromConfig: () => SidebarV2FromConfig,
51
+ SidebarV2Inset: () => SidebarV2Inset,
52
+ SidebarV2Panel: () => SidebarV2Panel,
53
+ SidebarV2PanelGroup: () => SidebarV2PanelGroup,
54
+ SidebarV2PanelItems: () => SidebarV2PanelItems,
55
+ SidebarV2PanelLabel: () => SidebarV2PanelLabel,
56
+ SidebarV2PanelLeaf: () => SidebarV2PanelLeaf,
57
+ SidebarV2Provider: () => SidebarV2Provider,
58
+ SidebarV2Rail: () => SidebarV2Rail,
59
+ SidebarV2RailItem: () => SidebarV2RailItem,
60
+ SidebarV2RailLink: () => SidebarV2RailLink,
61
+ SidebarV2RailSpacer: () => SidebarV2RailSpacer,
62
+ SidebarV2Trigger: () => SidebarV2Trigger,
63
+ SidebarV2Workspace: () => SidebarV2Workspace,
64
+ useSidebar: () => useSidebar,
65
+ useSidebarV2: () => useSidebarV2
44
66
  });
45
67
  module.exports = __toCommonJS(index_exports);
46
68
 
@@ -507,8 +529,952 @@ var Sidebar = Object.assign(SidebarRoot, {
507
529
  MenuButton: SidebarMenuButton,
508
530
  MenuAction: SidebarMenuAction
509
531
  });
532
+
533
+ // src/v2/app-shell.tsx
534
+ var import_shared_utils = require("@kopexa/shared-utils");
535
+ var import_react3 = require("react");
536
+ var import_react_dom = require("react-dom");
537
+
538
+ // src/v2/context.tsx
539
+ var import_react_utils2 = require("@kopexa/react-utils");
540
+ var import_tooltip2 = require("@kopexa/tooltip");
541
+ var import_use_is_mobile2 = require("@kopexa/use-is-mobile");
542
+ var import_react2 = require("react");
543
+ var import_jsx_runtime2 = require("react/jsx-runtime");
544
+ var PIN_COOKIE = "kpx_sidebar_v2_pinned";
545
+ var PIN_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
546
+ var [Provider2, useSidebarV2] = (0, import_react_utils2.createContext)({
547
+ name: "SidebarV2Context",
548
+ errorMessage: "useSidebarV2 must be used within <SidebarV2> (the provider component)."
549
+ });
550
+ var defaultRenderLink = (props) => {
551
+ const { href, className, children, ...rest } = props;
552
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href, className, ...rest, children });
553
+ };
554
+ function SidebarV2Provider({
555
+ children,
556
+ tone = "dark",
557
+ flyoutTrigger = "click",
558
+ activeHref,
559
+ renderLink = defaultRenderLink,
560
+ pinned: pinnedProp,
561
+ onPinnedChange,
562
+ defaultPinned = true
563
+ }) {
564
+ const isMobile = (0, import_use_is_mobile2.useIsMobile)();
565
+ const [drawerOpen, setDrawerOpen] = (0, import_react2.useState)(false);
566
+ const [flyoutValue, setFlyoutValue] = (0, import_react2.useState)(null);
567
+ const [selectedRail, setSelectedRail] = (0, import_react2.useState)(null);
568
+ const [openGroup, setOpenGroup] = (0, import_react2.useState)(null);
569
+ const [pinnedUncontrolled, setPinnedUncontrolled] = (0, import_react2.useState)(defaultPinned);
570
+ const pinned = pinnedProp != null ? pinnedProp : pinnedUncontrolled;
571
+ const [panelHost, setPanelHost] = (0, import_react2.useState)(null);
572
+ const [overrideCount, setOverrideCount] = (0, import_react2.useState)(0);
573
+ const registerPanelOverride = (0, import_react2.useCallback)(() => {
574
+ setOverrideCount((c) => c + 1);
575
+ return () => setOverrideCount((c) => c - 1);
576
+ }, []);
577
+ const panelOverrideActive = overrideCount > 0;
578
+ const navPreviewActive = pinned ? selectedRail !== null : flyoutValue !== null;
579
+ const setPinned = (0, import_react2.useCallback)(
580
+ (value2) => {
581
+ onPinnedChange == null ? void 0 : onPinnedChange(value2);
582
+ if (pinnedProp === void 0) {
583
+ setPinnedUncontrolled(value2);
584
+ }
585
+ document.cookie = `${PIN_COOKIE}=${value2}; path=/; max-age=${PIN_COOKIE_MAX_AGE}`;
586
+ },
587
+ [onPinnedChange, pinnedProp]
588
+ );
589
+ const togglePin = (0, import_react2.useCallback)(() => {
590
+ setPinned(!pinned);
591
+ setFlyoutValue(null);
592
+ }, [pinned, setPinned]);
593
+ const openFlyout = (0, import_react2.useCallback)((value2) => {
594
+ setFlyoutValue((curr) => curr === value2 ? null : value2);
595
+ }, []);
596
+ const setFlyout = (0, import_react2.useCallback)((value2) => {
597
+ setFlyoutValue(value2);
598
+ }, []);
599
+ const closeFlyout = (0, import_react2.useCallback)(() => setFlyoutValue(null), []);
600
+ const resetPanelSelection = (0, import_react2.useCallback)(() => {
601
+ setSelectedRail(null);
602
+ setFlyoutValue(null);
603
+ }, []);
604
+ const toggleGroup = (0, import_react2.useCallback)((key) => {
605
+ setOpenGroup((curr) => curr === key ? null : key);
606
+ }, []);
607
+ const isActive = (0, import_react2.useCallback)(
608
+ (href) => activeHref === href || href !== "/" && activeHref.startsWith(`${href}/`),
609
+ [activeHref]
610
+ );
611
+ const value = (0, import_react2.useMemo)(
612
+ () => ({
613
+ tone,
614
+ pinned,
615
+ togglePin,
616
+ setPinned,
617
+ selectedRail,
618
+ setSelectedRail,
619
+ flyoutTrigger,
620
+ flyoutValue,
621
+ openFlyout,
622
+ setFlyout,
623
+ closeFlyout,
624
+ resetPanelSelection,
625
+ openGroup,
626
+ toggleGroup,
627
+ setOpenGroup,
628
+ activeHref,
629
+ isActive,
630
+ renderLink,
631
+ isMobile,
632
+ drawerOpen,
633
+ setDrawerOpen,
634
+ panelHost,
635
+ setPanelHost,
636
+ panelOverrideActive,
637
+ registerPanelOverride,
638
+ navPreviewActive
639
+ }),
640
+ [
641
+ tone,
642
+ pinned,
643
+ togglePin,
644
+ setPinned,
645
+ selectedRail,
646
+ flyoutTrigger,
647
+ flyoutValue,
648
+ openFlyout,
649
+ setFlyout,
650
+ closeFlyout,
651
+ resetPanelSelection,
652
+ openGroup,
653
+ toggleGroup,
654
+ activeHref,
655
+ isActive,
656
+ renderLink,
657
+ isMobile,
658
+ drawerOpen,
659
+ panelHost,
660
+ panelOverrideActive,
661
+ registerPanelOverride,
662
+ navPreviewActive
663
+ ]
664
+ );
665
+ (0, import_react2.useEffect)(() => {
666
+ setDrawerOpen(false);
667
+ setFlyoutValue(null);
668
+ setSelectedRail(null);
669
+ setOpenGroup(null);
670
+ }, [activeHref]);
671
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Provider2, { value, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_tooltip2.TooltipProvider, { delayDuration: 0, children }) });
672
+ }
673
+
674
+ // src/v2/app-shell.tsx
675
+ var import_jsx_runtime3 = require("react/jsx-runtime");
676
+ var RAIL_WIDTH = "4rem";
677
+ var PANEL_WIDTH = "15rem";
678
+ function AppShellRoot({
679
+ className,
680
+ style,
681
+ children,
682
+ ...props
683
+ }) {
684
+ const { tone } = useSidebarV2();
685
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
686
+ "div",
687
+ {
688
+ "data-slot": "app-shell",
689
+ "data-tone": tone,
690
+ className: (0, import_shared_utils.cn)(
691
+ "relative isolate grid h-svh w-full overflow-hidden antialiased",
692
+ tone === "light" ? "bg-muted text-foreground" : "bg-sidebar text-sidebar-foreground",
693
+ className
694
+ ),
695
+ style: {
696
+ "--kpx-rail-width": RAIL_WIDTH,
697
+ "--kpx-panel-width": PANEL_WIDTH,
698
+ gridTemplateAreas: '"header header header header" "rail panel main aside"',
699
+ gridTemplateRows: "auto 1fr",
700
+ gridTemplateColumns: "auto auto 1fr auto",
701
+ ...style
702
+ },
703
+ ...props,
704
+ children
705
+ }
706
+ );
707
+ }
708
+ function AppShellHeader({
709
+ className,
710
+ style,
711
+ ...props
712
+ }) {
713
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
714
+ "header",
715
+ {
716
+ "data-slot": "app-shell-header",
717
+ className: (0, import_shared_utils.cn)("z-20 flex h-14 items-center gap-3 px-2", className),
718
+ style: { gridArea: "header", ...style },
719
+ ...props
720
+ }
721
+ );
722
+ }
723
+ function AppShellMain({ className, style, ...props }) {
724
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
725
+ "main",
726
+ {
727
+ "data-slot": "app-shell-main",
728
+ className: (0, import_shared_utils.cn)(
729
+ "relative flex min-h-0 min-w-0 flex-col overflow-hidden bg-background",
730
+ "m-2 rounded-xl shadow-sm",
731
+ className
732
+ ),
733
+ style: { gridArea: "main", ...style },
734
+ ...props
735
+ }
736
+ );
737
+ }
738
+ function AppShellAside({
739
+ className,
740
+ style,
741
+ ...props
742
+ }) {
743
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
744
+ "aside",
745
+ {
746
+ "data-slot": "app-shell-aside",
747
+ className: (0, import_shared_utils.cn)("min-h-0 min-w-0 overflow-hidden", className),
748
+ style: { gridArea: "aside", ...style },
749
+ ...props
750
+ }
751
+ );
752
+ }
753
+ function AppShellPanelContent({ children }) {
754
+ const { panelHost, registerPanelOverride, navPreviewActive } = useSidebarV2();
755
+ (0, import_react3.useEffect)(() => registerPanelOverride(), [registerPanelOverride]);
756
+ if (!panelHost || navPreviewActive) return null;
757
+ return (0, import_react_dom.createPortal)(children, panelHost);
758
+ }
759
+ var AppShell = AppShellRoot;
760
+ AppShell.Header = AppShellHeader;
761
+ AppShell.Main = AppShellMain;
762
+ AppShell.Aside = AppShellAside;
763
+ AppShell.PanelContent = AppShellPanelContent;
764
+
765
+ // src/v2/components.tsx
766
+ var import_button2 = require("@kopexa/button");
767
+ var import_icons2 = require("@kopexa/icons");
768
+ var import_shared_utils2 = require("@kopexa/shared-utils");
769
+ var import_theme2 = require("@kopexa/theme");
770
+ var import_tooltip3 = require("@kopexa/tooltip");
771
+ var import_react4 = require("react");
772
+
773
+ // src/v2/types.ts
774
+ function panelItemHasChildren(item) {
775
+ return "children" in item && Array.isArray(item.children);
776
+ }
777
+ function panelItemIsSection(item) {
778
+ return "section" in item;
779
+ }
780
+
781
+ // src/v2/components.tsx
782
+ var import_jsx_runtime4 = require("react/jsx-runtime");
783
+ function SidebarV2Inset({
784
+ className,
785
+ ...props
786
+ }) {
787
+ const { tone } = useSidebarV2();
788
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
789
+ "main",
790
+ {
791
+ "data-slot": "sidebar-v2-inset",
792
+ className: (0, import_shared_utils2.cn)(
793
+ "relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",
794
+ "md:m-2 md:rounded-xl md:shadow-sm",
795
+ // On a light surround the white card needs a hairline to define its
796
+ // edge; on the dark surround a border would read as a seam.
797
+ tone === "light" && "md:border md:border-border/70",
798
+ className
799
+ ),
800
+ ...props
801
+ }
802
+ );
803
+ }
804
+ function SidebarV2Rail({ className, ...props }) {
805
+ const { tone } = useSidebarV2();
806
+ const light = tone === "light";
807
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
808
+ "nav",
809
+ {
810
+ "data-slot": "sidebar-v2-rail",
811
+ className: (0, import_shared_utils2.cn)(
812
+ "flex w-(--kpx-rail-width) shrink-0 flex-col overflow-hidden bg-sidebar py-2 text-sidebar-foreground",
813
+ // Light tone: the dark rail floats as a rounded card on the light
814
+ // surround. Dark tone: full-height, flush to the edge.
815
+ light ? "m-2 rounded-2xl shadow-sm" : "h-full",
816
+ className
817
+ ),
818
+ ...props
819
+ }
820
+ );
821
+ }
822
+ function SidebarV2RailSpacer() {
823
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "aria-hidden": true, className: "flex-1" });
824
+ }
825
+ var SidebarV2Workspace = (0, import_react4.forwardRef)(({ name, role, logo, className, appearance = "rail", ...props }, ref) => {
826
+ if (appearance === "bar") {
827
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
828
+ "button",
829
+ {
830
+ ref,
831
+ type: "button",
832
+ "data-slot": "sidebar-v2-workspace",
833
+ "aria-label": role ? `${name} \u2013 ${role}` : name,
834
+ className: (0, import_shared_utils2.cn)(
835
+ "group/ws flex cursor-pointer items-center gap-2 rounded-lg py-1 pr-2 pl-1",
836
+ "outline-hidden ring-ring transition-colors hover:bg-foreground/5 focus-visible:ring-2",
837
+ className
838
+ ),
839
+ ...props,
840
+ children: [
841
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex size-7 shrink-0 items-center justify-center rounded-md bg-primary text-xs font-semibold text-primary-foreground", children: logo != null ? logo : name.charAt(0).toUpperCase() }),
842
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "flex min-w-0 flex-col text-left leading-tight", children: [
843
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate text-sm font-semibold text-foreground", children: name }),
844
+ role && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate text-xs text-muted-foreground", children: role })
845
+ ] }),
846
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.ChevronDownIcon, { className: "size-4 shrink-0 text-muted-foreground" })
847
+ ]
848
+ }
849
+ );
850
+ }
851
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
852
+ "button",
853
+ {
854
+ ref,
855
+ type: "button",
856
+ "data-slot": "sidebar-v2-workspace",
857
+ "aria-label": role ? `${name} \u2013 ${role}` : name,
858
+ className: (0, import_shared_utils2.cn)(
859
+ "group/ws relative mx-auto mt-1 flex cursor-pointer items-center justify-center rounded-lg p-1",
860
+ "outline-hidden ring-sidebar-ring transition-colors",
861
+ "hover:bg-sidebar-accent focus-visible:ring-2",
862
+ className
863
+ ),
864
+ ...props,
865
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "relative flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary text-sm font-semibold text-primary-foreground", children: [
866
+ logo != null ? logo : name.charAt(0).toUpperCase(),
867
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.ChevronDownIcon, { className: "absolute -right-1 -bottom-1 size-3.5 rounded-full bg-sidebar p-px text-sidebar-foreground/60" })
868
+ ] })
869
+ }
870
+ );
871
+ });
872
+ SidebarV2Workspace.displayName = "SidebarV2Workspace";
873
+ function railButtonClasses(active) {
874
+ return (0, import_shared_utils2.cn)(
875
+ "group/rail relative mx-auto flex size-11 shrink-0 cursor-pointer items-center justify-center rounded-xl",
876
+ "outline-hidden ring-sidebar-ring transition-colors",
877
+ "text-sidebar-foreground/85 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
878
+ "focus-visible:ring-2",
879
+ active && "bg-sidebar-accent text-sidebar-accent-foreground"
880
+ );
881
+ }
882
+ function RailInner({
883
+ icon: Icon,
884
+ active,
885
+ badge
886
+ }) {
887
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
888
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
889
+ "span",
890
+ {
891
+ "aria-hidden": true,
892
+ className: (0, import_shared_utils2.cn)(
893
+ "absolute top-1/2 left-0 h-5 w-0.5 -translate-x-[0.6rem] -translate-y-1/2 rounded-r bg-primary transition-opacity",
894
+ active ? "opacity-100" : "opacity-0"
895
+ )
896
+ }
897
+ ),
898
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { className: "size-5 shrink-0" }),
899
+ badge != null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "absolute -top-0.5 -right-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[0.5625rem] font-semibold text-primary-foreground", children: badge })
900
+ ] });
901
+ }
902
+ function SidebarV2RailLink({
903
+ icon,
904
+ label,
905
+ href,
906
+ badge
907
+ }) {
908
+ const { renderLink, isActive, resetPanelSelection } = useSidebarV2();
909
+ const active = isActive(href);
910
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tooltip3.Tooltip, { content: label, side: "right", children: renderLink({
911
+ href,
912
+ className: railButtonClasses(active),
913
+ "data-active": active,
914
+ "aria-current": active ? "page" : void 0,
915
+ "aria-label": label,
916
+ // Navigating to a destination link clears any open panel preview,
917
+ // even when the route doesn't change (e.g. already on it).
918
+ onClick: resetPanelSelection,
919
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RailInner, { icon, label, active, badge })
920
+ }) });
921
+ }
922
+ function SidebarV2RailItem({
923
+ icon,
924
+ label,
925
+ active,
926
+ hasPanel,
927
+ onClick,
928
+ onMouseEnter,
929
+ onMouseLeave,
930
+ badge
931
+ }) {
932
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tooltip3.Tooltip, { content: label, side: "right", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
933
+ "button",
934
+ {
935
+ type: "button",
936
+ "data-active": active,
937
+ "aria-label": label,
938
+ "aria-expanded": hasPanel ? active : void 0,
939
+ onClick,
940
+ onMouseEnter,
941
+ onMouseLeave,
942
+ className: railButtonClasses(active),
943
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RailInner, { icon, label, active, badge })
944
+ }
945
+ ) });
946
+ }
947
+ function SidebarV2Panel({
948
+ title,
949
+ subtitle,
950
+ floating,
951
+ hidePin,
952
+ action,
953
+ children,
954
+ className
955
+ }) {
956
+ const { togglePin, pinned, tone } = useSidebarV2();
957
+ const light = tone === "light";
958
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
959
+ "div",
960
+ {
961
+ "data-slot": "sidebar-v2-panel",
962
+ "data-floating": floating,
963
+ className: (0, import_shared_utils2.cn)(
964
+ "flex h-full w-(--kpx-panel-width) shrink-0 flex-col",
965
+ // Surface. The flyout is a distinct floating card (white on light),
966
+ // so it reads as an overlay rather than a flat full-height slab.
967
+ floating ? light ? "bg-background text-foreground" : "bg-sidebar text-sidebar-foreground" : light ? "bg-muted text-foreground" : "bg-sidebar text-sidebar-foreground",
968
+ floating ? (
969
+ // Floating card: rounded, soft layered shadow, hairline ring.
970
+ (0, import_shared_utils2.cn)(
971
+ "overflow-hidden rounded-2xl shadow-2xl shadow-black/20 ring-1",
972
+ light ? "ring-black/5" : "ring-white/10"
973
+ )
974
+ ) : (
975
+ // Pinned: light blends into the surround (no border); dark keeps a
976
+ // hairline against the rail.
977
+ light ? "" : "border-l border-sidebar-border/40"
978
+ ),
979
+ className
980
+ ),
981
+ children: [
982
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-start gap-2 px-3 pt-3 pb-1.5", children: [
983
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "min-w-0 flex-1", children: [
984
+ title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
985
+ "div",
986
+ {
987
+ className: (0, import_shared_utils2.cn)(
988
+ "truncate text-sm font-semibold",
989
+ light ? "text-foreground" : "text-sidebar-foreground"
990
+ ),
991
+ children: title
992
+ }
993
+ ),
994
+ subtitle && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
995
+ "div",
996
+ {
997
+ className: (0, import_shared_utils2.cn)(
998
+ "truncate text-xs",
999
+ light ? "text-muted-foreground" : "text-sidebar-foreground/70"
1000
+ ),
1001
+ children: subtitle
1002
+ }
1003
+ )
1004
+ ] }),
1005
+ action != null ? action : !hidePin && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1006
+ import_tooltip3.Tooltip,
1007
+ {
1008
+ content: pinned ? "Panel l\xF6sen" : "Panel anheften",
1009
+ side: "bottom",
1010
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1011
+ import_button2.IconButton,
1012
+ {
1013
+ variant: "ghost",
1014
+ size: "sm",
1015
+ "aria-label": pinned ? "Panel l\xF6sen" : "Panel anheften",
1016
+ onClick: togglePin,
1017
+ className: (0, import_shared_utils2.cn)(
1018
+ "-mr-1 shrink-0",
1019
+ light ? "text-muted-foreground hover:bg-foreground/5 hover:text-foreground" : "text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
1020
+ ),
1021
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.PanelLeftIcon, { className: "size-4" })
1022
+ }
1023
+ )
1024
+ }
1025
+ )
1026
+ ] }),
1027
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-auto p-2", children })
1028
+ ]
1029
+ }
1030
+ );
1031
+ }
1032
+ function panelRowLight(active) {
1033
+ return (0, import_shared_utils2.cn)(
1034
+ "flex h-8 w-full items-center gap-2.5 rounded-md px-2 text-sm outline-hidden ring-ring transition-colors focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
1035
+ active ? "bg-primary/10 font-medium text-primary" : "text-foreground/80 hover:bg-foreground/5"
1036
+ );
1037
+ }
1038
+ function SidebarV2PanelLabel({
1039
+ className,
1040
+ ...props
1041
+ }) {
1042
+ const { tone } = useSidebarV2();
1043
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1044
+ "div",
1045
+ {
1046
+ "data-slot": "sidebar-v2-panel-label",
1047
+ className: (0, import_shared_utils2.cn)(
1048
+ "px-2 pt-3 pb-1 text-[0.6875rem] font-medium uppercase tracking-wide",
1049
+ tone === "light" ? "text-muted-foreground" : "text-sidebar-foreground/50",
1050
+ className
1051
+ ),
1052
+ ...props
1053
+ }
1054
+ );
1055
+ }
1056
+ function SidebarV2PanelLeaf({
1057
+ item,
1058
+ active: activeProp
1059
+ }) {
1060
+ const { renderLink, isActive, tone } = useSidebarV2();
1061
+ const light = tone === "light";
1062
+ const Icon = item.icon;
1063
+ const active = activeProp != null ? activeProp : isActive(item.href);
1064
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLink({
1065
+ href: item.href,
1066
+ "data-active": active,
1067
+ "aria-current": active ? "page" : void 0,
1068
+ className: light ? panelRowLight(active) : (0, import_theme2.sidebarMenuButton)({ size: "md" }),
1069
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1070
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1071
+ Icon,
1072
+ {
1073
+ className: (0, import_shared_utils2.cn)(
1074
+ light ? active ? void 0 : "text-muted-foreground" : "text-sidebar-foreground/75"
1075
+ )
1076
+ }
1077
+ ),
1078
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
1079
+ item.badge != null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1080
+ "span",
1081
+ {
1082
+ className: (0, import_shared_utils2.cn)(
1083
+ "ml-auto rounded-full px-1.5 text-[0.625rem] font-medium",
1084
+ light ? "bg-foreground/10 text-foreground/70" : "bg-sidebar-accent text-sidebar-accent-foreground"
1085
+ ),
1086
+ children: item.badge
1087
+ }
1088
+ )
1089
+ ] })
1090
+ }) });
1091
+ }
1092
+ function SidebarV2PanelGroup({
1093
+ item
1094
+ }) {
1095
+ var _a;
1096
+ const { openGroup, toggleGroup, activeHref, renderLink, tone } = useSidebarV2();
1097
+ const light = tone === "light";
1098
+ const Icon = item.icon;
1099
+ const key = (_a = item.value) != null ? _a : item.label;
1100
+ let bestChildHref = null;
1101
+ let bestLen = -1;
1102
+ for (const c of item.children) {
1103
+ if (activeHref === c.href) {
1104
+ bestChildHref = c.href;
1105
+ break;
1106
+ }
1107
+ if (activeHref.startsWith(`${c.href}/`) && c.href.length > bestLen) {
1108
+ bestChildHref = c.href;
1109
+ bestLen = c.href.length;
1110
+ }
1111
+ }
1112
+ const containsActive = bestChildHref !== null;
1113
+ const open = openGroup === key || openGroup === null && containsActive;
1114
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1115
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
1116
+ "button",
1117
+ {
1118
+ type: "button",
1119
+ "data-state": open ? "open" : "closed",
1120
+ "aria-expanded": open,
1121
+ onClick: () => toggleGroup(key),
1122
+ className: (0, import_shared_utils2.cn)(
1123
+ light ? panelRowLight(false) : (0, import_theme2.sidebarMenuButton)({ size: "md" }),
1124
+ "cursor-pointer",
1125
+ containsActive && (light ? "font-medium text-foreground" : "font-medium")
1126
+ ),
1127
+ children: [
1128
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1129
+ Icon,
1130
+ {
1131
+ className: light ? "text-muted-foreground" : "text-sidebar-foreground/75"
1132
+ }
1133
+ ),
1134
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "min-w-0 flex-1 truncate text-left", children: item.label }),
1135
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1136
+ import_icons2.ChevronRightIcon,
1137
+ {
1138
+ className: (0, import_shared_utils2.cn)(
1139
+ "size-3.5! shrink-0 transition-transform",
1140
+ light ? "text-muted-foreground" : "text-sidebar-foreground/60",
1141
+ open && "rotate-90"
1142
+ )
1143
+ }
1144
+ )
1145
+ ]
1146
+ }
1147
+ ),
1148
+ open && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1149
+ "div",
1150
+ {
1151
+ className: (0, import_shared_utils2.cn)(
1152
+ "my-0.5 ml-[1.05rem] flex flex-col border-l pl-3",
1153
+ light ? "border-border" : "border-sidebar-border"
1154
+ ),
1155
+ children: item.children.map((child) => {
1156
+ const active = child.href === bestChildHref;
1157
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: renderLink({
1158
+ href: child.href,
1159
+ "data-active": active,
1160
+ "aria-current": active ? "page" : void 0,
1161
+ className: (0, import_shared_utils2.cn)(
1162
+ "relative block rounded-md px-2 py-1.5 text-[0.8125rem] outline-hidden transition-colors focus-visible:ring-2",
1163
+ "before:absolute before:top-1/2 before:-left-3 before:h-px before:w-2.5",
1164
+ light ? active ? "bg-primary/10 font-medium text-primary ring-ring before:bg-primary" : "text-muted-foreground ring-ring hover:bg-foreground/5 hover:text-foreground before:bg-border" : active ? "bg-sidebar-accent font-medium text-sidebar-accent-foreground ring-sidebar-ring before:bg-primary" : "text-sidebar-foreground/80 ring-sidebar-ring hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground before:bg-sidebar-foreground/30"
1165
+ ),
1166
+ children: child.label
1167
+ }) }, child.href);
1168
+ })
1169
+ }
1170
+ )
1171
+ ] });
1172
+ }
1173
+ function SidebarV2PanelItems({
1174
+ items
1175
+ }) {
1176
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: items.map((item, idx) => {
1177
+ var _a;
1178
+ if (panelItemIsSection(item)) {
1179
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SidebarV2PanelLabel, { children: item.section }, `section-${item.section}-${idx}`);
1180
+ }
1181
+ if (panelItemHasChildren(item)) {
1182
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SidebarV2PanelGroup, { item }, (_a = item.value) != null ? _a : item.label);
1183
+ }
1184
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SidebarV2PanelLeaf, { item }, item.href);
1185
+ }) });
1186
+ }
1187
+ function SidebarV2Trigger({
1188
+ className,
1189
+ ...props
1190
+ }) {
1191
+ const { setDrawerOpen, drawerOpen } = useSidebarV2();
1192
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1193
+ import_button2.IconButton,
1194
+ {
1195
+ variant: "ghost",
1196
+ size: "md",
1197
+ "aria-label": "Navigation \xF6ffnen",
1198
+ onClick: () => setDrawerOpen(!drawerOpen),
1199
+ className,
1200
+ ...props,
1201
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.PanelLeftIcon, { className: "size-5" })
1202
+ }
1203
+ );
1204
+ }
1205
+
1206
+ // src/v2/from-config.tsx
1207
+ var import_drawer2 = require("@kopexa/drawer");
1208
+ var import_shared_utils3 = require("@kopexa/shared-utils");
1209
+ var import_react5 = require("motion/react");
1210
+ var import_react6 = require("react");
1211
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1212
+ var RAIL_WIDTH2 = "4rem";
1213
+ var PANEL_WIDTH2 = "15rem";
1214
+ var railVars = {
1215
+ "--kpx-rail-width": RAIL_WIDTH2,
1216
+ "--kpx-panel-width": PANEL_WIDTH2
1217
+ };
1218
+ function entryValue(entry) {
1219
+ var _a;
1220
+ if (entry.type === "divider") return "divider";
1221
+ return entry.type === "panel" ? (_a = entry.value) != null ? _a : entry.label : entry.label;
1222
+ }
1223
+ function SidebarV2FromConfig({
1224
+ items,
1225
+ header
1226
+ }) {
1227
+ var _a, _b, _c;
1228
+ const {
1229
+ pinned,
1230
+ flyoutTrigger,
1231
+ flyoutValue,
1232
+ openFlyout,
1233
+ setFlyout,
1234
+ closeFlyout,
1235
+ selectedRail,
1236
+ setSelectedRail,
1237
+ isActive,
1238
+ isMobile,
1239
+ drawerOpen,
1240
+ setDrawerOpen,
1241
+ setPanelHost,
1242
+ panelOverrideActive,
1243
+ navPreviewActive
1244
+ } = useSidebarV2();
1245
+ const hoverMode = flyoutTrigger === "hover" && !pinned && !isMobile;
1246
+ const closeTimer = (0, import_react6.useRef)(null);
1247
+ const cancelClose = (0, import_react6.useCallback)(() => {
1248
+ if (closeTimer.current) clearTimeout(closeTimer.current);
1249
+ closeTimer.current = null;
1250
+ }, []);
1251
+ const scheduleClose = (0, import_react6.useCallback)(() => {
1252
+ cancelClose();
1253
+ closeTimer.current = setTimeout(() => closeFlyout(), 160);
1254
+ }, [cancelClose, closeFlyout]);
1255
+ (0, import_react6.useEffect)(() => cancelClose, [cancelClose]);
1256
+ (0, import_react6.useEffect)(() => {
1257
+ if (pinned || isMobile || !flyoutValue) return;
1258
+ const onPointerDown = (event) => {
1259
+ const t = event.target;
1260
+ if (!t) return;
1261
+ if (t.closest('[data-slot="sidebar-v2-rail"]')) return;
1262
+ if (t.closest('[data-floating="true"]')) return;
1263
+ closeFlyout();
1264
+ };
1265
+ const onKeyDown = (event) => {
1266
+ if (event.key === "Escape") closeFlyout();
1267
+ };
1268
+ document.addEventListener("pointerdown", onPointerDown);
1269
+ document.addEventListener("keydown", onKeyDown);
1270
+ return () => {
1271
+ document.removeEventListener("pointerdown", onPointerDown);
1272
+ document.removeEventListener("keydown", onKeyDown);
1273
+ };
1274
+ }, [pinned, isMobile, flyoutValue, closeFlyout]);
1275
+ const panels = (0, import_react6.useMemo)(
1276
+ () => items.filter(
1277
+ (e) => e.type === "panel"
1278
+ ),
1279
+ [items]
1280
+ );
1281
+ const activeRailValue = (0, import_react6.useMemo)(() => {
1282
+ const match = panels.find(
1283
+ (p) => p.items.some((item) => {
1284
+ if (panelItemIsSection(item)) return false;
1285
+ return panelItemHasChildren(item) ? item.children.some((c) => isActive(c.href)) : isActive(item.href);
1286
+ })
1287
+ );
1288
+ return match ? entryValue(match) : null;
1289
+ }, [panels, isActive]);
1290
+ const shownValue = pinned ? selectedRail != null ? selectedRail : activeRailValue : flyoutValue;
1291
+ const shownPanel = (_a = panels.find((p) => entryValue(p) === shownValue)) != null ? _a : null;
1292
+ const topEntries = items.filter((e) => e.slot !== "bottom");
1293
+ const bottomEntries = items.filter((e) => e.slot === "bottom");
1294
+ function renderRailEntry(entry, index) {
1295
+ if (entry.type === "divider") {
1296
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1297
+ "div",
1298
+ {
1299
+ "aria-hidden": true,
1300
+ className: "mx-3 my-1.5 h-px shrink-0 bg-sidebar-border/70"
1301
+ },
1302
+ `rail-divider-${index}`
1303
+ );
1304
+ }
1305
+ const value = entryValue(entry);
1306
+ if (entry.type === "link") {
1307
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1308
+ SidebarV2RailLink,
1309
+ {
1310
+ icon: entry.icon,
1311
+ label: entry.label,
1312
+ href: entry.href,
1313
+ badge: entry.badge
1314
+ },
1315
+ value
1316
+ );
1317
+ }
1318
+ if (entry.type === "action") {
1319
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1320
+ SidebarV2RailItem,
1321
+ {
1322
+ icon: entry.icon,
1323
+ label: entry.label,
1324
+ active: false,
1325
+ onClick: entry.onSelect
1326
+ },
1327
+ value
1328
+ );
1329
+ }
1330
+ const active = flyoutValue ? value === flyoutValue : value === (selectedRail != null ? selectedRail : activeRailValue);
1331
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1332
+ SidebarV2RailItem,
1333
+ {
1334
+ icon: entry.icon,
1335
+ label: entry.label,
1336
+ active,
1337
+ hasPanel: true,
1338
+ onClick: () => {
1339
+ if (pinned) setSelectedRail(value);
1340
+ else openFlyout(value);
1341
+ },
1342
+ onMouseEnter: hoverMode ? () => {
1343
+ cancelClose();
1344
+ setFlyout(value);
1345
+ } : void 0,
1346
+ onMouseLeave: hoverMode ? scheduleClose : void 0
1347
+ },
1348
+ value
1349
+ );
1350
+ }
1351
+ const railContent = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1352
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: [
1353
+ header && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1354
+ header,
1355
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "mx-3 my-1 h-px shrink-0 bg-sidebar-border/60" })
1356
+ ] }),
1357
+ topEntries.map(renderRailEntry)
1358
+ ] }),
1359
+ bottomEntries.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex shrink-0 flex-col gap-1 pt-1", children: bottomEntries.map(renderRailEntry) })
1360
+ ] });
1361
+ const navData = pinned && shownPanel && (navPreviewActive || !panelOverrideActive) ? shownPanel : null;
1362
+ const [bufferedPanel, setBufferedPanel] = (0, import_react6.useState)(navData);
1363
+ (0, import_react6.useEffect)(() => {
1364
+ if (navData) {
1365
+ setBufferedPanel(navData);
1366
+ return;
1367
+ }
1368
+ const t = setTimeout(() => setBufferedPanel(null), 220);
1369
+ return () => clearTimeout(t);
1370
+ }, [navData]);
1371
+ const navToRender = navData != null ? navData : bufferedPanel;
1372
+ const renderNav = (!panelOverrideActive || navPreviewActive) && navToRender;
1373
+ const panelContent = navToRender && renderNav ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1374
+ SidebarV2Panel,
1375
+ {
1376
+ title: (_b = navToRender.title) != null ? _b : navToRender.label,
1377
+ subtitle: navToRender.subtitle,
1378
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SidebarV2PanelItems, { items: navToRender.items })
1379
+ },
1380
+ entryValue(navToRender)
1381
+ ) : null;
1382
+ const docked = Boolean(navData) || panelOverrideActive;
1383
+ const showFlyout = !pinned && Boolean(shownPanel);
1384
+ if (isMobile) {
1385
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1386
+ import_drawer2.Drawer.Root,
1387
+ {
1388
+ open: drawerOpen,
1389
+ onOpenChange: setDrawerOpen,
1390
+ placement: "left",
1391
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_drawer2.Drawer.Content, { className: "w-auto max-w-[85vw] border-0 bg-sidebar p-0 [&>button]:hidden", children: [
1392
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_drawer2.Drawer.Header, { className: "sr-only", children: [
1393
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_drawer2.Drawer.Title, { children: "Navigation" }),
1394
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_drawer2.Drawer.Description, { children: "Hauptnavigation" })
1395
+ ] }),
1396
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex h-full", style: railVars, children: [
1397
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SidebarV2Rail, { children: railContent }),
1398
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1399
+ "div",
1400
+ {
1401
+ ref: setPanelHost,
1402
+ "data-slot": "sidebar-v2-panel-zone",
1403
+ className: "flex min-h-0",
1404
+ children: panelContent
1405
+ }
1406
+ )
1407
+ ] })
1408
+ ] })
1409
+ }
1410
+ );
1411
+ }
1412
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1413
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SidebarV2Rail, { style: { gridArea: "rail" }, children: railContent }),
1414
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1415
+ "div",
1416
+ {
1417
+ ref: setPanelHost,
1418
+ "data-slot": "sidebar-v2-panel-zone",
1419
+ className: (0, import_shared_utils3.cn)(
1420
+ "relative shrink-0 transition-[width] duration-200 ease-out motion-reduce:transition-none",
1421
+ pinned && "overflow-hidden"
1422
+ ),
1423
+ style: { gridArea: "panel", width: docked ? PANEL_WIDTH2 : "0px" },
1424
+ children: [
1425
+ panelContent,
1426
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react5.AnimatePresence, { children: showFlyout && shownPanel && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1427
+ import_react5.motion.div,
1428
+ {
1429
+ "data-floating": "true",
1430
+ className: "absolute inset-y-2 left-1 z-30",
1431
+ initial: { x: -14, opacity: 0 },
1432
+ animate: { x: 0, opacity: 1 },
1433
+ exit: { x: -14, opacity: 0 },
1434
+ transition: { duration: 0.16, ease: "easeOut" },
1435
+ onMouseEnter: hoverMode ? cancelClose : void 0,
1436
+ onMouseLeave: hoverMode ? scheduleClose : void 0,
1437
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1438
+ SidebarV2Panel,
1439
+ {
1440
+ floating: true,
1441
+ title: (_c = shownPanel.title) != null ? _c : shownPanel.label,
1442
+ subtitle: shownPanel.subtitle,
1443
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SidebarV2PanelItems, { items: shownPanel.items })
1444
+ }
1445
+ )
1446
+ },
1447
+ "sidebar-v2-flyout"
1448
+ ) })
1449
+ ]
1450
+ }
1451
+ )
1452
+ ] });
1453
+ }
1454
+
1455
+ // src/v2/index.tsx
1456
+ var SidebarV2 = SidebarV2Provider;
1457
+ SidebarV2.FromConfig = SidebarV2FromConfig;
1458
+ SidebarV2.Inset = SidebarV2Inset;
1459
+ SidebarV2.Trigger = SidebarV2Trigger;
1460
+ SidebarV2.Rail = SidebarV2Rail;
1461
+ SidebarV2.RailItem = SidebarV2RailItem;
1462
+ SidebarV2.RailLink = SidebarV2RailLink;
1463
+ SidebarV2.RailSpacer = SidebarV2RailSpacer;
1464
+ SidebarV2.Workspace = SidebarV2Workspace;
1465
+ SidebarV2.Panel = SidebarV2Panel;
1466
+ SidebarV2.PanelItems = SidebarV2PanelItems;
1467
+ SidebarV2.PanelLeaf = SidebarV2PanelLeaf;
1468
+ SidebarV2.PanelGroup = SidebarV2PanelGroup;
1469
+ SidebarV2.PanelLabel = SidebarV2PanelLabel;
510
1470
  // Annotate the CommonJS export names for ESM import in node:
511
1471
  0 && (module.exports = {
1472
+ AppShell,
1473
+ AppShellAside,
1474
+ AppShellHeader,
1475
+ AppShellMain,
1476
+ AppShellPanelContent,
1477
+ AppShellRoot,
512
1478
  Sidebar,
513
1479
  SidebarContent,
514
1480
  SidebarFooter,
@@ -528,5 +1494,21 @@ var Sidebar = Object.assign(SidebarRoot, {
528
1494
  SidebarRoot,
529
1495
  SidebarSeparator,
530
1496
  SidebarTrigger,
531
- useSidebar
1497
+ SidebarV2,
1498
+ SidebarV2FromConfig,
1499
+ SidebarV2Inset,
1500
+ SidebarV2Panel,
1501
+ SidebarV2PanelGroup,
1502
+ SidebarV2PanelItems,
1503
+ SidebarV2PanelLabel,
1504
+ SidebarV2PanelLeaf,
1505
+ SidebarV2Provider,
1506
+ SidebarV2Rail,
1507
+ SidebarV2RailItem,
1508
+ SidebarV2RailLink,
1509
+ SidebarV2RailSpacer,
1510
+ SidebarV2Trigger,
1511
+ SidebarV2Workspace,
1512
+ useSidebar,
1513
+ useSidebarV2
532
1514
  });