import { LitElement, html } from 'lit'; import { customElement, property, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import TabScss from './tab.scss'; /** * Tabs. * @slot unnamed - Slot for tab button text. */ @customElement('kyn-tab') export class Tab extends LitElement { static override styles = TabScss; /** Tab ID, required. */ @property({ type: String, reflect: true }) override id = ''; /** Tab selected state. Must match Tab Panel visible state. */ @property({ type: Boolean, reflect: true }) selected = false; /** Tab disabled state. */ @property({ type: Boolean }) disabled = false; /** Size of the tab buttons. Inherited. * @internal */ @state() private _size = 'md'; /** Vertical orientation. Inherited. * @internal */ @state() private _vertical = false; /** Tab style. Inherited. * @internal */ @state() private _tabStyle = 'contained'; /** aria role. * @internal */ @property({ type: String, reflect: true }) override role = 'tab'; /** Make host tabbable. * @internal */ @property({ type: Number, reflect: true }) override tabIndex = 0; /** aria-controls. * @internal */ @property({ type: String, reflect: true }) 'aria-selected' = 'false'; /** aria-controls. * @internal */ @property({ type: String, reflect: true }) 'aria-controls' = ''; override render() { const classes = { tab: true, contained: this._tabStyle === 'contained', line: this._tabStyle === 'line', 'size--sm': this._size === 'sm', 'size--md': this._size === 'md', // 'size--lg': this._size === 'lg', vertical: this._vertical, selected: this.selected, disabled: this.disabled, }; return html`