{"version":3,"file":"RichTextBulletList.B8w19Chk.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/h8f8xOB5j3eYLopaly5w/8mpYqBsWgCofnKRM04bp/RichTextBulletList.js"],"sourcesContent":["// Custom bullet list component that takes plain text from CMS and renders with custom SVG bullets\n// Headings are identified by ** and paragraphs by *\n// Includes font controls for both heading and paragraph text\n// Supports custom SVG file upload with color control\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RichTextBulletList(props){const{content=\"**First Item\\n*This is the description for the first item\\n\\n**Second Item\\n*This is the description for the second item\",customSvg=\"\",bulletSize=24,bulletColor=\"#122E75\",bulletPadding=0,gap=16,headingFont,paragraphFont,headingColor=\"#000000\",paragraphColor=\"#666666\",style}=props;const items=useMemo(()=>{const lines=content.split(\"\\n\");const parsedItems=[];let currentItem={};for(const line of lines){const trimmedLine=line.trim();if(trimmedLine.startsWith(\"**\")){if(currentItem.heading){parsedItems.push({heading:currentItem.heading||\"\",description:currentItem.description||\"\"});currentItem={};}currentItem.heading=trimmedLine.substring(2).trim();}else if(trimmedLine.startsWith(\"*\")){currentItem.description=trimmedLine.substring(1).trim();}}if(currentItem.heading){parsedItems.push({heading:currentItem.heading||\"\",description:currentItem.description||\"\"});}return parsedItems;},[content]);const isFixedWidth=style?.width===\"100%\";const renderBullet=()=>{if(customSvg){return /*#__PURE__*/_jsx(\"img\",{src:customSvg,alt:\"Bullet icon\",style:{width:\"100%\",height:\"100%\",objectFit:\"contain\",filter:getColorFilter(bulletColor)}});}return /*#__PURE__*/_jsxs(\"svg\",{viewBox:\"0 0 24 24\",style:{width:\"100%\",height:\"100%\",fill:bulletColor},children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"12\",cy:\"12\",r:\"10\",fill:bulletColor}),/*#__PURE__*/_jsx(\"path\",{d:\"M9 12l2 2 4-4\",stroke:\"white\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",fill:\"none\"})]});};return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",flexDirection:\"column\",gap:`${gap}px`,minHeight:\"5px\",...isFixedWidth?{}:{width:\"max-content\"}},children:items.map((item,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:\"12px\",alignItems:\"flex-start\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{flexShrink:0,width:`${bulletSize}px`,height:`${bulletSize}px`,padding:`${bulletPadding}px`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:renderBullet()}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:\"4px\",flex:1},children:[item.heading&&/*#__PURE__*/_jsx(\"h3\",{style:{margin:0,color:headingColor,...headingFont},children:item.heading}),item.description&&/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:paragraphColor,...paragraphFont},children:item.description})]})]},index))});}// Helper function to convert hex color to CSS filter\nfunction getColorFilter(hexColor){// Remove # if present\nconst hex=hexColor.replace(\"#\",\"\");// Convert hex to RGB\nconst r=parseInt(hex.substr(0,2),16);const g=parseInt(hex.substr(2,2),16);const b=parseInt(hex.substr(4,2),16);// Convert to filter values (approximate)\nconst hue=Math.round(Math.atan2(Math.sqrt(3)*(g-b),2*r-g-b)*180/Math.PI);const saturation=Math.round(Math.sqrt(Math.pow(r-g,2)+Math.pow(g-b,2)+Math.pow(b-r,2))/Math.sqrt(3)/255*100);const lightness=Math.round((r+g+b)/3/255*100);return`hue-rotate(${hue}deg) saturate(${saturation}%) brightness(${lightness}%)`;}addPropertyControls(RichTextBulletList,{content:{type:ControlType.String,title:\"Content\",displayTextArea:true,defaultValue:\"**First Item\\n*This is the description for the first item\\n\\n**Second Item\\n*This is the description for the second item\\n\\n**Third Item\\n*This is the description for the third item\"},customSvg:{type:ControlType.File,title:\"Custom SVG\",allowedFileTypes:[\"svg\"]},bulletSize:{type:ControlType.Number,title:\"Bullet Size\",defaultValue:24,min:12,max:64,step:1,unit:\"px\"},bulletColor:{type:ControlType.Color,title:\"Bullet Color\",defaultValue:\"#122E75\"},bulletPadding:{type:ControlType.Number,title:\"Bullet Padding\",defaultValue:0,min:0,max:32,step:1,unit:\"px\"},gap:{type:ControlType.Number,title:\"Item Gap\",defaultValue:16,min:0,max:64,step:1,unit:\"px\"},headingFont:{type:ControlType.Font,title:\"Heading Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},headingColor:{type:ControlType.Color,title:\"Heading Color\",defaultValue:\"#000000\"},paragraphFont:{type:ControlType.Font,title:\"Paragraph Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.4em\"}},paragraphColor:{type:ControlType.Color,title:\"Paragraph Color\",defaultValue:\"#666666\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RichTextBulletList\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RichTextBulletList.map"],"mappings":"iLAOG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,UAAQ;;;;8CAA2H,YAAU,GAAG,aAAW,GAAG,cAAY,UAAU,gBAAc,EAAE,MAAI,GAAG,cAAY,gBAAc,eAAa,UAAU,iBAAe,UAAU,SAAO,EAAY,EAAMA,MAAY,CAAC,IAAM,EAAM,EAAQ,MAAM;EAAK,CAAO,EAAY,EAAE,CAAK,EAAY,EAAE,CAAC,IAAI,IAAM,KAAQ,EAAM,CAAC,IAAM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