UNPKG

@payfit/unity-components

Version:

41 lines (40 loc) 1.1 kB
import { forwardRef as e } from "react"; import { uyTv as t } from "@payfit/unity-themes"; import { jsx as n } from "react/jsx-runtime"; import { ListBox as r } from "react-aria-components/ListBox"; import { ListLayout as i, Virtualizer as a } from "react-aria-components/Virtualizer"; //#region src/components/list-view/ListView.tsx var o = t({ base: [ "uy:pb-500 uy:data-[empty=true]:pb-0", "uy:[&_[data-unity-slot=\"ListViewSection\"]]:pb-300", "uy:[&_[data-unity-slot=\"ListViewSection\"]:last-child]:pb-0" ] }), s = { layout: i, layoutOptions: { estimatedRowHeight: 56, estimatedHeadingHeight: 24, gap: 0, padding: 0 } }, c = e((e, t) => { let { children: i, enableVirtualization: c, className: l, ...u } = e, d = o({ className: l }); return c ? /* @__PURE__ */ n(a, { ...s, children: /* @__PURE__ */ n(r, { ...u, ref: t, "data-dd-privacy": "show", className: d, children: i }) }) : /* @__PURE__ */ n(r, { ...u, ref: t, "data-dd-privacy": "show", className: d, children: i }); }); c.displayName = "ListView"; //#endregion export { c as ListView };