{"version":3,"file":"TruncatedText.DFRsKYD8.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/ADXKUVFZan2suLO0qSf8/1viyorRZJOkFgRkDNQ8v/TruncatedText.js"],"sourcesContent":["// Text component with character limit and ellipsis, customizable font and color, supports Framer style prop\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * TruncatedText\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TruncatedText(props){const{text,charLimit,font,color,style,limitType=\"char\",lineLimit=2}=props;const displayText=useMemo(()=>{if(!text)return\"\";if(limitType===\"char\"){if(text.length<=charLimit)return text;return text.slice(0,Math.max(0,charLimit))+\"...\";}else{// line limit: let CSS handle truncation, just return text\nreturn text;}},[text,charLimit,limitType]);return /*#__PURE__*/_jsx(\"span\",{style:{...style||{},...font,color,width:style&&style.width===\"100%\"?\"100%\":\"max-content\",minWidth:0,display:limitType===\"line\"?\"-webkit-box\":\"inline-block\",whiteSpace:limitType===\"line\"?\"pre-line\":\"pre-line\",overflow:limitType===\"line\"?\"hidden\":undefined,textOverflow:limitType===\"line\"?\"ellipsis\":undefined,WebkitLineClamp:limitType===\"line\"?lineLimit:undefined,WebkitBoxOrient:limitType===\"line\"?\"vertical\":undefined},children:displayText});}addPropertyControls(TruncatedText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is a sample text for the TruncatedText component.\",displayTextArea:true},limitType:{type:ControlType.Enum,title:\"Limit By\",options:[\"char\",\"line\"],optionTitles:[\"Character\",\"Line\"],defaultValue:\"char\",displaySegmentedControl:true},charLimit:{type:ControlType.Number,title:\"Char Limit\",defaultValue:30,min:1,max:500,step:1,displayStepper:true,hidden:({limitType})=>limitType===\"line\"},lineLimit:{type:ControlType.Number,title:\"Line Limit\",defaultValue:2,min:1,max:10,step:1,displayStepper:true,hidden:({limitType})=>limitType!==\"line\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TruncatedText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TruncatedText.map"],"mappings":"0KAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,OAAK,QAAM,QAAM,YAAU,OAAO,YAAU,GAAG,EAAY,EAAYA,MAAiB,EAAiB,IAAY,OAAW,EAAK,QAAQ,EAAiB,EAAY,EAAK,MAAM,EAAE,KAAK,IAAI,EAAE,CAAS,CAAC,EAAE,MAC5Q,EADiK,GACzJ,CAAC,EAAK,EAAU,CAAS,CAAC,EAAE,OAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,GAAO,CAAC,EAAE,GAAG,EAAK,QAAM,MAAM,GAAO,EAAM,QAAQ,OAAO,OAAO,cAAc,SAAS,EAAE,QAAQ,IAAY,OAAO,cAAc,eAAe,WAA8B,WAAsB,SAAS,IAAY,OAAO,SAAS,IAAA,GAAU,aAAa,IAAY,OAAO,WAAW,IAAA,GAAU,gBAAgB,IAAY,OAAO,EAAU,IAAA,GAAU,gBAAgB,IAAY,OAAO,WAAW,IAAA,EAAS,EAAE,SAAS,CAAW,CAAC,CAAE,iBAN7d,IAAoD,IAA2B,EAM+Y,EAAoB,EAAc,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,OAAO,aAAa,yDAAyD,gBAAgB,EAAI,EAAE,UAAU,CAAC,KAAK,EAAY,KAAK,MAAM,WAAW,QAAQ,CAAC,OAAO,MAAM,EAAE,aA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