Skip to content

Add checkbox component#65

Merged
albx merged 11 commits intomainfrom
feature/39-checkbox
Dec 19, 2025
Merged

Add checkbox component#65
albx merged 11 commits intomainfrom
feature/39-checkbox

Conversation

@albx
Copy link
Owner

@albx albx commented Dec 17, 2025

This pull request introduces a new BitCheckbox form component to the BitBlazor library, along with its associated documentation, stories, and tests. Additionally, it refactors the handling of "additional text" and related attributes in form components to centralize this logic in the base class, improving code maintainability and consistency.

New BitCheckbox Component:

  • Added the new BitCheckbox form component, which supports features like inline display, grouping, and additional text, and integrates with form validation and accessibility. (src/BitBlazor/Form/Checkbox/BitCheckbox.razor [1] src/BitBlazor/Form/Checkbox/BitCheckbox.razor.cs [2]

Refactoring and Codebase Improvements:

  • Moved the AdditionalText and AdditionalTextId parameters, as well as their rendering and attribute logic, from BitInputFieldBase<T> to the more general BitFormComponentBase<T>, ensuring all form components can leverage this functionality and reducing code duplication. (src/BitBlazor/Form/BitFormComponentBase.cs [1] [2] [3]; src/BitBlazor/Form/BitInputFieldBase.cs [4] [5]

Storybook and Documentation:

Testing:

  • Introduced new unit and rendering tests for BitCheckbox to verify its behaviors, markup, and accessibility features. (tests/BitBlazor.Test/Form/Checkbox/BitCheckboxTest.Behaviors.cs [1] tests/BitBlazor.Test/Form/Checkbox/BitCheckboxTest.Rendering.razor [2]

@albx albx linked an issue Dec 17, 2025 that may be closed by this pull request
@albx albx marked this pull request as ready for review December 18, 2025 21:36
@albx albx requested a review from Copilot December 18, 2025 21:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new BitCheckbox form component to the BitBlazor library with comprehensive documentation, tests, and examples. It also refactors the AdditionalText functionality from BitInputFieldBase to the base BitFormComponentBase class, making it available to all form components.

Key Changes

  • Added BitCheckbox component with support for inline and grouped layouts, disabled states, and additional text
  • Refactored AdditionalText and AdditionalTextId parameters to BitFormComponentBase for reusability across all form components
  • Updated BlazingStory packages to version 1.0.0-preview.62

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/BitBlazor/Form/Checkbox/BitCheckbox.razor Checkbox component markup with InputCheckbox, label, and additional text support
src/BitBlazor/Form/Checkbox/BitCheckbox.razor.cs Component logic with Inline and Grouped parameters, CSS class computation
src/BitBlazor/Form/BitFormComponentBase.cs Added AdditionalText parameters and rendering methods moved from BitInputFieldBase
src/BitBlazor/Form/BitInputFieldBase.cs Removed AdditionalText-related code (refactored to base class)
tests/BitBlazor.Test/Form/Checkbox/BitCheckboxTest.Rendering.razor Rendering tests for default, inline, grouped, disabled, and checked states
tests/BitBlazor.Test/Form/Checkbox/BitCheckboxTest.Behaviors.cs Behavior tests for value changes and checked attribute updates
stories/BitBlazor.Stories/Components/Stories/Form/BitCheckbox.stories.razor Storybook stories demonstrating various checkbox configurations
stories/BitBlazor.Stories/BitBlazor.Stories.csproj Updated BlazingStory package versions
docs/form/checkbox.md Comprehensive documentation with usage examples and parameter descriptions
docs/form/form-components.md Added BitCheckbox to components table
docs/quick-reference.md Added BitCheckbox quick reference examples and form example
docs/README.md Added BitCheckbox to documentation index

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

albx and others added 3 commits December 19, 2025 15:45
…azor

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Dec 19, 2025

@albx I've opened a new pull request, #66, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…azor

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@albx albx merged commit aa6b3d7 into main Dec 19, 2025
4 checks passed
@albx albx deleted the feature/39-checkbox branch December 19, 2025 16:06
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.

[FEATURE] Add checkbox component

2 participants