You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

is-filled-picker.tsx 852B

1234567891011121314151617181920212223242526272829
  1. import * as Checkbox from '@radix-ui/react-checkbox'
  2. import { CheckIcon } from '@radix-ui/react-icons'
  3. import { strokes } from 'lib/shape-styles'
  4. import { Square } from 'react-feather'
  5. import { IconWrapper, RowButton } from '../shared'
  6. interface Props {
  7. isFilled: boolean
  8. onChange: (isFilled: boolean) => void
  9. }
  10. export default function IsFilledPicker({ isFilled, onChange }: Props) {
  11. return (
  12. <Checkbox.Root
  13. as={RowButton}
  14. bp={{ '@initial': 'mobile', '@sm': 'small' }}
  15. checked={isFilled}
  16. onCheckedChange={(e: React.ChangeEvent<HTMLInputElement>) =>
  17. onChange(e.currentTarget.checked)
  18. }
  19. >
  20. <label htmlFor="fill">Fill</label>
  21. <IconWrapper>
  22. {isFilled || <Square stroke={strokes.Black} />}
  23. <Checkbox.Indicator as={CheckIcon} />
  24. </IconWrapper>
  25. </Checkbox.Root>
  26. )
  27. }