diff --git a/src/material/tooltip/BUILD.bazel b/src/material/tooltip/BUILD.bazel index f967ddf32d57..17842fa193fc 100644 --- a/src/material/tooltip/BUILD.bazel +++ b/src/material/tooltip/BUILD.bazel @@ -62,7 +62,6 @@ ng_test_library( "//src/cdk/overlay", "//src/cdk/platform", "//src/cdk/testing/private", - "@npm//@angular/animations", "@npm//@angular/platform-browser", "@npm//rxjs", ], diff --git a/src/material/tooltip/tooltip-animations.ts b/src/material/tooltip/tooltip-animations.ts index 652e7f4806f1..8ae83dfd4608 100644 --- a/src/material/tooltip/tooltip-animations.ts +++ b/src/material/tooltip/tooltip-animations.ts @@ -5,14 +5,6 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ -import { - animate, - AnimationTriggerMetadata, - state, - style, - transition, - trigger, -} from '@angular/animations'; /** * Animations used by MatTooltip. @@ -21,15 +13,44 @@ import { * @breaking-change 21.0.0 */ export const matTooltipAnimations: { - readonly tooltipState: AnimationTriggerMetadata; + readonly tooltipState: any; } = { + // Represents: + // trigger('state', [ + // state('initial, void, hidden', style({opacity: 0, transform: 'scale(0.8)'})), + // state('visible', style({transform: 'scale(1)'})), + // transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')), + // transition('* => hidden', animate('75ms cubic-bezier(0.4, 0, 1, 1)')), + // ]) + /** Animation that transitions a tooltip in and out. */ - tooltipState: trigger('state', [ - // TODO(crisbeto): these values are based on MDC's CSS. - // We should be able to use their styles directly once we land #19432. - state('initial, void, hidden', style({opacity: 0, transform: 'scale(0.8)'})), - state('visible', style({transform: 'scale(1)'})), - transition('* => visible', animate('150ms cubic-bezier(0, 0, 0.2, 1)')), - transition('* => hidden', animate('75ms cubic-bezier(0.4, 0, 1, 1)')), - ]), + tooltipState: { + type: 7, + name: 'state', + definitions: [ + { + type: 0, + name: 'initial, void, hidden', + styles: {type: 6, styles: {opacity: 0, transform: 'scale(0.8)'}, offset: null}, + }, + { + type: 0, + name: 'visible', + styles: {type: 6, styles: {transform: 'scale(1)'}, offset: null}, + }, + { + type: 1, + expr: '* => visible', + animation: {type: 4, styles: null, timings: '150ms cubic-bezier(0, 0, 0.2, 1)'}, + options: null, + }, + { + type: 1, + expr: '* => hidden', + animation: {type: 4, styles: null, timings: '75ms cubic-bezier(0.4, 0, 1, 1)'}, + options: null, + }, + ], + options: {}, + }, }; diff --git a/tools/public_api_guard/material/tooltip.md b/tools/public_api_guard/material/tooltip.md index 5ab73d9cf192..ec2d78bf856e 100644 --- a/tools/public_api_guard/material/tooltip.md +++ b/tools/public_api_guard/material/tooltip.md @@ -5,7 +5,6 @@ ```ts import { AfterViewInit } from '@angular/core'; -import { AnimationTriggerMetadata } from '@angular/animations'; import { BooleanInput } from '@angular/cdk/coercion'; import { ConnectedPosition } from '@angular/cdk/overlay'; import { Directionality } from '@angular/cdk/bidi'; @@ -105,7 +104,7 @@ export class MatTooltip implements OnDestroy, AfterViewInit { // @public @deprecated export const matTooltipAnimations: { - readonly tooltipState: AnimationTriggerMetadata; + readonly tooltipState: any; }; // @public