react-aria-components 1.15.0 → 1.16.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.
- package/dist/Button.main.js +3 -2
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +3 -2
- package/dist/Button.module.js +3 -2
- package/dist/Button.module.js.map +1 -1
- package/dist/Collection.main.js +3 -0
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.mjs +3 -0
- package/dist/Collection.module.js +3 -0
- package/dist/Collection.module.js.map +1 -1
- package/dist/ComboBox.main.js +59 -8
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +61 -12
- package/dist/ComboBox.module.js +61 -12
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +8 -4
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +8 -4
- package/dist/DateField.module.js +8 -4
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +6 -2
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +6 -2
- package/dist/DatePicker.module.js +6 -2
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/DropZone.main.js +1 -1
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +2 -2
- package/dist/DropZone.module.js +2 -2
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FileTrigger.main.js +1 -1
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +2 -2
- package/dist/FileTrigger.module.js +2 -2
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/GridList.main.js +7 -4
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +7 -5
- package/dist/GridList.module.js +7 -5
- package/dist/GridList.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +3 -1
- package/dist/HiddenDateInput.main.js.map +1 -1
- package/dist/HiddenDateInput.mjs +3 -1
- package/dist/HiddenDateInput.module.js +3 -1
- package/dist/HiddenDateInput.module.js.map +1 -1
- package/dist/Keyboard.main.js.map +1 -1
- package/dist/Keyboard.module.js.map +1 -1
- package/dist/ListBox.main.js +2 -1
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +3 -2
- package/dist/ListBox.module.js +3 -2
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +3 -1
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +3 -1
- package/dist/Menu.module.js +3 -1
- package/dist/Menu.module.js.map +1 -1
- package/dist/Popover.main.js +1 -1
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +3 -3
- package/dist/Popover.module.js +3 -3
- package/dist/Popover.module.js.map +1 -1
- package/dist/Tree.main.js +151 -102
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +153 -106
- package/dist/Tree.module.js +153 -106
- package/dist/Tree.module.js.map +1 -1
- package/dist/import.mjs +3 -3
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -3
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +77 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/package.json +23 -23
- package/src/Button.tsx +4 -2
- package/src/Collection.tsx +6 -0
- package/src/ComboBox.tsx +89 -12
- package/src/DateField.tsx +14 -5
- package/src/DatePicker.tsx +11 -2
- package/src/DropZone.tsx +2 -2
- package/src/FileTrigger.tsx +2 -2
- package/src/GridList.tsx +12 -3
- package/src/HiddenDateInput.tsx +2 -1
- package/src/Keyboard.tsx +2 -2
- package/src/ListBox.tsx +5 -4
- package/src/Menu.tsx +3 -2
- package/src/Popover.tsx +3 -3
- package/src/Tree.tsx +209 -146
- package/src/index.ts +4 -3
- package/src/utils.tsx +7 -6
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AriaLabelingProps, RefObject, DOMProps as _DOMProps1, GlobalDOMAttributes, ValidationResult, HoverEvents as _HoverEvents1, InputDOMProps, FocusableElement, FocusEvents, KeyboardEvents, Node, ValueBase, CollectionBase, DropTargetDelegate, ItemDropTarget, Key, LayoutDelegate, DraggableCollectionProps, DroppableCollectionProps, LinkDOMProps, PressEvents, MultipleSelection, Orientation as _Orientation2, DisabledBehavior as _DisabledBehavior1, Expandable, SelectionMode as
|
|
1
|
+
import { AriaLabelingProps, RefObject, DOMProps as _DOMProps1, GlobalDOMAttributes, ValidationResult, HoverEvents as _HoverEvents1, InputDOMProps, FocusableElement, FocusEvents, KeyboardEvents, Node, ValueBase, CollectionBase, DropTargetDelegate, ItemDropTarget, Key, LayoutDelegate, DraggableCollectionProps, DroppableCollectionProps, LinkDOMProps, PressEvents, MultipleSelection, Orientation as _Orientation2, DisabledBehavior as _DisabledBehavior1, Expandable, SelectionMode as _SelectionMode3 } from "@react-types/shared";
|
|
2
2
|
import React, { AnchorHTMLAttributes, Context, CSSProperties, DetailedHTMLProps, ForwardedRef, JSX, ReactElement, ReactNode, HTMLAttributes, LabelHTMLAttributes, InputHTMLAttributes, OutputHTMLAttributes, TextareaHTMLAttributes } from "react";
|
|
3
3
|
import { FormProps as _FormProps1 } from "@react-types/form";
|
|
4
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, LabelAriaProps, DropOptions, AriaGridListProps, AriaMeterProps, AriaModalOverlayProps, AriaNumberFieldProps, AriaRadioGroupProps, AriaRadioProps, AriaSearchFieldProps, AriaSelectProps, AriaSwitchProps, AriaTabListProps, AriaTabPanelProps, AriaTagGroupProps, AriaTextFieldProps as _AriaTextFieldProps1, AriaToastProps, AriaToastRegionProps, AriaToggleButtonGroupProps, AriaToggleButtonProps, AriaPositionProps, Placement, AriaTreeItemOptions, AriaTreeProps } from "react-aria";
|
|
5
|
-
import { CheckboxGroupState, Color, ColorAreaState, ColorChannel, ColorFieldState, ColorSpace, SliderState, ColorSliderState, ColorWheelState, Collection, Node as _Node1, SelectionBehavior, SelectionMode as
|
|
5
|
+
import { CheckboxGroupState, Color, ColorAreaState, ColorChannel, ColorFieldState, ColorSpace, SliderState, ColorSliderState, ColorWheelState, Collection, Node as _Node1, SelectionBehavior, SelectionMode as _SelectionMode2, 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 { AriaTextFieldProps } from "@react-aria/textfield";
|
|
7
7
|
import { AriaAutocompleteProps } from "@react-aria/autocomplete";
|
|
8
8
|
import { AutocompleteState } from "@react-stately/autocomplete";
|
|
@@ -18,15 +18,15 @@ export const DEFAULT_SLOT: unique symbol;
|
|
|
18
18
|
interface SlottedValue<T> {
|
|
19
19
|
slots?: Record<string | symbol, T>;
|
|
20
20
|
}
|
|
21
|
-
type SlottedContextValue<T> =
|
|
21
|
+
type SlottedContextValue<T> = SlottedValue<T> | T | null | undefined;
|
|
22
22
|
export type ContextValue<T, E> = SlottedContextValue<WithRef<T, E>>;
|
|
23
23
|
type ProviderValue<T> = [Context<T>, T];
|
|
24
|
-
type ProviderValues<A, B, C, D, E, F, G, H, I, J, K> = [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>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>, ProviderValue<K>];
|
|
25
|
-
interface ProviderProps<A, B, C, D, E, F, G, H, I, J, K> {
|
|
26
|
-
values: ProviderValues<A, B, C, D, E, F, G, H, I, J, K>;
|
|
24
|
+
type ProviderValues<A, B, C, D, E, F, G, H, I, J, K, L> = [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>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>, ProviderValue<K>] | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>, ProviderValue<K>, ProviderValue<L>];
|
|
25
|
+
interface ProviderProps<A, B, C, D, E, F, G, H, I, J, K, L> {
|
|
26
|
+
values: ProviderValues<A, B, C, D, E, F, G, H, I, J, K, L>;
|
|
27
27
|
children: ReactNode;
|
|
28
28
|
}
|
|
29
|
-
export function Provider<A, B, C, D, E, F, G, H, I, J, K>({ values, children }: ProviderProps<A, B, C, D, E, F, G, H, I, J, K>): JSX.Element;
|
|
29
|
+
export function Provider<A, B, C, D, E, F, G, H, I, J, K, L>({ values, children }: ProviderProps<A, B, C, D, E, F, G, H, I, J, K, L>): JSX.Element;
|
|
30
30
|
interface StyleProps {
|
|
31
31
|
/** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. */
|
|
32
32
|
className?: string;
|
|
@@ -746,7 +746,7 @@ interface ItemRenderProps {
|
|
|
746
746
|
* The type of selection that is allowed in the collection.
|
|
747
747
|
* @selector [data-selection-mode="single | multiple"]
|
|
748
748
|
*/
|
|
749
|
-
selectionMode:
|
|
749
|
+
selectionMode: _SelectionMode2;
|
|
750
750
|
/** The selection behavior for the collection. */
|
|
751
751
|
selectionBehavior: SelectionBehavior;
|
|
752
752
|
/**
|
|
@@ -1311,7 +1311,7 @@ interface DropIndicatorContextValue {
|
|
|
1311
1311
|
* A DropIndicator is rendered between items in a collection to indicate where dropped data will be inserted.
|
|
1312
1312
|
*/
|
|
1313
1313
|
export const DropIndicator: React.ForwardRefExoticComponent<DropIndicatorProps & React.RefAttributes<HTMLElement>>;
|
|
1314
|
-
interface HeaderProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'header', undefined> {
|
|
1314
|
+
export interface HeaderProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'header', undefined> {
|
|
1315
1315
|
}
|
|
1316
1316
|
export const HeaderContext: React.Context<ContextValue<HeaderProps, HTMLElement>>;
|
|
1317
1317
|
export const Header: (props: HeaderProps & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
|
|
@@ -1447,7 +1447,7 @@ export interface ListBoxSectionProps<T> extends SectionProps<T>, DOMRenderProps<
|
|
|
1447
1447
|
export const ListBoxSection: <T extends object>(props: ListBoxSectionProps<T> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
|
|
1448
1448
|
export interface ListBoxItemRenderProps extends ItemRenderProps {
|
|
1449
1449
|
}
|
|
1450
|
-
export interface ListBoxItemProps<T = object> extends Omit<RenderProps<ListBoxItemRenderProps>, 'render'>, PossibleLinkDOMRenderProps<'div', ListBoxItemRenderProps>, LinkDOMProps, _HoverEvents1, PressEvents, FocusEvents<HTMLDivElement>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {
|
|
1450
|
+
export interface ListBoxItemProps<T = object> extends Omit<RenderProps<ListBoxItemRenderProps>, 'render'>, PossibleLinkDOMRenderProps<'div', ListBoxItemRenderProps>, LinkDOMProps, _HoverEvents1, PressEvents, KeyboardEvents, FocusEvents<HTMLDivElement>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {
|
|
1451
1451
|
/**
|
|
1452
1452
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.
|
|
1453
1453
|
* @default 'react-aria-ListBoxItem'
|
|
@@ -1631,8 +1631,10 @@ export const PopoverContext: React.Context<ContextValue<PopoverContextValue, HTM
|
|
|
1631
1631
|
* A popover is an overlay element positioned relative to a trigger.
|
|
1632
1632
|
*/
|
|
1633
1633
|
export const Popover: (props: PopoverProps & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
|
|
1634
|
-
|
|
1635
|
-
|
|
1634
|
+
interface KeyboardProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'kbd', undefined> {
|
|
1635
|
+
}
|
|
1636
|
+
export const KeyboardContext: React.Context<ContextValue<KeyboardProps, HTMLElement>>;
|
|
1637
|
+
export const Keyboard: React.ForwardRefExoticComponent<KeyboardProps & React.RefAttributes<HTMLElement>>;
|
|
1636
1638
|
export const MenuContext: React.Context<ContextValue<MenuProps<any>, HTMLDivElement>>;
|
|
1637
1639
|
export const MenuStateContext: React.Context<TreeState<any> | null>;
|
|
1638
1640
|
export const RootMenuTriggerStateContext: React.Context<RootMenuTriggerState | null>;
|
|
@@ -1756,6 +1758,7 @@ export function DialogTrigger(props: DialogTriggerProps): JSX.Element;
|
|
|
1756
1758
|
* A dialog is an overlay shown above other content in an application.
|
|
1757
1759
|
*/
|
|
1758
1760
|
export const Dialog: (props: DialogProps & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
|
|
1761
|
+
type SelectionMode = 'single' | 'multiple';
|
|
1759
1762
|
export interface ComboBoxRenderProps {
|
|
1760
1763
|
/**
|
|
1761
1764
|
* Whether the combobox is currently open.
|
|
@@ -1778,7 +1781,7 @@ export interface ComboBoxRenderProps {
|
|
|
1778
1781
|
*/
|
|
1779
1782
|
isRequired: boolean;
|
|
1780
1783
|
}
|
|
1781
|
-
export interface ComboBoxProps<T extends object> extends Omit<AriaComboBoxProps<T>, 'children' | 'placeholder' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<ComboBoxRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
1784
|
+
export interface ComboBoxProps<T extends object, M extends SelectionMode = 'single'> extends Omit<AriaComboBoxProps<T, M>, 'children' | 'placeholder' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<ComboBoxRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
1782
1785
|
/**
|
|
1783
1786
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.
|
|
1784
1787
|
* @default 'react-aria-ComboBox'
|
|
@@ -1795,12 +1798,40 @@ export interface ComboBoxProps<T extends object> extends Omit<AriaComboBoxProps<
|
|
|
1795
1798
|
/** Whether the combo box allows the menu to be open when the collection is empty. */
|
|
1796
1799
|
allowsEmptyCollection?: boolean;
|
|
1797
1800
|
}
|
|
1798
|
-
export const ComboBoxContext: React.Context<ContextValue<ComboBoxProps<any>, HTMLDivElement>>;
|
|
1799
|
-
export const ComboBoxStateContext: React.Context<ComboBoxState<any> | null>;
|
|
1801
|
+
export const ComboBoxContext: React.Context<ContextValue<ComboBoxProps<any, SelectionMode>, HTMLDivElement>>;
|
|
1802
|
+
export const ComboBoxStateContext: React.Context<ComboBoxState<any, SelectionMode> | null>;
|
|
1800
1803
|
/**
|
|
1801
1804
|
* A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.
|
|
1802
1805
|
*/
|
|
1803
|
-
export const ComboBox: <T extends object>(props: ComboBoxProps<T> & React.RefAttributes<HTMLDivElement>) =>
|
|
1806
|
+
export const ComboBox: <T extends object, M extends SelectionMode = "single">(props: ComboBoxProps<T, M> & React.RefAttributes<HTMLDivElement>) => ReactElement | null;
|
|
1807
|
+
export interface ComboBoxValueRenderProps<T> {
|
|
1808
|
+
/**
|
|
1809
|
+
* Whether the value is a placeholder.
|
|
1810
|
+
* @selector [data-placeholder]
|
|
1811
|
+
*/
|
|
1812
|
+
isPlaceholder: boolean;
|
|
1813
|
+
/** The object values of the currently selected items. */
|
|
1814
|
+
selectedItems: (T | null)[];
|
|
1815
|
+
/** The textValue of the currently selected items. */
|
|
1816
|
+
selectedText: string;
|
|
1817
|
+
/** The state of the ComboBox. */
|
|
1818
|
+
state: ComboBoxState<T, 'single' | 'multiple'>;
|
|
1819
|
+
}
|
|
1820
|
+
export interface ComboBoxValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<ComboBoxValueRenderProps<T>, 'div'> {
|
|
1821
|
+
/**
|
|
1822
|
+
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.
|
|
1823
|
+
* @default 'react-aria-ComboBoxValue'
|
|
1824
|
+
*/
|
|
1825
|
+
className?: ClassNameOrFunction<ComboBoxValueRenderProps<T>>;
|
|
1826
|
+
/** A value to display when no items are selected. */
|
|
1827
|
+
placeholder?: ReactNode;
|
|
1828
|
+
}
|
|
1829
|
+
export const ComboBoxValueContext: React.Context<ContextValue<ComboBoxValueProps<any>, HTMLDivElement>>;
|
|
1830
|
+
/**
|
|
1831
|
+
* ComboBoxValue renders the selected values of a ComboBox, or a placeholder if no value is selected.
|
|
1832
|
+
* By default, the items are rendered as a comma separated list. Use the render function to customize this.
|
|
1833
|
+
*/
|
|
1834
|
+
export const ComboBoxValue: <T extends object>(props: ComboBoxValueProps<T> & React.RefAttributes<HTMLDivElement>) => ReactElement | null;
|
|
1804
1835
|
export interface DateFieldRenderProps {
|
|
1805
1836
|
/**
|
|
1806
1837
|
* State of the date field.
|
|
@@ -1821,6 +1852,11 @@ export interface DateFieldRenderProps {
|
|
|
1821
1852
|
* @selector [data-readonly]
|
|
1822
1853
|
*/
|
|
1823
1854
|
isReadOnly: boolean;
|
|
1855
|
+
/**
|
|
1856
|
+
* Whether the date field is required.
|
|
1857
|
+
* @selector [data-required]
|
|
1858
|
+
*/
|
|
1859
|
+
isRequired: boolean;
|
|
1824
1860
|
}
|
|
1825
1861
|
export interface DateFieldProps<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
1826
1862
|
/**
|
|
@@ -1970,6 +2006,11 @@ export interface DatePickerRenderProps {
|
|
|
1970
2006
|
* @selector [data-invalid]
|
|
1971
2007
|
*/
|
|
1972
2008
|
isInvalid: boolean;
|
|
2009
|
+
/**
|
|
2010
|
+
* Whether the date picker is required.
|
|
2011
|
+
* @selector [data-required]
|
|
2012
|
+
*/
|
|
2013
|
+
isRequired: boolean;
|
|
1973
2014
|
/**
|
|
1974
2015
|
* Whether the date picker's popover is currently open.
|
|
1975
2016
|
* @selector [data-open]
|
|
@@ -2233,6 +2274,12 @@ export const GridListContext: React.Context<ContextValue<GridListProps<any>, HTM
|
|
|
2233
2274
|
*/
|
|
2234
2275
|
export const GridList: <T extends object>(props: GridListProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
2235
2276
|
export interface GridListItemRenderProps extends ItemRenderProps {
|
|
2277
|
+
/** The unique id of the item. */
|
|
2278
|
+
id?: Key;
|
|
2279
|
+
/**
|
|
2280
|
+
* State of the grid list.
|
|
2281
|
+
*/
|
|
2282
|
+
state: ListState<unknown>;
|
|
2236
2283
|
}
|
|
2237
2284
|
export interface GridListItemProps<T = object> extends RenderProps<GridListItemRenderProps>, LinkDOMProps, _HoverEvents1, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {
|
|
2238
2285
|
/**
|
|
@@ -2542,7 +2589,7 @@ export const SearchFieldContext: React.Context<ContextValue<SearchFieldProps, HT
|
|
|
2542
2589
|
* A search field allows a user to enter and clear a search query.
|
|
2543
2590
|
*/
|
|
2544
2591
|
export const SearchField: (props: SearchFieldProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
2545
|
-
type
|
|
2592
|
+
type _SelectionMode1 = 'single' | 'multiple';
|
|
2546
2593
|
export interface SelectRenderProps {
|
|
2547
2594
|
/**
|
|
2548
2595
|
* Whether the select is focused, either via a mouse or keyboard.
|
|
@@ -2575,7 +2622,7 @@ export interface SelectRenderProps {
|
|
|
2575
2622
|
*/
|
|
2576
2623
|
isRequired: boolean;
|
|
2577
2624
|
}
|
|
2578
|
-
export interface SelectProps<T extends object = {}, M extends
|
|
2625
|
+
export interface SelectProps<T extends object = {}, M extends _SelectionMode1 = 'single'> extends Omit<AriaSelectProps<T, M>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
2579
2626
|
/**
|
|
2580
2627
|
* The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.
|
|
2581
2628
|
* @default 'react-aria-Select'
|
|
@@ -2587,12 +2634,12 @@ export interface SelectProps<T extends object = {}, M extends SelectionMode = 's
|
|
|
2587
2634
|
*/
|
|
2588
2635
|
placeholder?: string;
|
|
2589
2636
|
}
|
|
2590
|
-
export const SelectContext: React.Context<ContextValue<SelectProps<any,
|
|
2591
|
-
export const SelectStateContext: React.Context<SelectState<unknown,
|
|
2637
|
+
export const SelectContext: React.Context<ContextValue<SelectProps<any, _SelectionMode1>, HTMLDivElement>>;
|
|
2638
|
+
export const SelectStateContext: React.Context<SelectState<unknown, _SelectionMode1> | null>;
|
|
2592
2639
|
/**
|
|
2593
2640
|
* A select displays a collapsible list of options and allows a user to select one of them.
|
|
2594
2641
|
*/
|
|
2595
|
-
export const Select: <T extends object = {}, M extends
|
|
2642
|
+
export const Select: <T extends object = {}, M extends _SelectionMode1 = "single">(props: SelectProps<T, M> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
2596
2643
|
export interface SelectValueRenderProps<T> {
|
|
2597
2644
|
/**
|
|
2598
2645
|
* Whether the value is a placeholder.
|
|
@@ -2758,7 +2805,7 @@ export interface TableProps extends Omit<_TableProps1<any>, 'children'>, StyleRe
|
|
|
2758
2805
|
export const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLDivElement | HTMLTableElement>>;
|
|
2759
2806
|
interface TableOptionsContextValue {
|
|
2760
2807
|
/** The type of selection that is allowed in the table. */
|
|
2761
|
-
selectionMode:
|
|
2808
|
+
selectionMode: _SelectionMode2;
|
|
2762
2809
|
/** The selection behavior for the table. If selectionMode is `"none"`, this will be `null`. */
|
|
2763
2810
|
selectionBehavior: SelectionBehavior | null;
|
|
2764
2811
|
/** Whether the table allows empty selection. */
|
|
@@ -3568,7 +3615,7 @@ export interface TreeRenderProps {
|
|
|
3568
3615
|
* The type of selection that is allowed in the collection.
|
|
3569
3616
|
* @selector [data-selection-mode="single | multiple"]
|
|
3570
3617
|
*/
|
|
3571
|
-
selectionMode:
|
|
3618
|
+
selectionMode: _SelectionMode3;
|
|
3572
3619
|
/**
|
|
3573
3620
|
* Whether the tree allows dragging.
|
|
3574
3621
|
* @selector [data-allows-dragging]
|
|
@@ -3693,6 +3740,13 @@ export interface TreeLoadMoreItemProps extends Omit<LoadMoreSentinelProps, 'coll
|
|
|
3693
3740
|
isLoading?: boolean;
|
|
3694
3741
|
}
|
|
3695
3742
|
export const TreeLoadMoreItem: <T extends object>(props: TreeLoadMoreItemProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
3743
|
+
interface _GridListSectionProps1<T> extends SectionProps<T>, DOMRenderProps<'section', undefined> {
|
|
3744
|
+
}
|
|
3745
|
+
/**
|
|
3746
|
+
* A TreeSection represents a section within a Tree.
|
|
3747
|
+
*/
|
|
3748
|
+
export const TreeSection: <T extends object>(props: _GridListSectionProps1<T> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
|
|
3749
|
+
export const TreeHeader: (props: GridListHeaderProps) => ReactNode;
|
|
3696
3750
|
export { Collection, createLeafComponent, createBranchComponent, CollectionBuilder } from '@react-aria/collections';
|
|
3697
3751
|
export { useDrag, useDrop } from '@react-aria/dnd';
|
|
3698
3752
|
export { DIRECTORY_DRAG_TYPE, isDirectoryDropItem, isFileDropItem, isTextDropItem, SSRProvider, RouterProvider, I18nProvider, isRTL, useLocale, useFilter, Pressable, Focusable, VisuallyHidden } from 'react-aria';
|