{"version":3,"file":"TruncatedText.CGIMY075.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/tPGYJu5YyQuh46JW5xN5/heTcFvB093U64LwsLEc0/TruncatedText.js"],"sourcesContent":["// Text component with configurable truncation and ellipsis\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TruncatedText(props){const{text=\"This is a sample text that will be truncated when it exceeds the maximum character limit.\",maxCharacters=50,showEllipsis=true,ellipsisText=\"...\",font,textColor,style}=props;const truncatedText=useMemo(()=>{if(text.length<=maxCharacters){return text;}const truncated=text.substring(0,maxCharacters);return showEllipsis?truncated+ellipsisText:truncated;},[text,maxCharacters,showEllipsis,ellipsisText]);const isFixedWidth=style?.width===\"100%\";return /*#__PURE__*/_jsx(\"span\",{style:{...style,color:textColor,...font,...isFixedWidth?{}:{width:\"max-content\"},display:\"inline-block\",wordBreak:\"break-word\",overflowWrap:\"break-word\"},children:truncatedText});}addPropertyControls(TruncatedText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is a sample text that will be truncated when it exceeds the maximum character limit.\",displayTextArea:true},maxCharacters:{type:ControlType.Number,title:\"Max Characters\",defaultValue:50,min:1,max:500,step:1,displayStepper:true},showEllipsis:{type:ControlType.Boolean,title:\"Show Ellipsis\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},ellipsisText:{type:ControlType.String,title:\"Ellipsis Text\",defaultValue:\"...\",hidden:({showEllipsis})=>!showEllipsis},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TruncatedText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TruncatedText.map"],"mappings":"sKAIG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,4FAA4F,gBAAc,GAAG,eAAa,GAAK,eAAa,MAAM,OAAK,YAAU,SAAO,EAAY,EAAcA,MAAY,CAAC,GAAG,EAAK,QAAQ,EAAe,OAAO,EAAM,IAAM,EAAU,EAAK,UAAU,EAAE,CAAa,EAAE,OAAO,EAAa,EAAU,EAAa,CAAU,EAAE,CAAC,EAAK,EAAc,EAAa,CAAY,CAAC,EAAQ,EAAa,GAAO,QAAQ,OAAO,OAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,EAAU,GAAG,EAAK,GAAG,EAAa,CAAC,EAAE,CAAC,MAAM,aAAa,EAAE,QAAQ,eAAe,UAAU,aAAa,aAAa,YAAY,EAAE,SAAS,CAAa,CAAC,CAAE,iBAHhqB,IAAoD,IAA2B,EAGklB,EAAoB,EAAc,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,OAAO,aAAa,4FAA4F,gBAAgB,EAAI,EAAE,cAAc,CAAC,KAAK,EAAY,OAAO,MAAM,iBAAiB,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,eAAe,EAAI,EAAE,aAAa,CAAC,KAAK,EAAY,QAAQ,MAAM,gBAAgB,aAAa,GAAK,aAAa,OAAO,cAAc,MAAM,EAAE,aAAa,CAAC,KAAK,EAAY,OAAO,MAAM,gBAAgB,aAAa,MAAM,QAAQ,CAAC,kBAAgB,CAAC,CAAY,EAAE,KAAK,CAAC,KAAK,EAAY,KAAK,MAAM,OAAO,aAAa,CAAC,SAAS,OAAO,QAAQ,SAAS,cAAc,UAAU,WAAW,OAAO,EAAE,SAAS,WAAW,gBAAgB,YAAY,EAAE,UAAU,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,aAAa,SAAS,CAAC,CAAC"}