{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/VqaHB3gIRuIUtWjo3LNk/7APsVvTxh9wM4MAEGPy4/Checkbox.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useState, useEffect } from \"react\";\nimport { addPropertyControls, ControlType, motion, RenderTarget } from \"framer\";\nimport { colorTokentoValue } from \"https://framer.com/m/framer/default-utils.js@^0.45.0\";\nasync function handleActions(callbacks) {\n  for (const cb of callbacks) {\n    if (!cb) continue;\n    const value = await cb();\n    if (value === false) break;\n  }\n} /**\n  * CHECKBOX\n  *\n  * @framerIntrinsicWidth 20\n  * @framerIntrinsicHeight 20\n  *\n  * @framerSupportedLayoutWidth fixed\n  * @framerSupportedLayoutHeight fixed\n  */\nexport function Checkbox(props) {\n  let {\n    activeBackground,\n    onToggle,\n    onCheck,\n    onUncheck,\n    isChecked,\n    radius,\n    topLeft,\n    topRight,\n    bottomRight,\n    bottomLeft,\n    isMixed,\n    checkSize,\n    color,\n    inactiveBackground,\n    inactiveBorder,\n    activeBorder,\n    hasBorder,\n    borderWidth,\n    transition,\n    backgroundTransition,\n    initialAnimation,\n    disabled,\n    joinType,\n    strokeWidth\n  } = props;\n  const [checked, setChecked] = useState(isChecked);\n  const borderRadius = isMixed ? `${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px` : `${radius}px`;\n  useEffect(() => {\n    setChecked(isChecked);\n  }, [isChecked]);\n  initialAnimation = RenderTarget.current() !== RenderTarget.preview ? false : initialAnimation;\n  const inactiveBorderStyle = `${borderWidth}px solid ${colorTokentoValue(inactiveBorder)}`;\n  const activeBorderStyle = `${borderWidth}px solid ${colorTokentoValue(activeBorder)}`;\n  const animationBuffer = 15;\n  const pathLength = 8.5;\n  return /*#__PURE__*/_jsx(\"div\", {\n    style: containerStyle,\n    \"data-framer-highlight\": !disabled,\n    children: /*#__PURE__*/_jsx(motion.div, {\n      // @ts-ignore\n      style: {\n        ...checkboxStyle,\n        borderRadius\n      },\n      initial: initialAnimation ? {\n        background: checked ? colorTokentoValue(inactiveBackground) : colorTokentoValue(activeBackground)\n      } : false,\n      animate: {\n        background: checked ? colorTokentoValue(activeBackground) : colorTokentoValue(inactiveBackground),\n        border: hasBorder ? checked ? activeBorderStyle : inactiveBorderStyle : \"none\"\n      },\n      transition: backgroundTransition,\n      onTap: () => {\n        if (disabled) return;\n        handleActions([() => onToggle && onToggle(!checked), onCheck, onUncheck, () => setChecked(!checked)]);\n      },\n      children: /*#__PURE__*/_jsx(\"svg\", {\n        viewBox: \"0 0 12 12\",\n        style: {\n          margin: 1,\n          width: `${checkSize}%`,\n          height: `${checkSize}%`\n        },\n        children: /*#__PURE__*/_jsx(motion.path, {\n          d: \"M3 6l2 2 4-4\",\n          fill: \"transparent\",\n          strokeWidth: strokeWidth,\n          stroke: color,\n          strokeLinecap: \"round\",\n          strokeLinejoin: joinType,\n          strokeDasharray: pathLength + animationBuffer,\n          transition: transition,\n          initial: {\n            strokeDashoffset: initialAnimation ? checked ? pathLength + animationBuffer : animationBuffer : checked ? animationBuffer : pathLength + animationBuffer\n          },\n          // initial={false}\n          animate: {\n            strokeDashoffset: checked ? animationBuffer : pathLength + animationBuffer + 3\n          }\n        })\n      })\n    })\n  });\n}\nCheckbox.defaultProps = {\n  height: 20,\n  width: 20,\n  text: \"Get started!\",\n  activeBackground: \"#0099ff\",\n  activeBorder: \"#0066FF\",\n  inactiveBackground: \"#EBEBEB\",\n  inactiveBorder: \"#a5a5a5\",\n  hasBorder: false,\n  radius: 5,\n  isChecked: true,\n  borderWidth: 1,\n  strokeWidth: 1.5,\n  joinType: \"round\",\n  checkSize: 100,\n  color: \"white\",\n  initialAnimation: false,\n  disabled: false,\n  transition: {\n    duration: 0.15,\n    ease: [0.12, 0.23, 0.5, 1],\n    type: \"tween\"\n  },\n  backgroundTransition: {\n    duration: 0.15,\n    ease: [0.12, 0.23, 0.5, 1],\n    type: \"tween\"\n  }\n}; // Learn more: https://framer.com/api/property-controls/\naddPropertyControls(Checkbox, {\n  isChecked: {\n    title: \"Checked\",\n    type: ControlType.Boolean,\n    defaultValue: true,\n    enabledTitle: \"Yes\",\n    disabledTitle: \"No\"\n  },\n  disabled: {\n    title: \"Disabled\",\n    type: ControlType.Boolean,\n    enabledTitle: \"Yes\",\n    disabledTitle: \"No\"\n  },\n  hasBorder: {\n    title: \"Border\",\n    type: ControlType.Boolean,\n    enabledTitle: \"Yes\",\n    disabledTitle: \"No\"\n  },\n  borderWidth: {\n    title: \"Width\",\n    type: ControlType.Number,\n    defaultValue: Checkbox.defaultProps.borderWidth,\n    hidden: ({\n      hasBorder\n    }) => !hasBorder\n  },\n  activeBorder: {\n    title: \"Active\",\n    type: ControlType.Color,\n    defaultValue: Checkbox.defaultProps.activeBackground,\n    hidden: ({\n      hasBorder\n    }) => !hasBorder\n  },\n  inactiveBorder: {\n    title: \"Inactive\",\n    type: ControlType.Color,\n    defaultValue: Checkbox.defaultProps.inactiveBackground,\n    hidden: ({\n      hasBorder\n    }) => !hasBorder\n  },\n  activeBackground: {\n    title: \"Active\",\n    type: ControlType.Color,\n    defaultValue: Checkbox.defaultProps.activeBackground\n  },\n  inactiveBackground: {\n    title: \"Inactive\",\n    type: ControlType.Color,\n    defaultValue: Checkbox.defaultProps.inactiveBackground\n  },\n  color: {\n    title: \"Check\",\n    type: ControlType.Color,\n    defaultValue: Checkbox.defaultProps.color\n  },\n  checkSize: {\n    title: \"Check Size\",\n    type: ControlType.Number,\n    unit: \"%\",\n    min: 0,\n    max: 100,\n    defaultValue: Checkbox.defaultProps.checkSize\n  },\n  joinType: {\n    title: \"Corner\",\n    type: ControlType.Enum,\n    displaySegmentedControl: true,\n    options: [\"miter\", \"round\"],\n    optionTitles: [\"Square\", \"Round\"]\n  },\n  strokeWidth: {\n    title: \"Thickness\",\n    type: ControlType.Number,\n    min: 1,\n    max: 5,\n    step: 0.5,\n    displayStepper: true\n  },\n  radius: {\n    title: \"Radius\",\n    type: ControlType.FusedNumber,\n    defaultValue: Checkbox.defaultProps.radius,\n    toggleKey: \"isMixed\",\n    toggleTitles: [\"Radius\", \"Radius per corner\"],\n    valueKeys: [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"],\n    valueLabels: [\"TL\", \"TR\", \"BR\", \"BL\"],\n    min: 0\n  },\n  transition: {\n    title: \"Check\",\n    type: ControlType.Transition,\n    defaultValue: Checkbox.defaultProps.transition\n  },\n  backgroundTransition: {\n    title: \"Fill\",\n    type: ControlType.Transition,\n    defaultValue: Checkbox.defaultProps.transition\n  },\n  initialAnimation: {\n    title: \"On Load\",\n    type: ControlType.Boolean,\n    enabledTitle: \"Animate\",\n    disabledTitle: \"Instant\"\n  },\n  onToggle: {\n    type: ControlType.EventHandler\n  },\n  onCheck: {\n    type: ControlType.EventHandler\n  },\n  onUncheck: {\n    type: ControlType.EventHandler\n  }\n});\nconst containerStyle = {\n  display: \"flex\",\n  justifyContent: \"center\",\n  alignItems: \"center\",\n  height: \"100%\",\n  width: \"100%\",\n  position: \"absolute\",\n  left: 0,\n  right: 0,\n  top: 0,\n  bottom: 0\n};\nconst checkboxStyle = {\n  width: \"100%\",\n  height: \"100%\",\n  borderRadius: 6,\n  display: \"flex\",\n  justifyContent: \"center\",\n  alignItems: \"center\",\n  cursor: \"pointer\",\n  WebkitTapHighlightColor: \"rgba(0, 0, 0, 0)\"\n};\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"Checkbox\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Checkbox\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerSupportedLayoutWidth\": \"fixed\",\n        \"framerIntrinsicWidth\": \"20\",\n        \"framerIntrinsicHeight\": \"20\",\n        \"framerSupportedLayoutHeight\": \"fixed\",\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"CheckboxProps\": {\n      \"type\": \"tsType\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\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pB,MAAO,OACP,KAAM0C,EAAY,WAClB,aAAc1C,EAAS,aAAa,UACtC,EACA,iBAAkB,CAChB,MAAO,UACP,KAAM0C,EAAY,QAClB,aAAc,UACd,cAAe,SACjB,EACA,SAAU,CACR,KAAMA,EAAY,YACpB,EACA,QAAS,CACP,KAAMA,EAAY,YACpB,EACA,UAAW,CACT,KAAMA,EAAY,YACpB,CACF,CAAC,EACD,IAAMJ,EAAiB,CACrB,QAAS,OACT,eAAgB,SAChB,WAAY,SACZ,OAAQ,OACR,MAAO,OACP,SAAU,WACV,KAAM,EACN,MAAO,EACP,IAAK,EACL,OAAQ,CACV,EACME,EAAgB,CACpB,MAAO,OACP,OAAQ,OACR,aAAc,EACd,QAAS,OACT,eAAgB,SAChB,WAAY,SACZ,OAAQ,UACR,wBAAyB,kBAC3B",
  "names": ["handleActions", "callbacks", "cb", "Checkbox", "props", "activeBackground", "onToggle", "onCheck", "onUncheck", "isChecked", "radius", "topLeft", "topRight", "bottomRight", "bottomLeft", "isMixed", "checkSize", "color", "inactiveBackground", "inactiveBorder", "activeBorder", "hasBorder", "borderWidth", "transition", "backgroundTransition", "initialAnimation", "disabled", "joinType", "strokeWidth", "checked", "setChecked", "ye", "borderRadius", "ue", "RenderTarget", "inactiveBorderStyle", "colorTokentoValue", "activeBorderStyle", "animationBuffer", "pathLength", "p", "containerStyle", "motion", "checkboxStyle", "addPropertyControls", "ControlType"]
}
