{"version":3,"file":"Form.mjs","names":[],"sources":["../../../../src/integrations/react-hook-form/Form.tsx"],"sourcesContent":["import {\n  type FC,\n  type FormEvent,\n  type PropsWithChildren,\n  type Ref,\n} from \"react\";\n\ntype FormProps = {\n  onSubmit?: () => void | Promise<void>;\n  ref?: Ref<HTMLFormElement>;\n} & PropsWithChildren;\n\n/**\n * ReactHookForm won't send the data over onSubmit, the form state is\n * transferred over onChange. To avoid sending unnecessary data, this RemoteForm\n * sends only the onSubmit without any formData.\n */\nexport const Form: FC<FormProps> = (props) => {\n  const { onSubmit: onSubmitFromProps, ref, ...rest } = props;\n\n  const onSubmit = async (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    await onSubmitFromProps?.();\n  };\n\n  return <form {...rest} ref={ref} onSubmit={onSubmit} />;\n};\n"],"mappings":";;;;;;;;;;AAiBA,IAAa,QAAuB,UAAU;CAC5C,MAAM,EAAE,UAAU,mBAAmB,KAAK,GAAG,SAAS;CAEtD,MAAM,WAAW,OAAO,UAAsC;EAC5D,MAAM,eAAe;EACrB,MAAM,oBAAoB;CAC5B;CAEA,OAAO,oBAAC,QAAD;EAAM,GAAI;EAAW;EAAe;CAAW,CAAA;AACxD"}