Skip to content

Commit 02ed862

Browse files
committed
fix(material/snack-bar): remove remaining animation dependencies
Removes the remaning dependencies on `@angular/animations` from the package.
1 parent 712d5e2 commit 02ed862

File tree

2 files changed

+63
-37
lines changed

2 files changed

+63
-37
lines changed

src/material/snack-bar/snack-bar-animations.ts

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.dev/license
77
*/
8-
import {
9-
animate,
10-
state,
11-
style,
12-
transition,
13-
trigger,
14-
AnimationTriggerMetadata,
15-
} from '@angular/animations';
168

179
/**
1810
* Animations used by the Material snack bar.
@@ -21,33 +13,68 @@ import {
2113
* @breaking-change 21.0.0
2214
*/
2315
export const matSnackBarAnimations: {
24-
readonly snackBarState: AnimationTriggerMetadata;
16+
readonly snackBarState: any;
2517
} = {
18+
// Represents
19+
// trigger('state', [
20+
// state(
21+
// 'void, hidden',
22+
// style({
23+
// transform: 'scale(0.8)',
24+
// opacity: 0,
25+
// }),
26+
// ),
27+
// state(
28+
// 'visible',
29+
// style({
30+
// transform: 'scale(1)',
31+
// opacity: 1,
32+
// }),
33+
// ),
34+
// transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
35+
// transition(
36+
// '* => void, * => hidden',
37+
// animate(
38+
// '75ms cubic-bezier(0.4, 0.0, 1, 1)',
39+
// style({
40+
// opacity: 0,
41+
// }),
42+
// ),
43+
// ),
44+
// ])
45+
2646
/** Animation that shows and hides a snack bar. */
27-
snackBarState: trigger('state', [
28-
state(
29-
'void, hidden',
30-
style({
31-
transform: 'scale(0.8)',
32-
opacity: 0,
33-
}),
34-
),
35-
state(
36-
'visible',
37-
style({
38-
transform: 'scale(1)',
39-
opacity: 1,
40-
}),
41-
),
42-
transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
43-
transition(
44-
'* => void, * => hidden',
45-
animate(
46-
'75ms cubic-bezier(0.4, 0.0, 1, 1)',
47-
style({
48-
opacity: 0,
49-
}),
50-
),
51-
),
52-
]),
47+
snackBarState: {
48+
type: 7,
49+
name: 'state',
50+
'definitions': [
51+
{
52+
type: 0,
53+
name: 'void, hidden',
54+
styles: {type: 6, styles: {transform: 'scale(0.8)', opacity: 0}, offset: null},
55+
},
56+
{
57+
type: 0,
58+
name: 'visible',
59+
styles: {type: 6, styles: {transform: 'scale(1)', opacity: 1}, offset: null},
60+
},
61+
{
62+
type: 1,
63+
expr: '* => visible',
64+
animation: {type: 4, styles: null, timings: '150ms cubic-bezier(0, 0, 0.2, 1)'},
65+
options: null,
66+
},
67+
{
68+
type: 1,
69+
expr: '* => void, * => hidden',
70+
animation: {
71+
type: 4,
72+
styles: {type: 6, styles: {opacity: 0}, offset: null},
73+
timings: '75ms cubic-bezier(0.4, 0.0, 1, 1)',
74+
},
75+
options: null,
76+
},
77+
],
78+
options: {},
79+
},
5380
};

tools/public_api_guard/material/snack-bar.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
```ts
66

7-
import { AnimationTriggerMetadata } from '@angular/animations';
87
import { AriaLivePoliteness } from '@angular/cdk/a11y';
98
import { BasePortalOutlet } from '@angular/cdk/portal';
109
import { CdkPortalOutlet } from '@angular/cdk/portal';
@@ -76,7 +75,7 @@ export class MatSnackBarActions {
7675

7776
// @public @deprecated
7877
export const matSnackBarAnimations: {
79-
readonly snackBarState: AnimationTriggerMetadata;
78+
readonly snackBarState: any;
8079
};
8180

8281
// @public

0 commit comments

Comments
 (0)