{"version":3,"file":"RowsLimit.DXHH3bvD.mjs","names":["useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/v0xWykDYzsAN6bCoLt36/Us0jnDaeqdq3aYwBGMgW/RowsLimit.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function withFixedThreeRows(props){const text=props.text||\"\";const[minHeight,setMinHeight]=useState(\"auto\");const className=props?.children?.props?.children?.props?.className||\"\";useEffect(()=>{const updateHeight=()=>{if(className){const element=document.querySelector(`.${className}`);if(element){// Получаем текущие стили элемента\nconst computedStyle=window.getComputedStyle(element);const fontSize=parseFloat(computedStyle.fontSize)// в пикселях\n;const lineHeight=parseFloat(computedStyle.lineHeight)||fontSize*1.5// Фallback на 1.5 * fontSize\n;// Рассчитываем минимальную высоту для 3 строк\nconst calculatedMinHeight=`${lineHeight*3}px`;setMinHeight(calculatedMinHeight);}}};// Расчет при монтировании\nupdateHeight();// Расчет при ресайзе\nwindow.addEventListener(\"resize\",updateHeight);return()=>{window.removeEventListener(\"resize\",updateHeight);};},[text,className]);return{text:text,style:{display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",WebkitLineClamp:3,overflow:\"hidden\",textOverflow:\"ellipsis\",minHeight:minHeight}};}export function withFixedTwoRows(props){const text=props.text||\"\";const[minHeight,setMinHeight]=useState(\"auto\");const className=props?.children?.props?.children?.props?.className||\"\";useEffect(()=>{const updateHeight=()=>{if(className){const element=document.querySelector(`.${className}`);if(element){// Получаем текущие стили элемента\nconst computedStyle=window.getComputedStyle(element);const fontSize=parseFloat(computedStyle.fontSize)// в пикселях\n;const lineHeight=parseFloat(computedStyle.lineHeight)||fontSize*1.5// Фallback на 1.5 * fontSize\n;// Рассчитываем минимальную высоту для 2 строк\nconst calculatedMinHeight=`${lineHeight*2}px`;setMinHeight(calculatedMinHeight);}}};// Расчет при монтировании\nupdateHeight();// Расчет при ресайзе\nwindow.addEventListener(\"resize\",updateHeight);return()=>{window.removeEventListener(\"resize\",updateHeight);};},[text,className]);return{text:text,style:{display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",WebkitLineClamp:2,overflow:\"hidden\",textOverflow:\"ellipsis\",minHeight:minHeight}};}export function withMaxThreeRows(props){const text=props.text||\"\";return{text:text,style:{display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",WebkitLineClamp:3,overflow:\"hidden\",textOverflow:\"ellipsis\"}};}export function withMaxTwoRows(props){const text=props.text||\"\";return{text:text,style:{display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",WebkitLineClamp:2,overflow:\"hidden\",textOverflow:\"ellipsis\"}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withwithFixedThreeRows(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...withFixedThreeRows(props)});};}withwithFixedThreeRows.displayName=\"withFixedThreeRows\";export function withwithFixedTwoRows(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...withFixedTwoRows(props)});};}withwithFixedTwoRows.displayName=\"withFixedTwoRows\";export function withwithMaxThreeRows(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...withMaxThreeRows(props)});};}withwithMaxThreeRows.displayName=\"withMaxThreeRows\";export function withwithMaxTwoRows(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...withMaxTwoRows(props)});};}withwithMaxTwoRows.displayName=\"withMaxTwoRows\";\nexport const __FramerMetadata__ = {\"exports\":{\"withwithFixedTwoRows\":{\"type\":\"reactHoc\",\"name\":\"withwithFixedTwoRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFixedThreeRows\":{\"type\":\"override\",\"name\":\"withFixedThreeRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withwithMaxTwoRows\":{\"type\":\"reactHoc\",\"name\":\"withwithMaxTwoRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMaxTwoRows\":{\"type\":\"override\",\"name\":\"withMaxTwoRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withwithMaxThreeRows\":{\"type\":\"reactHoc\",\"name\":\"withwithMaxThreeRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMaxThreeRows\":{\"type\":\"override\",\"name\":\"withMaxThreeRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFixedTwoRows\":{\"type\":\"override\",\"name\":\"withFixedTwoRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withwithFixedThreeRows\":{\"type\":\"reactHoc\",\"name\":\"withwithFixedThreeRows\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RowsLimit.map"],"mappings":"ySAAiF,SAAgB,EAAmB,EAAM,CAAC,IAAM,EAAK,EAAM,MAAM,GAAQ,CAAC,EAAU,GAAcA,EAAS,OAAO,CAAO,EAAU,GAAO,UAAU,OAAO,UAAU,OAAO,WAAW,GAMtI,OANyI,MAAc,CAAC,IAAM,MAAiB,CAAC,GAAG,EAAU,CAAC,IAAM,EAAQ,SAAS,cAAc,IAAI,IAAY,CAAC,GAAG,EAAQ,CACjY,IAAM,EAAc,EAAO,iBAAiB,EAAQ,CAAO,EAAS,WAAW,EAAc,SAAS,CAGhG,EAAoB,IAFR,WAAW,EAAc,WAAW,EAAE,EAAS,KAEzB,EAAE,IAAI,EAAa,EAAoB,IAEhC,OAD/C,GAAc,CACd,EAAO,iBAAiB,SAAS,EAAa,KAAW,CAAC,EAAO,oBAAoB,SAAS,EAAa,GAAK,CAAC,EAAK,EAAU,CAAC,CAAO,CAAM,OAAK,MAAM,CAAC,QAAQ,cAAc,gBAAgB,WAAW,gBAAgB,EAAE,SAAS,SAAS,aAAa,WAAqB,YAAU,CA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