"use client";
import { cn } from "./index3.js";
import { Kbd } from "./index83.js";
import { Check, ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
import { Menu as Menu$1 } from "@base-ui/react/menu";
//#region src/components/organisms/menus/DropdownMenu/DropdownMenu.tsx
function DropdownMenuRoot({ ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.Root, {
		"data-slot": "dropdown-menu-root",
		...props
	});
}
DropdownMenuRoot.displayName = "DropdownMenu.Root";
function DropdownMenuPortal({ ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.Portal, {
		"data-slot": "dropdown-menu-portal",
		...props
	});
}
DropdownMenuPortal.displayName = "DropdownMenu.Portal";
function DropdownMenuTrigger({ ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.Trigger, {
		"data-slot": "dropdown-menu-trigger",
		...props
	});
}
DropdownMenuTrigger.displayName = "DropdownMenu.Trigger";
function DropdownMenuGroup({ ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.Group, {
		"data-slot": "dropdown-menu-group",
		...props
	});
}
DropdownMenuGroup.displayName = "DropdownMenu.Group";
function DropdownMenuSub({ ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.SubmenuRoot, {
		"data-slot": "dropdown-menu-sub",
		...props
	});
}
DropdownMenuSub.displayName = "DropdownMenu.Sub";
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
	return /* @__PURE__ */ jsxs(Menu$1.SubmenuTrigger, {
		"data-slot": "dropdown-menu-sub-trigger",
		"data-inset": inset,
		className: cn("focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-2 text-sm [&_svg:not([class*='size-'])]:size-4 group/dd-sub flex cursor-default items-center outline-hidden select-none data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 transition-[color,background-color,transform] duration-150 active:scale-[0.99]", className),
		...props,
		children: [children, /* @__PURE__ */ jsx(ChevronRight, { className: "ms-auto rtl:rotate-180 transition-transform duration-150 group-data-open/dd-sub:translate-x-0.5" })]
	});
}
DropdownMenuSubTrigger.displayName = "DropdownMenu.SubTrigger";
function DropdownMenuRadioGroup({ ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.RadioGroup, {
		"data-slot": "dropdown-menu-radio-group",
		...props
	});
}
DropdownMenuRadioGroup.displayName = "DropdownMenu.RadioGroup";
function DropdownMenuRadioItem({ className, children, ...props }) {
	return /* @__PURE__ */ jsxs(Menu$1.RadioItem, {
		"data-slot": "dropdown-menu-radio-item",
		className: cn("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-2 pe-8 ps-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 transition-colors duration-150", className),
		...props,
		children: [/* @__PURE__ */ jsx("span", {
			className: "pointer-events-none absolute end-2 flex items-center justify-center",
			"data-slot": "dropdown-menu-radio-item-indicator",
			children: /* @__PURE__ */ jsx(Menu$1.RadioItemIndicator, {
				className: "animate-in zoom-in-75 duration-150 motion-reduce:animate-none",
				children: /* @__PURE__ */ jsx(Check, {})
			})
		}), children]
	});
}
DropdownMenuRadioItem.displayName = "DropdownMenu.RadioItem";
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
	return /* @__PURE__ */ jsxs(Menu$1.CheckboxItem, {
		"data-slot": "dropdown-menu-checkbox-item",
		className: cn("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-2 pe-8 ps-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 transition-colors duration-150", className),
		checked,
		...props,
		children: [/* @__PURE__ */ jsx("span", {
			className: "pointer-events-none absolute end-2 flex items-center justify-center",
			"data-slot": "dropdown-menu-checkbox-item-indicator",
			children: /* @__PURE__ */ jsx(Menu$1.CheckboxItemIndicator, {
				className: "animate-in zoom-in-75 duration-150 motion-reduce:animate-none",
				children: /* @__PURE__ */ jsx(Check, {})
			})
		}), children]
	});
}
DropdownMenuCheckboxItem.displayName = "DropdownMenu.CheckboxItem";
function DropdownMenuShortcut({ className, ...props }) {
	return /* @__PURE__ */ jsx("span", {
		"data-slot": "dropdown-menu-shortcut",
		className: cn("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ms-auto text-xs tracking-widest", className),
		...props
	});
}
DropdownMenuShortcut.displayName = "DropdownMenu.Shortcut";
var popupWidthClasses = {
	auto: "",
	sm: "w-48",
	md: "w-56",
	lg: "w-64"
};
function DropdownMenuPopup({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, width = "auto", className, ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
		className: "isolate z-50 outline-none",
		align,
		alignOffset,
		side,
		sideOffset,
		children: /* @__PURE__ */ jsx(Menu$1.Popup, {
			"data-slot": "dropdown-menu-popup",
			className: cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", "ring-1 ring-foreground/10 bg-background text-popover-foreground min-w-32 rounded-lg p-1 shadow-lg z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden", "duration-200 motion-reduce:animate-none", popupWidthClasses[width], className),
			...props
		})
	}) });
}
DropdownMenuPopup.displayName = "DropdownMenu.Popup";
function DropdownMenuSubPopup({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
	return /* @__PURE__ */ jsx(DropdownMenuPopup, {
		"data-slot": "dropdown-menu-sub-popup",
		className: cn("min-w-[96px] w-auto", className),
		align,
		alignOffset,
		side,
		sideOffset,
		...props
	});
}
DropdownMenuSubPopup.displayName = "DropdownMenu.SubPopup";
function DropdownMenuHeader({ className, avatar, title, subtitle, children, ...props }) {
	if (children) return /* @__PURE__ */ jsx("div", {
		"data-slot": "dropdown-menu-header",
		className: cn("border-b border-border px-4 py-3", className),
		...props,
		children
	});
	return /* @__PURE__ */ jsx("div", {
		"data-slot": "dropdown-menu-header",
		className: cn("border-b border-border px-4 py-3", className),
		...props,
		children: /* @__PURE__ */ jsxs("div", {
			className: "flex items-center gap-3",
			children: [avatar, /* @__PURE__ */ jsxs("div", {
				className: "flex flex-col min-w-0",
				children: [title && /* @__PURE__ */ jsx("span", {
					className: "text-sm font-semibold text-foreground truncate",
					children: title
				}), subtitle && /* @__PURE__ */ jsx("span", {
					className: "text-sm text-muted-foreground truncate",
					children: subtitle
				})]
			})]
		})
	});
}
DropdownMenuHeader.displayName = "DropdownMenu.Header";
/**
* Enhanced DropdownMenuLabel
*/
function DropdownMenuLabel({ className, inset, ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.GroupLabel, {
		"data-slot": "dropdown-menu-label",
		"data-inset": inset,
		className: cn("px-4 py-2 text-xs font-medium text-quaternary-foreground uppercase tracking-wider", "data-[inset]:ps-8", className),
		...props
	});
}
DropdownMenuLabel.displayName = "DropdownMenu.Label";
function DropdownMenuItem({ className, icon, shortcut, destructive = false, render, inset, variant = "default", children, ...props }) {
	const isDestructive = destructive || variant === "destructive";
	return /* @__PURE__ */ jsxs(Menu$1.Item, {
		"data-slot": "dropdown-menu-item",
		"data-inset": inset,
		"data-variant": isDestructive ? "destructive" : variant,
		className: cn("group/dropdown-menu-item relative flex items-center gap-2 mx-1.5 px-2.5 py-2 rounded-md cursor-pointer outline-none", "text-sm font-semibold text-secondary-foreground", "focus:bg-muted focus:text-secondary-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", "data-[inset]:ps-8", "[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", "transition-[color,background-color,transform] duration-150 active:scale-[0.99]", isDestructive && "text-destructive focus:text-destructive focus:bg-destructive/10", className),
		render,
		...props,
		children: [
			icon && /* @__PURE__ */ jsx("span", {
				className: cn("size-4 shrink-0 transition-colors duration-150", isDestructive ? "text-destructive" : "text-quaternary-foreground group-focus/dropdown-menu-item:text-secondary-foreground"),
				children: icon
			}),
			/* @__PURE__ */ jsx("span", {
				className: "flex-1",
				children
			}),
			shortcut && /* @__PURE__ */ jsx(DropdownMenuShortcutBadge, {
				className: "transition-colors duration-150 group-focus/dropdown-menu-item:bg-brand-500/10 group-focus/dropdown-menu-item:text-brand-600",
				children: shortcut
			})
		]
	});
}
DropdownMenuItem.displayName = "DropdownMenu.Item";
/**
* Enhanced DropdownMenuSeparator
*/
function DropdownMenuSeparator({ className, ...props }) {
	return /* @__PURE__ */ jsx(Menu$1.Separator, {
		"data-slot": "dropdown-menu-separator",
		className: cn("my-1 h-px bg-surface-2", className),
		...props
	});
}
DropdownMenuSeparator.displayName = "DropdownMenu.Separator";
/**
* Container for menu items with proper padding
*/
function DropdownMenuItems({ className, children, ...props }) {
	return /* @__PURE__ */ jsx("div", {
		"data-slot": "dropdown-menu-items",
		className: cn("py-1", className),
		...props,
		children
	});
}
DropdownMenuItems.displayName = "DropdownMenu.Items";
/**
* Styled shortcut badge that matches Figma design (uses Kbd wrapper)
*/
function DropdownMenuShortcutBadge({ className, children, ...props }) {
	return /* @__PURE__ */ jsx(Kbd, {
		variant: "outline",
		size: "xs",
		className,
		...props,
		children
	});
}
DropdownMenuShortcutBadge.displayName = "DropdownMenu.ShortcutBadge";
/**
* Simplified DropdownMenu component with explicit trigger prop.
* Prevents nested button hydration errors by using base-ui's render prop.
*
* @example
* <SimpleDropdownMenu trigger={<Button>Menu</Button>}>
*   <DropdownMenu.Popup>
*     <DropdownMenu.Items>
*       <DropdownMenu.Item>Option 1</DropdownMenu.Item>
*     </DropdownMenu.Items>
*   </DropdownMenu.Popup>
* </SimpleDropdownMenu>
*/
function SimpleDropdownMenu({ trigger, open, onOpenChange, children }) {
	return /* @__PURE__ */ jsxs(DropdownMenuRoot, {
		open,
		onOpenChange,
		children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: trigger }), children]
	});
}
SimpleDropdownMenu.displayName = "DropdownMenu.Simple";
var DropdownMenu = Object.assign(DropdownMenuRoot, {
	Root: DropdownMenuRoot,
	Portal: DropdownMenuPortal,
	Trigger: DropdownMenuTrigger,
	Popup: DropdownMenuPopup,
	Group: DropdownMenuGroup,
	Label: DropdownMenuLabel,
	Item: DropdownMenuItem,
	CheckboxItem: DropdownMenuCheckboxItem,
	RadioGroup: DropdownMenuRadioGroup,
	RadioItem: DropdownMenuRadioItem,
	Separator: DropdownMenuSeparator,
	Shortcut: DropdownMenuShortcut,
	ShortcutBadge: DropdownMenuShortcutBadge,
	Sub: DropdownMenuSub,
	SubTrigger: DropdownMenuSubTrigger,
	SubPopup: DropdownMenuSubPopup,
	Header: DropdownMenuHeader,
	Items: DropdownMenuItems,
	Simple: SimpleDropdownMenu
});
//#endregion
export { DropdownMenu };

//# sourceMappingURL=index461.js.map