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