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
+4
View File
@@ -10,6 +10,7 @@
// The app must also load the tokens: import '@xenia/ui/tokens.css' (or styles.css).
const c = name => `rgb(var(--x-${name}-rgb) / <alpha-value>)`
const BOARD = ['bg', 'rail', 'topbar', 'line', 'deep', 'ink', 'ink-2', 'ink-3', 'ink-4', 'tab-active', 'on-status', 'card', 'card-ink', 'card-ink-2', 'card-muted', 'card-soft', 'card-line', 'card-progress', 'card-done', 'note', 'note-ink', 'fresh', 'fresh-deep', 'warning', 'warning-deep', 'late', 'late-deep', 'done', 'done-deep', 'future', 'future-deep', 'future-glow', 'progress', 'fresh-soft', 'warning-soft', 'late-soft', 'progress-soft']
const tone = name => ({ DEFAULT: c(name), fg: c(`${name}-fg`), soft: c(`${name}-soft`), ink: c(`${name}-ink`) })
/** @type {import('tailwindcss').Config} */
@@ -31,6 +32,8 @@ export default {
warning: tone('warning'),
danger: tone('danger'),
info: tone('info'),
// the board design language (kitchen display): bg-board-bg, text-board-ink-2, bg-board-late…
board: Object.fromEntries(BOARD.map(n => [n, c(`board-${n}`)])),
},
fontSize: {
caption: ['var(--x-text-caption)', { lineHeight: 'var(--x-leading-caption)' }],
@@ -45,6 +48,7 @@ export default {
control: 'var(--x-radius-control)',
card: 'var(--x-radius-card)',
dialog: 'var(--x-radius-dialog)',
'board-card': 'var(--x-board-radius-card)',
},
boxShadow: {
raised: 'var(--x-shadow-raised)',