Skip to content

refactor(form): standardize label usage with LabelBlock component#494

Merged
robsongajunior merged 1 commit intomainfrom
refactor/standardize-label-component
Mar 30, 2026
Merged

refactor(form): standardize label usage with LabelBlock component#494
robsongajunior merged 1 commit intomainfrom
refactor/standardize-label-component

Conversation

@HerbertJulio
Copy link
Copy Markdown
Contributor

Summary

  • Replace native <label> HTML elements with the LabelBlock component in field-group-checkbox, field-group-switch, field-group-radio, field-dropdown-icon, and field-auto-complete
  • Move the v-if="props.label" guard inside LabelBlock itself, eliminating the repeated pattern across 11 consumer components
  • Change label prop from required: true to default: '' to support internal conditional rendering
  • Update Label Storybook description to reflect the new optional behavior

Test plan

  • Verify label renders correctly when label prop is provided in all affected components
  • Verify no label element is rendered when label prop is empty or omitted
  • Verify isRequired indicator renders correctly in field-group-radio
  • Verify data-testid and for attributes are correctly forwarded via $attrs
  • Check Storybook stories for Label, FieldGroupRadio, FieldGroupCheckbox, FieldGroupSwitch, FieldDropdownIcon, and FieldAutoComplete

- Replace native <label> with LabelBlock in field-group-checkbox, field-group-switch, field-group-radio, field-dropdown-icon and field-auto-complete
- Move v-if="props.label" guard into LabelBlock itself, removing duplication across 11 consumer components
- Change label prop from required to default '' to support conditional rendering internally
- Update Label storybook description to reflect new optional behavior
@HerbertJulio HerbertJulio self-assigned this Mar 30, 2026
@HerbertJulio HerbertJulio added the enhancement New feature or request label Mar 30, 2026
@robsongajunior robsongajunior merged commit fc34775 into main Mar 30, 2026
3 checks passed
@robsongajunior
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@robsongajunior
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@robsongajunior robsongajunior deleted the refactor/standardize-label-component branch April 17, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Development

Successfully merging this pull request may close these issues.

2 participants