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:
@@ -65,3 +65,20 @@ test('system theme mirrors dark', () => {
|
||||
const darkCanvas = dark.canvas.join(' ')
|
||||
assert.ok(sys.includes(`--x-canvas-rgb: ${darkCanvas};`), 'system dark uses the dark canvas')
|
||||
})
|
||||
|
||||
// The board (kitchen display, 3.2b-2): always dark, so one set. Done items (card-muted) and
|
||||
// empty states (ink-4) are meant to recede and aren't checked.
|
||||
test('board token pairs are readable', () => {
|
||||
const b = Object.fromEntries([...css.matchAll(/--x-board-([\w-]+)-rgb:\s*([\d\s]+);/g)].map(([, k, v]) => [k, v.trim().split(/\s+/).map(Number)]))
|
||||
const boardPairs = [
|
||||
['ink', 'bg', TEXT], ['ink-2', 'bg', TEXT], ['ink-2', 'line', TEXT], ['ink-3', 'rail', TEXT], ['bg', 'tab-active', TEXT],
|
||||
['card-ink', 'card', TEXT], ['card-ink-2', 'card-soft', TEXT], ['note-ink', 'note', TEXT],
|
||||
['late-deep', 'card', TEXT], ['fresh-deep', 'card', TEXT], ['on-status', 'fresh-deep', TEXT], ['on-status', 'late-deep', TEXT],
|
||||
['warning-deep', 'card', UI], ['progress', 'card', UI], ['on-status', 'warning-deep', UI],
|
||||
]
|
||||
for (const [fg, bg, min] of boardPairs) {
|
||||
assert.ok(b[fg] && b[bg], `board tokens ${fg} / ${bg} exist`)
|
||||
const r = ratio(b[fg], b[bg])
|
||||
assert.ok(r >= min, `board ${fg} on ${bg}: ${r.toFixed(2)} < ${min}`)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user