Files
NapCatQQ/.pnpm-store/v3/files/9b/231edd9e9b3c664aa69b23a9122d14f090529939c3fdba49aef93f26ffe50ccfd7cdd19d1390450edcd746ad301e41e61798444cfae109a60aacdb44f9c3dd
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

111 lines
3.3 KiB
Plaintext

"use client";
import {
listbox_item_default
} from "./chunk-V45NB7OG.mjs";
// src/listbox-section.tsx
import { listboxSection } from "@heroui/theme";
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 { useListBoxSection } from "@react-aria/listbox";
import { jsx, jsxs } from "react/jsx-runtime";
var ListboxSection = forwardRef(
({
item,
state,
as,
variant,
color,
disableAnimation,
className,
classNames,
hideSelectedIcon,
showDivider = false,
dividerProps = {},
itemClasses,
title,
items,
...otherProps
}, _) => {
const Component = as || "li";
const slots = useMemo(() => listboxSection(), []);
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 } = useListBoxSection({
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 listboxItem = /* @__PURE__ */ jsx(
listbox_item_default,
{
classNames: itemClasses,
color,
disableAnimation,
hideSelectedIcon,
item: node,
state,
variant,
...nodeProps
},
nodeKey
);
if (node.wrapper) {
listboxItem = node.wrapper(listboxItem);
}
return listboxItem;
}),
showDivider && /* @__PURE__ */ jsx(
Divider,
{
as: "li",
className: slots.divider({
class: dividerStyles
}),
...dividerProps
}
)
]
}
)
]
},
item.key
);
}
);
ListboxSection.displayName = "HeroUI.ListboxSection";
var listbox_section_default = ListboxSection;
export {
listbox_section_default
};