Skip to content

feat(v2/ui): add ZardCheckboxComponent#57

Merged
Aarti-panchal01 merged 3 commits into
PSMRI:angular-zard-migrationfrom
Aarti-panchal01:feat/v2-ui-checkbox
Jun 27, 2026
Merged

feat(v2/ui): add ZardCheckboxComponent#57
Aarti-panchal01 merged 3 commits into
PSMRI:angular-zard-migrationfrom
Aarti-panchal01:feat/v2-ui-checkbox

Conversation

@Aarti-panchal01

@Aarti-panchal01 Aarti-panchal01 commented Jun 26, 2026

Copy link
Copy Markdown

What

Adds the Checkbox component to v2/ui — the shared ZardUI component library used across AMRIT apps (104, 1097, MMU).

What's included

  • ZardCheckboxComponent — standalone, OnPush, signal-based, ControlValueAccessor
  • Supports checked, unchecked, indeterminate states (lucideMinus icon + aria-checked="mixed")
  • Supports disabled state (input binding + form-driven setDisabledState)
  • Label projected via <ng-content>, paired via ZardIdDirective
  • Full CVA — works with reactive forms (formControlName) and template-driven (ngModel)
  • Accessible — native <input type="checkbox">, Space toggles natively, aria-checked, aria-disabled
  • GPL-3.0 headers on all files ("Integrated Technologies")
  • Exported from v2/ui/index.ts → v2/public-api.ts

Type of Change

  • New feature

CodeRabbit

All findings resolved:

  • standalone:true added
  • Duplicate zCheckedChange output removed (model() generates it automatically)
  • Null-safe event.target optional chaining
  • De-duplicated icon markup via iconName computed
  • CVA empty callbacks fixed (matches select pattern)
  • Nested ternaries extracted (SonarCloud S3358)

SonarCloud

Quality Gate passed — 0 new issues, 0 duplication, 0 security hotspots.

…ate states, CVA, accessible

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new Angular checkbox component with ControlValueAccessor support, indeterminate and disabled state handling, checkbox style variants, and package re-exports through the checkbox and UI entrypoints.

Changes

Checkbox component and exports

Layer / File(s) Summary
Component shell and template
v2/ui/checkbox/checkbox.component.ts
ZardCheckboxComponent is defined with its template, providers, icon setup, and rendering configuration.
State and ControlValueAccessor
v2/ui/checkbox/checkbox.component.ts
Reactive inputs/models, ARIA state, writeValue, registerOnChange, registerOnTouched, setDisabledState, and checkbox event handling update component and form state.
Variants and exports
v2/ui/checkbox/checkbox.variants.ts, v2/ui/checkbox/index.ts, v2/ui/index.ts
Checkbox and label variants are declared, then re-exported through the checkbox module and the UI index.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding ZardCheckboxComponent to v2/ui.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Aarti-panchal01 Aarti-panchal01 changed the base branch from main to angular-zard-migration June 26, 2026 20:20
@Aarti-panchal01

Copy link
Copy Markdown
Author

@coderabbitai review --dir v2/ui/checkbox

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@Aarti-panchal01 Reviewing the changes with focus on v2/ui/checkbox.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@v2/ui/checkbox/checkbox.component.ts`:
- Around line 51-54: Add standalone: true to ZardCheckboxComponent’s `@Component`
metadata so the imports array is valid. Update the component decorator where
NgIcon and ZardIdDirective are declared to make ZardCheckboxComponent a
standalone component, keeping the existing imports unchanged.
- Around line 23-35: The Checkbox component is defining a redundant
zCheckedChange output alongside zChecked = model(false), which already generates
the matching change event. Remove the explicit output<boolean>() and any manual
.emit() usage, and rely on the model-generated binding contract in
checkbox.component.ts so zChecked remains the single source of truth.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4a9b5757-3837-4e90-873a-7dd000af904c

📥 Commits

Reviewing files that changed from the base of the PR and between 1393fa6 and 74b85ac.

📒 Files selected for processing (4)
  • v2/ui/checkbox/checkbox.component.ts
  • v2/ui/checkbox/checkbox.variants.ts
  • v2/ui/checkbox/index.ts
  • v2/ui/index.ts

Comment thread v2/ui/checkbox/checkbox.component.ts
Comment thread v2/ui/checkbox/checkbox.component.ts
… remove duplicate output, null-safe event.target, de-duplicate icon markup, fix CVA empty callbacks
@Aarti-panchal01

Copy link
Copy Markdown
Author

@coderabbitai review --dir v2/ui/checkbox

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@Aarti-panchal01 Reviewing the changes with focus on v2/ui/checkbox.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Aarti-panchal01 Aarti-panchal01 requested a review from drtechie June 26, 2026 20:48
@Aarti-panchal01 Aarti-panchal01 merged commit abcff6f into PSMRI:angular-zard-migration Jun 27, 2026
3 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants