import {LitElement, html, unsafeCSS} from 'lit';
import {
customElement,
property,
queryAssignedElements,
state,
} from 'lit/decorators.js';
import iconStyle from './card-list-button.css?inline';
import {classMap} from 'lit/directives/class-map.js';
@customElement('obc-card-list-button')
export class ObcCardListButton extends LitElement {
@property({type: String}) icon = 'placeholder';
@property({type: String}) variant = 'normal';
@queryAssignedElements({slot: 'leading-icon'})
private leadingIcon!: NodeListOf;
@queryAssignedElements({slot: 'trailing-icon'})
private trailingIcon!: NodeListOf;
@state() private hasIconLeading = false;
@state() private hasIconTrailing = false;
override firstUpdated() {
this.hasIconLeading = this.leadingIcon.length > 0;
this.hasIconTrailing = this.trailingIcon.length > 0;
}
override render() {
return html`
`;
}
static override styles = unsafeCSS(iconStyle);
}
declare global {
interface HTMLElementTagNameMap {
'obc-card-list-button': ObcCardListButton;
}
}