Skip to content

Commit 56ba78d

Browse files
committed
✨ feat(icons): added custom icon as a part of Zard icons
1 parent a973aca commit 56ba78d

File tree

8 files changed

+1166
-1362
lines changed

8 files changed

+1166
-1362
lines changed

apps/web/public/installation/manual/icon.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ import {
163163
Zap,
164164
} from 'lucide-angular';
165165
166+
const DarkMode: LucideIconData = [
167+
['path', { d: 'M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' }],
168+
['path', { d: 'M12 3l0 18' }],
169+
['path', { d: 'M12 9l4.65 -4.65' }],
170+
['path', { d: 'M12 14.3l7.37 -7.37' }],
171+
['path', { d: 'M12 19.6l8.85 -8.85' }],
172+
];
173+
166174
export const ZARD_ICONS = {
167175
house: House,
168176
settings: Settings,
@@ -248,6 +256,7 @@ export const ZARD_ICONS = {
248256
trash: Trash2,
249257
tag: Tag,
250258
'sun-moon': SunMoon,
259+
'dark-mode': DarkMode,
251260
} as const satisfies Record<string, LucideIconData>;
252261
253262
export declare type ZardIcon = keyof typeof ZARD_ICONS | LucideIconData;

apps/web/src/app/domain/components/header/header.component.html

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,7 @@
4242
</button>
4343
<z-divider zOrientation="vertical" zSpacing="none" class="h-4!"></z-divider>
4444
<button z-button zType="ghost" zSize="sm" (click)="toggleTheme()">
45-
<svg
46-
xmlns="http://www.w3.org/2000/svg"
47-
width="24"
48-
height="24"
49-
viewBox="0 0 24 24"
50-
fill="none"
51-
stroke="currentColor"
52-
stroke-width="2"
53-
stroke-linecap="round"
54-
stroke-linejoin="round"
55-
class="size-4.5"
56-
>
57-
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
58-
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path>
59-
<path d="M12 3l0 18"></path>
60-
<path d="M12 9l4.65 -4.65"></path>
61-
<path d="M12 14.3l7.37 -7.37"></path>
62-
<path d="M12 19.6l8.85 -8.85"></path>
63-
</svg>
45+
<z-icon zType="dark-mode" class="size-4.5" />
6446
<span class="sr-only">Toggle theme</span>
6547
</button>
6648
</aside>

apps/web/src/app/domain/components/header/header.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ import { MobileMenuComponent } from '../mobile-nav/mobile-nav.component';
2929
ZardButtonComponent,
3030
ZardIconComponent,
3131
ZardBadgeComponent,
32-
MobileMenuComponent,
3332
ZardDividerComponent,
33+
ZardIconComponent,
34+
MobileMenuComponent,
3435
AsyncPipe,
3536
DocResearcherComponent,
3637
LucideAngularModule,

libs/zard/src/lib/components/accordion/accordion.component.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { mergeClasses } from '../../shared/utils/utils';
99

1010
jest.mock('../../shared/utils/utils', () => ({
1111
mergeClasses: jest.fn().mockImplementation((variants, cls) => cls || 'default-classes'),
12+
transform: jest.fn(),
13+
generateId: jest.fn(),
14+
noopFun: jest.fn(),
1215
}));
1316

1417
const getHostComponent = (

libs/zard/src/lib/components/icon/icons.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ import {
8686
Zap,
8787
} from 'lucide-angular';
8888

89+
const DarkMode: LucideIconData = [
90+
['path', { d: 'M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' }],
91+
['path', { d: 'M12 3l0 18' }],
92+
['path', { d: 'M12 9l4.65 -4.65' }],
93+
['path', { d: 'M12 14.3l7.37 -7.37' }],
94+
['path', { d: 'M12 19.6l8.85 -8.85' }],
95+
];
96+
8997
export const ZARD_ICONS = {
9098
house: House,
9199
settings: Settings,
@@ -171,6 +179,7 @@ export const ZARD_ICONS = {
171179
trash: Trash2,
172180
tag: Tag,
173181
'sun-moon': SunMoon,
182+
'dark-mode': DarkMode,
174183
} as const satisfies Record<string, LucideIconData>;
175184

176185
export declare type ZardIcon = keyof typeof ZARD_ICONS | LucideIconData;

0 commit comments

Comments
 (0)