Skip to content

Commit 5d3f43c

Browse files
committed
fix(material/tooltip): remove remaining animation dependencies
Removes the remaning dependencies on `@angular/animations` from the package.
1 parent b20a85a commit 5d3f43c

File tree

3 files changed

+39
-20
lines changed

3 files changed

+39
-20
lines changed

src/material/tooltip/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ ng_test_library(
6262
"//src/cdk/overlay",
6363
"//src/cdk/platform",
6464
"//src/cdk/testing/private",
65-
"@npm//@angular/animations",
6665
"@npm//@angular/platform-browser",
6766
"@npm//rxjs",
6867
],

src/material/tooltip/tooltip-animations.ts

+38-17
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-
AnimationTriggerMetadata,
11-
state,
12-
style,
13-
transition,
14-
trigger,
15-
} from '@angular/animations';
168

179
/**
1810
* Animations used by MatTooltip.
@@ -21,15 +13,44 @@ import {
2113
* @breaking-change 21.0.0
2214
*/
2315
export const matTooltipAnimations: {
24-
readonly tooltipState: AnimationTriggerMetadata;
16+
readonly tooltipState: any;
2517
} = {
18+
// Represents:
19+
// trigger('state', [
20+
// state('initial, void, hidden', style({opacity: 0, transform: 'scale(0.8)'})),
21+
// state('visible', style({transform: 'scale(1)'})),
22+
// transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
23+
// transition('* => hidden', animate('75ms cubic-bezier(0.4, 0, 1, 1)')),
24+
// ])
25+
2626
/** Animation that transitions a tooltip in and out. */
27-
tooltipState: trigger('state', [
28-
// TODO(crisbeto): these values are based on MDC's CSS.
29-
// We should be able to use their styles directly once we land #19432.
30-
state('initial, void, hidden', style({opacity: 0, transform: 'scale(0.8)'})),
31-
state('visible', style({transform: 'scale(1)'})),
32-
transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')),
33-
transition('* => hidden', animate('75ms cubic-bezier(0.4, 0, 1, 1)')),
34-
]),
27+
tooltipState: {
28+
type: 7,
29+
name: 'state',
30+
definitions: [
31+
{
32+
type: 0,
33+
name: 'initial, void, hidden',
34+
styles: {type: 6, styles: {opacity: 0, transform: 'scale(0.8)'}, offset: null},
35+
},
36+
{
37+
type: 0,
38+
name: 'visible',
39+
styles: {type: 6, styles: {transform: 'scale(1)'}, offset: null},
40+
},
41+
{
42+
type: 1,
43+
expr: '* => visible',
44+
animation: {type: 4, styles: null, timings: '150ms cubic-bezier(0, 0, 0.2, 1)'},
45+
options: null,
46+
},
47+
{
48+
type: 1,
49+
expr: '* => hidden',
50+
animation: {type: 4, styles: null, timings: '75ms cubic-bezier(0.4, 0, 1, 1)'},
51+
options: null,
52+
},
53+
],
54+
options: {},
55+
},
3556
};

tools/public_api_guard/material/tooltip.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
```ts
66

77
import { AfterViewInit } from '@angular/core';
8-
import { AnimationTriggerMetadata } from '@angular/animations';
98
import { BooleanInput } from '@angular/cdk/coercion';
109
import { ConnectedPosition } from '@angular/cdk/overlay';
1110
import { Directionality } from '@angular/cdk/bidi';
@@ -105,7 +104,7 @@ export class MatTooltip implements OnDestroy, AfterViewInit {
105104

106105
// @public @deprecated
107106
export const matTooltipAnimations: {
108-
readonly tooltipState: AnimationTriggerMetadata;
107+
readonly tooltipState: any;
109108
};
110109

111110
// @public

0 commit comments

Comments
 (0)