UNPKG

@stratakit/react

Version:

A React component library for StrataKit

29 lines (28 loc) 1 kB
import { jsx, jsxs } from "react/jsx-runtime"; import * as React from "react"; import { Field, Checkbox as SkCheckbox } from "@stratakit/bricks"; import { useCompatProps } from "./~utils.js"; const Checkbox = React.forwardRef((props, forwardedRef) => { const { label, wrapperProps, labelProps, // biome-ignore-start lint/correctness/noUnusedVariables: NOT IMPLEMENTED indeterminate, status, variant, isLoading, // biome-ignore-end lint/correctness/noUnusedVariables: NOT IMPLEMENTED ...rest } = useCompatProps(props); if (label) { return /* @__PURE__ */ jsxs(Field.Root, { render: /* @__PURE__ */ jsx(Field.Label, { ...wrapperProps }), children: [ /* @__PURE__ */ jsx(Field.Control, { ref: forwardedRef, render: /* @__PURE__ */ jsx(SkCheckbox, { ...rest }) }), /* @__PURE__ */ jsx("span", { ...labelProps, children: label }) ] }); } return /* @__PURE__ */ jsx(SkCheckbox, { ...rest, ref: forwardedRef }); }); export { Checkbox };