- replace default Onyx surfaces with paper/ink, signal orange and Archivo - make /plan answer peak, staff-hours, cost vs flat and coverage above the fold - add the weekly shift board, shared plan helpers and a pulse line - rebuild /live as a phone-first dark board and /stage as a full-bleed projector - label the real 14-20 Nov window; remove 'next week' claims - keep Onyx components, SSR, live scenario updates and accessible states
This commit is contained in:
1 parent
66b80a62fb
commit
33063afbdf
18 files changed
+4300
-1452
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { LIVE_COLORS, LIVE_LABELS, liveAge } from '#shared/live'
|
||||
import { LIVE_LABELS, liveAge } from '#shared/live'
|
||||
import type { LiveConnection } from '#shared/live'
|
||||
|
||||
const props = withDefaults(
|
||||
@@ -7,31 +7,122 @@ const props = withDefaults(
|
||||
status: LiveConnection
|
||||
lastEventAt?: string
|
||||
compact?: boolean
|
||||
dark?: boolean
|
||||
}>(),
|
||||
{ lastEventAt: '', compact: false },
|
||||
{ lastEventAt: '', compact: false, dark: false },
|
||||
)
|
||||
|
||||
const color = computed(() => LIVE_COLORS[props.status])
|
||||
const label = computed(() => LIVE_LABELS[props.status])
|
||||
const age = computed(() => (props.lastEventAt ? liveAge(props.lastEventAt) : ''))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="live-status" role="status" aria-live="polite" :title="lastEventAt ? `Last event ${age}` : undefined">
|
||||
<OnyxBadge :color="color" :density="compact ? 'compact' : 'default'">{{ label }}</OnyxBadge>
|
||||
<span v-if="lastEventAt && !compact" class="live-status__age">{{ age }}</span>
|
||||
<span
|
||||
class="pc-status"
|
||||
:class="[`pc-status--${status}`, { 'pc-status--compact': compact, 'pc-status--dark': dark }]"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
:title="lastEventAt ? `Last event ${age}` : undefined"
|
||||
>
|
||||
<span class="pc-status__dot" aria-hidden="true" />
|
||||
<span class="pc-status__label">{{ label }}</span>
|
||||
<span v-if="lastEventAt && !compact" class="pc-status__age">{{ age }}</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.live-status {
|
||||
.pc-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
gap: 0.4rem;
|
||||
color: var(--pc-muted, #6e665a);
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.live-status__age {
|
||||
color: var(--onyx-color-text-icons-neutral-soft);
|
||||
font-size: 0.7rem;
|
||||
.pc-status__dot {
|
||||
width: 0.45rem;
|
||||
height: 0.45rem;
|
||||
flex: none;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.pc-status__label {
|
||||
color: var(--pc-ink, #16130f);
|
||||
}
|
||||
|
||||
.pc-status--live .pc-status__dot {
|
||||
background: var(--pc-green, #2e6b4f);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-green, #2e6b4f) 16%, transparent);
|
||||
}
|
||||
|
||||
.pc-status--polling .pc-status__dot {
|
||||
background: var(--pc-signal-text, #b63a00);
|
||||
}
|
||||
|
||||
.pc-status--offline .pc-status__dot {
|
||||
background: var(--pc-danger, #b3261e);
|
||||
}
|
||||
|
||||
.pc-status--connecting .pc-status__dot {
|
||||
background: var(--pc-muted, #6e665a);
|
||||
}
|
||||
|
||||
.pc-status__age {
|
||||
color: var(--pc-muted, #6e665a);
|
||||
font-size: 0.66rem;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.pc-status--compact .pc-status__label {
|
||||
font-size: 0.66rem;
|
||||
}
|
||||
|
||||
.pc-status--dark {
|
||||
color: var(--pc-dark-muted, #b4ae9f);
|
||||
}
|
||||
|
||||
.pc-status--dark .pc-status__label {
|
||||
color: var(--pc-paper, #f4efe6);
|
||||
}
|
||||
|
||||
.pc-status--dark .pc-status__age {
|
||||
color: var(--pc-dark-muted, #b4ae9f);
|
||||
}
|
||||
|
||||
.pc-status--dark.pc-status--live .pc-status__dot {
|
||||
background: var(--pc-green-bright, #5fc99a);
|
||||
box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-green-bright, #5fc99a) 18%, transparent);
|
||||
}
|
||||
|
||||
.pc-status--dark.pc-status--polling .pc-status__dot {
|
||||
background: var(--pc-signal-bright, #ff6a2a);
|
||||
}
|
||||
|
||||
.pc-status--dark.pc-status--offline .pc-status__dot {
|
||||
background: var(--pc-danger-bright, #ff7a6e);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.pc-status--live .pc-status__dot {
|
||||
animation: pc-status-pulse 2.4s ease-in-out infinite;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pc-status-pulse {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.55;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user