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

83 lines
2.2 KiB
Plaintext

"use client";
import {
useListbox
} from "./chunk-JEEKNW4E.mjs";
import {
virtualized_listbox_default
} from "./chunk-VE6UBSD2.mjs";
import {
listbox_section_default
} from "./chunk-L637PYVS.mjs";
import {
listbox_item_default
} from "./chunk-V45NB7OG.mjs";
// src/listbox.tsx
import { forwardRef } from "@heroui/system";
import { mergeProps } from "@react-aria/utils";
import { jsx, jsxs } from "react/jsx-runtime";
var Listbox = forwardRef(function Listbox2(props, ref) {
const { isVirtualized, ...restProps } = props;
const useListboxProps = useListbox({ ...restProps, ref });
const {
Component,
state,
color,
variant,
itemClasses,
getBaseProps,
topContent,
bottomContent,
hideEmptyContent,
hideSelectedIcon,
shouldHighlightOnFocus,
disableAnimation,
getEmptyContentProps,
getListProps
} = useListboxProps;
if (isVirtualized) {
return /* @__PURE__ */ jsx(virtualized_listbox_default, { ...props, ...useListboxProps });
}
const content = /* @__PURE__ */ jsxs(Component, { ...getListProps(), children: [
!state.collection.size && !hideEmptyContent && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("div", { ...getEmptyContentProps() }) }),
[...state.collection].map((item) => {
var _a;
const itemProps = {
color,
item,
state,
variant,
disableAnimation,
hideSelectedIcon,
...item.props
};
if (item.type === "section") {
return /* @__PURE__ */ jsx(listbox_section_default, { ...itemProps, itemClasses }, item.key);
}
let listboxItem = /* @__PURE__ */ jsx(
listbox_item_default,
{
...itemProps,
classNames: mergeProps(itemClasses, (_a = item.props) == null ? void 0 : _a.classNames),
shouldHighlightOnFocus
},
item.key
);
if (item.wrapper) {
listboxItem = item.wrapper(listboxItem);
}
return listboxItem;
})
] });
return /* @__PURE__ */ jsxs("div", { ...getBaseProps(), children: [
topContent,
content,
bottomContent
] });
});
var listbox_default = Listbox;
export {
listbox_default
};