-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
index.ts
34 lines (28 loc) · 965 Bytes
/
index.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
import { html, LitElement } from 'lit'
import { property } from 'lit/decorators.js'
import '../../components/wui-text/index.js'
import { resetStyles } from '../../utils/ThemeUtil.js'
import { customElement } from '../../utils/WebComponentsUtil.js'
import styles from './styles.js'
@customElement('wui-separator')
export class WuiSeparator extends LitElement {
public static override styles = [resetStyles, styles]
// -- State & Properties -------------------------------- //
@property() public text? = ''
// -- Render -------------------------------------------- //
public override render() {
return html`${this.template()}`
}
// -- Private ------------------------------------------- //
private template() {
if (this.text) {
return html`<wui-text variant="small-500" color="fg-200">${this.text}</wui-text>`
}
return null
}
}
declare global {
interface HTMLElementTagNameMap {
'wui-separator': WuiSeparator
}
}