{"version":3,"file":"TruncateText.Bp5HuKJS.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/lqAim0fQ6S7TSqEYcM24/asr6n40q0aQsnzAc0kkG/TruncateText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,Link}from\"framer\";export default function TruncateText(props){const{text,lines,font,fontColor,link,linkFont,linkColor,useFontColor,underline,useHoverColor,hoverColor,hoverUnderline,newTab,style}=props;const[hovered,setHovered]=React.useState(false);const activeFont=link?linkFont:font;const restColor=link&&!useFontColor?linkColor:fontColor;const currentColor=hovered&&useHoverColor?hoverColor:restColor;let showUnderline=underline===\"always\";if(hovered){if(hoverUnderline===\"always\")showUnderline=true;else if(hoverUnderline===\"never\")showUnderline=false;}const textStyle={...style,display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",overflow:\"hidden\",WebkitLineClamp:lines,textOverflow:\"ellipsis\",fontFamily:activeFont.fontFamily,fontSize:activeFont.fontSize,fontWeight:activeFont.fontWeight,fontStyle:activeFont.fontStyle,letterSpacing:activeFont.letterSpacing,lineHeight:activeFont.lineHeight,color:currentColor,textAlign:activeFont.textAlign,textDecoration:link&&showUnderline?\"underline\":\"none\",cursor:link?\"pointer\":\"inherit\",transition:\"color 0.2s ease\"};if(link){return /*#__PURE__*/_jsx(Link,{href:link,openInNewTab:newTab,children:/*#__PURE__*/_jsx(\"a\",{style:textStyle,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),children:text})});}return /*#__PURE__*/_jsx(\"div\",{style:textStyle,children:text});}TruncateText.defaultProps={text:\"Truncate text to the size you need.\",lines:1};addPropertyControls(TruncateText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Truncate text to the size you need.\",displayTextArea:true},lines:{type:ControlType.Number,title:\"Lines\",min:1,max:10,defaultValue:1},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"1rem\",fontWeight:400,lineHeight:\"1.2em\",letterSpacing:\"0em\",textAlign:\"left\"},controls:\"extended\",defaultFontType:\"sans-serif\"},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#000\"},link:{type:ControlType.Link,title:\"Link\"},linkFont:{type:ControlType.Font,title:\"Link Font\",defaultValue:{fontSize:\"1rem\",fontWeight:400,lineHeight:\"1.2em\",letterSpacing:\"0em\",textAlign:\"left\"},controls:\"extended\",defaultFontType:\"sans-serif\"},useFontColor:{type:ControlType.Boolean,title:\"Link Color\",defaultValue:false,enabledTitle:\"Font\",disabledTitle:\"Custom\"},linkColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#0066FF\",hidden:props=>props.useFontColor},underline:{type:ControlType.Enum,title:\"Underline\",options:[\"always\",\"never\"],optionTitles:[\"Always\",\"Never\"],defaultValue:\"always\",displaySegmentedControl:true},useHoverColor:{type:ControlType.Boolean,title:\"Hover Color\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},hoverColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#0044CC\",hidden:props=>!props.useHoverColor},hoverUnderline:{type:ControlType.Enum,title:\"Hover Underline\",options:[\"inherit\",\"always\",\"never\"],optionTitles:[\"Inherit\",\"Always\",\"Never\"],defaultValue:\"inherit\",displaySegmentedControl:true},newTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TruncateText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TruncateText.map"],"mappings":"4KAAgI,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,OAAK,YAAU,OAAK,WAAS,YAAU,eAAa,YAAU,gBAAc,aAAW,iBAAe,SAAO,SAAO,EAAW,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAQ,EAAW,EAAK,EAAS,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