Skip to content

✨ feat(icons): adding dark mode icon to Zard icons #371

Merged
Luizgomess merged 1 commit intomasterfrom
feat/custom-icons
Dec 11, 2025
Merged

✨ feat(icons): adding dark mode icon to Zard icons #371
Luizgomess merged 1 commit intomasterfrom
feat/custom-icons

Conversation

@mikij
Copy link
Contributor

@mikij mikij commented Dec 10, 2025

What was done? 📝

Added custom icon that are not part of Lucide icons package to be available to Zard icon component

Screenshots or GIFs 📸

|-----Figma-----|
|-----Implementation-----|

Link to Issue 🔗

Type of change 🏗

  • New feature (non-breaking change that adds functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • Refactor (non-breaking change that improves the code or technical debt)
  • Chore (none of the above, such as upgrading libraries)

Breaking change 🚨

Checklist 🧐

  • Tested on Chrome
  • Tested on Safari
  • Tested on Firefox
  • No errors in the console

Summary by CodeRabbit

  • New Features

    • Added a reusable dark-mode icon to the component library.
  • Style

    • Header now uses the new icon component for dark-mode and gallery, preserving layout and labels.
  • Behavior

    • Theme state exposed as readonly; toggle accepts an explicit target mode and the prior direct "activate theme" helper was removed. Pages and header now delegate theme changes to the shared service.
  • Tests

    • Expanded mocked utilities in the accordion test suite.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'tools', 'path_instructions'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Replaced Lucide/SVG icons with z-icon, added a dark-mode icon to the icon set, and changed the dark-mode API to expose a readonly theme and a toggleTheme(target?) method; consumers and tests were updated to call the new API and to mock additional utilities.

Changes

Cohort / File(s) Summary
Header — template & behavior
apps/web/src/app/domain/components/header/header.component.html, apps/web/src/app/domain/components/header/header.component.ts
Replaced inline/SVG/Lucide icons with <z-icon ... /> usages. Removed local theme state and activateTheme(...); toggleTheme() now calls darkModeService.toggleTheme() directly and unused imports were removed.
Dark-mode provider service
libs/zard/src/lib/components/core/provider/services/dark-mode.ts
theme exposed as themeSignal.asReadonly. toggleTheme() signature changed to toggleTheme(targetMode?: DarkModeOptions): void; activateTheme() removed. Logic updated to apply a provided target or compute next mode.
Icon library
libs/zard/src/lib/components/icon/icons.ts
Added a new DarkMode icon constant and registered it in ZARD_ICONS as 'dark-mode'.
Dark-mode page — template & page
apps/web/src/app/domain/pages/dark-mode/dark-mode.page.html, apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
Template/button handlers updated to call darkModeService.toggleTheme(...) instead of activateTheme(...). Import of DarkModeOptions removed; method activateTheme(...) removed from page class.
Tests / Mocks
libs/zard/src/lib/components/accordion/accordion.component.spec.ts
Extended Jest mock for ../../shared/utils/utils to include transform, generateId, and noopFun (all mocked), preserving mergeClasses mock.
Misc / manifest
package.json
(manifest reference in diff) — no API changes described beyond above edits.

Sequence Diagram(s)

sequenceDiagram
  %% Participants
  participant User as User
  participant Header as HeaderComponent
  participant Icon as ZardIconComponent
  participant Service as ZardDarkMode
  participant Signal as ThemeSignal

  User->>Header: click theme toggle / select mode
  Header->>Icon: render z-icon zType="dark-mode"
  Header->>Service: toggleTheme() or toggleTheme(targetMode)
  Service->>Signal: read current or apply target -> update signal
  Signal-->>Service: emits new theme (readonly)
  Service-->>Header: subscribers receive updated theme
  Header-->>User: UI updates (bindings / classes reflect theme)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus areas:
    • libs/zard/.../dark-mode.ts — verify themeSignal.asReadonly typing and optional targetMode semantics.
    • header.component.ts / template — ensure removal of properties/methods didn't break bindings; OnPush/signal usage correctness.
    • icons.ts — validate DarkMode icon data and registration key.
    • Updated consumers (pages/templates) — ensure all usages moved from activateTheme to toggleTheme.
    • Tests — confirm new mocks don't hide required utility behavior.

Possibly related PRs

Suggested reviewers

  • srizzon
  • Luizgomess

Poem

🌒 New icon beams, old SVGs fade,
A readonly signal sets the shade.
Toggle now accepts a guiding hand,
Tests and templates in tidy band.
Night and day switch — seamless and grand. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a dark mode icon to the Zard icons library, which aligns with the primary objective of making custom icons available.
Description check ✅ Passed The description covers the main objective and includes most required sections, though Figma/implementation screenshots are placeholders and the linked issue is empty.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/custom-icons

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29acd14 and 74a72fc.

⛔ Files ignored due to path filters (4)
  • apps/web/public/installation/manual/icon.md is excluded by !apps/web/public/** and included by apps/**
  • package-lock.json is excluded by !**/package-lock.json and included by none
  • package.json is excluded by none and included by none
  • packages/cli/src/utils/templates.ts is excluded by !packages/** and included by none
📒 Files selected for processing (7)
  • apps/web/src/app/domain/components/header/header.component.html (1 hunks)
  • apps/web/src/app/domain/components/header/header.component.ts (3 hunks)
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.html (4 hunks)
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts (1 hunks)
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts (1 hunks)
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts (2 hunks)
  • libs/zard/src/lib/components/icon/icons.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use @zard/* path aliases for imports mapping to libs/zard/src/lib/* directories

Files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
libs/zard/**/*.{css,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

Use CSS custom properties for design tokens and theming in the component library

Files:

  • libs/zard/src/lib/components/icon/icons.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
libs/zard/src/lib/components/**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

libs/zard/src/lib/components/**/*.spec.ts: Co-locate test files with components using .spec.ts suffix next to component files
Use Angular TestBed and ComponentFixture utilities for testing components

Write co-located Jest tests using TestBed and ComponentFixture next to components

Files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
🧠 Learnings (33)
📓 Common learnings
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use computed properties in Angular components for reactive class calculations: `protected readonly classes = computed(() => ...)`

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-29T15:31:22.377Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 339
File: libs/zard/src/lib/components/carousel/carousel.component.ts:92-92
Timestamp: 2025-11-29T15:31:22.377Z
Learning: In libs/zard/src/lib/components/**/*.component.ts files using TailwindCSS, avoid suggesting individual class bindings like `[class.fill-primary]="condition"` because they can cause TailwindCSS issues. Prefer string concatenation or `[class]` binding with conditional expressions instead.

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-30T13:27:41.206Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/popover/popover.component.ts:28-29
Timestamp: 2025-11-30T13:27:41.206Z
Learning: In libs/zard/src/lib/components/core/**/*.ts files (core utilities, plugins, and providers), use relative imports for intra-core dependencies because the ZardUI CLI performs path transformations during component installation. The CLI expects specific relative path patterns and transforms them to the target project structure. For all other component imports and application code, use zard/* path aliases.

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Export all components in `libs/zard/src/lib/components/components.ts` for public API

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use Angular standalone components as the base template for component architecture

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • apps/web/src/app/domain/components/header/header.component.html
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Add new components to barrel export in `libs/zard/src/lib/components/components.ts`

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • apps/web/src/app/domain/components/header/header.component.html
📚 Learning: 2025-11-30T08:50:23.436Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/core/providezard.ts:0-0
Timestamp: 2025-11-30T08:50:23.436Z
Learning: In libs/zard/src/lib/components/core/providezard.ts, the import paths `../core/event-manager-plugins/...` are intentionally structured this way because the ZardUI CLI transforms them to 'shared/components/core/event-manager-plugins/...' format. Other relative path combinations don't work with the current CLI implementation. This path pattern should not be simplified until the CLI transformation logic is updated.

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.html : Use ZardUI form components (`ZardFormFieldComponent`, `ZardFormLabelComponent`, `ZardFormControlComponent`) for proper validation and error handling in templates

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/**/*.ts : Export demo and documentation components with proper naming for automatic site generation

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • apps/web/src/app/domain/components/header/header.component.html
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use TailwindCSS v4 with PostCSS for component styling and utility-first approach

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/demo/**/*.ts : Create demo components in the `demo/` folder with a main export, default example, and variant examples

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses()` utility with `clsx` and `tailwind-merge` to resolve class conflicts in component styling

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:55:04.698Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: packages/cli/README.md:0-0
Timestamp: 2025-11-25T18:55:04.698Z
Learning: Components should support dark mode through built-in styling and configuration

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.html
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/*.ts : Create component demo files with `name`, `code`, and `component` properties following existing patterns

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to **/*.{ts,tsx,js} : Use `zard/*` path aliases for imports mapping to `libs/zard/src/lib/*` directories

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Use path aliases `zard/*` pointing to `libs/zard/src/lib/*` for component imports

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.ts : Implement standalone Angular components with explicit imports rather than using module declarations

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses` utility with `tailwind-merge` to resolve class conflicts in components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy in Angular components: `changeDetection: ChangeDetectionStrategy.OnPush`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • apps/web/src/app/domain/components/header/header.component.html
📚 Learning: 2025-11-14T22:52:09.135Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 326
File: libs/zard/src/lib/components/input/float.label.component.ts:71-0
Timestamp: 2025-11-14T22:52:09.135Z
Learning: In libs/zard/src/lib/components/*/*.component.ts files, move HostListener and HostBinding to the Component decorator's host property instead of using decorators on class members (e.g., host: { '(input)': 'onInput()' }).

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Create components as standalone components with `standalone: true` in Angular

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • apps/web/src/app/domain/components/header/header.component.html
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy for all Angular components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • apps/web/src/app/domain/components/header/header.component.html
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Use Angular TestBed and ComponentFixture utilities for testing components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use signal-based inputs (`input()`) for Angular component inputs in the ZardUI library

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Write co-located Jest tests using TestBed and ComponentFixture next to components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Co-locate test files with components using `.spec.ts` suffix next to component files

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-26T11:20:45.264Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/select/select.component.spec.ts:79-88
Timestamp: 2025-11-26T11:20:45.264Z
Learning: In ZardUI select component tests (libs/zard/src/lib/components/select/select.component.spec.ts), use fakeAsync() with flush() instead of setTimeout because the component uses setTimeout(..., 0) for focus management, which requires advancing macrotasks in tests.

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Use Jest with `happy-dom/jest-environment` for testing Angular components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use Signal-based inputs with the `input()` function instead of Input decorators in Angular components

Applied to files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.ts : Use signals (`signal()` from `angular/core`) for reactive state management in block components, such as loading states and UI state

Applied to files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.ts : Always use the `protected` access modifier for component properties and methods that are accessed in templates (e.g., `protected readonly`, `protected onSubmit()`)

Applied to files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
🔇 Additional comments (13)
libs/zard/src/lib/components/accordion/accordion.component.spec.ts (1)

10-15: LGTM - Mock improvements properly implemented.

The mock now provides safe default implementations that mirror the real contracts:

  • transform returns its input value (identity function)
  • generateId returns a deterministic test ID
  • noopFun remains a plain mock, which is appropriate for a no-op

This addresses the previous review feedback and keeps tests isolated while preventing undefined-related runtime errors.

apps/web/src/app/domain/components/header/header.component.html (2)

40-40: Icon migration looks good.

The migration from Lucide icon component to z-icon with [zType]="GalleryHorizontalIcon" binding is correct and follows the component library pattern.


45-45: size-4.5 is valid Tailwind v4 syntax—no changes needed.

In Tailwind v4, fractional numeric values like 4.5 are supported as canonical classes in the default scale (e.g., p-2.5, mt-4.5, size-4.5). This is the correct and preferred syntax over arbitrary bracket notation or splitting into separate utilities.

libs/zard/src/lib/components/icon/icons.ts (2)

89-95: Clean icon data definition.

Defining the DarkMode icon directly as LucideIconData array is efficient and avoids SVG parsing overhead. The path data is properly structured for the Lucide icon system.


182-182: Icon registration correct.

The 'dark-mode': DarkMode entry properly extends the icon set and is now available throughout the application via <z-icon zType="dark-mode" />.

apps/web/src/app/domain/pages/dark-mode/dark-mode.page.html (2)

3-4: Binding reordering is fine.

Reordering input bindings has no functional impact. Both bindings are still present and correctly typed.


95-95: Service-based theme control properly implemented.

The template now calls darkModeService.toggleTheme(...) with explicit mode arguments (EDarkModes.SYSTEM, LIGHT, DARK). This correctly uses the new service API and removes the component middleman, following best practices for service delegation.

Also applies to: 106-106, 117-117

apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts (2)

8-8: Import cleanup is correct.

Removing DarkModeOptions is appropriate since the component no longer has an activateTheme method. The component now delegates all theme changes to the service.


40-40: Proper signal usage for reactive theme.

Assigning this.darkModeService.theme (the readonly signal itself, not calling it) is correct. The template then calls it reactively with @let theme = currentTheme(), ensuring the UI updates when the theme changes. This follows Angular signal best practices.

apps/web/src/app/domain/components/header/header.component.ts (2)

5-5: Import cleanup aligns with simplified API.

Removing LucideAngularModule, DarkModeOptions, and EDarkModes is correct. The component now uses z-icon for icons and delegates theme logic to the service without needing local theme enum values.

Also applies to: 12-12


53-55: Simplified toggle delegates to service.

Calling this.darkModeService.toggleTheme() without arguments will cycle between LIGHT and DARK modes (not SYSTEM). This provides simpler UX for the header button compared to the full theme selector in the dark-mode settings page.

Note: Users who set SYSTEM mode in settings will have it changed to an explicit LIGHT or DARK mode when clicking the header toggle. This is likely intentional design, but ensure it matches UX requirements.

Verify with UX/design that the header theme button should cycle between explicit LIGHT/DARK modes without returning to SYSTEM mode. If SYSTEM should be part of the cycle, the service API would need adjustment.

libs/zard/src/lib/components/core/provider/services/dark-mode.ts (2)

23-23: Readonly signal exposure is correct.

Using this.themeSignal.asReadonly() properly exposes a readonly signal for external consumption, preventing direct mutation while allowing reactive reads. This follows Angular signal best practices.


44-55: Flexible toggle API with clear behavior.

The updated toggleTheme(targetMode?: DarkModeOptions) signature provides two modes of operation:

  1. With targetMode: Directly sets SYSTEM, LIGHT, or DARK (used by settings page)
  2. Without targetMode: Toggles between LIGHT and DARK based on current themeMode() (used by header button)

The toggle logic on line 52 uses themeMode() (the computed actual mode), not themeSignal() (the stored preference). This means:

  • If current theme is SYSTEM displaying as DARK → toggles to explicit LIGHT
  • If current theme is SYSTEM displaying as LIGHT → toggles to explicit DARK
  • SYSTEM mode can only be restored by explicitly passing EDarkModes.SYSTEM

This design is consistent with the component usage patterns and provides clean separation between quick toggle vs. explicit mode selection.


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 and usage tips.

@mikij mikij force-pushed the feat/custom-icons branch from 892ab95 to 5e585d4 Compare December 10, 2025 14:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/src/app/domain/components/header/header.component.ts (1)

27-38: Remove duplicate ZardIconComponent import.

The imports array contains ZardIconComponent twice (lines 30 and 33), which is unnecessary.

Apply this diff to remove the duplicate:

   imports: [
     RouterModule,
     ZardButtonComponent,
     ZardIconComponent,
     ZardBadgeComponent,
     ZardDividerComponent,
-    ZardIconComponent,
     MobileMenuComponent,
     AsyncPipe,
     DocResearcherComponent,
     LucideAngularModule,
   ],
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a973aca and 5e585d4.

⛔ Files ignored due to path filters (5)
  • apps/web/public/installation/manual/icon.md is excluded by !apps/web/public/** and included by apps/**
  • package-lock.json is excluded by !**/package-lock.json and included by none
  • package.json is excluded by none and included by none
  • packages/cli/src/commands/init/dependencies.ts is excluded by !packages/** and included by none
  • packages/cli/src/utils/templates.ts is excluded by !packages/** and included by none
📒 Files selected for processing (4)
  • apps/web/src/app/domain/components/header/header.component.html (1 hunks)
  • apps/web/src/app/domain/components/header/header.component.ts (1 hunks)
  • libs/zard/src/lib/components/icon/icons.ts (2 hunks)
  • libs/zard/src/lib/shared/utils/utils.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/zard/**/*.{css,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

Use CSS custom properties for design tokens and theming in the component library

Files:

  • libs/zard/src/lib/shared/utils/utils.ts
  • libs/zard/src/lib/components/icon/icons.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use @zard/* path aliases for imports mapping to libs/zard/src/lib/* directories

Files:

  • libs/zard/src/lib/shared/utils/utils.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
🧠 Learnings (25)
📓 Common learnings
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: packages/cli/README.md:0-0
Timestamp: 2025-11-25T18:55:04.698Z
Learning: Components should support dark mode through built-in styling and configuration
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use Angular standalone components as the base template for component architecture

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-14T22:52:09.135Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 326
File: libs/zard/src/lib/components/input/float.label.component.ts:71-0
Timestamp: 2025-11-14T22:52:09.135Z
Learning: In libs/zard/src/lib/components/*/*.component.ts files, move HostListener and HostBinding to the Component decorator's host property instead of using decorators on class members (e.g., host: { '(input)': 'onInput()' }).

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Add new components to barrel export in `libs/zard/src/lib/components/components.ts`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses()` utility with `clsx` and `tailwind-merge` to resolve class conflicts in component styling

Applied to files:

  • libs/zard/src/lib/shared/utils/utils.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses` utility with `tailwind-merge` to resolve class conflicts in components

Applied to files:

  • libs/zard/src/lib/shared/utils/utils.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:55:04.698Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: packages/cli/README.md:0-0
Timestamp: 2025-11-25T18:55:04.698Z
Learning: Applies to packages/cli/src/app/shared/utils/**/*.{ts,tsx} : Create utility functions in src/app/shared/utils/ directory for reusable code like mergeClasses

Applied to files:

  • libs/zard/src/lib/shared/utils/utils.ts
📚 Learning: 2025-11-29T15:31:22.377Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 339
File: libs/zard/src/lib/components/carousel/carousel.component.ts:92-92
Timestamp: 2025-11-29T15:31:22.377Z
Learning: In libs/zard/src/lib/components/**/*.component.ts files using TailwindCSS, avoid suggesting individual class bindings like `[class.fill-primary]="condition"` because they can cause TailwindCSS issues. Prefer string concatenation or `[class]` binding with conditional expressions instead.

Applied to files:

  • libs/zard/src/lib/shared/utils/utils.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.variants.ts : Use CVA (Class Variance Authority) for type-safe styling variants in components

Applied to files:

  • libs/zard/src/lib/shared/utils/utils.ts
  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-30T13:27:41.206Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/popover/popover.component.ts:28-29
Timestamp: 2025-11-30T13:27:41.206Z
Learning: In libs/zard/src/lib/components/core/**/*.ts files (core utilities, plugins, and providers), use relative imports for intra-core dependencies because the ZardUI CLI performs path transformations during component installation. The CLI expects specific relative path patterns and transforms them to the target project structure. For all other component imports and application code, use zard/* path aliases.

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Export all components in `libs/zard/src/lib/components/components.ts` for public API

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/**/*.ts : Export demo and documentation components with proper naming for automatic site generation

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-30T08:50:23.436Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/core/providezard.ts:0-0
Timestamp: 2025-11-30T08:50:23.436Z
Learning: In libs/zard/src/lib/components/core/providezard.ts, the import paths `../core/event-manager-plugins/...` are intentionally structured this way because the ZardUI CLI transforms them to 'shared/components/core/event-manager-plugins/...' format. Other relative path combinations don't work with the current CLI implementation. This path pattern should not be simplified until the CLI transformation logic is updated.

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/demo/**/*.ts : Create demo components in the `demo/` folder with a main export, default example, and variant examples

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to **/*.{ts,tsx,js} : Use `zard/*` path aliases for imports mapping to `libs/zard/src/lib/*` directories

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/*.ts : Create component demo files with `name`, `code`, and `component` properties following existing patterns

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.ts : Implement standalone Angular components with explicit imports rather than using module declarations

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy in Angular components: `changeDetection: ChangeDetectionStrategy.OnPush`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Create components as standalone components with `standalone: true` in Angular

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy for all Angular components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use signal-based inputs (`input()`) for Angular component inputs in the ZardUI library

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.html : Use ZardUI form components (`ZardFormFieldComponent`, `ZardFormLabelComponent`, `ZardFormControlComponent`) for proper validation and error handling in templates

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Use Angular TestBed and ComponentFixture utilities for testing components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use computed properties in Angular components for reactive class calculations: `protected readonly classes = computed(() => ...)`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
🧬 Code graph analysis (1)
libs/zard/src/lib/components/icon/icons.ts (1)
libs/zard/src/lib/shared/utils/utils.ts (1)
  • svgToLucideIconData (21-24)
🪛 GitHub Actions: CI/Unit Tests
libs/zard/src/lib/components/icon/icons.ts

[error] 197-197: TypeError: (0 , utils_1.svgToLucideIconData) is not a function. Ensure svgToLucideIconData is exported correctly from utils and imported properly in icons.ts.

🔇 Additional comments (2)
apps/web/src/app/domain/components/header/header.component.html (1)

45-45: Clean refactor to use icon component.

Replacing inline SVG with <z-icon zType="dark-mode" /> improves maintainability and aligns with the component architecture. The size-4.5 TailwindCSS utility is appropriate for button icons.

Note: This change depends on resolving the pipeline failure in libs/zard/src/lib/components/icon/icons.ts. Once the svgToLucideIconData function is working correctly, verify the icon renders properly in both light and dark modes.

libs/zard/src/lib/components/icon/icons.ts (1)

89-89: Import path is correct and follows the established codebase pattern.

The import statement on line 89 uses the correct relative import path ../../shared/utils/utils, which is the standard pattern throughout the codebase. The svgToLucideIconData function is properly exported as export const in utils.ts (line 21), and the svgson dependency is correctly imported within that file. No @zard/* path aliases are configured in the repository; all components consistently use relative imports to access shared utilities. No circular dependencies exist between the icon and utils modules.

Likely an incorrect or invalid review comment.

@mikij mikij force-pushed the feat/custom-icons branch 2 times, most recently from 56ba78d to 1c32fe0 Compare December 10, 2025 14:35
@mikij mikij requested a review from Luizgomess December 10, 2025 14:36
@mikij mikij changed the title ✨ feat(icons): adding support for custom icons ✨ feat(icons): adding dark mode icon to Zard icons Dec 10, 2025
Copy link
Contributor

@ribeiromatheuss ribeiromatheuss left a comment

Choose a reason for hiding this comment

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

When accessing the site for the first time, the value 'system' was set for the theme variable. On my system, this represents the dark theme. Upon clicking again, the variable is updated to 'dark', giving the impression that the button did not work.

image

@mikij mikij force-pushed the feat/custom-icons branch from 1c32fe0 to dc29050 Compare December 10, 2025 21:22
@mikij
Copy link
Contributor Author

mikij commented Dec 10, 2025

okay even your comment was not intention of this PR, I found solution for the problem and added it

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/src/app/domain/components/header/header.component.ts (1)

27-38: Remove duplicate ZardIconComponent import.

ZardIconComponent appears twice in the imports array (lines 30 and 33). This is redundant and should be cleaned up.

   imports: [
     RouterModule,
     ZardButtonComponent,
     ZardIconComponent,
     ZardBadgeComponent,
     ZardDividerComponent,
-    ZardIconComponent,
     MobileMenuComponent,
     AsyncPipe,
     DocResearcherComponent,
     LucideAngularModule,
   ],
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56ba78d and dc29050.

⛔ Files ignored due to path filters (4)
  • apps/web/public/installation/manual/icon.md is excluded by !apps/web/public/** and included by apps/**
  • package-lock.json is excluded by !**/package-lock.json and included by none
  • package.json is excluded by none and included by none
  • packages/cli/src/utils/templates.ts is excluded by !packages/** and included by none
📒 Files selected for processing (6)
  • apps/web/src/app/domain/components/header/header.component.html (1 hunks)
  • apps/web/src/app/domain/components/header/header.component.ts (3 hunks)
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts (2 hunks)
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts (1 hunks)
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts (2 hunks)
  • libs/zard/src/lib/components/icon/icons.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
libs/zard/src/lib/components/**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

libs/zard/src/lib/components/**/*.spec.ts: Co-locate test files with components using .spec.ts suffix next to component files
Use Angular TestBed and ComponentFixture utilities for testing components

Write co-located Jest tests using TestBed and ComponentFixture next to components

Files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
libs/zard/**/*.{css,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

Use CSS custom properties for design tokens and theming in the component library

Files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use @zard/* path aliases for imports mapping to libs/zard/src/lib/* directories

Files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
🧠 Learnings (29)
📓 Common learnings
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use Angular standalone components as the base template for component architecture

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-14T22:52:09.135Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 326
File: libs/zard/src/lib/components/input/float.label.component.ts:71-0
Timestamp: 2025-11-14T22:52:09.135Z
Learning: In libs/zard/src/lib/components/*/*.component.ts files, move HostListener and HostBinding to the Component decorator's host property instead of using decorators on class members (e.g., host: { '(input)': 'onInput()' }).

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use signal-based inputs (`input()`) for Angular component inputs in the ZardUI library

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Write co-located Jest tests using TestBed and ComponentFixture next to components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Use Angular TestBed and ComponentFixture utilities for testing components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Co-locate test files with components using `.spec.ts` suffix next to component files

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-26T11:20:45.264Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/select/select.component.spec.ts:79-88
Timestamp: 2025-11-26T11:20:45.264Z
Learning: In ZardUI select component tests (libs/zard/src/lib/components/select/select.component.spec.ts), use fakeAsync() with flush() instead of setTimeout because the component uses setTimeout(..., 0) for focus management, which requires advancing macrotasks in tests.

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Add new components to barrel export in `libs/zard/src/lib/components/components.ts`

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/*.ts : Create component demo files with `name`, `code`, and `component` properties following existing patterns

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses()` utility with `clsx` and `tailwind-merge` to resolve class conflicts in component styling

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses` utility with `tailwind-merge` to resolve class conflicts in components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/demo/**/*.ts : Create demo components in the `demo/` folder with a main export, default example, and variant examples

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Export all components in `libs/zard/src/lib/components/components.ts` for public API

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Use Jest with `happy-dom/jest-environment` for testing Angular components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-30T13:27:41.206Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/popover/popover.component.ts:28-29
Timestamp: 2025-11-30T13:27:41.206Z
Learning: In libs/zard/src/lib/components/core/**/*.ts files (core utilities, plugins, and providers), use relative imports for intra-core dependencies because the ZardUI CLI performs path transformations during component installation. The CLI expects specific relative path patterns and transforms them to the target project structure. For all other component imports and application code, use zard/* path aliases.

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/**/*.ts : Export demo and documentation components with proper naming for automatic site generation

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-30T08:50:23.436Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/core/providezard.ts:0-0
Timestamp: 2025-11-30T08:50:23.436Z
Learning: In libs/zard/src/lib/components/core/providezard.ts, the import paths `../core/event-manager-plugins/...` are intentionally structured this way because the ZardUI CLI transforms them to 'shared/components/core/event-manager-plugins/...' format. Other relative path combinations don't work with the current CLI implementation. This path pattern should not be simplified until the CLI transformation logic is updated.

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to **/*.{ts,tsx,js} : Use `zard/*` path aliases for imports mapping to `libs/zard/src/lib/*` directories

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Use path aliases `zard/*` pointing to `libs/zard/src/lib/*` for component imports

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy in Angular components: `changeDetection: ChangeDetectionStrategy.OnPush`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use Signal-based inputs with the `input()` function instead of Input decorators in Angular components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy for all Angular components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.html : Use ZardUI form components (`ZardFormFieldComponent`, `ZardFormLabelComponent`, `ZardFormControlComponent`) for proper validation and error handling in templates

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:55:04.698Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: packages/cli/README.md:0-0
Timestamp: 2025-11-25T18:55:04.698Z
Learning: Components should support dark mode through built-in styling and configuration

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use TailwindCSS v4 with PostCSS for component styling and utility-first approach

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Create components as standalone components with `standalone: true` in Angular

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use computed properties in Angular components for reactive class calculations: `protected readonly classes = computed(() => ...)`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
🔇 Additional comments (7)
libs/zard/src/lib/components/accordion/accordion.component.spec.ts (1)

10-15: LGTM! Mock expansion for shared utils.

The additional mocks for transform, generateId, and noopFun ensure test isolation when these utilities are transitively imported. Clean and minimal approach.

libs/zard/src/lib/components/icon/icons.ts (2)

89-96: Nicely done! Clean LucideIconData definition.

The icon is now defined directly as LucideIconData array, avoiding the SVG parsing overhead. The invisible path has been removed as suggested in the previous review. This is the idiomatic approach for custom icons in the Lucide ecosystem.


182-182: LGTM! Icon registration.

The 'dark-mode' key is properly registered in ZARD_ICONS, making it available for <z-icon zType="dark-mode"> usage throughout the application.

libs/zard/src/lib/components/core/provider/services/dark-mode.ts (1)

44-55: LGTM! Clean API consolidation.

The toggleTheme method now serves dual purpose: direct theme application when targetMode is provided, and toggle behavior otherwise. Using themeMode() for the toggle calculation correctly handles the SYSTEM preference resolution.

apps/web/src/app/domain/components/header/header.component.html (1)

44-47: LGTM! Clean migration to z-icon component.

Replacing the inline SVG with <z-icon zType="dark-mode"> leverages the centralized icon registry and keeps the template clean. The size-4.5 class provides consistent sizing.

apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts (1)

62-64: LGTM! Correct API usage.

The activateTheme method properly delegates to toggleTheme(theme) using the updated service API.

apps/web/src/app/domain/components/header/header.component.ts (1)

55-57: LGTM! Clean service delegation.

The toggleTheme() method now properly delegates to the service without local theme computation. This aligns with the updated ZardDarkMode API and keeps the component focused on coordination rather than logic.

@mikij mikij force-pushed the feat/custom-icons branch 2 times, most recently from 3fa2c3b to 29acd14 Compare December 11, 2025 08:38
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fa2c3b and 29acd14.

⛔ Files ignored due to path filters (4)
  • apps/web/public/installation/manual/icon.md is excluded by !apps/web/public/** and included by apps/**
  • package-lock.json is excluded by !**/package-lock.json and included by none
  • package.json is excluded by none and included by none
  • packages/cli/src/utils/templates.ts is excluded by !packages/** and included by none
📒 Files selected for processing (6)
  • apps/web/src/app/domain/components/header/header.component.html (1 hunks)
  • apps/web/src/app/domain/components/header/header.component.ts (3 hunks)
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts (1 hunks)
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts (1 hunks)
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts (2 hunks)
  • libs/zard/src/lib/components/icon/icons.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
libs/zard/**/*.{css,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

Use CSS custom properties for design tokens and theming in the component library

Files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use @zard/* path aliases for imports mapping to libs/zard/src/lib/* directories

Files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
libs/zard/src/lib/components/**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

libs/zard/src/lib/components/**/*.spec.ts: Co-locate test files with components using .spec.ts suffix next to component files
Use Angular TestBed and ComponentFixture utilities for testing components

Write co-located Jest tests using TestBed and ComponentFixture next to components

Files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
🧠 Learnings (31)
📓 Common learnings
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: packages/cli/README.md:0-0
Timestamp: 2025-11-25T18:55:04.698Z
Learning: Components should support dark mode through built-in styling and configuration
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use Angular standalone components as the base template for component architecture

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-14T22:52:09.135Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 326
File: libs/zard/src/lib/components/input/float.label.component.ts:71-0
Timestamp: 2025-11-14T22:52:09.135Z
Learning: In libs/zard/src/lib/components/*/*.component.ts files, move HostListener and HostBinding to the Component decorator's host property instead of using decorators on class members (e.g., host: { '(input)': 'onInput()' }).

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Add new components to barrel export in `libs/zard/src/lib/components/components.ts`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy in Angular components: `changeDetection: ChangeDetectionStrategy.OnPush`

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use signal-based inputs (`input()`) for Angular component inputs in the ZardUI library

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/**/*.{css,ts} : Use CSS custom properties for design tokens and theming in the component library

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use Signal-based inputs with the `input()` function instead of Input decorators in Angular components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use OnPush change detection strategy for all Angular components

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Create components as standalone components with `standalone: true` in Angular

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/**/*.ts : Export demo and documentation components with proper naming for automatic site generation

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.html
  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-30T13:27:41.206Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/popover/popover.component.ts:28-29
Timestamp: 2025-11-30T13:27:41.206Z
Learning: In libs/zard/src/lib/components/core/**/*.ts files (core utilities, plugins, and providers), use relative imports for intra-core dependencies because the ZardUI CLI performs path transformations during component installation. The CLI expects specific relative path patterns and transforms them to the target project structure. For all other component imports and application code, use zard/* path aliases.

Applied to files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.ts : Use signals (`signal()` from `angular/core`) for reactive state management in block components, such as loading states and UI state

Applied to files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.ts : Always use the `protected` access modifier for component properties and methods that are accessed in templates (e.g., `protected readonly`, `protected onSubmit()`)

Applied to files:

  • libs/zard/src/lib/components/core/provider/services/dark-mode.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use computed properties in Angular components for reactive class calculations: `protected readonly classes = computed(() => ...)`

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-29T15:31:22.377Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 339
File: libs/zard/src/lib/components/carousel/carousel.component.ts:92-92
Timestamp: 2025-11-29T15:31:22.377Z
Learning: In libs/zard/src/lib/components/**/*.component.ts files using TailwindCSS, avoid suggesting individual class bindings like `[class.fill-primary]="condition"` because they can cause TailwindCSS issues. Prefer string concatenation or `[class]` binding with conditional expressions instead.

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-25T18:55:04.698Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: packages/cli/README.md:0-0
Timestamp: 2025-11-25T18:55:04.698Z
Learning: Components should support dark mode through built-in styling and configuration

Applied to files:

  • apps/web/src/app/domain/pages/dark-mode/dark-mode.page.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Write co-located Jest tests using TestBed and ComponentFixture next to components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Co-locate test files with components using `.spec.ts` suffix next to component files

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.spec.ts : Use Angular TestBed and ComponentFixture utilities for testing components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/demo/**/*.ts : Create demo components in the `demo/` folder with a main export, default example, and variant examples

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/components.ts : Export all components in `libs/zard/src/lib/components/components.ts` for public API

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/*/demo/*.ts : Create component demo files with `name`, `code`, and `component` properties following existing patterns

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-26T11:20:45.264Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/select/select.component.spec.ts:79-88
Timestamp: 2025-11-26T11:20:45.264Z
Learning: In ZardUI select component tests (libs/zard/src/lib/components/select/select.component.spec.ts), use fakeAsync() with flush() instead of setTimeout because the component uses setTimeout(..., 0) for focus management, which requires advancing macrotasks in tests.

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses` utility with `tailwind-merge` to resolve class conflicts in components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Use Jest with `happy-dom/jest-environment` for testing Angular components

Applied to files:

  • libs/zard/src/lib/components/accordion/accordion.component.spec.ts
📚 Learning: 2025-11-30T08:50:23.436Z
Learnt from: mikij
Repo: zard-ui/zardui PR: 348
File: libs/zard/src/lib/components/core/providezard.ts:0-0
Timestamp: 2025-11-30T08:50:23.436Z
Learning: In libs/zard/src/lib/components/core/providezard.ts, the import paths `../core/event-manager-plugins/...` are intentionally structured this way because the ZardUI CLI transforms them to 'shared/components/core/event-manager-plugins/...' format. Other relative path combinations don't work with the current CLI implementation. This path pattern should not be simplified until the CLI transformation logic is updated.

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:22.692Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T18:54:22.692Z
Learning: Applies to **/*.{ts,tsx,js} : Use `zard/*` path aliases for imports mapping to `libs/zard/src/lib/*` directories

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Use path aliases `zard/*` pointing to `libs/zard/src/lib/*` for component imports

Applied to files:

  • libs/zard/src/lib/components/icon/icons.ts
📚 Learning: 2025-11-25T18:54:50.383Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: libs/blocks/README.md:0-0
Timestamp: 2025-11-25T18:54:50.383Z
Learning: Applies to libs/blocks/src/lib/**/*.component.ts : Implement standalone Angular components with explicit imports rather than using module declarations

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
📚 Learning: 2025-11-25T18:54:01.560Z
Learnt from: CR
Repo: zard-ui/zardui PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T18:54:01.560Z
Learning: Applies to libs/zard/src/lib/components/**/*.component.ts : Use `mergeClasses()` utility with `clsx` and `tailwind-merge` to resolve class conflicts in component styling

Applied to files:

  • apps/web/src/app/domain/components/header/header.component.ts
🔇 Additional comments (5)
libs/zard/src/lib/components/core/provider/services/dark-mode.ts (1)

23-55: Theme signal exposure and toggle behavior now look consistent

Exposing theme via this.themeSignal.asReadonly() and updating toggleTheme(targetMode?) to either apply an explicit mode or flip between resolved light/dark via themeMode() aligns well with the new API and signal-based pattern. It also cleanly separates “selected mode” (themeSignal) from “effective mode” (themeMode).

Please just double‑check that the new two‑state toggle (LIGHT ⇄ DARK, with SYSTEM only set via an explicit targetMode) matches the intended UX in your docs and demos.

apps/web/src/app/domain/components/header/header.component.html (1)

39-47: Using <z-icon> for layout and dark‑mode icons is a good consolidation

Switching to <z-icon> with [zType]="GalleryHorizontalIcon" and zType="dark-mode" makes the header rely on the design‑system icon component instead of ad‑hoc SVGs, so sizing/theming stays consistent and the new dark‑mode registry entry is exercised.

libs/zard/src/lib/components/icon/icons.ts (1)

89-95: Dark‑mode icon definition and registration match existing patterns

Defining DarkMode as a path/attrs tuple array and wiring it into ZARD_ICONS under 'dark-mode' keeps it consistent with the rest of the registry and makes it directly consumable via <z-icon zType="dark-mode"> in the app.

Also applies to: 182-183

apps/web/src/app/domain/components/header/header.component.ts (2)

5-5: Icon wiring into the header component looks solid

Importing GalleryHorizontal, exposing it as GalleryHorizontalIcon, and adding ZardIconComponent plus AsyncPipe/RouterModule to the imports array cleanly supports the new <z-icon [zType]="GalleryHorizontalIcon"> usage and existing async bindings without dragging in extra modules.

Also applies to: 28-36, 47-47


12-12: Header now correctly delegates theme toggling to the central dark‑mode service

Injecting ZardDarkMode and having toggleTheme() call this.darkModeService.toggleTheme() removes local theme state from the header and centralizes behavior in the provider, which is preferable for consistency and future changes to theme logic.

Also applies to: 49-55

@Luizgomess Luizgomess merged commit 8ed6b44 into master Dec 11, 2025
5 checks passed
@Luizgomess Luizgomess deleted the feat/custom-icons branch December 11, 2025 09:21
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.

3 participants