Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 79 additions & 88 deletions packages/@react-spectrum/s2/src/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ const listitem = style<GridListItemRenderProps & {
selectionStyle?: 'highlight' | 'checkbox',
scale?: 'medium' | 'large'
}>({
...focusRing(),
outlineStyle: 'none',
boxSizing: 'border-box',
outlineOffset: -2,
columnGap: 0,
paddingX: 0,
paddingY: 8,
Expand Down Expand Up @@ -320,7 +319,6 @@ const listitem = style<GridListItemRenderProps & {
default: 'default',
isLink: 'pointer'
},
transition: 'default',
'--borderColor': {
type: 'borderColor',
value: {
Expand All @@ -339,54 +337,16 @@ const listitem = style<GridListItemRenderProps & {
default: 1,
isLastItem: {
default: 1,
isQuiet: {
selectionStyle: {
checkbox: 0,
highlight: {
default: 0,
isSelected: 1
}
}
}
isQuiet: 0
}
},
borderStartWidth: 0,
borderEndWidth: 0,
borderStyle: 'solid',
borderColor: {
default: '--borderColor',
isSelected: {
selectionStyle: {
highlight: {
default: 'transparent',
isNextSelected: 'transparent'
},
checkbox: {
default: '--borderColor',
isNextSelected: selectedBackground
}
}
}
},
borderTopStartRadius: {
isFirstItem: 'default'
},
borderTopEndRadius: {
isFirstItem: 'default'
},
borderBottomStartRadius: {
isLastItem: {
isQuiet: {
isSelected: 'default'
}
}
},
borderBottomEndRadius: {
isLastItem: {
isQuiet: {
isSelected: 'default'
}
}
isNextSelected: 'transparent',
isSelected: 'transparent'
}
});

Expand All @@ -400,22 +360,22 @@ const listRowBackground = style<GridListItemRenderProps & {
isNextNotSelected?: boolean,
selectionStyle?: 'highlight' | 'checkbox'
}>({
...focusRing(),
outlineOffset: -2,
position: 'absolute',
zIndex: -1,
top: 0,
top: {
default: 0,
isSelected: '[-1px]',
// Don't overlap focus ring of row above.
isPrevSelected: 0,
isFirstItem: 0
},
left: 0,
right: 0,
bottom: {
default: 0,
isSelected: {
selectionStyle: {
checkbox: 0,
highlight: {
default: 0,
isNextSelected: '[-1px]'
}
}
}
isSelected: '[-1px]'
},
backgroundColor: {
default: '--rowBackgroundColor',
Expand All @@ -440,9 +400,10 @@ const listRowBackground = style<GridListItemRenderProps & {
isFocusVisible: selectedActiveBackground
},
highlight: {
default: 'blue-900/10',
isHovered: 'blue-900/15',
isPressed: 'blue-900/15'
// Use solid colors rather than transparent because the rows overlap.
default: colorMix('gray-25', 'blue-900', 10),
isHovered: colorMix('gray-25', 'blue-900', 15),
isPressed: colorMix('gray-25', 'blue-900', 15)
}
}
},
Expand All @@ -451,64 +412,94 @@ const listRowBackground = style<GridListItemRenderProps & {
}
},
borderTopStartRadius: {
isFirstItem: 'default'
isFirstItem: {
isSelected: {
selectionStyle: {
checkbox: 'none',
highlight: 'default'
}
},
isQuiet: 'default',
isFocusVisible: 'default'
}
},
borderTopEndRadius: {
isFirstItem: 'default'
isFirstItem: {
isSelected: {
selectionStyle: {
checkbox: 'none',
highlight: 'default'
}
},
isQuiet: 'default',
isFocusVisible: 'default'
}
},
borderBottomStartRadius: {
isLastItem: {
isQuiet: {
isSelected: 'default'
}
isSelected: {
selectionStyle: {
checkbox: 'none',
highlight: 'default'
}
},
isQuiet: 'default',
isFocusVisible: 'default'
}
},
borderBottomEndRadius: {
isLastItem: {
isQuiet: {
isSelected: 'default'
}
isSelected: {
selectionStyle: {
checkbox: 'none',
highlight: 'default'
}
},
isQuiet: 'default',
isFocusVisible: 'default'
}
},
borderTopWidth: {
default: 1,
isPrevSelected: {
default: {
selectionStyle: {
highlight: 0,
checkbox: 0
checkbox: 0,
highlight: 1
}
}
},
isPrevSelected: 0
},
borderBottomWidth: {
default: 1,
isNextSelected: {
default: {
selectionStyle: {
highlight: 0,
checkbox: 0
checkbox: 0,
highlight: 1
}
},
isLastItem: {
default: 1,
isQuiet: {
selectionStyle: {
checkbox: 0,
highlight: {
default: 0,
isSelected: 1
}
}
isNextSelected: 0
},
borderStartWidth: {
default: {
selectionStyle: {
checkbox: 0,
highlight: 1
}
}
},
borderEndWidth: {
default: {
selectionStyle: {
checkbox: 0,
highlight: 1
}
}
},
borderStartWidth: 1,
borderEndWidth: 1,
borderStyle: 'solid',
borderColor: {
default: 'transparent',
isSelected: {
selectionStyle: {
highlight: '--borderColor',
checkbox: 'transparent'
checkbox: 'transparent',
highlight: '--borderColor'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/s2-docs/src/StackBlitz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function getFiles(
'tailwindcss-animate': '^1'
} : {}),
...(type === 's2' ? {
'unplugin-parcel-macros': '^0.1.2-alpha.1'
'unplugin-parcel-macros': '^0.2.0'
} : {})
}
}, null, 2) + '\n',
Expand Down
Loading