feat(waiter): the look on the shared tokens; the venue's colour (platform-v2 step 4.6)
- The waiter's --bg/--text/--accent… are made of @xenia/ui tokens: light / dark (user menu) and the venue's accent reach every screen; the 751 colour literals in waiter_pwa/src became tokens (by hue family and lightness), hex-alpha suffixes became fade() (color-mix), fixing 'var(--accent)18' tints that never showed. - @xenia/ui: new `special` (violet: offers, discounts, deals; contrast-tested) and `on-colour` tokens. - Setting venue.theme (teal | amber | blue | violet | rose, default amber), bootstrap venue.theme, manager Settings → Venue → Colour; the waiter sets data-venue-theme and the theme before the first render. - Guard tests/no-colours.test.mjs; tests/e2e/waiter_look.mjs (every page light + dark, side-by-side compare page); waiter e2e +3; backend test_venue_theme.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import { assetUrl } from '../config/server'
|
||||
import { money } from '../i18n'
|
||||
import { LineError, estimate, wireLine } from '@xenia/api'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
// A cart item whose option is not on the menu any more (4.4: lines go by id)
|
||||
const lineErrorText = (err, t) => t('add.optionGone', { product: err.product, what: err.what })
|
||||
@@ -40,7 +41,7 @@ function GlobalCourseModal({ courses, selected, onSelect, onClose }) {
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '12px 16px',
|
||||
background: c.id === selected ? `${c.color}22` : 'var(--bg3)',
|
||||
background: c.id === selected ? `${fade(c.color, 0.13)}` : 'var(--bg3)',
|
||||
border: `2px solid ${c.id === selected ? c.color : 'var(--border)'}`,
|
||||
borderRadius: 12, cursor: 'pointer', textAlign: 'left',
|
||||
}}
|
||||
@@ -558,7 +559,7 @@ export default function AddItemsPage() {
|
||||
<span style={{
|
||||
position: 'absolute', top: -2, right: -2,
|
||||
minWidth: 18, height: 18, borderRadius: 9,
|
||||
background: '#38bdf8', color: '#000',
|
||||
background: 'var(--x-info)', color: 'rgb(var(--x-scrim-rgb) / 1)',
|
||||
fontSize: 10, fontWeight: 800,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
padding: '0 4px',
|
||||
@@ -583,7 +584,7 @@ export default function AddItemsPage() {
|
||||
<span style={{
|
||||
position: 'absolute', top: -2, right: -2,
|
||||
minWidth: 18, height: 18, borderRadius: 9,
|
||||
background: c.color, color: '#fff',
|
||||
background: c.color, color: 'var(--x-on-colour)',
|
||||
fontSize: 10, fontWeight: 800,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
padding: '0 4px',
|
||||
@@ -679,7 +680,7 @@ export default function AddItemsPage() {
|
||||
return (
|
||||
<div key={item._key} style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<span style={{ fontSize: 12, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', flex: 1 }}>{p?.name ?? `#${item.product_id}`}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 700, color: '#f59e0b', fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>{fmtDraftQty(item.quantity, p?.unit_type)}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 700, color: 'var(--x-warning)', fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>{fmtDraftQty(item.quantity, p?.unit_type)}</span>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
@@ -711,7 +712,7 @@ export default function AddItemsPage() {
|
||||
onClick={() => setCartOpen(false)}
|
||||
style={{
|
||||
position: 'fixed', inset: 0,
|
||||
background: 'rgba(0,0,0,0.55)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.55)',
|
||||
opacity: cartOpen ? 1 : 0,
|
||||
pointerEvents: cartOpen ? 'auto' : 'none',
|
||||
transition: 'opacity 240ms ease',
|
||||
@@ -728,7 +729,7 @@ export default function AddItemsPage() {
|
||||
transition: 'transform 280ms cubic-bezier(0.32, 0.72, 0, 1)',
|
||||
zIndex: 51,
|
||||
display: 'flex', flexDirection: 'column',
|
||||
boxShadow: cartOpen ? '-8px 0 32px rgba(0,0,0,0.4)' : 'none',
|
||||
boxShadow: cartOpen ? '-8px 0 32px rgb(var(--x-scrim-rgb) / 0.4)' : 'none',
|
||||
}}>
|
||||
{/* Drawer header */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '14px 16px', borderBottom: '1px solid var(--border)', flexShrink: 0 }}>
|
||||
@@ -831,7 +832,7 @@ export default function AddItemsPage() {
|
||||
rows={3}
|
||||
style={{
|
||||
width: '100%', resize: 'none', padding: '10px 12px',
|
||||
background: 'rgba(245,158,11,0.07)', border: '1.5px solid rgba(245,158,11,0.35)',
|
||||
background: 'rgb(var(--x-warning-rgb) / 0.07)', border: '1.5px solid rgb(var(--x-warning-rgb) / 0.35)',
|
||||
borderRadius: 10, fontSize: 14, color: 'var(--text)', lineHeight: 1.5,
|
||||
outline: 'none', boxSizing: 'border-box', fontFamily: 'inherit',
|
||||
}}
|
||||
@@ -846,11 +847,11 @@ export default function AddItemsPage() {
|
||||
) : orderNote ? (
|
||||
<div
|
||||
onClick={() => setOrderNoteEditing(true)}
|
||||
style={{ cursor: 'pointer', padding: '9px 12px', background: 'rgba(245,158,11,0.09)', border: '1.5px solid rgba(245,158,11,0.3)', borderRadius: 10, fontSize: 13, color: 'var(--text)', lineHeight: 1.5, whiteSpace: 'pre-wrap', position: 'relative' }}
|
||||
style={{ cursor: 'pointer', padding: '9px 12px', background: 'rgb(var(--x-warning-rgb) / 0.09)', border: '1.5px solid rgb(var(--x-warning-rgb) / 0.3)', borderRadius: 10, fontSize: 13, color: 'var(--text)', lineHeight: 1.5, whiteSpace: 'pre-wrap', position: 'relative' }}
|
||||
>
|
||||
<span style={{ fontSize: 10, fontWeight: 700, color: '#f59e0b', textTransform: 'uppercase', letterSpacing: 0.6, display: 'block', marginBottom: 3 }}>{t('add.note.title')}</span>
|
||||
<span style={{ fontSize: 10, fontWeight: 700, color: 'var(--x-warning)', textTransform: 'uppercase', letterSpacing: 0.6, display: 'block', marginBottom: 3 }}>{t('add.note.title')}</span>
|
||||
{orderNote}
|
||||
<span style={{ position: 'absolute', top: 8, right: 10, fontSize: 11, color: '#f59e0b', fontWeight: 700 }}>✎</span>
|
||||
<span style={{ position: 'absolute', top: 8, right: 10, fontSize: 11, color: 'var(--x-warning)', fontWeight: 700 }}>✎</span>
|
||||
</div>
|
||||
) : (
|
||||
<button
|
||||
@@ -994,25 +995,25 @@ export default function AddItemsPage() {
|
||||
<div style={{
|
||||
position: 'fixed', inset: 0, zIndex: 9999,
|
||||
display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center',
|
||||
background: 'rgba(0,0,0,0.72)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.72)',
|
||||
animation: 'fadeInOverlay 180ms ease',
|
||||
}}>
|
||||
<div style={{
|
||||
background: printAck._offline ? '#451a03' : printAck._pending ? '#1c1917' : '#14532d',
|
||||
border: `2px solid ${printAck._offline ? '#f59e0b' : printAck._pending ? '#f59e0b' : '#22c55e'}`,
|
||||
background: printAck._offline ? 'var(--x-warning-soft)' : printAck._pending ? 'var(--x-canvas)' : 'var(--x-success-soft)',
|
||||
border: `2px solid ${printAck._offline ? 'var(--x-warning)' : printAck._pending ? 'var(--x-warning)' : 'var(--x-success)'}`,
|
||||
borderRadius: 20, padding: '36px 48px',
|
||||
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16,
|
||||
animation: 'popIn 220ms cubic-bezier(0.34,1.56,0.64,1)',
|
||||
}}>
|
||||
<svg width="56" height="56" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="11" stroke={printAck._offline || printAck._pending ? '#f59e0b' : '#22c55e'} strokeWidth="2"/>
|
||||
<circle cx="12" cy="12" r="11" stroke={printAck._offline || printAck._pending ? 'var(--x-warning)' : 'var(--x-success)'} strokeWidth="2"/>
|
||||
{printAck._offline || printAck._pending ? (
|
||||
<path d="M12 8v5M12 16h.01" stroke="#f59e0b" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M12 8v5M12 16h.01" stroke="var(--x-warning)" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
) : (
|
||||
<path d="M7 12.5l3.5 3.5 6.5-7" stroke="#22c55e" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M7 12.5l3.5 3.5 6.5-7" stroke="var(--x-success)" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
)}
|
||||
</svg>
|
||||
<span style={{ color: printAck._offline || printAck._pending ? '#fcd34d' : '#86efac', fontWeight: 700, fontSize: 18, letterSpacing: 0.3 }}>
|
||||
<span style={{ color: printAck._offline || printAck._pending ? 'var(--x-warning)' : 'var(--x-success-ink)', fontWeight: 700, fontSize: 18, letterSpacing: 0.3 }}>
|
||||
{printAck._offline ? t('add.ack.offline') : printAck._pending ? t('add.ack.printing') : t('add.ack.printed')}
|
||||
</span>
|
||||
</div>
|
||||
@@ -1068,14 +1069,14 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
||||
<div style={{
|
||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||
width: 48, height: 48, borderRadius: '50%',
|
||||
background: 'rgba(167,139,250,0.15)', marginBottom: 10,
|
||||
background: 'rgb(var(--x-special-rgb) / 0.15)', marginBottom: 10,
|
||||
}}>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M20 12v10H4V12M22 7H2v5h20V7zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z"
|
||||
stroke="#a78bfa" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
stroke="var(--x-special-ink)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
<h2 style={{ margin: 0, fontSize: 17, fontWeight: 700, color: '#a78bfa' }}>{t('add.deal.title')}</h2>
|
||||
<h2 style={{ margin: 0, fontSize: 17, fontWeight: 700, color: 'var(--x-special-ink)' }}>{t('add.deal.title')}</h2>
|
||||
<p style={{ margin: '6px 0 0', fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>{offer.deal_name}</p>
|
||||
</div>
|
||||
|
||||
@@ -1083,13 +1084,13 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
||||
{isFreeItem && offer.free_item_name && (
|
||||
<div style={{
|
||||
margin: '0 0 16px', padding: '14px 16px',
|
||||
background: 'rgba(34,197,94,0.08)', border: '1.5px solid rgba(34,197,94,0.3)',
|
||||
background: 'rgb(var(--x-success-rgb) / 0.08)', border: '1.5px solid rgb(var(--x-success-rgb) / 0.3)',
|
||||
borderRadius: 12,
|
||||
}}>
|
||||
<p style={{ margin: 0, fontSize: 13, color: 'var(--muted)', marginBottom: 4 }}>{t('add.deal.freeProduct')}</p>
|
||||
<p style={{ margin: 0, fontSize: 15, fontWeight: 700, color: '#4ade80' }}>
|
||||
<p style={{ margin: 0, fontSize: 15, fontWeight: 700, color: 'var(--x-success)' }}>
|
||||
{offer.free_item_name}
|
||||
{offer.free_quantity > 1 && <span style={{ color: '#f59e0b', marginLeft: 6 }}>×{offer.free_quantity}</span>}
|
||||
{offer.free_quantity > 1 && <span style={{ color: 'var(--x-warning)', marginLeft: 6 }}>×{offer.free_quantity}</span>}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -1099,7 +1100,7 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
||||
<div style={{ marginBottom: 16 }}>
|
||||
<p style={{ fontSize: 12, color: 'var(--muted)', marginBottom: 8 }}>
|
||||
{t('add.deal.pickFree', { count: offer.free_quantity ?? 1 })}
|
||||
{remaining > 0 && <span style={{ color: '#a78bfa', marginLeft: 4 }}>{t('add.deal.remaining', { count: remaining })}</span>}
|
||||
{remaining > 0 && <span style={{ color: 'var(--x-special-ink)', marginLeft: 4 }}>{t('add.deal.remaining', { count: remaining })}</span>}
|
||||
</p>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, maxHeight: 220, overflowY: 'auto' }}>
|
||||
{offer.free_choices.map(choice => {
|
||||
@@ -1110,15 +1111,15 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 10,
|
||||
padding: '10px 12px', borderRadius: 10, border: 'none', cursor: disabled ? 'not-allowed' : 'pointer',
|
||||
background: checked ? 'rgba(167,139,250,0.15)' : 'var(--bg3)',
|
||||
background: checked ? 'rgb(var(--x-special-rgb) / 0.15)' : 'var(--bg3)',
|
||||
opacity: disabled ? 0.4 : 1, textAlign: 'left',
|
||||
}}>
|
||||
<div style={{
|
||||
width: 20, height: 20, borderRadius: 5, flexShrink: 0,
|
||||
background: checked ? '#a78bfa' : 'var(--border)',
|
||||
background: checked ? 'var(--x-special-ink)' : 'var(--border)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
}}>
|
||||
{checked && <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="3" strokeLinecap="round"><path d="M20 6L9 17l-5-5"/></svg>}
|
||||
{checked && <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="var(--x-on-colour)" strokeWidth="3" strokeLinecap="round"><path d="M20 6L9 17l-5-5"/></svg>}
|
||||
</div>
|
||||
<span style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>{choice.name}</span>
|
||||
</button>
|
||||
@@ -1132,13 +1133,13 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
||||
{isDiscount && offer.price_before != null && offer.price_after != null && (
|
||||
<div style={{
|
||||
margin: '0 0 16px', padding: '14px 16px',
|
||||
background: 'rgba(34,197,94,0.08)', border: '1.5px solid rgba(34,197,94,0.3)',
|
||||
background: 'rgb(var(--x-success-rgb) / 0.08)', border: '1.5px solid rgb(var(--x-success-rgb) / 0.3)',
|
||||
borderRadius: 12, textAlign: 'center',
|
||||
}}>
|
||||
<span style={{ fontSize: 14, color: 'var(--muted)', textDecoration: 'line-through' }}>
|
||||
{money(offer.price_before)}
|
||||
</span>
|
||||
<span style={{ fontSize: 22, fontWeight: 800, color: '#4ade80', margin: '0 12px' }}>
|
||||
<span style={{ fontSize: 22, fontWeight: 800, color: 'var(--x-success)', margin: '0 12px' }}>
|
||||
{money(offer.price_after)}
|
||||
</span>
|
||||
</div>
|
||||
@@ -1148,7 +1149,7 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
||||
<button className="btn btn--secondary" style={{ flex: 1 }} onClick={onDismiss}>
|
||||
{t('add.deal.skip')}
|
||||
</button>
|
||||
<button className="btn btn--primary" style={{ flex: 1, background: '#7c3aed', borderColor: '#7c3aed' }}
|
||||
<button className="btn btn--primary" style={{ flex: 1, background: 'var(--x-special)', borderColor: 'var(--x-special)' }}
|
||||
onClick={handleAccept} disabled={!canConfirm}>
|
||||
{isFreeItem ? t('add.deal.addFree') : isFreeChoice ? t('common.confirm') : t('common.apply')}
|
||||
</button>
|
||||
@@ -1171,7 +1172,7 @@ function QuickAddToast({ product, count }) {
|
||||
background: 'var(--bg)',
|
||||
border: '1px solid var(--border)',
|
||||
borderRadius: 14,
|
||||
boxShadow: '0 8px 32px rgba(0,0,0,0.35)',
|
||||
boxShadow: '0 8px 32px rgb(var(--x-scrim-rgb) / 0.35)',
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '10px 16px 10px 10px',
|
||||
minWidth: 220, maxWidth: 'min(88vw, 340px)',
|
||||
@@ -1227,11 +1228,11 @@ const SECTION_META = {
|
||||
|
||||
function SectionIcon({ type }) {
|
||||
const icons = {
|
||||
prefs: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="4" fill="#f59e0b"/><circle cx="12" cy="12" r="9" stroke="#f59e0b" strokeWidth="2"/></svg>,
|
||||
quick: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><path d="M5 12h14M13 6l6 6-6 6" stroke="#a3e635" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></svg>,
|
||||
extras: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><path d="M12 5v14M5 12h14" stroke="#60a5fa" strokeWidth="2.5" strokeLinecap="round"/></svg>,
|
||||
removed: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><path d="M5 12h14" stroke="#ef4444" strokeWidth="2.5" strokeLinecap="round"/></svg>,
|
||||
note: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="1.5" fill="#94a3b8"/><path d="M12 7v1M12 16v1" stroke="#94a3b8" strokeWidth="2" strokeLinecap="round"/><circle cx="12" cy="12" r="9" stroke="#94a3b8" strokeWidth="1.5"/></svg>,
|
||||
prefs: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="4" fill="var(--x-warning)"/><circle cx="12" cy="12" r="9" stroke="var(--x-warning)" strokeWidth="2"/></svg>,
|
||||
quick: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><path d="M5 12h14M13 6l6 6-6 6" stroke="var(--x-success)" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></svg>,
|
||||
extras: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><path d="M12 5v14M5 12h14" stroke="var(--x-info)" strokeWidth="2.5" strokeLinecap="round"/></svg>,
|
||||
removed: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><path d="M5 12h14" stroke="var(--x-danger)" strokeWidth="2.5" strokeLinecap="round"/></svg>,
|
||||
note: <svg width="13" height="13" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="1.5" fill="var(--x-ink-2)"/><path d="M12 7v1M12 16v1" stroke="var(--x-ink-2)" strokeWidth="2" strokeLinecap="round"/><circle cx="12" cy="12" r="9" stroke="var(--x-ink-2)" strokeWidth="1.5"/></svg>,
|
||||
}
|
||||
return <span style={{ display: 'inline-flex', alignItems: 'center', flexShrink: 0 }}>{icons[type] ?? null}</span>
|
||||
}
|
||||
@@ -1266,7 +1267,7 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
||||
</div>
|
||||
|
||||
{/* Quantity on the right */}
|
||||
<span style={{ color: '#f59e0b', fontSize: 13, fontWeight: 700, fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>{fmtDraftQty(item.quantity, product?.unit_type)}</span>
|
||||
<span style={{ color: 'var(--x-warning)', fontSize: 13, fontWeight: 700, fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>{fmtDraftQty(item.quantity, product?.unit_type)}</span>
|
||||
|
||||
{/* Edit — stop propagation so it doesn't toggle expand */}
|
||||
<button onClick={e => { e.stopPropagation(); onEdit() }} style={{ background: 'none', border: '1px solid var(--border)', borderRadius: 7, color: 'var(--muted)', cursor: 'pointer', padding: '3px 9px', fontSize: 12, fontWeight: 500, flexShrink: 0 }}>
|
||||
@@ -1298,7 +1299,7 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
||||
<SectionIcon type="quick" />
|
||||
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
||||
{line.name}
|
||||
{line._qty > 1 && <span style={{ color: '#f59e0b', marginLeft: 4, fontWeight: 700 }}>×{line._qty}</span>}
|
||||
{line._qty > 1 && <span style={{ color: 'var(--x-warning)', marginLeft: 4, fontWeight: 700 }}>×{line._qty}</span>}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
@@ -1308,7 +1309,7 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
||||
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
||||
{line.name}
|
||||
{line.subName && <span> · {line.subName}</span>}
|
||||
{line.qty > 1 && <span style={{ color: '#f59e0b', marginLeft: 4, fontWeight: 700 }}>×{line.qty}</span>}
|
||||
{line.qty > 1 && <span style={{ color: 'var(--x-warning)', marginLeft: 4, fontWeight: 700 }}>×{line.qty}</span>}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
@@ -1357,7 +1358,7 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
||||
style={{
|
||||
width: 36, height: 36, borderRadius: '50%',
|
||||
background: 'var(--bg3)', border: '1px solid var(--border)',
|
||||
color: '#22c55e',
|
||||
color: 'var(--x-success)',
|
||||
fontSize: 20, fontWeight: 700, cursor: 'pointer',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
}}
|
||||
@@ -1397,7 +1398,7 @@ function SearchModal({ products, query, setQuery, onClose, onAdd, courses = [],
|
||||
return (
|
||||
<>
|
||||
{/* Dim backdrop — tap to close */}
|
||||
<div onClick={onClose} style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.5)', zIndex: 200 }} />
|
||||
<div onClick={onClose} style={{ position: 'fixed', inset: 0, background: 'rgb(var(--x-scrim-rgb) / 0.5)', zIndex: 200 }} />
|
||||
|
||||
{/* Panel: fixed to bottom, grows upward, capped at 60vh so results don't
|
||||
push the input off screen on short viewports */}
|
||||
|
||||
@@ -112,7 +112,7 @@ function ConvRow({ conv, currentUserId, onClick }) {
|
||||
|
||||
{hasUnread && (
|
||||
<div style={{
|
||||
background: 'var(--danger)', color: '#fff',
|
||||
background: 'var(--danger)', color: 'var(--x-danger-fg)',
|
||||
borderRadius: '50%', minWidth: 20, height: 20,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
fontSize: 11, fontWeight: 800, flexShrink: 0,
|
||||
|
||||
@@ -159,7 +159,7 @@ function LeaveModal({ onConfirm, onCancel }) {
|
||||
<button
|
||||
style={{
|
||||
flex: 1, height: 44, borderRadius: 12, border: 'none',
|
||||
background: 'var(--danger)', color: '#fff',
|
||||
background: 'var(--danger)', color: 'var(--x-danger-fg)',
|
||||
fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
||||
}}
|
||||
onClick={onConfirm}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { money } from '../i18n'
|
||||
// ── Heart icon ────────────────────────────────────────────────────────────────
|
||||
function Heart({ filled, size = 22 }) {
|
||||
return (
|
||||
<svg width={size} height={size} viewBox="0 0 24 24" fill={filled ? '#ef4444' : 'none'} stroke={filled ? '#ef4444' : 'currentColor'} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<svg width={size} height={size} viewBox="0 0 24 24" fill={filled ? 'var(--x-danger)' : 'none'} stroke={filled ? 'var(--x-danger)' : 'currentColor'} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
|
||||
</svg>
|
||||
)
|
||||
@@ -57,8 +57,8 @@ function AttrSection({ title, items, favIds, onToggle }) {
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '10px 14px',
|
||||
background: isFav ? 'rgba(239,68,68,0.07)' : 'var(--bg2)',
|
||||
border: `1px solid ${isFav ? 'rgba(239,68,68,0.25)' : 'var(--border)'}`,
|
||||
background: isFav ? 'rgb(var(--x-danger-rgb) / 0.07)' : 'var(--bg2)',
|
||||
border: `1px solid ${isFav ? 'rgb(var(--x-danger-rgb) / 0.25)' : 'var(--border)'}`,
|
||||
borderRadius: 10,
|
||||
transition: 'background 120ms, border-color 120ms',
|
||||
}}
|
||||
@@ -76,7 +76,7 @@ function AttrSection({ title, items, favIds, onToggle }) {
|
||||
</div>
|
||||
<button
|
||||
onClick={() => onToggle(item.id)}
|
||||
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 4, flexShrink: 0, color: isFav ? '#ef4444' : 'var(--muted)' }}
|
||||
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 4, flexShrink: 0, color: isFav ? 'var(--x-danger)' : 'var(--muted)' }}
|
||||
>
|
||||
<Heart filled={isFav} size={20} />
|
||||
</button>
|
||||
@@ -138,7 +138,7 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
||||
{/* Backdrop */}
|
||||
<div
|
||||
onClick={onClose}
|
||||
style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.5)', zIndex: 100 }}
|
||||
style={{ position: 'fixed', inset: 0, background: 'rgb(var(--x-scrim-rgb) / 0.5)', zIndex: 100 }}
|
||||
/>
|
||||
|
||||
{/* Sheet */}
|
||||
@@ -149,7 +149,7 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
||||
borderRadius: '20px 20px 0 0',
|
||||
maxHeight: '88vh',
|
||||
display: 'flex', flexDirection: 'column',
|
||||
boxShadow: '0 -8px 40px rgba(0,0,0,0.2)',
|
||||
boxShadow: '0 -8px 40px rgb(var(--x-scrim-rgb) / 0.2)',
|
||||
}}>
|
||||
{/* Handle bar */}
|
||||
<div style={{ display: 'flex', justifyContent: 'center', padding: '10px 0 0' }}>
|
||||
@@ -187,7 +187,7 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
||||
) : (
|
||||
<>
|
||||
<p style={{ fontSize: 13, color: 'var(--muted)', marginBottom: 16, lineHeight: 1.5 }}>
|
||||
{t('favSetup.pickIntro')} <strong style={{ color: '#ef4444' }}>♥ {t('settings.tabs.favorites')}</strong>. {t('favSetup.pickOutro')}
|
||||
{t('favSetup.pickIntro')} <strong style={{ color: 'var(--x-danger)' }}>♥ {t('settings.tabs.favorites')}</strong>. {t('favSetup.pickOutro')}
|
||||
</p>
|
||||
|
||||
<AttrSection
|
||||
@@ -241,8 +241,8 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
||||
onClick={handleSave}
|
||||
style={{
|
||||
flex: 1, height: 44, borderRadius: 12, border: 'none',
|
||||
background: totalSelected > 0 ? '#ef4444' : 'var(--accent)',
|
||||
color: '#fff',
|
||||
background: totalSelected > 0 ? 'var(--x-danger)' : 'var(--accent)',
|
||||
color: 'var(--x-danger-fg)',
|
||||
fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
@@ -293,7 +293,7 @@ function ProductRow({ product, isFav, hasAttrOverride, onToggleFav, onEditAttrs
|
||||
{/* Heart — toggles product in/out of favorites list */}
|
||||
<button
|
||||
onClick={() => onToggleFav(product.id)}
|
||||
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 6, color: isFav ? '#ef4444' : 'var(--muted)', flexShrink: 0 }}
|
||||
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: 6, color: isFav ? 'var(--x-danger)' : 'var(--muted)', flexShrink: 0 }}
|
||||
>
|
||||
<Heart filled={isFav} />
|
||||
</button>
|
||||
@@ -357,7 +357,7 @@ function FavoritesList({ items, products, onReorder }) {
|
||||
if (items.length === 0) {
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', flex: 1, padding: 32, gap: 12 }}>
|
||||
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#ef4444" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ opacity: 0.4 }}>
|
||||
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="var(--x-danger)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ opacity: 0.4 }}>
|
||||
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
|
||||
</svg>
|
||||
<p style={{ fontSize: 14, color: 'var(--muted)', textAlign: 'center', lineHeight: 1.6 }}>
|
||||
@@ -370,7 +370,7 @@ function FavoritesList({ items, products, onReorder }) {
|
||||
return (
|
||||
<div ref={containerRef} style={{ flex: 1, overflowY: 'auto', touchAction: 'pan-x' }}>
|
||||
{dropIndex === 0 && dragging != null && (
|
||||
<div style={{ height: 3, background: '#22c55e', margin: '0 16px', borderRadius: 2 }} />
|
||||
<div style={{ height: 3, background: 'var(--x-success)', margin: '0 16px', borderRadius: 2 }} />
|
||||
)}
|
||||
|
||||
{items.map((productId, idx) => {
|
||||
@@ -412,7 +412,7 @@ function FavoritesList({ items, products, onReorder }) {
|
||||
</div>
|
||||
|
||||
{dropIndex === idx + 1 && dragging != null && dragging !== idx && (
|
||||
<div style={{ height: 3, background: '#22c55e', margin: '0 16px', borderRadius: 2 }} />
|
||||
<div style={{ height: 3, background: 'var(--x-success)', margin: '0 16px', borderRadius: 2 }} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -44,7 +44,7 @@ function WaiterCard({ waiter, onClick }) {
|
||||
<div style={{
|
||||
width: 48, height: 48, borderRadius: '50%', flexShrink: 0,
|
||||
background: waiter.avatar_url ? 'transparent' : 'var(--bg3)',
|
||||
border: `2px solid ${waiter.on_shift ? '#22c55e' : 'var(--border)'}`,
|
||||
border: `2px solid ${waiter.on_shift ? 'var(--x-success)' : 'var(--border)'}`,
|
||||
overflow: 'hidden',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
fontSize: 18, fontWeight: 700, color: 'var(--text)',
|
||||
@@ -69,9 +69,9 @@ function WaiterCard({ waiter, onClick }) {
|
||||
{waiter.on_shift && (
|
||||
<span style={{
|
||||
width: 10, height: 10, borderRadius: '50%',
|
||||
background: '#22c55e',
|
||||
background: 'var(--x-success)',
|
||||
flexShrink: 0,
|
||||
boxShadow: '0 0 6px #22c55e88',
|
||||
boxShadow: '0 0 6px rgb(var(--x-success-rgb) / 0.53)',
|
||||
}} title={t('login.onShift')} />
|
||||
)}
|
||||
|
||||
@@ -197,7 +197,7 @@ export default function LoginPage() {
|
||||
) : serverUnreachable ? (
|
||||
<div style={{ textAlign: 'center', padding: 32 }}>
|
||||
<div style={{ fontSize: 48, marginBottom: 16 }}>🔌</div>
|
||||
<p style={{ fontSize: 17, fontWeight: 700, color: '#ef4444', marginBottom: 8 }}>
|
||||
<p style={{ fontSize: 17, fontWeight: 700, color: 'var(--x-danger)', marginBottom: 8 }}>
|
||||
{t('login.serverNotFound')}
|
||||
</p>
|
||||
<p style={{ fontSize: 14, color: 'var(--muted)', lineHeight: 1.6, marginBottom: 24 }}>
|
||||
@@ -242,7 +242,7 @@ export default function LoginPage() {
|
||||
<div style={{
|
||||
width: 40, height: 40, borderRadius: '50%', flexShrink: 0,
|
||||
background: w.avatar_url ? 'transparent' : 'var(--bg3)',
|
||||
border: `2px solid ${w.on_shift ? '#22c55e' : 'var(--border)'}`,
|
||||
border: `2px solid ${w.on_shift ? 'var(--x-success)' : 'var(--border)'}`,
|
||||
overflow: 'hidden',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
fontSize: 15, fontWeight: 700, color: 'var(--text)',
|
||||
|
||||
@@ -39,8 +39,8 @@ export default function OfflinePage() {
|
||||
<div className="page page--centered">
|
||||
<div style={{ textAlign: 'center', maxWidth: 300 }}>
|
||||
<p style={{ fontSize: 48, marginBottom: 16 }}>📡</p>
|
||||
<h2 style={{ color: '#e2e8f0', marginBottom: 8 }}>{t('offline.title')}</h2>
|
||||
<p style={{ color: '#64748b', marginBottom: 32 }}>
|
||||
<h2 style={{ color: 'var(--x-ink)', marginBottom: 8 }}>{t('offline.title')}</h2>
|
||||
<p style={{ color: 'var(--x-ink-3)', marginBottom: 32 }}>
|
||||
{t('offline.body')}
|
||||
</p>
|
||||
<button className="btn btn--primary btn--lg" onClick={retry} disabled={checking || searching}>
|
||||
@@ -57,7 +57,7 @@ export default function OfflinePage() {
|
||||
</button>
|
||||
)}
|
||||
{search === 'not-found' && (
|
||||
<p style={{ color: '#94a3b8', fontSize: 13, marginTop: 12, lineHeight: 1.45 }}>
|
||||
<p style={{ color: 'var(--x-ink-2)', fontSize: 13, marginTop: 12, lineHeight: 1.45 }}>
|
||||
{t('offline.notFound')}
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -4,6 +4,7 @@ import AppShell from '../components/AppShell'
|
||||
import client from '../api/client'
|
||||
import { useFormat, useTranslation } from '@xenia/i18n'
|
||||
import { money as fmtPrice } from '../i18n'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
// ── helpers ───────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -14,9 +15,9 @@ import { money as fmtPrice } from '../i18n'
|
||||
function PrintOkIcon() {
|
||||
return (
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M6 9V2h12v7" stroke="#22c55e" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" stroke="#22c55e" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<rect x="6" y="14" width="12" height="8" rx="1" stroke="#22c55e" strokeWidth="2"/>
|
||||
<path d="M6 9V2h12v7" stroke="var(--x-success)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" stroke="var(--x-success)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<rect x="6" y="14" width="12" height="8" rx="1" stroke="var(--x-success)" strokeWidth="2"/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -24,10 +25,10 @@ function PrintOkIcon() {
|
||||
function PrintFailIcon() {
|
||||
return (
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M6 9V2h12v7" stroke="#ef4444" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" stroke="#ef4444" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<rect x="6" y="14" width="12" height="8" rx="1" stroke="#ef4444" strokeWidth="2"/>
|
||||
<path d="M10 17l4 4M14 17l-4 4" stroke="#ef4444" strokeWidth="1.5" strokeLinecap="round"/>
|
||||
<path d="M6 9V2h12v7" stroke="var(--x-danger)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" stroke="var(--x-danger)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<rect x="6" y="14" width="12" height="8" rx="1" stroke="var(--x-danger)" strokeWidth="2"/>
|
||||
<path d="M10 17l4 4M14 17l-4 4" stroke="var(--x-danger)" strokeWidth="1.5" strokeLinecap="round"/>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -35,7 +36,7 @@ function PrintFailIcon() {
|
||||
// Receipt SVG from ASSETS/ICONS/receipt.svg, coloured by fiscal status
|
||||
function FiscalStatusIcon({ status }) {
|
||||
if (!status) return null
|
||||
const color = status === 'success' ? '#22c55e' : status === 'pending' ? '#f59e0b' : '#ef4444'
|
||||
const color = status === 'success' ? 'var(--x-success)' : status === 'pending' ? 'var(--x-warning)' : 'var(--x-danger)'
|
||||
return (
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17 13H21V19C21 20.1046 20.1046 21 19 21M17 13V19C17 20.1046 17.8954 21 19 21M17 13V5.75707C17 4.85168 17 4.39898 16.8098 4.13646C16.6439 3.90746 16.3888 3.75941 16.1076 3.72897C15.7853 3.69408 15.3923 3.91868 14.6062 4.36788L14.2938 4.54637C14.0045 4.7117 13.8598 4.79438 13.7062 4.82675C13.5702 4.85539 13.4298 4.85539 13.2938 4.82675C13.1402 4.79438 12.9955 4.7117 12.7062 4.54637L10.7938 3.45359C10.5045 3.28826 10.3598 3.20559 10.2062 3.17322C10.0702 3.14457 9.92978 3.14457 9.79383 3.17322C9.64019 3.20559 9.49552 3.28826 9.20618 3.4536L7.29382 4.54637C7.00448 4.71171 6.85981 4.79438 6.70617 4.82675C6.57022 4.85539 6.42978 4.85539 6.29383 4.82675C6.14019 4.79438 5.99552 4.71171 5.70618 4.54637L5.39382 4.36788C4.60772 3.91868 4.21467 3.69408 3.89237 3.72897C3.61123 3.75941 3.35611 3.90746 3.1902 4.13646C3 4.39898 3 4.85168 3 5.75707V16.2C3 17.8801 3 18.7202 3.32698 19.362C3.6146 19.9264 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H19M12 10.5C11.5 10.376 10.6851 10.3714 10 10.376C9.77091 10.3775 9.90941 10.3678 9.6 10.376C8.79258 10.4012 8.00165 10.7368 8 11.6875C7.99825 12.7003 9 13 10 13C11 13 12 13.2312 12 14.3125C12 15.1251 11.1925 15.4812 10.1861 15.5991C9.3861 15.5991 9 15.625 8 15.5M10 16V17M10 8.99998V9.99998" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
@@ -80,7 +81,7 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
||||
onClick={onClose}
|
||||
style={{
|
||||
position: 'fixed', inset: 0, zIndex: 200,
|
||||
background: 'rgba(0,0,0,0.55)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.55)',
|
||||
display: 'flex', alignItems: 'flex-end',
|
||||
}}
|
||||
>
|
||||
@@ -90,7 +91,7 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
||||
width: '100%', background: 'var(--bg)',
|
||||
borderRadius: '20px 20px 0 0',
|
||||
padding: '12px 16px 32px',
|
||||
boxShadow: '0 -4px 20px rgba(0,0,0,0.4)',
|
||||
boxShadow: '0 -4px 20px rgb(var(--x-scrim-rgb) / 0.4)',
|
||||
}}
|
||||
>
|
||||
<div style={{ width: 40, height: 4, borderRadius: 2, background: 'var(--border)', margin: '0 auto 16px' }} />
|
||||
@@ -100,7 +101,7 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
||||
<div style={{ fontSize: 13, color: 'var(--muted)', marginBottom: 20 }}>
|
||||
{t('log.orderLine', { id: order.id, table: order.table_name, time: fmtTime(order.opened_at) })}
|
||||
{order.print_retry_count > 0 && (
|
||||
<span style={{ marginLeft: 8, color: '#f59e0b' }}>
|
||||
<span style={{ marginLeft: 8, color: 'var(--x-warning)' }}>
|
||||
{t('log.retries', { count: order.print_retry_count })}
|
||||
</span>
|
||||
)}
|
||||
@@ -111,7 +112,7 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
||||
disabled={busy}
|
||||
style={{
|
||||
padding: '14px', borderRadius: 12, border: 'none',
|
||||
background: 'var(--accent)', color: '#fff',
|
||||
background: 'var(--accent)', color: 'var(--x-accent-fg)',
|
||||
fontSize: 15, fontWeight: 700, cursor: busy ? 'default' : 'pointer',
|
||||
opacity: busy ? 0.6 : 1,
|
||||
}}
|
||||
@@ -123,8 +124,8 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
||||
disabled={busy}
|
||||
style={{
|
||||
padding: '14px', borderRadius: 12,
|
||||
border: '1px solid #fee2e2', background: '#fff5f5',
|
||||
fontSize: 15, fontWeight: 600, color: '#dc2626',
|
||||
border: '1px solid var(--x-danger-soft)', background: 'var(--x-ink)',
|
||||
fontSize: 15, fontWeight: 600, color: 'var(--x-danger)',
|
||||
cursor: busy ? 'default' : 'pointer',
|
||||
opacity: busy ? 0.6 : 1,
|
||||
}}
|
||||
@@ -160,7 +161,7 @@ function FilterSheet({ filter, dateFrom, dateTo, onApply, onClose }) {
|
||||
onClick={onClose}
|
||||
style={{
|
||||
position: 'fixed', inset: 0, zIndex: 200,
|
||||
background: 'rgba(0,0,0,0.55)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.55)',
|
||||
display: 'flex', alignItems: 'flex-end',
|
||||
}}
|
||||
>
|
||||
@@ -170,7 +171,7 @@ function FilterSheet({ filter, dateFrom, dateTo, onApply, onClose }) {
|
||||
width: '100%', background: 'var(--bg)',
|
||||
borderRadius: '20px 20px 0 0',
|
||||
padding: '12px 16px 40px',
|
||||
boxShadow: '0 -4px 20px rgba(0,0,0,0.4)',
|
||||
boxShadow: '0 -4px 20px rgb(var(--x-scrim-rgb) / 0.4)',
|
||||
}}
|
||||
>
|
||||
<div style={{ width: 40, height: 4, borderRadius: 2, background: 'var(--border)', margin: '0 auto 20px' }} />
|
||||
@@ -257,7 +258,7 @@ function FilterSheet({ filter, dateFrom, dateTo, onApply, onClose }) {
|
||||
onClick={() => onApply(localFilter, localFrom, localTo)}
|
||||
style={{
|
||||
width: '100%', padding: '14px', borderRadius: 12, border: 'none',
|
||||
background: 'var(--accent)', color: '#fff',
|
||||
background: 'var(--accent)', color: 'var(--x-accent-fg)',
|
||||
fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
@@ -278,7 +279,7 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
||||
<div
|
||||
style={{
|
||||
background: 'var(--bg2)',
|
||||
border: `1px solid ${isPending ? 'rgba(239,68,68,0.4)' : 'var(--border)'}`,
|
||||
border: `1px solid ${isPending ? 'rgb(var(--x-danger-rgb) / 0.4)' : 'var(--border)'}`,
|
||||
borderRadius: 12,
|
||||
cursor: 'pointer',
|
||||
transition: 'border-color 0.15s',
|
||||
@@ -337,7 +338,7 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
||||
<span style={{ fontSize: 14, fontWeight: 600, color: 'var(--muted)' }}>{t('common.total')}</span>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
{isPending && order.print_retry_count > 0 && (
|
||||
<span style={{ fontSize: 11, color: '#f59e0b' }}>
|
||||
<span style={{ fontSize: 11, color: 'var(--x-warning)' }}>
|
||||
{t('log.retries', { count: order.print_retry_count })}
|
||||
</span>
|
||||
)}
|
||||
@@ -347,7 +348,7 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
||||
{order.fiscal_status && (
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
||||
<span style={{ color: 'var(--muted)' }}>{t('log.fiscal')}</span>
|
||||
<span style={{ fontWeight: 600, color: order.fiscal_status === 'success' ? '#22c55e' : order.fiscal_status === 'pending' ? '#f59e0b' : '#ef4444' }}>
|
||||
<span style={{ fontWeight: 600, color: order.fiscal_status === 'success' ? 'var(--x-success)' : order.fiscal_status === 'pending' ? 'var(--x-warning)' : 'var(--x-danger)' }}>
|
||||
{order.fiscal_status === 'success' ? t('log.ok') : order.fiscal_status === 'pending' ? t('log.pending') : t('log.failed')}
|
||||
</span>
|
||||
</div>
|
||||
@@ -362,7 +363,7 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
||||
disabled={busy}
|
||||
style={{
|
||||
flex: 1, padding: '10px 8px', borderRadius: 10, border: 'none',
|
||||
background: 'var(--accent)', color: '#fff',
|
||||
background: 'var(--accent)', color: 'var(--x-accent-fg)',
|
||||
fontSize: 13, fontWeight: 700, cursor: busy ? 'default' : 'pointer',
|
||||
opacity: busy ? 0.6 : 1,
|
||||
}}
|
||||
@@ -374,8 +375,8 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
||||
disabled={busy}
|
||||
style={{
|
||||
flex: 1, padding: '10px 8px', borderRadius: 10,
|
||||
border: '1px solid #fee2e2', background: '#fff5f5',
|
||||
fontSize: 13, fontWeight: 600, color: '#dc2626',
|
||||
border: '1px solid var(--x-danger-soft)', background: 'var(--x-ink)',
|
||||
fontSize: 13, fontWeight: 600, color: 'var(--x-danger)',
|
||||
cursor: busy ? 'default' : 'pointer',
|
||||
opacity: busy ? 0.6 : 1,
|
||||
}}
|
||||
@@ -416,7 +417,7 @@ function DetailedCard({ order, onLongPress }) {
|
||||
onPointerLeave={cancelPress}
|
||||
style={{
|
||||
background: 'var(--bg2)',
|
||||
border: `1px solid ${isPending ? 'rgba(239,68,68,0.4)' : 'var(--border)'}`,
|
||||
border: `1px solid ${isPending ? 'rgb(var(--x-danger-rgb) / 0.4)' : 'var(--border)'}`,
|
||||
borderRadius: 14,
|
||||
cursor: isPending ? 'pointer' : 'default',
|
||||
userSelect: 'none',
|
||||
@@ -427,7 +428,7 @@ function DetailedCard({ order, onLongPress }) {
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', gap: 10,
|
||||
padding: '11px 14px',
|
||||
background: isPending ? 'rgba(239,68,68,0.06)' : 'var(--bg3)',
|
||||
background: isPending ? 'rgb(var(--x-danger-rgb) / 0.06)' : 'var(--bg3)',
|
||||
borderBottom: '1px solid var(--border)',
|
||||
borderRadius: '14px 14px 0 0',
|
||||
}}>
|
||||
@@ -449,7 +450,7 @@ function DetailedCard({ order, onLongPress }) {
|
||||
</div>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
||||
<span style={{ color: 'var(--muted)' }}>{t('log.print')}</span>
|
||||
<span style={{ fontWeight: 600, color: isPending ? '#ef4444' : '#22c55e' }}>
|
||||
<span style={{ fontWeight: 600, color: isPending ? 'var(--x-danger)' : 'var(--x-success)' }}>
|
||||
{isPending
|
||||
? t('log.pendingRetries', { count: order.print_retry_count })
|
||||
: `OK ${fmtTime(order.print_attempted_at)}`}
|
||||
@@ -458,7 +459,7 @@ function DetailedCard({ order, onLongPress }) {
|
||||
{order.fiscal_status && (
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
||||
<span style={{ color: 'var(--muted)' }}>{t('log.fiscal')}</span>
|
||||
<span style={{ fontWeight: 600, color: order.fiscal_status === 'success' ? '#22c55e' : order.fiscal_status === 'pending' ? '#f59e0b' : '#ef4444' }}>
|
||||
<span style={{ fontWeight: 600, color: order.fiscal_status === 'success' ? 'var(--x-success)' : order.fiscal_status === 'pending' ? 'var(--x-warning)' : 'var(--x-danger)' }}>
|
||||
{order.fiscal_status === 'success' ? t('log.ok') : order.fiscal_status === 'pending' ? t('log.pending') : t('log.failed')}
|
||||
</span>
|
||||
</div>
|
||||
@@ -628,7 +629,7 @@ export default function OrderLogPage() {
|
||||
style={{
|
||||
width: 38, height: 38, borderRadius: 10,
|
||||
border: `1px solid ${view === 'detailed' ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: view === 'detailed' ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: view === 'detailed' ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
cursor: 'pointer',
|
||||
}}
|
||||
@@ -643,15 +644,15 @@ export default function OrderLogPage() {
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', gap: 8,
|
||||
padding: '8px 14px',
|
||||
background: 'rgba(239,68,68,0.08)',
|
||||
borderBottom: '1px solid rgba(239,68,68,0.2)',
|
||||
background: 'rgb(var(--x-danger-rgb) / 0.08)',
|
||||
borderBottom: '1px solid rgb(var(--x-danger-rgb) / 0.2)',
|
||||
flexShrink: 0,
|
||||
}}>
|
||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="10" stroke="#ef4444" strokeWidth="2"/>
|
||||
<path d="M12 8v4M12 16h.01" stroke="#ef4444" strokeWidth="2" strokeLinecap="round"/>
|
||||
<circle cx="12" cy="12" r="10" stroke="var(--x-danger)" strokeWidth="2"/>
|
||||
<path d="M12 8v4M12 16h.01" stroke="var(--x-danger)" strokeWidth="2" strokeLinecap="round"/>
|
||||
</svg>
|
||||
<span style={{ fontSize: 13, color: '#ef4444', fontWeight: 600 }}>
|
||||
<span style={{ fontSize: 13, color: 'var(--x-danger)', fontWeight: 600 }}>
|
||||
{t('log.printProblems', { count: pendingCount })}
|
||||
</span>
|
||||
</div>
|
||||
@@ -668,8 +669,8 @@ export default function OrderLogPage() {
|
||||
{filter !== 'all' && (
|
||||
<span style={{
|
||||
fontSize: 12, padding: '3px 10px', borderRadius: 999,
|
||||
background: filter === 'failed' ? 'rgba(239,68,68,0.12)' : 'rgba(34,197,94,0.12)',
|
||||
color: filter === 'failed' ? '#ef4444' : '#22c55e',
|
||||
background: filter === 'failed' ? 'rgb(var(--x-danger-rgb) / 0.12)' : 'rgb(var(--x-success-rgb) / 0.12)',
|
||||
color: filter === 'failed' ? 'var(--x-danger)' : 'var(--x-success)',
|
||||
fontWeight: 600,
|
||||
}}>
|
||||
{filter === 'failed' ? t('log.printFailed') : t('log.printOk')}
|
||||
@@ -735,8 +736,8 @@ export default function OrderLogPage() {
|
||||
width: 52, height: 52, borderRadius: '50%',
|
||||
border: 'none', cursor: 'pointer',
|
||||
background: hasActiveFilters ? 'var(--accent)' : 'var(--bg3)',
|
||||
color: hasActiveFilters ? '#fff' : 'var(--text)',
|
||||
boxShadow: '0 4px 16px rgba(0,0,0,0.25)',
|
||||
color: hasActiveFilters ? 'var(--x-ink)' : 'var(--text)',
|
||||
boxShadow: '0 4px 16px rgb(var(--x-scrim-rgb) / 0.25)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
zIndex: 10,
|
||||
}}
|
||||
@@ -747,7 +748,7 @@ export default function OrderLogPage() {
|
||||
<span style={{
|
||||
position: 'absolute', top: -2, right: -2,
|
||||
width: 14, height: 14, borderRadius: '50%',
|
||||
background: '#ef4444',
|
||||
background: 'var(--x-danger)',
|
||||
border: '2px solid var(--bg)',
|
||||
}} />
|
||||
)}
|
||||
|
||||
@@ -7,6 +7,7 @@ import useOrderingSettingsStore from '../store/orderingSettingsStore'
|
||||
import usePaymentSettingsStore from '../store/paymentSettingsStore'
|
||||
import useWaiterFavoritesStore from '../store/waiterFavoritesStore'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
const CHIP_STYLE_OPTIONS = [
|
||||
{ key: 'full', label: 'settings.chips.full', example: 'orders.chips.pending' },
|
||||
@@ -135,15 +136,15 @@ function Grid1Detail() {
|
||||
<svg viewBox="0 0 56 48" fill="none" xmlns="http://www.w3.org/2000/svg" style={{ width: '100%', height: '100%' }}>
|
||||
<rect x="2" y="4" width="52" height="20" rx="2" fill="currentColor" opacity="0.9"/>
|
||||
{/* left section lines */}
|
||||
<rect x="5" y="8" width="14" height="3" rx="1" fill="white" opacity="0.6"/>
|
||||
<rect x="5" y="13" width="9" height="2" rx="1" fill="white" opacity="0.4"/>
|
||||
<rect x="5" y="18" width="11" height="2" rx="1" fill="white" opacity="0.4"/>
|
||||
<rect x="5" y="8" width="14" height="3" rx="1" fill="var(--x-on-colour)" opacity="0.6"/>
|
||||
<rect x="5" y="13" width="9" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.4"/>
|
||||
<rect x="5" y="18" width="11" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.4"/>
|
||||
{/* vertical divider */}
|
||||
<rect x="22" y="7" width="1" height="14" rx="0.5" fill="white" opacity="0.3"/>
|
||||
<rect x="22" y="7" width="1" height="14" rx="0.5" fill="var(--x-on-colour)" opacity="0.3"/>
|
||||
{/* right section lines */}
|
||||
<rect x="25" y="8" width="24" height="2" rx="1" fill="white" opacity="0.5"/>
|
||||
<rect x="25" y="12" width="20" height="2" rx="1" fill="white" opacity="0.35"/>
|
||||
<rect x="25" y="16" width="22" height="2" rx="1" fill="white" opacity="0.25"/>
|
||||
<rect x="25" y="8" width="24" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.5"/>
|
||||
<rect x="25" y="12" width="20" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.35"/>
|
||||
<rect x="25" y="16" width="22" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.25"/>
|
||||
<rect x="2" y="29" width="52" height="15" rx="2" fill="currentColor" opacity="0.45"/>
|
||||
</svg>
|
||||
)
|
||||
@@ -192,7 +193,7 @@ function LayoutTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
padding: '12px 16px', borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -232,7 +233,7 @@ function LayoutTab() {
|
||||
padding: '14px 16px',
|
||||
borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)' + '18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer',
|
||||
textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
@@ -292,7 +293,7 @@ function LayoutTab() {
|
||||
flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 6,
|
||||
padding: '14px 12px', borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -320,7 +321,7 @@ function LayoutTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
padding: '12px 16px', borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -362,7 +363,7 @@ function LayoutTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
padding: '12px 16px', borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -403,7 +404,7 @@ function LayoutTab() {
|
||||
padding: '18px 12px',
|
||||
borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)' + '18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: active ? 'default' : 'pointer',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -458,7 +459,7 @@ function ToggleRow({ label, desc, checked, onChange }) {
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
width: '100%', padding: '14px 16px', borderRadius: 14,
|
||||
border: `2px solid ${checked ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: checked ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: checked ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -469,8 +470,8 @@ function ToggleRow({ label, desc, checked, onChange }) {
|
||||
}}>
|
||||
<div style={{
|
||||
position: 'absolute', top: 3, left: checked ? 23 : 3,
|
||||
width: 18, height: 18, borderRadius: '50%', background: 'white',
|
||||
transition: 'left 0.2s', boxShadow: '0 1px 4px rgba(0,0,0,0.3)',
|
||||
width: 18, height: 18, borderRadius: '50%', background: 'var(--x-on-colour)',
|
||||
transition: 'left 0.2s', boxShadow: '0 1px 4px rgb(var(--x-scrim-rgb) / 0.3)',
|
||||
}} />
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
@@ -523,7 +524,7 @@ function LeitourgiaTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
padding: '12px 16px', borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -597,7 +598,7 @@ function LeitourgiaTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
padding: '12px 16px', borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -656,11 +657,11 @@ function PersonalizeTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
width: '100%', padding: '14px 16px', borderRadius: 14,
|
||||
border: '2px solid var(--accent)',
|
||||
background: 'var(--accent)18',
|
||||
background: fade('var(--accent)', 0.09),
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
}}
|
||||
>
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="#ef4444" stroke="#ef4444" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="var(--x-danger)" stroke="var(--x-danger)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>
|
||||
</svg>
|
||||
<div style={{ flex: 1 }}>
|
||||
@@ -690,7 +691,7 @@ function PersonalizeTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
width: '100%', padding: '14px 16px', borderRadius: 14,
|
||||
border: `2px solid ${confirmReset ? 'var(--danger)' : 'var(--border)'}`,
|
||||
background: confirmReset ? 'var(--danger-dim, #fee2e2)' : 'var(--bg2)',
|
||||
background: confirmReset ? 'var(--danger-dim, var(--x-danger-soft))' : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.15s, background 0.15s',
|
||||
}}
|
||||
@@ -939,7 +940,7 @@ function PloigisiTab() {
|
||||
display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 6,
|
||||
padding: '14px 12px', borderRadius: 14,
|
||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
||||
background: active ? 'var(--accent)18' : 'var(--bg2)',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'var(--bg2)',
|
||||
cursor: 'pointer', textAlign: 'left',
|
||||
transition: 'border-color 0.12s, background 0.12s',
|
||||
}}
|
||||
@@ -983,7 +984,7 @@ function PloigisiTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
|
||||
border: '2px solid var(--accent)',
|
||||
background: 'var(--accent)18',
|
||||
background: fade('var(--accent)', 0.09),
|
||||
cursor: 'grab', userSelect: 'none',
|
||||
opacity: triDragging === item.key ? 0.4 : 1,
|
||||
transition: 'opacity 0.1s',
|
||||
@@ -1084,7 +1085,7 @@ function PloigisiTab() {
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
|
||||
border: `2px solid var(--accent)`,
|
||||
background: 'var(--accent)18',
|
||||
background: fade('var(--accent)', 0.09),
|
||||
cursor: 'grab',
|
||||
userSelect: 'none',
|
||||
opacity: dragging === item.key ? 0.4 : 1,
|
||||
|
||||
@@ -104,14 +104,14 @@ function BreakRow({ brk, index }) {
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '10px 14px', borderRadius: 10,
|
||||
background: active ? 'rgba(251,146,60,0.1)' : 'var(--bg2)',
|
||||
border: `1px solid ${active ? '#f97316' : 'var(--border)'}`,
|
||||
background: active ? 'rgb(var(--x-warning-rgb) / 0.1)' : 'var(--bg2)',
|
||||
border: `1px solid ${active ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||
}}>
|
||||
<div style={{
|
||||
width: 28, height: 28, borderRadius: 8, flexShrink: 0,
|
||||
background: active ? '#f97316' : 'var(--bg3)',
|
||||
background: active ? 'var(--x-warning)' : 'var(--bg3)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
fontSize: 12, fontWeight: 700, color: active ? 'white' : 'var(--muted)',
|
||||
fontSize: 12, fontWeight: 700, color: active ? 'var(--x-warning-fg)' : 'var(--muted)',
|
||||
}}>{index + 1}</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div style={{ fontSize: 13, fontWeight: 600, color: 'var(--text)' }}>
|
||||
@@ -124,7 +124,7 @@ function BreakRow({ brk, index }) {
|
||||
{active && (
|
||||
<span style={{
|
||||
fontSize: 10, fontWeight: 700, padding: '3px 8px', borderRadius: 999,
|
||||
background: '#f97316', color: 'white',
|
||||
background: 'var(--x-warning)', color: 'var(--x-warning-fg)',
|
||||
}}>{t('venues.active')}</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -212,13 +212,13 @@ export default function ShiftOverviewPage() {
|
||||
margin: '0 0 16px',
|
||||
padding: '12px 16px',
|
||||
borderRadius: 12,
|
||||
background: 'rgba(251,146,60,0.12)',
|
||||
border: '1px solid #f97316',
|
||||
background: 'rgb(var(--x-warning-rgb) / 0.12)',
|
||||
border: '1px solid var(--x-warning)',
|
||||
display: 'flex', alignItems: 'center', gap: 10,
|
||||
}}>
|
||||
<span style={{ fontSize: 20 }}>☕</span>
|
||||
<div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: '#f97316' }}>{t('shiftPage.onBreak')}</div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: 'var(--x-warning)' }}>{t('shiftPage.onBreak')}</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 1 }}>
|
||||
{t('shiftPage.breakSince', { time: fmtTime(activeBreak.started_at), duration: fmtDuration(breakDurationSeconds(activeBreak)) })}
|
||||
</div>
|
||||
@@ -232,7 +232,7 @@ export default function ShiftOverviewPage() {
|
||||
<StatCard label={t('shiftPage.worked')} value={fmtDuration(workedSec)} sub={t('shiftPage.breaksSub', { duration: fmtDuration(totalBreakSec) })} />
|
||||
<StatCard label={t('shiftPage.startCash')} value={fmtEuro(shift.starting_cash)} />
|
||||
{!hideRevenue && (
|
||||
<StatCard label={t('shiftPage.collected')} value={fmtEuro(shift.total_collected)} accent="var(--success, #22c55e)" />
|
||||
<StatCard label={t('shiftPage.collected')} value={fmtEuro(shift.total_collected)} accent="var(--success, var(--x-success))" />
|
||||
)}
|
||||
{!hideRevenue && (
|
||||
<StatCard label={t('shiftPage.toHandIn')} value={fmtEuro(shift.net_to_deliver)} sub={t('shiftPage.toHandInSub')} accent="var(--accent)" />
|
||||
|
||||
@@ -14,6 +14,7 @@ import { TransferIcon, MergeIcon, FlagsIcon, WaiterIcon, PrintIcon } from '../co
|
||||
import usePaymentSettingsStore from '../store/paymentSettingsStore'
|
||||
import useTableViewStore from '../store/tableViewStore'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
const fmtPrice = money
|
||||
|
||||
@@ -79,10 +80,10 @@ function SplitModal({ item, onConfirm, onClose }) {
|
||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{t('detail.split.title')}</h2>
|
||||
<p style={{ textAlign: 'center', color: '#94a3b8', fontSize: 14, marginBottom: 4 }}>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-2)', fontSize: 14, marginBottom: 4 }}>
|
||||
{item.product?.name} ×{item.quantity}
|
||||
</p>
|
||||
<p style={{ textAlign: 'center', color: '#94a3b8', fontSize: 13, marginBottom: 16 }}>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-2)', fontSize: 13, marginBottom: 16 }}>
|
||||
{t('detail.split.howMany')}
|
||||
</p>
|
||||
|
||||
@@ -92,9 +93,9 @@ function SplitModal({ item, onConfirm, onClose }) {
|
||||
<button className="qty-btn" onClick={() => setSplitQty(q => Math.min(max, q + 1))}>+</button>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', justifyContent: 'center', gap: 20, marginBottom: 20, fontSize: 13, color: '#94a3b8' }}>
|
||||
<span>{t('detail.split.newLine')} <strong style={{ color: '#f59e0b' }}>×{splitQty}</strong></span>
|
||||
<span>{t('detail.split.remains')} <strong style={{ color: '#64748b' }}>×{item.quantity - splitQty}</strong></span>
|
||||
<div style={{ display: 'flex', justifyContent: 'center', gap: 20, marginBottom: 20, fontSize: 13, color: 'var(--x-ink-2)' }}>
|
||||
<span>{t('detail.split.newLine')} <strong style={{ color: 'var(--x-warning)' }}>×{splitQty}</strong></span>
|
||||
<span>{t('detail.split.remains')} <strong style={{ color: 'var(--x-ink-3)' }}>×{item.quantity - splitQty}</strong></span>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', gap: 12 }}>
|
||||
@@ -164,7 +165,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
||||
onBlur={commitEdit}
|
||||
onKeyDown={e => { if (e.key === 'Enter') commitEdit() }}
|
||||
style={{
|
||||
fontSize: 36, fontWeight: 800, color: adj !== 0 ? '#f59e0b' : 'var(--text)',
|
||||
fontSize: 36, fontWeight: 800, color: adj !== 0 ? 'var(--x-warning)' : 'var(--text)',
|
||||
background: 'var(--bg3)', border: '2px solid var(--accent)',
|
||||
borderRadius: 12, padding: '6px 16px', textAlign: 'center',
|
||||
width: '140px',
|
||||
@@ -174,7 +175,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
||||
<button
|
||||
onClick={startEdit}
|
||||
style={{
|
||||
fontSize: 36, fontWeight: 800, color: adj !== 0 ? '#f59e0b' : 'var(--text)',
|
||||
fontSize: 36, fontWeight: 800, color: adj !== 0 ? 'var(--x-warning)' : 'var(--text)',
|
||||
background: 'var(--bg3)', border: '2px solid var(--border)',
|
||||
borderRadius: 12, padding: '6px 20px', cursor: 'pointer',
|
||||
}}
|
||||
@@ -183,7 +184,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
||||
</button>
|
||||
)}
|
||||
{adj !== 0 && (
|
||||
<div style={{ fontSize: 12, color: adj > 0 ? '#22c55e' : '#f87171', marginTop: 4 }}>
|
||||
<div style={{ fontSize: 12, color: adj > 0 ? 'var(--x-success)' : 'var(--x-danger)', marginTop: 4 }}>
|
||||
{t('detail.price.base', { base: fmtPrice(basePrice), change: `${adj > 0 ? '+' : ''}${fmtPrice(adj)}` })}
|
||||
</div>
|
||||
)}
|
||||
@@ -206,8 +207,8 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
||||
style={{
|
||||
padding: '9px 4px', borderRadius: 10, border: 'none', cursor: 'pointer',
|
||||
fontWeight: 700, fontSize: 13,
|
||||
background: d < 0 ? 'rgba(239,68,68,0.15)' : 'rgba(34,197,94,0.15)',
|
||||
color: d < 0 ? '#f87171' : '#4ade80',
|
||||
background: d < 0 ? 'rgb(var(--x-danger-rgb) / 0.15)' : 'rgb(var(--x-success-rgb) / 0.15)',
|
||||
color: d < 0 ? 'var(--x-danger)' : 'var(--x-success)',
|
||||
}}
|
||||
>
|
||||
{d > 0 ? '+' : ''}{d.toFixed(1).replace('.0', '')} €
|
||||
@@ -221,7 +222,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
||||
onClick={() => setAdj(0)}
|
||||
style={{
|
||||
width: '100%', marginBottom: 8, padding: '8px 0', borderRadius: 10,
|
||||
background: 'rgba(148,163,184,0.1)', border: '1px solid var(--border)',
|
||||
background: 'rgb(var(--x-ink-2-rgb) / 0.1)', border: '1px solid var(--border)',
|
||||
color: 'var(--muted)', fontSize: 13, cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
@@ -252,14 +253,14 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
||||
const actionRows = [
|
||||
...(!multiSelect && priceAdjAllowed ? [{
|
||||
key: 'adjust_price',
|
||||
color: '#f59e0b',
|
||||
iconBg: 'rgba(245,158,11,0.15)',
|
||||
color: 'var(--x-warning)',
|
||||
iconBg: 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||
label: t('detail.item.price'),
|
||||
sub: priceNeedsApproval ? t('detail.withApproval') : t('detail.item.priceSub'),
|
||||
icon: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="9" stroke="#f59e0b" strokeWidth="2"/>
|
||||
<path d="M12 7v10M9.5 9.5C9.5 8.12 10.62 7 12 7s2.5 1.12 2.5 2.5c0 1.38-1.12 2.5-2.5 2.5s-2.5 1.12-2.5 2.5S10.62 17 12 17s2.5-1.12 2.5-2.5" stroke="#f59e0b" strokeWidth="1.8" strokeLinecap="round"/>
|
||||
<circle cx="12" cy="12" r="9" stroke="var(--x-warning)" strokeWidth="2"/>
|
||||
<path d="M12 7v10M9.5 9.5C9.5 8.12 10.62 7 12 7s2.5 1.12 2.5 2.5c0 1.38-1.12 2.5-2.5 2.5s-2.5 1.12-2.5 2.5S10.62 17 12 17s2.5-1.12 2.5-2.5" stroke="var(--x-warning)" strokeWidth="1.8" strokeLinecap="round"/>
|
||||
</svg>
|
||||
),
|
||||
onClick: onAdjustPrice,
|
||||
@@ -267,14 +268,14 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
||||
}] : []),
|
||||
{
|
||||
key: 'order_again',
|
||||
color: '#22c55e',
|
||||
iconBg: 'rgba(34,197,94,0.15)',
|
||||
color: 'var(--x-success)',
|
||||
iconBg: 'rgb(var(--x-success-rgb) / 0.15)',
|
||||
label: t('detail.item.again'),
|
||||
sub: t('detail.item.againSub'),
|
||||
icon: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M1 4v6h6M23 20v-6h-6" stroke="#22c55e" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4-4.64 4.36A9 9 0 0 1 3.51 15" stroke="#22c55e" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M1 4v6h6M23 20v-6h-6" stroke="var(--x-success)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4-4.64 4.36A9 9 0 0 1 3.51 15" stroke="var(--x-success)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
),
|
||||
onClick: onOrderAgain,
|
||||
@@ -282,13 +283,13 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
||||
},
|
||||
...(canMove ? [{
|
||||
key: 'move',
|
||||
color: '#f97316',
|
||||
iconBg: 'rgba(249,115,22,0.15)',
|
||||
color: 'var(--x-warning)',
|
||||
iconBg: 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||
label: t('detail.item.move'),
|
||||
sub: t('detail.item.moveSub'),
|
||||
icon: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M5 12h14M12 5l7 7-7 7" stroke="#f97316" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M5 12h14M12 5l7 7-7 7" stroke="var(--x-warning)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
),
|
||||
onClick: onMoveToTable,
|
||||
@@ -296,13 +297,13 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
||||
}] : []),
|
||||
...(canMove && singleStacked && !multiSelect ? [{
|
||||
key: 'split',
|
||||
color: '#60a5fa',
|
||||
iconBg: 'rgba(96,165,250,0.15)',
|
||||
color: 'var(--x-info)',
|
||||
iconBg: 'rgb(var(--x-info-rgb) / 0.15)',
|
||||
label: t('detail.split.title'),
|
||||
sub: t('detail.item.splitSub'),
|
||||
icon: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M16 3h5v5M4 20L21 3M21 16v5h-5M15 15l6 6M4 4l5 5" stroke="#60a5fa" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M16 3h5v5M4 20L21 3M21 16v5h-5M15 15l6 6M4 4l5 5" stroke="var(--x-info)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
),
|
||||
onClick: onSplit,
|
||||
@@ -310,14 +311,14 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
||||
}] : []),
|
||||
{
|
||||
key: 'cancel',
|
||||
color: canCancel ? '#ef4444' : '#6b7280',
|
||||
iconBg: canCancel ? 'rgba(239,68,68,0.15)' : 'rgba(107,114,128,0.1)',
|
||||
color: canCancel ? 'var(--x-danger)' : 'var(--x-ink-3)',
|
||||
iconBg: canCancel ? 'rgb(var(--x-danger-rgb) / 0.15)' : 'rgb(var(--x-ink-2-rgb) / 0.1)',
|
||||
label: t('detail.item.cancel'),
|
||||
sub: !canCancel ? t('detail.cancelNotAllowed') : cancelNeedsApproval ? t('detail.withApproval') : t('detail.item.cancelSub'),
|
||||
icon: (
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||
<circle cx="12" cy="12" r="10" stroke={canCancel ? '#ef4444' : '#6b7280'} strokeWidth="2"/>
|
||||
<path d="M15 9l-6 6M9 9l6 6" stroke={canCancel ? '#ef4444' : '#6b7280'} strokeWidth="2" strokeLinecap="round"/>
|
||||
<circle cx="12" cy="12" r="10" stroke={canCancel ? 'var(--x-danger)' : 'var(--x-ink-3)'} strokeWidth="2"/>
|
||||
<path d="M15 9l-6 6M9 9l6 6" stroke={canCancel ? 'var(--x-danger)' : 'var(--x-ink-3)'} strokeWidth="2" strokeLinecap="round"/>
|
||||
</svg>
|
||||
),
|
||||
onClick: canCancel ? onCancel : null,
|
||||
@@ -437,15 +438,15 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 10,
|
||||
padding: '10px 12px', borderRadius: 10, border: 'none', cursor: 'pointer',
|
||||
background: checked ? 'rgba(99,102,241,0.12)' : 'var(--bg3)',
|
||||
background: checked ? 'rgb(var(--x-info-rgb) / 0.12)' : 'var(--bg3)',
|
||||
textAlign: 'left',
|
||||
}}>
|
||||
<div style={{
|
||||
width: 20, height: 20, borderRadius: 5, flexShrink: 0,
|
||||
background: checked ? '#6366f1' : 'var(--border)',
|
||||
background: checked ? 'var(--x-info)' : 'var(--border)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
}}>
|
||||
{checked && <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="3" strokeLinecap="round"><path d="M20 6L9 17l-5-5"/></svg>}
|
||||
{checked && <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="var(--x-on-colour)" strokeWidth="3" strokeLinecap="round"><path d="M20 6L9 17l-5-5"/></svg>}
|
||||
</div>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 13, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
@@ -454,7 +455,7 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
||||
<div style={{ fontSize: 11, color: 'var(--muted)' }}>×{item.quantity} · {fmtPrice(eff)}</div>
|
||||
</div>
|
||||
{checked && (
|
||||
<div style={{ fontSize: 12, fontWeight: 700, color: '#4ade80', shrink: 0 }}>
|
||||
<div style={{ fontSize: 12, fontWeight: 700, color: 'var(--x-success)', shrink: 0 }}>
|
||||
→ {fmtPrice(newPrice)}
|
||||
</div>
|
||||
)}
|
||||
@@ -472,8 +473,8 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
||||
<button key={p} onClick={() => setPct(p)}
|
||||
style={{
|
||||
padding: '6px 12px', borderRadius: 8, border: 'none', cursor: 'pointer', fontWeight: 700, fontSize: 13,
|
||||
background: pct === p ? '#6366f1' : 'var(--bg3)',
|
||||
color: pct === p ? '#fff' : 'var(--text)',
|
||||
background: pct === p ? 'var(--x-info)' : 'var(--bg3)',
|
||||
color: pct === p ? 'var(--x-info-fg)' : 'var(--text)',
|
||||
}}>
|
||||
{p}%
|
||||
</button>
|
||||
@@ -488,7 +489,7 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
||||
color: 'var(--text)', fontSize: 16, fontWeight: 700, textAlign: 'center',
|
||||
}} />
|
||||
<span style={{ fontSize: 14, color: 'var(--muted)' }}>%</span>
|
||||
<span style={{ fontSize: 13, color: '#4ade80', fontWeight: 700 }}>
|
||||
<span style={{ fontSize: 13, color: 'var(--x-success)', fontWeight: 700 }}>
|
||||
−{fmtPrice(discountTotal)}
|
||||
</span>
|
||||
</div>
|
||||
@@ -507,7 +508,7 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
<p style={{ fontSize: 12, color: '#f87171', textAlign: 'center', marginBottom: 10 }}>{error}</p>
|
||||
<p style={{ fontSize: 12, color: 'var(--x-danger)', textAlign: 'center', marginBottom: 10 }}>{error}</p>
|
||||
)}
|
||||
|
||||
<div style={{ display: 'flex', gap: 10 }}>
|
||||
@@ -556,16 +557,16 @@ function ActionsSheet({ order, _tableId, isStandalone, onClose, onTransfer, onMe
|
||||
const hasActiveItems = hasOrder && order.items?.some(i => i.status === 'active')
|
||||
const allActions = [
|
||||
{ Icon: CheckIcon, label: t('tables.quick.markAllServed'), sub: t('detail.actions.markAllServedSub'),
|
||||
onClick: hasServable ? onMarkAllServed : null, color: hasServable ? '#4ade80' : '#6b7280', iconBg: hasServable ? 'rgba(34,197,94,0.15)' : 'rgba(107,114,128,0.1)' },
|
||||
onClick: hasServable ? onMarkAllServed : null, color: hasServable ? 'var(--x-success)' : 'var(--x-ink-3)', iconBg: hasServable ? 'rgb(var(--x-success-rgb) / 0.15)' : 'rgb(var(--x-ink-2-rgb) / 0.1)' },
|
||||
{ Icon: DiscountIcon, label: t('detail.actions.discount'), sub: canDiscount ? t('detail.actions.discountSub') : t('detail.actions.discountNotAllowed'),
|
||||
onClick: (hasActiveItems && canDiscount) ? onApplyDiscount : null, color: (hasActiveItems && canDiscount) ? '#a78bfa' : '#6b7280', iconBg: (hasActiveItems && canDiscount) ? 'rgba(167,139,250,0.15)' : 'rgba(107,114,128,0.1)' },
|
||||
{ Icon: TransferIcon, label: t('detail.actions.transfer'), sub: t('detail.item.move'), onClick: hasOrder ? onTransfer : null, color: '#6099db', iconBg: 'rgba(96,165,250,0.15)', tableOnly: true, needsMove: true },
|
||||
{ Icon: MergeIcon, label: t('detail.actions.merge'), sub: t('detail.actions.mergeSub'), onClick: hasOrder ? onMerge : null, color: '#6099db', iconBg: 'rgba(96,165,250,0.15)', tableOnly: true, needsMove: true },
|
||||
{ Icon: FlagsIcon, label: t('tables.actions.flags'), sub: t('detail.actions.flagsSub'), onClick: onSetFlags, color: '#fac823', iconBg: 'rgba(251,191,36,0.15)', tableOnly: true },
|
||||
{ Icon: WaiterIcon, label: t('tables.actions.assignWaiter'), sub: t('detail.actions.assignSub'), onClick: hasOrder ? onAssignWaiter : null, color: '#39b861', iconBg: 'rgba(34,197,94,0.15)' },
|
||||
{ Icon: PrintIcon, label: t('tables.actions.printSynopsis'), sub: t('detail.actions.printSub'), onClick: hasOrder ? onPrintSynopsis : null, color: '#cbd5e1', iconBg: 'rgba(148,163,184,0.15)' },
|
||||
onClick: (hasActiveItems && canDiscount) ? onApplyDiscount : null, color: (hasActiveItems && canDiscount) ? 'var(--x-special-ink)' : 'var(--x-ink-3)', iconBg: (hasActiveItems && canDiscount) ? 'rgb(var(--x-special-rgb) / 0.15)' : 'rgb(var(--x-ink-2-rgb) / 0.1)' },
|
||||
{ Icon: TransferIcon, label: t('detail.actions.transfer'), sub: t('detail.item.move'), onClick: hasOrder ? onTransfer : null, color: 'var(--x-info)', iconBg: 'rgb(var(--x-info-rgb) / 0.15)', tableOnly: true, needsMove: true },
|
||||
{ Icon: MergeIcon, label: t('detail.actions.merge'), sub: t('detail.actions.mergeSub'), onClick: hasOrder ? onMerge : null, color: 'var(--x-info)', iconBg: 'rgb(var(--x-info-rgb) / 0.15)', tableOnly: true, needsMove: true },
|
||||
{ Icon: FlagsIcon, label: t('tables.actions.flags'), sub: t('detail.actions.flagsSub'), onClick: onSetFlags, color: 'var(--x-warning)', iconBg: 'rgb(var(--x-warning-rgb) / 0.15)', tableOnly: true },
|
||||
{ Icon: WaiterIcon, label: t('tables.actions.assignWaiter'), sub: t('detail.actions.assignSub'), onClick: hasOrder ? onAssignWaiter : null, color: 'var(--x-success)', iconBg: 'rgb(var(--x-success-rgb) / 0.15)' },
|
||||
{ Icon: PrintIcon, label: t('tables.actions.printSynopsis'), sub: t('detail.actions.printSub'), onClick: hasOrder ? onPrintSynopsis : null, color: 'var(--x-ink)', iconBg: 'rgb(var(--x-ink-2-rgb) / 0.15)' },
|
||||
{ Icon: CancelIcon, label: t('tables.quick.cancelOrder'), sub: !canCancel ? t('detail.cancelNotAllowed') : cancelNeedsApproval ? t('detail.withApproval') : t('detail.actions.cancelSub'),
|
||||
onClick: (hasOrder && canCancel) ? onCancelOrder : null, color: (hasOrder && canCancel) ? '#ef4444' : '#6b7280', iconBg: (hasOrder && canCancel) ? 'rgba(239,68,68,0.15)' : 'rgba(107,114,128,0.1)' },
|
||||
onClick: (hasOrder && canCancel) ? onCancelOrder : null, color: (hasOrder && canCancel) ? 'var(--x-danger)' : 'var(--x-ink-3)', iconBg: (hasOrder && canCancel) ? 'rgb(var(--x-danger-rgb) / 0.15)' : 'rgb(var(--x-ink-2-rgb) / 0.1)' },
|
||||
]
|
||||
// plan 4.3: discounts show only with pricing.discounts.apply, transfer/merge with ordering.orders.open
|
||||
const actions = allActions
|
||||
@@ -620,13 +621,13 @@ function TablePicker({ title, subtitle, tables, _currentTableId, onSelect, onClo
|
||||
<div className="modal-sheet modal-sheet--top" onClick={e => e.stopPropagation()}>
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{title}</h2>
|
||||
{subtitle && <p style={{ textAlign: 'center', color: '#94a3b8', fontSize: 13, marginBottom: 4 }}>{subtitle}</p>}
|
||||
{subtitle && <p style={{ textAlign: 'center', color: 'var(--x-ink-2)', fontSize: 13, marginBottom: 4 }}>{subtitle}</p>}
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, maxHeight: '60svh', overflowY: 'auto' }}>
|
||||
{loading && (
|
||||
<p style={{ textAlign: 'center', color: '#64748b', padding: 24 }}>{t('common.loading')}</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-3)', padding: 24 }}>{t('common.loading')}</p>
|
||||
)}
|
||||
{!loading && tables.length === 0 && (
|
||||
<p style={{ textAlign: 'center', color: '#64748b', padding: 24 }}>{t('detail.noTables')}</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-3)', padding: 24 }}>{t('detail.noTables')}</p>
|
||||
)}
|
||||
{!loading && tables.map(tb => (
|
||||
<button
|
||||
@@ -643,7 +644,7 @@ function TablePicker({ title, subtitle, tables, _currentTableId, onSelect, onClo
|
||||
{tb.label || `T${tb.number}`}
|
||||
</div>
|
||||
{tb.orderStatus && (
|
||||
<div style={{ fontSize: 12, color: '#f59e0b', marginTop: 2 }}>
|
||||
<div style={{ fontSize: 12, color: 'var(--x-warning)', marginTop: 2 }}>
|
||||
{tb.orderStatus === 'open' ? t('tables.status.open') : tb.orderStatus === 'partially_paid' ? t('tables.status.partlyPaid') : tb.orderStatus}
|
||||
</div>
|
||||
)}
|
||||
@@ -678,10 +679,10 @@ function FlagPicker({ _tableId, currentFlagIds, flagDefs, onSave, onClose, loadi
|
||||
<h2 className="modal-title">{t('tables.actions.flags')}</h2>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 20 }}>
|
||||
{loading && (
|
||||
<p style={{ textAlign: 'center', color: '#64748b', padding: 16 }}>{t('common.loading')}</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-3)', padding: 16 }}>{t('common.loading')}</p>
|
||||
)}
|
||||
{!loading && flagDefs.length === 0 && (
|
||||
<p style={{ textAlign: 'center', color: '#64748b', padding: 16 }}>{t('detail.noFlags')}</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-3)', padding: 16 }}>{t('detail.noFlags')}</p>
|
||||
)}
|
||||
{!loading && flagDefs.map(f => {
|
||||
const sel = selected.includes(f.id)
|
||||
@@ -698,7 +699,7 @@ function FlagPicker({ _tableId, currentFlagIds, flagDefs, onSave, onClose, loadi
|
||||
>
|
||||
<div style={{
|
||||
width: 36, height: 36, borderRadius: '50%', flexShrink: 0,
|
||||
background: f.color + '33', border: `2px solid ${sel ? f.color : 'transparent'}`,
|
||||
background: fade(f.color, 0.2), border: `2px solid ${sel ? f.color : 'transparent'}`,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 18,
|
||||
}}>
|
||||
{f.emoji || '🏷️'}
|
||||
@@ -751,10 +752,10 @@ function AssignWaiterPicker({ orderId, currentWaiterIds, waiters, onAssigned, on
|
||||
<h2 className="modal-title">{t('tables.actions.assignWaiter')}</h2>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 16, maxHeight: '60svh', overflowY: 'auto' }}>
|
||||
{loading && (
|
||||
<p style={{ textAlign: 'center', color: '#64748b', padding: 16 }}>{t('common.loading')}</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-3)', padding: 16 }}>{t('common.loading')}</p>
|
||||
)}
|
||||
{!loading && available.length === 0 && (
|
||||
<p style={{ textAlign: 'center', color: '#64748b', padding: 16 }}>{t('detail.allAssigned')}</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-3)', padding: 16 }}>{t('detail.allAssigned')}</p>
|
||||
)}
|
||||
{!loading && available.map(w => (
|
||||
<button
|
||||
@@ -813,7 +814,7 @@ function PrintSynopsisPicker({ orderId, onClose }) {
|
||||
<div className="modal-sheet modal-sheet--top" onClick={e => e.stopPropagation()}>
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{t('tables.actions.printSynopsis')}</h2>
|
||||
<p style={{ textAlign: 'center', color: '#94a3b8', fontSize: 13, marginBottom: 8 }}>{t('detail.pickPrinter')}</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-2)', fontSize: 13, marginBottom: 8 }}>{t('detail.pickPrinter')}</p>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 16 }}>
|
||||
{printers.filter(p => p.reachable).map(p => (
|
||||
<button
|
||||
@@ -835,7 +836,7 @@ function PrintSynopsisPicker({ orderId, onClose }) {
|
||||
<div key={p.id} style={{ display: 'flex', alignItems: 'center', gap: 14, padding: '14px 4px', borderBottom: '1px solid var(--border)', opacity: 0.4 }}>
|
||||
<span style={{ fontSize: 20 }}>🖨️</span>
|
||||
<span style={{ fontSize: 15, color: 'var(--text)' }}>{p.name}</span>
|
||||
<span style={{ marginLeft: 'auto', fontSize: 11, color: '#ef4444' }}>Offline</span>
|
||||
<span style={{ marginLeft: 'auto', fontSize: 11, color: 'var(--x-danger)' }}>Offline</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -854,7 +855,7 @@ function CancelConfirmModal({ itemCount, onConfirm, onClose }) {
|
||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{t('detail.cancel.title')}</h2>
|
||||
<p style={{ color: '#94a3b8', textAlign: 'center', marginBottom: 24, fontSize: 14 }}>
|
||||
<p style={{ color: 'var(--x-ink-2)', textAlign: 'center', marginBottom: 24, fontSize: 14 }}>
|
||||
{itemCount === null
|
||||
? t('detail.cancel.whole')
|
||||
: t('detail.cancel.items', { count: itemCount })}
|
||||
@@ -865,7 +866,7 @@ function CancelConfirmModal({ itemCount, onConfirm, onClose }) {
|
||||
onClick={onConfirm}
|
||||
style={{
|
||||
flex: 1, height: 48, borderRadius: 12, border: 'none',
|
||||
background: '#dc2626', color: 'white', fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
||||
background: 'var(--x-danger)', color: 'var(--x-danger-fg)', fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
||||
}}
|
||||
>{t('detail.cancel.button')}</button>
|
||||
</div>
|
||||
@@ -917,8 +918,8 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title" style={{ fontSize: andClose ? 16 : undefined }}>{title}</h2>
|
||||
<p style={{ color: '#94a3b8', textAlign: 'center', marginBottom: 4 }}>{subtitle}</p>
|
||||
<p style={{ color: '#f59e0b', textAlign: 'center', fontSize: 28, fontWeight: 700, marginBottom: 20 }}>
|
||||
<p style={{ color: 'var(--x-ink-2)', textAlign: 'center', marginBottom: 4 }}>{subtitle}</p>
|
||||
<p style={{ color: 'var(--x-warning)', textAlign: 'center', fontSize: 28, fontWeight: 700, marginBottom: 20 }}>
|
||||
{fmtPrice(payTotal)}
|
||||
</p>
|
||||
|
||||
@@ -931,9 +932,9 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
||||
onClick={() => setMethod(m)}
|
||||
style={{
|
||||
flex: 1, padding: '10px 0', borderRadius: 10, fontSize: 14, fontWeight: 600,
|
||||
border: `2px solid ${method === m ? '#3b82f6' : 'rgba(255,255,255,0.1)'}`,
|
||||
background: method === m ? 'rgba(59,130,246,0.18)' : 'rgba(255,255,255,0.04)',
|
||||
color: method === m ? '#93c5fd' : '#94a3b8',
|
||||
border: `2px solid ${method === m ? 'var(--x-info)' : 'rgb(var(--x-ink-rgb) / 0.1)'}`,
|
||||
background: method === m ? 'rgb(var(--x-info-rgb) / 0.18)' : 'rgb(var(--x-ink-rgb) / 0.04)',
|
||||
color: method === m ? 'var(--x-info-ink)' : 'var(--x-ink-2)',
|
||||
cursor: 'pointer', transition: 'all 0.12s',
|
||||
}}
|
||||
>
|
||||
@@ -963,7 +964,7 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
||||
</span>
|
||||
{longPressActive && (
|
||||
<span style={{
|
||||
position: 'absolute', inset: 0, background: 'rgba(255,255,255,0.25)',
|
||||
position: 'absolute', inset: 0, background: 'rgb(var(--x-ink-rgb) / 0.25)',
|
||||
animation: 'longpress-fill 0.8s linear forwards',
|
||||
transformOrigin: 'left',
|
||||
}} />
|
||||
@@ -979,15 +980,15 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
||||
{/* Second confirmation dialog */}
|
||||
{secondConfirmOpen && (
|
||||
<div style={{
|
||||
position: 'absolute', inset: 0, background: 'rgba(0,0,0,0.6)',
|
||||
position: 'absolute', inset: 0, background: 'rgb(var(--x-scrim-rgb) / 0.6)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
borderRadius: 'inherit', padding: 20,
|
||||
}} onClick={e => e.stopPropagation()}>
|
||||
<div style={{ background: 'var(--bg2,#1e293b)', borderRadius: 14, padding: 24, width: '100%' }}>
|
||||
<p style={{ color: '#f1f5f9', fontWeight: 700, fontSize: 15, textAlign: 'center', marginBottom: 8 }}>
|
||||
<div style={{ background: 'var(--bg2,var(--x-surface))', borderRadius: 14, padding: 24, width: '100%' }}>
|
||||
<p style={{ color: 'var(--x-ink)', fontWeight: 700, fontSize: 15, textAlign: 'center', marginBottom: 8 }}>
|
||||
{t('common.sure')}
|
||||
</p>
|
||||
<p style={{ color: '#94a3b8', fontSize: 13, textAlign: 'center', marginBottom: 20 }}>
|
||||
<p style={{ color: 'var(--x-ink-2)', fontSize: 13, textAlign: 'center', marginBottom: 20 }}>
|
||||
{fmtPrice(payTotal)} — {method === 'card' ? t('detail.pay.card') : t('detail.pay.cash')}
|
||||
</p>
|
||||
<div style={{ display: 'flex', gap: 10 }}>
|
||||
@@ -1597,7 +1598,7 @@ export default function TableDetailPage() {
|
||||
? (order?.order_type === 'delivery' ? `Delivery #${standaloneOrderId}` : `Takeaway #${standaloneOrderId}`)
|
||||
: (table ? (table.label || `T${table.number}`) : '—')
|
||||
|
||||
if (loading) return <div className="page page--centered"><p style={{ color: '#94a3b8' }}>{t('common.loading')}</p></div>
|
||||
if (loading) return <div className="page page--centered"><p style={{ color: 'var(--x-ink-2)' }}>{t('common.loading')}</p></div>
|
||||
|
||||
return (
|
||||
<div className="page">
|
||||
@@ -1614,9 +1615,9 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center', gap: 5,
|
||||
height: 34, padding: '0 10px',
|
||||
borderRadius: 999,
|
||||
background: customerCount ? 'rgba(245,158,11,0.15)' : 'var(--bg2)',
|
||||
border: `1.5px solid ${customerCount ? 'rgba(245,158,11,0.5)' : 'var(--border)'}`,
|
||||
color: customerCount ? '#f59e0b' : 'var(--muted)',
|
||||
background: customerCount ? 'rgb(var(--x-warning-rgb) / 0.15)' : 'var(--bg2)',
|
||||
border: `1.5px solid ${customerCount ? 'rgb(var(--x-warning-rgb) / 0.5)' : 'var(--border)'}`,
|
||||
color: customerCount ? 'var(--x-warning)' : 'var(--muted)',
|
||||
cursor: 'pointer', fontSize: 13, fontWeight: 700,
|
||||
}}
|
||||
title={t('detail.guests.button')}
|
||||
@@ -1640,8 +1641,8 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center', gap: 5,
|
||||
height: 34, padding: '0 10px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(99,102,241,0.12)',
|
||||
border: '1.5px solid rgba(99,102,241,0.3)',
|
||||
background: 'rgb(var(--x-info-rgb) / 0.12)',
|
||||
border: '1.5px solid rgb(var(--x-info-rgb) / 0.3)',
|
||||
color: 'var(--accent)',
|
||||
cursor: 'pointer', fontSize: 13, fontWeight: 700,
|
||||
}}
|
||||
@@ -1668,15 +1669,15 @@ export default function TableDetailPage() {
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
padding: '10px 14px',
|
||||
background: (def.color || '#6295F3') + '22',
|
||||
border: `1px solid ${def.color || '#6295F3'}`,
|
||||
background: fade(def.color || 'var(--x-info)', 0.13),
|
||||
border: `1px solid ${def.color || 'var(--x-info)'}`,
|
||||
borderRadius: 12, cursor: 'pointer', textAlign: 'left',
|
||||
width: '100%',
|
||||
}}
|
||||
>
|
||||
<span style={{ fontSize: 20 }}>{def.emoji || '🏷️'}</span>
|
||||
<span style={{ flex: 1, fontSize: 14, fontWeight: 600, color: def.color || '#6295F3' }}>{def.name}</span>
|
||||
<span style={{ fontSize: 18, color: def.color || '#6295F3', opacity: 0.6 }}>✕</span>
|
||||
<span style={{ flex: 1, fontSize: 14, fontWeight: 600, color: def.color || 'var(--x-info)' }}>{def.name}</span>
|
||||
<span style={{ fontSize: 18, color: def.color || 'var(--x-info)', opacity: 0.6 }}>✕</span>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
@@ -1689,9 +1690,9 @@ export default function TableDetailPage() {
|
||||
<span style={{
|
||||
display: 'inline-flex', alignItems: 'center', gap: 6,
|
||||
padding: '6px 14px', borderRadius: 20,
|
||||
background: order.order_type === 'delivery' ? 'rgba(96,165,250,0.15)' : 'rgba(245,158,11,0.15)',
|
||||
border: `1.5px solid ${order.order_type === 'delivery' ? '#60a5fa55' : '#f59e0b55'}`,
|
||||
color: order.order_type === 'delivery' ? '#93c5fd' : '#fbbf24',
|
||||
background: order.order_type === 'delivery' ? 'rgb(var(--x-info-rgb) / 0.15)' : 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||
border: `1.5px solid ${order.order_type === 'delivery' ? 'rgb(var(--x-info-rgb) / 0.33)' : 'rgb(var(--x-warning-rgb) / 0.33)'}`,
|
||||
color: order.order_type === 'delivery' ? 'var(--x-info-ink)' : 'var(--x-warning)',
|
||||
fontSize: 13, fontWeight: 700,
|
||||
}}>
|
||||
{order.order_type === 'delivery' ? '🛵 Delivery' : '🥡 Takeaway'}
|
||||
@@ -1701,7 +1702,7 @@ export default function TableDetailPage() {
|
||||
|
||||
{!order && !isStandalone && (
|
||||
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
|
||||
<p style={{ color: '#94a3b8', marginBottom: 24 }}>{t('tables.quick.noOrder')}</p>
|
||||
<p style={{ color: 'var(--x-ink-2)', marginBottom: 24 }}>{t('tables.quick.noOrder')}</p>
|
||||
<button className="btn btn--primary btn--lg" onClick={openOrder}>
|
||||
{t('detail.openOrder')}
|
||||
</button>
|
||||
@@ -1730,9 +1731,9 @@ export default function TableDetailPage() {
|
||||
style={{
|
||||
width: 40, flexShrink: 0,
|
||||
borderRadius: 10, cursor: 'pointer',
|
||||
background: editMode ? 'rgba(251,191,36,0.2)' : 'var(--bg2)',
|
||||
color: editMode ? '#fbbf24' : 'var(--muted)',
|
||||
border: editMode ? '1px solid rgba(251,191,36,0.45)' : '1px solid var(--border)',
|
||||
background: editMode ? 'rgb(var(--x-warning-rgb) / 0.2)' : 'var(--bg2)',
|
||||
color: editMode ? 'var(--x-warning)' : 'var(--muted)',
|
||||
border: editMode ? '1px solid rgb(var(--x-warning-rgb) / 0.45)' : '1px solid var(--border)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
transition: 'background 0.15s, color 0.15s',
|
||||
}}
|
||||
@@ -1764,7 +1765,7 @@ export default function TableDetailPage() {
|
||||
{t('detail.tabs.unpaid')} {activeItems.length > 0 && (
|
||||
<span style={{
|
||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||
background: activeTab === 'active' ? 'rgba(0,0,0,0.2)' : 'var(--bg3)',
|
||||
background: activeTab === 'active' ? 'rgb(var(--x-scrim-rgb) / 0.2)' : 'var(--bg3)',
|
||||
borderRadius: 999, fontSize: 11, fontWeight: 800,
|
||||
padding: '1px 7px', marginLeft: 4,
|
||||
}}>{activeItems.length}</span>
|
||||
@@ -1775,15 +1776,15 @@ export default function TableDetailPage() {
|
||||
style={{
|
||||
flex: 1, padding: '9px 0', border: 'none', cursor: 'pointer',
|
||||
fontWeight: 700, fontSize: 13,
|
||||
background: activeTab === 'paid' ? '#14532d' : 'transparent',
|
||||
color: activeTab === 'paid' ? '#86efac' : 'var(--muted)',
|
||||
background: activeTab === 'paid' ? 'var(--x-success-soft)' : 'transparent',
|
||||
color: activeTab === 'paid' ? 'var(--x-success-ink)' : 'var(--muted)',
|
||||
transition: 'background 0.15s',
|
||||
}}
|
||||
>
|
||||
{t('detail.tabs.paid')} {paidItems.length > 0 && (
|
||||
<span style={{
|
||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||
background: activeTab === 'paid' ? 'rgba(0,0,0,0.2)' : 'var(--bg3)',
|
||||
background: activeTab === 'paid' ? 'rgb(var(--x-scrim-rgb) / 0.2)' : 'var(--bg3)',
|
||||
borderRadius: 999, fontSize: 11, fontWeight: 800,
|
||||
padding: '1px 7px', marginLeft: 4,
|
||||
}}>{paidItems.length}</span>
|
||||
@@ -1813,9 +1814,9 @@ export default function TableDetailPage() {
|
||||
style={{
|
||||
width: 40, flexShrink: 0,
|
||||
borderRadius: 10, cursor: 'pointer',
|
||||
background: mergeMode !== MERGE_OFF ? 'rgba(99,102,241,0.25)' : 'var(--bg2)',
|
||||
color: mergeMode !== MERGE_OFF ? '#a5b4fc' : 'var(--muted)',
|
||||
border: mergeMode !== MERGE_OFF ? '1px solid rgba(99,102,241,0.45)' : '1px solid var(--border)',
|
||||
background: mergeMode !== MERGE_OFF ? 'rgb(var(--x-info-rgb) / 0.25)' : 'var(--bg2)',
|
||||
color: mergeMode !== MERGE_OFF ? 'var(--x-info-ink)' : 'var(--muted)',
|
||||
border: mergeMode !== MERGE_OFF ? '1px solid rgb(var(--x-info-rgb) / 0.45)' : '1px solid var(--border)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
transition: 'background 0.15s, color 0.15s',
|
||||
}}
|
||||
@@ -1862,7 +1863,7 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(239,68,68,0.18)', color: '#fca5a5',
|
||||
background: 'rgb(var(--x-danger-rgb) / 0.18)', color: 'var(--x-danger-ink)',
|
||||
border: 'none', cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -1876,7 +1877,7 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(34,197,94,0.18)', color: '#86efac',
|
||||
background: 'rgb(var(--x-success-rgb) / 0.18)', color: 'var(--x-success-ink)',
|
||||
border: 'none', cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -1890,8 +1891,8 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(34,197,94,0.22)', color: '#4ade80',
|
||||
border: '1px solid rgba(34,197,94,0.3)',
|
||||
background: 'rgb(var(--x-success-rgb) / 0.22)', color: 'var(--x-success)',
|
||||
border: '1px solid rgb(var(--x-success-rgb) / 0.3)',
|
||||
cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -1908,7 +1909,7 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(148,163,184,0.18)', color: '#cbd5e1',
|
||||
background: 'rgb(var(--x-ink-2-rgb) / 0.18)', color: 'var(--x-ink)',
|
||||
border: 'none', cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -1921,7 +1922,7 @@ export default function TableDetailPage() {
|
||||
{activeTab === 'paid' && (
|
||||
<div style={{ padding: '8px 0' }}>
|
||||
{paidItems.length === 0 ? (
|
||||
<p style={{ color: '#64748b', textAlign: 'center', padding: '24px 0', fontSize: 14 }}>
|
||||
<p style={{ color: 'var(--x-ink-3)', textAlign: 'center', padding: '24px 0', fontSize: 14 }}>
|
||||
{t('detail.noPaid')}
|
||||
</p>
|
||||
) : (
|
||||
@@ -1952,7 +1953,7 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(239,68,68,0.18)', color: '#fca5a5',
|
||||
background: 'rgb(var(--x-danger-rgb) / 0.18)', color: 'var(--x-danger-ink)',
|
||||
border: 'none', cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -1964,8 +1965,8 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(34,197,94,0.22)', color: '#4ade80',
|
||||
border: '1px solid rgba(34,197,94,0.3)',
|
||||
background: 'rgb(var(--x-success-rgb) / 0.22)', color: 'var(--x-success)',
|
||||
border: '1px solid rgb(var(--x-success-rgb) / 0.3)',
|
||||
cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -1990,7 +1991,7 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(96,165,250,0.18)', color: '#93c5fd',
|
||||
background: 'rgb(var(--x-info-rgb) / 0.18)', color: 'var(--x-info-ink)',
|
||||
border: 'none', cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -2003,8 +2004,8 @@ export default function TableDetailPage() {
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
height: 36, padding: '0 14px',
|
||||
borderRadius: 999,
|
||||
background: 'rgba(251,191,36,0.15)', color: '#fbbf24',
|
||||
border: '1px solid rgba(251,191,36,0.25)',
|
||||
background: 'rgb(var(--x-warning-rgb) / 0.15)', color: 'var(--x-warning)',
|
||||
border: '1px solid rgb(var(--x-warning-rgb) / 0.25)',
|
||||
cursor: 'pointer',
|
||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||
}}
|
||||
@@ -2044,7 +2045,7 @@ export default function TableDetailPage() {
|
||||
<span>€ PAY</span>
|
||||
{selectedIds.length > 0 && (
|
||||
<span style={{
|
||||
background: 'rgba(0,0,0,0.25)', color: 'white',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.25)', color: 'var(--x-on-colour)',
|
||||
borderRadius: 999, fontSize: 11, fontWeight: 700,
|
||||
padding: '1px 7px',
|
||||
}}>{selectedIds.length}</span>
|
||||
@@ -2098,18 +2099,18 @@ export default function TableDetailPage() {
|
||||
>
|
||||
<div style={{
|
||||
width: 36, height: 36, borderRadius: '50%', flexShrink: 0,
|
||||
background: active ? 'rgba(99,102,241,0.25)' : 'var(--bg3)',
|
||||
background: active ? 'rgb(var(--x-info-rgb) / 0.25)' : 'var(--bg3)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
border: active ? '2px solid #6366f1' : '2px solid transparent',
|
||||
border: active ? '2px solid var(--x-info)' : '2px solid transparent',
|
||||
}}>
|
||||
{active && (
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#a5b4fc" strokeWidth="2.5" strokeLinecap="round">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="var(--x-info-ink)" strokeWidth="2.5" strokeLinecap="round">
|
||||
<path d="M20 6L9 17l-5-5"/>
|
||||
</svg>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: active ? '#a5b4fc' : 'var(--text)', marginBottom: 2 }}>{label}</div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: active ? 'var(--x-info-ink)' : 'var(--text)', marginBottom: 2 }}>{label}</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--muted)' }}>{desc}</div>
|
||||
</div>
|
||||
</button>
|
||||
@@ -2259,7 +2260,7 @@ export default function TableDetailPage() {
|
||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{t('detail.revert.title')}</h2>
|
||||
<p style={{ color: '#94a3b8', textAlign: 'center', marginBottom: 24 }}>
|
||||
<p style={{ color: 'var(--x-ink-2)', textAlign: 'center', marginBottom: 24 }}>
|
||||
{revertConfirm.itemIds.length === 1
|
||||
? t('detail.revert.items', { count: 1 })
|
||||
: t('detail.revert.items', { count: revertConfirm.itemIds.length })}
|
||||
@@ -2286,7 +2287,7 @@ export default function TableDetailPage() {
|
||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{t('detail.close.title')}</h2>
|
||||
<p style={{ color: '#94a3b8', textAlign: 'center', marginBottom: 24 }}>
|
||||
<p style={{ color: 'var(--x-ink-2)', textAlign: 'center', marginBottom: 24 }}>
|
||||
{t('detail.close.body')}
|
||||
</p>
|
||||
<div style={{ display: 'flex', gap: 12 }}>
|
||||
@@ -2381,7 +2382,7 @@ export default function TableDetailPage() {
|
||||
: pendingTable.mode === 'merge' ? t('detail.move.confirmMerge')
|
||||
: t('detail.move.confirmItems')}
|
||||
</h2>
|
||||
<p style={{ textAlign: 'center', color: '#94a3b8', fontSize: 14, marginBottom: 4 }}>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-2)', fontSize: 14, marginBottom: 4 }}>
|
||||
{pendingTable.mode === 'transfer' ? t('detail.move.transferTo')
|
||||
: pendingTable.mode === 'merge' ? t('detail.move.mergeWith')
|
||||
: t('detail.move.itemsTo', { count: selectedIds.length })}
|
||||
|
||||
@@ -11,6 +11,7 @@ import client from '../api/client'
|
||||
import { getVenueSettings } from '../api/venueSettings'
|
||||
import db from '../db/posdb'
|
||||
import { FlagsIcon, TransferIcon, MergeIcon, PrintIcon, WaiterIcon } from '../components/Icons'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
|
||||
const _UNIT_LABELS = { kg: 'kg', liter: 'L', gram: 'g', ml: 'mL' }
|
||||
@@ -44,11 +45,11 @@ function CheckIcon({ width = 18, height = 18 }) {
|
||||
}
|
||||
|
||||
const QUICK_ACTIONS = [
|
||||
{ Icon: FlagsIcon, label: 'tables.actions.flags', key: 'flags', color: '#fac823', iconBg: 'rgba(251,191,36,0.15)' },
|
||||
{ Icon: TransferIcon, label: 'tables.actions.transfer', key: 'transfer', color: '#6099db', iconBg: 'rgba(96,165,250,0.15)' },
|
||||
{ Icon: MergeIcon, label: 'tables.actions.merge', key: 'merge', color: '#6099db', iconBg: 'rgba(96,165,250,0.15)' },
|
||||
{ Icon: PrintIcon, label: 'tables.actions.printSynopsis', key: 'print_synopsis', color: '#cbd5e1', iconBg: 'rgba(148,163,184,0.15)' },
|
||||
{ Icon: WaiterIcon, label: 'tables.actions.assignWaiter', key: 'assign_waiter', color: '#39b861', iconBg: 'rgba(34,197,94,0.15)' },
|
||||
{ Icon: FlagsIcon, label: 'tables.actions.flags', key: 'flags', color: 'var(--x-warning)', iconBg: 'rgb(var(--x-warning-rgb) / 0.15)' },
|
||||
{ Icon: TransferIcon, label: 'tables.actions.transfer', key: 'transfer', color: 'var(--x-info)', iconBg: 'rgb(var(--x-info-rgb) / 0.15)' },
|
||||
{ Icon: MergeIcon, label: 'tables.actions.merge', key: 'merge', color: 'var(--x-info)', iconBg: 'rgb(var(--x-info-rgb) / 0.15)' },
|
||||
{ Icon: PrintIcon, label: 'tables.actions.printSynopsis', key: 'print_synopsis', color: 'var(--x-ink)', iconBg: 'rgb(var(--x-ink-2-rgb) / 0.15)' },
|
||||
{ Icon: WaiterIcon, label: 'tables.actions.assignWaiter', key: 'assign_waiter', color: 'var(--x-success)', iconBg: 'rgb(var(--x-success-rgb) / 0.15)' },
|
||||
]
|
||||
|
||||
function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, onCancelOrder, onMarkAllServed, canCancel }) {
|
||||
@@ -81,12 +82,12 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
||||
</div>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 14 }}>
|
||||
<span style={{ color: 'var(--muted)' }}>{t('tables.quick.paid')}</span>
|
||||
<span style={{ fontWeight: 600, color: '#22c55e' }}>{fmtPrice(paid)}</span>
|
||||
<span style={{ fontWeight: 600, color: 'var(--x-success)' }}>{fmtPrice(paid)}</span>
|
||||
</div>
|
||||
{due > 0 && (
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 14 }}>
|
||||
<span style={{ color: 'var(--muted)' }}>{t('tables.quick.due')}</span>
|
||||
<span style={{ fontWeight: 700, color: '#f59e0b' }}>{fmtPrice(due)}</span>
|
||||
<span style={{ fontWeight: 700, color: 'var(--x-warning)' }}>{fmtPrice(due)}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -98,12 +99,12 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
||||
{flags.map(f => (
|
||||
<div key={f.id} style={{
|
||||
display: 'flex', alignItems: 'center', gap: 6,
|
||||
background: (f.color || '#6295F3') + '22',
|
||||
border: `1px solid ${f.color || '#6295F3'}`,
|
||||
background: fade(f.color || 'var(--x-info)', 0.13),
|
||||
border: `1px solid ${f.color || 'var(--x-info)'}`,
|
||||
borderRadius: 20, padding: '4px 10px',
|
||||
}}>
|
||||
<span style={{ fontSize: 14 }}>{f.emoji || '🏷️'}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 600, color: f.color || '#6295F3' }}>{f.name}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 600, color: f.color || 'var(--x-info)' }}>{f.name}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -148,10 +149,10 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
||||
cursor: disabled ? 'not-allowed' : 'pointer',
|
||||
opacity: disabled ? 0.35 : 1, textAlign: 'left',
|
||||
}}>
|
||||
<span style={{ width: 36, height: 36, borderRadius: 9, flexShrink: 0, background: 'rgba(34,197,94,0.12)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#4ade80' }}>
|
||||
<span style={{ width: 36, height: 36, borderRadius: 9, flexShrink: 0, background: 'rgb(var(--x-success-rgb) / 0.12)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'var(--x-success)' }}>
|
||||
<CheckIcon width="18" height="18" />
|
||||
</span>
|
||||
<span style={{ fontSize: 15, fontWeight: 600, color: '#4ade80' }}>{t('tables.quick.markAllServed')}</span>
|
||||
<span style={{ fontSize: 15, fontWeight: 600, color: 'var(--x-success)' }}>{t('tables.quick.markAllServed')}</span>
|
||||
</button>
|
||||
)
|
||||
})()}
|
||||
@@ -159,7 +160,7 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
||||
{(() => {
|
||||
const hasActiveItems = activeItems.length > 0
|
||||
const disabled = !order || !hasActiveItems
|
||||
const colour = canCancel && !disabled ? '#ef4444' : 'var(--muted)'
|
||||
const colour = canCancel && !disabled ? 'var(--x-danger)' : 'var(--muted)'
|
||||
return (
|
||||
<button
|
||||
disabled={!canCancel || disabled}
|
||||
@@ -170,7 +171,7 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
||||
cursor: canCancel && !disabled ? 'pointer' : 'not-allowed',
|
||||
opacity: canCancel && !disabled ? 1 : 0.35, textAlign: 'left',
|
||||
}}>
|
||||
<span style={{ width: 36, height: 36, borderRadius: 9, flexShrink: 0, background: 'rgba(239,68,68,0.12)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: colour }}>
|
||||
<span style={{ width: 36, height: 36, borderRadius: 9, flexShrink: 0, background: 'rgb(var(--x-danger-rgb) / 0.12)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: colour }}>
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round">
|
||||
<circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/>
|
||||
</svg>
|
||||
@@ -745,11 +746,11 @@ export default function TableListPage() {
|
||||
style={{
|
||||
position: 'fixed', bottom: 84, right: 24,
|
||||
width: 52, height: 52, borderRadius: '50%', border: 'none',
|
||||
background: hasActiveFilters ? 'var(--accent-dim,#92400e)' : 'var(--accent,#f59e0b)',
|
||||
color: hasActiveFilters ? '#fde68a' : 'var(--accent-fg,#1c1000)',
|
||||
background: hasActiveFilters ? 'var(--accent-dim,var(--x-warning))' : 'var(--accent,var(--x-warning))',
|
||||
color: hasActiveFilters ? 'var(--x-warning-ink)' : 'var(--accent-fg,rgb(var(--x-scrim-rgb) / 1))',
|
||||
cursor: 'pointer',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
boxShadow: '0 4px 20px rgba(245,158,11,0.55), 0 2px 8px rgba(0,0,0,0.35)',
|
||||
boxShadow: '0 4px 20px rgb(var(--x-warning-rgb) / 0.55), 0 2px 8px rgb(var(--x-scrim-rgb) / 0.35)',
|
||||
zIndex: 40, transition: 'background 0.12s',
|
||||
}}
|
||||
>
|
||||
@@ -757,7 +758,7 @@ export default function TableListPage() {
|
||||
{hasActiveFilters && (
|
||||
<span style={{
|
||||
position: 'absolute', top: 0, right: 0,
|
||||
background: '#ef4444', color: '#fff',
|
||||
background: 'var(--x-danger)', color: 'var(--x-danger-fg)',
|
||||
fontSize: 9, fontWeight: 800,
|
||||
borderRadius: '50%', width: 16, height: 16,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
@@ -818,7 +819,7 @@ export default function TableListPage() {
|
||||
<p style={{ fontSize: 14, color: 'var(--muted)', marginBottom: 20 }}>{t('tables.cancelConfirmBody')}</p>
|
||||
<div style={{ display: 'flex', gap: 10 }}>
|
||||
<button className="btn btn--secondary" style={{ flex: 1 }} onClick={() => setCancelConfirm(null)}>{t('common.cancel')}</button>
|
||||
<button className="btn" style={{ flex: 1, background: '#ef4444', color: '#fff' }} onClick={() => executeCancelOrder(cancelConfirm.orderId)}>{t('common.confirm')}</button>
|
||||
<button className="btn" style={{ flex: 1, background: 'var(--x-danger)', color: 'var(--x-danger-fg)' }} onClick={() => executeCancelOrder(cancelConfirm.orderId)}>{t('common.confirm')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -842,7 +843,7 @@ const KDS_FILTER_CHIPS = [
|
||||
<rect x="14" y="14" width="7" height="7" rx="1.5" fill="currentColor"/>
|
||||
</svg>
|
||||
),
|
||||
color: '#94a3b8', activeBg: '#334155', activeColor: '#e2e8f0',
|
||||
color: 'var(--x-ink-2)', activeBg: 'var(--x-surface-3)', activeColor: 'var(--x-ink)',
|
||||
},
|
||||
{
|
||||
key: 'pending',
|
||||
@@ -852,7 +853,7 @@ const KDS_FILTER_CHIPS = [
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z" fill="currentColor"/>
|
||||
</svg>
|
||||
),
|
||||
color: '#f59e0b', activeBg: 'rgba(245,158,11,0.25)', activeColor: '#fbbf24',
|
||||
color: 'var(--x-warning)', activeBg: 'rgb(var(--x-warning-rgb) / 0.25)', activeColor: 'var(--x-warning)',
|
||||
},
|
||||
{
|
||||
key: 'preparing',
|
||||
@@ -862,7 +863,7 @@ const KDS_FILTER_CHIPS = [
|
||||
<path d="M13.5 0.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z" fill="currentColor"/>
|
||||
</svg>
|
||||
),
|
||||
color: '#60a5fa', activeBg: 'rgba(96,165,250,0.25)', activeColor: '#93c5fd',
|
||||
color: 'var(--x-info)', activeBg: 'rgb(var(--x-info-rgb) / 0.25)', activeColor: 'var(--x-info-ink)',
|
||||
},
|
||||
{
|
||||
key: 'ready',
|
||||
@@ -873,7 +874,7 @@ const KDS_FILTER_CHIPS = [
|
||||
<path d="M7 12l3.5 3.5L17 8" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
),
|
||||
color: '#4ade80', activeBg: 'rgba(34,197,94,0.25)', activeColor: '#86efac',
|
||||
color: 'var(--x-success)', activeBg: 'rgb(var(--x-success-rgb) / 0.25)', activeColor: 'var(--x-success-ink)',
|
||||
},
|
||||
{
|
||||
key: 'ready_items',
|
||||
@@ -884,14 +885,14 @@ const KDS_FILTER_CHIPS = [
|
||||
<path d="M12 2a10 10 0 0 0 0 20V2z" fill="currentColor"/>
|
||||
</svg>
|
||||
),
|
||||
color: '#34d399', activeBg: 'rgba(52,211,153,0.22)', activeColor: '#6ee7b7',
|
||||
color: 'var(--x-success)', activeBg: 'rgb(var(--x-success-rgb) / 0.22)', activeColor: 'var(--x-success)',
|
||||
},
|
||||
]
|
||||
|
||||
const KDS_ITEM_COLORS = {
|
||||
pending: { textColor: '#f59e0b', label: 'kds.pending' },
|
||||
preparing: { textColor: '#60a5fa', label: 'kds.preparing' },
|
||||
done: { textColor: '#4ade80', label: 'kds.ready' },
|
||||
pending: { textColor: 'var(--x-warning)', label: 'kds.pending' },
|
||||
preparing: { textColor: 'var(--x-info)', label: 'kds.preparing' },
|
||||
done: { textColor: 'var(--x-success)', label: 'kds.ready' },
|
||||
served: { textColor: null, label: null },
|
||||
}
|
||||
|
||||
@@ -1038,10 +1039,10 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
||||
const preparing = items.filter(i => kds(i.kds_status) === 'preparing').length
|
||||
const done = items.filter(i => kds(i.kds_status) === 'done').length
|
||||
const total = items.length
|
||||
if (done === total) return { label: t('kds.ready'), color: '#4ade80', bg: 'rgba(34,197,94,0.15)' }
|
||||
if (preparing > 0) return { label: t('kds.preparing'), color: '#60a5fa', bg: 'rgba(96,165,250,0.15)' }
|
||||
if (pending === total) return { label: t('kds.pending'), color: '#f59e0b', bg: 'rgba(245,158,11,0.15)' }
|
||||
return { label: t('kds.someReady', { done, total }), color: '#4ade80', bg: 'rgba(34,197,94,0.12)' }
|
||||
if (done === total) return { label: t('kds.ready'), color: 'var(--x-success)', bg: 'rgb(var(--x-success-rgb) / 0.15)' }
|
||||
if (preparing > 0) return { label: t('kds.preparing'), color: 'var(--x-info)', bg: 'rgb(var(--x-info-rgb) / 0.15)' }
|
||||
if (pending === total) return { label: t('kds.pending'), color: 'var(--x-warning)', bg: 'rgb(var(--x-warning-rgb) / 0.15)' }
|
||||
return { label: t('kds.someReady', { done, total }), color: 'var(--x-success)', bg: 'rgb(var(--x-success-rgb) / 0.12)' }
|
||||
}
|
||||
|
||||
// Count per filter for badge
|
||||
@@ -1097,7 +1098,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
||||
{showIcon && <span style={{ display: 'inline-flex', alignItems: 'center', flexShrink: 0 }}>{chip.icon}</span>}
|
||||
{showText && <span style={{ lineHeight: 1 }}>{textLabel}</span>}
|
||||
<span style={{
|
||||
background: active ? `${chip.color}30` : 'rgba(255,255,255,0.08)',
|
||||
background: active ? `${fade(chip.color, 0.19)}` : 'rgb(var(--x-ink-rgb) / 0.08)',
|
||||
color: active ? chip.activeColor : 'var(--muted)',
|
||||
borderRadius: 10, fontSize: 11, fontWeight: 800,
|
||||
padding: '1px 6px', lineHeight: 1,
|
||||
@@ -1168,7 +1169,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
||||
height: 20, padding: '0 8px', borderRadius: 4,
|
||||
background: kdsLabel.bg, color: kdsLabel.color,
|
||||
fontSize: 10, fontWeight: 800, letterSpacing: 0.3,
|
||||
border: `1px solid ${kdsLabel.color}40`,
|
||||
border: `1px solid ${fade(kdsLabel.color, 0.25)}`,
|
||||
}}>{kdsLabel.label}</span>
|
||||
)}
|
||||
|
||||
@@ -1204,7 +1205,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
||||
<span style={{
|
||||
fontSize: 9, fontWeight: 800, color: kdsC.textColor,
|
||||
borderRadius: 3, padding: '1px 5px',
|
||||
border: `1px solid ${kdsC.textColor}60`,
|
||||
border: `1px solid ${fade(kdsC.textColor, 0.38)}`,
|
||||
}}>{t(kdsC.label)}</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -1225,7 +1226,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
||||
onClick={() => onMarkAllServed(o.id)}
|
||||
style={{
|
||||
flex: 1, height: 34, borderRadius: 8, border: 'none',
|
||||
background: 'rgba(34,197,94,0.15)', color: '#4ade80',
|
||||
background: 'rgb(var(--x-success-rgb) / 0.15)', color: 'var(--x-success)',
|
||||
fontSize: 13, fontWeight: 700, cursor: 'pointer',
|
||||
}}
|
||||
>{t('orders.markServed')}</button>
|
||||
@@ -1244,11 +1245,11 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
||||
style={{
|
||||
position: 'fixed', bottom: 84, right: 24,
|
||||
width: 52, height: 52, borderRadius: '50%', border: 'none',
|
||||
background: hasActiveOrderFilters ? 'var(--accent-dim,#92400e)' : 'var(--accent,#f59e0b)',
|
||||
color: hasActiveOrderFilters ? '#fde68a' : 'var(--accent-fg,#1c1000)',
|
||||
background: hasActiveOrderFilters ? 'var(--accent-dim,var(--x-warning))' : 'var(--accent,var(--x-warning))',
|
||||
color: hasActiveOrderFilters ? 'var(--x-warning-ink)' : 'var(--accent-fg,rgb(var(--x-scrim-rgb) / 1))',
|
||||
cursor: 'pointer',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
boxShadow: '0 4px 20px rgba(245,158,11,0.55), 0 2px 8px rgba(0,0,0,0.35)',
|
||||
boxShadow: '0 4px 20px rgb(var(--x-warning-rgb) / 0.55), 0 2px 8px rgb(var(--x-scrim-rgb) / 0.35)',
|
||||
zIndex: 40, transition: 'background 0.12s',
|
||||
}}
|
||||
>
|
||||
@@ -1256,7 +1257,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
||||
{hasActiveOrderFilters && (
|
||||
<span style={{
|
||||
position: 'absolute', top: 0, right: 0,
|
||||
background: '#ef4444', color: '#fff',
|
||||
background: 'var(--x-danger)', color: 'var(--x-danger-fg)',
|
||||
fontSize: 9, fontWeight: 800,
|
||||
borderRadius: '50%', width: 16, height: 16,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
@@ -1292,20 +1293,20 @@ function StandaloneOrderCard({ order, onClick }) {
|
||||
const total = [...activeItems, ...paidItems].reduce((s, i) => s + (i.unit_price + (i.price_adjustment || 0)) * i.quantity, 0)
|
||||
|
||||
const statusColor = {
|
||||
open: '#f59e0b',
|
||||
partially_paid: '#60a5fa',
|
||||
paid: '#4ade80',
|
||||
}[order.status] || '#94a3b8'
|
||||
open: 'var(--x-warning)',
|
||||
partially_paid: 'var(--x-info)',
|
||||
paid: 'var(--x-success)',
|
||||
}[order.status] || 'var(--x-ink-2)'
|
||||
|
||||
const kds = order.kds_status || 'pending'
|
||||
const kdsColor = { pending: '#f59e0b', preparing: '#60a5fa', done: '#4ade80', served: '#94a3b8' }[kds] || '#94a3b8'
|
||||
const kdsColor = { pending: 'var(--x-warning)', preparing: 'var(--x-info)', done: 'var(--x-success)', served: 'var(--x-ink-2)' }[kds] || 'var(--x-ink-2)'
|
||||
|
||||
return (
|
||||
<div
|
||||
onClick={onClick}
|
||||
style={{
|
||||
background: 'var(--bg2)',
|
||||
border: `2px solid ${isDelivery ? 'rgba(96,165,250,0.35)' : 'rgba(245,158,11,0.35)'}`,
|
||||
border: `2px solid ${isDelivery ? 'rgb(var(--x-info-rgb) / 0.35)' : 'rgb(var(--x-warning-rgb) / 0.35)'}`,
|
||||
borderRadius: 14,
|
||||
padding: '12px 14px',
|
||||
cursor: 'pointer',
|
||||
@@ -1322,9 +1323,9 @@ function StandaloneOrderCard({ order, onClick }) {
|
||||
position: 'absolute', top: 8, right: 8,
|
||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.5,
|
||||
padding: '2px 7px', borderRadius: 6,
|
||||
background: isDelivery ? 'rgba(96,165,250,0.18)' : 'rgba(245,158,11,0.18)',
|
||||
color: isDelivery ? '#93c5fd' : '#fbbf24',
|
||||
border: `1px solid ${isDelivery ? '#60a5fa44' : '#f59e0b44'}`,
|
||||
background: isDelivery ? 'rgb(var(--x-info-rgb) / 0.18)' : 'rgb(var(--x-warning-rgb) / 0.18)',
|
||||
color: isDelivery ? 'var(--x-info-ink)' : 'var(--x-warning)',
|
||||
border: `1px solid ${isDelivery ? 'rgb(var(--x-info-rgb) / 0.27)' : 'rgb(var(--x-warning-rgb) / 0.27)'}`,
|
||||
}}>
|
||||
{isDelivery ? 'DELIVERY' : 'TAKEAWAY'}
|
||||
</span>
|
||||
@@ -1339,8 +1340,8 @@ function StandaloneOrderCard({ order, onClick }) {
|
||||
<span style={{
|
||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
||||
padding: '2px 6px', borderRadius: 4,
|
||||
background: `${statusColor}22`, color: statusColor,
|
||||
border: `1px solid ${statusColor}44`,
|
||||
background: `${fade(statusColor, 0.13)}`, color: statusColor,
|
||||
border: `1px solid ${fade(statusColor, 0.27)}`,
|
||||
}}>
|
||||
{{ open: t('card.open'), partially_paid: t('card.partlyPaid'), paid: t('card.paid') }[order.status] || order.status.toUpperCase()}
|
||||
</span>
|
||||
@@ -1348,8 +1349,8 @@ function StandaloneOrderCard({ order, onClick }) {
|
||||
<span style={{
|
||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
||||
padding: '2px 6px', borderRadius: 4,
|
||||
background: `${kdsColor}22`, color: kdsColor,
|
||||
border: `1px solid ${kdsColor}44`,
|
||||
background: `${fade(kdsColor, 0.13)}`, color: kdsColor,
|
||||
border: `1px solid ${fade(kdsColor, 0.27)}`,
|
||||
}}>
|
||||
{{ pending: t('kds.pending'), preparing: t('kds.preparing'), done: t('kds.ready') }[kds] || kds.toUpperCase()}
|
||||
</span>
|
||||
@@ -1372,8 +1373,8 @@ function NewStandaloneCard({ label, color, icon, onClick }) {
|
||||
<div
|
||||
onClick={onClick}
|
||||
style={{
|
||||
background: `${color}0f`,
|
||||
border: `2px dashed ${color}55`,
|
||||
background: `${fade(color, 0.06)}`,
|
||||
border: `2px dashed ${fade(color, 0.33)}`,
|
||||
borderRadius: 14,
|
||||
padding: '12px 14px',
|
||||
cursor: 'pointer',
|
||||
@@ -1411,13 +1412,13 @@ function StandaloneView({ orders, gridCols, navigate }) {
|
||||
{/* Fixed action cards always at top */}
|
||||
<NewStandaloneCard
|
||||
label={t('orders.newTakeaway')}
|
||||
color="#f59e0b"
|
||||
color="var(--x-warning)"
|
||||
icon="🥡"
|
||||
onClick={() => navigate('/standalone/takeaway/add?new=1')}
|
||||
/>
|
||||
<NewStandaloneCard
|
||||
label={t('orders.newDelivery')}
|
||||
color="#60a5fa"
|
||||
color="var(--x-info)"
|
||||
icon="🛵"
|
||||
onClick={() => navigate('/standalone/delivery/add?new=1')}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user