@inf-monkeys-tech/monkeys-design 1.0.36 → 1.0.37
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/agent-workbench/index.js +47 -13
- package/dist/components/agent-workbench/index.js.map +1 -1
- package/dist/components/agent-workbench/index.mjs +48 -14
- package/dist/components/agent-workbench/index.mjs.map +1 -1
- package/dist/components/layout/index.d.mts +1 -4
- package/dist/components/layout/index.d.ts +1 -4
- package/dist/components/layout/index.js +98 -149
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +98 -149
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/index.js +98 -149
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +98 -149
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -107,8 +107,6 @@ declare function cn(...inputs: (false | null | string | undefined)[]): string;
|
|
|
107
107
|
interface NavButtonProps {
|
|
108
108
|
/** 是否处于激活状态 */
|
|
109
109
|
active?: boolean;
|
|
110
|
-
/** 是否显示但禁止交互 */
|
|
111
|
-
disabled?: boolean;
|
|
112
110
|
/** 左侧图标 */
|
|
113
111
|
icon?: ReactNode;
|
|
114
112
|
/** 右侧附加内容(如 chevron) */
|
|
@@ -118,7 +116,7 @@ interface NavButtonProps {
|
|
|
118
116
|
className?: string;
|
|
119
117
|
children: ReactNode;
|
|
120
118
|
}
|
|
121
|
-
declare function NavButton({ active,
|
|
119
|
+
declare function NavButton({ active, icon, postfix, onClick, className, children, }: NavButtonProps): react_jsx_runtime.JSX.Element;
|
|
122
120
|
interface HeaderTab {
|
|
123
121
|
id: string;
|
|
124
122
|
label: string;
|
|
@@ -162,7 +160,6 @@ interface SidebarNavItem {
|
|
|
162
160
|
id: string;
|
|
163
161
|
label: string;
|
|
164
162
|
icon?: ReactNode;
|
|
165
|
-
disabled?: boolean;
|
|
166
163
|
/** 如果有 children 则为分组,点击展开/折叠 */
|
|
167
164
|
children?: SidebarNavItem[];
|
|
168
165
|
}
|
|
@@ -107,8 +107,6 @@ declare function cn(...inputs: (false | null | string | undefined)[]): string;
|
|
|
107
107
|
interface NavButtonProps {
|
|
108
108
|
/** 是否处于激活状态 */
|
|
109
109
|
active?: boolean;
|
|
110
|
-
/** 是否显示但禁止交互 */
|
|
111
|
-
disabled?: boolean;
|
|
112
110
|
/** 左侧图标 */
|
|
113
111
|
icon?: ReactNode;
|
|
114
112
|
/** 右侧附加内容(如 chevron) */
|
|
@@ -118,7 +116,7 @@ interface NavButtonProps {
|
|
|
118
116
|
className?: string;
|
|
119
117
|
children: ReactNode;
|
|
120
118
|
}
|
|
121
|
-
declare function NavButton({ active,
|
|
119
|
+
declare function NavButton({ active, icon, postfix, onClick, className, children, }: NavButtonProps): react_jsx_runtime.JSX.Element;
|
|
122
120
|
interface HeaderTab {
|
|
123
121
|
id: string;
|
|
124
122
|
label: string;
|
|
@@ -162,7 +160,6 @@ interface SidebarNavItem {
|
|
|
162
160
|
id: string;
|
|
163
161
|
label: string;
|
|
164
162
|
icon?: ReactNode;
|
|
165
|
-
disabled?: boolean;
|
|
166
163
|
/** 如果有 children 则为分组,点击展开/折叠 */
|
|
167
164
|
children?: SidebarNavItem[];
|
|
168
165
|
}
|
|
@@ -2789,7 +2789,7 @@ function UserAccountMenu({
|
|
|
2789
2789
|
DropdownMenu__namespace.Item,
|
|
2790
2790
|
{
|
|
2791
2791
|
disabled: item.disabled,
|
|
2792
|
-
onSelect: item.
|
|
2792
|
+
onSelect: item.onSelect,
|
|
2793
2793
|
className: cn(
|
|
2794
2794
|
"relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
2795
2795
|
radiusClass,
|
|
@@ -2815,7 +2815,6 @@ function cn2(...inputs) {
|
|
|
2815
2815
|
}
|
|
2816
2816
|
function NavButton({
|
|
2817
2817
|
active,
|
|
2818
|
-
disabled,
|
|
2819
2818
|
icon,
|
|
2820
2819
|
postfix,
|
|
2821
2820
|
onClick,
|
|
@@ -2823,17 +2822,11 @@ function NavButton({
|
|
|
2823
2822
|
children
|
|
2824
2823
|
}) {
|
|
2825
2824
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2826
|
-
"
|
|
2825
|
+
"div",
|
|
2827
2826
|
{
|
|
2828
|
-
type: "button",
|
|
2829
|
-
"aria-disabled": disabled || void 0,
|
|
2830
|
-
"aria-pressed": active || void 0,
|
|
2831
|
-
"data-disabled": disabled || void 0,
|
|
2832
|
-
disabled,
|
|
2833
2827
|
className: cn2(
|
|
2834
|
-
"flex w-full cursor-pointer select-none items-center gap-2 rounded-xl border p-2 text-
|
|
2828
|
+
"flex w-full cursor-pointer select-none items-center gap-2 rounded-xl border p-2 text-xs text-[hsl(var(--foreground))] transition-colors",
|
|
2835
2829
|
active ? "border-[hsl(var(--input))] bg-[hsl(var(--muted))] font-bold" : "border-transparent hover:border-[hsl(var(--input))]/60 hover:bg-[hsl(var(--muted))]/60",
|
|
2836
|
-
disabled && "!cursor-not-allowed opacity-60 hover:border-transparent hover:bg-transparent",
|
|
2837
2830
|
className
|
|
2838
2831
|
),
|
|
2839
2832
|
onClick,
|
|
@@ -3126,8 +3119,6 @@ function SidebarNavList({
|
|
|
3126
3119
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3127
3120
|
NavButton,
|
|
3128
3121
|
{
|
|
3129
|
-
active: item.id === resolvedActiveItemId,
|
|
3130
|
-
disabled: item.disabled,
|
|
3131
3122
|
icon: item.icon,
|
|
3132
3123
|
onClick: () => toggle(item.id),
|
|
3133
3124
|
postfix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3152,11 +3143,10 @@ function SidebarNavList({
|
|
|
3152
3143
|
children: item.label
|
|
3153
3144
|
}
|
|
3154
3145
|
),
|
|
3155
|
-
isExpanded &&
|
|
3146
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-1 mt-1", children: item.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3156
3147
|
NavButton,
|
|
3157
3148
|
{
|
|
3158
3149
|
active: child.id === resolvedActiveItemId,
|
|
3159
|
-
disabled: child.disabled,
|
|
3160
3150
|
onClick: () => {
|
|
3161
3151
|
setLocalActiveItemId(child.id);
|
|
3162
3152
|
onNavigate?.(child.id);
|
|
@@ -3172,7 +3162,6 @@ function SidebarNavList({
|
|
|
3172
3162
|
{
|
|
3173
3163
|
icon: item.icon,
|
|
3174
3164
|
active: item.id === resolvedActiveItemId,
|
|
3175
|
-
disabled: item.disabled,
|
|
3176
3165
|
onClick: () => {
|
|
3177
3166
|
setLocalActiveItemId(item.id);
|
|
3178
3167
|
onNavigate?.(item.id);
|
|
@@ -3422,10 +3411,6 @@ function SidebarNavigationList({
|
|
|
3422
3411
|
const [expandedByRoot, setExpandedByRoot] = react.useState(
|
|
3423
3412
|
{}
|
|
3424
3413
|
);
|
|
3425
|
-
const canRevealRequestedRoot = revealRequest ? items.some(
|
|
3426
|
-
(item) => item.id === revealRequest.id && !item.disabled
|
|
3427
|
-
) : false;
|
|
3428
|
-
const activeRootId = findNavigationRootId(items, activeItemId);
|
|
3429
3414
|
const toggleRoot = (id) => {
|
|
3430
3415
|
setExpandedByRoot((current) => ({
|
|
3431
3416
|
...current,
|
|
@@ -3433,7 +3418,7 @@ function SidebarNavigationList({
|
|
|
3433
3418
|
}));
|
|
3434
3419
|
};
|
|
3435
3420
|
react.useEffect(() => {
|
|
3436
|
-
if (!revealRequest
|
|
3421
|
+
if (!revealRequest) return;
|
|
3437
3422
|
setExpandedByRoot((current) => ({
|
|
3438
3423
|
...current,
|
|
3439
3424
|
[revealRequest.id]: true
|
|
@@ -3451,7 +3436,7 @@ function SidebarNavigationList({
|
|
|
3451
3436
|
}
|
|
3452
3437
|
});
|
|
3453
3438
|
return () => window.cancelAnimationFrame(frameId);
|
|
3454
|
-
}, [
|
|
3439
|
+
}, [revealRequest]);
|
|
3455
3440
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3456
3441
|
"div",
|
|
3457
3442
|
{
|
|
@@ -3466,15 +3451,13 @@ function SidebarNavigationList({
|
|
|
3466
3451
|
className: "monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",
|
|
3467
3452
|
children: items.map((item) => {
|
|
3468
3453
|
const isGroup = Boolean(item.children?.length);
|
|
3469
|
-
const isExpanded =
|
|
3470
|
-
const isActive =
|
|
3454
|
+
const isExpanded = Boolean(expandedByRoot[item.id]);
|
|
3455
|
+
const isActive = activeItemId === item.id;
|
|
3471
3456
|
if (isGroup) {
|
|
3472
3457
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-navigation-sidebar-root-id": item.id, children: [
|
|
3473
3458
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3474
3459
|
NavButton,
|
|
3475
3460
|
{
|
|
3476
|
-
active: isActive,
|
|
3477
|
-
disabled: item.disabled,
|
|
3478
3461
|
icon: item.icon,
|
|
3479
3462
|
onClick: () => toggleRoot(item.id),
|
|
3480
3463
|
postfix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3503,7 +3486,6 @@ function SidebarNavigationList({
|
|
|
3503
3486
|
NavButton,
|
|
3504
3487
|
{
|
|
3505
3488
|
active: activeItemId === child.id,
|
|
3506
|
-
disabled: child.disabled,
|
|
3507
3489
|
onClick: () => onNavigate?.(child.id),
|
|
3508
3490
|
children: child.label
|
|
3509
3491
|
},
|
|
@@ -3515,7 +3497,6 @@ function SidebarNavigationList({
|
|
|
3515
3497
|
NavButton,
|
|
3516
3498
|
{
|
|
3517
3499
|
active: isActive,
|
|
3518
|
-
disabled: item.disabled,
|
|
3519
3500
|
icon: item.icon,
|
|
3520
3501
|
onClick: () => onNavigate?.(item.id),
|
|
3521
3502
|
children: item.label
|
|
@@ -3631,11 +3612,9 @@ function Sidebar({
|
|
|
3631
3612
|
appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
|
|
3632
3613
|
tone: "muted",
|
|
3633
3614
|
active: isActive,
|
|
3634
|
-
disabled: item.disabled,
|
|
3635
3615
|
iconOnly: true,
|
|
3636
3616
|
icon: item.icon,
|
|
3637
3617
|
onClick: () => {
|
|
3638
|
-
if (item.disabled) return;
|
|
3639
3618
|
onRevealRoot?.(item.id);
|
|
3640
3619
|
onCollapsedChange?.(false);
|
|
3641
3620
|
if (item.children?.length) return;
|
|
@@ -3712,7 +3691,6 @@ function HeadbarNavMenuItem({
|
|
|
3712
3691
|
useTokenRadius
|
|
3713
3692
|
}) {
|
|
3714
3693
|
const [open, setOpen] = react.useState(false);
|
|
3715
|
-
const menuOpen = !item.disabled && open;
|
|
3716
3694
|
const closeTimerRef = react.useRef(null);
|
|
3717
3695
|
const wasOpenOnPointerDownRef = react.useRef(false);
|
|
3718
3696
|
const clearCloseTimer = () => {
|
|
@@ -3721,7 +3699,6 @@ function HeadbarNavMenuItem({
|
|
|
3721
3699
|
closeTimerRef.current = null;
|
|
3722
3700
|
};
|
|
3723
3701
|
const openMenu = () => {
|
|
3724
|
-
if (item.disabled) return;
|
|
3725
3702
|
clearCloseTimer();
|
|
3726
3703
|
setOpen(true);
|
|
3727
3704
|
};
|
|
@@ -3733,7 +3710,6 @@ function HeadbarNavMenuItem({
|
|
|
3733
3710
|
}, 120);
|
|
3734
3711
|
};
|
|
3735
3712
|
const navigateToFirstEnabledChild = () => {
|
|
3736
|
-
if (item.disabled) return false;
|
|
3737
3713
|
const firstEnabledChild = item.children?.find((child) => !child.disabled);
|
|
3738
3714
|
if (!firstEnabledChild) return false;
|
|
3739
3715
|
setOpen(false);
|
|
@@ -3741,113 +3717,98 @@ function HeadbarNavMenuItem({
|
|
|
3741
3717
|
return true;
|
|
3742
3718
|
};
|
|
3743
3719
|
react.useEffect(() => clearCloseTimer, []);
|
|
3744
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3745
|
-
DropdownMenu__namespace.
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3720
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Root, { modal: false, open, onOpenChange: setOpen, children: [
|
|
3721
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3722
|
+
BaseButton,
|
|
3723
|
+
{
|
|
3724
|
+
appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
|
|
3725
|
+
tone: "muted",
|
|
3726
|
+
active: isActive || open,
|
|
3727
|
+
icon: item.icon,
|
|
3728
|
+
endIcon: /* @__PURE__ */ jsxRuntime.jsx(HeadbarChevronIcon, { open }),
|
|
3729
|
+
label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: label }),
|
|
3730
|
+
disabled: item.disabled,
|
|
3731
|
+
onClick: () => {
|
|
3732
|
+
const wasOpenOnPointerDown = wasOpenOnPointerDownRef.current;
|
|
3733
|
+
wasOpenOnPointerDownRef.current = false;
|
|
3734
|
+
if (wasOpenOnPointerDown && navigateToFirstEnabledChild()) return;
|
|
3735
|
+
setOpen(true);
|
|
3736
|
+
},
|
|
3737
|
+
onPointerDown: () => {
|
|
3738
|
+
wasOpenOnPointerDownRef.current = open;
|
|
3739
|
+
},
|
|
3740
|
+
onPointerCancel: () => {
|
|
3741
|
+
wasOpenOnPointerDownRef.current = false;
|
|
3742
|
+
},
|
|
3743
|
+
onKeyDown: (event) => {
|
|
3744
|
+
if (!open || event.key !== "Enter" && event.key !== " ") return;
|
|
3745
|
+
if (navigateToFirstEnabledChild()) event.preventDefault();
|
|
3746
|
+
},
|
|
3747
|
+
onMouseEnter: openMenu,
|
|
3748
|
+
onMouseLeave: scheduleCloseMenu,
|
|
3749
|
+
style: getHeadbarItemStyle(
|
|
3750
|
+
isActive || open,
|
|
3751
|
+
compound ? false : useTokenRadius
|
|
3752
|
+
),
|
|
3753
|
+
classNames: {
|
|
3754
|
+
icon: "text-[inherit] [&_*]:!text-[inherit] [&_svg]:!stroke-current",
|
|
3755
|
+
label: "text-[inherit] [&_*]:!text-[inherit]"
|
|
3756
|
+
},
|
|
3757
|
+
className: cn2(
|
|
3758
|
+
"max-w-[12rem] shrink-0 border shadow-none",
|
|
3759
|
+
compound && "!rounded-none !border-0 !bg-transparent",
|
|
3760
|
+
menuButtonRadiusClass,
|
|
3761
|
+
isActive || open ? "" : "hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]"
|
|
3762
|
+
)
|
|
3763
|
+
}
|
|
3764
|
+
) }),
|
|
3765
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3766
|
+
DropdownMenu__namespace.Content,
|
|
3767
|
+
{
|
|
3768
|
+
align: "start",
|
|
3769
|
+
sideOffset: 5,
|
|
3770
|
+
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
3771
|
+
onMouseEnter: openMenu,
|
|
3772
|
+
onMouseLeave: scheduleCloseMenu,
|
|
3773
|
+
className: cn2(
|
|
3774
|
+
"z-50 min-w-56 border p-1.5 animate-in fade-in-0 zoom-in-95",
|
|
3775
|
+
menuContentRadiusClass
|
|
3776
|
+
),
|
|
3777
|
+
style: {
|
|
3778
|
+
background: "var(--monkeys-component-navigation-headbar-menu-background, hsl(var(--popover)))",
|
|
3779
|
+
borderColor: "var(--monkeys-component-navigation-headbar-menu-border-color, hsl(var(--border)))",
|
|
3780
|
+
color: "var(--monkeys-component-navigation-headbar-menu-foreground, hsl(var(--popover-foreground)))",
|
|
3781
|
+
boxShadow: "var(--monkeys-component-navigation-headbar-menu-shadow, 0 10px 15px -3px rgb(0 0 0 / 0.1))",
|
|
3782
|
+
backdropFilter: "blur(var(--monkeys-component-navigation-headbar-menu-backdrop-blur, 0px))"
|
|
3783
|
+
},
|
|
3784
|
+
children: item.children?.map((child) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3785
|
+
DropdownMenu__namespace.Item,
|
|
3800
3786
|
{
|
|
3801
|
-
|
|
3802
|
-
sideOffset: 5,
|
|
3803
|
-
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
3804
|
-
onMouseEnter: openMenu,
|
|
3805
|
-
onMouseLeave: scheduleCloseMenu,
|
|
3787
|
+
disabled: child.disabled,
|
|
3806
3788
|
className: cn2(
|
|
3807
|
-
"
|
|
3808
|
-
|
|
3789
|
+
"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)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] focus:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] focus:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))] data-[highlighted]:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--accent)))] data-[highlighted]:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--accent-foreground)))]",
|
|
3790
|
+
menuItemRadiusClass
|
|
3809
3791
|
),
|
|
3810
|
-
style:
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3792
|
+
style: getHeadbarItemStyle(
|
|
3793
|
+
child.id === activeItemId,
|
|
3794
|
+
useTokenRadius
|
|
3795
|
+
),
|
|
3796
|
+
onSelect: () => {
|
|
3797
|
+
if (child.disabled) return;
|
|
3798
|
+
setOpen(false);
|
|
3799
|
+
onNavigate?.(child.id);
|
|
3816
3800
|
},
|
|
3817
|
-
children:
|
|
3818
|
-
|
|
3819
|
-
{
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
),
|
|
3829
|
-
onSelect: () => {
|
|
3830
|
-
if (child.disabled) return;
|
|
3831
|
-
setOpen(false);
|
|
3832
|
-
onNavigate?.(child.id);
|
|
3833
|
-
},
|
|
3834
|
-
children: [
|
|
3835
|
-
child.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]", children: child.icon }) : null,
|
|
3836
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: child.headbarLabel ?? child.label }),
|
|
3837
|
-
child.trailing
|
|
3838
|
-
]
|
|
3839
|
-
},
|
|
3840
|
-
child.id
|
|
3841
|
-
))
|
|
3842
|
-
}
|
|
3843
|
-
) })
|
|
3844
|
-
]
|
|
3845
|
-
}
|
|
3846
|
-
);
|
|
3847
|
-
}
|
|
3848
|
-
function preventDisabledNavigationInteraction(event) {
|
|
3849
|
-
event.preventDefault();
|
|
3850
|
-
event.stopPropagation();
|
|
3801
|
+
children: [
|
|
3802
|
+
child.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]", children: child.icon }) : null,
|
|
3803
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: child.headbarLabel ?? child.label }),
|
|
3804
|
+
child.trailing
|
|
3805
|
+
]
|
|
3806
|
+
},
|
|
3807
|
+
child.id
|
|
3808
|
+
))
|
|
3809
|
+
}
|
|
3810
|
+
) })
|
|
3811
|
+
] });
|
|
3851
3812
|
}
|
|
3852
3813
|
function NavigationHeadbarMenu({
|
|
3853
3814
|
activeItemId,
|
|
@@ -3914,13 +3875,10 @@ function NavigationHeadbarMenu({
|
|
|
3914
3875
|
"div",
|
|
3915
3876
|
{
|
|
3916
3877
|
"data-navigation-headbar-compound-item": item.id,
|
|
3917
|
-
"data-disabled": item.disabled || void 0,
|
|
3918
|
-
"aria-disabled": item.disabled || void 0,
|
|
3919
3878
|
className: cn2(
|
|
3920
3879
|
"inline-flex min-w-0 shrink-0 items-center gap-0 overflow-hidden border shadow-none",
|
|
3921
3880
|
menuButtonRadiusClass,
|
|
3922
|
-
isActive ? "" : "hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]"
|
|
3923
|
-
item.disabled && "!cursor-not-allowed"
|
|
3881
|
+
isActive ? "" : "hover:!bg-[var(--monkeys-component-navigation-headbar-item-hover-background,hsl(var(--muted)))] hover:!text-[var(--monkeys-component-navigation-headbar-item-hover-foreground,hsl(var(--foreground)))]"
|
|
3924
3882
|
),
|
|
3925
3883
|
style: getHeadbarCompoundStyle(isActive, useTokenRadius),
|
|
3926
3884
|
children: [
|
|
@@ -3936,16 +3894,7 @@ function NavigationHeadbarMenu({
|
|
|
3936
3894
|
"span",
|
|
3937
3895
|
{
|
|
3938
3896
|
"data-navigation-headbar-secondary-action": item.id,
|
|
3939
|
-
"
|
|
3940
|
-
...item.disabled ? { inert: "" } : {},
|
|
3941
|
-
onClickCapture: item.disabled ? preventDisabledNavigationInteraction : void 0,
|
|
3942
|
-
onKeyDownCapture: item.disabled ? preventDisabledNavigationInteraction : void 0,
|
|
3943
|
-
onKeyUpCapture: item.disabled ? preventDisabledNavigationInteraction : void 0,
|
|
3944
|
-
onPointerDownCapture: item.disabled ? preventDisabledNavigationInteraction : void 0,
|
|
3945
|
-
className: cn2(
|
|
3946
|
-
"inline-flex min-w-0 shrink-0 items-center",
|
|
3947
|
-
item.disabled && "!cursor-not-allowed opacity-60"
|
|
3948
|
-
),
|
|
3897
|
+
className: "inline-flex min-w-0 shrink-0 items-center",
|
|
3949
3898
|
children: item.headbarSecondaryAction
|
|
3950
3899
|
}
|
|
3951
3900
|
)
|