Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
beb53c65bb | ||
|
|
d8c3a6c57c |
@@ -112,6 +112,7 @@ def bootstrap(
|
|||||||
"timezone": timeutil.venue_tz().key,
|
"timezone": timeutil.venue_tz().key,
|
||||||
"language": i18n.venue_language(),
|
"language": i18n.venue_language(),
|
||||||
"currency": _setting(db, "venue.currency", "EUR"),
|
"currency": _setting(db, "venue.currency", "EUR"),
|
||||||
|
"theme": _setting(db, "venue.theme", "amber") or "amber", # the accent colour (4.6, data-venue-theme)
|
||||||
"business_day_rollover_hour": timeutil.rollover_hour(),
|
"business_day_rollover_hour": timeutil.rollover_hour(),
|
||||||
},
|
},
|
||||||
"modules": [{"key": m.key, "kind": m.kind} for m in registry().values() if m.key in effective],
|
"modules": [{"key": m.key, "kind": m.kind} for m in registry().values() if m.key in effective],
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ MODULE = Module(
|
|||||||
SettingDef('venue.language', 'en', 'Default language (en | el) for staff without their own language, and for printed reports/receipts and tickets of zones without one.', type='str'),
|
SettingDef('venue.language', 'en', 'Default language (en | el) for staff without their own language, and for printed reports/receipts and tickets of zones without one.', type='str'),
|
||||||
SettingDef('venue.timezone', 'Europe/Athens', 'IANA time zone of the venue (e.g. Europe/Athens). All times are shown in it; DST is automatic. Applies immediately.', type='str'),
|
SettingDef('venue.timezone', 'Europe/Athens', 'IANA time zone of the venue (e.g. Europe/Athens). All times are shown in it; DST is automatic. Applies immediately.', type='str'),
|
||||||
SettingDef('venue.name', '', 'Venue name shown on screens and tickets.', type='str'),
|
SettingDef('venue.name', '', 'Venue name shown on screens and tickets.', type='str'),
|
||||||
|
SettingDef('venue.theme', 'amber', "Accent colour of the staff apps (the waiter's phones first, plan step 4.6): 'teal' | 'amber' | 'blue' | 'violet' | 'rose'", type='enum', choices=('teal', 'amber', 'blue', 'violet', 'rose')),
|
||||||
SettingDef('venue.type', '', 'Kind of venue (restaurant, cafe, bar...), chosen in the setup wizard.', type='str'),
|
SettingDef('venue.type', '', 'Kind of venue (restaurant, cafe, bar...), chosen in the setup wizard.', type='str'),
|
||||||
SettingDef('venue.currency', 'EUR', 'ISO 4217 currency of all prices.', type='str'),
|
SettingDef('venue.currency', 'EUR', 'ISO 4217 currency of all prices.', type='str'),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
"""The venue's colour for the staff apps (plan step 4.6): setting venue.theme, in bootstrap."""
|
||||||
|
|
||||||
|
|
||||||
|
def test_venue_theme_reaches_bootstrap(client, make_user, login):
|
||||||
|
owner = login(make_user(role="owner"))
|
||||||
|
assert client.get("/api/platform/bootstrap").json()["venue"]["theme"] == "amber" # the waiter's colour so far
|
||||||
|
assert client.put("/api/settings/venue.theme", headers=owner, json={"value": "blue"}).status_code == 200
|
||||||
|
assert client.get("/api/platform/bootstrap").json()["venue"]["theme"] == "blue"
|
||||||
|
r = client.put("/api/settings/venue.theme", headers=owner, json={"value": "neon"})
|
||||||
|
assert r.status_code in (400, 422)
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
// Venue language and time zone (plan step 2.6f, D-11, D-12): venue.language is the
|
// Venue language and time zone (plan step 2.6f, D-11, D-12): venue.language is the
|
||||||
// language of staff without their own choice and of printed tickets/reports; venue.timezone
|
// language of staff without their own choice and of printed tickets/reports; venue.timezone
|
||||||
// is the zone every time is shown in (applies at once). Both reload bootstrap after saving.
|
// is the zone every time is shown in (applies at once); venue.theme is the staff apps' accent
|
||||||
|
// colour (plan step 4.6: the waiter's phones). All reload bootstrap after saving.
|
||||||
import { useId, useMemo } from 'react'
|
import { useId, useMemo } from 'react'
|
||||||
import { useAccess } from '@xenia/access'
|
import { useAccess } from '@xenia/access'
|
||||||
import { LANGUAGE_NAMES, useTranslation, useFormat } from '@xenia/i18n'
|
import { LANGUAGE_NAMES, useTranslation, useFormat } from '@xenia/i18n'
|
||||||
@@ -9,6 +10,8 @@ import { SettingRow, SettingsCard } from './SettingsCard'
|
|||||||
import { useSettings } from './useSettings'
|
import { useSettings } from './useSettings'
|
||||||
import { timeZones } from './timeZones'
|
import { timeZones } from './timeZones'
|
||||||
|
|
||||||
|
const VENUE_THEMES = ['amber', 'teal', 'blue', 'violet', 'rose'] // packages/ui tokens.css data-venue-theme
|
||||||
|
|
||||||
export default function VenueSettings() {
|
export default function VenueSettings() {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
const f = useFormat()
|
const f = useFormat()
|
||||||
@@ -16,6 +19,7 @@ export default function VenueSettings() {
|
|||||||
const s = useSettings()
|
const s = useSettings()
|
||||||
const langId = useId()
|
const langId = useId()
|
||||||
const tzId = useId()
|
const tzId = useId()
|
||||||
|
const themeId = useId()
|
||||||
const tz = s.get('venue.timezone', 'Europe/Athens')
|
const tz = s.get('venue.timezone', 'Europe/Athens')
|
||||||
const zones = useMemo(() => timeZones(tz), [tz])
|
const zones = useMemo(() => timeZones(tz), [tz])
|
||||||
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
if (s.loading) return <div className="py-8 flex justify-center"><Spinner /></div>
|
||||||
@@ -33,6 +37,11 @@ export default function VenueSettings() {
|
|||||||
onChange={e => s.save('venue.timezone', e.target.value)}
|
onChange={e => s.save('venue.timezone', e.target.value)}
|
||||||
options={zones.map(z => ({ value: z, label: z.replace(/_/g, ' ') }))} />
|
options={zones.map(z => ({ value: z, label: z.replace(/_/g, ' ') }))} />
|
||||||
</SettingRow>
|
</SettingRow>
|
||||||
|
<SettingRow label={t('settings.venue.theme')} htmlFor={themeId} hint={t('settings.venue.themeHint')}>
|
||||||
|
<Select id={themeId} value={s.get('venue.theme', 'amber')} disabled={s.saving} data-testid="setting-venue.theme"
|
||||||
|
onChange={e => s.save('venue.theme', e.target.value)}
|
||||||
|
options={VENUE_THEMES.map(v => ({ value: v, label: t(`settings.venue.themes.${v}`) }))} />
|
||||||
|
</SettingRow>
|
||||||
</SettingsCard>
|
</SettingsCard>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { useTranslation } from '@xenia/i18n'
|
|||||||
import client from '../../../api/client'
|
import client from '../../../api/client'
|
||||||
|
|
||||||
/** Keys that change what bootstrap says (language, time zone, sign-in mode): reload it. */
|
/** Keys that change what bootstrap says (language, time zone, sign-in mode): reload it. */
|
||||||
const BOOTSTRAP_KEYS = new Set(['venue.language', 'venue.timezone', 'auth.manager_login_mode', 'security.autofill_username'])
|
const BOOTSTRAP_KEYS = new Set(['venue.language', 'venue.timezone', 'venue.theme', 'auth.manager_login_mode', 'security.autofill_username'])
|
||||||
|
|
||||||
export function useSettings() {
|
export function useSettings() {
|
||||||
const { t } = useTranslation('manager')
|
const { t } = useTranslation('manager')
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { OverrideHost } from './OverrideHost.jsx'
|
|||||||
* error with Retry.
|
* error with Retry.
|
||||||
*/
|
*/
|
||||||
const CACHE_RETRY_MS = 15_000
|
const CACHE_RETRY_MS = 15_000
|
||||||
|
const BOOTSTRAP_TIMEOUT_MS = 8_000
|
||||||
|
|
||||||
export function AccessProvider({
|
export function AccessProvider({
|
||||||
client, token = null, i18n, deviceLanguage, override = true, loading, autoRetryMs = 0, cache, failed, children,
|
client, token = null, i18n, deviceLanguage, override = true, loading, autoRetryMs = 0, cache, failed, children,
|
||||||
@@ -44,7 +45,9 @@ export function AccessProvider({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { data } = await client.get('/api/platform/bootstrap', { xenia: { ignoreUnauthorized: true, noOverride: true } })
|
// a time limit: a request that never answers (a half-dead link) must not leave the app on
|
||||||
|
// its loading screen for good; it counts as offline and is retried (4.6, Android e2e)
|
||||||
|
const { data } = await client.get('/api/platform/bootstrap', { timeout: BOOTSTRAP_TIMEOUT_MS, xenia: { ignoreUnauthorized: true, noOverride: true } })
|
||||||
await apply(data)
|
await apply(data)
|
||||||
try { cache?.save(token, data) } catch { /* storage full or blocked: still works online */ }
|
try { cache?.save(token, data) } catch { /* storage full or blocked: still works online */ }
|
||||||
setState({ data, forToken: token, error: null, offline: false })
|
setState({ data, forToken: token, error: null, offline: false })
|
||||||
|
|||||||
@@ -360,7 +360,16 @@
|
|||||||
"language": "Γλώσσα",
|
"language": "Γλώσσα",
|
||||||
"languageHint": "Για όσους δεν έχουν διαλέξει δική τους, και για τα εκτυπωμένα δελτία και τις αναφορές.",
|
"languageHint": "Για όσους δεν έχουν διαλέξει δική τους, και για τα εκτυπωμένα δελτία και τις αναφορές.",
|
||||||
"timezone": "Ζώνη ώρας",
|
"timezone": "Ζώνη ώρας",
|
||||||
"timezoneHint": "Όλες οι ώρες εμφανίζονται σε αυτή. Η ώρα εκεί τώρα: {{time}}."
|
"timezoneHint": "Όλες οι ώρες εμφανίζονται σε αυτή. Η ώρα εκεί τώρα: {{time}}.",
|
||||||
|
"theme": "Χρώμα",
|
||||||
|
"themeHint": "Το χρώμα έμφασης στα κινητά των σερβιτόρων.",
|
||||||
|
"themes": {
|
||||||
|
"amber": "Πορτοκαλί",
|
||||||
|
"teal": "Πετρόλ",
|
||||||
|
"blue": "Μπλε",
|
||||||
|
"violet": "Μωβ",
|
||||||
|
"rose": "Ροζ"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"print": {
|
"print": {
|
||||||
"title": "Ειδοποιήσεις εκτύπωσης",
|
"title": "Ειδοποιήσεις εκτύπωσης",
|
||||||
|
|||||||
@@ -360,7 +360,16 @@
|
|||||||
"language": "Language",
|
"language": "Language",
|
||||||
"languageHint": "For staff who haven't chosen their own, and for printed tickets and reports.",
|
"languageHint": "For staff who haven't chosen their own, and for printed tickets and reports.",
|
||||||
"timezone": "Time zone",
|
"timezone": "Time zone",
|
||||||
"timezoneHint": "Every time is shown in it. The time there now: {{time}}."
|
"timezoneHint": "Every time is shown in it. The time there now: {{time}}.",
|
||||||
|
"theme": "Colour",
|
||||||
|
"themeHint": "The accent colour of the waiters' phones.",
|
||||||
|
"themes": {
|
||||||
|
"amber": "Amber",
|
||||||
|
"teal": "Teal",
|
||||||
|
"blue": "Blue",
|
||||||
|
"violet": "Violet",
|
||||||
|
"rose": "Rose"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"print": {
|
"print": {
|
||||||
"title": "Print alerts",
|
"title": "Print alerts",
|
||||||
|
|||||||
@@ -41,6 +41,11 @@
|
|||||||
--x-info-fg-rgb: 255 255 255;
|
--x-info-fg-rgb: 255 255 255;
|
||||||
--x-info-soft-rgb: 219 234 254;
|
--x-info-soft-rgb: 219 234 254;
|
||||||
--x-info-ink-rgb: 29 78 216;
|
--x-info-ink-rgb: 29 78 216;
|
||||||
|
/* special: offers, discounts, deals (violet; plan step 4.6) */
|
||||||
|
--x-special-rgb: 109 40 217;
|
||||||
|
--x-special-fg-rgb: 255 255 255;
|
||||||
|
--x-special-soft-rgb: 237 233 254;
|
||||||
|
--x-special-ink-rgb: 91 33 182;
|
||||||
--x-scrim-rgb: 15 23 42;
|
--x-scrim-rgb: 15 23 42;
|
||||||
--x-accent-rgb: 15 118 110;
|
--x-accent-rgb: 15 118 110;
|
||||||
--x-accent-strong-rgb: 17 94 89;
|
--x-accent-strong-rgb: 17 94 89;
|
||||||
@@ -76,6 +81,10 @@
|
|||||||
--x-info-fg-rgb: 23 37 84;
|
--x-info-fg-rgb: 23 37 84;
|
||||||
--x-info-soft-rgb: 30 58 138;
|
--x-info-soft-rgb: 30 58 138;
|
||||||
--x-info-ink-rgb: 191 219 254;
|
--x-info-ink-rgb: 191 219 254;
|
||||||
|
--x-special-rgb: 167 139 250;
|
||||||
|
--x-special-fg-rgb: 30 16 64;
|
||||||
|
--x-special-soft-rgb: 59 31 110;
|
||||||
|
--x-special-ink-rgb: 221 214 254;
|
||||||
--x-scrim-rgb: 0 0 0;
|
--x-scrim-rgb: 0 0 0;
|
||||||
--x-accent-rgb: 45 212 191;
|
--x-accent-rgb: 45 212 191;
|
||||||
--x-accent-strong-rgb: 94 234 212;
|
--x-accent-strong-rgb: 94 234 212;
|
||||||
@@ -110,6 +119,10 @@
|
|||||||
--x-info-fg-rgb: 23 37 84;
|
--x-info-fg-rgb: 23 37 84;
|
||||||
--x-info-soft-rgb: 30 58 138;
|
--x-info-soft-rgb: 30 58 138;
|
||||||
--x-info-ink-rgb: 191 219 254;
|
--x-info-ink-rgb: 191 219 254;
|
||||||
|
--x-special-rgb: 167 139 250;
|
||||||
|
--x-special-fg-rgb: 30 16 64;
|
||||||
|
--x-special-soft-rgb: 59 31 110;
|
||||||
|
--x-special-ink-rgb: 221 214 254;
|
||||||
--x-scrim-rgb: 0 0 0;
|
--x-scrim-rgb: 0 0 0;
|
||||||
--x-accent-rgb: 45 212 191;
|
--x-accent-rgb: 45 212 191;
|
||||||
--x-accent-strong-rgb: 94 234 212;
|
--x-accent-strong-rgb: 94 234 212;
|
||||||
@@ -366,6 +379,10 @@
|
|||||||
--x-info-fg: rgb(var(--x-info-fg-rgb));
|
--x-info-fg: rgb(var(--x-info-fg-rgb));
|
||||||
--x-info-soft: rgb(var(--x-info-soft-rgb));
|
--x-info-soft: rgb(var(--x-info-soft-rgb));
|
||||||
--x-info-ink: rgb(var(--x-info-ink-rgb));
|
--x-info-ink: rgb(var(--x-info-ink-rgb));
|
||||||
|
--x-special: rgb(var(--x-special-rgb));
|
||||||
|
--x-special-fg: rgb(var(--x-special-fg-rgb));
|
||||||
|
--x-special-soft: rgb(var(--x-special-soft-rgb));
|
||||||
|
--x-special-ink: rgb(var(--x-special-ink-rgb));
|
||||||
--x-scrim: rgb(var(--x-scrim-rgb));
|
--x-scrim: rgb(var(--x-scrim-rgb));
|
||||||
--x-accent: rgb(var(--x-accent-rgb));
|
--x-accent: rgb(var(--x-accent-rgb));
|
||||||
--x-accent-strong: rgb(var(--x-accent-strong-rgb));
|
--x-accent-strong: rgb(var(--x-accent-strong-rgb));
|
||||||
@@ -373,6 +390,10 @@
|
|||||||
--x-accent-soft: rgb(var(--x-accent-soft-rgb));
|
--x-accent-soft: rgb(var(--x-accent-soft-rgb));
|
||||||
--x-accent-ink: rgb(var(--x-accent-ink-rgb));
|
--x-accent-ink: rgb(var(--x-accent-ink-rgb));
|
||||||
--x-focus-ring: 0 0 0 3px rgb(var(--x-accent-rgb) / 0.35);
|
--x-focus-ring: 0 0 0 3px rgb(var(--x-accent-rgb) / 0.35);
|
||||||
|
/* text on a colour the venue chose (a category, a course, a flag) or on a photo: always
|
||||||
|
white, with a shadow where the colour may be light (plan step 4.6) */
|
||||||
|
--x-on-colour-rgb: 255 255 255;
|
||||||
|
--x-on-colour: rgb(var(--x-on-colour-rgb));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For native controls (select popups, scrollbars) inside @xenia/ui components only.
|
/* For native controls (select popups, scrollbars) inside @xenia/ui components only.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const pairs = [
|
|||||||
['accent-ink', 'accent-soft', TEXT], ['accent-ink', 'surface', TEXT],
|
['accent-ink', 'accent-soft', TEXT], ['accent-ink', 'surface', TEXT],
|
||||||
['accent', 'surface', UI], // switch on, focus, filled PIN dots
|
['accent', 'surface', UI], // switch on, focus, filled PIN dots
|
||||||
['ink-3', 'surface', UI], // switch off track
|
['ink-3', 'surface', UI], // switch off track
|
||||||
...['success', 'warning', 'danger', 'info'].flatMap(t => [
|
...['success', 'warning', 'danger', 'info', 'special'].flatMap(t => [
|
||||||
[`${t}-fg`, t, TEXT], [`${t}-ink`, `${t}-soft`, TEXT], [`${t}-ink`, 'surface', TEXT], [t, 'surface', UI],
|
[`${t}-fg`, t, TEXT], [`${t}-ink`, `${t}-soft`, TEXT], [`${t}-ink`, 'surface', TEXT], [t, 'surface', UI],
|
||||||
]),
|
]),
|
||||||
]
|
]
|
||||||
|
|||||||
+19
-1
@@ -15,7 +15,7 @@ const vite = await startViteNative({ port: 5181, backendUrl: backend.url })
|
|||||||
const APP = 'http://localhost:5181'
|
const APP = 'http://localhost:5181'
|
||||||
const TOKEN_KEY = 'xenia:dev:token'
|
const TOKEN_KEY = 'xenia:dev:token'
|
||||||
const browser = await chromium.launch(BROWSER_CHANNEL ? { channel: BROWSER_CHANNEL } : {})
|
const browser = await chromium.launch(BROWSER_CHANNEL ? { channel: BROWSER_CHANNEL } : {})
|
||||||
const r = reporter('waiter: sign-in v2, lock, approvals (4.2), keys (4.3), server prices (4.4), languages (4.5), table history (4.7)')
|
const r = reporter('waiter: sign-in v2, lock, approvals (4.2), keys (4.3), server prices (4.4), languages (4.5), table history (4.7), look (4.6)')
|
||||||
const errors = []
|
const errors = []
|
||||||
let failures = 0
|
let failures = 0
|
||||||
|
|
||||||
@@ -274,6 +274,24 @@ try {
|
|||||||
await a.getByTestId('menu-language-en').click()
|
await a.getByTestId('menu-language-en').click()
|
||||||
await waitFor(async () => (await navText()).includes('Tables'), 8000, 300)
|
await waitFor(async () => (await navText()).includes('Tables'), 8000, 300)
|
||||||
|
|
||||||
|
// ── 4.6: the look on the shared tokens: the venue's colour and light / dark reach the phone ──
|
||||||
|
const accentOf = () => a.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue('--x-accent-rgb').trim())
|
||||||
|
r.check('4.6: the venue colour (default amber) is on the phone', await a.evaluate(() => document.documentElement.dataset.venueTheme) === 'amber')
|
||||||
|
await api('PUT', '/api/settings/venue.theme', { token: boss, body: { value: 'blue' } })
|
||||||
|
await a.reload()
|
||||||
|
await waitFor(async () => (await a.evaluate(() => document.documentElement.dataset.venueTheme)) === 'blue', 10_000, 300)
|
||||||
|
r.check('4.6: Settings → Venue → Colour: blue reaches the phone (its accent turns blue)',
|
||||||
|
await a.evaluate(() => document.documentElement.dataset.venueTheme) === 'blue' && (await accentOf()) === '96 165 250', await accentOf())
|
||||||
|
await api('PUT', '/api/settings/venue.theme', { token: boss, body: { value: 'amber' } })
|
||||||
|
await a.getByRole('button', { name: 'demo_maria' }).first().click({ timeout: 10_000 })
|
||||||
|
await a.getByRole('button', { name: /Light theme/ }).click()
|
||||||
|
const bg = await a.evaluate(() => getComputedStyle(document.body).backgroundColor)
|
||||||
|
r.check('4.6: light theme from the menu: the page turns light (tokens)', await a.evaluate(() => document.documentElement.dataset.theme) === 'light' && bg === 'rgb(248, 250, 252)', bg)
|
||||||
|
await a.screenshot({ path: path.join(OUT, 'waiter-light.png') })
|
||||||
|
await a.getByRole('button', { name: 'demo_maria' }).first().click({ timeout: 10_000 })
|
||||||
|
await a.getByRole('button', { name: /Dark theme/ }).click()
|
||||||
|
await a.reload()
|
||||||
|
|
||||||
// ── Signing out ends the session on the server: the second phone can sign in ─
|
// ── Signing out ends the session on the server: the second phone can sign in ─
|
||||||
await a.getByRole('button', { name: 'demo_maria' }).first().click({ timeout: 10_000 })
|
await a.getByRole('button', { name: 'demo_maria' }).first().click({ timeout: 10_000 })
|
||||||
await a.getByRole('button', { name: /Sign out/ }).last().click()
|
await a.getByRole('button', { name: /Sign out/ }).last().click()
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
// Screenshots of every waiter page, light and dark, on a phone-sized screen (plan step 4.6:
|
||||||
|
// "the screenshots of every page are reviewed side by side with today's").
|
||||||
|
//
|
||||||
|
// node waiter_look.mjs <label> → out/look/<label>/<page>-<theme>.png
|
||||||
|
// node waiter_look.mjs --compare a b → out/look/compare.html (a and b side by side)
|
||||||
|
//
|
||||||
|
// Starts its own backend (:8062, demo data) and the venue-mode dev build (:5182).
|
||||||
|
import { mkdirSync, readdirSync, writeFileSync } from 'node:fs'
|
||||||
|
import path from 'node:path'
|
||||||
|
import { chromium } from 'playwright'
|
||||||
|
import { BROWSER_CHANNEL, OUT, sleep } from './lib/env.mjs'
|
||||||
|
import { login, startBackend, startViteNative } from './lib/proc.mjs'
|
||||||
|
|
||||||
|
const LOOK = path.join(OUT, 'look')
|
||||||
|
|
||||||
|
if (process.argv[2] === '--compare') {
|
||||||
|
const [a, b] = process.argv.slice(3)
|
||||||
|
const shots = readdirSync(path.join(LOOK, a)).filter(f => f.endsWith('.png')).sort()
|
||||||
|
const rows = shots.map(f => `<tr><th colspan="2">${f}</th></tr><tr><td><img src="${a}/${f}"></td><td><img src="${b}/${f}"></td></tr>`).join('\n')
|
||||||
|
writeFileSync(path.join(LOOK, 'compare.html'), `<!doctype html><meta charset="utf-8"><title>Waiter look ${a} / ${b}</title>
|
||||||
|
<style>body{font-family:sans-serif;background:#ddd}td{vertical-align:top;padding:6px}img{width:393px;border:1px solid #999}th{text-align:left;padding-top:18px}</style>
|
||||||
|
<table><tr><th>${a}</th><th>${b}</th></tr>${rows}</table>`)
|
||||||
|
console.log(`✓ ${path.join(LOOK, 'compare.html')} (${shots.length} pages)`)
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
const label = process.argv[2] || 'now'
|
||||||
|
const dir = path.join(LOOK, label)
|
||||||
|
mkdirSync(dir, { recursive: true })
|
||||||
|
const backend = await startBackend({ port: 8062, siteId: 'test-site-1', env: { LICENSE_MODE: 'off' } })
|
||||||
|
const vite = await startViteNative({ port: 5182, backendUrl: backend.url })
|
||||||
|
const APP = 'http://localhost:5182'
|
||||||
|
const browser = await chromium.launch(BROWSER_CHANNEL ? { channel: BROWSER_CHANNEL } : {})
|
||||||
|
try {
|
||||||
|
const boss = await login(backend.url)
|
||||||
|
await fetch(`${backend.url}/api/business-day/open`, { method: 'POST', headers: { 'content-type': 'application/json', authorization: `Bearer ${boss}` }, body: '{}' }).catch(() => {})
|
||||||
|
const ctx = await browser.newContext({ viewport: { width: 393, height: 852 }, deviceScaleFactor: 1, isMobile: true, hasTouch: true })
|
||||||
|
const page = await ctx.newPage()
|
||||||
|
await page.goto(`${APP}/login`)
|
||||||
|
await page.getByTestId('waiter-card').filter({ hasText: 'Κωνσταντίνου' }).click()
|
||||||
|
for (const d of '3302') await page.getByRole('button', { name: d, exact: true }).first().click()
|
||||||
|
await page.getByRole('button', { name: /Start shift/ }).click({ timeout: 10_000 }).catch(() => {})
|
||||||
|
await page.waitForURL(u => u.pathname.startsWith('/tables'), { timeout: 15_000 }).catch(() => {})
|
||||||
|
const token = await page.evaluate(() => localStorage.getItem('xenia:dev:token'))
|
||||||
|
const api = (m, u, body) => fetch(backend.url + u, { method: m, headers: { 'content-type': 'application/json', authorization: `Bearer ${token}` }, body: body && JSON.stringify(body) }).then(r => r.json())
|
||||||
|
const tables = await api('GET', '/api/tables/')
|
||||||
|
// an order with a few items on the first table (the demo data has only finished orders)
|
||||||
|
const [busy, free] = tables
|
||||||
|
const prods = (await api('GET', '/api/products/')).filter(p => p.is_available && !p.is_service_item && !(p.preference_sets || []).some(ps => ps.default_choice_id == null))
|
||||||
|
const o = await api('POST', '/api/orders/', { table_id: busy.id, order_type: 'here' })
|
||||||
|
await api('POST', `/api/orders/${o.id}/items`, { lines: prods.slice(0, 4).map((p, i) => ({ product_id: p.id, quantity: i + 1 })) })
|
||||||
|
|
||||||
|
const shots = [
|
||||||
|
['01-tables', '/tables'],
|
||||||
|
['02-orders', '/tables?tab=orders'],
|
||||||
|
['03-table-detail', `/tables/${busy.id}`],
|
||||||
|
['04-table-free', `/tables/${free.id}`],
|
||||||
|
['05-add-items', `/tables/${busy.id}/add`],
|
||||||
|
['06-shift', '/shift-overview'],
|
||||||
|
['07-order-log', '/order-log'],
|
||||||
|
['08-settings', '/settings'],
|
||||||
|
['09-messages', '/messages'],
|
||||||
|
]
|
||||||
|
for (const theme of ['dark', 'light']) {
|
||||||
|
await page.evaluate(th => { localStorage.setItem('pos-theme', JSON.stringify({ state: { dark: th === 'dark' }, version: 0 })) }, theme)
|
||||||
|
for (const [name, url] of shots) {
|
||||||
|
await page.goto(APP + url)
|
||||||
|
await sleep(2500)
|
||||||
|
await page.screenshot({ path: path.join(dir, `${name}-${theme}.png`) })
|
||||||
|
}
|
||||||
|
// the cart and the options drawer
|
||||||
|
await page.goto(`${APP}/tables/${busy.id}/add`)
|
||||||
|
await sleep(2000)
|
||||||
|
await page.locator('[data-testid="product-card"]').first().click().catch(() => {})
|
||||||
|
await sleep(1200)
|
||||||
|
await page.screenshot({ path: path.join(dir, `10-drawer-${theme}.png`) })
|
||||||
|
await page.goto(`${APP}/tables/${busy.id}`)
|
||||||
|
await sleep(2000)
|
||||||
|
await page.getByText(/ACTIONS/i).first().click().catch(() => {})
|
||||||
|
await sleep(800)
|
||||||
|
await page.screenshot({ path: path.join(dir, `11-actions-${theme}.png`) })
|
||||||
|
await page.getByTestId('user-menu').click().catch(() => {})
|
||||||
|
}
|
||||||
|
const p2 = await ctx.newPage()
|
||||||
|
await page.evaluate(() => localStorage.removeItem('xenia:dev:token'))
|
||||||
|
await p2.goto(`${APP}/login`)
|
||||||
|
await sleep(2000)
|
||||||
|
await p2.screenshot({ path: path.join(dir, '00-login-light.png') })
|
||||||
|
console.log(`✓ ${dir}`)
|
||||||
|
} finally {
|
||||||
|
await browser.close()
|
||||||
|
vite.stop(); await backend.stop()
|
||||||
|
}
|
||||||
@@ -78,9 +78,9 @@ function GateBtn({ onClick, disabled, variant = 'primary', children }) {
|
|||||||
opacity: disabled ? 0.6 : 1, transition: 'opacity 120ms',
|
opacity: disabled ? 0.6 : 1, transition: 'opacity 120ms',
|
||||||
}
|
}
|
||||||
const styles = {
|
const styles = {
|
||||||
primary: { background: 'var(--accent)', color: '#0f172a' },
|
primary: { background: 'var(--accent)', color: 'var(--x-canvas)' },
|
||||||
secondary: { background: 'var(--bg3)', color: 'var(--text)' },
|
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>
|
return <button style={{ ...base, ...styles[variant] }} onClick={onClick} disabled={disabled}>{children}</button>
|
||||||
}
|
}
|
||||||
@@ -331,11 +331,17 @@ function OfflineListener() {
|
|||||||
return null
|
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() {
|
function ThemeApplier() {
|
||||||
const dark = useThemeStore(s => s.dark)
|
const dark = useThemeStore(s => s.dark)
|
||||||
|
const venueTheme = useAccess()?.venue?.theme || 'amber'
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light')
|
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light')
|
||||||
}, [dark])
|
}, [dark])
|
||||||
|
useEffect(() => {
|
||||||
|
document.documentElement.setAttribute('data-venue-theme', venueTheme)
|
||||||
|
}, [venueTheme])
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import useKdsReadyStore from '../store/kdsReadyStore'
|
|||||||
import useInstallPromptStore, { apkAvailable } from '../store/installPromptStore'
|
import useInstallPromptStore, { apkAvailable } from '../store/installPromptStore'
|
||||||
import useOfflineQueueCount from '../hooks/useOfflineQueueCount'
|
import useOfflineQueueCount from '../hooks/useOfflineQueueCount'
|
||||||
import useFailedPrintCount from '../hooks/useFailedPrintCount'
|
import useFailedPrintCount from '../hooks/useFailedPrintCount'
|
||||||
|
import { fade } from '../logic/colour'
|
||||||
|
|
||||||
// ─── Nav item registry ────────────────────────────────────────────────────────
|
// ─── Nav item registry ────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -121,7 +122,7 @@ function CacheButton({ count }) {
|
|||||||
position: 'relative',
|
position: 'relative',
|
||||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
minWidth: 44, minHeight: 44, borderRadius: 8,
|
minWidth: 44, minHeight: 44, borderRadius: 8,
|
||||||
color: '#f59e0b',
|
color: 'var(--x-warning)',
|
||||||
}}>
|
}}>
|
||||||
{/* Cloud upload icon */}
|
{/* Cloud upload icon */}
|
||||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none">
|
<svg width="22" height="22" viewBox="0 0 24 24" fill="none">
|
||||||
@@ -130,7 +131,7 @@ function CacheButton({ count }) {
|
|||||||
</svg>
|
</svg>
|
||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: 6, right: 6,
|
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,
|
borderRadius: '50%', width: 16, height: 16,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
}}>
|
}}>
|
||||||
@@ -152,7 +153,7 @@ function FailedPrintButton({ count, onClick }) {
|
|||||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
minWidth: 44, minHeight: 44, borderRadius: 8,
|
minWidth: 44, minHeight: 44, borderRadius: 8,
|
||||||
background: 'none', border: 'none', cursor: 'pointer',
|
background: 'none', border: 'none', cursor: 'pointer',
|
||||||
color: '#ef4444',
|
color: 'var(--x-danger)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* Printer icon */}
|
{/* Printer icon */}
|
||||||
@@ -163,7 +164,7 @@ function FailedPrintButton({ count, onClick }) {
|
|||||||
</svg>
|
</svg>
|
||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: 6, right: 6,
|
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,
|
borderRadius: '50%', width: 16, height: 16,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
}}>
|
}}>
|
||||||
@@ -193,7 +194,7 @@ function BellButton({ onClick, count }) {
|
|||||||
{count > 0 && (
|
{count > 0 && (
|
||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: 6, right: 6,
|
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,
|
borderRadius: '50%', width: 16, height: 16,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
}}>
|
}}>
|
||||||
@@ -230,7 +231,7 @@ function NotificationDrawer({ messages, onClose }) {
|
|||||||
<span style={{ fontSize: 20, flexShrink: 0 }}>📢</span>
|
<span style={{ fontSize: 20, flexShrink: 0 }}>📢</span>
|
||||||
<div style={{ flex: 1, minWidth: 0 }}>
|
<div style={{ flex: 1, minWidth: 0 }}>
|
||||||
{msg.sender_name && (
|
{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>
|
<div style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>{msg.body}</div>
|
||||||
{tableIds.length > 0 && (
|
{tableIds.length > 0 && (
|
||||||
@@ -349,7 +350,7 @@ function DrawerButton({ item, location, onNavigate, active: activeProp, onClick
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
padding: '12px 14px', borderRadius: 12, border: 'none',
|
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)',
|
color: active ? 'var(--accent)' : 'var(--text)',
|
||||||
fontSize: 15, fontWeight: active ? 700 : 500,
|
fontSize: 15, fontWeight: active ? 700 : 500,
|
||||||
cursor: 'pointer', textAlign: 'left', width: '100%',
|
cursor: 'pointer', textAlign: 'left', width: '100%',
|
||||||
@@ -391,7 +392,7 @@ function SideDrawer({ open, onClose }) {
|
|||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
style={{
|
style={{
|
||||||
position: 'fixed', inset: 0, zIndex: 300,
|
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,
|
opacity: open ? 1 : 0,
|
||||||
pointerEvents: open ? 'all' : 'none',
|
pointerEvents: open ? 'all' : 'none',
|
||||||
transition: 'opacity 0.22s ease',
|
transition: 'opacity 0.22s ease',
|
||||||
@@ -406,7 +407,7 @@ function SideDrawer({ open, onClose }) {
|
|||||||
display: 'flex', flexDirection: 'column',
|
display: 'flex', flexDirection: 'column',
|
||||||
transform: open ? 'translateX(0)' : 'translateX(-100%)',
|
transform: open ? 'translateX(0)' : 'translateX(-100%)',
|
||||||
transition: 'transform 0.22s ease',
|
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 */}
|
{/* Drawer header */}
|
||||||
<div style={{ padding: '20px 20px 16px', borderBottom: '1px solid var(--border)' }}>
|
<div style={{ padding: '20px 20px 16px', borderBottom: '1px solid var(--border)' }}>
|
||||||
@@ -451,11 +452,11 @@ function SideDrawer({ open, onClose }) {
|
|||||||
|
|
||||||
// ─── Triple pill footer ───────────────────────────────────────────────────────
|
// ─── Triple pill footer ───────────────────────────────────────────────────────
|
||||||
|
|
||||||
function PillBadge({ count, color = '#ef4444' }) {
|
function PillBadge({ count, color = 'var(--x-danger)' }) {
|
||||||
if (!count) return null
|
if (!count) return null
|
||||||
return (
|
return (
|
||||||
<span style={{
|
<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,
|
borderRadius: 11, minWidth: 22, height: 22,
|
||||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
padding: '0 6px', lineHeight: 1, flexShrink: 0,
|
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) && !isStandaloneActive
|
||||||
: item.match(location)
|
: item.match(location)
|
||||||
const badge = item.key === 'messages' && chatUnread > 0
|
const badge = item.key === 'messages' && chatUnread > 0
|
||||||
? { count: chatUnread, color: '#ef4444' }
|
? { count: chatUnread, color: 'var(--x-danger)' }
|
||||||
: item.key === 'orders' && kdsReady > 0
|
: item.key === 'orders' && kdsReady > 0
|
||||||
? { count: kdsReady, color: '#22c55e' }
|
? { count: kdsReady, color: 'var(--x-success)' }
|
||||||
: null
|
: null
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
@@ -564,9 +565,9 @@ function IconNavbar({ navItems, location, navigate, chatUnread, kdsReady }) {
|
|||||||
? item.match(location) && !isStandaloneActive
|
? item.match(location) && !isStandaloneActive
|
||||||
: item.match(location)
|
: item.match(location)
|
||||||
const badge = item.key === 'messages' && chatUnread > 0
|
const badge = item.key === 'messages' && chatUnread > 0
|
||||||
? { count: chatUnread, color: '#ef4444' }
|
? { count: chatUnread, color: 'var(--x-danger)' }
|
||||||
: item.key === 'orders' && kdsReady > 0
|
: item.key === 'orders' && kdsReady > 0
|
||||||
? { count: kdsReady, color: '#22c55e' }
|
? { count: kdsReady, color: 'var(--x-success)' }
|
||||||
: null
|
: null
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
@@ -594,7 +595,7 @@ function IconNavbar({ navItems, location, navigate, chatUnread, kdsReady }) {
|
|||||||
{badge && (
|
{badge && (
|
||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: -4, right: -6,
|
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,
|
borderRadius: '50%', minWidth: 14, height: 14,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
padding: '0 2px',
|
padding: '0 2px',
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export default function BundleSync() {
|
|||||||
position: 'fixed', bottom: 80, left: 12, right: 12, zIndex: 9998,
|
position: 'fixed', bottom: 80, left: 12, right: 12, zIndex: 9998,
|
||||||
background: 'var(--bg2)', border: '1px solid var(--accent)', borderRadius: 16,
|
background: 'var(--bg2)', border: '1px solid var(--accent)', borderRadius: 16,
|
||||||
padding: '12px 14px', display: 'flex', alignItems: 'center', gap: 12,
|
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 }}>
|
<span style={{ flex: 1, fontSize: 13, color: 'var(--text)', lineHeight: 1.35 }}>
|
||||||
{t('update.needsNewerApp')}
|
{t('update.needsNewerApp')}
|
||||||
@@ -56,7 +56,7 @@ export default function BundleSync() {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
style={{
|
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',
|
fontSize: 14, fontWeight: 700, textDecoration: 'none', whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import useConnectionStore from '../store/connectionStore'
|
import useConnectionStore from '../store/connectionStore'
|
||||||
|
import { fade } from '../logic/colour'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A 3px bar pinned to the very top of the screen (above the header).
|
* 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 isReconnecting = status === 'reconnecting'
|
||||||
|
|
||||||
const color = isOnline
|
const color = isOnline
|
||||||
? (liveAlive ? '#22c55e' : '#3b82f6')
|
? (liveAlive ? 'var(--x-success)' : 'var(--x-info)')
|
||||||
: isReconnecting
|
: isReconnecting
|
||||||
? '#f59e0b'
|
? 'var(--x-warning)'
|
||||||
: '#ef4444'
|
: 'var(--x-danger)'
|
||||||
|
|
||||||
const animated = !isOnline
|
const animated = !isOnline
|
||||||
|
|
||||||
@@ -67,7 +68,7 @@ export default function ConnectivityBar() {
|
|||||||
style={{
|
style={{
|
||||||
'--cb-color': color,
|
'--cb-color': color,
|
||||||
backgroundColor: 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
|
<div
|
||||||
onClick={dismiss}
|
onClick={dismiss}
|
||||||
style={{
|
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,
|
display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 16,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -45,7 +45,7 @@ export default function InstallAppDialog() {
|
|||||||
style={{
|
style={{
|
||||||
width: '100%', maxWidth: 360, maxHeight: '92vh', overflowY: 'auto',
|
width: '100%', maxWidth: 360, maxHeight: '92vh', overflowY: 'auto',
|
||||||
background: 'var(--bg2)', border: '1px solid var(--border)', borderRadius: 22,
|
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,
|
display: 'flex', flexDirection: 'column', gap: 18,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -55,7 +55,7 @@ export default function InstallAppDialog() {
|
|||||||
alt=""
|
alt=""
|
||||||
width={76}
|
width={76}
|
||||||
height={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' }}>
|
<h2 id="install-app-title" style={{ fontSize: 20, fontWeight: 800, color: 'var(--text)', margin: '14px 0 4px' }}>
|
||||||
{t('install.title')}
|
{t('install.title')}
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ function CheckCircle({ selected }) {
|
|||||||
return (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 24, height: 24, borderRadius: '50%', flexShrink: 0,
|
width: 24, height: 24, borderRadius: '50%', flexShrink: 0,
|
||||||
border: `2px solid ${selected ? '#f59e0b' : 'var(--border)'}`,
|
border: `2px solid ${selected ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||||
background: selected ? '#f59e0b' : 'transparent',
|
background: selected ? 'var(--x-warning)' : 'transparent',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
transition: 'all 120ms ease',
|
transition: 'all 120ms ease',
|
||||||
}}>
|
}}>
|
||||||
@@ -118,12 +118,12 @@ function RadioDot({ selected }) {
|
|||||||
return (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 22, height: 22, borderRadius: '50%', flexShrink: 0,
|
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',
|
background: 'transparent',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
transition: 'all 120ms ease',
|
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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -132,8 +132,8 @@ function Row({ selected, onClick, children, right, left, style = {} }) {
|
|||||||
return (
|
return (
|
||||||
<div onClick={onClick} style={{
|
<div onClick={onClick} style={{
|
||||||
padding: '12px 14px',
|
padding: '12px 14px',
|
||||||
background: selected ? 'rgba(245,158,11,0.12)' : 'var(--bg2)',
|
background: selected ? 'rgb(var(--x-warning-rgb) / 0.12)' : 'var(--bg2)',
|
||||||
border: `1px solid ${selected ? 'rgba(245,158,11,0.4)' : 'var(--border)'}`,
|
border: `1px solid ${selected ? 'rgb(var(--x-warning-rgb) / 0.4)' : 'var(--border)'}`,
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
cursor: onClick ? 'pointer' : 'default',
|
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: 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 }}>
|
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 2 }}>
|
||||||
{(opt.extra_cost ?? 0) !== 0 ? `+${money(opt.extra_cost)}` : t('drawer.included')}
|
{(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 && (
|
{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>
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{/* Single-select sub-choices (radio) */}
|
{/* Single-select sub-choices (radio) */}
|
||||||
{selected && open && hasSubs && !isMultiSelect && (
|
{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>
|
<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) => {
|
{opt.sub_choices.map((sub, si) => {
|
||||||
const isSel = sel.subName === sub.name
|
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) */}
|
{/* Multi-select sub-choices (checkboxes, optional qty stepper per sub) */}
|
||||||
{selected && open && hasSubs && isMultiSelect && (
|
{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>
|
<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) => {
|
{opt.sub_choices.map((sub, si) => {
|
||||||
const subQty = subs[sub.name] || 0
|
const subQty = subs[sub.name] || 0
|
||||||
@@ -335,7 +335,7 @@ function IngredientRow({ ing, removedState, setRemovedState, compact }) {
|
|||||||
height: 32, padding: '0 12px', borderRadius: 16,
|
height: 32, padding: '0 12px', borderRadius: 16,
|
||||||
background: removed ? 'var(--danger)' : 'var(--bg3)',
|
background: removed ? 'var(--danger)' : 'var(--bg3)',
|
||||||
border: `1px solid ${removed ? 'var(--danger)' : 'var(--border)'}`,
|
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,
|
fontSize: compact ? 11 : 13, fontWeight: 600,
|
||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
transition: 'all 120ms ease', whiteSpace: 'nowrap',
|
transition: 'all 120ms ease', whiteSpace: 'nowrap',
|
||||||
@@ -371,8 +371,8 @@ function PrefSetBlock({ ps, prefs, setPrefs, subChoices, setSubChoices, sharedSu
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div style={{ display: 'flex', alignItems: 'baseline', gap: 8, padding: '0 2px 10px' }}>
|
<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>
|
<div style={{ fontSize: 14, fontWeight: 700, color: complete ? 'var(--text)' : 'var(--x-danger)' }}>{ps.name}</div>
|
||||||
{!complete && <div style={{ fontSize: 11, fontWeight: 700, color: '#ef4444', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('drawer.required')}</div>}
|
{!complete && <div style={{ fontSize: 11, fontWeight: 700, color: 'var(--x-danger)', textTransform: 'uppercase', letterSpacing: 0.6 }}>{t('drawer.required')}</div>}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
|
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
|
||||||
{ps.choices.map(ch => {
|
{ps.choices.map(ch => {
|
||||||
@@ -389,8 +389,8 @@ function PrefSetBlock({ ps, prefs, setPrefs, subChoices, setSubChoices, sharedSu
|
|||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{isSel && hasSubs && (
|
{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 }}>
|
<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: '#ef4444', margin: '4px 2px 2px' }}>{t('drawer.choiceRequired')}</p>}
|
{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) => {
|
{ch.sub_choices.map((sub, si) => {
|
||||||
const subSel = subChoices[ch.id]?.name === sub.name
|
const subSel = subChoices[ch.id]?.name === sub.name
|
||||||
return (
|
return (
|
||||||
@@ -410,7 +410,7 @@ function PrefSetBlock({ ps, prefs, setPrefs, subChoices, setSubChoices, sharedSu
|
|||||||
})}
|
})}
|
||||||
|
|
||||||
{showShared && (
|
{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={{ 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 }}>
|
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 6 }}>
|
||||||
{ps.shared_subset.choices.map((sub, si) => {
|
{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
|
// Static group colours — cycle by index passed from parent
|
||||||
const GROUP_COLORS = [
|
const GROUP_COLORS = [
|
||||||
{ bg: '#e0e7ff', border: '#a5b4fc', text: '#3730a3' }, // indigo
|
{ bg: 'var(--x-info-soft)', border: 'var(--x-info-ink)', text: 'var(--x-info)' }, // indigo
|
||||||
{ bg: '#fce7f3', border: '#f9a8d4', text: '#9d174d' }, // pink
|
{ bg: 'var(--x-special-soft)', border: 'var(--x-special-ink)', text: 'var(--x-special)' }, // pink
|
||||||
{ bg: '#d1fae5', border: '#6ee7b7', text: '#065f46' }, // emerald
|
{ bg: 'var(--x-success-soft)', border: 'var(--x-success)', text: 'var(--x-success-soft)' }, // emerald
|
||||||
{ bg: '#fef3c7', border: '#fcd34d', text: '#92400e' }, // amber
|
{ bg: 'var(--x-warning-soft)', border: 'var(--x-warning)', text: 'var(--x-warning)' }, // amber
|
||||||
{ bg: '#e0f2fe', border: '#7dd3fc', text: '#075985' }, // sky
|
{ bg: 'var(--x-info-soft)', border: 'var(--x-info-ink)', text: 'var(--x-info)' }, // sky
|
||||||
{ bg: '#f3e8ff', border: '#d8b4fe', text: '#581c87' }, // purple
|
{ bg: 'var(--x-special-soft)', border: 'var(--x-special-ink)', text: 'var(--x-special)' }, // purple
|
||||||
]
|
]
|
||||||
|
|
||||||
function PWAGroupHeader({ name, collapsed, onToggle, colorIdx = 0 }) {
|
function PWAGroupHeader({ name, collapsed, onToggle, colorIdx = 0 }) {
|
||||||
@@ -788,7 +788,7 @@ function QuantityTab({ unitCfg, qty, setQty }) {
|
|||||||
onClick={() => setQty(q => clamp(q + off))}
|
onClick={() => setQty(q => clamp(q + off))}
|
||||||
style={{
|
style={{
|
||||||
padding: '10px 4px', borderRadius: 12, border: 'none',
|
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',
|
fontSize: 13, fontWeight: 700, cursor: 'pointer', textAlign: 'center',
|
||||||
}}
|
}}
|
||||||
>+{fmtDecimalQty(off, unitCfg)}{unitCfg.label}</button>
|
>+{fmtDecimalQty(off, unitCfg)}{unitCfg.label}</button>
|
||||||
@@ -799,7 +799,7 @@ function QuantityTab({ unitCfg, qty, setQty }) {
|
|||||||
onClick={() => setQty(q => clamp(q - off))}
|
onClick={() => setQty(q => clamp(q - off))}
|
||||||
style={{
|
style={{
|
||||||
padding: '10px 4px', borderRadius: 12, border: 'none',
|
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',
|
fontSize: 13, fontWeight: 700, cursor: 'pointer', textAlign: 'center',
|
||||||
}}
|
}}
|
||||||
>−{fmtDecimalQty(off, unitCfg)}{unitCfg.label}</button>
|
>−{fmtDecimalQty(off, unitCfg)}{unitCfg.label}</button>
|
||||||
@@ -843,7 +843,7 @@ function PriceAdjustTab({ basePrice, priceAdj, setPriceAdj }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
|
<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')}
|
{t('drawer.price.intro')}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -859,14 +859,14 @@ function PriceAdjustTab({ basePrice, priceAdj, setPriceAdj }) {
|
|||||||
onChange={e => setRawInput(e.target.value)}
|
onChange={e => setRawInput(e.target.value)}
|
||||||
onBlur={commitInput}
|
onBlur={commitInput}
|
||||||
onKeyDown={e => { if (e.key === 'Enter') e.target.blur() }}
|
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={{
|
<button onClick={() => { setRawInput(effectivePrice.toFixed(2)); setEditing(true) }} style={{
|
||||||
minWidth: 110, height: 52, borderRadius: 14,
|
minWidth: 110, height: 52, borderRadius: 14,
|
||||||
border: `2px solid ${priceAdj !== 0 ? '#f59e0b' : 'var(--border)'}`,
|
border: `2px solid ${priceAdj !== 0 ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||||
background: priceAdj !== 0 ? 'rgba(245,158,11,0.12)' : 'var(--bg2)',
|
background: priceAdj !== 0 ? 'rgb(var(--x-warning-rgb) / 0.12)' : 'var(--bg2)',
|
||||||
color: priceAdj !== 0 ? '#f59e0b' : 'var(--text)',
|
color: priceAdj !== 0 ? 'var(--x-warning)' : 'var(--text)',
|
||||||
fontSize: 22, fontWeight: 800, cursor: 'pointer', fontFamily: 'inherit',
|
fontSize: 22, fontWeight: 800, cursor: 'pointer', fontFamily: 'inherit',
|
||||||
}}>
|
}}>
|
||||||
{money(effectivePrice)}
|
{money(effectivePrice)}
|
||||||
@@ -878,7 +878,7 @@ function PriceAdjustTab({ basePrice, priceAdj, setPriceAdj }) {
|
|||||||
{priceAdj !== 0 && (
|
{priceAdj !== 0 && (
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 10 }}>
|
<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, 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)}
|
{priceAdj > 0 ? '+' : ''}{money(priceAdj)}
|
||||||
</span>
|
</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>
|
<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)}
|
onClick={() => applyDelta(d)}
|
||||||
style={{
|
style={{
|
||||||
padding: '11px 4px', borderRadius: 12, border: 'none',
|
padding: '11px 4px', borderRadius: 12, border: 'none',
|
||||||
background: d < 0 ? 'rgba(239,68,68,0.12)' : 'rgba(34,197,94,0.12)',
|
background: d < 0 ? 'rgb(var(--x-danger-rgb) / 0.12)' : 'rgb(var(--x-success-rgb) / 0.12)',
|
||||||
color: d < 0 ? '#fca5a5' : '#4ade80',
|
color: d < 0 ? 'var(--x-danger-ink)' : 'var(--x-success)',
|
||||||
fontSize: 14, fontWeight: 700, cursor: 'pointer',
|
fontSize: 14, fontWeight: 700, cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -947,7 +947,7 @@ function Section({ title, tab, lines, onJumpTab }) {
|
|||||||
<div style={{ marginBottom: 20 }}>
|
<div style={{ marginBottom: 20 }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '0 2px 8px' }}>
|
<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>
|
<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>
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
|
||||||
{lines.map((l, i) => (
|
{lines.map((l, i) => (
|
||||||
@@ -1006,9 +1006,9 @@ function SummaryTab({ _product, summaryLines, note, onJumpTab }) {
|
|||||||
<div style={{ marginBottom: 20 }}>
|
<div style={{ marginBottom: 20 }}>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '0 2px 8px' }}>
|
<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>
|
<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>
|
||||||
<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>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
@@ -1027,7 +1027,7 @@ function CoursesTab({ courses, courseId, setCourseId }) {
|
|||||||
style={{
|
style={{
|
||||||
padding: '10px 14px', borderRadius: 10, textAlign: 'left',
|
padding: '10px 14px', borderRadius: 10, textAlign: 'left',
|
||||||
background: courseId === null ? 'var(--accent)' : 'var(--card)',
|
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)'}`,
|
border: `2px solid ${courseId === null ? 'var(--accent)' : 'var(--line)'}`,
|
||||||
fontWeight: 600, fontSize: 14, cursor: 'pointer', fontFamily: 'inherit',
|
fontWeight: 600, fontSize: 14, cursor: 'pointer', fontFamily: 'inherit',
|
||||||
}}
|
}}
|
||||||
@@ -1041,7 +1041,7 @@ function CoursesTab({ courses, courseId, setCourseId }) {
|
|||||||
style={{
|
style={{
|
||||||
padding: '10px 14px', borderRadius: 10, textAlign: 'left',
|
padding: '10px 14px', borderRadius: 10, textAlign: 'left',
|
||||||
background: courseId === c.id ? c.color : 'var(--card)',
|
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)'}`,
|
border: `2px solid ${courseId === c.id ? c.color : 'var(--line)'}`,
|
||||||
fontWeight: 600, fontSize: 14, cursor: 'pointer', fontFamily: 'inherit',
|
fontWeight: 600, fontSize: 14, cursor: 'pointer', fontFamily: 'inherit',
|
||||||
display: 'flex', alignItems: 'center', gap: 10,
|
display: 'flex', alignItems: 'center', gap: 10,
|
||||||
@@ -1049,7 +1049,7 @@ function CoursesTab({ courses, courseId, setCourseId }) {
|
|||||||
>
|
>
|
||||||
<span style={{
|
<span style={{
|
||||||
width: 12, height: 12, borderRadius: '50%',
|
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,
|
flexShrink: 0,
|
||||||
}} />
|
}} />
|
||||||
{c.name}
|
{c.name}
|
||||||
@@ -1398,7 +1398,7 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
|||||||
{/* Backdrop */}
|
{/* Backdrop */}
|
||||||
<div onClick={onClose} style={{
|
<div onClick={onClose} style={{
|
||||||
position: 'fixed', inset: 0,
|
position: 'fixed', inset: 0,
|
||||||
background: 'rgba(0,0,0,0.6)',
|
background: 'rgb(var(--x-scrim-rgb) / 0.6)',
|
||||||
opacity: isOpen ? 1 : 0,
|
opacity: isOpen ? 1 : 0,
|
||||||
pointerEvents: isOpen ? 'auto' : 'none',
|
pointerEvents: isOpen ? 'auto' : 'none',
|
||||||
transition: 'opacity 260ms ease',
|
transition: 'opacity 260ms ease',
|
||||||
@@ -1416,7 +1416,7 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
|||||||
zIndex: 41,
|
zIndex: 41,
|
||||||
display: 'flex', flexDirection: 'column',
|
display: 'flex', flexDirection: 'column',
|
||||||
overflow: 'hidden',
|
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 */}
|
{/* Grab handle */}
|
||||||
<div style={{ padding: '10px 0 4px', display: 'flex', justifyContent: 'center', flexShrink: 0 }}>
|
<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={{ flex: 1, minWidth: 0 }}>
|
||||||
<div style={{ fontSize: 18, fontWeight: 700, color: 'var(--text)', lineHeight: 1.2 }}>{product.name}</div>
|
<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
|
{priceAdj !== 0
|
||||||
? <><span style={{ textDecoration: 'line-through', opacity: 0.5 }}>{money(product.base_price)}</span> → {money(product.base_price + priceAdj)}</>
|
? <><span style={{ textDecoration: 'line-through', opacity: 0.5 }}>{money(product.base_price)}</span> → {money(product.base_price + priceAdj)}</>
|
||||||
: <>{money(product.base_price)}</>
|
: <>{money(product.base_price)}</>
|
||||||
@@ -1450,12 +1450,12 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
|||||||
const active = activeTab === tb.id
|
const active = activeTab === tb.id
|
||||||
const badge = badgeFor(tb.id)
|
const badge = badgeFor(tb.id)
|
||||||
const isAlert = (tb.id === 'prefs' && prefsTabAlert) || (tb.id === 'favorites' && favTabAlert)
|
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 (
|
return (
|
||||||
<button key={tb.id} ref={el => { tabButtonRefs.current[tb.id] = el }} onClick={() => setActiveTab(tb.id)} style={{
|
<button key={tb.id} ref={el => { tabButtonRefs.current[tb.id] = el }} onClick={() => setActiveTab(tb.id)} style={{
|
||||||
padding: '12px 6px',
|
padding: '12px 6px',
|
||||||
background: 'none', border: 'none',
|
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,
|
color: tabColor,
|
||||||
fontSize: 13, fontWeight: (active || isAlert) ? 700 : 500,
|
fontSize: 13, fontWeight: (active || isAlert) ? 700 : 500,
|
||||||
fontFamily: 'inherit', cursor: 'pointer',
|
fontFamily: 'inherit', cursor: 'pointer',
|
||||||
@@ -1510,7 +1510,7 @@ export default function OrderDrawer({ product, isOpen, onClose, onAdd, initialSt
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Footer: qty stepper + ADD */}
|
{/* 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 ? (
|
{isDecimal ? (
|
||||||
<div
|
<div
|
||||||
onClick={() => setActiveTab('quantity')}
|
onClick={() => setActiveTab('quantity')}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { useRef, useState } from 'react'
|
|||||||
import useTableViewStore from '../store/tableViewStore'
|
import useTableViewStore from '../store/tableViewStore'
|
||||||
import { money } from '../i18n'
|
import { money } from '../i18n'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
|
import { fade } from '../logic/colour'
|
||||||
|
|
||||||
const fmtPrice = money
|
const fmtPrice = money
|
||||||
|
|
||||||
@@ -25,11 +26,11 @@ function fmtDateTime(iso) {
|
|||||||
|
|
||||||
function SectionIcon({ type }) {
|
function SectionIcon({ type }) {
|
||||||
const icons = {
|
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>,
|
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="#a3e635" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></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="#60a5fa" strokeWidth="2.5" strokeLinecap="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="#ef4444" 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="#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>,
|
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>
|
return <span style={{ display: 'inline-flex', alignItems: 'center', flexShrink: 0 }}>{icons[type] ?? null}</span>
|
||||||
}
|
}
|
||||||
@@ -112,9 +113,9 @@ function buildSections(item) {
|
|||||||
// ── KDS colour strip ──────────────────────────────────────────────────────────
|
// ── KDS colour strip ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
const KDS_COLORS = {
|
const KDS_COLORS = {
|
||||||
pending: { textColor: '#f59e0b', label: 'kds.pending', icon: '⏳', dot: '#f59e0b' },
|
pending: { textColor: 'var(--x-warning)', label: 'kds.pending', icon: '⏳', dot: 'var(--x-warning)' },
|
||||||
preparing: { textColor: '#60a5fa', label: 'kds.preparing', icon: '🔥', dot: '#60a5fa' },
|
preparing: { textColor: 'var(--x-info)', label: 'kds.preparing', icon: '🔥', dot: 'var(--x-info)' },
|
||||||
done: { textColor: '#4ade80', label: 'kds.ready', icon: '✓', dot: '#4ade80' },
|
done: { textColor: 'var(--x-success)', label: 'kds.ready', icon: '✓', dot: 'var(--x-success)' },
|
||||||
served: { textColor: null, label: null, icon: null, dot: null },
|
served: { textColor: null, label: null, icon: null, dot: null },
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +145,7 @@ function OptionsPanel({ sections }) {
|
|||||||
<SectionIcon type="quick" />
|
<SectionIcon type="quick" />
|
||||||
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
||||||
{line.name}
|
{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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@@ -154,7 +155,7 @@ function OptionsPanel({ sections }) {
|
|||||||
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
||||||
{line.name}
|
{line.name}
|
||||||
{line.subName && <span> · {line.subName}</span>}
|
{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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@@ -195,7 +196,7 @@ function KdsBadge({ kdsColor, kdsDisplayStyle }) {
|
|||||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.4,
|
fontSize: 9, fontWeight: 800, letterSpacing: 0.4,
|
||||||
color: kdsColor.textColor,
|
color: kdsColor.textColor,
|
||||||
borderRadius: 3, padding: '1px 5px',
|
borderRadius: 3, padding: '1px 5px',
|
||||||
border: `1px solid ${kdsColor.textColor}60`,
|
border: `1px solid ${fade(kdsColor.textColor, 0.38)}`,
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
}}>{t(kdsColor.label)}</span>
|
}}>{t(kdsColor.label)}</span>
|
||||||
)
|
)
|
||||||
@@ -204,10 +205,10 @@ function KdsBadge({ kdsColor, kdsDisplayStyle }) {
|
|||||||
// ── Price event label helpers ─────────────────────────────────────────────────
|
// ── Price event label helpers ─────────────────────────────────────────────────
|
||||||
|
|
||||||
const PRICING_EVENT_STYLE = {
|
const PRICING_EVENT_STYLE = {
|
||||||
modifier_applied: { color: '#60a5fa', label: null }, // label comes from modifier_name
|
modifier_applied: { color: 'var(--x-info)', label: null }, // label comes from modifier_name
|
||||||
waiter_discount: { color: '#c084fc', label: 'summary.discount' },
|
waiter_discount: { color: 'var(--x-special-ink)', label: 'summary.discount' },
|
||||||
free_item_added: { color: '#4ade80', label: 'summary.free' },
|
free_item_added: { color: 'var(--x-success)', label: 'summary.free' },
|
||||||
deal_offer_accepted: { color: '#4ade80', label: null }, // label from deal_name
|
deal_offer_accepted: { color: 'var(--x-success)', label: null }, // label from deal_name
|
||||||
}
|
}
|
||||||
|
|
||||||
function PricingRows({ events, _layout, nameIndent = 12 }) {
|
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={{ margin: `0 12px`, height: 1, background: 'var(--border)' }} />
|
||||||
<div style={{ padding: `4px 12px 4px ${nameIndent}px`, display: 'flex', flexDirection: 'column', gap: 3 }}>
|
<div style={{ padding: `4px 12px 4px ${nameIndent}px`, display: 'flex', flexDirection: 'column', gap: 3 }}>
|
||||||
{rows.map((ev, i) => {
|
{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 label = ev.modifier_name || ev.deal_name || (evStyle.label && t(evStyle.label)) || ev.event_type
|
||||||
const delta = ev.delta_amount
|
const delta = ev.delta_amount
|
||||||
|
|
||||||
@@ -263,19 +264,19 @@ function PricingBadge({ events }) {
|
|||||||
const icons = []
|
const icons = []
|
||||||
if (hasModifier) icons.push(
|
if (hasModifier) icons.push(
|
||||||
<svg key="mod" width="10" height="10" viewBox="0 0 24 24" fill="none" title={t('summary.modifier')}>
|
<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>
|
</svg>
|
||||||
)
|
)
|
||||||
if (hasDiscount) icons.push(
|
if (hasDiscount) icons.push(
|
||||||
<svg key="disc" width="10" height="10" viewBox="0 0 24 24" fill="none" title={t('summary.discount')}>
|
<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="9" cy="9" r="2" stroke="var(--x-special-ink)" strokeWidth="2"/>
|
||||||
<circle cx="15" cy="15" r="2" stroke="#c084fc" strokeWidth="2"/>
|
<circle cx="15" cy="15" r="2" stroke="var(--x-special-ink)" strokeWidth="2"/>
|
||||||
<path d="M5 19L19 5" stroke="#c084fc" strokeWidth="2" strokeLinecap="round"/>
|
<path d="M5 19L19 5" stroke="var(--x-special-ink)" strokeWidth="2" strokeLinecap="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
if (hasFree) icons.push(
|
if (hasFree) icons.push(
|
||||||
<svg key="free" width="10" height="10" viewBox="0 0 24 24" fill="none" title={t('summary.free')}>
|
<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>
|
</svg>
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -294,8 +295,8 @@ function DealBadge({ item }) {
|
|||||||
return (
|
return (
|
||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 9, fontWeight: 700, padding: '1px 5px', borderRadius: 4,
|
fontSize: 9, fontWeight: 700, padding: '1px 5px', borderRadius: 4,
|
||||||
background: 'rgba(167,139,250,0.15)', color: '#a78bfa',
|
background: 'rgb(var(--x-special-rgb) / 0.15)', color: 'var(--x-special-ink)',
|
||||||
border: '1px solid rgba(167,139,250,0.4)', flexShrink: 0, letterSpacing: 0.3,
|
border: '1px solid rgb(var(--x-special-rgb) / 0.4)', flexShrink: 0, letterSpacing: 0.3,
|
||||||
}}>
|
}}>
|
||||||
{t('summary.freeCaps')}
|
{t('summary.freeCaps')}
|
||||||
</span>
|
</span>
|
||||||
@@ -309,8 +310,8 @@ function MergedBadge({ item }) {
|
|||||||
return (
|
return (
|
||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 9, fontWeight: 700, padding: '1px 5px', borderRadius: 4,
|
fontSize: 9, fontWeight: 700, padding: '1px 5px', borderRadius: 4,
|
||||||
background: 'rgba(99,102,241,0.15)', color: '#a5b4fc',
|
background: 'rgb(var(--x-info-rgb) / 0.15)', color: 'var(--x-info-ink)',
|
||||||
border: '1px solid rgba(99,102,241,0.35)', flexShrink: 0, letterSpacing: 0.3,
|
border: '1px solid rgb(var(--x-info-rgb) / 0.35)', flexShrink: 0, letterSpacing: 0.3,
|
||||||
}}>
|
}}>
|
||||||
∑{item._sourceIds?.length}
|
∑{item._sourceIds?.length}
|
||||||
</span>
|
</span>
|
||||||
@@ -373,7 +374,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
<span style={{
|
<span style={{
|
||||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
width: 16, height: 16, borderRadius: '50%',
|
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,
|
fontSize: 9, fontWeight: 700, flexShrink: 0, marginLeft: 4,
|
||||||
}}>
|
}}>
|
||||||
{courses.indexOf(course) + 1}
|
{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' }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '7px 12px' }}>
|
||||||
{selectable && !isCancelled && (
|
{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 ? '☑' : '☐'}
|
{selected ? '☑' : '☐'}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -464,7 +465,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
|
|
||||||
<KdsBadge kdsColor={kdsColor} kdsDisplayStyle={kdsDisplayStyle} />
|
<KdsBadge kdsColor={kdsColor} kdsDisplayStyle={kdsDisplayStyle} />
|
||||||
<span className="order-item__qty">{fmtQty(item.quantity, item.unit_type)}</span>
|
<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}
|
{totalPrice}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -488,7 +489,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
{/* Row 1: checkbox · name · badges · expand arrow · KDS badge */}
|
{/* Row 1: checkbox · name · badges · expand arrow · KDS badge */}
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 12px 2px' }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 12px 2px' }}>
|
||||||
{selectable && !isCancelled && (
|
{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 ? '☑' : '☐'}
|
{selected ? '☑' : '☐'}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -520,14 +521,14 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
}}>
|
}}>
|
||||||
<span style={{ fontSize: 12, color: 'var(--muted)', flex: 1 }}>
|
<span style={{ fontSize: 12, color: 'var(--muted)', flex: 1 }}>
|
||||||
{hasPriceAdj
|
{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)
|
: fmtPrice(unitPriceAdjusted)
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<span className="order-item__qty" style={{ textAlign: 'center', minWidth: 48 }}>
|
<span className="order-item__qty" style={{ textAlign: 'center', minWidth: 48 }}>
|
||||||
{fmtQty(item.quantity, item.unit_type)}
|
{fmtQty(item.quantity, item.unit_type)}
|
||||||
</span>
|
</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}
|
{totalPrice}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -553,7 +554,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
{/* Row 1 */}
|
{/* Row 1 */}
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 12px 2px' }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 12px 2px' }}>
|
||||||
{selectable && !isCancelled && (
|
{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 ? '☑' : '☐'}
|
{selected ? '☑' : '☐'}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -575,14 +576,14 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
}}>
|
}}>
|
||||||
<span style={{ fontSize: 12, color: 'var(--muted)', flex: 1 }}>
|
<span style={{ fontSize: 12, color: 'var(--muted)', flex: 1 }}>
|
||||||
{hasPriceAdj
|
{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)
|
: fmtPrice(unitPriceAdjusted)
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<span className="order-item__qty" style={{ textAlign: 'center', minWidth: 48 }}>
|
<span className="order-item__qty" style={{ textAlign: 'center', minWidth: 48 }}>
|
||||||
{fmtQty(item.quantity, item.unit_type)}
|
{fmtQty(item.quantity, item.unit_type)}
|
||||||
</span>
|
</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}
|
{totalPrice}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -635,7 +636,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
<SectionIcon type="quick" />
|
<SectionIcon type="quick" />
|
||||||
<span style={{ fontSize: 11, color: 'var(--text)', flex: 1 }}>
|
<span style={{ fontSize: 11, color: 'var(--text)', flex: 1 }}>
|
||||||
{line.name}
|
{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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@@ -645,7 +646,7 @@ function ItemRow({ item, selectable, selected, onToggle, onLongPress, isLast, kd
|
|||||||
<span style={{ fontSize: 11, color: 'var(--text)', flex: 1 }}>
|
<span style={{ fontSize: 11, color: 'var(--text)', flex: 1 }}>
|
||||||
{line.name}
|
{line.name}
|
||||||
{line.subName && <span> · {line.subName}</span>}
|
{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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@@ -684,7 +685,7 @@ export default function OrderSummary({ order, selectable = false, selectedIds =
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="order-summary">
|
<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) => (
|
{activeItems.map((item, idx) => (
|
||||||
<ItemRow
|
<ItemRow
|
||||||
key={item.id}
|
key={item.id}
|
||||||
@@ -706,15 +707,15 @@ export default function OrderSummary({ order, selectable = false, selectedIds =
|
|||||||
<span>{fmtPrice(total)}</span>
|
<span>{fmtPrice(total)}</span>
|
||||||
</div>
|
</div>
|
||||||
{paidTotal > 0 && paidTotal < total && (
|
{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>{t('tables.quick.paid')}</span>
|
||||||
<span style={{ color: '#22c55e' }}>{fmtPrice(paidTotal)}</span>
|
<span style={{ color: 'var(--x-success)' }}>{fmtPrice(paidTotal)}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{paidTotal > 0 && paidTotal < total && (
|
{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>{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>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ function CartItemSummaryRow({ item, product, price, estimated, onEdit }) {
|
|||||||
{opts.length > 0 && (
|
{opts.length > 0 && (
|
||||||
<div style={{ marginTop: 5, display: 'flex', flexWrap: 'wrap', gap: '3px 8px' }}>
|
<div style={{ marginTop: 5, display: 'flex', flexWrap: 'wrap', gap: '3px 8px' }}>
|
||||||
{opts.map((o, i) => (
|
{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>
|
</div>
|
||||||
)}
|
)}
|
||||||
{removed.length > 0 && (
|
{removed.length > 0 && (
|
||||||
<div style={{ marginTop: 4, display: 'flex', flexWrap: 'wrap', gap: '3px 8px' }}>
|
<div style={{ marginTop: 4, display: 'flex', flexWrap: 'wrap', gap: '3px 8px' }}>
|
||||||
{removed.map((r, i) => (
|
{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>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -88,7 +88,7 @@ export default function OrderSummaryModal({ cart, products, prices, total, estim
|
|||||||
{/* Backdrop */}
|
{/* Backdrop */}
|
||||||
<div
|
<div
|
||||||
onClick={onClose}
|
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 */}
|
{/* Sheet */}
|
||||||
@@ -145,7 +145,7 @@ export default function OrderSummaryModal({ cart, products, prices, total, estim
|
|||||||
rows={3}
|
rows={3}
|
||||||
style={{
|
style={{
|
||||||
width: '100%', resize: 'none', padding: '10px 12px',
|
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,
|
borderRadius: 10, fontSize: 14, color: 'var(--text)', lineHeight: 1.5,
|
||||||
outline: 'none', boxSizing: 'border-box', fontFamily: 'inherit',
|
outline: 'none', boxSizing: 'border-box', fontFamily: 'inherit',
|
||||||
}}
|
}}
|
||||||
@@ -160,10 +160,10 @@ export default function OrderSummaryModal({ cart, products, prices, total, estim
|
|||||||
) : orderNote ? (
|
) : orderNote ? (
|
||||||
<div
|
<div
|
||||||
onClick={() => setNoteEditing(true)}
|
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}
|
{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>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default function PinPad({ onSubmit, loading }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const dots = Array.from({ length: 4 }, (_, i) => (
|
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 (
|
return (
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function ProductDetailModal({ product, onClose }) {
|
|||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
style={{
|
style={{
|
||||||
position: 'fixed', inset: 0,
|
position: 'fixed', inset: 0,
|
||||||
background: 'rgba(0,0,0,0.65)',
|
background: 'rgb(var(--x-scrim-rgb) / 0.65)',
|
||||||
zIndex: 300,
|
zIndex: 300,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -96,7 +96,7 @@ function ProductDetailModal({ product, onClose }) {
|
|||||||
background: 'var(--bg)',
|
background: 'var(--bg)',
|
||||||
borderRadius: 20,
|
borderRadius: 20,
|
||||||
overflow: 'hidden',
|
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 */}
|
{/* Close button */}
|
||||||
<button
|
<button
|
||||||
@@ -104,14 +104,14 @@ function ProductDetailModal({ product, onClose }) {
|
|||||||
style={{
|
style={{
|
||||||
position: 'absolute', top: 12, right: 12,
|
position: 'absolute', top: 12, right: 12,
|
||||||
width: 32, height: 32, borderRadius: '50%',
|
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',
|
border: 'none', cursor: 'pointer',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
zIndex: 1,
|
zIndex: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none">
|
<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>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ function ProductDetailModal({ product, onClose }) {
|
|||||||
<div style={{ fontSize: 20, fontWeight: 800, color: 'var(--text)', lineHeight: 1.2, marginBottom: 6 }}>
|
<div style={{ fontSize: 20, fontWeight: 800, color: 'var(--text)', lineHeight: 1.2, marginBottom: 6 }}>
|
||||||
{product.name}
|
{product.name}
|
||||||
</div>
|
</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)}
|
{money(product.base_price)}
|
||||||
</div>
|
</div>
|
||||||
{product.description && (
|
{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 }}>
|
<span style={{ fontSize: 15, fontWeight: 700, color: 'var(--text)', lineHeight: 1.2, flex: 1, minWidth: 0 }}>
|
||||||
{product.name}
|
{product.name}
|
||||||
</span>
|
</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')}
|
{hasPrice ? money(product.base_price) : t('picker.noCharge')}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -294,8 +294,8 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
|||||||
onClick={dec}
|
onClick={dec}
|
||||||
style={{
|
style={{
|
||||||
...btnBase,
|
...btnBase,
|
||||||
background: qty === 0 ? 'var(--bg3)' : 'rgba(245,158,11,0.15)',
|
background: qty === 0 ? 'var(--bg3)' : 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||||
color: qty === 0 ? 'var(--muted)' : '#f59e0b',
|
color: qty === 0 ? 'var(--muted)' : 'var(--x-warning)',
|
||||||
}}
|
}}
|
||||||
>−</button>
|
>−</button>
|
||||||
|
|
||||||
@@ -306,8 +306,8 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
|||||||
title={t('picker.setToGuests', { count: customerCount ?? 1 })}
|
title={t('picker.setToGuests', { count: customerCount ?? 1 })}
|
||||||
style={{
|
style={{
|
||||||
...btnBase,
|
...btnBase,
|
||||||
background: 'rgba(245,158,11,0.12)',
|
background: 'rgb(var(--x-warning-rgb) / 0.12)',
|
||||||
color: '#f59e0b',
|
color: 'var(--x-warning)',
|
||||||
fontSize: 14, fontWeight: 800,
|
fontSize: 14, fontWeight: 800,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -325,8 +325,8 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
|||||||
onClick={inc}
|
onClick={inc}
|
||||||
style={{
|
style={{
|
||||||
...btnBase,
|
...btnBase,
|
||||||
background: 'rgba(245,158,11,0.15)',
|
background: 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||||
color: '#f59e0b',
|
color: 'var(--x-warning)',
|
||||||
}}
|
}}
|
||||||
>+</button>
|
>+</button>
|
||||||
|
|
||||||
@@ -357,10 +357,10 @@ function ServiceItemCard({ product, customerCount, onAdd }) {
|
|||||||
disabled={qty === 0}
|
disabled={qty === 0}
|
||||||
style={{
|
style={{
|
||||||
padding: '8px 16px', borderRadius: 10,
|
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',
|
border: 'none', cursor: qty === 0 ? 'default' : 'pointer',
|
||||||
fontSize: 12, fontWeight: 800,
|
fontSize: 12, fontWeight: 800,
|
||||||
color: qty === 0 ? 'var(--muted)' : '#fff',
|
color: qty === 0 ? 'var(--muted)' : 'var(--x-warning-fg)',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -518,9 +518,9 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
|||||||
<button
|
<button
|
||||||
className="cat-tab"
|
className="cat-tab"
|
||||||
style={{
|
style={{
|
||||||
background: isSvcActive ? '#f59e0b' : hexToRgba('#f59e0b', 0.22),
|
background: isSvcActive ? 'var(--x-warning)' : hexToRgba('var(--x-warning)', 0.22),
|
||||||
color: isSvcActive ? '#fff' : '#b45309',
|
color: isSvcActive ? 'var(--x-warning-fg)' : 'var(--x-warning)',
|
||||||
border: isSvcActive ? '2px solid #f59e0b' : undefined,
|
border: isSvcActive ? '2px solid var(--x-warning)' : undefined,
|
||||||
display: 'flex', alignItems: 'center', gap: 5,
|
display: 'flex', alignItems: 'center', gap: 5,
|
||||||
}}
|
}}
|
||||||
onClick={() => selectCategory(SVC_CAT_ID)}
|
onClick={() => selectCategory(SVC_CAT_ID)}
|
||||||
@@ -536,9 +536,9 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
|||||||
<button
|
<button
|
||||||
className="cat-tab"
|
className="cat-tab"
|
||||||
style={{
|
style={{
|
||||||
background: isFavActive ? '#ef4444' : hexToRgba('#ef4444', 0.22),
|
background: isFavActive ? 'var(--x-danger)' : hexToRgba('var(--x-danger)', 0.22),
|
||||||
color: isFavActive ? '#fff' : '#ef4444',
|
color: isFavActive ? 'var(--x-danger-fg)' : 'var(--x-danger)',
|
||||||
border: isFavActive ? '2px solid #ef4444' : undefined,
|
border: isFavActive ? '2px solid var(--x-danger)' : undefined,
|
||||||
display: 'flex', alignItems: 'center', gap: 5,
|
display: 'flex', alignItems: 'center', gap: 5,
|
||||||
}}
|
}}
|
||||||
onClick={() => selectCategory(FAV_CAT_ID)}
|
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 ? cat.color : hexToRgba(cat.color, 0.35)
|
||||||
: isActive ? 'var(--accent)' : 'var(--bg3)'
|
: isActive ? 'var(--accent)' : 'var(--bg3)'
|
||||||
const color = cat.color
|
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)'
|
: isActive ? 'var(--accent-fg)' : 'var(--muted)'
|
||||||
return (
|
return (
|
||||||
<button
|
<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 }}>
|
<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"/>
|
<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>
|
</svg>
|
||||||
<p style={{ color: 'var(--muted)', fontSize: 14, textAlign: 'center', lineHeight: 1.6 }}>
|
<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}
|
onShowDetail={setDetailProduct}
|
||||||
/>
|
/>
|
||||||
{flatProducts.length === 0 && (
|
{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')}
|
{t('picker.noProducts')}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
@@ -726,12 +726,12 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
|||||||
{favorites.length > 0 && (
|
{favorites.length > 0 && (
|
||||||
<button
|
<button
|
||||||
className={`cat-all-tile ${isFavActive ? 'cat-all-tile--active' : ''}`}
|
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)}
|
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 }}>
|
<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"/>
|
<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>
|
</svg>
|
||||||
{t('settings.tabs.favorites')}
|
{t('settings.tabs.favorites')}
|
||||||
@@ -741,12 +741,12 @@ export default function ProductPicker({ categories, products, onAdd, onQuickAdd:
|
|||||||
{topLevel.map(cat => {
|
{topLevel.map(cat => {
|
||||||
const isActive = activeCat === cat.id
|
const isActive = activeCat === cat.id
|
||||||
const bg = cat.color || 'var(--bg3)'
|
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 (
|
return (
|
||||||
<button
|
<button
|
||||||
key={cat.id}
|
key={cat.id}
|
||||||
className={`cat-all-tile ${isActive ? 'cat-all-tile--active' : ''}`}
|
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)}
|
onClick={() => selectCategory(cat.id)}
|
||||||
>
|
>
|
||||||
<span className="cat-all-tile__overlay" style={{ background: overlay }} />
|
<span className="cat-all-tile__overlay" style={{ background: overlay }} />
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export default function QrScannerModal({ onResult, onClose }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{
|
<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',
|
display: 'flex', flexDirection: 'column',
|
||||||
}}>
|
}}>
|
||||||
<div style={{ flex: 1, position: 'relative', overflow: 'hidden' }}>
|
<div style={{ flex: 1, position: 'relative', overflow: 'hidden' }}>
|
||||||
@@ -72,16 +72,16 @@ export default function QrScannerModal({ onResult, onClose }) {
|
|||||||
{error && (
|
{error && (
|
||||||
<div style={{
|
<div style={{
|
||||||
position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center',
|
position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
padding: 32, textAlign: 'center', color: '#e2e8f0', fontSize: 15, lineHeight: 1.5,
|
padding: 32, textAlign: 'center', color: 'var(--x-ink)', fontSize: 15, lineHeight: 1.5,
|
||||||
background: 'rgba(15,23,42,0.92)',
|
background: 'rgb(var(--x-scrim-rgb) / 0.92)',
|
||||||
}}>
|
}}>
|
||||||
{t(error)}
|
{t(error)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</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 && (
|
{!error && (
|
||||||
<p style={{ color: '#94a3b8', fontSize: 13, textAlign: 'center' }}>
|
<p style={{ color: 'var(--x-ink-2)', fontSize: 13, textAlign: 'center' }}>
|
||||||
{t('qr.aim')}
|
{t('qr.aim')}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -61,16 +61,16 @@ export default function ServerRediscovery() {
|
|||||||
if (!movedTo) return null
|
if (!movedTo) return null
|
||||||
return (
|
return (
|
||||||
<div style={{
|
<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',
|
display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 32, textAlign: 'center',
|
||||||
}}>
|
}}>
|
||||||
<div>
|
<div>
|
||||||
<div style={{ fontSize: 44, marginBottom: 12 }}>🔄</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')}
|
{t('offline.moved')}
|
||||||
</p>
|
</p>
|
||||||
<p style={{ color: '#94a3b8', fontSize: 14, fontFamily: 'monospace' }}>{movedTo}</p>
|
<p style={{ color: 'var(--x-ink-2)', 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, marginTop: 10 }}>{t('offline.reconnecting')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useFormat, useTranslation } from '@xenia/i18n'
|
|||||||
import useThemeStore from '../store/themeStore'
|
import useThemeStore from '../store/themeStore'
|
||||||
import useTableColourStore from '../store/tableColourStore'
|
import useTableColourStore from '../store/tableColourStore'
|
||||||
import { assetUrl } from '../config/server'
|
import { assetUrl } from '../config/server'
|
||||||
|
import { fade } from '../logic/colour'
|
||||||
|
|
||||||
function useFlashToggle(active, intervalMs = 900) {
|
function useFlashToggle(active, intervalMs = 900) {
|
||||||
const [frame, setFrame] = useState(false)
|
const [frame, setFrame] = useState(false)
|
||||||
@@ -55,9 +56,9 @@ function computeKdsBadge(order) {
|
|||||||
const preparing = relevant.filter(i => kds(i.kds_status) === 'preparing').length
|
const preparing = relevant.filter(i => kds(i.kds_status) === 'preparing').length
|
||||||
const done = relevant.filter(i => kds(i.kds_status) === 'done').length
|
const done = relevant.filter(i => kds(i.kds_status) === 'done').length
|
||||||
const total = relevant.length
|
const total = relevant.length
|
||||||
if (preparing > 0) return { label: 'PREP', color: '#60a5fa', bg: 'rgba(37,99,235,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: '#4ade80', bg: 'rgba(22,163,74,0.20)' }
|
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: '#4ade80', bg: 'rgba(22,163,74,0.18)' }
|
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
|
return null // all pending — no badge needed
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +82,7 @@ function KdsBadge({ badge, small }) {
|
|||||||
fontWeight: 800,
|
fontWeight: 800,
|
||||||
letterSpacing: 0.3,
|
letterSpacing: 0.3,
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
border: `1px solid ${badge.color}40`,
|
border: `1px solid ${fade(badge.color, 0.25)}`,
|
||||||
}}>{badge.label}</span>
|
}}>{badge.label}</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -91,7 +92,7 @@ const HOLD_MS = 480
|
|||||||
|
|
||||||
// ─── Avatar helpers ───────────────────────────────────────────────────────────
|
// ─── 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 = '') {
|
function avatarColor(name = '') {
|
||||||
let h = 0
|
let h = 0
|
||||||
@@ -121,7 +122,7 @@ function WaiterAvatar({ waiter, size = 22, ring }) {
|
|||||||
<div style={{
|
<div style={{
|
||||||
width: size, height: size, borderRadius: '50%',
|
width: size, height: size, borderRadius: '50%',
|
||||||
background: avatarColor(displayName),
|
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',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
...ringStyle,
|
...ringStyle,
|
||||||
@@ -168,7 +169,7 @@ function WaiterRow({ waiters, size = 22, cfg }) {
|
|||||||
{waiters.length > 3 && (
|
{waiters.length > 3 && (
|
||||||
<div style={{
|
<div style={{
|
||||||
marginLeft: -(size * 0.28), height: size, padding: '0 6px',
|
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,
|
color: cfg.nameText, fontSize: 10, fontWeight: 700,
|
||||||
display: 'flex', alignItems: 'center',
|
display: 'flex', alignItems: 'center',
|
||||||
}}>+{waiters.length - 3}</div>
|
}}>+{waiters.length - 3}</div>
|
||||||
@@ -202,13 +203,13 @@ function StatusPill({ label, badgeBg, badgeText, small }) {
|
|||||||
// ─── Flag dot ─────────────────────────────────────────────────────────────────
|
// ─── Flag dot ─────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
function FlagDot({ flag, size = 22 }) {
|
function FlagDot({ flag, size = 22 }) {
|
||||||
const textColor = flag.text_color || '#ffffff'
|
const textColor = flag.text_color || 'var(--x-ink)'
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
title={flag.name}
|
title={flag.name}
|
||||||
style={{
|
style={{
|
||||||
width: size, height: size, borderRadius: '50%',
|
width: size, height: size, borderRadius: '50%',
|
||||||
background: flag.color || '#6295F3',
|
background: flag.color || 'var(--x-info)',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
fontSize: size * 0.55,
|
fontSize: size * 0.55,
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
@@ -232,8 +233,8 @@ function FlagDots({ flags, size, maxShow }) {
|
|||||||
{overflow > 0 && (
|
{overflow > 0 && (
|
||||||
<div style={{
|
<div style={{
|
||||||
width: size, height: size, borderRadius: '50%',
|
width: size, height: size, borderRadius: '50%',
|
||||||
background: 'rgba(0,0,0,0.18)',
|
background: 'rgb(var(--x-scrim-rgb) / 0.18)',
|
||||||
color: '#fff', fontSize: size * 0.44, fontWeight: 800,
|
color: 'var(--x-ink)', fontSize: size * 0.44, fontWeight: 800,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
}}>+{overflow}</div>
|
}}>+{overflow}</div>
|
||||||
@@ -245,7 +246,7 @@ function FlagDots({ flags, size, maxShow }) {
|
|||||||
// ─── Flag chip (icon + label) ─────────────────────────────────────────────────
|
// ─── Flag chip (icon + label) ─────────────────────────────────────────────────
|
||||||
|
|
||||||
function FlagChip({ flag }) {
|
function FlagChip({ flag }) {
|
||||||
const textColor = flag.text_color || '#ffffff'
|
const textColor = flag.text_color || 'var(--x-ink)'
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
title={flag.name}
|
title={flag.name}
|
||||||
@@ -253,7 +254,7 @@ function FlagChip({ flag }) {
|
|||||||
display: 'inline-flex', alignItems: 'center', gap: 5,
|
display: 'inline-flex', alignItems: 'center', gap: 5,
|
||||||
height: 26, padding: '0 9px',
|
height: 26, padding: '0 9px',
|
||||||
borderRadius: 13,
|
borderRadius: 13,
|
||||||
background: flag.color || '#6295F3',
|
background: flag.color || 'var(--x-info)',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -294,7 +295,7 @@ function Card1x1({ table, _order, flags, _waiterObjects, cfg, statusKey, kdsBadg
|
|||||||
position: 'relative', overflow: 'hidden',
|
position: 'relative', overflow: 'hidden',
|
||||||
display: 'flex', flexDirection: 'column',
|
display: 'flex', flexDirection: 'column',
|
||||||
padding: 8,
|
padding: 8,
|
||||||
boxShadow: '0 2px 8px rgba(0,0,0,0.12)',
|
boxShadow: '0 2px 8px rgb(var(--x-scrim-rgb) / 0.12)',
|
||||||
}}>
|
}}>
|
||||||
{flashOverlay}
|
{flashOverlay}
|
||||||
|
|
||||||
@@ -342,7 +343,7 @@ function Card2x1({ table, _order, flags, _waiterObjects, cfg, statusKey, kdsBadg
|
|||||||
padding: '10px 12px',
|
padding: '10px 12px',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'space-between',
|
display: 'flex', alignItems: 'center', justifyContent: 'space-between',
|
||||||
gap: 10, overflow: 'hidden',
|
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',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
{flashOverlay}
|
{flashOverlay}
|
||||||
@@ -385,7 +386,7 @@ function Card2x2({ table, order, flags, _waiterObjects, cfg, statusKey, kdsBadge
|
|||||||
background: cfg.cardBg, borderRadius: 16,
|
background: cfg.cardBg, borderRadius: 16,
|
||||||
padding: '12px 12px 12px',
|
padding: '12px 12px 12px',
|
||||||
display: 'flex', gap: 8, overflow: 'hidden',
|
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',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
{flashOverlay}
|
{flashOverlay}
|
||||||
@@ -436,7 +437,7 @@ function Card4x1({ table, order, flags, _waiterObjects, cfg, statusKey, kdsBadge
|
|||||||
background: cfg.cardBg, borderRadius: 14,
|
background: cfg.cardBg, borderRadius: 14,
|
||||||
padding: '12px 14px',
|
padding: '12px 14px',
|
||||||
display: 'flex', alignItems: 'center', gap: 14, overflow: 'hidden',
|
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',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
{flashOverlay}
|
{flashOverlay}
|
||||||
@@ -489,7 +490,7 @@ function Card4x2({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
background: cfg.cardBg, borderRadius: 16,
|
background: cfg.cardBg, borderRadius: 16,
|
||||||
overflow: 'hidden',
|
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',
|
display: 'flex', flexDirection: 'column',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
@@ -537,7 +538,7 @@ function Card4x2({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
|||||||
{flags.length > 4 && (
|
{flags.length > 4 && (
|
||||||
<div style={{
|
<div style={{
|
||||||
height: 26, padding: '0 9px', borderRadius: 13,
|
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,
|
fontSize: 11, fontWeight: 800,
|
||||||
display: 'flex', alignItems: 'center',
|
display: 'flex', alignItems: 'center',
|
||||||
}}>+{flags.length - 4}</div>
|
}}>+{flags.length - 4}</div>
|
||||||
@@ -548,7 +549,7 @@ function Card4x2({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
|||||||
|
|
||||||
{/* footer: waiters */}
|
{/* footer: waiters */}
|
||||||
<div style={{
|
<div style={{
|
||||||
borderTop: `1px solid ${cfg.nameText}22`,
|
borderTop: `1px solid ${fade(cfg.nameText, 0.13)}`,
|
||||||
padding: '10px 14px', minHeight: 40,
|
padding: '10px 14px', minHeight: 40,
|
||||||
display: 'flex', alignItems: 'center',
|
display: 'flex', alignItems: 'center',
|
||||||
position: 'relative', zIndex: 2,
|
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 preparing = relevant.filter(i => kds(i.kds_status) === 'preparing').length
|
||||||
const done = relevant.filter(i => kds(i.kds_status) === 'done').length
|
const done = relevant.filter(i => kds(i.kds_status) === 'done').length
|
||||||
const total = relevant.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 = []
|
const parts = []
|
||||||
if (preparing > 0) parts.push(t('card.preparingCount', { count: preparing }))
|
if (preparing > 0) parts.push(t('card.preparingCount', { count: preparing }))
|
||||||
if (done > 0) parts.push(t('card.readyCount', { count: done }))
|
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 (
|
return (
|
||||||
@@ -590,7 +591,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
background: cfg.cardBg, borderRadius: 16,
|
background: cfg.cardBg, borderRadius: 16,
|
||||||
overflow: 'hidden',
|
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',
|
display: 'flex', flexDirection: 'column',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
}}>
|
}}>
|
||||||
@@ -632,7 +633,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* divider */}
|
{/* 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 */}
|
{/* right column: order items */}
|
||||||
<div style={{ flex: 1, minWidth: 0, overflow: 'hidden' }}>
|
<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 }}>
|
<div key={item.id} style={{ display: 'flex', alignItems: 'baseline', gap: 5, overflow: 'hidden', minWidth: 0 }}>
|
||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 11, fontWeight: 700, color: cfg.nameText,
|
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,
|
padding: '1px 5px', flexShrink: 0,
|
||||||
}}>{fmtItemQtyTC(item.quantity, item.unit_type)}</span>
|
}}>{fmtItemQtyTC(item.quantity, item.unit_type)}</span>
|
||||||
<span style={{
|
<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 */}
|
{/* KDS footer row — only when there's something to show */}
|
||||||
{kdsFooter && (
|
{kdsFooter && (
|
||||||
<div style={{
|
<div style={{
|
||||||
borderTop: `1px solid ${cfg.nameText}22`,
|
borderTop: `1px solid ${fade(cfg.nameText, 0.13)}`,
|
||||||
padding: '6px 14px',
|
padding: '6px 14px',
|
||||||
display: 'flex', alignItems: 'center', gap: 6,
|
display: 'flex', alignItems: 'center', gap: 6,
|
||||||
position: 'relative', zIndex: 2,
|
position: 'relative', zIndex: 2,
|
||||||
@@ -688,7 +689,7 @@ function Card4x3({ table, order, flags, waiterObjects, groupName, cfg, statusKey
|
|||||||
|
|
||||||
{/* footer: waiters */}
|
{/* footer: waiters */}
|
||||||
<div style={{
|
<div style={{
|
||||||
borderTop: `1px solid ${cfg.nameText}22`,
|
borderTop: `1px solid ${fade(cfg.nameText, 0.13)}`,
|
||||||
padding: '10px 14px', minHeight: 38,
|
padding: '10px 14px', minHeight: 38,
|
||||||
display: 'flex', alignItems: 'center',
|
display: 'flex', alignItems: 'center',
|
||||||
position: 'relative', zIndex: 2,
|
position: 'relative', zIndex: 2,
|
||||||
@@ -738,8 +739,8 @@ export default function TableCard({
|
|||||||
const flashFrame = useFlashToggle(flashOn)
|
const flashFrame = useFlashToggle(flashOn)
|
||||||
|
|
||||||
// 'transparent' in a flash color means "show the base card color for that slot".
|
// '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.
|
// The settings UI stores transparent as 'rgb(var(--x-scrim-rgb) / 0)', so we check both forms.
|
||||||
const isTransparent = (v) => !v || v === 'transparent' || v === 'rgba(0,0,0,0)'
|
const isTransparent = (v) => !v || v === 'transparent' || v === 'rgb(var(--x-scrim-rgb) / 0)'
|
||||||
const fc = (flashColor, baseColor) => isTransparent(flashColor) ? baseColor : flashColor
|
const fc = (flashColor, baseColor) => isTransparent(flashColor) ? baseColor : flashColor
|
||||||
|
|
||||||
// cfg always = baseCfg for card background (so table status colour shows through flash overlay)
|
// cfg always = baseCfg for card background (so table status colour shows through flash overlay)
|
||||||
@@ -844,7 +845,7 @@ export default function TableCard({
|
|||||||
}}>
|
}}>
|
||||||
<span style={{
|
<span style={{
|
||||||
display: 'inline-flex', alignItems: 'center', gap: 3,
|
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,
|
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
||||||
borderRadius: 4, padding: '2px 6px',
|
borderRadius: 4, padding: '2px 6px',
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function UpdatePrompt() {
|
|||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
gap: 16,
|
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',
|
whiteSpace: 'nowrap',
|
||||||
}}>
|
}}>
|
||||||
<span style={{ fontSize: 14, color: 'var(--text)', fontWeight: 500 }}>
|
<span style={{ fontSize: 14, color: 'var(--text)', fontWeight: 500 }}>
|
||||||
@@ -34,7 +34,7 @@ export default function UpdatePrompt() {
|
|||||||
onClick={() => updateServiceWorker(true)}
|
onClick={() => updateServiceWorker(true)}
|
||||||
style={{
|
style={{
|
||||||
background: 'var(--accent)',
|
background: 'var(--accent)',
|
||||||
color: '#0f172a',
|
color: 'var(--x-canvas)',
|
||||||
border: 'none',
|
border: 'none',
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
padding: '8px 16px',
|
padding: '8px 16px',
|
||||||
|
|||||||
@@ -14,29 +14,29 @@ export function useNotifications() {
|
|||||||
|
|
||||||
const TYPE_THEME = {
|
const TYPE_THEME = {
|
||||||
manager: {
|
manager: {
|
||||||
bg: '#1e1b4b', border: '#6366f1', ackBg: '#4f46e5',
|
bg: 'var(--x-info-soft)', border: 'var(--x-info)', ackBg: 'var(--x-info)',
|
||||||
labelColor: '#a5b4fc', icon: '📢',
|
labelColor: 'var(--x-info-ink)', icon: '📢',
|
||||||
},
|
},
|
||||||
kds_order_done: {
|
kds_order_done: {
|
||||||
bg: '#052e16', border: '#22c55e', ackBg: '#16a34a',
|
bg: 'var(--x-success-fg)', border: 'var(--x-success)', ackBg: 'var(--x-success)',
|
||||||
labelColor: '#86efac', icon: '✅',
|
labelColor: 'var(--x-success-ink)', icon: '✅',
|
||||||
},
|
},
|
||||||
kds_item_done: {
|
kds_item_done: {
|
||||||
bg: '#052e16', border: '#4ade80', ackBg: '#15803d',
|
bg: 'var(--x-success-fg)', border: 'var(--x-success)', ackBg: 'var(--x-success)',
|
||||||
labelColor: '#86efac', icon: '🍽️',
|
labelColor: 'var(--x-success-ink)', icon: '🍽️',
|
||||||
},
|
},
|
||||||
kds_call_order: {
|
kds_call_order: {
|
||||||
bg: '#2d1505', border: '#f97316', ackBg: '#ea580c',
|
bg: 'var(--x-warning-fg)', border: 'var(--x-warning)', ackBg: 'var(--x-warning)',
|
||||||
labelColor: '#fed7aa', icon: '🔔',
|
labelColor: 'var(--x-warning-ink)', icon: '🔔',
|
||||||
},
|
},
|
||||||
kds_call_general: {
|
kds_call_general: {
|
||||||
bg: '#2d1505', border: '#f59e0b', ackBg: '#d97706',
|
bg: 'var(--x-warning-fg)', border: 'var(--x-warning)', ackBg: 'var(--x-warning)',
|
||||||
labelColor: '#fde68a', icon: '👋',
|
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
|
// a table ordered from the QR menu (phase 3S, S.7): already on the table's order and in the kitchen
|
||||||
qr_order: {
|
qr_order: {
|
||||||
bg: '#0c1f2e', border: '#38bdf8', ackBg: '#0284c7',
|
bg: 'var(--x-info-fg)', border: 'var(--x-info)', ackBg: 'var(--x-info)',
|
||||||
labelColor: '#bae6fd', icon: '📱',
|
labelColor: 'var(--x-info-ink)', icon: '📱',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ function isManagerMessage(msg) {
|
|||||||
|
|
||||||
// ─── Rich body renderer — highlights #order, table name, and zone after " - " ─
|
// ─── 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)
|
// 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'
|
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,
|
display: 'flex', alignItems: 'flex-start', gap: 12,
|
||||||
background: theme.bg, border: `1px solid ${theme.border}`,
|
background: theme.bg, border: `1px solid ${theme.border}`,
|
||||||
borderRadius: 14, padding: '12px 14px',
|
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',
|
animation: 'slideIn 0.25s ease',
|
||||||
}}>
|
}}>
|
||||||
<span style={{ fontSize: 22, flexShrink: 0 }}>{theme.icon}</span>
|
<span style={{ fontSize: 22, flexShrink: 0 }}>{theme.icon}</span>
|
||||||
@@ -121,11 +121,11 @@ function NotificationBanner({ message, onAck, autoDismiss }) {
|
|||||||
{message.kds_zone || message.sender_name}
|
{message.kds_zone || message.sender_name}
|
||||||
</div>
|
</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} />
|
<RichBody text={message.body} />
|
||||||
</div>
|
</div>
|
||||||
{tableIds.length > 0 && (
|
{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(', ') })}
|
{t('notify.tables', { count: tableIds.length, tables: tableIds.join(', ') })}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -135,7 +135,7 @@ function NotificationBanner({ message, onAck, autoDismiss }) {
|
|||||||
style={{
|
style={{
|
||||||
flexShrink: 0, height: 32, padding: '0 12px',
|
flexShrink: 0, height: 32, padding: '0 12px',
|
||||||
borderRadius: 8, border: 'none',
|
borderRadius: 8, border: 'none',
|
||||||
background: theme.ackBg, color: 'white',
|
background: theme.ackBg, color: 'var(--x-on-colour)',
|
||||||
fontSize: 12, fontWeight: 700, cursor: 'pointer',
|
fontSize: 12, fontWeight: 700, cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
>OK ✓</button>
|
>OK ✓</button>
|
||||||
@@ -279,7 +279,7 @@ export function NotificationProvider({ children }) {
|
|||||||
))}
|
))}
|
||||||
{popupMessages.length > 3 && (
|
{popupMessages.length > 3 && (
|
||||||
<div style={{
|
<div style={{
|
||||||
textAlign: 'center', fontSize: 12, color: '#94a3b8',
|
textAlign: 'center', fontSize: 12, color: 'var(--x-ink-2)',
|
||||||
pointerEvents: 'all',
|
pointerEvents: 'all',
|
||||||
}}>
|
}}>
|
||||||
{t('notify.more', { count: popupMessages.length - 3 })}
|
{t('notify.more', { count: popupMessages.length - 3 })}
|
||||||
|
|||||||
+43
-69
@@ -33,9 +33,9 @@ input, textarea, [contenteditable] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@keyframes tab-alert {
|
@keyframes tab-alert {
|
||||||
0% { color: #f87171; }
|
0% { color: var(--x-danger); }
|
||||||
50% { color: #ef444488; }
|
50% { color: rgb(var(--x-danger-rgb) / 0.53); }
|
||||||
100% { color: #f87171; }
|
100% { color: var(--x-danger); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes gate-spin {
|
@keyframes gate-spin {
|
||||||
@@ -44,73 +44,47 @@ input, textarea, [contenteditable] {
|
|||||||
|
|
||||||
/* Order item text pulse for "done" KDS status in order detail view */
|
/* Order item text pulse for "done" KDS status in order detail view */
|
||||||
@keyframes kds-ready-pulse-text {
|
@keyframes kds-ready-pulse-text {
|
||||||
0%,100% { color: #4ade80; }
|
0%,100% { color: var(--x-success); }
|
||||||
50% { color: #bbf7d0; }
|
50% { color: var(--x-success-ink); }
|
||||||
}
|
}
|
||||||
.kds-ready-flash-text {
|
.kds-ready-flash-text {
|
||||||
animation: kds-ready-pulse-text 1.6s ease-in-out infinite;
|
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 {
|
:root {
|
||||||
/* "Free" table card — dark theme: muted blue-slate */
|
/* "Free" table card */
|
||||||
--card-free-bg: #243044;
|
--card-free-bg: var(--x-surface-2);
|
||||||
--card-free-text: #94b8d4;
|
--card-free-text: var(--x-ink-2);
|
||||||
--card-free-muted: rgba(148,184,212,0.45);
|
--card-free-muted: rgb(var(--x-ink-2-rgb) / 0.45);
|
||||||
|
|
||||||
/* Dark theme — deep navy */
|
--bg: var(--x-canvas);
|
||||||
--bg: #0d1520;
|
--bg2: var(--x-surface);
|
||||||
--bg2: #1a2535;
|
--bg3: var(--x-surface-2);
|
||||||
--bg3: #243044;
|
--bg4: var(--x-surface-3);
|
||||||
--bg4: #2e3d54;
|
--text: var(--x-ink);
|
||||||
--text: #edf2f7;
|
--text2: var(--x-ink-2);
|
||||||
--text2: #94a3b8;
|
--muted: var(--x-ink-3);
|
||||||
--muted: #5a7390;
|
--accent: var(--x-accent);
|
||||||
--accent: #f59e0b;
|
--accent-fg: var(--x-accent-fg);
|
||||||
--accent-fg: #1c1000;
|
--accent-dim: var(--x-accent-soft);
|
||||||
--accent-dim: #6b3a00;
|
--success: var(--x-success);
|
||||||
--success: #22c55e;
|
--success-fg: var(--x-success-fg);
|
||||||
--success-fg: #052e16;
|
--danger: var(--x-danger);
|
||||||
--danger: #f87171;
|
--danger-sat: var(--x-danger);
|
||||||
--danger-sat: #ef4444;
|
--danger-dim: var(--x-danger-soft);
|
||||||
--danger-dim: #450a0a;
|
--primary: var(--x-info);
|
||||||
--primary: #3b82f6;
|
--primary-fg: var(--x-info-fg);
|
||||||
--primary-fg: #ffffff;
|
--border: var(--x-line);
|
||||||
--border: #253245;
|
--shadow: rgb(var(--x-scrim-rgb) / 0.3);
|
||||||
--shadow: rgba(0,0,0,0.35);
|
|
||||||
font-family: 'Google Sans', system-ui, 'Segoe UI', sans-serif;
|
font-family: 'Google Sans', system-ui, 'Segoe UI', sans-serif;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
background: var(--bg);
|
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 {
|
html, body {
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
overscroll-behavior: none;
|
overscroll-behavior: none;
|
||||||
@@ -169,7 +143,7 @@ html, body {
|
|||||||
.btn--primary { background: var(--primary); color: var(--primary-fg); }
|
.btn--primary { background: var(--primary); color: var(--primary-fg); }
|
||||||
.btn--accent { background: var(--accent); color: var(--accent-fg); }
|
.btn--accent { background: var(--accent); color: var(--accent-fg); }
|
||||||
.btn--success { background: var(--success); color: var(--success-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--secondary{ background: var(--bg3); color: var(--text); }
|
||||||
.btn--lg { min-height: 64px; font-size: 17px; border-radius: 14px; }
|
.btn--lg { min-height: 64px; font-size: 17px; border-radius: 14px; }
|
||||||
|
|
||||||
@@ -387,7 +361,7 @@ html, body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 8px 10px;
|
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 {
|
.cat-all-tile__overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
@@ -397,9 +371,9 @@ html, body {
|
|||||||
position: relative;
|
position: relative;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #fff;
|
color: var(--x-on-colour);
|
||||||
text-align: center;
|
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;
|
line-height: 1.3;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
@@ -569,9 +543,9 @@ html, body {
|
|||||||
.order-item--last { border-bottom: none; }
|
.order-item--last { border-bottom: none; }
|
||||||
.order-item--paid { opacity: 0.5; }
|
.order-item--paid { opacity: 0.5; }
|
||||||
.order-item--cancelled { opacity: 0.3; text-decoration: line-through; }
|
.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__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--served { color: var(--text); }
|
||||||
.order-item__name--cancelled { color: var(--muted); }
|
.order-item__name--cancelled { color: var(--muted); }
|
||||||
.order-item__qty { font-size: 15px; color: var(--muted); }
|
.order-item__qty { font-size: 15px; color: var(--muted); }
|
||||||
@@ -607,7 +581,7 @@ html, body {
|
|||||||
.modal-overlay {
|
.modal-overlay {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
background: rgba(0,0,0,0.6);
|
background: rgb(var(--x-scrim-rgb) / 0.6);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
@@ -745,14 +719,14 @@ html, body {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.qty-offset-btn--add {
|
.qty-offset-btn--add {
|
||||||
background: rgba(34,197,94,0.12);
|
background: rgb(var(--x-success-rgb) / 0.12);
|
||||||
color: var(--success);
|
color: var(--success);
|
||||||
border-color: rgba(34,197,94,0.3);
|
border-color: rgb(var(--x-success-rgb) / 0.3);
|
||||||
}
|
}
|
||||||
.qty-offset-btn--sub {
|
.qty-offset-btn--sub {
|
||||||
background: rgba(248,113,113,0.12);
|
background: rgb(var(--x-danger-rgb) / 0.12);
|
||||||
color: var(--danger);
|
color: var(--danger);
|
||||||
border-color: rgba(248,113,113,0.3);
|
border-color: rgb(var(--x-danger-rgb) / 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── User Menu Dropdown ──────────────────────────────────── */
|
/* ── User Menu Dropdown ──────────────────────────────────── */
|
||||||
@@ -764,7 +738,7 @@ html, body {
|
|||||||
background: var(--bg2);
|
background: var(--bg2);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 14px;
|
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;
|
min-width: 200px;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
display: flex;
|
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 { StrictMode } from 'react'
|
||||||
import { createRoot } from 'react-dom/client'
|
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'
|
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 App from './App.jsx'
|
||||||
import db from './db/posdb.js'
|
import db from './db/posdb.js'
|
||||||
import { deliveryMode, getActiveVenue } from './config/server'
|
import { deliveryMode, getActiveVenue } from './config/server'
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { assetUrl } from '../config/server'
|
|||||||
import { money } from '../i18n'
|
import { money } from '../i18n'
|
||||||
import { LineError, estimate, wireLine } from '@xenia/api'
|
import { LineError, estimate, wireLine } from '@xenia/api'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
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)
|
// 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 })
|
const lineErrorText = (err, t) => t('add.optionGone', { product: err.product, what: err.what })
|
||||||
@@ -40,7 +41,7 @@ function GlobalCourseModal({ courses, selected, onSelect, onClose }) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
padding: '12px 16px',
|
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)'}`,
|
border: `2px solid ${c.id === selected ? c.color : 'var(--border)'}`,
|
||||||
borderRadius: 12, cursor: 'pointer', textAlign: 'left',
|
borderRadius: 12, cursor: 'pointer', textAlign: 'left',
|
||||||
}}
|
}}
|
||||||
@@ -558,7 +559,7 @@ export default function AddItemsPage() {
|
|||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: -2, right: -2,
|
position: 'absolute', top: -2, right: -2,
|
||||||
minWidth: 18, height: 18, borderRadius: 9,
|
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,
|
fontSize: 10, fontWeight: 800,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
padding: '0 4px',
|
padding: '0 4px',
|
||||||
@@ -583,7 +584,7 @@ export default function AddItemsPage() {
|
|||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: -2, right: -2,
|
position: 'absolute', top: -2, right: -2,
|
||||||
minWidth: 18, height: 18, borderRadius: 9,
|
minWidth: 18, height: 18, borderRadius: 9,
|
||||||
background: c.color, color: '#fff',
|
background: c.color, color: 'var(--x-on-colour)',
|
||||||
fontSize: 10, fontWeight: 800,
|
fontSize: 10, fontWeight: 800,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
padding: '0 4px',
|
padding: '0 4px',
|
||||||
@@ -679,7 +680,7 @@ export default function AddItemsPage() {
|
|||||||
return (
|
return (
|
||||||
<div key={item._key} style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
<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, 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>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
@@ -711,7 +712,7 @@ export default function AddItemsPage() {
|
|||||||
onClick={() => setCartOpen(false)}
|
onClick={() => setCartOpen(false)}
|
||||||
style={{
|
style={{
|
||||||
position: 'fixed', inset: 0,
|
position: 'fixed', inset: 0,
|
||||||
background: 'rgba(0,0,0,0.55)',
|
background: 'rgb(var(--x-scrim-rgb) / 0.55)',
|
||||||
opacity: cartOpen ? 1 : 0,
|
opacity: cartOpen ? 1 : 0,
|
||||||
pointerEvents: cartOpen ? 'auto' : 'none',
|
pointerEvents: cartOpen ? 'auto' : 'none',
|
||||||
transition: 'opacity 240ms ease',
|
transition: 'opacity 240ms ease',
|
||||||
@@ -728,7 +729,7 @@ export default function AddItemsPage() {
|
|||||||
transition: 'transform 280ms cubic-bezier(0.32, 0.72, 0, 1)',
|
transition: 'transform 280ms cubic-bezier(0.32, 0.72, 0, 1)',
|
||||||
zIndex: 51,
|
zIndex: 51,
|
||||||
display: 'flex', flexDirection: 'column',
|
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 */}
|
{/* Drawer header */}
|
||||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '14px 16px', borderBottom: '1px solid var(--border)', flexShrink: 0 }}>
|
<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}
|
rows={3}
|
||||||
style={{
|
style={{
|
||||||
width: '100%', resize: 'none', padding: '10px 12px',
|
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,
|
borderRadius: 10, fontSize: 14, color: 'var(--text)', lineHeight: 1.5,
|
||||||
outline: 'none', boxSizing: 'border-box', fontFamily: 'inherit',
|
outline: 'none', boxSizing: 'border-box', fontFamily: 'inherit',
|
||||||
}}
|
}}
|
||||||
@@ -846,11 +847,11 @@ export default function AddItemsPage() {
|
|||||||
) : orderNote ? (
|
) : orderNote ? (
|
||||||
<div
|
<div
|
||||||
onClick={() => setOrderNoteEditing(true)}
|
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}
|
{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>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
@@ -994,25 +995,25 @@ export default function AddItemsPage() {
|
|||||||
<div style={{
|
<div style={{
|
||||||
position: 'fixed', inset: 0, zIndex: 9999,
|
position: 'fixed', inset: 0, zIndex: 9999,
|
||||||
display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center',
|
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',
|
animation: 'fadeInOverlay 180ms ease',
|
||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
background: printAck._offline ? '#451a03' : printAck._pending ? '#1c1917' : '#14532d',
|
background: printAck._offline ? 'var(--x-warning-soft)' : printAck._pending ? 'var(--x-canvas)' : 'var(--x-success-soft)',
|
||||||
border: `2px solid ${printAck._offline ? '#f59e0b' : printAck._pending ? '#f59e0b' : '#22c55e'}`,
|
border: `2px solid ${printAck._offline ? 'var(--x-warning)' : printAck._pending ? 'var(--x-warning)' : 'var(--x-success)'}`,
|
||||||
borderRadius: 20, padding: '36px 48px',
|
borderRadius: 20, padding: '36px 48px',
|
||||||
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16,
|
display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16,
|
||||||
animation: 'popIn 220ms cubic-bezier(0.34,1.56,0.64,1)',
|
animation: 'popIn 220ms cubic-bezier(0.34,1.56,0.64,1)',
|
||||||
}}>
|
}}>
|
||||||
<svg width="56" height="56" viewBox="0 0 24 24" fill="none">
|
<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 ? (
|
{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>
|
</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')}
|
{printAck._offline ? t('add.ack.offline') : printAck._pending ? t('add.ack.printing') : t('add.ack.printed')}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -1068,14 +1069,14 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
|||||||
<div style={{
|
<div style={{
|
||||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
width: 48, height: 48, borderRadius: '50%',
|
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">
|
<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"
|
<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>
|
</svg>
|
||||||
</div>
|
</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>
|
<p style={{ margin: '6px 0 0', fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>{offer.deal_name}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1083,13 +1084,13 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
|||||||
{isFreeItem && offer.free_item_name && (
|
{isFreeItem && offer.free_item_name && (
|
||||||
<div style={{
|
<div style={{
|
||||||
margin: '0 0 16px', padding: '14px 16px',
|
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,
|
borderRadius: 12,
|
||||||
}}>
|
}}>
|
||||||
<p style={{ margin: 0, fontSize: 13, color: 'var(--muted)', marginBottom: 4 }}>{t('add.deal.freeProduct')}</p>
|
<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_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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -1099,7 +1100,7 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
|||||||
<div style={{ marginBottom: 16 }}>
|
<div style={{ marginBottom: 16 }}>
|
||||||
<p style={{ fontSize: 12, color: 'var(--muted)', marginBottom: 8 }}>
|
<p style={{ fontSize: 12, color: 'var(--muted)', marginBottom: 8 }}>
|
||||||
{t('add.deal.pickFree', { count: offer.free_quantity ?? 1 })}
|
{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>
|
</p>
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, maxHeight: 220, overflowY: 'auto' }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, maxHeight: 220, overflowY: 'auto' }}>
|
||||||
{offer.free_choices.map(choice => {
|
{offer.free_choices.map(choice => {
|
||||||
@@ -1110,15 +1111,15 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 10,
|
display: 'flex', alignItems: 'center', gap: 10,
|
||||||
padding: '10px 12px', borderRadius: 10, border: 'none', cursor: disabled ? 'not-allowed' : 'pointer',
|
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',
|
opacity: disabled ? 0.4 : 1, textAlign: 'left',
|
||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 20, height: 20, borderRadius: 5, flexShrink: 0,
|
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',
|
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>
|
||||||
<span style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>{choice.name}</span>
|
<span style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)' }}>{choice.name}</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -1132,13 +1133,13 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
|||||||
{isDiscount && offer.price_before != null && offer.price_after != null && (
|
{isDiscount && offer.price_before != null && offer.price_after != null && (
|
||||||
<div style={{
|
<div style={{
|
||||||
margin: '0 0 16px', padding: '14px 16px',
|
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',
|
borderRadius: 12, textAlign: 'center',
|
||||||
}}>
|
}}>
|
||||||
<span style={{ fontSize: 14, color: 'var(--muted)', textDecoration: 'line-through' }}>
|
<span style={{ fontSize: 14, color: 'var(--muted)', textDecoration: 'line-through' }}>
|
||||||
{money(offer.price_before)}
|
{money(offer.price_before)}
|
||||||
</span>
|
</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)}
|
{money(offer.price_after)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -1148,7 +1149,7 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
|||||||
<button className="btn btn--secondary" style={{ flex: 1 }} onClick={onDismiss}>
|
<button className="btn btn--secondary" style={{ flex: 1 }} onClick={onDismiss}>
|
||||||
{t('add.deal.skip')}
|
{t('add.deal.skip')}
|
||||||
</button>
|
</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}>
|
onClick={handleAccept} disabled={!canConfirm}>
|
||||||
{isFreeItem ? t('add.deal.addFree') : isFreeChoice ? t('common.confirm') : t('common.apply')}
|
{isFreeItem ? t('add.deal.addFree') : isFreeChoice ? t('common.confirm') : t('common.apply')}
|
||||||
</button>
|
</button>
|
||||||
@@ -1171,7 +1172,7 @@ function QuickAddToast({ product, count }) {
|
|||||||
background: 'var(--bg)',
|
background: 'var(--bg)',
|
||||||
border: '1px solid var(--border)',
|
border: '1px solid var(--border)',
|
||||||
borderRadius: 14,
|
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,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
padding: '10px 16px 10px 10px',
|
padding: '10px 16px 10px 10px',
|
||||||
minWidth: 220, maxWidth: 'min(88vw, 340px)',
|
minWidth: 220, maxWidth: 'min(88vw, 340px)',
|
||||||
@@ -1227,11 +1228,11 @@ const SECTION_META = {
|
|||||||
|
|
||||||
function SectionIcon({ type }) {
|
function SectionIcon({ type }) {
|
||||||
const icons = {
|
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>,
|
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="#a3e635" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></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="#60a5fa" strokeWidth="2.5" strokeLinecap="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="#ef4444" 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="#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>,
|
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>
|
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>
|
</div>
|
||||||
|
|
||||||
{/* Quantity on the right */}
|
{/* 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 */}
|
{/* 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 }}>
|
<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" />
|
<SectionIcon type="quick" />
|
||||||
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
||||||
{line.name}
|
{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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@@ -1308,7 +1309,7 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
|||||||
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
<span style={{ fontSize: 12, color: 'var(--text)', flex: 1 }}>
|
||||||
{line.name}
|
{line.name}
|
||||||
{line.subName && <span> · {line.subName}</span>}
|
{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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
@@ -1357,7 +1358,7 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
|||||||
style={{
|
style={{
|
||||||
width: 36, height: 36, borderRadius: '50%',
|
width: 36, height: 36, borderRadius: '50%',
|
||||||
background: 'var(--bg3)', border: '1px solid var(--border)',
|
background: 'var(--bg3)', border: '1px solid var(--border)',
|
||||||
color: '#22c55e',
|
color: 'var(--x-success)',
|
||||||
fontSize: 20, fontWeight: 700, cursor: 'pointer',
|
fontSize: 20, fontWeight: 700, cursor: 'pointer',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
}}
|
}}
|
||||||
@@ -1397,7 +1398,7 @@ function SearchModal({ products, query, setQuery, onClose, onAdd, courses = [],
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Dim backdrop — tap to close */}
|
{/* 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
|
{/* Panel: fixed to bottom, grows upward, capped at 60vh so results don't
|
||||||
push the input off screen on short viewports */}
|
push the input off screen on short viewports */}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ function ConvRow({ conv, currentUserId, onClick }) {
|
|||||||
|
|
||||||
{hasUnread && (
|
{hasUnread && (
|
||||||
<div style={{
|
<div style={{
|
||||||
background: 'var(--danger)', color: '#fff',
|
background: 'var(--danger)', color: 'var(--x-danger-fg)',
|
||||||
borderRadius: '50%', minWidth: 20, height: 20,
|
borderRadius: '50%', minWidth: 20, height: 20,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
fontSize: 11, fontWeight: 800, flexShrink: 0,
|
fontSize: 11, fontWeight: 800, flexShrink: 0,
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ function LeaveModal({ onConfirm, onCancel }) {
|
|||||||
<button
|
<button
|
||||||
style={{
|
style={{
|
||||||
flex: 1, height: 44, borderRadius: 12, border: 'none',
|
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',
|
fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { money } from '../i18n'
|
|||||||
// ── Heart icon ────────────────────────────────────────────────────────────────
|
// ── Heart icon ────────────────────────────────────────────────────────────────
|
||||||
function Heart({ filled, size = 22 }) {
|
function Heart({ filled, size = 22 }) {
|
||||||
return (
|
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"/>
|
<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>
|
</svg>
|
||||||
)
|
)
|
||||||
@@ -57,8 +57,8 @@ function AttrSection({ title, items, favIds, onToggle }) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
padding: '10px 14px',
|
padding: '10px 14px',
|
||||||
background: isFav ? 'rgba(239,68,68,0.07)' : 'var(--bg2)',
|
background: isFav ? 'rgb(var(--x-danger-rgb) / 0.07)' : 'var(--bg2)',
|
||||||
border: `1px solid ${isFav ? 'rgba(239,68,68,0.25)' : 'var(--border)'}`,
|
border: `1px solid ${isFav ? 'rgb(var(--x-danger-rgb) / 0.25)' : 'var(--border)'}`,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
transition: 'background 120ms, border-color 120ms',
|
transition: 'background 120ms, border-color 120ms',
|
||||||
}}
|
}}
|
||||||
@@ -76,7 +76,7 @@ function AttrSection({ title, items, favIds, onToggle }) {
|
|||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => onToggle(item.id)}
|
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} />
|
<Heart filled={isFav} size={20} />
|
||||||
</button>
|
</button>
|
||||||
@@ -138,7 +138,7 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
|||||||
{/* Backdrop */}
|
{/* Backdrop */}
|
||||||
<div
|
<div
|
||||||
onClick={onClose}
|
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 */}
|
{/* Sheet */}
|
||||||
@@ -149,7 +149,7 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
|||||||
borderRadius: '20px 20px 0 0',
|
borderRadius: '20px 20px 0 0',
|
||||||
maxHeight: '88vh',
|
maxHeight: '88vh',
|
||||||
display: 'flex', flexDirection: 'column',
|
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 */}
|
{/* Handle bar */}
|
||||||
<div style={{ display: 'flex', justifyContent: 'center', padding: '10px 0 0' }}>
|
<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 }}>
|
<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>
|
</p>
|
||||||
|
|
||||||
<AttrSection
|
<AttrSection
|
||||||
@@ -241,8 +241,8 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
|||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
style={{
|
style={{
|
||||||
flex: 1, height: 44, borderRadius: 12, border: 'none',
|
flex: 1, height: 44, borderRadius: 12, border: 'none',
|
||||||
background: totalSelected > 0 ? '#ef4444' : 'var(--accent)',
|
background: totalSelected > 0 ? 'var(--x-danger)' : 'var(--accent)',
|
||||||
color: '#fff',
|
color: 'var(--x-danger-fg)',
|
||||||
fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
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 */}
|
{/* Heart — toggles product in/out of favorites list */}
|
||||||
<button
|
<button
|
||||||
onClick={() => onToggleFav(product.id)}
|
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} />
|
<Heart filled={isFav} />
|
||||||
</button>
|
</button>
|
||||||
@@ -357,7 +357,7 @@ function FavoritesList({ items, products, onReorder }) {
|
|||||||
if (items.length === 0) {
|
if (items.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', flex: 1, padding: 32, gap: 12 }}>
|
<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"/>
|
<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>
|
</svg>
|
||||||
<p style={{ fontSize: 14, color: 'var(--muted)', textAlign: 'center', lineHeight: 1.6 }}>
|
<p style={{ fontSize: 14, color: 'var(--muted)', textAlign: 'center', lineHeight: 1.6 }}>
|
||||||
@@ -370,7 +370,7 @@ function FavoritesList({ items, products, onReorder }) {
|
|||||||
return (
|
return (
|
||||||
<div ref={containerRef} style={{ flex: 1, overflowY: 'auto', touchAction: 'pan-x' }}>
|
<div ref={containerRef} style={{ flex: 1, overflowY: 'auto', touchAction: 'pan-x' }}>
|
||||||
{dropIndex === 0 && dragging != null && (
|
{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) => {
|
{items.map((productId, idx) => {
|
||||||
@@ -412,7 +412,7 @@ function FavoritesList({ items, products, onReorder }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{dropIndex === idx + 1 && dragging != null && dragging !== idx && (
|
{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>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ function WaiterCard({ waiter, onClick }) {
|
|||||||
<div style={{
|
<div style={{
|
||||||
width: 48, height: 48, borderRadius: '50%', flexShrink: 0,
|
width: 48, height: 48, borderRadius: '50%', flexShrink: 0,
|
||||||
background: waiter.avatar_url ? 'transparent' : 'var(--bg3)',
|
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',
|
overflow: 'hidden',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
fontSize: 18, fontWeight: 700, color: 'var(--text)',
|
fontSize: 18, fontWeight: 700, color: 'var(--text)',
|
||||||
@@ -69,9 +69,9 @@ function WaiterCard({ waiter, onClick }) {
|
|||||||
{waiter.on_shift && (
|
{waiter.on_shift && (
|
||||||
<span style={{
|
<span style={{
|
||||||
width: 10, height: 10, borderRadius: '50%',
|
width: 10, height: 10, borderRadius: '50%',
|
||||||
background: '#22c55e',
|
background: 'var(--x-success)',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
boxShadow: '0 0 6px #22c55e88',
|
boxShadow: '0 0 6px rgb(var(--x-success-rgb) / 0.53)',
|
||||||
}} title={t('login.onShift')} />
|
}} title={t('login.onShift')} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ export default function LoginPage() {
|
|||||||
) : serverUnreachable ? (
|
) : serverUnreachable ? (
|
||||||
<div style={{ textAlign: 'center', padding: 32 }}>
|
<div style={{ textAlign: 'center', padding: 32 }}>
|
||||||
<div style={{ fontSize: 48, marginBottom: 16 }}>🔌</div>
|
<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')}
|
{t('login.serverNotFound')}
|
||||||
</p>
|
</p>
|
||||||
<p style={{ fontSize: 14, color: 'var(--muted)', lineHeight: 1.6, marginBottom: 24 }}>
|
<p style={{ fontSize: 14, color: 'var(--muted)', lineHeight: 1.6, marginBottom: 24 }}>
|
||||||
@@ -242,7 +242,7 @@ export default function LoginPage() {
|
|||||||
<div style={{
|
<div style={{
|
||||||
width: 40, height: 40, borderRadius: '50%', flexShrink: 0,
|
width: 40, height: 40, borderRadius: '50%', flexShrink: 0,
|
||||||
background: w.avatar_url ? 'transparent' : 'var(--bg3)',
|
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',
|
overflow: 'hidden',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
fontSize: 15, fontWeight: 700, color: 'var(--text)',
|
fontSize: 15, fontWeight: 700, color: 'var(--text)',
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ export default function OfflinePage() {
|
|||||||
<div className="page page--centered">
|
<div className="page page--centered">
|
||||||
<div style={{ textAlign: 'center', maxWidth: 300 }}>
|
<div style={{ textAlign: 'center', maxWidth: 300 }}>
|
||||||
<p style={{ fontSize: 48, marginBottom: 16 }}>📡</p>
|
<p style={{ fontSize: 48, marginBottom: 16 }}>📡</p>
|
||||||
<h2 style={{ color: '#e2e8f0', marginBottom: 8 }}>{t('offline.title')}</h2>
|
<h2 style={{ color: 'var(--x-ink)', marginBottom: 8 }}>{t('offline.title')}</h2>
|
||||||
<p style={{ color: '#64748b', marginBottom: 32 }}>
|
<p style={{ color: 'var(--x-ink-3)', marginBottom: 32 }}>
|
||||||
{t('offline.body')}
|
{t('offline.body')}
|
||||||
</p>
|
</p>
|
||||||
<button className="btn btn--primary btn--lg" onClick={retry} disabled={checking || searching}>
|
<button className="btn btn--primary btn--lg" onClick={retry} disabled={checking || searching}>
|
||||||
@@ -57,7 +57,7 @@ export default function OfflinePage() {
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{search === 'not-found' && (
|
{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')}
|
{t('offline.notFound')}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import AppShell from '../components/AppShell'
|
|||||||
import client from '../api/client'
|
import client from '../api/client'
|
||||||
import { useFormat, useTranslation } from '@xenia/i18n'
|
import { useFormat, useTranslation } from '@xenia/i18n'
|
||||||
import { money as fmtPrice } from '../i18n'
|
import { money as fmtPrice } from '../i18n'
|
||||||
|
import { fade } from '../logic/colour'
|
||||||
|
|
||||||
// ── helpers ───────────────────────────────────────────────────────────────────
|
// ── helpers ───────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -14,9 +15,9 @@ import { money as fmtPrice } from '../i18n'
|
|||||||
function PrintOkIcon() {
|
function PrintOkIcon() {
|
||||||
return (
|
return (
|
||||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none">
|
<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 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="#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="var(--x-success)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||||
<rect x="6" y="14" width="12" height="8" rx="1" stroke="#22c55e" strokeWidth="2"/>
|
<rect x="6" y="14" width="12" height="8" rx="1" stroke="var(--x-success)" strokeWidth="2"/>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -24,10 +25,10 @@ function PrintOkIcon() {
|
|||||||
function PrintFailIcon() {
|
function PrintFailIcon() {
|
||||||
return (
|
return (
|
||||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none">
|
<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 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="#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="var(--x-danger)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||||
<rect x="6" y="14" width="12" height="8" rx="1" stroke="#ef4444" strokeWidth="2"/>
|
<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="#ef4444" strokeWidth="1.5" strokeLinecap="round"/>
|
<path d="M10 17l4 4M14 17l-4 4" stroke="var(--x-danger)" strokeWidth="1.5" strokeLinecap="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -35,7 +36,7 @@ function PrintFailIcon() {
|
|||||||
// Receipt SVG from ASSETS/ICONS/receipt.svg, coloured by fiscal status
|
// Receipt SVG from ASSETS/ICONS/receipt.svg, coloured by fiscal status
|
||||||
function FiscalStatusIcon({ status }) {
|
function FiscalStatusIcon({ status }) {
|
||||||
if (!status) return null
|
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 (
|
return (
|
||||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<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"/>
|
<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}
|
onClick={onClose}
|
||||||
style={{
|
style={{
|
||||||
position: 'fixed', inset: 0, zIndex: 200,
|
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',
|
display: 'flex', alignItems: 'flex-end',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -90,7 +91,7 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
|||||||
width: '100%', background: 'var(--bg)',
|
width: '100%', background: 'var(--bg)',
|
||||||
borderRadius: '20px 20px 0 0',
|
borderRadius: '20px 20px 0 0',
|
||||||
padding: '12px 16px 32px',
|
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' }} />
|
<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 }}>
|
<div style={{ fontSize: 13, color: 'var(--muted)', marginBottom: 20 }}>
|
||||||
{t('log.orderLine', { id: order.id, table: order.table_name, time: fmtTime(order.opened_at) })}
|
{t('log.orderLine', { id: order.id, table: order.table_name, time: fmtTime(order.opened_at) })}
|
||||||
{order.print_retry_count > 0 && (
|
{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 })}
|
{t('log.retries', { count: order.print_retry_count })}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -111,7 +112,7 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
|||||||
disabled={busy}
|
disabled={busy}
|
||||||
style={{
|
style={{
|
||||||
padding: '14px', borderRadius: 12, border: 'none',
|
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',
|
fontSize: 15, fontWeight: 700, cursor: busy ? 'default' : 'pointer',
|
||||||
opacity: busy ? 0.6 : 1,
|
opacity: busy ? 0.6 : 1,
|
||||||
}}
|
}}
|
||||||
@@ -123,8 +124,8 @@ function PrintActionSheet({ order, onRetry, onCancel, onClose, busy }) {
|
|||||||
disabled={busy}
|
disabled={busy}
|
||||||
style={{
|
style={{
|
||||||
padding: '14px', borderRadius: 12,
|
padding: '14px', borderRadius: 12,
|
||||||
border: '1px solid #fee2e2', background: '#fff5f5',
|
border: '1px solid var(--x-danger-soft)', background: 'var(--x-ink)',
|
||||||
fontSize: 15, fontWeight: 600, color: '#dc2626',
|
fontSize: 15, fontWeight: 600, color: 'var(--x-danger)',
|
||||||
cursor: busy ? 'default' : 'pointer',
|
cursor: busy ? 'default' : 'pointer',
|
||||||
opacity: busy ? 0.6 : 1,
|
opacity: busy ? 0.6 : 1,
|
||||||
}}
|
}}
|
||||||
@@ -160,7 +161,7 @@ function FilterSheet({ filter, dateFrom, dateTo, onApply, onClose }) {
|
|||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
style={{
|
style={{
|
||||||
position: 'fixed', inset: 0, zIndex: 200,
|
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',
|
display: 'flex', alignItems: 'flex-end',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -170,7 +171,7 @@ function FilterSheet({ filter, dateFrom, dateTo, onApply, onClose }) {
|
|||||||
width: '100%', background: 'var(--bg)',
|
width: '100%', background: 'var(--bg)',
|
||||||
borderRadius: '20px 20px 0 0',
|
borderRadius: '20px 20px 0 0',
|
||||||
padding: '12px 16px 40px',
|
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' }} />
|
<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)}
|
onClick={() => onApply(localFilter, localFrom, localTo)}
|
||||||
style={{
|
style={{
|
||||||
width: '100%', padding: '14px', borderRadius: 12, border: 'none',
|
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',
|
fontSize: 15, fontWeight: 700, cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -278,7 +279,7 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
background: 'var(--bg2)',
|
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,
|
borderRadius: 12,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
transition: 'border-color 0.15s',
|
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>
|
<span style={{ fontSize: 14, fontWeight: 600, color: 'var(--muted)' }}>{t('common.total')}</span>
|
||||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||||
{isPending && order.print_retry_count > 0 && (
|
{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 })}
|
{t('log.retries', { count: order.print_retry_count })}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
@@ -347,7 +348,7 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
|||||||
{order.fiscal_status && (
|
{order.fiscal_status && (
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
||||||
<span style={{ color: 'var(--muted)' }}>{t('log.fiscal')}</span>
|
<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')}
|
{order.fiscal_status === 'success' ? t('log.ok') : order.fiscal_status === 'pending' ? t('log.pending') : t('log.failed')}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -362,7 +363,7 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
|||||||
disabled={busy}
|
disabled={busy}
|
||||||
style={{
|
style={{
|
||||||
flex: 1, padding: '10px 8px', borderRadius: 10, border: 'none',
|
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',
|
fontSize: 13, fontWeight: 700, cursor: busy ? 'default' : 'pointer',
|
||||||
opacity: busy ? 0.6 : 1,
|
opacity: busy ? 0.6 : 1,
|
||||||
}}
|
}}
|
||||||
@@ -374,8 +375,8 @@ function CompactCard({ order, expanded, onToggle, onRetry, onCancel, busy }) {
|
|||||||
disabled={busy}
|
disabled={busy}
|
||||||
style={{
|
style={{
|
||||||
flex: 1, padding: '10px 8px', borderRadius: 10,
|
flex: 1, padding: '10px 8px', borderRadius: 10,
|
||||||
border: '1px solid #fee2e2', background: '#fff5f5',
|
border: '1px solid var(--x-danger-soft)', background: 'var(--x-ink)',
|
||||||
fontSize: 13, fontWeight: 600, color: '#dc2626',
|
fontSize: 13, fontWeight: 600, color: 'var(--x-danger)',
|
||||||
cursor: busy ? 'default' : 'pointer',
|
cursor: busy ? 'default' : 'pointer',
|
||||||
opacity: busy ? 0.6 : 1,
|
opacity: busy ? 0.6 : 1,
|
||||||
}}
|
}}
|
||||||
@@ -416,7 +417,7 @@ function DetailedCard({ order, onLongPress }) {
|
|||||||
onPointerLeave={cancelPress}
|
onPointerLeave={cancelPress}
|
||||||
style={{
|
style={{
|
||||||
background: 'var(--bg2)',
|
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,
|
borderRadius: 14,
|
||||||
cursor: isPending ? 'pointer' : 'default',
|
cursor: isPending ? 'pointer' : 'default',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
@@ -427,7 +428,7 @@ function DetailedCard({ order, onLongPress }) {
|
|||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 10,
|
display: 'flex', alignItems: 'center', gap: 10,
|
||||||
padding: '11px 14px',
|
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)',
|
borderBottom: '1px solid var(--border)',
|
||||||
borderRadius: '14px 14px 0 0',
|
borderRadius: '14px 14px 0 0',
|
||||||
}}>
|
}}>
|
||||||
@@ -449,7 +450,7 @@ function DetailedCard({ order, onLongPress }) {
|
|||||||
</div>
|
</div>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
||||||
<span style={{ color: 'var(--muted)' }}>{t('log.print')}</span>
|
<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
|
{isPending
|
||||||
? t('log.pendingRetries', { count: order.print_retry_count })
|
? t('log.pendingRetries', { count: order.print_retry_count })
|
||||||
: `OK ${fmtTime(order.print_attempted_at)}`}
|
: `OK ${fmtTime(order.print_attempted_at)}`}
|
||||||
@@ -458,7 +459,7 @@ function DetailedCard({ order, onLongPress }) {
|
|||||||
{order.fiscal_status && (
|
{order.fiscal_status && (
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12 }}>
|
||||||
<span style={{ color: 'var(--muted)' }}>{t('log.fiscal')}</span>
|
<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')}
|
{order.fiscal_status === 'success' ? t('log.ok') : order.fiscal_status === 'pending' ? t('log.pending') : t('log.failed')}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -628,7 +629,7 @@ export default function OrderLogPage() {
|
|||||||
style={{
|
style={{
|
||||||
width: 38, height: 38, borderRadius: 10,
|
width: 38, height: 38, borderRadius: 10,
|
||||||
border: `1px solid ${view === 'detailed' ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
@@ -643,15 +644,15 @@ export default function OrderLogPage() {
|
|||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 8,
|
display: 'flex', alignItems: 'center', gap: 8,
|
||||||
padding: '8px 14px',
|
padding: '8px 14px',
|
||||||
background: 'rgba(239,68,68,0.08)',
|
background: 'rgb(var(--x-danger-rgb) / 0.08)',
|
||||||
borderBottom: '1px solid rgba(239,68,68,0.2)',
|
borderBottom: '1px solid rgb(var(--x-danger-rgb) / 0.2)',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
}}>
|
}}>
|
||||||
<svg width="15" height="15" viewBox="0 0 24 24" fill="none">
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="none">
|
||||||
<circle cx="12" cy="12" r="10" stroke="#ef4444" strokeWidth="2"/>
|
<circle cx="12" cy="12" r="10" stroke="var(--x-danger)" strokeWidth="2"/>
|
||||||
<path d="M12 8v4M12 16h.01" stroke="#ef4444" strokeWidth="2" strokeLinecap="round"/>
|
<path d="M12 8v4M12 16h.01" stroke="var(--x-danger)" strokeWidth="2" strokeLinecap="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span style={{ fontSize: 13, color: '#ef4444', fontWeight: 600 }}>
|
<span style={{ fontSize: 13, color: 'var(--x-danger)', fontWeight: 600 }}>
|
||||||
{t('log.printProblems', { count: pendingCount })}
|
{t('log.printProblems', { count: pendingCount })}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -668,8 +669,8 @@ export default function OrderLogPage() {
|
|||||||
{filter !== 'all' && (
|
{filter !== 'all' && (
|
||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 12, padding: '3px 10px', borderRadius: 999,
|
fontSize: 12, padding: '3px 10px', borderRadius: 999,
|
||||||
background: filter === 'failed' ? 'rgba(239,68,68,0.12)' : 'rgba(34,197,94,0.12)',
|
background: filter === 'failed' ? 'rgb(var(--x-danger-rgb) / 0.12)' : 'rgb(var(--x-success-rgb) / 0.12)',
|
||||||
color: filter === 'failed' ? '#ef4444' : '#22c55e',
|
color: filter === 'failed' ? 'var(--x-danger)' : 'var(--x-success)',
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
}}>
|
}}>
|
||||||
{filter === 'failed' ? t('log.printFailed') : t('log.printOk')}
|
{filter === 'failed' ? t('log.printFailed') : t('log.printOk')}
|
||||||
@@ -735,8 +736,8 @@ export default function OrderLogPage() {
|
|||||||
width: 52, height: 52, borderRadius: '50%',
|
width: 52, height: 52, borderRadius: '50%',
|
||||||
border: 'none', cursor: 'pointer',
|
border: 'none', cursor: 'pointer',
|
||||||
background: hasActiveFilters ? 'var(--accent)' : 'var(--bg3)',
|
background: hasActiveFilters ? 'var(--accent)' : 'var(--bg3)',
|
||||||
color: hasActiveFilters ? '#fff' : 'var(--text)',
|
color: hasActiveFilters ? 'var(--x-ink)' : 'var(--text)',
|
||||||
boxShadow: '0 4px 16px rgba(0,0,0,0.25)',
|
boxShadow: '0 4px 16px rgb(var(--x-scrim-rgb) / 0.25)',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
zIndex: 10,
|
zIndex: 10,
|
||||||
}}
|
}}
|
||||||
@@ -747,7 +748,7 @@ export default function OrderLogPage() {
|
|||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: -2, right: -2,
|
position: 'absolute', top: -2, right: -2,
|
||||||
width: 14, height: 14, borderRadius: '50%',
|
width: 14, height: 14, borderRadius: '50%',
|
||||||
background: '#ef4444',
|
background: 'var(--x-danger)',
|
||||||
border: '2px solid var(--bg)',
|
border: '2px solid var(--bg)',
|
||||||
}} />
|
}} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import useOrderingSettingsStore from '../store/orderingSettingsStore'
|
|||||||
import usePaymentSettingsStore from '../store/paymentSettingsStore'
|
import usePaymentSettingsStore from '../store/paymentSettingsStore'
|
||||||
import useWaiterFavoritesStore from '../store/waiterFavoritesStore'
|
import useWaiterFavoritesStore from '../store/waiterFavoritesStore'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
|
import { fade } from '../logic/colour'
|
||||||
|
|
||||||
const CHIP_STYLE_OPTIONS = [
|
const CHIP_STYLE_OPTIONS = [
|
||||||
{ key: 'full', label: 'settings.chips.full', example: 'orders.chips.pending' },
|
{ 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%' }}>
|
<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"/>
|
<rect x="2" y="4" width="52" height="20" rx="2" fill="currentColor" opacity="0.9"/>
|
||||||
{/* left section lines */}
|
{/* left section lines */}
|
||||||
<rect x="5" y="8" width="14" height="3" rx="1" fill="white" opacity="0.6"/>
|
<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="white" opacity="0.4"/>
|
<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="white" opacity="0.4"/>
|
<rect x="5" y="18" width="11" height="2" rx="1" fill="var(--x-on-colour)" opacity="0.4"/>
|
||||||
{/* vertical divider */}
|
{/* 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 */}
|
{/* right section lines */}
|
||||||
<rect x="25" y="8" width="24" height="2" rx="1" fill="white" opacity="0.5"/>
|
<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="white" opacity="0.35"/>
|
<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="white" opacity="0.25"/>
|
<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"/>
|
<rect x="2" y="29" width="52" height="15" rx="2" fill="currentColor" opacity="0.45"/>
|
||||||
</svg>
|
</svg>
|
||||||
)
|
)
|
||||||
@@ -192,7 +193,7 @@ function LayoutTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
padding: '12px 16px', borderRadius: 14,
|
padding: '12px 16px', borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -232,7 +233,7 @@ function LayoutTab() {
|
|||||||
padding: '14px 16px',
|
padding: '14px 16px',
|
||||||
borderRadius: 14,
|
borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer',
|
||||||
textAlign: 'left',
|
textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
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,
|
flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 6,
|
||||||
padding: '14px 12px', borderRadius: 14,
|
padding: '14px 12px', borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -320,7 +321,7 @@ function LayoutTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
padding: '12px 16px', borderRadius: 14,
|
padding: '12px 16px', borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -362,7 +363,7 @@ function LayoutTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
padding: '12px 16px', borderRadius: 14,
|
padding: '12px 16px', borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -403,7 +404,7 @@ function LayoutTab() {
|
|||||||
padding: '18px 12px',
|
padding: '18px 12px',
|
||||||
borderRadius: 14,
|
borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: active ? 'default' : 'pointer',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -458,7 +459,7 @@ function ToggleRow({ label, desc, checked, onChange }) {
|
|||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
width: '100%', padding: '14px 16px', borderRadius: 14,
|
width: '100%', padding: '14px 16px', borderRadius: 14,
|
||||||
border: `2px solid ${checked ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -469,8 +470,8 @@ function ToggleRow({ label, desc, checked, onChange }) {
|
|||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
position: 'absolute', top: 3, left: checked ? 23 : 3,
|
position: 'absolute', top: 3, left: checked ? 23 : 3,
|
||||||
width: 18, height: 18, borderRadius: '50%', background: 'white',
|
width: 18, height: 18, borderRadius: '50%', background: 'var(--x-on-colour)',
|
||||||
transition: 'left 0.2s', boxShadow: '0 1px 4px rgba(0,0,0,0.3)',
|
transition: 'left 0.2s', boxShadow: '0 1px 4px rgb(var(--x-scrim-rgb) / 0.3)',
|
||||||
}} />
|
}} />
|
||||||
</div>
|
</div>
|
||||||
<div style={{ flex: 1 }}>
|
<div style={{ flex: 1 }}>
|
||||||
@@ -523,7 +524,7 @@ function LeitourgiaTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
padding: '12px 16px', borderRadius: 14,
|
padding: '12px 16px', borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -597,7 +598,7 @@ function LeitourgiaTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
padding: '12px 16px', borderRadius: 14,
|
padding: '12px 16px', borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -656,11 +657,11 @@ function PersonalizeTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 14,
|
display: 'flex', alignItems: 'center', gap: 14,
|
||||||
width: '100%', padding: '14px 16px', borderRadius: 14,
|
width: '100%', padding: '14px 16px', borderRadius: 14,
|
||||||
border: '2px solid var(--accent)',
|
border: '2px solid var(--accent)',
|
||||||
background: 'var(--accent)18',
|
background: fade('var(--accent)', 0.09),
|
||||||
cursor: 'pointer', textAlign: 'left',
|
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"/>
|
<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>
|
</svg>
|
||||||
<div style={{ flex: 1 }}>
|
<div style={{ flex: 1 }}>
|
||||||
@@ -690,7 +691,7 @@ function PersonalizeTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
width: '100%', padding: '14px 16px', borderRadius: 14,
|
width: '100%', padding: '14px 16px', borderRadius: 14,
|
||||||
border: `2px solid ${confirmReset ? 'var(--danger)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.15s, background 0.15s',
|
transition: 'border-color 0.15s, background 0.15s',
|
||||||
}}
|
}}
|
||||||
@@ -939,7 +940,7 @@ function PloigisiTab() {
|
|||||||
display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 6,
|
display: 'flex', flexDirection: 'column', alignItems: 'flex-start', gap: 6,
|
||||||
padding: '14px 12px', borderRadius: 14,
|
padding: '14px 12px', borderRadius: 14,
|
||||||
border: `2px solid ${active ? 'var(--accent)' : 'var(--border)'}`,
|
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',
|
cursor: 'pointer', textAlign: 'left',
|
||||||
transition: 'border-color 0.12s, background 0.12s',
|
transition: 'border-color 0.12s, background 0.12s',
|
||||||
}}
|
}}
|
||||||
@@ -983,7 +984,7 @@ function PloigisiTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
|
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
|
||||||
border: '2px solid var(--accent)',
|
border: '2px solid var(--accent)',
|
||||||
background: 'var(--accent)18',
|
background: fade('var(--accent)', 0.09),
|
||||||
cursor: 'grab', userSelect: 'none',
|
cursor: 'grab', userSelect: 'none',
|
||||||
opacity: triDragging === item.key ? 0.4 : 1,
|
opacity: triDragging === item.key ? 0.4 : 1,
|
||||||
transition: 'opacity 0.1s',
|
transition: 'opacity 0.1s',
|
||||||
@@ -1084,7 +1085,7 @@ function PloigisiTab() {
|
|||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
|
padding: '12px 14px', borderRadius: 14, marginBottom: 8,
|
||||||
border: `2px solid var(--accent)`,
|
border: `2px solid var(--accent)`,
|
||||||
background: 'var(--accent)18',
|
background: fade('var(--accent)', 0.09),
|
||||||
cursor: 'grab',
|
cursor: 'grab',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
opacity: dragging === item.key ? 0.4 : 1,
|
opacity: dragging === item.key ? 0.4 : 1,
|
||||||
|
|||||||
@@ -104,14 +104,14 @@ function BreakRow({ brk, index }) {
|
|||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
padding: '10px 14px', borderRadius: 10,
|
padding: '10px 14px', borderRadius: 10,
|
||||||
background: active ? 'rgba(251,146,60,0.1)' : 'var(--bg2)',
|
background: active ? 'rgb(var(--x-warning-rgb) / 0.1)' : 'var(--bg2)',
|
||||||
border: `1px solid ${active ? '#f97316' : 'var(--border)'}`,
|
border: `1px solid ${active ? 'var(--x-warning)' : 'var(--border)'}`,
|
||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 28, height: 28, borderRadius: 8, flexShrink: 0,
|
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',
|
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>
|
}}>{index + 1}</div>
|
||||||
<div style={{ flex: 1 }}>
|
<div style={{ flex: 1 }}>
|
||||||
<div style={{ fontSize: 13, fontWeight: 600, color: 'var(--text)' }}>
|
<div style={{ fontSize: 13, fontWeight: 600, color: 'var(--text)' }}>
|
||||||
@@ -124,7 +124,7 @@ function BreakRow({ brk, index }) {
|
|||||||
{active && (
|
{active && (
|
||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 10, fontWeight: 700, padding: '3px 8px', borderRadius: 999,
|
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>
|
}}>{t('venues.active')}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -212,13 +212,13 @@ export default function ShiftOverviewPage() {
|
|||||||
margin: '0 0 16px',
|
margin: '0 0 16px',
|
||||||
padding: '12px 16px',
|
padding: '12px 16px',
|
||||||
borderRadius: 12,
|
borderRadius: 12,
|
||||||
background: 'rgba(251,146,60,0.12)',
|
background: 'rgb(var(--x-warning-rgb) / 0.12)',
|
||||||
border: '1px solid #f97316',
|
border: '1px solid var(--x-warning)',
|
||||||
display: 'flex', alignItems: 'center', gap: 10,
|
display: 'flex', alignItems: 'center', gap: 10,
|
||||||
}}>
|
}}>
|
||||||
<span style={{ fontSize: 20 }}>☕</span>
|
<span style={{ fontSize: 20 }}>☕</span>
|
||||||
<div>
|
<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 }}>
|
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 1 }}>
|
||||||
{t('shiftPage.breakSince', { time: fmtTime(activeBreak.started_at), duration: fmtDuration(breakDurationSeconds(activeBreak)) })}
|
{t('shiftPage.breakSince', { time: fmtTime(activeBreak.started_at), duration: fmtDuration(breakDurationSeconds(activeBreak)) })}
|
||||||
</div>
|
</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.worked')} value={fmtDuration(workedSec)} sub={t('shiftPage.breaksSub', { duration: fmtDuration(totalBreakSec) })} />
|
||||||
<StatCard label={t('shiftPage.startCash')} value={fmtEuro(shift.starting_cash)} />
|
<StatCard label={t('shiftPage.startCash')} value={fmtEuro(shift.starting_cash)} />
|
||||||
{!hideRevenue && (
|
{!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 && (
|
{!hideRevenue && (
|
||||||
<StatCard label={t('shiftPage.toHandIn')} value={fmtEuro(shift.net_to_deliver)} sub={t('shiftPage.toHandInSub')} accent="var(--accent)" />
|
<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 usePaymentSettingsStore from '../store/paymentSettingsStore'
|
||||||
import useTableViewStore from '../store/tableViewStore'
|
import useTableViewStore from '../store/tableViewStore'
|
||||||
import { useTranslation } from '@xenia/i18n'
|
import { useTranslation } from '@xenia/i18n'
|
||||||
|
import { fade } from '../logic/colour'
|
||||||
|
|
||||||
const fmtPrice = money
|
const fmtPrice = money
|
||||||
|
|
||||||
@@ -79,10 +80,10 @@ function SplitModal({ item, onConfirm, onClose }) {
|
|||||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||||
<div className="modal-handle" />
|
<div className="modal-handle" />
|
||||||
<h2 className="modal-title">{t('detail.split.title')}</h2>
|
<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}
|
{item.product?.name} ×{item.quantity}
|
||||||
</p>
|
</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')}
|
{t('detail.split.howMany')}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -92,9 +93,9 @@ function SplitModal({ item, onConfirm, onClose }) {
|
|||||||
<button className="qty-btn" onClick={() => setSplitQty(q => Math.min(max, q + 1))}>+</button>
|
<button className="qty-btn" onClick={() => setSplitQty(q => Math.min(max, q + 1))}>+</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'center', gap: 20, marginBottom: 20, fontSize: 13, color: '#94a3b8' }}>
|
<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: '#f59e0b' }}>×{splitQty}</strong></span>
|
<span>{t('detail.split.newLine')} <strong style={{ color: 'var(--x-warning)' }}>×{splitQty}</strong></span>
|
||||||
<span>{t('detail.split.remains')} <strong style={{ color: '#64748b' }}>×{item.quantity - splitQty}</strong></span>
|
<span>{t('detail.split.remains')} <strong style={{ color: 'var(--x-ink-3)' }}>×{item.quantity - splitQty}</strong></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ display: 'flex', gap: 12 }}>
|
<div style={{ display: 'flex', gap: 12 }}>
|
||||||
@@ -164,7 +165,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
|||||||
onBlur={commitEdit}
|
onBlur={commitEdit}
|
||||||
onKeyDown={e => { if (e.key === 'Enter') commitEdit() }}
|
onKeyDown={e => { if (e.key === 'Enter') commitEdit() }}
|
||||||
style={{
|
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)',
|
background: 'var(--bg3)', border: '2px solid var(--accent)',
|
||||||
borderRadius: 12, padding: '6px 16px', textAlign: 'center',
|
borderRadius: 12, padding: '6px 16px', textAlign: 'center',
|
||||||
width: '140px',
|
width: '140px',
|
||||||
@@ -174,7 +175,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
|||||||
<button
|
<button
|
||||||
onClick={startEdit}
|
onClick={startEdit}
|
||||||
style={{
|
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)',
|
background: 'var(--bg3)', border: '2px solid var(--border)',
|
||||||
borderRadius: 12, padding: '6px 20px', cursor: 'pointer',
|
borderRadius: 12, padding: '6px 20px', cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
@@ -183,7 +184,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
{adj !== 0 && (
|
{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)}` })}
|
{t('detail.price.base', { base: fmtPrice(basePrice), change: `${adj > 0 ? '+' : ''}${fmtPrice(adj)}` })}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -206,8 +207,8 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
|||||||
style={{
|
style={{
|
||||||
padding: '9px 4px', borderRadius: 10, border: 'none', cursor: 'pointer',
|
padding: '9px 4px', borderRadius: 10, border: 'none', cursor: 'pointer',
|
||||||
fontWeight: 700, fontSize: 13,
|
fontWeight: 700, fontSize: 13,
|
||||||
background: d < 0 ? 'rgba(239,68,68,0.15)' : 'rgba(34,197,94,0.15)',
|
background: d < 0 ? 'rgb(var(--x-danger-rgb) / 0.15)' : 'rgb(var(--x-success-rgb) / 0.15)',
|
||||||
color: d < 0 ? '#f87171' : '#4ade80',
|
color: d < 0 ? 'var(--x-danger)' : 'var(--x-success)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{d > 0 ? '+' : ''}{d.toFixed(1).replace('.0', '')} €
|
{d > 0 ? '+' : ''}{d.toFixed(1).replace('.0', '')} €
|
||||||
@@ -221,7 +222,7 @@ function PriceAdjustModal({ item, onConfirm, onClose }) {
|
|||||||
onClick={() => setAdj(0)}
|
onClick={() => setAdj(0)}
|
||||||
style={{
|
style={{
|
||||||
width: '100%', marginBottom: 8, padding: '8px 0', borderRadius: 10,
|
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',
|
color: 'var(--muted)', fontSize: 13, cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -252,14 +253,14 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
|||||||
const actionRows = [
|
const actionRows = [
|
||||||
...(!multiSelect && priceAdjAllowed ? [{
|
...(!multiSelect && priceAdjAllowed ? [{
|
||||||
key: 'adjust_price',
|
key: 'adjust_price',
|
||||||
color: '#f59e0b',
|
color: 'var(--x-warning)',
|
||||||
iconBg: 'rgba(245,158,11,0.15)',
|
iconBg: 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||||
label: t('detail.item.price'),
|
label: t('detail.item.price'),
|
||||||
sub: priceNeedsApproval ? t('detail.withApproval') : t('detail.item.priceSub'),
|
sub: priceNeedsApproval ? t('detail.withApproval') : t('detail.item.priceSub'),
|
||||||
icon: (
|
icon: (
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||||
<circle cx="12" cy="12" r="9" stroke="#f59e0b" strokeWidth="2"/>
|
<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="#f59e0b" strokeWidth="1.8" strokeLinecap="round"/>
|
<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>
|
</svg>
|
||||||
),
|
),
|
||||||
onClick: onAdjustPrice,
|
onClick: onAdjustPrice,
|
||||||
@@ -267,14 +268,14 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
|||||||
}] : []),
|
}] : []),
|
||||||
{
|
{
|
||||||
key: 'order_again',
|
key: 'order_again',
|
||||||
color: '#22c55e',
|
color: 'var(--x-success)',
|
||||||
iconBg: 'rgba(34,197,94,0.15)',
|
iconBg: 'rgb(var(--x-success-rgb) / 0.15)',
|
||||||
label: t('detail.item.again'),
|
label: t('detail.item.again'),
|
||||||
sub: t('detail.item.againSub'),
|
sub: t('detail.item.againSub'),
|
||||||
icon: (
|
icon: (
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
<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="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="#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="var(--x-success)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
onClick: onOrderAgain,
|
onClick: onOrderAgain,
|
||||||
@@ -282,13 +283,13 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
|||||||
},
|
},
|
||||||
...(canMove ? [{
|
...(canMove ? [{
|
||||||
key: 'move',
|
key: 'move',
|
||||||
color: '#f97316',
|
color: 'var(--x-warning)',
|
||||||
iconBg: 'rgba(249,115,22,0.15)',
|
iconBg: 'rgb(var(--x-warning-rgb) / 0.15)',
|
||||||
label: t('detail.item.move'),
|
label: t('detail.item.move'),
|
||||||
sub: t('detail.item.moveSub'),
|
sub: t('detail.item.moveSub'),
|
||||||
icon: (
|
icon: (
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
<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>
|
</svg>
|
||||||
),
|
),
|
||||||
onClick: onMoveToTable,
|
onClick: onMoveToTable,
|
||||||
@@ -296,13 +297,13 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
|||||||
}] : []),
|
}] : []),
|
||||||
...(canMove && singleStacked && !multiSelect ? [{
|
...(canMove && singleStacked && !multiSelect ? [{
|
||||||
key: 'split',
|
key: 'split',
|
||||||
color: '#60a5fa',
|
color: 'var(--x-info)',
|
||||||
iconBg: 'rgba(96,165,250,0.15)',
|
iconBg: 'rgb(var(--x-info-rgb) / 0.15)',
|
||||||
label: t('detail.split.title'),
|
label: t('detail.split.title'),
|
||||||
sub: t('detail.item.splitSub'),
|
sub: t('detail.item.splitSub'),
|
||||||
icon: (
|
icon: (
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
<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>
|
</svg>
|
||||||
),
|
),
|
||||||
onClick: onSplit,
|
onClick: onSplit,
|
||||||
@@ -310,14 +311,14 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
|||||||
}] : []),
|
}] : []),
|
||||||
{
|
{
|
||||||
key: 'cancel',
|
key: 'cancel',
|
||||||
color: canCancel ? '#ef4444' : '#6b7280',
|
color: canCancel ? 'var(--x-danger)' : 'var(--x-ink-3)',
|
||||||
iconBg: canCancel ? 'rgba(239,68,68,0.15)' : 'rgba(107,114,128,0.1)',
|
iconBg: canCancel ? 'rgb(var(--x-danger-rgb) / 0.15)' : 'rgb(var(--x-ink-2-rgb) / 0.1)',
|
||||||
label: t('detail.item.cancel'),
|
label: t('detail.item.cancel'),
|
||||||
sub: !canCancel ? t('detail.cancelNotAllowed') : cancelNeedsApproval ? t('detail.withApproval') : t('detail.item.cancelSub'),
|
sub: !canCancel ? t('detail.cancelNotAllowed') : cancelNeedsApproval ? t('detail.withApproval') : t('detail.item.cancelSub'),
|
||||||
icon: (
|
icon: (
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
<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"/>
|
<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 ? '#ef4444' : '#6b7280'} strokeWidth="2" strokeLinecap="round"/>
|
<path d="M15 9l-6 6M9 9l6 6" stroke={canCancel ? 'var(--x-danger)' : 'var(--x-ink-3)'} strokeWidth="2" strokeLinecap="round"/>
|
||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
onClick: canCancel ? onCancel : null,
|
onClick: canCancel ? onCancel : null,
|
||||||
@@ -437,15 +438,15 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 10,
|
display: 'flex', alignItems: 'center', gap: 10,
|
||||||
padding: '10px 12px', borderRadius: 10, border: 'none', cursor: 'pointer',
|
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',
|
textAlign: 'left',
|
||||||
}}>
|
}}>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 20, height: 20, borderRadius: 5, flexShrink: 0,
|
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',
|
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>
|
||||||
<div style={{ flex: 1, minWidth: 0 }}>
|
<div style={{ flex: 1, minWidth: 0 }}>
|
||||||
<div style={{ fontSize: 13, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
<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 style={{ fontSize: 11, color: 'var(--muted)' }}>×{item.quantity} · {fmtPrice(eff)}</div>
|
||||||
</div>
|
</div>
|
||||||
{checked && (
|
{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)}
|
→ {fmtPrice(newPrice)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -472,8 +473,8 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
|||||||
<button key={p} onClick={() => setPct(p)}
|
<button key={p} onClick={() => setPct(p)}
|
||||||
style={{
|
style={{
|
||||||
padding: '6px 12px', borderRadius: 8, border: 'none', cursor: 'pointer', fontWeight: 700, fontSize: 13,
|
padding: '6px 12px', borderRadius: 8, border: 'none', cursor: 'pointer', fontWeight: 700, fontSize: 13,
|
||||||
background: pct === p ? '#6366f1' : 'var(--bg3)',
|
background: pct === p ? 'var(--x-info)' : 'var(--bg3)',
|
||||||
color: pct === p ? '#fff' : 'var(--text)',
|
color: pct === p ? 'var(--x-info-fg)' : 'var(--text)',
|
||||||
}}>
|
}}>
|
||||||
{p}%
|
{p}%
|
||||||
</button>
|
</button>
|
||||||
@@ -488,7 +489,7 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
|||||||
color: 'var(--text)', fontSize: 16, fontWeight: 700, textAlign: 'center',
|
color: 'var(--text)', fontSize: 16, fontWeight: 700, textAlign: 'center',
|
||||||
}} />
|
}} />
|
||||||
<span style={{ fontSize: 14, color: 'var(--muted)' }}>%</span>
|
<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)}
|
−{fmtPrice(discountTotal)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -507,7 +508,7 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{error && (
|
{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 }}>
|
<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 hasActiveItems = hasOrder && order.items?.some(i => i.status === 'active')
|
||||||
const allActions = [
|
const allActions = [
|
||||||
{ Icon: CheckIcon, label: t('tables.quick.markAllServed'), sub: t('detail.actions.markAllServedSub'),
|
{ 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'),
|
{ 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)' },
|
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: '#6099db', iconBg: 'rgba(96,165,250,0.15)', tableOnly: true, needsMove: true },
|
{ 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: '#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: '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: '#fac823', iconBg: 'rgba(251,191,36,0.15)', tableOnly: 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: '#39b861', iconBg: 'rgba(34,197,94,0.15)' },
|
{ 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: '#cbd5e1', iconBg: 'rgba(148,163,184,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'),
|
{ 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
|
// plan 4.3: discounts show only with pricing.discounts.apply, transfer/merge with ordering.orders.open
|
||||||
const actions = allActions
|
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-sheet modal-sheet--top" onClick={e => e.stopPropagation()}>
|
||||||
<div className="modal-handle" />
|
<div className="modal-handle" />
|
||||||
<h2 className="modal-title">{title}</h2>
|
<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' }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, maxHeight: '60svh', overflowY: 'auto' }}>
|
||||||
{loading && (
|
{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 && (
|
{!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 => (
|
{!loading && tables.map(tb => (
|
||||||
<button
|
<button
|
||||||
@@ -643,7 +644,7 @@ function TablePicker({ title, subtitle, tables, _currentTableId, onSelect, onClo
|
|||||||
{tb.label || `T${tb.number}`}
|
{tb.label || `T${tb.number}`}
|
||||||
</div>
|
</div>
|
||||||
{tb.orderStatus && (
|
{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}
|
{tb.orderStatus === 'open' ? t('tables.status.open') : tb.orderStatus === 'partially_paid' ? t('tables.status.partlyPaid') : tb.orderStatus}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -678,10 +679,10 @@ function FlagPicker({ _tableId, currentFlagIds, flagDefs, onSave, onClose, loadi
|
|||||||
<h2 className="modal-title">{t('tables.actions.flags')}</h2>
|
<h2 className="modal-title">{t('tables.actions.flags')}</h2>
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 20 }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 20 }}>
|
||||||
{loading && (
|
{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 && (
|
{!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 => {
|
{!loading && flagDefs.map(f => {
|
||||||
const sel = selected.includes(f.id)
|
const sel = selected.includes(f.id)
|
||||||
@@ -698,7 +699,7 @@ function FlagPicker({ _tableId, currentFlagIds, flagDefs, onSave, onClose, loadi
|
|||||||
>
|
>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 36, height: 36, borderRadius: '50%', flexShrink: 0,
|
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,
|
display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 18,
|
||||||
}}>
|
}}>
|
||||||
{f.emoji || '🏷️'}
|
{f.emoji || '🏷️'}
|
||||||
@@ -751,10 +752,10 @@ function AssignWaiterPicker({ orderId, currentWaiterIds, waiters, onAssigned, on
|
|||||||
<h2 className="modal-title">{t('tables.actions.assignWaiter')}</h2>
|
<h2 className="modal-title">{t('tables.actions.assignWaiter')}</h2>
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 16, maxHeight: '60svh', overflowY: 'auto' }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 16, maxHeight: '60svh', overflowY: 'auto' }}>
|
||||||
{loading && (
|
{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 && (
|
{!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 => (
|
{!loading && available.map(w => (
|
||||||
<button
|
<button
|
||||||
@@ -813,7 +814,7 @@ function PrintSynopsisPicker({ orderId, onClose }) {
|
|||||||
<div className="modal-sheet modal-sheet--top" onClick={e => e.stopPropagation()}>
|
<div className="modal-sheet modal-sheet--top" onClick={e => e.stopPropagation()}>
|
||||||
<div className="modal-handle" />
|
<div className="modal-handle" />
|
||||||
<h2 className="modal-title">{t('tables.actions.printSynopsis')}</h2>
|
<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 }}>
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 0, marginBottom: 16 }}>
|
||||||
{printers.filter(p => p.reachable).map(p => (
|
{printers.filter(p => p.reachable).map(p => (
|
||||||
<button
|
<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 }}>
|
<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: 20 }}>🖨️</span>
|
||||||
<span style={{ fontSize: 15, color: 'var(--text)' }}>{p.name}</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>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -854,7 +855,7 @@ function CancelConfirmModal({ itemCount, onConfirm, onClose }) {
|
|||||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||||
<div className="modal-handle" />
|
<div className="modal-handle" />
|
||||||
<h2 className="modal-title">{t('detail.cancel.title')}</h2>
|
<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
|
{itemCount === null
|
||||||
? t('detail.cancel.whole')
|
? t('detail.cancel.whole')
|
||||||
: t('detail.cancel.items', { count: itemCount })}
|
: t('detail.cancel.items', { count: itemCount })}
|
||||||
@@ -865,7 +866,7 @@ function CancelConfirmModal({ itemCount, onConfirm, onClose }) {
|
|||||||
onClick={onConfirm}
|
onClick={onConfirm}
|
||||||
style={{
|
style={{
|
||||||
flex: 1, height: 48, borderRadius: 12, border: 'none',
|
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>
|
>{t('detail.cancel.button')}</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -917,8 +918,8 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
|||||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||||
<div className="modal-handle" />
|
<div className="modal-handle" />
|
||||||
<h2 className="modal-title" style={{ fontSize: andClose ? 16 : undefined }}>{title}</h2>
|
<h2 className="modal-title" style={{ fontSize: andClose ? 16 : undefined }}>{title}</h2>
|
||||||
<p style={{ color: '#94a3b8', textAlign: 'center', marginBottom: 4 }}>{subtitle}</p>
|
<p style={{ color: 'var(--x-ink-2)', textAlign: 'center', marginBottom: 4 }}>{subtitle}</p>
|
||||||
<p style={{ color: '#f59e0b', textAlign: 'center', fontSize: 28, fontWeight: 700, marginBottom: 20 }}>
|
<p style={{ color: 'var(--x-warning)', textAlign: 'center', fontSize: 28, fontWeight: 700, marginBottom: 20 }}>
|
||||||
{fmtPrice(payTotal)}
|
{fmtPrice(payTotal)}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -931,9 +932,9 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
|||||||
onClick={() => setMethod(m)}
|
onClick={() => setMethod(m)}
|
||||||
style={{
|
style={{
|
||||||
flex: 1, padding: '10px 0', borderRadius: 10, fontSize: 14, fontWeight: 600,
|
flex: 1, padding: '10px 0', borderRadius: 10, fontSize: 14, fontWeight: 600,
|
||||||
border: `2px solid ${method === m ? '#3b82f6' : 'rgba(255,255,255,0.1)'}`,
|
border: `2px solid ${method === m ? 'var(--x-info)' : 'rgb(var(--x-ink-rgb) / 0.1)'}`,
|
||||||
background: method === m ? 'rgba(59,130,246,0.18)' : 'rgba(255,255,255,0.04)',
|
background: method === m ? 'rgb(var(--x-info-rgb) / 0.18)' : 'rgb(var(--x-ink-rgb) / 0.04)',
|
||||||
color: method === m ? '#93c5fd' : '#94a3b8',
|
color: method === m ? 'var(--x-info-ink)' : 'var(--x-ink-2)',
|
||||||
cursor: 'pointer', transition: 'all 0.12s',
|
cursor: 'pointer', transition: 'all 0.12s',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -963,7 +964,7 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
|||||||
</span>
|
</span>
|
||||||
{longPressActive && (
|
{longPressActive && (
|
||||||
<span style={{
|
<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',
|
animation: 'longpress-fill 0.8s linear forwards',
|
||||||
transformOrigin: 'left',
|
transformOrigin: 'left',
|
||||||
}} />
|
}} />
|
||||||
@@ -979,15 +980,15 @@ function PayConfirmModal({ payAll, payIds, activeItems, andClose, cardEnabled, o
|
|||||||
{/* Second confirmation dialog */}
|
{/* Second confirmation dialog */}
|
||||||
{secondConfirmOpen && (
|
{secondConfirmOpen && (
|
||||||
<div style={{
|
<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',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
borderRadius: 'inherit', padding: 20,
|
borderRadius: 'inherit', padding: 20,
|
||||||
}} onClick={e => e.stopPropagation()}>
|
}} onClick={e => e.stopPropagation()}>
|
||||||
<div style={{ background: 'var(--bg2,#1e293b)', borderRadius: 14, padding: 24, width: '100%' }}>
|
<div style={{ background: 'var(--bg2,var(--x-surface))', borderRadius: 14, padding: 24, width: '100%' }}>
|
||||||
<p style={{ color: '#f1f5f9', fontWeight: 700, fontSize: 15, textAlign: 'center', marginBottom: 8 }}>
|
<p style={{ color: 'var(--x-ink)', fontWeight: 700, fontSize: 15, textAlign: 'center', marginBottom: 8 }}>
|
||||||
{t('common.sure')}
|
{t('common.sure')}
|
||||||
</p>
|
</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')}
|
{fmtPrice(payTotal)} — {method === 'card' ? t('detail.pay.card') : t('detail.pay.cash')}
|
||||||
</p>
|
</p>
|
||||||
<div style={{ display: 'flex', gap: 10 }}>
|
<div style={{ display: 'flex', gap: 10 }}>
|
||||||
@@ -1597,7 +1598,7 @@ export default function TableDetailPage() {
|
|||||||
? (order?.order_type === 'delivery' ? `Delivery #${standaloneOrderId}` : `Takeaway #${standaloneOrderId}`)
|
? (order?.order_type === 'delivery' ? `Delivery #${standaloneOrderId}` : `Takeaway #${standaloneOrderId}`)
|
||||||
: (table ? (table.label || `T${table.number}`) : '—')
|
: (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 (
|
return (
|
||||||
<div className="page">
|
<div className="page">
|
||||||
@@ -1614,9 +1615,9 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center', gap: 5,
|
display: 'inline-flex', alignItems: 'center', gap: 5,
|
||||||
height: 34, padding: '0 10px',
|
height: 34, padding: '0 10px',
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
background: customerCount ? 'rgba(245,158,11,0.15)' : 'var(--bg2)',
|
background: customerCount ? 'rgb(var(--x-warning-rgb) / 0.15)' : 'var(--bg2)',
|
||||||
border: `1.5px solid ${customerCount ? 'rgba(245,158,11,0.5)' : 'var(--border)'}`,
|
border: `1.5px solid ${customerCount ? 'rgb(var(--x-warning-rgb) / 0.5)' : 'var(--border)'}`,
|
||||||
color: customerCount ? '#f59e0b' : 'var(--muted)',
|
color: customerCount ? 'var(--x-warning)' : 'var(--muted)',
|
||||||
cursor: 'pointer', fontSize: 13, fontWeight: 700,
|
cursor: 'pointer', fontSize: 13, fontWeight: 700,
|
||||||
}}
|
}}
|
||||||
title={t('detail.guests.button')}
|
title={t('detail.guests.button')}
|
||||||
@@ -1640,8 +1641,8 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center', gap: 5,
|
display: 'inline-flex', alignItems: 'center', gap: 5,
|
||||||
height: 34, padding: '0 10px',
|
height: 34, padding: '0 10px',
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
background: 'rgba(99,102,241,0.12)',
|
background: 'rgb(var(--x-info-rgb) / 0.12)',
|
||||||
border: '1.5px solid rgba(99,102,241,0.3)',
|
border: '1.5px solid rgb(var(--x-info-rgb) / 0.3)',
|
||||||
color: 'var(--accent)',
|
color: 'var(--accent)',
|
||||||
cursor: 'pointer', fontSize: 13, fontWeight: 700,
|
cursor: 'pointer', fontSize: 13, fontWeight: 700,
|
||||||
}}
|
}}
|
||||||
@@ -1668,15 +1669,15 @@ export default function TableDetailPage() {
|
|||||||
style={{
|
style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 12,
|
display: 'flex', alignItems: 'center', gap: 12,
|
||||||
padding: '10px 14px',
|
padding: '10px 14px',
|
||||||
background: (def.color || '#6295F3') + '22',
|
background: fade(def.color || 'var(--x-info)', 0.13),
|
||||||
border: `1px solid ${def.color || '#6295F3'}`,
|
border: `1px solid ${def.color || 'var(--x-info)'}`,
|
||||||
borderRadius: 12, cursor: 'pointer', textAlign: 'left',
|
borderRadius: 12, cursor: 'pointer', textAlign: 'left',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span style={{ fontSize: 20 }}>{def.emoji || '🏷️'}</span>
|
<span style={{ fontSize: 20 }}>{def.emoji || '🏷️'}</span>
|
||||||
<span style={{ flex: 1, fontSize: 14, fontWeight: 600, color: def.color || '#6295F3' }}>{def.name}</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 || '#6295F3', opacity: 0.6 }}>✕</span>
|
<span style={{ fontSize: 18, color: def.color || 'var(--x-info)', opacity: 0.6 }}>✕</span>
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
@@ -1689,9 +1690,9 @@ export default function TableDetailPage() {
|
|||||||
<span style={{
|
<span style={{
|
||||||
display: 'inline-flex', alignItems: 'center', gap: 6,
|
display: 'inline-flex', alignItems: 'center', gap: 6,
|
||||||
padding: '6px 14px', borderRadius: 20,
|
padding: '6px 14px', borderRadius: 20,
|
||||||
background: order.order_type === 'delivery' ? 'rgba(96,165,250,0.15)' : 'rgba(245,158,11,0.15)',
|
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' ? '#60a5fa55' : '#f59e0b55'}`,
|
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' ? '#93c5fd' : '#fbbf24',
|
color: order.order_type === 'delivery' ? 'var(--x-info-ink)' : 'var(--x-warning)',
|
||||||
fontSize: 13, fontWeight: 700,
|
fontSize: 13, fontWeight: 700,
|
||||||
}}>
|
}}>
|
||||||
{order.order_type === 'delivery' ? '🛵 Delivery' : '🥡 Takeaway'}
|
{order.order_type === 'delivery' ? '🛵 Delivery' : '🥡 Takeaway'}
|
||||||
@@ -1701,7 +1702,7 @@ export default function TableDetailPage() {
|
|||||||
|
|
||||||
{!order && !isStandalone && (
|
{!order && !isStandalone && (
|
||||||
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}>
|
<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}>
|
<button className="btn btn--primary btn--lg" onClick={openOrder}>
|
||||||
{t('detail.openOrder')}
|
{t('detail.openOrder')}
|
||||||
</button>
|
</button>
|
||||||
@@ -1730,9 +1731,9 @@ export default function TableDetailPage() {
|
|||||||
style={{
|
style={{
|
||||||
width: 40, flexShrink: 0,
|
width: 40, flexShrink: 0,
|
||||||
borderRadius: 10, cursor: 'pointer',
|
borderRadius: 10, cursor: 'pointer',
|
||||||
background: editMode ? 'rgba(251,191,36,0.2)' : 'var(--bg2)',
|
background: editMode ? 'rgb(var(--x-warning-rgb) / 0.2)' : 'var(--bg2)',
|
||||||
color: editMode ? '#fbbf24' : 'var(--muted)',
|
color: editMode ? 'var(--x-warning)' : 'var(--muted)',
|
||||||
border: editMode ? '1px solid rgba(251,191,36,0.45)' : '1px solid var(--border)',
|
border: editMode ? '1px solid rgb(var(--x-warning-rgb) / 0.45)' : '1px solid var(--border)',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
transition: 'background 0.15s, color 0.15s',
|
transition: 'background 0.15s, color 0.15s',
|
||||||
}}
|
}}
|
||||||
@@ -1764,7 +1765,7 @@ export default function TableDetailPage() {
|
|||||||
{t('detail.tabs.unpaid')} {activeItems.length > 0 && (
|
{t('detail.tabs.unpaid')} {activeItems.length > 0 && (
|
||||||
<span style={{
|
<span style={{
|
||||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
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,
|
borderRadius: 999, fontSize: 11, fontWeight: 800,
|
||||||
padding: '1px 7px', marginLeft: 4,
|
padding: '1px 7px', marginLeft: 4,
|
||||||
}}>{activeItems.length}</span>
|
}}>{activeItems.length}</span>
|
||||||
@@ -1775,15 +1776,15 @@ export default function TableDetailPage() {
|
|||||||
style={{
|
style={{
|
||||||
flex: 1, padding: '9px 0', border: 'none', cursor: 'pointer',
|
flex: 1, padding: '9px 0', border: 'none', cursor: 'pointer',
|
||||||
fontWeight: 700, fontSize: 13,
|
fontWeight: 700, fontSize: 13,
|
||||||
background: activeTab === 'paid' ? '#14532d' : 'transparent',
|
background: activeTab === 'paid' ? 'var(--x-success-soft)' : 'transparent',
|
||||||
color: activeTab === 'paid' ? '#86efac' : 'var(--muted)',
|
color: activeTab === 'paid' ? 'var(--x-success-ink)' : 'var(--muted)',
|
||||||
transition: 'background 0.15s',
|
transition: 'background 0.15s',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t('detail.tabs.paid')} {paidItems.length > 0 && (
|
{t('detail.tabs.paid')} {paidItems.length > 0 && (
|
||||||
<span style={{
|
<span style={{
|
||||||
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
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,
|
borderRadius: 999, fontSize: 11, fontWeight: 800,
|
||||||
padding: '1px 7px', marginLeft: 4,
|
padding: '1px 7px', marginLeft: 4,
|
||||||
}}>{paidItems.length}</span>
|
}}>{paidItems.length}</span>
|
||||||
@@ -1813,9 +1814,9 @@ export default function TableDetailPage() {
|
|||||||
style={{
|
style={{
|
||||||
width: 40, flexShrink: 0,
|
width: 40, flexShrink: 0,
|
||||||
borderRadius: 10, cursor: 'pointer',
|
borderRadius: 10, cursor: 'pointer',
|
||||||
background: mergeMode !== MERGE_OFF ? 'rgba(99,102,241,0.25)' : 'var(--bg2)',
|
background: mergeMode !== MERGE_OFF ? 'rgb(var(--x-info-rgb) / 0.25)' : 'var(--bg2)',
|
||||||
color: mergeMode !== MERGE_OFF ? '#a5b4fc' : 'var(--muted)',
|
color: mergeMode !== MERGE_OFF ? 'var(--x-info-ink)' : 'var(--muted)',
|
||||||
border: mergeMode !== MERGE_OFF ? '1px solid rgba(99,102,241,0.45)' : '1px solid var(--border)',
|
border: mergeMode !== MERGE_OFF ? '1px solid rgb(var(--x-info-rgb) / 0.45)' : '1px solid var(--border)',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
||||||
transition: 'background 0.15s, color 0.15s',
|
transition: 'background 0.15s, color 0.15s',
|
||||||
}}
|
}}
|
||||||
@@ -1862,7 +1863,7 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
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',
|
border: 'none', cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -1876,7 +1877,7 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
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',
|
border: 'none', cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -1890,8 +1891,8 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
background: 'rgba(34,197,94,0.22)', color: '#4ade80',
|
background: 'rgb(var(--x-success-rgb) / 0.22)', color: 'var(--x-success)',
|
||||||
border: '1px solid rgba(34,197,94,0.3)',
|
border: '1px solid rgb(var(--x-success-rgb) / 0.3)',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -1908,7 +1909,7 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
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',
|
border: 'none', cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -1921,7 +1922,7 @@ export default function TableDetailPage() {
|
|||||||
{activeTab === 'paid' && (
|
{activeTab === 'paid' && (
|
||||||
<div style={{ padding: '8px 0' }}>
|
<div style={{ padding: '8px 0' }}>
|
||||||
{paidItems.length === 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')}
|
{t('detail.noPaid')}
|
||||||
</p>
|
</p>
|
||||||
) : (
|
) : (
|
||||||
@@ -1952,7 +1953,7 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
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',
|
border: 'none', cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -1964,8 +1965,8 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
background: 'rgba(34,197,94,0.22)', color: '#4ade80',
|
background: 'rgb(var(--x-success-rgb) / 0.22)', color: 'var(--x-success)',
|
||||||
border: '1px solid rgba(34,197,94,0.3)',
|
border: '1px solid rgb(var(--x-success-rgb) / 0.3)',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -1990,7 +1991,7 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
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',
|
border: 'none', cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -2003,8 +2004,8 @@ export default function TableDetailPage() {
|
|||||||
display: 'inline-flex', alignItems: 'center',
|
display: 'inline-flex', alignItems: 'center',
|
||||||
height: 36, padding: '0 14px',
|
height: 36, padding: '0 14px',
|
||||||
borderRadius: 999,
|
borderRadius: 999,
|
||||||
background: 'rgba(251,191,36,0.15)', color: '#fbbf24',
|
background: 'rgb(var(--x-warning-rgb) / 0.15)', color: 'var(--x-warning)',
|
||||||
border: '1px solid rgba(251,191,36,0.25)',
|
border: '1px solid rgb(var(--x-warning-rgb) / 0.25)',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
fontSize: 13, fontWeight: 700, letterSpacing: 0.5,
|
||||||
}}
|
}}
|
||||||
@@ -2044,7 +2045,7 @@ export default function TableDetailPage() {
|
|||||||
<span>€ PAY</span>
|
<span>€ PAY</span>
|
||||||
{selectedIds.length > 0 && (
|
{selectedIds.length > 0 && (
|
||||||
<span style={{
|
<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,
|
borderRadius: 999, fontSize: 11, fontWeight: 700,
|
||||||
padding: '1px 7px',
|
padding: '1px 7px',
|
||||||
}}>{selectedIds.length}</span>
|
}}>{selectedIds.length}</span>
|
||||||
@@ -2098,18 +2099,18 @@ export default function TableDetailPage() {
|
|||||||
>
|
>
|
||||||
<div style={{
|
<div style={{
|
||||||
width: 36, height: 36, borderRadius: '50%', flexShrink: 0,
|
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',
|
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 && (
|
{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"/>
|
<path d="M20 6L9 17l-5-5"/>
|
||||||
</svg>
|
</svg>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ flex: 1, minWidth: 0 }}>
|
<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 style={{ fontSize: 12, color: 'var(--muted)' }}>{desc}</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -2259,7 +2260,7 @@ export default function TableDetailPage() {
|
|||||||
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
<div className="modal-sheet" onClick={e => e.stopPropagation()}>
|
||||||
<div className="modal-handle" />
|
<div className="modal-handle" />
|
||||||
<h2 className="modal-title">{t('detail.revert.title')}</h2>
|
<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
|
{revertConfirm.itemIds.length === 1
|
||||||
? t('detail.revert.items', { count: 1 })
|
? t('detail.revert.items', { count: 1 })
|
||||||
: t('detail.revert.items', { count: revertConfirm.itemIds.length })}
|
: 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-sheet" onClick={e => e.stopPropagation()}>
|
||||||
<div className="modal-handle" />
|
<div className="modal-handle" />
|
||||||
<h2 className="modal-title">{t('detail.close.title')}</h2>
|
<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')}
|
{t('detail.close.body')}
|
||||||
</p>
|
</p>
|
||||||
<div style={{ display: 'flex', gap: 12 }}>
|
<div style={{ display: 'flex', gap: 12 }}>
|
||||||
@@ -2381,7 +2382,7 @@ export default function TableDetailPage() {
|
|||||||
: pendingTable.mode === 'merge' ? t('detail.move.confirmMerge')
|
: pendingTable.mode === 'merge' ? t('detail.move.confirmMerge')
|
||||||
: t('detail.move.confirmItems')}
|
: t('detail.move.confirmItems')}
|
||||||
</h2>
|
</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 === 'transfer' ? t('detail.move.transferTo')
|
||||||
: pendingTable.mode === 'merge' ? t('detail.move.mergeWith')
|
: pendingTable.mode === 'merge' ? t('detail.move.mergeWith')
|
||||||
: t('detail.move.itemsTo', { count: selectedIds.length })}
|
: t('detail.move.itemsTo', { count: selectedIds.length })}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import client from '../api/client'
|
|||||||
import { getVenueSettings } from '../api/venueSettings'
|
import { getVenueSettings } from '../api/venueSettings'
|
||||||
import db from '../db/posdb'
|
import db from '../db/posdb'
|
||||||
import { FlagsIcon, TransferIcon, MergeIcon, PrintIcon, WaiterIcon } from '../components/Icons'
|
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' }
|
const _UNIT_LABELS = { kg: 'kg', liter: 'L', gram: 'g', ml: 'mL' }
|
||||||
@@ -44,11 +45,11 @@ function CheckIcon({ width = 18, height = 18 }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QUICK_ACTIONS = [
|
const QUICK_ACTIONS = [
|
||||||
{ Icon: FlagsIcon, label: 'tables.actions.flags', key: 'flags', color: '#fac823', iconBg: 'rgba(251,191,36,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: '#6099db', iconBg: 'rgba(96,165,250,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: '#6099db', iconBg: 'rgba(96,165,250,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: '#cbd5e1', iconBg: 'rgba(148,163,184,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: '#39b861', iconBg: 'rgba(34,197,94,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 }) {
|
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>
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 14 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 14 }}>
|
||||||
<span style={{ color: 'var(--muted)' }}>{t('tables.quick.paid')}</span>
|
<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>
|
</div>
|
||||||
{due > 0 && (
|
{due > 0 && (
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 14 }}>
|
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 14 }}>
|
||||||
<span style={{ color: 'var(--muted)' }}>{t('tables.quick.due')}</span>
|
<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>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -98,12 +99,12 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
|||||||
{flags.map(f => (
|
{flags.map(f => (
|
||||||
<div key={f.id} style={{
|
<div key={f.id} style={{
|
||||||
display: 'flex', alignItems: 'center', gap: 6,
|
display: 'flex', alignItems: 'center', gap: 6,
|
||||||
background: (f.color || '#6295F3') + '22',
|
background: fade(f.color || 'var(--x-info)', 0.13),
|
||||||
border: `1px solid ${f.color || '#6295F3'}`,
|
border: `1px solid ${f.color || 'var(--x-info)'}`,
|
||||||
borderRadius: 20, padding: '4px 10px',
|
borderRadius: 20, padding: '4px 10px',
|
||||||
}}>
|
}}>
|
||||||
<span style={{ fontSize: 14 }}>{f.emoji || '🏷️'}</span>
|
<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>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -148,10 +149,10 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
|||||||
cursor: disabled ? 'not-allowed' : 'pointer',
|
cursor: disabled ? 'not-allowed' : 'pointer',
|
||||||
opacity: disabled ? 0.35 : 1, textAlign: 'left',
|
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" />
|
<CheckIcon width="18" height="18" />
|
||||||
</span>
|
</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>
|
</button>
|
||||||
)
|
)
|
||||||
})()}
|
})()}
|
||||||
@@ -159,7 +160,7 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
|||||||
{(() => {
|
{(() => {
|
||||||
const hasActiveItems = activeItems.length > 0
|
const hasActiveItems = activeItems.length > 0
|
||||||
const disabled = !order || !hasActiveItems
|
const disabled = !order || !hasActiveItems
|
||||||
const colour = canCancel && !disabled ? '#ef4444' : 'var(--muted)'
|
const colour = canCancel && !disabled ? 'var(--x-danger)' : 'var(--muted)'
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
disabled={!canCancel || disabled}
|
disabled={!canCancel || disabled}
|
||||||
@@ -170,7 +171,7 @@ function TableQuickModal({ table, order, flags, onClose, onNavigate, onAction, o
|
|||||||
cursor: canCancel && !disabled ? 'pointer' : 'not-allowed',
|
cursor: canCancel && !disabled ? 'pointer' : 'not-allowed',
|
||||||
opacity: canCancel && !disabled ? 1 : 0.35, textAlign: 'left',
|
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">
|
<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"/>
|
<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>
|
</svg>
|
||||||
@@ -745,11 +746,11 @@ export default function TableListPage() {
|
|||||||
style={{
|
style={{
|
||||||
position: 'fixed', bottom: 84, right: 24,
|
position: 'fixed', bottom: 84, right: 24,
|
||||||
width: 52, height: 52, borderRadius: '50%', border: 'none',
|
width: 52, height: 52, borderRadius: '50%', border: 'none',
|
||||||
background: hasActiveFilters ? 'var(--accent-dim,#92400e)' : 'var(--accent,#f59e0b)',
|
background: hasActiveFilters ? 'var(--accent-dim,var(--x-warning))' : 'var(--accent,var(--x-warning))',
|
||||||
color: hasActiveFilters ? '#fde68a' : 'var(--accent-fg,#1c1000)',
|
color: hasActiveFilters ? 'var(--x-warning-ink)' : 'var(--accent-fg,rgb(var(--x-scrim-rgb) / 1))',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
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',
|
zIndex: 40, transition: 'background 0.12s',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -757,7 +758,7 @@ export default function TableListPage() {
|
|||||||
{hasActiveFilters && (
|
{hasActiveFilters && (
|
||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: 0, right: 0,
|
position: 'absolute', top: 0, right: 0,
|
||||||
background: '#ef4444', color: '#fff',
|
background: 'var(--x-danger)', color: 'var(--x-danger-fg)',
|
||||||
fontSize: 9, fontWeight: 800,
|
fontSize: 9, fontWeight: 800,
|
||||||
borderRadius: '50%', width: 16, height: 16,
|
borderRadius: '50%', width: 16, height: 16,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
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>
|
<p style={{ fontSize: 14, color: 'var(--muted)', marginBottom: 20 }}>{t('tables.cancelConfirmBody')}</p>
|
||||||
<div style={{ display: 'flex', gap: 10 }}>
|
<div style={{ display: 'flex', gap: 10 }}>
|
||||||
<button className="btn btn--secondary" style={{ flex: 1 }} onClick={() => setCancelConfirm(null)}>{t('common.cancel')}</button>
|
<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>
|
</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"/>
|
<rect x="14" y="14" width="7" height="7" rx="1.5" fill="currentColor"/>
|
||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
color: '#94a3b8', activeBg: '#334155', activeColor: '#e2e8f0',
|
color: 'var(--x-ink-2)', activeBg: 'var(--x-surface-3)', activeColor: 'var(--x-ink)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'pending',
|
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"/>
|
<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>
|
</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',
|
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"/>
|
<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>
|
</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',
|
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"/>
|
<path d="M7 12l3.5 3.5L17 8" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/>
|
||||||
</svg>
|
</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',
|
key: 'ready_items',
|
||||||
@@ -884,14 +885,14 @@ const KDS_FILTER_CHIPS = [
|
|||||||
<path d="M12 2a10 10 0 0 0 0 20V2z" fill="currentColor"/>
|
<path d="M12 2a10 10 0 0 0 0 20V2z" fill="currentColor"/>
|
||||||
</svg>
|
</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 = {
|
const KDS_ITEM_COLORS = {
|
||||||
pending: { textColor: '#f59e0b', label: 'kds.pending' },
|
pending: { textColor: 'var(--x-warning)', label: 'kds.pending' },
|
||||||
preparing: { textColor: '#60a5fa', label: 'kds.preparing' },
|
preparing: { textColor: 'var(--x-info)', label: 'kds.preparing' },
|
||||||
done: { textColor: '#4ade80', label: 'kds.ready' },
|
done: { textColor: 'var(--x-success)', label: 'kds.ready' },
|
||||||
served: { textColor: null, label: null },
|
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 preparing = items.filter(i => kds(i.kds_status) === 'preparing').length
|
||||||
const done = items.filter(i => kds(i.kds_status) === 'done').length
|
const done = items.filter(i => kds(i.kds_status) === 'done').length
|
||||||
const total = items.length
|
const total = items.length
|
||||||
if (done === total) return { label: t('kds.ready'), color: '#4ade80', bg: 'rgba(34,197,94,0.15)' }
|
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: '#60a5fa', bg: 'rgba(96,165,250,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: '#f59e0b', bg: 'rgba(245,158,11,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: '#4ade80', bg: 'rgba(34,197,94,0.12)' }
|
return { label: t('kds.someReady', { done, total }), color: 'var(--x-success)', bg: 'rgb(var(--x-success-rgb) / 0.12)' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count per filter for badge
|
// 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>}
|
{showIcon && <span style={{ display: 'inline-flex', alignItems: 'center', flexShrink: 0 }}>{chip.icon}</span>}
|
||||||
{showText && <span style={{ lineHeight: 1 }}>{textLabel}</span>}
|
{showText && <span style={{ lineHeight: 1 }}>{textLabel}</span>}
|
||||||
<span style={{
|
<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)',
|
color: active ? chip.activeColor : 'var(--muted)',
|
||||||
borderRadius: 10, fontSize: 11, fontWeight: 800,
|
borderRadius: 10, fontSize: 11, fontWeight: 800,
|
||||||
padding: '1px 6px', lineHeight: 1,
|
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,
|
height: 20, padding: '0 8px', borderRadius: 4,
|
||||||
background: kdsLabel.bg, color: kdsLabel.color,
|
background: kdsLabel.bg, color: kdsLabel.color,
|
||||||
fontSize: 10, fontWeight: 800, letterSpacing: 0.3,
|
fontSize: 10, fontWeight: 800, letterSpacing: 0.3,
|
||||||
border: `1px solid ${kdsLabel.color}40`,
|
border: `1px solid ${fade(kdsLabel.color, 0.25)}`,
|
||||||
}}>{kdsLabel.label}</span>
|
}}>{kdsLabel.label}</span>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -1204,7 +1205,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
|||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 9, fontWeight: 800, color: kdsC.textColor,
|
fontSize: 9, fontWeight: 800, color: kdsC.textColor,
|
||||||
borderRadius: 3, padding: '1px 5px',
|
borderRadius: 3, padding: '1px 5px',
|
||||||
border: `1px solid ${kdsC.textColor}60`,
|
border: `1px solid ${fade(kdsC.textColor, 0.38)}`,
|
||||||
}}>{t(kdsC.label)}</span>
|
}}>{t(kdsC.label)}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -1225,7 +1226,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
|||||||
onClick={() => onMarkAllServed(o.id)}
|
onClick={() => onMarkAllServed(o.id)}
|
||||||
style={{
|
style={{
|
||||||
flex: 1, height: 34, borderRadius: 8, border: 'none',
|
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',
|
fontSize: 13, fontWeight: 700, cursor: 'pointer',
|
||||||
}}
|
}}
|
||||||
>{t('orders.markServed')}</button>
|
>{t('orders.markServed')}</button>
|
||||||
@@ -1244,11 +1245,11 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
|||||||
style={{
|
style={{
|
||||||
position: 'fixed', bottom: 84, right: 24,
|
position: 'fixed', bottom: 84, right: 24,
|
||||||
width: 52, height: 52, borderRadius: '50%', border: 'none',
|
width: 52, height: 52, borderRadius: '50%', border: 'none',
|
||||||
background: hasActiveOrderFilters ? 'var(--accent-dim,#92400e)' : 'var(--accent,#f59e0b)',
|
background: hasActiveOrderFilters ? 'var(--accent-dim,var(--x-warning))' : 'var(--accent,var(--x-warning))',
|
||||||
color: hasActiveOrderFilters ? '#fde68a' : 'var(--accent-fg,#1c1000)',
|
color: hasActiveOrderFilters ? 'var(--x-warning-ink)' : 'var(--accent-fg,rgb(var(--x-scrim-rgb) / 1))',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
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',
|
zIndex: 40, transition: 'background 0.12s',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -1256,7 +1257,7 @@ function OrdersView({ orders, allOrders, tables, filter, setFilter, myOnly, setM
|
|||||||
{hasActiveOrderFilters && (
|
{hasActiveOrderFilters && (
|
||||||
<span style={{
|
<span style={{
|
||||||
position: 'absolute', top: 0, right: 0,
|
position: 'absolute', top: 0, right: 0,
|
||||||
background: '#ef4444', color: '#fff',
|
background: 'var(--x-danger)', color: 'var(--x-danger-fg)',
|
||||||
fontSize: 9, fontWeight: 800,
|
fontSize: 9, fontWeight: 800,
|
||||||
borderRadius: '50%', width: 16, height: 16,
|
borderRadius: '50%', width: 16, height: 16,
|
||||||
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
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 total = [...activeItems, ...paidItems].reduce((s, i) => s + (i.unit_price + (i.price_adjustment || 0)) * i.quantity, 0)
|
||||||
|
|
||||||
const statusColor = {
|
const statusColor = {
|
||||||
open: '#f59e0b',
|
open: 'var(--x-warning)',
|
||||||
partially_paid: '#60a5fa',
|
partially_paid: 'var(--x-info)',
|
||||||
paid: '#4ade80',
|
paid: 'var(--x-success)',
|
||||||
}[order.status] || '#94a3b8'
|
}[order.status] || 'var(--x-ink-2)'
|
||||||
|
|
||||||
const kds = order.kds_status || 'pending'
|
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 (
|
return (
|
||||||
<div
|
<div
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
style={{
|
style={{
|
||||||
background: 'var(--bg2)',
|
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,
|
borderRadius: 14,
|
||||||
padding: '12px 14px',
|
padding: '12px 14px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
@@ -1322,9 +1323,9 @@ function StandaloneOrderCard({ order, onClick }) {
|
|||||||
position: 'absolute', top: 8, right: 8,
|
position: 'absolute', top: 8, right: 8,
|
||||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.5,
|
fontSize: 9, fontWeight: 800, letterSpacing: 0.5,
|
||||||
padding: '2px 7px', borderRadius: 6,
|
padding: '2px 7px', borderRadius: 6,
|
||||||
background: isDelivery ? 'rgba(96,165,250,0.18)' : 'rgba(245,158,11,0.18)',
|
background: isDelivery ? 'rgb(var(--x-info-rgb) / 0.18)' : 'rgb(var(--x-warning-rgb) / 0.18)',
|
||||||
color: isDelivery ? '#93c5fd' : '#fbbf24',
|
color: isDelivery ? 'var(--x-info-ink)' : 'var(--x-warning)',
|
||||||
border: `1px solid ${isDelivery ? '#60a5fa44' : '#f59e0b44'}`,
|
border: `1px solid ${isDelivery ? 'rgb(var(--x-info-rgb) / 0.27)' : 'rgb(var(--x-warning-rgb) / 0.27)'}`,
|
||||||
}}>
|
}}>
|
||||||
{isDelivery ? 'DELIVERY' : 'TAKEAWAY'}
|
{isDelivery ? 'DELIVERY' : 'TAKEAWAY'}
|
||||||
</span>
|
</span>
|
||||||
@@ -1339,8 +1340,8 @@ function StandaloneOrderCard({ order, onClick }) {
|
|||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
||||||
padding: '2px 6px', borderRadius: 4,
|
padding: '2px 6px', borderRadius: 4,
|
||||||
background: `${statusColor}22`, color: statusColor,
|
background: `${fade(statusColor, 0.13)}`, color: statusColor,
|
||||||
border: `1px solid ${statusColor}44`,
|
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()}
|
{{ open: t('card.open'), partially_paid: t('card.partlyPaid'), paid: t('card.paid') }[order.status] || order.status.toUpperCase()}
|
||||||
</span>
|
</span>
|
||||||
@@ -1348,8 +1349,8 @@ function StandaloneOrderCard({ order, onClick }) {
|
|||||||
<span style={{
|
<span style={{
|
||||||
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
fontSize: 9, fontWeight: 800, letterSpacing: 0.3,
|
||||||
padding: '2px 6px', borderRadius: 4,
|
padding: '2px 6px', borderRadius: 4,
|
||||||
background: `${kdsColor}22`, color: kdsColor,
|
background: `${fade(kdsColor, 0.13)}`, color: kdsColor,
|
||||||
border: `1px solid ${kdsColor}44`,
|
border: `1px solid ${fade(kdsColor, 0.27)}`,
|
||||||
}}>
|
}}>
|
||||||
{{ pending: t('kds.pending'), preparing: t('kds.preparing'), done: t('kds.ready') }[kds] || kds.toUpperCase()}
|
{{ pending: t('kds.pending'), preparing: t('kds.preparing'), done: t('kds.ready') }[kds] || kds.toUpperCase()}
|
||||||
</span>
|
</span>
|
||||||
@@ -1372,8 +1373,8 @@ function NewStandaloneCard({ label, color, icon, onClick }) {
|
|||||||
<div
|
<div
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
style={{
|
style={{
|
||||||
background: `${color}0f`,
|
background: `${fade(color, 0.06)}`,
|
||||||
border: `2px dashed ${color}55`,
|
border: `2px dashed ${fade(color, 0.33)}`,
|
||||||
borderRadius: 14,
|
borderRadius: 14,
|
||||||
padding: '12px 14px',
|
padding: '12px 14px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
@@ -1411,13 +1412,13 @@ function StandaloneView({ orders, gridCols, navigate }) {
|
|||||||
{/* Fixed action cards always at top */}
|
{/* Fixed action cards always at top */}
|
||||||
<NewStandaloneCard
|
<NewStandaloneCard
|
||||||
label={t('orders.newTakeaway')}
|
label={t('orders.newTakeaway')}
|
||||||
color="#f59e0b"
|
color="var(--x-warning)"
|
||||||
icon="🥡"
|
icon="🥡"
|
||||||
onClick={() => navigate('/standalone/takeaway/add?new=1')}
|
onClick={() => navigate('/standalone/takeaway/add?new=1')}
|
||||||
/>
|
/>
|
||||||
<NewStandaloneCard
|
<NewStandaloneCard
|
||||||
label={t('orders.newDelivery')}
|
label={t('orders.newDelivery')}
|
||||||
color="#60a5fa"
|
color="var(--x-info)"
|
||||||
icon="🛵"
|
icon="🛵"
|
||||||
onClick={() => navigate('/standalone/delivery/add?new=1')}
|
onClick={() => navigate('/standalone/delivery/add?new=1')}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// Plan step 4.6 (CS-16): the waiter's colours are @xenia/ui tokens (var(--x-…) or the app's
|
||||||
|
// --bg / --text / --accent… made of them), so light / dark and the venue's colour reach every
|
||||||
|
// screen. No colour value may be written in the app's code; a colour that isn't a token yet
|
||||||
|
// becomes one in packages/ui/src/tokens.css. Colours the venue stores are data, not styling:
|
||||||
|
// the table-card palette's defaults (store/tableColourStore.js) are the one exception.
|
||||||
|
import { test } from 'node:test'
|
||||||
|
import assert from 'node:assert/strict'
|
||||||
|
import { readdirSync, readFileSync, statSync } from 'node:fs'
|
||||||
|
import path from 'node:path'
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
|
||||||
|
const SRC = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'src')
|
||||||
|
const DATA = new Set(['store/tableColourStore.js'])
|
||||||
|
const COLOUR = [
|
||||||
|
/(^|[^\w&])#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3})?(?:[0-9a-fA-F]{2})?\b/, // #fff, #f59e0b, #f59e0b40
|
||||||
|
/\brgba?\(\s*\d/, // rgb(245, 158, 11)
|
||||||
|
/\bhsla?\(\s*\d/,
|
||||||
|
/['"](white|black)['"]/, // named colours as values
|
||||||
|
/var\(--[\w-]+\)[0-9a-fA-F]{2}\b/, // 'var(--accent)18': invalid CSS
|
||||||
|
]
|
||||||
|
|
||||||
|
function walk(dir, out = []) {
|
||||||
|
for (const name of readdirSync(dir)) {
|
||||||
|
const p = path.join(dir, name)
|
||||||
|
if (statSync(p).isDirectory()) walk(p, out)
|
||||||
|
else if (/\.(jsx?|css)$/.test(name)) out.push(p)
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
test('no colour literal in the waiter app (tokens only)', () => {
|
||||||
|
const hits = []
|
||||||
|
for (const file of walk(SRC)) {
|
||||||
|
const rel = path.relative(SRC, file).split(path.sep).join('/')
|
||||||
|
if (DATA.has(rel)) continue
|
||||||
|
readFileSync(file, 'utf8').split('\n').forEach((line, i) => {
|
||||||
|
if (COLOUR.some(re => re.test(line))) hits.push(`${rel}:${i + 1}: ${line.trim().slice(0, 90)}`)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
assert.deepEqual(hits, [], `colour values in app code — use a token (var(--x-…)):\n${hits.join('\n')}`)
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user