mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
[CL-155] Add support for hiding the close button on banner (#7142)
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
|
*ngIf="showClose"
|
||||||
type="button"
|
type="button"
|
||||||
bitIconButton="bwi-close"
|
bitIconButton="bwi-close"
|
||||||
buttonType="contrast"
|
buttonType="contrast"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export class BannerComponent implements OnInit {
|
|||||||
@Input("bannerType") bannerType: BannerTypes = "info";
|
@Input("bannerType") bannerType: BannerTypes = "info";
|
||||||
@Input() icon: string;
|
@Input() icon: string;
|
||||||
@Input() useAlertRole = true;
|
@Input() useAlertRole = true;
|
||||||
|
@Input() showClose = true;
|
||||||
|
|
||||||
@Output() onClose = new EventEmitter<void>();
|
@Output() onClose = new EventEmitter<void>();
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export default {
|
|||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
bannerType: "warning",
|
bannerType: "warning",
|
||||||
|
showClose: true,
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
onClose: { action: "onClose" },
|
onClose: { action: "onClose" },
|
||||||
@@ -50,7 +51,7 @@ export const Premium: Story = {
|
|||||||
render: (args: BannerComponent) => ({
|
render: (args: BannerComponent) => ({
|
||||||
props: args,
|
props: args,
|
||||||
template: `
|
template: `
|
||||||
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)">
|
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)" [showClose]=showClose>
|
||||||
Content Really Long Text Lorem Ipsum Ipsum Ipsum
|
Content Really Long Text Lorem Ipsum Ipsum Ipsum
|
||||||
<button bitLink linkType="contrast">Button</button>
|
<button bitLink linkType="contrast">Button</button>
|
||||||
</bit-banner>
|
</bit-banner>
|
||||||
@@ -82,3 +83,10 @@ export const Danger: Story = {
|
|||||||
bannerType: "danger",
|
bannerType: "danger",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const HideClose: Story = {
|
||||||
|
...Premium,
|
||||||
|
args: {
|
||||||
|
showClose: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user