{"version":3,"file":"FirstLineIndentText.Cf2PBpgR.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/uYqlLQ6yxxgJQt9Hkiqd/V8aUucP2yhwCoiprhJoM/FirstLineIndentText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo,useEffect,useState}from\"react\";/**\n * FirstLineIndentText\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function FirstLineIndentText(props){const{text,indentValue,indentUnit,color,font,htmlTag,style,overflow,hyphenate=true,language=\"en\"}=props;const[enableHyphenation,setEnableHyphenation]=useState(false);useEffect(()=>{const checkWidth=()=>{const width=window.innerWidth;setEnableHyphenation(hyphenate&&width<390);};checkWidth();window.addEventListener(\"resize\",checkWidth);return()=>window.removeEventListener(\"resize\",checkWidth);},[hyphenate]);const indent=useMemo(()=>`${indentValue}${indentUnit}`,[indentValue,indentUnit]);const Tag=htmlTag;const hyphenationStyles=enableHyphenation?{hyphens:\"auto\",WebkitHyphens:\"auto\",msHyphens:\"auto\",wordBreak:\"normal\",overflowWrap:\"normal\"}:{hyphens:\"none\",WebkitHyphens:\"none\",msHyphens:\"none\",wordBreak:\"break-word\",overflowWrap:\"break-word\"};return /*#__PURE__*/_jsx(Tag,{lang:language,style:{all:\"unset\",display:\"block\",boxSizing:\"border-box\",margin:0,padding:0,color,...font,width:style?.width||\"100%\",minWidth:0,whiteSpace:\"pre-wrap\",textAlign:font?.textAlign||\"left\",textIndent:indent,overflow,...hyphenationStyles,...style},children:text});}addPropertyControls(FirstLineIndentText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This text will automatically use hyphenation when the viewport width is under 390px.\",displayTextArea:true},indentValue:{type:ControlType.Number,title:\"Indent\",defaultValue:32,min:0,max:200,step:1},indentUnit:{type:ControlType.Enum,title:\"Unit\",options:[\"px\",\"%\"],optionTitles:[\"px\",\"%\"],defaultValue:\"px\",displaySegmentedControl:true},htmlTag:{type:ControlType.Enum,title:\"HTML Tag\",options:[\"p\",\"span\",\"div\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],optionTitles:[\"p\",\"span\",\"div\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],defaultValue:\"p\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},overflow:{type:ControlType.Enum,title:\"Overflow\",options:[\"visible\",\"hidden\",\"scroll\",\"auto\"],optionTitles:[\"Visible\",\"Hidden\",\"Scroll\",\"Auto\"],defaultValue:\"hidden\"},hyphenate:{type:ControlType.Boolean,title:\"Hyphenate\",defaultValue:true},language:{type:ControlType.String,title:\"Lang\",defaultValue:\"en\",placeholder:\"en, de, fr, es\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FirstLineIndentText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FirstLineIndentText.map"],"mappings":"sMAKG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,OAAK,cAAY,aAAW,QAAM,OAAK,UAAQ,QAAM,WAAS,YAAU,GAAK,WAAS,MAAM,EAAW,CAAC,EAAkB,GAAsBA,EAAS,GAAM,CAAC,MAAc,CAAC,IAAM,MAAe,CAAC,IAAM,EAAM,EAAO,WAAW,EAAqB,GAAW,EAAM,IAAI,EAA6D,OAA1D,GAAY,CAAC,EAAO,iBAAiB,SAAS,EAAW,KAAW,EAAO,oBAAoB,SAAS,EAAW,EAAG,CAAC,EAAU,CAAC,CAAC,IAAM,EAAO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