{"version":3,"file":"TruncatedText.BEozsOa9.mjs","names":["useMemo","_jsx","__esmMin","init_npm_react_18_3_1","pe","init_jsx_runtime","c","addPropertyControls","init_framer_ChujFWHC","ControlType","TruncatedText","props","text","charLimit","font","color","style","limitType","lineLimit","displayText","init_TruncatedText"],"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":"A,0KAMG,SAAwBU,EAAcC,EAAM,CAAC,GAAK,CAACC,OAAKC,YAAUC,OAAKC,QAAMC,QAAMC,YAAU,OAAOC,YAAU,GAAGP,EAAYQ,EAAYnB,MAAiBY,EAAiBK,IAAY,OAAWL,EAAK,QAAQC,EAAiBD,EAAYA,EAAK,MAAM,EAAE,KAAK,IAAI,EAAEC,CAAS,CAAC,EAAE,MAC5QD,EADiK,GACzJ,CAACA,EAAKC,EAAUI,CAAS,CAAC,EAAE,MAAoBhB,gBAAK,OAAO,CAAC,MAAM,CAAC,GAAGe,GAAO,CAAC,EAAE,GAAGF,EAAKC,QAAM,MAAMC,GAAOA,EAAM,QAAQ,OAAO,OAAO,cAAc,SAAS,EAAE,QAAQC,IAAY,OAAO,cAAc,eAAe,WAA8B,WAAsB,SAASA,IAAY,OAAO,SAAS,IAAA,GAAU,aAAaA,IAAY,OAAO,WAAW,IAAA,GAAU,gBAAgBA,IAAY,OAAOC,EAAU,IAAA,GAAU,gBAAgBD,IAAY,OAAO,WAAW,IAAA,EAAS,EAAE,SAASE,CAAW,CAAC,CAAE,C,0CAACZ,EAAoBG,EAAc,CAAC,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