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
41 changes: 41 additions & 0 deletions packages/@adobe/react-spectrum/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,44 @@ export {useAsyncList, useListData, useTreeData} from '@react-stately/data';
export {VisuallyHidden} from '@react-aria/visually-hidden';
export {useCollator, useDateFormatter, useFilter, useLocale, useLocalizedStringFormatter, useMessageFormatter, useNumberFormatter} from '@react-aria/i18n';
export {SSRProvider} from '@react-aria/ssr';

export type {SpectrumActionGroupProps} from '@react-spectrum/actiongroup';
export type {SpectrumBreadcrumbsProps} from '@react-spectrum/breadcrumbs';
export type {SpectrumActionButtonProps, SpectrumButtonProps, SpectrumLogicButtonProps, SpectrumToggleButtonProps} from '@react-spectrum/button';
export type {SpectrumButtonGroupProps} from '@react-spectrum/buttongroup';
export type {SpectrumCalendarProps, SpectrumRangeCalendarProps} from '@react-spectrum/calendar';
export type {SpectrumCheckboxGroupProps, SpectrumCheckboxProps} from '@react-spectrum/checkbox';
export type {SpectrumComboBoxProps} from '@react-spectrum/combobox';
export type {SpectrumContextualHelpProps} from '@react-spectrum/contextualhelp';
export type {DialogContainerValue, SpectrumAlertDialogProps, SpectrumDialogContainerProps, SpectrumDialogProps, SpectrumDialogTriggerProps} from '@react-spectrum/dialog';
export type {SpectrumDateFieldProps, SpectrumDatePickerProps, SpectrumDateRangePickerProps, SpectrumTimeFieldProps} from '@react-spectrum/datepicker';
export type {SpectrumDividerProps} from '@react-spectrum/divider';
export type {SpectrumFormProps} from '@react-spectrum/form';
export type {IconProps} from '@react-spectrum/icon';
export type {SpectrumIllustratedMessageProps} from '@react-spectrum/illustratedmessage';
export type {SpectrumImageProps} from '@react-spectrum/image';
export type {DimensionValue, FlexProps, GridProps} from '@react-spectrum/layout';
export type {SpectrumLinkProps} from '@react-spectrum/link';
export type {SpectrumListBoxProps} from '@react-spectrum/listbox';
export type {SpectrumActionMenuProps, SpectrumMenuProps, SpectrumMenuTriggerProps} from '@react-spectrum/menu';
export type {SpectrumMeterProps} from '@react-spectrum/meter';
export type {SpectrumNumberFieldProps} from '@react-spectrum/numberfield';
export type {SpectrumPickerProps} from '@react-spectrum/picker';
export type {SpectrumProgressBarProps, SpectrumProgressCircleProps} from '@react-spectrum/progress';
export type {ProviderContext, ProviderProps} from '@react-spectrum/provider';
export type {SpectrumRadioGroupProps, SpectrumRadioProps} from '@react-spectrum/radio';
export type {SpectrumRangeSliderProps, SpectrumSliderProps} from '@react-spectrum/slider';
export type {SpectrumSearchFieldProps} from '@react-spectrum/searchfield';
export type {SpectrumStatusLightProps} from '@react-spectrum/statuslight';
export type {SpectrumSwitchProps} from '@react-spectrum/switch';
export type {HeadingProps, KeyboardProps, TextProps} from '@react-spectrum/text';
export type {SpectrumTableProps, SpectrumColumnProps, TableHeaderProps, TableBodyProps, RowProps, CellProps} from '@react-spectrum/table';
export type {SpectrumTabListProps, SpectrumTabPanelsProps, SpectrumTabsProps} from '@react-spectrum/tabs';
export type {SpectrumTextFieldProps} from '@react-spectrum/textfield';
export type {SpectrumTooltipProps, SpectrumTooltipTriggerProps} from '@react-spectrum/tooltip';
export type {ContentProps, FooterProps, HeaderProps, ViewProps} from '@react-spectrum/view';
export type {SpectrumWellProps} from '@react-spectrum/well';
export type {AsyncListData, AsyncListOptions, ListData, ListOptions, TreeData, TreeOptions} from '@react-stately/data';
export type {VisuallyHiddenAria, VisuallyHiddenProps} from '@react-aria/visually-hidden';
export type {DateFormatter, DateFormatterOptions, Filter, FormatMessage, Locale, LocalizedStrings} from '@react-aria/i18n';
export type {SSRProviderProps} from '@react-aria/ssr';
2 changes: 2 additions & 0 deletions packages/@react-aria/accordion/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
* governing permissions and limitations under the License.
*/
export {useAccordionItem, useAccordion} from './useAccordion';
export type {AccordionAria, AccordionItemAria, AccordionItemAriaProps} from './useAccordion';
export type {AriaAccordionProps} from '@react-types/accordion';
7 changes: 4 additions & 3 deletions packages/@react-aria/accordion/src/useAccordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ import {TreeState} from '@react-stately/tree';
import {useButton} from '@react-aria/button';
import {useSelectableItem, useSelectableList} from '@react-aria/selection';

interface AccordionAria {
export interface AccordionAria {
/** Props for the accordion container element. */
accordionProps: DOMAttributes
}
interface AccordionItemAriaProps<T> {

export interface AccordionItemAriaProps<T> {
item: Node<T>
}

interface AccordionItemAria {
export interface AccordionItemAria {
/** Props for the accordion item button. */
buttonProps: ButtonHTMLAttributes<HTMLElement>,
/** Props for the accordion item content element. */
Expand Down
2 changes: 2 additions & 0 deletions packages/@react-aria/actiongroup/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
export type {ActionGroupAria} from './useActionGroup';
export {useActionGroup} from './useActionGroup';
export {useActionGroupItem} from './useActionGroupItem';
export type {AriaActionGroupProps} from '@react-types/actiongroup';
export type {ActionGroupItemAria, AriaActionGroupItemProps} from './useActionGroupItem';
6 changes: 3 additions & 3 deletions packages/@react-aria/actiongroup/src/useActionGroupItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import {ListState} from '@react-stately/list';
import {mergeProps} from '@react-aria/utils';
import {PressProps} from '@react-aria/interactions';

interface ActionGroupItemProps {
export interface AriaActionGroupItemProps {
key: Key
}

interface ActionGroupItemAria {
export interface ActionGroupItemAria {
buttonProps: DOMAttributes & PressProps
}

Expand All @@ -31,7 +31,7 @@ const BUTTON_ROLES = {
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useActionGroupItem<T>(props: ActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement>): ActionGroupItemAria {
export function useActionGroupItem<T>(props: AriaActionGroupItemProps, state: ListState<T>, ref?: RefObject<FocusableElement>): ActionGroupItemAria {
let selectionMode = state.selectionManager.selectionMode;
let buttonProps = {
role: BUTTON_ROLES[selectionMode]
Expand Down
1 change: 1 addition & 0 deletions packages/@react-aria/autocomplete/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
* governing permissions and limitations under the License.
*/
export {useSearchAutocomplete} from './useSearchAutocomplete';
export type {AriaSearchAutocompleteProps, SearchAutocompleteAria} from './useSearchAutocomplete';
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {SearchAutocompleteProps} from '@react-types/autocomplete';
import {useComboBox} from '@react-aria/combobox';
import {useSearchField} from '@react-aria/searchfield';

interface AriaSearchAutocompleteProps<T> extends SearchAutocompleteProps<T> {
export interface AriaSearchAutocompleteProps<T> extends SearchAutocompleteProps<T> {
/** The ref for the input element. */
inputRef: RefObject<HTMLInputElement>,
/** The ref for the list box popover. */
Expand All @@ -32,7 +32,7 @@ interface AriaSearchAutocompleteProps<T> extends SearchAutocompleteProps<T> {
keyboardDelegate?: KeyboardDelegate
}

interface SearchAutocompleteAria<T> {
export interface SearchAutocompleteAria<T> {
/** Props for the label element. */
labelProps: DOMAttributes,
/** Props for the search input element. */
Expand Down
3 changes: 3 additions & 0 deletions packages/@react-aria/breadcrumbs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
*/
export {useBreadcrumbItem} from './useBreadcrumbItem';
export {useBreadcrumbs} from './useBreadcrumbs';
export type {AriaBreadcrumbItemProps, AriaBreadcrumbsProps} from '@react-types/breadcrumbs';
export type {BreadcrumbItemAria} from './useBreadcrumbItem';
export type {BreadcrumbsAria} from './useBreadcrumbs';
2 changes: 1 addition & 1 deletion packages/@react-aria/breadcrumbs/src/useBreadcrumbItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {DOMAttributes, FocusableElement} from '@react-types/shared';
import {RefObject} from 'react';
import {useLink} from '@react-aria/link';

interface BreadcrumbItemAria {
export interface BreadcrumbItemAria {
/** Props for the breadcrumb item link element. */
itemProps: DOMAttributes
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/breadcrumbs/src/useBreadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {filterDOMProps} from '@react-aria/utils';
import intlMessages from '../intl/*.json';
import {useLocalizedStringFormatter} from '@react-aria/i18n';

interface BreadcrumbsAria {
export interface BreadcrumbsAria {
/** Props for the breadcrumbs navigation element. */
navProps: DOMAttributes
}
Expand Down
3 changes: 2 additions & 1 deletion packages/@react-aria/button/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
export type {ButtonAria} from './useButton';
export {useButton} from './useButton';
export {useToggleButton} from './useToggleButton';
export type {ButtonAria} from './useButton';
export type {AriaButtonProps, AriaToggleButtonProps} from '@react-types/button';
2 changes: 2 additions & 0 deletions packages/@react-aria/checkbox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export type {CheckboxAria} from './useCheckbox';
export {useCheckbox} from './useCheckbox';
export {useCheckboxGroup} from './useCheckboxGroup';
export {useCheckboxGroupItem} from './useCheckboxGroupItem';
export type {AriaCheckboxGroupItemProps, AriaCheckboxGroupProps, AriaCheckboxProps} from '@react-types/checkbox';
export type {CheckboxGroupAria} from './useCheckboxGroup';
2 changes: 1 addition & 1 deletion packages/@react-aria/checkbox/src/useCheckboxGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {DOMAttributes} from '@react-types/shared';
import {filterDOMProps, mergeProps} from '@react-aria/utils';
import {useLabel} from '@react-aria/label';

interface CheckboxGroupAria {
export interface CheckboxGroupAria {
/** Props for the checkbox group wrapper element. */
groupProps: DOMAttributes,
/** Props for the checkbox group's visible label (if any). */
Expand Down
5 changes: 5 additions & 0 deletions packages/@react-aria/color/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ export {useColorArea} from './useColorArea';
export {useColorSlider} from './useColorSlider';
export {useColorWheel} from './useColorWheel';
export {useColorField} from './useColorField';
export type {AriaColorAreaOptions, ColorAreaAria} from './useColorArea';
export type {AriaColorSliderOptions, ColorSliderAria} from './useColorSlider';
export type {AriaColorWheelOptions, ColorWheelAria} from './useColorWheel';
export type {AriaColorFieldProps} from '@react-types/color';
export type {ColorFieldAria} from './useColorField';
6 changes: 3 additions & 3 deletions packages/@react-aria/color/src/useColorArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {useFocus, useFocusWithin, useKeyboard, useMove} from '@react-aria/intera
import {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';
import {useVisuallyHidden} from '@react-aria/visually-hidden';

interface ColorAreaAria {
export interface ColorAreaAria {
/** Props for the color area container element. */
colorAreaProps: DOMAttributes,
/** Props for the color area gradient foreground element. */
Expand All @@ -35,7 +35,7 @@ interface ColorAreaAria {
yInputProps: InputHTMLAttributes<HTMLInputElement>
}

interface ColorAreaAriaProps extends AriaColorAreaProps {
export interface AriaColorAreaOptions extends AriaColorAreaProps {
/** A ref to the input that represents the x axis of the color area. */
inputXRef: RefObject<HTMLInputElement>,
/** A ref to the input that represents the y axis of the color area. */
Expand All @@ -48,7 +48,7 @@ interface ColorAreaAriaProps extends AriaColorAreaProps {
* Provides the behavior and accessibility implementation for a color area component.
* Color area allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
*/
export function useColorArea(props: ColorAreaAriaProps, state: ColorAreaState): ColorAreaAria {
export function useColorArea(props: AriaColorAreaOptions, state: ColorAreaState): ColorAreaAria {
let {
isDisabled,
inputXRef,
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/color/src/useColorField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {useFocusWithin, useScrollWheel} from '@react-aria/interactions';
import {useFormattedTextField} from '@react-aria/textfield';
import {useSpinButton} from '@react-aria/spinbutton';

interface ColorFieldAria {
export interface ColorFieldAria {
/** Props for the label element. */
labelProps: LabelHTMLAttributes<HTMLLabelElement>,
/** Props for the input element. */
Expand Down
6 changes: 3 additions & 3 deletions packages/@react-aria/color/src/useColorSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import {mergeProps} from '@react-aria/utils';
import {useLocale} from '@react-aria/i18n';
import {useSlider, useSliderThumb} from '@react-aria/slider';

interface ColorSliderAriaOptions extends AriaColorSliderProps {
export interface AriaColorSliderOptions extends AriaColorSliderProps {
/** A ref for the track element. */
trackRef: RefObject<Element>,
/** A ref for the input element. */
inputRef: RefObject<HTMLInputElement>
}

interface ColorSliderAria {
export interface ColorSliderAria {
/** Props for the label element. */
labelProps: DOMAttributes,
/** Props for the track element. */
Expand All @@ -42,7 +42,7 @@ interface ColorSliderAria {
* Provides the behavior and accessibility implementation for a color slider component.
* Color sliders allow users to adjust an individual channel of a color value.
*/
export function useColorSlider(props: ColorSliderAriaOptions, state: ColorSliderState): ColorSliderAria {
export function useColorSlider(props: AriaColorSliderOptions, state: ColorSliderState): ColorSliderAria {
let {trackRef, inputRef, orientation, channel, 'aria-label': ariaLabel} = props;

let {locale, direction} = useLocale();
Expand Down
6 changes: 3 additions & 3 deletions packages/@react-aria/color/src/useColorWheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import React, {ChangeEvent, InputHTMLAttributes, RefObject, useCallback, useRef}
import {useKeyboard, useMove} from '@react-aria/interactions';
import {useLocale} from '@react-aria/i18n';

interface ColorWheelAriaProps extends AriaColorWheelProps {
export interface AriaColorWheelOptions extends AriaColorWheelProps {
/** The outer radius of the color wheel. */
outerRadius: number,
/** The inner radius of the color wheel. */
innerRadius: number
}

interface ColorWheelAria {
export interface ColorWheelAria {
/** Props for the track element. */
trackProps: DOMAttributes,
/** Props for the thumb element. */
Expand All @@ -38,7 +38,7 @@ interface ColorWheelAria {
* Provides the behavior and accessibility implementation for a color wheel component.
* Color wheels allow users to adjust the hue of an HSL or HSB color value on a circular track.
*/
export function useColorWheel(props: ColorWheelAriaProps, state: ColorWheelState, inputRef: RefObject<HTMLInputElement>): ColorWheelAria {
export function useColorWheel(props: AriaColorWheelOptions, state: ColorWheelState, inputRef: RefObject<HTMLInputElement>): ColorWheelAria {
let {
isDisabled,
innerRadius,
Expand Down
1 change: 1 addition & 0 deletions packages/@react-aria/combobox/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
* governing permissions and limitations under the License.
*/
export {useComboBox} from './useComboBox';
export type {AriaComboBoxOptions, ComboBoxAria} from './useComboBox';
4 changes: 2 additions & 2 deletions packages/@react-aria/combobox/src/useComboBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {useLocalizedStringFormatter} from '@react-aria/i18n';
import {useMenuTrigger} from '@react-aria/menu';
import {useTextField} from '@react-aria/textfield';

interface AriaComboBoxOptions<T> extends AriaComboBoxProps<T> {
export interface AriaComboBoxOptions<T> extends AriaComboBoxProps<T> {
/** The ref for the input element. */
inputRef: RefObject<HTMLInputElement>,
/** The ref for the list box popover. */
Expand All @@ -40,7 +40,7 @@ interface AriaComboBoxOptions<T> extends AriaComboBoxProps<T> {
keyboardDelegate?: KeyboardDelegate
}

interface ComboBoxAria<T> {
export interface ComboBoxAria<T> {
/** Props for the label element. */
labelProps: DOMAttributes,
/** Props for the combo box input element. */
Expand Down
1 change: 1 addition & 0 deletions packages/@react-aria/datepicker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ export type {AriaDateFieldProps, DateFieldAria} from './useDateField';
export type {DatePickerAria} from './useDatePicker';
export type {DateRangePickerAria} from './useDateRangePicker';
export type {DateSegmentAria} from './useDateSegment';
export type {AriaTimeFieldProps} from '@react-types/datepicker';
2 changes: 2 additions & 0 deletions packages/@react-aria/dialog/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
* governing permissions and limitations under the License.
*/
export {useDialog} from './useDialog';
export type {AriaDialogProps} from '@react-types/dialog';
export type {DialogAria} from './useDialog';
2 changes: 1 addition & 1 deletion packages/@react-aria/dialog/src/useDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {filterDOMProps, useSlotId} from '@react-aria/utils';
import {focusSafely} from '@react-aria/focus';
import {RefObject, useEffect} from 'react';

interface DialogAria {
export interface DialogAria {
/** Props for the dialog container element. */
dialogProps: DOMAttributes,

Expand Down
3 changes: 3 additions & 0 deletions packages/@react-aria/dnd/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export type {DroppableItemOptions, DroppableItemResult} from './useDroppableItem
export type {DropIndicatorProps, DropIndicatorAria} from './useDropIndicator';
export type {DraggableItemProps, DraggableItemResult} from './useDraggableItem';
export type {DragPreviewProps} from './DragPreview';
export type {DragOptions, DragResult} from './useDrag';
export type {DropOptions, DropResult} from './useDrop';
export type {ClipboardProps, ClipboardResult} from './useClipboard';

export {useDrag} from './useDrag';
export {useDrop} from './useDrop';
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-aria/dnd/src/useClipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import {readFromDataTransfer, writeToDataTransfer} from './utils';
import {useEffect, useRef} from 'react';
import {useFocus} from '@react-aria/interactions';

interface ClipboardProps {
export interface ClipboardProps {
getItems?: () => DragItem[],
onCopy?: () => void,
onCut?: () => void,
onPaste?: (items: DropItem[]) => void
}

interface ClipboardResult {
export interface ClipboardResult {
clipboardProps: DOMAttributes
}

Expand Down
4 changes: 2 additions & 2 deletions packages/@react-aria/dnd/src/useDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {useDragModality} from './utils';
import {useLocalizedStringFormatter} from '@react-aria/i18n';
import {writeToDataTransfer} from './utils';

interface DragOptions {
export interface DragOptions {
onDragStart?: (e: DragStartEvent) => void,
onDragMove?: (e: DragMoveEvent) => void,
onDragEnd?: (e: DragEndEvent) => void,
Expand All @@ -31,7 +31,7 @@ interface DragOptions {
getAllowedDropOperations?: () => DropOperation[]
}

interface DragResult {
export interface DragResult {
dragProps: HTMLAttributes<HTMLElement>,
dragButtonProps: AriaButtonProps,
isDragging: boolean
Expand Down
4 changes: 2 additions & 2 deletions packages/@react-aria/dnd/src/useDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropMoveEve
import {useLayoutEffect} from '@react-aria/utils';
import {useVirtualDrop} from './useVirtualDrop';

interface DropOptions {
export interface DropOptions {
ref: RefObject<HTMLElement>,
getDropOperation?: (types: IDragTypes, allowedOperations: DropOperation[]) => DropOperation,
getDropOperationForPoint?: (types: IDragTypes, allowedOperations: DropOperation[], x: number, y: number) => DropOperation,
Expand All @@ -31,7 +31,7 @@ interface DropOptions {
onDrop?: (e: DropEvent) => void
}

interface DropResult {
export interface DropResult {
dropProps: HTMLAttributes<HTMLElement>,
isDropTarget: boolean // (??) whether the element is currently an active drop target
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@react-aria/focus/src/FocusRing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {mergeProps} from '@react-aria/utils';
import React, {ReactElement} from 'react';
import {useFocusRing} from './useFocusRing';

interface FocusRingProps {
export interface FocusRingProps {
/** Child element to apply CSS classes to. */
children: ReactElement,
/** CSS class to apply when the element is focused. */
Expand Down
Loading