in src/button/styled-components.ts [695:792]
function getDoubleBorderStyles({
// @ts-ignore
$theme,
// @ts-ignore
$isLoading,
// @ts-ignore
$isSelected,
// @ts-ignore
$kind,
// @ts-ignore
$disabled,
// @ts-ignore
$backgroundSafe,
}) {
if ($disabled) {
return Object.freeze({});
}
const backgroundSafeBoxShadow = $backgroundSafe ? `, ${$theme.lighting.shallowBelow}` : '';
switch ($kind) {
case KIND.primary:
return {
...($isSelected
? {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonOuterBorder} ${backgroundSafeBoxShadow}`,
}
: {}),
':focus-visible': {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonFocusOuterBorder} ${backgroundSafeBoxShadow}`,
},
};
case KIND.secondary:
return {
':focus-visible': {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonFocusOuterBorder} ${backgroundSafeBoxShadow}`,
},
};
case KIND.tertiary:
return {
...($isSelected
? {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonOuterBorder} ${backgroundSafeBoxShadow}`,
}
: {}),
':focus-visible': {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonFocusOuterBorder} ${backgroundSafeBoxShadow}`,
},
};
case KIND.dangerPrimary: {
return {
...($isSelected
? {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonOuterBorder} ${backgroundSafeBoxShadow}`,
}
: {}),
':focus-visible': {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonFocusOuterBorder} ${backgroundSafeBoxShadow}`,
},
};
}
case KIND.dangerSecondary: {
return {
':focus-visible': {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonInnerBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonFocusOuterBorder} ${backgroundSafeBoxShadow}`,
},
};
}
case KIND.dangerTertiary: {
return {
...($isSelected
? {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonTransparentBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonDangerTertiaryOuterBorder} ${backgroundSafeBoxShadow}`,
}
: {}),
':focus-visible': {
boxShadow: `inset 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonTransparentBorder}, 0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonFocusOuterBorder} ${backgroundSafeBoxShadow}`,
},
};
}
case BUTTON_GROUP_EXCLUSIVE_KINDS.outline: {
return {
...($isSelected
? {
boxShadow: `0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonOuterBorder}`,
}
: {
boxShadow: `0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonOutlineOuterBorder}`,
}),
':focus-visible': {
boxShadow: `0 0 0 ${$theme.sizing.scale0} ${$theme.colors.buttonFocusOuterBorder}`,
},
};
}
default:
return Object.freeze({});
}
}