{"version":3,"file":"Checkbox.RdZ8yDLA.mjs","names":["useState","value"],"sources":["https:/framerusercontent.com/modules/LCISGuPgK3yvuMxxhNw7/E4VWpCVDKdWJ5FXW9rDl/Checkbox.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n *//**\n * @framerDisableUnlink\n */function FormCheckbox({native,value,checkedComponent,uncheckedComponent,onChange,name,label,layout,selected}){const defaultStyles={cursor:\"pointer\",display:\"flex\",gap:8,alignItems:\"start\",height:\"100%\",width:\"auto\",margin:0,padding:0};const[selectedValue,setSelectedValue]=useState(selected);const[labelStyle,setLabelStyle]=useState(defaultStyles);const handleChange=(e,value)=>{if(!native){e.preventDefault();}setSelectedValue(selectedValue?false:value);};const setFocusStyles=()=>{setLabelStyle({...defaultStyles,outline:\"1px solid var(--token-92aaba62-0189-4281-8a12-a59deebb62b8)\",outlineOffset:\"1px\"});};const removeFocusStyles=()=>{setLabelStyle(defaultStyles);};const getCustomComponent=()=>{if(native){return null;}else{return selectedValue?checkedComponent:uncheckedComponent;}};return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:layout.direction,justifyContent:layout.distribute,alignItems:layout.align,flexWrap:layout.wrap?\"wrap\":\"nowrap\",gap:layout.gap},children:[/*#__PURE__*/_jsx(\"input\",{type:\"Checkbox\",name:name,value:value,checked:selectedValue,onChange:e=>handleChange(e,value),style:{padding:0,margin:0,display:!native?\"none\":\"block\"}}),getCustomComponent(),/*#__PURE__*/_jsx(\"label\",{onClick:e=>handleChange(e,value),htmlFor:name,style:{...labelStyle,lineHeight:\"1rem\"},children:/*#__PURE__*/_jsx(\"span\",{id:`label-${value}`,style:{...label,lineHeight:\"1rem\",padding:0,margin:0},children:label.text})})]});}// Define default props to prevent errors when properties are not set\nFormCheckbox.defaultProps={value:\"checkbox\",checkedComponent:undefined,uncheckedComponent:undefined,name:\"radio-group\",label:{},layout:{},selected:false};// Define property controls which allow users to configure this component in Framer\naddPropertyControls(FormCheckbox,{native:{type:ControlType.Boolean,description:\"Set to false if you want to use custom components\"},name:{type:ControlType.String,title:\"Name\",description:\"Unique name for the checkbox\",defaultValue:\"my-checkbox\"},label:{type:ControlType.Object,title:\"Label\",description:\"Style of the labels\",controls:{text:{type:ControlType.String,defaultValue:\"HTML Checkbox\"},fontFamily:{type:ControlType.String,defaultValue:\"Inter\",title:\"Font Family\"},color:{type:ControlType.Color,defaultValue:\"#ffffff\"},fontSize:{type:ControlType.Number,defaultValue:14,title:\"Font Size\"}}},value:{type:ControlType.String,defaultValue:\"value\",description:\"The value that will be submitted\"},selected:{type:ControlType.Boolean,description:\"Set to true in order to pre select it.\"},layout:{type:ControlType.Object,title:\"Layout\",controls:{direction:{type:ControlType.Enum,defaultValue:\"row\",displaySegmentedControl:true,segmentedControlDirection:\"horizontal\",options:[\"row\",\"column\"],optionTitles:[\"Row\",\"Col\"]},distribute:{type:ControlType.Enum,defaultValue:\"start\",displaySegmentedControl:false,segmentedControlDirection:\"vertical\",options:[\"start\",\"center\",\"end\",\"space-between\",\"space-around\",\"space-evenly\"],optionTitles:[\"Start\",\"Center\",\"End\",\"Space between\",\"Space around\",\"Space evenly\"]},align:{type:ControlType.Enum,defaultValue:\"start\",displaySegmentedControl:false,segmentedControlDirection:\"vertical\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"]},wrap:{type:ControlType.Boolean,defaultValue:true,title:\"Wrap\"},gap:{type:ControlType.Number,displayStepper:true,step:1,title:\"Gap\"}}},checkedComponent:{type:ControlType.ComponentInstance,title:\"Checked\",hidden:props=>props.native},uncheckedComponent:{type:ControlType.ComponentInstance,title:\"Unchecked\",hidden:props=>props.native}});export default FormCheckbox;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormCheckbox\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Checkbox.map"],"mappings":"iLAQG,SAAS,EAAa,CAAC,SAAO,QAAM,mBAAiB,qBAAmB,WAAS,OAAK,QAAM,SAAO,YAAU,CAAC,IAAM,EAAc,CAAC,OAAO,UAAU,QAAQ,OAAO,IAAI,EAAE,WAAW,QAAQ,OAAO,OAAO,MAAM,OAAO,OAAO,EAAE,QAAQ,EAAE,CAAM,CAAC,EAAc,GAAkBA,EAAS,EAAS,CAAM,CAAC,EAAW,GAAeA,EAAS,EAAc,CAAO,GAAc,EAAE,IAAQ,CAAK,GAAQ,EAAE,gBAAgB,CAAE,EAAiB,EAAc,GAAMC,EAAM,EAA8U,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,cAAc,EAAO,UAAU,eAAe,EAAO,WAAW,WAAW,EAAO,MAAM,SAAS,EAAO,KAAK,OAAO,SAAS,IAAI,EAAO,IAAI,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,KAAK,WAAgB,OAAW,QAAM,QAAQ,EAAc,SAAS,GAAG,EAAa,EAAE,EAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAS,EAAc,QAAP,OAAe,CAAC,CAAC,MAAxd,EAAe,KAAkB,EAAc,EAAiB,IAA6a,CAAc,EAAK,QAAQ,CAAC,QAAQ,GAAG,EAAa,EAAE,EAAM,CAAC,QAAQ,EAAK,MAAM,CAAC,GAAG,EAAW,WAAW,OAAO,CAAC,SAAsB,EAAK,OAAO,CAAC,GAAG,SAAS,IAAQ,MAAM,CAAC,GAAG,EAAM,WAAW,OAAO,QAAQ,EAAE,OAAO,EAAE,CAAC,SAAS,EAAM,KAAK,CA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