UNPKG

@primer/react-brand

Version:

Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.

51 lines (50 loc) 1.77 kB
import e from "../../node_modules/clsx/dist/clsx.js"; import { Text as t } from "../../Text/Text.js"; import { CheckIcon as n, DashIcon as r, XIcon as i } from "../../node_modules/@primer/octicons-react/dist/index.esm.js"; import { ListContext as a } from "../listContext.js"; import o from "./ListItem.module.js"; import { useContext as s } from "react"; import { jsx as c, jsxs as l } from "react/jsx-runtime"; //#region src/list/ListItem/ListItem.tsx function u({ className: u, children: d, leadingVisualFill: f, leadingVisual: p, leadingVisualAriaLabel: m, variant: h = "default", ...g }) { let { variant: _ } = s(a), v = () => { let t = { fill: f, "aria-label": m, ...f && { style: { fill: f } } }; if (p) return /* @__PURE__ */ c(p, { className: e(o["ListItem__leading-visual"], !f && o["ListItem__leading-visual--muted"]), ...t }); switch (_) { case "checked": return /* @__PURE__ */ c(n, { className: e(o["ListItem__leading-visual"], o.ListItem__checked, !f && o["ListItem__leading-visual--muted"]), ...t }); case "x": return /* @__PURE__ */ c(i, { className: e(o["ListItem__leading-visual"], o.ListItem__x, !f && o["ListItem__leading-visual--muted"]), ...t }); case "default": return /* @__PURE__ */ c(r, { className: e(o["ListItem__leading-visual"], o.ListItem__default, !f && o["ListItem__leading-visual--muted"]), ...t }); default: return null; } }; return /* @__PURE__ */ l("li", { className: e(o.ListItem, !_ && o.OrderedList__item, u), ...g, children: [v(), /* @__PURE__ */ c(t, { as: "span", variant: h, className: e(o[`ListItem--${h}`]), children: d })] }); } var d = Object.assign(u); //#endregion export { d as ListItem }; //# sourceMappingURL=ListItem.js.map