{"version":3,"file":"TextTruncator.RArmdCeR.mjs","names":["useMemo"],"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":"qKAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,GAAG,WAAS,GAAG,YAAU,OAAK,YAAU,OAAO,SAAO,EAAY,EAAUA,MAAgB,EAAK,QAAQ,EAAgB,EAAY,EAAK,MAAM,EAAE,EAAS,CAAC,IAAM,CAAC,EAAK,EAAS,CAAC,CAAC,OAAoB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAM,GAAG,EAAU,GAAG,EAAK,MAAM,EAAU,MAAM,OAAO,SAAS,EAAE,QAAQ,eAAe,WAAW,WAAW,aAAa,aAAa,CAAC,SAAS,EAAU,CAAC,kBAL7Y,IAAoD,IAA2B,CAKgU,EAAoB,EAAc,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,cAAc,aAAa,2DAA2D,gBAAgB,GAAK,CAAC,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,eAAe,GAAK,CAAC,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,SAAS,EAAE,CAAC,aAAa,EAAE,CAAC,qBAAqB,GAAK,CAAC,KAAK,CAAC,KAAK,EAAY,KAAK,MAAM,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,OAAO,QAAQ,SAAS,cAAc,UAAU,WAAW,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,aAAa,UAAU,CAAC,CAAC"}