{"version":3,"file":"file-button.cjs","names":["createComponent","fileButtonStyle","Button","useFileButton","useInputBorder","Portal","styled"],"sources":["../../../../src/components/file-button/file-button.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ThemeProps } from \"../../core\"\nimport type { ButtonProps } from \"../button\"\nimport type { UseInputBorderProps } from \"../input\"\nimport type { FileButtonStyle } from \"./file-button.style\"\nimport type { UseFileButtonProps } from \"./use-file-button\"\nimport { createComponent, styled } from \"../../core\"\nimport { Button } from \"../button\"\nimport { useInputBorder } from \"../input\"\nimport { Portal } from \"../portal\"\nimport { fileButtonStyle } from \"./file-button.style\"\nimport { useFileButton } from \"./use-file-button\"\n\nexport interface FileButtonProps\n  extends Omit<ButtonProps, \"defaultValue\" | \"onChange\" | \"ref\" | \"value\">,\n    UseFileButtonProps,\n    Pick<UseInputBorderProps, \"errorBorderColor\">,\n    ThemeProps<FileButtonStyle> {}\n\nconst {\n  PropsContext: FileButtonPropsContext,\n  usePropsContext: useFileButtonPropsContext,\n  withContext,\n} = createComponent<FileButtonProps, FileButtonStyle>(\n  \"file-button\",\n  fileButtonStyle,\n)\n\nexport { FileButtonPropsContext, useFileButtonPropsContext }\n\n/**\n * `FileButton` is a button component used for users to select files.\n *\n * @see https://yamada-ui.com/docs/components/file-button\n */\nexport const FileButton = withContext<\"input\", FileButtonProps>(\n  ({ as: As = Button, children, errorBorderColor, ...rest }) => {\n    const { getButtonProps, getInputProps } = useFileButton(rest)\n    const varProps = useInputBorder({ errorBorderColor })\n\n    return (\n      <>\n        <Portal>\n          <styled.input {...getInputProps()} />\n        </Portal>\n\n        <As {...varProps} {...getButtonProps()}>\n          {children}\n        </As>\n      </>\n    )\n  },\n)()\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,EACJ,cAAc,wBACd,iBAAiB,2BACjB,gBACEA,yCACF,eACAC,0CACD;;;;;;AASD,MAAa,aAAa,aACvB,EAAE,IAAI,KAAKC,uBAAQ,UAAU,iBAAkB,GAAG,WAAW;CAC5D,MAAM,EAAE,gBAAgB,kBAAkBC,sCAAc,KAAK;CAC7D,MAAM,WAAWC,wCAAe,EAAE,kBAAkB,CAAC;AAErD,QACE,qFACE,2CAACC,mCACC,2CAACC,uBAAO,SAAM,GAAI,eAAe,GAAI,GAC9B,EAET,2CAAC;EAAG,GAAI;EAAU,GAAI,gBAAgB;EACnC;GACE,IACJ;EAGR,EAAE"}