UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

23 lines (18 loc) 752 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const jsxRuntime = require('react/jsx-runtime'); const primitives = require('./primitives.cjs'); const closable = require('./closable.cjs'); function isClosableTag(props) { return "onClick" in props && typeof props.onClick !== "undefined"; } function Tag(props) { const { children } = props; if (isClosableTag(props)) { const { onClick, ...rootProps2 } = props; return /* @__PURE__ */ jsxRuntime.jsx(closable.ClosableTag, { onClick, ...rootProps2, children }); } const rootProps = props; return /* @__PURE__ */ jsxRuntime.jsx(primitives.TagRoot, { "data-palette": rootProps.palette ?? "page", ...rootProps, children }); } exports.Tag = Tag;