{"version":3,"file":"SelectorContato.YoGFGFU2.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/qbAG5Fbh2FFfLUSNqHB6/WfuuJol5Re3zcPTv9gMW/SelectorContato.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function PackagingSelector(props){const{label,name,id,fontFamily,fontSize,labelFontSize,labelColor,labelFontWeight,dropdownColor,dropdownBorderRadius,placeholderColor,textColor,isRequired,products,minQuantities,onSelect}=props;const[selectedOption,setSelectedOption]=useState(\"\");const[selectedText,setSelectedText]=useState(\"\");const[hasError,setHasError]=useState(false);// Convert minQuantities (string array) into a mapping object\nconst minQuantityMap={};products.forEach((product,index)=>{minQuantityMap[product]=minQuantities[index]||\"\";});// 🔹 Handle selection\nconst handleSelect=event=>{const value=event.target.value;setSelectedOption(value);setSelectedText(minQuantityMap[value]||\"\");setHasError(false)// Clear error when user selects a value\n;onSelect&&onSelect(value);};// 🔹 Validate selection on blur\nconst handleBlur=()=>{if(isRequired&&!selectedOption){setHasError(true);}};const styles={container:{display:\"flex\",flexDirection:\"column\",gap:\"10px\"},label:{fontFamily:fontFamily,fontSize:`${labelFontSize}px`,color:labelColor,fontWeight:labelFontWeight},customSelectWrapper:{position:\"relative\",width:\"100%\"},customSelect:{width:\"100%\",padding:\"8px\",fontFamily:fontFamily,fontSize:`${fontSize}px`,color:selectedOption?textColor:placeholderColor,backgroundColor:dropdownColor,border:hasError?\"2px solid red\":\"1px solid #ccc\",borderRadius:`${dropdownBorderRadius}px`,cursor:\"pointer\",appearance:\"none\"},arrowDown:{position:\"absolute\",right:\"10px\",top:\"50%\",transform:\"translateY(-50%)\",pointerEvents:\"none\",fontSize:\"14px\",color:\"#666\"},errorText:{fontSize:\"12px\",color:\"red\"},minQuantityText:{fontSize:\"14px\",color:\"#555\",fontStyle:\"italic\",whiteSpace:\"pre-line\"}};return /*#__PURE__*/_jsxs(\"div\",{style:styles.container,children:[/*#__PURE__*/_jsxs(\"label\",{style:styles.label,htmlFor:id,children:[label,\" \",isRequired&&\"*\"]}),/*#__PURE__*/_jsxs(\"div\",{style:styles.customSelectWrapper,children:[/*#__PURE__*/_jsxs(\"select\",{id:id,name:name,style:styles.customSelect,value:selectedOption,onChange:handleSelect,onBlur:handleBlur,children:[/*#__PURE__*/_jsx(\"option\",{value:\"\",disabled:true,children:\"Selecione uma embalagem\"}),products.map((product,index)=>/*#__PURE__*/_jsx(\"option\",{value:product,children:product},index))]}),/*#__PURE__*/_jsx(\"div\",{style:styles.arrowDown,children:\"▼\"})]}),hasError&&/*#__PURE__*/_jsx(\"div\",{style:styles.errorText,children:\"Este campo \\xe9 obrigat\\xf3rio.\"}),selectedOption&&/*#__PURE__*/_jsx(\"div\",{style:styles.minQuantityText,children:selectedText})]});}// 🔹 Add property controls for Framer\naddPropertyControls(PackagingSelector,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Escolha a embalagem\"},name:{type:ControlType.String,title:\"Name\",defaultValue:\"packagingSelector\"},id:{type:ControlType.String,title:\"ID\",defaultValue:\"packagingDropdown\"},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Arial\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:14},labelFontSize:{type:ControlType.Number,title:\"Label Font Size\",defaultValue:12},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#333\"},labelFontWeight:{type:ControlType.Enum,title:\"Label Font Weight\",options:[\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"],optionTitles:[\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"],defaultValue:\"400\"},dropdownColor:{type:ControlType.Color,title:\"Dropdown Background\",defaultValue:\"#FFF\"},dropdownBorderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:4},placeholderColor:{type:ControlType.Color,title:\"Placeholder Color\",defaultValue:\"#999\"},textColor:{type:ControlType.Color,title:\"Selected Text Color\",defaultValue:\"#000\"},isRequired:{type:ControlType.Boolean,title:\"Required\",defaultValue:false},products:{type:ControlType.Array,title:\"Products\",defaultValue:[\"Embalagem para delivery (praticook\\xae e outros)\",\"Embalagem para FastFood\",\"Embalagem para Sorvete (praticup\\xae)\",\"Embalagem para Acompanhamento (praticup\\xae)\",\"Embalagem para Sobremesa (praticup\\xae)\",\"Embalagem Farmac\\xeautica\",\"Embalagem Industrial\"],propertyControl:{type:ControlType.String}},minQuantities:{type:ControlType.Array,title:\"Min. Quantities\",defaultValue:[\"A quantidade m\\xednima para produ\\xe7\\xe3o \\xe9 a partir de 5.000 unidades por tamanho considerando uma \\xfanica arte. Demais embalagens delivery somente sob consulta.\",\"A quantidade m\\xednima para produ\\xe7\\xe3o \\xe9 a partir de 20.000 unidades.\",\"Potes para consumo imediato, a quantidade m\\xednima para produ\\xe7\\xe3o \\xe9 a partir de 15.000 unidades por tamanho, considerando uma \\xfanica arte.\\nPotes para venda no varejo (freezer), a quantidade m\\xednima para produ\\xe7\\xe3o \\xe9 de 30.000 unidades por tamanho, considerando diferentes artes em uma produ\\xe7\\xe3o.\",\"Mesma regra da embalagem de sorvete.\",\"Mesma regra da embalagem de sorvete.\",\"A quantidade m\\xednima para produ\\xe7\\xe3o \\xe9 a partir de 10.000 unidades, dependendo do tipo de cartucho e acabamentos.\",\"A quantidade m\\xednima para produ\\xe7\\xe3o \\xe9 a partir de 10.000 unidades, dependendo do tipo de cartucho e acabamentos.\"],propertyControl:{type:ControlType.String}},onSelect:{type:ControlType.EventHandler,title:\"On Select\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"PackagingSelector\":{\"type\":\"reactComponent\",\"name\":\"PackagingSelector\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SelectorContato.map"],"mappings":"iLAAyI,SAAgB,EAAkB,EAAM,CAAC,GAAK,CAAC,QAAM,OAAK,KAAG,aAAW,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