mirror of
https://github.com/material-components/material-web.git
synced 2024-09-11 13:46:10 +03:00
We are changing the names of these files to reduce similarity with CSS modules and avoid clashing with tooling built around that. If you're importing `*/internal/styles.css.js`, swap to `*/internal/styles.js`. PiperOrigin-RevId: 611265000
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
/**
|
||
* @license
|
||
* Copyright 2023 Google LLC
|
||
* SPDX-License-Identifier: Apache-2.0
|
||
*/
|
||
|
||
import {CSSResultOrNative} from 'lit';
|
||
import {customElement} from 'lit/decorators.js';
|
||
|
||
import {Dialog} from './internal/dialog.js';
|
||
import {styles} from './internal/dialog-styles.js';
|
||
|
||
declare global {
|
||
interface HTMLElementTagNameMap {
|
||
'md-dialog': MdDialog;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @summary Dialogs can require an action, communicate information, or help
|
||
* users accomplish a task. There are two types of dialogs: basic and
|
||
* full-screen.
|
||
*
|
||
* @description
|
||
* A dialog is a modal window that appears in front of app content to provide
|
||
* critical information or ask for a decision. Dialogs disable all app
|
||
* functionality when they appear, and remain on screen until confirmed,
|
||
* dismissed, or a required action has been taken.
|
||
*
|
||
* Dialogs are purposefully interruptive, so they should be used sparingly.
|
||
* A less disruptive alternative is to use a menu, which provides options
|
||
* without interrupting a user’s experience.
|
||
*
|
||
* On mobile devices only, complex dialogs should be displayed fullscreen.
|
||
*
|
||
* __Example usages:__
|
||
* - Common use cases for basic dialogs include alerts, quick selection, and
|
||
* confirmation.
|
||
* - More complex dialogs may contain actions that require a series of tasks
|
||
* to complete. One example is creating a calendar entry with the event title,
|
||
* date, location, and time.
|
||
*
|
||
* @final
|
||
* @suppress {visibility}
|
||
*/
|
||
@customElement('md-dialog')
|
||
export class MdDialog extends Dialog {
|
||
static override styles: CSSResultOrNative[] = [styles];
|
||
}
|