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:
@@ -78,9 +78,9 @@ function GateBtn({ onClick, disabled, variant = 'primary', children }) {
|
||||
opacity: disabled ? 0.6 : 1, transition: 'opacity 120ms',
|
||||
}
|
||||
const styles = {
|
||||
primary: { background: 'var(--accent)', color: '#0f172a' },
|
||||
primary: { background: 'var(--accent)', color: 'var(--x-canvas)' },
|
||||
secondary: { background: 'var(--bg3)', color: 'var(--text)' },
|
||||
danger: { background: 'var(--danger)', color: '#fff' },
|
||||
danger: { background: 'var(--danger)', color: 'var(--x-danger-fg)' },
|
||||
}
|
||||
return <button style={{ ...base, ...styles[variant] }} onClick={onClick} disabled={disabled}>{children}</button>
|
||||
}
|
||||
@@ -331,11 +331,17 @@ function OfflineListener() {
|
||||
return null
|
||||
}
|
||||
|
||||
// Light / dark from the user menu (per phone), the accent colour from the venue (bootstrap
|
||||
// venue.theme, Settings → Venue; plan step 4.6). The waiter's colours are @xenia/ui tokens.
|
||||
function ThemeApplier() {
|
||||
const dark = useThemeStore(s => s.dark)
|
||||
const venueTheme = useAccess()?.venue?.theme || 'amber'
|
||||
useEffect(() => {
|
||||
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light')
|
||||
}, [dark])
|
||||
useEffect(() => {
|
||||
document.documentElement.setAttribute('data-venue-theme', venueTheme)
|
||||
}, [venueTheme])
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import useKdsReadyStore from '../store/kdsReadyStore'
|
||||
import useInstallPromptStore, { apkAvailable } from '../store/installPromptStore'
|
||||
import useOfflineQueueCount from '../hooks/useOfflineQueueCount'
|
||||
import useFailedPrintCount from '../hooks/useFailedPrintCount'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
// ─── Nav item registry ────────────────────────────────────────────────────────
|
||||
|
||||
@@ -121,7 +122,7 @@ function CacheButton({ count }) {
|
||||
position: 'relative',
|
||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||
minWidth: 44, minHeight: 44, borderRadius: 8,
|
||||
color: '#f59e0b',
|
||||
color: 'var(--x-warning)',
|
||||
}}>
|
||||
{/* Cloud upload icon */}
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none">
|
||||
@@ -130,7 +131,7 @@ function CacheButton({ count }) {
|
||||
</svg>
|
||||
<span style={{
|
||||
position: 'absolute', top: 6, right: 6,
|
||||
background: '#f59e0b', color: 'white', fontSize: 10, fontWeight: 700,
|
||||
background: 'var(--x-warning)', color: 'var(--x-warning-fg)', fontSize: 10, fontWeight: 700,
|
||||
borderRadius: '50%', width: 16, height: 16,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
}}>
|
||||
@@ -152,7 +153,7 @@ function FailedPrintButton({ count, onClick }) {
|
||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||
minWidth: 44, minHeight: 44, borderRadius: 8,
|
||||
background: 'none', border: 'none', cursor: 'pointer',
|
||||
color: '#ef4444',
|
||||
color: 'var(--x-danger)',
|
||||
}}
|
||||
>
|
||||
{/* Printer icon */}
|
||||
@@ -163,7 +164,7 @@ function FailedPrintButton({ count, onClick }) {
|
||||
</svg>
|
||||
<span style={{
|
||||
position: 'absolute', top: 6, right: 6,
|
||||
background: '#ef4444', color: 'white', fontSize: 10, fontWeight: 700,
|
||||
background: 'var(--x-danger)', color: 'var(--x-danger-fg)', fontSize: 10, fontWeight: 700,
|
||||
borderRadius: '50%', width: 16, height: 16,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
}}>
|
||||
@@ -193,7 +194,7 @@ function BellButton({ onClick, count }) {
|
||||
{count > 0 && (
|
||||
<span style={{
|
||||
position: 'absolute', top: 6, right: 6,
|
||||
background: '#ef4444', color: 'white', fontSize: 10, fontWeight: 700,
|
||||
background: 'var(--x-danger)', color: 'var(--x-danger-fg)', fontSize: 10, fontWeight: 700,
|
||||
borderRadius: '50%', width: 16, height: 16,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
}}>
|
||||
@@ -230,7 +231,7 @@ function NotificationDrawer({ messages, onClose }) {
|
||||
<span style={{ fontSize: 20, flexShrink: 0 }}>📢</span>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
{msg.sender_name && (
|
||||
<div style={{ fontSize: 11, fontWeight: 700, color: '#a5b4fc', marginBottom: 2 }}>{msg.sender_name}</div>
|
||||
<div style={{ fontSize: 11, fontWeight: 700, color: 'var(--x-info-ink)', marginBottom: 2 }}>{msg.sender_name}</div>
|
||||
)}
|
||||
<div style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>{msg.body}</div>
|
||||
{tableIds.length > 0 && (
|
||||
@@ -349,7 +350,7 @@ function DrawerButton({ item, location, onNavigate, active: activeProp, onClick
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 14,
|
||||
padding: '12px 14px', borderRadius: 12, border: 'none',
|
||||
background: active ? 'var(--accent)18' : 'transparent',
|
||||
background: active ? fade('var(--accent)', 0.09) : 'transparent',
|
||||
color: active ? 'var(--accent)' : 'var(--text)',
|
||||
fontSize: 15, fontWeight: active ? 700 : 500,
|
||||
cursor: 'pointer', textAlign: 'left', width: '100%',
|
||||
@@ -391,7 +392,7 @@ function SideDrawer({ open, onClose }) {
|
||||
onClick={onClose}
|
||||
style={{
|
||||
position: 'fixed', inset: 0, zIndex: 300,
|
||||
background: 'rgba(0,0,0,0.55)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.55)',
|
||||
opacity: open ? 1 : 0,
|
||||
pointerEvents: open ? 'all' : 'none',
|
||||
transition: 'opacity 0.22s ease',
|
||||
@@ -406,7 +407,7 @@ function SideDrawer({ open, onClose }) {
|
||||
display: 'flex', flexDirection: 'column',
|
||||
transform: open ? 'translateX(0)' : 'translateX(-100%)',
|
||||
transition: 'transform 0.22s ease',
|
||||
boxShadow: open ? '4px 0 24px rgba(0,0,0,0.4)' : 'none',
|
||||
boxShadow: open ? '4px 0 24px rgb(var(--x-scrim-rgb) / 0.4)' : 'none',
|
||||
}}>
|
||||
{/* Drawer header */}
|
||||
<div style={{ padding: '20px 20px 16px', borderBottom: '1px solid var(--border)' }}>
|
||||
@@ -451,11 +452,11 @@ function SideDrawer({ open, onClose }) {
|
||||
|
||||
// ─── Triple pill footer ───────────────────────────────────────────────────────
|
||||
|
||||
function PillBadge({ count, color = '#ef4444' }) {
|
||||
function PillBadge({ count, color = 'var(--x-danger)' }) {
|
||||
if (!count) return null
|
||||
return (
|
||||
<span style={{
|
||||
background: color, color: 'white', fontSize: 12, fontWeight: 800,
|
||||
background: color, color: 'var(--x-on-colour)', fontSize: 12, fontWeight: 800,
|
||||
borderRadius: 11, minWidth: 22, height: 22,
|
||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||
padding: '0 6px', lineHeight: 1, flexShrink: 0,
|
||||
@@ -494,9 +495,9 @@ function TripleFooter({ location, navigate, chatUnread, kdsReady, tripleItems })
|
||||
? item.match(location) && !isStandaloneActive
|
||||
: item.match(location)
|
||||
const badge = item.key === 'messages' && chatUnread > 0
|
||||
? { count: chatUnread, color: '#ef4444' }
|
||||
? { count: chatUnread, color: 'var(--x-danger)' }
|
||||
: item.key === 'orders' && kdsReady > 0
|
||||
? { count: kdsReady, color: '#22c55e' }
|
||||
? { count: kdsReady, color: 'var(--x-success)' }
|
||||
: null
|
||||
return (
|
||||
<button
|
||||
@@ -564,9 +565,9 @@ function IconNavbar({ navItems, location, navigate, chatUnread, kdsReady }) {
|
||||
? item.match(location) && !isStandaloneActive
|
||||
: item.match(location)
|
||||
const badge = item.key === 'messages' && chatUnread > 0
|
||||
? { count: chatUnread, color: '#ef4444' }
|
||||
? { count: chatUnread, color: 'var(--x-danger)' }
|
||||
: item.key === 'orders' && kdsReady > 0
|
||||
? { count: kdsReady, color: '#22c55e' }
|
||||
? { count: kdsReady, color: 'var(--x-success)' }
|
||||
: null
|
||||
return (
|
||||
<button
|
||||
@@ -594,7 +595,7 @@ function IconNavbar({ navItems, location, navigate, chatUnread, kdsReady }) {
|
||||
{badge && (
|
||||
<span style={{
|
||||
position: 'absolute', top: -4, right: -6,
|
||||
background: badge.color, color: 'white', fontSize: 9, fontWeight: 800,
|
||||
background: badge.color, color: 'var(--x-on-colour)', fontSize: 9, fontWeight: 800,
|
||||
borderRadius: '50%', minWidth: 14, height: 14,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
padding: '0 2px',
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function BundleSync() {
|
||||
position: 'fixed', bottom: 80, left: 12, right: 12, zIndex: 9998,
|
||||
background: 'var(--bg2)', border: '1px solid var(--accent)', borderRadius: 16,
|
||||
padding: '12px 14px', display: 'flex', alignItems: 'center', gap: 12,
|
||||
boxShadow: '0 8px 32px rgba(0,0,0,0.4)',
|
||||
boxShadow: '0 8px 32px rgb(var(--x-scrim-rgb) / 0.4)',
|
||||
}}>
|
||||
<span style={{ flex: 1, fontSize: 13, color: 'var(--text)', lineHeight: 1.35 }}>
|
||||
{t('update.needsNewerApp')}
|
||||
@@ -56,7 +56,7 @@ export default function BundleSync() {
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
style={{
|
||||
background: 'var(--accent)', color: '#0f172a', borderRadius: 10, padding: '8px 14px',
|
||||
background: 'var(--accent)', color: 'var(--x-canvas)', borderRadius: 10, padding: '8px 14px',
|
||||
fontSize: 14, fontWeight: 700, textDecoration: 'none', whiteSpace: 'nowrap',
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import useConnectionStore from '../store/connectionStore'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
/**
|
||||
* A 3px bar pinned to the very top of the screen (above the header).
|
||||
@@ -17,10 +18,10 @@ export default function ConnectivityBar() {
|
||||
const isReconnecting = status === 'reconnecting'
|
||||
|
||||
const color = isOnline
|
||||
? (liveAlive ? '#22c55e' : '#3b82f6')
|
||||
? (liveAlive ? 'var(--x-success)' : 'var(--x-info)')
|
||||
: isReconnecting
|
||||
? '#f59e0b'
|
||||
: '#ef4444'
|
||||
? 'var(--x-warning)'
|
||||
: 'var(--x-danger)'
|
||||
|
||||
const animated = !isOnline
|
||||
|
||||
@@ -67,7 +68,7 @@ export default function ConnectivityBar() {
|
||||
style={{
|
||||
'--cb-color': color,
|
||||
backgroundColor: color,
|
||||
boxShadow: `0 0 6px 1px ${color}99`,
|
||||
boxShadow: `0 0 6px 1px ${fade(color, 0.6)}`,
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function InstallAppDialog() {
|
||||
<div
|
||||
onClick={dismiss}
|
||||
style={{
|
||||
position: 'fixed', inset: 0, zIndex: 10000, background: 'rgba(0,0,0,0.6)',
|
||||
position: 'fixed', inset: 0, zIndex: 10000, background: 'rgb(var(--x-scrim-rgb) / 0.6)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 16,
|
||||
}}
|
||||
>
|
||||
@@ -45,7 +45,7 @@ export default function InstallAppDialog() {
|
||||
style={{
|
||||
width: '100%', maxWidth: 360, maxHeight: '92vh', overflowY: 'auto',
|
||||
background: 'var(--bg2)', border: '1px solid var(--border)', borderRadius: 22,
|
||||
boxShadow: '0 16px 48px rgba(0,0,0,0.5)', padding: '26px 22px 20px',
|
||||
boxShadow: '0 16px 48px rgb(var(--x-scrim-rgb) / 0.5)', padding: '26px 22px 20px',
|
||||
display: 'flex', flexDirection: 'column', gap: 18,
|
||||
}}
|
||||
>
|
||||
@@ -55,7 +55,7 @@ export default function InstallAppDialog() {
|
||||
alt=""
|
||||
width={76}
|
||||
height={76}
|
||||
style={{ borderRadius: 18, boxShadow: '0 6px 20px rgba(0,0,0,0.35)' }}
|
||||
style={{ borderRadius: 18, boxShadow: '0 6px 20px rgb(var(--x-scrim-rgb) / 0.35)' }}
|
||||
/>
|
||||
<h2 id="install-app-title" style={{ fontSize: 20, fontWeight: 800, color: 'var(--text)', margin: '14px 0 4px' }}>
|
||||
{t('install.title')}
|
||||
|
||||
@@ -104,8 +104,8 @@ function CheckCircle({ selected }) {
|
||||
return (
|
||||
<div style={{
|
||||
width: 24, height: 24, borderRadius: '50%', flexShrink: 0,
|
||||
border: `2px solid ${selected ? '#f59e0b' : 'var(--border)'}`,
|
||||
background: selected ? '#f59e0b' : 'transparent',
|
||||
border: `2px solid ${selected ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||
background: selected ? 'var(--x-warning)' : 'transparent',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
transition: 'all 120ms ease',
|
||||
}}>
|
||||
@@ -118,12 +118,12 @@ function RadioDot({ selected }) {
|
||||
return (
|
||||
<div style={{
|
||||
width: 22, height: 22, borderRadius: '50%', flexShrink: 0,
|
||||
border: `2px solid ${selected ? '#f59e0b' : 'var(--border)'}`,
|
||||
border: `2px solid ${selected ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||
background: 'transparent',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
transition: 'all 120ms ease',
|
||||
}}>
|
||||
{selected && <div style={{ width: 10, height: 10, borderRadius: '50%', background: '#f59e0b' }} />}
|
||||
{selected && <div style={{ width: 10, height: 10, borderRadius: '50%', background: 'var(--x-warning)' }} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -132,8 +132,8 @@ function Row({ selected, onClick, children, right, left, style = {} }) {
|
||||
return (
|
||||
<div onClick={onClick} style={{
|
||||
padding: '12px 14px',
|
||||
background: selected ? 'rgba(245,158,11,0.12)' : 'var(--bg2)',
|
||||
border: `1px solid ${selected ? 'rgba(245,158,11,0.4)' : 'var(--border)'}`,
|
||||
background: selected ? 'rgb(var(--x-warning-rgb) / 0.12)' : 'var(--bg2)',
|
||||
border: `1px solid ${selected ? 'rgb(var(--x-warning-rgb) / 0.4)' : 'var(--border)'}`,
|
||||
borderRadius: 12,
|
||||
display: 'flex', alignItems: 'center', gap: 12,
|
||||
cursor: onClick ? 'pointer' : 'default',
|
||||
@@ -249,16 +249,16 @@ function ExtraOptionRow({ opt, extrasState, setExtrasState, expandedExtra, setEx
|
||||
<div style={{ fontSize: compact ? 13 : 15, fontWeight: 500, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{opt.name}</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 2 }}>
|
||||
{(opt.extra_cost ?? 0) !== 0 ? `+${money(opt.extra_cost)}` : t('drawer.included')}
|
||||
{subLabel && <span style={{ color: '#f59e0b', fontWeight: 600 }}> · {subLabel}</span>}
|
||||
{subLabel && <span style={{ color: 'var(--x-warning)', fontWeight: 600 }}> · {subLabel}</span>}
|
||||
{isMultiSelect && selectedSubCount > 0 && (
|
||||
<span style={{ color: '#f59e0b', fontWeight: 600 }}> · {t('drawer.selectedCount', { count: selectedSubCount })}</span>
|
||||
<span style={{ color: 'var(--x-warning)', fontWeight: 600 }}> · {t('drawer.selectedCount', { count: selectedSubCount })}</span>
|
||||
)}
|
||||
</div>
|
||||
</Row>
|
||||
|
||||
{/* Single-select sub-choices (radio) */}
|
||||
{selected && open && hasSubs && !isMultiSelect && (
|
||||
<div style={{ margin: '6px 0 2px 16px', paddingLeft: 14, borderLeft: '2px solid rgba(245,158,11,0.3)', display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||
<div style={{ margin: '6px 0 2px 16px', paddingLeft: 14, borderLeft: '2px solid rgb(var(--x-warning-rgb) / 0.3)', display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||
<div style={{ width: '100%', fontSize: 11, fontWeight: 700, color: 'var(--muted)', textTransform: 'uppercase', letterSpacing: 0.6, padding: '6px 2px 2px' }}>{t('drawer.choose')}</div>
|
||||
{opt.sub_choices.map((sub, si) => {
|
||||
const isSel = sel.subName === sub.name
|
||||
@@ -281,7 +281,7 @@ function ExtraOptionRow({ opt, extrasState, setExtrasState, expandedExtra, setEx
|
||||
|
||||
{/* Multi-select sub-choices (checkboxes, optional qty stepper per sub) */}
|
||||
{selected && open && hasSubs && isMultiSelect && (
|
||||
<div style={{ margin: '6px 0 2px 16px', paddingLeft: 14, borderLeft: '2px solid rgba(245,158,11,0.3)', display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||
<div style={{ margin: '6px 0 2px 16px', paddingLeft: 14, borderLeft: '2px solid rgb(var(--x-warning-rgb) / 0.3)', display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||
<div style={{ width: '100%', fontSize: 11, fontWeight: 700, color: 'var(--muted)', textTransform: 'uppercase', letterSpacing: 0.6, padding: '6px 2px 2px' }}>{t('drawer.chooseMany')}</div>
|
||||
{opt.sub_choices.map((sub, si) => {
|
||||
const subQty = subs[sub.name] || 0
|
||||
@@ -335,7 +335,7 @@ function IngredientRow({ ing, removedState, setRemovedState, compact }) {
|
||||
height: 32, padding: '0 12px', borderRadius: 16,
|
||||
background: removed ? 'var(--danger)' : 'var(--bg3)',
|
||||
border: `1px solid ${removed ? 'var(--danger)' : 'var(--border)'}`,
|
||||
color: removed ? '#fff' : 'var(--text)',
|
||||
color: removed ? 'var(--x-ink)' : 'var(--text)',
|
||||
fontSize: compact ? 11 : 13, fontWeight: 600,
|
||||
display: 'inline-flex', alignItems: 'center',
|
||||
transition: 'all 120ms ease', whiteSpace: 'nowrap',
|
||||
@@ -371,8 +371,8 @@ function PrefSetBlock({ ps, prefs, setPrefs, subChoices, setSubChoices, sharedSu
|
||||
return (
|
||||
<div>
|
||||
<div style={{ display: 'flex', alignItems: 'baseline', gap: 8, padding: '0 2px 10px' }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: complete ? 'var(--text)' : '#ef4444' }}>{ps.name}</div>
|
||||
{!complete && <div style={{ fontSize: 11, fontWeight: 700, color: '#ef4444', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('drawer.required')}</div>}
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: complete ? 'var(--text)' : 'var(--x-danger)' }}>{ps.name}</div>
|
||||
{!complete && <div style={{ fontSize: 11, fontWeight: 700, color: 'var(--x-danger)', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('drawer.required')}</div>}
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
|
||||
{ps.choices.map(ch => {
|
||||
@@ -389,8 +389,8 @@ function PrefSetBlock({ ps, prefs, setPrefs, subChoices, setSubChoices, sharedSu
|
||||
</Row>
|
||||
|
||||
{isSel && hasSubs && (
|
||||
<div style={{ margin: '6px 0 2px 16px', paddingLeft: 14, borderLeft: `2px solid ${subMissing ? '#ef4444' : 'rgba(245,158,11,0.3)'}`, display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||
{subMissing && <p style={{ width: '100%', fontSize: 12, color: '#ef4444', margin: '4px 2px 2px' }}>{t('drawer.choiceRequired')}</p>}
|
||||
<div style={{ margin: '6px 0 2px 16px', paddingLeft: 14, borderLeft: `2px solid ${subMissing ? 'var(--x-danger)' : 'rgb(var(--x-warning-rgb) / 0.3)'}`, display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||
{subMissing && <p style={{ width: '100%', fontSize: 12, color: 'var(--x-danger)', margin: '4px 2px 2px' }}>{t('drawer.choiceRequired')}</p>}
|
||||
{ch.sub_choices.map((sub, si) => {
|
||||
const subSel = subChoices[ch.id]?.name === sub.name
|
||||
return (
|
||||
@@ -410,7 +410,7 @@ function PrefSetBlock({ ps, prefs, setPrefs, subChoices, setSubChoices, sharedSu
|
||||
})}
|
||||
|
||||
{showShared && (
|
||||
<div style={{ marginTop: 4, marginLeft: 8, paddingLeft: 14, borderLeft: '2px solid rgba(245,158,11,0.3)', width: '100%' }}>
|
||||
<div style={{ marginTop: 4, marginLeft: 8, paddingLeft: 14, borderLeft: '2px solid rgb(var(--x-warning-rgb) / 0.3)', width: '100%' }}>
|
||||
<div style={{ fontSize: 11, fontWeight: 700, color: 'var(--muted)', textTransform: 'uppercase', letterSpacing: 0.6, padding: '4px 2px 6px' }}>{ps.shared_subset.name}</div>
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||
{ps.shared_subset.choices.map((sub, si) => {
|
||||
@@ -493,12 +493,12 @@ function QuickTab({ product, quickState, setQuickState }) {
|
||||
|
||||
// Static group colours — cycle by index passed from parent
|
||||
const GROUP_COLORS = [
|
||||
{ bg: '#e0e7ff', border: '#a5b4fc', text: '#3730a3' }, // indigo
|
||||
{ bg: '#fce7f3', border: '#f9a8d4', text: '#9d174d' }, // pink
|
||||
{ bg: '#d1fae5', border: '#6ee7b7', text: '#065f46' }, // emerald
|
||||
{ bg: '#fef3c7', border: '#fcd34d', text: '#92400e' }, // amber
|
||||
{ bg: '#e0f2fe', border: '#7dd3fc', text: '#075985' }, // sky
|
||||
{ bg: '#f3e8ff', border: '#d8b4fe', text: '#581c87' }, // purple
|
||||
{ bg: 'var(--x-info-soft)', border: 'var(--x-info-ink)', text: 'var(--x-info)' }, // indigo
|
||||
{ bg: 'var(--x-special-soft)', border: 'var(--x-special-ink)', text: 'var(--x-special)' }, // pink
|
||||
{ bg: 'var(--x-success-soft)', border: 'var(--x-success)', text: 'var(--x-success-soft)' }, // emerald
|
||||
{ bg: 'var(--x-warning-soft)', border: 'var(--x-warning)', text: 'var(--x-warning)' }, // amber
|
||||
{ bg: 'var(--x-info-soft)', border: 'var(--x-info-ink)', text: 'var(--x-info)' }, // sky
|
||||
{ bg: 'var(--x-special-soft)', border: 'var(--x-special-ink)', text: 'var(--x-special)' }, // purple
|
||||
]
|
||||
|
||||
function PWAGroupHeader({ name, collapsed, onToggle, colorIdx = 0 }) {
|
||||
@@ -788,7 +788,7 @@ function QuantityTab({ unitCfg, qty, setQty }) {
|
||||
onClick={() => setQty(q => clamp(q + off))}
|
||||
style={{
|
||||
padding: '10px 4px', borderRadius: 12, border: 'none',
|
||||
background: 'rgba(34,197,94,0.12)', color: '#4ade80',
|
||||
background: 'rgb(var(--x-success-rgb) / 0.12)', color: 'var(--x-success)',
|
||||
fontSize: 13, fontWeight: 700, cursor: 'pointer', textAlign: 'center',
|
||||
}}
|
||||
>+{fmtDecimalQty(off, unitCfg)}{unitCfg.label}</button>
|
||||
@@ -799,7 +799,7 @@ function QuantityTab({ unitCfg, qty, setQty }) {
|
||||
onClick={() => setQty(q => clamp(q - off))}
|
||||
style={{
|
||||
padding: '10px 4px', borderRadius: 12, border: 'none',
|
||||
background: 'rgba(239,68,68,0.12)', color: '#fca5a5',
|
||||
background: 'rgb(var(--x-danger-rgb) / 0.12)', color: 'var(--x-danger-ink)',
|
||||
fontSize: 13, fontWeight: 700, cursor: 'pointer', textAlign: 'center',
|
||||
}}
|
||||
>−{fmtDecimalQty(off, unitCfg)}{unitCfg.label}</button>
|
||||
@@ -843,7 +843,7 @@ function PriceAdjustTab({ basePrice, priceAdj, setPriceAdj }) {
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
|
||||
<div style={{ padding: '10px 14px', background: 'rgba(245,158,11,0.08)', border: '1px solid rgba(245,158,11,0.2)', borderRadius: 10, fontSize: 13, color: '#f59e0b' }}>
|
||||
<div style={{ padding: '10px 14px', background: 'rgb(var(--x-warning-rgb) / 0.08)', border: '1px solid rgb(var(--x-warning-rgb) / 0.2)', borderRadius: 10, fontSize: 13, color: 'var(--x-warning)' }}>
|
||||
{t('drawer.price.intro')}
|
||||
</div>
|
||||
|
||||
@@ -859,14 +859,14 @@ function PriceAdjustTab({ basePrice, priceAdj, setPriceAdj }) {
|
||||
onChange={e => setRawInput(e.target.value)}
|
||||
onBlur={commitInput}
|
||||
onKeyDown={e => { if (e.key === 'Enter') e.target.blur() }}
|
||||
style={{ width: 110, height: 52, border: '2px solid #f59e0b', borderRadius: 14, background: 'var(--bg2)', textAlign: 'center', fontSize: 22, fontWeight: 800, color: '#f59e0b', outline: 'none', fontFamily: 'inherit' }}
|
||||
style={{ width: 110, height: 52, border: '2px solid var(--x-warning)', borderRadius: 14, background: 'var(--bg2)', textAlign: 'center', fontSize: 22, fontWeight: 800, color: 'var(--x-warning)', outline: 'none', fontFamily: 'inherit' }}
|
||||
/>
|
||||
) : (
|
||||
<button onClick={() => { setRawInput(effectivePrice.toFixed(2)); setEditing(true) }} style={{
|
||||
minWidth: 110, height: 52, borderRadius: 14,
|
||||
border: `2px solid ${priceAdj !== 0 ? '#f59e0b' : 'var(--border)'}`,
|
||||
background: priceAdj !== 0 ? 'rgba(245,158,11,0.12)' : 'var(--bg2)',
|
||||
color: priceAdj !== 0 ? '#f59e0b' : 'var(--text)',
|
||||
border: `2px solid ${priceAdj !== 0 ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||
background: priceAdj !== 0 ? 'rgb(var(--x-warning-rgb) / 0.12)' : 'var(--bg2)',
|
||||
color: priceAdj !== 0 ? 'var(--x-warning)' : 'var(--text)',
|
||||
fontSize: 22, fontWeight: 800, cursor: 'pointer', fontFamily: 'inherit',
|
||||
}}>
|
||||
{money(effectivePrice)}
|
||||
@@ -878,7 +878,7 @@ function PriceAdjustTab({ basePrice, priceAdj, setPriceAdj }) {
|
||||
{priceAdj !== 0 && (
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10 }}>
|
||||
<span style={{ fontSize: 13, color: 'var(--muted)' }}>{t('drawer.price.base', { price: money(basePrice) })}</span>
|
||||
<span style={{ fontSize: 13, fontWeight: 700, color: priceAdj > 0 ? '#4ade80' : '#f87171' }}>
|
||||
<span style={{ fontSize: 13, fontWeight: 700, color: priceAdj > 0 ? 'var(--x-success)' : 'var(--x-danger)' }}>
|
||||
{priceAdj > 0 ? '+' : ''}{money(priceAdj)}
|
||||
</span>
|
||||
<button onClick={() => setPriceAdj(0)} style={{ padding: '3px 10px', borderRadius: 8, border: '1px solid var(--border)', background: 'var(--bg3)', color: 'var(--muted)', fontSize: 12, cursor: 'pointer' }}>{t('settings.reset.title')}</button>
|
||||
@@ -893,8 +893,8 @@ function PriceAdjustTab({ basePrice, priceAdj, setPriceAdj }) {
|
||||
onClick={() => applyDelta(d)}
|
||||
style={{
|
||||
padding: '11px 4px', borderRadius: 12, border: 'none',
|
||||
background: d < 0 ? 'rgba(239,68,68,0.12)' : 'rgba(34,197,94,0.12)',
|
||||
color: d < 0 ? '#fca5a5' : '#4ade80',
|
||||
background: d < 0 ? 'rgb(var(--x-danger-rgb) / 0.12)' : 'rgb(var(--x-success-rgb) / 0.12)',
|
||||
color: d < 0 ? 'var(--x-danger-ink)' : 'var(--x-success)',
|
||||
fontSize: 14, fontWeight: 700, cursor: 'pointer',
|
||||
}}
|
||||
>
|
||||
@@ -947,7 +947,7 @@ function Section({ title, tab, lines, onJumpTab }) {
|
||||
<div style={{ marginBottom: 20 }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '0 2px 8px' }}>
|
||||
<div style={{ fontSize: 11, fontWeight: 700, color: 'var(--muted)', textTransform: 'uppercase', letterSpacing: 0.6 }}>{title}</div>
|
||||
<button onClick={() => onJumpTab(tab)} style={{ background: 'none', border: 'none', fontSize: 12, fontWeight: 700, color: '#f59e0b', cursor: 'pointer', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('common.change')}</button>
|
||||
<button onClick={() => onJumpTab(tab)} style={{ background: 'none', border: 'none', fontSize: 12, fontWeight: 700, color: 'var(--x-warning)', cursor: 'pointer', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('common.change')}</button>
|
||||
</div>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
||||
{lines.map((l, i) => (
|
||||
@@ -1006,9 +1006,9 @@ function SummaryTab({ _product, summaryLines, note, onJumpTab }) {
|
||||
<div style={{ marginBottom: 20 }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '0 2px 8px' }}>
|
||||
<div style={{ fontSize: 11, fontWeight: 700, color: 'var(--muted)', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('drawer.tabs.note')}</div>
|
||||
<button onClick={() => onJumpTab('notes')} style={{ background: 'none', border: 'none', fontSize: 12, fontWeight: 700, color: '#f59e0b', cursor: 'pointer', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('common.change')}</button>
|
||||
<button onClick={() => onJumpTab('notes')} style={{ background: 'none', border: 'none', fontSize: 12, fontWeight: 700, color: 'var(--x-warning)', cursor: 'pointer', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('common.change')}</button>
|
||||
</div>
|
||||
<div style={{ padding: '12px 14px', background: 'rgba(245,158,11,0.08)', border: '1px solid rgba(245,158,11,0.2)', borderRadius: 10, fontSize: 14, color: 'var(--text)', lineHeight: 1.4, whiteSpace: 'pre-wrap' }}>{note}</div>
|
||||
<div style={{ padding: '12px 14px', background: 'rgb(var(--x-warning-rgb) / 0.08)', border: '1px solid rgb(var(--x-warning-rgb) / 0.2)', borderRadius: 10, fontSize: 14, color: 'var(--text)', lineHeight: 1.4, whiteSpace: 'pre-wrap' }}>{note}</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
@@ -1027,7 +1027,7 @@ function CoursesTab({ courses, courseId, setCourseId }) {
|
||||
style={{
|
||||
padding: '10px 14px', borderRadius: 10, textAlign: 'left',
|
||||
background: courseId === null ? 'var(--accent)' : 'var(--card)',
|
||||
color: courseId === null ? '#fff' : 'var(--text)',
|
||||
color: courseId === null ? 'var(--x-ink)' : 'var(--text)',
|
||||
border: `2px solid ${courseId === null ? 'var(--accent)' : 'var(--line)'}`,
|
||||
fontWeight: 600, fontSize: 14, cursor: 'pointer', fontFamily: 'inherit',
|
||||
}}
|
||||
@@ -1041,7 +1041,7 @@ function CoursesTab({ courses, courseId, setCourseId }) {
|
||||
style={{
|
||||
padding: '10px 14px', borderRadius: 10, textAlign: 'left',
|
||||
background: courseId === c.id ? c.color : 'var(--card)',
|
||||
color: courseId === c.id ? '#fff' : 'var(--text)',
|
||||
color: courseId === c.id ? 'var(--x-ink)' : 'var(--text)',
|
||||
border: `2px solid ${courseId === c.id ? c.color : 'var(--line)'}`,
|
||||
fontWeight: 600, fontSize: 14, cursor: 'pointer', fontFamily: 'inherit',
|
||||
display: 'flex', alignItems: 'center', gap: 10,
|
||||
@@ -1049,7 +1049,7 @@ function CoursesTab({ courses, courseId, setCourseId }) {
|
||||
>
|
||||
<span style={{
|
||||
width: 12, height: 12, borderRadius: '50%',
|
||||
background: courseId === c.id ? 'rgba(255,255,255,0.5)' : c.color,
|
||||
background: courseId === c.id ? 'rgb(var(--x-ink-rgb) / 0.5)' : c.color,
|
||||
flexShrink: 0,
|
||||
}} />
|
||||
{c.name}
|
||||
@@ -1398,7 +1398,7 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
||||
{/* Backdrop */}
|
||||
<div onClick={onClose} style={{
|
||||
position: 'fixed', inset: 0,
|
||||
background: 'rgba(0,0,0,0.6)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.6)',
|
||||
opacity: isOpen ? 1 : 0,
|
||||
pointerEvents: isOpen ? 'auto' : 'none',
|
||||
transition: 'opacity 260ms ease',
|
||||
@@ -1416,7 +1416,7 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
||||
zIndex: 41,
|
||||
display: 'flex', flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 -4px 20px rgba(0,0,0,0.4)',
|
||||
boxShadow: '0 -4px 20px rgb(var(--x-scrim-rgb) / 0.4)',
|
||||
}}>
|
||||
{/* Grab handle */}
|
||||
<div style={{ padding: '10px 0 4px', display: 'flex', justifyContent: 'center', flexShrink: 0 }}>
|
||||
@@ -1431,7 +1431,7 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
||||
)}
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 18, fontWeight: 700, color: 'var(--text)', lineHeight: 1.2 }}>{product.name}</div>
|
||||
<div style={{ fontSize: 13, color: priceAdj !== 0 ? '#f59e0b' : 'var(--muted)', marginTop: 2 }}>
|
||||
<div style={{ fontSize: 13, color: priceAdj !== 0 ? 'var(--x-warning)' : 'var(--muted)', marginTop: 2 }}>
|
||||
{priceAdj !== 0
|
||||
? <><span style={{ textDecoration: 'line-through', opacity: 0.5 }}>{money(product.base_price)}</span> → {money(product.base_price + priceAdj)}</>
|
||||
: <>{money(product.base_price)}</>
|
||||
@@ -1450,12 +1450,12 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
||||
const active = activeTab === tb.id
|
||||
const badge = badgeFor(tb.id)
|
||||
const isAlert = (tb.id === 'prefs' && prefsTabAlert) || (tb.id === 'favorites' && favTabAlert)
|
||||
const tabColor = isAlert ? '#f87171' : active ? '#f59e0b' : 'var(--muted)'
|
||||
const tabColor = isAlert ? 'var(--x-danger)' : active ? 'var(--x-warning)' : 'var(--muted)'
|
||||
return (
|
||||
<button key={tb.id} ref={el => { tabButtonRefs.current[tb.id] = el }} onClick={() => setActiveTab(tb.id)} style={{
|
||||
padding: '12px 6px',
|
||||
background: 'none', border: 'none',
|
||||
borderBottom: `2px solid ${active ? '#f59e0b' : isAlert ? '#f87171' : 'transparent'}`,
|
||||
borderBottom: `2px solid ${active ? 'var(--x-warning)' : isAlert ? 'var(--x-danger)' : 'transparent'}`,
|
||||
color: tabColor,
|
||||
fontSize: 13, fontWeight: (active || isAlert) ? 700 : 500,
|
||||
fontFamily: 'inherit', cursor: 'pointer',
|
||||
@@ -1510,7 +1510,7 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
||||
</div>
|
||||
|
||||
{/* Footer: qty stepper + ADD */}
|
||||
<div style={{ padding: '12px 16px 20px', background: 'var(--bg2)', borderTop: '1px solid var(--border)', display: 'flex', alignItems: 'center', gap: 12, flexShrink: 0, boxShadow: '0 -4px 16px rgba(0,0,0,0.3)' }}>
|
||||
<div style={{ padding: '12px 16px 20px', background: 'var(--bg2)', borderTop: '1px solid var(--border)', display: 'flex', alignItems: 'center', gap: 12, flexShrink: 0, boxShadow: '0 -4px 16px rgb(var(--x-scrim-rgb) / 0.3)' }}>
|
||||
{isDecimal ? (
|
||||
<div
|
||||
onClick={() => setActiveTab('quantity')}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useRef, useState } from 'react'
|
||||
import useTableViewStore from '../store/tableViewStore'
|
||||
import { money } from '../i18n'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
const fmtPrice = money
|
||||
|
||||
@@ -25,11 +26,11 @@ function fmtDateTime(iso) {
|
||||
|
||||
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>
|
||||
}
|
||||
@@ -112,9 +113,9 @@ function buildSections(item) {
|
||||
// ── KDS colour strip ──────────────────────────────────────────────────────────
|
||||
|
||||
const KDS_COLORS = {
|
||||
pending: { textColor: '#f59e0b', label: 'kds.pending', icon: '⏳', dot: '#f59e0b' },
|
||||
preparing: { textColor: '#60a5fa', label: 'kds.preparing', icon: '🔥', dot: '#60a5fa' },
|
||||
done: { textColor: '#4ade80', label: 'kds.ready', icon: '✓', dot: '#4ade80' },
|
||||
pending: { textColor: 'var(--x-warning)', label: 'kds.pending', icon: '⏳', dot: 'var(--x-warning)' },
|
||||
preparing: { textColor: 'var(--x-info)', label: 'kds.preparing', icon: '🔥', dot: 'var(--x-info)' },
|
||||
done: { textColor: 'var(--x-success)', label: 'kds.ready', icon: '✓', dot: 'var(--x-success)' },
|
||||
served: { textColor: null, label: null, icon: null, dot: null },
|
||||
}
|
||||
|
||||
@@ -144,7 +145,7 @@ function OptionsPanel({ sections }) {
|
||||
<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>
|
||||
))}
|
||||
@@ -154,7 +155,7 @@ function OptionsPanel({ sections }) {
|
||||
<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>
|
||||
))}
|
||||
@@ -195,7 +196,7 @@ function KdsBadge({ kdsColor, kdsDisplayStyle }) {
|
||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.4,
|
||||
color: kdsColor.textColor,
|
||||
borderRadius: 3, padding: '1px 5px',
|
||||
border: `1px solid ${kdsColor.textColor}60`,
|
||||
border: `1px solid ${fade(kdsColor.textColor, 0.38)}`,
|
||||
flexShrink: 0,
|
||||
}}>{t(kdsColor.label)}</span>
|
||||
)
|
||||
@@ -204,10 +205,10 @@ function KdsBadge({ kdsColor, kdsDisplayStyle }) {
|
||||
// ── Price event label helpers ─────────────────────────────────────────────────
|
||||
|
||||
const PRICING_EVENT_STYLE = {
|
||||
modifier_applied: { color: '#60a5fa', label: null }, // label comes from modifier_name
|
||||
waiter_discount: { color: '#c084fc', label: 'summary.discount' },
|
||||
free_item_added: { color: '#4ade80', label: 'summary.free' },
|
||||
deal_offer_accepted: { color: '#4ade80', label: null }, // label from deal_name
|
||||
modifier_applied: { color: 'var(--x-info)', label: null }, // label comes from modifier_name
|
||||
waiter_discount: { color: 'var(--x-special-ink)', label: 'summary.discount' },
|
||||
free_item_added: { color: 'var(--x-success)', label: 'summary.free' },
|
||||
deal_offer_accepted: { color: 'var(--x-success)', label: null }, // label from deal_name
|
||||
}
|
||||
|
||||
function PricingRows({ events, _layout, nameIndent = 12 }) {
|
||||
@@ -225,7 +226,7 @@ function PricingRows({ events, _layout, nameIndent = 12 }) {
|
||||
<div style={{ margin: `0 12px`, height: 1, background: 'var(--border)' }} />
|
||||
<div style={{ padding: `4px 12px 4px ${nameIndent}px`, display: 'flex', flexDirection: 'column', gap: 3 }}>
|
||||
{rows.map((ev, i) => {
|
||||
const evStyle = PRICING_EVENT_STYLE[ev.event_type] || { color: '#94a3b8', label: ev.event_type }
|
||||
const evStyle = PRICING_EVENT_STYLE[ev.event_type] || { color: 'var(--x-ink-2)', label: ev.event_type }
|
||||
const label = ev.modifier_name || ev.deal_name || (evStyle.label && t(evStyle.label)) || ev.event_type
|
||||
const delta = ev.delta_amount
|
||||
|
||||
@@ -263,19 +264,19 @@ function PricingBadge({ events }) {
|
||||
const icons = []
|
||||
if (hasModifier) icons.push(
|
||||
<svg key="mod" width="10" height="10" viewBox="0 0 24 24" fill="none" title={t('summary.modifier')}>
|
||||
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" stroke="#60a5fa" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" stroke="var(--x-info)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||
</svg>
|
||||
)
|
||||
if (hasDiscount) icons.push(
|
||||
<svg key="disc" width="10" height="10" viewBox="0 0 24 24" fill="none" title={t('summary.discount')}>
|
||||
<circle cx="9" cy="9" r="2" stroke="#c084fc" strokeWidth="2"/>
|
||||
<circle cx="15" cy="15" r="2" stroke="#c084fc" strokeWidth="2"/>
|
||||
<path d="M5 19L19 5" stroke="#c084fc" strokeWidth="2" strokeLinecap="round"/>
|
||||
<circle cx="9" cy="9" r="2" stroke="var(--x-special-ink)" strokeWidth="2"/>
|
||||
<circle cx="15" cy="15" r="2" stroke="var(--x-special-ink)" strokeWidth="2"/>
|
||||
<path d="M5 19L19 5" stroke="var(--x-special-ink)" strokeWidth="2" strokeLinecap="round"/>
|
||||
</svg>
|
||||
)
|
||||
if (hasFree) icons.push(
|
||||
<svg key="free" width="10" height="10" viewBox="0 0 24 24" fill="none" title={t('summary.free')}>
|
||||
<path d="M20 12v10H4V12M22 7H2v5h20V7z" stroke="#4ade80" strokeWidth="2" strokeLinecap="round"/>
|
||||
<path d="M20 12v10H4V12M22 7H2v5h20V7z" stroke="var(--x-success)" strokeWidth="2" strokeLinecap="round"/>
|
||||
</svg>
|
||||
)
|
||||
|
||||
@@ -294,8 +295,8 @@ function DealBadge({ item }) {
|
||||
return (
|
||||
<span style={{
|
||||
fontSize: 9, fontWeight: 700, padding: '1px 5px', borderRadius: 4,
|
||||
background: 'rgba(167,139,250,0.15)', color: '#a78bfa',
|
||||
border: '1px solid rgba(167,139,250,0.4)', flexShrink: 0, letterSpacing: 0.3,
|
||||
background: 'rgb(var(--x-special-rgb) / 0.15)', color: 'var(--x-special-ink)',
|
||||
border: '1px solid rgb(var(--x-special-rgb) / 0.4)', flexShrink: 0, letterSpacing: 0.3,
|
||||
}}>
|
||||
{t('summary.freeCaps')}
|
||||
</span>
|
||||
@@ -309,8 +310,8 @@ function MergedBadge({ item }) {
|
||||
return (
|
||||
<span style={{
|
||||
fontSize: 9, fontWeight: 700, padding: '1px 5px', borderRadius: 4,
|
||||
background: 'rgba(99,102,241,0.15)', color: '#a5b4fc',
|
||||
border: '1px solid rgba(99,102,241,0.35)', flexShrink: 0, letterSpacing: 0.3,
|
||||
background: 'rgb(var(--x-info-rgb) / 0.15)', color: 'var(--x-info-ink)',
|
||||
border: '1px solid rgb(var(--x-info-rgb) / 0.35)', flexShrink: 0, letterSpacing: 0.3,
|
||||
}}>
|
||||
∑{item._sourceIds?.length}
|
||||
</span>
|
||||
@@ -373,7 +374,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
<span style={{
|
||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||
width: 16, height: 16, borderRadius: '50%',
|
||||
background: course.color, color: '#fff',
|
||||
background: course.color, color: 'var(--x-on-colour)',
|
||||
fontSize: 9, fontWeight: 700, flexShrink: 0, marginLeft: 4,
|
||||
}}>
|
||||
{courses.indexOf(course) + 1}
|
||||
@@ -435,7 +436,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '7px 12px' }}>
|
||||
{selectable && !isCancelled && (
|
||||
<span style={{ color: selected ? '#f59e0b' : '#475569', flexShrink: 0, fontSize: 16 }}>
|
||||
<span style={{ color: selected ? 'var(--x-warning)' : 'var(--x-ink-3)', flexShrink: 0, fontSize: 16 }}>
|
||||
{selected ? '☑' : '☐'}
|
||||
</span>
|
||||
)}
|
||||
@@ -464,7 +465,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
|
||||
<KdsBadge kdsColor={kdsColor} kdsDisplayStyle={kdsDisplayStyle} />
|
||||
<span className="order-item__qty">{fmtQty(item.quantity, item.unit_type)}</span>
|
||||
<span className="order-item__price" style={hasPriceAdj ? { color: '#60a5fa' } : undefined}>
|
||||
<span className="order-item__price" style={hasPriceAdj ? { color: 'var(--x-info)' } : undefined}>
|
||||
{totalPrice}
|
||||
</span>
|
||||
</div>
|
||||
@@ -488,7 +489,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
{/* Row 1: checkbox · name · badges · expand arrow · KDS badge */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 12px 2px' }}>
|
||||
{selectable && !isCancelled && (
|
||||
<span style={{ color: selected ? '#f59e0b' : '#475569', flexShrink: 0, fontSize: 16 }}>
|
||||
<span style={{ color: selected ? 'var(--x-warning)' : 'var(--x-ink-3)', flexShrink: 0, fontSize: 16 }}>
|
||||
{selected ? '☑' : '☐'}
|
||||
</span>
|
||||
)}
|
||||
@@ -520,14 +521,14 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
}}>
|
||||
<span style={{ fontSize: 12, color: 'var(--muted)', flex: 1 }}>
|
||||
{hasPriceAdj
|
||||
? <><span style={{ textDecoration: 'line-through', marginRight: 4, opacity: 0.6 }}>{fmtPrice(item.unit_price)}</span><span style={{ color: '#60a5fa' }}>{fmtPrice(unitPriceAdjusted)}</span></>
|
||||
? <><span style={{ textDecoration: 'line-through', marginRight: 4, opacity: 0.6 }}>{fmtPrice(item.unit_price)}</span><span style={{ color: 'var(--x-info)' }}>{fmtPrice(unitPriceAdjusted)}</span></>
|
||||
: fmtPrice(unitPriceAdjusted)
|
||||
}
|
||||
</span>
|
||||
<span className="order-item__qty" style={{ textAlign: 'center', minWidth: 48 }}>
|
||||
{fmtQty(item.quantity, item.unit_type)}
|
||||
</span>
|
||||
<span className="order-item__price" style={{ minWidth: 64, textAlign: 'right', ...(hasPriceAdj ? { color: '#60a5fa' } : {}) }}>
|
||||
<span className="order-item__price" style={{ minWidth: 64, textAlign: 'right', ...(hasPriceAdj ? { color: 'var(--x-info)' } : {}) }}>
|
||||
{totalPrice}
|
||||
</span>
|
||||
</div>
|
||||
@@ -553,7 +554,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
{/* Row 1 */}
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 12px 2px' }}>
|
||||
{selectable && !isCancelled && (
|
||||
<span style={{ color: selected ? '#f59e0b' : '#475569', flexShrink: 0, fontSize: 16 }}>
|
||||
<span style={{ color: selected ? 'var(--x-warning)' : 'var(--x-ink-3)', flexShrink: 0, fontSize: 16 }}>
|
||||
{selected ? '☑' : '☐'}
|
||||
</span>
|
||||
)}
|
||||
@@ -575,14 +576,14 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
}}>
|
||||
<span style={{ fontSize: 12, color: 'var(--muted)', flex: 1 }}>
|
||||
{hasPriceAdj
|
||||
? <><span style={{ textDecoration: 'line-through', marginRight: 4, opacity: 0.6 }}>{fmtPrice(item.unit_price)}</span><span style={{ color: '#60a5fa' }}>{fmtPrice(unitPriceAdjusted)}</span></>
|
||||
? <><span style={{ textDecoration: 'line-through', marginRight: 4, opacity: 0.6 }}>{fmtPrice(item.unit_price)}</span><span style={{ color: 'var(--x-info)' }}>{fmtPrice(unitPriceAdjusted)}</span></>
|
||||
: fmtPrice(unitPriceAdjusted)
|
||||
}
|
||||
</span>
|
||||
<span className="order-item__qty" style={{ textAlign: 'center', minWidth: 48 }}>
|
||||
{fmtQty(item.quantity, item.unit_type)}
|
||||
</span>
|
||||
<span className="order-item__price" style={{ minWidth: 64, textAlign: 'right', ...(hasPriceAdj ? { color: '#60a5fa' } : {}) }}>
|
||||
<span className="order-item__price" style={{ minWidth: 64, textAlign: 'right', ...(hasPriceAdj ? { color: 'var(--x-info)' } : {}) }}>
|
||||
{totalPrice}
|
||||
</span>
|
||||
</div>
|
||||
@@ -635,7 +636,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
<SectionIcon type="quick" />
|
||||
<span style={{ fontSize: 11, 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>
|
||||
))}
|
||||
@@ -645,7 +646,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
||||
<span style={{ fontSize: 11, 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>
|
||||
))}
|
||||
@@ -684,7 +685,7 @@ export default function OrderSummary({ order, selectable = false, selectedIds =
|
||||
|
||||
return (
|
||||
<div className="order-summary">
|
||||
{activeItems.length === 0 && <p style={{ color: '#64748b', textAlign: 'center' }}>{t('summary.noItems')}</p>}
|
||||
{activeItems.length === 0 && <p style={{ color: 'var(--x-ink-3)', textAlign: 'center' }}>{t('summary.noItems')}</p>}
|
||||
{activeItems.map((item, idx) => (
|
||||
<ItemRow
|
||||
key={item.id}
|
||||
@@ -706,15 +707,15 @@ export default function OrderSummary({ order, selectable = false, selectedIds =
|
||||
<span>{fmtPrice(total)}</span>
|
||||
</div>
|
||||
{paidTotal > 0 && paidTotal < total && (
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 12px 8px', fontSize: 13, color: '#64748b' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 12px 8px', fontSize: 13, color: 'var(--x-ink-3)' }}>
|
||||
<span>{t('tables.quick.paid')}</span>
|
||||
<span style={{ color: '#22c55e' }}>{fmtPrice(paidTotal)}</span>
|
||||
<span style={{ color: 'var(--x-success)' }}>{fmtPrice(paidTotal)}</span>
|
||||
</div>
|
||||
)}
|
||||
{paidTotal > 0 && paidTotal < total && (
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 12px 8px', fontSize: 13, color: '#94a3b8' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', padding: '0 12px 8px', fontSize: 13, color: 'var(--x-ink-2)' }}>
|
||||
<span>{t('summary.due')}</span>
|
||||
<span style={{ color: '#f59e0b', fontWeight: 700 }}>{fmtPrice(total - paidTotal)}</span>
|
||||
<span style={{ color: 'var(--x-warning)', fontWeight: 700 }}>{fmtPrice(total - paidTotal)}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -42,14 +42,14 @@ function CartItemSummaryRow({ item, product, price, estimated, onEdit }) {
|
||||
{opts.length > 0 && (
|
||||
<div style={{ marginTop: 5, display: 'flex', flexWrap: 'wrap', gap: '3px 8px' }}>
|
||||
{opts.map((o, i) => (
|
||||
<span key={i} style={{ fontSize: 12, color: '#f59e0b', fontWeight: 600, background: 'rgba(245,158,11,0.08)', borderRadius: 6, padding: '1px 6px' }}>{o}</span>
|
||||
<span key={i} style={{ fontSize: 12, color: 'var(--x-warning)', fontWeight: 600, background: 'rgb(var(--x-warning-rgb) / 0.08)', borderRadius: 6, padding: '1px 6px' }}>{o}</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
{removed.length > 0 && (
|
||||
<div style={{ marginTop: 4, display: 'flex', flexWrap: 'wrap', gap: '3px 8px' }}>
|
||||
{removed.map((r, i) => (
|
||||
<span key={i} style={{ fontSize: 12, color: '#ef4444', fontWeight: 600, background: 'rgba(239,68,68,0.08)', borderRadius: 6, padding: '1px 6px' }}>− {r}</span>
|
||||
<span key={i} style={{ fontSize: 12, color: 'var(--x-danger)', fontWeight: 600, background: 'rgb(var(--x-danger-rgb) / 0.08)', borderRadius: 6, padding: '1px 6px' }}>− {r}</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
@@ -88,7 +88,7 @@ export default function OrderSummaryModal({ cart, products, prices, total, estim
|
||||
{/* Backdrop */}
|
||||
<div
|
||||
onClick={onClose}
|
||||
style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.65)', zIndex: 200 }}
|
||||
style={{ position: 'fixed', inset: 0, background: 'rgb(var(--x-scrim-rgb) / 0.65)', zIndex: 200 }}
|
||||
/>
|
||||
|
||||
{/* Sheet */}
|
||||
@@ -145,7 +145,7 @@ export default function OrderSummaryModal({ cart, products, prices, total, estim
|
||||
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',
|
||||
}}
|
||||
@@ -160,10 +160,10 @@ export default function OrderSummaryModal({ cart, products, prices, total, estim
|
||||
) : orderNote ? (
|
||||
<div
|
||||
onClick={() => setNoteEditing(true)}
|
||||
style={{ cursor: 'pointer', padding: '10px 13px', background: 'rgba(245,158,11,0.09)', border: '1.5px solid rgba(245,158,11,0.3)', borderRadius: 10, fontSize: 14, color: 'var(--text)', lineHeight: 1.5, whiteSpace: 'pre-wrap', position: 'relative' }}
|
||||
style={{ cursor: 'pointer', padding: '10px 13px', background: 'rgb(var(--x-warning-rgb) / 0.09)', border: '1.5px solid rgb(var(--x-warning-rgb) / 0.3)', borderRadius: 10, fontSize: 14, color: 'var(--text)', lineHeight: 1.5, whiteSpace: 'pre-wrap', position: 'relative' }}
|
||||
>
|
||||
{orderNote}
|
||||
<span style={{ position: 'absolute', top: 8, right: 10, fontSize: 12, color: '#f59e0b', fontWeight: 700 }}>✎</span>
|
||||
<span style={{ position: 'absolute', top: 8, right: 10, fontSize: 12, color: 'var(--x-warning)', fontWeight: 700 }}>✎</span>
|
||||
</div>
|
||||
) : (
|
||||
<button
|
||||
|
||||
@@ -19,7 +19,7 @@ export default function PinPad({ onSubmit, loading }) {
|
||||
}
|
||||
|
||||
const dots = Array.from({ length: 4 }, (_, i) => (
|
||||
<span key={i} style={{ fontSize: 20, color: i < pin.length ? '#f59e0b' : '#334155' }}>●</span>
|
||||
<span key={i} style={{ fontSize: 20, color: i < pin.length ? 'var(--x-warning)' : 'var(--x-surface-3)' }}>●</span>
|
||||
))
|
||||
|
||||
return (
|
||||
|
||||
@@ -83,7 +83,7 @@ function ProductDetailModal({ product, onClose }) {
|
||||
onClick={onClose}
|
||||
style={{
|
||||
position: 'fixed', inset: 0,
|
||||
background: 'rgba(0,0,0,0.65)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.65)',
|
||||
zIndex: 300,
|
||||
}}
|
||||
/>
|
||||
@@ -96,7 +96,7 @@ function ProductDetailModal({ product, onClose }) {
|
||||
background: 'var(--bg)',
|
||||
borderRadius: 20,
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 20px 60px rgba(0,0,0,0.5)',
|
||||
boxShadow: '0 20px 60px rgb(var(--x-scrim-rgb) / 0.5)',
|
||||
}}>
|
||||
{/* Close button */}
|
||||
<button
|
||||
@@ -104,14 +104,14 @@ function ProductDetailModal({ product, onClose }) {
|
||||
style={{
|
||||
position: 'absolute', top: 12, right: 12,
|
||||
width: 32, height: 32, borderRadius: '50%',
|
||||
background: 'rgba(0,0,0,0.45)',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.45)',
|
||||
border: 'none', cursor: 'pointer',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
zIndex: 1,
|
||||
}}
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M6 6L18 18M6 18L18 6" stroke="#fff" strokeWidth="2.2" strokeLinecap="round"/>
|
||||
<path d="M6 6L18 18M6 18L18 6" stroke="var(--x-ink)" strokeWidth="2.2" strokeLinecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
@@ -133,7 +133,7 @@ function ProductDetailModal({ product, onClose }) {
|
||||
<div style={{ fontSize: 20, fontWeight: 800, color: 'var(--text)', lineHeight: 1.2, marginBottom: 6 }}>
|
||||
{product.name}
|
||||
</div>
|
||||
<div style={{ fontSize: 18, fontWeight: 700, color: 'var(--accent, #f59e0b)', marginBottom: product.description ? 14 : 0 }}>
|
||||
<div style={{ fontSize: 18, fontWeight: 700, color: 'var(--accent, var(--x-warning))', marginBottom: product.description ? 14 : 0 }}>
|
||||
{money(product.base_price)}
|
||||
</div>
|
||||
{product.description && (
|
||||
@@ -281,7 +281,7 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
||||
<span style={{ fontSize: 15, fontWeight: 700, color: 'var(--text)', lineHeight: 1.2, flex: 1, minWidth: 0 }}>
|
||||
{product.name}
|
||||
</span>
|
||||
<span style={{ fontSize: 13, fontWeight: 600, color: hasPrice ? '#f59e0b' : 'var(--muted)', flexShrink: 0 }}>
|
||||
<span style={{ fontSize: 13, fontWeight: 600, color: hasPrice ? 'var(--x-warning)' : 'var(--muted)', flexShrink: 0 }}>
|
||||
{hasPrice ? money(product.base_price) : t('picker.noCharge')}
|
||||
</span>
|
||||
</div>
|
||||
@@ -294,8 +294,8 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
||||
onClick={dec}
|
||||
style={{
|
||||
...btnBase,
|
||||
background: qty === 0 ? 'var(--bg3)' : 'rgba(245,158,11,0.15)',
|
||||
color: qty === 0 ? 'var(--muted)' : '#f59e0b',
|
||||
background: qty === 0 ? 'var(--bg3)' : 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||
color: qty === 0 ? 'var(--muted)' : 'var(--x-warning)',
|
||||
}}
|
||||
>−</button>
|
||||
|
||||
@@ -306,8 +306,8 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
||||
title={t('picker.setToGuests', { count: customerCount ?? 1 })}
|
||||
style={{
|
||||
...btnBase,
|
||||
background: 'rgba(245,158,11,0.12)',
|
||||
color: '#f59e0b',
|
||||
background: 'rgb(var(--x-warning-rgb) / 0.12)',
|
||||
color: 'var(--x-warning)',
|
||||
fontSize: 14, fontWeight: 800,
|
||||
}}
|
||||
>
|
||||
@@ -325,8 +325,8 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
||||
onClick={inc}
|
||||
style={{
|
||||
...btnBase,
|
||||
background: 'rgba(245,158,11,0.15)',
|
||||
color: '#f59e0b',
|
||||
background: 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||
color: 'var(--x-warning)',
|
||||
}}
|
||||
>+</button>
|
||||
|
||||
@@ -357,10 +357,10 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
||||
disabled={qty === 0}
|
||||
style={{
|
||||
padding: '8px 16px', borderRadius: 10,
|
||||
background: qty === 0 ? 'var(--bg3)' : '#f59e0b',
|
||||
background: qty === 0 ? 'var(--bg3)' : 'var(--x-warning)',
|
||||
border: 'none', cursor: qty === 0 ? 'default' : 'pointer',
|
||||
fontSize: 12, fontWeight: 800,
|
||||
color: qty === 0 ? 'var(--muted)' : '#fff',
|
||||
color: qty === 0 ? 'var(--muted)' : 'var(--x-warning-fg)',
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
@@ -518,9 +518,9 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
||||
<button
|
||||
className="cat-tab"
|
||||
style={{
|
||||
background: isSvcActive ? '#f59e0b' : hexToRgba('#f59e0b', 0.22),
|
||||
color: isSvcActive ? '#fff' : '#b45309',
|
||||
border: isSvcActive ? '2px solid #f59e0b' : undefined,
|
||||
background: isSvcActive ? 'var(--x-warning)' : hexToRgba('var(--x-warning)', 0.22),
|
||||
color: isSvcActive ? 'var(--x-warning-fg)' : 'var(--x-warning)',
|
||||
border: isSvcActive ? '2px solid var(--x-warning)' : undefined,
|
||||
display: 'flex', alignItems: 'center', gap: 5,
|
||||
}}
|
||||
onClick={() => selectCategory(SVC_CAT_ID)}
|
||||
@@ -536,9 +536,9 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
||||
<button
|
||||
className="cat-tab"
|
||||
style={{
|
||||
background: isFavActive ? '#ef4444' : hexToRgba('#ef4444', 0.22),
|
||||
color: isFavActive ? '#fff' : '#ef4444',
|
||||
border: isFavActive ? '2px solid #ef4444' : undefined,
|
||||
background: isFavActive ? 'var(--x-danger)' : hexToRgba('var(--x-danger)', 0.22),
|
||||
color: isFavActive ? 'var(--x-danger-fg)' : 'var(--x-danger)',
|
||||
border: isFavActive ? '2px solid var(--x-danger)' : undefined,
|
||||
display: 'flex', alignItems: 'center', gap: 5,
|
||||
}}
|
||||
onClick={() => selectCategory(FAV_CAT_ID)}
|
||||
@@ -555,7 +555,7 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
||||
? isActive ? cat.color : hexToRgba(cat.color, 0.35)
|
||||
: isActive ? 'var(--accent)' : 'var(--bg3)'
|
||||
const color = cat.color
|
||||
? isActive ? '#fff' : 'rgba(255,255,255,0.65)'
|
||||
? isActive ? 'var(--x-ink)' : 'rgb(var(--x-ink-rgb) / 0.65)'
|
||||
: isActive ? 'var(--accent-fg)' : 'var(--muted)'
|
||||
return (
|
||||
<button
|
||||
@@ -592,7 +592,7 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
||||
/>
|
||||
) : (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', padding: '48px 24px', gap: 14 }}>
|
||||
<svg width="44" height="44" viewBox="0 0 24 24" fill="none" stroke="#ef4444" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" style={{ opacity: 0.4 }}>
|
||||
<svg width="44" height="44" 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={{ color: 'var(--muted)', fontSize: 14, textAlign: 'center', lineHeight: 1.6 }}>
|
||||
@@ -620,7 +620,7 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
||||
onShowDetail={setDetailProduct}
|
||||
/>
|
||||
{flatProducts.length === 0 && (
|
||||
<p style={{ color: '#64748b', textAlign: 'center', padding: 32 }}>
|
||||
<p style={{ color: 'var(--x-ink-3)', textAlign: 'center', padding: 32 }}>
|
||||
{t('picker.noProducts')}
|
||||
</p>
|
||||
)}
|
||||
@@ -726,12 +726,12 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
||||
{favorites.length > 0 && (
|
||||
<button
|
||||
className={`cat-all-tile ${isFavActive ? 'cat-all-tile--active' : ''}`}
|
||||
style={{ background: '#ef4444', boxShadow: isFavActive ? `0 0 0 3px #fff` : undefined }}
|
||||
style={{ background: 'var(--x-danger)', boxShadow: isFavActive ? `0 0 0 3px var(--x-ink)` : undefined }}
|
||||
onClick={() => selectCategory(FAV_CAT_ID)}
|
||||
>
|
||||
<span className="cat-all-tile__overlay" style={{ background: isFavActive ? 'rgba(255,255,255,0.18)' : 'rgba(0,0,0,0.22)' }} />
|
||||
<span className="cat-all-tile__overlay" style={{ background: isFavActive ? 'rgb(var(--x-ink-rgb) / 0.18)' : 'rgb(var(--x-scrim-rgb) / 0.22)' }} />
|
||||
<span className="cat-all-tile__name" style={{ display: 'flex', alignItems: 'center', gap: 5 }}>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="white" stroke="white" strokeWidth="1" style={{ flexShrink: 0 }}>
|
||||
<svg width="13" height="13" viewBox="0 0 24 24" fill="var(--x-on-colour)" stroke="var(--x-on-colour)" strokeWidth="1" style={{ flexShrink: 0 }}>
|
||||
<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>
|
||||
{t('settings.tabs.favorites')}
|
||||
@@ -741,12 +741,12 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
||||
{topLevel.map(cat => {
|
||||
const isActive = activeCat === cat.id
|
||||
const bg = cat.color || 'var(--bg3)'
|
||||
const overlay = isActive ? 'rgba(255,255,255,0.18)' : 'rgba(0,0,0,0.35)'
|
||||
const overlay = isActive ? 'rgb(var(--x-ink-rgb) / 0.18)' : 'rgb(var(--x-scrim-rgb) / 0.35)'
|
||||
return (
|
||||
<button
|
||||
key={cat.id}
|
||||
className={`cat-all-tile ${isActive ? 'cat-all-tile--active' : ''}`}
|
||||
style={{ background: bg, boxShadow: isActive ? `0 0 0 3px #fff` : undefined }}
|
||||
style={{ background: bg, boxShadow: isActive ? `0 0 0 3px var(--x-ink)` : undefined }}
|
||||
onClick={() => selectCategory(cat.id)}
|
||||
>
|
||||
<span className="cat-all-tile__overlay" style={{ background: overlay }} />
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function QrScannerModal({ onResult, onClose }) {
|
||||
|
||||
return (
|
||||
<div style={{
|
||||
position: 'fixed', inset: 0, zIndex: 10000, background: '#000',
|
||||
position: 'fixed', inset: 0, zIndex: 10000, background: 'rgb(var(--x-scrim-rgb) / 1)',
|
||||
display: 'flex', flexDirection: 'column',
|
||||
}}>
|
||||
<div style={{ flex: 1, position: 'relative', overflow: 'hidden' }}>
|
||||
@@ -72,16 +72,16 @@ export default function QrScannerModal({ onResult, onClose }) {
|
||||
{error && (
|
||||
<div style={{
|
||||
position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
padding: 32, textAlign: 'center', color: '#e2e8f0', fontSize: 15, lineHeight: 1.5,
|
||||
background: 'rgba(15,23,42,0.92)',
|
||||
padding: 32, textAlign: 'center', color: 'var(--x-ink)', fontSize: 15, lineHeight: 1.5,
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.92)',
|
||||
}}>
|
||||
{t(error)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ padding: 16, display: 'flex', flexDirection: 'column', gap: 10, background: '#0f172a' }}>
|
||||
<div style={{ padding: 16, display: 'flex', flexDirection: 'column', gap: 10, background: 'var(--x-canvas)' }}>
|
||||
{!error && (
|
||||
<p style={{ color: '#94a3b8', fontSize: 13, textAlign: 'center' }}>
|
||||
<p style={{ color: 'var(--x-ink-2)', fontSize: 13, textAlign: 'center' }}>
|
||||
{t('qr.aim')}
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -61,16 +61,16 @@ export default function ServerRediscovery() {
|
||||
if (!movedTo) return null
|
||||
return (
|
||||
<div style={{
|
||||
position: 'fixed', inset: 0, zIndex: 10001, background: 'rgba(15,23,42,0.92)',
|
||||
position: 'fixed', inset: 0, zIndex: 10001, background: 'rgb(var(--x-scrim-rgb) / 0.92)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 32, textAlign: 'center',
|
||||
}}>
|
||||
<div>
|
||||
<div style={{ fontSize: 44, marginBottom: 12 }}>🔄</div>
|
||||
<p style={{ color: '#e2e8f0', fontSize: 17, fontWeight: 600, marginBottom: 6 }}>
|
||||
<p style={{ color: 'var(--x-ink)', fontSize: 17, fontWeight: 600, marginBottom: 6 }}>
|
||||
{t('offline.moved')}
|
||||
</p>
|
||||
<p style={{ color: '#94a3b8', fontSize: 14, fontFamily: 'monospace' }}>{movedTo}</p>
|
||||
<p style={{ color: '#94a3b8', fontSize: 14, marginTop: 10 }}>{t('offline.reconnecting')}</p>
|
||||
<p style={{ color: 'var(--x-ink-2)', fontSize: 14, fontFamily: 'monospace' }}>{movedTo}</p>
|
||||
<p style={{ color: 'var(--x-ink-2)', fontSize: 14, marginTop: 10 }}>{t('offline.reconnecting')}</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useFormat, useTranslation } from '@xenia/i18n'
|
||||
import useThemeStore from '../store/themeStore'
|
||||
import useTableColourStore from '../store/tableColourStore'
|
||||
import { assetUrl } from '../config/server'
|
||||
import { fade } from '../logic/colour'
|
||||
|
||||
function useFlashToggle(active, intervalMs = 900) {
|
||||
const [frame, setFrame] = useState(false)
|
||||
@@ -55,9 +56,9 @@ function computeKdsBadge(order) {
|
||||
const preparing = relevant.filter(i => kds(i.kds_status) === 'preparing').length
|
||||
const done = relevant.filter(i => kds(i.kds_status) === 'done').length
|
||||
const total = relevant.length
|
||||
if (preparing > 0) return { label: 'PREP', color: '#60a5fa', bg: 'rgba(37,99,235,0.18)' }
|
||||
if (done === total) return { label: 'READY', color: '#4ade80', bg: 'rgba(22,163,74,0.20)' }
|
||||
if (done > 0) return { label: `${done}/${total} READY`, color: '#4ade80', bg: 'rgba(22,163,74,0.18)' }
|
||||
if (preparing > 0) return { label: 'PREP', color: 'var(--x-info)', bg: 'rgb(var(--x-info-rgb) / 0.18)' }
|
||||
if (done === total) return { label: 'READY', color: 'var(--x-success)', bg: 'rgb(var(--x-success-rgb) / 0.2)' }
|
||||
if (done > 0) return { label: `${done}/${total} READY`, color: 'var(--x-success)', bg: 'rgb(var(--x-success-rgb) / 0.18)' }
|
||||
return null // all pending — no badge needed
|
||||
}
|
||||
|
||||
@@ -81,7 +82,7 @@ function KdsBadge({ badge, small }) {
|
||||
fontWeight: 800,
|
||||
letterSpacing: 0.3,
|
||||
whiteSpace: 'nowrap',
|
||||
border: `1px solid ${badge.color}40`,
|
||||
border: `1px solid ${fade(badge.color, 0.25)}`,
|
||||
}}>{badge.label}</span>
|
||||
)
|
||||
}
|
||||
@@ -91,7 +92,7 @@ const HOLD_MS = 480
|
||||
|
||||
// ─── Avatar helpers ───────────────────────────────────────────────────────────
|
||||
|
||||
const AVATAR_PALETTE = ['#3758c9', '#7a44c9', '#2f9e5e', '#d94b26', '#8a6d2b', '#0d7a8a', '#c93775', '#1d6f3a']
|
||||
const AVATAR_PALETTE = ['var(--x-info)', 'var(--x-special)', 'var(--x-success)', 'var(--x-danger)', 'var(--x-warning)', 'var(--x-info)', 'var(--x-special)', 'var(--x-success)']
|
||||
|
||||
function avatarColor(name = '') {
|
||||
let h = 0
|
||||
@@ -121,7 +122,7 @@ function WaiterAvatar({ waiter, size = 22, ring }) {
|
||||
<div style={{
|
||||
width: size, height: size, borderRadius: '50%',
|
||||
background: avatarColor(displayName),
|
||||
color: 'white', fontSize: size * 0.4, fontWeight: 700,
|
||||
color: 'var(--x-on-colour)', fontSize: size * 0.4, fontWeight: 700,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
...ringStyle,
|
||||
@@ -168,7 +169,7 @@ function WaiterRow({ waiters, size = 22, cfg }) {
|
||||
{waiters.length > 3 && (
|
||||
<div style={{
|
||||
marginLeft: -(size * 0.28), height: size, padding: '0 6px',
|
||||
borderRadius: size, background: `${cfg.nameText}20`,
|
||||
borderRadius: size, background: `${fade(cfg.nameText, 0.13)}`,
|
||||
color: cfg.nameText, fontSize: 10, fontWeight: 700,
|
||||
display: 'flex', alignItems: 'center',
|
||||
}}>+{waiters.length - 3}</div>
|
||||
@@ -202,13 +203,13 @@ function StatusPill({ label, badgeBg, badgeText, small }) {
|
||||
// ─── Flag dot ─────────────────────────────────────────────────────────────────
|
||||
|
||||
function FlagDot({ flag, size = 22 }) {
|
||||
const textColor = flag.text_color || '#ffffff'
|
||||
const textColor = flag.text_color || 'var(--x-ink)'
|
||||
return (
|
||||
<div
|
||||
title={flag.name}
|
||||
style={{
|
||||
width: size, height: size, borderRadius: '50%',
|
||||
background: flag.color || '#6295F3',
|
||||
background: flag.color || 'var(--x-info)',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
fontSize: size * 0.55,
|
||||
flexShrink: 0,
|
||||
@@ -232,8 +233,8 @@ function FlagDots({ flags, size, maxShow }) {
|
||||
{overflow > 0 && (
|
||||
<div style={{
|
||||
width: size, height: size, borderRadius: '50%',
|
||||
background: 'rgba(0,0,0,0.18)',
|
||||
color: '#fff', fontSize: size * 0.44, fontWeight: 800,
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.18)',
|
||||
color: 'var(--x-ink)', fontSize: size * 0.44, fontWeight: 800,
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||
flexShrink: 0,
|
||||
}}>+{overflow}</div>
|
||||
@@ -245,7 +246,7 @@ function FlagDots({ flags, size, maxShow }) {
|
||||
// ─── Flag chip (icon + label) ─────────────────────────────────────────────────
|
||||
|
||||
function FlagChip({ flag }) {
|
||||
const textColor = flag.text_color || '#ffffff'
|
||||
const textColor = flag.text_color || 'var(--x-ink)'
|
||||
return (
|
||||
<div
|
||||
title={flag.name}
|
||||
@@ -253,7 +254,7 @@ function FlagChip({ flag }) {
|
||||
display: 'inline-flex', alignItems: 'center', gap: 5,
|
||||
height: 26, padding: '0 9px',
|
||||
borderRadius: 13,
|
||||
background: flag.color || '#6295F3',
|
||||
background: flag.color || 'var(--x-info)',
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
@@ -294,7 +295,7 @@ function Card1x1({ table, _order, flags, _waiterObjects, cfg, statusKey, kdsBadg
|
||||
position: 'relative', overflow: 'hidden',
|
||||
display: 'flex', flexDirection: 'column',
|
||||
padding: 8,
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.12)',
|
||||
boxShadow: '0 2px 8px rgb(var(--x-scrim-rgb) / 0.12)',
|
||||
}}>
|
||||
{flashOverlay}
|
||||
|
||||
@@ -342,7 +343,7 @@ function Card2x1({ table, _order, flags, _waiterObjects, cfg, statusKey, kdsBadg
|
||||
padding: '10px 12px',
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'space-between',
|
||||
gap: 10, overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.12)',
|
||||
boxShadow: '0 2px 8px rgb(var(--x-scrim-rgb) / 0.12)',
|
||||
position: 'relative',
|
||||
}}>
|
||||
{flashOverlay}
|
||||
@@ -385,7 +386,7 @@ function Card2x2({ table, order, flags, _waiterObjects, cfg, statusKey, kdsBadge
|
||||
background: cfg.cardBg, borderRadius: 16,
|
||||
padding: '12px 12px 12px',
|
||||
display: 'flex', gap: 8, overflow: 'hidden',
|
||||
boxShadow: '0 2px 10px rgba(0,0,0,0.12)',
|
||||
boxShadow: '0 2px 10px rgb(var(--x-scrim-rgb) / 0.12)',
|
||||
position: 'relative',
|
||||
}}>
|
||||
{flashOverlay}
|
||||
@@ -436,7 +437,7 @@ function Card4x1({ table, order, flags, _waiterObjects, cfg, statusKey, kdsBadge
|
||||
background: cfg.cardBg, borderRadius: 14,
|
||||
padding: '12px 14px',
|
||||
display: 'flex', alignItems: 'center', gap: 14, overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.12)',
|
||||
boxShadow: '0 2px 8px rgb(var(--x-scrim-rgb) / 0.12)',
|
||||
position: 'relative',
|
||||
}}>
|
||||
{flashOverlay}
|
||||
@@ -489,7 +490,7 @@ function Card4x2({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
width: '100%',
|
||||
background: cfg.cardBg, borderRadius: 16,
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 10px rgba(0,0,0,0.12)',
|
||||
boxShadow: '0 2px 10px rgb(var(--x-scrim-rgb) / 0.12)',
|
||||
display: 'flex', flexDirection: 'column',
|
||||
position: 'relative',
|
||||
}}>
|
||||
@@ -537,7 +538,7 @@ function Card4x2({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
{flags.length > 4 && (
|
||||
<div style={{
|
||||
height: 26, padding: '0 9px', borderRadius: 13,
|
||||
background: 'rgba(0,0,0,0.18)', color: '#fff',
|
||||
background: 'rgb(var(--x-scrim-rgb) / 0.18)', color: 'var(--x-ink)',
|
||||
fontSize: 11, fontWeight: 800,
|
||||
display: 'flex', alignItems: 'center',
|
||||
}}>+{flags.length - 4}</div>
|
||||
@@ -548,7 +549,7 @@ function Card4x2({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
|
||||
{/* footer: waiters */}
|
||||
<div style={{
|
||||
borderTop: `1px solid ${cfg.nameText}22`,
|
||||
borderTop: `1px solid ${fade(cfg.nameText, 0.13)}`,
|
||||
padding: '10px 14px', minHeight: 40,
|
||||
display: 'flex', alignItems: 'center',
|
||||
position: 'relative', zIndex: 2,
|
||||
@@ -578,11 +579,11 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
const preparing = relevant.filter(i => kds(i.kds_status) === 'preparing').length
|
||||
const done = relevant.filter(i => kds(i.kds_status) === 'done').length
|
||||
const total = relevant.length
|
||||
if (done === total && total > 0) return { text: t('card.allReady'), color: '#4ade80' }
|
||||
if (done === total && total > 0) return { text: t('card.allReady'), color: 'var(--x-success)' }
|
||||
const parts = []
|
||||
if (preparing > 0) parts.push(t('card.preparingCount', { count: preparing }))
|
||||
if (done > 0) parts.push(t('card.readyCount', { count: done }))
|
||||
return parts.length > 0 ? { text: parts.join(' · '), color: done > 0 ? '#4ade80' : '#60a5fa' } : null
|
||||
return parts.length > 0 ? { text: parts.join(' · '), color: done > 0 ? 'var(--x-success)' : 'var(--x-info)' } : null
|
||||
})()
|
||||
|
||||
return (
|
||||
@@ -590,7 +591,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
width: '100%',
|
||||
background: cfg.cardBg, borderRadius: 16,
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 10px rgba(0,0,0,0.12)',
|
||||
boxShadow: '0 2px 10px rgb(var(--x-scrim-rgb) / 0.12)',
|
||||
display: 'flex', flexDirection: 'column',
|
||||
position: 'relative',
|
||||
}}>
|
||||
@@ -632,7 +633,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
</div>
|
||||
|
||||
{/* divider */}
|
||||
<div style={{ width: 1, background: `${cfg.nameText}20`, alignSelf: 'stretch', flexShrink: 0 }} />
|
||||
<div style={{ width: 1, background: `${fade(cfg.nameText, 0.13)}`, alignSelf: 'stretch', flexShrink: 0 }} />
|
||||
|
||||
{/* right column: order items */}
|
||||
<div style={{ flex: 1, minWidth: 0, overflow: 'hidden' }}>
|
||||
@@ -650,7 +651,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
<div key={item.id} style={{ display: 'flex', alignItems: 'baseline', gap: 5, overflow: 'hidden', minWidth: 0 }}>
|
||||
<span style={{
|
||||
fontSize: 11, fontWeight: 700, color: cfg.nameText,
|
||||
background: `${cfg.nameText}18`, borderRadius: 3,
|
||||
background: `${fade(cfg.nameText, 0.09)}`, borderRadius: 3,
|
||||
padding: '1px 5px', flexShrink: 0,
|
||||
}}>{fmtItemQtyTC(item.quantity, item.unit_type)}</span>
|
||||
<span style={{
|
||||
@@ -675,7 +676,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
{/* KDS footer row — only when there's something to show */}
|
||||
{kdsFooter && (
|
||||
<div style={{
|
||||
borderTop: `1px solid ${cfg.nameText}22`,
|
||||
borderTop: `1px solid ${fade(cfg.nameText, 0.13)}`,
|
||||
padding: '6px 14px',
|
||||
display: 'flex', alignItems: 'center', gap: 6,
|
||||
position: 'relative', zIndex: 2,
|
||||
@@ -688,7 +689,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
||||
|
||||
{/* footer: waiters */}
|
||||
<div style={{
|
||||
borderTop: `1px solid ${cfg.nameText}22`,
|
||||
borderTop: `1px solid ${fade(cfg.nameText, 0.13)}`,
|
||||
padding: '10px 14px', minHeight: 38,
|
||||
display: 'flex', alignItems: 'center',
|
||||
position: 'relative', zIndex: 2,
|
||||
@@ -738,8 +739,8 @@ export default function TableCard({
|
||||
const flashFrame = useFlashToggle(flashOn)
|
||||
|
||||
// 'transparent' in a flash color means "show the base card color for that slot".
|
||||
// The settings UI stores transparent as 'rgba(0,0,0,0)', so we check both forms.
|
||||
const isTransparent = (v) => !v || v === 'transparent' || v === 'rgba(0,0,0,0)'
|
||||
// The settings UI stores transparent as 'rgb(var(--x-scrim-rgb) / 0)', so we check both forms.
|
||||
const isTransparent = (v) => !v || v === 'transparent' || v === 'rgb(var(--x-scrim-rgb) / 0)'
|
||||
const fc = (flashColor, baseColor) => isTransparent(flashColor) ? baseColor : flashColor
|
||||
|
||||
// cfg always = baseCfg for card background (so table status colour shows through flash overlay)
|
||||
@@ -844,7 +845,7 @@ export default function TableCard({
|
||||
}}>
|
||||
<span style={{
|
||||
display: 'inline-flex', alignItems: 'center', gap: 3,
|
||||
background: '#4f46e5', color: '#e0e7ff',
|
||||
background: 'var(--x-info)', color: 'var(--x-info-soft)',
|
||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
||||
borderRadius: 4, padding: '2px 6px',
|
||||
}}>
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function UpdatePrompt() {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 16,
|
||||
boxShadow: '0 8px 32px rgba(0,0,0,0.4)',
|
||||
boxShadow: '0 8px 32px rgb(var(--x-scrim-rgb) / 0.4)',
|
||||
whiteSpace: 'nowrap',
|
||||
}}>
|
||||
<span style={{ fontSize: 14, color: 'var(--text)', fontWeight: 500 }}>
|
||||
@@ -34,7 +34,7 @@ export default function UpdatePrompt() {
|
||||
onClick={() => updateServiceWorker(true)}
|
||||
style={{
|
||||
background: 'var(--accent)',
|
||||
color: '#0f172a',
|
||||
color: 'var(--x-canvas)',
|
||||
border: 'none',
|
||||
borderRadius: 10,
|
||||
padding: '8px 16px',
|
||||
|
||||
@@ -14,29 +14,29 @@ export function useNotifications() {
|
||||
|
||||
const TYPE_THEME = {
|
||||
manager: {
|
||||
bg: '#1e1b4b', border: '#6366f1', ackBg: '#4f46e5',
|
||||
labelColor: '#a5b4fc', icon: '📢',
|
||||
bg: 'var(--x-info-soft)', border: 'var(--x-info)', ackBg: 'var(--x-info)',
|
||||
labelColor: 'var(--x-info-ink)', icon: '📢',
|
||||
},
|
||||
kds_order_done: {
|
||||
bg: '#052e16', border: '#22c55e', ackBg: '#16a34a',
|
||||
labelColor: '#86efac', icon: '✅',
|
||||
bg: 'var(--x-success-fg)', border: 'var(--x-success)', ackBg: 'var(--x-success)',
|
||||
labelColor: 'var(--x-success-ink)', icon: '✅',
|
||||
},
|
||||
kds_item_done: {
|
||||
bg: '#052e16', border: '#4ade80', ackBg: '#15803d',
|
||||
labelColor: '#86efac', icon: '🍽️',
|
||||
bg: 'var(--x-success-fg)', border: 'var(--x-success)', ackBg: 'var(--x-success)',
|
||||
labelColor: 'var(--x-success-ink)', icon: '🍽️',
|
||||
},
|
||||
kds_call_order: {
|
||||
bg: '#2d1505', border: '#f97316', ackBg: '#ea580c',
|
||||
labelColor: '#fed7aa', icon: '🔔',
|
||||
bg: 'var(--x-warning-fg)', border: 'var(--x-warning)', ackBg: 'var(--x-warning)',
|
||||
labelColor: 'var(--x-warning-ink)', icon: '🔔',
|
||||
},
|
||||
kds_call_general: {
|
||||
bg: '#2d1505', border: '#f59e0b', ackBg: '#d97706',
|
||||
labelColor: '#fde68a', icon: '👋',
|
||||
bg: 'var(--x-warning-fg)', border: 'var(--x-warning)', ackBg: 'var(--x-warning)',
|
||||
labelColor: 'var(--x-warning-ink)', icon: '👋',
|
||||
},
|
||||
// a table ordered from the QR menu (phase 3S, S.7): already on the table's order and in the kitchen
|
||||
qr_order: {
|
||||
bg: '#0c1f2e', border: '#38bdf8', ackBg: '#0284c7',
|
||||
labelColor: '#bae6fd', icon: '📱',
|
||||
bg: 'var(--x-info-fg)', border: 'var(--x-info)', ackBg: 'var(--x-info)',
|
||||
labelColor: 'var(--x-info-ink)', icon: '📱',
|
||||
},
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ function isManagerMessage(msg) {
|
||||
|
||||
// ─── Rich body renderer — highlights #order, table name, and zone after " - " ─
|
||||
|
||||
const HIGHLIGHT = { color: '#7dd3fc', fontWeight: 800 } // light blue bold
|
||||
const HIGHLIGHT = { color: 'var(--x-info-ink)', fontWeight: 800 } // light blue bold
|
||||
|
||||
// the word before a table name in staff messages, English or Greek (\u escapes keep the source ASCII)
|
||||
const TABLE_WORDS = 'table|\u03c4\u03c1\u03b1\u03c0\u03ad\u03b6\u03b9'
|
||||
@@ -111,7 +111,7 @@ function NotificationBanner({ message, onAck, autoDismiss }) {
|
||||
display: 'flex', alignItems: 'flex-start', gap: 12,
|
||||
background: theme.bg, border: `1px solid ${theme.border}`,
|
||||
borderRadius: 14, padding: '12px 14px',
|
||||
boxShadow: '0 8px 24px rgba(0,0,0,0.4)',
|
||||
boxShadow: '0 8px 24px rgb(var(--x-scrim-rgb) / 0.4)',
|
||||
animation: 'slideIn 0.25s ease',
|
||||
}}>
|
||||
<span style={{ fontSize: 22, flexShrink: 0 }}>{theme.icon}</span>
|
||||
@@ -121,11 +121,11 @@ function NotificationBanner({ message, onAck, autoDismiss }) {
|
||||
{message.kds_zone || message.sender_name}
|
||||
</div>
|
||||
)}
|
||||
<div style={{ fontSize: 15, fontWeight: 600, color: '#e2e8f0', lineHeight: 1.4 }}>
|
||||
<div style={{ fontSize: 15, fontWeight: 600, color: 'var(--x-ink)', lineHeight: 1.4 }}>
|
||||
<RichBody text={message.body} />
|
||||
</div>
|
||||
{tableIds.length > 0 && (
|
||||
<div style={{ fontSize: 12, color: '#94a3b8', marginTop: 4 }}>
|
||||
<div style={{ fontSize: 12, color: 'var(--x-ink-2)', marginTop: 4 }}>
|
||||
{t('notify.tables', { count: tableIds.length, tables: tableIds.join(', ') })}
|
||||
</div>
|
||||
)}
|
||||
@@ -135,7 +135,7 @@ function NotificationBanner({ message, onAck, autoDismiss }) {
|
||||
style={{
|
||||
flexShrink: 0, height: 32, padding: '0 12px',
|
||||
borderRadius: 8, border: 'none',
|
||||
background: theme.ackBg, color: 'white',
|
||||
background: theme.ackBg, color: 'var(--x-on-colour)',
|
||||
fontSize: 12, fontWeight: 700, cursor: 'pointer',
|
||||
}}
|
||||
>OK ✓</button>
|
||||
@@ -279,7 +279,7 @@ export function NotificationProvider({ children }) {
|
||||
))}
|
||||
{popupMessages.length > 3 && (
|
||||
<div style={{
|
||||
textAlign: 'center', fontSize: 12, color: '#94a3b8',
|
||||
textAlign: 'center', fontSize: 12, color: 'var(--x-ink-2)',
|
||||
pointerEvents: 'all',
|
||||
}}>
|
||||
{t('notify.more', { count: popupMessages.length - 3 })}
|
||||
|
||||
+43
-69
@@ -33,9 +33,9 @@ input, textarea, [contenteditable] {
|
||||
}
|
||||
|
||||
@keyframes tab-alert {
|
||||
0% { color: #f87171; }
|
||||
50% { color: #ef444488; }
|
||||
100% { color: #f87171; }
|
||||
0% { color: var(--x-danger); }
|
||||
50% { color: rgb(var(--x-danger-rgb) / 0.53); }
|
||||
100% { color: var(--x-danger); }
|
||||
}
|
||||
|
||||
@keyframes gate-spin {
|
||||
@@ -44,73 +44,47 @@ input, textarea, [contenteditable] {
|
||||
|
||||
/* Order item text pulse for "done" KDS status in order detail view */
|
||||
@keyframes kds-ready-pulse-text {
|
||||
0%,100% { color: #4ade80; }
|
||||
50% { color: #bbf7d0; }
|
||||
0%,100% { color: var(--x-success); }
|
||||
50% { color: var(--x-success-ink); }
|
||||
}
|
||||
.kds-ready-flash-text {
|
||||
animation: kds-ready-pulse-text 1.6s ease-in-out infinite;
|
||||
}
|
||||
|
||||
/* The waiter's own variables are the shared @xenia/ui tokens (plan step 4.6, CS-16): light /
|
||||
* dark from data-theme on <html> (the user menu), the accent from data-venue-theme (the
|
||||
* venue's colour, Settings → Venue). No colour value is written here or in the app's code. */
|
||||
:root {
|
||||
/* "Free" table card — dark theme: muted blue-slate */
|
||||
--card-free-bg: #243044;
|
||||
--card-free-text: #94b8d4;
|
||||
--card-free-muted: rgba(148,184,212,0.45);
|
||||
/* "Free" table card */
|
||||
--card-free-bg: var(--x-surface-2);
|
||||
--card-free-text: var(--x-ink-2);
|
||||
--card-free-muted: rgb(var(--x-ink-2-rgb) / 0.45);
|
||||
|
||||
/* Dark theme — deep navy */
|
||||
--bg: #0d1520;
|
||||
--bg2: #1a2535;
|
||||
--bg3: #243044;
|
||||
--bg4: #2e3d54;
|
||||
--text: #edf2f7;
|
||||
--text2: #94a3b8;
|
||||
--muted: #5a7390;
|
||||
--accent: #f59e0b;
|
||||
--accent-fg: #1c1000;
|
||||
--accent-dim: #6b3a00;
|
||||
--success: #22c55e;
|
||||
--success-fg: #052e16;
|
||||
--danger: #f87171;
|
||||
--danger-sat: #ef4444;
|
||||
--danger-dim: #450a0a;
|
||||
--primary: #3b82f6;
|
||||
--primary-fg: #ffffff;
|
||||
--border: #253245;
|
||||
--shadow: rgba(0,0,0,0.35);
|
||||
--bg: var(--x-canvas);
|
||||
--bg2: var(--x-surface);
|
||||
--bg3: var(--x-surface-2);
|
||||
--bg4: var(--x-surface-3);
|
||||
--text: var(--x-ink);
|
||||
--text2: var(--x-ink-2);
|
||||
--muted: var(--x-ink-3);
|
||||
--accent: var(--x-accent);
|
||||
--accent-fg: var(--x-accent-fg);
|
||||
--accent-dim: var(--x-accent-soft);
|
||||
--success: var(--x-success);
|
||||
--success-fg: var(--x-success-fg);
|
||||
--danger: var(--x-danger);
|
||||
--danger-sat: var(--x-danger);
|
||||
--danger-dim: var(--x-danger-soft);
|
||||
--primary: var(--x-info);
|
||||
--primary-fg: var(--x-info-fg);
|
||||
--border: var(--x-line);
|
||||
--shadow: rgb(var(--x-scrim-rgb) / 0.3);
|
||||
font-family: 'Google Sans', system-ui, 'Segoe UI', sans-serif;
|
||||
font-size: 16px;
|
||||
color: var(--text);
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
[data-theme="light"] {
|
||||
/* "Free" table card — light theme: cool light grey */
|
||||
--card-free-bg: #dde5ef;
|
||||
--card-free-text: #3d5270;
|
||||
--card-free-muted: rgba(61,82,112,0.45);
|
||||
|
||||
/* Light theme — warm slate / off-white */
|
||||
--bg: #f1f5f9;
|
||||
--bg2: #ffffff;
|
||||
--bg3: #e8edf4;
|
||||
--bg4: #dce3ee;
|
||||
--text: #1e293b;
|
||||
--text2: #475569;
|
||||
--muted: #7a8fa6;
|
||||
--accent: #e08c00;
|
||||
--accent-fg: #ffffff;
|
||||
--accent-dim: #fef3c7;
|
||||
--success: #16a34a;
|
||||
--success-fg: #ffffff;
|
||||
--danger: #dc2626;
|
||||
--danger-sat: #dc2626;
|
||||
--danger-dim: #fee2e2;
|
||||
--primary: #2563eb;
|
||||
--primary-fg: #ffffff;
|
||||
--border: #cdd6e0;
|
||||
--shadow: rgba(0,0,0,0.10);
|
||||
}
|
||||
|
||||
html, body {
|
||||
background: var(--bg);
|
||||
overscroll-behavior: none;
|
||||
@@ -169,7 +143,7 @@ html, body {
|
||||
.btn--primary { background: var(--primary); color: var(--primary-fg); }
|
||||
.btn--accent { background: var(--accent); color: var(--accent-fg); }
|
||||
.btn--success { background: var(--success); color: var(--success-fg); }
|
||||
.btn--danger { background: var(--danger-sat); color: #fff; }
|
||||
.btn--danger { background: var(--danger-sat); color: var(--x-danger-fg); }
|
||||
.btn--secondary{ background: var(--bg3); color: var(--text); }
|
||||
.btn--lg { min-height: 64px; font-size: 17px; border-radius: 14px; }
|
||||
|
||||
@@ -387,7 +361,7 @@ html, body {
|
||||
overflow: hidden;
|
||||
padding: 8px 10px;
|
||||
}
|
||||
.cat-all-tile--active { outline: 3px solid #fff; }
|
||||
.cat-all-tile--active { outline: 3px solid var(--x-on-colour); }
|
||||
.cat-all-tile__overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
@@ -397,9 +371,9 @@ html, body {
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
color: var(--x-on-colour);
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 4px rgba(0,0,0,0.6);
|
||||
text-shadow: 0 1px 4px rgb(var(--x-scrim-rgb) / 0.6);
|
||||
line-height: 1.3;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
@@ -569,9 +543,9 @@ html, body {
|
||||
.order-item--last { border-bottom: none; }
|
||||
.order-item--paid { opacity: 0.5; }
|
||||
.order-item--cancelled { opacity: 0.3; text-decoration: line-through; }
|
||||
.order-item--selected { background: rgba(245,158,11,0.10); border-radius: 8px; }
|
||||
.order-item--selected { background: rgb(var(--x-warning-rgb) / 0.1); border-radius: 8px; }
|
||||
.order-item__row { display: flex; align-items: center; gap: 8px; }
|
||||
.order-item__name { flex: 1; font-size: 17px; font-weight: 600; color: #f59e0b; }
|
||||
.order-item__name { flex: 1; font-size: 17px; font-weight: 600; color: var(--x-warning); }
|
||||
.order-item__name--served { color: var(--text); }
|
||||
.order-item__name--cancelled { color: var(--muted); }
|
||||
.order-item__qty { font-size: 15px; color: var(--muted); }
|
||||
@@ -607,7 +581,7 @@ html, body {
|
||||
.modal-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0,0,0,0.6);
|
||||
background: rgb(var(--x-scrim-rgb) / 0.6);
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
z-index: 100;
|
||||
@@ -745,14 +719,14 @@ html, body {
|
||||
cursor: pointer;
|
||||
}
|
||||
.qty-offset-btn--add {
|
||||
background: rgba(34,197,94,0.12);
|
||||
background: rgb(var(--x-success-rgb) / 0.12);
|
||||
color: var(--success);
|
||||
border-color: rgba(34,197,94,0.3);
|
||||
border-color: rgb(var(--x-success-rgb) / 0.3);
|
||||
}
|
||||
.qty-offset-btn--sub {
|
||||
background: rgba(248,113,113,0.12);
|
||||
background: rgb(var(--x-danger-rgb) / 0.12);
|
||||
color: var(--danger);
|
||||
border-color: rgba(248,113,113,0.3);
|
||||
border-color: rgb(var(--x-danger-rgb) / 0.3);
|
||||
}
|
||||
|
||||
/* ── User Menu Dropdown ──────────────────────────────────── */
|
||||
@@ -764,7 +738,7 @@ html, body {
|
||||
background: var(--bg2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 8px 24px rgba(0,0,0,0.25);
|
||||
box-shadow: 0 8px 24px rgb(var(--x-scrim-rgb) / 0.25);
|
||||
min-width: 200px;
|
||||
padding: 6px;
|
||||
display: flex;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Colours made lighter / see-through (plan step 4.6). Works for a token (`var(--x-warning)`)
|
||||
// and for a colour the venue stored (a course's, a table card's) alike, so app code never
|
||||
// appends a hex alpha (e.g. an amber plus "40") to a value it doesn't know the format of.
|
||||
export const fade = (colour, alpha) => `color-mix(in srgb, ${colour} ${Math.round(alpha * 100)}%, transparent)`
|
||||
@@ -1,7 +1,15 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import '@xenia/ui/tokens.css' // shared --x-* tokens; the waiter's own --bg/--text… stay as they are
|
||||
import '@xenia/ui/tokens.css' // shared --x-* tokens: the waiter's --bg/--text… are made of them (4.6)
|
||||
import './index.css'
|
||||
|
||||
// The theme before anything renders (no light flash on a dark phone): the user's light/dark
|
||||
// (themeStore, default dark) and the waiter's default accent until bootstrap says the venue's.
|
||||
try {
|
||||
const saved = JSON.parse(localStorage.getItem('pos-theme') || 'null')
|
||||
document.documentElement.setAttribute('data-theme', saved?.state?.dark === false ? 'light' : 'dark')
|
||||
} catch { document.documentElement.setAttribute('data-theme', 'dark') }
|
||||
document.documentElement.setAttribute('data-venue-theme', 'amber')
|
||||
import App from './App.jsx'
|
||||
import db from './db/posdb.js'
|
||||
import { deliveryMode, getActiveVenue } from './config/server'
|
||||
|
||||
@@ -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