Skip to content

Commit

Permalink
Audit fix: Remove hover props from s2 (adobe#7094)
Browse files Browse the repository at this point in the history
* Remove extraneous hover props from s2

* Fix ts

* use the correct prop name
  • Loading branch information
snowystinger committed Sep 26, 2024
1 parent a626c25 commit ff56080
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/@react-spectrum/s2/src/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface CardRenderProps {
size: 'XS' | 'S' | 'M' | 'L' | 'XL'
}

export interface CardProps extends Omit<GridListItemProps, 'className' | 'style' | 'children'>, StyleProps {
export interface CardProps extends Omit<GridListItemProps, 'className' | 'style' | 'children' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'>, StyleProps {
/** The children of the Card. */
children: ReactNode | ((renderProps: CardRenderProps) => ReactNode),
/**
Expand Down Expand Up @@ -438,9 +438,9 @@ export const Card = forwardRef(function Card(props: CardProps, ref: DOMRef<HTMLD
{...props}
ref={domRef}
className={renderProps => UNSAFE_className + card({...renderProps, isCardView: true, isLink: !!props.href, size, density, variant}, styles)}
style={renderProps =>
style={renderProps =>
// Only the preview in quiet cards scales down on press
variant === 'quiet' ? UNSAFE_style : press(renderProps)
variant === 'quiet' ? UNSAFE_style : press(renderProps)
}>
{({selectionMode, selectionBehavior, isHovered, isFocusVisible, isSelected, isPressed}) => (
<InternalCardContext.Provider value={{size, isQuiet, isCheckboxSelection: selectionMode !== 'none' && selectionBehavior === 'toggle', isHovered, isFocusVisible, isSelected, isPressed}}>
Expand All @@ -466,7 +466,7 @@ function SelectionIndicator() {
className={selectionIndicator({
size,
isSelected,
// Add an inner stroke only for quiet cards with no checkbox to
// Add an inner stroke only for quiet cards with no checkbox to
// help distinguish the selected state from the preview.
isStrokeInner: isQuiet && !isCheckboxSelection
})} />
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-spectrum/s2/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ const selectAllCheckboxColumn = style({

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

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

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

0 comments on commit ff56080

Please sign in to comment.