-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathtooltip.ts
37 lines (32 loc) · 912 Bytes
/
tooltip.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { customElement, html, TemplateResult } from "lit-element";
import { IPopoverProperties, Popover } from "../popover/popover";
import "../popover-card/popover-card";
import { cssResult } from "../util/css";
import styles from "./tooltip.scss";
/**
* Properties of the tooltip.
*/
export interface ITooltipProperties extends IPopoverProperties {}
/**
* Informative context related text.
* @cssprop --tooltip-padding - Padding
* @cssprop --tooltip-bg - Background
* @cssprop --tooltip-color - Color
*/
@customElement("wl-tooltip")
export class Tooltip extends Popover implements ITooltipProperties {
static styles = [...Popover.styles, cssResult(styles)];
/**
* Renders the content.
*/
protected renderContent(): TemplateResult {
return html`
<wl-popover-card><slot></slot></wl-popover-card>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
"wl-tooltip": Tooltip;
}
}