react-aria-components 1.0.0-beta.0 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -1,22 +1,24 @@
1
- import React, { Context, CSSProperties, ForwardedRef, ReactNode, RefObject, Key, ReactElement, HTMLAttributes, LabelHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes } from "react";
2
- import { CollectionBase, DraggableCollectionProps, DroppableCollectionProps, AriaLabelingProps, InputDOMProps } from "@react-types/shared";
3
- import { Collection as _Collection1, Node, SelectionBehavior, SelectionMode, ItemProps as _ItemProps1, SectionProps as _SectionProps1, CalendarState, RangeCalendarState, CheckboxGroupState, DraggableCollectionState, DraggableCollectionStateOptions, DroppableCollectionState, DroppableCollectionStateOptions, ListState, Orientation, OverlayTriggerProps, OverlayTriggerState, DateFieldState, DateSegmentType, DateSegment as _DateSegment1, DatePickerState, DateRangePickerState, MenuTriggerProps as _MenuTriggerProps1, NumberFieldState, RadioGroupState, SearchFieldState, SliderState, ToggleState, DisabledBehavior, SortDirection, TableState, TabListState, TooltipTriggerProps, TooltipTriggerState } from "react-stately";
4
- import { AriaLinkOptions, AriaBreadcrumbsProps, AriaButtonProps, CalendarProps as _CalendarProps1, RangeCalendarProps as _RangeCalendarProps1, DateValue, AriaCheckboxGroupProps, AriaCheckboxProps, DropIndicatorProps as _DropIndicatorProps1, DraggableCollectionOptions, DraggableItemProps, DraggableItemResult, DragItem, DragPreview, DropIndicatorAria, DroppableCollectionOptions, DroppableCollectionResult, DroppableItemOptions, DroppableItemResult, DropTarget, DropTargetDelegate, ListDropTargetDelegate, SeparatorProps as _SeparatorProps1, AriaListBoxProps, PlacementAxis, AriaPopoverProps, PositionProps, AriaComboBoxProps, AriaDateFieldProps, AriaTimeFieldProps, TimeValue, AriaModalOverlayProps, AriaDialogProps, AriaDatePickerProps, AriaDateRangePickerProps, DropOptions, AriaGridListProps, AriaMenuProps, AriaMeterProps, AriaNumberFieldProps, AriaProgressBarProps, AriaRadioGroupProps, AriaRadioProps, Orientation as _Orientation1, AriaSearchFieldProps, AriaSelectProps, AriaSliderProps, AriaSliderThumbProps, AriaSwitchProps, AriaTabListProps, AriaTabPanelProps, AriaTagGroupProps, AriaTextFieldProps, AriaToggleButtonProps } from "react-aria";
1
+ import React, { Context, CSSProperties, ForwardedRef, ReactNode, RefObject, Key, ReactElement, HTMLAttributes, LabelHTMLAttributes, InputHTMLAttributes, OutputHTMLAttributes, TextareaHTMLAttributes } from "react";
2
+ import { CollectionBase, LinkDOMProps, DraggableCollectionProps, DroppableCollectionProps, AriaLabelingProps, InputDOMProps } from "@react-types/shared";
3
+ import { SelectionBehavior, SelectionMode, ItemProps as _ItemProps1, SectionProps as _SectionProps1, CalendarState, RangeCalendarState, CheckboxGroupState, DraggableCollectionState, DraggableCollectionStateOptions, DroppableCollectionState, DroppableCollectionStateOptions, ListState, Orientation, OverlayTriggerProps, OverlayTriggerState, ComboBoxState, DateFieldState, DateSegmentType, DateSegment as _DateSegment1, TimeFieldState, DatePickerState, DateRangePickerState, MenuTriggerProps as _MenuTriggerProps1, TreeState, NumberFieldState, RadioGroupState, SearchFieldState, SelectState, SliderState, ToggleState, DisabledBehavior, SortDirection, TableState, TabListState, TooltipTriggerProps, TooltipTriggerState } from "react-stately";
4
+ import { AriaLinkOptions, AriaBreadcrumbsProps, AriaButtonProps, CalendarProps as _CalendarProps1, RangeCalendarProps as _RangeCalendarProps1, DateValue, AriaCheckboxGroupProps, AriaCheckboxProps, DropIndicatorProps as _DropIndicatorProps1, DraggableCollectionOptions, DraggableItemProps, DraggableItemResult, DragItem, DragPreview, DropIndicatorAria, DroppableCollectionOptions, DroppableCollectionResult, DroppableItemOptions, DroppableItemResult, DropTarget, DropTargetDelegate, ListDropTargetDelegate, SeparatorProps as _SeparatorProps1, AriaListBoxProps, PlacementAxis, AriaPopoverProps, PositionProps, AriaDialogProps, AriaComboBoxProps, AriaDateFieldProps, AriaTimeFieldProps, TimeValue, AriaDatePickerProps, AriaDateRangePickerProps, DropOptions, AriaGridListProps, AriaMenuProps, AriaMeterProps, AriaModalOverlayProps, AriaNumberFieldProps, AriaProgressBarProps, AriaRadioGroupProps, AriaRadioProps, Orientation as _Orientation1, AriaSearchFieldProps, AriaSelectProps, AriaSliderProps, AriaSliderThumbProps, AriaSwitchProps, AriaTabListProps, AriaTabPanelProps, AriaTagGroupProps, AriaTextFieldProps, AriaToggleButtonProps } from "react-aria";
5
5
  import { CalendarDate, DateDuration } from "@internationalized/date";
6
+ import { TableColumnResizeState } from "@react-stately/table";
6
7
  import { ColumnSize, ColumnStaticSize, TableProps as _TableProps1 } from "@react-types/table";
7
8
  declare const slotCallbackSymbol: unique symbol;
8
9
  interface SlottedValue<T> {
9
10
  slots?: Record<string | symbol, T>;
10
11
  [slotCallbackSymbol]?: (value: T) => void;
11
12
  }
12
- export type ContextValue<T extends SlotProps, E extends Element> = SlottedValue<WithRef<T, E>> | WithRef<T, E> | null | undefined;
13
+ type SlottedContextValue<T> = SlottedValue<T> | T | null | undefined;
14
+ export type ContextValue<T, E extends Element> = SlottedContextValue<WithRef<T, E>>;
13
15
  type ProviderValue<T> = [Context<T>, T];
14
- type ProviderValues<A, B, C, D, E, F, G, H> = [ProviderValue<A>] | [ProviderValue<A>, ProviderValue<B>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>];
15
- interface ProviderProps<A, B, C, D, E, F, G, H> {
16
- values: ProviderValues<A, B, C, D, E, F, G, H>;
16
+ type ProviderValues<A, B, C, D, E, F, G, H, I, J> = [ProviderValue<A>] | [ProviderValue<A>, ProviderValue<B>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>];
17
+ interface ProviderProps<A, B, C, D, E, F, G, H, I, J> {
18
+ values: ProviderValues<A, B, C, D, E, F, G, H, I, J>;
17
19
  children: ReactNode;
18
20
  }
19
- export function Provider<A, B, C, D, E, F, G, H>({ values, children }: ProviderProps<A, B, C, D, E, F, G, H>): JSX.Element;
21
+ export function Provider<A, B, C, D, E, F, G, H, I, J>({ values, children }: ProviderProps<A, B, C, D, E, F, G, H, I, J>): JSX.Element;
20
22
  interface StyleProps {
21
23
  /** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. */
22
24
  className?: string;
@@ -41,129 +43,14 @@ type WithRef<T, E> = T & {
41
43
  ref?: ForwardedRef<E>;
42
44
  };
43
45
  export interface SlotProps {
44
- /** A slot name for the component. Slots allow the component to receive props from a parent component. */
45
- slot?: string;
46
+ /**
47
+ * A slot name for the component. Slots allow the component to receive props from a parent component.
48
+ * An explicit `null` value indicates that the local props completely override all props received from a parent.
49
+ */
50
+ slot?: string | null;
46
51
  }
47
- export function useSlottedContext<U extends SlotProps, E extends Element>(context: Context<ContextValue<U, E>>, slot?: string): WithRef<U, E> | null | undefined;
52
+ export function useSlottedContext<T>(context: Context<SlottedContextValue<T>>, slot?: string | null): T | null | undefined;
48
53
  export function useContextProps<T, U extends SlotProps, E extends Element>(props: T & SlotProps, ref: ForwardedRef<E>, context: Context<ContextValue<U, E>>): [T, RefObject<E>];
49
- type Mutable<T> = {
50
- -readonly [P in keyof T]: T[P];
51
- };
52
- /** An immutable object representing a Node in a Collection. */
53
- declare class NodeValue<T> implements Node<T> {
54
- readonly type: string;
55
- readonly key: Key;
56
- readonly value: T | null;
57
- readonly level: number;
58
- readonly hasChildNodes: boolean;
59
- readonly rendered: ReactNode;
60
- readonly textValue: string;
61
- readonly 'aria-label'?: string;
62
- readonly index: number;
63
- readonly parentKey: Key | null;
64
- readonly prevKey: Key | null;
65
- readonly nextKey: Key | null;
66
- readonly firstChildKey: Key | null;
67
- readonly lastChildKey: Key | null;
68
- readonly props: any;
69
- constructor(type: string, key: Key);
70
- get childNodes(): Iterable<Node<T>>;
71
- clone(): NodeValue<T>;
72
- }
73
- /**
74
- * A mutable node in the fake DOM tree. When mutated, it marks itself as dirty
75
- * and queues an update with the owner document.
76
- */
77
- declare class BaseNode<T> {
78
- ownerDocument: Document<T, any>;
79
- constructor(ownerDocument: Document<T, any>);
80
- [Symbol.iterator](): Generator<ElementNode<T>, void, unknown>;
81
- get firstChild(): ElementNode<T>;
82
- set firstChild(firstChild: ElementNode<T>);
83
- get lastChild(): ElementNode<T>;
84
- set lastChild(lastChild: ElementNode<T>);
85
- get previousSibling(): ElementNode<T>;
86
- set previousSibling(previousSibling: ElementNode<T>);
87
- get nextSibling(): ElementNode<T>;
88
- set nextSibling(nextSibling: ElementNode<T>);
89
- get parentNode(): BaseNode<T>;
90
- set parentNode(parentNode: BaseNode<T>);
91
- appendChild(child: ElementNode<T>): void;
92
- insertBefore(newNode: ElementNode<T>, referenceNode: ElementNode<T>): void;
93
- removeChild(child: ElementNode<T>): void;
94
- addEventListener(): void;
95
- removeEventListener(): void;
96
- }
97
- /**
98
- * A mutable element node in the fake DOM tree. It owns an immutable
99
- * Collection Node which is copied on write.
100
- */
101
- declare class ElementNode<T> extends BaseNode<T> {
102
- nodeType: number;
103
- node: NodeValue<T>;
104
- hasSetProps: boolean;
105
- constructor(type: string, ownerDocument: Document<T, any>);
106
- get index(): number;
107
- set index(index: number);
108
- get level(): number;
109
- updateNode(): void;
110
- setProps<T extends Element>(obj: any, ref: ForwardedRef<T>, rendered?: any): void;
111
- get style(): {};
112
- hasAttribute(): void;
113
- setAttribute(): void;
114
- setAttributeNS(): void;
115
- removeAttribute(): void;
116
- }
117
- /**
118
- * An immutable Collection implementation. Updates are only allowed
119
- * when it is not marked as frozen.
120
- */
121
- declare class BaseCollection<T> implements _Collection1<Node<T>> {
122
- get size(): number;
123
- getKeys(): IterableIterator<React.Key>;
124
- [Symbol.iterator](): Generator<Node<T>, void, unknown>;
125
- getChildren(key: Key): Iterable<Node<T>>;
126
- getKeyBefore(key: Key): React.Key;
127
- getKeyAfter(key: Key): React.Key;
128
- getFirstKey(): React.Key;
129
- getLastKey(): React.Key;
130
- getItem(key: Key): Node<T> | null;
131
- at(): Node<T>;
132
- clone(): this;
133
- addNode(node: NodeValue<T>): void;
134
- removeNode(key: Key): void;
135
- commit(firstKey: Key | null, lastKey: Key | null, isSSR?: boolean): void;
136
- }
137
- /**
138
- * A mutable Document in the fake DOM. It owns an immutable Collection instance,
139
- * which is lazily copied on write during updates.
140
- */
141
- declare class Document<T, C extends BaseCollection<T> = BaseCollection<T>> extends BaseNode<T> {
142
- nodeType: number;
143
- ownerDocument: this;
144
- dirtyNodes: Set<BaseNode<T>>;
145
- isSSR: boolean;
146
- nodeId: number;
147
- nodesByProps: WeakMap<object, ElementNode<T>>;
148
- constructor(collection: C);
149
- createElement(type: string): ElementNode<T>;
150
- /**
151
- * Lazily gets a mutable instance of a Node. If the node has already
152
- * been cloned during this update cycle, it just returns the existing one.
153
- */
154
- getMutableNode(element: ElementNode<T>): Mutable<NodeValue<T>>;
155
- markDirty(node: BaseNode<T>): void;
156
- startTransaction(): void;
157
- endTransaction(): void;
158
- addNode(element: ElementNode<T>): void;
159
- removeNode(node: ElementNode<T>): void;
160
- /** Finalizes the collection update, updating all nodes and freezing the collection. */
161
- getCollection(): C;
162
- updateCollection(): void;
163
- queueUpdate(): void;
164
- subscribe(fn: () => void): () => boolean;
165
- resetAfterSSR(): void;
166
- }
167
54
  interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'> {
168
55
  /** The contents of the collection. */
169
56
  children?: ReactNode | ((item: T) => ReactNode);
@@ -226,7 +113,7 @@ export interface ItemRenderProps {
226
113
  */
227
114
  isDropTarget?: boolean;
228
115
  }
229
- export interface ItemProps<T = object> extends Omit<_ItemProps1<T>, 'children'>, RenderProps<ItemRenderProps> {
116
+ export interface ItemProps<T = object> extends Omit<_ItemProps1<T>, 'children'>, RenderProps<ItemRenderProps>, LinkDOMProps {
230
117
  /** The unique id of the item. */
231
118
  id?: Key;
232
119
  /** The object value that this item represents. When using dynamic collections, this is set automatically. */
@@ -292,7 +179,7 @@ export interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledK
292
179
  }
293
180
  export const BreadcrumbsContext: React.Context<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>;
294
181
  /**
295
- * Breadcrumbs display a heirarchy of links to the current page or resource in an application.
182
+ * Breadcrumbs display a hierarchy of links to the current page or resource in an application.
296
183
  */
297
184
  export const Breadcrumbs: <T extends object>(props: BreadcrumbsProps<T> & React.RefAttributes<HTMLOListElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
298
185
  export interface BreadcrumbProps extends StyleProps {
@@ -412,6 +299,8 @@ export interface RangeCalendarProps<T extends DateValue> extends Omit<_RangeCale
412
299
  }
413
300
  export const CalendarContext: React.Context<ContextValue<CalendarProps<any>, HTMLDivElement>>;
414
301
  export const RangeCalendarContext: React.Context<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>;
302
+ export const CalendarStateContext: React.Context<CalendarState>;
303
+ export const RangeCalendarStateContext: React.Context<RangeCalendarState>;
415
304
  /**
416
305
  * A calendar displays one or more date grids and allows users to select a single date.
417
306
  */
@@ -638,6 +527,7 @@ export interface CheckboxRenderProps {
638
527
  isRequired: boolean;
639
528
  }
640
529
  export const CheckboxGroupContext: React.Context<ContextValue<CheckboxGroupProps, HTMLDivElement>>;
530
+ export const CheckboxGroupStateContext: React.Context<CheckboxGroupState>;
641
531
  export const CheckboxContext: React.Context<ContextValue<CheckboxProps, HTMLInputElement>>;
642
532
  /**
643
533
  * A checkbox allows a user to select multiple items from a list of individual items, or
@@ -746,6 +636,12 @@ interface DropIndicatorContextValue {
746
636
  * A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.
747
637
  */
748
638
  export const DropIndicator: React.ForwardRefExoticComponent<DropIndicatorProps & React.RefAttributes<HTMLElement>>;
639
+ interface DragAndDropContextValue {
640
+ dragAndDropHooks?: DragAndDropHooks;
641
+ dragState?: DraggableCollectionState;
642
+ dropState?: DroppableCollectionState;
643
+ }
644
+ export const DragAndDropContext: React.Context<DragAndDropContextValue>;
749
645
  export const Header: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
750
646
  export interface SeparatorProps extends _SeparatorProps1, StyleProps, SlotProps {
751
647
  }
@@ -801,15 +697,12 @@ export interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' |
801
697
  */
802
698
  orientation?: Orientation;
803
699
  }
804
- interface ListBoxContextValue<T> extends ListBoxProps<T> {
805
- state?: ListState<T>;
806
- document?: Document<any, any>;
807
- }
808
- export const ListBoxContext: React.Context<ContextValue<ListBoxContextValue<any>, HTMLDivElement>>;
700
+ export const ListBoxContext: React.Context<ContextValue<ListBoxProps<any>, HTMLDivElement>>;
701
+ export const ListStateContext: React.Context<ListState<any>>;
809
702
  /**
810
703
  * A listbox displays a list of options and allows a user to select one or more of them.
811
704
  */
812
- export const ListBox: <T>(props: ListBoxProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
705
+ export const ListBox: <T extends object>(props: ListBoxProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
813
706
  export interface OverlayArrowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'children'>, RenderProps<OverlayArrowRenderProps> {
814
707
  }
815
708
  export interface OverlayArrowRenderProps {
@@ -850,15 +743,31 @@ export interface PopoverRenderProps {
850
743
  */
851
744
  isExiting: boolean;
852
745
  }
853
- interface PopoverContextValue extends PopoverProps {
854
- state?: OverlayTriggerState;
855
- triggerRef?: RefObject<Element>;
856
- }
857
- export const PopoverContext: React.Context<ContextValue<PopoverContextValue, HTMLElement>>;
746
+ export const PopoverContext: React.Context<ContextValue<PopoverProps, HTMLElement>>;
858
747
  /**
859
748
  * A popover is an overlay element positioned relative to a trigger.
860
749
  */
861
750
  export const Popover: (props: PopoverProps & React.RefAttributes<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
751
+ export interface DialogTriggerProps extends OverlayTriggerProps {
752
+ children: ReactNode;
753
+ }
754
+ interface DialogRenderProps {
755
+ close: () => void;
756
+ }
757
+ export interface DialogProps extends AriaDialogProps, StyleProps, SlotProps {
758
+ /** Children of the dialog. A function may be provided to access a function to close the dialog. */
759
+ children?: ReactNode | ((opts: DialogRenderProps) => ReactNode);
760
+ }
761
+ export const DialogContext: React.Context<ContextValue<DialogProps, HTMLElement>>;
762
+ export const OverlayTriggerStateContext: React.Context<OverlayTriggerState>;
763
+ /**
764
+ * A DialogTrigger opens a dialog when a trigger element is pressed.
765
+ */
766
+ export function DialogTrigger(props: DialogTriggerProps): React.JSX.Element;
767
+ /**
768
+ * A dialog is an overlay shown above other content in an application.
769
+ */
770
+ export const Dialog: (props: DialogProps & React.RefAttributes<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
862
771
  export interface ComboBoxRenderProps {
863
772
  /**
864
773
  * Whether the combobox is currently open.
@@ -892,10 +801,57 @@ export interface ComboBoxProps<T extends object> extends Omit<AriaComboBoxProps<
892
801
  formValue?: 'text' | 'key';
893
802
  }
894
803
  export const ComboBoxContext: React.Context<ContextValue<ComboBoxProps<any>, HTMLDivElement>>;
804
+ export const ComboBoxStateContext: React.Context<ComboBoxState<any>>;
895
805
  /**
896
806
  * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.
897
807
  */
898
808
  export const ComboBox: <T extends object>(props: ComboBoxProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
809
+ export interface GroupRenderProps {
810
+ /**
811
+ * Whether the group is currently hovered with a mouse.
812
+ * @selector [data-hovered]
813
+ */
814
+ isHovered: boolean;
815
+ /**
816
+ * Whether an element within the group is focused, either via a mouse or keyboard.
817
+ * @selector [data-focus-within]
818
+ */
819
+ isFocusWithin: boolean;
820
+ /**
821
+ * Whether an element within the group is keyboard focused.
822
+ * @selector [data-focus-visible]
823
+ */
824
+ isFocusVisible: boolean;
825
+ /**
826
+ * Whether the group is disabled.
827
+ * @selector [data-disabled]
828
+ */
829
+ isDisabled: boolean;
830
+ /**
831
+ * Whether the group is invalid.
832
+ * @selector [data-invalid]
833
+ */
834
+ isInvalid: boolean;
835
+ }
836
+ export interface GroupProps extends AriaLabelingProps, Omit<HTMLAttributes<HTMLElement>, 'className' | 'style' | 'role'>, StyleRenderProps<GroupRenderProps> {
837
+ /** Whether the group is disabled. */
838
+ isDisabled?: boolean;
839
+ /** Whether the group is invalid. */
840
+ isInvalid?: boolean;
841
+ /**
842
+ * An accessibility role for the group. By default, this is set to `'group'`.
843
+ * Use `'region'` when the contents of the group is important enough to be
844
+ * included in the page table of contents. Use `'presentation'` if the group
845
+ * is visual only and does not represent a semantic grouping of controls.
846
+ * @default 'group'
847
+ */
848
+ role?: 'group' | 'region' | 'presentation';
849
+ }
850
+ export const GroupContext: React.Context<ContextValue<GroupProps, HTMLDivElement>>;
851
+ /**
852
+ * A group represents a set of related UI controls, and supports interactive states for styling.
853
+ */
854
+ export const Group: React.ForwardRefExoticComponent<GroupProps & React.RefAttributes<HTMLDivElement>>;
899
855
  export interface DateFieldRenderProps {
900
856
  /**
901
857
  * State of the date field.
@@ -918,6 +874,8 @@ export interface TimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldP
918
874
  }
919
875
  export const DateFieldContext: React.Context<ContextValue<DateFieldProps<any>, HTMLDivElement>>;
920
876
  export const TimeFieldContext: React.Context<ContextValue<TimeFieldProps<any>, HTMLDivElement>>;
877
+ export const DateFieldStateContext: React.Context<DateFieldState>;
878
+ export const TimeFieldStateContext: React.Context<TimeFieldState>;
921
879
  /**
922
880
  * A date field allows users to enter and edit date and time values using a keyboard.
923
881
  * Each part of a date value is displayed in an individually editable segment.
@@ -958,6 +916,21 @@ export interface DateInputProps extends SlotProps, StyleRenderProps<DateInputRen
958
916
  */
959
917
  export const DateInput: (props: DateInputProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
960
918
  export interface DateSegmentRenderProps extends Omit<_DateSegment1, 'isEditable'> {
919
+ /**
920
+ * Whether the segment is currently hovered with a mouse.
921
+ * @selector [data-hovered]
922
+ */
923
+ isHovered: boolean;
924
+ /**
925
+ * Whether the segment is focused, either via a mouse or keyboard.
926
+ * @selector [data-focused]
927
+ */
928
+ isFocused: boolean;
929
+ /**
930
+ * Whether the segment is keyboard focused.
931
+ * @selector [data-focus-visible]
932
+ */
933
+ isFocusVisible: boolean;
961
934
  /**
962
935
  * Whether the value is a placeholder.
963
936
  * @selector [data-placeholder]
@@ -987,79 +960,6 @@ export interface DateSegmentProps extends RenderProps<DateSegmentRenderProps> {
987
960
  * the value by typing or using the arrow keys to increment and decrement.
988
961
  */
989
962
  export const DateSegment: (props: DateSegmentProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
990
- export interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {
991
- }
992
- interface ModalContextValue extends ModalOverlayProps {
993
- state?: OverlayTriggerState;
994
- }
995
- export const ModalContext: React.Context<ContextValue<ModalContextValue, HTMLDivElement>>;
996
- export interface ModalRenderProps {
997
- /**
998
- * Whether the modal is currently entering. Use this to apply animations.
999
- * @selector [data-entering]
1000
- */
1001
- isEntering: boolean;
1002
- /**
1003
- * Whether the modal is currently exiting. Use this to apply animations.
1004
- * @selector [data-exiting]
1005
- */
1006
- isExiting: boolean;
1007
- /**
1008
- * State of the modal.
1009
- */
1010
- state: OverlayTriggerState;
1011
- }
1012
- /**
1013
- * A modal is an overlay element which blocks interaction with elements outside it.
1014
- */
1015
- export const Modal: (props: ModalOverlayProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1016
- /**
1017
- * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.
1018
- */
1019
- export const ModalOverlay: (props: ModalOverlayProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1020
- export interface DialogTriggerProps extends OverlayTriggerProps {
1021
- children: ReactNode;
1022
- }
1023
- interface DialogRenderProps {
1024
- close: () => void;
1025
- }
1026
- export interface DialogProps extends AriaDialogProps, StyleProps, SlotProps {
1027
- children?: ReactNode | ((opts: DialogRenderProps) => ReactNode);
1028
- onClose?: () => void;
1029
- }
1030
- export const DialogContext: React.Context<ContextValue<DialogProps, HTMLElement>>;
1031
- /**
1032
- * A DialogTrigger opens a dialog when a trigger element is pressed.
1033
- */
1034
- export function DialogTrigger(props: DialogTriggerProps): React.JSX.Element;
1035
- /**
1036
- * A dialog is an overlay shown above other content in an application.
1037
- */
1038
- export const Dialog: (props: DialogProps & React.RefAttributes<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1039
- export interface GroupRenderProps {
1040
- /**
1041
- * Whether the group is currently hovered with a mouse.
1042
- * @selector [data-hovered]
1043
- */
1044
- isHovered: boolean;
1045
- /**
1046
- * Whether an element within the group is focused, either via a mouse or keyboard.
1047
- * @selector [data-focus-within]
1048
- */
1049
- isFocusWithin: boolean;
1050
- /**
1051
- * Whether an element within the group is keyboard focused.
1052
- * @selector [data-focus-visible]
1053
- */
1054
- isFocusVisible: boolean;
1055
- }
1056
- export interface GroupProps extends Omit<HTMLAttributes<HTMLElement>, 'className' | 'style'>, StyleRenderProps<GroupRenderProps> {
1057
- }
1058
- export const GroupContext: React.Context<ContextValue<GroupProps, HTMLDivElement>>;
1059
- /**
1060
- * An group represents a set of related UI controls.
1061
- */
1062
- export const Group: React.ForwardRefExoticComponent<GroupProps & React.RefAttributes<HTMLDivElement>>;
1063
963
  export interface DatePickerRenderProps {
1064
964
  /**
1065
965
  * Whether an element within the date picker is focused, either via a mouse or keyboard.
@@ -1081,6 +981,11 @@ export interface DatePickerRenderProps {
1081
981
  * @selector [data-disabled]
1082
982
  */
1083
983
  isInvalid: boolean;
984
+ /**
985
+ * Whether the date picker's popover is currently open.
986
+ * @selector [data-open]
987
+ */
988
+ isOpen: boolean;
1084
989
  /**
1085
990
  * State of the date picker.
1086
991
  */
@@ -1098,6 +1003,8 @@ export interface DateRangePickerProps<T extends DateValue> extends Omit<AriaDate
1098
1003
  }
1099
1004
  export const DatePickerContext: React.Context<ContextValue<DatePickerProps<any>, HTMLDivElement>>;
1100
1005
  export const DateRangePickerContext: React.Context<ContextValue<DateRangePickerProps<any>, HTMLDivElement>>;
1006
+ export const DatePickerStateContext: React.Context<DatePickerState>;
1007
+ export const DateRangePickerStateContext: React.Context<DateRangePickerState>;
1101
1008
  /**
1102
1009
  * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.
1103
1010
  */
@@ -1152,11 +1059,7 @@ export interface FileTriggerProps {
1152
1059
  /**
1153
1060
  * Handler when a user selects a file.
1154
1061
  */
1155
- onChange?: (files: FileList | null) => void;
1156
- /**
1157
- * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname).
1158
- */
1159
- name?: string;
1062
+ onSelect?: (files: FileList | null) => void;
1160
1063
  /**
1161
1064
  * The children of the component.
1162
1065
  */
@@ -1209,6 +1112,7 @@ export const GridList: <T extends object>(props: GridListProps<T> & React.RefAtt
1209
1112
  export const KeyboardContext: React.Context<ContextValue<React.HTMLAttributes<HTMLElement>, HTMLElement>>;
1210
1113
  export const Keyboard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
1211
1114
  export const MenuContext: React.Context<ContextValue<MenuProps<any>, HTMLDivElement>>;
1115
+ export const MenuStateContext: React.Context<TreeState<unknown>>;
1212
1116
  export interface MenuTriggerProps extends _MenuTriggerProps1 {
1213
1117
  children?: ReactNode;
1214
1118
  }
@@ -1237,6 +1141,33 @@ export const MeterContext: React.Context<ContextValue<MeterProps, HTMLDivElement
1237
1141
  * A meter represents a quantity within a known range, or a fractional value.
1238
1142
  */
1239
1143
  export const Meter: (props: MeterProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1144
+ export interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps<ModalRenderProps>, SlotProps {
1145
+ }
1146
+ export const ModalContext: React.Context<ContextValue<ModalOverlayProps, HTMLDivElement>>;
1147
+ export interface ModalRenderProps {
1148
+ /**
1149
+ * Whether the modal is currently entering. Use this to apply animations.
1150
+ * @selector [data-entering]
1151
+ */
1152
+ isEntering: boolean;
1153
+ /**
1154
+ * Whether the modal is currently exiting. Use this to apply animations.
1155
+ * @selector [data-exiting]
1156
+ */
1157
+ isExiting: boolean;
1158
+ /**
1159
+ * State of the modal.
1160
+ */
1161
+ state: OverlayTriggerState;
1162
+ }
1163
+ /**
1164
+ * A modal is an overlay element which blocks interaction with elements outside it.
1165
+ */
1166
+ export const Modal: (props: ModalOverlayProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1167
+ /**
1168
+ * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element.
1169
+ */
1170
+ export const ModalOverlay: (props: ModalOverlayProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1240
1171
  export interface NumberFieldRenderProps {
1241
1172
  /**
1242
1173
  * Whether the number field is disabled.
@@ -1256,6 +1187,7 @@ export interface NumberFieldRenderProps {
1256
1187
  export interface NumberFieldProps extends Omit<AriaNumberFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState'>, InputDOMProps, RenderProps<NumberFieldRenderProps>, SlotProps {
1257
1188
  }
1258
1189
  export const NumberFieldContext: React.Context<ContextValue<NumberFieldProps, HTMLDivElement>>;
1190
+ export const NumberFieldStateContext: React.Context<NumberFieldState>;
1259
1191
  /**
1260
1192
  * A number field allows a user to enter a number, and increment or decrement the value using stepper buttons.
1261
1193
  */
@@ -1368,6 +1300,7 @@ export interface RadioRenderProps {
1368
1300
  }
1369
1301
  export const RadioGroupContext: React.Context<ContextValue<RadioGroupProps, HTMLDivElement>>;
1370
1302
  export const RadioContext: React.Context<ContextValue<Partial<RadioProps>, HTMLInputElement>>;
1303
+ export const RadioGroupStateContext: React.Context<RadioGroupState>;
1371
1304
  /**
1372
1305
  * A radio group allows a user to select a single item from a list of mutually exclusive options.
1373
1306
  */
@@ -1439,6 +1372,7 @@ export interface SelectRenderProps {
1439
1372
  export interface SelectProps<T extends object> extends Omit<AriaSelectProps<T>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'items'>, RenderProps<SelectRenderProps>, SlotProps {
1440
1373
  }
1441
1374
  export const SelectContext: React.Context<ContextValue<SelectProps<any>, HTMLDivElement>>;
1375
+ export const SelectStateContext: React.Context<SelectState<unknown>>;
1442
1376
  /**
1443
1377
  * A select displays a collapsible list of options and allows a user to select one of them.
1444
1378
  */
@@ -1456,6 +1390,7 @@ export interface SelectValueRenderProps<T> {
1456
1390
  }
1457
1391
  export interface SelectValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<SelectValueRenderProps<T>> {
1458
1392
  }
1393
+ export const SelectValueContext: React.Context<ContextValue<SelectValueProps<any>, HTMLSpanElement>>;
1459
1394
  /**
1460
1395
  * SelectValue renders the current value of a Select, or a placeholder if no value is selected.
1461
1396
  * It is usually placed within the button element.
@@ -1468,6 +1403,9 @@ export interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps
1468
1403
  formatOptions?: Intl.NumberFormatOptions;
1469
1404
  }
1470
1405
  export const SliderContext: React.Context<ContextValue<SliderProps<number | number[]>, HTMLDivElement>>;
1406
+ export const SliderStateContext: React.Context<SliderState>;
1407
+ export const SliderTrackContext: React.Context<ContextValue<SliderTrackContextValue, HTMLDivElement>>;
1408
+ export const SliderOutputContext: React.Context<ContextValue<SliderOutputContextValue, HTMLOutputElement>>;
1471
1409
  export interface SliderRenderProps {
1472
1410
  /**
1473
1411
  * The orientation of the slider.
@@ -1490,6 +1428,8 @@ export interface SliderRenderProps {
1490
1428
  export const Slider: <T extends number | number[]>(props: SliderProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1491
1429
  export interface SliderOutputProps extends RenderProps<SliderRenderProps> {
1492
1430
  }
1431
+ interface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {
1432
+ }
1493
1433
  /**
1494
1434
  * A slider output displays the current value of a slider as text.
1495
1435
  */
@@ -1503,6 +1443,8 @@ export interface SliderTrackRenderProps extends SliderRenderProps {
1503
1443
  }
1504
1444
  export interface SliderTrackProps extends RenderProps<SliderTrackRenderProps> {
1505
1445
  }
1446
+ interface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'style'>, SliderTrackProps {
1447
+ }
1506
1448
  /**
1507
1449
  * A slider track is a container for one or more slider thumbs.
1508
1450
  */
@@ -1611,6 +1553,8 @@ export interface ResizableTableContainerProps extends DOMProps {
1611
1553
  }
1612
1554
  export const ResizableTableContainer: React.ForwardRefExoticComponent<ResizableTableContainerProps & React.RefAttributes<HTMLDivElement>>;
1613
1555
  export const TableContext: React.Context<ContextValue<TableProps, HTMLTableElement>>;
1556
+ export const TableStateContext: React.Context<TableState<unknown>>;
1557
+ export const TableColumnResizeStateContext: React.Context<TableColumnResizeState<unknown>>;
1614
1558
  export interface TableRenderProps {
1615
1559
  /**
1616
1560
  * Whether the table is currently focused.
@@ -1763,7 +1707,7 @@ export interface TableBodyProps<T> extends CollectionProps<T>, StyleRenderProps<
1763
1707
  export const TableBody: <T extends object>(props: TableBodyProps<T> & React.RefAttributes<HTMLTableSectionElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
1764
1708
  export interface RowRenderProps extends ItemRenderProps {
1765
1709
  }
1766
- export interface RowProps<T> extends StyleRenderProps<RowRenderProps> {
1710
+ export interface RowProps<T> extends StyleRenderProps<RowRenderProps>, LinkDOMProps {
1767
1711
  id?: Key;
1768
1712
  /** A list of columns used when dynamically rendering cells. */
1769
1713
  columns?: Iterable<T>;
@@ -1861,7 +1805,7 @@ export interface TabListRenderProps {
1861
1805
  */
1862
1806
  state: TabListState<unknown>;
1863
1807
  }
1864
- export interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps {
1808
+ export interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps, LinkDOMProps {
1865
1809
  id?: Key;
1866
1810
  }
1867
1811
  export interface TabRenderProps {
@@ -1927,6 +1871,7 @@ export interface TabPanelRenderProps {
1927
1871
  state: TabListState<unknown>;
1928
1872
  }
1929
1873
  export const TabsContext: React.Context<ContextValue<TabsProps, HTMLDivElement>>;
1874
+ export const TabListStateContext: React.Context<TabListState<object>>;
1930
1875
  /**
1931
1876
  * Tabs organize content into multiple sections and allow users to navigate between them.
1932
1877
  */
@@ -1968,6 +1913,7 @@ export interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'
1968
1913
  renderEmptyState?: () => ReactNode;
1969
1914
  }
1970
1915
  export const TagGroupContext: React.Context<ContextValue<TagGroupProps, HTMLDivElement>>;
1916
+ export const TagListContext: React.Context<ContextValue<TagListProps<any>, HTMLDivElement>>;
1971
1917
  /**
1972
1918
  * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.
1973
1919
  */
@@ -1983,7 +1929,7 @@ export interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' |
1983
1929
  */
1984
1930
  allowsRemoving: boolean;
1985
1931
  }
1986
- export interface TagProps extends RenderProps<TagRenderProps> {
1932
+ export interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps {
1987
1933
  /** A unique id for the tag. */
1988
1934
  id?: Key;
1989
1935
  /**
@@ -2045,7 +1991,13 @@ export const ToggleButton: (props: ToggleButtonProps & React.RefAttributes<HTMLB
2045
1991
  export interface TooltipTriggerComponentProps extends TooltipTriggerProps {
2046
1992
  children: ReactNode;
2047
1993
  }
2048
- export interface TooltipProps extends PositionProps, AriaLabelingProps, RenderProps<TooltipRenderProps> {
1994
+ export interface TooltipProps extends PositionProps, OverlayTriggerProps, AriaLabelingProps, RenderProps<TooltipRenderProps> {
1995
+ /**
1996
+ * The ref for the element which the tooltip positions itself with respect to.
1997
+ *
1998
+ * When used within a TooltipTrigger this is set automatically. It is only required when used standalone.
1999
+ */
2000
+ triggerRef?: RefObject<Element>;
2049
2001
  }
2050
2002
  export interface TooltipRenderProps {
2051
2003
  /**
@@ -2068,6 +2020,8 @@ export interface TooltipRenderProps {
2068
2020
  */
2069
2021
  state: TooltipTriggerState;
2070
2022
  }
2023
+ export const TooltipTriggerStateContext: React.Context<TooltipTriggerState>;
2024
+ export const TooltipContext: React.Context<ContextValue<TooltipProps, HTMLDivElement>>;
2071
2025
  /**
2072
2026
  * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing
2073
2027
  * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip
@@ -2078,7 +2032,7 @@ export function TooltipTrigger(props: TooltipTriggerComponentProps): React.JSX.E
2078
2032
  * A tooltip displays a description of an element on hover or focus.
2079
2033
  */
2080
2034
  export const Tooltip: (props: TooltipProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
2081
- export { DIRECTORY_DRAG_TYPE, isDirectoryDropItem, isFileDropItem, isTextDropItem, SSRProvider } from 'react-aria';
2035
+ export { DIRECTORY_DRAG_TYPE, isDirectoryDropItem, isFileDropItem, isTextDropItem, SSRProvider, RouterProvider, I18nProvider } from 'react-aria';
2082
2036
  export type { DateValue, DateRange, TimeValue } from 'react-aria';
2083
2037
  export type { DirectoryDropItem, DraggableCollectionEndEvent, DraggableCollectionMoveEvent, DraggableCollectionStartEvent, DragPreviewRenderer, DragTypes, DropItem, DropOperation, DroppableCollectionDropEvent, DroppableCollectionEnterEvent, DroppableCollectionExitEvent, DroppableCollectionInsertDropEvent, DroppableCollectionMoveEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, DropPosition, DropTarget, FileDropItem, ItemDropTarget, RootDropTarget, TextDropItem, PressEvent } from 'react-aria';
2084
2038
  export type { Selection, SortDescriptor, SortDirection, SelectionMode } from 'react-stately';