( variant: ActionListItemProps['variant'], disabled: ActionListItemProps['disabled'], inactive?: boolean, )
| 69 | export const ItemContext = React.createContext<ItemContext>({}) |
| 70 | |
| 71 | export const getVariantStyles = ( |
| 72 | variant: ActionListItemProps['variant'], |
| 73 | disabled: ActionListItemProps['disabled'], |
| 74 | inactive?: boolean, |
| 75 | ) => { |
| 76 | if (disabled) { |
| 77 | return { |
| 78 | color: 'primer.fg.disabled', |
| 79 | iconColor: 'primer.fg.disabled', |
| 80 | annotationColor: 'primer.fg.disabled', |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | if (inactive) { |
| 85 | return { |
| 86 | color: 'fg.muted', |
| 87 | iconColor: 'fg.muted', |
| 88 | annotationColor: 'fg.muted', |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | switch (variant) { |
| 93 | case 'danger': |
| 94 | return { |
| 95 | color: 'danger.fg', |
| 96 | iconColor: 'danger.fg', |
| 97 | annotationColor: 'fg.muted', |
| 98 | hoverColor: 'actionListItem.danger.hoverText', |
| 99 | } |
| 100 | default: |
| 101 | return { |
| 102 | color: 'fg.default', |
| 103 | iconColor: 'fg.muted', |
| 104 | annotationColor: 'fg.muted', |
| 105 | hoverColor: 'fg.default', |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | export const TEXT_ROW_HEIGHT = '20px' // custom value off the scale |
| 111 |
no outgoing calls
no test coverage detected