From 181b2f16b05f1ef71d1fd346c7bfedbc6729abb4 Mon Sep 17 00:00:00 2001 From: bonamin Date: Fri, 20 Nov 2026 17:51:16 +0200 Subject: [PATCH] feat(ui): Pane and Page fit/header, inset/fill Tabs, quiet tones, dialog toolbar - Page `fit` + `Pane`: panes scroll on their own, the page doesn't (from 768 px); Page `header`: the title and description above the tabs; the scrollbar's room is always kept, so short and long tabs are the same width. - Tabs `inset` (a card's header: room around the end button) and `fill`. - IconButton tone: grey at rest, the colour on hover; Button tone (ghost text that turns red on hover). - Dialog / Sheet `toolbar`: stays under the title while the body scrolls. - A Switch without a label lines up with the buttons beside it. - DESIGN.md updated. Co-Authored-By: Claude Opus 5.5 --- docs/DESIGN.md | 13 +++++++-- packages/ui/src/components.css | 39 +++++++++++++++++++++---- packages/ui/src/components/Button.jsx | 12 ++++---- packages/ui/src/components/Controls.jsx | 7 +++-- packages/ui/src/components/Page.jsx | 31 ++++++++++++++++++-- packages/ui/src/components/Switch.jsx | 2 +- packages/ui/src/index.js | 2 +- packages/ui/src/internal/ModalFrame.jsx | 6 ++-- 8 files changed, 90 insertions(+), 22 deletions(-) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 3eeec87..16d4332 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -31,11 +31,14 @@ Every page's root is `` from `@xenia/ui`. It provides: ``` - `top={}` keeps a tab strip above the scrolling part (Online orders, Settings). The tab is kept in the address (`?tab=`). +- `header={}` with `top`: the page's title and description come **first**, then the tabs (Offers & pricing). Each tab then starts with its own head: title, description, its "New" button at the top right. +- `fit`: the page is exactly the screen's height and doesn't scroll; its `Pane`s do, each on its own (Products). Put them in an element with `x-page__fill`. Phones scroll as usual. +- The scrollbar's room is always kept (`scrollbar-gutter: stable`), so a short tab is exactly as wide as a long one. - `width="form"` for settings and forms (centred at `--x-page-form-max`, 880 px). Lists, tables and dashboards use the default (full). - **Never** put `p-*`, `max-w-*`, `mx-auto`, `h-full` or `overflow-*` on a page's root, and never nest a second width limit inside it. - Checked by `tests/e2e/manager_layout.mjs` (1920×1080 and 3440×1440: every page fills / is centred, and scrolls). Add a new page to its `PAGES` list. -Every page is on `` except Inventory → Stock (a placeholder). Two-column pages (Products: the category tree and the list; the floor editor: the map and its panels) put each side in its own container (`rounded-card border bg-surface shadow-raised`), the narrow side `sticky` so it stays in view while the page scrolls. +Every page is on `` except Inventory → Stock (a placeholder). Two-column pages put each side in its own container. Products is a `Page fit` with two `Pane`s (header and footer stay, only the list scrolls; the list's body `sunken`, a shade darker, so the white product rows stand out). The floor editor: the map and its panels, the narrow side `sticky`. ## 3. Components (`@xenia/ui`) @@ -47,11 +50,15 @@ Every page is on `` except Inventory → Stock (a placeholder). Two-column | Choose one / several | `Dropdown` (`multiple`) | **never a native `