{"version":3,"file":"FormValidation.BFKqO6gO.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/pRsXs0qHUApyBmOHtXTS/fHZxpr9b9OpljDs8xOXl/FormValidation.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function withFormValidation(Component){return props=>{const[variant,setVariant]=useState(\"Primary\");useEffect(()=>{// Reset variant when component mounts\nsetVariant(\"Primary\");},[]);const handleSubmit=e=>{const form=e.target;// Check if form is valid\nif(!form.checkValidity()){e.preventDefault();e.stopPropagation();setVariant(\"Error\");return false;}// If valid, continue with normal submit\nsetVariant(\"Primary\");};const handleChange=()=>{// Reset to Primary when user types\nif(variant===\"Error\"){setVariant(\"Primary\");}};return /*#__PURE__*/_jsx(Component,{...props,variant:variant,onSubmit:handleSubmit,onChange:handleChange});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFormValidation\":{\"type\":\"reactHoc\",\"name\":\"withFormValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormValidation.map"],"mappings":"yHAAiF,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAS,UAAU,CAAC,MAAc,CAC1M,EAAW,UAAU,EAAG,EAAE,CAAC,CAAC,IAAM,EAAa,GAAG,CAClD,GAAG,CAD2D,EAAE,OACvD,eAAe,CAA6D,OAA3D,EAAE,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,EAAW,QAAQ,CAAQ,GAC5F,EAAW,UAAU,EAAS,MAAiB,CAC5C,IAAU,SAAS,EAAW,UAAU,EAAI,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAc,UAAQ,SAAS,EAAa,SAAS,EAAa,CAAC,mBAJ9G,IAAsC"}