Skip to content

Commit 16f32b0

Browse files
authored
Merge pull request #13948 from IgniteUI/simeonoff/indigo-theme
feat(themes): implement updated Indigo UI theme
2 parents 00a1bff + 35a34a0 commit 16f32b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+8158
-7473
lines changed

package-lock.json

Lines changed: 7046 additions & 7273 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@types/source-map": "0.5.2",
7171
"express": "^4.18.2",
7272
"fflate": "^0.8.1",
73-
"igniteui-theming": "^4.4.0",
73+
"igniteui-theming": "^5.0.1",
7474
"igniteui-trial-watermark": "^3.0.2",
7575
"lodash-es": "^4.17.21",
7676
"rxjs": "^7.8.0",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$disabled-color",
6+
"replaceWith": "$disabled-text-color",
7+
"owner": "expansion-panel-theme",
8+
"type": "property"
9+
}
10+
]
11+
}

projects/igniteui-angular/migrations/update-17_1_0/index.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,17 @@ describe(`Update to ${version}`, () => {
153153
`
154154
);
155155
});
156+
157+
it('should rename the expansion-panel $disabled-color property to $disabled-text-color', async () => {
158+
appTree.create(
159+
`/testSrc/appPrefix/component/test.component.scss`,
160+
`$custom-expansion-panel: expansion-panel-theme($disabled-color: color($default-palette, 'gray', 200));`
161+
);
162+
163+
const tree = await schematicRunner.runSchematic(migrationName, { shouldInvokeLS: false }, appTree);
164+
165+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.scss')).toEqual(
166+
`$custom-expansion-panel: expansion-panel-theme($disabled-text-color: color($default-palette, 'gray', 200));`
167+
);
168+
});
156169
});

projects/igniteui-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"igniteui-trial-watermark": "^3.0.2",
7575
"lodash-es": "^4.17.21",
7676
"uuid": "^9.0.0",
77-
"igniteui-theming": "^4.4.0",
77+
"igniteui-theming": "^5.0.1",
7878
"@igniteui/material-icons-extended": "^3.0.0"
7979
},
8080
"peerDependencies": {

projects/igniteui-angular/src/lib/banner/banner.component.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,8 @@ export class IgxBannerSampleComponent {
551551
<igx-avatar
552552
src="https://www.infragistics.com/angular-demos/assets/images/card/avatars/brad_stanley.jpg">
553553
</igx-avatar>
554-
<div class="igx-card-header__tgroup">
555-
<h3 class="igx-card-header__title--small">Brad Stanley</h3>
556-
<h5 class="igx-card-header__subtitle">Audi AG</h5>
557-
</div>
554+
<h3 class="igx-card-header__title--small">Brad Stanley</h3>
555+
<h5 class="igx-card-header__subtitle">Audi AG</h5>
558556
</igx-card-header>
559557
<igx-card-content>
560558
<p class="igx-card-content__text">Brad Stanley has requested to follow you.</p>

projects/igniteui-angular/src/lib/card/card-header.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[igxCardHeaderTitle],
88
[igxCardHeaderSubtitle],
99
.igx-card-header__title,
10+
.igx-card-header__title--small,
1011
.igx-card-header__subtitle">
1112
</ng-content>
1213
</div>

projects/igniteui-angular/src/lib/carousel/carousel.component.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
</span>
1919
</ng-template>
2020

21+
<ng-template #indigoPrevButton let-disabled>
22+
<span class="igx-nav-arrow"
23+
[class.igx-nav-arrow--disabled]="disabled">
24+
<igx-icon>chevron_left</igx-icon>
25+
</span>
26+
</ng-template>
27+
28+
<ng-template #indigoNextButton let-disabled>
29+
<span class="igx-nav-arrow"
30+
[class.igx-nav-arrow--disabled]="disabled">
31+
<igx-icon>chevron_right</igx-icon>
32+
</span>
33+
</ng-template>
34+
2135
<div *ngIf="showIndicators" [ngClass]="indicatorsOrientationClass" [attr.role]="'tablist'">
2236
<div *ngFor="let slide of slides"
2337
class="igx-carousel-indicators__indicator"
@@ -46,6 +60,3 @@
4660
<div *ngIf="navigation && slides.length" role="button" tabindex="0" class="igx-carousel__arrow--next" [attr.aria-label]="resourceStrings.igx_carousel_next_slide" (keydown.enter)="next()" (click)="next()">
4761
<ng-container *ngTemplateOutlet="getNextButtonTemplate; context: {$implicit: nextButtonDisabled};"></ng-container>
4862
</div>
49-
50-
51-

projects/igniteui-angular/src/lib/carousel/carousel.component.ts

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NgIf, NgClass, NgFor, NgTemplateOutlet } from '@angular/common';
22
import {
33
AfterContentInit,
4+
AfterViewChecked,
45
ChangeDetectorRef,
56
Component,
67
ContentChild,
@@ -27,7 +28,6 @@ import { merge, Subject } from 'rxjs';
2728
import { takeUntil } from 'rxjs/operators';
2829
import { CarouselResourceStringsEN, ICarouselResourceStrings } from '../core/i18n/carousel-resources';
2930
import { IBaseEventArgs, PlatformUtil } from '../core/utils';
30-
3131
import { IgxAngularAnimationService } from '../services/animation/angular-animation-service';
3232
import { AnimationService } from '../services/animation/animation';
3333
import { Direction, IgxCarouselComponentBase } from './carousel-base';
@@ -37,9 +37,11 @@ import { IgxIconComponent } from '../icon/icon.component';
3737
import { getCurrentResourceStrings } from '../core/i18n/resources';
3838
import { HammerGesturesManager } from '../core/touch';
3939
import { CarouselIndicatorsOrientation, HorizontalAnimationType } from './enums';
40+
import { ThemeService } from '../services/theme/theme.service';
4041

4142
let NEXT_ID = 0;
4243

44+
4345
@Injectable()
4446
export class CarouselHammerConfig extends HammerGestureConfig {
4547
public override overrides = {
@@ -84,7 +86,8 @@ export class CarouselHammerConfig extends HammerGestureConfig {
8486
standalone: true,
8587
imports: [IgxIconComponent, NgIf, NgClass, NgFor, NgTemplateOutlet]
8688
})
87-
export class IgxCarouselComponent extends IgxCarouselComponentBase implements OnDestroy, AfterContentInit {
89+
90+
export class IgxCarouselComponent extends IgxCarouselComponentBase implements OnDestroy, AfterContentInit, AfterViewChecked {
8891

8992
/**
9093
* Sets the `id` of the carousel.
@@ -140,6 +143,12 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
140143
return this.gesturesSupport ? 'pan-y' : 'auto';
141144
}
142145

146+
/**
147+
* Sets the theme of the carousel component.
148+
*/
149+
@Input('theme')
150+
public theme: string;
151+
143152
/**
144153
* Sets whether the carousel should `loop` back to the first slide after reaching the last slide.
145154
* Default value is `true`.
@@ -373,6 +382,12 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
373382
@ViewChild('defaultPrevButton', { read: TemplateRef, static: true })
374383
private defaultPrevButton: TemplateRef<any>;
375384

385+
@ViewChild('indigoNextButton', { read: TemplateRef, static: true })
386+
private indigoNextButton: TemplateRef<any>;
387+
388+
@ViewChild('indigoPrevButton', { read: TemplateRef, static: true })
389+
private indigoPrevButton: TemplateRef<any>;
390+
376391
/**
377392
* @hidden
378393
* @internal
@@ -418,15 +433,17 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
418433
if (this.nextButtonTemplate) {
419434
return this.nextButtonTemplate;
420435
}
421-
return this.defaultNextButton;
436+
437+
return this.isTypeIndigo ? this.indigoNextButton : this.defaultNextButton
422438
}
423439

424440
/** @hidden */
425441
public get getPrevButtonTemplate(): TemplateRef<any> {
426442
if (this.prevButtonTemplate) {
427443
return this.prevButtonTemplate;
428444
}
429-
return this.defaultPrevButton;
445+
446+
return this.isTypeIndigo ? this.indigoPrevButton : this.defaultPrevButton
430447
}
431448

432449
/** @hidden */
@@ -540,9 +557,12 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
540557
private element: ElementRef,
541558
private iterableDiffers: IterableDiffers,
542559
@Inject(IgxAngularAnimationService) animationService: AnimationService,
543-
private platformUtil: PlatformUtil) {
560+
private platformUtil: PlatformUtil,
561+
private themeService: ThemeService
562+
) {
544563
super(animationService, cdr);
545564
this.differ = this.iterableDiffers.find([]).create(null);
565+
this.theme = this.themeService.theme;
546566
}
547567

548568

@@ -674,6 +694,23 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
674694
}
675695
}
676696

697+
/**
698+
* Returns true if the `IgxCarouselComponent` theme is Indigo.
699+
*
700+
* ```typescript
701+
* @ViewChild("carousel")
702+
* public carousel: IgxCarouselComponent;
703+
*
704+
* ngAfterViewInit(){
705+
* let isTypeIndigo = this.carousel.isTypeIndigo;
706+
* }
707+
* ```
708+
*/
709+
@HostBinding('class.igx-carousel--indigo')
710+
public get isTypeIndigo() {
711+
return this.theme ? this.theme === 'indigo-design' : this.themeService.theme === 'indigo-design';
712+
}
713+
677714
/** @hidden */
678715
public ngAfterContentInit() {
679716
this.slides.changes
@@ -683,6 +720,11 @@ export class IgxCarouselComponent extends IgxCarouselComponentBase implements On
683720
this.initSlides(this.slides);
684721
}
685722

723+
/** @hidden @internal */
724+
public ngAfterViewChecked() {
725+
this.themeService.getCssProp(this.element);
726+
}
727+
686728
/** @hidden */
687729
public ngOnDestroy() {
688730
this.destroy$.next(true);

projects/igniteui-angular/src/lib/core/styles/base/_mixins.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@
8787
@mixin gen-color-class($name, $variant, $prefix, $suffix) {
8888
$prefix: if($prefix, '#{$prefix}-', '');
8989
$suffix: if($suffix, '-#{$suffix}', '');
90+
$_name: '' + $name;
9091

91-
.#{$prefix}#{$name}-#{$variant}#{$suffix} {
92+
.#{$prefix}#{$_name}-#{$variant}#{$suffix} {
9293
@content;
9394
}
9495
}

0 commit comments

Comments
 (0)