Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
};
}
}
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,
};
}
}
({disabled}) => ({
'&:hover::after': {
boxShadow: disabled ? undefined : '0 0 0 ' + rippleRadius + 'px ' + colors.soap200,
},
})
);
{Object.keys(theme.palette).map(name => {
const palette = theme.palette[name as Palette] as CanvasThemePalette;
const bg = (palette.main && palette.main) || colors.soap200;
const contrast = palette.contrast;
return (
{createSwatch(name, bg, contrast, PaletteTitle)}
{Object.keys(palette).map(key => {
if (key === 'contrast') {
return;
}
return createSwatch(key, palette[key as Swatch], contrast);
})}
);
})}
({disabled}) => ({
'&:hover::after': {
boxShadow: disabled ? undefined : '0 0 0 ' + rippleRadius + 'px ' + colors.soap200,
},
})
);
verticalAlign: 'middle',
maxWidth: 150,
height: spacing.s,
padding: `1px ${spacing.xxxs}`,
borderRadius: borderRadius.s,
boxSizing: 'border-box',
},
variants: {
gray: {
high: {
color: colors.frenchVanilla100,
background: colors.licorice300,
},
low: {
color: colors.licorice400,
background: colors.soap200,
},
},
orange: {
high: {
color: colors.licorice500,
background: colors.cantaloupe400,
},
low: {
color: colors.toastedMarshmallow600,
background: colors.cantaloupe100,
},
},
blue: {
high: {
color: colors.frenchVanilla100,
background: colors.blueberry400,
});
/**
* Using a wrapper prevents the browser default behavior of trigging
* :hover on the radio when you hover on it's corresponding label.
* This stops the ripple from showing when you hover on the label.
*/
const RadioInputWrapper = styled('div')>(
{
height: radioHeight,
width: radioWidth,
marginTop: '3px',
alignSelf: 'flex-start',
'&::after': {
borderRadius: borderRadius.circle,
boxShadow: '0 0 0 0 ' + colors.soap200,
content: '""',
display: 'inline-block',
height: radioHeight,
transition: 'box-shadow 150ms ease-out',
width: radioWidth,
zIndex: 1,
},
},
({disabled}) => ({
'&:hover::after': {
boxShadow: disabled ? undefined : '0 0 0 ' + rippleRadius + 'px ' + colors.soap200,
},
})
);
/**
}
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',
},
};
[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)',
backgroundFocus: colors.frenchVanilla100,
color: colors.frenchVanilla100,
colorFocus: colors.blackPepper300,
placeholderColor: colors.frenchVanilla100,
placeholderColorFocus: colors.licorice300,
boxShadow: 'none',
},
({disabled}) => ({
backgroundColor: disabled ? colors.soap200 : '',
})
);