{"version":3,"sources":["../../src/components/Select/index.tsx"],"names":["forwardRef","styles","jsx","Select","label","description","error","size","fill","id","className","props","forwardedRef","select","UnstyledInput","clsx_m_default","FormField"],"mappings":"wNACA,OAAS,cAAAA,MAAkB,QAO3B,OAAOC,MAAY,uBAab,cAAAC,MAAA,oBANC,IAAMC,EAASH,EACpB,CACE,CAAE,MAAAI,EAAO,YAAAC,EAAa,MAAAC,EAAO,KAAAC,EAAO,KAAM,KAAAC,EAAM,GAAAC,EAAI,UAAAC,EAAW,GAAGC,CAAM,EACxEC,IACG,CACH,IAAMC,EACJX,EAACY,EAAA,CACC,UAAU,SACV,IAAKF,EACJ,GAAGD,EACJ,UAAWI,EACTd,EAAO,MACPA,EAAO,UAAUM,GAAM,EACvBC,GAAQP,EAAO,aAAa,EAC5BS,CACF,EACF,EAGF,OAAKN,EAEHF,EAACc,EAAA,CACC,YAAaX,EACb,MAAOC,EACP,MAAOF,EACP,GAAIK,EACJ,KAAMD,EAEL,SAAAK,EACH,EAViBA,CAYrB,CACF,EAEAV,EAAO,YAAc","sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\n\nimport type { Size } from \"@camome/system\";\n\nimport { FormField, FormFieldProps } from \"../FormField\";\nimport { UnstyledInput } from \"../UnstyledInput\";\n\nimport styles from \"./styles.module.scss\";\n\ntype NativeProps = Omit<JSX.IntrinsicElements[\"select\"], \"size\" | \"ref\">;\n\nexport type SelectProps = { size?: Size; fill?: boolean } & NativeProps &\n  Pick<Partial<FormFieldProps>, \"description\" | \"error\" | \"label\">;\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n  (\n    { label, description, error, size = \"md\", fill, id, className, ...props },\n    forwardedRef\n  ) => {\n    const select = (\n      <UnstyledInput\n        component=\"select\"\n        ref={forwardedRef}\n        {...props}\n        className={clsx(\n          styles.Block,\n          styles[`Block--${size}`],\n          fill && styles[\"Block--fill\"],\n          className\n        )}\n      />\n    );\n\n    if (!label) return select;\n    return (\n      <FormField\n        description={description}\n        error={error}\n        label={label}\n        id={id}\n        fill={fill}\n      >\n        {select}\n      </FormField>\n    );\n  }\n);\n\nSelect.displayName = \"Select\";\n"]}