Skip to content

Add Field component with validation, autowiring, and composite control support#46

Merged
banditburai merged 1 commit intomainfrom
feat/field-component
Mar 27, 2026
Merged

Add Field component with validation, autowiring, and composite control support#46
banditburai merged 1 commit intomainfrom
feat/field-component

Conversation

@banditburai
Copy link
Copy Markdown
Owner

Summary

  • Adds the Field component family (Field, FieldSet, FieldLegend, FieldGroup, FieldContent, FieldLabel, FieldTitle, FieldDescription, FieldSeparator, FieldError) for accessible form field composition
  • Deep autowiring walks nested children to find a single text-like control, enabling wrappers like input + copy button to still auto-wire IDs and aria attributes
  • Checkbox gains field_control param to explicitly opt into Field autowiring
  • validate= parameter auto-creates signals, wires FieldError, and sets data-invalid reactively
  • validate_event parameter controls when validation fires (default: "input")
  • Full docs page with 7 examples: basic, orientation, states, form submission, composite control, fieldset, and separator

Test plan

  • All 419 tests pass
  • ruff check and ruff format --check pass
  • star sort --check passes (Tailwind class ordering)
  • pyright passes with 0 errors
  • Registry index regenerated with updated checksums

Field now walks nested children to find a single text-like control,
enabling autowiring inside wrapper divs (e.g. input + copy button).
Checkbox gains field_control param to explicitly opt into autowiring.
Adds validate_event parameter, composite control docs example, and
regenerates registry index.
@banditburai banditburai merged commit 4f418ce into main Mar 27, 2026
3 checks passed
@banditburai banditburai deleted the feat/field-component branch March 27, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant