@cerberus-design/react
Version:
The Cerberus Design React component library.
41 lines (39 loc) • 1.21 kB
JavaScript
import {
MatchAvatar
} from "./chunk-3NPWHL5X.js";
import {
AdmonitionParts
} from "./chunk-76VTLS7X.js";
import {
Show
} from "./chunk-NUXMADXV.js";
import {
splitProps
} from "./chunk-BL7G3577.js";
// src/components/admonition/admonition.tsx
import { jsx, jsxs } from "react/jsx-runtime";
function Admonition(props) {
const [elProps, styleProps, rootProps] = splitProps(
props,
["heading", "icon", "children"],
["palette", "usage"]
);
return /* @__PURE__ */ jsxs(AdmonitionParts.Root, { ...styleProps, ...rootProps, children: [
/* @__PURE__ */ jsx(
Show,
{
when: elProps.icon,
fallback: /* @__PURE__ */ jsx(MatchAvatar, { palette: styleProps.palette }),
children: /* @__PURE__ */ jsx(AdmonitionParts.Indicator, { children: elProps.icon })
}
),
/* @__PURE__ */ jsxs(AdmonitionParts.Content, { children: [
/* @__PURE__ */ jsx(Show, { when: elProps.heading, children: /* @__PURE__ */ jsx(AdmonitionParts.Heading, { children: elProps.heading }) }),
/* @__PURE__ */ jsx(AdmonitionParts.Description, { children: elProps.children })
] })
] });
}
export {
Admonition
};
//# sourceMappingURL=chunk-C7XAB665.js.map