-
Notifications
You must be signed in to change notification settings - Fork 2
/
toast.ts
41 lines (35 loc) · 1.16 KB
/
toast.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { html } from 'lit';
import { styles as shared } from './themes/shared/toast.common.css.js';
import { all } from './themes/themes.js';
import { styles } from './themes/toast.base.css.js';
import { addAnimationController } from '../../animations/player.js';
import { themes } from '../../theming/theming-decorator.js';
import { registerComponent } from '../common/definitions/register.js';
import { IgcBaseAlertLikeComponent } from '../common/mixins/alert.js';
/**
* A toast component is used to show a notification
*
* @element igc-toast
*
* @csspart base - The base wrapper of the toast.
*/
@themes(all)
export default class IgcToastComponent extends IgcBaseAlertLikeComponent {
public static readonly tagName = 'igc-toast';
public static override styles = [styles, shared];
protected override _animationPlayer: ReturnType<
typeof addAnimationController
> = addAnimationController(this);
/* blazorSuppress */
public static register() {
registerComponent(this);
}
protected override render() {
return html`<slot .inert=${!this.open}></slot>`;
}
}
declare global {
interface HTMLElementTagNameMap {
'igc-toast': IgcToastComponent;
}
}