- Waiter: Bookings (side drawer, for whoever has connect_orders.manage or reservations.manage, with the online-orders app on): requests made online are confirmed or declined with a reason the guest sees; confirmed ones are seated at a free table (its seats shown, a warning mark when the party is bigger) or cancelled / marked as a no-show; the food ordered ahead and its kitchen time; live updates. - Backend: the bookings routes take reservations.manage too (require_any). - @xenia/ui ReasonPicker + reasonText (gallery, unit test), first piece moved from the terminal (4.6 → 4.8): the counter's online reject and booking decline dialogs use it; the waiter loads @xenia/ui styles.css (the .x-* components; tokens as before). - Tests: waiter e2e +2 (request listed with the key, confirmed and seated from the phone); terminal.mjs and qr_table.mjs green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
331 lines
20 KiB
CSS
331 lines
20 KiB
CSS
/*
|
|
* @xenia/ui component styles. Uses only the tokens (tokens.css) and .x-* classes:
|
|
* no element selectors and no resets, so loading it never restyles an app's own screens.
|
|
* Text inherits the app's font; sizes and colours come from the tokens.
|
|
*/
|
|
|
|
.x-visually-hidden {
|
|
position: absolute !important;
|
|
width: 1px; height: 1px; padding: 0; margin: -1px;
|
|
overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
|
|
}
|
|
|
|
.x-dialog, .x-sheet, .x-toast, .x-input, .x-select__control { color-scheme: var(--x-color-scheme); }
|
|
|
|
/* ── Spinner ─────────────────────────────────────────────────────────────── */
|
|
.x-spinner { display: inline-flex; flex-shrink: 0; color: currentColor; }
|
|
.x-spinner svg { width: 100%; height: 100%; animation: x-spin 0.8s linear infinite; }
|
|
.x-spinner--sm { width: 16px; height: 16px; }
|
|
.x-spinner--md { width: 24px; height: 24px; }
|
|
.x-spinner--lg { width: 40px; height: 40px; }
|
|
@keyframes x-spin { to { transform: rotate(360deg); } }
|
|
@media (prefers-reduced-motion: reduce) { .x-spinner svg { animation-duration: 2.4s; } }
|
|
|
|
/* ── Button ──────────────────────────────────────────────────────────────── */
|
|
.x-btn {
|
|
display: inline-flex; align-items: center; justify-content: center; gap: var(--x-space-2);
|
|
box-sizing: border-box;
|
|
min-height: var(--x-control-md); padding: 0 var(--x-space-4);
|
|
border: 1px solid transparent; border-radius: var(--x-radius-control);
|
|
font: inherit; font-size: var(--x-text-body); line-height: var(--x-leading-body); font-weight: var(--x-weight-semibold);
|
|
white-space: nowrap; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
|
|
transition: background-color var(--x-duration-fast) var(--x-ease), border-color var(--x-duration-fast) var(--x-ease),
|
|
color var(--x-duration-fast) var(--x-ease), transform var(--x-duration-fast) var(--x-ease);
|
|
}
|
|
.x-btn:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
|
.x-btn:active:not(:disabled) { transform: scale(0.98); }
|
|
.x-btn:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
.x-btn[aria-busy="true"] { opacity: 0.8; cursor: progress; }
|
|
.x-btn > svg { flex-shrink: 0; }
|
|
|
|
.x-btn--sm { min-height: var(--x-control-sm); padding: 0 var(--x-space-3); font-size: var(--x-text-label); }
|
|
.x-btn--lg { min-height: var(--x-control-lg); padding: 0 var(--x-space-6); font-size: var(--x-text-body-lg); }
|
|
.x-btn--block { display: flex; width: 100%; }
|
|
|
|
.x-btn--primary { background: var(--x-accent); color: var(--x-accent-fg); }
|
|
.x-btn--primary:hover:not(:disabled) { background: var(--x-accent-strong); }
|
|
.x-btn--secondary { background: var(--x-surface); color: var(--x-ink); border-color: var(--x-line-strong); }
|
|
.x-btn--secondary:hover:not(:disabled) { background: var(--x-surface-2); }
|
|
.x-btn--ghost { background: transparent; color: var(--x-ink-2); }
|
|
.x-btn--ghost:hover:not(:disabled) { background: var(--x-surface-2); color: var(--x-ink); }
|
|
.x-btn--danger { background: var(--x-danger); color: var(--x-danger-fg); }
|
|
.x-btn--danger:hover:not(:disabled) { background: rgb(var(--x-danger-rgb) / 0.88); }
|
|
|
|
.x-btn--icon { padding: 0; width: var(--x-control-md); }
|
|
.x-btn--icon.x-btn--sm { width: var(--x-control-sm); }
|
|
.x-btn--icon.x-btn--lg { width: var(--x-control-lg); }
|
|
|
|
/* ── Overlay, Dialog, Sheet ──────────────────────────────────────────────── */
|
|
.x-overlay {
|
|
position: fixed; inset: 0; z-index: var(--x-z-overlay);
|
|
display: flex; align-items: center; justify-content: center;
|
|
padding: var(--x-space-4);
|
|
background: rgb(var(--x-scrim-rgb) / 0.5);
|
|
animation: x-fade-in var(--x-duration-base) var(--x-ease);
|
|
}
|
|
.x-overlay--bottom { align-items: flex-end; padding: 0; }
|
|
.x-overlay--right { justify-content: flex-end; align-items: stretch; padding: 0; }
|
|
|
|
.x-dialog, .x-sheet {
|
|
display: flex; flex-direction: column;
|
|
box-sizing: border-box; max-height: 100%;
|
|
background: var(--x-surface); color: var(--x-ink);
|
|
box-shadow: var(--x-shadow-overlay);
|
|
outline: none;
|
|
}
|
|
.x-dialog {
|
|
width: 100%; max-height: calc(100vh - 2 * var(--x-space-4));
|
|
border-radius: var(--x-radius-dialog);
|
|
animation: x-pop-in var(--x-duration-base) var(--x-ease);
|
|
}
|
|
.x-dialog--sm { max-width: 400px; }
|
|
.x-dialog--md { max-width: 520px; }
|
|
.x-dialog--lg { max-width: 720px; }
|
|
|
|
.x-sheet--bottom {
|
|
width: 100%; max-width: 640px; max-height: 90vh;
|
|
border-radius: var(--x-radius-dialog) var(--x-radius-dialog) 0 0;
|
|
padding-bottom: env(safe-area-inset-bottom);
|
|
animation: x-slide-up var(--x-duration-base) var(--x-ease);
|
|
}
|
|
.x-sheet--right {
|
|
width: min(480px, 100vw); height: 100%;
|
|
border-radius: var(--x-radius-dialog) 0 0 var(--x-radius-dialog);
|
|
animation: x-slide-left var(--x-duration-base) var(--x-ease);
|
|
}
|
|
.x-sheet__grip {
|
|
width: 40px; height: 4px; margin: var(--x-space-2) auto 0;
|
|
border-radius: var(--x-radius-full); background: var(--x-line-strong);
|
|
}
|
|
|
|
.x-modal__header {
|
|
display: flex; align-items: flex-start; gap: var(--x-space-3);
|
|
padding: var(--x-space-5) var(--x-space-5) var(--x-space-2) var(--x-space-6);
|
|
}
|
|
.x-modal__titles { flex: 1; min-width: 0; padding-top: var(--x-space-1-5); }
|
|
.x-modal__title { margin: 0; font-size: var(--x-text-title); line-height: var(--x-leading-title); font-weight: var(--x-weight-semibold); }
|
|
.x-modal__description { margin: var(--x-space-1) 0 0; font-size: var(--x-text-body); line-height: var(--x-leading-body); color: var(--x-ink-2); }
|
|
.x-modal__close { margin: calc(-1 * var(--x-space-1)) calc(-1 * var(--x-space-1)) 0 0; }
|
|
.x-modal__body {
|
|
flex: 1; min-height: 0; overflow-y: auto;
|
|
padding: var(--x-space-2) var(--x-space-6) var(--x-space-6);
|
|
font-size: var(--x-text-body); line-height: var(--x-leading-body); color: var(--x-ink-2);
|
|
}
|
|
.x-modal__footer {
|
|
display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--x-space-2);
|
|
padding: var(--x-space-4) var(--x-space-6);
|
|
border-top: 1px solid var(--x-line);
|
|
}
|
|
.x-modal__header + .x-modal__footer { border-top: 0; }
|
|
|
|
@keyframes x-fade-in { from { opacity: 0; } }
|
|
@keyframes x-pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
|
|
@keyframes x-slide-up { from { transform: translateY(100%); } }
|
|
@keyframes x-slide-left { from { transform: translateX(100%); } }
|
|
|
|
/* ── Toast ───────────────────────────────────────────────────────────────── */
|
|
.x-toasts {
|
|
position: fixed; z-index: var(--x-z-toast);
|
|
display: flex; flex-direction: column; gap: var(--x-space-2);
|
|
width: min(380px, calc(100vw - 2 * var(--x-space-4)));
|
|
pointer-events: none;
|
|
}
|
|
.x-toasts--top-right { top: var(--x-space-4); right: var(--x-space-4); }
|
|
.x-toasts--top-center { top: var(--x-space-4); left: 50%; transform: translateX(-50%); }
|
|
.x-toasts--bottom-center {
|
|
bottom: calc(var(--x-space-4) + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
|
|
flex-direction: column-reverse;
|
|
}
|
|
.x-toast {
|
|
position: relative; overflow: hidden;
|
|
display: flex; align-items: flex-start; gap: var(--x-space-3);
|
|
padding: var(--x-space-3) var(--x-space-2) var(--x-space-3) var(--x-space-4);
|
|
background: var(--x-surface); color: var(--x-ink);
|
|
border: 1px solid var(--x-line); border-radius: var(--x-radius-card);
|
|
box-shadow: var(--x-shadow-popover);
|
|
pointer-events: auto;
|
|
animation: x-pop-in var(--x-duration-base) var(--x-ease);
|
|
}
|
|
.x-toast__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--x-ink-3); }
|
|
.x-toast--success .x-toast__bar { background: var(--x-success); }
|
|
.x-toast--warning .x-toast__bar { background: var(--x-warning); }
|
|
.x-toast--danger .x-toast__bar { background: var(--x-danger); }
|
|
.x-toast--info .x-toast__bar { background: var(--x-info); }
|
|
.x-toast__text { flex: 1; min-width: 0; padding: var(--x-space-0-5) 0; }
|
|
.x-toast__title { font-size: var(--x-text-body); line-height: var(--x-leading-body); font-weight: var(--x-weight-semibold); }
|
|
.x-toast__description { margin-top: var(--x-space-0-5); font-size: var(--x-text-label); line-height: var(--x-leading-label); color: var(--x-ink-2); }
|
|
.x-toast__action, .x-toast__close {
|
|
flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
|
|
min-height: 32px; border: 0; border-radius: var(--x-radius-sm); background: transparent;
|
|
font: inherit; cursor: pointer;
|
|
}
|
|
.x-toast__action { padding: 0 var(--x-space-2); font-size: var(--x-text-label); font-weight: var(--x-weight-semibold); color: var(--x-accent-ink); }
|
|
.x-toast__action:hover { background: var(--x-accent-soft); }
|
|
.x-toast__close { width: 32px; color: var(--x-ink-3); }
|
|
.x-toast__close:hover { background: var(--x-surface-2); color: var(--x-ink); }
|
|
.x-toast__action:focus-visible, .x-toast__close:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
|
|
|
/* ── PinPad ──────────────────────────────────────────────────────────────── */
|
|
.x-pinpad { display: flex; flex-direction: column; align-items: center; gap: var(--x-space-4); color: var(--x-ink); }
|
|
.x-pinpad__title { font-size: var(--x-text-body-lg); line-height: var(--x-leading-body-lg); font-weight: var(--x-weight-semibold); }
|
|
.x-pinpad__dots { display: flex; gap: var(--x-space-3); }
|
|
.x-pinpad__dots--shake { animation: x-shake 0.36s var(--x-ease); }
|
|
.x-pinpad__dot {
|
|
width: 14px; height: 14px; border-radius: var(--x-radius-full);
|
|
border: 2px solid var(--x-line-strong);
|
|
transition: background-color var(--x-duration-fast) var(--x-ease), border-color var(--x-duration-fast) var(--x-ease);
|
|
}
|
|
.x-pinpad__dot--filled { background: var(--x-accent); border-color: var(--x-accent); }
|
|
.x-pinpad__dot--error { border-color: var(--x-danger); }
|
|
.x-pinpad__status { min-height: 20px; display: flex; align-items: center; color: var(--x-ink-3); }
|
|
.x-pinpad__error { font-size: var(--x-text-label); line-height: var(--x-leading-label); color: var(--x-danger-ink); }
|
|
.x-pinpad__keys { display: grid; grid-template-columns: repeat(3, 72px); gap: var(--x-space-3); }
|
|
.x-pinpad__key {
|
|
height: 60px; border: 0; border-radius: var(--x-radius-card);
|
|
background: var(--x-surface-2); color: var(--x-ink);
|
|
font: inherit; font-size: var(--x-text-heading); font-weight: var(--x-weight-medium);
|
|
display: flex; align-items: center; justify-content: center;
|
|
cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
|
|
transition: background-color var(--x-duration-fast) var(--x-ease), transform var(--x-duration-fast) var(--x-ease);
|
|
}
|
|
.x-pinpad__key:hover:not(:disabled) { background: var(--x-surface-3); }
|
|
.x-pinpad__key:active:not(:disabled) { transform: scale(0.95); }
|
|
.x-pinpad__key:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
|
.x-pinpad__key:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
.x-pinpad__key--backspace { background: transparent; color: var(--x-ink-2); }
|
|
.x-pinpad__key--submit { background: var(--x-accent); color: var(--x-accent-fg); }
|
|
.x-pinpad__key--submit:hover:not(:disabled) { background: var(--x-accent-strong); }
|
|
@keyframes x-shake {
|
|
20% { transform: translateX(-8px); } 40% { transform: translateX(7px); }
|
|
60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
|
|
}
|
|
|
|
/* ── InfoTip ─────────────────────────────────────────────────────────────── */
|
|
.x-infotip {
|
|
display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
|
|
width: 24px; height: 24px; margin: -4px 0; padding: 0;
|
|
border: 0; border-radius: var(--x-radius-full); background: transparent;
|
|
color: var(--x-ink-3); cursor: pointer; -webkit-tap-highlight-color: transparent;
|
|
}
|
|
.x-infotip:hover, .x-infotip--open { color: var(--x-accent); background: var(--x-accent-soft); }
|
|
.x-infotip:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
|
.x-infotip__popover {
|
|
position: fixed; z-index: var(--x-z-popover);
|
|
box-sizing: border-box; max-width: min(320px, calc(100vw - 16px));
|
|
padding: var(--x-space-2-5) var(--x-space-3);
|
|
background: var(--x-ink); color: var(--x-canvas);
|
|
border-radius: var(--x-radius-sm); box-shadow: var(--x-shadow-popover);
|
|
font-size: var(--x-text-label); line-height: var(--x-leading-label); font-weight: var(--x-weight-regular);
|
|
animation: x-fade-in var(--x-duration-fast) var(--x-ease);
|
|
}
|
|
.x-infotip__popover::after {
|
|
content: ""; position: absolute; left: var(--x-arrow-x, 50%);
|
|
width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg);
|
|
}
|
|
.x-infotip__popover--above::after { bottom: -4px; }
|
|
.x-infotip__popover--below::after { top: -4px; }
|
|
|
|
/* ── EmptyState ──────────────────────────────────────────────────────────── */
|
|
.x-empty {
|
|
display: flex; flex-direction: column; align-items: center; text-align: center;
|
|
padding: var(--x-space-12) var(--x-space-6); color: var(--x-ink-2);
|
|
}
|
|
.x-empty--compact { padding: var(--x-space-6) var(--x-space-4); }
|
|
.x-empty__icon {
|
|
display: flex; align-items: center; justify-content: center;
|
|
width: 48px; height: 48px; margin-bottom: var(--x-space-3);
|
|
border-radius: var(--x-radius-card); background: var(--x-surface-2); color: var(--x-ink-3);
|
|
}
|
|
.x-empty__icon svg { width: 24px; height: 24px; }
|
|
.x-empty__title { font-size: var(--x-text-body-lg); line-height: var(--x-leading-body-lg); font-weight: var(--x-weight-semibold); color: var(--x-ink); }
|
|
.x-empty__description { max-width: 360px; margin-top: var(--x-space-1); font-size: var(--x-text-body); line-height: var(--x-leading-body); }
|
|
.x-empty__action { margin-top: var(--x-space-4); }
|
|
|
|
/* ── Field, Input, Select ────────────────────────────────────────────────── */
|
|
.x-field { display: flex; flex-direction: column; gap: var(--x-space-1-5); }
|
|
.x-field__label-row { display: flex; align-items: center; gap: var(--x-space-1); }
|
|
.x-field__label { font-size: var(--x-text-label); line-height: var(--x-leading-label); font-weight: var(--x-weight-medium); color: var(--x-ink); }
|
|
.x-field__required { color: var(--x-danger-ink); }
|
|
.x-field__hint { font-size: var(--x-text-caption); line-height: var(--x-leading-caption); color: var(--x-ink-3); }
|
|
.x-field__error { font-size: var(--x-text-caption); line-height: var(--x-leading-caption); color: var(--x-danger-ink); }
|
|
|
|
.x-input, .x-select__control {
|
|
box-sizing: border-box; width: 100%;
|
|
min-height: var(--x-control-md); padding: 0 var(--x-space-3);
|
|
background: var(--x-surface); color: var(--x-ink);
|
|
border: 1px solid var(--x-line-strong); border-radius: var(--x-radius-control);
|
|
font: inherit; font-size: var(--x-text-body-lg); /* 16px: phones don't zoom in on focus */
|
|
transition: border-color var(--x-duration-fast) var(--x-ease), box-shadow var(--x-duration-fast) var(--x-ease);
|
|
}
|
|
.x-input::placeholder { color: var(--x-ink-3); }
|
|
.x-input:hover:not(:disabled), .x-select__control:hover:not(:disabled) { border-color: var(--x-ink-3); }
|
|
.x-input:focus, .x-select__control:focus { outline: none; border-color: var(--x-accent); box-shadow: var(--x-focus-ring); }
|
|
.x-input:disabled, .x-select__control:disabled { background: var(--x-surface-2); color: var(--x-ink-3); cursor: not-allowed; }
|
|
.x-input[aria-invalid="true"], .x-select__control[aria-invalid="true"] { border-color: var(--x-danger); }
|
|
.x-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(var(--x-danger-rgb) / 0.3); }
|
|
.x-input--sm, .x-select--sm .x-select__control { min-height: var(--x-control-sm); font-size: var(--x-text-body); }
|
|
.x-input--lg, .x-select--lg .x-select__control { min-height: var(--x-control-lg); }
|
|
.x-textarea { padding: var(--x-space-2-5) var(--x-space-3); resize: vertical; min-height: 88px; }
|
|
|
|
.x-select { position: relative; display: block; }
|
|
.x-select__control { appearance: none; -webkit-appearance: none; padding-right: var(--x-space-10); cursor: pointer; }
|
|
.x-select__chevron { position: absolute; right: var(--x-space-3); top: 50%; transform: translateY(-50%); color: var(--x-ink-3); pointer-events: none; }
|
|
|
|
/* ── Stepper ─────────────────────────────────────────────────────────────── */
|
|
.x-stepper { display: inline-flex; align-items: center; gap: var(--x-space-1-5); flex-shrink: 0; }
|
|
.x-stepper__btn {
|
|
display: inline-flex; align-items: center; justify-content: center;
|
|
width: var(--x-control-md); height: var(--x-control-md); padding: 0;
|
|
border: 1px solid var(--x-line-strong); border-radius: var(--x-radius-control);
|
|
background: var(--x-surface-2); color: var(--x-ink); cursor: pointer;
|
|
transition: background-color var(--x-duration-fast) var(--x-ease);
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
.x-stepper__btn:hover:not(:disabled) { background: var(--x-surface-3); }
|
|
.x-stepper__btn:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
|
.x-stepper__btn:disabled { color: var(--x-ink-3); opacity: 0.5; cursor: default; }
|
|
.x-stepper__value {
|
|
min-width: 64px; text-align: center; font-family: var(--x-font-mono);
|
|
font-size: var(--x-text-body-lg); font-weight: var(--x-weight-bold); color: var(--x-ink);
|
|
}
|
|
|
|
/* ── Switch ──────────────────────────────────────────────────────────────── */
|
|
.x-switch {
|
|
position: relative; flex-shrink: 0;
|
|
width: 44px; height: 26px; padding: 0;
|
|
border: 0; border-radius: var(--x-radius-full);
|
|
background: var(--x-ink-3); cursor: pointer; /* off track: 3:1 against the surface (contrast test) */
|
|
transition: background-color var(--x-duration-base) var(--x-ease);
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
.x-switch::before { content: ""; position: absolute; inset: -9px 0; } /* 44px touch target */
|
|
.x-switch__thumb {
|
|
position: absolute; top: 3px; left: 3px;
|
|
width: 20px; height: 20px; border-radius: var(--x-radius-full);
|
|
background: #fff; box-shadow: var(--x-shadow-raised);
|
|
transition: transform var(--x-duration-base) var(--x-ease);
|
|
}
|
|
.x-switch--on { background: var(--x-accent); }
|
|
.x-switch--on .x-switch__thumb { transform: translateX(18px); }
|
|
.x-switch:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
|
.x-switch:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
|
|
.x-switch-row { display: flex; align-items: center; gap: var(--x-space-4); }
|
|
.x-switch-row__text { flex: 1; min-width: 0; }
|
|
.x-switch-row__label { display: block; font-size: var(--x-text-body); line-height: var(--x-leading-body); font-weight: var(--x-weight-medium); color: var(--x-ink); cursor: pointer; }
|
|
.x-switch-row__description { margin-top: var(--x-space-0-5); font-size: var(--x-text-label); line-height: var(--x-leading-label); color: var(--x-ink-2); }
|
|
.x-switch-row--disabled .x-switch-row__label { cursor: not-allowed; opacity: 0.6; }
|
|
|
|
/* ── ReasonPicker ───────────────────────────────────────────────────────────── */
|
|
.x-reasons { display: grid; gap: var(--x-space-2); }
|
|
.x-reasons__list { display: grid; gap: var(--x-space-1); }
|
|
.x-reasons__option {
|
|
min-height: var(--x-control-md); padding: 0 var(--x-space-3);
|
|
border: 0; border-radius: var(--x-radius-control); text-align: left;
|
|
font: inherit; font-size: var(--x-text-body); color: var(--x-ink); background: var(--x-surface-2);
|
|
cursor: pointer; transition: background-color var(--x-duration-fast) var(--x-ease);
|
|
}
|
|
.x-reasons__option:hover { background: var(--x-surface-3); }
|
|
.x-reasons__option:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
|
.x-reasons__option--on, .x-reasons__option--on:hover { background: var(--x-accent); color: var(--x-accent-fg); }
|