UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

23 lines (22 loc) • 971 B
import type { ReactNode } from 'react'; import type { AnyKitForm, FieldRegistry, KitExtras } from '../../kit/types.js'; import type { UntypedFormSchema } from '../core/types.js'; import type { SchemaRegistries } from './context.js'; /** A kit's registries in renderer form: the default layouts with the kit's overrides on top. */ export declare function schemaRegistries(fields: FieldRegistry, extras: KitExtras): SchemaRegistries; export interface SchemaComponents { SchemaForm: (props: { form: AnyKitForm; schema: UntypedFormSchema; context?: unknown; }) => ReactNode; SchemaNode: (props: { form: AnyKitForm; schema: UntypedFormSchema; context?: unknown; id: string; prefix?: string; }) => ReactNode; } /** `SchemaForm` / `SchemaNode` bound to a kit's registries (`kit.SchemaForm`, §3.3). */ export declare function createSchemaComponents(registries: SchemaRegistries): SchemaComponents;