feat(ui): @xenia/ui design tokens, Tailwind preset and base components

Platform-v2 step 2.3 (APPS_PLATFORM D-15 §9):
- tokens.css: --x- prefixed colours (light/dark/system + 5 venue accent themes),
  spacing, radius, type scale, shadows, motion, z-index; variables only
- components.css: .x-* classes only, no element selectors (new rule CS-16)
- Button, IconButton, Dialog, Sheet, Toast, PinPad, InfoTip, EmptyState,
  Spinner, Field/Input/Textarea/Select, Switch (accessible: focus trap and
  restore, ARIA wiring, 44px targets)
- tailwind-preset.js (adds names only); manager uses it + styles.css, the
  waiter imports tokens.css; existing screens unchanged
- dev-only /ui-gallery in the manager; e2e suite tests/e2e/ui.mjs; unit tests
  for PIN rules and WCAG AA contrast of every token pair, both in run-all

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 19:33:58 +02:00
co-authored by Claude Opus 5.5
parent c7102f1c89
commit 3580f2815c
36 changed files with 1920 additions and 8 deletions
+23 -3
View File
@@ -1,3 +1,23 @@
// @xenia/ui — Design tokens (CSS variables), the Tailwind preset and base components (plan step 2.3).
// Imported from source by Vite (no build step). Filled in by its plan step.
export {}
// @xenia/ui — design tokens and base components shared by the manager, the terminal
// and the waiter app (APPS_PLATFORM §9, plan step 2.3). Imported from source by Vite.
//
// Styles are separate so an app chooses what to load:
// import '@xenia/ui/tokens.css' CSS variables only (the waiter today)
// import '@xenia/ui/styles.css' tokens + the components' styles (.x-* classes)
// Tailwind apps also add the preset: import xenia from '@xenia/ui/tailwind-preset'.
//
// Components ship English default labels (Close, Loading, Delete…); pass translated
// ones as props until @xenia/i18n exists (2.4).
export { Button, IconButton } from './components/Button.jsx'
export { Dialog } from './components/Dialog.jsx'
export { Sheet } from './components/Sheet.jsx'
export { ToastProvider } from './components/Toast.jsx'
export { useToast } from './components/toastContext.js'
export { PinPad } from './components/PinPad.jsx'
export { InfoTip } from './components/InfoTip.jsx'
export { EmptyState } from './components/EmptyState.jsx'
export { Spinner } from './components/Spinner.jsx'
export { Field, Input, Textarea, Select } from './components/Field.jsx'
export { Switch } from './components/Switch.jsx'
export { cx } from './internal/cx.js'