-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathindex.ts
35 lines (28 loc) · 1.09 KB
/
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
35
import { LitElement, html } from 'lit'
import { property } from 'lit/decorators.js'
import { ifDefined } from 'lit/directives/if-defined.js'
import '../../components/wui-text/index.js'
import { elementStyles, resetStyles } from '../../utils/ThemeUtil.js'
import { customElement } from '../../utils/WebComponentsUtil.js'
import styles from './styles.js'
@customElement('wui-list-button')
export class WuiListButton extends LitElement {
public static override styles = [resetStyles, elementStyles, styles]
// -- State & Properties -------------------------------- //
@property() public text = ''
@property({ type: Boolean }) public disabled = false
@property() public tabIdx?: number = undefined
// -- Render -------------------------------------------- //
public override render() {
return html`
<button ?disabled=${this.disabled} tabindex=${ifDefined(this.tabIdx)}>
<wui-text align="center" variant="paragraph-500" color="inherit">${this.text}</wui-text>
</button>
`
}
}
declare global {
interface HTMLElementTagNameMap {
'wui-list-button': WuiListButton
}
}