// Visual check page for @xenia/ui (plan step 2.3). Dev builds only: the manager mounts
// it at /ui-gallery under `import.meta.env.DEV` (moves to the terminal dev build in 3.1).
// Sets data-theme / data-venue-theme on while open and restores them on leave.
import { useEffect, useState } from 'react'
import {
Button, Dialog, EmptyState, Field, IconButton, InfoTip, Input, PinPad, Select, Sheet,
Spinner, Switch, Textarea, ToastProvider, useToast,
} from '../src/index.js'
import '../src/styles.css'
const THEMES = ['light', 'dark', 'system']
const VENUES = ['teal', 'amber', 'blue', 'violet', 'rose']
const Plus = () => (
)
const Trash = () => (
)
const Inbox = () => (
)
const page = {
minHeight: '100vh', background: 'var(--x-canvas)', color: 'var(--x-ink)',
fontFamily: 'var(--x-font-sans)', fontSize: 'var(--x-text-body)', padding: 'var(--x-space-6)',
}
const card = {
background: 'var(--x-surface)', border: '1px solid var(--x-line)', borderRadius: 'var(--x-radius-card)',
boxShadow: 'var(--x-shadow-raised)', padding: 'var(--x-space-6)', marginBottom: 'var(--x-space-6)',
}
const row = { display: 'flex', flexWrap: 'wrap', gap: 'var(--x-space-3)', alignItems: 'center' }
const h2 = { margin: '0 0 var(--x-space-4)', fontSize: 'var(--x-text-title)', fontWeight: 600 }
function Section({ title, children }) {
return
}
function Demo() {
const toast = useToast()
const [theme, setTheme] = useState('light')
const [venue, setVenue] = useState('teal')
const [dialog, setDialog] = useState(false)
const [locked, setLocked] = useState(false)
const [sheet, setSheet] = useState(null)
const [on, setOn] = useState(true)
const [off, setOff] = useState(false)
const [name, setName] = useState('')
const [lang, setLang] = useState('el')
const [pinError, setPinError] = useState('')
const [unlocked, setUnlocked] = useState('')
useEffect(() => {
const html = document.documentElement
const before = [html.getAttribute('data-theme'), html.getAttribute('data-venue-theme')]
html.setAttribute('data-theme', theme)
html.setAttribute('data-venue-theme', venue)
return () => {
before[0] == null ? html.removeAttribute('data-theme') : html.setAttribute('data-theme', before[0])
before[1] == null ? html.removeAttribute('data-venue-theme') : html.setAttribute('data-venue-theme', before[1])
}
}, [theme, venue])
const checkPin = pin => new Promise((resolve, reject) => setTimeout(() => {
if (pin === '1234') { setPinError(''); setUnlocked(`Unlocked at ${new Date().toLocaleTimeString()}`); resolve() }
else { setPinError('Wrong PIN'); reject(new Error('wrong')) }
}, 500))
return (
@xenia/ui gallery
setTheme(e.target.value)} options={THEMES.map(t => ({ value: t, label: `Theme: ${t}` }))} />
setVenue(e.target.value)} options={VENUES.map(v => ({ value: v, label: `Venue: ${v}` }))} />
Primary
Secondary
Ghost
}>Delete
Saving
Disabled
}>Small
Large
Alert after How many failed print attempts before managers are notified. 0 turns the alert off.
} title="No online orders yet" description="New orders from the QR menu appear here." action={Menu settings } />
)
}
export default function Gallery() {
return
}