@@ -41,7 +41,7 @@ const generateStyle = (
4141 props : TagProps ,
4242 sharedTokens : SharedTokens
4343) : TagStyle => {
44- const { variant , size, dismissible, onClick, disabled } = props
44+ const { size, dismissible, onClick, disabled } = props
4545
4646 const isButton = ! ! onClick
4747
@@ -118,66 +118,6 @@ const generateStyle = (
118118 }
119119 : { }
120120
121- const tagVariantVariants = {
122- default : {
123- tag : {
124- backgroundColor : componentTheme . defaultBackground ,
125- border : `${ componentTheme . defaultBorderWidth } ${ componentTheme . defaultBorderStyle } ${ componentTheme . defaultBorderColor } ` ,
126- borderRadius : componentTheme . defaultBorderRadius ,
127- color : componentTheme . defaultColor ,
128- ...( isButton && {
129- '&:hover' : { backgroundColor : componentTheme . defaultBackgroundHover }
130- } )
131- } ,
132- tagBefore : {
133- ...( isButton && {
134- borderRadius : componentTheme . defaultBorderRadius
135- } )
136- }
137- } ,
138- inline : {
139- tag : {
140- backgroundColor : componentTheme . inlineBackground ,
141- border : `${ componentTheme . inlineBorderWidth } ${ componentTheme . inlineBorderStyle } ${ componentTheme . inlineBorderColor } ` ,
142- borderRadius : componentTheme . inlineBorderRadius ,
143- color : componentTheme . inlineColor ,
144- cursor : 'text' ,
145- margin : '0 0.1875rem 0.1875rem' ,
146- ...( isButton && {
147- '&:hover' : { backgroundColor : componentTheme . inlineBackgroundHover }
148- } )
149- } ,
150- tagBefore : {
151- ...( isButton && {
152- borderRadius : `calc(${ componentTheme . inlineBorderRadius } * 1.5)`
153- } )
154- }
155- }
156- }
157-
158- const inlineIconVariant =
159- variant === 'inline' && dismissible
160- ? {
161- backgroundColor : componentTheme . inlineIconColor ,
162- borderRadius : '50%' ,
163- padding : '0.25rem' ,
164- position : 'absolute' ,
165- insetInlineEnd : 0 ,
166- insetInlineStart : 'auto' ,
167- top : 0 ,
168- transform : 'translate(40%, -40%)' ,
169- display : 'flex' ,
170- alignItems : 'center' ,
171- justifyContent : 'center' ,
172-
173- '[class$="-tag"]:hover > &' : {
174- backgroundColor : componentTheme . inlineIconHoverColor
175- } ,
176-
177- '[dir="rtl"] &' : { transform : 'translate(-40%, -40%)' }
178- }
179- : { }
180-
181121 return {
182122 tag : {
183123 label : 'tag' ,
@@ -188,13 +128,21 @@ const generateStyle = (
188128 textAlign : 'center' ,
189129 verticalAlign : 'middle' ,
190130 userSelect : 'none' ,
131+ backgroundColor : componentTheme . defaultBackground ,
132+ border : `${ componentTheme . defaultBorderWidth } ${ componentTheme . defaultBorderStyle } ${ componentTheme . defaultBorderColor } ` ,
133+ borderRadius : componentTheme . defaultBorderRadius ,
134+ color : componentTheme . defaultColor ,
135+ ...( isButton && {
136+ '&:hover' : { backgroundColor : componentTheme . defaultBackgroundHover }
137+ } ) ,
191138 ...sizeVariants [ size ! ] . tag ,
192139 ...buttonVariant . tag ,
193- ...tagVariantVariants [ variant ! ] . tag ,
194140
195141 '&::before' : {
196142 ...buttonVariant . tagBefore ,
197- ...tagVariantVariants [ variant ! ] . tagBefore
143+ ...( isButton && {
144+ borderRadius : componentTheme . defaultBorderRadius
145+ } )
198146 }
199147 } ,
200148 text : {
@@ -210,8 +158,7 @@ const generateStyle = (
210158 marginInlineStart : componentTheme . iconMargin ,
211159 marginInlineEnd : 0 ,
212160 transition : `all ${ componentTheme . transitionTiming } ` ,
213- cursor : 'pointer' ,
214- ...inlineIconVariant
161+ cursor : 'pointer'
215162 }
216163 }
217164}
0 commit comments