diff --git a/src/components/input/Button.tsx b/src/components/input/Button.tsx index 8404ff53c..26887da5b 100644 --- a/src/components/input/Button.tsx +++ b/src/components/input/Button.tsx @@ -27,6 +27,12 @@ type ComponentProps = { */ title?: string; + /** + * Whether the focus ring should be applied to `:focus` or `:focus-visible`. + * Defaults to focus-visible. + */ + focusRing?: 'focus' | 'focus-visible'; + /** Use `expanded` prop instead */ 'aria-expanded'?: never; /** Use `pressed` prop instead */ @@ -64,6 +70,7 @@ export default function Button({ size = 'md', variant = 'secondary', unstyled = false, + focusRing = 'focus-visible', role, ...htmlAttributes @@ -96,8 +103,11 @@ export default function Button({ {...htmlAttributes} className={classnames( { - 'focus-visible-ring transition-colors whitespace-nowrap flex items-center': - styled, + 'transition-colors whitespace-nowrap flex items-center': styled, + }, + styled && { + 'focus-visible-ring': focusRing === 'focus-visible', + 'focus:ring outline-none': focusRing === 'focus', }, themed && { 'font-semibold rounded': true, diff --git a/src/components/input/SelectNext.tsx b/src/components/input/SelectNext.tsx index 50567f1e7..f84afb9e5 100644 --- a/src/components/input/SelectNext.tsx +++ b/src/components/input/SelectNext.tsx @@ -48,6 +48,7 @@ function SelectOption({ return (