{"version":3,"file":"HighlightText.NEELCM-j.mjs","names":["useId","_Fragment"],"sources":["https:/framerusercontent.com/modules/KJM1vkNhNC8tZNdYD54Z/x67F2mhvnwBb6Guh2oHG/HighlightText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useId}from\"react\";/**\n * Highlight Text — ZDC Restaurant Consulting\n * Titolo con UNA parola in colore diverso, che funziona PER LOCALE.\n *\n * IL PROBLEMA CHE RISOLVE\n * In Framer il colore su una parola e' un segmento inline ancorato al testo\n * della lingua base (ES). La localizzazione EN traduce il testo ma NON porta\n * il segmento: o sbaglia parola o colora tutta la frase. Qui invece testo e\n * parola-da-colorare sono DUE prop stringa: Framer le localizza entrambe\n * indipendentemente, quindi in EN scegli una parola diversa e un testo diverso.\n *\n *   ES: text \"Restaurantes rentables...\"  highlight \"rentables\"\n *   EN: text \"Profitable restaurants...\"  highlight \"restaurants\"\n *\n * SEO: renderizza il vero tag (h1/h2/h3), la parola e' uno <span>. Semantica intatta.\n *\n * NOTA REVEAL: se il titolo che sostituisci ha un'animazione Framer (appear/\n * scroll effect), riapplicala all'istanza di QUESTO componente in GUI: gli\n * effetti Framer funzionano su qualsiasi layer, code component inclusi.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 520\n * @framerIntrinsicHeight 80\n * @framerDisableUnlink\n */export default function HighlightText(props){const{text,highlight,highlightAll,tag,baseColor,highlightColor,weight,fontSize,fontSizeTablet,fontSizePhone,tabletBreak,phoneBreak,lineHeight,letterSpacing,align,style}=props;const uid=useId().replace(/:/g,\"\");const Tag=tag||\"h2\";const cls=`ht-${uid}`;// Spezza il testo attorno alla parola/frase da colorare.\n// highlightAll = true -> tutte le occorrenze; false -> solo la prima.\nconst segments=[];const src=text||\"\";const needle=(highlight||\"\").trim();if(!needle){segments.push({t:src,hot:false});}else{let i=0;let idx=src.indexOf(needle);let done=false;while(idx!==-1&&!done){if(idx>i)segments.push({t:src.slice(i,idx),hot:false});segments.push({t:needle,hot:true});i=idx+needle.length;if(!highlightAll){done=true;break;}idx=src.indexOf(needle,i);}if(i<src.length)segments.push({t:src.slice(i),hot:false});}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .${cls} {\n                    margin: 0;\n                    font-family: \"Fraunces\", Georgia, serif;\n                    font-weight: ${weight};\n                    font-size: ${fontSize}px;\n                    line-height: ${lineHeight}%;\n                    letter-spacing: ${letterSpacing}em;\n                    color: ${baseColor};\n                    text-align: ${align};\n                }\n                @media (max-width: ${tabletBreak}px) {\n                    .${cls} { font-size: ${fontSizeTablet}px; }\n                }\n                @media (max-width: ${phoneBreak}px) {\n                    .${cls} { font-size: ${fontSizePhone}px; }\n                }\n            `}),/*#__PURE__*/_jsx(Tag,{className:cls,style:style,children:segments.map((s,i)=>s.hot?/*#__PURE__*/_jsx(\"span\",{style:{color:highlightColor},children:s.t},i):/*#__PURE__*/_jsx(\"span\",{children:s.t},i))})]});}HighlightText.defaultProps={text:\"Casos seleccionados\",highlight:\"Casos\",highlightAll:false,tag:\"h2\",baseColor:\"#0A0A0A\",highlightColor:\"#2B7FB0\",weight:500,fontSize:52,fontSizeTablet:42,fontSizePhone:32,tabletBreak:1280,phoneBreak:768,lineHeight:110,letterSpacing:-.03,align:\"left\"};addPropertyControls(HighlightText,{text:{type:ControlType.String,title:\"Testo\",displayTextArea:true,defaultValue:\"Casos seleccionados\",description:\"Localizza questo per ogni lingua.\"},highlight:{type:ControlType.String,title:\"Parola colore\",defaultValue:\"Casos\",description:\"La parola/frase da colorare. Localizzala anche questa (ES: rentables, EN: restaurants).\"},highlightAll:{type:ControlType.Boolean,title:\"Tutte\",defaultValue:false,enabledTitle:\"Tutte\",disabledTitle:\"1\\xaa\",description:\"Colora tutte le occorrenze o solo la prima.\"},tag:{type:ControlType.Enum,title:\"Tag\",options:[\"h1\",\"h2\",\"h3\"],optionTitles:[\"H1\",\"H2\",\"H3\"],defaultValue:\"h2\",displaySegmentedControl:true,description:\"Semantica SEO. H1 solo uno per pagina.\"},// Colori\nbaseColor:{type:ControlType.Color,title:\"Colore base\",defaultValue:\"#0A0A0A\",description:\"Bianco su hero scuro, nero su fondo chiaro.\"},highlightColor:{type:ControlType.Color,title:\"Colore parola\",defaultValue:\"#2B7FB0\",description:\"Il brand. Non l'elettrico (quello e' per le interazioni).\"},// Tipografia (match /Heading 2)\nweight:{type:ControlType.Enum,title:\"Peso\",options:[400,500],optionTitles:[\"400\",\"500\"],defaultValue:500,displaySegmentedControl:true},fontSize:{type:ControlType.Number,title:\"Size\",defaultValue:52,min:20,max:120,step:1,description:\"Desktop. H1 hero ~64, H2 ~52.\"},fontSizeTablet:{type:ControlType.Number,title:\"Size tablet\",defaultValue:42,min:18,max:100,step:1},fontSizePhone:{type:ControlType.Number,title:\"Size phone\",defaultValue:32,min:16,max:80,step:1},tabletBreak:{type:ControlType.Number,title:\"Break tablet\",defaultValue:1280,min:768,max:1600,step:10},phoneBreak:{type:ControlType.Number,title:\"Break phone\",defaultValue:768,min:360,max:900,step:10},lineHeight:{type:ControlType.Number,title:\"Interlinea\",defaultValue:110,min:90,max:160,step:5,unit:\"%\"},letterSpacing:{type:ControlType.Number,title:\"Tracking\",defaultValue:-.03,min:-.06,max:.04,step:.005,unit:\"em\"},align:{type:ControlType.Enum,title:\"Allineamento\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Sx\",\"Centro\",\"Dx\"],defaultValue:\"left\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"80\",\"framerIntrinsicWidth\":\"520\",\"framerDisableUnlink\":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