{"version":3,"file":"Counter.vPs6FGJS.mjs","names":["useState","Minus","Plus"],"sources":["https:/framerusercontent.com/modules/6QmV9C6Gx7kIyZpG4DVn/Ez36sN7uL3ckVlxWn7zu/Counter.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{Plus,Minus}from\"lucide-react\";import{motion}from\"framer-motion\";import{cn}from\"https://framerusercontent.com/modules/eAejHXy6apg0StNmpKvK/GXn1lJ5V4nUwhRO9yQKC/_framer_utils.js\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Counter({onChange=()=>false,count,min=0,loading=false,styles={}}){const[state,setState]=useState(1);useEffect(()=>{if(count!==state&&count!==undefined)setState(count);},[count]);return /*#__PURE__*/_jsxs(\"div\",{style:cn(style.container,styles,loading&&style.loading),children:[/*#__PURE__*/_jsx(motion.button,{whileHover:{scale:1.15},style:style.button,disabled:loading||state<=min,onClick:()=>{const c=Math.max(state-1,min);setState(c);onChange(c);},children:/*#__PURE__*/_jsx(Minus,{size:styles.iconSize,color:styles.iconColor})}),/*#__PURE__*/_jsx(\"span\",{children:state}),/*#__PURE__*/_jsx(motion.button,{whileHover:{scale:1.15},style:style.button,disabled:loading,onClick:()=>{const c=state+1;setState(c);onChange(c);},children:/*#__PURE__*/_jsx(Plus,{size:styles.iconSize,color:styles.iconColor})})]});}export const CounterPropertyControls={fontSize:{type:ControlType.Number,min:8,max:100,defaultValue:16},gap:{type:ControlType.Number,defaultValue:14,min:0},color:{type:ControlType.Color,defaultValue:\"#000\"},backgroundColor:{type:ControlType.Color,optional:true},font:{type:ControlType.Font},border:{type:ControlType.Border,defaultValue:{borderWidth:1,borderColor:\"#DBDBDB\"}},borderRadius:{type:ControlType.BorderRadius,defaultValue:\"24px\"},padding:{type:ControlType.Padding,defaultValue:\"6px 14px 6px 14px\"},iconColor:{type:ControlType.Color,defaultValue:\"#919191\"},iconSize:{type:ControlType.Number,defaultValue:16,min:0}};addPropertyControls(Counter,{styles:{type:ControlType.Object,controls:CounterPropertyControls}});const style={container:{display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:\"center\"},button:{backgroundColor:\"transparent\",border:\"none\",padding:0,margin:0,cursor:\"pointer\"},loading:{opacity:.6,cursor:\"wait\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"CounterPropertyControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Counter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"mVAIG,SAAwB,EAAQ,CAAC,eAAa,GAAM,QAAM,MAAI,EAAE,UAAQ,GAAM,SAAO,EAAE,EAAE,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,EAAE,CAA+E,OAA9E,MAAc,CAAI,IAAQ,GAAO,IAAQ,IAAA,IAAU,EAAS,EAAM,EAAG,CAAC,EAAM,CAAC,CAAqB,EAAM,MAAM,CAAC,MAAM,EAAG,EAAM,UAAU,EAAO,GAAS,EAAM,QAAQ,CAAC,SAAS,CAAc,EAAK,EAAO,OAAO,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,MAAM,EAAM,OAAO,SAAS,GAAS,GAAO,EAAI,YAAY,CAAC,IAAM,EAAE,KAAK,IAAI,EAAM,EAAE,EAAI,CAAC,EAAS,EAAE,CAAC,EAAS,EAAE,EAAG,SAAsB,EAAKC,EAAM,CAAC,KAAK,EAAO,SAAS,MAAM,EAAO,UAAU,CAAC,CAAC,CAAC,CAAc,EAAK,OAAO,CAAC,SAAS,EAAM,CAAC,CAAc,EAAK,EAAO,OAAO,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,MAAM,EAAM,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