@frontify/fondue
Version:
Design system of Frontify
16 lines (15 loc) • 733 B
JavaScript
import { jsx as r } from "react/jsx-runtime";
import { Section as d, Item as c } from "@react-stately/collections";
const m = (a, e) => ({
"aria-label": a,
children: e.map(({ id: t, menuItems: l, ariaLabel: o }) => /* @__PURE__ */ r(d, { title: t, "aria-label": o, children: l.map((i) => /* @__PURE__ */ r(c, { children: i.title }, i.id)) }, t))
}), p = (a) => a.flatMap(({ menuItems: e }) => e), b = (a) => a.reduce((e, t) => ({ ...e, [t.id]: t }), {}), f = (a) => new Set(
a.reduce((e, t) => [...e, t.disabled ? t.id : ""], []).filter((e) => e !== "").map((e) => e.toString())
);
export {
f as getDisabledItemIds,
b as getKeyItemRecord,
p as getMenuItems,
m as mapToAriaProps
};
//# sourceMappingURL=helper.es.js.map