@tamagui/field 0.0.0-bootstrap.0 → 3.0.0-beta.1091.1

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 (79) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/Field.cjs +856 -0
  3. package/dist/cjs/Field.native.cjs +1010 -0
  4. package/dist/cjs/Field.native.js +1012 -0
  5. package/dist/cjs/Field.native.js.map +1 -0
  6. package/dist/cjs/FieldContext.cjs +85 -0
  7. package/dist/cjs/FieldContext.native.cjs +89 -0
  8. package/dist/cjs/FieldContext.native.js +91 -0
  9. package/dist/cjs/FieldContext.native.js.map +1 -0
  10. package/dist/cjs/index.cjs +20 -0
  11. package/dist/cjs/index.native.cjs +22 -0
  12. package/dist/cjs/index.native.js +24 -0
  13. package/dist/cjs/index.native.js.map +1 -0
  14. package/dist/cjs/types.cjs +16 -0
  15. package/dist/cjs/types.native.cjs +18 -0
  16. package/dist/cjs/types.native.js +20 -0
  17. package/dist/cjs/types.native.js.map +1 -0
  18. package/dist/cjs/validation.cjs +113 -0
  19. package/dist/cjs/validation.native.cjs +121 -0
  20. package/dist/cjs/validation.native.js +123 -0
  21. package/dist/cjs/validation.native.js.map +1 -0
  22. package/dist/esm/Field.mjs +824 -0
  23. package/dist/esm/Field.mjs.map +1 -0
  24. package/dist/esm/Field.native.js +976 -0
  25. package/dist/esm/Field.native.js.map +1 -0
  26. package/dist/esm/FieldContext.mjs +51 -0
  27. package/dist/esm/FieldContext.mjs.map +1 -0
  28. package/dist/esm/FieldContext.native.js +53 -0
  29. package/dist/esm/FieldContext.native.js.map +1 -0
  30. package/dist/esm/index.js +5 -0
  31. package/dist/esm/index.mjs +5 -0
  32. package/dist/esm/index.native.js +5 -0
  33. package/dist/esm/types.mjs +0 -0
  34. package/dist/esm/types.native.js +0 -0
  35. package/dist/esm/validation.mjs +86 -0
  36. package/dist/esm/validation.mjs.map +1 -0
  37. package/dist/esm/validation.native.js +92 -0
  38. package/dist/esm/validation.native.js.map +1 -0
  39. package/dist/jsx/Field.mjs +824 -0
  40. package/dist/jsx/Field.mjs.map +1 -0
  41. package/dist/jsx/Field.native.cjs +1010 -0
  42. package/dist/jsx/Field.native.js +1012 -0
  43. package/dist/jsx/Field.native.js.map +1 -0
  44. package/dist/jsx/FieldContext.mjs +51 -0
  45. package/dist/jsx/FieldContext.mjs.map +1 -0
  46. package/dist/jsx/FieldContext.native.cjs +89 -0
  47. package/dist/jsx/FieldContext.native.js +91 -0
  48. package/dist/jsx/FieldContext.native.js.map +1 -0
  49. package/dist/jsx/index.js +5 -0
  50. package/dist/jsx/index.mjs +5 -0
  51. package/dist/jsx/index.native.cjs +22 -0
  52. package/dist/jsx/index.native.js +24 -0
  53. package/dist/jsx/index.native.js.map +1 -0
  54. package/dist/jsx/types.mjs +0 -0
  55. package/dist/jsx/types.native.cjs +18 -0
  56. package/dist/jsx/types.native.js +20 -0
  57. package/dist/jsx/types.native.js.map +1 -0
  58. package/dist/jsx/validation.mjs +86 -0
  59. package/dist/jsx/validation.mjs.map +1 -0
  60. package/dist/jsx/validation.native.cjs +121 -0
  61. package/dist/jsx/validation.native.js +123 -0
  62. package/dist/jsx/validation.native.js.map +1 -0
  63. package/package.json +51 -4
  64. package/src/Field.tsx +1127 -0
  65. package/src/FieldContext.tsx +61 -0
  66. package/src/index.ts +3 -0
  67. package/src/types.ts +125 -0
  68. package/src/validation.ts +136 -0
  69. package/types/Field.d.ts +401 -0
  70. package/types/Field.d.ts.map +1 -0
  71. package/types/FieldContext.d.ts +11 -0
  72. package/types/FieldContext.d.ts.map +1 -0
  73. package/types/index.d.ts +4 -0
  74. package/types/index.d.ts.map +1 -0
  75. package/types/types.d.ts +112 -0
  76. package/types/types.d.ts.map +1 -0
  77. package/types/validation.d.ts +24 -0
  78. package/types/validation.d.ts.map +1 -0
  79. package/README.md +0 -1
@@ -0,0 +1,1012 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: () => from[key],
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var Field_exports = {};
30
+ __export(Field_exports, {
31
+ Field: () => Field2,
32
+ FieldDescriptionFrame: () => FieldDescriptionFrame,
33
+ FieldErrorFrame: () => FieldErrorFrame,
34
+ FieldFrame: () => FieldFrame,
35
+ FieldItemFrame: () => FieldItemFrame,
36
+ FieldLabelFrame: () => FieldLabelFrame
37
+ });
38
+ module.exports = __toCommonJS(Field_exports);
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+ var import_core = require("@tamagui/core");
41
+ var import_form = require("@tamagui/form");
42
+ var import_focusable = require("@tamagui/focusable");
43
+ var React = __toESM(require("react"), 1);
44
+ var import_FieldContext = require("./FieldContext.native.js");
45
+ var import_validation = require("./validation.native.js");
46
+ var fieldStateVariants = {
47
+ valid: { true: {} },
48
+ invalid: { true: {} },
49
+ touched: { true: {} },
50
+ dirty: { true: {} },
51
+ filled: { true: {} },
52
+ focused: { true: {} },
53
+ disabled: { true: {} }
54
+ };
55
+ var FieldFrame = (0, import_core.styled)(import_core.View, {
56
+ displayName: "Field",
57
+ context: import_FieldContext.FieldStyledContext,
58
+ variants: fieldStateVariants
59
+ });
60
+ var FieldLabelFrame = (0, import_core.styled)(import_core.Text, {
61
+ displayName: "FieldLabel",
62
+ render: "label",
63
+ context: import_FieldContext.FieldStyledContext,
64
+ variants: fieldStateVariants
65
+ });
66
+ var FieldDescriptionFrame = (0, import_core.styled)(import_core.Text, {
67
+ displayName: "FieldDescription",
68
+ render: "p",
69
+ context: import_FieldContext.FieldStyledContext,
70
+ variants: fieldStateVariants
71
+ });
72
+ var FieldErrorFrame = (0, import_core.styled)(import_core.Text, {
73
+ displayName: "FieldError",
74
+ render: "span",
75
+ context: import_FieldContext.FieldStyledContext,
76
+ variants: fieldStateVariants
77
+ });
78
+ var FieldItemFrame = (0, import_core.styled)(import_core.View, {
79
+ displayName: "FieldItem",
80
+ context: import_FieldContext.FieldStyledContext,
81
+ variants: fieldStateVariants
82
+ });
83
+ var validityKeys = [
84
+ "badInput",
85
+ "customError",
86
+ "patternMismatch",
87
+ "rangeOverflow",
88
+ "rangeUnderflow",
89
+ "stepMismatch",
90
+ "tooLong",
91
+ "tooShort",
92
+ "typeMismatch",
93
+ "valueMissing"
94
+ ];
95
+ var AssociationContext = /* @__PURE__ */ React.createContext(null);
96
+ var FieldRootContext = /* @__PURE__ */ React.createContext(null);
97
+ var FieldItemContext = /* @__PURE__ */ React.createContext(false);
98
+ function getText(children) {
99
+ var text = [];
100
+ React.Children.forEach(children, function(child) {
101
+ if (typeof child === "string" || typeof child === "number") {
102
+ text.push(String(child));
103
+ return;
104
+ }
105
+ if (/* @__PURE__ */ React.isValidElement(child)) {
106
+ var nested = getText(child.props.children);
107
+ if (nested) {
108
+ text.push(nested);
109
+ }
110
+ }
111
+ });
112
+ return text.join(" ").trim() || void 0;
113
+ }
114
+ function useAssociation(prefix, parent) {
115
+ var defaultControlId = `${prefix}-control`;
116
+ var controlIdsRef = React.useRef(/* @__PURE__ */ new Map());
117
+ var labelsRef = React.useRef(/* @__PURE__ */ new Map());
118
+ var messagesRef = React.useRef(/* @__PURE__ */ new Map());
119
+ var [, update] = React.useReducer(function(value) {
120
+ return value + 1;
121
+ }, 0);
122
+ var registerControlId = React.useCallback(function(id) {
123
+ var source = /* @__PURE__ */ Symbol();
124
+ controlIdsRef.current.set(source, id);
125
+ update();
126
+ return function() {
127
+ controlIdsRef.current.delete(source);
128
+ update();
129
+ };
130
+ }, []);
131
+ var registerLabel = React.useCallback(function(id, text) {
132
+ var source = /* @__PURE__ */ Symbol();
133
+ labelsRef.current.set(source, {
134
+ id,
135
+ text
136
+ });
137
+ update();
138
+ return function() {
139
+ labelsRef.current.delete(source);
140
+ update();
141
+ };
142
+ }, []);
143
+ var registerMessage = React.useCallback(function(id, text) {
144
+ var source = /* @__PURE__ */ Symbol();
145
+ messagesRef.current.set(source, {
146
+ id,
147
+ text
148
+ });
149
+ update();
150
+ return function() {
151
+ messagesRef.current.delete(source);
152
+ update();
153
+ };
154
+ }, []);
155
+ var _Array_from_at;
156
+ var controlId = (_Array_from_at = Array.from(controlIdsRef.current.values()).at(-1)) !== null && _Array_from_at !== void 0 ? _Array_from_at : defaultControlId;
157
+ var label = Array.from(labelsRef.current.values()).at(-1);
158
+ var messages = Array.from(messagesRef.current.values());
159
+ return React.useMemo(function() {
160
+ var _parent_messageIds, _parent_messageTexts;
161
+ return {
162
+ controlId,
163
+ labelId: [parent === null || parent === void 0 ? void 0 : parent.labelId, label === null || label === void 0 ? void 0 : label.id].filter(Boolean).join(" ") || void 0,
164
+ labelText: [parent === null || parent === void 0 ? void 0 : parent.labelText, label === null || label === void 0 ? void 0 : label.text].filter(Boolean).join(" ") || void 0,
165
+ messageIds: Array.from(/* @__PURE__ */ new Set([...(_parent_messageIds = parent === null || parent === void 0 ? void 0 : parent.messageIds) !== null && _parent_messageIds !== void 0 ? _parent_messageIds : [], ...messages.map(function(message) {
166
+ return message.id;
167
+ })])),
168
+ messageTexts: [...(_parent_messageTexts = parent === null || parent === void 0 ? void 0 : parent.messageTexts) !== null && _parent_messageTexts !== void 0 ? _parent_messageTexts : [], ...messages.flatMap(function(message) {
169
+ return message.text ? [message.text] : [];
170
+ })],
171
+ registerControlId,
172
+ registerLabel,
173
+ registerMessage
174
+ };
175
+ }, [
176
+ controlId,
177
+ label === null || label === void 0 ? void 0 : label.id,
178
+ label === null || label === void 0 ? void 0 : label.text,
179
+ messages,
180
+ parent === null || parent === void 0 ? void 0 : parent.labelId,
181
+ parent === null || parent === void 0 ? void 0 : parent.labelText,
182
+ parent === null || parent === void 0 ? void 0 : parent.messageIds,
183
+ parent === null || parent === void 0 ? void 0 : parent.messageTexts,
184
+ registerControlId,
185
+ registerLabel,
186
+ registerMessage
187
+ ]);
188
+ }
189
+ function getStyleState(state) {
190
+ var disabled = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : state.disabled;
191
+ return {
192
+ valid: state.valid === true,
193
+ invalid: state.valid === false,
194
+ touched: state.touched,
195
+ dirty: state.dirty,
196
+ filled: state.filled,
197
+ focused: state.focused,
198
+ disabled
199
+ };
200
+ }
201
+ function getDataProps(state) {
202
+ var disabled = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : state.disabled;
203
+ if (!import_core.isWeb) {
204
+ return {};
205
+ }
206
+ return {
207
+ "data-valid": state.valid === true ? "" : void 0,
208
+ "data-invalid": state.valid === false ? "" : void 0,
209
+ "data-touched": state.touched ? "" : void 0,
210
+ "data-dirty": state.dirty ? "" : void 0,
211
+ "data-filled": state.filled ? "" : void 0,
212
+ "data-focused": state.focused ? "" : void 0,
213
+ "data-disabled": disabled ? "" : void 0
214
+ };
215
+ }
216
+ function useControlContext(root, association) {
217
+ var itemDisabled = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, isItem = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
218
+ var disabled = root.state.disabled || itemDisabled;
219
+ var controlIdRef = React.useRef(association.controlId);
220
+ var registrationDisabledRef = React.useRef(root.rootDisabled || itemDisabled);
221
+ controlIdRef.current = association.controlId;
222
+ registrationDisabledRef.current = root.rootDisabled || itemDisabled;
223
+ var registerControl = React.useCallback(function(registration) {
224
+ var _registration_id;
225
+ var id = (_registration_id = registration.id) !== null && _registration_id !== void 0 ? _registration_id : controlIdRef.current;
226
+ var unregisterId = association.registerControlId(id);
227
+ var nextRegistration = {
228
+ ...registration,
229
+ id,
230
+ get disabled() {
231
+ return registrationDisabledRef.current || registration.disabled;
232
+ }
233
+ };
234
+ var unregisterControl = root.registerControl(nextRegistration, !isItem);
235
+ return function() {
236
+ unregisterControl();
237
+ unregisterId();
238
+ };
239
+ }, [
240
+ association.registerControlId,
241
+ isItem,
242
+ root.registerControl
243
+ ]);
244
+ return React.useMemo(function() {
245
+ return {
246
+ name: root.name,
247
+ disabled,
248
+ ariaProps: {
249
+ id: association.controlId,
250
+ ...import_core.isWeb ? {
251
+ "aria-labelledby": association.labelId,
252
+ "aria-describedby": association.messageIds.join(" ") || void 0,
253
+ "aria-invalid": root.state.valid === false ? true : void 0
254
+ } : {
255
+ accessibilityLabel: association.labelText,
256
+ accessibilityHint: association.messageTexts.join(" ") || void 0,
257
+ accessibilityState: disabled ? { disabled: true } : void 0
258
+ }
259
+ },
260
+ dataProps: getDataProps(root.state, disabled),
261
+ onFocus: root.onFocus,
262
+ onBlur: root.onBlur,
263
+ onChange: root.onChange,
264
+ onDisabledChange: isItem ? function() {} : root.onDisabledChange,
265
+ registerControl
266
+ };
267
+ }, [
268
+ association.controlId,
269
+ association.labelId,
270
+ association.labelText,
271
+ association.messageIds,
272
+ association.messageTexts,
273
+ disabled,
274
+ isItem,
275
+ registerControl,
276
+ root.name,
277
+ root.onBlur,
278
+ root.onChange,
279
+ root.onDisabledChange,
280
+ root.onFocus,
281
+ root.state
282
+ ]);
283
+ }
284
+ function getRegistrationValue(registration) {
285
+ return (registration === null || registration === void 0 ? void 0 : registration.getValue) ? registration.getValue() : registration === null || registration === void 0 ? void 0 : registration.value;
286
+ }
287
+ function getInput(registration) {
288
+ var _registration_inputRef;
289
+ return (_registration_inputRef = registration.inputRef) === null || _registration_inputRef === void 0 ? void 0 : _registration_inputRef.current;
290
+ }
291
+ function canValidateInput(input) {
292
+ return Boolean(input && input.validity && typeof input.setCustomValidity === "function" && !input.disabled);
293
+ }
294
+ function isEligibleInput(input, formElement) {
295
+ var _input_matches, _input_hasAttribute;
296
+ if ((_input_matches = input.matches) === null || _input_matches === void 0 ? void 0 : _input_matches.call(input, ":disabled")) {
297
+ return false;
298
+ }
299
+ if (!formElement || input.form === formElement) {
300
+ return true;
301
+ }
302
+ return input.form === null && !((_input_hasAttribute = input.hasAttribute) === null || _input_hasAttribute === void 0 ? void 0 : _input_hasAttribute.call(input, "form"));
303
+ }
304
+ function isEligibleRegistration(registration, formElement) {
305
+ if (registration.disabled) {
306
+ return false;
307
+ }
308
+ var input = getInput(registration);
309
+ return !canValidateInput(input) || isEligibleInput(input, formElement);
310
+ }
311
+ function getNativeValidity(input, showValueMissing) {
312
+ var state = (0, import_validation.createDefaultValidityState)(true);
313
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
314
+ try {
315
+ for (var _iterator = validityKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
316
+ var key = _step.value;
317
+ state[key] = Boolean(input.validity[key]);
318
+ }
319
+ } catch (err) {
320
+ _didIteratorError = true;
321
+ _iteratorError = err;
322
+ } finally {
323
+ try {
324
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
325
+ _iterator.return();
326
+ }
327
+ } finally {
328
+ if (_didIteratorError) {
329
+ throw _iteratorError;
330
+ }
331
+ }
332
+ }
333
+ state.valid = Boolean(input.validity.valid);
334
+ return (0, import_validation.normalizeNativeValidity)(state, showValueMissing);
335
+ }
336
+ function hasValidityError(state) {
337
+ return state.valid === false;
338
+ }
339
+ function hasError(errors) {
340
+ return Array.isArray(errors) ? errors.length > 0 : Boolean(errors);
341
+ }
342
+ var FieldComponent = (0, import_core.createStyledHOC)(FieldFrame, function Field(param, forwardedRef) {
343
+ var { name: nameProp, disabled: disabledProp = false, invalid = false, validate, validationMode: validationModeProp, validationDebounceTime = 0, children, ...fieldProps } = param;
344
+ var form = (0, import_form.useFormRegistryContext)();
345
+ var { clearErrors: clearFormErrors, errors: formErrors, formElementRef, getValues: getFormValues, registerField: registerFormField, submitAttemptedRef, validationMode: formValidationMode } = form;
346
+ var reactId = React.useId().replace(/:/g, "");
347
+ var association = useAssociation(`field-${reactId}`);
348
+ var fieldId = `field-${reactId}`;
349
+ var controlsRef = React.useRef(/* @__PURE__ */ new Map());
350
+ var reportsDisabledRef = React.useRef(/* @__PURE__ */ new WeakMap());
351
+ var activeControlRef = React.useRef(void 0);
352
+ var activeValidationControlRef = React.useRef(void 0);
353
+ var formControlRef = React.useRef(null);
354
+ var formValidityDataRef = React.useRef({ state: { valid: null } });
355
+ var initialValueRef = React.useRef(void 0);
356
+ var hasInitialValueRef = React.useRef(false);
357
+ var valueRef = React.useRef(void 0);
358
+ var dirtyRef = React.useRef(false);
359
+ var debounceRef = React.useRef(void 0);
360
+ var [registeredName, setRegisteredName] = React.useState();
361
+ var [controlDisabled, setControlDisabled] = React.useState(false);
362
+ var [touched, setTouched] = React.useState(false);
363
+ var [dirty, setDirty] = React.useState(false);
364
+ var [filled, setFilled] = React.useState(false);
365
+ var [focused, setFocused] = React.useState(false);
366
+ var [currentValue, setCurrentValue] = React.useState(void 0);
367
+ var [validityData, setValidityData] = React.useState({
368
+ state: (0, import_validation.createDefaultValidityState)(),
369
+ error: "",
370
+ errors: [],
371
+ value: void 0,
372
+ initialValue: void 0
373
+ });
374
+ var validityDataRef = React.useRef(validityData);
375
+ validityDataRef.current = validityData;
376
+ var effectiveName = nameProp !== null && nameProp !== void 0 ? nameProp : registeredName;
377
+ var effectiveNameRef = React.useRef(effectiveName);
378
+ effectiveNameRef.current = effectiveName;
379
+ var disabled = disabledProp || controlDisabled;
380
+ var disabledRef = React.useRef(disabled);
381
+ disabledRef.current = disabled;
382
+ var validationMode = validationModeProp !== null && validationModeProp !== void 0 ? validationModeProp : formValidationMode;
383
+ var externalError = effectiveName && effectiveName in formErrors ? formErrors[effectiveName] : void 0;
384
+ var externalErrors = Array.isArray(externalError) ? externalError : externalError ? [externalError] : [];
385
+ var externallyInvalid = invalid || hasError(externalError);
386
+ var externallyInvalidRef = React.useRef(externallyInvalid);
387
+ externallyInvalidRef.current = externallyInvalid;
388
+ var valid = externallyInvalid ? false : disabled ? null : validityData.state.valid;
389
+ formValidityDataRef.current.state.valid = disabled ? null : externallyInvalid ? false : validityData.state.valid;
390
+ var errors = externalErrors.length ? externalErrors : validityData.errors;
391
+ var _errors_;
392
+ var error = (_errors_ = errors[0]) !== null && _errors_ !== void 0 ? _errors_ : "";
393
+ var state = React.useMemo(function() {
394
+ return {
395
+ name: effectiveName,
396
+ value: currentValue,
397
+ error,
398
+ errors,
399
+ validity: validityData.state,
400
+ valid,
401
+ touched,
402
+ dirty,
403
+ filled,
404
+ focused,
405
+ disabled
406
+ };
407
+ }, [
408
+ dirty,
409
+ disabled,
410
+ currentValue,
411
+ effectiveName,
412
+ error,
413
+ errors,
414
+ filled,
415
+ focused,
416
+ touched,
417
+ valid,
418
+ validityData.state
419
+ ]);
420
+ var stateRef = React.useRef(state);
421
+ stateRef.current = state;
422
+ var publishValidityRef = React.useRef(function() {});
423
+ var validationCommitterRef = React.useRef(void 0);
424
+ if (!validationCommitterRef.current) {
425
+ validationCommitterRef.current = (0, import_validation.createValidationCommitter)(function(data) {
426
+ publishValidityRef.current(data);
427
+ });
428
+ }
429
+ var getActiveControl = React.useCallback(function() {
430
+ var active;
431
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
432
+ try {
433
+ for (var _iterator = controlsRef.current.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
434
+ var registration = _step.value;
435
+ if (!isEligibleRegistration(registration, formElementRef.current)) {
436
+ continue;
437
+ }
438
+ active = registration;
439
+ }
440
+ } catch (err) {
441
+ _didIteratorError = true;
442
+ _iteratorError = err;
443
+ } finally {
444
+ try {
445
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
446
+ _iterator.return();
447
+ }
448
+ } finally {
449
+ if (_didIteratorError) {
450
+ throw _iteratorError;
451
+ }
452
+ }
453
+ }
454
+ return active;
455
+ }, [formElementRef]);
456
+ var syncControlDisabled = React.useCallback(function() {
457
+ var nextDisabled = false;
458
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
459
+ try {
460
+ for (var _iterator = controlsRef.current.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
461
+ var registration = _step.value;
462
+ if (reportsDisabledRef.current.get(registration)) {
463
+ nextDisabled = Boolean(registration.disabled);
464
+ }
465
+ }
466
+ } catch (err) {
467
+ _didIteratorError = true;
468
+ _iteratorError = err;
469
+ } finally {
470
+ try {
471
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
472
+ _iterator.return();
473
+ }
474
+ } finally {
475
+ if (_didIteratorError) {
476
+ throw _iteratorError;
477
+ }
478
+ }
479
+ }
480
+ setControlDisabled(nextDisabled);
481
+ }, []);
482
+ var getRepresentativeControl = React.useCallback(function() {
483
+ var fallback;
484
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
485
+ try {
486
+ for (var _iterator = controlsRef.current.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
487
+ var registration = _step.value;
488
+ var input = getInput(registration);
489
+ if (!isEligibleRegistration(registration, formElementRef.current)) {
490
+ continue;
491
+ }
492
+ fallback !== null && fallback !== void 0 ? fallback : fallback = registration;
493
+ if (canValidateInput(input) && !input.validity.valid) {
494
+ return registration;
495
+ }
496
+ }
497
+ } catch (err) {
498
+ _didIteratorError = true;
499
+ _iteratorError = err;
500
+ } finally {
501
+ try {
502
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
503
+ _iterator.return();
504
+ }
505
+ } finally {
506
+ if (_didIteratorError) {
507
+ throw _iteratorError;
508
+ }
509
+ }
510
+ }
511
+ return fallback !== null && fallback !== void 0 ? fallback : getActiveControl();
512
+ }, [formElementRef, getActiveControl]);
513
+ var clearCustomValidity = React.useCallback(function() {
514
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
515
+ try {
516
+ for (var _iterator = controlsRef.current.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
517
+ var registration = _step.value;
518
+ var input = getInput(registration);
519
+ if (canValidateInput(input)) {
520
+ input.setCustomValidity("");
521
+ }
522
+ }
523
+ } catch (err) {
524
+ _didIteratorError = true;
525
+ _iteratorError = err;
526
+ } finally {
527
+ try {
528
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
529
+ _iterator.return();
530
+ }
531
+ } finally {
532
+ if (_didIteratorError) {
533
+ throw _iteratorError;
534
+ }
535
+ }
536
+ }
537
+ }, []);
538
+ var setCustomValidity = React.useCallback(function(message) {
539
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
540
+ try {
541
+ for (var _iterator = controlsRef.current.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
542
+ var registration = _step.value;
543
+ if (!isEligibleRegistration(registration, formElementRef.current)) {
544
+ continue;
545
+ }
546
+ var input = getInput(registration);
547
+ if (canValidateInput(input)) {
548
+ input.setCustomValidity(message);
549
+ }
550
+ }
551
+ } catch (err) {
552
+ _didIteratorError = true;
553
+ _iteratorError = err;
554
+ } finally {
555
+ try {
556
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
557
+ _iterator.return();
558
+ }
559
+ } finally {
560
+ if (_didIteratorError) {
561
+ throw _iteratorError;
562
+ }
563
+ }
564
+ }
565
+ }, [formElementRef]);
566
+ var publishValidity = React.useCallback(function(data) {
567
+ if (data.state.customError) {
568
+ setCustomValidity(data.errors.join("\n"));
569
+ } else {
570
+ clearCustomValidity();
571
+ }
572
+ formValidityDataRef.current.state.valid = disabledRef.current ? null : externallyInvalidRef.current ? false : data.state.valid;
573
+ validityDataRef.current = data;
574
+ setCurrentValue(data.value);
575
+ setValidityData(data);
576
+ }, [clearCustomValidity, setCustomValidity]);
577
+ publishValidityRef.current = publishValidity;
578
+ var validateValue = React.useCallback(function(value) {
579
+ var submit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, fromChange = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
580
+ if (debounceRef.current) {
581
+ clearTimeout(debounceRef.current);
582
+ debounceRef.current = void 0;
583
+ }
584
+ var showValueMissing = dirtyRef.current || submit || submitAttemptedRef.current;
585
+ if (fromChange) {
586
+ clearCustomValidity();
587
+ }
588
+ var representative = getRepresentativeControl();
589
+ activeValidationControlRef.current = representative;
590
+ var _representative_controlRef_current;
591
+ formControlRef.current = (_representative_controlRef_current = representative === null || representative === void 0 ? void 0 : representative.controlRef.current) !== null && _representative_controlRef_current !== void 0 ? _representative_controlRef_current : null;
592
+ var input = representative && getInput(representative);
593
+ var nativeState = (0, import_validation.createDefaultValidityState)(true);
594
+ var nativeMessage = "";
595
+ if (canValidateInput(input)) {
596
+ nativeState = getNativeValidity(input, showValueMissing);
597
+ nativeMessage = nativeState.valid === false ? input.validationMessage : "";
598
+ } else {
599
+ var required = Array.from(controlsRef.current.values()).some(function(registration) {
600
+ return registration.required && isEligibleRegistration(registration, formElementRef.current);
601
+ });
602
+ if (required && !(0, import_validation.isFilled)(value) && showValueMissing) {
603
+ nativeState = {
604
+ ...(0, import_validation.createDefaultValidityState)(false),
605
+ valueMissing: true
606
+ };
607
+ nativeMessage = "Please fill out this field.";
608
+ }
609
+ }
610
+ var initialValue = initialValueRef.current;
611
+ var makeValidityData = function(customErrors) {
612
+ if (customErrors.length) {
613
+ var _customErrors_;
614
+ return {
615
+ state: {
616
+ ...nativeState,
617
+ valid: false,
618
+ customError: true
619
+ },
620
+ error: (_customErrors_ = customErrors[0]) !== null && _customErrors_ !== void 0 ? _customErrors_ : "",
621
+ errors: customErrors,
622
+ value,
623
+ initialValue
624
+ };
625
+ }
626
+ if (hasValidityError(nativeState)) {
627
+ return {
628
+ state: nativeState,
629
+ error: nativeMessage,
630
+ errors: nativeMessage ? [nativeMessage] : [],
631
+ value,
632
+ initialValue
633
+ };
634
+ }
635
+ return {
636
+ state: (0, import_validation.createDefaultValidityState)(true),
637
+ error: "",
638
+ errors: [],
639
+ value,
640
+ initialValue
641
+ };
642
+ };
643
+ if (nativeMessage && !fromChange) {
644
+ validationCommitterRef.current.run(makeValidityData([]));
645
+ return;
646
+ }
647
+ var result = validate ? (0, import_validation.getValidationResult)(validate, value, getFormValues()) : [];
648
+ if (result instanceof Promise) {
649
+ void validationCommitterRef.current.run(result.then(function(customErrors) {
650
+ return makeValidityData(customErrors);
651
+ }));
652
+ } else {
653
+ validationCommitterRef.current.run(makeValidityData(result));
654
+ }
655
+ }, [
656
+ clearCustomValidity,
657
+ formElementRef,
658
+ getFormValues,
659
+ getRepresentativeControl,
660
+ submitAttemptedRef,
661
+ validate
662
+ ]);
663
+ var registerControl = React.useCallback(function(registration) {
664
+ var reportDisabled = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
665
+ var _activeControlRef_current;
666
+ var source = /* @__PURE__ */ Symbol();
667
+ controlsRef.current.set(source, registration);
668
+ reportsDisabledRef.current.set(registration, reportDisabled);
669
+ activeControlRef.current = getActiveControl();
670
+ var _activeControlRef_current_controlRef_current;
671
+ formControlRef.current = (_activeControlRef_current_controlRef_current = (_activeControlRef_current = activeControlRef.current) === null || _activeControlRef_current === void 0 ? void 0 : _activeControlRef_current.controlRef.current) !== null && _activeControlRef_current_controlRef_current !== void 0 ? _activeControlRef_current_controlRef_current : null;
672
+ var value = getRegistrationValue(registration);
673
+ valueRef.current = value;
674
+ setCurrentValue(value);
675
+ if (!hasInitialValueRef.current) {
676
+ hasInitialValueRef.current = true;
677
+ initialValueRef.current = value;
678
+ validityDataRef.current = {
679
+ ...validityDataRef.current,
680
+ initialValue: value
681
+ };
682
+ setValidityData(validityDataRef.current);
683
+ }
684
+ if (!nameProp && registration.name) {
685
+ setRegisteredName(registration.name);
686
+ }
687
+ setFilled((0, import_validation.isFilled)(value));
688
+ syncControlDisabled();
689
+ return function() {
690
+ var _activeControlRef_current2;
691
+ controlsRef.current.delete(source);
692
+ activeControlRef.current = getActiveControl();
693
+ activeValidationControlRef.current = void 0;
694
+ var _activeControlRef_current_controlRef_current2;
695
+ formControlRef.current = (_activeControlRef_current_controlRef_current2 = (_activeControlRef_current2 = activeControlRef.current) === null || _activeControlRef_current2 === void 0 ? void 0 : _activeControlRef_current2.controlRef.current) !== null && _activeControlRef_current_controlRef_current2 !== void 0 ? _activeControlRef_current_controlRef_current2 : null;
696
+ var next = activeControlRef.current;
697
+ var nextValue = getRegistrationValue(next);
698
+ valueRef.current = nextValue;
699
+ setCurrentValue(nextValue);
700
+ setFilled((0, import_validation.isFilled)(nextValue));
701
+ if (!nameProp) {
702
+ setRegisteredName(next === null || next === void 0 ? void 0 : next.name);
703
+ }
704
+ syncControlDisabled();
705
+ };
706
+ }, [
707
+ getActiveControl,
708
+ nameProp,
709
+ syncControlDisabled
710
+ ]);
711
+ var onFocus = React.useCallback(function() {
712
+ setFocused(true);
713
+ }, []);
714
+ var onBlur = React.useCallback(function() {
715
+ var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : valueRef.current;
716
+ valueRef.current = value;
717
+ setCurrentValue(value);
718
+ setTouched(true);
719
+ setFocused(false);
720
+ if (validationMode === "onBlur") {
721
+ validateValue(value);
722
+ }
723
+ }, [validateValue, validationMode]);
724
+ var onChange = React.useCallback(function(value) {
725
+ valueRef.current = value;
726
+ setCurrentValue(value);
727
+ validationCommitterRef.current.invalidate();
728
+ if (debounceRef.current) {
729
+ clearTimeout(debounceRef.current);
730
+ debounceRef.current = void 0;
731
+ }
732
+ var nextDirty = !Object.is(value, initialValueRef.current);
733
+ dirtyRef.current = nextDirty;
734
+ setDirty(nextDirty);
735
+ setFilled((0, import_validation.isFilled)(value));
736
+ clearFormErrors(effectiveNameRef.current);
737
+ var validateOnChange = (0, import_validation.shouldValidateOnChange)(validationMode, submitAttemptedRef.current);
738
+ if (validateOnChange) {
739
+ if (validationMode === "onChange" && validationDebounceTime > 0 && value !== "") {
740
+ debounceRef.current = setTimeout(function() {
741
+ validateValue(value, false, true);
742
+ }, validationDebounceTime);
743
+ } else {
744
+ validateValue(value, false, true);
745
+ }
746
+ return;
747
+ }
748
+ if (stateRef.current.valid === false) {
749
+ var required = Array.from(controlsRef.current.values()).some(function(registration) {
750
+ return registration.required && isEligibleRegistration(registration, formElementRef.current);
751
+ });
752
+ if (required && !(0, import_validation.isFilled)(value) && dirtyRef.current) {
753
+ validateValue(value);
754
+ return;
755
+ }
756
+ clearCustomValidity();
757
+ publishValidity({
758
+ state: (0, import_validation.createDefaultValidityState)(true),
759
+ error: "",
760
+ errors: [],
761
+ value,
762
+ initialValue: initialValueRef.current
763
+ });
764
+ }
765
+ }, [
766
+ clearFormErrors,
767
+ clearCustomValidity,
768
+ formElementRef,
769
+ publishValidity,
770
+ submitAttemptedRef,
771
+ validateValue,
772
+ validationDebounceTime,
773
+ validationMode
774
+ ]);
775
+ var onDisabledChange = React.useCallback(function(nextDisabled) {
776
+ setControlDisabled(nextDisabled);
777
+ }, []);
778
+ React.useEffect(function() {
779
+ return function() {
780
+ var _validationCommitterRef_current;
781
+ (_validationCommitterRef_current = validationCommitterRef.current) === null || _validationCommitterRef_current === void 0 ? void 0 : _validationCommitterRef_current.invalidate();
782
+ if (debounceRef.current) {
783
+ clearTimeout(debounceRef.current);
784
+ }
785
+ };
786
+ }, []);
787
+ var formRegistration = React.useMemo(function() {
788
+ return {
789
+ controlRef: formControlRef,
790
+ validityData: formValidityDataRef.current,
791
+ get name() {
792
+ return stateRef.current.disabled ? void 0 : effectiveNameRef.current;
793
+ },
794
+ get controlId() {
795
+ var _activeValidationControlRef_current, _getRepresentativeControl;
796
+ var _activeValidationControlRef_current_id, _ref;
797
+ return (_ref = (_activeValidationControlRef_current_id = (_activeValidationControlRef_current = activeValidationControlRef.current) === null || _activeValidationControlRef_current === void 0 ? void 0 : _activeValidationControlRef_current.id) !== null && _activeValidationControlRef_current_id !== void 0 ? _activeValidationControlRef_current_id : (_getRepresentativeControl = getRepresentativeControl()) === null || _getRepresentativeControl === void 0 ? void 0 : _getRepresentativeControl.id) !== null && _ref !== void 0 ? _ref : association.controlId;
798
+ },
799
+ getValue() {
800
+ var _getRegistrationValue;
801
+ return (_getRegistrationValue = getRegistrationValue(getActiveControl())) !== null && _getRegistrationValue !== void 0 ? _getRegistrationValue : valueRef.current;
802
+ },
803
+ validate() {
804
+ var _getRegistrationValue;
805
+ validateValue((_getRegistrationValue = getRegistrationValue(getActiveControl())) !== null && _getRegistrationValue !== void 0 ? _getRegistrationValue : valueRef.current, true);
806
+ }
807
+ };
808
+ }, [
809
+ association.controlId,
810
+ getActiveControl,
811
+ getRepresentativeControl,
812
+ validateValue
813
+ ]);
814
+ React.useEffect(function() {
815
+ return registerFormField(fieldId, formRegistration);
816
+ }, [
817
+ fieldId,
818
+ formRegistration,
819
+ registerFormField
820
+ ]);
821
+ var rootContext = React.useMemo(function() {
822
+ return {
823
+ state,
824
+ validityData,
825
+ name: effectiveName,
826
+ rootDisabled: disabledProp,
827
+ registerControl,
828
+ onFocus,
829
+ onBlur,
830
+ onChange,
831
+ onDisabledChange
832
+ };
833
+ }, [
834
+ disabledProp,
835
+ effectiveName,
836
+ onBlur,
837
+ onChange,
838
+ onDisabledChange,
839
+ onFocus,
840
+ registerControl,
841
+ state,
842
+ validityData
843
+ ]);
844
+ var controlContext = useControlContext(rootContext, association);
845
+ var styleState = getStyleState(state);
846
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FieldContext.FieldStateContext.Provider, {
847
+ value: state,
848
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldRootContext.Provider, {
849
+ value: rootContext,
850
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AssociationContext.Provider, {
851
+ value: association,
852
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FieldContext.FieldControlContext.Provider, {
853
+ value: controlContext,
854
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FieldContext.FieldStyledContext.Provider, {
855
+ ...styleState,
856
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldFrame, {
857
+ ...fieldProps,
858
+ ...getDataProps(state),
859
+ disabled,
860
+ ref: forwardedRef,
861
+ children
862
+ })
863
+ })
864
+ })
865
+ })
866
+ })
867
+ });
868
+ });
869
+ function usePartContexts() {
870
+ var root = React.useContext(FieldRootContext);
871
+ var association = React.useContext(AssociationContext);
872
+ var itemDisabled = React.useContext(FieldItemContext);
873
+ if (!root || !association) {
874
+ throw new Error("Field parts must be rendered inside <Field>.");
875
+ }
876
+ return {
877
+ root,
878
+ association,
879
+ itemDisabled
880
+ };
881
+ }
882
+ var FieldLabel = (0, import_core.createStyledHOC)(FieldLabelFrame, function FieldLabel2(param, forwardedRef) {
883
+ var { id: idProp, children, onPress, onMouseDown, ...labelProps } = param;
884
+ var { root, association, itemDisabled } = usePartContexts();
885
+ var generatedId = React.useId().replace(/:/g, "");
886
+ var id = idProp !== null && idProp !== void 0 ? idProp : `field-label-${generatedId}`;
887
+ var text = getText(children);
888
+ var disabled = root.state.disabled || itemDisabled;
889
+ (0, import_core.useIsomorphicLayoutEffect)(function() {
890
+ return association.registerLabel(id, text);
891
+ }, [
892
+ association.registerLabel,
893
+ id,
894
+ text
895
+ ]);
896
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldLabelFrame, {
897
+ ...labelProps,
898
+ ...getDataProps(root.state, disabled),
899
+ id,
900
+ ref: forwardedRef,
901
+ ...import_core.isWeb ? { htmlFor: association.controlId } : void 0,
902
+ ...!import_core.isWeb && disabled ? { accessibilityState: { disabled: true } } : void 0,
903
+ onMouseDown: function(event) {
904
+ onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
905
+ if (!event.defaultPrevented && event.detail > 1) {
906
+ event.preventDefault();
907
+ }
908
+ },
909
+ onPress: function(event) {
910
+ onPress === null || onPress === void 0 ? void 0 : onPress(event);
911
+ if (!import_core.isWeb && !(event === null || event === void 0 ? void 0 : event.defaultPrevented)) {
912
+ (0, import_focusable.focusFocusable)(association.controlId);
913
+ }
914
+ },
915
+ children
916
+ });
917
+ });
918
+ var FieldDescription = (0, import_core.createStyledHOC)(FieldDescriptionFrame, function FieldDescription2(param, forwardedRef) {
919
+ var { id: idProp, children, ...descriptionProps } = param;
920
+ var { root, association, itemDisabled } = usePartContexts();
921
+ var generatedId = React.useId().replace(/:/g, "");
922
+ var id = idProp !== null && idProp !== void 0 ? idProp : `field-description-${generatedId}`;
923
+ var text = getText(children);
924
+ var disabled = root.state.disabled || itemDisabled;
925
+ (0, import_core.useIsomorphicLayoutEffect)(function() {
926
+ return association.registerMessage(id, text);
927
+ }, [
928
+ association.registerMessage,
929
+ id,
930
+ text
931
+ ]);
932
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldDescriptionFrame, {
933
+ ...descriptionProps,
934
+ ...getDataProps(root.state, disabled),
935
+ id,
936
+ ref: forwardedRef,
937
+ children
938
+ });
939
+ });
940
+ var FieldError = (0, import_core.createStyledHOC)(FieldErrorFrame, function FieldError2(param, forwardedRef) {
941
+ var { id: idProp, children, match, ...errorProps } = param;
942
+ var { root, association, itemDisabled } = usePartContexts();
943
+ var generatedId = React.useId().replace(/:/g, "");
944
+ var id = idProp !== null && idProp !== void 0 ? idProp : `field-error-${generatedId}`;
945
+ var disabled = root.state.disabled || itemDisabled;
946
+ var rendered = match === true || !disabled && (typeof match === "string" ? Boolean(root.validityData.state[match]) : root.state.valid === false);
947
+ var message = children !== null && children !== void 0 ? children : root.state.errors.join("\n");
948
+ var text = getText(message);
949
+ (0, import_core.useIsomorphicLayoutEffect)(function() {
950
+ if (!rendered) {
951
+ return;
952
+ }
953
+ return association.registerMessage(id, text);
954
+ }, [
955
+ association.registerMessage,
956
+ id,
957
+ rendered,
958
+ text
959
+ ]);
960
+ if (!rendered) {
961
+ return null;
962
+ }
963
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldErrorFrame, {
964
+ ...errorProps,
965
+ ...getDataProps(root.state, disabled),
966
+ id,
967
+ ref: forwardedRef,
968
+ children: message
969
+ });
970
+ });
971
+ var FieldItem = (0, import_core.createStyledHOC)(FieldItemFrame, function FieldItem2(param, forwardedRef) {
972
+ var { disabled: disabledProp = false, children, ...itemProps } = param;
973
+ var root = React.useContext(FieldRootContext);
974
+ var parentAssociation = React.useContext(AssociationContext);
975
+ var reactId = React.useId().replace(/:/g, "");
976
+ var association = useAssociation(`field-item-${reactId}`, parentAssociation);
977
+ if (!root || !parentAssociation) {
978
+ throw new Error("Field.Item must be rendered inside <Field>.");
979
+ }
980
+ var disabled = root.state.disabled || disabledProp;
981
+ var controlContext = useControlContext(root, association, disabledProp, true);
982
+ var styleState = getStyleState(root.state, disabled);
983
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldItemContext.Provider, {
984
+ value: disabledProp,
985
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AssociationContext.Provider, {
986
+ value: association,
987
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FieldContext.FieldControlContext.Provider, {
988
+ value: controlContext,
989
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FieldContext.FieldStyledContext.Provider, {
990
+ ...styleState,
991
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldItemFrame, {
992
+ ...itemProps,
993
+ ...getDataProps(root.state, disabled),
994
+ disabled,
995
+ ref: forwardedRef,
996
+ children
997
+ })
998
+ })
999
+ })
1000
+ })
1001
+ });
1002
+ });
1003
+ var Field2 = (0, import_core.withStaticProperties)(FieldComponent, {
1004
+ Label: FieldLabel,
1005
+ Description: FieldDescription,
1006
+ Error: FieldError,
1007
+ Item: FieldItem,
1008
+ useFieldState: import_FieldContext.useFieldState,
1009
+ useFieldControl: import_FieldContext.useFieldControl
1010
+ });
1011
+
1012
+ //# sourceMappingURL=Field.native.js.map