diff --git a/libs/components/src/dialog/animations.ts b/libs/components/src/dialog/animations.ts new file mode 100644 index 00000000000..56f0c971277 --- /dev/null +++ b/libs/components/src/dialog/animations.ts @@ -0,0 +1,11 @@ +import { style, animate, trigger, transition, group } from "@angular/animations"; + +export const fadeIn = trigger("fadeIn", [ + transition(":enter", [ + style({ opacity: 0, transform: "translateY(-50px)" }), + group([ + animate("0.15s linear", style({ opacity: 1 })), + animate("0.3s ease-out", style({ transform: "none" })), + ]), + ]), +]); diff --git a/libs/components/src/dialog/dialog/dialog.component.html b/libs/components/src/dialog/dialog/dialog.component.html index 271d923079e..cce5ad3e267 100644 --- a/libs/components/src/dialog/dialog/dialog.component.html +++ b/libs/components/src/dialog/dialog/dialog.component.html @@ -1,6 +1,7 @@
diff --git a/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts b/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts index 48a4d62c833..fa4e359bce0 100644 --- a/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts +++ b/libs/components/src/dialog/simple-dialog/simple-dialog.component.ts @@ -1,11 +1,14 @@ import { Component, ContentChild, Directive } from "@angular/core"; +import { fadeIn } from "../animations"; + @Directive({ selector: "[bit-dialog-icon]" }) export class IconDirective {} @Component({ selector: "bit-simple-dialog", templateUrl: "./simple-dialog.component.html", + animations: [fadeIn], }) export class SimpleDialogComponent { @ContentChild(IconDirective) icon!: IconDirective;