feat(statsgrid): integrate dees-tile component for enhanced tile structure and styling
This commit is contained in:
@@ -18,6 +18,7 @@ import '../../00group-utility/dees-icon/dees-icon.js';
|
|||||||
import '../../00group-overlay/dees-contextmenu/dees-contextmenu.js';
|
import '../../00group-overlay/dees-contextmenu/dees-contextmenu.js';
|
||||||
import '../../00group-button/dees-button/dees-button.js';
|
import '../../00group-button/dees-button/dees-button.js';
|
||||||
import { themeDefaultStyles } from '../../00theme.js';
|
import { themeDefaultStyles } from '../../00theme.js';
|
||||||
|
import '../../00group-layout/dees-tile/dees-tile.js';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
@@ -179,22 +180,12 @@ export class DeesStatsGrid extends DeesElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tile Base Styles */
|
/* Tile Base Styles — frame provided by dees-tile, hover via ::part */
|
||||||
.stats-tile {
|
.stats-tile::part(outer) {
|
||||||
background: ${cssManager.bdTheme('#ffffff', '#09090b')};
|
|
||||||
border: 1px solid ${cssManager.bdTheme('#e0e0e0', '#202020')};
|
|
||||||
border-radius: var(--border-radius);
|
|
||||||
padding: var(--tile-padding);
|
|
||||||
transition: all var(--transition-duration) ease;
|
transition: all var(--transition-duration) ease;
|
||||||
cursor: default;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-tile:hover {
|
.stats-tile:hover::part(outer) {
|
||||||
background: ${cssManager.bdTheme('#fafafa', '#0d0d0d')};
|
|
||||||
border-color: ${cssManager.bdTheme('#d0d0d0', '#2a2a2a')};
|
border-color: ${cssManager.bdTheme('#d0d0d0', '#2a2a2a')};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,17 +193,18 @@ export class DeesStatsGrid extends DeesElement {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-tile.clickable:hover {
|
.stats-tile.clickable:hover::part(outer) {
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
box-shadow: 0 2px 6px ${cssManager.bdTheme('rgba(0,0,0,0.03)', 'rgba(0,0,0,0.15)')};
|
box-shadow: 0 2px 6px ${cssManager.bdTheme('rgba(0,0,0,0.03)', 'rgba(0,0,0,0.15)')};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tile Header */
|
/* Tile Header — slotted into dees-tile header */
|
||||||
.tile-header {
|
.tile-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start;
|
align-items: center;
|
||||||
margin-bottom: var(--header-spacing);
|
padding: 0 12px;
|
||||||
|
height: 28px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,12 +224,12 @@ export class DeesStatsGrid extends DeesElement {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tile Content */
|
/* Tile Content — slotted into dees-tile content area */
|
||||||
.tile-content {
|
.tile-content {
|
||||||
min-height: var(--content-min-height);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: 1;
|
padding: 12px;
|
||||||
|
min-height: var(--content-min-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tile-value {
|
.tile-value {
|
||||||
@@ -261,9 +253,10 @@ export class DeesStatsGrid extends DeesElement {
|
|||||||
.tile-description {
|
.tile-description {
|
||||||
font-size: var(--label-font-size);
|
font-size: var(--label-font-size);
|
||||||
color: ${cssManager.bdTheme('hsl(215.4 16.3% 56.9%)', 'hsl(215 20.2% 55.1%)')};
|
color: ${cssManager.bdTheme('hsl(215.4 16.3% 56.9%)', 'hsl(215 20.2% 55.1%)')};
|
||||||
margin-top: var(--description-spacing);
|
|
||||||
letter-spacing: -0.01em;
|
letter-spacing: -0.01em;
|
||||||
flex-shrink: 0;
|
padding: 0 12px;
|
||||||
|
height: 24px;
|
||||||
|
line-height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gauge Styles */
|
/* Gauge Styles */
|
||||||
@@ -882,13 +875,13 @@ export class DeesStatsGrid extends DeesElement {
|
|||||||
const columnSpan = tile.columnSpan && tile.columnSpan > 1 ? tile.columnSpan : undefined;
|
const columnSpan = tile.columnSpan && tile.columnSpan > 1 ? tile.columnSpan : undefined;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div
|
<dees-tile
|
||||||
class="stats-tile ${clickable ? 'clickable' : ''}"
|
class="stats-tile ${clickable ? 'clickable' : ''}"
|
||||||
style="${columnSpan ? `grid-column: span ${columnSpan}` : ''}"
|
style="${columnSpan ? `grid-column: span ${columnSpan}` : ''}"
|
||||||
@click=${clickable ? () => this.handleTileAction(tile.actions![0], tile) : undefined}
|
@click=${clickable ? () => this.handleTileAction(tile.actions![0], tile) : undefined}
|
||||||
@contextmenu=${hasActions ? (e: MouseEvent) => this.showContextMenu(e, tile) : undefined}
|
@contextmenu=${hasActions ? (e: MouseEvent) => this.showContextMenu(e, tile) : undefined}
|
||||||
>
|
>
|
||||||
<div class="tile-header">
|
<div slot="header" class="tile-header">
|
||||||
<h3 class="tile-title">${tile.title}</h3>
|
<h3 class="tile-title">${tile.title}</h3>
|
||||||
${tile.icon ? html`
|
${tile.icon ? html`
|
||||||
<dees-icon class="tile-icon" .icon=${tile.icon} size="small"></dees-icon>
|
<dees-icon class="tile-icon" .icon=${tile.icon} size="small"></dees-icon>
|
||||||
@@ -900,9 +893,9 @@ export class DeesStatsGrid extends DeesElement {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
${tile.description && tile.type !== 'trend' ? html`
|
${tile.description && tile.type !== 'trend' ? html`
|
||||||
<div class="tile-description">${tile.description}</div>
|
<div slot="footer" class="tile-description">${tile.description}</div>
|
||||||
` : ''}
|
` : ''}
|
||||||
</div>
|
</dees-tile>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,16 +116,16 @@ export class DeesTile extends DeesElement {
|
|||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<div class="tile-outer">
|
<div class="tile-outer" part="outer">
|
||||||
<div class="tile-header">
|
<div class="tile-header" part="header">
|
||||||
<slot name="header">
|
<slot name="header">
|
||||||
<div class="tile-heading">${this.heading}</div>
|
<div class="tile-heading">${this.heading}</div>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="tile-content ${!this.hasFooter ? 'no-footer' : ''}">
|
<div class="tile-content ${!this.hasFooter ? 'no-footer' : ''}" part="content">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="tile-footer ${!this.hasFooter ? 'hidden' : ''}">
|
<div class="tile-footer ${!this.hasFooter ? 'hidden' : ''}" part="footer">
|
||||||
<slot name="footer" @slotchange=${this.onFooterSlotChange}></slot>
|
<slot name="footer" @slotchange=${this.onFooterSlotChange}></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user