{"version":3,"file":"DynamicNumberHighlight.EdfBOKpE.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/xeKirbsmrBJmCgZIXusz/xGUCMAAThoORZbvNhpnt/DynamicNumberHighlight.js"],"sourcesContent":["// Dynamisch cijfers en procenten blauw maken in tekst\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * DynamicNumberHighlight\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function DynamicNumberHighlight(props){const{text,font,color,numberColor,style}=props;// Regex: match numbers (integers, decimals) and percentages\nconst regex=/([0-9]+(?:[.,][0-9]+)?%?)/g;const parts=useMemo(()=>{const result=[];let lastIndex=0;let match;while((match=regex.exec(text))!==null){if(match.index>lastIndex){result.push({text:text.slice(lastIndex,match.index),isNumber:false});}result.push({text:match[0],isNumber:true});lastIndex=match.index+match[0].length;}if(lastIndex<text.length){result.push({text:text.slice(lastIndex),isNumber:false});}return result;},[text]);return /*#__PURE__*/_jsx(\"span\",{style:{...font,color,width:\"max-content\",whiteSpace:\"nowrap\",...style},children:parts.map((part,i)=>part.isNumber?/*#__PURE__*/_jsx(\"span\",{style:{color:numberColor},children:part.text},i):/*#__PURE__*/_jsx(\"span\",{children:part.text},i))});}addPropertyControls(DynamicNumberHighlight,{text:{type:ControlType.String,title:\"Tekst\",defaultValue:\"De omzet steeg met 12% tot 1.234 euro.\",displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"22px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},color:{type:ControlType.Color,title:\"Tekstkleur\",defaultValue:\"#000000\"},numberColor:{type:ControlType.Color,title:\"Cijferkleur\",defaultValue:\"#0099FF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DynamicNumberHighlight\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DynamicNumberHighlight.map"],"mappings":"0KAMG,SAAwB,EAAuB,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,QAAM,cAAY,SAAO,EAC5F,EAAM,6BAAmC,EAAMA,MAAY,CAAC,IAAM,EAAO,EAAE,CAAK,EAAU,EAAM,EAAM,MAAO,EAAM,EAAM,KAAK,EAAK,IAAI,MAAS,EAAM,MAAM,GAAW,EAAO,KAAK,CAAC,KAAK,EAAK,MAAM,EAAU,EAAM,MAAM,CAAC,SAAS,GAAM,CAAC,CAAE,EAAO,KAAK,CAAC,KAAK,EAAM,GAAG,SAAS,GAAK,CAAC,CAAC,EAAU,EAAM,MAAM,EAAM,GAAG,OAA4F,OAAjF,EAAU,EAAK,QAAQ,EAAO,KAAK,CAAC,KAAK,EAAK,MAAM,EAAU,CAAC,SAAS,GAAM,CAAC,CAAS,GAAS,CAAC,EAAK,CAAC,CAAC,OAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAK,QAAM,MAAM,cAAc,WAAW,SAAS,GAAG,EAAM,CAAC,SAAS,EAAM,KAAK,EAAK,IAAI,EAAK,SAAsB,EAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAY,CAAC,SAAS,EAAK,KAAK,CAAC,EAAE,CAAc,EAAK,OAAO,CAAC,SAAS,EAAK,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,kBANvpB,IAAoD,IAA2B,CAM0kB,EAAoB,EAAuB,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,QAAQ,aAAa,yCAAyC,gBAAgB,GAAK,CAAC,KAAK,CAAC,KAAK,EAAY,KAAK,MAAM,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,OAAO,QAAQ,WAAW,cAAc,UAAU,WAAW,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,aAAa,UAAU,CAAC,YAAY,CAAC,KAAK,EAAY,MAAM,MAAM,cAAc,aAAa,UAAU,CAAC,CAAC"}