feat(manager): design pass 1 — every page on <Page>, shared toolbars, fees under Online orders, QR codes under Tables, day stats reworked
From the owner's page-by-page review (2026-11-20): - every page root is <Page> (scrolls, fills 1080p, 16:9 centred on ultrawides); not yet: products, management/tables, stock (next pass) - /dashboard: more padding in cards (p-card), quieter secondary text, 11px uppercase labels everywhere (text-overline) - day stats: xl dialog, "● Day running · Opened …" as text, the six figures in equal boxes, "On tabs" in the payments bar, shared Tabs - /tables: Segmented List / Map / QR codes (?view=; /online/qr redirects), filter chips + zones multi-select at one height, the card itself opens the table (button removed), cards ~20% wider - /online-orders: shared Tabs with Settings (= the old /online/fees page, which redirects to ?tab=settings); orders fill the width - contacts, customers, expenses: PageHeader + Toolbar + SearchInput + multi-select Dropdowns (kinds; statuses, categories); table cells vertically centred; the Spent tip opens on hover - filterCards / filterContacts / filterExpenses take several values (unit tests added) - docs/DESIGN.md: the design language (CS-20 in the pack README) - tests/e2e/manager_layout.mjs: the page rule at 1920x1080 and 3440x1440; manager.mjs and manager_look.mjs follow the moved pages Verified: manager build + lint (0 errors), unit tests (manager 99, ui 24, i18n 31, api 25, access 8), i18n guard, manager_layout.mjs all passed, manager.mjs 228 checks all passed. Not checked: the waiter app and the terminal by eye (they only get the muted ink-2 token). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import toast from 'react-hot-toast'
|
||||
import { ArrowDown, ArrowUp, Download, Info } from 'lucide-react'
|
||||
import { errorMessage } from '@xenia/api'
|
||||
import { useFormat, useTranslation } from '@xenia/i18n'
|
||||
import { Button, EmptyState, InfoTip, Spinner, cx } from '@xenia/ui'
|
||||
import { Button, EmptyState, InfoTip, Page, Spinner, cx } from '@xenia/ui'
|
||||
import client from '../../../api/client'
|
||||
import { sortRows } from './reportLogic'
|
||||
|
||||
@@ -17,8 +17,7 @@ export function ReportPage({ title, tabs = [], children, testId }) {
|
||||
const active = tabs.find(t => t.id === params.get('tab'))?.id ?? tabs[0]?.id
|
||||
const tab = tabs.find(t => t.id === active)
|
||||
return (
|
||||
<div className="h-full overflow-y-auto" data-testid={testId}>
|
||||
<div className="max-w-7xl mx-auto p-4 lg:p-6 grid gap-4">
|
||||
<Page testId={testId}>
|
||||
<header className="flex flex-wrap items-end gap-3">
|
||||
<h1 className="text-title font-semibold text-ink flex-1 min-w-0">{title}</h1>
|
||||
{tabs.length > 1 && (
|
||||
@@ -33,8 +32,7 @@ export function ReportPage({ title, tabs = [], children, testId }) {
|
||||
)}
|
||||
</header>
|
||||
{tab ? <tab.Component key={tab.id} /> : children}
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -43,12 +41,12 @@ export function Panel({ title, tip, actions, children, className, padded = true,
|
||||
return (
|
||||
<section className={cx('rounded-card border border-line bg-surface shadow-raised overflow-hidden', className)} data-testid={testId}>
|
||||
{(title || actions) && (
|
||||
<header className="flex flex-wrap items-center gap-2 px-4 py-3 border-b border-line">
|
||||
<header className="flex flex-wrap items-center gap-2 px-card py-card-y border-b border-line">
|
||||
<h2 className="flex-1 min-w-0 text-body font-semibold text-ink flex items-center gap-1">{title}{tip && <InfoTip>{tip}</InfoTip>}</h2>
|
||||
{actions}
|
||||
</header>
|
||||
)}
|
||||
<div className={padded ? 'p-4' : ''}>{children}</div>
|
||||
<div className={padded ? 'p-card' : ''}>{children}</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -58,8 +56,8 @@ const TONE = { success: 'text-success-ink', danger: 'text-danger-ink', warning:
|
||||
/** A figure: a label over a value, an optional line under it, a tone for the value. */
|
||||
export function Stat({ label, value, sub, tip, tone, big = false, testId }) {
|
||||
return (
|
||||
<div className="rounded-card border border-line bg-surface shadow-raised p-4 grid gap-1 content-start" data-testid={testId}>
|
||||
<span className="text-caption font-semibold uppercase tracking-wide text-ink-3 flex items-center gap-1">{label}{tip && <InfoTip>{tip}</InfoTip>}</span>
|
||||
<div className="rounded-card border border-line bg-surface shadow-raised p-card grid gap-1 content-start" data-testid={testId}>
|
||||
<span className="text-overline font-semibold uppercase tracking-wide text-ink-3 flex items-center gap-1">{label}{tip && <InfoTip>{tip}</InfoTip>}</span>
|
||||
<span className={cx('font-semibold tabular-nums', big ? 'text-display' : 'text-title', TONE[tone] ?? 'text-ink')}>{value}</span>
|
||||
{sub && <span className="text-caption text-ink-2">{sub}</span>}
|
||||
</div>
|
||||
@@ -94,7 +92,7 @@ export function Table({ columns, rows, initialSort, onRow, rowTestId, limit = 20
|
||||
<thead>
|
||||
<tr className="bg-surface-2 text-ink-2">
|
||||
{columns.map(c => (
|
||||
<th key={c.key} className={cx('px-3 py-2 font-semibold whitespace-nowrap', c.align === 'right' ? 'text-right' : 'text-left')}>
|
||||
<th key={c.key} className={cx('px-4 py-2.5 align-middle font-semibold whitespace-nowrap', c.align === 'right' ? 'text-right' : 'text-left')}>
|
||||
{c.sort === false ? c.label : (
|
||||
<button type="button" className="inline-flex items-center gap-1 hover:text-ink" onClick={() => flip(c)}>
|
||||
{c.label}{sort?.key === c.key && (sort.dir === 'desc' ? <ArrowDown size={12} /> : <ArrowUp size={12} />)}
|
||||
@@ -110,7 +108,7 @@ export function Table({ columns, rows, initialSort, onRow, rowTestId, limit = 20
|
||||
<tr key={rowKey(r)} onClick={onRow ? () => onRow(r) : undefined} data-testid={rowTestId}
|
||||
className={cx(onRow && 'cursor-pointer hover:bg-surface-2')}>
|
||||
{columns.map(c => (
|
||||
<td key={c.key} className={cx('px-3 py-2 align-top', c.align === 'right' && 'text-right tabular-nums')}>{c.render ? c.render(r) : r[c.key]}</td>
|
||||
<td key={c.key} className={cx('px-4 py-2.5 align-middle', c.align === 'right' && 'text-right tabular-nums')}>{c.render ? c.render(r) : r[c.key]}</td>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user