{"version":3,"file":"DashedLine.UKaWT1pY.mjs","names":["useRef","useState","__esmMin","window","le","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","addPropertyControls","init_framer_BWFVvmND","ControlType","DashedLine","props","horizontal","direction","wrapRef","offset","setOffset","el","period","dash","gap","align","rect","scale","left","bleed","BLEED","observer","half","thickness","bleeding","color","init_DashedLine","init_jsx_runtime","p"],"sources":["https:/framerusercontent.com/modules/qN0LKpveUGIFLvKVibHR/CyZcqnRzOmKpCqKoc8Wt/DashedLine.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useLayoutEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const BLEED=4e3;/**\n * A dashed rule with adjustable dash length and spacing, which a plain CSS\n * dashed border can't do. Stretch it to fill its frame.\n *\n * Horizontal dashes are lined up with the page edge, so overlapping lines\n * (one per grid cell) merge into a single clean dashed line.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function DashedLine(props){const{direction,color,dash,gap,thickness,bleed}=props;const horizontal=direction===\"horizontal\";const wrapRef=useRef(null);const[offset,setOffset]=useState(0);// Keep the dash pattern aligned to the page edge so lines that overlap\n// (for example one per grid cell) merge into a single clean line.\nuseLayoutEffect(()=>{const el=wrapRef.current;if(!el||!horizontal||typeof window===\"undefined\")return;const period=dash+gap;const align=()=>{const rect=el.getBoundingClientRect();// Undo canvas zoom so the phase is measured in CSS pixels\nconst scale=el.offsetWidth>0?rect.width/el.offsetWidth:1;const left=rect.left/(scale||1)+window.scrollX-(bleed?BLEED:0);setOffset((left%period+period)%period);};align();const observer=new ResizeObserver(align);observer.observe(el);observer.observe(document.body);return()=>observer.disconnect();},[horizontal,bleed,dash,gap]);// An SVG stroke has no practical length limit, unlike a CSS\n// repeating-linear-gradient which stops rendering on long lines.\n// \"Full Bleed\" extends the line far past both sides of its frame; the page\n// frame clips the excess, so it always reaches the edges.\nconst half=thickness/2;const bleeding=horizontal&&bleed;return /*#__PURE__*/_jsx(\"div\",{ref:wrapRef,\"aria-hidden\":true,style:{position:\"relative\",width:horizontal?\"100%\":thickness,height:horizontal?thickness:\"100%\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{style:{display:\"block\",position:bleeding?\"absolute\":\"static\",top:0,left:bleeding?-BLEED:undefined,width:bleeding?`calc(100% + ${BLEED*2}px)`:horizontal?\"100%\":thickness,height:horizontal?thickness:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"line\",{x1:horizontal?0:half,x2:horizontal?\"100%\":half,y1:horizontal?half:0,y2:horizontal?half:\"100%\",stroke:color,strokeWidth:thickness,strokeDasharray:`${dash} ${gap}`,strokeDashoffset:horizontal?offset:0,shapeRendering:\"crispEdges\"})})});}DashedLine.defaultProps={direction:\"horizontal\",color:\"rgb(218, 221, 230)\",dash:4,gap:6,thickness:1,bleed:false};addPropertyControls(DashedLine,{direction:{type:ControlType.Enum,title:\"Direction\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],displaySegmentedControl:true,defaultValue:\"horizontal\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgb(218, 221, 230)\"},dash:{type:ControlType.Number,title:\"Dash\",min:1,max:40,step:1,unit:\"px\",defaultValue:4},gap:{type:ControlType.Number,title:\"Gap\",min:1,max:40,step:1,unit:\"px\",defaultValue:6},thickness:{type:ControlType.Number,title:\"Thickness\",min:1,max:4,step:1,unit:\"px\",defaultValue:1},bleed:{type:ControlType.Boolean,title:\"Full Bleed\",defaultValue:false,hidden:p=>p.direction!==\"horizontal\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DashedLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DashedLine.map"],"mappings":"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