{"version":3,"file":"FileUploadField.BKb9BQ-2.mjs","names":["React.useId","React.useState"],"sources":["https:/framerusercontent.com/modules/nWVtnwL5RZ4ZIWhlRmYD/wB9m8BG1H4CrBnzvG4D8/FileUploadField.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function FileUploadField(props){const{label,fieldName,helperText,buttonText,accept,multiple,required,background,borderColor,focusColor,textColor,mutedColor}=props;const inputId=React.useId();const[fileLabel,setFileLabel]=React.useState(buttonText);return /*#__PURE__*/_jsxs(\"label\",{style:{...styles.wrapper,color:textColor},htmlFor:inputId,children:[/*#__PURE__*/_jsx(\"span\",{style:styles.label,children:label}),/*#__PURE__*/_jsx(\"input\",{id:inputId,name:fieldName||\"fichier\",type:\"file\",accept:accept||undefined,multiple:multiple,required:required,style:{...styles.input,background,borderColor,color:mutedColor,outlineColor:focusColor},onChange:event=>{const files=Array.from(event.currentTarget.files||[]);if(!files.length){setFileLabel(buttonText);}else if(files.length===1){setFileLabel(files[0].name);}else{setFileLabel(String(files.length)+\" fichiers s\\xe9lectionn\\xe9s\");}},\"aria-label\":label}),/*#__PURE__*/_jsx(\"span\",{style:{...styles.helper,color:mutedColor},children:helperText}),/*#__PURE__*/_jsx(\"span\",{style:{...styles.fakeButton,borderColor,color:textColor},children:fileLabel})]});}const styles={wrapper:{position:\"relative\",width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:8,fontFamily:\"Inter, sans-serif\",boxSizing:\"border-box\"},label:{fontSize:14,lineHeight:\"1.2em\",fontWeight:700},input:{width:\"100%\",minHeight:52,border:\"1px solid\",borderRadius:10,padding:14,fontFamily:\"Inter, sans-serif\",fontSize:15,lineHeight:\"1.2em\",boxSizing:\"border-box\",cursor:\"pointer\"},helper:{fontSize:13,lineHeight:\"1.35em\",fontWeight:400},fakeButton:{display:\"none\"}};addPropertyControls(FileUploadField,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Ajouter un fichier\"},fieldName:{type:ControlType.String,title:\"Name\",defaultValue:\"fichier\"},helperText:{type:ControlType.String,title:\"Aide\",displayTextArea:true,defaultValue:\"Plaque signal\\xe9tique, facture, photo de la pi\\xe8ce ou tout autre document utile.\"},buttonText:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Choisir un fichier\"},accept:{type:ControlType.String,title:\"Formats\",defaultValue:\".pdf,.jpg,.jpeg,.png,.webp\"},multiple:{type:ControlType.Boolean,title:\"Multiple\",defaultValue:true},required:{type:ControlType.Boolean,title:\"Obligatoire\",defaultValue:false},background:{type:ControlType.Color,title:\"Fond\",defaultValue:\"rgb(248, 249, 251)\"},borderColor:{type:ControlType.Color,title:\"Bordure\",defaultValue:\"rgba(0, 28, 58, 0.14)\"},focusColor:{type:ControlType.Color,title:\"Focus\",defaultValue:\"rgba(0, 153, 255, 1)\"},textColor:{type:ControlType.Color,title:\"Texte\",defaultValue:\"rgb(0, 28, 58)\"},mutedColor:{type:ControlType.Color,title:\"Secondaire\",defaultValue:\"rgba(0, 28, 58, 0.62)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FileUploadField\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FileUploadField.map"],"mappings":"wLAGG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,YAAU,aAAW,aAAW,SAAO,WAAS,WAAS,aAAW,cAAY,aAAW,YAAU,cAAY,EAAY,EAAQA,EAAY,EAAO,CAAC,EAAU,GAAcC,EAAe,CAAU,EAAE,OAAoB,EAAM,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAO,QAAQ,MAAM,CAAS,EA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