fix(shadcn): field wrapper trio declared right-side-up — resolves #40 (3.2.0) - #42
Merged
Merged
Conversation
…40 (3.2.0) First-principles from the real API (field.tsx + the component docs): FieldSet renders a <fieldset> whose <legend> is FieldLegend — the one true HTML ownership in the family; FieldGroup stacks Fields and hosts FieldSeparator between sections; Field wraps ONE control with its label, title, description, error, and content. The canonical nesting is FieldSet > FieldLegend + FieldGroup > Field — the wrappers sit ABOVE field, and the contract's own composition notes already said so verbatim while the declaration said the opposite. Measured usage agreed with the notes, not the declaration: across all 14 worked examples, field-label (9/9) and field-description (5/5) appear only inside field, while field-set/field-legend/field-group appear only OUTSIDE it (the ex.notification-preferences exemplar), which made the contract's own exemplar an orphaned-sub surface under spec v0.4 §5.1. The correction, additive at the vocabulary level (no id changes): - field-set → top-level component; owns field-legend (slot 'legend' rides with it); - field-group → top-level component; owns field-separator (its own description places it 'between sections of a FieldGroup'); - field keeps its genuine inner parts: field-content, field-label, field-title, field-description, field-error; - composition notes updated: the wrappers are top-level here, and the upstream set-level FieldDescription is deliberately narrowed to Field scope (every shipped example uses it there; a set-level summary belongs to the legend); - rule.field-set-carries-a-legend unchanged — it anchors field-legend within field-set, and both remain valid lint-time nodes. Convergence with the §5.1 containment gate, verified: all 14 worked examples pass the new S2 under this declaration (the exemplar failed under the inverted one — pinned in dspack-gen's containment.test.ts). Version 3.2.0. Validator + example suite + lib boundary green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Grounded in the real shadcn API (field.tsx: FieldSet is a
<fieldset>, FieldLegend its<legend>; docs prescribe FieldSet > FieldLegend + FieldGroup > Field) and in measured usage (field-label 9/9 and field-description 5/5 insidefield; the wrapper trio 0/6 — always above it). The contract's own composition notes prescribed the correct hierarchy while the declaration inverted it, which madeex.notification-preferencesan orphaned-sub surface under spec v0.4 §5.1 (dspack#41).field-setandfield-grouppromoted to top-level components;field-legend(with itslegendslot) moves underfield-set,field-separatorunderfield-group.fieldkeeps content/label/title/description/error.rule.field-set-carries-a-legenduntouched (anchors stay valid).containment.test.ts).Closes #40. Version 3.2.0.
🤖 Generated with Claude Code