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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user