-
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 #99 from amir78729/feat/badge-wrapper-jsDoc
docs: add JSDoc to `badge-wrapper` component
- Loading branch information
Showing
4 changed files
with
38 additions
and
15 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
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,4 +1,4 @@ | ||
import { css } from "lit"; | ||
import { css } from 'lit'; | ||
|
||
export default css` | ||
.wrapper { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
import { customElement } from "lit/decorators.js"; | ||
import { BadgeWrapper } from "./badge-wrapper"; | ||
import styles from "./badge-wrapper.style"; | ||
// index.ts | ||
|
||
@customElement("tap-badge-wrapper") | ||
import { customElement } from 'lit/decorators.js'; | ||
import { BadgeWrapper } from './badge-wrapper'; | ||
import styles from './badge-wrapper.style'; | ||
|
||
/** | ||
* ### Example | ||
* | ||
* | ||
* ##### Simple | ||
* | ||
* ```html | ||
* <tap-badge-wrapper> | ||
* <tap-button>Click!</tap-button> | ||
* <tap-badge slot="badge" value="99+"></tap-badge> | ||
* </tap-badge-wrapper> | ||
* ``` | ||
* | ||
* @summary A wrapper component to position a badge relative to its content. | ||
* | ||
* @slot - The default slot for the main content. | ||
* @slot `badge` - The slot for the badge to be positioned. | ||
* | ||
* @csspart `wrapper` - The container that wraps the main content and the badge. | ||
* @csspart `badge` - The container that positions the badge. | ||
*/ | ||
@customElement('tap-badge-wrapper') | ||
export class TapBadgeWrapper extends BadgeWrapper { | ||
static readonly styles = [styles]; | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
"tap-badge-wrapper": TapBadgeWrapper; | ||
'tap-badge-wrapper': TapBadgeWrapper; | ||
} | ||
} |