{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/QSNKggqrGuTGRe9QbsBD/KlZiiIcfwYgfTmpO6Aak/TagInput.js"],
  "sourcesContent": ["// TagInput (Pill Tag) component for Framer Desktop\n// Features: 3 pill tags, ognuno editabile, colori personalizzabili, shadow opzionale, responsive wrapping, accessibilit\u00E0, props per testo/colore, senza maxTags, senza CMS\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * TagInput\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TagInput(props){const{tag1,tag2,tag3,tag1Background,tag2Background,tag3Background,tag1TextColor,tag2TextColor,tag3TextColor,showTags=true,showTag1=true,showTag2=true,showTag3=true,style,onTagChange}=props;const[tags,setTags]=useState([{label:tag1,backgroundColor:tag1Background,textColor:tag1TextColor,show:showTag1},{label:tag2,backgroundColor:tag2Background,textColor:tag2TextColor,show:showTag2},{label:tag3,backgroundColor:tag3Background,textColor:tag3TextColor,show:showTag3}]);const[editIndex,setEditIndex]=useState(-1);const[editValue,setEditValue]=useState(\"\");const inputRef=useRef(null);useEffect(()=>{setTags([{label:tag1,backgroundColor:tag1Background,textColor:tag1TextColor,show:showTag1},{label:tag2,backgroundColor:tag2Background,textColor:tag2TextColor,show:showTag2},{label:tag3,backgroundColor:tag3Background,textColor:tag3TextColor,show:showTag3}]);},[tag1,tag2,tag3,tag1Background,tag2Background,tag3Background,tag1TextColor,tag2TextColor,tag3TextColor,showTag1,showTag2,showTag3]);useEffect(()=>{if(typeof onTagChange===\"function\")onTagChange(tags);// eslint-disable-next-line\n},[JSON.stringify(tags)]);useEffect(()=>{if(editIndex!==-1&&inputRef.current){inputRef.current.focus();}},[editIndex]);function handleEdit(idx){setEditIndex(idx);setEditValue(tags[idx].label);}function handleEditChange(e){setEditValue(e.target.value);}function handleEditSubmit(idx){if(!editValue.trim())return;const newTags=tags.slice();newTags[idx].label=editValue.trim();startTransition(()=>{setTags(newTags);setEditIndex(-1);setEditValue(\"\");});}function handleEditKeyDown(e,idx){if(e.key===\"Enter\"){handleEditSubmit(idx);}else if(e.key===\"Escape\"){setEditIndex(-1);setEditValue(\"\");}}if(!showTags)return null;return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:style?.width||\"100%\",minHeight:48,display:\"flex\",flexWrap:\"wrap\",gap:12,alignItems:\"center\",background:\"transparent\",padding:0,boxSizing:\"border-box\"},role:\"list\",\"aria-label\":\"Tag list\",children:tags.map((tag,idx)=>{if(!tag.show)return null;const isEditing=editIndex===idx;return /*#__PURE__*/_jsx(\"div\",{tabIndex:0,\"aria-label\":tag.label,role:\"listitem\",style:{display:\"flex\",alignItems:\"center\",background:tag.backgroundColor||\"#fff\",color:tag.textColor||\"#222\",borderRadius:999,padding:\"8px 20px\",fontSize:16,fontWeight:500,boxShadow:\"0 2px 12px rgba(0,0,0,0.10)\",minWidth:48,maxWidth:240,whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\",margin:0,transition:\"box-shadow 0.2s\",userSelect:\"none\",outline:isEditing?\"2px solid #1976d2\":\"none\"},onDoubleClick:()=>handleEdit(idx),onKeyDown:e=>{if(e.key===\"Enter\")handleEdit(idx);},children:tag.label},idx);})});}addPropertyControls(TagInput,{tag1:{type:ControlType.String,title:\"Tag 1\",defaultValue:\"Ultimi posti disponibili\",setVariable:true},tag1Background:{type:ControlType.Color,title:\"Tag 1 BG\",defaultValue:\"#fff\"},tag1TextColor:{type:ControlType.Color,title:\"Tag 1 Text\",defaultValue:\"#1a237e\"},tag2:{type:ControlType.String,title:\"Tag 2\",defaultValue:\"Aperti a tutti\",setVariable:true},tag2Background:{type:ControlType.Color,title:\"Tag 2 BG\",defaultValue:\"#e3f2fd\"},tag2TextColor:{type:ControlType.Color,title:\"Tag 2 Text\",defaultValue:\"#1565c0\"},tag3:{type:ControlType.String,title:\"Tag 3\",defaultValue:\"Gratuito\",setVariable:true},tag3Background:{type:ControlType.Color,title:\"Tag 3 BG\",defaultValue:\"#c8e6c9\"},tag3TextColor:{type:ControlType.Color,title:\"Tag 3 Text\",defaultValue:\"#256029\"},showTags:{type:ControlType.Boolean,title:\"Mostra Tutti i Tag\",defaultValue:true,enabledTitle:\"Mostra\",disabledTitle:\"Nascondi\"},showTag1:{type:ControlType.Boolean,title:\"Mostra Tag 1\",defaultValue:true,enabledTitle:\"Mostra\",disabledTitle:\"Nascondi\"},showTag2:{type:ControlType.Boolean,title:\"Mostra Tag 2\",defaultValue:true,enabledTitle:\"Mostra\",disabledTitle:\"Nascondi\"},showTag3:{type:ControlType.Boolean,title:\"Mostra Tag 3\",defaultValue:true,enabledTitle:\"Mostra\",disabledTitle:\"Nascondi\"},onTagChange:{type:ControlType.EventHandler,title:\"On Tag Change\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TagInput\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TagInput.map"],
  "mappings": "yJAAAA,IAOkB,SAARC,EAA0BC,EAAM,CAAC,GAAK,CAAC,KAAAC,EAAK,KAAAC,EAAK,KAAAC,EAAK,eAAAC,EAAe,eAAAC,EAAe,eAAAC,EAAe,cAAAC,EAAc,cAAAC,EAAc,cAAAC,EAAc,SAAAC,EAAS,GAAK,SAAAC,EAAS,GAAK,SAAAC,EAAS,GAAK,SAAAC,EAAS,GAAK,MAAAC,EAAM,YAAAC,CAAW,EAAEf,EAAW,CAACgB,EAAKC,CAAO,EAAEC,EAAS,CAAC,CAAC,MAAMjB,EAAK,gBAAgBG,EAAe,UAAUG,EAAc,KAAKI,CAAQ,EAAE,CAAC,MAAMT,EAAK,gBAAgBG,EAAe,UAAUG,EAAc,KAAKI,CAAQ,EAA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,CAAC,KAAKA,EAAY,MAAM,MAAM,WAAW,aAAa,SAAS,EAAE,cAAc,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,MAAM,QAAQ,aAAa,WAAW,YAAY,EAAI,EAAE,eAAe,CAAC,KAAKA,EAAY,MAAM,MAAM,WAAW,aAAa,SAAS,EAAE,cAAc,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,EAAE,SAAS,CAAC,KAAKA,EAAY,QAAQ,MAAM,qBAAqB,aAAa,GAAK,aAAa,SAAS,cAAc,UAAU,EAAE,SAAS,CAAC,KAAKA,EAAY,QAAQ,MAAM,eAAe,aAAa,GAAK,aAAa,SAAS,cAAc,UAAU,EAAE,SAAS,CAAC,KAAKA,EAAY,QAAQ,MAAM,eAAe,aAAa,GAAK,aAAa,SAAS,cAAc,UAAU,EAAE,SAAS,CAAC,KAAKA,EAAY,QAAQ,MAAM,eAAe,aAAa,GAAK,aAAa,SAAS,cAAc,UAAU,EAAE,YAAY,CAAC,KAAKA,EAAY,aAAa,MAAM,eAAe,CAAC,CAAC",
  "names": ["init_ssg_sandbox_shims", "TagInput", "props", "tag1", "tag2", "tag3", "tag1Background", "tag2Background", "tag3Background", "tag1TextColor", "tag2TextColor", "tag3TextColor", "showTags", "showTag1", "showTag2", "showTag3", "style", "onTagChange", "tags", "setTags", "ye", "editIndex", "setEditIndex", "editValue", "setEditValue", "inputRef", "pe", "ue", "handleEdit", "idx", "handleEditChange", "e", "handleEditSubmit", "newTags", "Z", "handleEditKeyDown", "p", "tag", "isEditing", "addPropertyControls", "ControlType"]
}
