@@ -79,21 +79,38 @@ const getDisabledStyles = (props: ThemeProp & ButtonProps) => {
7979 const variant = props . variant || defaultProps . variant ;
8080 const category = props . category || defaultProps . category ;
8181
82+ if ( props . tag === "a" ) {
83+ return {
84+ bgColorPrimary : "transparent" ,
85+ borderColorPrimary : "transparent" ,
86+ txtColorPrimary : props . theme . colors . button . link . disabled ,
87+ bgColorSecondary : "transparent" ,
88+ borderColorSecondary : "transparent" ,
89+ txtColorSecondary : props . theme . colors . button . link . disabled ,
90+ bgColorTertiary : "transparent" ,
91+ borderColorTertiary : "transparent" ,
92+ txtColorTertiary : props . theme . colors . button . link . disabled ,
93+ } ;
94+ }
8295 const stylesByCategory = {
8396 [ Category . primary ] : {
8497 txtColorPrimary : props . theme . colors . button . disabledText ,
85- bgColorPrimary : props . theme . colors [ variant ] . darkest ,
86- borderColorPrimary : props . theme . colors [ variant ] . darkest ,
98+ bgColorPrimary : props . theme . colors [ variant ] . darker ,
99+ borderColorPrimary : props . theme . colors [ variant ] . darker ,
87100 } ,
88101 [ Category . secondary ] : {
89102 txtColorSecondary : props . theme . colors . button . disabledText ,
90- bgColorSecondary : props . theme . colors [ variant ] . darkest ,
91- borderColorSecondary : props . theme . colors [ variant ] . darker ,
103+ bgColorSecondary : props . theme . colors [ variant ] . darker ,
104+ borderColorSecondary : props . isLoading
105+ ? props . theme . colors [ variant ] . darkest
106+ : props . theme . colors . tertiary . darker ,
92107 } ,
93108 [ Category . tertiary ] : {
94109 txtColorTertiary : props . theme . colors . button . disabledText ,
95- bgColorTertiary : props . theme . colors . tertiary . darker ,
96- borderColorTertiary : props . theme . colors . tertiary . dark ,
110+ bgColorTertiary : props . theme . colors . tertiary . dark ,
111+ borderColorTertiary : props . isLoading
112+ ? props . theme . colors . tertiary . darkest
113+ : props . theme . colors . tertiary . darker ,
97114 } ,
98115 } ;
99116
@@ -104,6 +121,19 @@ const getMainStateStyles = (props: ThemeProp & ButtonProps) => {
104121 const variant = props . variant || defaultProps . variant ;
105122 const category = props . category || defaultProps . category ;
106123
124+ if ( props . tag === "a" ) {
125+ return {
126+ bgColorPrimary : "transparent" ,
127+ borderColorPrimary : "transparent" ,
128+ txtColorPrimary : props . theme . colors . button . link . main ,
129+ bgColorSecondary : "transparent" ,
130+ borderColorSecondary : "transparent" ,
131+ txtColorSecondary : props . theme . colors . button . link . main ,
132+ bgColorTertiary : "transparent" ,
133+ borderColorTertiary : "transparent" ,
134+ txtColorTertiary : props . theme . colors . button . link . main ,
135+ } ;
136+ }
107137 const stylesByCategory = {
108138 [ Category . primary ] : {
109139 bgColorPrimary : props . theme . colors [ variant ] . main ,
@@ -129,6 +159,20 @@ const getHoverStateStyles = (props: ThemeProp & ButtonProps) => {
129159 const variant = props . variant || defaultProps . variant ;
130160 const category = props . category || defaultProps . category ;
131161
162+ if ( props . tag === "a" ) {
163+ return {
164+ bgColorPrimary : "transparent" ,
165+ borderColorPrimary : "transparent" ,
166+ txtColorPrimary : props . theme . colors . button . link . hover ,
167+ bgColorSecondary : "transparent" ,
168+ borderColorSecondary : "transparent" ,
169+ txtColorSecondary : props . theme . colors . button . link . hover ,
170+ bgColorTertiary : "transparent" ,
171+ borderColorTertiary : "transparent" ,
172+ txtColorTertiary : props . theme . colors . button . link . hover ,
173+ } ;
174+ }
175+
132176 const stylesByCategory = {
133177 [ Category . primary ] : {
134178 bgColorPrimary : props . theme . colors [ variant ] . dark ,
@@ -154,6 +198,19 @@ const getActiveStateStyles = (props: ThemeProp & ButtonProps) => {
154198 const variant = props . variant || defaultProps . variant ;
155199 const category = props . category || defaultProps . category ;
156200
201+ if ( props . tag === "a" ) {
202+ return {
203+ bgColorPrimary : "transparent" ,
204+ borderColorPrimary : "transparent" ,
205+ txtColorPrimary : props . theme . colors . button . link . active ,
206+ bgColorSecondary : "transparent" ,
207+ borderColorSecondary : "transparent" ,
208+ txtColorSecondary : props . theme . colors . button . link . active ,
209+ bgColorTertiary : "transparent" ,
210+ borderColorTertiary : "transparent" ,
211+ txtColorTertiary : props . theme . colors . button . link . active ,
212+ } ;
213+ }
157214 const stylesByCategory = {
158215 [ Category . primary ] : {
159216 bgColorPrimary : props . theme . colors [ variant ] . dark ,
@@ -307,11 +364,25 @@ const ButtonStyles = css<ThemeProp & ButtonProps>`
307364 border-radius: 0;
308365 ${ ( props ) => btnFontStyles ( props ) . buttonFont } ;
309366 padding: ${ ( props ) => btnFontStyles ( props ) . padding } ;
310- .${ Classes . ICON } {
367+ .${ Classes . ICON } :not([name="no-response"]) {
311368 margin-right: ${ ( props ) =>
312369 props . text && props . icon ? `${ props . theme . spaces [ 2 ] - 1 } px` : `0` } ;
313370 path {
314371 fill: ${ ( props ) => btnColorStyles ( props , "main" ) . txtColor } ;
372+ &[stroke-width],
373+ &[stroke] {
374+ stroke: ${ ( props ) => btnColorStyles ( props , "main" ) . txtColor } ;
375+ fill: transparent;
376+ }
377+ }
378+ rect[stroke] {
379+ stroke: ${ ( props ) => btnColorStyles ( props , "main" ) . txtColor } ;
380+ }
381+ &[name="search"] {
382+ circle {
383+ fill: transparent;
384+ stroke: ${ ( props ) => btnColorStyles ( props , "main" ) . txtColor } ;
385+ }
315386 }
316387 }
317388 &:hover {
@@ -326,6 +397,20 @@ const ButtonStyles = css<ThemeProp & ButtonProps>`
326397 props . text && props . icon ? `${ props . theme . spaces [ 2 ] - 1 } px` : `0` } ;
327398 path {
328399 fill: ${ ( props ) => btnColorStyles ( props , "hover" ) . txtColor } ;
400+ &[stroke-width],
401+ &[stroke] {
402+ fill: transparent;
403+ stroke: ${ ( props ) => btnColorStyles ( props , "hover" ) . txtColor } ;
404+ }
405+ }
406+ rect[stroke] {
407+ stroke: ${ ( props ) => btnColorStyles ( props , "hover" ) . txtColor } ;
408+ }
409+ &[name="search"] {
410+ circle {
411+ fill: transparent;
412+ stroke: ${ ( props ) => btnColorStyles ( props , "hover" ) . txtColor } ;
413+ }
329414 }
330415 }
331416 }
@@ -339,6 +424,20 @@ const ButtonStyles = css<ThemeProp & ButtonProps>`
339424 .${ Classes . ICON } {
340425 path {
341426 fill: ${ ( props ) => btnColorStyles ( props , "active" ) . txtColor } ;
427+ &[stroke-width],
428+ &[stroke] {
429+ fill: transparent;
430+ stroke: ${ ( props ) => btnColorStyles ( props , "active" ) . txtColor } ;
431+ }
432+ }
433+ rect[stroke] {
434+ stroke: ${ ( props ) => btnColorStyles ( props , "active" ) . txtColor } ;
435+ }
436+ &[name="search"] {
437+ circle {
438+ fill: transparent;
439+ stroke: ${ ( props ) => btnColorStyles ( props , "active" ) . txtColor } ;
440+ }
342441 }
343442 }
344443 }
@@ -352,6 +451,9 @@ const ButtonStyles = css<ThemeProp & ButtonProps>`
352451 right: 0;
353452 margin-left: auto;
354453 margin-right: auto;
454+ circle {
455+ stroke: ${ ( props ) => props . theme . colors . button . disabledText } ;
456+ }
355457 }
356458` ;
357459
@@ -361,6 +463,8 @@ const StyledButton = styled("button")`
361463
362464const StyledLinkButton = styled ( "a" ) `
363465 ${ ButtonStyles }
466+ background: transparent;
467+ border-color: transparent;
364468` ;
365469
366470export const VisibilityWrapper = styled . div `
@@ -407,8 +511,11 @@ const getTextContent = (props: ButtonProps) =>
407511
408512const getButtonContent = ( props : ButtonProps ) => (
409513 < >
410- { getIconContent ( props ) }
411- < span > { getTextContent ( props ) } </ span >
514+ { props . tag === "button" && getIconContent ( props ) }
515+ < span style = { { marginRight : props . tag === "a" ? 7.67 : 0 } } >
516+ { getTextContent ( props ) }
517+ </ span >
518+ { props . tag === "a" && getIconContent ( props ) }
412519 { props . isLoading ? < Spinner size = { IconSizeProp ( props . size ) } /> : null }
413520 </ >
414521) ;
0 commit comments