Skip to content

Commit f89809d

Browse files
authored
fix: Fix S2 button/taggroup coloring so they apply on keyboard focus only (#8342)
1 parent 6bbacb8 commit f89809d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/@react-spectrum/s2/src/ActionButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & Togg
9595
default: lightDark('accent-900', 'accent-700'),
9696
isHovered: lightDark('accent-1000', 'accent-600'),
9797
isPressed: lightDark('accent-1000', 'accent-600'),
98-
isFocused: lightDark('accent-1000', 'accent-600')
98+
isFocusVisible: lightDark('accent-1000', 'accent-600')
9999
},
100100
isDisabled: {
101101
default: 'gray-100',

packages/@react-spectrum/s2/src/Button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ const button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: bool
116116
default: lightDark('accent-900', 'accent-700'),
117117
isHovered: lightDark('accent-1000', 'accent-600'),
118118
isPressed: lightDark('accent-1000', 'accent-600'),
119-
isFocused: lightDark('accent-1000', 'accent-600')
119+
isFocusVisible: lightDark('accent-1000', 'accent-600')
120120
},
121121
negative: {
122122
default: lightDark('negative-900', 'negative-700'),
123123
isHovered: lightDark('negative-1000', 'negative-600'),
124124
isPressed: lightDark('negative-1000', 'negative-600'),
125-
isFocused: lightDark('negative-1000', 'negative-600')
125+
isFocusVisible: lightDark('negative-1000', 'negative-600')
126126
},
127127
premium: 'gray-100',
128128
genai: 'gray-100'
@@ -347,7 +347,7 @@ export const Button = forwardRef(function Button(props: ButtonProps, ref: Focusa
347347
isStaticColor: !!staticColor
348348
}, props.styles)}>
349349
{(renderProps) => (<>
350-
{variant === 'genai' || variant === 'premium'
350+
{variant === 'genai' || variant === 'premium'
351351
? (
352352
<span
353353
className={gradient({

packages/@react-spectrum/s2/src/TagGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ const tagStyles = style<TagRenderProps & {size?: 'S' | 'M' | 'L', isEmphasized?:
442442
default: lightDark('accent-900', 'accent-700'),
443443
isHovered: lightDark('accent-1000', 'accent-600'),
444444
isPressed: lightDark('accent-1000', 'accent-600'),
445-
isFocused: lightDark('accent-1000', 'accent-600')
445+
isFocusVisible: lightDark('accent-1000', 'accent-600')
446446
}
447447
},
448448
isDisabled: 'disabled',

0 commit comments

Comments
 (0)