({
theme,
isOutlined,
disabled,
selectedColor,
backgroundColor,
}: BaseProps & { backgroundColor: string; selectedColor?: string })
| 16 | }; |
| 17 | |
| 18 | const getBorderColor = ({ |
| 19 | theme, |
| 20 | isOutlined, |
| 21 | disabled, |
| 22 | selectedColor, |
| 23 | backgroundColor, |
| 24 | }: BaseProps & { backgroundColor: string; selectedColor?: string }) => { |
| 25 | const isSelectedColor = selectedColor !== undefined; |
| 26 | |
| 27 | if (theme.isV3) { |
| 28 | if (!isOutlined) { |
| 29 | // If the Chip mode is "flat", set border color to transparent |
| 30 | return 'transparent'; |
| 31 | } |
| 32 | |
| 33 | if (disabled) { |
| 34 | return color(theme.colors.onSurfaceVariant).alpha(0.12).rgb().string(); |
| 35 | } |
| 36 | |
| 37 | if (isSelectedColor) { |
| 38 | return color(selectedColor).alpha(0.29).rgb().string(); |
| 39 | } |
| 40 | |
| 41 | return theme.colors.outline; |
| 42 | } |
| 43 | |
| 44 | if (isOutlined) { |
| 45 | if (isSelectedColor) { |
| 46 | return color(selectedColor).alpha(0.29).rgb().string(); |
| 47 | } |
| 48 | |
| 49 | if (theme.dark) { |
| 50 | return color(white).alpha(0.29).rgb().string(); |
| 51 | } |
| 52 | |
| 53 | return color(black).alpha(0.29).rgb().string(); |
| 54 | } |
| 55 | |
| 56 | return backgroundColor; |
| 57 | }; |
| 58 | |
| 59 | const getTextColor = ({ |
| 60 | theme, |
no outgoing calls
no test coverage detected
searching dependent graphs…