({
theme,
isMode,
disabled,
selected,
customContainerColor,
}: BaseProps & { customContainerColor?: string })
| 32 | }; |
| 33 | |
| 34 | const getBackgroundColor = ({ |
| 35 | theme, |
| 36 | isMode, |
| 37 | disabled, |
| 38 | selected, |
| 39 | customContainerColor, |
| 40 | }: BaseProps & { customContainerColor?: string }) => { |
| 41 | if (theme.isV3) { |
| 42 | if (disabled) { |
| 43 | if (isMode('contained') || isMode('contained-tonal')) { |
| 44 | return theme.colors.surfaceDisabled; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | if (typeof customContainerColor !== 'undefined') { |
| 49 | return customContainerColor; |
| 50 | } |
| 51 | |
| 52 | if (isMode('contained')) { |
| 53 | if (selected) { |
| 54 | return theme.colors.primary; |
| 55 | } |
| 56 | return theme.colors.surfaceVariant; |
| 57 | } |
| 58 | |
| 59 | if (isMode('contained-tonal')) { |
| 60 | if (selected) { |
| 61 | return theme.colors.secondaryContainer; |
| 62 | } |
| 63 | return theme.colors.surfaceVariant; |
| 64 | } |
| 65 | |
| 66 | if (isMode('outlined')) { |
| 67 | if (selected) { |
| 68 | return theme.colors.inverseSurface; |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | if (typeof customContainerColor !== 'undefined') { |
| 74 | return customContainerColor; |
| 75 | } |
| 76 | |
| 77 | return undefined; |
| 78 | }; |
| 79 | |
| 80 | const getIconColor = ({ |
| 81 | theme, |
no test coverage detected
searching dependent graphs…