77
88import styled , { DefaultTheme , ThemeProps } from 'styled-components' ;
99import { parseToRgb , readableColor } from 'polished' ;
10- import { DEFAULT_THEME , getColor , retrieveComponentStyles } from '@zendeskgarden/react-theming' ;
10+ import { DEFAULT_THEME , focusStyles , retrieveComponentStyles } from '@zendeskgarden/react-theming' ;
1111import { StyledButtonPreview } from '../ColorPickerDialog/StyledButtonPreview' ;
1212import { IRGBColor } from '../../types' ;
1313
@@ -18,7 +18,6 @@ interface IStyledColorSwatchLabelProps extends ThemeProps<DefaultTheme> {
1818}
1919
2020const colorStyles = ( props : IStyledColorSwatchLabelProps ) => {
21- const boxShadow = props . theme . shadows . md ( getColor ( 'primaryHue' , 600 , props . theme , 0.35 ) ! ) ;
2221 const { alpha } = parseToRgb ( props . backgroundColor ) as IRGBColor ;
2322 let foregroundColor ;
2423
@@ -34,9 +33,6 @@ const colorStyles = (props: IStyledColorSwatchLabelProps) => {
3433
3534 return `
3635 color: ${ foregroundColor } ;
37-
38- &[data-garden-focus-visible] {
39- box-shadow: ${ boxShadow } ;
4036 ` ;
4137} ;
4238
@@ -46,11 +42,13 @@ export const StyledColorSwatchLabel = styled(StyledButtonPreview).attrs({
4642 'data-garden-version' : PACKAGE_VERSION
4743} ) `
4844 position: relative;
45+ top: 0;
4946 border-radius: ${ props => props . theme . borderRadii . md } ;
50- cursor: pointer;
5147
5248 ${ colorStyles } ;
5349
50+ ${ props => focusStyles ( { theme : props . theme , selector : '&:has(:focus-visible)' } ) }
51+
5452 ${ props => retrieveComponentStyles ( COMPONENT_ID , props ) } ;
5553` ;
5654
0 commit comments