@stories-js/core
Version:
Stories web components to build stories
69 lines • 1.86 kB
JavaScript
/*!
* (C) StoriesJS https://storiesjs.org - GPL-2.0 License
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Component, Host, h, Element, Prop } from '@stencil/core';
export class Tab {
constructor() {
/** @internal */
this.active = false;
}
render() {
const { tab, active } = this;
return (h(Host, { "aria-hidden": !active ? 'true' : null, "aria-labelledby": `tab-button-${tab}`, class: {
'stories-page': true,
'tab-hidden': !active
}, role: "tabpanel" },
h("slot", null)));
}
static get is() { return "stories-tab"; }
static get encapsulation() { return "shadow"; }
static get originalStyleUrls() { return {
"$": ["tab.scss"]
}; }
static get styleUrls() { return {
"$": ["tab.css"]
}; }
static get properties() { return {
"active": {
"type": "boolean",
"mutable": true,
"complexType": {
"original": "boolean",
"resolved": "boolean",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [{
"name": "internal",
"text": undefined
}],
"text": ""
},
"attribute": "active",
"reflect": false,
"defaultValue": "false"
},
"tab": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": true,
"optional": false,
"docs": {
"tags": [],
"text": "A tab id must be provided for each `stories-tab`. It's used internally to reference\nthe selected tab or by the router to switch between them."
},
"attribute": "tab",
"reflect": false
}
}; }
static get elementRef() { return "el"; }
}
//# sourceMappingURL=tab.js.map