UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

31 lines (29 loc) 998 B
import { CheckboxIcon } from "./chunk-HYEFRC5Z.js"; import { CheckboxParts } from "./chunk-GFFIJGQC.js"; import { Text } from "./chunk-VPD3PPBW.js"; import { Show } from "./chunk-NUXMADXV.js"; // src/components/checkbox/checkbox.tsx import { jsx, jsxs } from "react/jsx-runtime"; function Checkbox(props) { const { size, children, ...rootProps } = props; return /* @__PURE__ */ jsxs(CheckboxParts.Root, { ...rootProps, children: [ /* @__PURE__ */ jsx(CheckboxParts.Control, { size, children: /* @__PURE__ */ jsx(CheckboxIcon, { indeterminate: rootProps.checked === "indeterminate" }) }), /* @__PURE__ */ jsxs(CheckboxParts.Label, { size, children: [ children, /* @__PURE__ */ jsx(Show, { when: props.required, children: /* @__PURE__ */ jsx(Text, { as: "span", "data-part": "required-indicator", children: "(required)" }) }) ] }), /* @__PURE__ */ jsx(CheckboxParts.HiddenInput, {}) ] }); } export { Checkbox }; //# sourceMappingURL=chunk-45ZTZUCD.js.map