@@ -7,37 +7,45 @@ import { Text } from '@/components/text';
7
7
import { TextDecorationType } from '@/components/text/types' ;
8
8
9
9
import { ILinkAsButtonStandAlone } from '../types/link' ;
10
+ import { LinkAsButtonWrapperStyled } from './linkAsButton.styled' ;
10
11
11
12
// eslint-disable-next-line complexity
12
13
export const LinkAsButtonStandAloneComponent = (
13
14
{ children, url, component, target, role, onClick, ...props } : ILinkAsButtonStandAlone ,
14
15
ref : React . ForwardedRef < HTMLElement > | undefined
15
16
) : JSX . Element => {
16
17
return (
17
- < Text
18
- ref = { ref }
19
- aria-label = { props [ 'aria-label' ] }
20
- component = { component }
21
- dataTestId = { props . dataTestId }
22
- decoration = { TextDecorationType . NONE }
23
- isDisabled = { props . state === ButtonStateType . DISABLED }
24
- role = { role }
25
- target = { target }
26
- url = { url }
27
- onClick = { onClick }
18
+ // Apply button border radius to the link when focus-visible
19
+ < LinkAsButtonWrapperStyled
20
+ $sizeStyles = { props . sizeStyles }
21
+ $state = { props . state }
22
+ $styles = { props . styles }
28
23
>
29
- < ButtonStyled
30
- as = "span"
31
- { ...props }
32
- $fullWidth = { props . fullWidth }
33
- $iconPosition = { props . iconPosition }
34
- $sizeStyles = { props . sizeStyles }
35
- $state = { props . state }
36
- $styles = { props . styles }
24
+ < Text
25
+ ref = { ref }
26
+ aria-label = { props [ 'aria-label' ] }
27
+ component = { component }
28
+ dataTestId = { props . dataTestId }
29
+ decoration = { TextDecorationType . NONE }
30
+ isDisabled = { props . state === ButtonStateType . DISABLED }
31
+ role = { role }
32
+ target = { target }
33
+ url = { url }
34
+ onClick = { onClick }
37
35
>
38
- < ButtonStandAloneStructure { ...props } > { children } </ ButtonStandAloneStructure >
39
- </ ButtonStyled >
40
- </ Text >
36
+ < ButtonStyled
37
+ as = "span"
38
+ { ...props }
39
+ $fullWidth = { props . fullWidth }
40
+ $iconPosition = { props . iconPosition }
41
+ $sizeStyles = { props . sizeStyles }
42
+ $state = { props . state }
43
+ $styles = { props . styles }
44
+ >
45
+ < ButtonStandAloneStructure { ...props } > { children } </ ButtonStandAloneStructure >
46
+ </ ButtonStyled >
47
+ </ Text >
48
+ </ LinkAsButtonWrapperStyled >
41
49
) ;
42
50
} ;
43
51
0 commit comments