feat(signage): look rows that wrap, one colour field with opacity, badges' text, several widgets per stack part, pages up to 2200 px (owner review 4)

- Menu text look: each field names its part ("Headings size"), rows wrap in aligned columns on
  alternating bands; names align left / right; line and letter spacing as lists (Auto default);
  each field changes only itself (followers frozen before the other changes); badge colour +
  badge text colour (auto: readableOn); "Reset the look" with a question.
- ColourField everywhere in signage: a Popover panel (new @xenia/ui Popover, portal, kept in the
  window) with 12 presets, picker, opacity (#rrggbbaa) and typed code; HEX accepts 8 digits.
- Stacks: Cell.widgets (a stored `widget` still reads), several widgets per part laid across the
  stack's direction; extras by path stack.part.place; Add a widget adds, each removable / ordered.
- Page rule: --x-page-max is 2200px (no longer follows the window height).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 12:53:14 +02:00
co-authored by Claude Opus 5.5
parent e8c8ec825e
commit aaa0914778
22 changed files with 663 additions and 281 deletions
+47 -17
View File
@@ -1527,16 +1527,19 @@
"column": "Το ένα κάτω από το άλλο",
"parts": "Πόσα",
"even": "Ίση μοιρασιά",
"shows": "Δείχνει",
"nothing": "Τίποτα",
"aSlide": "Μια διαφάνεια από τις Διαφάνειες",
"slide": "Διαφάνεια",
"noSlides": "Δεν υπάρχουν ακόμα διαφάνειες",
"barHint": "Σύρετε τις γραμμές ανάμεσα στα τμήματα για να αλλάξετε το μέγεθός τους (ή εστιάστε σε μια γραμμή και χρησιμοποιήστε τα βελάκια).",
"barHint": "Σύρετε τις γραμμές ανάμεσα στα τμήματα για το μέγεθός τους (ή εστιάστε σε μια γραμμή και χρησιμοποιήστε τα βελάκια). Τα widgets ενός τμήματος μπαίνουν το ένα κάτω από το άλλο.",
"partTitle": "Τμήμα {{n}}",
"line": "Η γραμμή ανάμεσα στα τμήματα {{a}} και {{b}}",
"add": "Προσθήκη widget",
"replace": "Κάτι άλλο"
"barHintColumn": "Σύρετε τις γραμμές ανάμεσα στα τμήματα για το μέγεθός τους (ή εστιάστε σε μια γραμμή και χρησιμοποιήστε τα βελάκια). Τα widgets ενός τμήματος μπαίνουν δίπλα-δίπλα.",
"aSlideInstead": "Μια διαφάνεια από τις Διαφάνειες (αντί για τα widgets)",
"removeSlide": "Αφαίρεση της διαφάνειας από αυτό το τμήμα",
"removeWidget": "Αφαίρεση αυτού του widget",
"before": "Μετακίνηση πριν",
"after": "Μετακίνηση μετά"
}
},
"tabs": {
@@ -1673,21 +1676,10 @@
"kept": "Κρατήθηκε στις Διαφάνειες."
},
"look": {
"headings": "Επικεφαλίδες",
"names": "Ονόματα προϊόντων",
"prices": "Τιμές",
"dots": "Τελείες",
"spacing": "Αποστάσεις",
"size": "Μέγεθος",
"colour": "Χρώμα",
"font": "Γραμματοσειρά",
"style": "Στυλ",
"align": "Στοίχιση",
"sameFont": "Όπως τα ονόματα",
"bold": "Έντονα",
"italic": "Πλάγια",
"underline": "Υπογράμμιση",
"dotStyle": "Γραμμή",
"dotStyles": {
"dotted": "Τελείες",
"dashed": "Παύλες",
@@ -1704,8 +1696,46 @@
"rounded": "Στρογγυλεμένο",
"round": "Στρογγυλό"
},
"accent": "Σήματα και τελείες σελίδων",
"hint": "Τα ονόματα προϊόντων ορίζουν το μέγεθος, το χρώμα και τη γραμματοσειρά του πίνακα· οι επικεφαλίδες και οι τιμές τα ακολουθούν (στο χρώμα έμφασης) μέχρι να αλλάξετε τα δικά τους. Με στοίχιση δεξιά τα ονόματα τελειώνουν στο ίδιο σημείο, με ίσες τελείες πριν τις τιμές. Διάστιχο: π.χ. 1.3 (× το κείμενο)· απόσταση γραμμάτων: π.χ. 0.05 (ενός γράμματος)· κενό = αυτόματο."
"hint": "Κάθε πεδίο αλλάζει μόνο τον εαυτό του. Οι επικεφαλίδες και οι τιμές ξεκινούν με το μέγεθος και τη γραμματοσειρά των ονομάτων («Όπως τα ονόματα»). Το χρώμα των σημάτων χρωματίζει και τις τελείες σελίδας. Τα ονόματα με δεξιά στοίχιση τελειώνουν όλα στο ίδιο σημείο, με ίσες τελείες πριν από τις τιμές.",
"f": {
"heading": {
"size": "Μέγεθος επικεφαλίδων",
"colour": "Χρώμα επικεφαλίδων",
"font": "Γραμματοσειρά επικεφαλίδων",
"style": "Στυλ επικεφαλίδων",
"align": "Στοίχιση επικεφαλίδων"
},
"item": {
"size": "Μέγεθος ονομάτων",
"colour": "Χρώμα ονομάτων",
"font": "Γραμματοσειρά ονομάτων",
"style": "Στυλ ονομάτων",
"align": "Στοίχιση ονομάτων"
},
"price": {
"size": "Μέγεθος τιμών",
"colour": "Χρώμα τιμών",
"font": "Γραμματοσειρά τιμών",
"style": "Στυλ τιμών",
"align": "Στοίχιση τιμών"
},
"dots": {
"size": "Μέγεθος τελειών",
"colour": "Χρώμα τελειών",
"line": "Γραμμή τελειών"
}
},
"badgeColour": "Χρώμα σημάτων",
"badgeText": "Κείμενο σημάτων",
"badgeTextAuto": "Αυτόματο",
"reset": "Επαναφορά εμφάνισης",
"resetTitle": "Επαναφορά της εμφάνισης αυτού του μενού;",
"resetBody": "Κάθε μέγεθος, χρώμα, γραμματοσειρά, στυλ, στοίχιση και διάστιχο γυρίζει στην αρχή. Τα προϊόντα, η σειρά και τα ονόματά τους μένουν. Η «Αναίρεση αλλαγών» τα φέρνει πίσω μέχρι να αποθηκεύσετε."
},
"colourPick": {
"custom": "Δικό σας χρώμα",
"code": "Κωδικός χρώματος",
"opacity": "Αδιαφάνεια"
}
},
"overview": {
+47 -17
View File
@@ -1527,16 +1527,19 @@
"column": "One over the other",
"parts": "How many",
"even": "Split evenly",
"shows": "Shows",
"nothing": "Nothing",
"aSlide": "A slide from Slides",
"slide": "Slide",
"noSlides": "No slides in Slides yet",
"barHint": "Drag the lines between the parts to size them (or focus a line and use the arrow keys).",
"barHint": "Drag the lines between the parts to size them (or focus a line and use the arrow keys). Widgets in one part sit one over the other.",
"partTitle": "Part {{n}}",
"line": "The line between parts {{a}} and {{b}}",
"add": "Add a widget",
"replace": "Put something else"
"barHintColumn": "Drag the lines between the parts to size them (or focus a line and use the arrow keys). Widgets in one part sit side by side.",
"aSlideInstead": "A slide from Slides (instead of the widgets)",
"removeSlide": "Take the slide out of this part",
"removeWidget": "Remove this widget",
"before": "Move before",
"after": "Move after"
}
},
"tabs": {
@@ -1673,21 +1676,10 @@
"kept": "Kept in Slides."
},
"look": {
"headings": "Headings",
"names": "Product names",
"prices": "Prices",
"dots": "Dots",
"spacing": "Spacing",
"size": "Size",
"colour": "Colour",
"font": "Font",
"style": "Style",
"align": "Alignment",
"sameFont": "As the names",
"bold": "Bold",
"italic": "Italic",
"underline": "Underline",
"dotStyle": "Line",
"dotStyles": {
"dotted": "Dots",
"dashed": "Dashes",
@@ -1704,8 +1696,46 @@
"rounded": "Rounded",
"round": "Round"
},
"accent": "Badges and page dots",
"hint": "Product names set the board's text size, colour and font; headings and prices follow them (in the accent colour) until you change theirs. Names aligned right all end at the same point, with equal dots before the prices. Line spacing: e.g. 1.3 (× the text); letter spacing: e.g. 0.05 (of a letter); empty = auto."
"hint": "Each field changes only itself. Headings and prices start in the names' size and font (\"As the names\"). The badges' colour also colours the page dots. Names aligned right all end at the same point, with equal dots before the prices.",
"f": {
"heading": {
"size": "Headings size",
"colour": "Headings colour",
"font": "Headings font",
"style": "Headings style",
"align": "Headings alignment"
},
"item": {
"size": "Names size",
"colour": "Names colour",
"font": "Names font",
"style": "Names style",
"align": "Names alignment"
},
"price": {
"size": "Prices size",
"colour": "Prices colour",
"font": "Prices font",
"style": "Prices style",
"align": "Prices alignment"
},
"dots": {
"size": "Dots size",
"colour": "Dots colour",
"line": "Dots line"
}
},
"badgeColour": "Badges colour",
"badgeText": "Badges text",
"badgeTextAuto": "Automatic",
"reset": "Reset the look",
"resetTitle": "Reset the look of this menu?",
"resetBody": "Every size, colour, font, style, alignment and spacing goes back to the start. The products, their order and names stay. \"Undo changes\" brings it back until you save."
},
"colourPick": {
"custom": "Your own colour",
"code": "Colour code",
"opacity": "Opacity"
}
},
"overview": {
+20 -14
View File
@@ -5,7 +5,7 @@
import { Cloud, CloudFog, CloudLightning, CloudMoon, CloudRain, CloudSnow, CloudSun, Moon, Sun } from 'lucide-react'
import { QRCodeSVG } from 'qrcode.react'
import { useFormat, useTranslation } from '@xenia/i18n'
import { fitUnit, FONTS, menuLook, menuPages, pageAt, priceChars, textWidth, visibleGroups, weatherIcon, widgetAlign } from './logic'
import { cellWidgets, fitUnit, FONTS, menuLook, menuPages, pageAt, priceChars, textWidth, visibleGroups, weatherIcon, widgetAlign } from './logic'
/** A slide's background: a colour, or a photo (cover / contain) with a darkening layer. */
export function Background({ bg, media }) {
@@ -64,7 +64,7 @@ export function MenuSlide({ slide, media, venue, now, page, pages, extras, embed
{/* the list: the whole width, or narrower and placed left / centre / right (2026-11-21) */}
<div style={{ flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column', width: `${c.board_width || 100}%`,
alignSelf: BOARD_ALIGN[c.board_align] || 'flex-start' }} data-testid="signage-menu-board" data-align={c.board_align || 'left'}>
{c.title && <h1 style={{ fontSize: `${7 * scale}cqmin`, fontWeight: 800, margin: '0 0 2cqmin', color: accent, lineHeight: 1.1,
{c.title && <h1 style={{ fontSize: `${7 * scale}cqmin`, fontWeight: 800, margin: '0 0 2cqmin', color: c.heading_style?.colour || accent, lineHeight: 1.1,
textAlign: c.board_align || 'left' }}>{c.title}</h1>}
<div style={{ columnCount: c.columns || 2, columnGap: '5cqmin', fontSize: `${3.2 * scale}cqmin`, flex: 1, minHeight: 0, overflow: 'hidden', columnFill: 'auto', ...listSpacing(c) }}
data-testid="signage-menu-list">
@@ -100,7 +100,6 @@ export function MenuGroups({ c, groups }) {
const { t } = useTranslation('terminal')
const { formatMoney } = useFormat()
const look = menuLook(c)
const accent = c.accent_colour || '#f59e0b'
const priceW = `${(priceChars(groups, formatMoney) * 0.62).toFixed(2)}em`
const nameFills = look.itemAlign !== 'left'
return (
@@ -123,7 +122,7 @@ export function MenuGroups({ c, groups }) {
<span style={{ ...look.item, textDecoration: it.available ? look.item.textDecoration : 'line-through',
...(nameFills ? { flex: 1, minWidth: 0, textAlign: look.itemAlign } : {}) }} data-testid="signage-menu-name">{it.name}</span>
{it.badge && (
<span style={{ background: accent, color: '#111', fontSize: '0.55em', fontWeight: 800, padding: '0.1em 0.5em', borderRadius: '99em',
<span style={{ ...look.badge, fontSize: '0.55em', fontWeight: 800, padding: '0.1em 0.5em', borderRadius: '99em',
textTransform: 'uppercase', letterSpacing: '0.05em', whiteSpace: 'nowrap', lineHeight: 1.4 }} data-testid="signage-badge">{t(`signage.badges.${it.badge}`)}</span>
)}
{!it.available && <span style={{ fontSize: '0.6em', whiteSpace: 'nowrap' }} data-testid="signage-sold-out">{t('signage.soldOut')}</span>}
@@ -327,7 +326,7 @@ function MenuWidget({ board: b, menu, now }) {
return (
<div style={{ width: '100%', height: '100%', overflow: 'hidden', fontSize, color: b.text_colour || '#fff', fontFamily: FONTS[b.font] || FONTS.sans, textAlign: 'left' }}
data-testid="signage-w-menu" data-page={page} data-pages={pages.length}>
{b.title && <div style={{ fontSize: '1.5em', fontWeight: 800, color: accent, lineHeight: 1.15, marginBottom: '0.3em' }}>{b.title}</div>}
{b.title && <div style={{ fontSize: '1.5em', fontWeight: 800, color: b.heading_style?.colour || accent, lineHeight: 1.15, marginBottom: '0.3em' }}>{b.title}</div>}
<div style={{ columnCount: cols, columnGap: '1.2em', columnFill: 'auto', ...listSpacing(b) }} data-testid="signage-menu-list">
<MenuGroups c={b} groups={pages[page] || []} />
</div>
@@ -337,25 +336,32 @@ function MenuWidget({ board: b, menu, now }) {
/**
* A stack (2026-11-21): parts side by side ("row") or one over the other ("column"), each its share
* of the stack, showing a widget (filling the part) or a whole library slide.
* of the stack, showing widgets (each filling its place; several share the part, one over the other
* in a side-by-side stack and side by side in the other: owner review 4) or a whole library slide.
*/
function Stack({ w, path, ctx }) {
const cells = w.cells || []
const Embed = ctx.embed
const across = w.direction === 'column' ? 'row' : 'column'
return (
<div style={{ display: 'flex', flexDirection: w.direction === 'column' ? 'column' : 'row', width: '100%', height: '100%' }}
data-testid="signage-w-stack" data-direction={w.direction || 'row'}>
{cells.map((c, j) => {
const cp = `${path}.${j}`
const slide = c.slide_id ? ctx.extras[cp]?.slide : null
const body = c.widget ? widgetBody(c.widget, ctx, true, cp) : null
const align = c.widget?.align && c.widget.align !== 'auto' ? c.widget.align : 'center'
const ws = cellWidgets(c)
const slide = !ws.length && c.slide_id ? ctx.extras[cp]?.slide : null
return (
<div key={j} style={{ flex: `${c.share || 1} 1 0%`, minWidth: 0, minHeight: 0, position: 'relative', overflow: 'hidden', containerType: 'size' }}
data-testid="signage-stack-cell" data-share={c.share}>
{body && (
<div style={{ width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: SELF[align], textAlign: align }}>{body}</div>
)}
<div key={j} style={{ flex: `${c.share || 1} 1 0%`, minWidth: 0, minHeight: 0, position: 'relative', overflow: 'hidden', containerType: 'size',
display: 'flex', flexDirection: across }} data-testid="signage-stack-cell" data-share={c.share}>
{ws.map((cw, k) => {
const align = cw.align && cw.align !== 'auto' ? cw.align : 'center'
return (
<div key={k} style={{ flex: '1 1 0%', minWidth: 0, minHeight: 0, overflow: 'hidden', containerType: 'size',
display: 'flex', alignItems: 'center', justifyContent: SELF[align], textAlign: align }} data-testid="signage-stack-place">
{widgetBody(cw, ctx, true, `${cp}.${k}`)}
</div>
)
})}
{slide && Embed && <Embed slide={slide} media={ctx.media} venue={ctx.venue} now={ctx.now} />}
</div>
)
+27 -1
View File
@@ -321,7 +321,8 @@ const DOTS = { dotted: 'dotted', dashed: 'dashed', solid: 'solid' }
* board's text size): headings, names and prices each their own size, colour, font, bold / italic /
* underline and alignment (empty: the board's text size and font, the text colour for names and the
* accent colour for headings and prices); the dots between name and price; line and letter spacing
* (auto: 1.25 and normal; set on the list, never inherited from the page); photos' size and shape.
* (auto: 1.25 and normal; set on the list, never inherited from the page); photos' size and shape;
* the badges' colours (2026-11-21: their text the venue's, or white / black to read on them).
*/
export function menuLook(c = {}) {
const base = c.text_size || 100
@@ -345,6 +346,9 @@ export function menuLook(c = {}) {
dots: d.style === 'none'
? { borderBottom: 'none' }
: { borderBottom: `${+(0.08 * (d.size || 100) / 100).toFixed(3)}em ${DOTS[d.style] || 'dotted'} ${d.colour || 'currentColor'}`, opacity: d.colour ? 1 : 0.35 },
// badges: the accent (also the page dots), their text the venue's or one that reads on it
badge: { background: accent, color: c.badge_text_colour || readableOn(accent) },
title: c.heading_style?.colour || accent,
lineHeight: c.line_height || 1.25,
letterSpacing: c.letter_spacing != null ? `${c.letter_spacing}em` : 'normal',
photo: { size: `${+(2.2 * (c.photo_size || 100) / 100).toFixed(3)}em`, radius: RADIUS[c.photo_shape] || RADIUS.rounded },
@@ -354,6 +358,28 @@ export function menuLook(c = {}) {
}
}
/** A stack part's widgets (a part stored before owner review 4 has one `widget`). */
export function cellWidgets(c) {
return c?.widgets?.length ? c.widgets : c?.widget ? [c.widget] : []
}
/**
* A text colour that reads on `hex` (#rgb, #rrggbb or #rrggbbaa; the alpha is ignored): white on a
* dark colour, near-black on a light one (a badge's text when the venue chose none, 2026-11-21).
*/
export function readableOn(hex) {
let h = String(hex || '').replace('#', '')
if (h.length === 3 || h.length === 4) h = h.slice(0, 3).split('').map(x => x + x).join('')
if (!/^[0-9a-f]{6}/i.test(h)) return '#111111'
const [r, g, b] = [0, 2, 4].map(i => {
const v = parseInt(h.slice(i, i + 2), 16) / 255
return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4
})
const lum = 0.2126 * r + 0.7152 * g + 0.0722 * b
// the text with the better contrast (WCAG): white beats near-black below ~0.18
return lum < 0.18 ? '#ffffff' : '#111111'
}
/** A page's widest price, in characters: the price column's width, so names and dots line up. */
export function priceChars(groups, format) {
let n = 0
+14
View File
@@ -192,3 +192,17 @@ test("a menu's look part by part: sizes against the board's text, colours fall b
assert.deepEqual(menuLook({ dot_style: { style: 'none' } }).dots, { borderBottom: 'none' })
assert.equal(priceChars([{ items: [{ price: 4.5 }, { price: 12 }, { price: null }] }], p => `€${p.toFixed(2)}`), 6)
})
test('owner review 4: a part\'s widgets (one stored as `widget` too), badges that read', async () => {
const { cellWidgets, menuLook, readableOn } = await import('../src/logic.js')
assert.deepEqual(cellWidgets({ widgets: [{ kind: 'clock' }, { kind: 'date' }] }).map(w => w.kind), ['clock', 'date'])
assert.deepEqual(cellWidgets({ widget: { kind: 'qr' } }).map(w => w.kind), ['qr'])
assert.deepEqual(cellWidgets({ slide_id: 3 }), [])
assert.equal(readableOn('#111827'), '#ffffff')
assert.equal(readableOn('#1e3a8acc'), '#ffffff')
assert.equal(readableOn('#f59e0b'), '#111111')
assert.equal(readableOn('#fff'), '#111111')
assert.deepEqual(menuLook({ accent_colour: '#1e3a8a' }).badge, { background: '#1e3a8a', color: '#ffffff' })
assert.deepEqual(menuLook({ accent_colour: '#1e3a8a', badge_text_colour: '#fde68a' }).badge, { background: '#1e3a8a', color: '#fde68a' })
assert.equal(menuLook({ accent_colour: '#123456', heading_style: { colour: '#ff0000' } }).title, '#ff0000')
})
+9
View File
@@ -465,6 +465,15 @@
box-shadow: var(--x-shadow-popover); outline: none;
animation: x-fade-in var(--x-duration-fast) var(--x-ease);
}
/* ── Popover (2026-11-21): a small panel under a button, kept inside the window ── */
.x-popover {
position: fixed; z-index: var(--x-z-popover); box-sizing: border-box;
max-width: calc(100vw - 16px); overflow: auto;
background: var(--x-surface); color: var(--x-ink); color-scheme: var(--x-color-scheme);
border: var(--x-border-width) solid var(--x-line); border-radius: var(--x-radius-card);
box-shadow: var(--x-shadow-popover); outline: none;
animation: x-fade-in var(--x-duration-fast) var(--x-ease);
}
.x-dropdown__search { padding: var(--x-space-2); border-bottom: var(--x-border-width) solid var(--x-line); }
.x-dropdown__list { list-style: none; margin: 0; padding: var(--x-space-1); overflow-y: auto; min-height: 0; }
.x-dropdown__option {
+1 -1
View File
@@ -2,7 +2,7 @@ import { cx } from '../internal/cx.js'
/**
* The page rule (2026-11-20): every app page's root. It scrolls on its own, fills the area up to
* a 16:9 screen's width (--x-page-max) and is centred beyond it (ultrawides), with the same
* 2200 px (--x-page-max: a 1080p screen is filled; the window's height never narrows it) and is centred beyond it (ultrawides), with the same
* padding and gaps everywhere. Never put padding, max-width or overflow on a page's root yourself.
*
* <Page testId="contacts-page">
+65
View File
@@ -0,0 +1,65 @@
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'
import { cx } from '../internal/cx.js'
import { Portal } from '../internal/Portal.jsx'
const GAP = 6
const MARGIN = 8
/**
* A small floating panel under a button (2026-11-21): a colour picker, an "Add…" menu. Drawn over
* everything (portal, fixed), like the Dropdown's list: below its button, above when there's no
* room, and always kept inside the window, so it never makes a page or a section scroll sideways.
* Closes on a click outside (the button excluded) and on Escape.
*
* const btn = useRef(null)
* <Button ref={btn} onClick={() => setOpen(o => !o)}>Add</Button>
* <Popover open={open} anchor={btn} onClose={() => setOpen(false)} role="menu">…</Popover>
*/
export function Popover({ open, anchor, onClose, className, style, children, role = 'dialog', ...rest }) {
const panel = useRef(null)
const [pos, setPos] = useState(null)
const place = useCallback(() => {
const b = anchor?.current?.getBoundingClientRect()
const p = panel.current?.getBoundingClientRect()
if (!b || !p) return
const below = window.innerHeight - b.bottom - GAP - MARGIN
const above = b.top - GAP - MARGIN
const up = p.height > below && above > below
const left = Math.min(Math.max(MARGIN, b.left), Math.max(MARGIN, window.innerWidth - MARGIN - p.width))
const top = up ? Math.max(MARGIN, b.top - GAP - p.height) : b.bottom + GAP
setPos({ left, top, maxHeight: Math.max(160, up ? above : below) })
}, [anchor])
useLayoutEffect(() => { if (open) place(); else setPos(null) }, [open, place])
useEffect(() => {
if (!open) return undefined
const away = e => {
if (panel.current?.contains(e.target) || anchor?.current?.contains(e.target)) return
onClose?.()
}
const esc = e => { if (e.key === 'Escape') { e.stopPropagation(); onClose?.() } }
const onScroll = e => { if (!panel.current?.contains(e.target)) place() }
document.addEventListener('pointerdown', away)
window.addEventListener('keydown', esc)
window.addEventListener('resize', place)
window.addEventListener('scroll', onScroll, true)
return () => {
document.removeEventListener('pointerdown', away)
window.removeEventListener('keydown', esc)
window.removeEventListener('resize', place)
window.removeEventListener('scroll', onScroll, true)
}
}, [open, anchor, onClose, place])
if (!open) return null
return (
<Portal>
<div ref={panel} role={role} className={cx('x-popover', className)} {...rest}
style={{ ...style, ...(pos ? { left: pos.left, top: pos.top, maxHeight: pos.maxHeight } : { left: 0, top: 0, visibility: 'hidden' }) }}>
{children}
</div>
</Portal>
)
}
+1
View File
@@ -22,6 +22,7 @@ export { EmptyState } from './components/EmptyState.jsx'
export { Spinner } from './components/Spinner.jsx'
export { Field, Input, Textarea, Select } from './components/Field.jsx'
export { Dropdown } from './components/Dropdown.jsx'
export { Popover } from './components/Popover.jsx'
export { Page, PageHeader, Pane, Toolbar, ToolbarSpacer } from './components/Page.jsx'
export { SearchInput, FilterChip, Segmented, Tabs } from './components/Controls.jsx'
export { Switch } from './components/Switch.jsx'
+4 -3
View File
@@ -588,9 +588,10 @@
--x-pad-card: 20px;
--x-pad-card-y: 14px; /* a card's header row and list rows */
/* Pages (the page rule, 2026-11-20): a page fills its area up to a 16:9 screen's width and
is centred beyond it, so ultrawides keep a 16:9 page instead of stretched content. */
--x-page-max: max(1280px, calc(100vh * 16 / 9));
/* Pages (the page rule, 2026-11-20; owner 2026-11-21): a page fills its area up to 2200 px
(a 1080p screen is filled) and is centred beyond it, so ultrawides don't stretch the content.
A fixed width: a short window never makes the page narrower. */
--x-page-max: 2200px;
--x-page-pad: 24px;
--x-page-gap: 20px;
--x-page-form-max: 880px; /* forms and settings that read badly when stretched */