feat: add ui layout field, custom field types, and defineField helpers - #153
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the new
uilayout field, implements support for custom/unregistered fields in both the core compiler and React renderer, provides helper functions (defineField/defineFields) for type safety outsidedefineSchema, documents these new layouts/unregistered field types, and compiles shadcn registry json assets. It also resolves Next.js build compilation and linting errors on the documentation site.Key Changes
Core (
form-core)UiField): Added support for inline HTML/React markup layouts via theuifield type, includingisLayoutFieldtype guard updates.FieldInput,CustomFieldInput) to allow unregistered field types to bypass strict union types and fallback tounknowninInferTypewithout compilation errors.defineFieldanddefineFieldsidentity functions for modular and type-safe schema splitting.fieldsproperty fromreadonly Field[]toreadonly FieldInput[]to natively support custom fields.define-helpers.test.tsand updated schema validator, field meta, and type inference test suites.React Adapter (
form-react)UiFieldlayout rendering within the headless form rendering stack.defineField,defineFields) and input schema types (FieldInput,CustomFieldInput).Docs / Web (
apps/web)uilayout field renderer inside the shadcn registry component set (apps/web/registry/shadcn/fields/ui.tsx).ui-and-custom-fields-form.tsx) showcasing both theuimarkup layout field and unregistered custom components.all.json,registry.json,ui-and-custom-fields-form.json,ui.json).custom-fields.mdxand a newui.mdxfile.first-form-demos.tsxand fixed a TypeScript mismatch insideform-manager-saved-panel.tsxby castingdocument.fields.ui-and-custom-fields-form.tsxdescription to satisfy thereact/no-unescaped-entitiesrule, and regenerated the compiled registry JSON schemas.Type of change
feat(New feature)fix(Bug fix)docs(Documentation changes)refactor(Refactoring code without changing behavior)Related Issues