2025-06-19 11:39:16 +00:00
|
|
|
import {
|
|
|
|
customElement,
|
|
|
|
DeesElement,
|
|
|
|
html,
|
|
|
|
css,
|
|
|
|
cssManager,
|
|
|
|
property,
|
|
|
|
type TemplateResult,
|
|
|
|
} from '@design.estate/dees-element';
|
|
|
|
import { demoFunc } from './dees-panel.demo.js';
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
interface HTMLElementTagNameMap {
|
|
|
|
'dees-panel': DeesPanel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@customElement('dees-panel')
|
|
|
|
export class DeesPanel extends DeesElement {
|
|
|
|
public static demo = demoFunc;
|
|
|
|
|
|
|
|
@property({ type: String })
|
|
|
|
public title: string = '';
|
|
|
|
|
|
|
|
@property({ type: String })
|
|
|
|
public subtitle: string = '';
|
|
|
|
|
|
|
|
public static styles = [
|
|
|
|
cssManager.defaultStyles,
|
|
|
|
css`
|
|
|
|
:host {
|
|
|
|
display: block;
|
2025-06-27 11:50:07 +00:00
|
|
|
background: ${cssManager.bdTheme('hsl(0 0% 100%)', 'hsl(215 20.2% 11.8%)')};
|
2025-06-19 11:39:16 +00:00
|
|
|
border-radius: 8px;
|
|
|
|
padding: 24px;
|
2025-06-27 11:50:07 +00:00
|
|
|
border: 1px solid ${cssManager.bdTheme('hsl(214.3 31.8% 91.4%)', 'hsl(215 20.2% 16.8%)')};
|
|
|
|
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
2025-06-19 11:39:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
2025-06-27 11:50:07 +00:00
|
|
|
margin: 0 0 8px 0;
|
2025-06-19 11:39:16 +00:00
|
|
|
font-size: 18px;
|
2025-06-27 11:50:07 +00:00
|
|
|
font-weight: 600;
|
|
|
|
color: ${cssManager.bdTheme('hsl(215.3 25% 8.8%)', 'hsl(210 40% 98%)')};
|
|
|
|
letter-spacing: -0.025em;
|
2025-06-19 11:39:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.subtitle {
|
2025-06-27 11:50:07 +00:00
|
|
|
margin: 0 0 16px 0;
|
2025-06-19 11:39:16 +00:00
|
|
|
font-size: 14px;
|
2025-06-27 11:50:07 +00:00
|
|
|
color: ${cssManager.bdTheme('hsl(215.4 16.3% 56.9%)', 'hsl(215 20.2% 55.1%)')};
|
|
|
|
letter-spacing: -0.01em;
|
2025-06-19 11:39:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
2025-06-27 11:50:07 +00:00
|
|
|
color: ${cssManager.bdTheme('hsl(215.3 25% 8.8%)', 'hsl(210 40% 98%)')};
|
2025-06-19 11:39:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Remove margins from first and last children */
|
|
|
|
.content ::slotted(*:first-child) {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.content ::slotted(*:last-child) {
|
|
|
|
margin-bottom: 0;
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
];
|
|
|
|
|
|
|
|
public render(): TemplateResult {
|
|
|
|
return html`
|
|
|
|
${this.title ? html`<h3 class="title">${this.title}</h3>` : ''}
|
|
|
|
${this.subtitle ? html`<p class="subtitle">${this.subtitle}</p>` : ''}
|
|
|
|
<div class="content">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|