import type { JSX, ValidComponent } from "@solidjs/web"; import { dynamic } from "@solidjs/web"; import { createEffect, createMemo, omit, onCleanup, Show, untrack, } from "solid-js"; import { useBaseUiId } from "../../internals/base-ui-id"; import { type FieldRootState, type FieldValidityState, useFieldRootContext, } from "../../internals/field-context.ts"; import { fieldStateAttrs } from "../../internals/field-state-attrs.ts"; import { useFormContext } from "../../internals/form-context.ts"; import { mergeRootProps } from "../../internals/merge-root-props"; import { resolveClassStyle } from "../../internals/resolve-class-style"; import type { BaseUIComponentProps } from "../../internals/types"; import { useFieldMessagesContext } from "../field-messages-context.ts"; export interface FieldErrorState extends FieldRootState {} export interface FieldErrorProps extends BaseUIComponentProps<"div", FieldErrorState> { /** Tag/component to render. Defaults to `"div"`. */ as?: ValidComponent; /** * Determines whether to show the error message according to the field's * [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState). * * - `true` forces the error to render regardless of validity (lets external * libraries drive visibility). * - A string picks a specific `ValidityState` key — the error renders only * when that key is `true` in the field's validity snapshot. * - Omitted: render when the field has a `