UNPKG

commonux2

Version:

A collection of styled components for use in ABB projects, designed for React and Next.js. It features TypeScript support, integrates Lucide icons, and is built on Radix primitives with Tailwind CSS.

23 lines (22 loc) 1.6 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import * as React from "react"; import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; import { Check, Minus } from "lucide-react"; import { cn } from "../../lib/utils"; const Checkbox = React.forwardRef((_a, ref) => { var { className, checkedType = "full" } = _a, props = __rest(_a, ["className", "checkedType"]); return (React.createElement(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: cn("peer h-[1rem] w-[1rem] shrink-0 rounded-[2.5px] border border-neutral-300 ring-offset-background focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-none", className) }, props), React.createElement(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current") }, checkedType === "semi" ? (React.createElement(Minus, { className: "w-4 h-4", strokeWidth: 3 })) : (React.createElement(Check, { className: "w-4 h-4", strokeWidth: 3 }))))); }); Checkbox.displayName = CheckboxPrimitive.Root.displayName; export { Checkbox };