react-aria-components 1.11.0 → 1.12.0

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.
Files changed (108) hide show
  1. package/dist/Autocomplete.main.js +7 -20
  2. package/dist/Autocomplete.main.js.map +1 -1
  3. package/dist/Autocomplete.mjs +8 -20
  4. package/dist/Autocomplete.module.js +8 -20
  5. package/dist/Autocomplete.module.js.map +1 -1
  6. package/dist/Breadcrumbs.main.js +4 -1
  7. package/dist/Breadcrumbs.main.js.map +1 -1
  8. package/dist/Breadcrumbs.mjs +5 -2
  9. package/dist/Breadcrumbs.module.js +5 -2
  10. package/dist/Breadcrumbs.module.js.map +1 -1
  11. package/dist/GridList.main.js +96 -15
  12. package/dist/GridList.main.js.map +1 -1
  13. package/dist/GridList.mjs +98 -19
  14. package/dist/GridList.module.js +98 -19
  15. package/dist/GridList.module.js.map +1 -1
  16. package/dist/Header.main.js +1 -1
  17. package/dist/Header.main.js.map +1 -1
  18. package/dist/Header.mjs +2 -2
  19. package/dist/Header.module.js +2 -2
  20. package/dist/Header.module.js.map +1 -1
  21. package/dist/ListBox.main.js +6 -18
  22. package/dist/ListBox.main.js.map +1 -1
  23. package/dist/ListBox.mjs +8 -20
  24. package/dist/ListBox.module.js +8 -20
  25. package/dist/ListBox.module.js.map +1 -1
  26. package/dist/Menu.main.js +29 -15
  27. package/dist/Menu.main.js.map +1 -1
  28. package/dist/Menu.mjs +31 -17
  29. package/dist/Menu.module.js +31 -17
  30. package/dist/Menu.module.js.map +1 -1
  31. package/dist/Popover.main.js +7 -11
  32. package/dist/Popover.main.js.map +1 -1
  33. package/dist/Popover.mjs +8 -12
  34. package/dist/Popover.module.js +8 -12
  35. package/dist/Popover.module.js.map +1 -1
  36. package/dist/SearchField.main.js +6 -4
  37. package/dist/SearchField.main.js.map +1 -1
  38. package/dist/SearchField.mjs +7 -5
  39. package/dist/SearchField.module.js +7 -5
  40. package/dist/SearchField.module.js.map +1 -1
  41. package/dist/Separator.main.js +13 -1
  42. package/dist/Separator.main.js.map +1 -1
  43. package/dist/Separator.mjs +15 -3
  44. package/dist/Separator.module.js +15 -3
  45. package/dist/Separator.module.js.map +1 -1
  46. package/dist/Table.main.js +58 -17
  47. package/dist/Table.main.js.map +1 -1
  48. package/dist/Table.mjs +60 -19
  49. package/dist/Table.module.js +60 -19
  50. package/dist/Table.module.js.map +1 -1
  51. package/dist/Tabs.main.js +4 -1
  52. package/dist/Tabs.main.js.map +1 -1
  53. package/dist/Tabs.mjs +5 -2
  54. package/dist/Tabs.module.js +5 -2
  55. package/dist/Tabs.module.js.map +1 -1
  56. package/dist/TagGroup.main.js +13 -4
  57. package/dist/TagGroup.main.js.map +1 -1
  58. package/dist/TagGroup.mjs +15 -6
  59. package/dist/TagGroup.module.js +15 -6
  60. package/dist/TagGroup.module.js.map +1 -1
  61. package/dist/TextField.main.js +7 -5
  62. package/dist/TextField.main.js.map +1 -1
  63. package/dist/TextField.mjs +8 -6
  64. package/dist/TextField.module.js +8 -6
  65. package/dist/TextField.module.js.map +1 -1
  66. package/dist/Tooltip.main.js +4 -11
  67. package/dist/Tooltip.main.js.map +1 -1
  68. package/dist/Tooltip.mjs +6 -13
  69. package/dist/Tooltip.module.js +6 -13
  70. package/dist/Tooltip.module.js.map +1 -1
  71. package/dist/Tree.main.js +9 -3
  72. package/dist/Tree.main.js.map +1 -1
  73. package/dist/Tree.mjs +10 -4
  74. package/dist/Tree.module.js +10 -4
  75. package/dist/Tree.module.js.map +1 -1
  76. package/dist/context.main.js +25 -0
  77. package/dist/context.main.js.map +1 -0
  78. package/dist/context.mjs +19 -0
  79. package/dist/context.module.js +19 -0
  80. package/dist/context.module.js.map +1 -0
  81. package/dist/import.mjs +3 -3
  82. package/dist/main.js +3 -0
  83. package/dist/main.js.map +1 -1
  84. package/dist/module.js +3 -3
  85. package/dist/module.js.map +1 -1
  86. package/dist/types.d.ts +178 -171
  87. package/dist/types.d.ts.map +1 -1
  88. package/dist/useDragAndDrop.main.js.map +1 -1
  89. package/dist/useDragAndDrop.module.js.map +1 -1
  90. package/package.json +23 -22
  91. package/src/Autocomplete.tsx +14 -25
  92. package/src/Breadcrumbs.tsx +6 -2
  93. package/src/GridList.tsx +89 -21
  94. package/src/Header.tsx +2 -2
  95. package/src/ListBox.tsx +12 -15
  96. package/src/Menu.tsx +37 -17
  97. package/src/Popover.tsx +11 -11
  98. package/src/SearchField.tsx +5 -4
  99. package/src/Separator.tsx +17 -2
  100. package/src/Table.tsx +65 -22
  101. package/src/Tabs.tsx +6 -2
  102. package/src/TagGroup.tsx +15 -6
  103. package/src/TextField.tsx +8 -7
  104. package/src/Tooltip.tsx +10 -14
  105. package/src/Tree.tsx +13 -5
  106. package/src/context.tsx +34 -0
  107. package/src/index.ts +2 -2
  108. package/src/useDragAndDrop.tsx +9 -9
package/dist/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { AriaLabelingProps, RefObject, DOMProps as _DOMProps1, GlobalDOMAttributes, ValidationResult, HoverEvents as _HoverEvents1, InputDOMProps, CollectionBase, DropTargetDelegate, ItemDropTarget, Key, LayoutDelegate, DraggableCollectionProps, DroppableCollectionProps, LinkDOMProps, PressEvents, ValueBase, MultipleSelection, Node as _Node1, Orientation as _Orientation2, DisabledBehavior as _DisabledBehavior1, Expandable, SelectionMode as _SelectionMode1 } from "@react-types/shared";
2
- import React, { Context, CSSProperties, ForwardedRef, JSX, ReactNode, HTMLAttributes, LabelHTMLAttributes, InputHTMLAttributes, OutputHTMLAttributes, TextareaHTMLAttributes, ReactElement } from "react";
2
+ import React, { Context, CSSProperties, ForwardedRef, JSX, ReactNode, HTMLAttributes, LabelHTMLAttributes, InputHTMLAttributes, OutputHTMLAttributes, ReactElement, TextareaHTMLAttributes } from "react";
3
3
  import { FormProps as _FormProps1 } from "@react-types/form";
4
- import { AriaCheckboxGroupProps, AriaCheckboxProps, HoverEvents, AriaColorAreaProps, HoverProps, AriaColorFieldProps, AriaSliderProps, AriaSliderThumbProps, Orientation, AriaColorSliderProps, AriaColorWheelOptions, AriaProgressBarProps, AriaButtonProps, AriaSearchFieldProps, AriaTextFieldProps, AriaLinkOptions, AriaBreadcrumbsProps, AriaCalendarProps, AriaRangeCalendarProps, DateValue, AriaColorSwatchProps, DropIndicatorProps as _DropIndicatorProps1, DraggableCollectionOptions, DraggableItemProps, DraggableItemResult, DragItem, DragPreview, DropIndicatorAria, DroppableCollectionOptions, DroppableCollectionResult, DroppableItemOptions, DroppableItemResult, DropTarget, DropTargetDelegate as _DropTargetDelegate1, ListDropTargetDelegate, SeparatorProps as _SeparatorProps1, AriaListBoxProps, PlacementAxis, AriaPopoverProps, PositionProps, AriaMenuProps, AriaDialogProps, AriaComboBoxProps, AriaDateFieldProps, AriaTimeFieldProps, TimeValue, AriaDatePickerProps, AriaDateRangePickerProps, AriaDisclosureProps, DropOptions, AriaGridListProps, AriaMeterProps, AriaModalOverlayProps, AriaNumberFieldProps, AriaRadioGroupProps, AriaRadioProps, AriaSelectProps, AriaSwitchProps, AriaTabListProps, AriaTabPanelProps, AriaTagGroupProps, AriaToastProps, AriaToastRegionProps, AriaToggleButtonGroupProps, AriaToggleButtonProps, AriaPositionProps, Placement, AriaTreeItemOptions, AriaTreeProps } from "react-aria";
5
- import { CheckboxGroupState, Color, ColorAreaState, ColorChannel, ColorFieldState, ColorSpace, SliderState, ColorSliderState, ColorWheelState, SearchFieldState, Collection, Node, SelectionBehavior, SelectionMode, SectionProps as _SectionProps1, CalendarState, RangeCalendarState, DraggableCollectionState, DraggableCollectionStateOptions, DroppableCollectionState, DroppableCollectionStateOptions, ListState, Orientation as _Orientation1, ColorPickerState, ColorPickerProps as _ColorPickerProps1, OverlayTriggerProps, MenuTriggerProps as _MenuTriggerProps1, RootMenuTriggerState, TreeState, OverlayTriggerState, ComboBoxState, DateFieldState, DateSegmentType, DateSegment as _DateSegment1, TimeFieldState, DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, DisclosureGroupState, DisclosureState, DisclosureGroupProps as _DisclosureGroupProps1, NumberFieldState, RadioGroupState, SelectState, ToggleState, DisabledBehavior, SortDirection, TableState, TabListState, QueuedToast, ToastQueue, ToastState, ToggleGroupState, TooltipTriggerProps, TooltipTriggerState } from "react-stately";
4
+ import { AriaCheckboxGroupProps, AriaCheckboxProps, HoverEvents, AriaColorAreaProps, HoverProps, AriaColorFieldProps, AriaSliderProps, AriaSliderThumbProps, Orientation, AriaColorSliderProps, AriaColorWheelOptions, AriaLinkOptions, AriaBreadcrumbsProps, AriaProgressBarProps, AriaButtonProps, AriaCalendarProps, AriaRangeCalendarProps, DateValue, AriaColorSwatchProps, DropIndicatorProps as _DropIndicatorProps1, DraggableCollectionOptions, DraggableItemProps, DraggableItemResult, DragItem, DragPreview, DropIndicatorAria, DroppableCollectionOptions, DroppableCollectionResult, DroppableItemOptions, DroppableItemResult, DropTarget, DropTargetDelegate as _DropTargetDelegate1, ListDropTargetDelegate, SeparatorProps as _SeparatorProps1, AriaListBoxProps, PlacementAxis, AriaPopoverProps, PositionProps, AriaMenuProps, AriaDialogProps, AriaComboBoxProps, AriaDateFieldProps, AriaTimeFieldProps, TimeValue, AriaDatePickerProps, AriaDateRangePickerProps, AriaDisclosureProps, DropOptions, AriaGridListProps, AriaMeterProps, AriaModalOverlayProps, AriaNumberFieldProps, AriaRadioGroupProps, AriaRadioProps, AriaSearchFieldProps, AriaSelectProps, AriaSwitchProps, AriaTabListProps, AriaTabPanelProps, AriaTagGroupProps, AriaTextFieldProps, AriaToastProps, AriaToastRegionProps, AriaToggleButtonGroupProps, AriaToggleButtonProps, AriaPositionProps, Placement, AriaTreeItemOptions, AriaTreeProps } from "react-aria";
5
+ import { CheckboxGroupState, Color, ColorAreaState, ColorChannel, ColorFieldState, ColorSpace, SliderState, ColorSliderState, ColorWheelState, Collection, Node, SelectionBehavior, SelectionMode, SectionProps as _SectionProps1, CalendarState, RangeCalendarState, DraggableCollectionState, DraggableCollectionStateOptions, DroppableCollectionState, DroppableCollectionStateOptions, ListState, Orientation as _Orientation1, ColorPickerState, ColorPickerProps as _ColorPickerProps1, OverlayTriggerProps, MenuTriggerProps as _MenuTriggerProps1, RootMenuTriggerState, TreeState, OverlayTriggerState, ComboBoxState, DateFieldState, DateSegmentType, DateSegment as _DateSegment1, TimeFieldState, DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, DisclosureGroupState, DisclosureState, DisclosureGroupProps as _DisclosureGroupProps1, NumberFieldState, RadioGroupState, SearchFieldState, SelectState, ToggleState, DisabledBehavior, SortDirection, TableState, TabListState, QueuedToast, ToastQueue, ToastState, ToggleGroupState, TooltipTriggerProps, TooltipTriggerState } from "react-stately";
6
6
  import { AriaAutocompleteProps } from "@react-aria/autocomplete";
7
7
  import { AutocompleteState } from "@react-stately/autocomplete";
8
8
  import { CalendarDate, CalendarIdentifier, DateDuration, Calendar as _Calendar1 } from "@internationalized/date";
@@ -553,151 +553,14 @@ export const ColorFieldContext: Context<ContextValue<ColorFieldProps, HTMLDivEle
553
553
  export const ColorSliderContext: Context<ContextValue<Partial<ColorSliderProps>, HTMLDivElement>>;
554
554
  export const ColorWheelContext: Context<ContextValue<Partial<ColorWheelProps>, HTMLDivElement>>;
555
555
  export const HeadingContext: Context<ContextValue<HeadingProps, HTMLHeadingElement>>;
556
- export interface ProgressBarProps extends Omit<AriaProgressBarProps, 'label'>, RenderProps<ProgressBarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
557
- }
558
- export interface ProgressBarRenderProps {
559
- /**
560
- * The value as a percentage between the minimum and maximum.
561
- */
562
- percentage?: number;
563
- /**
564
- * A formatted version of the value.
565
- * @selector [aria-valuetext]
566
- */
567
- valueText: string | undefined;
568
- /**
569
- * Whether the progress bar is indeterminate.
570
- * @selector :not([aria-valuenow])
571
- */
572
- isIndeterminate: boolean;
573
- }
574
- export const ProgressBarContext: React.Context<ContextValue<ProgressBarProps, HTMLDivElement>>;
575
- /**
576
- * Progress bars show either determinate or indeterminate progress of an operation
577
- * over time.
578
- */
579
- export const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
580
- export interface ButtonRenderProps {
581
- /**
582
- * Whether the button is currently hovered with a mouse.
583
- * @selector [data-hovered]
584
- */
585
- isHovered: boolean;
586
- /**
587
- * Whether the button is currently in a pressed state.
588
- * @selector [data-pressed]
589
- */
590
- isPressed: boolean;
591
- /**
592
- * Whether the button is focused, either via a mouse or keyboard.
593
- * @selector [data-focused]
594
- */
595
- isFocused: boolean;
596
- /**
597
- * Whether the button is keyboard focused.
598
- * @selector [data-focus-visible]
599
- */
600
- isFocusVisible: boolean;
601
- /**
602
- * Whether the button is disabled.
603
- * @selector [data-disabled]
604
- */
605
- isDisabled: boolean;
606
- /**
607
- * Whether the button is currently in a pending state.
608
- * @selector [data-pending]
609
- */
610
- isPending: boolean;
611
- }
612
- export interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {
613
- /**
614
- * Whether the button is in a pending state. This disables press and hover events
615
- * while retaining focusability, and announces the pending state to screen readers.
616
- */
617
- isPending?: boolean;
618
- }
619
- interface ButtonContextValue extends ButtonProps {
620
- isPressed?: boolean;
621
- }
622
- export const ButtonContext: React.Context<ContextValue<ButtonContextValue, HTMLButtonElement>>;
623
- /**
624
- * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.
625
- */
626
- export const Button: (props: ButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
627
- export interface SearchFieldRenderProps {
628
- /**
629
- * Whether the search field is empty.
630
- * @selector [data-empty]
631
- */
632
- isEmpty: boolean;
633
- /**
634
- * Whether the search field is disabled.
635
- * @selector [data-disabled]
636
- */
637
- isDisabled: boolean;
638
- /**
639
- * Whether the search field is invalid.
640
- * @selector [data-invalid]
641
- */
642
- isInvalid: boolean;
643
- /**
644
- * State of the search field.
645
- */
646
- state: SearchFieldState;
647
- }
648
- export interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<SearchFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
649
- }
650
- export const SearchFieldContext: React.Context<ContextValue<SearchFieldProps, HTMLDivElement>>;
651
- /**
652
- * A search field allows a user to enter and clear a search query.
653
- */
654
- export const SearchField: (props: SearchFieldProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
655
- export interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {
656
- }
657
- export const TextAreaContext: React.Context<ContextValue<TextAreaProps, HTMLTextAreaElement>>;
658
- /**
659
- * A textarea allows a user to input mult-line text.
660
- */
661
- export const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
662
- export interface TextFieldRenderProps {
663
- /**
664
- * Whether the text field is disabled.
665
- * @selector [data-disabled]
666
- */
667
- isDisabled: boolean;
668
- /**
669
- * Whether the value is invalid.
670
- * @selector [data-invalid]
671
- */
672
- isInvalid: boolean;
673
- /**
674
- * Whether the text field is read only.
675
- * @selector [data-readonly]
676
- */
677
- isReadOnly: boolean;
678
- /**
679
- * Whether the text field is required.
680
- * @selector [data-required]
681
- */
682
- isRequired: boolean;
556
+ export interface AutocompleteProps<T = object> extends AriaAutocompleteProps<T>, SlotProps {
683
557
  }
684
- export interface TextFieldProps extends Omit<AriaTextFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, Omit<DOMProps, 'style' | 'className' | 'children'>, SlotProps, RenderProps<TextFieldRenderProps>, GlobalDOMAttributes<HTMLDivElement> {
685
- /** Whether the value is invalid. */
686
- isInvalid?: boolean;
687
- }
688
- export const TextFieldContext: React.Context<ContextValue<TextFieldProps, HTMLDivElement>>;
689
- /**
690
- * A text field allows a user to enter a plain text value with a keyboard.
691
- */
692
- export const TextField: (props: TextFieldProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
693
- export interface AutocompleteProps extends AriaAutocompleteProps, SlotProps {
694
- }
695
- export const AutocompleteContext: React.Context<SlottedContextValue<Partial<AutocompleteProps>>>;
558
+ export const AutocompleteContext: React.Context<SlottedContextValue<Partial<AutocompleteProps<any>>>>;
696
559
  export const AutocompleteStateContext: React.Context<AutocompleteState | null>;
697
560
  /**
698
561
  * An autocomplete combines a TextField or SearchField with a Menu or ListBox, allowing users to search or filter a list of suggestions.
699
562
  */
700
- export function Autocomplete(props: AutocompleteProps): JSX.Element;
563
+ export function Autocomplete<T extends object>(props: AutocompleteProps<T>): JSX.Element;
701
564
  interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'> {
702
565
  /** The contents of the collection. */
703
566
  children?: ReactNode | ((item: T) => ReactNode);
@@ -876,7 +739,78 @@ export interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps>, Glo
876
739
  /**
877
740
  * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.
878
741
  */
879
- export const Breadcrumb: (props: BreadcrumbProps & React.RefAttributes<HTMLLIElement>) => React.ReactElement | null;
742
+ export const Breadcrumb: (props: BreadcrumbProps & React.RefAttributes<object>) => React.ReactElement | null;
743
+ export interface ProgressBarProps extends Omit<AriaProgressBarProps, 'label'>, RenderProps<ProgressBarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
744
+ }
745
+ export interface ProgressBarRenderProps {
746
+ /**
747
+ * The value as a percentage between the minimum and maximum.
748
+ */
749
+ percentage?: number;
750
+ /**
751
+ * A formatted version of the value.
752
+ * @selector [aria-valuetext]
753
+ */
754
+ valueText: string | undefined;
755
+ /**
756
+ * Whether the progress bar is indeterminate.
757
+ * @selector :not([aria-valuenow])
758
+ */
759
+ isIndeterminate: boolean;
760
+ }
761
+ export const ProgressBarContext: React.Context<ContextValue<ProgressBarProps, HTMLDivElement>>;
762
+ /**
763
+ * Progress bars show either determinate or indeterminate progress of an operation
764
+ * over time.
765
+ */
766
+ export const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
767
+ export interface ButtonRenderProps {
768
+ /**
769
+ * Whether the button is currently hovered with a mouse.
770
+ * @selector [data-hovered]
771
+ */
772
+ isHovered: boolean;
773
+ /**
774
+ * Whether the button is currently in a pressed state.
775
+ * @selector [data-pressed]
776
+ */
777
+ isPressed: boolean;
778
+ /**
779
+ * Whether the button is focused, either via a mouse or keyboard.
780
+ * @selector [data-focused]
781
+ */
782
+ isFocused: boolean;
783
+ /**
784
+ * Whether the button is keyboard focused.
785
+ * @selector [data-focus-visible]
786
+ */
787
+ isFocusVisible: boolean;
788
+ /**
789
+ * Whether the button is disabled.
790
+ * @selector [data-disabled]
791
+ */
792
+ isDisabled: boolean;
793
+ /**
794
+ * Whether the button is currently in a pending state.
795
+ * @selector [data-pending]
796
+ */
797
+ isPending: boolean;
798
+ }
799
+ export interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {
800
+ /**
801
+ * Whether the button is in a pending state. This disables press and hover events
802
+ * while retaining focusability, and announces the pending state to screen readers.
803
+ */
804
+ isPending?: boolean;
805
+ }
806
+ interface ButtonContextValue extends ButtonProps {
807
+ isPressed?: boolean;
808
+ }
809
+ export const ButtonContext: React.Context<ContextValue<ButtonContextValue, HTMLButtonElement>>;
810
+ /**
811
+ * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.
812
+ */
813
+ export const Button: (props: ButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null;
880
814
  export interface CalendarRenderProps {
881
815
  /**
882
816
  * Whether the calendar is disabled.
@@ -1083,10 +1017,10 @@ export const ColorSwatchContext: React.Context<ContextValue<ColorSwatchProps, HT
1083
1017
  * A ColorSwatch displays a preview of a selected color.
1084
1018
  */
1085
1019
  export const ColorSwatch: React.ForwardRefExoticComponent<ColorSwatchProps & React.RefAttributes<HTMLDivElement>>;
1086
- interface DraggableCollectionStateOpts extends Omit<DraggableCollectionStateOptions, 'getItems'> {
1020
+ interface DraggableCollectionStateOpts<T = object> extends Omit<DraggableCollectionStateOptions<T>, 'getItems'> {
1087
1021
  }
1088
- interface DragHooks {
1089
- useDraggableCollectionState?: (props: DraggableCollectionStateOpts) => DraggableCollectionState;
1022
+ interface DragHooks<T = object> {
1023
+ useDraggableCollectionState?: (props: DraggableCollectionStateOpts<T>) => DraggableCollectionState;
1090
1024
  useDraggableCollection?: (props: DraggableCollectionOptions, state: DraggableCollectionState, ref: RefObject<HTMLElement | null>) => void;
1091
1025
  useDraggableItem?: (props: DraggableItemProps, state: DraggableCollectionState) => DraggableItemResult;
1092
1026
  DragPreview?: typeof DragPreview;
@@ -1106,17 +1040,17 @@ interface DropHooks {
1106
1040
  dropTargetDelegate?: _DropTargetDelegate1;
1107
1041
  ListDropTargetDelegate: typeof ListDropTargetDelegate;
1108
1042
  }
1109
- export type DragAndDropHooks = DragHooks & DropHooks;
1110
- interface DragAndDrop {
1043
+ export type DragAndDropHooks<T = object> = DragHooks<T> & DropHooks;
1044
+ interface DragAndDrop<T = object> {
1111
1045
  /** Drag and drop hooks for the collection element. */
1112
- dragAndDropHooks: DragAndDropHooks;
1046
+ dragAndDropHooks: DragAndDropHooks<T>;
1113
1047
  }
1114
- export interface DragAndDropOptions extends Omit<DraggableCollectionProps, 'preview' | 'getItems'>, DroppableCollectionProps {
1048
+ export interface DragAndDropOptions<T = object> extends Omit<DraggableCollectionProps, 'preview' | 'getItems'>, DroppableCollectionProps {
1115
1049
  /**
1116
1050
  * A function that returns the items being dragged. If not specified, we assume that the collection is not draggable.
1117
1051
  * @default () => []
1118
1052
  */
1119
- getItems?: (keys: Set<Key>) => DragItem[];
1053
+ getItems?: (keys: Set<Key>, items: T[]) => DragItem[];
1120
1054
  /**
1121
1055
  * A function that renders a drag preview, which is shown under the user's cursor while dragging.
1122
1056
  * By default, a copy of the dragged element is rendered.
@@ -1140,7 +1074,7 @@ export interface DragAndDropOptions extends Omit<DraggableCollectionProps, 'prev
1140
1074
  /**
1141
1075
  * Provides the hooks required to enable drag and drop behavior for a drag and drop compatible collection component.
1142
1076
  */
1143
- export function useDragAndDrop(options: DragAndDropOptions): DragAndDrop;
1077
+ export function useDragAndDrop<T = object>(options: DragAndDropOptions<T>): DragAndDrop<T>;
1144
1078
  interface DragAndDropContextValue {
1145
1079
  dragAndDropHooks?: DragAndDropHooks;
1146
1080
  dragState?: DraggableCollectionState;
@@ -1165,11 +1099,11 @@ interface DropIndicatorContextValue {
1165
1099
  */
1166
1100
  export const DropIndicator: React.ForwardRefExoticComponent<DropIndicatorProps & React.RefAttributes<HTMLElement>>;
1167
1101
  export const HeaderContext: React.Context<ContextValue<React.HTMLAttributes<HTMLElement>, HTMLElement>>;
1168
- export const Header: (props: React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
1102
+ export const Header: (props: React.HTMLAttributes<HTMLElement> & React.RefAttributes<object>) => React.ReactElement | null;
1169
1103
  export interface SeparatorProps extends _SeparatorProps1, StyleProps, SlotProps, GlobalDOMAttributes<HTMLElement> {
1170
1104
  }
1171
1105
  export const SeparatorContext: React.Context<ContextValue<SeparatorProps, HTMLElement>>;
1172
- export const Separator: (props: SeparatorProps & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
1106
+ export const Separator: (props: SeparatorProps & React.RefAttributes<object>) => React.ReactElement | null;
1173
1107
  export interface ListBoxRenderProps {
1174
1108
  /**
1175
1109
  * Whether the listbox has no items and should display its empty state.
@@ -1208,7 +1142,7 @@ export interface ListBoxProps<T> extends Omit<AriaListBoxProps<T>, 'children' |
1208
1142
  */
1209
1143
  selectionBehavior?: SelectionBehavior;
1210
1144
  /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListBox. */
1211
- dragAndDropHooks?: DragAndDropHooks;
1145
+ dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>;
1212
1146
  /** Provides content to display when there are no items in the list. */
1213
1147
  renderEmptyState?: (props: ListBoxRenderProps) => ReactNode;
1214
1148
  /**
@@ -1257,7 +1191,7 @@ export interface ListBoxItemProps<T = object> extends RenderProps<ListBoxItemRen
1257
1191
  /**
1258
1192
  * A ListBoxItem represents an individual option in a ListBox.
1259
1193
  */
1260
- export const ListBoxItem: <T extends object>(props: ListBoxItemProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
1194
+ export const ListBoxItem: <T extends object>(props: ListBoxItemProps<T> & React.RefAttributes<T>) => React.ReactElement | null;
1261
1195
  export interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {
1262
1196
  /**
1263
1197
  * The load more spinner to render when loading additional items.
@@ -1268,7 +1202,7 @@ export interface ListBoxLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'c
1268
1202
  */
1269
1203
  isLoading?: boolean;
1270
1204
  }
1271
- export const ListBoxLoadMoreItem: (props: ListBoxLoadMoreItemProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
1205
+ export const ListBoxLoadMoreItem: (props: ListBoxLoadMoreItemProps & React.RefAttributes<object>) => React.ReactElement | null;
1272
1206
  export interface ColorSwatchPickerRenderProps extends Omit<ListBoxRenderProps, 'isDropTarget'> {
1273
1207
  }
1274
1208
  export interface ColorSwatchPickerProps extends ValueBase<string | Color, Color>, AriaLabelingProps, StyleRenderProps<ColorSwatchPickerRenderProps>, GlobalDOMAttributes<HTMLDivElement> {
@@ -1467,7 +1401,7 @@ export interface MenuItemProps<T = object> extends RenderProps<MenuItemRenderPro
1467
1401
  /**
1468
1402
  * A MenuItem represents an individual action in a Menu.
1469
1403
  */
1470
- export const MenuItem: <T extends object>(props: MenuItemProps<T> & React.RefAttributes<HTMLDivElement>) => ReactElement | null;
1404
+ export const MenuItem: <T extends object>(props: MenuItemProps<T> & React.RefAttributes<T>) => ReactElement | null;
1471
1405
  export interface DialogTriggerProps extends OverlayTriggerProps {
1472
1406
  children: ReactNode;
1473
1407
  }
@@ -1879,7 +1813,7 @@ export interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>
1879
1813
  */
1880
1814
  selectionBehavior?: SelectionBehavior;
1881
1815
  /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */
1882
- dragAndDropHooks?: DragAndDropHooks;
1816
+ dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>;
1883
1817
  /** Provides content to display when there are no items in the list. */
1884
1818
  renderEmptyState?: (props: GridListRenderProps) => ReactNode;
1885
1819
  /**
@@ -1914,7 +1848,7 @@ export interface GridListItemProps<T = object> extends RenderProps<GridListItemR
1914
1848
  /**
1915
1849
  * A GridListItem represents an individual item in a GridList.
1916
1850
  */
1917
- export const GridListItem: <T extends object>(props: GridListItemProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
1851
+ export const GridListItem: <T extends object>(props: GridListItemProps<T> & React.RefAttributes<T>) => React.ReactElement | null;
1918
1852
  export interface GridListLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLDivElement> {
1919
1853
  /**
1920
1854
  * The load more spinner to render when loading additional items.
@@ -1925,7 +1859,14 @@ export interface GridListLoadMoreItemProps extends Omit<LoadMoreSentinelProps, '
1925
1859
  */
1926
1860
  isLoading?: boolean;
1927
1861
  }
1928
- export const GridListLoadMoreItem: (props: GridListLoadMoreItemProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
1862
+ export const GridListLoadMoreItem: (props: GridListLoadMoreItemProps & React.RefAttributes<object>) => React.ReactElement | null;
1863
+ interface GridListSectionProps<T> extends SectionProps<T> {
1864
+ }
1865
+ /**
1866
+ * A GridListSection represents a section within a GridList.
1867
+ */
1868
+ export const GridListSection: <T extends object>(props: GridListSectionProps<T> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
1869
+ export const GridListHeader: (props: React.HTMLAttributes<HTMLElement> & React.RefAttributes<object>) => React.ReactElement | null;
1929
1870
  export interface MeterProps extends Omit<AriaMeterProps, 'label'>, RenderProps<MeterRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
1930
1871
  }
1931
1872
  export interface MeterRenderProps {
@@ -2111,6 +2052,34 @@ export const RadioGroup: (props: RadioGroupProps & React.RefAttributes<HTMLDivEl
2111
2052
  * A radio represents an individual option within a radio group.
2112
2053
  */
2113
2054
  export const Radio: (props: RadioProps & React.RefAttributes<HTMLLabelElement>) => React.ReactElement | null;
2055
+ export interface SearchFieldRenderProps {
2056
+ /**
2057
+ * Whether the search field is empty.
2058
+ * @selector [data-empty]
2059
+ */
2060
+ isEmpty: boolean;
2061
+ /**
2062
+ * Whether the search field is disabled.
2063
+ * @selector [data-disabled]
2064
+ */
2065
+ isDisabled: boolean;
2066
+ /**
2067
+ * Whether the search field is invalid.
2068
+ * @selector [data-invalid]
2069
+ */
2070
+ isInvalid: boolean;
2071
+ /**
2072
+ * State of the search field.
2073
+ */
2074
+ state: SearchFieldState;
2075
+ }
2076
+ export interface SearchFieldProps extends Omit<AriaSearchFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<SearchFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
2077
+ }
2078
+ export const SearchFieldContext: React.Context<ContextValue<SearchFieldProps, HTMLDivElement>>;
2079
+ /**
2080
+ * A search field allows a user to enter and clear a search query.
2081
+ */
2082
+ export const SearchField: (props: SearchFieldProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
2114
2083
  export interface SelectRenderProps {
2115
2084
  /**
2116
2085
  * Whether the select is focused, either via a mouse or keyboard.
@@ -2386,7 +2355,7 @@ export interface ColumnProps extends RenderProps<ColumnRenderProps>, GlobalDOMAt
2386
2355
  /**
2387
2356
  * A column within a `<Table>`.
2388
2357
  */
2389
- export const Column: (props: ColumnProps & React.RefAttributes<HTMLDivElement | HTMLTableCellElement>) => ReactElement | null;
2358
+ export const Column: (props: ColumnProps & React.RefAttributes<object>) => ReactElement | null;
2390
2359
  export interface ColumnResizerRenderProps {
2391
2360
  /**
2392
2361
  * Whether the resizer is currently hovered with a mouse.
@@ -2507,7 +2476,7 @@ export interface CellProps extends RenderProps<CellRenderProps>, GlobalDOMAttrib
2507
2476
  /**
2508
2477
  * A cell within a table row.
2509
2478
  */
2510
- export const Cell: (props: CellProps & React.RefAttributes<HTMLDivElement | HTMLTableCellElement>) => ReactElement | null;
2479
+ export const Cell: (props: CellProps & React.RefAttributes<object>) => ReactElement | null;
2511
2480
  export interface TableLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'collection'>, StyleProps, GlobalDOMAttributes<HTMLTableRowElement> {
2512
2481
  /**
2513
2482
  * The load more spinner to render when loading additional items.
@@ -2518,7 +2487,7 @@ export interface TableLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'col
2518
2487
  */
2519
2488
  isLoading?: boolean;
2520
2489
  }
2521
- export const TableLoadMoreItem: (props: TableLoadMoreItemProps & React.RefAttributes<HTMLTableRowElement>) => ReactElement | null;
2490
+ export const TableLoadMoreItem: (props: TableLoadMoreItemProps & React.RefAttributes<object>) => ReactElement | null;
2522
2491
  interface LayoutOptionsDelegate<O> {
2523
2492
  useLayoutOptions?(): O;
2524
2493
  }
@@ -2648,7 +2617,7 @@ export const TabList: <T extends object>(props: TabListProps<T> & React.RefAttri
2648
2617
  /**
2649
2618
  * A Tab provides a title for an individual item within a TabList.
2650
2619
  */
2651
- export const Tab: (props: TabProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
2620
+ export const Tab: (props: TabProps & React.RefAttributes<object>) => React.ReactElement | null;
2652
2621
  /**
2653
2622
  * A TabPanel provides the content for a tab.
2654
2623
  */
@@ -2711,7 +2680,45 @@ export interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, _Ho
2711
2680
  /**
2712
2681
  * A Tag is an individual item within a TagList.
2713
2682
  */
2714
- export const Tag: (props: TagProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
2683
+ export const Tag: (props: TagProps & React.RefAttributes<object>) => React.ReactElement | null;
2684
+ export interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {
2685
+ }
2686
+ export const TextAreaContext: React.Context<ContextValue<TextAreaProps, HTMLTextAreaElement>>;
2687
+ /**
2688
+ * A textarea allows a user to input mult-line text.
2689
+ */
2690
+ export const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
2691
+ export interface TextFieldRenderProps {
2692
+ /**
2693
+ * Whether the text field is disabled.
2694
+ * @selector [data-disabled]
2695
+ */
2696
+ isDisabled: boolean;
2697
+ /**
2698
+ * Whether the value is invalid.
2699
+ * @selector [data-invalid]
2700
+ */
2701
+ isInvalid: boolean;
2702
+ /**
2703
+ * Whether the text field is read only.
2704
+ * @selector [data-readonly]
2705
+ */
2706
+ isReadOnly: boolean;
2707
+ /**
2708
+ * Whether the text field is required.
2709
+ * @selector [data-required]
2710
+ */
2711
+ isRequired: boolean;
2712
+ }
2713
+ export interface TextFieldProps extends Omit<AriaTextFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, Omit<DOMProps, 'style' | 'className' | 'children'>, SlotProps, RenderProps<TextFieldRenderProps>, GlobalDOMAttributes<HTMLDivElement> {
2714
+ /** Whether the value is invalid. */
2715
+ isInvalid?: boolean;
2716
+ }
2717
+ export const TextFieldContext: React.Context<ContextValue<TextFieldProps, HTMLDivElement>>;
2718
+ /**
2719
+ * A text field allows a user to enter a plain text value with a keyboard.
2720
+ */
2721
+ export const TextField: (props: TextFieldProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
2715
2722
  export const UNSTABLE_ToastStateContext: React.Context<ToastState<any> | null>;
2716
2723
  export interface ToastRegionRenderProps<T> {
2717
2724
  /** A list of all currently visible toasts. */
@@ -2941,7 +2948,7 @@ export interface TreeProps<T> extends Omit<AriaTreeProps<T>, 'children'>, Multip
2941
2948
  */
2942
2949
  disabledBehavior?: _DisabledBehavior1;
2943
2950
  /** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the Tree. */
2944
- dragAndDropHooks?: DragAndDropHooks;
2951
+ dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>;
2945
2952
  }
2946
2953
  export const TreeContext: React.Context<ContextValue<TreeProps<any>, HTMLDivElement>>;
2947
2954
  export const TreeStateContext: React.Context<TreeState<any> | null>;
@@ -2980,7 +2987,7 @@ export interface TreeItemContentRenderProps extends TreeItemRenderProps {
2980
2987
  }
2981
2988
  export interface TreeItemContentProps extends Pick<RenderProps<TreeItemContentRenderProps>, 'children'> {
2982
2989
  }
2983
- export const TreeItemContent: (props: TreeItemContentProps & React.RefAttributes<Element>) => React.ReactElement | null;
2990
+ export const TreeItemContent: (props: TreeItemContentProps & React.RefAttributes<object>) => React.ReactElement | null;
2984
2991
  export interface TreeItemProps<T = object> extends StyleRenderProps<TreeItemRenderProps>, LinkDOMProps, _HoverEvents1, PressEvents, Pick<AriaTreeItemOptions, 'hasChildItems'>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {
2985
2992
  /** The unique id of the tree row. */
2986
2993
  id?: Key;
@@ -3023,9 +3030,9 @@ export interface TreeLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'coll
3023
3030
  */
3024
3031
  isLoading?: boolean;
3025
3032
  }
3026
- export const TreeLoadMoreItem: <T extends object>(props: TreeLoadMoreItemProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
3033
+ export const TreeLoadMoreItem: <T extends object>(props: TreeLoadMoreItemProps & React.RefAttributes<T>) => React.ReactElement | null;
3027
3034
  export { Collection, createLeafComponent as UNSTABLE_createLeafComponent, createBranchComponent as UNSTABLE_createBranchComponent, CollectionBuilder as UNSTABLE_CollectionBuilder } from '@react-aria/collections';
3028
- export { DIRECTORY_DRAG_TYPE, isDirectoryDropItem, isFileDropItem, isTextDropItem, SSRProvider, RouterProvider, I18nProvider, useLocale, useFilter, Pressable, Focusable } from 'react-aria';
3035
+ export { DIRECTORY_DRAG_TYPE, isDirectoryDropItem, isFileDropItem, isTextDropItem, SSRProvider, RouterProvider, I18nProvider, useLocale, useFilter, Pressable, Focusable, VisuallyHidden } from 'react-aria';
3029
3036
  export { FormValidationContext, parseColor, getColorChannels, ToastQueue as UNSTABLE_ToastQueue } from 'react-stately';
3030
3037
  export { ListLayout, GridLayout, WaterfallLayout } from '@react-stately/layout';
3031
3038
  export { Layout, LayoutInfo, Size, Rect, Point } from '@react-stately/virtualizer';