Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@react-spectrum/s2/src/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import {useSpectrumContextProps} from './useSpectrumContextProps';


export interface CalendarProps<T extends DateValue>
extends Omit<AriaCalendarProps<T>, 'visibleDuration' | 'style' | 'className' | 'styles' | keyof GlobalDOMAttributes>,
extends Omit<AriaCalendarProps<T>, 'visibleDuration' | 'style' | 'className' | 'styles' | 'children' | keyof GlobalDOMAttributes>,
StyleProps {
/**
* The error message to display when the calendar is invalid.
Expand Down
7 changes: 6 additions & 1 deletion packages/@react-spectrum/s2/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,12 @@ export function Divider(props: SeparatorProps): ReactNode {
);
}

export interface MenuSectionProps<T extends object> extends Omit<AriaMenuSectionProps<T>, keyof GlobalDOMAttributes> {}
export interface MenuSectionProps<T extends object> extends Omit<AriaMenuSectionProps<T>, 'style' | 'className' | keyof GlobalDOMAttributes> {
/**
* The children of the menu section.
*/
children?: ReactNode
}
export function MenuSection<T extends object>(props: MenuSectionProps<T>): ReactNode {
// remember, context doesn't work if it's around Section nor inside
let {size} = useContext(InternalMenuContext);
Expand Down
34 changes: 31 additions & 3 deletions packages/@react-spectrum/s2/src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from 'react-aria-components';
import {colorScheme, getAllowedOverrides, heightProperties, UnsafeStyles, widthProperties} from './style-utils' with {type: 'macro'};
import {ColorSchemeContext} from './Provider';
import {createContext, ForwardedRef, forwardRef, useCallback, useContext, useMemo} from 'react';
import {createContext, ForwardedRef, forwardRef, ReactNode, useCallback, useContext, useMemo} from 'react';
import {DOMRef, DOMRefValue, GlobalDOMAttributes} from '@react-types/shared';
import {lightDark, style} from '../style' with {type: 'macro'};
import {mergeRefs} from '@react-aria/utils';
Expand All @@ -31,7 +31,20 @@ import {StyleString} from '../style/types' with {type: 'macro'};
import {useDOMRef} from '@react-spectrum/utils';
import {useSpectrumContextProps} from './useSpectrumContextProps';

export interface PopoverProps extends UnsafeStyles, Omit<AriaPopoverProps, 'arrowSize' | 'isNonModal' | 'arrowBoundaryOffset' | 'isKeyboardDismissDisabled' | 'shouldCloseOnInteractOutside' | 'shouldUpdatePosition' | keyof GlobalDOMAttributes> {
export interface PopoverProps extends UnsafeStyles, Omit<AriaPopoverProps,
'arrowSize' |
'isNonModal' |
'arrowBoundaryOffset' |
'isKeyboardDismissDisabled' |
'shouldCloseOnInteractOutside' |
'shouldUpdatePosition' |
'style' |
'className' |
keyof GlobalDOMAttributes
> {
/**
* The styles of the popover.
*/
styles?: StyleString,
/**
* Whether a popover's arrow should be hidden.
Expand Down Expand Up @@ -228,7 +241,22 @@ export const PopoverBase = forwardRef(function PopoverBase(props: PopoverProps,
});

type PopoverStylesProp = StyleString<((typeof widthProperties)[number] | (typeof heightProperties)[number])>;
export interface PopoverDialogProps extends Pick<PopoverProps, 'children' | 'size' | 'hideArrow'| 'placement' | 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset' | 'triggerRef' | 'isOpen' | 'onOpenChange'>, Omit<DialogProps, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>, UnsafeStyles {
export interface PopoverDialogProps extends Pick<PopoverProps,
'size' |
'hideArrow'|
'placement' |
'shouldFlip' |
'containerPadding' |
'offset' |
'crossOffset' |
'triggerRef' |
'isOpen' |
'onOpenChange'
>, Omit<DialogProps, 'children' | 'className' | 'style' | keyof GlobalDOMAttributes>, UnsafeStyles {
/**
* The children of the popover.
*/
children?: ReactNode,
/**
* The amount of padding around the contents of the dialog.
* @default 'default'
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-spectrum/s2/src/RangeCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {useSpectrumContextProps} from './useSpectrumContextProps';


export interface RangeCalendarProps<T extends DateValue>
extends Omit<AriaRangeCalendarProps<T>, 'visibleDuration' | 'style' | 'className' | 'styles' | keyof GlobalDOMAttributes>,
extends Omit<AriaRangeCalendarProps<T>, 'visibleDuration' | 'style' | 'className' | 'children' | 'styles' | keyof GlobalDOMAttributes>,
StyleProps {
/**
* The error message to display when the calendar is invalid.
Expand Down
7 changes: 5 additions & 2 deletions packages/@react-spectrum/s2/src/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ const columnStyles = style({
forcedColorAdjust: 'none'
});

export interface ColumnProps extends Omit<RACColumnProps, keyof GlobalDOMAttributes> {
export interface ColumnProps extends Omit<RACColumnProps, 'style' | 'className' | keyof GlobalDOMAttributes> {
/** Whether the column should render a divider between it and the next column. */
showDivider?: boolean,
/** Whether the column allows resizing. */
Expand Down Expand Up @@ -1017,7 +1017,7 @@ const cellContent = style({
}
});

export interface CellProps extends RACCellProps, Pick<ColumnProps, 'align' | 'showDivider'> {
export interface CellProps extends Omit<RACCellProps, 'style' | 'className' | keyof GlobalDOMAttributes>, Pick<ColumnProps, 'align' | 'showDivider'> {
/** @private */
isSticky?: boolean,
/** The content to render as the cell children. */
Expand Down Expand Up @@ -1410,6 +1410,9 @@ export const Row = /*#__PURE__*/ (forwardRef as forwardRefType)(function Row<T e
}) + (renderProps.isFocusVisible && ' ' + raw('&:before { content: ""; display: inline-block; position: sticky; inset-inline-start: 0; width: 3px; height: 100%; margin-inline-end: -3px; margin-block-end: 1px; z-index: 3; background-color: var(--rowFocusIndicatorColor)'))}
{...otherProps}>
{selectionMode !== 'none' && selectionBehavior === 'toggle' && (
// Not sure what we want to do with this className, in Cell it currently overrides the className that would have been applied.
// The `spread` otherProps must be after className in Cell.
// @ts-ignore
<Cell isSticky className={checkboxCellStyle}>
<Checkbox isEmphasized slot="selection" />
</Cell>
Expand Down
6 changes: 3 additions & 3 deletions packages/@react-spectrum/s2/src/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {useMediaQuery} from '@react-spectrum/utils';
import {useOverlayTriggerState} from 'react-stately';

export type ToastPlacement = 'top' | 'top end' | 'bottom' | 'bottom end';
export interface ToastContainerProps extends Omit<ToastRegionProps<SpectrumToastValue>, 'queue' | 'children'> {
export interface ToastContainerProps extends Omit<ToastRegionProps<SpectrumToastValue>, 'queue' | 'children' | 'style' | 'className'> {
/**
* Placement of the toast container on the page.
* @default "bottom"
Expand Down Expand Up @@ -490,7 +490,7 @@ export function SpectrumToast(props: SpectrumToastProps): ReactNode {
width: '100%',
translate: `0 0 ${(-12 * index) / 16}rem`,
// Only 3 toasts are visible in the stack at once, but all toasts are in the DOM.
// This allows view transitions to smoothly animate them from where they would be
// This allows view transitions to smoothly animate them from where they would be
// in the collapsed stack to their final position in the expanded list.
opacity: index >= 3 ? 0 : 1,
zIndex: visibleToasts.length - index - 1,
Expand Down Expand Up @@ -528,7 +528,7 @@ export function SpectrumToast(props: SpectrumToastProps): ReactNode {
}
<Text slot="title">{toast.content.children}</Text>
</ToastContent>
{!isExpanded && visibleToasts.length > 1 &&
{!isExpanded && visibleToasts.length > 1 &&
<ActionButton
isQuiet
staticColor="white"
Expand Down