|
1 |
| -import { customElement } from "lit/decorators.js"; |
2 |
| -import { Banner } from "./banner.js"; |
3 |
| -import styles from "./banner.style.js"; |
| 1 | +import { customElement } from 'lit/decorators.js'; |
| 2 | +import { Banner } from './banner.js'; |
| 3 | +import styles from './banner.style.js'; |
4 | 4 |
|
5 |
| -@customElement("tap-banner") |
| 5 | +/** |
| 6 | + * ### Example |
| 7 | + * |
| 8 | + * ##### Simple |
| 9 | + * |
| 10 | + * ```html |
| 11 | + * <tap-banner heading="Welcome!" description="This is a banner."></tap-banner> |
| 12 | + * ``` |
| 13 | + * |
| 14 | + * ##### Hero Variant |
| 15 | + * |
| 16 | + * ```html |
| 17 | + * <tap-banner variant="hero" heading="Hero Banner" description="This is a hero banner."></tap-banner> |
| 18 | + * ``` |
| 19 | + * |
| 20 | + * @summary Display a banner with optional heading, description, and action slot. |
| 21 | + * |
| 22 | + * @prop {`string`} [`heading`] - The heading text to display in the banner. |
| 23 | + * @prop {`string`} [`description`] - The description text to display in the banner. |
| 24 | + * @prop {`string`} [`image`] - The URL of the background image to display in the banner. |
| 25 | + * @prop {`boolean`} [`full-width`=`false`] - Whether the banner should take the full width of its container. |
| 26 | + * @prop {`'default'` \| `'hero'`} [`variant`=`'default'`] - The variant style of the banner. |
| 27 | + * @prop {`string`} [`background-color`] - The background color of the banner. |
| 28 | + * @prop {`string`} [`textColor`] - The text color of the banner. |
| 29 | + * |
| 30 | + * @csspart `banner` - The main banner element. |
| 31 | + * @csspart `content` - The content container inside the banner. |
| 32 | + * @csspart `action` - The action container inside the banner. |
| 33 | + * @csspart `extra` - The extra slot container inside the hero variant. |
| 34 | + * |
| 35 | + * @cssprop [`--tap-sys-spacing-6`] - Spacing around the banner content. |
| 36 | + * @cssprop [`--tap-banner-color-surface`] - Background color of the banner. |
| 37 | + * @cssprop [`--tap-sys-radius-4`] - Border radius of the banner. |
| 38 | + * @cssprop [`--tap-banner-background-image`] - Background image of the banner. |
| 39 | + * @cssprop [`--tap-sys-spacing-4`] - Margin around the banner. |
| 40 | + * @cssprop [`--tap-banner-color-content`] - Text color of the banner. |
| 41 | + * @cssprop [`--tap-sys-typography-headline-xs-font`=`--tap-sys-font-family`] - Font family for the heading text. |
| 42 | + * @cssprop [`--tap-sys-typography-headline-xs-height`] - Line height for the heading text. |
| 43 | + * @cssprop [`--tap-sys-typography-headline-xs-size`] - Font size for the heading text. |
| 44 | + * @cssprop [`--tap-sys-typography-headline-xs-weight`] - Font weight for the heading text. |
| 45 | + * @cssprop [`--tap-sys-spacing-3`] - Margin below the heading text. |
| 46 | + * @cssprop [`--tap-sys-typography-body-xs-font`] - Font family for the description text. |
| 47 | + * @cssprop [`--tap-sys-typography-body-xs-height`] - Line height for the description text. |
| 48 | + * @cssprop [`--tap-sys-typography-body-xs-size`] - Font size for the description text. |
| 49 | + * @cssprop [`--tap-sys-typography-body-xs-weight`] - Font weight for the description text. |
| 50 | + * @cssprop [`--tap-sys-spacing-5`] - Margin above the action slot. |
| 51 | + * @cssprop [`--tap-sys-spacing-8`] - Minimum height of the extra slot in the hero variant. |
| 52 | + */ |
| 53 | +@customElement('tap-banner') |
6 | 54 | export class TapBanner extends Banner {
|
7 | 55 | static readonly styles = [styles];
|
8 | 56 | }
|
9 | 57 |
|
10 | 58 | declare global {
|
11 | 59 | interface HTMLElementTagNameMap {
|
12 |
| - "tap-banner": TapBanner; |
| 60 | + 'tap-banner': TapBanner; |
13 | 61 | }
|
14 | 62 | }
|
0 commit comments