{"version":3,"file":"DashLine.ht-KBOeb.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/KfRtsSxv2OAHs6Smx4z2/h8rXf2mKcRmaNrCkGYHZ/DashLine.js"],"sourcesContent":["// Dash line component with customizable style, orientation, and spacing\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,useInView}from\"framer-motion\";import{useRef}from\"react\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 20\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function DashLine(props){const{orientation=\"horizontal\",dashLength=10,gapLength=5,thickness=2,color=\"#000000\",animationDirectionHorizontal=\"forward\",animationDirectionVertical=\"forward\",transition}=props;const ref=useRef(null);const isInView=useInView(ref,{once:true,amount:.3});const isCanvas=RenderTarget.current()===RenderTarget.canvas;const shouldAnimate=!isCanvas;const isHorizontal=orientation===\"horizontal\";const animationDirection=isHorizontal?animationDirectionHorizontal:animationDirectionVertical;// Check if component is auto-sized\nconst isAutoWidth=!props.style?.width||props.style.width!==\"100%\";const isAutoHeight=!props.style?.height||props.style.height!==\"100%\";// Set minimum dimensions for auto-sized components\nconst minWidth=isHorizontal?50:Math.max(thickness,5);const minHeight=isHorizontal?Math.max(thickness,5):50;// Animation variants for single direction\nconst getAnimationVariants=()=>{if(animationDirection===\"centerOutward\")return{};const isForward=animationDirection===\"forward\";if(isHorizontal){// Horizontal: forward = left to right, backward = right to left\nreturn{hidden:{clipPath:isForward?\"inset(0 100% 0 0)\":\"inset(0 0 0 100%)\"},visible:{clipPath:\"inset(0 0 0 0)\",transition:transition||{duration:.8,ease:\"easeOut\"}}};}else{// Vertical: forward = top to bottom, backward = bottom to top\nreturn{hidden:{clipPath:isForward?\"inset(0 0 100% 0)\":\"inset(100% 0 0 0)\"},visible:{clipPath:\"inset(0 0 0 0)\",transition:transition||{duration:.8,ease:\"easeOut\"}}};}};// Center outward animation variants\nconst centerOutwardVariants={hidden:{clipPath:isHorizontal?\"inset(0 50% 0 50%)\":\"inset(50% 0 50% 0)\"},visible:{clipPath:\"inset(0 0 0 0)\",transition:transition||{duration:.8,ease:\"easeOut\"}}};const dashStyle={width:isHorizontal?\"100%\":`${thickness}px`,height:isHorizontal?`${thickness}px`:\"100%\",background:`repeating-linear-gradient(\n            ${isHorizontal?\"to right\":\"to bottom\"},\n            ${color} 0px,\n            ${color} ${dashLength}px,\n            transparent ${dashLength}px,\n            transparent ${dashLength+gapLength}px\n        )`};return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...props.style,position:\"relative\",width:isAutoWidth?`${minWidth}px`:\"100%\",height:isAutoHeight?`${minHeight}px`:\"100%\",minWidth:isAutoWidth?`${minWidth}px`:undefined,minHeight:isAutoHeight?`${minHeight}px`:undefined,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(motion.div,{style:dashStyle,variants:animationDirection===\"centerOutward\"?centerOutwardVariants:getAnimationVariants(),initial:shouldAnimate?\"hidden\":\"visible\",animate:shouldAnimate&&isInView?\"visible\":shouldAnimate?\"hidden\":\"visible\"})});}addPropertyControls(DashLine,{orientation:{type:ControlType.Enum,title:\"Orientation\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"↔\",\"↕\"],defaultValue:\"horizontal\",displaySegmentedControl:true},animationDirectionHorizontal:{type:ControlType.Enum,title:\"Animation\",options:[\"forward\",\"backward\",\"centerOutward\"],optionTitles:[\"Left to Right\",\"Right to Left\",\"Center\"],defaultValue:\"forward\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",hidden:props=>props.orientation===\"vertical\"},animationDirectionVertical:{type:ControlType.Enum,title:\"Animation\",options:[\"forward\",\"backward\",\"centerOutward\"],optionTitles:[\"Top to Bottom\",\"Bottom to Top\",\"Center\"],defaultValue:\"forward\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",hidden:props=>props.orientation===\"horizontal\"},transition:{type:ControlType.Transition,title:\"Transition\"},dashLength:{type:ControlType.Number,title:\"Dash Length\",defaultValue:10,min:1,max:50,step:1,unit:\"px\",displayStepper:true},gapLength:{type:ControlType.Number,title:\"Gap Length\",defaultValue:5,min:1,max:50,step:1,unit:\"px\",displayStepper:true},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:2,min:1,max:20,step:1,unit:\"px\",displayStepper:true},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\",description:\"More resources at [Velox Themes](https://veloxthemes.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DashLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"20\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DashLine.map"],"mappings":"yOAOG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,cAAY,aAAa,aAAW,GAAG,YAAU,EAAE,YAAU,EAAE,QAAM,UAAU,+BAA6B,UAAU,6BAA2B,UAAU,cAAY,EAAY,EAAIA,EAAO,KAAK,CAAO,EAAS,EAAU,EAAI,CAAC,KAAK,GAAK,OAAO,GAAG,CAAC,CAAmE,EAAnD,EAAa,SAAS,GAAG,EAAa,OAA2C,EAAa,IAAc,aAAmB,EAAmB,EAAa,EAA6B,EAC9e,EAAY,CAAC,EAAM,OAAO,OAAO,EAAM,MAAM,QAAQ,OAAa,EAAa,CAAC,EAAM,OAAO,QAAQ,EAAM,MAAM,SAAS,OAC1H,EAAS,EAAa,GAAG,KAAK,IAAI,EAAU,EAAE,CAAO,EAAU,EAAa,KAAK,IAAI,EAAU,EAAE,CAAC,GAClG,MAAyB,CAAC,GAAG,IAAqB,gBAAgB,MAAM,EAAE,CAAC,IAAM,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