feat(ui): board design language as global tokens; KDS on tokens and shared components (platform-v2 3.2b-2)

- @xenia/ui: --x-board-* tokens (the kitchen display's look: dark board, light cards,
  status colours, card radius/shadows, number font), Tailwind board.* colours, contrast
  test for the board pairs; near-identical shades merged.
- New shared Stepper component (gallery + ui.mjs), labels ui.decrease / ui.increase.
- KDS: theme.js maps to the board tokens, no colour literals left (only stored setting
  values); decline / call waiter / settings use Dialog, Button, Switch, Select, Stepper;
  toasts are @xenia/ui toasts (ToastProvider at the terminal root).
- Terminal: apps can set their theme (APP_THEMES, KDS dark) while they run.
- CS-16: board screens and "no hard-coded colours in app code".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 20:02:35 +02:00
co-authored by Claude Opus 5.5
parent 5f6d4ab428
commit 77e0adbe9c
26 changed files with 485 additions and 383 deletions
+13 -13
View File
@@ -9,7 +9,7 @@ const MOD_ICON_SZ = 13
const HOLD_MS = 500
export function ModRow({ Icon, color, text, done, fs }) {
const col = done ? KDS.doneInk : color
const col = done ? KDS.cardMuted : color
const fontSize = Math.round(12 * fs)
const lineH = Math.round(fontSize * 1.4)
const iconSz = Math.round(MOD_ICON_SZ * fs)
@@ -57,13 +57,13 @@ export default function ItemBlock({ item, focused, onBump, onDecline, fontScale
flexShrink: 0, minWidth: badgeH, height: badgeH,
paddingLeft: hasUnit(item.unit_type) ? Math.round(4 * fs) : 0, paddingRight: hasUnit(item.unit_type) ? Math.round(4 * fs) : 0,
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
background: done ? '#f1f2f4' : KDS.qtyBg, color: done ? KDS.doneInk : KDS.qtyInk,
borderRadius: Math.round(5 * fs), fontFamily: 'ui-monospace, monospace', fontWeight: 700, fontSize: Math.round(12 * fs), lineHeight: 1,
background: KDS.cardSoft, color: done ? KDS.cardMuted : KDS.cardInk,
borderRadius: Math.round(5 * fs), fontFamily: KDS.fontMono, fontWeight: 700, fontSize: Math.round(12 * fs), lineHeight: 1,
}}>
{formatQty(item.quantity, item.unit_type)}
</span>
<span style={{
color: done ? KDS.doneInk : KDS.ink, fontSize: nameFontSize, fontWeight, lineHeight: `${nameLineH}px`,
color: done ? KDS.cardMuted : KDS.cardInk, fontSize: nameFontSize, fontWeight, lineHeight: `${nameLineH}px`,
textDecoration: done ? 'line-through' : 'none', textDecorationThickness: 2, flex: '1 1 auto', minWidth: 0,
}}>
{item.product_name}
@@ -71,8 +71,8 @@ export default function ItemBlock({ item, focused, onBump, onDecline, fontScale
{focused && (
<span style={{
flexShrink: 0, width: 8, height: 8, borderRadius: 4, display: 'inline-block', marginTop: Math.round((badgeH - 8) / 2),
background: done ? KDS.green : preparing ? KDS.accent : KDS.qtyBg,
border: `1px solid ${done ? KDS.greenD : preparing ? KDS.accent : '#ccc'}`,
background: done ? KDS.fresh : preparing ? KDS.progress : KDS.cardSoft,
border: `1px solid ${done ? KDS.freshDeep : preparing ? KDS.progress : KDS.cardMuted}`,
}} />
)}
</div>
@@ -80,18 +80,18 @@ export default function ItemBlock({ item, focused, onBump, onDecline, fontScale
<div style={{ marginTop: 3, paddingLeft: badgeH + 7, display: 'flex', flexDirection: 'column', gap: 3 }}>
{combineModifiers ? (
<>
{removed.length > 0 && <ModRow Icon={Minus} color={KDS.redD} text={removed.join(' · ')} done={done} fs={fs} />}
{extras.length > 0 && <ModRow Icon={Plus} color={KDS.greenD} text={extras.join(' · ')} done={done} fs={fs} />}
{prefs.length > 0 && <ModRow Icon={ArrowRight} color={KDS.amberD} text={prefs.join(' · ')} done={done} fs={fs} />}
{removed.length > 0 && <ModRow Icon={Minus} color={KDS.lateDeep} text={removed.join(' · ')} done={done} fs={fs} />}
{extras.length > 0 && <ModRow Icon={Plus} color={KDS.freshDeep} text={extras.join(' · ')} done={done} fs={fs} />}
{prefs.length > 0 && <ModRow Icon={ArrowRight} color={KDS.warningDeep} text={prefs.join(' · ')} done={done} fs={fs} />}
</>
) : (
<>
{removed.map((r, i) => <ModRow key={`r${i}`} Icon={Minus} color={KDS.redD} text={r} done={done} fs={fs} />)}
{extras.map((x, i) => <ModRow key={`e${i}`} Icon={Plus} color={KDS.greenD} text={x} done={done} fs={fs} />)}
{prefs.map((p, i) => <ModRow key={`p${i}`} Icon={ArrowRight} color={KDS.amberD} text={p} done={done} fs={fs} />)}
{removed.map((r, i) => <ModRow key={`r${i}`} Icon={Minus} color={KDS.lateDeep} text={r} done={done} fs={fs} />)}
{extras.map((x, i) => <ModRow key={`e${i}`} Icon={Plus} color={KDS.freshDeep} text={x} done={done} fs={fs} />)}
{prefs.map((p, i) => <ModRow key={`p${i}`} Icon={ArrowRight} color={KDS.warningDeep} text={p} done={done} fs={fs} />)}
</>
)}
{item.notes && <ModRow Icon={Info} color="#3b82f6" text={item.notes} done={done} fs={fs} />}
{item.notes && <ModRow Icon={Info} color={KDS.progress} text={item.notes} done={done} fs={fs} />}
</div>
) : null}
</div>