carbon-custom-elements
Version:
A Carbon Design System variant that's as easy to use as native HTML elements, with no framework tax, no framework silo.
1 lines • 1.59 kB
Source Map (JSON)
{"version":3,"sources":["components/ui-shell/header-nav.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;AAKxE;;;GAGG;AACH,cACM,WAAY,SAAQ,UAAU;IAClC;;OAEG;IAEH,YAAY,EAAG,MAAM,CAAC;IAEtB,iBAAiB;IAOjB,MAAM;IAUN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,WAAW,CAAC","file":"header-nav.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2020\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport styles from './header.scss';\n\nconst { prefix } = settings;\n\n/**\n * Header.\n * @element bx-header-nav\n */\n@customElement(`${prefix}-header-nav`)\nclass BXHeaderNav extends LitElement {\n /**\n * The `aria-label` attribute for the menu bar UI.\n */\n @property({ attribute: 'menu-bar-label' })\n menuBarLabel!: string;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'navigation');\n }\n super.connectedCallback();\n }\n\n render() {\n const { menuBarLabel } = this;\n return html`\n <div class=\"${prefix}-ce--header__divider\"></div>\n <ul role=\"menubar\" class=\"${prefix}--header__menu-bar\" aria-label=\"${menuBarLabel}\">\n <slot></slot>\n </ul>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXHeaderNav;\n"]}