feat(products): every menu text per language, the editor's language picker, service item dialog
- Alembic 0042: a `translations` column on every choice (groups, quick options, extras, ingredients, preference sets and choices; sub-choices and shared sub-sets in their JSON); the texts typed so far become the text in their language (Greek letters → el, else the venue's); the product's old quick map moves onto the quick options. API, catalogue bundle and the cloud's quick option names carry them; names are checked before anything is replaced. - Editor: a language picker beside the close button (Default = the venue's language, plus every menu language) drives every name and description, left and right; an empty language shows what is used instead as its placeholder. The shown name is the venue language's, else any (never mixed). - Choices: one name field; the shared controls at one height (heart red when on, several / compact… chips coloured when on, delete red on hover); "+ Preference" at the right end of the tab strip; preference groups made inside a preference. - Categories: the shared dropdown to add one; the category dialog per language. - The service item switch is gone: "New service item" opens its own small dialog. - UI: Dialog headerEnd; a toned toggle keeps its colour while pressed. - Tests: backend (choice names, migration 0042), access, editor logic, e2e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,8 @@
|
||||
.x-btn--tone { color: var(--x-ink-2); }
|
||||
.x-btn--tone:hover:not(:disabled), .x-btn--tone:focus-visible { color: rgb(var(--x-tone-ink)); }
|
||||
.x-btn--icon.x-btn--tone { background: var(--x-surface-2); }
|
||||
/* a toned toggle that is on (a favourite's heart) keeps its colour */
|
||||
.x-btn--tone[aria-pressed="true"] { color: rgb(var(--x-tone-ink)); }
|
||||
.x-btn--icon.x-btn--tone:hover:not(:disabled) { background: var(--x-surface-3); }
|
||||
.x-btn--tone-danger { --x-tone: var(--x-danger-rgb); --x-tone-soft: var(--x-danger-soft-rgb); --x-tone-ink: var(--x-danger-ink-rgb); }
|
||||
.x-btn--tone-warning { --x-tone: var(--x-warning-rgb); --x-tone-soft: var(--x-warning-soft-rgb); --x-tone-ink: var(--x-warning-ink-rgb); }
|
||||
@@ -124,6 +126,7 @@
|
||||
.x-modal__titles { flex: 1; min-width: 0; padding-top: var(--x-space-1-5); }
|
||||
.x-modal__title { margin: 0; font-size: var(--x-text-title); line-height: var(--x-leading-title); font-weight: var(--x-weight-semibold); }
|
||||
.x-modal__description { margin: var(--x-space-1) 0 0; font-size: var(--x-text-body); line-height: var(--x-leading-body); color: var(--x-ink-2); }
|
||||
.x-modal__header-end { flex-shrink: 0; display: flex; align-items: center; gap: var(--x-space-2); }
|
||||
.x-modal__close { margin: calc(-1 * var(--x-space-1)) calc(-1 * var(--x-space-1)) 0 0; }
|
||||
.x-modal__toolbar { flex-shrink: 0; padding: var(--x-space-2) var(--x-space-6) var(--x-space-3); border-bottom: var(--x-border-width) solid var(--x-line); }
|
||||
.x-modal__body {
|
||||
|
||||
@@ -13,7 +13,7 @@ const CloseIcon = () => (
|
||||
|
||||
/** The shared body of Dialog and Sheet: backdrop, panel, header with ×, toolbar, body, footer. */
|
||||
export function ModalFrame({
|
||||
open, onClose, title, description, toolbar, children, footer,
|
||||
open, onClose, title, description, headerEnd, toolbar, children, footer,
|
||||
dismissible = true, closeLabel, initialFocus,
|
||||
overlayClass, panelClass, grip = false, bodyClass,
|
||||
}) {
|
||||
@@ -41,12 +41,14 @@ export function ModalFrame({
|
||||
className={panelClass}
|
||||
>
|
||||
{grip && <div className="x-sheet__grip" aria-hidden="true" />}
|
||||
{(title || description || showClose) && (
|
||||
{(title || description || showClose || headerEnd) && (
|
||||
<div className="x-modal__header">
|
||||
<div className="x-modal__titles">
|
||||
{title && <h2 id={titleId} className="x-modal__title">{title}</h2>}
|
||||
{description && <p id={descId} className="x-modal__description">{description}</p>}
|
||||
</div>
|
||||
{/* headerEnd: beside the close button (a language picker…) */}
|
||||
{headerEnd && <div className="x-modal__header-end">{headerEnd}</div>}
|
||||
{showClose && (
|
||||
<IconButton label={closeLabel ?? labels.close} size="sm" className="x-modal__close" onClick={onClose} data-x-autofocus-skip="">
|
||||
<CloseIcon />
|
||||
|
||||
Reference in New Issue
Block a user