{"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 }\n if(!selected) { return }\n return mode === DARK ?
:
\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