Skip to content

Commit ff56080

Browse files
authored
Audit fix: Remove hover props from s2 (#7094)
* Remove extraneous hover props from s2 * Fix ts * use the correct prop name
1 parent a626c25 commit ff56080

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/@react-spectrum/s2/src/Card.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ interface CardRenderProps {
3737
size: 'XS' | 'S' | 'M' | 'L' | 'XL'
3838
}
3939

40-
export interface CardProps extends Omit<GridListItemProps, 'className' | 'style' | 'children'>, StyleProps {
40+
export interface CardProps extends Omit<GridListItemProps, 'className' | 'style' | 'children' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'>, StyleProps {
4141
/** The children of the Card. */
4242
children: ReactNode | ((renderProps: CardRenderProps) => ReactNode),
4343
/**
@@ -438,9 +438,9 @@ export const Card = forwardRef(function Card(props: CardProps, ref: DOMRef<HTMLD
438438
{...props}
439439
ref={domRef}
440440
className={renderProps => UNSAFE_className + card({...renderProps, isCardView: true, isLink: !!props.href, size, density, variant}, styles)}
441-
style={renderProps =>
441+
style={renderProps =>
442442
// Only the preview in quiet cards scales down on press
443-
variant === 'quiet' ? UNSAFE_style : press(renderProps)
443+
variant === 'quiet' ? UNSAFE_style : press(renderProps)
444444
}>
445445
{({selectionMode, selectionBehavior, isHovered, isFocusVisible, isSelected, isPressed}) => (
446446
<InternalCardContext.Provider value={{size, isQuiet, isCheckboxSelection: selectionMode !== 'none' && selectionBehavior === 'toggle', isHovered, isFocusVisible, isSelected, isPressed}}>
@@ -466,7 +466,7 @@ function SelectionIndicator() {
466466
className={selectionIndicator({
467467
size,
468468
isSelected,
469-
// Add an inner stroke only for quiet cards with no checkbox to
469+
// Add an inner stroke only for quiet cards with no checkbox to
470470
// help distinguish the selected state from the preview.
471471
isStrokeInner: isQuiet && !isCheckboxSelection
472472
})} />

packages/@react-spectrum/s2/src/Table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ const selectAllCheckboxColumn = style({
814814

815815
let InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({isHeaderRowHovered: false});
816816

817-
export interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies'> {}
817+
export interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {}
818818

819819
/**
820820
* A header within a `<Table>`, containing the table columns.

0 commit comments

Comments
 (0)