{"version":3,"file":"TrackLine.KyCzztpU.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/EpKOyZJ97jXv1XDGwDwZ/rv1DtA36RKB2BtEY39JY/TrackLine.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef}from\"react\";import{motion,useScroll,useTransform,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * SCROLL GROW LINE\n * A thin vertical line whose fill grows downward as you scroll through it.\n *\n * How to use in Framer:\n * 1. Add this as a Code Component (Assets → + → New → Code File, paste this in).\n * 2. Drop the component on the canvas in your stepper column.\n * 3. Stretch it to the FULL HEIGHT of the section you want the line to track\n *    (e.g. from the first step to the last). The component measures its own\n *    top/bottom against the viewport, so its height defines the scroll range.\n * 4. Tune Start/End in the property panel to control when it begins and\n *    finishes filling.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ScrollGrowLine(props){const{color,trackColor,thickness,align,startOffset,endOffset,smooth}=props;const ref=useRef(null);// Progress = 0 when the line's top reaches `startOffset`% down the viewport,\n// 1 when its bottom reaches `endOffset`% down the viewport.\nconst{scrollYProgress}=useScroll({target:ref,offset:[`start ${startOffset}%`,`end ${endOffset}%`]});const smoothed=useSpring(scrollYProgress,{stiffness:120,damping:30,restDelta:.001});const progress=smooth?smoothed:scrollYProgress;const scaleY=useTransform(progress,[0,1],[0,1]);// horizontal placement of the line within the component's width\nconst left=align===\"left\"?\"0%\":align===\"right\"?\"100%\":\"50%\";const shift=align===\"left\"?\"0%\":align===\"right\"?\"-100%\":\"-50%\";const rail={position:\"absolute\",top:0,left,width:thickness,height:\"100%\",borderRadius:thickness};return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{...rail,transform:`translateX(${shift})`,background:trackColor}}),/*#__PURE__*/_jsx(motion.div,{style:{...rail,x:shift,background:color,transformOrigin:\"top\",scaleY}})]});}ScrollGrowLine.defaultProps={color:\"#FFFFFF\",trackColor:\"rgba(255,255,255,0.12)\",thickness:1,align:\"center\",startOffset:85,endOffset:15,smooth:true};addPropertyControls(ScrollGrowLine,{color:{type:ControlType.Color,title:\"Fill\"},trackColor:{type:ControlType.Color,title:\"Track\"},thickness:{type:ControlType.Number,title:\"Thickness\",min:1,max:20,step:1,unit:\"px\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true},startOffset:{type:ControlType.Number,title:\"Start\",min:0,max:100,unit:\"%\",description:\"Fills from when the top hits this point down the viewport\"},endOffset:{type:ControlType.Number,title:\"End\",min:0,max:100,unit:\"%\",description:\"Full when the bottom hits this point down the viewport\"},smooth:{type:ControlType.Boolean,title:\"Smooth\",enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollGrowLine\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TrackLine.map"],"mappings":"2PAeG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,aAAW,YAAU,QAAM,cAAY,YAAU,UAAQ,EAAY,EAAIA,EAAO,IAAI,EAE5I,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAI,OAAO,CAAC,SAAS,EAAY,GAAG,OAAO,EAAU,EAAE,CAAC,CAAC,EAAQ,EAAS,EAAU,EAAgB,CAAC,UAAU,IAAI,QAAQ,GAAG,UAAU,IAAI,CAAC,EAAuD,EAAO,EAA7C,EAAO,EAAS,EAAmD,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC/Q,EAAK,IAAQ,OAAO,KAAK,IAAQ,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