@bulmil/core
Version:

55 lines (50 loc) • 4.81 kB
JavaScript
/*!
* Bulmil - MIT License
*/
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
const tabsCss = ".tabs{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tabs:not(:last-child){margin-bottom:1.5rem}.tabs{-webkit-overflow-scrolling:touch;-ms-flex-align:stretch;align-items:stretch;display:-ms-flexbox;display:flex;font-size:1rem;-ms-flex-pack:justify;justify-content:space-between;overflow:hidden;overflow-x:auto;white-space:nowrap}.tabs a{-ms-flex-align:center;align-items:center;border-bottom-color:hsl(0, 0%, 86%);border-bottom-style:solid;border-bottom-width:1px;color:hsl(0, 0%, 29%);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin-bottom:-1px;padding:0.5em 1em;vertical-align:top}.tabs a:hover{border-bottom-color:hsl(0, 0%, 21%);color:hsl(0, 0%, 21%)}.tabs li{display:block}.tabs li.is-active a{border-bottom-color:#5851ff;color:#5851ff}.tabs ul{-ms-flex-align:center;align-items:center;border-bottom-color:hsl(0, 0%, 86%);border-bottom-style:solid;border-bottom-width:1px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-pack:start;justify-content:flex-start}.tabs ul.is-left{padding-right:0.75em}.tabs ul.is-center{-ms-flex:none;flex:none;-ms-flex-pack:center;justify-content:center;padding-left:0.75em;padding-right:0.75em}.tabs ul.is-right{-ms-flex-pack:end;justify-content:flex-end;padding-left:0.75em}.tabs .icon:first-child{margin-right:0.5em}.tabs .icon:last-child{margin-left:0.5em}.tabs.is-centered ul{-ms-flex-pack:center;justify-content:center}.tabs.is-right ul{-ms-flex-pack:end;justify-content:flex-end}.tabs.is-boxed a{border:1px solid transparent;border-radius:4px 4px 0 0}.tabs.is-boxed a:hover{background-color:hsl(0, 0%, 96%);border-bottom-color:hsl(0, 0%, 86%)}.tabs.is-boxed li.is-active a{background-color:hsl(0, 0%, 100%);border-color:hsl(0, 0%, 86%);border-bottom-color:transparent !important}.tabs.is-fullwidth li{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0}.tabs.is-toggle a{border-color:hsl(0, 0%, 86%);border-style:solid;border-width:1px;margin-bottom:0;position:relative}.tabs.is-toggle a:hover{background-color:hsl(0, 0%, 96%);border-color:hsl(0, 0%, 71%);z-index:2}.tabs.is-toggle li+li{margin-left:-1px}.tabs.is-toggle li:first-child a{border-top-left-radius:4px;border-bottom-left-radius:4px}.tabs.is-toggle li:last-child a{border-top-right-radius:4px;border-bottom-right-radius:4px}.tabs.is-toggle li.is-active a{background-color:#5851ff;border-color:#5851ff;color:#fff;z-index:1}.tabs.is-toggle ul{border-bottom:none}.tabs.is-toggle.is-toggle-rounded li:first-child a{border-bottom-left-radius:9999px;border-top-left-radius:9999px;padding-left:1.25em}.tabs.is-toggle.is-toggle-rounded li:last-child a{border-bottom-right-radius:9999px;border-top-right-radius:9999px;padding-right:1.25em}.tabs.is-small{font-size:0.75rem}.tabs.is-medium{font-size:1.25rem}.tabs.is-large{font-size:1.5rem}bm-tabs bm-icon:first-child .icon{margin-right:0.5em}bm-tabs bm-icon:last-child .icon{margin-left:0.5em}";
const BmTabsStyle0 = tabsCss;
const Tabs = /*@__PURE__*/ proxyCustomElement(class Tabs extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.size = undefined;
this.alignment = undefined;
this.tabStyle = undefined;
this.isRounded = false;
this.isFullwidth = false;
}
render() {
return (h(Host, { key: 'ec8d54a680d3613b8edf5cb39c89f7a6c1e22b8e' }, h("div", { key: 'a916a0e7427745bdfe73efcf17382490c19438ce', class: {
tabs: true,
[this.size]: Boolean(this.size),
[this.alignment]: Boolean(this.alignment),
[this.tabStyle]: Boolean(this.tabStyle),
'is-fullwidth': this.isFullwidth,
'is-toggle-rounded': this.isRounded && this.tabStyle === 'is-toggle',
} }, h("slot", { key: '2e3a97e9879b7fe6adc30991394ce22382ac19a6' }))));
}
static get style() { return BmTabsStyle0; }
}, [4, "bm-tabs", {
"size": [1],
"alignment": [1],
"tabStyle": [1, "tab-style"],
"isRounded": [4, "is-rounded"],
"isFullwidth": [4, "is-fullwidth"]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["bm-tabs"];
components.forEach(tagName => { switch (tagName) {
case "bm-tabs":
if (!customElements.get(tagName)) {
customElements.define(tagName, Tabs);
}
break;
} });
}
const BmTabs = Tabs;
const defineCustomElement = defineCustomElement$1;
export { BmTabs, defineCustomElement };