From ff56080d1b0fa64b4ae1a8c04e33c836d440393c Mon Sep 17 00:00:00 2001 From: Robert Snow Date: Fri, 27 Sep 2024 04:17:52 +1000 Subject: [PATCH] Audit fix: Remove hover props from s2 (#7094) * Remove extraneous hover props from s2 * Fix ts * use the correct prop name --- packages/@react-spectrum/s2/src/Card.tsx | 8 ++++---- packages/@react-spectrum/s2/src/Table.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@react-spectrum/s2/src/Card.tsx b/packages/@react-spectrum/s2/src/Card.tsx index 2c0286aa655..a898a2e6298 100644 --- a/packages/@react-spectrum/s2/src/Card.tsx +++ b/packages/@react-spectrum/s2/src/Card.tsx @@ -37,7 +37,7 @@ interface CardRenderProps { size: 'XS' | 'S' | 'M' | 'L' | 'XL' } -export interface CardProps extends Omit, StyleProps { +export interface CardProps extends Omit, StyleProps { /** The children of the Card. */ children: ReactNode | ((renderProps: CardRenderProps) => ReactNode), /** @@ -438,9 +438,9 @@ export const Card = forwardRef(function Card(props: CardProps, ref: DOMRef 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}) => ( @@ -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 })} /> diff --git a/packages/@react-spectrum/s2/src/Table.tsx b/packages/@react-spectrum/s2/src/Table.tsx index abbf8665556..104d2740a7e 100644 --- a/packages/@react-spectrum/s2/src/Table.tsx +++ b/packages/@react-spectrum/s2/src/Table.tsx @@ -814,7 +814,7 @@ const selectAllCheckboxColumn = style({ let InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({isHeaderRowHovered: false}); -export interface TableHeaderProps extends Omit, 'style' | 'className' | 'dependencies'> {} +export interface TableHeaderProps extends Omit, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {} /** * A header within a ``, containing the table columns.