Newer
Older
import {Component, Prop, h} from '@stencil/core';
Markus Kalijärvi
committed
import {ComponentLabels} from '../site-header';
@Component({
tag: 'hy-site-search',
styleUrl: 'site-search.scss',
shadow: true
})
export class SiteSearch {
@Prop() isAlternative: boolean = false;
@Prop() showLabel: boolean = false;
Markus Kalijärvi
committed
@Prop() labels: ComponentLabels[];
@Prop() size: number;
@Prop() color: string;
render() {
return (
<button
Markus Kalijärvi
committed
aria-label={this.labels['open']}
class={{
'button--search': true,
'is-open--menu': this.isAlternative
<hy-icon icon={'hy-icon-search'} size={this.size} fill={this.color} />
Markus Kalijärvi
committed
{this.showLabel ? <span class={'button--search__label'}>{this.labels['label']}</span> : ''}