Skip to content

Commit b2b29fb

Browse files
committed
fix some types
1 parent befdc04 commit b2b29fb

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

packages/@react-spectrum/s2/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
"@react-stately/utils": "^3.10.8",
165165
"@react-types/dialog": "^3.5.22",
166166
"@react-types/grid": "^3.3.6",
167+
"@react-types/overlays": "^3.9.2",
167168
"@react-types/provider": "^3.8.13",
168169
"@react-types/shared": "^3.32.1",
169170
"@react-types/table": "^3.13.4",

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ import {announce} from '@react-aria/live-announcer';
1515
import {CloseButton} from './CloseButton';
1616
import {ContextValue, SlotProps} from 'react-aria-components';
1717
import {createContext, ForwardedRef, forwardRef, ReactElement, ReactNode, RefObject, useCallback, useEffect, useMemo, useRef, useState} from 'react';
18-
import {DOMRef, DOMRefValue, Key} from '@react-types/shared';
18+
import {DOMProps, DOMRef, DOMRefValue, Key} from '@react-types/shared';
1919
import {FocusScope, useKeyboard} from 'react-aria';
2020
// @ts-ignore
2121
import intlMessages from '../intl/*.json';
2222
import {lightDark, style} from '../style' with {type: 'macro'};
23+
import {StyleProps} from './style-utils' with { type: 'macro' };
2324
import {useControlledState} from '@react-stately/utils';
2425
import {useDOMRef} from '@react-spectrum/utils';
2526
import {useEnterAnimation, useExitAnimation, useObjectRef, useResizeObserver} from '@react-aria/utils';
@@ -74,7 +75,7 @@ const actionBarStyles = style({
7475
}
7576
});
7677

77-
export interface ActionBarProps extends SlotProps {
78+
export interface ActionBarProps extends SlotProps, StyleProps, DOMProps {
7879
/** A list of ActionButtons to display. */
7980
children: ReactNode,
8081
/** Whether the ActionBar should be displayed with a emphasized style. */
@@ -106,7 +107,8 @@ export const ActionBar = forwardRef(function ActionBar(props: ActionBarProps, re
106107
});
107108

108109
const ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps & {isExiting: boolean}, ref: ForwardedRef<HTMLDivElement | null>) {
109-
let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting} = props;
110+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
111+
let {isEmphasized, selectedItemCount = 0, children, onClearSelection, isExiting, slot, ...otherProps} = props;
110112
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');
111113

112114
// Store the last count greater than zero so that we can retain it while rendering the fade-out animation.
@@ -158,6 +160,7 @@ const ActionBarInner = forwardRef(function ActionBarInner(props: ActionBarProps
158160
<FocusScope restoreFocus>
159161
<div
160162
ref={objectRef}
163+
{...otherProps}
161164
{...keyboardProps}
162165
className={actionBarStyles({isEmphasized, isInContainer: !!scrollRef, isEntering, isExiting})}
163166
style={{insetInlineEnd: `calc(var(--insetEnd) + ${scrollbarWidth}px)`}}>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import InfoIcon from '../s2wf-icons/S2_Icon_InfoCircle_20_N.svg';
1111
// @ts-ignore
1212
import intlMessages from '../intl/*.json';
1313
import {mergeStyles} from '../style/runtime';
14+
import {Placement} from '@react-types/overlays';
1415
import {Popover, PopoverDialogProps} from './Popover';
1516
import {space, style} from '../style' with {type: 'macro'};
1617
import {StyleProps} from './style-utils' with { type: 'macro' };
@@ -29,6 +30,11 @@ export interface ContextualHelpProps extends
2930
Pick<DialogTriggerProps, 'isOpen' | 'defaultOpen' | 'onOpenChange'>,
3031
Pick<PopoverDialogProps, 'shouldFlip' | 'offset' | 'crossOffset' | 'placement' | 'containerPadding'>,
3132
ContextualHelpStyleProps, StyleProps, DOMProps, AriaLabelingProps {
33+
/**
34+
* The placement of the popover with respect to the action button.
35+
* @default 'bottom start'
36+
*/
37+
placement?: Placement,
3238
/** Contents of the Contextual Help popover. */
3339
children: ReactNode,
3440
/**

packages/@react-types/combobox/src/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface SpectrumComboBoxProps<T> extends SpectrumTextInputBase, Omit<Ar
8484
/** Whether the ComboBox should be displayed with a quiet style. */
8585
isQuiet?: boolean,
8686
/** Alignment of the menu relative to the input target.
87-
* @default 'end'
87+
* @default 'start'
8888
*/
8989
align?: 'start' | 'end',
9090
/**

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7553,6 +7553,7 @@ __metadata:
75537553
"@react-stately/utils": "npm:^3.10.8"
75547554
"@react-types/dialog": "npm:^3.5.22"
75557555
"@react-types/grid": "npm:^3.3.6"
7556+
"@react-types/overlays": "npm:^3.9.2"
75567557
"@react-types/provider": "npm:^3.8.13"
75577558
"@react-types/shared": "npm:^3.32.1"
75587559
"@react-types/table": "npm:^3.13.4"

0 commit comments

Comments
 (0)