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