import React from 'react'; import { useStyles } from '../../core/hooks/useStyles'; import { useTheme } from '../../core/theme/ThemeProvider'; interface CheckboxProps extends React.InputHTMLAttributes { label?: string; } export const Checkbox: React.FC = ({ label, id, className = '', checked, disabled, ...props }) => { const { theme } = useTheme(); const createStyle = useStyles('checkbox'); const containerClass = createStyle({ display: 'grid', gridTemplateColumns: 'auto 1fr', gap: theme.spacing.sm, alignItems: 'center', cursor: disabled ? 'not-allowed' : 'pointer', userSelect: 'none', opacity: disabled ? 0.6 : 1, }); const customCheckboxClass = createStyle({ width: '18px', height: '18px', border: '2px solid', borderRadius: '4px', display: 'grid', placeContent: 'center', transition: 'all 0.2s', backgroundColor: checked ? theme.colors.primary : 'transparent', borderColor: checked ? theme.colors.primary : theme.colors.border, }); const inputClass = createStyle({ position: 'absolute', opacity: 0, height: 0, width: 0, '&:focus-visible + div': { boxShadow: `0 0 0 2px ${theme.colors.background}, 0 0 0 4px ${theme.colors.primary}`, } }); return ( ); };