Skip to content

Commit 01275a9

Browse files
authored
fix: Regressions from DOM events PR (#8525)
* fix merge order in ColorArea and ColorSwatch * omit global dom attributes from S2
1 parent 769d725 commit 01275a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+108
-106
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
import {ContextValue, DisclosureGroup, DisclosureGroupProps, SlotProps} from 'react-aria-components';
1414
import {DisclosureContext} from './Disclosure';
15-
import {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';
15+
import {DOMProps, DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared';
1616
import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' };
1717
import React, {createContext, forwardRef} from 'react';
1818
import {style} from '../style' with { type: 'macro' };
1919
import {useDOMRef} from '@react-spectrum/utils';
2020
import {useSpectrumContextProps} from './useSpectrumContextProps';
2121

22-
export interface AccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'children'>, UnsafeStyles, DOMProps, SlotProps {
22+
export interface AccordionProps extends Omit<DisclosureGroupProps, 'className' | 'style' | 'children' | keyof GlobalDOMAttributes>, UnsafeStyles, DOMProps, SlotProps {
2323
/** The disclosure elements in the accordion. */
2424
children: React.ReactNode,
2525
/** Spectrum-defined styles, returned by the `style()` macro. */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {ButtonProps, ButtonRenderProps, ContextValue, OverlayTriggerStateContext
1717
import {centerBaseline} from './CenterBaseline';
1818
import {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' };
1919
import {createContext, forwardRef, ReactNode, useContext} from 'react';
20-
import {FocusableRef, FocusableRefValue} from '@react-types/shared';
20+
import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared';
2121
import {IconContext} from './Icon';
2222
import {NotificationBadgeContext} from './NotificationBadge';
2323
import {pressScale} from './pressScale';
@@ -53,7 +53,7 @@ interface ActionGroupItemStyleProps {
5353
isJustified?: boolean
5454
}
5555

56-
export interface ActionButtonProps extends Omit<ButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'isPending' | 'onClick'>, StyleProps, ActionButtonStyleProps {
56+
export interface ActionButtonProps extends Omit<ButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'isPending' | 'onClick' | keyof GlobalDOMAttributes>, StyleProps, ActionButtonStyleProps {
5757
/** The content to display in the ActionButton. */
5858
children: ReactNode
5959
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from 'react-aria-components';
2828
import {baseColor, focusRing, size, style} from '../style' with { type: 'macro' };
2929
import ChevronIcon from '../ui-icons/Chevron';
30-
import {Collection, DOMRef, DOMRefValue, LinkDOMProps, Node} from '@react-types/shared';
30+
import {Collection, DOMRef, DOMRefValue, GlobalDOMAttributes, LinkDOMProps, Node} from '@react-types/shared';
3131
import {controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
3232
import {createContext, forwardRef, Fragment, ReactNode, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';
3333
import FolderIcon from '../s2wf-icons/S2_Icon_FolderBreadcrumb_20_N.svg';
@@ -62,7 +62,7 @@ interface BreadcrumbsStyleProps {
6262
// TODO: showRoot?: boolean,
6363
}
6464

65-
export interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'children' | 'items' | 'style' | 'className'>, BreadcrumbsStyleProps, StyleProps {
65+
export interface BreadcrumbsProps<T> extends Omit<AriaBreadcrumbsProps<T>, 'children' | 'items' | 'style' | 'className' | keyof GlobalDOMAttributes>, BreadcrumbsStyleProps, StyleProps {
6666
/** The children of the Breadcrumbs. */
6767
children: ReactNode
6868
}
@@ -291,7 +291,7 @@ const heading = style({
291291
fontWeight: 'extra-bold'
292292
});
293293

294-
export interface BreadcrumbProps extends Omit<AriaBreadcrumbItemProps, 'children' | 'style' | 'className' | 'autoFocus' | 'onClick'>, LinkDOMProps {
294+
export interface BreadcrumbProps extends Omit<AriaBreadcrumbItemProps, 'children' | 'style' | 'className' | 'autoFocus' | 'onClick' | keyof GlobalDOMAttributes>, LinkDOMProps {
295295
/** The children of the breadcrumb item. */
296296
children: ReactNode
297297
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateCon
1515
import {centerBaseline} from './CenterBaseline';
1616
import {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'};
1717
import {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react';
18-
import {FocusableRef, FocusableRefValue} from '@react-types/shared';
18+
import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared';
1919
import {IconContext} from './Icon';
2020
// @ts-ignore
2121
import intlMessages from '../intl/*.json';
@@ -51,12 +51,12 @@ interface ButtonStyleProps {
5151
staticColor?: 'white' | 'black' | 'auto'
5252
}
5353

54-
export interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'onClick'>, StyleProps, ButtonStyleProps {
54+
export interface ButtonProps extends Omit<RACButtonProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | 'onClick' | keyof GlobalDOMAttributes>, StyleProps, ButtonStyleProps {
5555
/** The content to display in the Button. */
5656
children: ReactNode
5757
}
5858

59-
export interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children' | 'onClick'>, StyleProps, ButtonStyleProps {
59+
export interface LinkButtonProps extends Omit<LinkProps, 'className' | 'style' | 'children' | 'onClick' | keyof GlobalDOMAttributes>, StyleProps, ButtonStyleProps {
6060
/** The content to display in the Button. */
6161
children: ReactNode
6262
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {composeRenderProps, ContextValue, DEFAULT_SLOT, type GridListItem, GridL
1919
import {ContentContext, FooterContext, TextContext} from './Content';
2020
import {createContext, CSSProperties, forwardRef, ReactNode, useContext} from 'react';
2121
import {DividerContext} from './Divider';
22-
import {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared';
22+
import {DOMProps, DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared';
2323
import {filterDOMProps, inertValue} from '@react-aria/utils';
2424
import {getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'};
2525
import {IllustrationContext} from './Icon';
@@ -36,7 +36,7 @@ interface CardRenderProps {
3636
size: 'XS' | 'S' | 'M' | 'L' | 'XL'
3737
}
3838

39-
export interface CardProps extends Omit<GridListItemProps, 'className' | 'style' | 'children' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'>, StyleProps {
39+
export interface CardProps extends Omit<GridListItemProps, 'className' | 'style' | 'children' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd' | keyof GlobalDOMAttributes>, StyleProps {
4040
/** The children of the Card. */
4141
children: ReactNode | ((renderProps: CardRenderProps) => ReactNode),
4242
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
} from 'react-aria-components';
2525
import {CardContext, InternalCardViewContext} from './Card';
2626
import {createContext, forwardRef, ReactElement, useMemo, useRef, useState} from 'react';
27-
import {DOMRef, DOMRefValue, forwardRefType, Key, LoadingState} from '@react-types/shared';
27+
import {DOMRef, DOMRefValue, forwardRefType, GlobalDOMAttributes, Key, LoadingState} from '@react-types/shared';
2828
import {focusRing, style} from '../style' with {type: 'macro'};
2929
import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};
3030
import {ImageCoordinator} from './ImageCoordinator';
@@ -33,7 +33,7 @@ import {useDOMRef} from '@react-spectrum/utils';
3333
import {useEffectEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils';
3434
import {useSpectrumContextProps} from './useSpectrumContextProps';
3535

36-
export interface CardViewProps<T> extends Omit<GridListProps<T>, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style' | 'isLoading'>, UnsafeStyles {
36+
export interface CardViewProps<T> extends Omit<GridListProps<T>, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style' | 'isLoading' | keyof GlobalDOMAttributes>, UnsafeStyles {
3737
/**
3838
* The layout of the cards.
3939
* @default 'grid'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import CheckmarkIcon from '../ui-icons/Checkmark';
1717
import {controlBorderRadius, controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
1818
import {createContext, forwardRef, ReactNode, useContext, useRef} from 'react';
1919
import DashIcon from '../ui-icons/Dash';
20-
import {FocusableRef, FocusableRefValue} from '@react-types/shared';
20+
import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared';
2121
import {FormContext, useFormProps} from './Form';
2222
import {pressScale} from './pressScale';
2323
import {useFocusableRef} from '@react-spectrum/utils';
@@ -36,7 +36,7 @@ interface CheckboxStyleProps {
3636

3737
interface RenderProps extends CheckboxRenderProps, CheckboxStyleProps {}
3838

39-
export interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange'>, StyleProps, CheckboxStyleProps {
39+
export interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'onHover' | 'onHoverStart' | 'onHoverEnd' | 'onHoverChange' | keyof GlobalDOMAttributes>, StyleProps, CheckboxStyleProps {
4040
/** The label for the element. */
4141
children?: ReactNode
4242
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import {
1717
} from 'react-aria-components';
1818
import {CheckboxContext} from './Checkbox';
1919
import {createContext, forwardRef, ReactNode, useContext} from 'react';
20-
import {DOMRef, DOMRefValue, HelpTextProps, Orientation, SpectrumLabelableProps} from '@react-types/shared';
20+
import {DOMRef, DOMRefValue, GlobalDOMAttributes, HelpTextProps, Orientation, SpectrumLabelableProps} from '@react-types/shared';
2121
import {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
2222
import {FieldLabel, HelpText} from './Field';
2323
import {FormContext, useFormProps} from './Form';
2424
import {style} from '../style' with {type: 'macro'};
2525
import {useDOMRef} from '@react-spectrum/utils';
2626
import {useSpectrumContextProps} from './useSpectrumContextProps';
2727

28-
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'className' | 'style' | 'children'>, StyleProps, SpectrumLabelableProps, HelpTextProps {
28+
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'className' | 'style' | 'children' | keyof GlobalDOMAttributes>, StyleProps, SpectrumLabelableProps, HelpTextProps {
2929
/**
3030
* The size of the Checkboxes in the CheckboxGroup.
3131
*

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
} from 'react';
4141
import {DividerContext} from './Divider';
4242
import {forwardRefType} from './types';
43+
import {GlobalDOMAttributes} from '@react-types/shared';
4344
import {ImageContext} from './Image';
4445
import {ImageCoordinator} from './ImageCoordinator';
4546
import {keyframes, raw} from '../style/style-macro' with {type: 'macro'};
@@ -51,7 +52,7 @@ import {useId, useObjectRef, useOverlayTrigger} from 'react-aria';
5152
import {useLayoutEffect} from '@react-aria/utils';
5253
import {useMenuTriggerState} from 'react-stately';
5354

54-
export interface CoachMarkProps extends Omit<PopoverProps, 'children' | 'arrowBoundaryOffset' | 'isKeyboardDismissDisabled' | 'isNonModal'>, StyleProps {
55+
export interface CoachMarkProps extends Omit<PopoverProps, 'children' | 'arrowBoundaryOffset' | 'isKeyboardDismissDisabled' | 'isNonModal' | keyof GlobalDOMAttributes>, StyleProps {
5556
/** The children of the coach mark. */
5657
children: ReactNode,
5758

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ import {
1717
} from 'react-aria-components';
1818
import {ColorHandle} from './ColorHandle';
1919
import {createContext, forwardRef} from 'react';
20-
import {DOMRef, DOMRefValue} from '@react-types/shared';
20+
import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared';
2121
import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};
2222
import {style} from '../style' with {type: 'macro'};
2323
import {useDOMRef} from '@react-spectrum/utils';
2424
import {useSpectrumContextProps} from './useSpectrumContextProps';
2525

26-
export interface ColorAreaProps extends Omit<AriaColorAreaProps, 'children' | 'className' | 'style'>, StyleProps {}
26+
export interface ColorAreaProps extends Omit<AriaColorAreaProps, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>, StyleProps {}
2727

2828
export const ColorAreaContext = createContext<ContextValue<Partial<ColorAreaProps>, DOMRefValue<HTMLDivElement>>>(null);
2929

0 commit comments

Comments
 (0)