-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from amir78729/docs/jsdoc/toast
docs: add JSDoc to `toast` component
- Loading branch information
Showing
4 changed files
with
233 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,64 @@ | ||
import { customElement } from "lit/decorators.js"; | ||
import { Toast } from "./toast"; | ||
import styles from "./toast.style"; | ||
import { LitElement, html } from "lit"; | ||
import { customElement } from 'lit/decorators.js'; | ||
import { Toast } from './toast'; | ||
import styles from './toast.style'; | ||
|
||
@customElement("tap-toast") | ||
/** | ||
* ### Example | ||
* | ||
* | ||
* ##### Simple | ||
* | ||
* ```html | ||
* <tap-toast>Message</tap-toast> | ||
* ``` | ||
* | ||
* ##### Success Variant | ||
* | ||
* ```html | ||
* <tap-toast variant="success">Success message</tap-toast> | ||
* ``` | ||
* | ||
* ##### With Dismiss Button | ||
* | ||
* ```html | ||
* <tap-toast show-dismiss-button>Message with dismiss</tap-toast> | ||
* ``` | ||
* | ||
* @summary A toast notification component. | ||
* | ||
* @prop {`boolean`} [`show-dismiss-button`=`false`] - Indicates whether to show the dismiss button. | ||
* @prop {`'success'` \| `'error'` \| `'info'` \| `'warning'` \| `'inverse'`} [`variant`=`'inverse'`] - The variant of the toast notification. Defaults to `inverse`. | ||
* | ||
* @csspart [`toast`] - The main container for the toast notification. | ||
* @csspart [`icon`] - The container for the icon. | ||
* @csspart [`message`] - The container for the message. | ||
* @csspart [`dismiss`] - The container for the dismiss button. | ||
* | ||
* @cssprop [`--tap-toast-vertical-padding`=`--tap-sys-spacing-5`] - The vertical padding inside the toast. | ||
* @cssprop [`--tap-toast-horizontal-padding`=`--tap-sys-spacing-5`] - The horizontal padding inside the toast. | ||
* @cssprop [`--tap-toast-background-color-default`=`--tap-sys-color-surface-inverse-secondary`] - The default background color of the toast. | ||
* @cssprop [`--tap-toast-color-default`=`--tap-sys-color-content-on-inverse`] - The default text color of the toast. | ||
* @cssprop [`--tap-toast-background-color-success`=`--tap-sys-color-surface-positive`] - The background color of the success variant. | ||
* @cssprop [`--tap-toast-color-success`=`--tap-sys-color-content-on-inverse`] - The text color of the success variant. | ||
* @cssprop [`--tap-toast-background-color-error`=`--tap-sys-color-surface-negative`] - The background color of the error variant. | ||
* @cssprop [`--tap-toast-color-error`=`--tap-sys-color-content-on-inverse`] - The text color of the error variant. | ||
* @cssprop [`--tap-toast-background-color-info`=`--tap-sys-color-surface-accent`] - The background color of the info variant. | ||
* @cssprop [`--tap-toast-color-info`=`--tap-sys-color-content-on-inverse`] - The text color of the info variant. | ||
* @cssprop [`--tap-toast-background-color-warning`=`--tap-sys-color-surface-warning`] - The background color of the warning variant. | ||
* @cssprop [`--tap-toast-color-warning`=`--tap-sys-color-content-primary`] - The text color of the warning variant. | ||
* @cssprop [`--tap-toast-background-color-inverse`=`--tap-sys-color-surface-inverse-secondary`] - The background color of the inverse variant. | ||
* @cssprop [`--tap-toast-color-inverse`=`--tap-sys-color-content-on-inverse`] - The text color of the inverse variant. | ||
* @cssprop [`--tap-toast-dismiss-color`=`'inherit'`] - The color of the dismiss button. | ||
* @cssprop [`--tap-toast-dismiss-background-color`=`transparent`] - The background color of the dismiss button. | ||
* | ||
*/ | ||
@customElement('tap-toast') | ||
export class TapToast extends Toast { | ||
static readonly styles = [styles]; | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"tap-toast": TapToast; | ||
'tap-toast': TapToast; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.