Skip to content

Commit

Permalink
feat(cxl-ui): add cxl-search-header-item component
Browse files Browse the repository at this point in the history
  • Loading branch information
freudFlintstone committed Aug 1, 2023
1 parent 6e78329 commit 2ca0930
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/cxl-ui/scss/cxl-filter-header-item.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:host {
font-weight: 400;

vaadin-button {
background-color: transparent;
border-radius: var(--lumo-border-radius-s) var(--lumo-border-radius-s) 0 0 ;
margin-bottom: 0;

&::part(label) {
color: var(--lumo-shade);
}
}

.label {
font-weight: 600;
}
}

:host(.checked) {
color: var(--lumo-contrast);

vaadin-button, vaadin-button {
background-color: var(--lumo-primary-color);

&::part(label) {
color: var(--lumo-base-color);
}
}
}
29 changes: 29 additions & 0 deletions packages/cxl-ui/src/components/cxl-filter-header-item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-disable import/no-extraneous-dependencies */
import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import '@vaadin/button';
import cxlFilterHeaderItemStyles from '../styles/cxl-filter-header-item-css.js';

@customElement('cxl-filter-header-item')
export class CXLFilterHeaderItemElement extends LitElement {
static get styles() {
return [cxlFilterHeaderItemStyles];
}

@property({ type: String }) label = '';
@property({ type: String }) value = '';

@property({ type: Number }) count = 0;

@property({ type: Boolean, reflect: true }) checked = false;

render () {
return html`
<vaadin-button>
<span class="label">${this.label}</span>
<span class="count">(${this.count})</span>
</vaadin-button>
`
}
}

0 comments on commit 2ca0930

Please sign in to comment.