UNPKG

@razorpay/blade

Version:

The Design System that powers Razorpay

11 lines (8 loc) 1.4 kB
import { checkboxIconColors, checkboxSizes } from '../checkboxTokens.js'; import getIn from '../../../utils/lodashButBetter/get.js'; import { makeSpace } from '../../../utils/makeSpace/makeSpace.js'; import { makeSize } from '../../../utils/makeSize/makeSize.js'; import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js'; var getCheckboxIconWrapperStyles=function getCheckboxIconWrapperStyles(_ref){var theme=_ref.theme,isChecked=_ref.isChecked,isDisabled=_ref.isDisabled,isNegative=_ref.isNegative,size=_ref.size;var variant='default';if(isDisabled)variant='disabled';if(isNegative)variant='negative';var checked=isChecked?'checked':'unchecked';var background=checkboxIconColors.variants[variant].background[checked];var border=checkboxIconColors.variants[variant].border[checked];var backgroundColor=getIn(theme,background);var borderColor=getIn(theme,border);return {position:'relative',display:'flex',alignItems:'center',justifyContent:'center',flexShrink:0,width:makeSpace(checkboxSizes.icon[size].width),height:makeSpace(checkboxSizes.icon[size].height),borderWidth:makeBorderSize(theme.border.width.thick),borderStyle:'solid',margin:makeSpace(theme.spacing[1]),borderRadius:makeSize(theme.border.radius.small),backgroundColor:backgroundColor,borderColor:borderColor};}; export { getCheckboxIconWrapperStyles }; //# sourceMappingURL=CheckboxIconWrapperStyles.js.map