@wix/site-ui 1.83.0 → 1.84.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.
@@ -1,482 +1,16 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
- import { useBaseUiId } from "../6046.js";
4
- import { useRefWithInit, EMPTY_OBJECT, mergeProps, useRenderElement } from "../8272.js";
5
- import { LabelableContext, FieldRootContext, useFieldRootContext, useLabelableContext, fieldValidityMapping, DEFAULT_VALIDITY_STATE } from "../1477.js";
6
- import { useStableCallback } from "../7541.js";
7
- import { useFormContext } from "../5085.js";
8
- import { useTimeout } from "../42.js";
9
- import { useIsoLayoutEffect, SafeReact } from "../6499.js";
10
- import { useFieldsetRootContext } from "../353.js";
3
+ import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "../1477.js";
11
4
  import { useLabel } from "../4143.js";
5
+ import { SafeReact } from "../6499.js";
12
6
  import { error } from "../4026.js";
13
- import { transitionStatusMapping, useOpenChangeComplete, useTransitionStatus } from "../880.js";
7
+ import { useRenderElement } from "../8272.js";
14
8
  import { useCheckboxGroupContext } from "../8979.js";
9
+ import { FieldRoot_FieldRoot, FieldDescription_FieldDescription, getCombinedFieldValidityData, LabelableProvider_LabelableProvider, FieldError_FieldError } from "../8972.js";
15
10
  import { FieldItemContext } from "../1457.js";
11
+ import { useTransitionStatus } from "../880.js";
16
12
  import { Input_module, FieldControl_FieldControl } from "../8685.js";
17
13
  import * as __rspack_external_react from "react";
18
- const LabelableProvider_LabelableProvider = function(props) {
19
- const defaultId = useBaseUiId();
20
- const initialControlId = void 0 === props.controlId ? defaultId : props.controlId;
21
- const [controlId, setControlIdState] = __rspack_external_react.useState(initialControlId);
22
- const [labelId, setLabelId] = __rspack_external_react.useState(props.labelId);
23
- const [messageIds, setMessageIds] = __rspack_external_react.useState([]);
24
- const registrationsRef = useRefWithInit(()=>new Map());
25
- const { messageIds: parentMessageIds } = useLabelableContext();
26
- const registerControlId = useStableCallback((source, nextId)=>{
27
- const registrations = registrationsRef.current;
28
- if (void 0 === nextId) return void registrations.delete(source);
29
- registrations.set(source, nextId);
30
- setControlIdState((prev)=>{
31
- if (0 === registrations.size) return;
32
- let nextControlId;
33
- for (const id of registrations.values()){
34
- if (void 0 !== prev && id === prev) return prev;
35
- if (void 0 === nextControlId) nextControlId = id;
36
- }
37
- return nextControlId;
38
- });
39
- });
40
- const getDescriptionProps = __rspack_external_react.useCallback((externalProps)=>mergeProps({
41
- 'aria-describedby': parentMessageIds.concat(messageIds).join(' ') || void 0
42
- }, externalProps), [
43
- parentMessageIds,
44
- messageIds
45
- ]);
46
- const contextValue = __rspack_external_react.useMemo(()=>({
47
- controlId,
48
- registerControlId,
49
- labelId,
50
- setLabelId,
51
- messageIds,
52
- setMessageIds,
53
- getDescriptionProps
54
- }), [
55
- controlId,
56
- registerControlId,
57
- labelId,
58
- setLabelId,
59
- messageIds,
60
- setMessageIds,
61
- getDescriptionProps
62
- ]);
63
- return /*#__PURE__*/ jsx(LabelableContext.Provider, {
64
- value: contextValue,
65
- children: props.children
66
- });
67
- };
68
- if ("production" !== process.env.NODE_ENV) LabelableProvider_LabelableProvider.displayName = "LabelableProvider";
69
- function getCombinedFieldValidityData(validityData, invalid) {
70
- return {
71
- ...validityData,
72
- state: {
73
- ...validityData.state,
74
- valid: !invalid && validityData.state.valid
75
- }
76
- };
77
- }
78
- const validityKeys = Object.keys(DEFAULT_VALIDITY_STATE);
79
- function isOnlyValueMissing(state) {
80
- if (!state || state.valid || !state.valueMissing) return false;
81
- let onlyValueMissing = false;
82
- for (const key of validityKeys)if ('valid' !== key) {
83
- if ('valueMissing' === key) onlyValueMissing = state[key];
84
- if (state[key]) onlyValueMissing = false;
85
- }
86
- return onlyValueMissing;
87
- }
88
- function useFieldValidation(params) {
89
- const { formRef, clearErrors } = useFormContext();
90
- const { setValidityData, validate, validityData, validationDebounceTime, invalid, markedDirtyRef, state, name, shouldValidateOnChange, getRegisteredFieldId } = params;
91
- const { controlId, getDescriptionProps } = useLabelableContext();
92
- const timeout = useTimeout();
93
- const inputRef = __rspack_external_react.useRef(null);
94
- const commit = useStableCallback(async (value, revalidate = false)=>{
95
- const element = inputRef.current;
96
- if (!element) return;
97
- function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid) {
98
- const fieldId = getRegisteredFieldId() ?? controlId;
99
- if (null == fieldId) return;
100
- const currentFieldData = formRef.current.fields.get(fieldId);
101
- if (!currentFieldData) return;
102
- const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
103
- formRef.current.fields.set(fieldId, {
104
- ...currentFieldData,
105
- validityData: validityDataWithFormErrors
106
- });
107
- }
108
- if (revalidate) {
109
- if (false !== state.valid) return;
110
- const currentNativeValidity = element.validity;
111
- if (!currentNativeValidity.valueMissing) {
112
- const nextValidityData = {
113
- value,
114
- state: {
115
- ...DEFAULT_VALIDITY_STATE,
116
- valid: true
117
- },
118
- error: '',
119
- errors: [],
120
- initialValue: validityData.initialValue
121
- };
122
- element.setCustomValidity('');
123
- updateRegisteredFieldValidity(nextValidityData, false);
124
- setValidityData(nextValidityData);
125
- return;
126
- }
127
- const currentNativeValidityObject = validityKeys.reduce((acc, key)=>{
128
- acc[key] = currentNativeValidity[key];
129
- return acc;
130
- }, {});
131
- if (!currentNativeValidityObject.valid && !isOnlyValueMissing(currentNativeValidityObject)) return;
132
- }
133
- function getState(el) {
134
- const computedState = validityKeys.reduce((acc, key)=>{
135
- acc[key] = el.validity[key];
136
- return acc;
137
- }, {});
138
- let hasOnlyValueMissingError = false;
139
- for (const key of validityKeys)if ('valid' !== key) {
140
- if ('valueMissing' === key && computedState[key]) hasOnlyValueMissingError = true;
141
- else if (computedState[key]) return computedState;
142
- }
143
- if (hasOnlyValueMissingError && !markedDirtyRef.current) {
144
- computedState.valid = true;
145
- computedState.valueMissing = false;
146
- }
147
- return computedState;
148
- }
149
- timeout.clear();
150
- let result = null;
151
- let validationErrors = [];
152
- const nextState = getState(element);
153
- let defaultValidationMessage;
154
- const validateOnChange = shouldValidateOnChange();
155
- if (element.validationMessage && !validateOnChange) {
156
- defaultValidationMessage = element.validationMessage;
157
- validationErrors = [
158
- element.validationMessage
159
- ];
160
- } else {
161
- const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field)=>{
162
- if (field.name) acc[field.name] = field.getValue();
163
- return acc;
164
- }, {});
165
- const resultOrPromise = validate(value, formValues);
166
- result = 'object' == typeof resultOrPromise && null !== resultOrPromise && 'then' in resultOrPromise ? await resultOrPromise : resultOrPromise;
167
- if (null !== result) {
168
- nextState.valid = false;
169
- nextState.customError = true;
170
- if (Array.isArray(result)) {
171
- validationErrors = result;
172
- element.setCustomValidity(result.join('\n'));
173
- } else if (result) {
174
- validationErrors = [
175
- result
176
- ];
177
- element.setCustomValidity(result);
178
- }
179
- } else if (validateOnChange) {
180
- element.setCustomValidity('');
181
- nextState.customError = false;
182
- if (element.validationMessage) {
183
- defaultValidationMessage = element.validationMessage;
184
- validationErrors = [
185
- element.validationMessage
186
- ];
187
- } else if (element.validity.valid && !nextState.valid) nextState.valid = true;
188
- }
189
- }
190
- const nextValidityData = {
191
- value,
192
- state: nextState,
193
- error: defaultValidationMessage ?? (Array.isArray(result) ? result[0] : result ?? ''),
194
- errors: validationErrors,
195
- initialValue: validityData.initialValue
196
- };
197
- updateRegisteredFieldValidity(nextValidityData);
198
- setValidityData(nextValidityData);
199
- });
200
- const getValidationProps = __rspack_external_react.useCallback((externalProps = {})=>mergeProps(getDescriptionProps, false === state.valid ? {
201
- 'aria-invalid': true
202
- } : EMPTY_OBJECT, externalProps), [
203
- getDescriptionProps,
204
- state.valid
205
- ]);
206
- const getInputValidationProps = __rspack_external_react.useCallback((externalProps = {})=>mergeProps({
207
- onChange (event) {
208
- if (event.nativeEvent.defaultPrevented) return;
209
- clearErrors(name);
210
- if (!shouldValidateOnChange()) return void commit(event.currentTarget.value, true);
211
- const element = event.currentTarget;
212
- if ('' === element.value) return void commit(element.value);
213
- timeout.clear();
214
- if (validationDebounceTime) timeout.start(validationDebounceTime, ()=>{
215
- commit(element.value);
216
- });
217
- else commit(element.value);
218
- }
219
- }, getValidationProps(externalProps)), [
220
- getValidationProps,
221
- clearErrors,
222
- name,
223
- timeout,
224
- commit,
225
- validationDebounceTime,
226
- shouldValidateOnChange
227
- ]);
228
- return __rspack_external_react.useMemo(()=>({
229
- getValidationProps,
230
- getInputValidationProps,
231
- inputRef,
232
- commit
233
- }), [
234
- getValidationProps,
235
- getInputValidationProps,
236
- commit
237
- ]);
238
- }
239
- function useFieldControlRegistration(params) {
240
- const { commit, invalid, markedDirtyRef, name, setRegisteredFieldId, setValidityData, validityData } = params;
241
- const { formRef } = useFormContext();
242
- const activeFieldControlSourceRef = __rspack_external_react.useRef(null);
243
- const registrationRef = __rspack_external_react.useRef(null);
244
- const fallbackControlRef = __rspack_external_react.useRef(null);
245
- const getValueForForm = useStableCallback(()=>{
246
- const registration = registrationRef.current;
247
- if (!registration) return;
248
- if (registration.getValue) return registration.getValue();
249
- return registration.value;
250
- });
251
- const validate = useStableCallback(()=>{
252
- const registration = registrationRef.current;
253
- if (!registration) return;
254
- let nextValue = registration.value;
255
- if (void 0 === nextValue) nextValue = getValueForForm();
256
- markedDirtyRef.current = true;
257
- commit(nextValue);
258
- });
259
- function refreshRegistration() {
260
- const registration = registrationRef.current;
261
- if (!registration || !registration.id) return;
262
- formRef.current.fields.set(registration.id, {
263
- getValue: getValueForForm,
264
- name,
265
- controlRef: registration.controlRef ?? fallbackControlRef,
266
- validityData: getCombinedFieldValidityData(validityData, invalid),
267
- validate
268
- });
269
- }
270
- function deleteRegistration(id = registrationRef.current?.id) {
271
- if (id) formRef.current.fields.delete(id);
272
- }
273
- function syncInitialValue() {
274
- const registration = registrationRef.current;
275
- if (!registration) return;
276
- let initialValue = registration.value;
277
- if (void 0 === initialValue) initialValue = getValueForForm();
278
- if (null === validityData.initialValue && null !== initialValue) setValidityData((prev)=>({
279
- ...prev,
280
- initialValue
281
- }));
282
- }
283
- useIsoLayoutEffect(()=>{
284
- const registration = registrationRef.current;
285
- if (!registration || !registration.id) return;
286
- formRef.current.fields.set(registration.id, {
287
- getValue: getValueForForm,
288
- name,
289
- controlRef: registration.controlRef ?? fallbackControlRef,
290
- validityData: getCombinedFieldValidityData(validityData, invalid),
291
- validate
292
- });
293
- }, [
294
- formRef,
295
- getValueForForm,
296
- invalid,
297
- name,
298
- validate,
299
- validityData
300
- ]);
301
- useIsoLayoutEffect(()=>{
302
- const fields = formRef.current.fields;
303
- return ()=>{
304
- const id = registrationRef.current?.id;
305
- if (id) fields.delete(id);
306
- };
307
- }, [
308
- formRef
309
- ]);
310
- return useStableCallback((source, registration)=>{
311
- if (!registration) {
312
- if (activeFieldControlSourceRef.current === source) {
313
- activeFieldControlSourceRef.current = null;
314
- deleteRegistration();
315
- registrationRef.current = null;
316
- setRegisteredFieldId(void 0);
317
- }
318
- return;
319
- }
320
- const previousId = registrationRef.current?.id;
321
- activeFieldControlSourceRef.current = source;
322
- registrationRef.current = registration;
323
- setRegisteredFieldId(registration.id);
324
- if (previousId && previousId !== registration.id) deleteRegistration(previousId);
325
- syncInitialValue();
326
- refreshRegistration();
327
- });
328
- }
329
- const FieldRoot_FieldRootInner = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
330
- const { errors, validationMode: formValidationMode, submitAttemptedRef } = useFormContext();
331
- const { render, className, validate: validateProp, validationDebounceTime = 0, validationMode = formValidationMode, name, disabled: disabledProp = false, invalid: invalidProp, dirty: dirtyProp, touched: touchedProp, actionsRef, style, ...elementProps } = componentProps;
332
- const { disabled: disabledFieldset } = useFieldsetRootContext();
333
- const validate = useStableCallback(validateProp || (()=>null));
334
- const disabled = disabledFieldset || disabledProp;
335
- const [touchedState, setTouchedUnwrapped] = __rspack_external_react.useState(false);
336
- const [dirtyState, setDirtyUnwrapped] = __rspack_external_react.useState(false);
337
- const [filled, setFilled] = __rspack_external_react.useState(false);
338
- const [focused, setFocused] = __rspack_external_react.useState(false);
339
- const dirty = dirtyProp ?? dirtyState;
340
- const touched = touchedProp ?? touchedState;
341
- const markedDirtyRef = __rspack_external_react.useRef(false);
342
- const registeredFieldIdRef = __rspack_external_react.useRef(void 0);
343
- const getRegisteredFieldId = __rspack_external_react.useCallback(()=>registeredFieldIdRef.current, []);
344
- const setRegisteredFieldId = __rspack_external_react.useCallback((id)=>{
345
- registeredFieldIdRef.current = id;
346
- }, []);
347
- const setDirty = useStableCallback((value)=>{
348
- if (void 0 !== dirtyProp) return;
349
- if (value) markedDirtyRef.current = true;
350
- setDirtyUnwrapped(value);
351
- });
352
- const setTouched = useStableCallback((value)=>{
353
- if (void 0 !== touchedProp) return;
354
- setTouchedUnwrapped(value);
355
- });
356
- const shouldValidateOnChange = useStableCallback(()=>'onChange' === validationMode || 'onSubmit' === validationMode && submitAttemptedRef.current);
357
- const hasFormError = !!name && Object.hasOwn(errors, name) && void 0 !== errors[name];
358
- const invalid = true === invalidProp || hasFormError;
359
- const [validityData, setValidityData] = __rspack_external_react.useState({
360
- state: DEFAULT_VALIDITY_STATE,
361
- error: '',
362
- errors: [],
363
- value: null,
364
- initialValue: null
365
- });
366
- const valid = !invalid && validityData.state.valid;
367
- const state = __rspack_external_react.useMemo(()=>({
368
- disabled,
369
- touched,
370
- dirty,
371
- valid,
372
- filled,
373
- focused
374
- }), [
375
- disabled,
376
- touched,
377
- dirty,
378
- valid,
379
- filled,
380
- focused
381
- ]);
382
- const validation = useFieldValidation({
383
- setValidityData,
384
- validate,
385
- validityData,
386
- validationDebounceTime,
387
- invalid,
388
- markedDirtyRef,
389
- state,
390
- name,
391
- shouldValidateOnChange,
392
- getRegisteredFieldId
393
- });
394
- const validityValue = validityData.value;
395
- const handleImperativeValidate = __rspack_external_react.useCallback(()=>{
396
- markedDirtyRef.current = true;
397
- validation.commit(validityValue);
398
- }, [
399
- validation,
400
- validityValue
401
- ]);
402
- const registerFieldControl = useFieldControlRegistration({
403
- commit: validation.commit,
404
- invalid,
405
- markedDirtyRef,
406
- name,
407
- setRegisteredFieldId,
408
- setValidityData,
409
- validityData
410
- });
411
- __rspack_external_react.useImperativeHandle(actionsRef, ()=>({
412
- validate: handleImperativeValidate
413
- }), [
414
- handleImperativeValidate
415
- ]);
416
- const contextValue = __rspack_external_react.useMemo(()=>({
417
- invalid,
418
- name,
419
- validityData,
420
- setValidityData,
421
- disabled,
422
- touched,
423
- setTouched,
424
- dirty,
425
- setDirty,
426
- filled,
427
- setFilled,
428
- focused,
429
- setFocused,
430
- validate,
431
- validationMode,
432
- validationDebounceTime,
433
- shouldValidateOnChange,
434
- state,
435
- markedDirtyRef,
436
- registerFieldControl,
437
- validation
438
- }), [
439
- invalid,
440
- name,
441
- validityData,
442
- disabled,
443
- touched,
444
- setTouched,
445
- dirty,
446
- setDirty,
447
- filled,
448
- setFilled,
449
- focused,
450
- setFocused,
451
- validate,
452
- validationMode,
453
- validationDebounceTime,
454
- shouldValidateOnChange,
455
- state,
456
- registerFieldControl,
457
- validation
458
- ]);
459
- const element = useRenderElement('div', componentProps, {
460
- ref: forwardedRef,
461
- state,
462
- props: elementProps,
463
- stateAttributesMapping: fieldValidityMapping
464
- });
465
- return /*#__PURE__*/ jsx(FieldRootContext.Provider, {
466
- value: contextValue,
467
- children: element
468
- });
469
- });
470
- if ("production" !== process.env.NODE_ENV) FieldRoot_FieldRootInner.displayName = "FieldRootInner";
471
- const FieldRoot_FieldRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
472
- return /*#__PURE__*/ jsx(LabelableProvider_LabelableProvider, {
473
- children: /*#__PURE__*/ jsx(FieldRoot_FieldRootInner, {
474
- ...componentProps,
475
- ref: forwardedRef
476
- })
477
- });
478
- });
479
- if ("production" !== process.env.NODE_ENV) FieldRoot_FieldRoot.displayName = "FieldRoot";
480
14
  const FieldLabel_FieldLabel = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
481
15
  const { render, className, style, id: idProp, nativeLabel = true, ...elementProps } = componentProps;
482
16
  const fieldRootContext = useFieldRootContext(false);
@@ -518,108 +52,6 @@ const FieldLabel_FieldLabel = /*#__PURE__*/ __rspack_external_react.forwardRef(f
518
52
  return element;
519
53
  });
520
54
  if ("production" !== process.env.NODE_ENV) FieldLabel_FieldLabel.displayName = "FieldLabel";
521
- const stateAttributesMapping = {
522
- ...fieldValidityMapping,
523
- ...transitionStatusMapping
524
- };
525
- const FieldError_FieldError = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
526
- const { render, id: idProp, className, match, style, ...elementProps } = componentProps;
527
- const id = useBaseUiId(idProp);
528
- const { validityData, state: fieldState, name } = useFieldRootContext(false);
529
- const { setMessageIds } = useLabelableContext();
530
- const { errors } = useFormContext();
531
- const formError = name ? errors[name] : null;
532
- const hasSpecificMatch = 'string' == typeof match;
533
- let rendered = false;
534
- rendered = true === match ? true : hasSpecificMatch ? Boolean(validityData.state[match]) : Boolean(formError) || false === validityData.state.valid;
535
- const { mounted, transitionStatus, setMounted } = useTransitionStatus(rendered);
536
- useIsoLayoutEffect(()=>{
537
- if (!rendered || !id) return;
538
- setMessageIds((v)=>v.concat(id));
539
- return ()=>{
540
- setMessageIds((v)=>v.filter((item)=>item !== id));
541
- };
542
- }, [
543
- rendered,
544
- id,
545
- setMessageIds
546
- ]);
547
- const errorRef = __rspack_external_react.useRef(null);
548
- const [lastRenderedMessage, setLastRenderedMessage] = __rspack_external_react.useState(null);
549
- const [lastRenderedMessageKey, setLastRenderedMessageKey] = __rspack_external_react.useState(null);
550
- const clientErrorMessage = validityData.errors.length > 1 ? /*#__PURE__*/ jsx("ul", {
551
- children: validityData.errors.map((message)=>/*#__PURE__*/ jsx("li", {
552
- children: message
553
- }, message))
554
- }) : validityData.error;
555
- const errorMessage = hasSpecificMatch ? clientErrorMessage : formError || clientErrorMessage;
556
- let errorKey = validityData.error;
557
- if (null != formError) errorKey = Array.isArray(formError) ? JSON.stringify(formError) : formError;
558
- else if (validityData.errors.length > 1) errorKey = JSON.stringify(validityData.errors);
559
- if (rendered && errorKey !== lastRenderedMessageKey) {
560
- setLastRenderedMessageKey(errorKey);
561
- setLastRenderedMessage(errorMessage);
562
- }
563
- useOpenChangeComplete({
564
- open: rendered,
565
- ref: errorRef,
566
- onComplete () {
567
- if (!rendered) setMounted(false);
568
- }
569
- });
570
- const state = {
571
- ...fieldState,
572
- transitionStatus
573
- };
574
- const element = useRenderElement('div', componentProps, {
575
- ref: [
576
- forwardedRef,
577
- errorRef
578
- ],
579
- state,
580
- props: [
581
- {
582
- id,
583
- children: rendered ? errorMessage : lastRenderedMessage
584
- },
585
- elementProps
586
- ],
587
- stateAttributesMapping: stateAttributesMapping,
588
- enabled: mounted
589
- });
590
- if (!mounted) return null;
591
- return element;
592
- });
593
- if ("production" !== process.env.NODE_ENV) FieldError_FieldError.displayName = "FieldError";
594
- const FieldDescription_FieldDescription = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
595
- const { render, id: idProp, className, style, ...elementProps } = componentProps;
596
- const id = useBaseUiId(idProp);
597
- const fieldRootContext = useFieldRootContext(false);
598
- const { setMessageIds } = useLabelableContext();
599
- useIsoLayoutEffect(()=>{
600
- if (!id) return;
601
- setMessageIds((v)=>v.concat(id));
602
- return ()=>{
603
- setMessageIds((v)=>v.filter((item)=>item !== id));
604
- };
605
- }, [
606
- id,
607
- setMessageIds
608
- ]);
609
- const element = useRenderElement('p', componentProps, {
610
- ref: forwardedRef,
611
- state: fieldRootContext.state,
612
- props: [
613
- {
614
- id
615
- },
616
- elementProps
617
- ],
618
- stateAttributesMapping: fieldValidityMapping
619
- });
620
- return element;
621
- });
622
- if ("production" !== process.env.NODE_ENV) FieldDescription_FieldDescription.displayName = "FieldDescription";
623
55
  const FieldItem_FieldItem = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
624
56
  const { render, className, style, disabled: disabledProp = false, ...elementProps } = componentProps;
625
57
  const { state, disabled: rootDisabled } = useFieldRootContext(false);