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:
2026-11-17 09:08:39 +02:00
co-authored by Claude Opus 5.5
parent d8c3a6c57c
commit beb53c65bb
41 changed files with 798 additions and 585 deletions
+25 -24
View File
@@ -7,6 +7,7 @@ import useOrderingSettingsStore from '../store/orderingSettingsStore'
import usePaymentSettingsStore from '../store/paymentSettingsStore'
import useWaiterFavoritesStore from '../store/waiterFavoritesStore'
import { useTranslation } from '@xenia/i18n'
import { fade } from '../logic/colour'
const CHIP_STYLE_OPTIONS = [
{ key: 'full', label: 'settings.chips.full', example: 'orders.chips.pending' },
@@ -135,15 +136,15 @@ function Grid1Detail() {
<svg viewBox="0 0 56 48" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ width: '100%', height: '100%' }}>
<rect x="2" y="4" width="52" height="20" rx="2" fill="currentColor" opacity="0.9"/>
{/* left section lines */}
<rect x="5" y="8" width="14" height="3" rx="1" fill="white" opacity="0.6"/>
<rect x="5" y="13" width="9" height="2" rx="1" fill="white" opacity="0.4"/>
<rect x="5" y="18" width="11" height="2" rx="1" fill="white" opacity="0.4"/>
<rect x="5" y="8" width="14" height="3" rx="1" fill="var(--x-on-colour)" opacity="0.6"/>
<rect x="5" y="13" width="9" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.4"/>
<rect x="5" y="18" width="11" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.4"/>
{/* vertical divider */}
<rect x="22" y="7" width="1" height="14" rx="0.5" fill="white" opacity="0.3"/>
<rect x="22" y="7" width="1" height="14" rx="0.5" fill="var(--x-on-colour)" opacity="0.3"/>
{/* right section lines */}
<rect x="25" y="8" width="24" height="2" rx="1" fill="white" opacity="0.5"/>
<rect x="25" y="12" width="20" height="2" rx="1" fill="white" opacity="0.35"/>
<rect x="25" y="16" width="22" height="2" rx="1" fill="white" opacity="0.25"/>
<rect x="25" y="8" width="24" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.5"/>
<rect x="25" y="12" width="20" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.35"/>
<rect x="25" y="16" width="22" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.25"/>
<rect x="2" y="29" width="52" height="15" rx="2" fill="currentColor" opacity="0.45"/>
</svg>
)
@@ -192,7 +193,7 @@ function LayoutTab() {
display: 'flex', alignItems: 'center', gap: 14,
padding: '12px 16px', borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -232,7 +233,7 @@ function LayoutTab() {
padding: '14px 16px',
borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)' + '18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer',
textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
@@ -292,7 +293,7 @@ function LayoutTab() {
flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 6,
padding: '14px 12px', borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -320,7 +321,7 @@ function LayoutTab() {
display: 'flex', alignItems: 'center', gap: 14,
padding: '12px 16px', borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -362,7 +363,7 @@ function LayoutTab() {
display: 'flex', alignItems: 'center', gap: 14,
padding: '12px 16px', borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -403,7 +404,7 @@ function LayoutTab() {
padding: '18px 12px',
borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)' + '18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: active ? 'default' : 'pointer',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -458,7 +459,7 @@ function ToggleRow({ label, desc, checked, onChange }) {
display: 'flex', alignItems: 'center', gap: 14,
width: '100%', padding: '14px 16px', borderRadius: 14,
border: `2px solid ${checked ? 'var(--accent)' : 'var(--border)'}`,
background: checked ? 'var(--accent)18' : 'var(--bg2)',
background: checked ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -469,8 +470,8 @@ function ToggleRow({ label, desc, checked, onChange }) {
}}>
<div style={{
position: 'absolute', top: 3, left: checked ? 23 : 3,
width: 18, height: 18, borderRadius: '50%', background: 'white',
transition: 'left 0.2s', boxShadow: '0 1px 4px rgba(0,0,0,0.3)',
width: 18, height: 18, borderRadius: '50%', background: 'var(--x-on-colour)',
transition: 'left 0.2s', boxShadow: '0 1px 4px rgb(var(--x-scrim-rgb) / 0.3)',
}} />
</div>
<div style={{ flex: 1 }}>
@@ -523,7 +524,7 @@ function LeitourgiaTab() {
display: 'flex', alignItems: 'center', gap: 14,
padding: '12px 16px', borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -597,7 +598,7 @@ function LeitourgiaTab() {
display: 'flex', alignItems: 'center', gap: 14,
padding: '12px 16px', borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -656,11 +657,11 @@ function PersonalizeTab() {
display: 'flex', alignItems: 'center', gap: 14,
width: '100%', padding: '14px 16px', borderRadius: 14,
border: '2px solid var(--accent)',
background: 'var(--accent)18',
background: fade('var(--accent)', 0.09),
cursor: 'pointer', textAlign: 'left',
}}
>
<svg width="22" height="22" viewBox="0 0 24 24" fill="#ef4444" stroke="#ef4444" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<svg width="22" height="22" viewBox="0 0 24 24" fill="var(--x-danger)" stroke="var(--x-danger)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
</svg>
<div style={{ flex: 1 }}>
@@ -690,7 +691,7 @@ function PersonalizeTab() {
display: 'flex', alignItems: 'center', gap: 12,
width: '100%', padding: '14px 16px', borderRadius: 14,
border: `2px solid ${confirmReset ? 'var(--danger)' : 'var(--border)'}`,
background: confirmReset ? 'var(--danger-dim, #fee2e2)' : 'var(--bg2)',
background: confirmReset ? 'var(--danger-dim, var(--x-danger-soft))' : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.15s, background 0.15s',
}}
@@ -939,7 +940,7 @@ function PloigisiTab() {
display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 6,
padding: '14px 12px', borderRadius: 14,
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
background: active ? 'var(--accent)18' : 'var(--bg2)',
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
cursor: 'pointer', textAlign: 'left',
transition: 'border-color 0.12s, background 0.12s',
}}
@@ -983,7 +984,7 @@ function PloigisiTab() {
display: 'flex', alignItems: 'center', gap: 12,
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
border: '2px solid var(--accent)',
background: 'var(--accent)18',
background: fade('var(--accent)', 0.09),
cursor: 'grab', userSelect: 'none',
opacity: triDragging === item.key ? 0.4 : 1,
transition: 'opacity 0.1s',
@@ -1084,7 +1085,7 @@ function PloigisiTab() {
display: 'flex', alignItems: 'center', gap: 12,
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
border: `2px solid var(--accent)`,
background: 'var(--accent)18',
background: fade('var(--accent)', 0.09),
cursor: 'grab',
userSelect: 'none',
opacity: dragging === item.key ? 0.4 : 1,