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 • 2.1 kB
Source Map (JSON)
{"version":3,"sources":["components/ui-shell/header-name.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMxE;;;GAGG;AACH,cACM,YAAa,SAAQ,iBAAsB;IAC/C;;OAEG;IAEH,IAAI,EAAG,MAAM,CAAC;IAEd;;OAEG;IAEH,MAAM,EAAG,MAAM,CAAC;IAEhB,gBAAgB;IAIhB,MAAM;IAYN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,YAAY,CAAC","file":"header-name.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 { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './header.scss';\n\nconst { prefix } = settings;\n\n/**\n * The product name UI in header nav.\n * @element bx-header-name\n */\n@customElement(`${prefix}-header-name`)\nclass BXHeaderName extends FocusMixin(LitElement) {\n /**\n * Link `href`.\n */\n @property()\n href!: string;\n\n /**\n * The product name prefix.\n */\n @property()\n prefix!: string;\n\n createRenderRoot() {\n return this.attachShadow({ mode: 'open', delegatesFocus: true });\n }\n\n render() {\n const { href, prefix: namePrefix } = this;\n const namePrefixPart = !namePrefix\n ? undefined\n : html`\n <span class=\"${prefix}--header__name--prefix\">${namePrefix}</span>\n `;\n return html`\n <a class=\"${prefix}--header__name\" href=\"${ifDefined(href)}\">${namePrefixPart} <slot></slot></a>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXHeaderName;\n"]}