@tamagui/field 0.0.0-bootstrap.0 → 3.0.0-beta.643.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 +857 -0
  3. package/dist/cjs/Field.native.cjs +1018 -0
  4. package/dist/cjs/Field.native.js +1020 -0
  5. package/dist/cjs/Field.native.js.map +1 -0
  6. package/dist/cjs/FieldContext.cjs +86 -0
  7. package/dist/cjs/FieldContext.native.cjs +90 -0
  8. package/dist/cjs/FieldContext.native.js +92 -0
  9. package/dist/cjs/FieldContext.native.js.map +1 -0
  10. package/dist/cjs/index.cjs +21 -0
  11. package/dist/cjs/index.native.cjs +23 -0
  12. package/dist/cjs/index.native.js +25 -0
  13. package/dist/cjs/index.native.js.map +1 -0
  14. package/dist/cjs/types.cjs +17 -0
  15. package/dist/cjs/types.native.cjs +19 -0
  16. package/dist/cjs/types.native.js +21 -0
  17. package/dist/cjs/types.native.js.map +1 -0
  18. package/dist/cjs/validation.cjs +114 -0
  19. package/dist/cjs/validation.native.cjs +126 -0
  20. package/dist/cjs/validation.native.js +128 -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 +983 -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 +96 -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 +1018 -0
  42. package/dist/jsx/Field.native.js +1020 -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 +90 -0
  47. package/dist/jsx/FieldContext.native.js +92 -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 +23 -0
  52. package/dist/jsx/index.native.js +25 -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 +19 -0
  56. package/dist/jsx/types.native.js +21 -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 +126 -0
  61. package/dist/jsx/validation.native.js +128 -0
  62. package/dist/jsx/validation.native.js.map +1 -0
  63. package/package.json +50 -5
  64. package/src/Field.tsx +1129 -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 @@
1
+ {"version":3,"file":"Field.js","names":[],"sources":["esm/Field.js"],"sourcesContent":["import {\n createStyledHOC,\n isWeb,\n styled,\n Text,\n useIsomorphicLayoutEffect,\n View,\n withStaticProperties\n} from \"@tamagui/core\";\nimport { useFormRegistryContext } from \"@tamagui/form\";\nimport { focusFocusable } from \"@tamagui/focusable\";\nimport * as React from \"react\";\nimport {\n FieldControlContext,\n FieldStateContext,\n FieldStyledContext,\n useFieldControl,\n useFieldState\n} from \"./FieldContext\";\nimport {\n createDefaultValidityState,\n createValidationCommitter,\n getValidationResult,\n isFilled,\n normalizeNativeValidity,\n shouldValidateOnChange\n} from \"./validation\";\nimport { jsx } from \"react/jsx-runtime\";\nconst fieldStateVariants = {\n valid: { true: {} },\n invalid: { true: {} },\n touched: { true: {} },\n dirty: { true: {} },\n filled: { true: {} },\n focused: { true: {} },\n disabled: { true: {} }\n};\nconst FieldFrame = styled(View, {\n displayName: \"Field\",\n context: FieldStyledContext,\n variants: fieldStateVariants\n});\nconst FieldLabelFrame = styled(Text, {\n displayName: \"FieldLabel\",\n render: \"label\",\n context: FieldStyledContext,\n variants: fieldStateVariants\n});\nconst FieldDescriptionFrame = styled(Text, {\n displayName: \"FieldDescription\",\n render: \"p\",\n context: FieldStyledContext,\n variants: fieldStateVariants\n});\nconst FieldErrorFrame = styled(Text, {\n displayName: \"FieldError\",\n render: \"span\",\n context: FieldStyledContext,\n variants: fieldStateVariants\n});\nconst FieldItemFrame = styled(View, {\n displayName: \"FieldItem\",\n context: FieldStyledContext,\n variants: fieldStateVariants\n});\nconst validityKeys = [\n \"badInput\",\n \"customError\",\n \"patternMismatch\",\n \"rangeOverflow\",\n \"rangeUnderflow\",\n \"stepMismatch\",\n \"tooLong\",\n \"tooShort\",\n \"typeMismatch\",\n \"valueMissing\"\n];\nconst AssociationContext = React.createContext(null);\nconst FieldRootContext = React.createContext(null);\nconst FieldItemContext = React.createContext(false);\nfunction getText(children) {\n const text = [];\n React.Children.forEach(children, (child) => {\n if (typeof child === \"string\" || typeof child === \"number\") {\n text.push(String(child));\n return;\n }\n if (React.isValidElement(child)) {\n const nested = getText(child.props.children);\n if (nested) {\n text.push(nested);\n }\n }\n });\n return text.join(\" \").trim() || void 0;\n}\nfunction useAssociation(prefix, parent) {\n const defaultControlId = `${prefix}-control`;\n const controlIdsRef = React.useRef(/* @__PURE__ */ new Map());\n const labelsRef = React.useRef(/* @__PURE__ */ new Map());\n const messagesRef = React.useRef(/* @__PURE__ */ new Map());\n const [, update] = React.useReducer((value) => value + 1, 0);\n const registerControlId = React.useCallback((id) => {\n const source = /* @__PURE__ */ Symbol();\n controlIdsRef.current.set(source, id);\n update();\n return () => {\n controlIdsRef.current.delete(source);\n update();\n };\n }, []);\n const registerLabel = React.useCallback((id, text) => {\n const source = /* @__PURE__ */ Symbol();\n labelsRef.current.set(source, { id, text });\n update();\n return () => {\n labelsRef.current.delete(source);\n update();\n };\n }, []);\n const registerMessage = React.useCallback((id, text) => {\n const source = /* @__PURE__ */ Symbol();\n messagesRef.current.set(source, { id, text });\n update();\n return () => {\n messagesRef.current.delete(source);\n update();\n };\n }, []);\n const controlId = Array.from(controlIdsRef.current.values()).at(-1) ?? defaultControlId;\n const label = Array.from(labelsRef.current.values()).at(-1);\n const messages = Array.from(messagesRef.current.values());\n return React.useMemo(\n () => ({\n controlId,\n labelId: [parent?.labelId, label?.id].filter(Boolean).join(\" \") || void 0,\n labelText: [parent?.labelText, label?.text].filter(Boolean).join(\" \") || void 0,\n messageIds: Array.from(\n /* @__PURE__ */ new Set([...parent?.messageIds ?? [], ...messages.map((message) => message.id)])\n ),\n messageTexts: [\n ...parent?.messageTexts ?? [],\n ...messages.flatMap((message) => message.text ? [message.text] : [])\n ],\n registerControlId,\n registerLabel,\n registerMessage\n }),\n [\n controlId,\n label?.id,\n label?.text,\n messages,\n parent?.labelId,\n parent?.labelText,\n parent?.messageIds,\n parent?.messageTexts,\n registerControlId,\n registerLabel,\n registerMessage\n ]\n );\n}\nfunction getStyleState(state, disabled = state.disabled) {\n return {\n valid: state.valid === true,\n invalid: state.valid === false,\n touched: state.touched,\n dirty: state.dirty,\n filled: state.filled,\n focused: state.focused,\n disabled\n };\n}\nfunction getDataProps(state, disabled = state.disabled) {\n if (!isWeb) {\n return {};\n }\n return {\n \"data-valid\": state.valid === true ? \"\" : void 0,\n \"data-invalid\": state.valid === false ? \"\" : void 0,\n \"data-touched\": state.touched ? \"\" : void 0,\n \"data-dirty\": state.dirty ? \"\" : void 0,\n \"data-filled\": state.filled ? \"\" : void 0,\n \"data-focused\": state.focused ? \"\" : void 0,\n \"data-disabled\": disabled ? \"\" : void 0\n };\n}\nfunction useControlContext(root, association, itemDisabled = false, isItem = false) {\n const disabled = root.state.disabled || itemDisabled;\n const controlIdRef = React.useRef(association.controlId);\n const registrationDisabledRef = React.useRef(root.rootDisabled || itemDisabled);\n controlIdRef.current = association.controlId;\n registrationDisabledRef.current = root.rootDisabled || itemDisabled;\n const registerControl = React.useCallback(\n (registration) => {\n const id = registration.id ?? controlIdRef.current;\n const unregisterId = association.registerControlId(id);\n const nextRegistration = {\n ...registration,\n id,\n get disabled() {\n return registrationDisabledRef.current || registration.disabled;\n }\n };\n const unregisterControl = root.registerControl(nextRegistration, !isItem);\n return () => {\n unregisterControl();\n unregisterId();\n };\n },\n [association.registerControlId, isItem, root.registerControl]\n );\n return React.useMemo(\n () => ({\n name: root.name,\n disabled,\n ariaProps: {\n id: association.controlId,\n ...isWeb ? {\n \"aria-labelledby\": association.labelId,\n \"aria-describedby\": association.messageIds.join(\" \") || void 0,\n \"aria-invalid\": root.state.valid === false ? true : void 0\n } : {\n accessibilityLabel: association.labelText,\n accessibilityHint: association.messageTexts.join(\" \") || void 0,\n accessibilityState: disabled ? { disabled: true } : void 0\n }\n },\n dataProps: getDataProps(root.state, disabled),\n onFocus: root.onFocus,\n onBlur: root.onBlur,\n onChange: root.onChange,\n onDisabledChange: isItem ? () => {\n } : root.onDisabledChange,\n registerControl\n }),\n [\n association.controlId,\n association.labelId,\n association.labelText,\n association.messageIds,\n association.messageTexts,\n disabled,\n isItem,\n registerControl,\n root.name,\n root.onBlur,\n root.onChange,\n root.onDisabledChange,\n root.onFocus,\n root.state\n ]\n );\n}\nfunction getRegistrationValue(registration) {\n return registration?.getValue ? registration.getValue() : registration?.value;\n}\nfunction getInput(registration) {\n return registration.inputRef?.current;\n}\nfunction canValidateInput(input) {\n return Boolean(\n input && input.validity && typeof input.setCustomValidity === \"function\" && !input.disabled\n );\n}\nfunction isEligibleInput(input, formElement) {\n if (input.matches?.(\":disabled\")) {\n return false;\n }\n if (!formElement || input.form === formElement) {\n return true;\n }\n return input.form === null && !input.hasAttribute?.(\"form\");\n}\nfunction isEligibleRegistration(registration, formElement) {\n if (registration.disabled) {\n return false;\n }\n const input = getInput(registration);\n return !canValidateInput(input) || isEligibleInput(input, formElement);\n}\nfunction getNativeValidity(input, showValueMissing) {\n const state = createDefaultValidityState(true);\n for (const key of validityKeys) {\n state[key] = Boolean(input.validity[key]);\n }\n state.valid = Boolean(input.validity.valid);\n return normalizeNativeValidity(state, showValueMissing);\n}\nfunction hasValidityError(state) {\n return state.valid === false;\n}\nfunction hasError(errors) {\n return Array.isArray(errors) ? errors.length > 0 : Boolean(errors);\n}\nconst FieldComponent = createStyledHOC(\n FieldFrame,\n function Field({\n name: nameProp,\n disabled: disabledProp = false,\n invalid = false,\n validate,\n validationMode: validationModeProp,\n validationDebounceTime = 0,\n children,\n ...fieldProps\n }, forwardedRef) {\n const form = useFormRegistryContext();\n const {\n clearErrors: clearFormErrors,\n errors: formErrors,\n formElementRef,\n getValues: getFormValues,\n registerField: registerFormField,\n submitAttemptedRef,\n validationMode: formValidationMode\n } = form;\n const reactId = React.useId().replace(/:/g, \"\");\n const association = useAssociation(`field-${reactId}`);\n const fieldId = `field-${reactId}`;\n const controlsRef = React.useRef(/* @__PURE__ */ new Map());\n const reportsDisabledRef = React.useRef(\n /* @__PURE__ */ new WeakMap()\n );\n const activeControlRef = React.useRef(void 0);\n const activeValidationControlRef = React.useRef(\n void 0\n );\n const formControlRef = React.useRef(null);\n const formValidityDataRef = React.useRef({\n state: {\n valid: null\n }\n });\n const initialValueRef = React.useRef(void 0);\n const hasInitialValueRef = React.useRef(false);\n const valueRef = React.useRef(void 0);\n const dirtyRef = React.useRef(false);\n const debounceRef = React.useRef(void 0);\n const [registeredName, setRegisteredName] = React.useState();\n const [controlDisabled, setControlDisabled] = React.useState(false);\n const [touched, setTouched] = React.useState(false);\n const [dirty, setDirty] = React.useState(false);\n const [filled, setFilled] = React.useState(false);\n const [focused, setFocused] = React.useState(false);\n const [currentValue, setCurrentValue] = React.useState(void 0);\n const [validityData, setValidityData] = React.useState({\n state: createDefaultValidityState(),\n error: \"\",\n errors: [],\n value: void 0,\n initialValue: void 0\n });\n const validityDataRef = React.useRef(validityData);\n validityDataRef.current = validityData;\n const effectiveName = nameProp ?? registeredName;\n const effectiveNameRef = React.useRef(effectiveName);\n effectiveNameRef.current = effectiveName;\n const disabled = disabledProp || controlDisabled;\n const disabledRef = React.useRef(disabled);\n disabledRef.current = disabled;\n const validationMode = validationModeProp ?? formValidationMode;\n const externalError = effectiveName && Object.hasOwn(formErrors, effectiveName) ? formErrors[effectiveName] : void 0;\n const externalErrors = Array.isArray(externalError) ? externalError : externalError ? [externalError] : [];\n const externallyInvalid = invalid || hasError(externalError);\n const externallyInvalidRef = React.useRef(externallyInvalid);\n externallyInvalidRef.current = externallyInvalid;\n const valid = externallyInvalid ? false : disabled ? null : validityData.state.valid;\n formValidityDataRef.current.state.valid = disabled ? null : externallyInvalid ? false : validityData.state.valid;\n const errors = externalErrors.length ? externalErrors : validityData.errors;\n const error = errors[0] ?? \"\";\n const state = React.useMemo(\n () => ({\n name: effectiveName,\n value: currentValue,\n error,\n errors,\n validity: validityData.state,\n valid,\n touched,\n dirty,\n filled,\n focused,\n disabled\n }),\n [\n dirty,\n disabled,\n currentValue,\n effectiveName,\n error,\n errors,\n filled,\n focused,\n touched,\n valid,\n validityData.state\n ]\n );\n const stateRef = React.useRef(state);\n stateRef.current = state;\n const publishValidityRef = React.useRef(() => {\n });\n const validationCommitterRef = React.useRef(void 0);\n if (!validationCommitterRef.current) {\n validationCommitterRef.current = createValidationCommitter((data) => {\n publishValidityRef.current(data);\n });\n }\n const getActiveControl = React.useCallback(() => {\n let active;\n for (const registration of controlsRef.current.values()) {\n if (!isEligibleRegistration(registration, formElementRef.current)) {\n continue;\n }\n active = registration;\n }\n return active;\n }, [formElementRef]);\n const syncControlDisabled = React.useCallback(() => {\n let nextDisabled = false;\n for (const registration of controlsRef.current.values()) {\n if (reportsDisabledRef.current.get(registration)) {\n nextDisabled = Boolean(registration.disabled);\n }\n }\n setControlDisabled(nextDisabled);\n }, []);\n const getRepresentativeControl = React.useCallback(() => {\n let fallback;\n for (const registration of controlsRef.current.values()) {\n const input = getInput(registration);\n if (!isEligibleRegistration(registration, formElementRef.current)) {\n continue;\n }\n fallback ??= registration;\n if (canValidateInput(input) && !input.validity.valid) {\n return registration;\n }\n }\n return fallback ?? getActiveControl();\n }, [formElementRef, getActiveControl]);\n const clearCustomValidity = React.useCallback(() => {\n for (const registration of controlsRef.current.values()) {\n const input = getInput(registration);\n if (canValidateInput(input)) {\n input.setCustomValidity(\"\");\n }\n }\n }, []);\n const setCustomValidity = React.useCallback(\n (message) => {\n for (const registration of controlsRef.current.values()) {\n if (!isEligibleRegistration(registration, formElementRef.current)) {\n continue;\n }\n const input = getInput(registration);\n if (canValidateInput(input)) {\n input.setCustomValidity(message);\n }\n }\n },\n [formElementRef]\n );\n const publishValidity = React.useCallback(\n (data) => {\n if (data.state.customError) {\n setCustomValidity(data.errors.join(\"\\n\"));\n } else {\n clearCustomValidity();\n }\n formValidityDataRef.current.state.valid = disabledRef.current ? null : externallyInvalidRef.current ? false : data.state.valid;\n validityDataRef.current = data;\n setCurrentValue(data.value);\n setValidityData(data);\n },\n [clearCustomValidity, setCustomValidity]\n );\n publishValidityRef.current = publishValidity;\n const validateValue = React.useCallback(\n (value, submit = false, fromChange = false) => {\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n debounceRef.current = void 0;\n }\n const showValueMissing = dirtyRef.current || submit || submitAttemptedRef.current;\n if (fromChange) {\n clearCustomValidity();\n }\n const representative = getRepresentativeControl();\n activeValidationControlRef.current = representative;\n formControlRef.current = representative?.controlRef.current ?? null;\n const input = representative && getInput(representative);\n let nativeState = createDefaultValidityState(true);\n let nativeMessage = \"\";\n if (canValidateInput(input)) {\n nativeState = getNativeValidity(input, showValueMissing);\n nativeMessage = nativeState.valid === false ? input.validationMessage : \"\";\n } else {\n const required = Array.from(controlsRef.current.values()).some(\n (registration) => registration.required && isEligibleRegistration(registration, formElementRef.current)\n );\n if (required && !isFilled(value) && showValueMissing) {\n nativeState = {\n ...createDefaultValidityState(false),\n valueMissing: true\n };\n nativeMessage = \"Please fill out this field.\";\n }\n }\n const initialValue = initialValueRef.current;\n const makeValidityData = (customErrors) => {\n if (customErrors.length) {\n return {\n state: {\n ...nativeState,\n valid: false,\n customError: true\n },\n error: customErrors[0] ?? \"\",\n errors: customErrors,\n value,\n initialValue\n };\n }\n if (hasValidityError(nativeState)) {\n return {\n state: nativeState,\n error: nativeMessage,\n errors: nativeMessage ? [nativeMessage] : [],\n value,\n initialValue\n };\n }\n return {\n state: createDefaultValidityState(true),\n error: \"\",\n errors: [],\n value,\n initialValue\n };\n };\n if (nativeMessage && !fromChange) {\n validationCommitterRef.current.run(makeValidityData([]));\n return;\n }\n const result = validate ? getValidationResult(validate, value, getFormValues()) : [];\n if (result instanceof Promise) {\n void validationCommitterRef.current.run(\n result.then((customErrors) => makeValidityData(customErrors))\n );\n } else {\n validationCommitterRef.current.run(makeValidityData(result));\n }\n },\n [\n clearCustomValidity,\n formElementRef,\n getFormValues,\n getRepresentativeControl,\n submitAttemptedRef,\n validate\n ]\n );\n const registerControl = React.useCallback(\n (registration, reportDisabled = true) => {\n const source = /* @__PURE__ */ Symbol();\n controlsRef.current.set(source, registration);\n reportsDisabledRef.current.set(registration, reportDisabled);\n activeControlRef.current = getActiveControl();\n formControlRef.current = activeControlRef.current?.controlRef.current ?? null;\n const value = getRegistrationValue(registration);\n valueRef.current = value;\n setCurrentValue(value);\n if (!hasInitialValueRef.current) {\n hasInitialValueRef.current = true;\n initialValueRef.current = value;\n validityDataRef.current = {\n ...validityDataRef.current,\n initialValue: value\n };\n setValidityData(validityDataRef.current);\n }\n if (!nameProp && registration.name) {\n setRegisteredName(registration.name);\n }\n setFilled(isFilled(value));\n syncControlDisabled();\n return () => {\n controlsRef.current.delete(source);\n activeControlRef.current = getActiveControl();\n activeValidationControlRef.current = void 0;\n formControlRef.current = activeControlRef.current?.controlRef.current ?? null;\n const next = activeControlRef.current;\n const nextValue = getRegistrationValue(next);\n valueRef.current = nextValue;\n setCurrentValue(nextValue);\n setFilled(isFilled(nextValue));\n if (!nameProp) {\n setRegisteredName(next?.name);\n }\n syncControlDisabled();\n };\n },\n [getActiveControl, nameProp, syncControlDisabled]\n );\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, []);\n const onBlur = React.useCallback(\n (value = valueRef.current) => {\n valueRef.current = value;\n setCurrentValue(value);\n setTouched(true);\n setFocused(false);\n if (validationMode === \"onBlur\") {\n validateValue(value);\n }\n },\n [validateValue, validationMode]\n );\n const onChange = React.useCallback(\n (value) => {\n valueRef.current = value;\n setCurrentValue(value);\n validationCommitterRef.current.invalidate();\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n debounceRef.current = void 0;\n }\n const nextDirty = !Object.is(value, initialValueRef.current);\n dirtyRef.current = nextDirty;\n setDirty(nextDirty);\n setFilled(isFilled(value));\n clearFormErrors(effectiveNameRef.current);\n const validateOnChange = shouldValidateOnChange(\n validationMode,\n submitAttemptedRef.current\n );\n if (validateOnChange) {\n if (validationMode === \"onChange\" && validationDebounceTime > 0 && value !== \"\") {\n debounceRef.current = setTimeout(() => {\n validateValue(value, false, true);\n }, validationDebounceTime);\n } else {\n validateValue(value, false, true);\n }\n return;\n }\n if (stateRef.current.valid === false) {\n const required = Array.from(controlsRef.current.values()).some(\n (registration) => registration.required && isEligibleRegistration(registration, formElementRef.current)\n );\n if (required && !isFilled(value) && dirtyRef.current) {\n validateValue(value);\n return;\n }\n clearCustomValidity();\n publishValidity({\n state: createDefaultValidityState(true),\n error: \"\",\n errors: [],\n value,\n initialValue: initialValueRef.current\n });\n }\n },\n [\n clearFormErrors,\n clearCustomValidity,\n formElementRef,\n publishValidity,\n submitAttemptedRef,\n validateValue,\n validationDebounceTime,\n validationMode\n ]\n );\n const onDisabledChange = React.useCallback((nextDisabled) => {\n setControlDisabled(nextDisabled);\n }, []);\n React.useEffect(() => {\n return () => {\n validationCommitterRef.current?.invalidate();\n if (debounceRef.current) {\n clearTimeout(debounceRef.current);\n }\n };\n }, []);\n const formRegistration = React.useMemo(\n () => ({\n controlRef: formControlRef,\n validityData: formValidityDataRef.current,\n get name() {\n return stateRef.current.disabled ? void 0 : effectiveNameRef.current;\n },\n get controlId() {\n return activeValidationControlRef.current?.id ?? getRepresentativeControl()?.id ?? association.controlId;\n },\n getValue() {\n return getRegistrationValue(getActiveControl()) ?? valueRef.current;\n },\n validate() {\n validateValue(\n getRegistrationValue(getActiveControl()) ?? valueRef.current,\n true\n );\n }\n }),\n [association.controlId, getActiveControl, getRepresentativeControl, validateValue]\n );\n React.useEffect(() => {\n return registerFormField(fieldId, formRegistration);\n }, [fieldId, formRegistration, registerFormField]);\n const rootContext = React.useMemo(\n () => ({\n state,\n validityData,\n name: effectiveName,\n rootDisabled: disabledProp,\n registerControl,\n onFocus,\n onBlur,\n onChange,\n onDisabledChange\n }),\n [\n disabledProp,\n effectiveName,\n onBlur,\n onChange,\n onDisabledChange,\n onFocus,\n registerControl,\n state,\n validityData\n ]\n );\n const controlContext = useControlContext(rootContext, association);\n const styleState = getStyleState(state);\n return /* @__PURE__ */ jsx(FieldStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx(FieldRootContext.Provider, { value: rootContext, children: /* @__PURE__ */ jsx(AssociationContext.Provider, { value: association, children: /* @__PURE__ */ jsx(FieldControlContext.Provider, { value: controlContext, children: /* @__PURE__ */ jsx(FieldStyledContext.Provider, { ...styleState, children: /* @__PURE__ */ jsx(\n FieldFrame,\n {\n ...fieldProps,\n ...getDataProps(state),\n disabled,\n ref: forwardedRef,\n children\n }\n ) }) }) }) }) });\n }\n);\nfunction usePartContexts() {\n const root = React.useContext(FieldRootContext);\n const association = React.useContext(AssociationContext);\n const itemDisabled = React.useContext(FieldItemContext);\n if (!root || !association) {\n throw new Error(\"Field parts must be rendered inside <Field>.\");\n }\n return { root, association, itemDisabled };\n}\nconst FieldLabel = createStyledHOC(\n FieldLabelFrame,\n function FieldLabel2({ id: idProp, children, onPress, onMouseDown, ...labelProps }, forwardedRef) {\n const { root, association, itemDisabled } = usePartContexts();\n const generatedId = React.useId().replace(/:/g, \"\");\n const id = idProp ?? `field-label-${generatedId}`;\n const text = getText(children);\n const disabled = root.state.disabled || itemDisabled;\n useIsomorphicLayoutEffect(() => {\n return association.registerLabel(id, text);\n }, [association.registerLabel, id, text]);\n return /* @__PURE__ */ jsx(\n FieldLabelFrame,\n {\n ...labelProps,\n ...getDataProps(root.state, disabled),\n id,\n ref: forwardedRef,\n ...isWeb ? { htmlFor: association.controlId } : void 0,\n ...!isWeb && disabled ? { accessibilityState: { disabled: true } } : void 0,\n onMouseDown: (event) => {\n onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n },\n onPress: (event) => {\n onPress?.(event);\n if (!isWeb && !event?.defaultPrevented) {\n focusFocusable(association.controlId);\n }\n },\n children\n }\n );\n }\n);\nconst FieldDescription = createStyledHOC(\n FieldDescriptionFrame,\n function FieldDescription2({ id: idProp, children, ...descriptionProps }, forwardedRef) {\n const { root, association, itemDisabled } = usePartContexts();\n const generatedId = React.useId().replace(/:/g, \"\");\n const id = idProp ?? `field-description-${generatedId}`;\n const text = getText(children);\n const disabled = root.state.disabled || itemDisabled;\n useIsomorphicLayoutEffect(() => {\n return association.registerMessage(id, text);\n }, [association.registerMessage, id, text]);\n return /* @__PURE__ */ jsx(\n FieldDescriptionFrame,\n {\n ...descriptionProps,\n ...getDataProps(root.state, disabled),\n id,\n ref: forwardedRef,\n children\n }\n );\n }\n);\nconst FieldError = createStyledHOC(\n FieldErrorFrame,\n function FieldError2({ id: idProp, children, match, ...errorProps }, forwardedRef) {\n const { root, association, itemDisabled } = usePartContexts();\n const generatedId = React.useId().replace(/:/g, \"\");\n const id = idProp ?? `field-error-${generatedId}`;\n const disabled = root.state.disabled || itemDisabled;\n const rendered = match === true || !disabled && (typeof match === \"string\" ? Boolean(root.validityData.state[match]) : root.state.valid === false);\n const message = children ?? root.state.errors.join(\"\\n\");\n const text = getText(message);\n useIsomorphicLayoutEffect(() => {\n if (!rendered) {\n return;\n }\n return association.registerMessage(id, text);\n }, [association.registerMessage, id, rendered, text]);\n if (!rendered) {\n return null;\n }\n return /* @__PURE__ */ jsx(\n FieldErrorFrame,\n {\n ...errorProps,\n ...getDataProps(root.state, disabled),\n id,\n ref: forwardedRef,\n children: message\n }\n );\n }\n);\nconst FieldItem = createStyledHOC(\n FieldItemFrame,\n function FieldItem2({ disabled: disabledProp = false, children, ...itemProps }, forwardedRef) {\n const root = React.useContext(FieldRootContext);\n const parentAssociation = React.useContext(AssociationContext);\n const reactId = React.useId().replace(/:/g, \"\");\n const association = useAssociation(`field-item-${reactId}`, parentAssociation);\n if (!root || !parentAssociation) {\n throw new Error(\"Field.Item must be rendered inside <Field>.\");\n }\n const disabled = root.state.disabled || disabledProp;\n const controlContext = useControlContext(root, association, disabledProp, true);\n const styleState = getStyleState(root.state, disabled);\n return /* @__PURE__ */ jsx(FieldItemContext.Provider, { value: disabledProp, children: /* @__PURE__ */ jsx(AssociationContext.Provider, { value: association, children: /* @__PURE__ */ jsx(FieldControlContext.Provider, { value: controlContext, children: /* @__PURE__ */ jsx(FieldStyledContext.Provider, { ...styleState, children: /* @__PURE__ */ jsx(\n FieldItemFrame,\n {\n ...itemProps,\n ...getDataProps(root.state, disabled),\n disabled,\n ref: forwardedRef,\n children\n }\n ) }) }) }) });\n }\n);\nconst Field2 = withStaticProperties(FieldComponent, {\n Label: FieldLabel,\n Description: FieldDescription,\n Error: FieldError,\n Item: FieldItem,\n useFieldState,\n useFieldControl\n});\nexport {\n Field2 as Field,\n FieldDescriptionFrame,\n FieldErrorFrame,\n FieldFrame,\n FieldItemFrame,\n FieldLabelFrame\n};\n//# sourceMappingURL=Field.js.map\n"],"mappings":";;;;;;;;;AA4BA,MAAM,qBAAqB;CACzB,OAAO,EAAE,MAAM,CAAC,EAAE;CAClB,SAAS,EAAE,MAAM,CAAC,EAAE;CACpB,SAAS,EAAE,MAAM,CAAC,EAAE;CACpB,OAAO,EAAE,MAAM,CAAC,EAAE;CAClB,QAAQ,EAAE,MAAM,CAAC,EAAE;CACnB,SAAS,EAAE,MAAM,CAAC,EAAE;CACpB,UAAU,EAAE,MAAM,CAAC,EAAE;AACvB;AACA,MAAM,aAAa,OAAO,MAAM;CAC9B,aAAa;CACb,SAAS;CACT,UAAU;AACZ,CAAC;AACD,MAAM,kBAAkB,OAAO,MAAM;CACnC,aAAa;CACb,QAAQ;CACR,SAAS;CACT,UAAU;AACZ,CAAC;AACD,MAAM,wBAAwB,OAAO,MAAM;CACzC,aAAa;CACb,QAAQ;CACR,SAAS;CACT,UAAU;AACZ,CAAC;AACD,MAAM,kBAAkB,OAAO,MAAM;CACnC,aAAa;CACb,QAAQ;CACR,SAAS;CACT,UAAU;AACZ,CAAC;AACD,MAAM,iBAAiB,OAAO,MAAM;CAClC,aAAa;CACb,SAAS;CACT,UAAU;AACZ,CAAC;AACD,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,qBAAqB,MAAM,cAAc,IAAI;AACnD,MAAM,mBAAmB,MAAM,cAAc,IAAI;AACjD,MAAM,mBAAmB,MAAM,cAAc,KAAK;AAClD,SAAS,QAAQ,UAAU;CACzB,MAAM,OAAO,CAAC;CACd,MAA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