@@ -3,10 +3,11 @@ import { buttonRecipe } from "../Button/Button.css";
3
3
import { useLinkComponent } from "../util/link" ;
4
4
import { ButtonProps } from "./createButton" ;
5
5
import { Label } from ".." ;
6
- import { Box } from "../internal" ;
6
+ import { Box , Column , Columns } from "../internal" ;
7
7
import { useLink } from "@react-aria/link" ;
8
8
import { element } from "../reset.css" ;
9
9
import { ButtonConfig } from "./Config" ;
10
+ import { IconProps } from "../Icons" ;
10
11
11
12
type Props = {
12
13
href : string ;
@@ -16,6 +17,7 @@ type Props = {
16
17
isDisabled ?: ButtonProps [ "isDisabled" ] ;
17
18
size ?: ButtonProps [ "size" ] ;
18
19
active ?: boolean ;
20
+ icon ?: ( props : IconProps ) => JSX . Element ;
19
21
} & Omit < AnchorHTMLAttributes < HTMLAnchorElement > , "color" > ;
20
22
21
23
export function createButtonLink ( config : ButtonConfig ) {
@@ -57,9 +59,19 @@ export function createButtonLink(config: ButtonConfig) {
57
59
paddingY = { config . paddingY [ size ] }
58
60
borderRadius = { config . radius }
59
61
>
60
- < Label as = "span" size = { config . labelSize } >
61
- { label }
62
- </ Label >
62
+ < Columns space = { config . internalSpacing } alignY = "center" >
63
+ { props . icon && (
64
+ < Column width = "content" >
65
+ { props . icon ( {
66
+ size : config . iconSize [ size ] ,
67
+ color : "inherit" ,
68
+ } ) }
69
+ </ Column >
70
+ ) }
71
+ < Label as = "span" size = { config . labelSize } uppercase = { config . uppercaseLabel } >
72
+ { label }
73
+ </ Label >
74
+ </ Columns >
63
75
</ Box >
64
76
) ;
65
77
} ;
0 commit comments