diff --git a/src/framework/theme/components/actions/actions.component.ts b/src/framework/theme/components/actions/actions.component.ts index ff6198256f..3cb30019fc 100644 --- a/src/framework/theme/components/actions/actions.component.ts +++ b/src/framework/theme/components/actions/actions.component.ts @@ -103,7 +103,7 @@ export class NbActionComponent { * 'primary', 'info', 'success', 'warning', 'danger' * @param {string} val */ - @Input() badgeStatus: NbComponentStatus; + @Input() badgeStatus: NbComponentStatus = 'basic'; /** * Badge position. diff --git a/src/framework/theme/components/badge/badge.component.spec.ts b/src/framework/theme/components/badge/badge.component.spec.ts index 02b24f2087..4a6cd95c17 100644 --- a/src/framework/theme/components/badge/badge.component.spec.ts +++ b/src/framework/theme/components/badge/badge.component.spec.ts @@ -22,8 +22,8 @@ describe('NbBadgeComponent', () => { expect(fixture.debugElement.nativeElement.textContent).toEqual(text); }); - it('should has primary status by default', () => { - expect(badgeComponent.status).toEqual('primary'); + it('should has basic status by default', () => { + expect(badgeComponent.status).toEqual('basic'); }); it('should set status class', () => { diff --git a/src/framework/theme/components/badge/badge.component.ts b/src/framework/theme/components/badge/badge.component.ts index b03de3a156..ce96210b83 100644 --- a/src/framework/theme/components/badge/badge.component.ts +++ b/src/framework/theme/components/badge/badge.component.ts @@ -7,6 +7,7 @@ import { Component, HostBinding, Input } from '@angular/core'; import { NbComponentStatus } from '../component-status'; +import { emptyStatusWarning } from '../helpers'; export type NbBadgePhysicalPosition = 'top left' | 'top right' | 'bottom left' | 'bottom right'; export type NbBadgeLogicalPosition = 'top start' | 'top end' | 'bottom start' | 'bottom end'; @@ -110,7 +111,18 @@ export class NbBadgeComponent { * Badge status (adds specific styles): * 'basic', 'primary', 'info', 'success', 'warning', 'danger', 'control' */ - @Input() status: NbComponentStatus = 'primary'; + @Input() + get status(): NbComponentStatus { + return this._status; + } + set status(value: NbComponentStatus) { + if ((value as string) === '') { + emptyStatusWarning('NbBadge'); + value = 'basic'; + } + this._status = value; + } + protected _status: NbComponentStatus = 'basic'; @HostBinding('class.status-primary') get primary(): boolean { diff --git a/src/framework/theme/components/button/button.component.ts b/src/framework/theme/components/button/button.component.ts index 7ff2f370dc..2845e98e61 100644 --- a/src/framework/theme/components/button/button.component.ts +++ b/src/framework/theme/components/button/button.component.ts @@ -26,7 +26,7 @@ export type NbButtonAppearance = 'filled' | 'outline' | 'ghost' | 'hero'; /** * Basic button component. * - * Default button size is `medium` and status color is `primary`: + * Default button size is `medium` and status color is `basic`: * @stacked-example(Button Showcase, button/button-showcase.component) * * ```html @@ -540,9 +540,9 @@ export class NbButtonComponent implements AfterViewInit { /** * Button status (adds specific styles): - * `basic`, `primary`, `info`, `success`, `warning`, `danger`, `control`. + * `primary`, `info`, `success`, `warning`, `danger` */ - @Input() status: NbComponentStatus = 'primary'; + @Input() status: NbComponentStatus = 'basic'; /** * Button shapes: `rectangle`, `round`, `semi-round` diff --git a/src/framework/theme/components/helpers.ts b/src/framework/theme/components/helpers.ts index 3af5741913..b3fd1c8d8e 100644 --- a/src/framework/theme/components/helpers.ts +++ b/src/framework/theme/components/helpers.ts @@ -41,7 +41,7 @@ export function lastChildNotComment(node: Node) { } /* - * @breaking-change Remove @5.0.0 + * @breaking-change Remove @6.0.0 */ export function emptyStatusWarning(source: string) { console.warn(`${source}: Using empty string as a status is deprecated. Use \`basic\` instead.`); diff --git a/src/framework/theme/components/progress-bar/progress-bar.component.ts b/src/framework/theme/components/progress-bar/progress-bar.component.ts index d77bb53be9..ed8430ed0a 100644 --- a/src/framework/theme/components/progress-bar/progress-bar.component.ts +++ b/src/framework/theme/components/progress-bar/progress-bar.component.ts @@ -113,9 +113,9 @@ export class NbProgressBarComponent { @Input() value: number = 0; /** - * Progress bar background (`basic`, `primary` (default), `info`, `success`, `warning`, `danger`, `control`) + * Progress bar background (`basic` (default), `primary`, `info`, `success`, `warning`, `danger`, `control`) */ - @Input() status: NbComponentStatus = 'primary'; + @Input() status: NbComponentStatus = 'basic'; /** * Progress bar size (`tiny`, `small`, `medium` (default), `large`, `giant`) diff --git a/src/framework/theme/components/tabset/tabset.component.ts b/src/framework/theme/components/tabset/tabset.component.ts index 9f11ae1d77..2d98a8ed66 100644 --- a/src/framework/theme/components/tabset/tabset.component.ts +++ b/src/framework/theme/components/tabset/tabset.component.ts @@ -132,7 +132,7 @@ export class NbTabComponent { * 'primary', 'info', 'success', 'warning', 'danger' * @param {string} val */ - @Input() badgeStatus: NbComponentStatus; + @Input() badgeStatus: NbComponentStatus = 'basic'; /** * Badge position. diff --git a/src/framework/theme/components/toastr/toastr-config.ts b/src/framework/theme/components/toastr/toastr-config.ts index 87ae214a82..39d9c4f254 100644 --- a/src/framework/theme/components/toastr/toastr-config.ts +++ b/src/framework/theme/components/toastr/toastr-config.ts @@ -30,7 +30,7 @@ export class NbToastrConfig { /** * Status chooses color scheme for the toast. * */ - status: NbComponentStatus = 'primary'; + status: NbComponentStatus = 'basic'; /** * Duration is timeout between toast appears and disappears. * */ @@ -87,7 +87,7 @@ export class NbToastrConfig { constructor(config: Partial) { if ((config.status as string) === '') { emptyStatusWarning('NbToastr'); - config.status = 'primary'; + config.status = 'basic'; } this.patchIcon(config); @@ -97,7 +97,7 @@ export class NbToastrConfig { protected patchIcon(config: Partial) { if (!('icon' in config)) { config.icon = { - icon: this.icons[config.status || 'primary'], + icon: this.icons[config.status || 'basic'], pack: 'nebular-essentials', }; } diff --git a/src/framework/theme/components/toastr/toastr.service.spec.ts b/src/framework/theme/components/toastr/toastr.service.spec.ts index d11a9151bf..5ac4201670 100644 --- a/src/framework/theme/components/toastr/toastr.service.spec.ts +++ b/src/framework/theme/components/toastr/toastr.service.spec.ts @@ -107,7 +107,7 @@ describe('toastr-service', () => { expect(attachSpy).toHaveBeenCalled(); const [[{ config }]] = attachSpy.calls.allArgs(); expect(config.position).toBe(NbGlobalLogicalPosition.BOTTOM_START, 'incorrect position'); - expect(config.status).toBe('primary', 'incorrect status'); + expect(config.status).toBe('basic', 'incorrect status'); expect(config.duration).toBe(1234, 'incorrect duration'); expect(config.destroyByClick).toBe(true, 'incorrect destroyByClick'); expect(config.preventDuplicates).toBe(true, 'incorrect preventDuplicates'); diff --git a/src/framework/theme/components/toastr/toastr.service.ts b/src/framework/theme/components/toastr/toastr.service.ts index 0e8e137fea..6af6071de1 100644 --- a/src/framework/theme/components/toastr/toastr.service.ts +++ b/src/framework/theme/components/toastr/toastr.service.ts @@ -226,7 +226,7 @@ export class NbToastrContainerRegistry { * @stacked-example(Position, toastr/toastr-positions.component) * * `status` - coloring and icon of the toast. - * Default is `primary`. + * Default is `basic`. * * @stacked-example(Status, toastr/toastr-statuses.component) * @@ -313,7 +313,7 @@ export class NbToastrService { } /** - * Shows basic toast with message, title and user config. + * Shows default toast with message, title and user config. * */ default(message, title?, config?: Partial): NbToastRef { return this.show(message, title, { ...config, status: 'basic' }); diff --git a/src/framework/theme/components/user/user.component.ts b/src/framework/theme/components/user/user.component.ts index 7eb35b3c09..d853283174 100644 --- a/src/framework/theme/components/user/user.component.ts +++ b/src/framework/theme/components/user/user.component.ts @@ -217,7 +217,7 @@ export class NbUserComponent { * `primary`, `info`, `success`, `warning`, `danger` * @param {string} val */ - @Input() badgeStatus: NbComponentStatus; + @Input() badgeStatus: NbComponentStatus = 'basic'; /** * Badge position.