import { forwardRef } from 'react';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { Check } from 'lucide-react';
import { cn } from '../../lib/utils.js';
/**
* Accessible, design-token styled checkbox.
* Wraps Radix Checkbox so it is keyboard-accessible with a visible focus ring.
* Accepts `checked`, `onCheckedChange` (Radix) and, for convenience, `onChange`
* (called with a synthetic-ish `{ target: { checked } }`) so it can drop into
* places that previously used a bare .
*/
const Checkbox = forwardRef(function Checkbox(
{ className, onCheckedChange, onChange, ...props },
ref
) {
const handleCheckedChange = (checked) => {
onCheckedChange?.(checked);
onChange?.({ target: { checked } });
};
return (
);
});
export { Checkbox };