@cerberus-design/react
Version:
The Cerberus Design React component library.
27 lines (24 loc) • 621 B
JavaScript
import { jsx } from 'react/jsx-runtime';
import { cerberus } from '../../system/index.js';
function Text(props) {
const { as = "p", ...elProps } = props;
const cache = {
h1: cerberus.h1,
h2: cerberus.h2,
h3: cerberus.h3,
h4: cerberus.h4,
h5: cerberus.h5,
h6: cerberus.h6,
strong: cerberus.strong,
em: cerberus.em,
small: cerberus.small,
span: cerberus.span,
p: cerberus.p
};
if (as in cache) {
const Component = cache[as];
return /* @__PURE__ */ jsx(Component, { ...elProps });
}
return /* @__PURE__ */ jsx(cerberus.p, { ...elProps });
}
export { Text };