Files
NapCatQQ/.pnpm-store/v3/files/a0/d824b7b7432c3725ccf1c99c45f167655f811097e0f4367ebc8f5d80917156680571cf17383eeeb93fe8a7665ef0227160644fd7d992b4b8f2a89a94d3dff3
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

113 lines
3.3 KiB
Plaintext

"use client";
import {
menu_item_default
} from "./chunk-6GUQKX6L.mjs";
// src/menu-section.tsx
import { menuSection } from "@heroui/theme";
import { useMenuSection } from "@react-aria/menu";
import { useMemo } from "react";
import { forwardRef } from "@heroui/system";
import { mergeProps } from "@react-aria/utils";
import { clsx } from "@heroui/shared-utils";
import { Divider } from "@heroui/divider";
import { jsx, jsxs } from "react/jsx-runtime";
var MenuSection = forwardRef(
({
item,
state,
as,
variant,
color,
disableAnimation,
onAction,
closeOnSelect,
className,
classNames,
showDivider = false,
hideSelectedIcon,
dividerProps = {},
itemClasses,
title,
...otherProps
}, _) => {
const Component = as || "li";
const slots = useMemo(() => menuSection(), []);
const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);
const dividerStyles = clsx(classNames == null ? void 0 : classNames.divider, dividerProps == null ? void 0 : dividerProps.className);
const { itemProps, headingProps, groupProps } = useMenuSection({
heading: item.rendered,
"aria-label": item["aria-label"]
});
return /* @__PURE__ */ jsxs(
Component,
{
"data-slot": "base",
...mergeProps(itemProps, otherProps),
className: slots.base({ class: baseStyles }),
children: [
item.rendered && /* @__PURE__ */ jsx(
"span",
{
...headingProps,
className: slots.heading({ class: classNames == null ? void 0 : classNames.heading }),
"data-slot": "heading",
children: item.rendered
}
),
/* @__PURE__ */ jsxs(
"ul",
{
...groupProps,
className: slots.group({ class: classNames == null ? void 0 : classNames.group }),
"data-has-title": !!item.rendered,
"data-slot": "group",
children: [
[...item.childNodes].map((node) => {
const { key: nodeKey, props: nodeProps } = node;
let menuItem = /* @__PURE__ */ jsx(
menu_item_default,
{
classNames: itemClasses,
closeOnSelect,
color,
disableAnimation,
hideSelectedIcon,
item: node,
state,
variant,
onAction,
...nodeProps
},
nodeKey
);
if (node.wrapper) {
menuItem = node.wrapper(menuItem);
}
return menuItem;
}),
showDivider && /* @__PURE__ */ jsx(
Divider,
{
as: "li",
className: slots.divider({
class: dividerStyles
}),
...dividerProps
}
)
]
}
)
]
}
);
}
);
MenuSection.displayName = "HeroUI.MenuSection";
var menu_section_default = MenuSection;
export {
menu_section_default
};