Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fill: iconColors.disabled,
},
};
} else {
// Is focused or focused and disabled
return {
backgroundColor: isDisabled ? colors.blueberry200 : commonColors.focusBackground,
color: typeColors.inverse,
'span .wd-icon-fill': {
fill: iconColors.inverse,
},
[`[data-whatinput='mouse'] &,
[data-whatinput='touch'] &,
[data-whatinput='pointer'] &`]: {
backgroundColor: 'inherit',
color: colors.blackPepper300,
'&:hover': {
backgroundColor: commonColors.hoverBackground,
'.wd-icon-fill': {
fill: iconColors.hover,
},
},
'.wd-icon-fill': {
fill: iconColors.standard,
},
},
};
}
}
);
function getInputColors(themeColor: HeaderTheme, collapsed: boolean) {
if (collapsed) {
return {
background: 'transparent',
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
};
} else if (themeColor === HeaderTheme.White) {
return {
background: colors.soap200,
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
focusBackground: colors.soap200,
focusBoxShadow: focusRing().boxShadow,
};
} else {
return {
background: 'rgba(0,0,0,0.2)',
color: colors.frenchVanilla100,
placeholderColor: colors.frenchVanilla100,
focusBackground: colors.frenchVanilla100,
secondaryIcon?: CanvasSystemIcon;
hasDivider?: boolean;
isDisabled?: boolean;
isFocused?: boolean;
role: string;
shouldClose?: boolean;
}
const Item = styled('li')>(
{
...type.body2,
padding: `${spacing.xxs} ${spacing.s}`,
height: spacing.xl,
boxSizing: 'border-box',
cursor: 'pointer',
color: colors.blackPepper300,
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
transition: 'background-color 80ms, color 80ms',
'&:focus': {
outline: 'none',
},
},
({isFocused, isDisabled}) => {
if (!isFocused && !isDisabled) {
return {
backgroundColor: 'inherit',
'&:hover': {
backgroundColor: commonColors.hoverBackground,
color: colors.blackPepper300,
'.wd-icon-fill': {
boxShadowFocus: 'none',
},
[SearchTheme.Light]: {
background: colors.soap200,
backgroundFocus: colors.soap200,
backgroundHover: colors.soap300,
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
boxShadow: 'none',
boxShadowFocus: focusRing().boxShadow,
},
[SearchTheme.Dark]: {
background: 'rgba(0, 0, 0, 0.2)',
backgroundFocus: colors.frenchVanilla100,
color: colors.frenchVanilla100,
colorFocus: colors.blackPepper300,
placeholderColor: colors.frenchVanilla100,
placeholderColorFocus: colors.licorice300,
boxShadow: 'none',
},
};
placeholderColor?: string;
placeholderColorFocus?: string;
boxShadow?: string | string[];
boxShadowFocus?: string | string[];
}
export interface SearchThemes {
[key: string]: SearchThemeAttributes;
}
export const searchThemes: SearchThemes = {
[SearchTheme.Transparent]: {
background: 'rgba(0, 0, 0, 0)',
backgroundFocus: 'rgba(0, 0, 0, 0)',
color: colors.blackPepper300,
colorFocus: colors.blackPepper300,
placeholderColor: colors.licorice300,
placeholderColorFocus: colors.licorice300,
boxShadow: 'none',
boxShadowFocus: 'none',
},
[SearchTheme.Light]: {
background: colors.soap200,
backgroundFocus: colors.soap200,
backgroundHover: colors.soap300,
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
boxShadow: 'none',
boxShadowFocus: focusRing().boxShadow,
},
[SearchTheme.Dark]: {
background: 'rgba(0, 0, 0, 0.2)',
colorFocus?: string;
placeholderColor?: string;
placeholderColorFocus?: string;
boxShadow?: string | string[];
boxShadowFocus?: string | string[];
}
export interface SearchThemes {
[key: string]: SearchThemeAttributes;
}
export const searchThemes: SearchThemes = {
[SearchTheme.Transparent]: {
background: 'rgba(0, 0, 0, 0)',
backgroundFocus: 'rgba(0, 0, 0, 0)',
color: colors.blackPepper300,
colorFocus: colors.blackPepper300,
placeholderColor: colors.licorice300,
placeholderColorFocus: colors.licorice300,
boxShadow: 'none',
boxShadowFocus: 'none',
},
[SearchTheme.Light]: {
background: colors.soap200,
backgroundFocus: colors.soap200,
backgroundHover: colors.soap300,
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
boxShadow: 'none',
boxShadowFocus: focusRing().boxShadow,
},
[SearchTheme.Dark]: {
export const searchThemes: SearchThemes = {
[SearchTheme.Transparent]: {
background: 'rgba(0, 0, 0, 0)',
backgroundFocus: 'rgba(0, 0, 0, 0)',
color: colors.blackPepper300,
colorFocus: colors.blackPepper300,
placeholderColor: colors.licorice300,
placeholderColorFocus: colors.licorice300,
boxShadow: 'none',
boxShadowFocus: 'none',
},
[SearchTheme.Light]: {
background: colors.soap200,
backgroundFocus: colors.soap200,
backgroundHover: colors.soap300,
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
boxShadow: 'none',
boxShadowFocus: focusRing().boxShadow,
},
[SearchTheme.Dark]: {
background: 'rgba(0, 0, 0, 0.2)',
backgroundFocus: colors.frenchVanilla100,
color: colors.frenchVanilla100,
colorFocus: colors.blackPepper300,
placeholderColor: colors.frenchVanilla100,
placeholderColorFocus: colors.licorice300,
boxShadow: 'none',
},
};
function getInputColors(themeColor: HeaderTheme, collapsed: boolean) {
if (collapsed) {
return {
background: 'transparent',
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
};
} else if (themeColor === HeaderTheme.White) {
return {
background: colors.soap200,
color: colors.blackPepper300,
placeholderColor: colors.licorice300,
focusBackground: colors.soap200,
focusBoxShadow: focusRing().boxShadow,
};
} else {
return {
background: 'rgba(0,0,0,0.2)',
color: colors.frenchVanilla100,
placeholderColor: colors.frenchVanilla100,
focusBackground: colors.frenchVanilla100,
};
}
}