{"version":3,"file":"checkBox-DWd552Hp.js","sources":["../../../client/app/bundles/Shared/components/shared/checkBox.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { ACTIVE, DISABLED, INDETERMINATE } from '../../utils/constants';\n\nconst indeterminateBlackSrc = 'https://assets.quill.org/images/icons/xs/dash-black.svg'\nconst indeterminateWhiteSrc = 'https://assets.quill.org/images/icons/xs/dash-white.svg'\nconst smallBlackCheckSrc = 'https://assets.quill.org/images/icons/xs/check-small.svg'\nconst smallWhiteCheckSrc = 'https://assets.quill.org/images/icons/xs/check-small-white.svg'\n\nconst DARK = 'dark'\nconst LIGHT = 'light'\n\ninterface checkboxProps {\n label?: string;\n mode?: string;\n onClick?: (e) => void;\n state?: string;\n selected: boolean;\n id?: string;\n}\n\nexport const Checkbox = ({ label, mode=LIGHT, onClick, state, selected, id, }: checkboxProps) => {\n const checkboxId = id || label\n const labelClass = `${state === DISABLED ? DISABLED : ''} ${mode}`\n const modeClass = mode === LIGHT ? `${mode} focus-on-light` : `${mode} focus-on-dark`\n\n function renderCheck() {\n if (state === INDETERMINATE) { return \"dash\" }\n if(!selected) { return }\n return mode === DARK ? \"check\" : \"check\"\n }\n\n function renderCheckbox() {\n const sharedProps = {\n 'aria-checked': selected,\n id: checkboxId,\n onClick,\n role: 'checkbox'\n }\n\n let checkbox = ()\n if (state === INDETERMINATE) {\n checkbox = ()\n\n } else if (state === DISABLED) {\n checkbox = ()\n } else if (selected) {\n checkbox = ()\n }\n return checkbox\n }\n\n return (\n
\n {renderCheckbox()}\n {label && }\n
\n );\n};\n\nexport default Checkbox\n"],"names":["indeterminateBlackSrc","indeterminateWhiteSrc","smallBlackCheckSrc","smallWhiteCheckSrc","DARK","LIGHT","Checkbox","label","mode","onClick","state","selected","id","checkboxId","labelClass","DISABLED","modeClass","renderCheck","INDETERMINATE","React.createElement","renderCheckbox","sharedProps","checkbox"],"mappings":"+DAIA,MAAMA,EAAwB,0DACxBC,EAAwB,0DACxBC,EAAqB,2DACrBC,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