@@ -25,20 +25,20 @@ const StyledBody = styled(Body)<{ $isSelectable: boolean; $showStripedRows: bool
25
25
'&&&' : {
26
26
border : 'none' ,
27
27
transition : rowBackgroundTransition ,
28
- '& tr:last-child td ' : {
28
+ '& tr:last-child .cell-wrapper ' : {
29
29
borderBottom : 'none' ,
30
30
} ,
31
31
32
- '& .row-select-single-selected td , .row-select-selected td ' : {
32
+ '& .row-select-single-selected .cell-wrapper-base , .row-select-selected .cell-wrapper-base ' : {
33
33
backgroundColor : getIn ( theme . colors , tableRow . nonStripe . backgroundColorSelected ) ,
34
34
} ,
35
- '& .row-select-single-selected:hover:not(.disabled-row) td , .row-select-selected:hover:not(.disabled-row) td ' : {
35
+ '& .row-select-single-selected:hover:not(.disabled-row) .cell-wrapper-base , .row-select-selected:hover:not(.disabled-row) .cell-wrapper-base ' : {
36
36
backgroundColor : getIn ( theme . colors , tableRow . nonStripe . backgroundColorSelectedHover ) ,
37
37
} ,
38
- '& .row-select-single-selected:focus:not(.disabled-row) td , .row-select-selected:focus:not(.disabled-row) td ' : {
38
+ '& .row-select-single-selected:focus:not(.disabled-row) .cell-wrapper-base , .row-select-selected:focus:not(.disabled-row) .cell-wrapper-base ' : {
39
39
backgroundColor : getIn ( theme . colors , tableRow . nonStripe . backgroundColorSelectedFocus ) ,
40
40
} ,
41
- '& .row-select-single-selected:active:not(.disabled-row) td , .row-select-selected:active:not(.disabled-row) td ' : {
41
+ '& .row-select-single-selected:active:not(.disabled-row) .cell-wrapper-base , .row-select-selected:active:not(.disabled-row) .cell-wrapper-base ' : {
42
42
backgroundColor : getIn ( theme . colors , tableRow . nonStripe . backgroundColorSelectedActive ) ,
43
43
} ,
44
44
@@ -52,7 +52,7 @@ const StyledBody = styled(Body)<{ $isSelectable: boolean; $showStripedRows: bool
52
52
'& tr:nth-child(even) .cell-wrapper' : {
53
53
backgroundColor : getIn ( theme . colors , tableRow . stripeWrapper . backgroundColor ) ,
54
54
} ,
55
- '& tr:nth-child(even) td ' : {
55
+ '& tr:nth-child(even) .cell-wrapper-base ' : {
56
56
backgroundColor : tableRow . stripe . backgroundColor ,
57
57
} ,
58
58
} ) ,
@@ -90,26 +90,26 @@ const StyledBody = styled(Body)<{ $isSelectable: boolean; $showStripedRows: bool
90
90
) ,
91
91
} ,
92
92
93
- '& tr:nth-child(even):hover:not(.disabled-row) td ' : {
93
+ '& tr:nth-child(even):hover:not(.disabled-row) .cell-wrapper-base ' : {
94
94
backgroundColor : getIn ( theme . colors , tableRow . stripe . backgroundColorHover ) ,
95
95
} ,
96
- '& tr:nth-child(even):focus:not(.disabled-row) td ' : {
96
+ '& tr:nth-child(even):focus:not(.disabled-row) .cell-wrapper-base ' : {
97
97
backgroundColor : getIn ( theme . colors , tableRow . stripe . backgroundColorFocus ) ,
98
98
} ,
99
- '& tr:nth-child(even):active:not(.disabled-row) td ' : {
99
+ '& tr:nth-child(even):active:not(.disabled-row) .cell-wrapper-base ' : {
100
100
backgroundColor : getIn ( theme . colors , tableRow . stripe . backgroundColorActive ) ,
101
101
} ,
102
102
103
- '& .row-select-single-selected:nth-child(even) td , .row-select-selected:nth-child(even) td ' : {
103
+ '& .row-select-single-selected:nth-child(even) .cell-wrapper-base , .row-select-selected:nth-child(even) .cell-wrapper-base ' : {
104
104
backgroundColor : getIn ( theme . colors , tableRow . stripe . backgroundColorSelected ) ,
105
105
} ,
106
- '& .row-select-single-selected:nth-child(even):hover:not(.disabled-row) td , .row-select-selected:nth-child(even):hover:not(.disabled-row) td ' : {
106
+ '& .row-select-single-selected:nth-child(even):hover:not(.disabled-row) .cell-wrapper-base , .row-select-selected:nth-child(even):hover:not(.disabled-row) .cell-wrapper-base ' : {
107
107
backgroundColor : getIn ( theme . colors , tableRow . stripe . backgroundColorSelectedHover ) ,
108
108
} ,
109
- '& .row-select-single-selected:nth-child(even):focus:not(.disabled-row) td , .row-select-selected:nth-child(even):focus:not(.disabled-row) td ' : {
109
+ '& .row-select-single-selected:nth-child(even):focus:not(.disabled-row) .cell-wrapper-base , .row-select-selected:nth-child(even):focus:not(.disabled-row) .cell-wrapper-base ' : {
110
110
backgroundColor : getIn ( theme . colors , tableRow . stripe . backgroundColorSelectedFocus ) ,
111
111
} ,
112
- '& .row-select-single-selected:nth-child(even):active:not(.disabled-row) td , .row-select-selected:nth-child(even):active:not(.disabled-row) td ' : {
112
+ '& .row-select-single-selected:nth-child(even):active:not(.disabled-row) .cell-wrapper-base , .row-select-selected:nth-child(even):active:not(.disabled-row) .cell-wrapper-base ' : {
113
113
backgroundColor : getIn ( theme . colors , tableRow . stripe . backgroundColorSelectedActive ) ,
114
114
} ,
115
115
} ) ,
@@ -191,18 +191,21 @@ const _TableCell = ({ children }: TableCellProps): React.ReactElement => {
191
191
$surfaceLevel = { surfaceLevel }
192
192
{ ...metaAttribute ( { name : MetaConstants . TableCell } ) }
193
193
>
194
- < CellWrapper
195
- className = "cell-wrapper"
196
- rowDensity = { rowDensity }
197
- showStripedRows = { showStripedRows }
198
- display = "flex"
199
- alignItems = "center"
200
- // when a direct string child is passed we want to disable pointer events
201
- // for custom cells components, consumers can handle pointer events themselves
202
- pointerEvents = { isChildrenString && isSelectable ? 'none' : 'auto' }
203
- >
204
- { isChildrenString ? < Text size = "medium" > { children } </ Text > : children }
205
- </ CellWrapper >
194
+ < BaseBox className = "cell-wrapper-base" display = "flex" alignItems = "center" height = "100%" >
195
+ < CellWrapper
196
+ className = "cell-wrapper"
197
+ rowDensity = { rowDensity }
198
+ showStripedRows = { showStripedRows }
199
+ display = "flex"
200
+ alignItems = "center"
201
+ flex = { 1 }
202
+ // when a direct string child is passed we want to disable pointer events
203
+ // for custom cells components, consumers can handle pointer events themselves
204
+ pointerEvents = { isChildrenString && isSelectable ? 'none' : 'auto' }
205
+ >
206
+ { isChildrenString ? < Text size = "medium" > { children } </ Text > : children }
207
+ </ CellWrapper >
208
+ </ BaseBox >
206
209
</ StyledCell >
207
210
) ;
208
211
} ;
@@ -244,17 +247,17 @@ const StyledRow = styled(Row)<{ $isSelectable: boolean }>(({ theme, $isSelectabl
244
247
'&&&' : {
245
248
backgroundColor : 'transparent' ,
246
249
...( $isSelectable && {
247
- '&:hover:not(.disabled-row) td ' : {
250
+ '&:hover:not(.disabled-row) .cell-wrapper-base ' : {
248
251
transition : rowBackgroundTransition ,
249
252
backgroundColor : getIn ( theme . colors , tableRow . nonStripe . backgroundColorHover ) ,
250
253
cursor : 'pointer' ,
251
254
} ,
252
- '&:focus:not(.disabled-row) td ' : {
255
+ '&:focus:not(.disabled-row) .cell-wrapper-base ' : {
253
256
transition : rowBackgroundTransition ,
254
257
backgroundColor : getIn ( theme . colors , tableRow . nonStripe . backgroundColorFocus ) ,
255
258
cursor : 'pointer' ,
256
259
} ,
257
- '&:active:not(.disabled-row) td ' : {
260
+ '&:active:not(.disabled-row) .cell-wrapper-base ' : {
258
261
transition : rowBackgroundTransition ,
259
262
backgroundColor : getIn ( theme . colors , tableRow . nonStripe . backgroundColorActive ) ,
260
263
cursor : 'pointer' ,
0 commit comments