UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

38 lines (37 loc) 1.42 kB
import { t as i } from "./dist-CMPkuWNy.js"; import { t as p } from "./utils-COaoD3PI.js"; import { useSelectContext as s } from "./components/Select/contexts/select.hook.js"; import { listGroupLabelVariants as m } from "./components/Select/components/List/List.variants.js"; import { additionalOptionSlotClassName as l } from "./components/Select/components/AdditionalOptions/AdditionalOptions.variants.js"; import { Fragment as c } from "react"; import { jsx as t, jsxs as u } from "react/jsx-runtime"; var N = (r) => "groupLabel" in r, f = (r) => typeof r == "object" && r !== null && "groupLabel" in r && "options" in r, j = ({ additionalOptions: r }) => { const { toggleOpen: e } = s(); return r?.length ? f(r[0]) ? r.map((o) => /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ t("li", { role: "presentation", "aria-hidden": "true", "data-action": "true", className: p(m()), children: o.groupLabel }), o.options.map((a, n) => /* @__PURE__ */ t("li", { role: "option", "data-action": "true", onClick: () => e(!1), children: /* @__PURE__ */ t(i, { className: l, children: a }) }, n))] }, o.groupLabel)) : r.map((o, a) => /* @__PURE__ */ t("li", { role: "option", "data-action": "true", onClick: () => e(!1), children: /* @__PURE__ */ t(i, { className: l, children: o }) }, a)) : null; }; export { N as n, j as t };