@scania/tegel
Version:
Tegel Design System
26 lines (21 loc) • 1.56 kB
JavaScript
;
var index = require('./index-DGsdvbvx.js');
var inheritAriaAttributes = require('./inheritAriaAttributes-D_xFGssc.js');
require('./inheritAttributes-CGw91JfB.js');
const headerLauncherButtonCss = () => `:host{display:block}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:all 0.2s ease-in-out}`;
const TdsHeaderLauncherButton = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
/** If the button should appear active. Can be used when the button is
* triggering a dropdown, and the dropdown is open, for example. */
this.active = false;
}
render() {
this.ariaAttributes = Object.assign(Object.assign({}, this.ariaAttributes), inheritAriaAttributes.inheritAriaAttributes(this.host));
const buttonProps = Object.assign({}, this.ariaAttributes);
return (index.h(index.Host, { key: 'b8f411243958b59899d67a8d991a1ffca34a82d0' }, index.h("tds-header-item", { key: '025b3aa6d6eee7f9cdb6c19cc672ab9df149741e', active: this.active }, index.h("button", Object.assign({ key: '7571c417caba3e5a472f58a893f6033c4102ae09' }, buttonProps, { "aria-label": this.tdsAriaLabel }), index.h("tds-icon", { key: 'f6477e6f48ca3eb5550f92123f0edc90a3f4e108', class: "icon", name: "bento", size: "20px", "svg-title": this.tdsAriaLabel })))));
}
get host() { return index.getElement(this); }
};
TdsHeaderLauncherButton.style = headerLauncherButtonCss();
exports.tds_header_launcher_button = TdsHeaderLauncherButton;