@wix/site-ui 1.29.0 → 1.31.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/1268.js +99 -0
- package/dist/1279.js +7 -0
- package/dist/1457.js +10 -0
- package/dist/1477.js +106 -0
- package/dist/1500.js +111 -0
- package/dist/167.js +6 -0
- package/dist/2274.js +34 -0
- package/dist/2287.js +17 -0
- package/dist/2418.js +31 -0
- package/dist/2801.js +20 -0
- package/dist/285.js +86 -0
- package/dist/2861.js +6 -0
- package/dist/3020.js +7 -0
- package/dist/3021.js +72 -0
- package/dist/3056.js +229 -0
- package/dist/3140.js +4 -0
- package/dist/3248.js +307 -0
- package/dist/3296.js +4 -0
- package/dist/3319.js +400 -0
- package/dist/3395.js +4 -0
- package/dist/3485.js +854 -0
- package/dist/353.js +14 -0
- package/dist/3670.js +418 -0
- package/dist/3829.js +113 -0
- package/dist/4026.js +12 -0
- package/dist/4143.js +46 -0
- package/dist/42.js +32 -0
- package/dist/4281.js +30 -0
- package/dist/4346.js +2 -0
- package/dist/4388.js +418 -0
- package/dist/4490.js +32 -0
- package/dist/4495.js +9 -0
- package/dist/4549.js +24 -0
- package/dist/4586.js +41 -0
- package/dist/4586.js.LICENSE.txt +19 -0
- package/dist/4707.js +19 -0
- package/dist/4723.js +7 -0
- package/dist/4745.js +7 -0
- package/dist/4768.js +35 -0
- package/dist/4922.js +15 -0
- package/dist/5036.js +17 -0
- package/dist/5085.js +20 -0
- package/dist/5299.js +597 -0
- package/dist/5659.js +4 -0
- package/dist/5778.js +10 -0
- package/dist/5864.js +86 -0
- package/dist/5992.js +913 -0
- package/dist/5992.js.LICENSE.txt +19 -0
- package/dist/6003.js +10 -0
- package/dist/6046.js +29 -0
- package/dist/6089.js +2355 -0
- package/dist/6107.js +10 -0
- package/dist/6247.js +20 -0
- package/dist/6270.js +487 -0
- package/dist/6329.js +32 -0
- package/dist/6330.js +30 -0
- package/dist/6499.js +7 -0
- package/dist/6535.js +71 -0
- package/dist/6588.js +382 -0
- package/dist/6706.js +16 -0
- package/dist/6825.js +7 -0
- package/dist/6882.js +1562 -0
- package/dist/6914.js +30 -0
- package/dist/7021.js +13 -0
- package/dist/7366.js +83 -0
- package/dist/7373.js +25 -0
- package/dist/7541.js +25 -0
- package/dist/7564.js +10 -0
- package/dist/7642.js +20 -0
- package/dist/7725.js +10 -0
- package/dist/7871.js +38 -0
- package/dist/8052.js +352 -0
- package/dist/8106.js +238 -0
- package/dist/8171.js +346 -0
- package/dist/8225.js +21 -0
- package/dist/8272.js +333 -0
- package/dist/8527.js +58 -0
- package/dist/8724.js +10 -0
- package/dist/8750.js +1920 -0
- package/dist/8758.js +43 -0
- package/dist/880.js +149 -0
- package/dist/8935.js +8 -0
- package/dist/8960.js +22 -0
- package/dist/8971.js +40 -0
- package/dist/8979.js +10 -0
- package/dist/8996.js +71 -0
- package/dist/904.js +121 -0
- package/dist/9048.js +52 -0
- package/dist/9087.js +256 -0
- package/dist/9189.js +158 -0
- package/dist/9255.js +136 -0
- package/dist/9352.js +148 -0
- package/dist/951.js +22 -0
- package/dist/9635.js +22 -0
- package/dist/9829.js +4 -0
- package/dist/9863.js +8 -0
- package/dist/Accordion/index.d.ts +569 -12
- package/dist/Accordion/index.js +423 -8
- package/dist/AlertDialog/index.d.ts +1417 -18
- package/dist/AlertDialog/index.js +34 -14
- package/dist/Autocomplete/index.d.ts +1861 -38
- package/dist/Autocomplete/index.js +98 -24
- package/dist/Avatar/index.d.ts +129 -7
- package/dist/Avatar/index.js +149 -6
- package/dist/Badge/index.css +44 -0
- package/dist/Badge/index.d.ts +22 -0
- package/dist/Badge/index.js +23 -0
- package/dist/Breadcrumbs/index.d.ts +960 -7
- package/dist/Breadcrumbs/index.js +5 -5
- package/dist/Button/index.d.ts +88 -6
- package/dist/Button/index.js +27 -3
- package/dist/Checkbox/index.d.ts +425 -5
- package/dist/Checkbox/index.js +45 -5
- package/dist/CheckboxGroup/index.d.ts +318 -3
- package/dist/CheckboxGroup/index.js +166 -3
- package/dist/Collapsible/index.d.ts +377 -7
- package/dist/Collapsible/index.js +160 -6
- package/dist/Combobox/index.d.ts +1984 -48
- package/dist/Combobox/index.js +352 -29
- package/dist/ContextMenu/index.d.ts +2340 -36
- package/dist/ContextMenu/index.js +197 -22
- package/dist/Dialog/index.d.ts +1355 -18
- package/dist/Dialog/index.js +16 -14
- package/dist/Drawer/index.d.ts +1653 -18
- package/dist/Drawer/index.js +2797 -20
- package/dist/Field/index.d.ts +655 -15
- package/dist/Field/index.js +677 -10
- package/dist/Fieldset/index.d.ts +94 -5
- package/dist/Fieldset/index.js +68 -5
- package/dist/Form/index.d.ts +331 -2
- package/dist/Form/index.js +106 -3
- package/dist/Input/index.d.ts +692 -3
- package/dist/Input/index.js +10 -3
- package/dist/Menu/index.d.ts +2301 -36
- package/dist/Menu/index.js +365 -26
- package/dist/Menubar/index.d.ts +2301 -3
- package/dist/Menubar/index.js +105 -3
- package/dist/Meter/index.d.ts +175 -11
- package/dist/Meter/index.js +129 -9
- package/dist/NavigationMenu/index.d.ts +978 -28
- package/dist/NavigationMenu/index.js +1034 -17
- package/dist/NumberField/index.d.ts +612 -15
- package/dist/NumberField/index.js +1409 -11
- package/dist/Popover/index.d.ts +1655 -20
- package/dist/Popover/index.js +792 -17
- package/dist/PreviewCard/index.d.ts +1523 -14
- package/dist/PreviewCard/index.js +679 -14
- package/dist/Progress/index.d.ts +183 -11
- package/dist/Progress/index.js +181 -9
- package/dist/Radio/index.d.ts +185 -6
- package/dist/Radio/index.js +253 -6
- package/dist/RadioGroup/index.d.ts +341 -2
- package/dist/RadioGroup/index.js +154 -3
- package/dist/ScrollArea/index.d.ts +265 -13
- package/dist/ScrollArea/index.js +892 -10
- package/dist/Select/index.d.ts +1493 -38
- package/dist/Select/index.js +1824 -23
- package/dist/Separator/index.d.ts +80 -6
- package/dist/Separator/index.js +3 -3
- package/dist/Slider/index.d.ts +678 -16
- package/dist/Slider/index.js +1199 -11
- package/dist/Switch/index.d.ts +393 -5
- package/dist/Switch/index.js +208 -6
- package/dist/Tabs/index.d.ts +523 -12
- package/dist/Tabs/index.js +685 -9
- package/dist/Toggle/index.d.ts +305 -2
- package/dist/Toggle/index.js +76 -3
- package/dist/ToggleGroup/index.d.ts +316 -2
- package/dist/ToggleGroup/index.js +102 -3
- package/dist/Toolbar/index.d.ts +282 -13
- package/dist/Toolbar/index.js +230 -9
- package/dist/Tooltip/index.d.ts +1572 -14
- package/dist/Tooltip/index.js +965 -14
- package/dist/index.d.ts +12758 -646
- package/dist/index.js +1 -0
- package/dist/rslib-runtime.js +18 -0
- package/package.json +3 -3
package/dist/Combobox/index.d.ts
CHANGED
|
@@ -1,101 +1,2037 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
1
|
+
import { ComboboxArrowProps as ComboboxArrowProps_2 } from '@base-ui/react/combobox';
|
|
2
|
+
import { ComboboxBackdropProps as ComboboxBackdropProps_2 } from '@base-ui/react/combobox';
|
|
3
|
+
import { ComboboxChipProps as ComboboxChipProps_2 } from '@base-ui/react/combobox';
|
|
4
|
+
import { ComboboxChipRemoveProps as ComboboxChipRemoveProps_2 } from '@base-ui/react/combobox';
|
|
5
|
+
import { ComboboxChipsProps as ComboboxChipsProps_2 } from '@base-ui/react/combobox';
|
|
6
|
+
import { ComboboxClearProps as ComboboxClearProps_2 } from '@base-ui/react/combobox';
|
|
7
|
+
import { ComboboxEmptyProps as ComboboxEmptyProps_2 } from '@base-ui/react/combobox';
|
|
8
|
+
import { ComboboxGroupLabelProps as ComboboxGroupLabelProps_2 } from '@base-ui/react/combobox';
|
|
9
|
+
import { ComboboxGroupProps as ComboboxGroupProps_2 } from '@base-ui/react/combobox';
|
|
10
|
+
import { ComboboxIconProps as ComboboxIconProps_2 } from '@base-ui/react/combobox';
|
|
11
|
+
import { ComboboxInputGroupProps as ComboboxInputGroupProps_2 } from '@base-ui/react/combobox';
|
|
12
|
+
import { ComboboxInputProps as ComboboxInputProps_2 } from '@base-ui/react/combobox';
|
|
13
|
+
import { ComboboxItemIndicatorProps as ComboboxItemIndicatorProps_2 } from '@base-ui/react/combobox';
|
|
14
|
+
import { ComboboxItemProps as ComboboxItemProps_2 } from '@base-ui/react/combobox';
|
|
15
|
+
import { ComboboxLabelProps as ComboboxLabelProps_2 } from '@base-ui/react/combobox';
|
|
16
|
+
import { ComboboxListProps as ComboboxListProps_2 } from '@base-ui/react/combobox';
|
|
17
|
+
import { ComboboxPopupProps as ComboboxPopupProps_2 } from '@base-ui/react/combobox';
|
|
18
|
+
import { ComboboxPortalProps as ComboboxPortalProps_2 } from '@base-ui/react/combobox';
|
|
19
|
+
import { ComboboxPositionerProps as ComboboxPositionerProps_2 } from '@base-ui/react/combobox';
|
|
20
|
+
import { ComboboxRowProps as ComboboxRowProps_2 } from '@base-ui/react/combobox';
|
|
21
|
+
import { ComboboxStatusProps as ComboboxStatusProps_2 } from '@base-ui/react/combobox';
|
|
22
|
+
import { ComboboxTriggerProps as ComboboxTriggerProps_2 } from '@base-ui/react/combobox';
|
|
23
|
+
import { InteractionType } from '@base-ui/utils/useEnhancedClickHandler';
|
|
24
|
+
import { Padding } from '@floating-ui/react-dom';
|
|
24
25
|
import * as React_2 from 'react';
|
|
25
|
-
import {
|
|
26
|
+
import { Rect } from '@floating-ui/utils';
|
|
27
|
+
import { SeparatorProps as SeparatorProps_2 } from '@base-ui/react';
|
|
28
|
+
import { VirtualElement } from '@floating-ui/react-dom';
|
|
29
|
+
|
|
30
|
+
declare type Align = 'start' | 'center' | 'end';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
declare function AriaCombobox<Value, Mode extends SelectionMode_2 = 'none'>(props: Omit<AriaComboboxProps<Value, Mode>, 'items'> & {
|
|
36
|
+
items: readonly Group<any>[];
|
|
37
|
+
}): React_2.JSX.Element;
|
|
38
|
+
|
|
39
|
+
declare function AriaCombobox<Value, Mode extends SelectionMode_2 = 'none'>(props: Omit<AriaComboboxProps<Value, Mode>, 'items'> & {
|
|
40
|
+
items?: readonly any[] | undefined;
|
|
41
|
+
}): React_2.JSX.Element;
|
|
42
|
+
|
|
43
|
+
declare namespace AriaCombobox {
|
|
44
|
+
type Props<Value, Mode extends SelectionMode_2 = 'none'> = AriaComboboxProps<Value, Mode>;
|
|
45
|
+
type State = AriaComboboxState;
|
|
46
|
+
interface Actions {
|
|
47
|
+
unmount: () => void;
|
|
48
|
+
}
|
|
49
|
+
type HighlightEventReason = 'keyboard' | 'pointer' | 'none';
|
|
50
|
+
type HighlightEventDetails = BaseUIGenericEventDetails<HighlightEventReason, {
|
|
51
|
+
index: number;
|
|
52
|
+
}>;
|
|
53
|
+
type ChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.outsidePress | typeof REASONS.itemPress | typeof REASONS.closePress | typeof REASONS.escapeKey | typeof REASONS.listNavigation | typeof REASONS.focusOut | typeof REASONS.inputChange | typeof REASONS.inputClear | typeof REASONS.clearPress | typeof REASONS.chipRemovePress | typeof REASONS.none;
|
|
54
|
+
type ChangeEventDetails = BaseUIChangeEventDetails<ChangeEventReason>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare type AriaComboboxProps<Value, Mode extends SelectionMode_2 = 'none'> = ComboboxRootProps_2<Value> & {
|
|
58
|
+
/**
|
|
59
|
+
* How the combobox should remember the selected value.
|
|
60
|
+
* - `single`: Remembers the last selected value.
|
|
61
|
+
* - `multiple`: Remember all selected values.
|
|
62
|
+
* - `none`: Do not remember the selected value.
|
|
63
|
+
* @default 'none'
|
|
64
|
+
*/
|
|
65
|
+
selectionMode?: Mode | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The selected value of the combobox. Use when controlled.
|
|
68
|
+
*/
|
|
69
|
+
selectedValue?: ComboboxItemValueType<Value, Mode> | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The uncontrolled selected value of the combobox when it's initially rendered.
|
|
72
|
+
*
|
|
73
|
+
* To render a controlled combobox, use the `selectedValue` prop instead.
|
|
74
|
+
*/
|
|
75
|
+
defaultSelectedValue?: ComboboxItemValueType<Value, Mode> | null | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Callback fired when the selected value of the combobox changes.
|
|
78
|
+
*/
|
|
79
|
+
onSelectedValueChange?: ((value: ComboboxItemValueType<Value, Mode>, eventDetails: AriaCombobox.ChangeEventDetails) => void) | undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare interface AriaComboboxState {}
|
|
83
|
+
|
|
84
|
+
declare type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
85
|
+
/**
|
|
86
|
+
* The reason for the event.
|
|
87
|
+
*/
|
|
88
|
+
reason: Reason;
|
|
89
|
+
/**
|
|
90
|
+
* The native event associated with the custom event.
|
|
91
|
+
*/
|
|
92
|
+
event: ReasonToEvent<Reason>;
|
|
93
|
+
/**
|
|
94
|
+
* Cancels Base UI from handling the event.
|
|
95
|
+
*/
|
|
96
|
+
cancel: () => void;
|
|
97
|
+
/**
|
|
98
|
+
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
99
|
+
*/
|
|
100
|
+
allowPropagation: () => void;
|
|
101
|
+
/**
|
|
102
|
+
* Indicates whether the event has been canceled.
|
|
103
|
+
*/
|
|
104
|
+
isCanceled: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Indicates whether the event is allowed to propagate.
|
|
107
|
+
*/
|
|
108
|
+
isPropagationAllowed: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* The element that triggered the event, if applicable.
|
|
111
|
+
*/
|
|
112
|
+
trigger: Element | undefined;
|
|
113
|
+
} & CustomProperties;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Details of custom change events emitted by Base UI components.
|
|
117
|
+
*/
|
|
118
|
+
declare type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Props shared by all Base UI components.
|
|
122
|
+
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
123
|
+
*/
|
|
124
|
+
declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
|
|
125
|
+
/**
|
|
126
|
+
* CSS class applied to the element, or a function that
|
|
127
|
+
* returns a class based on the component's state.
|
|
128
|
+
*/
|
|
129
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Allows you to replace the component's HTML element
|
|
132
|
+
* with a different tag, or compose it with another component.
|
|
133
|
+
*
|
|
134
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
135
|
+
*/
|
|
136
|
+
render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Style applied to the element, or a function that
|
|
139
|
+
* returns a style object based on the component's state.
|
|
140
|
+
*/
|
|
141
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
|
|
145
|
+
preventBaseUIHandler: () => void;
|
|
146
|
+
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Details of custom generic events emitted by Base UI components.
|
|
151
|
+
*/
|
|
152
|
+
declare type BaseUIGenericEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
153
|
+
/**
|
|
154
|
+
* The reason for the event.
|
|
155
|
+
*/
|
|
156
|
+
reason: Reason;
|
|
157
|
+
/**
|
|
158
|
+
* The native event associated with the custom event.
|
|
159
|
+
*/
|
|
160
|
+
event: ReasonToEvent<Reason>;
|
|
161
|
+
} & CustomProperties;
|
|
162
|
+
|
|
163
|
+
declare type BaseUIGenericEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIGenericEventDetail<Reason, CustomProperties> & {} : never;
|
|
164
|
+
|
|
165
|
+
declare type Boundary = 'clipping-ancestors' | Element | Element[] | Rect;
|
|
166
|
+
|
|
167
|
+
declare const cancelOpen: "cancel-open";
|
|
168
|
+
|
|
169
|
+
declare const chipRemovePress: "chip-remove-press";
|
|
170
|
+
|
|
171
|
+
declare const clearPress: "clear-press";
|
|
172
|
+
|
|
173
|
+
declare const closePress: "close-press";
|
|
174
|
+
|
|
175
|
+
declare const closeWatcher: "close-watcher";
|
|
176
|
+
|
|
177
|
+
declare type CollisionAvoidance = SideFlipMode | SideShiftMode;
|
|
26
178
|
|
|
27
179
|
export declare const Combobox: {
|
|
28
|
-
Label: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
180
|
+
Label: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxLabelProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
29
181
|
className?: string | undefined;
|
|
30
182
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
31
|
-
Input: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
183
|
+
Input: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxInputProps_2, "ref"> & React_2.RefAttributes<HTMLInputElement>, "ref">, "className"> & {
|
|
32
184
|
className?: string | undefined;
|
|
33
185
|
} & React_2.RefAttributes<HTMLInputElement>>;
|
|
34
|
-
InputGroup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
186
|
+
InputGroup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxInputGroupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
35
187
|
className?: string | undefined;
|
|
36
188
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
37
|
-
Trigger: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
189
|
+
Trigger: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxTriggerProps_2, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
38
190
|
className?: string | undefined;
|
|
39
191
|
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
40
|
-
List: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
192
|
+
List: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxListProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
41
193
|
className?: string | undefined;
|
|
42
194
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
43
|
-
Status: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
195
|
+
Status: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxStatusProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
44
196
|
className?: string | undefined;
|
|
45
197
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
46
|
-
Backdrop: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
198
|
+
Backdrop: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxBackdropProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
47
199
|
className?: string | undefined;
|
|
48
200
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
49
|
-
Positioner: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
201
|
+
Positioner: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxPositionerProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
50
202
|
className?: string | undefined;
|
|
51
203
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
52
|
-
Popup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
204
|
+
Popup: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxPopupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
53
205
|
className?: string | undefined;
|
|
54
206
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
55
|
-
Arrow: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
207
|
+
Arrow: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxArrowProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
56
208
|
className?: string | undefined;
|
|
57
209
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
58
|
-
Icon: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
210
|
+
Icon: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxIconProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
|
|
59
211
|
className?: string | undefined;
|
|
60
212
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
61
|
-
Group: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
213
|
+
Group: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxGroupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
62
214
|
className?: string | undefined;
|
|
63
215
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
64
|
-
GroupLabel: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
216
|
+
GroupLabel: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxGroupLabelProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
65
217
|
className?: string | undefined;
|
|
66
218
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
67
|
-
Item: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
219
|
+
Item: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxItemProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
68
220
|
className?: string | undefined;
|
|
69
221
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
70
|
-
ItemIndicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
222
|
+
ItemIndicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxItemIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
|
|
71
223
|
className?: string | undefined;
|
|
72
224
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
73
|
-
Chips: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
225
|
+
Chips: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxChipsProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
74
226
|
className?: string | undefined;
|
|
75
227
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
76
|
-
Chip: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
228
|
+
Chip: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxChipProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
77
229
|
className?: string | undefined;
|
|
78
230
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
79
|
-
ChipRemove: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
231
|
+
ChipRemove: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxChipRemoveProps_2, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
80
232
|
className?: string | undefined;
|
|
81
233
|
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
82
|
-
Row: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
234
|
+
Row: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxRowProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
83
235
|
className?: string | undefined;
|
|
84
236
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
85
237
|
Collection: typeof Combobox_2.Collection;
|
|
86
|
-
Empty: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
238
|
+
Empty: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxEmptyProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
87
239
|
className?: string | undefined;
|
|
88
240
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
89
|
-
Clear: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
241
|
+
Clear: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ComboboxClearProps_2, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
90
242
|
className?: string | undefined;
|
|
91
243
|
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
92
244
|
Root: typeof Combobox_2.Root;
|
|
93
245
|
Value: typeof Combobox_2.Value;
|
|
94
|
-
Portal: React_2.ForwardRefExoticComponent<Omit<
|
|
95
|
-
Separator: React_2.ForwardRefExoticComponent<Omit<
|
|
246
|
+
Portal: React_2.ForwardRefExoticComponent<Omit<ComboboxPortalProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
247
|
+
Separator: React_2.ForwardRefExoticComponent<Omit<SeparatorProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export declare namespace Combobox_2 {
|
|
251
|
+
export {
|
|
252
|
+
ComboboxRoot as Root,
|
|
253
|
+
ComboboxLabel as Label,
|
|
254
|
+
ComboboxValue as Value,
|
|
255
|
+
ComboboxInput as Input,
|
|
256
|
+
ComboboxInputGroup as InputGroup,
|
|
257
|
+
ComboboxTrigger as Trigger,
|
|
258
|
+
ComboboxList as List,
|
|
259
|
+
ComboboxStatus as Status,
|
|
260
|
+
ComboboxPortal as Portal,
|
|
261
|
+
ComboboxBackdrop as Backdrop,
|
|
262
|
+
ComboboxPositioner as Positioner,
|
|
263
|
+
ComboboxPopup as Popup,
|
|
264
|
+
ComboboxArrow as Arrow,
|
|
265
|
+
ComboboxIcon as Icon,
|
|
266
|
+
ComboboxGroup as Group,
|
|
267
|
+
ComboboxGroupLabel as GroupLabel,
|
|
268
|
+
ComboboxItem as Item,
|
|
269
|
+
ComboboxItemIndicator as ItemIndicator,
|
|
270
|
+
ComboboxChips as Chips,
|
|
271
|
+
ComboboxChip as Chip,
|
|
272
|
+
ComboboxChipRemove as ChipRemove,
|
|
273
|
+
ComboboxRow as Row,
|
|
274
|
+
ComboboxCollection as Collection,
|
|
275
|
+
ComboboxEmpty as Empty,
|
|
276
|
+
ComboboxClear as Clear,
|
|
277
|
+
Separator,
|
|
278
|
+
useComboboxFilter as useFilter,
|
|
279
|
+
useFilteredItems
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Displays an element positioned against the anchor.
|
|
285
|
+
* Renders a `<div>` element.
|
|
286
|
+
*
|
|
287
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
288
|
+
*/
|
|
289
|
+
export declare const ComboboxArrow: React_2.ForwardRefExoticComponent<Omit<ComboboxArrowProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
290
|
+
|
|
291
|
+
export declare namespace ComboboxArrow {
|
|
292
|
+
export type State = ComboboxArrowState;
|
|
293
|
+
export type Props = ComboboxArrowProps;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export declare interface ComboboxArrowProps extends BaseUIComponentProps<'div', ComboboxArrowState> {}
|
|
297
|
+
|
|
298
|
+
export declare interface ComboboxArrowState {
|
|
299
|
+
/**
|
|
300
|
+
* Whether the popup is currently open.
|
|
301
|
+
*/
|
|
302
|
+
open: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* The side of the anchor the component is placed on.
|
|
305
|
+
*/
|
|
306
|
+
side: Side;
|
|
307
|
+
/**
|
|
308
|
+
* The alignment of the component relative to the anchor.
|
|
309
|
+
*/
|
|
310
|
+
align: Align;
|
|
311
|
+
/**
|
|
312
|
+
* Whether the arrow cannot be centered on the anchor.
|
|
313
|
+
*/
|
|
314
|
+
uncentered: boolean;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* An overlay displayed beneath the popup.
|
|
319
|
+
* Renders a `<div>` element.
|
|
320
|
+
*
|
|
321
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
322
|
+
*/
|
|
323
|
+
export declare const ComboboxBackdrop: React_2.ForwardRefExoticComponent<Omit<ComboboxBackdropProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
324
|
+
|
|
325
|
+
export declare namespace ComboboxBackdrop {
|
|
326
|
+
export type Props = ComboboxBackdropProps;
|
|
327
|
+
export type State = ComboboxBackdropState;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export declare interface ComboboxBackdropProps extends BaseUIComponentProps<'div', ComboboxBackdropState> {}
|
|
331
|
+
|
|
332
|
+
export declare interface ComboboxBackdropState {
|
|
333
|
+
/**
|
|
334
|
+
* Whether the popup is currently open.
|
|
335
|
+
*/
|
|
336
|
+
open: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* The transition status of the component.
|
|
339
|
+
*/
|
|
340
|
+
transitionStatus: TransitionStatus;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* An individual chip that represents a value in a multiselectable input.
|
|
345
|
+
* Renders a `<div>` element.
|
|
346
|
+
*
|
|
347
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
348
|
+
*/
|
|
349
|
+
export declare const ComboboxChip: React_2.ForwardRefExoticComponent<Omit<ComboboxChipProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
350
|
+
|
|
351
|
+
export declare namespace ComboboxChip {
|
|
352
|
+
export type State = ComboboxChipState;
|
|
353
|
+
export type Props = ComboboxChipProps;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export declare interface ComboboxChipProps extends BaseUIComponentProps<'div', ComboboxChipState> {}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* A button to remove a chip.
|
|
360
|
+
* Renders a `<button>` element.
|
|
361
|
+
*
|
|
362
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
363
|
+
*/
|
|
364
|
+
export declare const ComboboxChipRemove: React_2.ForwardRefExoticComponent<Omit<ComboboxChipRemoveProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
365
|
+
|
|
366
|
+
export declare namespace ComboboxChipRemove {
|
|
367
|
+
export type State = ComboboxChipRemoveState;
|
|
368
|
+
export type Props = ComboboxChipRemoveProps;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export declare interface ComboboxChipRemoveProps extends NativeButtonProps, BaseUIComponentProps<'button', ComboboxChipRemoveState> {}
|
|
372
|
+
|
|
373
|
+
export declare interface ComboboxChipRemoveState {
|
|
374
|
+
/**
|
|
375
|
+
* Whether the component should ignore user interaction.
|
|
376
|
+
*/
|
|
377
|
+
disabled: boolean;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* A container for the chips in a multiselectable input.
|
|
382
|
+
* Renders a `<div>` element.
|
|
383
|
+
*
|
|
384
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
385
|
+
*/
|
|
386
|
+
export declare const ComboboxChips: React_2.ForwardRefExoticComponent<Omit<ComboboxChipsProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
387
|
+
|
|
388
|
+
export declare namespace ComboboxChips {
|
|
389
|
+
export type State = ComboboxChipsState;
|
|
390
|
+
export type Props = ComboboxChipsProps;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export declare interface ComboboxChipsProps extends BaseUIComponentProps<'div', ComboboxChipsState> {}
|
|
394
|
+
|
|
395
|
+
export declare interface ComboboxChipsState {}
|
|
396
|
+
|
|
397
|
+
export declare interface ComboboxChipState {
|
|
398
|
+
/**
|
|
399
|
+
* Whether the component should ignore user interaction.
|
|
400
|
+
*/
|
|
401
|
+
disabled: boolean;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Clears the value when clicked.
|
|
406
|
+
* Renders a `<button>` element.
|
|
407
|
+
*
|
|
408
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
409
|
+
*/
|
|
410
|
+
export declare const ComboboxClear: React_2.ForwardRefExoticComponent<Omit<ComboboxClearProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
411
|
+
|
|
412
|
+
export declare namespace ComboboxClear {
|
|
413
|
+
export type State = ComboboxClearState;
|
|
414
|
+
export type Props = ComboboxClearProps;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export declare interface ComboboxClearProps extends NativeButtonProps, BaseUIComponentProps<'button', ComboboxClearState> {
|
|
418
|
+
/**
|
|
419
|
+
* Whether the component should ignore user interaction.
|
|
420
|
+
* @default false
|
|
421
|
+
*/
|
|
422
|
+
disabled?: boolean | undefined;
|
|
423
|
+
/**
|
|
424
|
+
* Whether the component should remain mounted in the DOM when not visible.
|
|
425
|
+
* @default false
|
|
426
|
+
*/
|
|
427
|
+
keepMounted?: boolean | undefined;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export declare interface ComboboxClearState {
|
|
431
|
+
/**
|
|
432
|
+
* Whether the popup is open.
|
|
433
|
+
*/
|
|
434
|
+
open: boolean;
|
|
435
|
+
/**
|
|
436
|
+
* Whether the component should ignore user interaction.
|
|
437
|
+
*/
|
|
438
|
+
disabled: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Whether the clear button should be visible.
|
|
441
|
+
*/
|
|
442
|
+
visible: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* The transition status of the component.
|
|
445
|
+
*/
|
|
446
|
+
transitionStatus: TransitionStatus;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Renders filtered list items.
|
|
451
|
+
* Doesn't render its own HTML element.
|
|
452
|
+
*
|
|
453
|
+
* If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.
|
|
454
|
+
*
|
|
455
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
456
|
+
*/
|
|
457
|
+
export declare function ComboboxCollection(props: ComboboxCollection.Props): React_2.JSX.Element | null;
|
|
458
|
+
|
|
459
|
+
export declare namespace ComboboxCollection {
|
|
460
|
+
export type State = ComboboxCollectionState;
|
|
461
|
+
export type Props = ComboboxCollectionProps;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export declare interface ComboboxCollectionProps {
|
|
465
|
+
children: (item: any, index: number) => React_2.ReactNode;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export declare interface ComboboxCollectionState {}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Renders its children only when the list is empty.
|
|
472
|
+
* Requires the `items` prop on the root component.
|
|
473
|
+
* Announces changes politely to screen readers.
|
|
474
|
+
* This component's root element must remain mounted in the DOM to announce
|
|
475
|
+
* changes consistently across screen readers. Avoid hiding or removing the
|
|
476
|
+
* component itself with `display: none`, `hidden`, `aria-hidden`, or conditional
|
|
477
|
+
* rendering. Prefer updating or conditionally rendering its children instead.
|
|
478
|
+
* Renders a `<div>` element.
|
|
479
|
+
*
|
|
480
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
481
|
+
*/
|
|
482
|
+
export declare const ComboboxEmpty: React_2.ForwardRefExoticComponent<Omit<ComboboxEmptyProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
483
|
+
|
|
484
|
+
export declare namespace ComboboxEmpty {
|
|
485
|
+
export type State = ComboboxEmptyState;
|
|
486
|
+
export type Props = ComboboxEmptyProps;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export declare interface ComboboxEmptyProps extends BaseUIComponentProps<'div', ComboboxEmptyState> {}
|
|
490
|
+
|
|
491
|
+
export declare interface ComboboxEmptyState {}
|
|
492
|
+
|
|
493
|
+
export declare interface ComboboxFilter {
|
|
494
|
+
/** Returns whether the item matches the query anywhere. */
|
|
495
|
+
contains: <Item>(item: Item, query: string, itemToString?: (item: Item) => string) => boolean;
|
|
496
|
+
/** Returns whether the item starts with the query. */
|
|
497
|
+
startsWith: <Item>(item: Item, query: string, itemToString?: (item: Item) => string) => boolean;
|
|
498
|
+
/** Returns whether the item ends with the query. */
|
|
499
|
+
endsWith: <Item>(item: Item, query: string, itemToString?: (item: Item) => string) => boolean;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export declare interface ComboboxFilterOptions extends GetFilterParameters {
|
|
503
|
+
/**
|
|
504
|
+
* Whether the combobox is in multiple selection mode.
|
|
505
|
+
* @default false
|
|
506
|
+
*/
|
|
507
|
+
multiple?: boolean | undefined;
|
|
508
|
+
/**
|
|
509
|
+
* The current value of the combobox.
|
|
510
|
+
*/
|
|
511
|
+
value?: any;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Groups related items with the corresponding label.
|
|
516
|
+
* Renders a `<div>` element.
|
|
517
|
+
*
|
|
518
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
519
|
+
*/
|
|
520
|
+
export declare const ComboboxGroup: React_2.ForwardRefExoticComponent<Omit<ComboboxGroupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
521
|
+
|
|
522
|
+
export declare namespace ComboboxGroup {
|
|
523
|
+
export type State = ComboboxGroupState;
|
|
524
|
+
export type Props = ComboboxGroupProps;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* An accessible label that is automatically associated with its parent group.
|
|
529
|
+
* Renders a `<div>` element.
|
|
530
|
+
*
|
|
531
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
532
|
+
*/
|
|
533
|
+
export declare const ComboboxGroupLabel: React_2.ForwardRefExoticComponent<Omit<ComboboxGroupLabelProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
534
|
+
|
|
535
|
+
export declare namespace ComboboxGroupLabel {
|
|
536
|
+
export type State = ComboboxGroupLabelState;
|
|
537
|
+
export type Props = ComboboxGroupLabelProps;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export declare interface ComboboxGroupLabelProps extends BaseUIComponentProps<'div', ComboboxGroupLabelState> {}
|
|
541
|
+
|
|
542
|
+
export declare interface ComboboxGroupLabelState {}
|
|
543
|
+
|
|
544
|
+
export declare interface ComboboxGroupProps extends BaseUIComponentProps<'div', ComboboxGroupState> {
|
|
545
|
+
/**
|
|
546
|
+
* Items to be rendered within this group.
|
|
547
|
+
* When provided, child `Collection` components will use these items.
|
|
548
|
+
*/
|
|
549
|
+
items?: readonly any[] | undefined;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export declare interface ComboboxGroupState {}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* An icon that indicates that the trigger button opens the popup.
|
|
556
|
+
* Renders a `<span>` element.
|
|
557
|
+
*
|
|
558
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
559
|
+
*/
|
|
560
|
+
export declare const ComboboxIcon: React_2.ForwardRefExoticComponent<Omit<ComboboxIconProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
561
|
+
|
|
562
|
+
export declare namespace ComboboxIcon {
|
|
563
|
+
export type State = ComboboxIconState;
|
|
564
|
+
export type Props = ComboboxIconProps;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export declare interface ComboboxIconProps extends BaseUIComponentProps<'span', ComboboxIconState> {}
|
|
568
|
+
|
|
569
|
+
export declare interface ComboboxIconState {}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* A text input to search for items in the list.
|
|
573
|
+
* Renders an `<input>` element.
|
|
574
|
+
*
|
|
575
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
576
|
+
*/
|
|
577
|
+
export declare const ComboboxInput: React_2.ForwardRefExoticComponent<Omit<ComboboxInputProps, "ref"> & React_2.RefAttributes<HTMLInputElement>>;
|
|
578
|
+
|
|
579
|
+
export declare namespace ComboboxInput {
|
|
580
|
+
export type State = ComboboxInputState;
|
|
581
|
+
export type Props = ComboboxInputProps;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* A wrapper for the input and its associated controls.
|
|
586
|
+
* Renders a `<div>` element.
|
|
587
|
+
*
|
|
588
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
589
|
+
*/
|
|
590
|
+
export declare const ComboboxInputGroup: React_2.ForwardRefExoticComponent<Omit<ComboboxInputGroupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
591
|
+
|
|
592
|
+
export declare namespace ComboboxInputGroup {
|
|
593
|
+
export type State = ComboboxInputGroupState;
|
|
594
|
+
export type Props = ComboboxInputGroupProps;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export declare interface ComboboxInputGroupProps extends BaseUIComponentProps<'div', ComboboxInputGroup.State> {}
|
|
598
|
+
|
|
599
|
+
export declare interface ComboboxInputGroupState extends FieldRoot.State {
|
|
600
|
+
/**
|
|
601
|
+
* Whether the corresponding popup is open.
|
|
602
|
+
*/
|
|
603
|
+
open: boolean;
|
|
604
|
+
/**
|
|
605
|
+
* Whether the component should ignore user interaction.
|
|
606
|
+
*/
|
|
607
|
+
disabled: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Whether the component should ignore user edits.
|
|
610
|
+
*/
|
|
611
|
+
readOnly: boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
614
|
+
*/
|
|
615
|
+
popupSide: Side | null;
|
|
616
|
+
/**
|
|
617
|
+
* Present when the corresponding items list is empty.
|
|
618
|
+
*/
|
|
619
|
+
listEmpty: boolean;
|
|
620
|
+
/**
|
|
621
|
+
* Whether the combobox doesn't have a value.
|
|
622
|
+
*/
|
|
623
|
+
placeholder: boolean;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export declare interface ComboboxInputProps extends BaseUIComponentProps<'input', ComboboxInputState> {
|
|
627
|
+
/**
|
|
628
|
+
* Whether the component should ignore user interaction.
|
|
629
|
+
* @default false
|
|
630
|
+
*/
|
|
631
|
+
disabled?: boolean | undefined;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
export declare interface ComboboxInputState extends FieldRootState {
|
|
635
|
+
/**
|
|
636
|
+
* Whether the corresponding popup is open.
|
|
637
|
+
*/
|
|
638
|
+
open: boolean;
|
|
639
|
+
/**
|
|
640
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
641
|
+
*/
|
|
642
|
+
popupSide: Side | null;
|
|
643
|
+
/**
|
|
644
|
+
* Present when the corresponding items list is empty.
|
|
645
|
+
*/
|
|
646
|
+
listEmpty: boolean;
|
|
647
|
+
/**
|
|
648
|
+
* Whether the component should ignore user edits.
|
|
649
|
+
*/
|
|
650
|
+
readOnly: boolean;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* An individual item in the list.
|
|
655
|
+
* Renders a `<div>` element.
|
|
656
|
+
*
|
|
657
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
658
|
+
*/
|
|
659
|
+
export declare const ComboboxItem: React_2.NamedExoticComponent<Omit<ComboboxItemProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
660
|
+
|
|
661
|
+
export declare namespace ComboboxItem {
|
|
662
|
+
export type State = ComboboxItemState;
|
|
663
|
+
export type Props = ComboboxItemProps;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* Indicates whether the item is selected.
|
|
668
|
+
* Renders a `<span>` element.
|
|
669
|
+
*
|
|
670
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
671
|
+
*/
|
|
672
|
+
export declare const ComboboxItemIndicator: React_2.ForwardRefExoticComponent<Omit<ComboboxItemIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
673
|
+
|
|
674
|
+
export declare namespace ComboboxItemIndicator {
|
|
675
|
+
export type Props = ComboboxItemIndicatorProps;
|
|
676
|
+
export type State = ComboboxItemIndicatorState;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
export declare interface ComboboxItemIndicatorProps extends BaseUIComponentProps<'span', ComboboxItemIndicatorState> {
|
|
680
|
+
children?: React_2.ReactNode;
|
|
681
|
+
/**
|
|
682
|
+
* Whether to keep the HTML element in the DOM when the item is not selected.
|
|
683
|
+
* @default false
|
|
684
|
+
*/
|
|
685
|
+
keepMounted?: boolean | undefined;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export declare interface ComboboxItemIndicatorState {
|
|
689
|
+
/**
|
|
690
|
+
* Whether the item is selected.
|
|
691
|
+
*/
|
|
692
|
+
selected: boolean;
|
|
693
|
+
/**
|
|
694
|
+
* The transition status of the component.
|
|
695
|
+
*/
|
|
696
|
+
transitionStatus: TransitionStatus;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export declare interface ComboboxItemProps extends NonNativeButtonProps, Omit<BaseUIComponentProps<'div', ComboboxItemState>, 'id'> {
|
|
700
|
+
children?: React_2.ReactNode;
|
|
701
|
+
/**
|
|
702
|
+
* An optional click handler for the item when selected.
|
|
703
|
+
* It fires when clicking the item with the pointer, as well as when pressing `Enter` with the keyboard if the item is highlighted when the `Input` or `List` element has focus.
|
|
704
|
+
*/
|
|
705
|
+
onClick?: BaseUIComponentProps<'div', ComboboxItemState>['onClick'] | undefined;
|
|
706
|
+
/**
|
|
707
|
+
* The index of the item in the list. Improves performance when specified by avoiding the need to calculate the index automatically from the DOM.
|
|
708
|
+
*/
|
|
709
|
+
index?: number | undefined;
|
|
710
|
+
/**
|
|
711
|
+
* A unique value that identifies this item.
|
|
712
|
+
* @default null
|
|
713
|
+
*/
|
|
714
|
+
value?: any;
|
|
715
|
+
/**
|
|
716
|
+
* Whether the component should ignore user interaction.
|
|
717
|
+
* @default false
|
|
718
|
+
*/
|
|
719
|
+
disabled?: boolean | undefined;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
export declare interface ComboboxItemState {
|
|
723
|
+
/**
|
|
724
|
+
* Whether the item should ignore user interaction.
|
|
725
|
+
*/
|
|
726
|
+
disabled: boolean;
|
|
727
|
+
/**
|
|
728
|
+
* Whether the item is selected.
|
|
729
|
+
*/
|
|
730
|
+
selected: boolean;
|
|
731
|
+
/**
|
|
732
|
+
* Whether the item is highlighted.
|
|
733
|
+
*/
|
|
734
|
+
highlighted: boolean;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
declare type ComboboxItemValueType<ItemValue, Mode extends SelectionMode_2> = Mode extends 'multiple' ? ItemValue[] : ItemValue;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* An accessible label that is automatically associated with the combobox trigger.
|
|
741
|
+
* Renders a `<div>` element.
|
|
742
|
+
*
|
|
743
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
744
|
+
*/
|
|
745
|
+
export declare const ComboboxLabel: React_2.ForwardRefExoticComponent<Omit<ComboboxLabelProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
746
|
+
|
|
747
|
+
export declare namespace ComboboxLabel {
|
|
748
|
+
export type State = ComboboxLabelState;
|
|
749
|
+
export type Props = ComboboxLabelProps;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
export declare interface ComboboxLabelProps extends Omit<BaseUIComponentProps<'div', ComboboxLabel.State>, 'id'> {}
|
|
753
|
+
|
|
754
|
+
export declare type ComboboxLabelState = FieldRoot.State;
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* A list container for the items.
|
|
758
|
+
* Renders a `<div>` element.
|
|
759
|
+
*
|
|
760
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
761
|
+
*/
|
|
762
|
+
export declare const ComboboxList: React_2.ForwardRefExoticComponent<Omit<ComboboxListProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
763
|
+
|
|
764
|
+
export declare namespace ComboboxList {
|
|
765
|
+
export type State = ComboboxListState;
|
|
766
|
+
export type Props = ComboboxListProps;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
export declare interface ComboboxListProps extends Omit<BaseUIComponentProps<'div', ComboboxListState>, 'children'> {
|
|
770
|
+
children?: React_2.ReactNode | ((item: any, index: number) => React_2.ReactNode);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export declare interface ComboboxListState {
|
|
774
|
+
/**
|
|
775
|
+
* Whether the list is empty.
|
|
776
|
+
*/
|
|
777
|
+
empty: boolean;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* A container for the list.
|
|
782
|
+
* Renders a `<div>` element.
|
|
783
|
+
*
|
|
784
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
785
|
+
*/
|
|
786
|
+
export declare const ComboboxPopup: React_2.ForwardRefExoticComponent<Omit<ComboboxPopupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
787
|
+
|
|
788
|
+
export declare namespace ComboboxPopup {
|
|
789
|
+
export type State = ComboboxPopupState;
|
|
790
|
+
export type Props = ComboboxPopupProps;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
export declare interface ComboboxPopupProps extends BaseUIComponentProps<'div', ComboboxPopupState> {
|
|
794
|
+
/**
|
|
795
|
+
* Determines the element to focus when the popup is opened.
|
|
796
|
+
*
|
|
797
|
+
* - `false`: Do not move focus.
|
|
798
|
+
* - `true`: Move focus based on the default behavior (first tabbable element or popup).
|
|
799
|
+
* - `RefObject`: Move focus to the ref element.
|
|
800
|
+
* - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
|
|
801
|
+
* Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
|
|
802
|
+
*/
|
|
803
|
+
initialFocus?: boolean | React_2.RefObject<HTMLElement | null> | ((openType: InteractionType) => void | boolean | HTMLElement | null) | undefined;
|
|
804
|
+
/**
|
|
805
|
+
* Determines the element to focus when the popup is closed.
|
|
806
|
+
*
|
|
807
|
+
* - `false`: Do not move focus.
|
|
808
|
+
* - `true`: Move focus based on the default behavior (trigger or previously focused element).
|
|
809
|
+
* - `RefObject`: Move focus to the ref element.
|
|
810
|
+
* - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).
|
|
811
|
+
* Return an element to focus, `true` to use the default behavior, or `false`/`undefined` to do nothing.
|
|
812
|
+
*/
|
|
813
|
+
finalFocus?: boolean | React_2.RefObject<HTMLElement | null> | ((closeType: InteractionType) => void | boolean | HTMLElement | null) | undefined;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
export declare interface ComboboxPopupState {
|
|
817
|
+
/**
|
|
818
|
+
* Whether the component is open.
|
|
819
|
+
*/
|
|
820
|
+
open: boolean;
|
|
821
|
+
/**
|
|
822
|
+
* The side of the anchor the component is placed on.
|
|
823
|
+
*/
|
|
824
|
+
side: Side;
|
|
825
|
+
/**
|
|
826
|
+
* The alignment of the component relative to the anchor.
|
|
827
|
+
*/
|
|
828
|
+
align: Align;
|
|
829
|
+
/**
|
|
830
|
+
* Whether the anchor element is hidden.
|
|
831
|
+
*/
|
|
832
|
+
anchorHidden: boolean;
|
|
833
|
+
/**
|
|
834
|
+
* The transition status of the component.
|
|
835
|
+
*/
|
|
836
|
+
transitionStatus: TransitionStatus;
|
|
837
|
+
/**
|
|
838
|
+
* Whether there are no items to display.
|
|
839
|
+
*/
|
|
840
|
+
empty: boolean;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* A portal element that moves the popup to a different part of the DOM.
|
|
845
|
+
* By default, the portal element is appended to `<body>`.
|
|
846
|
+
* Renders a `<div>` element.
|
|
847
|
+
*
|
|
848
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
849
|
+
*/
|
|
850
|
+
export declare const ComboboxPortal: React_2.ForwardRefExoticComponent<Omit<ComboboxPortalProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
851
|
+
|
|
852
|
+
export declare namespace ComboboxPortal {
|
|
853
|
+
export type State = ComboboxPortalState;
|
|
854
|
+
export type Props = ComboboxPortalProps;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export declare interface ComboboxPortalProps extends FloatingPortal.Props<ComboboxPortalState> {
|
|
858
|
+
/**
|
|
859
|
+
* Whether to keep the portal mounted in the DOM while the popup is hidden.
|
|
860
|
+
* @default false
|
|
861
|
+
*/
|
|
862
|
+
keepMounted?: boolean | undefined;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
export declare interface ComboboxPortalState {}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Positions the popup against the trigger.
|
|
869
|
+
* Renders a `<div>` element.
|
|
870
|
+
*
|
|
871
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
872
|
+
*/
|
|
873
|
+
export declare const ComboboxPositioner: React_2.ForwardRefExoticComponent<Omit<ComboboxPositionerProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
874
|
+
|
|
875
|
+
export declare namespace ComboboxPositioner {
|
|
876
|
+
export type State = ComboboxPositionerState;
|
|
877
|
+
export type Props = ComboboxPositionerProps;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
export declare interface ComboboxPositionerProps extends UseAnchorPositioningSharedParameters, BaseUIComponentProps<'div', ComboboxPositionerState> {}
|
|
881
|
+
|
|
882
|
+
export declare interface ComboboxPositionerState {
|
|
883
|
+
/**
|
|
884
|
+
* Whether the popup is currently open.
|
|
885
|
+
*/
|
|
886
|
+
open: boolean;
|
|
887
|
+
/**
|
|
888
|
+
* The side of the anchor the component is placed on.
|
|
889
|
+
*/
|
|
890
|
+
side: Side;
|
|
891
|
+
/**
|
|
892
|
+
* The alignment of the component relative to the anchor.
|
|
893
|
+
*/
|
|
894
|
+
align: Align;
|
|
895
|
+
/**
|
|
896
|
+
* Whether the anchor element is hidden.
|
|
897
|
+
*/
|
|
898
|
+
anchorHidden: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Whether there are no items to display.
|
|
901
|
+
*/
|
|
902
|
+
empty: boolean;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Groups all parts of the combobox.
|
|
907
|
+
* Doesn't render its own HTML element.
|
|
908
|
+
*
|
|
909
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
910
|
+
*/
|
|
911
|
+
export declare function ComboboxRoot<Value, Multiple extends boolean | undefined = false>(props: ComboboxRoot.Props<Value, Multiple>): React_2.JSX.Element;
|
|
912
|
+
|
|
913
|
+
export declare namespace ComboboxRoot {
|
|
914
|
+
export type Props<Value, Multiple extends boolean | undefined = false> = ComboboxRootProps<Value, Multiple>;
|
|
915
|
+
export type State = ComboboxRootState;
|
|
916
|
+
export type Actions = ComboboxRootActions;
|
|
917
|
+
export type ChangeEventReason = ComboboxRootChangeEventReason;
|
|
918
|
+
export type ChangeEventDetails = ComboboxRootChangeEventDetails;
|
|
919
|
+
export type HighlightEventReason = ComboboxRootHighlightEventReason;
|
|
920
|
+
export type HighlightEventDetails = ComboboxRootHighlightEventDetails;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
export declare type ComboboxRootActions = AriaCombobox.Actions;
|
|
924
|
+
|
|
925
|
+
export declare type ComboboxRootChangeEventDetails = AriaCombobox.ChangeEventDetails;
|
|
926
|
+
|
|
927
|
+
export declare type ComboboxRootChangeEventReason = AriaCombobox.ChangeEventReason;
|
|
928
|
+
|
|
929
|
+
export declare type ComboboxRootHighlightEventDetails = AriaCombobox.HighlightEventDetails;
|
|
930
|
+
|
|
931
|
+
export declare type ComboboxRootHighlightEventReason = AriaCombobox.HighlightEventReason;
|
|
932
|
+
|
|
933
|
+
export declare type ComboboxRootProps<Value, Multiple extends boolean | undefined = false> = Omit<AriaCombobox.Props<Value, ModeFromMultiple<Multiple>>, 'fillInputOnItemPress' | 'autoComplete' | 'formAutoComplete' | 'submitOnItemClick' | 'autoHighlight' | 'keepHighlight' | 'highlightItemOnHover' | 'itemToStringLabel' | 'itemToStringValue' | 'isItemEqualToValue' | 'selectionMode' | 'defaultSelectedValue' | 'selectedValue' | 'onSelectedValueChange' | 'actionsRef' | 'onOpenChange' | 'onInputValueChange' | 'onItemHighlighted'> & {
|
|
934
|
+
/**
|
|
935
|
+
* Whether multiple items can be selected.
|
|
936
|
+
* @default false
|
|
937
|
+
*/
|
|
938
|
+
multiple?: Multiple | undefined;
|
|
939
|
+
/**
|
|
940
|
+
* Provides a hint to the browser for autofill.
|
|
941
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete
|
|
942
|
+
*/
|
|
943
|
+
autoComplete?: string | undefined;
|
|
944
|
+
/**
|
|
945
|
+
* Whether the first matching item is highlighted automatically while filtering.
|
|
946
|
+
* @default false
|
|
947
|
+
*/
|
|
948
|
+
autoHighlight?: boolean | undefined;
|
|
949
|
+
/**
|
|
950
|
+
* Whether moving the pointer over items should highlight them.
|
|
951
|
+
* Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
|
|
952
|
+
* @default true
|
|
953
|
+
*/
|
|
954
|
+
highlightItemOnHover?: boolean | undefined;
|
|
955
|
+
/**
|
|
956
|
+
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for display in the input.
|
|
957
|
+
* If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
|
|
958
|
+
*/
|
|
959
|
+
itemToStringLabel?: ((itemValue: Value) => string) | undefined;
|
|
960
|
+
/**
|
|
961
|
+
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for form submission.
|
|
962
|
+
* If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop.
|
|
963
|
+
*/
|
|
964
|
+
itemToStringValue?: ((itemValue: Value) => string) | undefined;
|
|
965
|
+
/**
|
|
966
|
+
* Custom comparison logic used to determine if a combobox item value matches the current selected value. Useful when item values are objects without matching referentially.
|
|
967
|
+
* Defaults to `Object.is` comparison.
|
|
968
|
+
*/
|
|
969
|
+
isItemEqualToValue?: ((itemValue: Value, value: Value) => boolean) | undefined;
|
|
970
|
+
/**
|
|
971
|
+
* The uncontrolled selected value of the combobox when it's initially rendered.
|
|
972
|
+
*
|
|
973
|
+
* To render a controlled combobox, use the `value` prop instead.
|
|
974
|
+
*/
|
|
975
|
+
defaultValue?: ComboboxValueType<Value, Multiple> | null | undefined;
|
|
976
|
+
/**
|
|
977
|
+
* A ref to imperative actions.
|
|
978
|
+
* - `unmount`: When specified, the combobox will not be unmounted when closed.
|
|
979
|
+
* Instead, the `unmount` function must be called to unmount the combobox manually.
|
|
980
|
+
* Useful when the combobox's animation is controlled by an external library.
|
|
981
|
+
*/
|
|
982
|
+
actionsRef?: React_2.RefObject<ComboboxRoot.Actions | null> | undefined;
|
|
983
|
+
/**
|
|
984
|
+
* Event handler called when the popup is opened or closed.
|
|
985
|
+
*/
|
|
986
|
+
onOpenChange?: ((open: boolean, eventDetails: ComboboxRoot.ChangeEventDetails) => void) | undefined;
|
|
987
|
+
/**
|
|
988
|
+
* Event handler called when the input value changes.
|
|
989
|
+
*/
|
|
990
|
+
onInputValueChange?: ((inputValue: string, eventDetails: ComboboxRoot.ChangeEventDetails) => void) | undefined;
|
|
991
|
+
/**
|
|
992
|
+
* Callback fired when an item is highlighted or unhighlighted.
|
|
993
|
+
* Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed.
|
|
994
|
+
* The `reason` can be:
|
|
995
|
+
* - `'keyboard'`: the highlight changed due to keyboard navigation.
|
|
996
|
+
* - `'pointer'`: the highlight changed due to pointer hovering.
|
|
997
|
+
* - `'none'`: the highlight changed programmatically.
|
|
998
|
+
*/
|
|
999
|
+
onItemHighlighted?: ((highlightedValue: Value | undefined, eventDetails: ComboboxRoot.HighlightEventDetails) => void) | undefined;
|
|
1000
|
+
/**
|
|
1001
|
+
* The selected value of the combobox. Use when controlled.
|
|
1002
|
+
*/
|
|
1003
|
+
value?: ComboboxValueType<Value, Multiple> | null | undefined;
|
|
1004
|
+
/**
|
|
1005
|
+
* Event handler called when the selected value of the combobox changes.
|
|
1006
|
+
*/
|
|
1007
|
+
onValueChange?: ((value: ComboboxValueType<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: ComboboxRoot.ChangeEventDetails) => void) | undefined;
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
declare interface ComboboxRootProps_2<ItemValue> {
|
|
1011
|
+
children?: React_2.ReactNode;
|
|
1012
|
+
/**
|
|
1013
|
+
* Identifies the field when a form is submitted.
|
|
1014
|
+
*/
|
|
1015
|
+
name?: string | undefined;
|
|
1016
|
+
/**
|
|
1017
|
+
* Identifies the form that owns the internal input.
|
|
1018
|
+
* Useful when the combobox is rendered outside the form.
|
|
1019
|
+
*/
|
|
1020
|
+
form?: string | undefined;
|
|
1021
|
+
/**
|
|
1022
|
+
* The id of the component.
|
|
1023
|
+
*/
|
|
1024
|
+
id?: string | undefined;
|
|
1025
|
+
/**
|
|
1026
|
+
* Whether the user must choose a value before submitting a form.
|
|
1027
|
+
* @default false
|
|
1028
|
+
*/
|
|
1029
|
+
required?: boolean | undefined;
|
|
1030
|
+
/**
|
|
1031
|
+
* Whether the user should be unable to choose a different option from the popup.
|
|
1032
|
+
* @default false
|
|
1033
|
+
*/
|
|
1034
|
+
readOnly?: boolean | undefined;
|
|
1035
|
+
/**
|
|
1036
|
+
* Whether the component should ignore user interaction.
|
|
1037
|
+
* @default false
|
|
1038
|
+
*/
|
|
1039
|
+
disabled?: boolean | undefined;
|
|
1040
|
+
/**
|
|
1041
|
+
* Whether the popup is initially open.
|
|
1042
|
+
*
|
|
1043
|
+
* To render a controlled popup, use the `open` prop instead.
|
|
1044
|
+
* @default false
|
|
1045
|
+
*/
|
|
1046
|
+
defaultOpen?: boolean | undefined;
|
|
1047
|
+
/**
|
|
1048
|
+
* Whether the popup is currently open. Use when controlled.
|
|
1049
|
+
*/
|
|
1050
|
+
open?: boolean | undefined;
|
|
1051
|
+
/**
|
|
1052
|
+
* Event handler called when the popup is opened or closed.
|
|
1053
|
+
*/
|
|
1054
|
+
onOpenChange?: ((open: boolean, eventDetails: AriaCombobox.ChangeEventDetails) => void) | undefined;
|
|
1055
|
+
/**
|
|
1056
|
+
* Event handler called after any animations complete when the popup is opened or closed.
|
|
1057
|
+
*/
|
|
1058
|
+
onOpenChangeComplete?: ((open: boolean) => void) | undefined;
|
|
1059
|
+
/**
|
|
1060
|
+
* Whether the popup opens when clicking the input.
|
|
1061
|
+
* @default true
|
|
1062
|
+
*/
|
|
1063
|
+
openOnInputClick?: boolean | undefined;
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether the first matching item is highlighted automatically.
|
|
1066
|
+
* - `false`: do not highlight automatically.
|
|
1067
|
+
* - `true`: highlight after the user types and keep the highlight while the query changes.
|
|
1068
|
+
* - `'always'`: highlight the first item as soon as the list opens.
|
|
1069
|
+
* @default false
|
|
1070
|
+
*/
|
|
1071
|
+
autoHighlight?: boolean | 'always' | undefined;
|
|
1072
|
+
/**
|
|
1073
|
+
* Whether the highlighted item should be preserved when the pointer leaves the list.
|
|
1074
|
+
* @default false
|
|
1075
|
+
*/
|
|
1076
|
+
keepHighlight?: boolean | undefined;
|
|
1077
|
+
/**
|
|
1078
|
+
* Whether moving the pointer over items should highlight them.
|
|
1079
|
+
* Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
|
|
1080
|
+
* @default true
|
|
1081
|
+
*/
|
|
1082
|
+
highlightItemOnHover?: boolean | undefined;
|
|
1083
|
+
/**
|
|
1084
|
+
* Whether to loop keyboard focus back to the input when the end of the list is reached while using the arrow keys. The first item can then be reached by pressing <kbd>ArrowDown</kbd> again from the input, or the last item can be reached by pressing <kbd>ArrowUp</kbd> from the input.
|
|
1085
|
+
* The input is always included in the focus loop per [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).
|
|
1086
|
+
* When disabled, focus does not move when on the last element and the user presses <kbd>ArrowDown</kbd>, or when on the first element and the user presses <kbd>ArrowUp</kbd>.
|
|
1087
|
+
* @default true
|
|
1088
|
+
*/
|
|
1089
|
+
loopFocus?: boolean | undefined;
|
|
1090
|
+
/**
|
|
1091
|
+
* The input value of the combobox. Use when controlled.
|
|
1092
|
+
*/
|
|
1093
|
+
inputValue?: React_2.ComponentProps<'input'>['value'] | undefined;
|
|
1094
|
+
/**
|
|
1095
|
+
* Callback fired when the input value of the combobox changes.
|
|
1096
|
+
*/
|
|
1097
|
+
onInputValueChange?: ((value: string, eventDetails: AriaCombobox.ChangeEventDetails) => void) | undefined;
|
|
1098
|
+
/**
|
|
1099
|
+
* The uncontrolled input value when initially rendered.
|
|
1100
|
+
*
|
|
1101
|
+
* To render a controlled input, use the `inputValue` prop instead.
|
|
1102
|
+
*/
|
|
1103
|
+
defaultInputValue?: React_2.ComponentProps<'input'>['defaultValue'] | undefined;
|
|
1104
|
+
/**
|
|
1105
|
+
* A ref to imperative actions.
|
|
1106
|
+
* - `unmount`: When specified, the combobox will not be unmounted when closed.
|
|
1107
|
+
* Instead, the `unmount` function must be called to unmount the combobox manually.
|
|
1108
|
+
* Useful when the combobox's animation is controlled by an external library.
|
|
1109
|
+
*/
|
|
1110
|
+
actionsRef?: React_2.RefObject<AriaCombobox.Actions | null> | undefined;
|
|
1111
|
+
/**
|
|
1112
|
+
* Callback fired when an item is highlighted or unhighlighted.
|
|
1113
|
+
* Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed.
|
|
1114
|
+
* The `reason` can be:
|
|
1115
|
+
* - `'keyboard'`: the highlight changed due to keyboard navigation.
|
|
1116
|
+
* - `'pointer'`: the highlight changed due to pointer hovering.
|
|
1117
|
+
* - `'none'`: the highlight changed programmatically.
|
|
1118
|
+
*/
|
|
1119
|
+
onItemHighlighted?: ((itemValue: ItemValue | undefined, eventDetails: AriaCombobox.HighlightEventDetails) => void) | undefined;
|
|
1120
|
+
/**
|
|
1121
|
+
* A ref to the hidden input element.
|
|
1122
|
+
*/
|
|
1123
|
+
inputRef?: React_2.Ref<HTMLInputElement> | undefined;
|
|
1124
|
+
/**
|
|
1125
|
+
* Whether list items are presented in a grid layout.
|
|
1126
|
+
* When enabled, arrow keys navigate across rows and columns inferred from DOM rows.
|
|
1127
|
+
* @default false
|
|
1128
|
+
*/
|
|
1129
|
+
grid?: boolean | undefined;
|
|
1130
|
+
/**
|
|
1131
|
+
* The items to be displayed in the list.
|
|
1132
|
+
* Can be either a flat array of items or an array of groups with items.
|
|
1133
|
+
*/
|
|
1134
|
+
items?: readonly any[] | readonly Group<any>[] | undefined;
|
|
1135
|
+
/**
|
|
1136
|
+
* Filtered items to display in the list.
|
|
1137
|
+
* When provided, the list will use these items instead of filtering the `items` prop internally.
|
|
1138
|
+
* Use when you want to control filtering logic externally with the `useFilter()` hook.
|
|
1139
|
+
*/
|
|
1140
|
+
filteredItems?: readonly any[] | readonly Group<any>[] | undefined;
|
|
1141
|
+
/**
|
|
1142
|
+
* Filter function used to match items vs input query.
|
|
1143
|
+
*/
|
|
1144
|
+
filter?: null | ((itemValue: ItemValue, query: string, itemToString?: (itemValue: ItemValue) => string) => boolean) | undefined;
|
|
1145
|
+
/**
|
|
1146
|
+
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for display in the input.
|
|
1147
|
+
* If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
|
|
1148
|
+
*/
|
|
1149
|
+
itemToStringLabel?: ((itemValue: ItemValue) => string) | undefined;
|
|
1150
|
+
/**
|
|
1151
|
+
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for form submission.
|
|
1152
|
+
* If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop.
|
|
1153
|
+
*/
|
|
1154
|
+
itemToStringValue?: ((itemValue: ItemValue) => string) | undefined;
|
|
1155
|
+
/**
|
|
1156
|
+
* Custom comparison logic used to determine if a combobox item value matches the current selected value. Useful when item values are objects without matching referentially.
|
|
1157
|
+
* Defaults to `Object.is` comparison.
|
|
1158
|
+
*/
|
|
1159
|
+
isItemEqualToValue?: ((itemValue: ItemValue, value: ItemValue) => boolean) | undefined;
|
|
1160
|
+
/**
|
|
1161
|
+
* Whether the items are being externally virtualized.
|
|
1162
|
+
* @default false
|
|
1163
|
+
*/
|
|
1164
|
+
virtualized?: boolean | undefined;
|
|
1165
|
+
/**
|
|
1166
|
+
* Whether the list is rendered inline without using the popup.
|
|
1167
|
+
* @default false
|
|
1168
|
+
*/
|
|
1169
|
+
inline?: boolean | undefined;
|
|
1170
|
+
/**
|
|
1171
|
+
* Determines if the popup enters a modal state when open.
|
|
1172
|
+
* - `true`: user interaction is limited to the popup: document page scroll is locked and pointer interactions on outside elements are disabled.
|
|
1173
|
+
* - `false`: user interaction with the rest of the document is allowed.
|
|
1174
|
+
* @default false
|
|
1175
|
+
*/
|
|
1176
|
+
modal?: boolean | undefined;
|
|
1177
|
+
/**
|
|
1178
|
+
* The maximum number of items to display in the list.
|
|
1179
|
+
* @default -1
|
|
1180
|
+
*/
|
|
1181
|
+
limit?: number | undefined;
|
|
1182
|
+
/**
|
|
1183
|
+
* Controls how the component behaves with respect to list filtering and inline autocompletion.
|
|
1184
|
+
* - `list` (default): items are dynamically filtered based on the input value. The input value does not change based on the active item.
|
|
1185
|
+
* - `both`: items are dynamically filtered based on the input value, which will temporarily change based on the active item (inline autocompletion).
|
|
1186
|
+
* - `inline`: items are static (not filtered), and the input value will temporarily change based on the active item (inline autocompletion).
|
|
1187
|
+
* - `none`: items are static (not filtered), and the input value will not change based on the active item.
|
|
1188
|
+
* @default 'list'
|
|
1189
|
+
*/
|
|
1190
|
+
autoComplete?: 'list' | 'both' | 'inline' | 'none' | undefined;
|
|
1191
|
+
/**
|
|
1192
|
+
* Provides a hint to the browser for autofill on the hidden input element.
|
|
1193
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete
|
|
1194
|
+
*/
|
|
1195
|
+
formAutoComplete?: string | undefined;
|
|
1196
|
+
/**
|
|
1197
|
+
* The locale to use for string comparison.
|
|
1198
|
+
* Defaults to the user's runtime locale.
|
|
1199
|
+
*/
|
|
1200
|
+
locale?: Intl.LocalesArgument | undefined;
|
|
1201
|
+
/**
|
|
1202
|
+
* Whether clicking an item should submit the owning form.
|
|
1203
|
+
* @default false
|
|
1204
|
+
*/
|
|
1205
|
+
submitOnItemClick?: boolean | undefined;
|
|
1206
|
+
/**
|
|
1207
|
+
* INTERNAL: When `selectionMode` is `none`, controls whether selecting an item fills the input.
|
|
1208
|
+
*/
|
|
1209
|
+
fillInputOnItemPress?: boolean | undefined;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
export declare interface ComboboxRootState extends AriaComboboxState {}
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* Displays a single row of items in a grid list.
|
|
1216
|
+
* Enable `grid` on the root component to turn the listbox into a grid.
|
|
1217
|
+
* Renders a `<div>` element.
|
|
1218
|
+
*
|
|
1219
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1220
|
+
*/
|
|
1221
|
+
export declare const ComboboxRow: React_2.ForwardRefExoticComponent<Omit<ComboboxRowProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
1222
|
+
|
|
1223
|
+
export declare namespace ComboboxRow {
|
|
1224
|
+
export type State = ComboboxRowState;
|
|
1225
|
+
export type Props = ComboboxRowProps;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
export declare interface ComboboxRowProps extends BaseUIComponentProps<'div', ComboboxRowState> {}
|
|
1229
|
+
|
|
1230
|
+
export declare interface ComboboxRowState {}
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Displays a status message whose content changes are announced politely to screen readers.
|
|
1234
|
+
* Useful for conveying the status of an asynchronously loaded list.
|
|
1235
|
+
* This component's root element must remain mounted in the DOM to announce
|
|
1236
|
+
* changes consistently across screen readers. Avoid hiding or removing the
|
|
1237
|
+
* component itself with `display: none`, `hidden`, `aria-hidden`, or conditional
|
|
1238
|
+
* rendering. Prefer updating or conditionally rendering its children instead.
|
|
1239
|
+
* Renders a `<div>` element.
|
|
1240
|
+
*
|
|
1241
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1242
|
+
*/
|
|
1243
|
+
export declare const ComboboxStatus: React_2.ForwardRefExoticComponent<Omit<ComboboxStatusProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
1244
|
+
|
|
1245
|
+
export declare namespace ComboboxStatus {
|
|
1246
|
+
export type State = ComboboxStatusState;
|
|
1247
|
+
export type Props = ComboboxStatusProps;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
export declare interface ComboboxStatusProps extends BaseUIComponentProps<'div', ComboboxStatusState> {}
|
|
1251
|
+
|
|
1252
|
+
export declare interface ComboboxStatusState {}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* A button that opens the popup.
|
|
1256
|
+
* Renders a `<button>` element.
|
|
1257
|
+
*
|
|
1258
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1259
|
+
*/
|
|
1260
|
+
export declare const ComboboxTrigger: React_2.ForwardRefExoticComponent<Omit<ComboboxTriggerProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
1261
|
+
|
|
1262
|
+
export declare namespace ComboboxTrigger {
|
|
1263
|
+
export type State = ComboboxTriggerState;
|
|
1264
|
+
export type Props = ComboboxTriggerProps;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
export declare interface ComboboxTriggerProps extends NativeButtonProps, BaseUIComponentProps<'button', ComboboxTriggerState> {
|
|
1268
|
+
/**
|
|
1269
|
+
* Whether the component should ignore user interaction.
|
|
1270
|
+
* @default false
|
|
1271
|
+
*/
|
|
1272
|
+
disabled?: boolean | undefined;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
export declare interface ComboboxTriggerState extends FieldRootState {
|
|
1276
|
+
/**
|
|
1277
|
+
* Whether the popup is open.
|
|
1278
|
+
*/
|
|
1279
|
+
open: boolean;
|
|
1280
|
+
/**
|
|
1281
|
+
* Whether the component should ignore user interaction.
|
|
1282
|
+
*/
|
|
1283
|
+
disabled: boolean;
|
|
1284
|
+
/**
|
|
1285
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
1286
|
+
*/
|
|
1287
|
+
popupSide: Side | null;
|
|
1288
|
+
/**
|
|
1289
|
+
* Present when the corresponding items list is empty.
|
|
1290
|
+
*/
|
|
1291
|
+
listEmpty: boolean;
|
|
1292
|
+
/**
|
|
1293
|
+
* Whether the combobox doesn't have a value.
|
|
1294
|
+
*/
|
|
1295
|
+
placeholder: boolean;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* The current value of the combobox.
|
|
1300
|
+
* Doesn't render its own HTML element.
|
|
1301
|
+
*
|
|
1302
|
+
* Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)
|
|
1303
|
+
*/
|
|
1304
|
+
export declare function ComboboxValue(props: ComboboxValue.Props): React_2.ReactElement;
|
|
1305
|
+
|
|
1306
|
+
export declare namespace ComboboxValue {
|
|
1307
|
+
export type State = ComboboxValueState;
|
|
1308
|
+
export type Props = ComboboxValueProps;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
export declare interface ComboboxValueProps {
|
|
1312
|
+
children?: React_2.ReactNode | ((selectedValue: any) => React_2.ReactNode);
|
|
1313
|
+
/**
|
|
1314
|
+
* The placeholder value to display when no value is selected.
|
|
1315
|
+
* This is overridden by `children` if specified, or by a null item's label in `items`.
|
|
1316
|
+
*/
|
|
1317
|
+
placeholder?: React_2.ReactNode;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
export declare interface ComboboxValueState {}
|
|
1321
|
+
|
|
1322
|
+
declare type ComboboxValueType<Value, Multiple extends boolean | undefined> = Multiple extends true ? Value[] : Value;
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
|
|
1326
|
+
*
|
|
1327
|
+
* @template Props Props to be spread on the rendered element.
|
|
1328
|
+
* @template State Component's internal state.
|
|
1329
|
+
*/
|
|
1330
|
+
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
1331
|
+
|
|
1332
|
+
declare const decrementPress: "decrement-press";
|
|
1333
|
+
|
|
1334
|
+
declare const disabled: "disabled";
|
|
1335
|
+
|
|
1336
|
+
declare const drag: "drag";
|
|
1337
|
+
|
|
1338
|
+
declare type Errors = Record<string, string | string[]>;
|
|
1339
|
+
|
|
1340
|
+
declare const escapeKey: "escape-key";
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* Groups all parts of the field.
|
|
1344
|
+
* Renders a `<div>` element.
|
|
1345
|
+
*
|
|
1346
|
+
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
|
1347
|
+
*/
|
|
1348
|
+
declare const FieldRoot: React_2.ForwardRefExoticComponent<Omit<FieldRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
1349
|
+
|
|
1350
|
+
declare namespace FieldRoot {
|
|
1351
|
+
type State = FieldRootState;
|
|
1352
|
+
type Props = FieldRootProps;
|
|
1353
|
+
type Actions = FieldRootActions;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
declare interface FieldRootActions {
|
|
1357
|
+
validate: () => void;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
declare interface FieldRootProps extends BaseUIComponentProps<'div', FieldRootState> {
|
|
1361
|
+
/**
|
|
1362
|
+
* Whether the component should ignore user interaction.
|
|
1363
|
+
* Takes precedence over the `disabled` prop on the `<Field.Control>` component.
|
|
1364
|
+
* @default false
|
|
1365
|
+
*/
|
|
1366
|
+
disabled?: boolean | undefined;
|
|
1367
|
+
/**
|
|
1368
|
+
* Identifies the field when a form is submitted.
|
|
1369
|
+
* Takes precedence over the `name` prop on the `<Field.Control>` component.
|
|
1370
|
+
*/
|
|
1371
|
+
name?: string | undefined;
|
|
1372
|
+
/**
|
|
1373
|
+
* A function for custom validation. Return a string or an array of strings with
|
|
1374
|
+
* the error message(s) if the value is invalid, or `null` if the value is valid.
|
|
1375
|
+
* Asynchronous functions are supported, but they do not prevent form submission
|
|
1376
|
+
* when using `validationMode="onSubmit"`.
|
|
1377
|
+
*/
|
|
1378
|
+
validate?: ((value: unknown, formValues: Form.Values) => string | string[] | null | Promise<string | string[] | null>) | undefined;
|
|
1379
|
+
/**
|
|
1380
|
+
* Determines when the field should be validated.
|
|
1381
|
+
* This takes precedence over the `validationMode` prop on `<Form>`.
|
|
1382
|
+
*
|
|
1383
|
+
* - `onSubmit`: triggers validation when the form is submitted, and re-validates on change after submission.
|
|
1384
|
+
* - `onBlur`: triggers validation when the control loses focus.
|
|
1385
|
+
* - `onChange`: triggers validation on every change to the control value.
|
|
1386
|
+
*
|
|
1387
|
+
* @default 'onSubmit'
|
|
1388
|
+
*/
|
|
1389
|
+
validationMode?: Form.ValidationMode | undefined;
|
|
1390
|
+
/**
|
|
1391
|
+
* How long to wait between `validate` callbacks if
|
|
1392
|
+
* `validationMode="onChange"` is used. Specified in milliseconds.
|
|
1393
|
+
* @default 0
|
|
1394
|
+
*/
|
|
1395
|
+
validationDebounceTime?: number | undefined;
|
|
1396
|
+
/**
|
|
1397
|
+
* Whether the field is invalid.
|
|
1398
|
+
* Useful when the field state is controlled by an external library.
|
|
1399
|
+
*/
|
|
1400
|
+
invalid?: boolean | undefined;
|
|
1401
|
+
/**
|
|
1402
|
+
* Whether the field's value has been changed from its initial value.
|
|
1403
|
+
* Useful when the field state is controlled by an external library.
|
|
1404
|
+
*/
|
|
1405
|
+
dirty?: boolean | undefined;
|
|
1406
|
+
/**
|
|
1407
|
+
* Whether the field has been touched.
|
|
1408
|
+
* Useful when the field state is controlled by an external library.
|
|
1409
|
+
*/
|
|
1410
|
+
touched?: boolean | undefined;
|
|
1411
|
+
/**
|
|
1412
|
+
* A ref to imperative actions.
|
|
1413
|
+
* - `validate`: Validates the field when called.
|
|
1414
|
+
*/
|
|
1415
|
+
actionsRef?: React_2.RefObject<FieldRoot.Actions | null> | undefined;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
declare interface FieldRootState {
|
|
1419
|
+
/**
|
|
1420
|
+
* Whether the component should ignore user interaction.
|
|
1421
|
+
*/
|
|
1422
|
+
disabled: boolean;
|
|
1423
|
+
/**
|
|
1424
|
+
* Whether the field has been touched.
|
|
1425
|
+
*/
|
|
1426
|
+
touched: boolean;
|
|
1427
|
+
/**
|
|
1428
|
+
* Whether the field value has changed from its initial value.
|
|
1429
|
+
*/
|
|
1430
|
+
dirty: boolean;
|
|
1431
|
+
/**
|
|
1432
|
+
* Whether the field is valid.
|
|
1433
|
+
*/
|
|
1434
|
+
valid: boolean | null;
|
|
1435
|
+
/**
|
|
1436
|
+
* Whether the field has a value.
|
|
1437
|
+
*/
|
|
1438
|
+
filled: boolean;
|
|
1439
|
+
/**
|
|
1440
|
+
* Whether the field is focused.
|
|
1441
|
+
*/
|
|
1442
|
+
focused: boolean;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
declare interface FieldValidityData {
|
|
1446
|
+
state: {
|
|
1447
|
+
badInput: boolean;
|
|
1448
|
+
customError: boolean;
|
|
1449
|
+
patternMismatch: boolean;
|
|
1450
|
+
rangeOverflow: boolean;
|
|
1451
|
+
rangeUnderflow: boolean;
|
|
1452
|
+
stepMismatch: boolean;
|
|
1453
|
+
tooLong: boolean;
|
|
1454
|
+
tooShort: boolean;
|
|
1455
|
+
typeMismatch: boolean;
|
|
1456
|
+
valueMissing: boolean;
|
|
1457
|
+
valid: boolean | null;
|
|
1458
|
+
};
|
|
1459
|
+
error: string;
|
|
1460
|
+
errors: string[];
|
|
1461
|
+
value: unknown;
|
|
1462
|
+
initialValue: unknown;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Portals the floating element into a given container element — by default,
|
|
1467
|
+
* outside of the app root and into the body.
|
|
1468
|
+
* This is necessary to ensure the floating element can appear outside any
|
|
1469
|
+
* potential parent containers that cause clipping (such as `overflow: hidden`),
|
|
1470
|
+
* while retaining its location in the React tree.
|
|
1471
|
+
* @see https://floating-ui.com/docs/FloatingPortal
|
|
1472
|
+
* @internal
|
|
1473
|
+
*/
|
|
1474
|
+
declare const FloatingPortal: React_2.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
|
|
1475
|
+
renderGuards?: boolean | undefined;
|
|
1476
|
+
}, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
1477
|
+
|
|
1478
|
+
declare namespace FloatingPortal {
|
|
1479
|
+
type State = FloatingPortalState;
|
|
1480
|
+
interface Props<TState> extends BaseUIComponentProps<'div', TState> {
|
|
1481
|
+
/**
|
|
1482
|
+
* A parent element to render the portal element into.
|
|
1483
|
+
*/
|
|
1484
|
+
container?: UseFloatingPortalNodeProps['container'] | undefined;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
declare interface FloatingPortalState {}
|
|
1489
|
+
|
|
1490
|
+
declare const focusOut: "focus-out";
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* A native form element with consolidated error handling.
|
|
1494
|
+
* Renders a `<form>` element.
|
|
1495
|
+
*
|
|
1496
|
+
* Documentation: [Base UI Form](https://base-ui.com/react/components/form)
|
|
1497
|
+
*/
|
|
1498
|
+
declare const Form: {
|
|
1499
|
+
<FormValues extends Record<string, any> = Record<string, any>>(props: Form.Props<FormValues> & {
|
|
1500
|
+
ref?: React_2.Ref<HTMLFormElement> | undefined;
|
|
1501
|
+
}): React_2.JSX.Element;
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
declare namespace Form {
|
|
1505
|
+
type Props<FormValues extends Record<string, any> = Record<string, any>> = FormProps<FormValues>;
|
|
1506
|
+
type State = FormState;
|
|
1507
|
+
type Actions = FormActions;
|
|
1508
|
+
type ValidationMode = FormValidationMode;
|
|
1509
|
+
type SubmitEventReason = FormSubmitEventReason;
|
|
1510
|
+
type SubmitEventDetails = FormSubmitEventDetails;
|
|
1511
|
+
type Values<FormValues extends Record<string, any> = Record<string, any>> = FormValues;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
declare interface FormActions {
|
|
1515
|
+
validate: (fieldName?: string | undefined) => void;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
declare interface FormContext {
|
|
1519
|
+
errors: Errors;
|
|
1520
|
+
clearErrors: (name: string | undefined) => void;
|
|
1521
|
+
formRef: React_2.RefObject<{
|
|
1522
|
+
fields: Map<string, {
|
|
1523
|
+
name: string | undefined;
|
|
1524
|
+
/**
|
|
1525
|
+
* After this returns, the field registry entry reflects the latest synchronous
|
|
1526
|
+
* validity verdict. Async validators do not block submit.
|
|
1527
|
+
*/
|
|
1528
|
+
validate: () => void;
|
|
1529
|
+
validityData: FieldValidityData;
|
|
1530
|
+
controlRef: React_2.RefObject<HTMLElement | null>;
|
|
1531
|
+
getValue: () => unknown;
|
|
1532
|
+
}>;
|
|
1533
|
+
}>;
|
|
1534
|
+
validationMode: Form.ValidationMode;
|
|
1535
|
+
submitAttemptedRef: React_2.RefObject<boolean>;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
declare const FormContext: React_2.Context<FormContext>;
|
|
1539
|
+
|
|
1540
|
+
declare interface FormProps<FormValues extends Record<string, any> = Record<string, any>> extends BaseUIComponentProps<'form', FormState> {
|
|
1541
|
+
/**
|
|
1542
|
+
* Determines when the form should be validated.
|
|
1543
|
+
* The `validationMode` prop on `<Field.Root>` takes precedence over this.
|
|
1544
|
+
*
|
|
1545
|
+
* - `onSubmit` (default): validates the field when the form is submitted, afterwards fields will re-validate on change.
|
|
1546
|
+
* - `onBlur`: validates a field when it loses focus.
|
|
1547
|
+
* - `onChange`: validates the field on every change to its value.
|
|
1548
|
+
*
|
|
1549
|
+
* @default 'onSubmit'
|
|
1550
|
+
*/
|
|
1551
|
+
validationMode?: FormValidationMode | undefined;
|
|
1552
|
+
/**
|
|
1553
|
+
* Validation errors returned externally, typically after submission by a server or a form action.
|
|
1554
|
+
* This should be an object where keys correspond to the `name` attribute on `<Field.Root>`,
|
|
1555
|
+
* and values correspond to error(s) related to that field.
|
|
1556
|
+
*/
|
|
1557
|
+
errors?: FormContext['errors'] | undefined;
|
|
1558
|
+
/**
|
|
1559
|
+
* Event handler called when the form is submitted.
|
|
1560
|
+
* `preventDefault()` is called on the native submit event when used.
|
|
1561
|
+
*/
|
|
1562
|
+
onFormSubmit?: ((formValues: FormValues, eventDetails: Form.SubmitEventDetails) => void) | undefined;
|
|
1563
|
+
/**
|
|
1564
|
+
* A ref to imperative actions.
|
|
1565
|
+
* - `validate`: Validates all fields when called. Optionally pass a field name to validate a single field.
|
|
1566
|
+
* @example
|
|
1567
|
+
* ```tsx
|
|
1568
|
+
* // validate all fields
|
|
1569
|
+
* actionsRef.current.validate();
|
|
1570
|
+
*
|
|
1571
|
+
* // validate one field
|
|
1572
|
+
* actionsRef.current.validate('email');
|
|
1573
|
+
* ```
|
|
1574
|
+
*/
|
|
1575
|
+
actionsRef?: React_2.RefObject<Form.Actions | null> | undefined;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
declare interface FormState {}
|
|
1579
|
+
|
|
1580
|
+
declare type FormSubmitEventDetails = BaseUIGenericEventDetails<Form.SubmitEventReason>;
|
|
1581
|
+
|
|
1582
|
+
declare type FormSubmitEventReason = typeof REASONS.none;
|
|
1583
|
+
|
|
1584
|
+
declare type FormValidationMode = 'onSubmit' | 'onBlur' | 'onChange';
|
|
1585
|
+
|
|
1586
|
+
declare interface GetFilterParameters extends Intl.CollatorOptions {
|
|
1587
|
+
/**
|
|
1588
|
+
* The locale to use for string comparison.
|
|
1589
|
+
* Defaults to the user's runtime locale.
|
|
1590
|
+
*/
|
|
1591
|
+
locale?: Intl.LocalesArgument | undefined;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
declare interface Group<Item = any> {
|
|
1595
|
+
[key: string]: unknown;
|
|
1596
|
+
items: ReadonlyArray<Item>;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
1600
|
+
ref?: React_2.Ref<T> | undefined;
|
|
96
1601
|
};
|
|
97
1602
|
|
|
1603
|
+
declare const imperativeAction: "imperative-action";
|
|
1604
|
+
|
|
1605
|
+
declare const incrementPress: "increment-press";
|
|
1606
|
+
|
|
1607
|
+
declare const initial: "initial";
|
|
1608
|
+
|
|
1609
|
+
declare const inputBlur: "input-blur";
|
|
1610
|
+
|
|
1611
|
+
declare const inputChange: "input-change";
|
|
1612
|
+
|
|
1613
|
+
declare const inputClear: "input-clear";
|
|
1614
|
+
|
|
1615
|
+
declare const inputPaste: "input-paste";
|
|
1616
|
+
|
|
1617
|
+
declare const inputPress: "input-press";
|
|
1618
|
+
|
|
1619
|
+
declare const itemPress: "item-press";
|
|
1620
|
+
|
|
1621
|
+
declare const keyboard: "keyboard";
|
|
1622
|
+
|
|
1623
|
+
declare const linkPress: "link-press";
|
|
1624
|
+
|
|
1625
|
+
declare const listNavigation: "list-navigation";
|
|
1626
|
+
|
|
1627
|
+
declare const missing: "missing";
|
|
1628
|
+
|
|
1629
|
+
declare type ModeFromMultiple<Multiple extends boolean | undefined> = Multiple extends true ? 'multiple' : 'single';
|
|
1630
|
+
|
|
1631
|
+
declare interface NativeButtonProps {
|
|
1632
|
+
/**
|
|
1633
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
1634
|
+
* via the `render` prop.
|
|
1635
|
+
* Set to `false` if the rendered element is not a button (for example, `<div>`).
|
|
1636
|
+
* @default true
|
|
1637
|
+
*/
|
|
1638
|
+
nativeButton?: boolean | undefined;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
declare const none: "none";
|
|
1642
|
+
|
|
1643
|
+
declare interface NonNativeButtonProps {
|
|
1644
|
+
/**
|
|
1645
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
1646
|
+
* via the `render` prop.
|
|
1647
|
+
* Set to `true` if the rendered element is a native button.
|
|
1648
|
+
* @default false
|
|
1649
|
+
*/
|
|
1650
|
+
nativeButton?: boolean | undefined;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
declare type OffsetFunction = (data: {
|
|
1654
|
+
side: Side;
|
|
1655
|
+
align: Align;
|
|
1656
|
+
anchor: {
|
|
1657
|
+
width: number;
|
|
1658
|
+
height: number;
|
|
1659
|
+
};
|
|
1660
|
+
positioner: {
|
|
1661
|
+
width: number;
|
|
1662
|
+
height: number;
|
|
1663
|
+
};
|
|
1664
|
+
}) => number;
|
|
1665
|
+
|
|
1666
|
+
declare type Orientation = 'horizontal' | 'vertical';
|
|
1667
|
+
|
|
1668
|
+
declare const outsidePress: "outside-press";
|
|
1669
|
+
|
|
1670
|
+
declare const pointer: "pointer";
|
|
1671
|
+
|
|
1672
|
+
declare namespace REASONS {
|
|
1673
|
+
export {
|
|
1674
|
+
none,
|
|
1675
|
+
triggerPress,
|
|
1676
|
+
triggerHover,
|
|
1677
|
+
triggerFocus,
|
|
1678
|
+
outsidePress,
|
|
1679
|
+
itemPress,
|
|
1680
|
+
closePress,
|
|
1681
|
+
linkPress,
|
|
1682
|
+
clearPress,
|
|
1683
|
+
chipRemovePress,
|
|
1684
|
+
trackPress,
|
|
1685
|
+
incrementPress,
|
|
1686
|
+
decrementPress,
|
|
1687
|
+
inputChange,
|
|
1688
|
+
inputClear,
|
|
1689
|
+
inputBlur,
|
|
1690
|
+
inputPaste,
|
|
1691
|
+
inputPress,
|
|
1692
|
+
focusOut,
|
|
1693
|
+
escapeKey,
|
|
1694
|
+
closeWatcher,
|
|
1695
|
+
listNavigation,
|
|
1696
|
+
keyboard,
|
|
1697
|
+
pointer,
|
|
1698
|
+
drag,
|
|
1699
|
+
wheel,
|
|
1700
|
+
scrub,
|
|
1701
|
+
cancelOpen,
|
|
1702
|
+
siblingOpen,
|
|
1703
|
+
disabled,
|
|
1704
|
+
missing,
|
|
1705
|
+
initial,
|
|
1706
|
+
imperativeAction,
|
|
1707
|
+
swipe,
|
|
1708
|
+
windowResize
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* Maps a change `reason` string to the corresponding native event type.
|
|
1714
|
+
*/
|
|
1715
|
+
declare type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
1716
|
+
|
|
1717
|
+
declare interface ReasonToEventMap {
|
|
1718
|
+
[REASONS.none]: Event;
|
|
1719
|
+
[REASONS.triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
1720
|
+
[REASONS.triggerHover]: MouseEvent;
|
|
1721
|
+
[REASONS.triggerFocus]: FocusEvent;
|
|
1722
|
+
[REASONS.outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
1723
|
+
[REASONS.itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
1724
|
+
[REASONS.closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
1725
|
+
[REASONS.linkPress]: MouseEvent | PointerEvent;
|
|
1726
|
+
[REASONS.clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
1727
|
+
[REASONS.chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
1728
|
+
[REASONS.trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1729
|
+
[REASONS.incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1730
|
+
[REASONS.decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
1731
|
+
[REASONS.inputChange]: InputEvent | Event;
|
|
1732
|
+
[REASONS.inputClear]: InputEvent | FocusEvent | Event;
|
|
1733
|
+
[REASONS.inputBlur]: FocusEvent;
|
|
1734
|
+
[REASONS.inputPaste]: ClipboardEvent;
|
|
1735
|
+
[REASONS.inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
1736
|
+
[REASONS.focusOut]: FocusEvent | KeyboardEvent;
|
|
1737
|
+
[REASONS.escapeKey]: KeyboardEvent;
|
|
1738
|
+
[REASONS.closeWatcher]: Event;
|
|
1739
|
+
[REASONS.listNavigation]: KeyboardEvent;
|
|
1740
|
+
[REASONS.keyboard]: KeyboardEvent;
|
|
1741
|
+
[REASONS.pointer]: PointerEvent;
|
|
1742
|
+
[REASONS.drag]: PointerEvent | TouchEvent;
|
|
1743
|
+
[REASONS.swipe]: PointerEvent | TouchEvent;
|
|
1744
|
+
[REASONS.wheel]: WheelEvent;
|
|
1745
|
+
[REASONS.scrub]: PointerEvent;
|
|
1746
|
+
[REASONS.cancelOpen]: MouseEvent;
|
|
1747
|
+
[REASONS.siblingOpen]: Event;
|
|
1748
|
+
[REASONS.disabled]: Event;
|
|
1749
|
+
[REASONS.missing]: Event;
|
|
1750
|
+
[REASONS.initial]: Event;
|
|
1751
|
+
[REASONS.imperativeAction]: Event;
|
|
1752
|
+
[REASONS.windowResize]: UIEvent;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
declare const scrub: "scrub";
|
|
1756
|
+
|
|
1757
|
+
declare type SelectionMode_2 = 'single' | 'multiple' | 'none';
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* A separator element accessible to screen readers.
|
|
1761
|
+
* Renders a `<div>` element.
|
|
1762
|
+
*
|
|
1763
|
+
* Documentation: [Base UI Separator](https://base-ui.com/react/components/separator)
|
|
1764
|
+
*/
|
|
1765
|
+
declare const Separator: React_2.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
1766
|
+
|
|
1767
|
+
declare namespace Separator {
|
|
1768
|
+
type Props = SeparatorProps;
|
|
1769
|
+
type State = SeparatorState;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
declare interface SeparatorProps extends BaseUIComponentProps<'div', SeparatorState> {
|
|
1773
|
+
/**
|
|
1774
|
+
* The orientation of the separator.
|
|
1775
|
+
* @default 'horizontal'
|
|
1776
|
+
*/
|
|
1777
|
+
orientation?: Orientation | undefined;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
declare interface SeparatorState {
|
|
1781
|
+
/**
|
|
1782
|
+
* The orientation of the separator.
|
|
1783
|
+
*/
|
|
1784
|
+
orientation: Orientation;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
declare const siblingOpen: "sibling-open";
|
|
1788
|
+
|
|
1789
|
+
declare type Side = 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start';
|
|
1790
|
+
|
|
1791
|
+
declare interface SideFlipMode {
|
|
1792
|
+
/**
|
|
1793
|
+
* How to avoid collisions on the side axis.
|
|
1794
|
+
* - `'flip'`: If there is not enough space, place the popup on the opposite side.
|
|
1795
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
1796
|
+
*/
|
|
1797
|
+
side?: 'flip' | 'none' | undefined;
|
|
1798
|
+
/**
|
|
1799
|
+
* How to avoid collisions on the align axis.
|
|
1800
|
+
* - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
|
|
1801
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
1802
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
1803
|
+
*/
|
|
1804
|
+
align?: 'flip' | 'shift' | 'none' | undefined;
|
|
1805
|
+
/**
|
|
1806
|
+
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
1807
|
+
* to a side on the perpendicular axis and which logical side to prefer.
|
|
1808
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
1809
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
1810
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
1811
|
+
*/
|
|
1812
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
declare interface SideShiftMode {
|
|
1816
|
+
/**
|
|
1817
|
+
* How to avoid collisions on the side axis.
|
|
1818
|
+
* - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
|
|
1819
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
1820
|
+
*/
|
|
1821
|
+
side?: 'shift' | 'none' | undefined;
|
|
1822
|
+
/**
|
|
1823
|
+
* How to avoid collisions on the align axis.
|
|
1824
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
1825
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
1826
|
+
*/
|
|
1827
|
+
align?: 'shift' | 'none' | undefined;
|
|
1828
|
+
/**
|
|
1829
|
+
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
1830
|
+
* to a side on the perpendicular axis and which logical side to prefer.
|
|
1831
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
1832
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
1833
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
1834
|
+
*/
|
|
1835
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
declare const swipe: "swipe";
|
|
1839
|
+
|
|
1840
|
+
declare const trackPress: "track-press";
|
|
1841
|
+
|
|
1842
|
+
declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
|
|
1843
|
+
|
|
1844
|
+
declare const triggerFocus: "trigger-focus";
|
|
1845
|
+
|
|
1846
|
+
declare const triggerHover: "trigger-hover";
|
|
1847
|
+
|
|
1848
|
+
declare const triggerPress: "trigger-press";
|
|
1849
|
+
|
|
1850
|
+
declare interface UseAnchorPositioningSharedParameters {
|
|
1851
|
+
/**
|
|
1852
|
+
* An element to position the popup against.
|
|
1853
|
+
* By default, the popup will be positioned against the trigger.
|
|
1854
|
+
*/
|
|
1855
|
+
anchor?: Element | null | VirtualElement | React_2.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
|
|
1856
|
+
/**
|
|
1857
|
+
* Determines which CSS `position` property to use.
|
|
1858
|
+
* @default 'absolute'
|
|
1859
|
+
*/
|
|
1860
|
+
positionMethod?: 'absolute' | 'fixed' | undefined;
|
|
1861
|
+
/**
|
|
1862
|
+
* Which side of the anchor element to align the popup against.
|
|
1863
|
+
* May automatically change to avoid collisions.
|
|
1864
|
+
* @default 'bottom'
|
|
1865
|
+
*/
|
|
1866
|
+
side?: Side | undefined;
|
|
1867
|
+
/**
|
|
1868
|
+
* Distance between the anchor and the popup in pixels.
|
|
1869
|
+
* Also accepts a function that returns the distance to read the dimensions of the anchor
|
|
1870
|
+
* and positioner elements, along with its side and alignment.
|
|
1871
|
+
*
|
|
1872
|
+
* The function takes a `data` object parameter with the following properties:
|
|
1873
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
1874
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
1875
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
1876
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
1877
|
+
*
|
|
1878
|
+
* @example
|
|
1879
|
+
* ```jsx
|
|
1880
|
+
* <Positioner
|
|
1881
|
+
* sideOffset={({ side, align, anchor, positioner }) => {
|
|
1882
|
+
* return side === 'top' || side === 'bottom'
|
|
1883
|
+
* ? anchor.height
|
|
1884
|
+
* : anchor.width;
|
|
1885
|
+
* }}
|
|
1886
|
+
* />
|
|
1887
|
+
* ```
|
|
1888
|
+
*
|
|
1889
|
+
* @default 0
|
|
1890
|
+
*/
|
|
1891
|
+
sideOffset?: number | OffsetFunction | undefined;
|
|
1892
|
+
/**
|
|
1893
|
+
* How to align the popup relative to the specified side.
|
|
1894
|
+
* @default 'center'
|
|
1895
|
+
*/
|
|
1896
|
+
align?: Align | undefined;
|
|
1897
|
+
/**
|
|
1898
|
+
* Additional offset along the alignment axis in pixels.
|
|
1899
|
+
* Also accepts a function that returns the offset to read the dimensions of the anchor
|
|
1900
|
+
* and positioner elements, along with its side and alignment.
|
|
1901
|
+
*
|
|
1902
|
+
* The function takes a `data` object parameter with the following properties:
|
|
1903
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
1904
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
1905
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
1906
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
1907
|
+
*
|
|
1908
|
+
* @example
|
|
1909
|
+
* ```jsx
|
|
1910
|
+
* <Positioner
|
|
1911
|
+
* alignOffset={({ side, align, anchor, positioner }) => {
|
|
1912
|
+
* return side === 'top' || side === 'bottom'
|
|
1913
|
+
* ? anchor.width
|
|
1914
|
+
* : anchor.height;
|
|
1915
|
+
* }}
|
|
1916
|
+
* />
|
|
1917
|
+
* ```
|
|
1918
|
+
*
|
|
1919
|
+
* @default 0
|
|
1920
|
+
*/
|
|
1921
|
+
alignOffset?: number | OffsetFunction | undefined;
|
|
1922
|
+
/**
|
|
1923
|
+
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
1924
|
+
* @default 'clipping-ancestors'
|
|
1925
|
+
*/
|
|
1926
|
+
collisionBoundary?: Boundary | undefined;
|
|
1927
|
+
/**
|
|
1928
|
+
* Additional space to maintain from the edge of the collision boundary.
|
|
1929
|
+
* @default 5
|
|
1930
|
+
*/
|
|
1931
|
+
collisionPadding?: Padding | undefined;
|
|
1932
|
+
/**
|
|
1933
|
+
* Whether to maintain the popup in the viewport after
|
|
1934
|
+
* the anchor element was scrolled out of view.
|
|
1935
|
+
* @default false
|
|
1936
|
+
*/
|
|
1937
|
+
sticky?: boolean | undefined;
|
|
1938
|
+
/**
|
|
1939
|
+
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
1940
|
+
*
|
|
1941
|
+
* Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
|
|
1942
|
+
* @default 5
|
|
1943
|
+
*/
|
|
1944
|
+
arrowPadding?: number | undefined;
|
|
1945
|
+
/**
|
|
1946
|
+
* Whether to disable the popup from tracking any layout shift of its positioning anchor.
|
|
1947
|
+
* @default false
|
|
1948
|
+
*/
|
|
1949
|
+
disableAnchorTracking?: boolean | undefined;
|
|
1950
|
+
/**
|
|
1951
|
+
* Determines how to handle collisions when positioning the popup.
|
|
1952
|
+
*
|
|
1953
|
+
* `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
|
|
1954
|
+
* - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
|
|
1955
|
+
* (`top` and `bottom`, or `left` and `right`).
|
|
1956
|
+
* - `'shift'`: never change side; keep the requested side and move the popup within
|
|
1957
|
+
* the clipping boundary so it stays visible.
|
|
1958
|
+
* - `'none'`: do not correct side-axis overflow.
|
|
1959
|
+
*
|
|
1960
|
+
* `align` controls overflow on the alignment axis (`start`/`center`/`end`):
|
|
1961
|
+
* - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
|
|
1962
|
+
* - `'shift'`: keep side and requested alignment, then nudge the popup along the
|
|
1963
|
+
* alignment axis to fit.
|
|
1964
|
+
* - `'none'`: do not correct alignment-axis overflow.
|
|
1965
|
+
*
|
|
1966
|
+
* `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
|
|
1967
|
+
* preferred axis cannot fit:
|
|
1968
|
+
* - `'start'`: allow perpendicular fallback and try the logical start side first
|
|
1969
|
+
* (`top` before `bottom`, or `left` before `right` in LTR).
|
|
1970
|
+
* - `'end'`: allow perpendicular fallback and try the logical end side first
|
|
1971
|
+
* (`bottom` before `top`, or `right` before `left` in LTR).
|
|
1972
|
+
* - `'none'`: do not fallback to the perpendicular axis.
|
|
1973
|
+
*
|
|
1974
|
+
* When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
|
|
1975
|
+
* If `align` is omitted, it defaults to `'flip'`.
|
|
1976
|
+
*
|
|
1977
|
+
* @example
|
|
1978
|
+
* ```jsx
|
|
1979
|
+
* <Positioner
|
|
1980
|
+
* collisionAvoidance={{
|
|
1981
|
+
* side: 'shift',
|
|
1982
|
+
* align: 'shift',
|
|
1983
|
+
* fallbackAxisSide: 'none',
|
|
1984
|
+
* }}
|
|
1985
|
+
* />
|
|
1986
|
+
* ```
|
|
1987
|
+
*
|
|
1988
|
+
*/
|
|
1989
|
+
collisionAvoidance?: CollisionAvoidance | undefined;
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
/**
|
|
1993
|
+
* Matches items against a query using `Intl.Collator` for robust string matching.
|
|
1994
|
+
*/
|
|
1995
|
+
declare function useComboboxFilter(options?: ComboboxFilterOptions): ComboboxFilter;
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* Returns the internally filtered items.
|
|
1999
|
+
*/
|
|
2000
|
+
declare function useFilteredItems<T>(): T[];
|
|
2001
|
+
|
|
2002
|
+
declare interface UseFloatingPortalNodeProps {
|
|
2003
|
+
ref?: React_2.Ref<HTMLDivElement> | undefined;
|
|
2004
|
+
container?: HTMLElement | ShadowRoot | null | React_2.RefObject<HTMLElement | ShadowRoot | null> | undefined;
|
|
2005
|
+
componentProps?: UseRenderElementComponentProps<any> | undefined;
|
|
2006
|
+
elementProps?: React_2.HTMLAttributes<HTMLDivElement> | undefined;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
declare interface UseRenderElementComponentProps<State> {
|
|
2010
|
+
/**
|
|
2011
|
+
* The class name to apply to the rendered element.
|
|
2012
|
+
* Can be a string or a function that accepts the state and returns a string.
|
|
2013
|
+
*/
|
|
2014
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
2015
|
+
/**
|
|
2016
|
+
* The render prop or React element to override the default element.
|
|
2017
|
+
*/
|
|
2018
|
+
render?: undefined | React_2.ReactElement | ComponentRenderFn<React_2.HTMLAttributes<any>, State>;
|
|
2019
|
+
/**
|
|
2020
|
+
* The style to apply to the rendered element.
|
|
2021
|
+
* Can be a style object or a function that accepts the state and returns a style object.
|
|
2022
|
+
*/
|
|
2023
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
declare const wheel: "wheel";
|
|
2027
|
+
|
|
2028
|
+
declare const windowResize: "window-resize";
|
|
2029
|
+
|
|
2030
|
+
/**
|
|
2031
|
+
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
2032
|
+
*/
|
|
2033
|
+
declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
|
|
98
2034
|
|
|
99
|
-
|
|
2035
|
+
declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
|
|
100
2036
|
|
|
101
2037
|
export { }
|