diff --git a/packages/@react-spectrum/s2/src/Accordion.tsx b/packages/@react-spectrum/s2/src/Accordion.tsx index 2145077a512..07f2763055b 100644 --- a/packages/@react-spectrum/s2/src/Accordion.tsx +++ b/packages/@react-spectrum/s2/src/Accordion.tsx @@ -12,14 +12,14 @@ import {ContextValue, DisclosureGroup, DisclosureGroupProps, SlotProps} from 'react-aria-components'; import {DisclosureContext} from './Disclosure'; -import {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMProps, DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with { type: 'macro' }; import React, {createContext, forwardRef} from 'react'; import {style} from '../style' with { type: 'macro' }; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface AccordionProps extends Omit, UnsafeStyles, DOMProps, SlotProps { +export interface AccordionProps extends Omit, UnsafeStyles, DOMProps, SlotProps { /** The disclosure elements in the accordion. */ children: React.ReactNode, /** Spectrum-defined styles, returned by the `style()` macro. */ diff --git a/packages/@react-spectrum/s2/src/ActionButton.tsx b/packages/@react-spectrum/s2/src/ActionButton.tsx index ee1e9c2c008..b1152dd634b 100644 --- a/packages/@react-spectrum/s2/src/ActionButton.tsx +++ b/packages/@react-spectrum/s2/src/ActionButton.tsx @@ -17,7 +17,7 @@ import {ButtonProps, ButtonRenderProps, ContextValue, OverlayTriggerStateContext import {centerBaseline} from './CenterBaseline'; import {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with { type: 'macro' }; import {createContext, forwardRef, ReactNode, useContext} from 'react'; -import {FocusableRef, FocusableRefValue} from '@react-types/shared'; +import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {IconContext} from './Icon'; import {NotificationBadgeContext} from './NotificationBadge'; import {pressScale} from './pressScale'; @@ -53,7 +53,7 @@ interface ActionGroupItemStyleProps { isJustified?: boolean } -export interface ActionButtonProps extends Omit, StyleProps, ActionButtonStyleProps { +export interface ActionButtonProps extends Omit, StyleProps, ActionButtonStyleProps { /** The content to display in the ActionButton. */ children: ReactNode } diff --git a/packages/@react-spectrum/s2/src/Breadcrumbs.tsx b/packages/@react-spectrum/s2/src/Breadcrumbs.tsx index 71527967aa6..a8369b9e757 100644 --- a/packages/@react-spectrum/s2/src/Breadcrumbs.tsx +++ b/packages/@react-spectrum/s2/src/Breadcrumbs.tsx @@ -27,7 +27,7 @@ import { } from 'react-aria-components'; import {baseColor, focusRing, size, style} from '../style' with { type: 'macro' }; import ChevronIcon from '../ui-icons/Chevron'; -import {Collection, DOMRef, DOMRefValue, LinkDOMProps, Node} from '@react-types/shared'; +import {Collection, DOMRef, DOMRefValue, GlobalDOMAttributes, LinkDOMProps, Node} from '@react-types/shared'; import {controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {createContext, forwardRef, Fragment, ReactNode, RefObject, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react'; import FolderIcon from '../s2wf-icons/S2_Icon_FolderBreadcrumb_20_N.svg'; @@ -62,7 +62,7 @@ interface BreadcrumbsStyleProps { // TODO: showRoot?: boolean, } -export interface BreadcrumbsProps extends Omit, 'children' | 'items' | 'style' | 'className'>, BreadcrumbsStyleProps, StyleProps { +export interface BreadcrumbsProps extends Omit, 'children' | 'items' | 'style' | 'className' | keyof GlobalDOMAttributes>, BreadcrumbsStyleProps, StyleProps { /** The children of the Breadcrumbs. */ children: ReactNode } @@ -291,7 +291,7 @@ const heading = style({ fontWeight: 'extra-bold' }); -export interface BreadcrumbProps extends Omit, LinkDOMProps { +export interface BreadcrumbProps extends Omit, LinkDOMProps { /** The children of the breadcrumb item. */ children: ReactNode } diff --git a/packages/@react-spectrum/s2/src/Button.tsx b/packages/@react-spectrum/s2/src/Button.tsx index fd4d42728e6..3c2afe3bb7a 100644 --- a/packages/@react-spectrum/s2/src/Button.tsx +++ b/packages/@react-spectrum/s2/src/Button.tsx @@ -15,7 +15,7 @@ import {ButtonRenderProps, ContextValue, Link, LinkProps, OverlayTriggerStateCon import {centerBaseline} from './CenterBaseline'; import {control, getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'}; import {createContext, forwardRef, ReactNode, useContext, useEffect, useState} from 'react'; -import {FocusableRef, FocusableRefValue} from '@react-types/shared'; +import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {IconContext} from './Icon'; // @ts-ignore import intlMessages from '../intl/*.json'; @@ -51,12 +51,12 @@ interface ButtonStyleProps { staticColor?: 'white' | 'black' | 'auto' } -export interface ButtonProps extends Omit, StyleProps, ButtonStyleProps { +export interface ButtonProps extends Omit, StyleProps, ButtonStyleProps { /** The content to display in the Button. */ children: ReactNode } -export interface LinkButtonProps extends Omit, StyleProps, ButtonStyleProps { +export interface LinkButtonProps extends Omit, StyleProps, ButtonStyleProps { /** The content to display in the Button. */ children: ReactNode } diff --git a/packages/@react-spectrum/s2/src/Card.tsx b/packages/@react-spectrum/s2/src/Card.tsx index b737c1505fc..bc7271451e6 100644 --- a/packages/@react-spectrum/s2/src/Card.tsx +++ b/packages/@react-spectrum/s2/src/Card.tsx @@ -19,7 +19,7 @@ import {composeRenderProps, ContextValue, DEFAULT_SLOT, type GridListItem, GridL import {ContentContext, FooterContext, TextContext} from './Content'; import {createContext, CSSProperties, forwardRef, ReactNode, useContext} from 'react'; import {DividerContext} from './Divider'; -import {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMProps, DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {filterDOMProps, inertValue} from '@react-aria/utils'; import {getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'}; import {IllustrationContext} from './Icon'; @@ -36,7 +36,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), /** diff --git a/packages/@react-spectrum/s2/src/CardView.tsx b/packages/@react-spectrum/s2/src/CardView.tsx index 6af61aea052..3e2c2106c9e 100644 --- a/packages/@react-spectrum/s2/src/CardView.tsx +++ b/packages/@react-spectrum/s2/src/CardView.tsx @@ -24,7 +24,7 @@ import { } from 'react-aria-components'; import {CardContext, InternalCardViewContext} from './Card'; import {createContext, forwardRef, ReactElement, useMemo, useRef, useState} from 'react'; -import {DOMRef, DOMRefValue, forwardRefType, Key, LoadingState} from '@react-types/shared'; +import {DOMRef, DOMRefValue, forwardRefType, GlobalDOMAttributes, Key, LoadingState} from '@react-types/shared'; import {focusRing, style} from '../style' with {type: 'macro'}; import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'}; import {ImageCoordinator} from './ImageCoordinator'; @@ -33,7 +33,7 @@ import {useDOMRef} from '@react-spectrum/utils'; import {useEffectEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface CardViewProps extends Omit, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style' | 'isLoading'>, UnsafeStyles { +export interface CardViewProps extends Omit, 'layout' | 'keyboardNavigationBehavior' | 'selectionBehavior' | 'className' | 'style' | 'isLoading' | keyof GlobalDOMAttributes>, UnsafeStyles { /** * The layout of the cards. * @default 'grid' diff --git a/packages/@react-spectrum/s2/src/Checkbox.tsx b/packages/@react-spectrum/s2/src/Checkbox.tsx index 2a0540b6f17..2e7fbb9f286 100644 --- a/packages/@react-spectrum/s2/src/Checkbox.tsx +++ b/packages/@react-spectrum/s2/src/Checkbox.tsx @@ -17,7 +17,7 @@ import CheckmarkIcon from '../ui-icons/Checkmark'; import {controlBorderRadius, controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {createContext, forwardRef, ReactNode, useContext, useRef} from 'react'; import DashIcon from '../ui-icons/Dash'; -import {FocusableRef, FocusableRefValue} from '@react-types/shared'; +import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {FormContext, useFormProps} from './Form'; import {pressScale} from './pressScale'; import {useFocusableRef} from '@react-spectrum/utils'; @@ -36,7 +36,7 @@ interface CheckboxStyleProps { interface RenderProps extends CheckboxRenderProps, CheckboxStyleProps {} -export interface CheckboxProps extends Omit, StyleProps, CheckboxStyleProps { +export interface CheckboxProps extends Omit, StyleProps, CheckboxStyleProps { /** The label for the element. */ children?: ReactNode } diff --git a/packages/@react-spectrum/s2/src/CheckboxGroup.tsx b/packages/@react-spectrum/s2/src/CheckboxGroup.tsx index 8ccf4f5e777..470db185e2b 100644 --- a/packages/@react-spectrum/s2/src/CheckboxGroup.tsx +++ b/packages/@react-spectrum/s2/src/CheckboxGroup.tsx @@ -17,7 +17,7 @@ import { } from 'react-aria-components'; import {CheckboxContext} from './Checkbox'; import {createContext, forwardRef, ReactNode, useContext} from 'react'; -import {DOMRef, DOMRefValue, HelpTextProps, Orientation, SpectrumLabelableProps} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes, HelpTextProps, Orientation, SpectrumLabelableProps} from '@react-types/shared'; import {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {FieldLabel, HelpText} from './Field'; import {FormContext, useFormProps} from './Form'; @@ -25,7 +25,7 @@ import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface CheckboxGroupProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { +export interface CheckboxGroupProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { /** * The size of the Checkboxes in the CheckboxGroup. * diff --git a/packages/@react-spectrum/s2/src/CoachMark.tsx b/packages/@react-spectrum/s2/src/CoachMark.tsx index 508a73de8a2..3eeaf8d9543 100644 --- a/packages/@react-spectrum/s2/src/CoachMark.tsx +++ b/packages/@react-spectrum/s2/src/CoachMark.tsx @@ -40,6 +40,7 @@ import { } from 'react'; import {DividerContext} from './Divider'; import {forwardRefType} from './types'; +import {GlobalDOMAttributes} from '@react-types/shared'; import {ImageContext} from './Image'; import {ImageCoordinator} from './ImageCoordinator'; import {keyframes, raw} from '../style/style-macro' with {type: 'macro'}; @@ -51,7 +52,7 @@ import {useId, useObjectRef, useOverlayTrigger} from 'react-aria'; import {useLayoutEffect} from '@react-aria/utils'; import {useMenuTriggerState} from 'react-stately'; -export interface CoachMarkProps extends Omit, StyleProps { +export interface CoachMarkProps extends Omit, StyleProps { /** The children of the coach mark. */ children: ReactNode, diff --git a/packages/@react-spectrum/s2/src/ColorArea.tsx b/packages/@react-spectrum/s2/src/ColorArea.tsx index f66df9f008f..12548bef8ea 100644 --- a/packages/@react-spectrum/s2/src/ColorArea.tsx +++ b/packages/@react-spectrum/s2/src/ColorArea.tsx @@ -17,13 +17,13 @@ import { } from 'react-aria-components'; import {ColorHandle} from './ColorHandle'; import {createContext, forwardRef} from 'react'; -import {DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface ColorAreaProps extends Omit, StyleProps {} +export interface ColorAreaProps extends Omit, StyleProps {} export const ColorAreaContext = createContext, DOMRefValue>>(null); diff --git a/packages/@react-spectrum/s2/src/ColorField.tsx b/packages/@react-spectrum/s2/src/ColorField.tsx index bb7ed37b0d0..9ac1b4fe4fc 100644 --- a/packages/@react-spectrum/s2/src/ColorField.tsx +++ b/packages/@react-spectrum/s2/src/ColorField.tsx @@ -20,12 +20,12 @@ import {createFocusableRef} from '@react-spectrum/utils'; import {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field'; import {FormContext, useFormProps} from './Form'; -import {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; +import {GlobalDOMAttributes, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; import {style} from '../style' with {type: 'macro'}; import {TextFieldRef} from '@react-types/textfield'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface ColorFieldProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { +export interface ColorFieldProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { /** * The size of the color field. * diff --git a/packages/@react-spectrum/s2/src/ColorSlider.tsx b/packages/@react-spectrum/s2/src/ColorSlider.tsx index 8e373009287..5fb7994722e 100644 --- a/packages/@react-spectrum/s2/src/ColorSlider.tsx +++ b/packages/@react-spectrum/s2/src/ColorSlider.tsx @@ -21,13 +21,13 @@ import { import {ColorHandle} from './ColorHandle'; import {controlFont, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {createContext, forwardRef, useRef} from 'react'; -import {DOMRef, DOMRefValue, SpectrumLabelableProps} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes, SpectrumLabelableProps} from '@react-types/shared'; import {FieldLabel} from './Field'; import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface ColorSliderProps extends Omit, Pick, StyleProps { +export interface ColorSliderProps extends Omit, Pick, StyleProps { label?: string } diff --git a/packages/@react-spectrum/s2/src/ColorSwatch.tsx b/packages/@react-spectrum/s2/src/ColorSwatch.tsx index 8ba5bdad466..99a38464f9d 100644 --- a/packages/@react-spectrum/s2/src/ColorSwatch.tsx +++ b/packages/@react-spectrum/s2/src/ColorSwatch.tsx @@ -18,13 +18,13 @@ import { parseColor } from 'react-aria-components'; import {createContext, forwardRef, JSX, ReactElement, useContext, useMemo} from 'react'; -import {DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'}; import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface ColorSwatchProps extends Omit, UnsafeStyles { +export interface ColorSwatchProps extends Omit, UnsafeStyles { /** * The size of the ColorSwatch. * @default 'M' diff --git a/packages/@react-spectrum/s2/src/ColorWheel.tsx b/packages/@react-spectrum/s2/src/ColorWheel.tsx index 7d773bd14e4..43d26419a9b 100644 --- a/packages/@react-spectrum/s2/src/ColorWheel.tsx +++ b/packages/@react-spectrum/s2/src/ColorWheel.tsx @@ -18,13 +18,13 @@ import { } from 'react-aria-components'; import {ColorHandle} from './ColorHandle'; import {createContext, forwardRef} from 'react'; -import {DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {style} from '../style' with {type: 'macro'}; import {StyleProps} from './style-utils'; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface ColorWheelProps extends Omit, StyleProps { +export interface ColorWheelProps extends Omit, StyleProps { /** * @default 192 */ diff --git a/packages/@react-spectrum/s2/src/ComboBox.tsx b/packages/@react-spectrum/s2/src/ComboBox.tsx index 5e0fbc124f5..3944ab79148 100644 --- a/packages/@react-spectrum/s2/src/ComboBox.tsx +++ b/packages/@react-spectrum/s2/src/ComboBox.tsx @@ -32,7 +32,7 @@ import { UNSTABLE_ListBoxLoadingSentinel, Virtualizer } from 'react-aria-components'; -import {AsyncLoadable, HelpTextProps, LoadingState, SpectrumLabelableProps} from '@react-types/shared'; +import {AsyncLoadable, GlobalDOMAttributes, HelpTextProps, LoadingState, SpectrumLabelableProps} from '@react-types/shared'; import {baseColor, edgeToText, focusRing, space, style} from '../style' with {type: 'macro'}; import {centerBaseline} from './CenterBaseline'; import {centerPadding, control, controlBorderRadius, controlFont, controlSize, field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; @@ -76,7 +76,7 @@ export interface ComboboxStyleProps { size?: 'S' | 'M' | 'L' | 'XL' } export interface ComboBoxProps extends - Omit, 'children' | 'style' | 'className' | 'defaultFilter' | 'allowsEmptyCollection'>, + Omit, 'children' | 'style' | 'className' | 'defaultFilter' | 'allowsEmptyCollection' | keyof GlobalDOMAttributes>, ComboboxStyleProps, StyleProps, SpectrumLabelableProps, @@ -359,7 +359,7 @@ export const ComboBox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Co ); }); -export interface ComboBoxItemProps extends Omit, StyleProps { +export interface ComboBoxItemProps extends Omit, StyleProps { children: ReactNode } @@ -409,7 +409,7 @@ export function ComboBoxItem(props: ComboBoxItemProps): ReactNode { ); } -export interface ComboBoxSectionProps extends SectionProps {} +export interface ComboBoxSectionProps extends Omit, keyof GlobalDOMAttributes> {} export function ComboBoxSection(props: ComboBoxSectionProps): ReactNode { let {size} = useContext(InternalComboboxContext); return ( diff --git a/packages/@react-spectrum/s2/src/CustomDialog.tsx b/packages/@react-spectrum/s2/src/CustomDialog.tsx index ea9e03ed417..5fe181908e0 100644 --- a/packages/@react-spectrum/s2/src/CustomDialog.tsx +++ b/packages/@react-spectrum/s2/src/CustomDialog.tsx @@ -11,14 +11,14 @@ */ import {composeRenderProps, OverlayTriggerStateContext, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components'; -import {DOMRef} from '@react-types/shared'; +import {DOMRef, GlobalDOMAttributes} from '@react-types/shared'; import {forwardRef} from 'react'; import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {Modal} from './Modal'; import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; -export interface CustomDialogProps extends Omit, StyleProps { +export interface CustomDialogProps extends Omit, StyleProps { /** * The size of the Dialog. */ diff --git a/packages/@react-spectrum/s2/src/Dialog.tsx b/packages/@react-spectrum/s2/src/Dialog.tsx index 9cbbc841d6c..a158d4574bd 100644 --- a/packages/@react-spectrum/s2/src/Dialog.tsx +++ b/packages/@react-spectrum/s2/src/Dialog.tsx @@ -14,7 +14,7 @@ import {ButtonGroupContext} from './ButtonGroup'; import {CloseButton} from './CloseButton'; import {composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components'; import {ContentContext, FooterContext, HeaderContext, HeadingContext} from './Content'; -import {DOMRef} from '@react-types/shared'; +import {DOMRef, GlobalDOMAttributes} from '@react-types/shared'; import {forwardRef} from 'react'; import {ImageContext} from './Image'; import {Modal} from './Modal'; @@ -23,7 +23,7 @@ import {StyleProps} from './style-utils'; import {useDOMRef} from '@react-spectrum/utils'; // TODO: what style overrides should be allowed? -export interface DialogProps extends Omit, StyleProps { +export interface DialogProps extends Omit, StyleProps { /** * Whether the Dialog is dismissible. */ diff --git a/packages/@react-spectrum/s2/src/Disclosure.tsx b/packages/@react-spectrum/s2/src/Disclosure.tsx index bddb06cc2fb..65e72b3254b 100644 --- a/packages/@react-spectrum/s2/src/Disclosure.tsx +++ b/packages/@react-spectrum/s2/src/Disclosure.tsx @@ -11,7 +11,7 @@ */ import {ActionButtonContext} from './ActionButton'; -import {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType} from '@react-types/shared'; +import {AriaLabelingProps, DOMProps, DOMRef, DOMRefValue, forwardRefType, GlobalDOMAttributes} from '@react-types/shared'; import {baseColor, focusRing, lightDark, space, style} from '../style' with { type: 'macro' }; import {Button, ContextValue, DisclosureStateContext, Heading, Provider, Disclosure as RACDisclosure, DisclosurePanel as RACDisclosurePanel, DisclosurePanelProps as RACDisclosurePanelProps, DisclosureProps as RACDisclosureProps, useLocale, useSlottedContext} from 'react-aria-components'; import {CenterBaseline} from './CenterBaseline'; @@ -22,7 +22,7 @@ import React, {createContext, forwardRef, ReactNode, useContext} from 'react'; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface DisclosureProps extends Omit, StyleProps { +export interface DisclosureProps extends Omit, StyleProps { /** * The size of the disclosure. * @default 'M' diff --git a/packages/@react-spectrum/s2/src/Divider.tsx b/packages/@react-spectrum/s2/src/Divider.tsx index 09a3cd8a90d..d41e3a0580e 100644 --- a/packages/@react-spectrum/s2/src/Divider.tsx +++ b/packages/@react-spectrum/s2/src/Divider.tsx @@ -12,7 +12,7 @@ import {ContextValue, Separator as RACSeparator, SeparatorProps as RACSeparatorProps} from 'react-aria-components'; import {createContext, forwardRef} from 'react'; -import {DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'}; import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; @@ -38,7 +38,7 @@ interface DividerSpectrumProps { } // TODO: allow overriding height (only when orientation is vertical)?? -export interface DividerProps extends DividerSpectrumProps, Omit, StyleProps {} +export interface DividerProps extends DividerSpectrumProps, Omit, StyleProps {} export const DividerContext = createContext, DOMRefValue>>(null); diff --git a/packages/@react-spectrum/s2/src/DropZone.tsx b/packages/@react-spectrum/s2/src/DropZone.tsx index 63e0149136a..3e755938ede 100644 --- a/packages/@react-spectrum/s2/src/DropZone.tsx +++ b/packages/@react-spectrum/s2/src/DropZone.tsx @@ -12,7 +12,7 @@ import {ContextValue, DropZoneRenderProps, DropZone as RACDropZone, DropZoneProps as RACDropZoneProps} from 'react-aria-components'; import {createContext, forwardRef, ReactNode} from 'react'; -import {DOMProps, DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMProps, DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'}; import {IllustratedMessageContext} from './IllustratedMessage'; // @ts-ignore @@ -22,7 +22,7 @@ import {useDOMRef} from '@react-spectrum/utils'; import {useLocalizedStringFormatter} from '@react-aria/i18n'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface DropZoneProps extends Omit, UnsafeStyles, DOMProps { +export interface DropZoneProps extends Omit, UnsafeStyles, DOMProps { /** Spectrum-defined styles, returned by the `style()` macro. */ styles?: StylesPropWithHeight, /** The content to display in the drop zone. */ diff --git a/packages/@react-spectrum/s2/src/Form.tsx b/packages/@react-spectrum/s2/src/Form.tsx index 0e65b03f6e7..e426f3f59ab 100644 --- a/packages/@react-spectrum/s2/src/Form.tsx +++ b/packages/@react-spectrum/s2/src/Form.tsx @@ -11,7 +11,7 @@ */ import {createContext, forwardRef, ReactNode, useContext, useMemo} from 'react'; -import {DOMRef, SpectrumLabelableProps} from '@react-types/shared'; +import {DOMRef, GlobalDOMAttributes, SpectrumLabelableProps} from '@react-types/shared'; import {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {Form as RACForm, FormProps as RACFormProps} from 'react-aria-components'; import {style} from '../style' with {type: 'macro'}; @@ -30,7 +30,7 @@ interface FormStyleProps extends Omit, StyleProps { +export interface FormProps extends FormStyleProps, Omit, StyleProps { children: ReactNode } diff --git a/packages/@react-spectrum/s2/src/FullscreenDialog.tsx b/packages/@react-spectrum/s2/src/FullscreenDialog.tsx index d46c31210a5..bc54c8cc0a4 100644 --- a/packages/@react-spectrum/s2/src/FullscreenDialog.tsx +++ b/packages/@react-spectrum/s2/src/FullscreenDialog.tsx @@ -13,7 +13,7 @@ import {ButtonGroupContext} from './ButtonGroup'; import {composeRenderProps, OverlayTriggerStateContext, Provider, Dialog as RACDialog, DialogProps as RACDialogProps} from 'react-aria-components'; import {ContentContext, HeaderContext, HeadingContext} from './Content'; -import {DOMRef} from '@react-types/shared'; +import {DOMRef, GlobalDOMAttributes} from '@react-types/shared'; import {forwardRef} from 'react'; import {Modal} from './Modal'; import {style} from '../style' with {type: 'macro'}; @@ -21,7 +21,7 @@ import {StyleProps} from './style-utils'; import {useDOMRef} from '@react-spectrum/utils'; // TODO: what style overrides should be allowed? -export interface FullscreenDialogProps extends Omit, StyleProps { +export interface FullscreenDialogProps extends Omit, StyleProps { /** * The variant of fullscreen dialog to display. * @default "fullscreen" diff --git a/packages/@react-spectrum/s2/src/Link.tsx b/packages/@react-spectrum/s2/src/Link.tsx index c218555ed57..f3f73977ada 100644 --- a/packages/@react-spectrum/s2/src/Link.tsx +++ b/packages/@react-spectrum/s2/src/Link.tsx @@ -13,7 +13,7 @@ import {baseColor, focusRing, style} from '../style' with {type: 'macro'}; import {ContextValue, LinkRenderProps, Link as RACLink, LinkProps as RACLinkProps} from 'react-aria-components'; import {createContext, forwardRef, ReactNode, useContext} from 'react'; -import {FocusableRef, FocusableRefValue} from '@react-types/shared'; +import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {getAllowedOverrides, staticColor, StyleProps} from './style-utils' with {type: 'macro'}; import {SkeletonContext, useSkeletonText} from './Skeleton'; import {useFocusableRef} from '@react-spectrum/utils'; @@ -34,7 +34,7 @@ interface LinkStyleProps { isQuiet?: boolean } -export interface LinkProps extends Omit, StyleProps, LinkStyleProps { +export interface LinkProps extends Omit, StyleProps, LinkStyleProps { children: ReactNode } diff --git a/packages/@react-spectrum/s2/src/Menu.tsx b/packages/@react-spectrum/s2/src/Menu.tsx index 96ec244a658..99cef9529c5 100644 --- a/packages/@react-spectrum/s2/src/Menu.tsx +++ b/packages/@react-spectrum/s2/src/Menu.tsx @@ -36,7 +36,7 @@ import CheckmarkIcon from '../ui-icons/Checkmark'; import ChevronRightIcon from '../ui-icons/Chevron'; import {createContext, forwardRef, JSX, ReactNode, useContext, useRef, useState} from 'react'; import {divider} from './Divider'; -import {DOMRef, DOMRefValue, PressEvent} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes, PressEvent} from '@react-types/shared'; import {forwardRefType} from './types'; import {HeaderContext, HeadingContext, KeyboardContext, Text, TextContext} from './Content'; import {IconContext} from './Icon'; // chevron right removed?? @@ -73,7 +73,7 @@ export interface MenuTriggerProps extends AriaMenuTriggerProps { shouldFlip?: boolean } -export interface MenuProps extends Omit, 'children' | 'style' | 'className' | 'dependencies' | 'renderEmptyState'>, StyleProps { +export interface MenuProps extends Omit, 'children' | 'style' | 'className' | 'dependencies' | 'renderEmptyState' | keyof GlobalDOMAttributes>, StyleProps { /** * The size of the Menu. * @@ -427,7 +427,7 @@ export function Divider(props: SeparatorProps): ReactNode { ); } -export interface MenuSectionProps extends AriaMenuSectionProps {} +export interface MenuSectionProps extends Omit, keyof GlobalDOMAttributes> {} export function MenuSection(props: MenuSectionProps): ReactNode { // remember, context doesn't work if it's around Section nor inside let {size} = useContext(InternalMenuContext); @@ -443,7 +443,7 @@ export function MenuSection(props: MenuSectionProps): React ); } -export interface MenuItemProps extends Omit, StyleProps { +export interface MenuItemProps extends Omit, StyleProps { /** * The contents of the item. */ diff --git a/packages/@react-spectrum/s2/src/Meter.tsx b/packages/@react-spectrum/s2/src/Meter.tsx index 0f791c80bb0..0c95b7e5b64 100644 --- a/packages/@react-spectrum/s2/src/Meter.tsx +++ b/packages/@react-spectrum/s2/src/Meter.tsx @@ -17,7 +17,7 @@ import { } from 'react-aria-components'; import {bar, track} from './bar-utils' with {type: 'macro'}; import {createContext, forwardRef, ReactNode} from 'react'; -import {DOMRef, DOMRefValue, LabelPosition} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes, LabelPosition} from '@react-types/shared'; import {FieldLabel} from './Field'; import {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {lightDark, style} from '../style' with {type: 'macro'}; @@ -48,7 +48,7 @@ interface MeterStyleProps { labelPosition?: LabelPosition } -export interface MeterProps extends Omit, MeterStyleProps, StyleProps { +export interface MeterProps extends Omit, MeterStyleProps, StyleProps { /** The content to display as the label. */ label?: ReactNode } diff --git a/packages/@react-spectrum/s2/src/NumberField.tsx b/packages/@react-spectrum/s2/src/NumberField.tsx index 132e03728a9..2cef55f2e80 100644 --- a/packages/@react-spectrum/s2/src/NumberField.tsx +++ b/packages/@react-spectrum/s2/src/NumberField.tsx @@ -29,7 +29,7 @@ import Dash from '../ui-icons/Dash'; import {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field'; import {filterDOMProps, mergeProps, mergeRefs} from '@react-aria/utils'; import {FormContext} from './Form'; -import {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; +import {GlobalDOMAttributes, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; import {pressScale} from './pressScale'; import {TextFieldRef} from '@react-types/textfield'; import {useButton, useFocusRing, useHover} from 'react-aria'; @@ -37,7 +37,7 @@ import {useSpectrumContextProps} from './useSpectrumContextProps'; export interface NumberFieldProps extends - Omit, + Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { diff --git a/packages/@react-spectrum/s2/src/Picker.tsx b/packages/@react-spectrum/s2/src/Picker.tsx index edc7b55383e..db430eb735c 100644 --- a/packages/@react-spectrum/s2/src/Picker.tsx +++ b/packages/@react-spectrum/s2/src/Picker.tsx @@ -31,7 +31,7 @@ import { UNSTABLE_ListBoxLoadingSentinel, Virtualizer } from 'react-aria-components'; -import {AsyncLoadable, FocusableRef, FocusableRefValue, HelpTextProps, LoadingState, PressEvent, RefObject, SpectrumLabelableProps} from '@react-types/shared'; +import {AsyncLoadable, FocusableRef, FocusableRefValue, GlobalDOMAttributes, HelpTextProps, LoadingState, PressEvent, RefObject, SpectrumLabelableProps} from '@react-types/shared'; import {baseColor, edgeToText, focusRing, style} from '../style' with {type: 'macro'}; import {centerBaseline} from './CenterBaseline'; import { @@ -91,7 +91,7 @@ export interface PickerStyleProps { } export interface PickerProps extends - Omit, 'children' | 'style' | 'className'>, + Omit, 'children' | 'style' | 'className' | keyof GlobalDOMAttributes>, PickerStyleProps, StyleProps, SpectrumLabelableProps, @@ -552,7 +552,7 @@ const PickerButton = createHideableComponent(function PickerButton, StyleProps { +export interface PickerItemProps extends Omit, StyleProps { children: ReactNode } @@ -610,7 +610,7 @@ function DefaultProvider({context, value, children}: {context: React.Context{children}; } -export interface PickerSectionProps extends SectionProps {} +export interface PickerSectionProps extends Omit, keyof GlobalDOMAttributes> {} export function PickerSection(props: PickerSectionProps): ReactNode { let {size} = useContext(InternalPickerContext); return ( diff --git a/packages/@react-spectrum/s2/src/Popover.tsx b/packages/@react-spectrum/s2/src/Popover.tsx index 5d0c7f4ce20..d090bbf1918 100644 --- a/packages/@react-spectrum/s2/src/Popover.tsx +++ b/packages/@react-spectrum/s2/src/Popover.tsx @@ -22,14 +22,14 @@ import { } from 'react-aria-components'; import {colorScheme, getAllowedOverrides, StyleProps, UnsafeStyles} from './style-utils' with {type: 'macro'}; import {ColorSchemeContext} from './Provider'; -import {DOMRef} from '@react-types/shared'; +import {DOMRef, GlobalDOMAttributes} from '@react-types/shared'; import {forwardRef, MutableRefObject, useCallback, useContext} from 'react'; import {mergeStyles} from '../style/runtime'; import {style} from '../style' with {type: 'macro'}; import {StyleString} from '../style/types' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; -export interface PopoverProps extends UnsafeStyles, Omit { +export interface PopoverProps extends UnsafeStyles, Omit { styles?: StyleString, /** * Whether a popover's arrow should be hidden. @@ -221,7 +221,7 @@ export const PopoverBase = forwardRef(function PopoverBase(props: PopoverProps, ); }); -export interface PopoverDialogProps extends Pick, Omit, StyleProps { +export interface PopoverDialogProps extends Pick, Omit, StyleProps { } diff --git a/packages/@react-spectrum/s2/src/ProgressBar.tsx b/packages/@react-spectrum/s2/src/ProgressBar.tsx index 0b2cf4a2a43..71e98fdb3f8 100644 --- a/packages/@react-spectrum/s2/src/ProgressBar.tsx +++ b/packages/@react-spectrum/s2/src/ProgressBar.tsx @@ -17,7 +17,7 @@ import { } from 'react-aria-components'; import {bar, track} from './bar-utils' with {type: 'macro'}; import {createContext, forwardRef, ReactNode} from 'react'; -import {DOMRef, DOMRefValue, LabelPosition} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes, LabelPosition} from '@react-types/shared'; import {FieldLabel} from './Field'; import {fieldLabel, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {keyframes} from '../style/style-macro' with {type: 'macro'}; @@ -50,7 +50,7 @@ interface ProgressBarStyleProps { } -export interface ProgressBarProps extends Omit, ProgressBarStyleProps, StyleProps { +export interface ProgressBarProps extends Omit, ProgressBarStyleProps, StyleProps { /** The content to display as the label. */ label?: ReactNode } diff --git a/packages/@react-spectrum/s2/src/ProgressCircle.tsx b/packages/@react-spectrum/s2/src/ProgressCircle.tsx index 1287537e13c..90ed77b60a2 100644 --- a/packages/@react-spectrum/s2/src/ProgressCircle.tsx +++ b/packages/@react-spectrum/s2/src/ProgressCircle.tsx @@ -12,7 +12,7 @@ import {ContextValue, ProgressBar as RACProgressBar, ProgressBarProps as RACProgressBarProps} from 'react-aria-components'; import {createContext, forwardRef} from 'react'; -import {DOMRef, DOMRefValue} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {getAllowedOverrides, staticColor, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'}; import {keyframes} from '../style/style-macro' with {type: 'macro'}; import {pxToRem} from './progress-utils' with {type: 'macro'}; @@ -104,7 +104,7 @@ const hcmStroke = style({ } }); -export interface ProgressCircleProps extends Omit, ProgressCircleStyleProps, UnsafeStyles { +export interface ProgressCircleProps extends Omit, ProgressCircleStyleProps, UnsafeStyles { /** Spectrum-defined styles, returned by the `style()` macro. */ styles?: StylesPropWithHeight } diff --git a/packages/@react-spectrum/s2/src/Radio.tsx b/packages/@react-spectrum/s2/src/Radio.tsx index 436bd712a77..e239397c958 100644 --- a/packages/@react-spectrum/s2/src/Radio.tsx +++ b/packages/@react-spectrum/s2/src/Radio.tsx @@ -18,13 +18,13 @@ import { import {baseColor, focusRing, space, style} from '../style' with {type: 'macro'}; import {CenterBaseline} from './CenterBaseline'; import {controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; -import {FocusableRef} from '@react-types/shared'; +import {FocusableRef, GlobalDOMAttributes} from '@react-types/shared'; import {FormContext, useFormProps} from './Form'; import {forwardRef, ReactNode, useContext, useRef} from 'react'; import {pressScale} from './pressScale'; import {useFocusableRef} from '@react-spectrum/utils'; -export interface RadioProps extends Omit, StyleProps { +export interface RadioProps extends Omit, StyleProps { /** * The label for the element. */ diff --git a/packages/@react-spectrum/s2/src/RadioGroup.tsx b/packages/@react-spectrum/s2/src/RadioGroup.tsx index a9f503028a7..11ad561c3c1 100644 --- a/packages/@react-spectrum/s2/src/RadioGroup.tsx +++ b/packages/@react-spectrum/s2/src/RadioGroup.tsx @@ -15,7 +15,7 @@ import { RadioGroupProps as AriaRadioGroupProps, ContextValue } from 'react-aria-components'; -import {DOMRef, DOMRefValue, HelpTextProps, Orientation, SpectrumLabelableProps} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes, HelpTextProps, Orientation, SpectrumLabelableProps} from '@react-types/shared'; import {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {FieldLabel, HelpText} from './Field'; import {FormContext, useFormProps} from './Form'; @@ -24,7 +24,7 @@ import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface RadioGroupProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { +export interface RadioGroupProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { /** * The Radios contained within the RadioGroup. */ diff --git a/packages/@react-spectrum/s2/src/SearchField.tsx b/packages/@react-spectrum/s2/src/SearchField.tsx index 494bc6175c7..1aa890b45e2 100644 --- a/packages/@react-spectrum/s2/src/SearchField.tsx +++ b/packages/@react-spectrum/s2/src/SearchField.tsx @@ -24,14 +24,14 @@ import {createFocusableRef} from '@react-spectrum/utils'; import {field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {FieldGroup, FieldLabel, HelpText, Input} from './Field'; import {FormContext, useFormProps} from './Form'; -import {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; +import {GlobalDOMAttributes, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; import {IconContext} from './Icon'; import {raw} from '../style/style-macro' with {type: 'macro'}; import SearchIcon from '../s2wf-icons/S2_Icon_Search_20_N.svg'; import {TextFieldRef} from '@react-types/textfield'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface SearchFieldProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { +export interface SearchFieldProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { /** * The size of the SearchField. * diff --git a/packages/@react-spectrum/s2/src/Skeleton.tsx b/packages/@react-spectrum/s2/src/Skeleton.tsx index de5673602ec..1fb2bdb185b 100644 --- a/packages/@react-spectrum/s2/src/Skeleton.tsx +++ b/packages/@react-spectrum/s2/src/Skeleton.tsx @@ -120,7 +120,7 @@ export function SkeletonWrapper({children}: {children: SkeletonElement}): ReactN return children; } - let childRef = 'ref' in children ? children.ref as any : children.props.ref; + let childRef = 'ref' in children && !Object.getOwnPropertyDescriptor(children, 'ref')?.get ? children.ref as any : children.props.ref; return ( {isLoading ? cloneElement(children, { diff --git a/packages/@react-spectrum/s2/src/Slider.tsx b/packages/@react-spectrum/s2/src/Slider.tsx index b3a9da22b2b..180d34385b3 100644 --- a/packages/@react-spectrum/s2/src/Slider.tsx +++ b/packages/@react-spectrum/s2/src/Slider.tsx @@ -23,7 +23,7 @@ import {clamp} from '@react-aria/utils'; import {controlFont, field, fieldInput, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {createContext, forwardRef, ReactNode, RefObject, useContext, useRef} from 'react'; import {FieldLabel} from './Field'; -import {FocusableRef, FocusableRefValue, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared'; +import {FocusableRef, FocusableRefValue, GlobalDOMAttributes, InputDOMProps, SpectrumLabelableProps} from '@react-types/shared'; import {focusRing, style} from '../style' with {type: 'macro'}; import {FormContext, useFormProps} from './Form'; import {mergeStyles} from '../style/runtime'; @@ -32,7 +32,7 @@ import {useFocusableRef} from '@react-spectrum/utils'; import {useLocale, useNumberFormatter} from '@react-aria/i18n'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface SliderBaseProps extends Omit, 'children' | 'style' | 'className' | 'orientation'>, Omit, StyleProps { +export interface SliderBaseProps extends Omit, 'children' | 'style' | 'className' | 'orientation' | keyof GlobalDOMAttributes>, Omit, StyleProps { children?: ReactNode, /** * The size of the Slider. diff --git a/packages/@react-spectrum/s2/src/Switch.tsx b/packages/@react-spectrum/s2/src/Switch.tsx index 897cc383954..c6b6ef65bd1 100644 --- a/packages/@react-spectrum/s2/src/Switch.tsx +++ b/packages/@react-spectrum/s2/src/Switch.tsx @@ -20,7 +20,7 @@ import {baseColor, focusRing, fontRelative, style} from '../style' with {type: ' import {CenterBaseline} from './CenterBaseline'; import {controlFont, controlSize, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {createContext, forwardRef, ReactNode, useContext, useRef} from 'react'; -import {FocusableRef, FocusableRefValue} from '@react-types/shared'; +import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {FormContext, useFormProps} from './Form'; import {pressScale} from './pressScale'; import {useFocusableRef} from '@react-spectrum/utils'; @@ -41,7 +41,7 @@ interface SwitchStyleProps { interface RenderProps extends SwitchRenderProps, SwitchStyleProps {} -export interface SwitchProps extends Omit, StyleProps, SwitchStyleProps { +export interface SwitchProps extends Omit, StyleProps, SwitchStyleProps { children?: ReactNode } diff --git a/packages/@react-spectrum/s2/src/TableView.tsx b/packages/@react-spectrum/s2/src/TableView.tsx index 4447ca218f5..abad1a7939c 100644 --- a/packages/@react-spectrum/s2/src/TableView.tsx +++ b/packages/@react-spectrum/s2/src/TableView.tsx @@ -48,7 +48,7 @@ import {centerPadding, controlFont, getAllowedOverrides, StylesPropWithHeight, U import {Checkbox} from './Checkbox'; import Chevron from '../ui-icons/Chevron'; import {ColumnSize} from '@react-types/table'; -import {DOMRef, DOMRefValue, forwardRefType, LoadingState, Node} from '@react-types/shared'; +import {DOMRef, DOMRefValue, forwardRefType, GlobalDOMAttributes, LoadingState, Node} from '@react-types/shared'; import {GridNode} from '@react-types/grid'; import {IconContext} from './Icon'; // @ts-ignore @@ -109,7 +109,7 @@ interface S2TableProps { } // TODO: Note that loadMore and loadingState are now on the Table instead of on the TableBody -export interface TableViewProps extends Omit, UnsafeStyles, S2TableProps { +export interface TableViewProps extends Omit, UnsafeStyles, S2TableProps { /** Spectrum-defined styles, returned by the `style()` macro. */ styles?: StylesPropWithHeight } @@ -373,7 +373,7 @@ const centeredWrapper = style({ height: 'full' }); -export interface TableBodyProps extends Omit, 'style' | 'className'> {} +export interface TableBodyProps extends Omit, 'style' | 'className' | keyof GlobalDOMAttributes> {} /** * The body of a ``, containing the table rows. @@ -507,7 +507,7 @@ const columnStyles = style({ forcedColorAdjust: 'none' }); -export interface ColumnProps extends RACColumnProps { +export interface ColumnProps extends Omit { /** Whether the column should render a divider between it and the next column. */ showDivider?: boolean, /** Whether the column allows resizing. */ @@ -863,7 +863,7 @@ const selectAllCheckboxColumn = style({ backgroundColor: 'gray-75' }); -export interface TableHeaderProps extends Omit, 'style' | 'className' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {} +export interface TableHeaderProps extends Omit, 'style' | 'className' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd' | keyof GlobalDOMAttributes> {} /** * A header within a `
`, containing the table columns. @@ -1119,7 +1119,7 @@ const row = style({ forcedColorAdjust: 'none' }); -export interface RowProps extends Pick, 'id' | 'columns' | 'children' | 'textValue' | 'dependencies'> {} +export interface RowProps extends Pick, 'id' | 'columns' | 'children' | 'textValue' | 'dependencies' | keyof GlobalDOMAttributes> {} /** * A row within a `
`. diff --git a/packages/@react-spectrum/s2/src/Tabs.tsx b/packages/@react-spectrum/s2/src/Tabs.tsx index c1e2d2c7ed6..9edc9ee7b77 100644 --- a/packages/@react-spectrum/s2/src/Tabs.tsx +++ b/packages/@react-spectrum/s2/src/Tabs.tsx @@ -27,7 +27,7 @@ import { } from 'react-aria-components'; import {baseColor, focusRing, size, style} from '../style' with {type: 'macro'}; import {centerBaseline} from './CenterBaseline'; -import {Collection, DOMRef, DOMRefValue, Key, Node, Orientation, RefObject} from '@react-types/shared'; +import {Collection, DOMRef, DOMRefValue, GlobalDOMAttributes, Key, Node, Orientation, RefObject} from '@react-types/shared'; import {CollectionBuilder} from '@react-aria/collections'; import {createContext, forwardRef, ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react'; import {getAllowedOverrides, StyleProps, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'}; @@ -41,7 +41,7 @@ import {useHasTabbableChild} from '@react-aria/focus'; import {useLocale} from '@react-aria/i18n'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface TabsProps extends Omit, UnsafeStyles { +export interface TabsProps extends Omit, UnsafeStyles { /** Spectrum-defined styles, returned by the `style()` macro. */ styles?: StylesPropWithHeight, /** The content to display in the tabs. */ @@ -59,17 +59,17 @@ export interface TabsProps extends Omit, StyleProps { +export interface TabProps extends Omit, StyleProps { /** The content to display in the tab. */ children: ReactNode } -export interface TabListProps extends Omit, 'style' | 'className' | 'aria-label' | 'aria-labelledby'>, StyleProps { +export interface TabListProps extends Omit, 'style' | 'className' | 'aria-label' | 'aria-labelledby' | keyof GlobalDOMAttributes>, StyleProps { /** The content to display in the tablist. */ children: ReactNode | ((item: T) => ReactNode) } -export interface TabPanelProps extends Omit, UnsafeStyles { +export interface TabPanelProps extends Omit, UnsafeStyles { /** Spectrum-defined styles, returned by the `style()` macro. */ styles?: StylesPropWithHeight, /** The content to display in the tab panels. */ diff --git a/packages/@react-spectrum/s2/src/TagGroup.tsx b/packages/@react-spectrum/s2/src/TagGroup.tsx index e84b33ad0f7..f5827931fb3 100644 --- a/packages/@react-spectrum/s2/src/TagGroup.tsx +++ b/packages/@react-spectrum/s2/src/TagGroup.tsx @@ -34,7 +34,7 @@ import {ClearButton} from './ClearButton'; import {Collection, CollectionBuilder} from '@react-aria/collections'; import {control, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'}; import {createContext, forwardRef, ReactNode, useContext, useEffect, useMemo, useRef, useState} from 'react'; -import {DOMRef, DOMRefValue, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared'; +import {DOMRef, DOMRefValue, GlobalDOMAttributes, HelpTextProps, Node, SpectrumLabelableProps} from '@react-types/shared'; import {FieldLabel, helpTextStyles} from './Field'; import {flushSync} from 'react-dom'; import {FormContext, useFormProps} from './Form'; @@ -51,12 +51,12 @@ import {useLocalizedStringFormatter} from '@react-aria/i18n'; import {useSpectrumContextProps} from './useSpectrumContextProps'; // Get types from RSP and extend those? -export interface TagProps extends Omit { +export interface TagProps extends Omit { /** The children of the tag. */ children: ReactNode } -export interface TagGroupProps extends Omit, Pick, 'items' | 'children' | 'renderEmptyState'>, Omit, StyleProps, Omit { +export interface TagGroupProps extends Omit, Pick, 'items' | 'children' | 'renderEmptyState'>, Omit, StyleProps, Omit { /** A description for the tag group. */ description?: ReactNode, /** diff --git a/packages/@react-spectrum/s2/src/TextField.tsx b/packages/@react-spectrum/s2/src/TextField.tsx index 56d27b4cff9..ec8fe36dadc 100644 --- a/packages/@react-spectrum/s2/src/TextField.tsx +++ b/packages/@react-spectrum/s2/src/TextField.tsx @@ -25,14 +25,14 @@ import {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHand import {createFocusableRef} from '@react-spectrum/utils'; import {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field'; import {FormContext, useFormProps} from './Form'; -import {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; +import {GlobalDOMAttributes, HelpTextProps, SpectrumLabelableProps} from '@react-types/shared'; import {mergeRefs} from '@react-aria/utils'; import {style} from '../style' with {type: 'macro'}; import {StyleString} from '../style/types'; import {TextFieldRef} from '@react-types/textfield'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface TextFieldProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { +export interface TextFieldProps extends Omit, StyleProps, SpectrumLabelableProps, HelpTextProps { /** * The size of the text field. * diff --git a/packages/@react-spectrum/s2/src/ToggleButton.tsx b/packages/@react-spectrum/s2/src/ToggleButton.tsx index b5041a3289a..c681aabc3d7 100644 --- a/packages/@react-spectrum/s2/src/ToggleButton.tsx +++ b/packages/@react-spectrum/s2/src/ToggleButton.tsx @@ -14,7 +14,7 @@ import {ActionButtonStyleProps, btnStyles} from './ActionButton'; import {centerBaseline} from './CenterBaseline'; import {ContextValue, Provider, ToggleButton as RACToggleButton, ToggleButtonProps as RACToggleButtonProps, useSlottedContext} from 'react-aria-components'; import {createContext, forwardRef, ReactNode} from 'react'; -import {FocusableRef, FocusableRefValue} from '@react-types/shared'; +import {FocusableRef, FocusableRefValue, GlobalDOMAttributes} from '@react-types/shared'; import {fontRelative, style} from '../style' with {type: 'macro'}; import {IconContext} from './Icon'; import {pressScale} from './pressScale'; @@ -26,7 +26,7 @@ import {useFocusableRef} from '@react-spectrum/utils'; import {useFormProps} from './Form'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface ToggleButtonProps extends Omit, StyleProps, ActionButtonStyleProps { +export interface ToggleButtonProps extends Omit, StyleProps, ActionButtonStyleProps { /** The content to display in the button. */ children: ReactNode, /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */ diff --git a/packages/@react-spectrum/s2/src/ToggleButtonGroup.tsx b/packages/@react-spectrum/s2/src/ToggleButtonGroup.tsx index 24f9ab3f18b..79a972a40da 100644 --- a/packages/@react-spectrum/s2/src/ToggleButtonGroup.tsx +++ b/packages/@react-spectrum/s2/src/ToggleButtonGroup.tsx @@ -13,9 +13,10 @@ import {ActionButtonGroupProps, actionGroupStyle} from './ActionButtonGroup'; import {ContextValue, ToggleButtonGroup as RACToggleButtonGroup, ToggleButtonGroupProps as RACToggleButtonGroupProps} from 'react-aria-components'; import {createContext, ForwardedRef, forwardRef} from 'react'; +import {GlobalDOMAttributes} from '@react-types/shared'; import {useSpectrumContextProps} from './useSpectrumContextProps'; -export interface ToggleButtonGroupProps extends ActionButtonGroupProps, Omit { +export interface ToggleButtonGroupProps extends ActionButtonGroupProps, Omit { /** Whether the button should be displayed with an [emphasized style](https://spectrum.adobe.com/page/action-button/#Emphasis). */ isEmphasized?: boolean } diff --git a/packages/@react-spectrum/s2/src/Tooltip.tsx b/packages/@react-spectrum/s2/src/Tooltip.tsx index 84295a4277c..bc27615475c 100644 --- a/packages/@react-spectrum/s2/src/Tooltip.tsx +++ b/packages/@react-spectrum/s2/src/Tooltip.tsx @@ -23,11 +23,11 @@ import {centerPadding, colorScheme, UnsafeStyles} from './style-utils' with {typ import {ColorScheme} from '@react-types/provider'; import {ColorSchemeContext} from './Provider'; import {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react'; -import {DOMRef} from '@react-types/shared'; +import {DOMRef, GlobalDOMAttributes} from '@react-types/shared'; import {style} from '../style' with {type: 'macro'}; import {useDOMRef} from '@react-spectrum/utils'; -export interface TooltipTriggerProps extends Omit, Pick { +export interface TooltipTriggerProps extends Omit, Pick { /** The content of the tooltip. */ children: ReactNode, /** @@ -38,7 +38,7 @@ export interface TooltipTriggerProps extends Omit, UnsafeStyles { +export interface TooltipProps extends Omit, UnsafeStyles { /** The content of the tooltip. */ children: ReactNode } diff --git a/packages/@react-spectrum/s2/src/TreeView.tsx b/packages/@react-spectrum/s2/src/TreeView.tsx index c6ec5fee9d9..d40953132f6 100644 --- a/packages/@react-spectrum/s2/src/TreeView.tsx +++ b/packages/@react-spectrum/s2/src/TreeView.tsx @@ -30,7 +30,7 @@ import {centerBaseline} from './CenterBaseline'; import {Checkbox} from './Checkbox'; import Chevron from '../ui-icons/Chevron'; import {colorMix, focusRing, fontRelative, lightDark, style} from '../style' with {type: 'macro'}; -import {DOMRef, DOMRefValue, forwardRefType, Key} from '@react-types/shared'; +import {DOMRef, DOMRefValue, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared'; import {getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'}; import {IconContext} from './Icon'; import {raw} from '../style/style-macro' with {type: 'macro'}; @@ -48,12 +48,12 @@ interface S2TreeProps { isEmphasized?: boolean } -export interface TreeViewProps extends Omit, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TreeProps { +export interface TreeViewProps extends Omit, 'style' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks' | keyof GlobalDOMAttributes>, UnsafeStyles, S2TreeProps { /** Spectrum-defined styles, returned by the `style()` macro. */ styles?: StylesPropWithHeight } -export interface TreeViewItemProps extends Omit { +export interface TreeViewItemProps extends Omit { /** Whether this item has children, even if not loaded yet. */ hasChildItems?: boolean } diff --git a/packages/react-aria-components/src/ColorArea.tsx b/packages/react-aria-components/src/ColorArea.tsx index c13467d9ed5..5a9af7fc5b8 100644 --- a/packages/react-aria-components/src/ColorArea.tsx +++ b/packages/react-aria-components/src/ColorArea.tsx @@ -60,7 +60,7 @@ export const ColorArea = forwardRef(function ColorArea(props: ColorAreaProps, re return (
);