feat(statuspage): refactor shared styles and modernize components for consistent theming, spacing and APIs

This commit is contained in:
2025-12-23 09:26:37 +00:00
parent 891eb04d11
commit ed9728dd4a
24 changed files with 4177 additions and 3542 deletions

View File

@@ -1,6 +1,6 @@
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, shadows } from '../styles/shared.styles.js';
import * as sharedStyles from '../styles/shared.styles.js';
import { demoFunc } from './upl-statuspage-header.demo.js';
declare global {
@@ -16,19 +16,19 @@ export class UplStatuspageHeader extends DeesElement {
// INSTANCE
@property({ type: String })
public pageTitle: string = "Statuspage Title";
accessor pageTitle: string = "Statuspage Title";
@property({ type: Boolean })
public showReportButton: boolean = true;
accessor showReportButton: boolean = true;
@property({ type: Boolean })
public showSubscribeButton: boolean = true;
accessor showSubscribeButton: boolean = true;
@property({ type: String })
public logoUrl: string = '';
accessor logoUrl: string = '';
@property({ type: Boolean })
public loading: boolean = false;
accessor loading: boolean = false;
constructor() {
@@ -39,136 +39,193 @@ export class UplStatuspageHeader extends DeesElement {
domtools.elementBasic.staticStyles,
css`
:host {
display: block;
background: ${cssManager.bdTheme('#ffffff', '#0a0a0a')};
font-family: ${unsafeCSS(fonts.base)};
color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
border-bottom: 1px solid ${cssManager.bdTheme('#e5e7eb', '#27272a')};
position: sticky;
top: 0;
z-index: 40;
}
display: block;
background: ${sharedStyles.colors.background.primary};
font-family: ${unsafeCSS(sharedStyles.fonts.base)};
color: ${sharedStyles.colors.text.primary};
border-bottom: 1px solid ${sharedStyles.colors.border.default};
position: sticky;
top: 0;
z-index: 40;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
.header-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 ${unsafeCSS(sharedStyles.spacing.lg)};
}
.header-nav {
display: flex;
align-items: center;
justify-content: space-between;
height: 64px;
}
.header-left {
display: flex;
align-items: center;
gap: ${unsafeCSS(sharedStyles.spacing.lg)};
}
.header-actions {
display: flex;
align-items: center;
gap: ${unsafeCSS(sharedStyles.spacing.sm)};
}
.actionButton {
font-family: ${unsafeCSS(sharedStyles.fonts.base)};
font-size: 13px;
font-weight: 500;
padding: 0 14px;
border-radius: ${unsafeCSS(sharedStyles.borderRadius.base)};
cursor: pointer;
user-select: none;
transition: all ${unsafeCSS(sharedStyles.durations.normal)} ${unsafeCSS(sharedStyles.easings.default)};
display: inline-flex;
align-items: center;
justify-content: center;
height: 36px;
background: transparent;
border: 1px solid ${sharedStyles.colors.border.default};
color: ${sharedStyles.colors.text.primary};
letter-spacing: -0.01em;
}
.actionButton:hover {
background: ${sharedStyles.colors.background.secondary};
border-color: ${sharedStyles.colors.border.muted};
box-shadow: ${unsafeCSS(sharedStyles.shadows.xs)};
}
.actionButton:active {
transform: scale(0.98);
transition-duration: ${unsafeCSS(sharedStyles.durations.fast)};
}
.actionButton:focus-visible {
outline: 2px solid ${sharedStyles.colors.accent.focus};
outline-offset: 2px;
}
.site-title {
font-size: 18px;
font-weight: 600;
letter-spacing: -0.02em;
color: ${sharedStyles.colors.text.primary};
}
.logo {
height: 28px;
width: auto;
filter: ${cssManager.bdTheme('none', 'brightness(0) invert(1)')};
transition: opacity ${unsafeCSS(sharedStyles.durations.normal)} ${unsafeCSS(sharedStyles.easings.default)};
}
.logo:hover {
opacity: 0.8;
}
.page-info {
padding: ${unsafeCSS(sharedStyles.spacing.lg)} 0 ${unsafeCSS(sharedStyles.spacing.xl)} 0;
}
.page-title {
font-size: 48px;
font-weight: 700;
letter-spacing: -0.03em;
line-height: 1.1;
color: ${sharedStyles.colors.text.primary};
margin: 0 0 16px 0;
}
.page-subtitle {
font-size: 18px;
color: ${sharedStyles.colors.text.secondary};
margin: 0;
line-height: 1.5;
}
/* Primary button variant */
.actionButton.primary {
background: ${sharedStyles.colors.accent.primary};
color: ${sharedStyles.colors.background.primary};
border-color: transparent;
}
.actionButton.primary:hover {
background: ${sharedStyles.colors.accent.hover};
box-shadow: ${unsafeCSS(sharedStyles.shadows.sm)};
}
.loading-skeleton {
height: 64px;
background: ${sharedStyles.colors.background.secondary};
border-bottom: 1px solid ${sharedStyles.colors.border.default};
position: relative;
overflow: hidden;
}
.loading-skeleton::after {
content: '';
position: absolute;
inset: 0;
background: ${cssManager.bdTheme(
'linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.04) 50%, transparent 100%)',
'linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%)'
)};
animation: loading 1.5s ${unsafeCSS(sharedStyles.easings.default)} infinite;
}
@keyframes loading {
0% { transform: translateX(-100%); }
100% { transform: translateX(200%); }
}
@media (max-width: 768px) {
.header-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 24px;
padding: 0 ${unsafeCSS(sharedStyles.spacing.md)};
}
.header-nav {
display: flex;
align-items: center;
justify-content: space-between;
height: 64px;
height: 56px;
}
.header-left {
display: flex;
align-items: center;
gap: 24px;
}
.header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.actionButton {
font-size: 14px;
font-weight: 500;
padding: 8px 12px;
border-radius: 6px;
cursor: pointer;
user-select: none;
transition: all 0.2s ease;
display: inline-flex;
align-items: center;
justify-content: center;
height: 36px;
background: transparent;
border: none;
color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
}
.actionButton:hover {
background: ${cssManager.bdTheme('#f4f4f5', '#27272a')};
gap: ${unsafeCSS(sharedStyles.spacing.md)};
}
.site-title {
font-size: 20px;
font-weight: 600;
letter-spacing: -0.02em;
color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
font-size: 16px;
}
.logo {
height: 24px;
width: auto;
filter: ${cssManager.bdTheme('none', 'brightness(0) invert(1)')};
}
.page-info {
padding: 48px 0 64px 0;
}
.page-title {
font-size: 48px;
font-weight: 700;
letter-spacing: -0.02em;
line-height: 1.1;
color: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
margin: 0 0 16px 0;
}
.page-subtitle {
font-size: 20px;
color: ${cssManager.bdTheme('#6b7280', '#a1a1aa')};
margin: 0;
line-height: 1.5;
}
/* Primary button variant */
.actionButton.primary {
background: ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
color: ${cssManager.bdTheme('#ffffff', '#0a0a0a')};
border: 1px solid ${cssManager.bdTheme('#0a0a0a', '#fafafa')};
}
@media (max-width: 640px) {
.actionButton {
font-size: 12px;
padding: 0 12px;
height: 32px;
}
.actionButton.primary:hover {
background: ${cssManager.bdTheme('#262626', '#e5e7eb')};
border-color: ${cssManager.bdTheme('#262626', '#e5e7eb')};
.page-title {
font-size: 32px;
}
.loading-skeleton {
height: 64px;
background: ${cssManager.bdTheme('#f9fafb', '#0a0a0a')};
border-bottom: 1px solid ${cssManager.bdTheme('#e5e7eb', '#27272a')};
.page-subtitle {
font-size: 16px;
}
@media (max-width: 640px) {
.header-nav {
height: 56px;
}
.site-title {
font-size: 18px;
}
.actionButton {
font-size: 13px;
padding: 6px 10px;
height: 32px;
}
.page-title {
font-size: 36px;
}
.page-subtitle {
font-size: 18px;
}
.header-actions {
gap: 6px;
}
}
`
]