{"version":3,"file":"checkBox-BTSNgI2M.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 ariaLabel?: string;\n}\n\nexport const Checkbox = ({ label, mode=LIGHT, onClick, state, selected, id, ariaLabel, }: 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 'aria-label': ariaLabel,\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","ariaLabel","checkboxId","labelClass","DISABLED","modeClass","renderCheck","INDETERMINATE","React.createElement","renderCheckbox","sharedProps","checkbox"],"mappings":"+DAIA,MA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