{"version":3,"file":"TextComponent.--P5lMVF.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/5Unv4fKOuN0vVOf9AncI/bd1v63vQo1uJzsAa8VBP/TextComponent.js"],"sourcesContent":["// Text component with customizable text, style, size, and character limit with ellipsis\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function TextComponent(props){const{text=\"Hello World\",font,color,maxCharacters=50,enableLimit=false}=props;const displayText=useMemo(()=>{if(!enableLimit||text.length<=maxCharacters){return text;}return text.slice(0,maxCharacters)+\"...\";},[text,maxCharacters,enableLimit]);const formattedText=useMemo(()=>{return displayText.split(\" \").map(word=>{if(word.length===0)return word;return word.charAt(0).toUpperCase()+word.slice(1).toLowerCase();}).join(\" \");},[displayText]);return /*#__PURE__*/_jsx(\"span\",{style:{...props.style,...font,color,width:\"max-content\"},children:formattedText});}addPropertyControls(TextComponent,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Hello World\",displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},enableLimit:{type:ControlType.Boolean,title:\"Character Limit\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},maxCharacters:{type:ControlType.Number,title:\"Max Characters\",defaultValue:50,min:1,max:500,step:1,hidden:({enableLimit})=>!enableLimit}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=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