{"version":3,"file":"CheckList.WW8TLrd3.mjs","names":["React.useState","React.useId","React.useCallback"],"sources":["https:/framerusercontent.com/modules/BoivREubYvpdhjZUWFc7/ZFpL4vH7RismVXk1af92/CheckList.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 290\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function AnimatedChecklistList(props){const{items=[\"Bread\",\"Cheese\",\"Coffee\"],font,direction,textColor,checkColor,disabledColor,bgColor,style}=props;const[checkedItems,setCheckedItems]=React.useState(()=>new Array(items.length).fill(false));const uniqueId=React.useId();const handleToggle=React.useCallback(index=>{React.startTransition(()=>{setCheckedItems(prev=>{const next=[...prev];next[index]=!next[index];return next;});});},[setCheckedItems]);React.useEffect(()=>{React.startTransition(()=>{setCheckedItems(new Array(items.length).fill(false));});},[items]);return /*#__PURE__*/_jsxs(\"div\",{style:{...containerStyle,...style,\"--background\":bgColor,\"--text\":textColor,\"--check\":checkColor,\"--disabled\":disabledColor,boxShadow:\"0px 10px 30px rgba(0,0,0, 0.05)\",position:\"relative\"},className:\"checklist-container\",dir:direction,children:[/*#__PURE__*/_jsx(\"style\",{children:cssStyles}),items.map((itemText,index)=>{const inputIdLeft=`checkbox-left-${uniqueId}-${index}`;const inputIdRight=`checkbox-right-${uniqueId}-${index}`;const isChecked=Boolean(checkedItems[index]);return /*#__PURE__*/_jsxs(\"div\",{className:\"checklist-item\",\"data-checked\":isChecked?\"true\":\"false\",children:[/*#__PURE__*/_jsx(\"input\",{id:inputIdLeft,className:\"checkbox checkbox-left\",type:\"checkbox\",checked:isChecked,onChange:()=>handleToggle(index),\"aria-label\":itemText}),/*#__PURE__*/_jsx(\"label\",{style:{...font,color:\"inherit\",cursor:\"pointer\",userSelect:\"none\",flex:1,minWidth:0},onClick:()=>handleToggle(index),onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \"||e.key===\"Spacebar\"){e.preventDefault();handleToggle(index);}},role:\"button\",tabIndex:0,\"aria-pressed\":isChecked,children:itemText}),/*#__PURE__*/_jsx(\"input\",{id:inputIdRight,className:\"checkbox checkbox-right\",type:\"checkbox\",checked:isChecked,onChange:()=>handleToggle(index),\"aria-label\":itemText})]},inputIdLeft);})]});}const containerStyle={display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",width:\"100%\",height:\"100%\",background:\"var(--background)\",borderRadius:\"20px\",padding:\"30px\",overflow:\"hidden\"};const cssStyles=`\n.checklist-item {\n  position: relative;\n  display: flex;\n  align-items: center;\n  gap: 15px;\n  padding: 10px 0;\n  width: 100%;\n  color: var(--text);\n}\n\n.checklist-container[dir=\"rtl\"] .checklist-item {\n  flex-direction: row-reverse;\n}\n\n.checklist-container[dir=\"rtl\"] .checkbox-left {\n  display: none;\n}\n\n.checklist-container[dir=\"ltr\"] .checkbox-right {\n  display: none;\n}\n\n.checklist-item:last-child {\n  margin-bottom: 0;\n}\n\n.checklist-item[data-checked=\"true\"] label {\n  color: var(--disabled);\n}\n\n/* Checkbox */\n.checklist-item .checkbox {\n  -webkit-appearance: none;\n  -moz-appearance: none;\n  appearance: none;\n  position: relative;\n  height: 20px;\n  width: 20px;\n  outline: none;\n  cursor: pointer;\n  background: transparent;\n  border: 2px solid var(--check);\n  border-radius: 6px;\n  display: grid;\n  place-items: center;\n  transition: background 0.25s ease, border-color 0.25s ease;\n  padding: 0;\n  flex: 0 0 auto;\n}\n\n.checklist-item .checkbox::after {\n  content: \"\";\n  position: absolute;\n  width: 6px;\n  height: 10px;\n  border-right: 2px solid #fff;\n  border-bottom: 2px solid #fff;\n  transform: rotate(45deg) scale(0);\n  transition: transform 0.2s ease;\n}\n\n.checklist-item input.checkbox:checked {\n  background: var(--check);\n  border-color: var(--check);\n}\n\n.checklist-item input.checkbox:checked::after {\n  transform: rotate(45deg) scale(1);\n}\n`;addPropertyControls(AnimatedChecklistList,{items:{type:ControlType.Array,title:\"Items\",control:{type:ControlType.String,defaultValue:\"New Item\"},defaultValue:[\"Bread\",\"Cheese\",\"Coffee\"]},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"ltr\",\"rtl\"],optionTitles:[\"LTR\",\"RTL\"],defaultValue:\"ltr\",displaySegmentedControl:true},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#414856\"},checkColor:{type:ControlType.Color,title:\"Check Color\",defaultValue:\"#4f29f0\"},disabledColor:{type:ControlType.Color,title:\"Done Color\",defaultValue:\"#c3c8de\"},bgColor:{type:ControlType.Color,title:\"Bg Color\",defaultValue:\"#ffffff\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedChecklistList\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"290\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CheckList.map"],"mappings":"6MAMG,SAAwB,EAAsB,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,QAAQ,SAAS,SAAS,CAAC,OAAK,YAAU,YAAU,aAAW,gBAAc,UAAQ,SAAO,EAAW,CAAC,EAAa,GAAiBA,MAAuB,MAAM,EAAM,OAAO,CAAC,KAAK,GAAM,CAAC,CAAO,EAASC,GAAa,CAAO,EAAaC,EAAkB,GAAO,CAAC,MAA0B,CAAC,EAAgB,GAAM,CAAC,IAAM,EAAK,CAAC,GAAG,EAAK,CAA0B,MAAzB,GAAK,GAAO,CAAC,EAAK,GA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