Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(design)!: remove deprecated layout and size properties in DaffCalloutComponent #2869

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions libs/design/callout/src/callout/callout.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,6 @@
}
}

// centered will be deprecated in v1.0.0
&--centered {
#{$root}__title {
margin: 0 auto;
text-align: center;
}

#{$root}__subtitle {
margin: 10px auto 0;
text-align: center;

@include layout.breakpoint(mobile) {
margin: 25px auto 0;
}
}
}

// compact will be deprecated in v1.0.0
&--compact {
padding: 25px;

@include layout.breakpoint(mobile) {
padding: 25px 50px;
}
}

&.daff-compact {
padding: 48px 24px;

Expand Down
40 changes: 2 additions & 38 deletions libs/design/callout/src/callout/callout.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,16 @@ import {
DaffTextAlignment,
} from '@daffodil/design';

import {
DaffCalloutComponent,
DaffCalloutLayout,
DaffCalloutSize,
} from './callout.component';
import { DaffCalloutComponent } from './callout.component';

@Component ({
template: `
<daff-callout [color]="color" [layout]="layout" [size]="size" [textAlignment]="textAlignment" [compact]="compact"></daff-callout>
<daff-callout [color]="color" [textAlignment]="textAlignment" [compact]="compact"></daff-callout>
`,
})

class WrapperComponent {
color: DaffPalette;
layout: DaffCalloutLayout;
size: DaffCalloutSize;
textAlignment: DaffTextAlignment;
compact = false;
}
Expand Down Expand Up @@ -81,36 +75,6 @@ describe('@daffodil/design/callout | DaffCalloutComponent', () => {
});
});

describe('setting the layout', () => {
describe('when layout="centered"', () => {
it('should add a class of "daff-callout--centered" to the host element', () => {
wrapper.layout = 'centered';
fixture.detectChanges();
expect(de.nativeElement.classList.contains('daff-callout--centered')).toBeTruthy();
});
});

it('should not set a default layout', () => {
expect(component.layout).toBeFalsy();
expect(de.nativeElement.classList.contains('daff-callout--centered')).toBeFalsy();
});
});

describe('setting the size', () => {
describe('when size="compact"', () => {
it('should add a class of "daff-callout--compact" to the host element', () => {
wrapper.size = 'compact';
fixture.detectChanges();
expect(de.nativeElement.classList.contains('daff-callout--compact')).toBeTruthy();
});
});

it('should not set a default size', () => {
expect(component.size).toBeFalsy();
expect(de.nativeElement.classList.contains('daff-callout--compact')).toBeFalsy();
});
});

it('should take textAlignment as an input', () => {
wrapper.textAlignment = 'left';
fixture.detectChanges();
Expand Down
40 changes: 0 additions & 40 deletions libs/design/callout/src/callout/callout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@ import {
daffTextAlignmentMixin,
} from '@daffodil/design';

/**
* @deprecated See {@link DaffTextAlignable}
*/
export type DaffCalloutLayout = 'centered' | undefined;
export enum DaffCalloutLayoutEnum {
Centered = 'centered'
}

/**
* @deprecated See {@link DaffCompactable}
*/
export type DaffCalloutSize = 'compact' | undefined;
export enum DaffCalloutSizeEnum {
Compact = 'compact'
}

/**
* An _elementRef and an instance of renderer2 are needed for the Colorable mixin
*/
Expand All @@ -58,16 +42,6 @@ const _daffCalloutBase = daffArticleEncapsulatedMixin(daffManageContainerLayoutM
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DaffCalloutComponent extends _daffCalloutBase implements DaffColorable, DaffTextAlignable, DaffCompactable {
/**
* @deprecated See {@link DaffTextAlignable}
*/
@Input() layout: DaffCalloutLayout;

/**
* @deprecated See {@link DaffCompactable}
*/
@Input() size: DaffCalloutSize;

constructor(private elementRef: ElementRef, private renderer: Renderer2) {
super(elementRef, renderer);
}
Expand All @@ -76,18 +50,4 @@ export class DaffCalloutComponent extends _daffCalloutBase implements DaffColora
* @docs-private
*/
@HostBinding('class.daff-callout') class = true;

/**
* @deprecated See {@link DaffTextAlignable}
*/
@HostBinding('class.daff-callout--centered') get centered() {
return this.layout === DaffCalloutLayoutEnum.Centered;
}

/**
* @deprecated See {@link DaffCompactable}
*/
@HostBinding('class.daff-callout--compact') get compactClass() {
return this.size === DaffCalloutSizeEnum.Compact;
}
}
Loading