{"version":3,"sources":["../../src/components/Checkbox/index.tsx"],"names":["forwardRef","styles","jsx","jsxs","Checkbox","label","description","error","size","id","inputProps","ref","FormField","clsx_m_default","UnstyledInput"],"mappings":"wNACA,OAAS,cAAAA,MAAkB,QAK3B,OAAOC,MAAY,uBAsBX,OAGE,OAAAC,EAHF,QAAAC,MAAA,oBAVD,IAAMC,EAAWJ,EACtB,CAAC,CAAE,MAAAK,EAAO,YAAAC,EAAa,MAAAC,EAAO,KAAAC,EAAO,KAAM,GAAAC,EAAI,GAAGC,CAAW,EAAGC,IAE5DT,EAACU,EAAA,CACC,MAAOP,EACP,YAAaC,EACb,MAAOC,EACP,GAAIE,EACJ,OAAM,GAEN,SAAAN,EAAC,OACC,UAAWU,EAAKZ,EAAO,MAAOO,IAAS,MAAQP,EAAO,KAAKO,GAAM,CAAC,EAElE,UAAAN,EAACY,EAAA,CAAc,KAAK,WAAY,GAAGJ,EAAY,IAAKC,EAAK,EACzDT,EAAC,OAAI,UAAWD,EAAO,OAAQ,EAC/BC,EAACU,EAAU,MAAV,EAAgB,EACjBV,EAACU,EAAU,MAAV,EAAgB,GACnB,EACF,CAGN,EAEAR,EAAS,YAAc","sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\n\nimport { FormField, FormFieldProps } from \"../FormField\";\nimport { UnstyledInput } from \"../UnstyledInput\";\n\nimport styles from \"./styles.module.scss\";\n\nexport type CheckboxSize = \"sm\" | \"md\" | \"lg\";\n\ntype NativeProps = Omit<JSX.IntrinsicElements[\"input\"], \"size\">;\n\nexport type CheckboxProps = {\n  size?: CheckboxSize;\n  label: string;\n} & NativeProps &\n  Pick<Partial<FormFieldProps>, \"description\" | \"error\">;\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n  ({ label, description, error, size = \"md\", id, ...inputProps }, ref) => {\n    return (\n      <FormField\n        label={label}\n        description={description}\n        error={error}\n        id={id}\n        custom\n      >\n        <div\n          className={clsx(styles.Block, size !== \"md\" && styles[`--${size}`])}\n        >\n          <UnstyledInput type=\"checkbox\" {...inputProps} ref={ref} />\n          <div className={styles.marker} />\n          <FormField.Label />\n          <FormField.Error />\n        </div>\n      </FormField>\n    );\n  }\n);\n\nCheckbox.displayName = \"Checkbox\";\n"]}