{"version":3,"file":"Simple_Bar_Chart.DTPPLwoH.mjs","names":["useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/o0vTBmTauAZrNcf2qar3/erxcBa2xSM3nO1JOlxJw/Simple_Bar_Chart.js"],"sourcesContent":["\"use client\";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{m,useInView,LazyMotion,domAnimation}from\"framer-motion\";import{useRef}from\"react\";// -------------------------------------------------- //\n// FRAMER PROPERTY CONTROLS\n// -------------------------------------------------- //\nconst defaultData=[{value:80,color:\"#f0591a\",hoverColor:\"#e84602\",useGradient:true,gradientColor:\"#ff8f59\",hoverGradientColor:\"#ff8f59\"},{value:65,color:\"#FF9F1C\",hoverColor:\"#ff9300\",useGradient:true,gradientColor:\"#FFBD43\",hoverGradientColor:\"#FFBD43\"},{value:45,color:\"#2EC4B6\",hoverColor:\"#059688\",useGradient:true,gradientColor:\"#50F9E8\",hoverGradientColor:\"#50F9E8\"},{value:30,color:\"#666666\",hoverColor:\"#4d4d4d\",useGradient:true,gradientColor:\"#9A9A9A\",hoverGradientColor:\"#9A9A9A\"},{value:15,color:\"#d3d3d3\",hoverColor:\"#b3b3b3\",useGradient:true,gradientColor:\"#ffffff\",hoverGradientColor:\"#ffffff\"}];addPropertyControls(SimpleBarChartFramer,{data:{type:ControlType.Array,title:\"Data\",control:{type:ControlType.Object,controls:{value:{type:ControlType.Number,defaultValue:25},color:{type:ControlType.Color,defaultValue:\"#f0591a\"},hoverColor:{type:ControlType.Color,defaultValue:\"#e84602\"},useGradient:{type:ControlType.Boolean,defaultValue:false,title:\"Use Gradient\"},gradientColor:{type:ControlType.Color,defaultValue:\"#ff8f59\",title:\"Gradient Color\",hidden:props=>!props.useGradient,description:\"The color on the bottom of the bar gradient\"},hoverGradientColor:{type:ControlType.Color,defaultValue:\"#ff6b26\",title:\"Hover Gradient Color\",hidden:props=>!props.useGradient,description:\"The color on the bottom of the bar gradient when hovered\"}}},defaultValue:defaultData},inViewAnimation:{type:ControlType.Object,title:\"In View Animation\",controls:{once:{type:ControlType.Boolean,title:\"Once\",defaultValue:true,description:\"If yes, the animation will only play once.\"},amount:{type:ControlType.Number,title:\"Amount in View\",defaultValue:.5,min:0,max:1,description:\"The amount of the component that must be in view to trigger the animation.\"},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{duration:.5,ease:\"easeOut\"}},delayBetweenValues:{type:ControlType.Number,title:\"Delay Between Values\",defaultValue:.1,min:0,max:1,step:.01}},defaultValue:{once:true,amount:.5,transition:{delay:0,duration:.5,ease:[.44,0,.56,1],type:\"tween\"},delayBetweenValues:.1}},hoverAnimation:{type:ControlType.Object,title:\"Hover Animation\",controls:{scale:{type:ControlType.Number,title:\"Scale\",min:1,max:1.5,step:.01,defaultValue:1.025},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{duration:.2,ease:\"easeOut\"}}},defaultValue:{scale:1.025,transition:{duration:.2,ease:\"easeOut\"}}},barSpacing:{type:ControlType.Number,title:\"Bar Spacing\",defaultValue:2,min:0,max:20,step:.1},barRadius:{type:ControlType.Number,title:\"Bar Radius\",defaultValue:1,min:0,max:20,step:.1}});// -------------------------------------------------- //\n// MAIN COMPONENT\n// -------------------------------------------------- //\n/**\n * @Copyright © David McBacon | Bachoff Studio\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight 300\n * @framerIntrinsicWidth 400\n * @framerDisableUnlink\n */export default function SimpleBarChartFramer(props){const isOnFramerCanvas=RenderTarget.hasRestrictions();const ref=useRef(null);const isInView=useInView(ref,{once:props.inViewAnimation.once,amount:props.inViewAnimation.amount});const correctData=props.data.length===0?defaultData:props.data;const maxValue=Math.max(...correctData.map(item=>item.value));const barWidth=(100-(correctData.length+1)*props.barSpacing)/correctData.length;return /*#__PURE__*/_jsx(LazyMotion,{features:domAnimation,children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsxs(\"svg\",{ref:ref,width:\"100%\",height:\"100%\",viewBox:\"0 0 100 100\",preserveAspectRatio:\"none\",style:{overflow:\"visible\"},children:[/*#__PURE__*/_jsx(\"defs\",{children:correctData.map((item,index)=>item.useGradient&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"linearGradient\",{id:`barGradient-${index}`,x1:\"0\",y1:\"0\",x2:\"0\",y2:\"1\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:item.color}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:item.gradientColor||item.color})]},`gradient-${index}`),/*#__PURE__*/_jsxs(\"linearGradient\",{id:`barHoverGradient-${index}`,x1:\"0\",y1:\"0\",x2:\"0\",y2:\"1\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:item.hoverColor}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:item.hoverGradientColor||item.hoverColor})]},`hover-gradient-${index}`)]}))}),correctData.map((item,index)=>{const barHeight=item.value/maxValue*80;const x=props.barSpacing+index*(barWidth+props.barSpacing);const y=100-barHeight;return /*#__PURE__*/_jsx(\"g\",{children:/*#__PURE__*/_jsx(m.rect,{x:x,y:y,width:barWidth,height:barHeight,rx:props.barRadius,ry:props.barRadius,fill:item.useGradient?`url(#barGradient-${index})`:item.color,initial:{scaleY:isOnFramerCanvas?1:0,opacity:isOnFramerCanvas?1:0},animate:{scaleY:isInView?1:0,opacity:isInView?1:0},whileHover:{fill:item.useGradient?`url(#barHoverGradient-${index})`:item.hoverColor,scale:props.hoverAnimation.scale,transition:props.hoverAnimation.transition},transition:{scaleY:{...props.inViewAnimation.transition,delay:index*props.inViewAnimation.delayBetweenValues},opacity:{...props.inViewAnimation.transition,delay:index*props.inViewAnimation.delayBetweenValues}}})},index);})]})})});}SimpleBarChartFramer.displayName=\"BAR CHART - BACHOFF STUDIO\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SimpleBarChartFramer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"300\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Simple_Bar_Chart.map"],"mappings":"qQAaG,SAAwB,EAAqB,EAAM,CAAC,IAAM,EAAiB,EAAa,iBAAiB,CAAO,EAAIA,EAAO,KAAK,CAAO,EAAS,EAAU,EAAI,CAAC,KAAK,EAAM,gBAAgB,KAAK,OAAO,EAAM,gBAAgB,OAAO,CAAC,CAAO,EAAY,EAAM,KAAK,SAAS,EAAE,EAAY,EAAM,KAAW,EAAS,KAAK,IAAI,GAAG,EAAY,IAAI,GAAM,EAAK,MAAM,CAAC,CAAO,GAAU,KAAK,EAAY,OAAO,GAAG,EAAM,YAAY,EAAY,OAAO,OAAoB,EAAK,EAAW,CAAC,SAAS,EAAa,SAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,CAAC,SAAsB,EAAM,MAAM,CAAK,MAAI,MAAM,OAAO,OAAO,OAAO,QAAQ,cAAc,oBAAoB,OAAO,MAAM,CAAC,SAAS,UAAU,CAAC,SAAS,CAAc,EAAK,OAAO,CAAC,SAAS,EAAY,KAAK,EAAK,IAAQ,EAAK,aAA0B,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAM,iBAAiB,CAAC,GAAG,eAAe,IAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,SAAS,CAAc,EAAK,OAAO,CAAC,OAAO,KAAK,UAAU,EAAK,MAAM,CAAC,CAAc,EAAK,OAAO,CAAC,OAAO,OAAO,UAAU,EAAK,eAAe,EAAK,MA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