@@ -2016,11 +2016,14 @@ const row = style<
20162016 }
20172017 }
20182018 } ,
2019- // When checkbox selection, render the gray divider between rows as a border
20202019 borderTopWidth : 0 ,
20212020 borderBottomWidth : {
20222021 selectionStyle : {
2023- highlight : 0 ,
2022+ highlight : {
2023+ default : 1 ,
2024+ isSelected : 0 ,
2025+ isNextSelected : 0
2026+ } ,
20242027 checkbox : 1
20252028 }
20262029 } ,
@@ -2029,7 +2032,10 @@ const row = style<
20292032 borderStyle : 'solid' ,
20302033 borderColor : {
20312034 selectionStyle : {
2032- highlight : 'transparent' ,
2035+ highlight : {
2036+ default : 'gray-300' ,
2037+ isSelected : 'transparent'
2038+ } ,
20332039 checkbox : 'gray-300'
20342040 }
20352041 } ,
@@ -2057,32 +2063,42 @@ const row = style<
20572063 isSelected : '--borderColorBlue'
20582064 }
20592065 } ,
2060- // When highlight selection, render gray dividers as box shadow
2061- boxShadow : {
2062- selectionStyle : {
2063- highlight : {
2064- default : '[inset 0 -1px 0px var(--borderColorGray)]' ,
2065- isNextSelected : '[inset 0 0 0 var(--borderColorGray)]'
2066- // TODO: Determine if we want to support gray dividers between selected grouped rows
2067- // isSelected: {
2068- // isNextSelected: '[inset 0 -1px 0px var(--borderColorGray)]'
2069- // }
2070- }
2071- } ,
2072- forcedColors : {
2073- isFocusVisible : '[inset 0 0 0 2px Highlight]'
2066+ '--focusRingColor' : {
2067+ type : 'outlineColor' ,
2068+ value : {
2069+ default : 'focus-ring' ,
2070+ forcedColors : 'Highlight'
20742071 }
20752072 } ,
20762073 fontWeight : {
20772074 default : 'normal' ,
20782075 isInFooter : 'bold'
20792076 } ,
20802077 isolation : 'isolate' ,
2081- forcedColorAdjust : 'none'
2078+ forcedColorAdjust : 'none' ,
2079+ '--topPosition' : {
2080+ type : 'top' ,
2081+ value : {
2082+ default : '[-1px]' ,
2083+ isFirstItem : 0
2084+ }
2085+ } ,
2086+ '--bottomPosition' : {
2087+ type : 'bottom' ,
2088+ value : {
2089+ default : '[-1px]' ,
2090+ selectionStyle : {
2091+ highlight : {
2092+ default : '[-1px]' ,
2093+ isSelected : 0
2094+ }
2095+ }
2096+ }
2097+ }
20822098} ) ;
20832099
20842100// Sticky cells (the drag cell, and the checkbox cell when present) get an inline z-index=2 applied by the virtualizer's layout
2085- // To ensure that the highlight selection border is painted above the stick cells, set z-index to 3
2101+ // To ensure that the highlight selection border is painted above the sticky cells, set z-index to 3
20862102const highlightSelectionBorder = css (
20872103 `&:before {
20882104 content: "";
@@ -2110,15 +2126,15 @@ const highlightSelectionBorder = css(
21102126const focusIndicator = css (
21112127 `&:after {
21122128 content: "";
2113- width: 100%;
2114- height: 100%;
2115- top: 0;
2116- z-index: 2;
2129+ top: var(--topPosition);
2130+ bottom: var(--bottomPosition);
2131+ z-index: 3;
21172132 inset-inline-start: 0;
2133+ inset-inline-end: 0;
21182134 border-radius: 5px;
21192135 position: absolute;
21202136 outline-style: solid;
2121- outline-color: var(--borderColorBlue );
2137+ outline-color: var(--focusRingColor );
21222138 outline-width: 2px;
21232139 outline-offset: -2px;
21242140 pointer-events: none;
@@ -2174,6 +2190,7 @@ export const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T>(
21742190 ...tableVisualOptions ,
21752191 selectionStyle,
21762192 isInFooter,
2193+ isFirstItem : isFirstItem ( renderProps . id , renderProps . state ) ,
21772194 isNextSelected : isNextSelected ( renderProps . id , renderProps . state ) ,
21782195 isPrevSelected : isPrevSelected ( renderProps . id , renderProps . state )
21792196 } ) +
@@ -2254,3 +2271,10 @@ export function isPrevSelected(id: Key | undefined, state: TableState<unknown>)
22542271 let keyBefore = state . collection . getKeyBefore ( id ) ;
22552272 return keyBefore != null && state . selectionManager . isSelected ( keyBefore ) ;
22562273}
2274+
2275+ function isFirstItem ( id : Key | undefined , state : TableState < unknown > ) {
2276+ if ( id == null || ! state ) {
2277+ return false ;
2278+ }
2279+ return state . collection . getFirstKey ( ) === id ;
2280+ }
0 commit comments