diff --git a/src/badge-wrapper/badge-wrapper.stories.ts b/src/badge-wrapper/badge-wrapper.stories.ts index 08081065..4a5f328c 100644 --- a/src/badge-wrapper/badge-wrapper.stories.ts +++ b/src/badge-wrapper/badge-wrapper.stories.ts @@ -1,11 +1,11 @@ -import { html, TemplateResult } from "lit"; -import "./index.js"; -import "../badge"; -import "../button"; +import { html, TemplateResult } from 'lit'; +import './index.js'; +import '../badge'; +import '../button'; export default { - title: "Badge", - component: "tap-badge-wrapper", + title: 'Badge', + component: 'tap-badge-wrapper', argTypes: {}, }; diff --git a/src/badge-wrapper/badge-wrapper.style.ts b/src/badge-wrapper/badge-wrapper.style.ts index 0c10cefc..8baf61d7 100644 --- a/src/badge-wrapper/badge-wrapper.style.ts +++ b/src/badge-wrapper/badge-wrapper.style.ts @@ -1,4 +1,4 @@ -import { css } from "lit"; +import { css } from 'lit'; export default css` .wrapper { diff --git a/src/badge-wrapper/badge-wrapper.ts b/src/badge-wrapper/badge-wrapper.ts index 8b596934..127c8e95 100644 --- a/src/badge-wrapper/badge-wrapper.ts +++ b/src/badge-wrapper/badge-wrapper.ts @@ -1,11 +1,11 @@ -import { html, LitElement } from "lit"; +import { html, LitElement } from 'lit'; export class BadgeWrapper extends LitElement { render() { return html` - + - + `; } diff --git a/src/badge-wrapper/index.ts b/src/badge-wrapper/index.ts index 29804932..7b9440e5 100644 --- a/src/badge-wrapper/index.ts +++ b/src/badge-wrapper/index.ts @@ -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 + * + * Click! + * + * + * ``` + * + * @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; } }