UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

32 lines (29 loc) 825 B
import React__default from 'react'; const ItemContext = /*#__PURE__*/React__default.createContext({}); const getVariantStyles = (variant, disabled) => { if (disabled) { return { color: 'primer.fg.disabled', iconColor: 'primer.fg.disabled', annotationColor: 'primer.fg.disabled' }; } switch (variant) { case 'danger': return { color: 'danger.fg', iconColor: 'danger.fg', annotationColor: 'fg.muted', hoverColor: 'actionListItem.danger.hoverText' }; default: return { color: 'fg.default', iconColor: 'fg.muted', annotationColor: 'fg.muted', hoverColor: 'fg.default' }; } }; const TEXT_ROW_HEIGHT = '20px'; // custom value off the scale export { ItemContext, TEXT_ROW_HEIGHT, getVariantStyles };