@@ -67,7 +67,6 @@ export const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & Togg
67
67
...focusRing ( ) ,
68
68
...staticColor ( ) ,
69
69
...controlStyle ,
70
- display : 'grid' ,
71
70
justifyContent : 'center' ,
72
71
flexShrink : {
73
72
default : 1 ,
@@ -80,21 +79,9 @@ export const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & Togg
80
79
isJustified : 0
81
80
} ,
82
81
fontWeight : 'medium' ,
83
- width : 'fit' ,
84
82
userSelect : 'none' ,
85
83
transition : 'default' ,
86
84
forcedColorAdjust : 'none' ,
87
- position : 'relative' ,
88
- gridTemplateAreas : {
89
- default : [ 'icon text' ] ,
90
- [ iconOnly ] : [ 'icon' ] ,
91
- [ textOnly ] : [ 'text' ]
92
- } ,
93
- gridTemplateColumns : {
94
- default : [ 'auto' , 'auto' ] ,
95
- [ iconOnly ] : [ 'auto' ] ,
96
- [ textOnly ] : [ 'auto' ]
97
- } ,
98
85
backgroundColor : {
99
86
default : {
100
87
...baseColor ( 'gray-100' ) ,
@@ -236,7 +223,8 @@ export const btnStyles = style<ButtonRenderProps & ActionButtonStyleProps & Togg
236
223
'--badgePosition' : {
237
224
type : 'width' ,
238
225
value : {
239
- default : '--iconWidth' ,
226
+ default : 'calc(self(paddingStart) + var(--iconWidth))' ,
227
+ [ iconOnly ] : 'calc(self(minWidth)/2 + var(--iconWidth)/2)' ,
240
228
[ textOnly ] : 'full'
241
229
}
242
230
} ,
@@ -301,10 +289,10 @@ export const ActionButton = forwardRef(function ActionButton(props: ActionButton
301
289
< Provider
302
290
values = { [
303
291
[ SkeletonContext , null ] ,
304
- [ TextContext , { styles : style ( { truncate : true , gridArea : 'text' } ) } ] ,
292
+ [ TextContext , { styles : style ( { order : 1 , truncate : true } ) } ] ,
305
293
[ IconContext , {
306
- render : centerBaseline ( { slot : 'icon' , styles : style ( { gridArea : 'icon' } ) } ) ,
307
- styles : style ( { size : fontRelative ( 20 ) , marginStart : '--iconMargin' } )
294
+ render : centerBaseline ( { slot : 'icon' , styles : style ( { order : 0 } ) } ) ,
295
+ styles : style ( { size : fontRelative ( 20 ) , marginStart : '--iconMargin' , flexShrink : 0 } )
308
296
} ] ,
309
297
[ AvatarContext , {
310
298
size : avatarSize [ size ] ,
@@ -313,14 +301,15 @@ export const ActionButton = forwardRef(function ActionButton(props: ActionButton
313
301
default : '--iconMargin' ,
314
302
':last-child' : 0
315
303
} ,
316
- gridArea : 'icon'
304
+ flexShrink : 0 ,
305
+ order : 0
317
306
} )
318
307
} ] ,
319
308
[ NotificationBadgeContext , {
320
309
staticColor : staticColor ,
321
310
size : props . size === 'XS' ? undefined : props . size ,
322
311
isDisabled : props . isDisabled ,
323
- styles : style ( { position : 'absolute' , top : '--badgeTop' , marginTop : 'calc((self(height) * -1)/2)' , marginStart : 'calc(var(--iconMargin) * 2 + ( self(height) * -1)/4)' , gridColumnStart : 1 , insetStart : '--badgePosition '} )
312
+ styles : style ( { position : 'absolute' , top : '--badgeTop' , insetStart : '--badgePosition' , marginTop : 'calc((self(height) * -1)/2)' , marginStart : 'calc(( self(height) * -1)/2) ' } )
324
313
} ]
325
314
] } >
326
315
{ typeof props . children === 'string' ? < Text > { props . children } </ Text > : props . children }
0 commit comments