Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 80ad56c

Browse files
author
Tsvetan Emilov
committed
Migrate components to cds-icon
Introduce a new `IconsModule` that register the `cds-icon` component using the provided by Clarity `CdsIconModule` and import all Clarity icons. Testing Done: Run e2e tests.
1 parent c0d4bee commit 80ad56c

29 files changed

+361
-107
lines changed

package-lock.json

Lines changed: 247 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@angular/platform-browser-dynamic": "^15.2.3",
3030
"@angular/router": "^15.2.3",
3131
"@cds/core": "^6.3.1",
32+
"@cds/angular": "^6.3.1",
3233
"@clr/angular": "^15.0.3",
3334
"@clr/icons": "13.0.2",
3435
"@clr/ui": "^15.0.3",

projects/components/CHANGELOG.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
- Replace `clr-icon` with `cds-icon`
910

1011
## [15.0.1-dev.13]
1112
### Fixed

projects/components/src/action-menu/action-menu.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
}}</ng-container>
9999

100100
<a *ngIf="shouldShowIcon" role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm">
101-
<clr-icon [attr.size]="'1em'" [attr.shape]="action.icon"></clr-icon>
101+
<cds-icon [attr.size]="'1em'" [attr.shape]="action.icon"></cds-icon>
102102
<span class="tooltip-content" *ngIf="shouldShowTooltip">{{
103103
action.isTranslatable === false ? action.textKey : (action.textKey | translate)
104104
}}</span>

projects/components/src/action-menu/action-menu.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import { NgModule } from '@angular/core';
88
import { ClarityModule } from '@clr/angular';
99
import { I18nModule } from '@vcd/i18n';
1010
import { DropdownModule } from '../dropdown/dropdown.module';
11+
import { IconsModule } from '../icons';
1112
import { ShowClippedTextDirectiveModule } from '../lib/directives/show-clipped-text.directive.module';
1213
import { ActionMenuComponent } from './action-menu.component';
1314

1415
@NgModule({
15-
imports: [ClarityModule, CommonModule, I18nModule, DropdownModule, ShowClippedTextDirectiveModule],
16+
imports: [ClarityModule, CommonModule, I18nModule, DropdownModule, ShowClippedTextDirectiveModule, IconsModule],
1617
declarations: [ActionMenuComponent],
1718
providers: [],
1819
exports: [ActionMenuComponent],

projects/components/src/data-exporter/data-exporter.component.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ <h3 class="modal-title">{{ dialogHeader | lazyString }}</h3>
4141
<label [attr.data-ui]="DataUi.selectAllToggleLabel">{{ exportAllText | lazyString }}</label>
4242
</clr-checkbox-wrapper>
4343
<clr-dropdown [clrCloseMenuOnItemClick]="false">
44-
<clr-icon
45-
[attr.shape]="isDropdownOpen ? 'caret up' : 'caret down'"
46-
size="24"
44+
<cds-icon
45+
shape="caret"
46+
size="md"
47+
[attr.direction]="isDropdownOpen ? 'up' : 'down'"
4748
clrDropdownTrigger
4849
class="dropdown-button"
4950
[attr.data-ui]="DataUi.columnCheckboxArrow"
5051
*ngIf="!this.selectAllControl.value"
51-
></clr-icon>
52+
></cds-icon>
5253
<clr-dropdown-menu clrPosition="bottom" [formGroup]="formGroup" *clrIfOpen #dropdownMenu>
5354
<ul>
5455
<li
@@ -75,7 +76,7 @@ <h3 class="modal-title">{{ dialogHeader | lazyString }}</h3>
7576
</div>
7677

7778
<span
78-
class="x-button label"
79+
class="label"
7980
*ngFor="let column of selectedColumns"
8081
[attr.data-ui]="DataUi.columnSelectionBubbles"
8182
[ngStyle]="{ visibility: shouldShowBubbles ? 'visible' : 'hidden' }"
@@ -88,7 +89,7 @@ <h3 class="modal-title">{{ dialogHeader | lazyString }}</h3>
8889
(click)="selectColumn(column, false)"
8990
[attr.data-ui]="DataUi.columnBubblesX"
9091
>
91-
<clr-icon shape="close" class="badge badge-info"> </clr-icon>
92+
<cds-icon shape="close" size="sm"> </cds-icon>
9293
</button>
9394
</span>
9495
</div>

projects/components/src/data-exporter/data-exporter.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ clr-dropdown-menu {
4040
overflow: auto;
4141
}
4242

43-
.x-button.label {
44-
padding: 0 0.1rem 0.02rem;
43+
.label:has(> button) {
44+
padding-right: var(--cds-global-space-3);
4545
}
4646

4747
button.btn-link.remove-col-button {

projects/components/src/data-exporter/data-exporter.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import { NgModule } from '@angular/core';
88
import { ReactiveFormsModule } from '@angular/forms';
99
import { ClarityModule } from '@clr/angular';
1010
import { I18nModule } from '@vcd/i18n';
11+
import { IconsModule } from '../icons';
1112
import { DataExporterComponent } from './data-exporter.component';
1213

1314
@NgModule({
1415
declarations: [DataExporterComponent],
15-
imports: [CommonModule, ReactiveFormsModule, ClarityModule, I18nModule],
16+
imports: [CommonModule, ReactiveFormsModule, ClarityModule, I18nModule, IconsModule],
1617
exports: [DataExporterComponent],
1718
})
1819
export class VcdDataExporterModule {}

projects/components/src/dropdown/dropdown.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
>
1515
<ng-container *ngIf="dropdownTriggerBtnTxt">
1616
{{ dropdownTriggerBtnTxt }}
17-
<clr-icon *ngIf="!isNestedDropdown" shape="caret down"></clr-icon>
17+
<cds-icon *ngIf="!isNestedDropdown" shape="caret" direction="down"></cds-icon>
1818
</ng-container>
19-
<clr-icon *ngIf="!dropdownTriggerBtnTxt" [attr.shape]="dropdownTriggerBtnIcon"></clr-icon>
19+
<cds-icon *ngIf="!dropdownTriggerBtnTxt" [attr.shape]="dropdownTriggerBtnIcon"></cds-icon>
2020
</button>
2121

2222
<ng-container *ngIf="!isDropdownDisabled">
@@ -90,7 +90,7 @@
9090
}}</ng-container>
9191

9292
<a *ngIf="shouldShowIcon" role="tooltip" aria-haspopup="true" class="tooltip tooltip-sm">
93-
<clr-icon size="1em" [attr.shape]="item.icon"></clr-icon>
93+
<cds-icon size="md" [attr.shape]="item.icon"></cds-icon>
9494
<span class="tooltip-content" *ngIf="shouldShowTooltip">{{
9595
item.textKey | translate
9696
}}</span>

projects/components/src/dropdown/dropdown.module.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,22 @@ import { NgModule } from '@angular/core';
88
import { ReactiveFormsModule } from '@angular/forms';
99
import { ClarityModule } from '@clr/angular';
1010
import { I18nModule } from '@vcd/i18n';
11+
import { IconsModule } from '../icons';
1112
import { ShowClippedTextDirectiveModule } from '../lib/directives/show-clipped-text.directive.module';
1213
import { DropdownFocusHandlerDirective } from './dropdown.component';
1314
import { DropdownComponent } from './dropdown.component';
1415
import { DynamicDropdownPositionDirective } from './dynamic-dropdown-position.directive';
1516

1617
@NgModule({
1718
declarations: [DropdownComponent, DynamicDropdownPositionDirective, DropdownFocusHandlerDirective],
18-
imports: [CommonModule, ReactiveFormsModule, ClarityModule, I18nModule, ShowClippedTextDirectiveModule],
19+
imports: [
20+
CommonModule,
21+
ReactiveFormsModule,
22+
ClarityModule,
23+
I18nModule,
24+
ShowClippedTextDirectiveModule,
25+
IconsModule,
26+
],
1927
exports: [DropdownComponent, DynamicDropdownPositionDirective, DropdownFocusHandlerDirective],
2028
})
2129
export class DropdownModule {}

0 commit comments

Comments
 (0)