Newer
Older
Ekaterina Kondareva
committed
import {Component, Element, h, Host, Prop} from '@stencil/core';
Ekaterina Kondareva
committed
styleUrls: {
default: 'paragraph-text.scss',
content: 'paragraph-text-content.scss',
landing: 'paragraph-text-landing.scss',
},
shadow: false,
Ekaterina Kondareva
committed
@Prop() variant: string;

Ekaterina Kondareva
committed
@Prop() placement: string = 'internal';
Ekaterina Kondareva
committed
@Prop() headerstyle: string = 'default';
@Element() el: HTMLElement;
componentDidLoad() {
let hyMainDiv = this.el.closest('.hy-main');
if (hyMainDiv) {
if (!hyMainDiv.classList.contains('with-sidebar')) {
this.headerstyle = 'wide';
}
}
}

Ekaterina Kondareva
committed
const classAttributes = ['hy-paragraph-text', `${this.variant}`, `${this.placement}`, `${this.headerstyle}`].join(
' '
);
Ekaterina Kondareva
committed
Ekaterina Kondareva
committed
<div class={classAttributes}>
<slot></slot>
</div>
</Host>