feat(waiter): the look on the shared tokens; the venue's colour (platform-v2 step 4.6)
- The waiter's --bg/--text/--accent… are made of @xenia/ui tokens: light / dark (user menu) and the venue's accent reach every screen; the 751 colour literals in waiter_pwa/src became tokens (by hue family and lightness), hex-alpha suffixes became fade() (color-mix), fixing 'var(--accent)18' tints that never showed. - @xenia/ui: new `special` (violet: offers, discounts, deals; contrast-tested) and `on-colour` tokens. - Setting venue.theme (teal | amber | blue | violet | rose, default amber), bootstrap venue.theme, manager Settings → Venue → Colour; the waiter sets data-venue-theme and the theme before the first render. - Guard tests/no-colours.test.mjs; tests/e2e/waiter_look.mjs (every page light + dark, side-by-side compare page); waiter e2e +3; backend test_venue_theme.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -104,14 +104,14 @@ function BreakRow({ brk, index }) {
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '10px 14px', borderRadius: 10,
|
||||
background: active ? 'rgba(251,146,60,0.1)' : 'var(--bg2)',
|
||||
border: `1px solid ${active ? '#f97316' : 'var(--border)'}`,
|
||||
background: active ? 'rgb(var(--x-warning-rgb) / 0.1)' : 'var(--bg2)',
|
||||
border: `1px solid ${active ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||
}}>
|
||||
<div style={{
|
||||
width: 28, height: 28, borderRadius: 8, flexShrink: 0,
|
||||
background: active ? '#f97316' : 'var(--bg3)',
|
||||
background: active ? 'var(--x-warning)' : 'var(--bg3)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
fontSize: 12, fontWeight: 700, color: active ? 'white' : 'var(--muted)',
|
||||
fontSize: 12, fontWeight: 700, color: active ? 'var(--x-warning-fg)' : 'var(--muted)',
|
||||
}}>{index + 1}</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div style={{ fontSize: 13, fontWeight: 600, color: 'var(--text)' }}>
|
||||
@@ -124,7 +124,7 @@ function BreakRow({ brk, index }) {
|
||||
{active && (
|
||||
<span style={{
|
||||
fontSize: 10, fontWeight: 700, padding: '3px 8px', borderRadius: 999,
|
||||
background: '#f97316', color: 'white',
|
||||
background: 'var(--x-warning)', color: 'var(--x-warning-fg)',
|
||||
}}>{t('venues.active')}</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -212,13 +212,13 @@ export default function ShiftOverviewPage() {
|
||||
margin: '0 0 16px',
|
||||
padding: '12px 16px',
|
||||
borderRadius: 12,
|
||||
background: 'rgba(251,146,60,0.12)',
|
||||
border: '1px solid #f97316',
|
||||
background: 'rgb(var(--x-warning-rgb) / 0.12)',
|
||||
border: '1px solid var(--x-warning)',
|
||||
display: 'flex', alignItems: 'center', gap: 10,
|
||||
}}>
|
||||
<span style={{ fontSize: 20 }}>☕</span>
|
||||
<div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: '#f97316' }}>{t('shiftPage.onBreak')}</div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: 'var(--x-warning)' }}>{t('shiftPage.onBreak')}</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 1 }}>
|
||||
{t('shiftPage.breakSince', { time: fmtTime(activeBreak.started_at), duration: fmtDuration(breakDurationSeconds(activeBreak)) })}
|
||||
</div>
|
||||
@@ -232,7 +232,7 @@ export default function ShiftOverviewPage() {
|
||||
<StatCard label={t('shiftPage.worked')} value={fmtDuration(workedSec)} sub={t('shiftPage.breaksSub', { duration: fmtDuration(totalBreakSec) })} />
|
||||
<StatCard label={t('shiftPage.startCash')} value={fmtEuro(shift.starting_cash)} />
|
||||
{!hideRevenue && (
|
||||
<StatCard label={t('shiftPage.collected')} value={fmtEuro(shift.total_collected)} accent="var(--success, #22c55e)" />
|
||||
<StatCard label={t('shiftPage.collected')} value={fmtEuro(shift.total_collected)} accent="var(--success, var(--x-success))" />
|
||||
)}
|
||||
{!hideRevenue && (
|
||||
<StatCard label={t('shiftPage.toHandIn')} value={fmtEuro(shift.net_to_deliver)} sub={t('shiftPage.toHandInSub')} accent="var(--accent)" />
|
||||
|
||||
Reference in New Issue
Block a user