@wix/site-ui 1.30.0 → 1.32.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,37 +1,634 @@
|
|
|
1
|
-
import { NumberFieldDecrementProps } from '@base-ui/react/number-field';
|
|
2
|
-
import { NumberFieldGroupProps } from '@base-ui/react/number-field';
|
|
3
|
-
import { NumberFieldIncrementProps } from '@base-ui/react/number-field';
|
|
4
|
-
import { NumberFieldInputProps } from '@base-ui/react/number-field';
|
|
5
|
-
import { NumberFieldRootProps } from '@base-ui/react/number-field';
|
|
6
|
-
import { NumberFieldScrubAreaCursorProps } from '@base-ui/react/number-field';
|
|
7
|
-
import { NumberFieldScrubAreaProps } from '@base-ui/react/number-field';
|
|
1
|
+
import { NumberFieldDecrementProps as NumberFieldDecrementProps_2 } from '@base-ui/react/number-field';
|
|
2
|
+
import { NumberFieldGroupProps as NumberFieldGroupProps_2 } from '@base-ui/react/number-field';
|
|
3
|
+
import { NumberFieldIncrementProps as NumberFieldIncrementProps_2 } from '@base-ui/react/number-field';
|
|
4
|
+
import { NumberFieldInputProps as NumberFieldInputProps_2 } from '@base-ui/react/number-field';
|
|
5
|
+
import { NumberFieldRootProps as NumberFieldRootProps_2 } from '@base-ui/react/number-field';
|
|
6
|
+
import { NumberFieldScrubAreaCursorProps as NumberFieldScrubAreaCursorProps_2 } from '@base-ui/react/number-field';
|
|
7
|
+
import { NumberFieldScrubAreaProps as NumberFieldScrubAreaProps_2 } from '@base-ui/react/number-field';
|
|
8
8
|
import * as React_2 from 'react';
|
|
9
9
|
|
|
10
|
+
declare type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
11
|
+
/**
|
|
12
|
+
* The reason for the event.
|
|
13
|
+
*/
|
|
14
|
+
reason: Reason;
|
|
15
|
+
/**
|
|
16
|
+
* The native event associated with the custom event.
|
|
17
|
+
*/
|
|
18
|
+
event: ReasonToEvent<Reason>;
|
|
19
|
+
/**
|
|
20
|
+
* Cancels Base UI from handling the event.
|
|
21
|
+
*/
|
|
22
|
+
cancel: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Allows the event to propagate in cases where Base UI will stop the propagation.
|
|
25
|
+
*/
|
|
26
|
+
allowPropagation: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Indicates whether the event has been canceled.
|
|
29
|
+
*/
|
|
30
|
+
isCanceled: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Indicates whether the event is allowed to propagate.
|
|
33
|
+
*/
|
|
34
|
+
isPropagationAllowed: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The element that triggered the event, if applicable.
|
|
37
|
+
*/
|
|
38
|
+
trigger: Element | undefined;
|
|
39
|
+
} & CustomProperties;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Details of custom change events emitted by Base UI components.
|
|
43
|
+
*/
|
|
44
|
+
declare type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Props shared by all Base UI components.
|
|
48
|
+
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
49
|
+
*/
|
|
50
|
+
declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
|
|
51
|
+
/**
|
|
52
|
+
* CSS class applied to the element, or a function that
|
|
53
|
+
* returns a class based on the component's state.
|
|
54
|
+
*/
|
|
55
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Allows you to replace the component's HTML element
|
|
58
|
+
* with a different tag, or compose it with another component.
|
|
59
|
+
*
|
|
60
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
61
|
+
*/
|
|
62
|
+
render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Style applied to the element, or a function that
|
|
65
|
+
* returns a style object based on the component's state.
|
|
66
|
+
*/
|
|
67
|
+
style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
|
|
71
|
+
preventBaseUIHandler: () => void;
|
|
72
|
+
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Details of custom generic events emitted by Base UI components.
|
|
77
|
+
*/
|
|
78
|
+
declare type BaseUIGenericEventDetail<Reason extends string, CustomProperties extends object> = {
|
|
79
|
+
/**
|
|
80
|
+
* The reason for the event.
|
|
81
|
+
*/
|
|
82
|
+
reason: Reason;
|
|
83
|
+
/**
|
|
84
|
+
* The native event associated with the custom event.
|
|
85
|
+
*/
|
|
86
|
+
event: ReasonToEvent<Reason>;
|
|
87
|
+
} & CustomProperties;
|
|
88
|
+
|
|
89
|
+
declare type BaseUIGenericEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIGenericEventDetail<Reason, CustomProperties> & {} : never;
|
|
90
|
+
|
|
91
|
+
declare const cancelOpen: "cancel-open";
|
|
92
|
+
|
|
93
|
+
declare interface ChangeEventCustomProperties {
|
|
94
|
+
direction?: Direction | undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
declare const chipRemovePress: "chip-remove-press";
|
|
98
|
+
|
|
99
|
+
declare const clearPress: "clear-press";
|
|
100
|
+
|
|
101
|
+
declare const closePress: "close-press";
|
|
102
|
+
|
|
103
|
+
declare const closeWatcher: "close-watcher";
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 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.
|
|
107
|
+
*
|
|
108
|
+
* @template Props Props to be spread on the rendered element.
|
|
109
|
+
* @template State Component's internal state.
|
|
110
|
+
*/
|
|
111
|
+
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
112
|
+
|
|
113
|
+
declare const decrementPress: "decrement-press";
|
|
114
|
+
|
|
115
|
+
declare type Direction = -1 | 1;
|
|
116
|
+
|
|
117
|
+
declare const disabled: "disabled";
|
|
118
|
+
|
|
119
|
+
declare const drag: "drag";
|
|
120
|
+
|
|
121
|
+
declare const escapeKey: "escape-key";
|
|
122
|
+
|
|
123
|
+
declare interface FieldRootState {
|
|
124
|
+
/**
|
|
125
|
+
* Whether the component should ignore user interaction.
|
|
126
|
+
*/
|
|
127
|
+
disabled: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether the field has been touched.
|
|
130
|
+
*/
|
|
131
|
+
touched: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether the field value has changed from its initial value.
|
|
134
|
+
*/
|
|
135
|
+
dirty: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the field is valid.
|
|
138
|
+
*/
|
|
139
|
+
valid: boolean | null;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the field has a value.
|
|
142
|
+
*/
|
|
143
|
+
filled: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the field is focused.
|
|
146
|
+
*/
|
|
147
|
+
focused: boolean;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
declare const focusOut: "focus-out";
|
|
151
|
+
|
|
152
|
+
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
153
|
+
ref?: React_2.Ref<T> | undefined;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
declare const imperativeAction: "imperative-action";
|
|
157
|
+
|
|
158
|
+
declare const incrementPress: "increment-press";
|
|
159
|
+
|
|
160
|
+
declare const initial: "initial";
|
|
161
|
+
|
|
162
|
+
declare const inputBlur: "input-blur";
|
|
163
|
+
|
|
164
|
+
declare const inputChange: "input-change";
|
|
165
|
+
|
|
166
|
+
declare const inputClear: "input-clear";
|
|
167
|
+
|
|
168
|
+
declare const inputPaste: "input-paste";
|
|
169
|
+
|
|
170
|
+
declare const inputPress: "input-press";
|
|
171
|
+
|
|
172
|
+
declare const itemPress: "item-press";
|
|
173
|
+
|
|
174
|
+
declare const keyboard: "keyboard";
|
|
175
|
+
|
|
176
|
+
declare const linkPress: "link-press";
|
|
177
|
+
|
|
178
|
+
declare const listNavigation: "list-navigation";
|
|
179
|
+
|
|
180
|
+
declare const missing: "missing";
|
|
181
|
+
|
|
182
|
+
declare interface NativeButtonProps {
|
|
183
|
+
/**
|
|
184
|
+
* Whether the component renders a native `<button>` element when replacing it
|
|
185
|
+
* via the `render` prop.
|
|
186
|
+
* Set to `false` if the rendered element is not a button (for example, `<div>`).
|
|
187
|
+
* @default true
|
|
188
|
+
*/
|
|
189
|
+
nativeButton?: boolean | undefined;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
declare const none: "none";
|
|
193
|
+
|
|
10
194
|
export declare const NumberField: {
|
|
11
|
-
Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
195
|
+
Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NumberFieldRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
12
196
|
className?: string | undefined;
|
|
13
197
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
Group: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
198
|
+
Group: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NumberFieldGroupProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
15
199
|
className?: string | undefined;
|
|
16
200
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
Increment: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
201
|
+
Increment: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NumberFieldIncrementProps_2, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
18
202
|
className?: string | undefined;
|
|
19
203
|
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
20
|
-
Decrement: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
204
|
+
Decrement: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NumberFieldDecrementProps_2, "ref"> & React_2.RefAttributes<HTMLButtonElement>, "ref">, "className"> & {
|
|
21
205
|
className?: string | undefined;
|
|
22
206
|
} & React_2.RefAttributes<HTMLButtonElement>>;
|
|
23
|
-
Input: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
207
|
+
Input: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NumberFieldInputProps_2, "ref"> & React_2.RefAttributes<HTMLInputElement>, "ref">, "className"> & {
|
|
24
208
|
className?: string | undefined;
|
|
25
209
|
} & React_2.RefAttributes<HTMLInputElement>>;
|
|
26
|
-
ScrubArea: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
210
|
+
ScrubArea: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NumberFieldScrubAreaProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
|
|
27
211
|
className?: string | undefined;
|
|
28
212
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
29
|
-
ScrubAreaCursor: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<
|
|
213
|
+
ScrubAreaCursor: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<NumberFieldScrubAreaCursorProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
|
|
30
214
|
className?: string | undefined;
|
|
31
215
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
32
216
|
};
|
|
33
217
|
|
|
218
|
+
/**
|
|
219
|
+
* A stepper button that decreases the field value when clicked.
|
|
220
|
+
* Renders an `<button>` element.
|
|
221
|
+
*
|
|
222
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
223
|
+
*/
|
|
224
|
+
export declare const NumberFieldDecrement: React_2.ForwardRefExoticComponent<Omit<NumberFieldDecrementProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
225
|
+
|
|
226
|
+
export declare namespace NumberFieldDecrement {
|
|
227
|
+
export type State = NumberFieldDecrementState;
|
|
228
|
+
export type Props = NumberFieldDecrementProps;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare interface NumberFieldDecrementProps extends NativeButtonProps, BaseUIComponentProps<'button', NumberFieldDecrementState> {}
|
|
232
|
+
|
|
233
|
+
export declare interface NumberFieldDecrementState extends NumberFieldRootState {}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Groups the input with the increment and decrement buttons.
|
|
237
|
+
* Renders a `<div>` element.
|
|
238
|
+
*
|
|
239
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
240
|
+
*/
|
|
241
|
+
export declare const NumberFieldGroup: React_2.ForwardRefExoticComponent<Omit<NumberFieldGroupProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
242
|
+
|
|
243
|
+
export declare namespace NumberFieldGroup {
|
|
244
|
+
export type State = NumberFieldGroupState;
|
|
245
|
+
export type Props = NumberFieldGroupProps;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export declare interface NumberFieldGroupProps extends BaseUIComponentProps<'div', NumberFieldGroupState> {}
|
|
249
|
+
|
|
250
|
+
export declare interface NumberFieldGroupState extends NumberFieldRootState {}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* A stepper button that increases the field value when clicked.
|
|
254
|
+
* Renders an `<button>` element.
|
|
255
|
+
*
|
|
256
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
257
|
+
*/
|
|
258
|
+
export declare const NumberFieldIncrement: React_2.ForwardRefExoticComponent<Omit<NumberFieldIncrementProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
259
|
+
|
|
260
|
+
export declare namespace NumberFieldIncrement {
|
|
261
|
+
export type State = NumberFieldIncrementState;
|
|
262
|
+
export type Props = NumberFieldIncrementProps;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export declare interface NumberFieldIncrementProps extends NativeButtonProps, BaseUIComponentProps<'button', NumberFieldIncrementState> {}
|
|
266
|
+
|
|
267
|
+
export declare interface NumberFieldIncrementState extends NumberFieldRootState {}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The native input control in the number field.
|
|
271
|
+
* Renders an `<input>` element.
|
|
272
|
+
*
|
|
273
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
274
|
+
*/
|
|
275
|
+
export declare const NumberFieldInput: React_2.ForwardRefExoticComponent<Omit<NumberFieldInputProps, "ref"> & React_2.RefAttributes<HTMLInputElement>>;
|
|
276
|
+
|
|
277
|
+
export declare namespace NumberFieldInput {
|
|
278
|
+
export type State = NumberFieldInputState;
|
|
279
|
+
export type Props = NumberFieldInputProps;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export declare interface NumberFieldInputProps extends BaseUIComponentProps<'input', NumberFieldInputState> {
|
|
283
|
+
/**
|
|
284
|
+
* A string value that provides a user-friendly name for the role of the input.
|
|
285
|
+
* @default 'Number field'
|
|
286
|
+
*/
|
|
287
|
+
'aria-roledescription'?: React_2.AriaAttributes['aria-roledescription'] | undefined;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export declare interface NumberFieldInputState extends NumberFieldRootState {}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Groups all parts of the number field and manages its state.
|
|
294
|
+
* Renders a `<div>` element.
|
|
295
|
+
*
|
|
296
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
297
|
+
*/
|
|
298
|
+
export declare const NumberFieldRoot: React_2.ForwardRefExoticComponent<Omit<NumberFieldRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
299
|
+
|
|
300
|
+
export declare namespace NumberFieldRoot {
|
|
301
|
+
export type State = NumberFieldRootState;
|
|
302
|
+
export type Props = NumberFieldRootProps;
|
|
303
|
+
export type ChangeEventReason = NumberFieldRootChangeEventReason;
|
|
304
|
+
export type ChangeEventDetails = NumberFieldRootChangeEventDetails;
|
|
305
|
+
export type CommitEventReason = NumberFieldRootCommitEventReason;
|
|
306
|
+
export type CommitEventDetails = NumberFieldRootCommitEventDetails;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export declare type NumberFieldRootChangeEventDetails = BaseUIChangeEventDetails<NumberFieldRootChangeEventReason, ChangeEventCustomProperties>;
|
|
310
|
+
|
|
311
|
+
export declare type NumberFieldRootChangeEventReason = typeof REASONS.inputChange | typeof REASONS.inputClear | typeof REASONS.inputBlur | typeof REASONS.inputPaste | typeof REASONS.keyboard | typeof REASONS.incrementPress | typeof REASONS.decrementPress | typeof REASONS.wheel | typeof REASONS.scrub | typeof REASONS.none;
|
|
312
|
+
|
|
313
|
+
export declare type NumberFieldRootCommitEventDetails = BaseUIGenericEventDetails<NumberFieldRoot.CommitEventReason>;
|
|
314
|
+
|
|
315
|
+
export declare type NumberFieldRootCommitEventReason = typeof REASONS.inputBlur | typeof REASONS.inputClear | typeof REASONS.keyboard | typeof REASONS.incrementPress | typeof REASONS.decrementPress | typeof REASONS.wheel | typeof REASONS.scrub | typeof REASONS.none;
|
|
316
|
+
|
|
317
|
+
export declare interface NumberFieldRootProps extends Omit<BaseUIComponentProps<'div', NumberFieldRootState>, 'onChange'> {
|
|
318
|
+
/**
|
|
319
|
+
* The id of the input element.
|
|
320
|
+
*/
|
|
321
|
+
id?: string | undefined;
|
|
322
|
+
/**
|
|
323
|
+
* The minimum value of the input element.
|
|
324
|
+
*/
|
|
325
|
+
min?: number | undefined;
|
|
326
|
+
/**
|
|
327
|
+
* The maximum value of the input element.
|
|
328
|
+
*/
|
|
329
|
+
max?: number | undefined;
|
|
330
|
+
/**
|
|
331
|
+
* When true, direct text entry may be outside the `min`/`max` range without clamping,
|
|
332
|
+
* so native range underflow/overflow validation can occur.
|
|
333
|
+
* Step-based interactions (keyboard arrows, buttons, wheel, scrub) still clamp.
|
|
334
|
+
* @default false
|
|
335
|
+
*/
|
|
336
|
+
allowOutOfRange?: boolean | undefined;
|
|
337
|
+
/**
|
|
338
|
+
* The small step value of the input element when incrementing while the meta key is held. Snaps
|
|
339
|
+
* to multiples of this value.
|
|
340
|
+
* @default 0.1
|
|
341
|
+
*/
|
|
342
|
+
smallStep?: number | undefined;
|
|
343
|
+
/**
|
|
344
|
+
* Amount to increment and decrement with the buttons and arrow keys, or to scrub with pointer movement in the scrub area.
|
|
345
|
+
* To always enable step validation on form submission, specify the `min` prop explicitly in conjunction with this prop.
|
|
346
|
+
* Specify `step="any"` to always disable step validation.
|
|
347
|
+
* @default 1
|
|
348
|
+
*/
|
|
349
|
+
step?: number | 'any' | undefined;
|
|
350
|
+
/**
|
|
351
|
+
* The large step value of the input element when incrementing while the shift key is held. Snaps
|
|
352
|
+
* to multiples of this value.
|
|
353
|
+
* @default 10
|
|
354
|
+
*/
|
|
355
|
+
largeStep?: number | undefined;
|
|
356
|
+
/**
|
|
357
|
+
* Whether the user must enter a value before submitting a form.
|
|
358
|
+
* @default false
|
|
359
|
+
*/
|
|
360
|
+
required?: boolean | undefined;
|
|
361
|
+
/**
|
|
362
|
+
* Whether the component should ignore user interaction.
|
|
363
|
+
* @default false
|
|
364
|
+
*/
|
|
365
|
+
disabled?: boolean | undefined;
|
|
366
|
+
/**
|
|
367
|
+
* Whether the user should be unable to change the field value.
|
|
368
|
+
* @default false
|
|
369
|
+
*/
|
|
370
|
+
readOnly?: boolean | undefined;
|
|
371
|
+
/**
|
|
372
|
+
* Identifies the field when a form is submitted.
|
|
373
|
+
*/
|
|
374
|
+
name?: string | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* Identifies the form that owns the hidden input.
|
|
377
|
+
* Useful when the number field is rendered outside the form.
|
|
378
|
+
*/
|
|
379
|
+
form?: string | undefined;
|
|
380
|
+
/**
|
|
381
|
+
* The raw numeric value of the field.
|
|
382
|
+
*/
|
|
383
|
+
value?: number | null | undefined;
|
|
384
|
+
/**
|
|
385
|
+
* The uncontrolled value of the field when it's initially rendered.
|
|
386
|
+
*
|
|
387
|
+
* To render a controlled number field, use the `value` prop instead.
|
|
388
|
+
*/
|
|
389
|
+
defaultValue?: number | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* Whether to allow the user to scrub the input value with the mouse wheel while focused and
|
|
392
|
+
* hovering over the input.
|
|
393
|
+
* @default false
|
|
394
|
+
*/
|
|
395
|
+
allowWheelScrub?: boolean | undefined;
|
|
396
|
+
/**
|
|
397
|
+
* Whether the value should snap to the nearest step when incrementing or decrementing.
|
|
398
|
+
* @default false
|
|
399
|
+
*/
|
|
400
|
+
snapOnStep?: boolean | undefined;
|
|
401
|
+
/**
|
|
402
|
+
* Options to format the input value.
|
|
403
|
+
*/
|
|
404
|
+
format?: Intl.NumberFormatOptions | undefined;
|
|
405
|
+
/**
|
|
406
|
+
* Callback fired when the number value changes.
|
|
407
|
+
*
|
|
408
|
+
* The `eventDetails.reason` indicates what triggered the change:
|
|
409
|
+
* - `'input-change'` for parseable typing or programmatic text updates
|
|
410
|
+
* - `'input-clear'` when the field becomes empty
|
|
411
|
+
* - `'input-blur'` when formatting (and clamping, if enabled) occurs on blur
|
|
412
|
+
* - `'input-paste'` for paste interactions
|
|
413
|
+
* - `'keyboard'` for keyboard input
|
|
414
|
+
* - `'increment-press'` / `'decrement-press'` for button presses on the increment and decrement controls
|
|
415
|
+
* - `'wheel'` for wheel-based scrubbing
|
|
416
|
+
* - `'scrub'` for scrub area drags
|
|
417
|
+
*/
|
|
418
|
+
onValueChange?: ((value: number | null, eventDetails: NumberFieldRoot.ChangeEventDetails) => void) | undefined;
|
|
419
|
+
/**
|
|
420
|
+
* Callback function that is fired when the value is committed.
|
|
421
|
+
* It runs later than `onValueChange`, when:
|
|
422
|
+
* - The input is blurred after typing a value.
|
|
423
|
+
* - The pointer is released after scrubbing or pressing the increment/decrement buttons.
|
|
424
|
+
*
|
|
425
|
+
* It runs simultaneously with `onValueChange` when interacting with the keyboard.
|
|
426
|
+
*
|
|
427
|
+
* **Warning**: This is a generic event not a change event.
|
|
428
|
+
*/
|
|
429
|
+
onValueCommitted?: ((value: number | null, eventDetails: NumberFieldRoot.CommitEventDetails) => void) | undefined;
|
|
430
|
+
/**
|
|
431
|
+
* The locale of the input element.
|
|
432
|
+
* Defaults to the user's runtime locale.
|
|
433
|
+
*/
|
|
434
|
+
locale?: Intl.LocalesArgument | undefined;
|
|
435
|
+
/**
|
|
436
|
+
* A ref to access the hidden input element.
|
|
437
|
+
*/
|
|
438
|
+
inputRef?: React_2.Ref<HTMLInputElement> | undefined;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export declare interface NumberFieldRootState extends FieldRootState {
|
|
442
|
+
/**
|
|
443
|
+
* The raw numeric value of the field.
|
|
444
|
+
*/
|
|
445
|
+
value: number | null;
|
|
446
|
+
/**
|
|
447
|
+
* The formatted string value presented in the input element.
|
|
448
|
+
*/
|
|
449
|
+
inputValue: string;
|
|
450
|
+
/**
|
|
451
|
+
* Whether the user must enter a value before submitting a form.
|
|
452
|
+
*/
|
|
453
|
+
required: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* Whether the component should ignore user interaction.
|
|
456
|
+
*/
|
|
457
|
+
disabled: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* Whether the user should be unable to change the field value.
|
|
460
|
+
*/
|
|
461
|
+
readOnly: boolean;
|
|
462
|
+
/**
|
|
463
|
+
* Whether the user is currently scrubbing the field.
|
|
464
|
+
*/
|
|
465
|
+
scrubbing: boolean;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* An interactive area where the user can click and drag to change the field value.
|
|
470
|
+
* Renders a `<span>` element.
|
|
471
|
+
*
|
|
472
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
473
|
+
*/
|
|
474
|
+
export declare const NumberFieldScrubArea: React_2.ForwardRefExoticComponent<Omit<NumberFieldScrubAreaProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
475
|
+
|
|
476
|
+
export declare namespace NumberFieldScrubArea {
|
|
477
|
+
export type State = NumberFieldScrubAreaState;
|
|
478
|
+
export type Props = NumberFieldScrubAreaProps;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* A custom element to display instead of the native cursor while using the scrub area.
|
|
483
|
+
* Renders a `<span>` element.
|
|
484
|
+
*
|
|
485
|
+
* This component uses the [Pointer Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API), which may prompt the browser to display a related notification. It is disabled
|
|
486
|
+
* in Safari to avoid a layout shift that this notification causes there.
|
|
487
|
+
*
|
|
488
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
489
|
+
*/
|
|
490
|
+
export declare const NumberFieldScrubAreaCursor: React_2.ForwardRefExoticComponent<Omit<NumberFieldScrubAreaCursorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
491
|
+
|
|
492
|
+
export declare namespace NumberFieldScrubAreaCursor {
|
|
493
|
+
export type State = NumberFieldScrubAreaCursorState;
|
|
494
|
+
export type Props = NumberFieldScrubAreaCursorProps;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export declare interface NumberFieldScrubAreaCursorProps extends BaseUIComponentProps<'span', NumberFieldScrubAreaCursorState> {}
|
|
498
|
+
|
|
499
|
+
export declare interface NumberFieldScrubAreaCursorState extends NumberFieldRootState {}
|
|
500
|
+
|
|
501
|
+
export declare interface NumberFieldScrubAreaProps extends BaseUIComponentProps<'span', NumberFieldScrubAreaState> {
|
|
502
|
+
/**
|
|
503
|
+
* Cursor movement direction in the scrub area.
|
|
504
|
+
* @default 'horizontal'
|
|
505
|
+
*/
|
|
506
|
+
direction?: 'horizontal' | 'vertical' | undefined;
|
|
507
|
+
/**
|
|
508
|
+
* Determines how many pixels the cursor must move before the value changes.
|
|
509
|
+
* A higher value will make scrubbing less sensitive.
|
|
510
|
+
* @default 2
|
|
511
|
+
*/
|
|
512
|
+
pixelSensitivity?: number | undefined;
|
|
513
|
+
/**
|
|
514
|
+
* If specified, determines the distance that the cursor may move from the center
|
|
515
|
+
* of the scrub area before it will loop back around.
|
|
516
|
+
*/
|
|
517
|
+
teleportDistance?: number | undefined;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export declare interface NumberFieldScrubAreaState extends NumberFieldRootState {}
|
|
521
|
+
|
|
522
|
+
declare const outsidePress: "outside-press";
|
|
523
|
+
|
|
524
|
+
declare const pointer: "pointer";
|
|
525
|
+
|
|
526
|
+
declare namespace REASONS {
|
|
527
|
+
export {
|
|
528
|
+
none,
|
|
529
|
+
triggerPress,
|
|
530
|
+
triggerHover,
|
|
531
|
+
triggerFocus,
|
|
532
|
+
outsidePress,
|
|
533
|
+
itemPress,
|
|
534
|
+
closePress,
|
|
535
|
+
linkPress,
|
|
536
|
+
clearPress,
|
|
537
|
+
chipRemovePress,
|
|
538
|
+
trackPress,
|
|
539
|
+
incrementPress,
|
|
540
|
+
decrementPress,
|
|
541
|
+
inputChange,
|
|
542
|
+
inputClear,
|
|
543
|
+
inputBlur,
|
|
544
|
+
inputPaste,
|
|
545
|
+
inputPress,
|
|
546
|
+
focusOut,
|
|
547
|
+
escapeKey,
|
|
548
|
+
closeWatcher,
|
|
549
|
+
listNavigation,
|
|
550
|
+
keyboard,
|
|
551
|
+
pointer,
|
|
552
|
+
drag,
|
|
553
|
+
wheel,
|
|
554
|
+
scrub,
|
|
555
|
+
cancelOpen,
|
|
556
|
+
siblingOpen,
|
|
557
|
+
disabled,
|
|
558
|
+
missing,
|
|
559
|
+
initial,
|
|
560
|
+
imperativeAction,
|
|
561
|
+
swipe,
|
|
562
|
+
windowResize
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Maps a change `reason` string to the corresponding native event type.
|
|
568
|
+
*/
|
|
569
|
+
declare type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
|
|
570
|
+
|
|
571
|
+
declare interface ReasonToEventMap {
|
|
572
|
+
[REASONS.none]: Event;
|
|
573
|
+
[REASONS.triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
574
|
+
[REASONS.triggerHover]: MouseEvent;
|
|
575
|
+
[REASONS.triggerFocus]: FocusEvent;
|
|
576
|
+
[REASONS.outsidePress]: MouseEvent | PointerEvent | TouchEvent;
|
|
577
|
+
[REASONS.itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
578
|
+
[REASONS.closePress]: MouseEvent | KeyboardEvent | PointerEvent;
|
|
579
|
+
[REASONS.linkPress]: MouseEvent | PointerEvent;
|
|
580
|
+
[REASONS.clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
581
|
+
[REASONS.chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
|
|
582
|
+
[REASONS.trackPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
583
|
+
[REASONS.incrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
584
|
+
[REASONS.decrementPress]: PointerEvent | MouseEvent | TouchEvent;
|
|
585
|
+
[REASONS.inputChange]: InputEvent | Event;
|
|
586
|
+
[REASONS.inputClear]: InputEvent | FocusEvent | Event;
|
|
587
|
+
[REASONS.inputBlur]: FocusEvent;
|
|
588
|
+
[REASONS.inputPaste]: ClipboardEvent;
|
|
589
|
+
[REASONS.inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
|
|
590
|
+
[REASONS.focusOut]: FocusEvent | KeyboardEvent;
|
|
591
|
+
[REASONS.escapeKey]: KeyboardEvent;
|
|
592
|
+
[REASONS.closeWatcher]: Event;
|
|
593
|
+
[REASONS.listNavigation]: KeyboardEvent;
|
|
594
|
+
[REASONS.keyboard]: KeyboardEvent;
|
|
595
|
+
[REASONS.pointer]: PointerEvent;
|
|
596
|
+
[REASONS.drag]: PointerEvent | TouchEvent;
|
|
597
|
+
[REASONS.swipe]: PointerEvent | TouchEvent;
|
|
598
|
+
[REASONS.wheel]: WheelEvent;
|
|
599
|
+
[REASONS.scrub]: PointerEvent;
|
|
600
|
+
[REASONS.cancelOpen]: MouseEvent;
|
|
601
|
+
[REASONS.siblingOpen]: Event;
|
|
602
|
+
[REASONS.disabled]: Event;
|
|
603
|
+
[REASONS.missing]: Event;
|
|
604
|
+
[REASONS.initial]: Event;
|
|
605
|
+
[REASONS.imperativeAction]: Event;
|
|
606
|
+
[REASONS.windowResize]: UIEvent;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
declare const scrub: "scrub";
|
|
610
|
+
|
|
611
|
+
declare const siblingOpen: "sibling-open";
|
|
612
|
+
|
|
613
|
+
declare const swipe: "swipe";
|
|
614
|
+
|
|
615
|
+
declare const trackPress: "track-press";
|
|
616
|
+
|
|
617
|
+
declare const triggerFocus: "trigger-focus";
|
|
618
|
+
|
|
619
|
+
declare const triggerHover: "trigger-hover";
|
|
620
|
+
|
|
621
|
+
declare const triggerPress: "trigger-press";
|
|
622
|
+
|
|
623
|
+
declare const wheel: "wheel";
|
|
624
|
+
|
|
625
|
+
declare const windowResize: "window-resize";
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Adds a `preventBaseUIHandler` method to all event handlers.
|
|
629
|
+
*/
|
|
630
|
+
declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
|
|
34
631
|
|
|
35
|
-
|
|
632
|
+
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;
|
|
36
633
|
|
|
37
634
|
export { }
|