{"version":3,"file":"IndentedText.CeJgEncK.mjs","names":["React.useMemo","p"],"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":"0KAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,OAAK,OAAK,SAAO,eAAa,mBAAiB,SAAO,EAAY,EAAa,CAAC,CAAC,GAAO,EAAM,QAAQ,OAAa,EAAc,CAAC,CAAC,GAAO,EAAM,SAAS,OAAa,EAAa,EAAW,EAAWA,MAAkB,CAAC,IAAM,GAAK,GAAM,IAAI,UAAU,CAAC,GAAG,CAAC,EAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CACzV,IAAM,EAAM,EAAI,MAAM,WAAW,CAAC,OAAO,EAAM,OAAO,EAAM,CAAC,EAAI,EAAG,CAAC,EAAK,CAAC,CAAO,EAAWA,MAAkB,CAAC,IAAM,EAAY,IAAO,QAAQ,EAAO,EAAQ,EAAgB,IAAO,aAAa,EAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAU,GAAG,EAAa,YAAY,EAAY,WAAW,EAAgB,WAAW,EAAiB,WAAW,SAAS,aAAa,aAAa,UAAU,aA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