{"version":3,"file":"IndentedText.Ctd1ORpa.mjs","names":["React.useMemo","__esmMin","pe","init_npm_react_18_3_1","c","init_jsx_runtime","init_framer_DxfB3JJo","ControlType","addPropertyControls","IndentedText","props","isFixedWidth","style","isFixedHeight","resolvedFont","font","paragraphs","raw","text","parts","basePStyle","blockIndent","mode","indent","firstLineIndent","textColor","preserveNewlines","paragraphGap","p","i","init_IndentedText"],"sources":["https:/framerusercontent.com/modules/rkXvDpZtyH2vkjn0sDzw/o2cKONep0fy7mCwIYvmf/IndentedText.js"],"sourcesContent":["// User instructions: Create a text component with indented paragraphs.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function IndentedText(props){const{text,textColor,font,mode,indent,paragraphGap,preserveNewlines,style}=props;const isFixedWidth=!!style&&style.width===\"100%\";const isFixedHeight=!!style&&style.height===\"100%\";const resolvedFont=font;const paragraphs=React.useMemo(()=>{const raw=(text??\"\").toString();if(!raw.trim())return[\"\"];// Treat blank lines as paragraph separators\nconst parts=raw.split(/\\n\\s*\\n/g);return parts.length?parts:[raw];},[text]);const basePStyle=React.useMemo(()=>{const blockIndent=mode===\"block\"?indent:0;const firstLineIndent=mode===\"first-line\"?indent:0;return{margin:0,color:textColor,...resolvedFont,paddingLeft:blockIndent,textIndent:firstLineIndent,whiteSpace:preserveNewlines?\"pre-wrap\":\"normal\",overflowWrap:\"break-word\",wordBreak:\"break-word\"};},[indent,mode,preserveNewlines,resolvedFont,textColor]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:isFixedHeight?\"100%\":\"auto\",...isFixedWidth?{}:{minWidth:\"max-content\"},display:\"flex\",flexDirection:\"column\",gap:paragraphGap,...style},children:paragraphs.map((p,i)=>/*#__PURE__*/_jsx(\"p\",{style:basePStyle,children:p},i))});}addPropertyControls(IndentedText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is an indented paragraph. The first line starts with an indent.\\n\\nThis is a second paragraph, also indented.\",displayTextArea:true},mode:{type:ControlType.Enum,title:\"Indent\",options:[\"first-line\",\"block\"],optionTitles:[\"First Line\",\"Whole Block\"],defaultValue:\"first-line\",displaySegmentedControl:true},indent:{type:ControlType.Number,title:\"Size\",defaultValue:24,min:0,max:160,step:1,unit:\"px\"},paragraphGap:{type:ControlType.Number,title:\"Gap\",defaultValue:12,min:0,max:80,step:1,unit:\"px\"},preserveNewlines:{type:ControlType.Boolean,title:\"Newlines\",defaultValue:true,enabledTitle:\"Preserve\",disabledTitle:\"Collapse\"},textColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",displayFontSize:true,defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"IndentedText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./IndentedText.map"],"mappings":"A,0KAIG,SAAwBS,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,OAAK,OAAK,SAAO,eAAa,mBAAiB,SAAOC,EAAYC,EAAa,CAAC,CAACC,GAAOA,EAAM,QAAQ,OAAaC,EAAc,CAAC,CAACD,GAAOA,EAAM,SAAS,OAAaE,EAAaC,EAAWC,EAAWhB,MAAkB,CAAC,IAAMiB,GAAKC,GAAM,GAAA,CAAI,SAAS,EAAE,GAAG,CAACD,EAAI,KAAK,EAAE,MAAM,CAAC,EAAE,EACxV,IAAME,EAAMF,EAAI,MAAM,UAAU,EAAE,OAAOE,EAAM,OAAOA,EAAM,CAACF,CAAG,CAAE,EAAE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