{"version":3,"file":"TextTruncator.FevYYiIC.mjs","names":[],"sources":["https:/framerusercontent.com/modules/9shVziBPHBzL4dXfX7BV/Yric6VtcJDC84OgaQdcr/TextTruncator.js"],"sourcesContent":["// TextTruncator component: truncates text to a max number of characters, with font controls and editable source text\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * TextTruncator\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TextTruncator(props){const{text=\"\",maxChars=50,textStyle,font,textColor=\"#000\",style}=props;const truncated=useMemo(()=>{if(text.length<=maxChars)return text;return text.slice(0,maxChars)+\"…\";},[text,maxChars]);return /*#__PURE__*/_jsx(\"span\",{style:{...style,...textStyle,...font,color:textColor,width:\"100%\",minWidth:0,display:\"inline-block\",whiteSpace:\"pre-line\",overflowWrap:\"break-word\"},children:truncated});}addPropertyControls(TextTruncator,{text:{type:ControlType.String,title:\"Source Text\",defaultValue:\"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\",displayTextArea:true},maxChars:{type:ControlType.Number,title:\"Max Chars\",defaultValue:50,min:1,max:1e3,step:1,displayStepper:true},textStyle:{type:ControlType.Object,title:\"Text Style\",controls:{},defaultValue:{},useProjectTextStyles:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextTruncator\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextTruncator.map"],"mappings":"kQAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,GAAG,WAAS,GAAG,YAAU,OAAK,YAAU,OAAO,QAAM,CAAC,EAAY,EAAU,EAAQ,IAAQ,EAAK,QAAQ,EAAgB,EAAY,EAAK,MAAM,EAAE,EAAS,CAAC,IAAM,CAAC,EAAK,CAAS,EAAC,CAAC,MAAoB,GAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAM,GAAG,EAAU,GAAG,EAAK,MAAM,EAAU,MAAM,OAAO,SAAS,EAAE,QAAQ,eAAe,WAAW,WAAW,aAAa,YAAa,EAAC,SAAS,CAAU,EAAC,AAAE,cAAA,AAL1b,GAA2C,IAAoD,IAA2B,CAKgU,EAAoB,EAAc,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,cAAc,aAAa,2DAA2D,iBAAgB,CAAK,EAAC,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,gBAAe,CAAK,EAAC,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,SAAS,CAAE,EAAC,aAAa,CAAE,EAAC,sBAAqB,CAAK,EAAC,KAAK,CAAC,KAAK,EAAY,KAAK,MAAM,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,OAAO,QAAQ,SAAS,cAAc,UAAU,WAAW,OAAQ,CAAC,EAAC,UAAU,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,aAAa,SAAU,CAAC,EAAC"}