31 lines
621 B
TypeScript
31 lines
621 B
TypeScript
import type { CheckboxProps } from "$/types/InputTypes";
|
|
import clsx from "clsx";
|
|
import { forwardRef } from "react";
|
|
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
|
|
|
|
|
const LightCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
|
className,
|
|
box = true,
|
|
...props
|
|
}, ref) => {
|
|
return (
|
|
<MattrixwvCheckbox
|
|
className={clsx(
|
|
className,
|
|
{
|
|
"group-data-checked:bg-light group-data-checked:stroke-dark": box,
|
|
"group-data-checked:stroke-light": !box
|
|
}
|
|
)}
|
|
box={box}
|
|
{...props}
|
|
ref={ref}
|
|
/>
|
|
);
|
|
});
|
|
|
|
LightCheckbox.displayName = "LightCheckbox";
|
|
|
|
export default LightCheckbox;
|