({
theme,
isVariant,
disabled,
customBackgroundColor,
}: BaseProps & { customBackgroundColor?: ColorValue })
| 165 | }; |
| 166 | |
| 167 | const getBackgroundColor = ({ |
| 168 | theme, |
| 169 | isVariant, |
| 170 | disabled, |
| 171 | customBackgroundColor, |
| 172 | }: BaseProps & { customBackgroundColor?: ColorValue }) => { |
| 173 | if (customBackgroundColor && !disabled) { |
| 174 | return customBackgroundColor; |
| 175 | } |
| 176 | |
| 177 | if (theme.isV3) { |
| 178 | if (disabled) { |
| 179 | return theme.colors.surfaceDisabled; |
| 180 | } |
| 181 | |
| 182 | if (isVariant('primary')) { |
| 183 | return theme.colors.primaryContainer; |
| 184 | } |
| 185 | |
| 186 | if (isVariant('secondary')) { |
| 187 | return theme.colors.secondaryContainer; |
| 188 | } |
| 189 | |
| 190 | if (isVariant('tertiary')) { |
| 191 | return theme.colors.tertiaryContainer; |
| 192 | } |
| 193 | |
| 194 | if (isVariant('surface')) { |
| 195 | return theme.colors.elevation.level3; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | if (disabled) { |
| 200 | if (theme.dark) { |
| 201 | return color(white).alpha(0.12).rgb().string(); |
| 202 | } |
| 203 | return color(black).alpha(0.12).rgb().string(); |
| 204 | } |
| 205 | |
| 206 | //@ts-ignore |
| 207 | return theme.colors?.accent; |
| 208 | }; |
| 209 | |
| 210 | const getForegroundColor = ({ |
| 211 | theme, |
no test coverage detected
searching dependent graphs…