@@ -16,13 +16,23 @@ import {BasicHorizontalCard} from './HorizontalCard';
1616import { Button } from 'react-aria-components/Button' ;
1717import { CardProps } from '@react-spectrum/s2/Card' ;
1818import Close from '@react-spectrum/s2/icons/Close' ;
19- import { controlSize , getAllowedOverrides } from './style-utils-copy' with { type : 'macro' } ;
2019import { forwardRef , useRef } from 'react' ;
2120import { iconStyle } from '@react-spectrum/s2/style' with { type : 'macro' } ;
21+ import { mergeStyles } from '@react-spectrum/s2/mergeStyles' ;
2222import { pressScale } from '@react-spectrum/s2/pressScale' ;
2323import { Tag , TagGroup , TagList } from 'react-aria-components/TagGroup' ;
2424import { useDOMRef } from './useDOMRef' ;
2525
26+ const controlSizeM = {
27+ default : 32 ,
28+ size : {
29+ XS : 20 ,
30+ S : 24 ,
31+ L : 40 ,
32+ XL : 48
33+ }
34+ } as const ;
35+
2636const hoverBackground = {
2737 default : 'gray-200' ,
2838 isStaticColor : 'transparent-overlay-200'
@@ -34,43 +44,40 @@ const styles = style<{
3444 isFocusVisible : boolean ;
3545 isPressed : boolean ;
3646 size : 'S' | 'M' | 'L' | 'XL' ;
37- } > (
38- {
39- ...focusRing ( ) ,
40- display : 'flex' ,
41- alignItems : 'center' ,
42- justifyContent : 'center' ,
43- size : controlSize ( ) ,
44- flexShrink : 0 ,
45- borderRadius : 'full' ,
46- padding : 0 ,
47- borderStyle : 'none' ,
48- transition : 'default' ,
49- backgroundColor : {
50- default : 'gray-200' ,
51- isHovered : hoverBackground ,
52- isFocusVisible : hoverBackground ,
53- isPressed : hoverBackground
54- } ,
55- '--iconPrimary' : {
56- type : 'color' ,
57- value : {
58- default : baseColor ( 'neutral' ) ,
59- isDisabled : 'disabled' ,
60- forcedColors : {
61- default : 'ButtonText' ,
62- isDisabled : 'GrayText'
63- }
47+ } > ( {
48+ ...focusRing ( ) ,
49+ display : 'flex' ,
50+ alignItems : 'center' ,
51+ justifyContent : 'center' ,
52+ size : controlSizeM ,
53+ flexShrink : 0 ,
54+ borderRadius : 'full' ,
55+ padding : 0 ,
56+ borderStyle : 'none' ,
57+ transition : 'default' ,
58+ backgroundColor : {
59+ default : 'gray-200' ,
60+ isHovered : hoverBackground ,
61+ isFocusVisible : hoverBackground ,
62+ isPressed : hoverBackground
63+ } ,
64+ '--iconPrimary' : {
65+ type : 'color' ,
66+ value : {
67+ default : baseColor ( 'neutral' ) ,
68+ isDisabled : 'disabled' ,
69+ forcedColors : {
70+ default : 'ButtonText' ,
71+ isDisabled : 'GrayText'
6472 }
65- } ,
66- outlineColor : {
67- default : 'focus-ring' ,
68- forcedColors : 'Highlight'
69- } ,
70- disableTapHighlight : true
73+ }
7174 } ,
72- getAllowedOverrides ( )
73- ) ;
75+ outlineColor : {
76+ default : 'focus-ring' ,
77+ forcedColors : 'Highlight'
78+ } ,
79+ disableTapHighlight : true
80+ } ) ;
7481
7582const closeIconStyle = ( { size = 'M' } ) => {
7683 if ( size === 'S' ) return iconStyle ( { size : 'XS' } ) ;
@@ -88,21 +95,21 @@ const CloseButton = function CloseButton(props) {
8895 ref = { ref }
8996 slot = "remove"
9097 style = { pressScale ( ref , { } ) }
91- className = { renderProps => styles ( { ...renderProps , size : props . size || 'M' } , props . styles ) } >
98+ className = { renderProps =>
99+ mergeStyles ( styles ( { ...renderProps , size : props . size || 'M' } ) , props . styles )
100+ } >
92101 < Close styles = { closeIconStyle ( { size : props . size ?? 'M' } ) } />
93102 </ Button >
94103 ) ;
95104} ;
96105
97- let attachmentListStyles = style ( { } , getAllowedOverrides ( ) ) ;
98-
99106export const AttachmentList = forwardRef ( function AttachmentList (
100107 props : any ,
101108 ref : DOMRef < HTMLDivElement >
102109) {
103110 let domRef = useDOMRef ( ref ) ;
104111 return (
105- < TagGroup { ...props } className = { attachmentListStyles ( props . styles ) } ref = { domRef } >
112+ < TagGroup { ...props } className = { props . styles } ref = { domRef } >
106113 < TagList
107114 className = { style ( {
108115 display : 'flex' ,
0 commit comments