@payfit/unity-components
Version:
54 lines (53 loc) • 1.5 kB
JavaScript
import { useMenuContext as e } from "../Menu.context.js";
import { MenuSeparator as t } from "./MenuSeparator.js";
import { uyTv as n } from "@payfit/unity-themes";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
import { MenuSection as a } from "react-aria-components/Menu";
import { Header as o } from "react-aria-components/Header";
import { Collection as s } from "react-aria-components/Collection";
//#region src/core/components/menu/parts/MenuSection.tsx
var c = n({
slots: {
base: ["uy:group/menu-section uy:w-full"],
header: ["uy:w-full uy:overflow-clip uy:px-150 uy:py-125 uy:sm:py-100 uy:typography-body-strong uy:text-content-neutral-enabled"]
},
variants: {
compact: {
true: { header: "uy:px-100 uy:py-100 uy:sm:py-50" },
false: { header: "" }
},
isTitleHidden: {
true: { header: "uy:sr-only" },
false: { header: "" }
}
},
defaultVariants: {
compact: !1,
isTitleHidden: !1
}
});
function l({ children: n, items: l, className: u, title: d, isTitleHidden: f, withDivider: p = !1, ...m }) {
let { compact: h } = e(), { base: g, header: _ } = c({
isTitleHidden: f,
compact: h
});
return /* @__PURE__ */ i(a, {
...m,
"data-compact": h || void 0,
className: g({ className: u }),
children: [
/* @__PURE__ */ r(o, {
className: _(),
children: d
}),
/* @__PURE__ */ r(s, {
items: l,
children: n
}),
p && /* @__PURE__ */ r(t, {})
]
});
}
l.displayName = "MenuSection";
//#endregion
export { l as MenuSection };