Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
return css`
/* avoid wrapping label onto new lines */
white-space: nowrap;
flex: 0;
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
line-height: calc(${vars.sizeHeightInput} - 2 * ${vars.borderRadius1});
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
border-top-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border: 1px ${overwrittenVars[designTokens.borderColorForInputWhenDisabled]}
solid;
padding: 0 ${vars.spacingS};
transition: border-color ${vars.transitionStandard},
background-color ${vars.transitionStandard},
color ${vars.transitionStandard};
border-right: 0;
box-shadow: none;
appearance: none;
`;
};
...vars,
...theme,
};
return css`
/* avoid wrapping label onto new lines */
flex: 1 0 auto;
box-sizing: border-box;
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
height: ${vars.sizeHeightInput};
line-height: ${vars.sizeHeightInput};
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
border-top-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border: 1px ${overwrittenVars[designTokens.borderColorForInputWhenDisabled]}
solid;
padding: 0 ${vars.spacingS};
transition: border-color ${vars.transitionStandard},
background-color ${vars.transitionStandard},
color ${vars.transitionStandard};
border-right: 0;
box-shadow: none;
appearance: none;
`;
};
...theme,
};
return css`
/* avoid wrapping label onto new lines */
flex: 1 0 auto;
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
line-height: calc(${vars.sizeHeightInput} - 2 * ${vars.borderRadius1});
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
border-top-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border: 1px ${overwrittenVars[designTokens.borderColorForInputWhenDisabled]}
solid;
padding: 0 ${vars.spacingS};
transition: border-color ${vars.transitionStandard},
background-color ${vars.transitionStandard},
color ${vars.transitionStandard};
border-right: 0;
box-shadow: none;
appearance: none;
`;
};
const overwrittenVars = {
...vars,
...theme,
};
return css`
/* avoid wrapping label onto new lines */
white-space: nowrap;
flex: 0;
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
line-height: calc(${vars.sizeHeightInput} - 2 * ${vars.borderRadius1});
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
border-top-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border: 1px ${overwrittenVars[designTokens.borderColorForInputWhenDisabled]}
solid;
padding: 0 ${vars.spacingS};
transition: border-color ${vars.transitionStandard},
background-color ${vars.transitionStandard},
color ${vars.transitionStandard};
border-right: 0;
box-shadow: none;
appearance: none;
`;
};
const getLanguageLabelStyles = (props, theme) => {
const overwrittenVars = {
...vars,
...theme,
};
return css`
/* avoid wrapping label onto new lines */
flex: 1 0 auto;
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
line-height: calc(${vars.sizeHeightInput} - 2 * ${vars.borderRadius1});
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
border-top-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border: 1px ${overwrittenVars[designTokens.borderColorForInputWhenDisabled]}
solid;
padding: 0 ${vars.spacingS};
transition: border-color ${vars.transitionStandard},
background-color ${vars.transitionStandard},
color ${vars.transitionStandard};
border-right: 0;
box-shadow: none;
appearance: none;
`;
};
return css`
/* avoid wrapping label onto new lines */
flex: 1 0 auto;
box-sizing: border-box;
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
height: ${vars.sizeHeightInput};
line-height: ${vars.sizeHeightInput};
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
border-top-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-left-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border: 1px ${overwrittenVars[designTokens.borderColorForInputWhenDisabled]}
solid;
padding: 0 ${vars.spacingS};
transition: border-color ${vars.transitionStandard},
background-color ${vars.transitionStandard},
color ${vars.transitionStandard};
border-right: 0;
box-shadow: none;
appearance: none;
`;
};
align-items: center;
box-sizing: border-box;
background-color: ${overwrittenVars[designTokens.backgroundColorForInput]};
border-bottom: 1px solid
${overwrittenVars[designTokens.borderColorForInput]};
border-right: 1px solid ${overwrittenVars[designTokens.borderColorForInput]};
border-top: 1px solid ${overwrittenVars[designTokens.borderColorForInput]};
border-left: none;
height: ${overwrittenVars.sizeHeightInput};
display: flex;
padding: ${overwrittenVars.spacingXs};
border-top-right-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-right-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
transition: border-color ${overwrittenVars.transitionStandard};
`;
if (props.isDisabled) {
return [
baseIconStyles,
css`
cursor: not-allowed;
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
border-color: ${overwrittenVars[
designTokens.borderColorForInputWhenDisabled
]};
`,
const menuListStyles = (props, theme) => base => {
const overwrittenVars = {
...vars,
...theme,
};
return {
...base,
padding: '0',
borderRadius: overwrittenVars[designTokens.borderRadiusForInput],
backgroundColor: overwrittenVars[designTokens.backgroundColorForInput],
};
};
};
const baseIconStyles = css`
align-items: center;
box-sizing: border-box;
background-color: ${overwrittenVars[designTokens.backgroundColorForInput]};
border-bottom: 1px solid
${overwrittenVars[designTokens.borderColorForInput]};
border-right: 1px solid ${overwrittenVars[designTokens.borderColorForInput]};
border-top: 1px solid ${overwrittenVars[designTokens.borderColorForInput]};
border-left: none;
height: ${overwrittenVars.sizeHeightInput};
display: flex;
padding: ${overwrittenVars.spacingXs};
border-top-right-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
border-bottom-right-radius: ${overwrittenVars[
designTokens.borderRadiusForInput
]};
transition: border-color ${overwrittenVars.transitionStandard};
`;
if (props.isDisabled) {
return [
baseIconStyles,
css`
cursor: not-allowed;
background-color: ${overwrittenVars[
designTokens.backgroundColorForInputWhenDisabled
]};
color: ${overwrittenVars[designTokens.fontColorForInputWhenDisabled]};
border-color: ${overwrittenVars[
const containerStyles = (props, theme) => (base, state) => {
const overwrittenVars = {
...vars,
...theme,
};
return {
...base,
fontFamily: 'inherit',
minHeight: overwrittenVars.sizeHeightInput,
borderRadius: overwrittenVars[designTokens.borderRadiusForInput],
borderColor: state.isFocused
? overwrittenVars[designTokens.borderColorForInputWhenFocused]
: base.borderColor,
boxShadow: state.isFocused ? 'none' : base.boxShadow,
};
};