update
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { DeesElement, property, html, customElement, type TemplateResult, css, cssManager } from '@design.estate/dees-element';
|
||||
import { DeesElement, property, html, customElement, type TemplateResult, css, cssManager, unsafeCSS } from '@design.estate/dees-element';
|
||||
import * as domtools from '@design.estate/dees-domtools';
|
||||
import { fonts } from '../styles/shared.styles.js';
|
||||
import { demoFunc } from './upl-statuspage-header.demo.js';
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
@@ -10,14 +12,30 @@ declare global {
|
||||
@customElement('upl-statuspage-header')
|
||||
export class UplStatuspageHeader extends DeesElement {
|
||||
// STATIC
|
||||
public static demo = () => html`
|
||||
<upl-statuspage-header></upl-statuspage-header>
|
||||
`;
|
||||
public static demo = demoFunc;
|
||||
|
||||
// INSTANCE
|
||||
@property()
|
||||
@property({ type: String })
|
||||
public pageTitle: string = "Statuspage Title";
|
||||
|
||||
@property({ type: Boolean })
|
||||
public showReportButton: boolean = true;
|
||||
|
||||
@property({ type: Boolean })
|
||||
public showSubscribeButton: boolean = true;
|
||||
|
||||
@property({ type: String })
|
||||
public brandColor: string = '';
|
||||
|
||||
@property({ type: String })
|
||||
public logoUrl: string = '';
|
||||
|
||||
@property({ type: Boolean })
|
||||
public customStyles: boolean = false;
|
||||
|
||||
@property({ type: Boolean })
|
||||
public loading: boolean = false;
|
||||
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
@@ -28,70 +46,162 @@ export class UplStatuspageHeader extends DeesElement {
|
||||
css`
|
||||
:host {
|
||||
display: block;
|
||||
background: ${cssManager.bdTheme('#eeeeeb', '#222222')};
|
||||
font-family: Inter;
|
||||
color: ${cssManager.bdTheme('#333333', '#ffffff')};
|
||||
background: ${cssManager.bdTheme('#ffffff', '#0a0a0a')};
|
||||
font-family: ${unsafeCSS(fonts.base)};
|
||||
color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
|
||||
border-bottom: 1px solid ${cssManager.bdTheme('#e5e7eb', '#262626')};
|
||||
}
|
||||
|
||||
.mainbox {
|
||||
margin: auto;
|
||||
max-width: 900px;
|
||||
max-width: 1200px;
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
.mainbox .actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 20px 0px 40px 0px;
|
||||
gap: 8px;
|
||||
padding: 24px 0;
|
||||
}
|
||||
|
||||
.mainbox .actions .actionButton {
|
||||
background: ${cssManager.bdTheme('#00000000', '#ffffff00')};
|
||||
|
||||
font-size: 12px;
|
||||
border: 1px solid ${cssManager.bdTheme('#333', '#CCC')};
|
||||
padding: 6px 10px 7px 10px;
|
||||
margin-left: 10px;
|
||||
border-radius: 3px;
|
||||
background: transparent;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
border: 1px solid ${cssManager.bdTheme('#e5e7eb', '#262626')};
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: all 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 36px;
|
||||
color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
|
||||
}
|
||||
|
||||
.mainbox .actions .actionButton:hover {
|
||||
background: ${cssManager.bdTheme('#333333', '#efefef')};
|
||||
border: 1px solid ${cssManager.bdTheme('#333333', '#efefef')};
|
||||
color: ${cssManager.bdTheme('#fff', '#333333')};
|
||||
background: ${cssManager.bdTheme('#f9fafb', '#262626')};
|
||||
border-color: ${cssManager.bdTheme('#d1d5db', '#404040')};
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.mainbox .actions .actionButton:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.header-content {
|
||||
padding: 48px 0 64px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0px;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 35px;
|
||||
margin: 0;
|
||||
font-size: 48px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.1;
|
||||
color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 0px;
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
font-size: 18px;
|
||||
.subtitle {
|
||||
margin: 16px 0 0 0;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: ${cssManager.bdTheme('#6b7280', '#a1a1aa')};
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
margin: 0 auto 32px;
|
||||
max-width: 180px;
|
||||
height: auto;
|
||||
filter: ${cssManager.bdTheme('none', 'brightness(0) invert(1)')};
|
||||
}
|
||||
|
||||
.loading-skeleton {
|
||||
height: 200px;
|
||||
background: ${cssManager.bdTheme(
|
||||
'linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%)',
|
||||
'linear-gradient(90deg, #1f1f1f 25%, #262626 50%, #1f1f1f 75%)'
|
||||
)};
|
||||
background-size: 200% 100%;
|
||||
animation: loading 1.5s infinite;
|
||||
border-radius: 6px;
|
||||
margin: 24px 0;
|
||||
}
|
||||
|
||||
@keyframes loading {
|
||||
0% { background-position: 200% 0; }
|
||||
100% { background-position: -200% 0; }
|
||||
}
|
||||
|
||||
/* Primary button variant */
|
||||
.actionButton.primary {
|
||||
background: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
|
||||
color: ${cssManager.bdTheme('#ffffff', '#0a0a0a')};
|
||||
border-color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
|
||||
}
|
||||
|
||||
.actionButton.primary:hover {
|
||||
background: ${cssManager.bdTheme('#262626', '#f4f4f5')};
|
||||
border-color: ${cssManager.bdTheme('#262626', '#f4f4f5')};
|
||||
}
|
||||
`
|
||||
]
|
||||
|
||||
public render(): TemplateResult {
|
||||
if (this.loading) {
|
||||
return html`
|
||||
<div class="mainbox">
|
||||
<div class="loading-skeleton"></div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
return html`
|
||||
${domtools.elementBasic.styles}
|
||||
<style>
|
||||
|
||||
${this.customStyles && this.brandColor ? `
|
||||
.mainbox .actions .actionButton {
|
||||
border-color: ${this.brandColor};
|
||||
color: ${this.brandColor};
|
||||
}
|
||||
.mainbox .actions .actionButton:hover {
|
||||
background: ${this.brandColor}10;
|
||||
border-color: ${this.brandColor};
|
||||
}
|
||||
.mainbox .actions .actionButton.primary {
|
||||
background: ${this.brandColor};
|
||||
border-color: ${this.brandColor};
|
||||
color: white;
|
||||
}
|
||||
.mainbox .actions .actionButton.primary:hover {
|
||||
background: ${this.brandColor}dd;
|
||||
border-color: ${this.brandColor}dd;
|
||||
}
|
||||
` : ''}
|
||||
</style>
|
||||
<div class="mainbox">
|
||||
<div class="actions">
|
||||
<div class="actionButton" @click=${this.dispatchReportNewIncident}>report new incident</div>
|
||||
<div class="actionButton" @click=${this.dispatchStatusSubscribe}>subscribe</div>
|
||||
${this.showReportButton ? html`
|
||||
<div class="actionButton" @click=${this.dispatchReportNewIncident}>Report Issue</div>
|
||||
` : ''}
|
||||
${this.showSubscribeButton ? html`
|
||||
<div class="actionButton primary" @click=${this.dispatchStatusSubscribe}>Subscribe</div>
|
||||
` : ''}
|
||||
</div>
|
||||
<div class="header-content">
|
||||
${this.logoUrl ? html`
|
||||
<img src="${this.logoUrl}" alt="Logo" class="logo">
|
||||
` : ''}
|
||||
<h1>${this.pageTitle}</h1>
|
||||
<div class="subtitle">System Status</div>
|
||||
</div>
|
||||
<h1>${this.pageTitle}</h1>
|
||||
<h2>STATUS BOARD</h2>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user