{"version":3,"file":"DimLine.BeDLjLWL.mjs","names":["React.useRef","React.useState","__esmMin","_e","de","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","init_framer_BkYB2Gqq","addPropertyControls","ControlType","RenderTarget","DimLine","props","onCanvas","ref","w","setW","shown","setShown","el","measure","ro","io","es","text","label","style","CSS","init_DimLine"],"sources":["https:/framerusercontent.com/modules/qvW5Hyxkflxsqbm5Ao1n/L4tgK9PxkAJcyydAb1Zy/DimLine.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * DimLine — an architectural dimension line drawn above a statement: a hairline with end ticks\n * and a label that MEASURES ITSELF — \"4,100 ft² — 6.38 m at 1:100\" (its own width in px ÷ 100).\n * The two halves draw outwards from the label when it scrolls into view.\n *\n * Place it directly above the statement it measures, width Fill (same column as the text),\n * height 14. Used on: project pages (label = the project's size, CMS-bound), Team (\"One desk\"),\n * Digital Lab (\"Model scale 1:1\").\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 520\n * @framerIntrinsicHeight 14\n * @framerDisableUnlink\n */export default function DimLine(props){const{label=\"One desk\",color=\"#64615C\",style}=props;const onCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=React.useRef(null);const[w,setW]=React.useState(0);const[shown,setShown]=React.useState(false);React.useEffect(()=>{const el=ref.current;if(!el)return;const measure=()=>setW(el.getBoundingClientRect().width);measure();const ro=typeof ResizeObserver!==\"undefined\"?new ResizeObserver(measure):null;ro&&ro.observe(el);let io=null;if(!onCanvas&&typeof IntersectionObserver!==\"undefined\"){io=new IntersectionObserver(es=>es.some(e=>e.isIntersecting)&&(setShown(true),io&&io.disconnect()),{rootMargin:\"0px 0px -10% 0px\"});io.observe(el);}else setShown(true);return()=>{ro&&ro.disconnect();io&&io.disconnect();};},[onCanvas]);const text=(label?label+\" — \":\"\")+(w/100).toFixed(2)+\" m at 1:100\";return /*#__PURE__*/_jsxs(\"div\",{ref:ref,className:\"dl\"+(shown?\" is-in\":\"\"),\"aria-hidden\":\"true\",style:{...style,color},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),/*#__PURE__*/_jsx(\"i\",{}),/*#__PURE__*/_jsx(\"b\",{children:text}),/*#__PURE__*/_jsx(\"i\",{})]});}const CSS=`\n.dl{display:flex;align-items:center;gap:10px;height:14px;width:100%;font-family:\"Geist Mono\",\"Geist Mono Placeholder\",ui-monospace,monospace;font-size:10px;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;box-sizing:border-box}\n.dl i{flex:1;position:relative;height:1px;background:currentColor;opacity:.55;transform-origin:left;transform:scaleX(0);transition:transform 1.2s cubic-bezier(.16,1,.3,1) .15s}\n.dl i:last-child{transform-origin:right}\n.dl i::before,.dl i::after{content:\"\";position:absolute;top:-4px;width:1px;height:9px;background:currentColor}\n.dl i::before{left:0}.dl i::after{right:0}\n.dl i:first-child::after,.dl i:last-child::before{display:none}\n.dl b{font-weight:500;opacity:0;transform:translateY(4px);transition:opacity .6s cubic-bezier(.16,1,.3,1) .5s,transform .6s cubic-bezier(.16,1,.3,1) .5s}\n.dl.is-in i{transform:scaleX(1)}\n.dl.is-in b{opacity:1;transform:none}\n@media (prefers-reduced-motion:reduce){.dl i{transform:none;transition:none}.dl b{opacity:1;transform:none;transition:none}}\n`;addPropertyControls(DimLine,{label:{type:ControlType.String,defaultValue:\"One desk\",description:\"Shown before the measured width, e.g. the project size.\"},color:{type:ControlType.Color,defaultValue:\"#64615C\",description:\"Color/Grey on stone, Color/Grey Inverse on ink.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DimLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"520\",\"framerIntrinsicHeight\":\"14\",\"framerContractVers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