@inf-monkeys-tech/monkeys-design 1.0.6 → 1.0.7
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/components/layout/index.d.mts +38 -9
- package/dist/components/layout/index.d.ts +38 -9
- package/dist/components/layout/index.js +526 -185
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +526 -186
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/primitives/index.d.mts +2 -2
- package/dist/components/primitives/index.d.ts +2 -2
- package/dist/components/primitives/index.js +92 -15
- package/dist/components/primitives/index.js.map +1 -1
- package/dist/components/primitives/index.mjs +92 -15
- package/dist/components/primitives/index.mjs.map +1 -1
- package/dist/components/workbench/index.d.mts +11 -1
- package/dist/components/workbench/index.d.ts +11 -1
- package/dist/components/workbench/index.js +28 -3
- package/dist/components/workbench/index.js.map +1 -1
- package/dist/components/workbench/index.mjs +28 -3
- package/dist/components/workbench/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +554 -188
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +554 -189
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2278,6 +2278,93 @@ var BaseTooltip = react.forwardRef(
|
|
|
2278
2278
|
);
|
|
2279
2279
|
}
|
|
2280
2280
|
);
|
|
2281
|
+
var rootTokenStyles = {
|
|
2282
|
+
width: "var(--monkeys-component-app-shell-sidebar-width, 16rem)",
|
|
2283
|
+
borderRadius: "var(--monkeys-component-app-shell-sidebar-radius, var(--radius, 0.75rem))",
|
|
2284
|
+
background: "var(--monkeys-component-app-shell-sidebar-background, hsl(var(--card)))",
|
|
2285
|
+
color: "var(--monkeys-component-app-shell-sidebar-foreground, hsl(var(--card-foreground)))",
|
|
2286
|
+
borderColor: "var(--monkeys-component-app-shell-sidebar-border-color, hsl(var(--border)))",
|
|
2287
|
+
boxShadow: "var(--monkeys-component-app-shell-sidebar-shadow, none)"
|
|
2288
|
+
};
|
|
2289
|
+
var headerTokenStyles = {
|
|
2290
|
+
padding: "var(--monkeys-component-app-shell-sidebar-header-padding, var(--global-spacing, 0.75rem))",
|
|
2291
|
+
borderColor: "var(--monkeys-component-app-shell-sidebar-header-border-color, hsl(var(--border)))"
|
|
2292
|
+
};
|
|
2293
|
+
var navigationTokenStyles = {
|
|
2294
|
+
padding: "var(--monkeys-component-app-shell-sidebar-navigation-padding, var(--global-spacing, 0.75rem))",
|
|
2295
|
+
"--monkeys-component-accordion-item-border-color": "transparent"
|
|
2296
|
+
};
|
|
2297
|
+
var footerTokenStyles = {
|
|
2298
|
+
padding: "var(--monkeys-component-app-shell-sidebar-footer-padding, var(--global-spacing, 0.75rem))",
|
|
2299
|
+
background: "var(--monkeys-component-app-shell-sidebar-footer-background, hsl(var(--muted) / 0.22))",
|
|
2300
|
+
borderColor: "var(--monkeys-component-app-shell-sidebar-footer-border-color, hsl(var(--border)))"
|
|
2301
|
+
};
|
|
2302
|
+
var AppShellSidebar = react.forwardRef(
|
|
2303
|
+
function AppShellSidebar2({
|
|
2304
|
+
navigation,
|
|
2305
|
+
header,
|
|
2306
|
+
footer,
|
|
2307
|
+
width,
|
|
2308
|
+
className,
|
|
2309
|
+
classNames,
|
|
2310
|
+
style,
|
|
2311
|
+
"aria-label": ariaLabel = "Application navigation",
|
|
2312
|
+
...props
|
|
2313
|
+
}, ref) {
|
|
2314
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2315
|
+
"aside",
|
|
2316
|
+
{
|
|
2317
|
+
ref,
|
|
2318
|
+
"aria-label": ariaLabel,
|
|
2319
|
+
"data-app-shell-sidebar": "",
|
|
2320
|
+
className: cn(
|
|
2321
|
+
"relative isolate flex h-full min-h-0 shrink-0 flex-col overflow-hidden border",
|
|
2322
|
+
classNames?.root,
|
|
2323
|
+
className
|
|
2324
|
+
),
|
|
2325
|
+
style: {
|
|
2326
|
+
...rootTokenStyles,
|
|
2327
|
+
...width === void 0 ? null : { width },
|
|
2328
|
+
...style
|
|
2329
|
+
},
|
|
2330
|
+
...props,
|
|
2331
|
+
children: [
|
|
2332
|
+
header ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2333
|
+
"div",
|
|
2334
|
+
{
|
|
2335
|
+
"data-slot": "header",
|
|
2336
|
+
className: cn("shrink-0 border-b", classNames?.header),
|
|
2337
|
+
style: headerTokenStyles,
|
|
2338
|
+
children: header
|
|
2339
|
+
}
|
|
2340
|
+
) : null,
|
|
2341
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2342
|
+
"div",
|
|
2343
|
+
{
|
|
2344
|
+
"data-slot": "navigation",
|
|
2345
|
+
className: cn(
|
|
2346
|
+
"relative min-h-0 flex-1 overflow-hidden",
|
|
2347
|
+
classNames?.navigation
|
|
2348
|
+
),
|
|
2349
|
+
style: navigationTokenStyles,
|
|
2350
|
+
children: navigation
|
|
2351
|
+
}
|
|
2352
|
+
),
|
|
2353
|
+
footer ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2354
|
+
"div",
|
|
2355
|
+
{
|
|
2356
|
+
"data-slot": "footer",
|
|
2357
|
+
className: cn("shrink-0 border-t", classNames?.footer),
|
|
2358
|
+
style: footerTokenStyles,
|
|
2359
|
+
children: footer
|
|
2360
|
+
}
|
|
2361
|
+
) : null
|
|
2362
|
+
]
|
|
2363
|
+
}
|
|
2364
|
+
);
|
|
2365
|
+
}
|
|
2366
|
+
);
|
|
2367
|
+
AppShellSidebar.displayName = "AppShellSidebar";
|
|
2281
2368
|
var defaultAppearance = {
|
|
2282
2369
|
preset: "soft",
|
|
2283
2370
|
density: "compact",
|
|
@@ -2552,7 +2639,14 @@ function UserAccountMenu({
|
|
|
2552
2639
|
function cn2(...inputs) {
|
|
2553
2640
|
return inputs.filter(Boolean).join(" ");
|
|
2554
2641
|
}
|
|
2555
|
-
function NavButton({
|
|
2642
|
+
function NavButton({
|
|
2643
|
+
active,
|
|
2644
|
+
icon,
|
|
2645
|
+
postfix,
|
|
2646
|
+
onClick,
|
|
2647
|
+
className,
|
|
2648
|
+
children
|
|
2649
|
+
}) {
|
|
2556
2650
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2557
2651
|
"div",
|
|
2558
2652
|
{
|
|
@@ -2604,7 +2698,14 @@ function AppHeader({
|
|
|
2604
2698
|
"flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",
|
|
2605
2699
|
logo.url ? "bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
|
|
2606
2700
|
),
|
|
2607
|
-
children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2701
|
+
children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2702
|
+
"img",
|
|
2703
|
+
{
|
|
2704
|
+
src: logo.url,
|
|
2705
|
+
alt: logo.title,
|
|
2706
|
+
className: "h-full w-full object-contain"
|
|
2707
|
+
}
|
|
2708
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold", children: logo.title.charAt(0) })
|
|
2608
2709
|
}
|
|
2609
2710
|
),
|
|
2610
2711
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-lg font-semibold whitespace-nowrap", children: logo.title })
|
|
@@ -2630,7 +2731,14 @@ function AppHeader({
|
|
|
2630
2731
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-4", children: [
|
|
2631
2732
|
extra,
|
|
2632
2733
|
user && /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Root, { children: [
|
|
2633
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "flex h-8 w-8 items-center justify-center rounded-full hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-none", children: user.photo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2734
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "flex h-8 w-8 items-center justify-center rounded-full hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-none", children: user.photo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2735
|
+
"img",
|
|
2736
|
+
{
|
|
2737
|
+
src: user.photo,
|
|
2738
|
+
alt: user.name,
|
|
2739
|
+
className: "h-8 w-8 rounded-full object-cover"
|
|
2740
|
+
}
|
|
2741
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium", children: user.name ? getUserInitials(user.name) : "U" }) }) }),
|
|
2634
2742
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2635
2743
|
DropdownMenu__namespace.Content,
|
|
2636
2744
|
{
|
|
@@ -2639,7 +2747,14 @@ function AppHeader({
|
|
|
2639
2747
|
align: "end",
|
|
2640
2748
|
children: [
|
|
2641
2749
|
/* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Label, { className: "flex items-center gap-2 px-2 py-1.5 font-normal", children: [
|
|
2642
|
-
user.photo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2750
|
+
user.photo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2751
|
+
"img",
|
|
2752
|
+
{
|
|
2753
|
+
src: user.photo,
|
|
2754
|
+
alt: user.name,
|
|
2755
|
+
className: "h-8 w-8 rounded-full object-cover"
|
|
2756
|
+
}
|
|
2757
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium", children: user.name ? getUserInitials(user.name) : "U" }),
|
|
2643
2758
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
2644
2759
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium leading-none", children: user.name }),
|
|
2645
2760
|
user.email && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))] leading-none mt-1", children: user.email })
|
|
@@ -2654,11 +2769,25 @@ function AppHeader({
|
|
|
2654
2769
|
className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-[hsl(var(--destructive))] outline-none transition-colors hover:bg-[hsl(var(--accent))]",
|
|
2655
2770
|
onSelect: () => onLogout?.(),
|
|
2656
2771
|
children: [
|
|
2657
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2772
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2773
|
+
"svg",
|
|
2774
|
+
{
|
|
2775
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2776
|
+
width: "16",
|
|
2777
|
+
height: "16",
|
|
2778
|
+
viewBox: "0 0 24 24",
|
|
2779
|
+
fill: "none",
|
|
2780
|
+
stroke: "currentColor",
|
|
2781
|
+
strokeWidth: "1.5",
|
|
2782
|
+
strokeLinecap: "round",
|
|
2783
|
+
strokeLinejoin: "round",
|
|
2784
|
+
children: [
|
|
2785
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
2786
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "16 17 21 12 16 7" }),
|
|
2787
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
|
|
2788
|
+
]
|
|
2789
|
+
}
|
|
2790
|
+
),
|
|
2662
2791
|
logoutLabel
|
|
2663
2792
|
]
|
|
2664
2793
|
}
|
|
@@ -2693,19 +2822,33 @@ function AppSidebar({
|
|
|
2693
2822
|
className
|
|
2694
2823
|
),
|
|
2695
2824
|
children: [
|
|
2696
|
-
logo && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2825
|
+
logo && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2826
|
+
"div",
|
|
2827
|
+
{
|
|
2828
|
+
className: "flex shrink-0 cursor-pointer items-center gap-2",
|
|
2829
|
+
onClick: logo.onClick,
|
|
2830
|
+
children: [
|
|
2831
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2832
|
+
"div",
|
|
2833
|
+
{
|
|
2834
|
+
className: cn2(
|
|
2835
|
+
"flex h-8 w-8 items-center justify-center rounded-lg overflow-hidden",
|
|
2836
|
+
logo.url ? "bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
|
|
2837
|
+
),
|
|
2838
|
+
children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2839
|
+
"img",
|
|
2840
|
+
{
|
|
2841
|
+
src: logo.url,
|
|
2842
|
+
alt: logo.title,
|
|
2843
|
+
className: "h-full w-full object-contain"
|
|
2844
|
+
}
|
|
2845
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold", children: logo.title.charAt(0) })
|
|
2846
|
+
}
|
|
2703
2847
|
),
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
] }),
|
|
2848
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-lg font-semibold whitespace-nowrap", children: logo.title })
|
|
2849
|
+
]
|
|
2850
|
+
}
|
|
2851
|
+
),
|
|
2709
2852
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2710
2853
|
SidebarNavList,
|
|
2711
2854
|
{
|
|
@@ -2718,7 +2861,14 @@ function AppSidebar({
|
|
|
2718
2861
|
(account || footer) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2719
2862
|
account && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full flex-col gap-2 rounded-lg bg-[hsl(var(--muted))] p-2 shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between px-3 py-1", children: [
|
|
2720
2863
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2721
|
-
account.photo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2864
|
+
account.photo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2865
|
+
"img",
|
|
2866
|
+
{
|
|
2867
|
+
src: account.photo,
|
|
2868
|
+
alt: account.name,
|
|
2869
|
+
className: "h-5 w-5 rounded-full object-cover"
|
|
2870
|
+
}
|
|
2871
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-[10px] font-medium", children: account.name ? account.name.charAt(0).toUpperCase() : "U" }),
|
|
2722
2872
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium truncate max-w-[100px]", children: account.name })
|
|
2723
2873
|
] }),
|
|
2724
2874
|
onLogout && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2727,11 +2877,25 @@ function AppSidebar({
|
|
|
2727
2877
|
onClick: onLogout,
|
|
2728
2878
|
className: "flex items-center justify-center text-[hsl(var(--destructive))] hover:opacity-80 transition-opacity",
|
|
2729
2879
|
title: logoutLabel,
|
|
2730
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2880
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2881
|
+
"svg",
|
|
2882
|
+
{
|
|
2883
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2884
|
+
width: "16",
|
|
2885
|
+
height: "16",
|
|
2886
|
+
viewBox: "0 0 24 24",
|
|
2887
|
+
fill: "none",
|
|
2888
|
+
stroke: "currentColor",
|
|
2889
|
+
strokeWidth: "1.5",
|
|
2890
|
+
strokeLinecap: "round",
|
|
2891
|
+
strokeLinejoin: "round",
|
|
2892
|
+
children: [
|
|
2893
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
2894
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "16 17 21 12 16 7" }),
|
|
2895
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
|
|
2896
|
+
]
|
|
2897
|
+
}
|
|
2898
|
+
)
|
|
2735
2899
|
}
|
|
2736
2900
|
)
|
|
2737
2901
|
] }) }),
|
|
@@ -2741,7 +2905,12 @@ function AppSidebar({
|
|
|
2741
2905
|
}
|
|
2742
2906
|
);
|
|
2743
2907
|
}
|
|
2744
|
-
function SidebarNavList({
|
|
2908
|
+
function SidebarNavList({
|
|
2909
|
+
items,
|
|
2910
|
+
activeItemId,
|
|
2911
|
+
onNavigate,
|
|
2912
|
+
defaultExpandedGroups
|
|
2913
|
+
}) {
|
|
2745
2914
|
const [expanded, setExpanded] = react.useState(() => {
|
|
2746
2915
|
const map = {};
|
|
2747
2916
|
(defaultExpandedGroups ?? items.map((i) => i.id)).forEach((id) => {
|
|
@@ -2756,84 +2925,115 @@ function SidebarNavList({ items, activeItemId, onNavigate, defaultExpandedGroups
|
|
|
2756
2925
|
}
|
|
2757
2926
|
}, [activeItemId]);
|
|
2758
2927
|
const toggle = (id) => {
|
|
2759
|
-
setExpanded((prev) => ({
|
|
2928
|
+
setExpanded((prev) => ({
|
|
2929
|
+
...prev,
|
|
2930
|
+
[id]: !prev[id]
|
|
2931
|
+
}));
|
|
2760
2932
|
};
|
|
2761
2933
|
const resolvedActiveItemId = activeItemId ?? localActiveItemId;
|
|
2762
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2934
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2935
|
+
"div",
|
|
2936
|
+
{
|
|
2937
|
+
className: "h-full flex-1 overflow-y-auto",
|
|
2938
|
+
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
2939
|
+
children: [
|
|
2940
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `.monkeys-sidebar-nav::-webkit-scrollbar { display: none; }` }),
|
|
2941
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "monkeys-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]", children: items.map((item) => {
|
|
2942
|
+
if (item.children && item.children.length > 0) {
|
|
2943
|
+
const isExpanded = expanded[item.id] ?? true;
|
|
2944
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2945
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2946
|
+
NavButton,
|
|
2775
2947
|
{
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2948
|
+
icon: item.icon,
|
|
2949
|
+
onClick: () => toggle(item.id),
|
|
2950
|
+
postfix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2951
|
+
"svg",
|
|
2952
|
+
{
|
|
2953
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2954
|
+
width: "16",
|
|
2955
|
+
height: "16",
|
|
2956
|
+
viewBox: "0 0 24 24",
|
|
2957
|
+
fill: "none",
|
|
2958
|
+
stroke: "currentColor",
|
|
2959
|
+
strokeWidth: "2",
|
|
2960
|
+
strokeLinecap: "round",
|
|
2961
|
+
strokeLinejoin: "round",
|
|
2962
|
+
className: "shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",
|
|
2963
|
+
style: {
|
|
2964
|
+
transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
|
|
2965
|
+
},
|
|
2966
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
2967
|
+
}
|
|
2968
|
+
) }),
|
|
2969
|
+
children: item.label
|
|
2788
2970
|
}
|
|
2789
|
-
)
|
|
2790
|
-
children: item.
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2971
|
+
),
|
|
2972
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-1 mt-1", children: item.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2973
|
+
NavButton,
|
|
2974
|
+
{
|
|
2975
|
+
active: child.id === resolvedActiveItemId,
|
|
2976
|
+
onClick: () => {
|
|
2977
|
+
setLocalActiveItemId(child.id);
|
|
2978
|
+
onNavigate?.(child.id);
|
|
2979
|
+
},
|
|
2980
|
+
children: child.label
|
|
2981
|
+
},
|
|
2982
|
+
child.id
|
|
2983
|
+
)) })
|
|
2984
|
+
] }, item.id);
|
|
2985
|
+
}
|
|
2986
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2794
2987
|
NavButton,
|
|
2795
2988
|
{
|
|
2796
|
-
|
|
2989
|
+
icon: item.icon,
|
|
2990
|
+
active: item.id === resolvedActiveItemId,
|
|
2797
2991
|
onClick: () => {
|
|
2798
|
-
setLocalActiveItemId(
|
|
2799
|
-
onNavigate?.(
|
|
2992
|
+
setLocalActiveItemId(item.id);
|
|
2993
|
+
onNavigate?.(item.id);
|
|
2800
2994
|
},
|
|
2801
|
-
children:
|
|
2995
|
+
children: item.label
|
|
2802
2996
|
},
|
|
2803
|
-
|
|
2804
|
-
)
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
{
|
|
2810
|
-
icon: item.icon,
|
|
2811
|
-
active: item.id === resolvedActiveItemId,
|
|
2812
|
-
onClick: () => {
|
|
2813
|
-
setLocalActiveItemId(item.id);
|
|
2814
|
-
onNavigate?.(item.id);
|
|
2815
|
-
},
|
|
2816
|
-
children: item.label
|
|
2817
|
-
},
|
|
2818
|
-
item.id
|
|
2819
|
-
);
|
|
2820
|
-
}) })
|
|
2821
|
-
] });
|
|
2997
|
+
item.id
|
|
2998
|
+
);
|
|
2999
|
+
}) })
|
|
3000
|
+
]
|
|
3001
|
+
}
|
|
3002
|
+
);
|
|
2822
3003
|
}
|
|
2823
|
-
function AppLayout({
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
3004
|
+
function AppLayout({
|
|
3005
|
+
header,
|
|
3006
|
+
sidebar,
|
|
3007
|
+
children,
|
|
3008
|
+
flush = false,
|
|
3009
|
+
className
|
|
3010
|
+
}) {
|
|
3011
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3012
|
+
"div",
|
|
3013
|
+
{
|
|
3014
|
+
className: cn2(
|
|
3015
|
+
"flex h-screen flex-col gap-[var(--global-spacing,0.75rem)] overflow-hidden p-[var(--global-spacing,0.75rem)]",
|
|
3016
|
+
className
|
|
3017
|
+
),
|
|
3018
|
+
style: { backgroundColor: "hsl(var(--muted))" },
|
|
3019
|
+
children: [
|
|
3020
|
+
header ? header : null,
|
|
3021
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 gap-[var(--global-spacing,0.75rem)] overflow-hidden min-h-0", children: [
|
|
3022
|
+
sidebar ? sidebar : null,
|
|
3023
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3024
|
+
"main",
|
|
3025
|
+
{
|
|
3026
|
+
className: cn2(
|
|
3027
|
+
"flex-1 min-h-0 overflow-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))]",
|
|
3028
|
+
!flush && "overflow-y-auto"
|
|
3029
|
+
),
|
|
3030
|
+
children: flush ? children : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full overflow-y-auto", children })
|
|
3031
|
+
}
|
|
3032
|
+
)
|
|
3033
|
+
] })
|
|
3034
|
+
]
|
|
3035
|
+
}
|
|
3036
|
+
);
|
|
2837
3037
|
}
|
|
2838
3038
|
var NAVIGATION_LAYOUT_SIDEBAR_EXPANDED_WIDTH = "13.7rem";
|
|
2839
3039
|
var NAVIGATION_LAYOUT_SIDEBAR_COLLAPSED_WIDTH = "4.25rem";
|
|
@@ -2855,15 +3055,39 @@ var NAVIGATION_LAYOUT_DEFAULT_APPEARANCE = {
|
|
|
2855
3055
|
};
|
|
2856
3056
|
var NAVIGATION_LAYOUT_MENU_RADIUS_CLASS_MAP = {
|
|
2857
3057
|
none: { all: "rounded-none", left: "!rounded-none", right: "!rounded-none" },
|
|
2858
|
-
sm: {
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
3058
|
+
sm: {
|
|
3059
|
+
all: "rounded-sm",
|
|
3060
|
+
left: "!rounded-l-sm !rounded-r-none",
|
|
3061
|
+
right: "!rounded-l-none !rounded-r-sm"
|
|
3062
|
+
},
|
|
3063
|
+
md: {
|
|
3064
|
+
all: "rounded-md",
|
|
3065
|
+
left: "!rounded-l-md !rounded-r-none",
|
|
3066
|
+
right: "!rounded-l-none !rounded-r-md"
|
|
3067
|
+
},
|
|
3068
|
+
lg: {
|
|
3069
|
+
all: "rounded-lg",
|
|
3070
|
+
left: "!rounded-l-lg !rounded-r-none",
|
|
3071
|
+
right: "!rounded-l-none !rounded-r-lg"
|
|
3072
|
+
},
|
|
3073
|
+
xl: {
|
|
3074
|
+
all: "rounded-xl",
|
|
3075
|
+
left: "!rounded-l-xl !rounded-r-none",
|
|
3076
|
+
right: "!rounded-l-none !rounded-r-xl"
|
|
3077
|
+
},
|
|
3078
|
+
full: {
|
|
3079
|
+
all: "rounded-full",
|
|
3080
|
+
left: "!rounded-l-full !rounded-r-none",
|
|
3081
|
+
right: "!rounded-l-none !rounded-r-full"
|
|
3082
|
+
}
|
|
2863
3083
|
};
|
|
2864
3084
|
function clampHeadbarHeight(value) {
|
|
2865
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
2866
|
-
|
|
3085
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
3086
|
+
return NAVIGATION_LAYOUT_HEADBAR_DEFAULT_HEIGHT_PX;
|
|
3087
|
+
return Math.min(
|
|
3088
|
+
NAVIGATION_LAYOUT_HEADBAR_MAX_HEIGHT_PX,
|
|
3089
|
+
Math.max(NAVIGATION_LAYOUT_HEADBAR_MIN_HEIGHT_PX, Math.round(value))
|
|
3090
|
+
);
|
|
2867
3091
|
}
|
|
2868
3092
|
function getHeadbarVerticalPaddingPx(heightPx) {
|
|
2869
3093
|
return heightPx <= NAVIGATION_LAYOUT_HEADBAR_COMPACT_HEIGHT_THRESHOLD_PX ? NAVIGATION_LAYOUT_HEADBAR_COMPACT_VERTICAL_PADDING_PX : NAVIGATION_LAYOUT_HEADBAR_BOXED_VERTICAL_PADDING_PX;
|
|
@@ -2881,7 +3105,13 @@ function getHeadbarMenuRadiusClass(menuRadius = "default", part = "all") {
|
|
|
2881
3105
|
}
|
|
2882
3106
|
function getHeadbarFrameClass(layoutMode = "boxed", navPosition = "center") {
|
|
2883
3107
|
const columns = navPosition === "center" ? "grid-cols-[minmax(max-content,1fr)_minmax(0,max-content)_minmax(max-content,1fr)]" : "grid-cols-[max-content_minmax(0,1fr)_max-content]";
|
|
2884
|
-
return layoutMode === "full-bleed" ? cn2(
|
|
3108
|
+
return layoutMode === "full-bleed" ? cn2(
|
|
3109
|
+
"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-none border-b border-x-0 border-t-0 border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",
|
|
3110
|
+
columns
|
|
3111
|
+
) : cn2(
|
|
3112
|
+
"sticky top-0 z-40 grid w-full shrink-0 items-center gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]",
|
|
3113
|
+
columns
|
|
3114
|
+
);
|
|
2885
3115
|
}
|
|
2886
3116
|
function getHeadbarFrameStyle(layoutMode = "boxed", heightPx, surface = "card") {
|
|
2887
3117
|
const verticalPaddingPx = getHeadbarVerticalPaddingPx(heightPx);
|
|
@@ -2927,7 +3157,8 @@ function getHeadbarItemStyle(active, useTokenRadius = true) {
|
|
|
2927
3157
|
function findNavigationRootId(items, activeItemId) {
|
|
2928
3158
|
for (const item of items) {
|
|
2929
3159
|
if (item.id === activeItemId) return item.id;
|
|
2930
|
-
if (item.children?.some((child) => child.id === activeItemId))
|
|
3160
|
+
if (item.children?.some((child) => child.id === activeItemId))
|
|
3161
|
+
return item.id;
|
|
2931
3162
|
}
|
|
2932
3163
|
return activeItemId;
|
|
2933
3164
|
}
|
|
@@ -2996,7 +3227,9 @@ function SidebarNavigationList({
|
|
|
2996
3227
|
revealRequest
|
|
2997
3228
|
}) {
|
|
2998
3229
|
const navRef = react.useRef(null);
|
|
2999
|
-
const [expandedByRoot, setExpandedByRoot] = react.useState(
|
|
3230
|
+
const [expandedByRoot, setExpandedByRoot] = react.useState(
|
|
3231
|
+
{}
|
|
3232
|
+
);
|
|
3000
3233
|
const toggleRoot = (id) => {
|
|
3001
3234
|
setExpandedByRoot((current) => ({
|
|
3002
3235
|
...current,
|
|
@@ -3014,65 +3247,86 @@ function SidebarNavigationList({
|
|
|
3014
3247
|
`[data-navigation-sidebar-root-id="${CSS.escape(revealRequest.id)}"]`
|
|
3015
3248
|
);
|
|
3016
3249
|
if (targetElement instanceof HTMLElement) {
|
|
3017
|
-
targetElement.scrollIntoView({
|
|
3250
|
+
targetElement.scrollIntoView({
|
|
3251
|
+
behavior: "auto",
|
|
3252
|
+
block: "nearest",
|
|
3253
|
+
inline: "nearest"
|
|
3254
|
+
});
|
|
3018
3255
|
}
|
|
3019
3256
|
});
|
|
3020
3257
|
return () => window.cancelAnimationFrame(frameId);
|
|
3021
3258
|
}, [revealRequest]);
|
|
3022
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
"
|
|
3026
|
-
{
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3259
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3260
|
+
"div",
|
|
3261
|
+
{
|
|
3262
|
+
className: "h-full flex-1 overflow-y-auto",
|
|
3263
|
+
style: { scrollbarWidth: "none", msOverflowStyle: "none" },
|
|
3264
|
+
children: [
|
|
3265
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `.monkeys-navigation-sidebar-nav::-webkit-scrollbar { display: none; }` }),
|
|
3266
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3267
|
+
"div",
|
|
3268
|
+
{
|
|
3269
|
+
ref: navRef,
|
|
3270
|
+
className: "monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",
|
|
3271
|
+
children: items.map((item) => {
|
|
3272
|
+
const isGroup = Boolean(item.children?.length);
|
|
3273
|
+
const isExpanded = Boolean(expandedByRoot[item.id]);
|
|
3274
|
+
const isActive = activeItemId === item.id;
|
|
3275
|
+
if (isGroup) {
|
|
3276
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-navigation-sidebar-root-id": item.id, children: [
|
|
3277
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3278
|
+
NavButton,
|
|
3279
|
+
{
|
|
3280
|
+
icon: item.icon,
|
|
3281
|
+
onClick: () => toggleRoot(item.id),
|
|
3282
|
+
postfix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3283
|
+
"svg",
|
|
3284
|
+
{
|
|
3285
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3286
|
+
width: "16",
|
|
3287
|
+
height: "16",
|
|
3288
|
+
viewBox: "0 0 24 24",
|
|
3289
|
+
fill: "none",
|
|
3290
|
+
stroke: "currentColor",
|
|
3291
|
+
strokeWidth: "2",
|
|
3292
|
+
strokeLinecap: "round",
|
|
3293
|
+
strokeLinejoin: "round",
|
|
3294
|
+
className: "shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",
|
|
3295
|
+
style: {
|
|
3296
|
+
transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
|
|
3297
|
+
},
|
|
3298
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
3299
|
+
}
|
|
3300
|
+
) }),
|
|
3301
|
+
children: item.label
|
|
3302
|
+
}
|
|
3303
|
+
),
|
|
3304
|
+
isExpanded ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex flex-col gap-1", children: item.children?.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3305
|
+
NavButton,
|
|
3306
|
+
{
|
|
3307
|
+
active: activeItemId === child.id,
|
|
3308
|
+
onClick: () => onNavigate?.(child.id),
|
|
3309
|
+
children: child.label
|
|
3310
|
+
},
|
|
3311
|
+
child.id
|
|
3312
|
+
)) }) : null
|
|
3313
|
+
] }, item.id);
|
|
3314
|
+
}
|
|
3315
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-navigation-sidebar-root-id": item.id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3036
3316
|
NavButton,
|
|
3037
3317
|
{
|
|
3318
|
+
active: isActive,
|
|
3038
3319
|
icon: item.icon,
|
|
3039
|
-
onClick: () =>
|
|
3040
|
-
postfix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3041
|
-
"svg",
|
|
3042
|
-
{
|
|
3043
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3044
|
-
width: "16",
|
|
3045
|
-
height: "16",
|
|
3046
|
-
viewBox: "0 0 24 24",
|
|
3047
|
-
fill: "none",
|
|
3048
|
-
stroke: "currentColor",
|
|
3049
|
-
strokeWidth: "2",
|
|
3050
|
-
strokeLinecap: "round",
|
|
3051
|
-
strokeLinejoin: "round",
|
|
3052
|
-
className: "shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",
|
|
3053
|
-
style: { transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)" },
|
|
3054
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
|
|
3055
|
-
}
|
|
3056
|
-
) }),
|
|
3320
|
+
onClick: () => onNavigate?.(item.id),
|
|
3057
3321
|
children: item.label
|
|
3058
3322
|
}
|
|
3059
|
-
),
|
|
3060
|
-
|
|
3061
|
-
NavButton,
|
|
3062
|
-
{
|
|
3063
|
-
active: activeItemId === child.id,
|
|
3064
|
-
onClick: () => onNavigate?.(child.id),
|
|
3065
|
-
children: child.label
|
|
3066
|
-
},
|
|
3067
|
-
child.id
|
|
3068
|
-
)) }) : null
|
|
3069
|
-
] }, item.id);
|
|
3323
|
+
) }, item.id);
|
|
3324
|
+
})
|
|
3070
3325
|
}
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
] });
|
|
3326
|
+
)
|
|
3327
|
+
]
|
|
3328
|
+
}
|
|
3329
|
+
);
|
|
3076
3330
|
}
|
|
3077
3331
|
function SidebarBrand({
|
|
3078
3332
|
collapsed,
|
|
@@ -3088,7 +3342,14 @@ function SidebarBrand({
|
|
|
3088
3342
|
"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",
|
|
3089
3343
|
logo.url ? "bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
|
|
3090
3344
|
),
|
|
3091
|
-
children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3345
|
+
children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3346
|
+
"img",
|
|
3347
|
+
{
|
|
3348
|
+
src: logo.url,
|
|
3349
|
+
alt: logo.title,
|
|
3350
|
+
className: "h-full w-full object-contain"
|
|
3351
|
+
}
|
|
3352
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold", children: logo.title.charAt(0) })
|
|
3092
3353
|
}
|
|
3093
3354
|
);
|
|
3094
3355
|
if (collapsed) {
|
|
@@ -3222,7 +3483,10 @@ function HeadbarChevronIcon({ open }) {
|
|
|
3222
3483
|
"svg",
|
|
3223
3484
|
{
|
|
3224
3485
|
"aria-hidden": "true",
|
|
3225
|
-
className: cn2(
|
|
3486
|
+
className: cn2(
|
|
3487
|
+
"h-4 w-4 shrink-0 transition-transform duration-200",
|
|
3488
|
+
open && "rotate-180"
|
|
3489
|
+
),
|
|
3226
3490
|
viewBox: "0 0 24 24",
|
|
3227
3491
|
fill: "none",
|
|
3228
3492
|
stroke: "currentColor",
|
|
@@ -3316,7 +3580,10 @@ function HeadbarNavMenuItem({
|
|
|
3316
3580
|
"relative flex cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-none transition-colors hover:bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))]",
|
|
3317
3581
|
menuItemRadiusClass
|
|
3318
3582
|
),
|
|
3319
|
-
style: getHeadbarItemStyle(
|
|
3583
|
+
style: getHeadbarItemStyle(
|
|
3584
|
+
child.id === activeItemId,
|
|
3585
|
+
useTokenRadius
|
|
3586
|
+
),
|
|
3320
3587
|
onSelect: () => {
|
|
3321
3588
|
if (child.disabled) return;
|
|
3322
3589
|
setOpen(false);
|
|
@@ -3417,7 +3684,10 @@ function NavigationHeadbar({
|
|
|
3417
3684
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3418
3685
|
"header",
|
|
3419
3686
|
{
|
|
3420
|
-
className: cn2(
|
|
3687
|
+
className: cn2(
|
|
3688
|
+
getHeadbarFrameClass(layoutMode, layout?.navPosition),
|
|
3689
|
+
className
|
|
3690
|
+
),
|
|
3421
3691
|
"data-navigation-headbar": "",
|
|
3422
3692
|
"data-navigation-headbar-surface": surface,
|
|
3423
3693
|
style: frameStyle,
|
|
@@ -3435,7 +3705,14 @@ function NavigationHeadbar({
|
|
|
3435
3705
|
logo.url ? "w-auto max-w-[min(22rem,30vw)] bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
|
|
3436
3706
|
),
|
|
3437
3707
|
style: logo.url ? { height: logoHeightPx } : { width: logoHeightPx, height: logoHeightPx },
|
|
3438
|
-
children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3708
|
+
children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3709
|
+
"img",
|
|
3710
|
+
{
|
|
3711
|
+
src: logo.url,
|
|
3712
|
+
alt: logo.title,
|
|
3713
|
+
className: "block h-full w-auto object-contain"
|
|
3714
|
+
}
|
|
3715
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: logo.title.charAt(0) })
|
|
3439
3716
|
}
|
|
3440
3717
|
),
|
|
3441
3718
|
label: showBrandTitle ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap text-base font-medium text-[hsl(var(--foreground))]", children: layout?.brandTitle }) : null,
|
|
@@ -3446,16 +3723,25 @@ function NavigationHeadbar({
|
|
|
3446
3723
|
onClick: logo.onClick
|
|
3447
3724
|
}
|
|
3448
3725
|
) : null) }),
|
|
3449
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3450
|
-
|
|
3726
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3727
|
+
"div",
|
|
3451
3728
|
{
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3729
|
+
className: cn2(
|
|
3730
|
+
"flex min-w-0 items-center",
|
|
3731
|
+
getHeadbarNavClass(layout?.navPosition)
|
|
3732
|
+
),
|
|
3733
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "no-scrollbar flex max-w-full min-w-0 items-center overflow-x-auto overscroll-x-contain", children: navigation ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3734
|
+
NavigationHeadbarMenu,
|
|
3735
|
+
{
|
|
3736
|
+
activeItemId,
|
|
3737
|
+
activeRootId,
|
|
3738
|
+
items: navItems,
|
|
3739
|
+
menuRadius,
|
|
3740
|
+
onNavigate
|
|
3741
|
+
}
|
|
3742
|
+
) })
|
|
3457
3743
|
}
|
|
3458
|
-
)
|
|
3744
|
+
),
|
|
3459
3745
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center justify-end gap-3", children: [
|
|
3460
3746
|
actions,
|
|
3461
3747
|
extra,
|
|
@@ -3533,21 +3819,47 @@ function NavigationLayout({
|
|
|
3533
3819
|
id: "toggle-headbar",
|
|
3534
3820
|
label: switchToHeadbarLabel,
|
|
3535
3821
|
onClick: () => setNavigationMode("headbar"),
|
|
3536
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3822
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3823
|
+
"svg",
|
|
3824
|
+
{
|
|
3825
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3826
|
+
className: "h-[18px] w-[18px] rotate-180",
|
|
3827
|
+
viewBox: "0 0 24 24",
|
|
3828
|
+
fill: "none",
|
|
3829
|
+
stroke: "currentColor",
|
|
3830
|
+
strokeWidth: "1.8",
|
|
3831
|
+
strokeLinecap: "round",
|
|
3832
|
+
strokeLinejoin: "round",
|
|
3833
|
+
children: [
|
|
3834
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
3835
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 9h18" })
|
|
3836
|
+
]
|
|
3837
|
+
}
|
|
3838
|
+
)
|
|
3540
3839
|
});
|
|
3541
3840
|
}
|
|
3542
3841
|
navigationActions.push({
|
|
3543
3842
|
id: "toggle-sidebar",
|
|
3544
3843
|
label: sidebarCollapsed ? expandSidebarLabel : collapseSidebarLabel,
|
|
3545
3844
|
onClick: () => setCollapsed(!sidebarCollapsed),
|
|
3546
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3845
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3846
|
+
"svg",
|
|
3847
|
+
{
|
|
3848
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3849
|
+
className: "h-[18px] w-[18px]",
|
|
3850
|
+
viewBox: "0 0 24 24",
|
|
3851
|
+
fill: "none",
|
|
3852
|
+
stroke: "currentColor",
|
|
3853
|
+
strokeWidth: "1.8",
|
|
3854
|
+
strokeLinecap: "round",
|
|
3855
|
+
strokeLinejoin: "round",
|
|
3856
|
+
children: [
|
|
3857
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
3858
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" }),
|
|
3859
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: sidebarCollapsed ? "m14 9 3 3-3 3" : "m16 15-3-3 3-3" })
|
|
3860
|
+
]
|
|
3861
|
+
}
|
|
3862
|
+
)
|
|
3551
3863
|
});
|
|
3552
3864
|
const sidebar = isHeadbarMode ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3553
3865
|
"div",
|
|
@@ -3556,7 +3868,10 @@ function NavigationLayout({
|
|
|
3556
3868
|
"relative h-full min-h-0 shrink-0 transition-[width] duration-260",
|
|
3557
3869
|
sidebarCollapsed ? "z-20 overflow-visible" : "z-10 overflow-hidden"
|
|
3558
3870
|
),
|
|
3559
|
-
style: {
|
|
3871
|
+
style: {
|
|
3872
|
+
width: sidebarWidth,
|
|
3873
|
+
transitionTimingFunction: NAVIGATION_LAYOUT_TRANSITION_TIMING
|
|
3874
|
+
},
|
|
3560
3875
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3561
3876
|
Sidebar,
|
|
3562
3877
|
{
|
|
@@ -3571,7 +3886,10 @@ function NavigationLayout({
|
|
|
3571
3886
|
logo,
|
|
3572
3887
|
onCollapsedChange: setCollapsed,
|
|
3573
3888
|
onNavigate,
|
|
3574
|
-
onRevealRoot: (rootId) => setRevealRequest((prev) => ({
|
|
3889
|
+
onRevealRoot: (rootId) => setRevealRequest((prev) => ({
|
|
3890
|
+
id: rootId,
|
|
3891
|
+
nonce: (prev?.nonce ?? 0) + 1
|
|
3892
|
+
})),
|
|
3575
3893
|
revealRequest,
|
|
3576
3894
|
title: headbarLayout?.brandTitle
|
|
3577
3895
|
}
|
|
@@ -3590,11 +3908,24 @@ function NavigationLayout({
|
|
|
3590
3908
|
{
|
|
3591
3909
|
appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
|
|
3592
3910
|
tone: "muted",
|
|
3593
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3911
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3912
|
+
"svg",
|
|
3913
|
+
{
|
|
3914
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3915
|
+
className: "h-4 w-4 shrink-0",
|
|
3916
|
+
viewBox: "0 0 24 24",
|
|
3917
|
+
fill: "none",
|
|
3918
|
+
stroke: "currentColor",
|
|
3919
|
+
strokeWidth: "1.8",
|
|
3920
|
+
strokeLinecap: "round",
|
|
3921
|
+
strokeLinejoin: "round",
|
|
3922
|
+
children: [
|
|
3923
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
3924
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" }),
|
|
3925
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m14 9 3 3-3 3" })
|
|
3926
|
+
]
|
|
3927
|
+
}
|
|
3928
|
+
),
|
|
3598
3929
|
label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: switchToSidebarLabel }),
|
|
3599
3930
|
onClick: () => setNavigationMode("sidebar"),
|
|
3600
3931
|
className: cn2(
|
|
@@ -3612,11 +3943,21 @@ function NavigationLayout({
|
|
|
3612
3943
|
onNavigate
|
|
3613
3944
|
}
|
|
3614
3945
|
) : null;
|
|
3615
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3946
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3947
|
+
AppLayout,
|
|
3948
|
+
{
|
|
3949
|
+
header,
|
|
3950
|
+
sidebar,
|
|
3951
|
+
flush,
|
|
3952
|
+
className,
|
|
3953
|
+
children
|
|
3954
|
+
}
|
|
3955
|
+
);
|
|
3616
3956
|
}
|
|
3617
3957
|
|
|
3618
3958
|
exports.AppHeader = AppHeader;
|
|
3619
3959
|
exports.AppLayout = AppLayout;
|
|
3960
|
+
exports.AppShellSidebar = AppShellSidebar;
|
|
3620
3961
|
exports.AppSidebar = AppSidebar;
|
|
3621
3962
|
exports.NavButton = NavButton;
|
|
3622
3963
|
exports.NavigationHeadbar = NavigationHeadbar;
|