@wix/site-ui 1.29.0 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/1268.js +99 -0
  2. package/dist/1279.js +7 -0
  3. package/dist/1457.js +10 -0
  4. package/dist/1477.js +106 -0
  5. package/dist/1500.js +111 -0
  6. package/dist/167.js +6 -0
  7. package/dist/2274.js +34 -0
  8. package/dist/2287.js +17 -0
  9. package/dist/2418.js +31 -0
  10. package/dist/2801.js +20 -0
  11. package/dist/285.js +86 -0
  12. package/dist/2861.js +6 -0
  13. package/dist/3020.js +7 -0
  14. package/dist/3021.js +72 -0
  15. package/dist/3056.js +229 -0
  16. package/dist/3140.js +4 -0
  17. package/dist/3248.js +307 -0
  18. package/dist/3296.js +4 -0
  19. package/dist/3319.js +400 -0
  20. package/dist/3395.js +4 -0
  21. package/dist/3485.js +854 -0
  22. package/dist/353.js +14 -0
  23. package/dist/3670.js +418 -0
  24. package/dist/3829.js +113 -0
  25. package/dist/4026.js +12 -0
  26. package/dist/4143.js +46 -0
  27. package/dist/42.js +32 -0
  28. package/dist/4281.js +30 -0
  29. package/dist/4346.js +2 -0
  30. package/dist/4388.js +418 -0
  31. package/dist/4490.js +32 -0
  32. package/dist/4495.js +9 -0
  33. package/dist/4549.js +24 -0
  34. package/dist/4586.js +41 -0
  35. package/dist/4586.js.LICENSE.txt +19 -0
  36. package/dist/4707.js +19 -0
  37. package/dist/4723.js +7 -0
  38. package/dist/4745.js +7 -0
  39. package/dist/4768.js +35 -0
  40. package/dist/4922.js +15 -0
  41. package/dist/5036.js +17 -0
  42. package/dist/5085.js +20 -0
  43. package/dist/5299.js +597 -0
  44. package/dist/5659.js +4 -0
  45. package/dist/5778.js +10 -0
  46. package/dist/5864.js +86 -0
  47. package/dist/5992.js +913 -0
  48. package/dist/5992.js.LICENSE.txt +19 -0
  49. package/dist/6003.js +10 -0
  50. package/dist/6046.js +29 -0
  51. package/dist/6089.js +2355 -0
  52. package/dist/6107.js +10 -0
  53. package/dist/6247.js +20 -0
  54. package/dist/6270.js +487 -0
  55. package/dist/6329.js +32 -0
  56. package/dist/6330.js +30 -0
  57. package/dist/6499.js +7 -0
  58. package/dist/6535.js +71 -0
  59. package/dist/6588.js +382 -0
  60. package/dist/6706.js +16 -0
  61. package/dist/6825.js +7 -0
  62. package/dist/6882.js +1562 -0
  63. package/dist/6914.js +30 -0
  64. package/dist/7021.js +13 -0
  65. package/dist/7366.js +83 -0
  66. package/dist/7373.js +25 -0
  67. package/dist/7541.js +25 -0
  68. package/dist/7564.js +10 -0
  69. package/dist/7642.js +20 -0
  70. package/dist/7725.js +10 -0
  71. package/dist/7871.js +38 -0
  72. package/dist/8052.js +352 -0
  73. package/dist/8106.js +238 -0
  74. package/dist/8171.js +346 -0
  75. package/dist/8225.js +21 -0
  76. package/dist/8272.js +333 -0
  77. package/dist/8527.js +58 -0
  78. package/dist/8724.js +10 -0
  79. package/dist/8750.js +1920 -0
  80. package/dist/8758.js +43 -0
  81. package/dist/880.js +149 -0
  82. package/dist/8935.js +8 -0
  83. package/dist/8960.js +22 -0
  84. package/dist/8971.js +40 -0
  85. package/dist/8979.js +10 -0
  86. package/dist/8996.js +71 -0
  87. package/dist/904.js +121 -0
  88. package/dist/9048.js +52 -0
  89. package/dist/9087.js +256 -0
  90. package/dist/9189.js +158 -0
  91. package/dist/9255.js +136 -0
  92. package/dist/9352.js +148 -0
  93. package/dist/951.js +22 -0
  94. package/dist/9635.js +22 -0
  95. package/dist/9829.js +4 -0
  96. package/dist/9863.js +8 -0
  97. package/dist/Accordion/index.d.ts +569 -12
  98. package/dist/Accordion/index.js +423 -8
  99. package/dist/AlertDialog/index.d.ts +1417 -18
  100. package/dist/AlertDialog/index.js +34 -14
  101. package/dist/Autocomplete/index.d.ts +1861 -38
  102. package/dist/Autocomplete/index.js +98 -24
  103. package/dist/Avatar/index.d.ts +129 -7
  104. package/dist/Avatar/index.js +149 -6
  105. package/dist/Badge/index.css +44 -0
  106. package/dist/Badge/index.d.ts +22 -0
  107. package/dist/Badge/index.js +23 -0
  108. package/dist/Breadcrumbs/index.d.ts +960 -7
  109. package/dist/Breadcrumbs/index.js +5 -5
  110. package/dist/Button/index.d.ts +88 -6
  111. package/dist/Button/index.js +27 -3
  112. package/dist/Checkbox/index.d.ts +425 -5
  113. package/dist/Checkbox/index.js +45 -5
  114. package/dist/CheckboxGroup/index.d.ts +318 -3
  115. package/dist/CheckboxGroup/index.js +166 -3
  116. package/dist/Collapsible/index.d.ts +377 -7
  117. package/dist/Collapsible/index.js +160 -6
  118. package/dist/Combobox/index.d.ts +1984 -48
  119. package/dist/Combobox/index.js +352 -29
  120. package/dist/ContextMenu/index.d.ts +2340 -36
  121. package/dist/ContextMenu/index.js +197 -22
  122. package/dist/Dialog/index.d.ts +1355 -18
  123. package/dist/Dialog/index.js +16 -14
  124. package/dist/Drawer/index.d.ts +1653 -18
  125. package/dist/Drawer/index.js +2797 -20
  126. package/dist/Field/index.d.ts +655 -15
  127. package/dist/Field/index.js +677 -10
  128. package/dist/Fieldset/index.d.ts +94 -5
  129. package/dist/Fieldset/index.js +68 -5
  130. package/dist/Form/index.d.ts +331 -2
  131. package/dist/Form/index.js +106 -3
  132. package/dist/Input/index.d.ts +692 -3
  133. package/dist/Input/index.js +10 -3
  134. package/dist/Menu/index.d.ts +2301 -36
  135. package/dist/Menu/index.js +365 -26
  136. package/dist/Menubar/index.d.ts +2301 -3
  137. package/dist/Menubar/index.js +105 -3
  138. package/dist/Meter/index.d.ts +175 -11
  139. package/dist/Meter/index.js +129 -9
  140. package/dist/NavigationMenu/index.d.ts +978 -28
  141. package/dist/NavigationMenu/index.js +1034 -17
  142. package/dist/NumberField/index.d.ts +612 -15
  143. package/dist/NumberField/index.js +1409 -11
  144. package/dist/Popover/index.d.ts +1655 -20
  145. package/dist/Popover/index.js +792 -17
  146. package/dist/PreviewCard/index.d.ts +1523 -14
  147. package/dist/PreviewCard/index.js +679 -14
  148. package/dist/Progress/index.d.ts +183 -11
  149. package/dist/Progress/index.js +181 -9
  150. package/dist/Radio/index.d.ts +185 -6
  151. package/dist/Radio/index.js +253 -6
  152. package/dist/RadioGroup/index.d.ts +341 -2
  153. package/dist/RadioGroup/index.js +154 -3
  154. package/dist/ScrollArea/index.d.ts +265 -13
  155. package/dist/ScrollArea/index.js +892 -10
  156. package/dist/Select/index.d.ts +1493 -38
  157. package/dist/Select/index.js +1824 -23
  158. package/dist/Separator/index.d.ts +80 -6
  159. package/dist/Separator/index.js +3 -3
  160. package/dist/Slider/index.d.ts +678 -16
  161. package/dist/Slider/index.js +1199 -11
  162. package/dist/Switch/index.d.ts +393 -5
  163. package/dist/Switch/index.js +208 -6
  164. package/dist/Tabs/index.d.ts +523 -12
  165. package/dist/Tabs/index.js +685 -9
  166. package/dist/Toggle/index.d.ts +305 -2
  167. package/dist/Toggle/index.js +76 -3
  168. package/dist/ToggleGroup/index.d.ts +316 -2
  169. package/dist/ToggleGroup/index.js +102 -3
  170. package/dist/Toolbar/index.d.ts +282 -13
  171. package/dist/Toolbar/index.js +230 -9
  172. package/dist/Tooltip/index.d.ts +1572 -14
  173. package/dist/Tooltip/index.js +965 -14
  174. package/dist/index.d.ts +12758 -646
  175. package/dist/index.js +1 -0
  176. package/dist/rslib-runtime.js +18 -0
  177. package/package.json +3 -3
@@ -1,11 +1,700 @@
1
- import { InputProps } from '@base-ui/react/input';
1
+ import { InputProps as InputProps_2 } from '@base-ui/react/input';
2
2
  import * as React_2 from 'react';
3
3
 
4
- export declare const Input: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<InputProps, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">, "className"> & {
4
+ declare type BaseUIChangeEventDetail<Reason extends string, CustomProperties extends object> = {
5
+ /**
6
+ * The reason for the event.
7
+ */
8
+ reason: Reason;
9
+ /**
10
+ * The native event associated with the custom event.
11
+ */
12
+ event: ReasonToEvent<Reason>;
13
+ /**
14
+ * Cancels Base UI from handling the event.
15
+ */
16
+ cancel: () => void;
17
+ /**
18
+ * Allows the event to propagate in cases where Base UI will stop the propagation.
19
+ */
20
+ allowPropagation: () => void;
21
+ /**
22
+ * Indicates whether the event has been canceled.
23
+ */
24
+ isCanceled: boolean;
25
+ /**
26
+ * Indicates whether the event is allowed to propagate.
27
+ */
28
+ isPropagationAllowed: boolean;
29
+ /**
30
+ * The element that triggered the event, if applicable.
31
+ */
32
+ trigger: Element | undefined;
33
+ } & CustomProperties;
34
+
35
+ /**
36
+ * Details of custom change events emitted by Base UI components.
37
+ */
38
+ declare type BaseUIChangeEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIChangeEventDetail<Reason, CustomProperties> & {} : never;
39
+
40
+ /**
41
+ * Props shared by all Base UI components.
42
+ * Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
43
+ */
44
+ declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
45
+ /**
46
+ * CSS class applied to the element, or a function that
47
+ * returns a class based on the component's state.
48
+ */
49
+ className?: string | ((state: State) => string | undefined) | undefined;
50
+ /**
51
+ * Allows you to replace the component's HTML element
52
+ * with a different tag, or compose it with another component.
53
+ *
54
+ * Accepts a `ReactElement` or a function that returns the element to render.
55
+ */
56
+ render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
57
+ /**
58
+ * Style applied to the element, or a function that
59
+ * returns a style object based on the component's state.
60
+ */
61
+ style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
62
+ };
63
+
64
+ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
65
+ preventBaseUIHandler: () => void;
66
+ readonly baseUIHandlerPrevented?: boolean | undefined;
67
+ };
68
+
69
+ /**
70
+ * Details of custom generic events emitted by Base UI components.
71
+ */
72
+ declare type BaseUIGenericEventDetail<Reason extends string, CustomProperties extends object> = {
73
+ /**
74
+ * The reason for the event.
75
+ */
76
+ reason: Reason;
77
+ /**
78
+ * The native event associated with the custom event.
79
+ */
80
+ event: ReasonToEvent<Reason>;
81
+ } & CustomProperties;
82
+
83
+ declare type BaseUIGenericEventDetails<Reason extends string, CustomProperties extends object = {}> = Reason extends string ? BaseUIGenericEventDetail<Reason, CustomProperties> & {} : never;
84
+
85
+ declare const cancelOpen: "cancel-open";
86
+
87
+ declare const chipRemovePress: "chip-remove-press";
88
+
89
+ declare const clearPress: "clear-press";
90
+
91
+ declare const closePress: "close-press";
92
+
93
+ declare const closeWatcher: "close-watcher";
94
+
95
+ /**
96
+ * 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.
97
+ *
98
+ * @template Props Props to be spread on the rendered element.
99
+ * @template State Component's internal state.
100
+ */
101
+ declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
102
+
103
+ declare const decrementPress: "decrement-press";
104
+
105
+ declare const disabled: "disabled";
106
+
107
+ declare const drag: "drag";
108
+
109
+ declare type Errors = Record<string, string | string[]>;
110
+
111
+ declare const escapeKey: "escape-key";
112
+
113
+ export declare namespace Field {
114
+ export {
115
+ FieldRoot as Root,
116
+ FieldLabel as Label,
117
+ FieldError as Error,
118
+ FieldDescription as Description,
119
+ FieldControl as Control,
120
+ FieldValidity as Validity,
121
+ FieldItem as Item,
122
+ FieldValidityData as ValidityData
123
+ }
124
+ }
125
+
126
+ /**
127
+ * The form control to label and validate.
128
+ * Renders an `<input>` element.
129
+ *
130
+ * You can omit this part and use any Base UI input component instead. For example,
131
+ * [Input](https://base-ui.com/react/components/input), [Checkbox](https://base-ui.com/react/components/checkbox),
132
+ * or [Select](https://base-ui.com/react/components/select), among others, will work with Field out of the box.
133
+ *
134
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
135
+ */
136
+ declare const FieldControl: React_2.ForwardRefExoticComponent<Omit<FieldControlProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
137
+
138
+ declare namespace FieldControl {
139
+ type State = FieldControlState;
140
+ type Props = FieldControlProps;
141
+ type ChangeEventReason = FieldControlChangeEventReason;
142
+ type ChangeEventDetails = FieldControlChangeEventDetails;
143
+ }
144
+
145
+ declare type FieldControlChangeEventDetails = BaseUIChangeEventDetails<FieldControl.ChangeEventReason>;
146
+
147
+ declare type FieldControlChangeEventReason = typeof REASONS.none;
148
+
149
+ declare interface FieldControlProps extends BaseUIComponentProps<'input', FieldControlState> {
150
+ /**
151
+ * Callback fired when the `value` changes. Use when controlled.
152
+ */
153
+ onValueChange?: ((value: string, eventDetails: FieldControl.ChangeEventDetails) => void) | undefined;
154
+ defaultValue?: React_2.ComponentProps<'input'>['defaultValue'] | undefined;
155
+ }
156
+
157
+ declare interface FieldControlState extends FieldRootState {}
158
+
159
+ /**
160
+ * A paragraph with additional information about the field.
161
+ * Renders a `<p>` element.
162
+ *
163
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
164
+ */
165
+ declare const FieldDescription: React_2.ForwardRefExoticComponent<Omit<FieldDescriptionProps, "ref"> & React_2.RefAttributes<HTMLParagraphElement>>;
166
+
167
+ declare namespace FieldDescription {
168
+ type State = FieldDescriptionState;
169
+ type Props = FieldDescriptionProps;
170
+ }
171
+
172
+ declare interface FieldDescriptionProps extends BaseUIComponentProps<'p', FieldDescriptionState> {}
173
+
174
+ declare interface FieldDescriptionState extends FieldRootState {}
175
+
176
+ /**
177
+ * An error message displayed if the field control fails validation.
178
+ * Renders a `<div>` element.
179
+ *
180
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
181
+ */
182
+ declare const FieldError: React_2.ForwardRefExoticComponent<Omit<FieldErrorProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
183
+
184
+ declare namespace FieldError {
185
+ type State = FieldErrorState;
186
+ type Props = FieldErrorProps;
187
+ }
188
+
189
+ declare interface FieldErrorProps extends BaseUIComponentProps<'div', FieldErrorState> {
190
+ /**
191
+ * Determines whether to show the error message according to the field's
192
+ * [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState).
193
+ * Specifying `true` will always show the error message, and lets external libraries
194
+ * control the visibility.
195
+ */
196
+ match?: boolean | keyof ValidityState | undefined;
197
+ }
198
+
199
+ declare interface FieldErrorState extends FieldRootState {
200
+ /**
201
+ * The transition status of the component.
202
+ */
203
+ transitionStatus: TransitionStatus;
204
+ }
205
+
206
+ /**
207
+ * Groups individual items in a checkbox group or radio group with a label and description.
208
+ * Renders a `<div>` element.
209
+ *
210
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
211
+ */
212
+ declare const FieldItem: React_2.ForwardRefExoticComponent<Omit<FieldItemProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
213
+
214
+ declare namespace FieldItem {
215
+ type State = FieldItemState;
216
+ type Props = FieldItemProps;
217
+ }
218
+
219
+ declare interface FieldItemProps extends BaseUIComponentProps<'div', FieldItemState> {
220
+ /**
221
+ * Whether the wrapped control should ignore user interaction.
222
+ * The `disabled` prop on `<Field.Root>` takes precedence over this.
223
+ * @default false
224
+ */
225
+ disabled?: boolean | undefined;
226
+ }
227
+
228
+ declare interface FieldItemState extends FieldRootState {}
229
+
230
+ /**
231
+ * An accessible label that is automatically associated with the field control.
232
+ * Renders a `<label>` element.
233
+ *
234
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
235
+ */
236
+ declare const FieldLabel: React_2.ForwardRefExoticComponent<Omit<FieldLabelProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
237
+
238
+ declare namespace FieldLabel {
239
+ type State = FieldLabelState;
240
+ type Props = FieldLabelProps;
241
+ }
242
+
243
+ declare interface FieldLabelProps extends BaseUIComponentProps<'label', FieldLabelState> {
244
+ /**
245
+ * Whether the component renders a native `<label>` element when replacing it via the `render` prop.
246
+ * Set to `false` if the rendered element is not a label (for example, `<div>`).
247
+ *
248
+ * This is useful to avoid inheriting label behaviors on `<button>` controls (such as `<Select.Trigger>` and `<Combobox.Trigger>`), including avoiding `:hover` on the button when hovering the label, and preventing clicks on the label from firing on the button.
249
+ * @default true
250
+ */
251
+ nativeLabel?: boolean | undefined;
252
+ }
253
+
254
+ declare interface FieldLabelState extends FieldRootState {}
255
+
256
+ /**
257
+ * Groups all parts of the field.
258
+ * Renders a `<div>` element.
259
+ *
260
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
261
+ */
262
+ declare const FieldRoot: React_2.ForwardRefExoticComponent<Omit<FieldRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
263
+
264
+ declare namespace FieldRoot {
265
+ type State = FieldRootState;
266
+ type Props = FieldRootProps;
267
+ type Actions = FieldRootActions;
268
+ }
269
+
270
+ declare interface FieldRootActions {
271
+ validate: () => void;
272
+ }
273
+
274
+ declare interface FieldRootProps extends BaseUIComponentProps<'div', FieldRootState> {
275
+ /**
276
+ * Whether the component should ignore user interaction.
277
+ * Takes precedence over the `disabled` prop on the `<Field.Control>` component.
278
+ * @default false
279
+ */
280
+ disabled?: boolean | undefined;
281
+ /**
282
+ * Identifies the field when a form is submitted.
283
+ * Takes precedence over the `name` prop on the `<Field.Control>` component.
284
+ */
285
+ name?: string | undefined;
286
+ /**
287
+ * A function for custom validation. Return a string or an array of strings with
288
+ * the error message(s) if the value is invalid, or `null` if the value is valid.
289
+ * Asynchronous functions are supported, but they do not prevent form submission
290
+ * when using `validationMode="onSubmit"`.
291
+ */
292
+ validate?: ((value: unknown, formValues: Form.Values) => string | string[] | null | Promise<string | string[] | null>) | undefined;
293
+ /**
294
+ * Determines when the field should be validated.
295
+ * This takes precedence over the `validationMode` prop on `<Form>`.
296
+ *
297
+ * - `onSubmit`: triggers validation when the form is submitted, and re-validates on change after submission.
298
+ * - `onBlur`: triggers validation when the control loses focus.
299
+ * - `onChange`: triggers validation on every change to the control value.
300
+ *
301
+ * @default 'onSubmit'
302
+ */
303
+ validationMode?: Form.ValidationMode | undefined;
304
+ /**
305
+ * How long to wait between `validate` callbacks if
306
+ * `validationMode="onChange"` is used. Specified in milliseconds.
307
+ * @default 0
308
+ */
309
+ validationDebounceTime?: number | undefined;
310
+ /**
311
+ * Whether the field is invalid.
312
+ * Useful when the field state is controlled by an external library.
313
+ */
314
+ invalid?: boolean | undefined;
315
+ /**
316
+ * Whether the field's value has been changed from its initial value.
317
+ * Useful when the field state is controlled by an external library.
318
+ */
319
+ dirty?: boolean | undefined;
320
+ /**
321
+ * Whether the field has been touched.
322
+ * Useful when the field state is controlled by an external library.
323
+ */
324
+ touched?: boolean | undefined;
325
+ /**
326
+ * A ref to imperative actions.
327
+ * - `validate`: Validates the field when called.
328
+ */
329
+ actionsRef?: React_2.RefObject<FieldRoot.Actions | null> | undefined;
330
+ }
331
+
332
+ declare interface FieldRootState {
333
+ /**
334
+ * Whether the component should ignore user interaction.
335
+ */
336
+ disabled: boolean;
337
+ /**
338
+ * Whether the field has been touched.
339
+ */
340
+ touched: boolean;
341
+ /**
342
+ * Whether the field value has changed from its initial value.
343
+ */
344
+ dirty: boolean;
345
+ /**
346
+ * Whether the field is valid.
347
+ */
348
+ valid: boolean | null;
349
+ /**
350
+ * Whether the field has a value.
351
+ */
352
+ filled: boolean;
353
+ /**
354
+ * Whether the field is focused.
355
+ */
356
+ focused: boolean;
357
+ }
358
+
359
+ /**
360
+ * Used to display a custom message based on the field's validity.
361
+ * Requires `children` to be a function that accepts field validity state as an argument.
362
+ *
363
+ * Documentation: [Base UI Field](https://base-ui.com/react/components/field)
364
+ */
365
+ declare const FieldValidity: React_2.FC<FieldValidity.Props>;
366
+
367
+ declare namespace FieldValidity {
368
+ type State = FieldValidityState;
369
+ type Props = FieldValidityProps;
370
+ }
371
+
372
+ declare interface FieldValidityData {
373
+ state: {
374
+ badInput: boolean;
375
+ customError: boolean;
376
+ patternMismatch: boolean;
377
+ rangeOverflow: boolean;
378
+ rangeUnderflow: boolean;
379
+ stepMismatch: boolean;
380
+ tooLong: boolean;
381
+ tooShort: boolean;
382
+ typeMismatch: boolean;
383
+ valueMissing: boolean;
384
+ valid: boolean | null;
385
+ };
386
+ error: string;
387
+ errors: string[];
388
+ value: unknown;
389
+ initialValue: unknown;
390
+ }
391
+
392
+ declare interface FieldValidityProps {
393
+ /**
394
+ * A function that accepts the field validity state as an argument.
395
+ *
396
+ * ```jsx
397
+ * <Field.Validity>
398
+ * {(validity) => {
399
+ * return <div>...</div>
400
+ * }}
401
+ * </Field.Validity>
402
+ * ```
403
+ */
404
+ children: (state: FieldValidityState) => React_2.ReactNode;
405
+ }
406
+
407
+ declare interface FieldValidityState extends Omit<FieldValidityData, 'state'> {
408
+ /**
409
+ * The validity state.
410
+ */
411
+ validity: FieldValidityData['state'];
412
+ /**
413
+ * The transition status of the component.
414
+ */
415
+ transitionStatus: TransitionStatus;
416
+ }
417
+
418
+ declare const focusOut: "focus-out";
419
+
420
+ /**
421
+ * A native form element with consolidated error handling.
422
+ * Renders a `<form>` element.
423
+ *
424
+ * Documentation: [Base UI Form](https://base-ui.com/react/components/form)
425
+ */
426
+ declare const Form: {
427
+ <FormValues extends Record<string, any> = Record<string, any>>(props: Form.Props<FormValues> & {
428
+ ref?: React_2.Ref<HTMLFormElement> | undefined;
429
+ }): React_2.JSX.Element;
430
+ };
431
+
432
+ declare namespace Form {
433
+ type Props<FormValues extends Record<string, any> = Record<string, any>> = FormProps<FormValues>;
434
+ type State = FormState;
435
+ type Actions = FormActions;
436
+ type ValidationMode = FormValidationMode;
437
+ type SubmitEventReason = FormSubmitEventReason;
438
+ type SubmitEventDetails = FormSubmitEventDetails;
439
+ type Values<FormValues extends Record<string, any> = Record<string, any>> = FormValues;
440
+ }
441
+
442
+ declare interface FormActions {
443
+ validate: (fieldName?: string | undefined) => void;
444
+ }
445
+
446
+ declare interface FormContext {
447
+ errors: Errors;
448
+ clearErrors: (name: string | undefined) => void;
449
+ formRef: React_2.RefObject<{
450
+ fields: Map<string, {
451
+ name: string | undefined;
452
+ /**
453
+ * After this returns, the field registry entry reflects the latest synchronous
454
+ * validity verdict. Async validators do not block submit.
455
+ */
456
+ validate: () => void;
457
+ validityData: FieldValidityData;
458
+ controlRef: React_2.RefObject<HTMLElement | null>;
459
+ getValue: () => unknown;
460
+ }>;
461
+ }>;
462
+ validationMode: Form.ValidationMode;
463
+ submitAttemptedRef: React_2.RefObject<boolean>;
464
+ }
465
+
466
+ declare const FormContext: React_2.Context<FormContext>;
467
+
468
+ declare interface FormProps<FormValues extends Record<string, any> = Record<string, any>> extends BaseUIComponentProps<'form', FormState> {
469
+ /**
470
+ * Determines when the form should be validated.
471
+ * The `validationMode` prop on `<Field.Root>` takes precedence over this.
472
+ *
473
+ * - `onSubmit` (default): validates the field when the form is submitted, afterwards fields will re-validate on change.
474
+ * - `onBlur`: validates a field when it loses focus.
475
+ * - `onChange`: validates the field on every change to its value.
476
+ *
477
+ * @default 'onSubmit'
478
+ */
479
+ validationMode?: FormValidationMode | undefined;
480
+ /**
481
+ * Validation errors returned externally, typically after submission by a server or a form action.
482
+ * This should be an object where keys correspond to the `name` attribute on `<Field.Root>`,
483
+ * and values correspond to error(s) related to that field.
484
+ */
485
+ errors?: FormContext['errors'] | undefined;
486
+ /**
487
+ * Event handler called when the form is submitted.
488
+ * `preventDefault()` is called on the native submit event when used.
489
+ */
490
+ onFormSubmit?: ((formValues: FormValues, eventDetails: Form.SubmitEventDetails) => void) | undefined;
491
+ /**
492
+ * A ref to imperative actions.
493
+ * - `validate`: Validates all fields when called. Optionally pass a field name to validate a single field.
494
+ * @example
495
+ * ```tsx
496
+ * // validate all fields
497
+ * actionsRef.current.validate();
498
+ *
499
+ * // validate one field
500
+ * actionsRef.current.validate('email');
501
+ * ```
502
+ */
503
+ actionsRef?: React_2.RefObject<Form.Actions | null> | undefined;
504
+ }
505
+
506
+ declare interface FormState {}
507
+
508
+ declare type FormSubmitEventDetails = BaseUIGenericEventDetails<Form.SubmitEventReason>;
509
+
510
+ declare type FormSubmitEventReason = typeof REASONS.none;
511
+
512
+ declare type FormValidationMode = 'onSubmit' | 'onBlur' | 'onChange';
513
+
514
+ declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
515
+ ref?: React_2.Ref<T> | undefined;
516
+ };
517
+
518
+ declare const imperativeAction: "imperative-action";
519
+
520
+ declare const incrementPress: "increment-press";
521
+
522
+ declare const initial: "initial";
523
+
524
+ export declare const Input: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<InputProps_2, "ref"> & React_2.RefAttributes<HTMLElement>, "ref">, "className"> & {
5
525
  className?: string | undefined;
6
526
  } & React_2.RefAttributes<HTMLElement>>;
7
527
 
528
+ /**
529
+ * A native input element that automatically works with [Field](https://base-ui.com/react/components/field).
530
+ * Renders an `<input>` element.
531
+ *
532
+ * Documentation: [Base UI Input](https://base-ui.com/react/components/input)
533
+ */
534
+ declare const Input_2: React_2.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React_2.RefAttributes<HTMLElement>>;
535
+
536
+ declare namespace Input_2 {
537
+ type Props = InputProps;
538
+ type State = InputState;
539
+ type ChangeEventReason = InputChangeEventReason;
540
+ type ChangeEventDetails = InputChangeEventDetails;
541
+ }
542
+
543
+ declare const inputBlur: "input-blur";
544
+
545
+ declare const inputChange: "input-change";
546
+
547
+ export declare type InputChangeEventDetails = Field.Control.ChangeEventDetails;
548
+
549
+ export declare type InputChangeEventReason = Field.Control.ChangeEventReason;
550
+
551
+ declare const inputClear: "input-clear";
552
+
553
+ declare const inputPaste: "input-paste";
554
+
555
+ declare const inputPress: "input-press";
556
+
557
+ export declare interface InputProps extends BaseUIComponentProps<'input', InputState> {
558
+ /**
559
+ * Callback fired when the `value` changes. Use when controlled.
560
+ */
561
+ onValueChange?: ((value: string, eventDetails: Input_2.ChangeEventDetails) => void) | undefined;
562
+ /**
563
+ * The default value of the input. Use when uncontrolled.
564
+ */
565
+ defaultValue?: Field.Control.Props['defaultValue'] | undefined;
566
+ /**
567
+ * The value of the input. Use when controlled.
568
+ */
569
+ value?: React_2.ComponentProps<'input'>['value'] | undefined;
570
+ }
571
+
572
+ export declare interface InputState extends FieldControlState {}
573
+
574
+ declare const itemPress: "item-press";
575
+
576
+ declare const keyboard: "keyboard";
577
+
578
+ declare const linkPress: "link-press";
579
+
580
+ declare const listNavigation: "list-navigation";
581
+
582
+ declare const missing: "missing";
583
+
584
+ declare const none: "none";
585
+
586
+ declare const outsidePress: "outside-press";
587
+
588
+ declare const pointer: "pointer";
589
+
590
+ declare namespace REASONS {
591
+ export {
592
+ none,
593
+ triggerPress,
594
+ triggerHover,
595
+ triggerFocus,
596
+ outsidePress,
597
+ itemPress,
598
+ closePress,
599
+ linkPress,
600
+ clearPress,
601
+ chipRemovePress,
602
+ trackPress,
603
+ incrementPress,
604
+ decrementPress,
605
+ inputChange,
606
+ inputClear,
607
+ inputBlur,
608
+ inputPaste,
609
+ inputPress,
610
+ focusOut,
611
+ escapeKey,
612
+ closeWatcher,
613
+ listNavigation,
614
+ keyboard,
615
+ pointer,
616
+ drag,
617
+ wheel,
618
+ scrub,
619
+ cancelOpen,
620
+ siblingOpen,
621
+ disabled,
622
+ missing,
623
+ initial,
624
+ imperativeAction,
625
+ swipe,
626
+ windowResize
627
+ }
628
+ }
629
+
630
+ /**
631
+ * Maps a change `reason` string to the corresponding native event type.
632
+ */
633
+ declare type ReasonToEvent<Reason extends string> = Reason extends keyof ReasonToEventMap ? ReasonToEventMap[Reason] : Event;
634
+
635
+ declare interface ReasonToEventMap {
636
+ [REASONS.none]: Event;
637
+ [REASONS.triggerPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
638
+ [REASONS.triggerHover]: MouseEvent;
639
+ [REASONS.triggerFocus]: FocusEvent;
640
+ [REASONS.outsidePress]: MouseEvent | PointerEvent | TouchEvent;
641
+ [REASONS.itemPress]: MouseEvent | KeyboardEvent | PointerEvent;
642
+ [REASONS.closePress]: MouseEvent | KeyboardEvent | PointerEvent;
643
+ [REASONS.linkPress]: MouseEvent | PointerEvent;
644
+ [REASONS.clearPress]: PointerEvent | MouseEvent | KeyboardEvent;
645
+ [REASONS.chipRemovePress]: PointerEvent | MouseEvent | KeyboardEvent;
646
+ [REASONS.trackPress]: PointerEvent | MouseEvent | TouchEvent;
647
+ [REASONS.incrementPress]: PointerEvent | MouseEvent | TouchEvent;
648
+ [REASONS.decrementPress]: PointerEvent | MouseEvent | TouchEvent;
649
+ [REASONS.inputChange]: InputEvent | Event;
650
+ [REASONS.inputClear]: InputEvent | FocusEvent | Event;
651
+ [REASONS.inputBlur]: FocusEvent;
652
+ [REASONS.inputPaste]: ClipboardEvent;
653
+ [REASONS.inputPress]: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent;
654
+ [REASONS.focusOut]: FocusEvent | KeyboardEvent;
655
+ [REASONS.escapeKey]: KeyboardEvent;
656
+ [REASONS.closeWatcher]: Event;
657
+ [REASONS.listNavigation]: KeyboardEvent;
658
+ [REASONS.keyboard]: KeyboardEvent;
659
+ [REASONS.pointer]: PointerEvent;
660
+ [REASONS.drag]: PointerEvent | TouchEvent;
661
+ [REASONS.swipe]: PointerEvent | TouchEvent;
662
+ [REASONS.wheel]: WheelEvent;
663
+ [REASONS.scrub]: PointerEvent;
664
+ [REASONS.cancelOpen]: MouseEvent;
665
+ [REASONS.siblingOpen]: Event;
666
+ [REASONS.disabled]: Event;
667
+ [REASONS.missing]: Event;
668
+ [REASONS.initial]: Event;
669
+ [REASONS.imperativeAction]: Event;
670
+ [REASONS.windowResize]: UIEvent;
671
+ }
672
+
673
+ declare const scrub: "scrub";
674
+
675
+ declare const siblingOpen: "sibling-open";
676
+
677
+ declare const swipe: "swipe";
678
+
679
+ declare const trackPress: "track-press";
680
+
681
+ declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
682
+
683
+ declare const triggerFocus: "trigger-focus";
684
+
685
+ declare const triggerHover: "trigger-hover";
686
+
687
+ declare const triggerPress: "trigger-press";
688
+
689
+ declare const wheel: "wheel";
690
+
691
+ declare const windowResize: "window-resize";
692
+
693
+ /**
694
+ * Adds a `preventBaseUIHandler` method to all event handlers.
695
+ */
696
+ declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
8
697
 
9
- export * from "@base-ui/react/input";
698
+ 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;
10
699
 
11
700
  export { }