feat(ui): the shared page frame and toolbar kit: Page, PageHeader, Toolbar, Dropdown (multi-select), SearchInput, FilterChip, Segmented, Tabs
Owner's UI review (2026-11-20): pages that don't scroll and sit on the left, native selects in toolbars, controls of different heights, labels too loud. Everything is global in @xenia/ui so no page rebuilds it: - Page: scrolls on its own, fills the area up to a 16:9 screen's width (--x-page-max = max(1280px, 100vh*16/9)), centred beyond (ultrawides); width="form" for settings; top= keeps a tab strip above the scroll - Dropdown: portal list, flips above, keyboard, search for long lists, multiple (array value, [] = all, allLabel), dots and hints; Input heights - SearchInput, FilterChip (tone + count), Segmented, Tabs (sideways scroll only, no 1px up/down scroll), Toolbar/ToolbarSpacer - InfoTip opens on hover too; Dialog size xl (920px) - tokens: --x-text-overline (11px), --x-pad-card(-y), muted ink-2 (contrast test still passes in every look); preset: text-overline, p-card, max-w-page, the special tone - component labels (search, clear, all, nothing found) in en/el Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
|
||||
}
|
||||
|
||||
.x-dialog, .x-sheet, .x-toast, .x-input, .x-select__control { color-scheme: var(--x-color-scheme); }
|
||||
.x-dialog, .x-sheet, .x-toast, .x-input, .x-select__control, .x-dropdown__menu { color-scheme: var(--x-color-scheme); }
|
||||
|
||||
/* ── Spinner ─────────────────────────────────────────────────────────────── */
|
||||
.x-spinner { display: inline-flex; flex-shrink: 0; color: currentColor; }
|
||||
@@ -81,6 +81,7 @@
|
||||
.x-dialog--sm { max-width: 400px; }
|
||||
.x-dialog--md { max-width: 520px; }
|
||||
.x-dialog--lg { max-width: 720px; }
|
||||
.x-dialog--xl { max-width: 920px; }
|
||||
|
||||
.x-sheet--bottom {
|
||||
width: 100%; max-width: 640px; max-height: 90vh;
|
||||
@@ -334,3 +335,166 @@
|
||||
/* always light behind the code, in dark themes too: scanners need the contrast */
|
||||
.x-qr__tile { padding: var(--x-space-3); border-radius: var(--x-radius-card); border: var(--x-border-width) solid var(--x-line); background: var(--x-on-colour); line-height: 0; }
|
||||
.x-qr__caption { font-size: var(--x-text-label); color: var(--x-ink-2); text-align: center; }
|
||||
|
||||
/* ── Page, PageHeader, Toolbar (the page rule, 2026-11-20) ─────────────────
|
||||
* A page scrolls on its own and is as wide as a 16:9 screen allows, centred beyond. */
|
||||
.x-page { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; }
|
||||
.x-page__top { flex-shrink: 0; border-bottom: var(--x-border-width) solid var(--x-line); background: var(--x-surface); }
|
||||
.x-page__top-inner { box-sizing: border-box; width: 100%; max-width: var(--x-page-max); margin-inline: auto; padding: 0 var(--x-page-pad); }
|
||||
.x-page__scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
|
||||
.x-page__body {
|
||||
box-sizing: border-box; width: 100%; max-width: var(--x-page-max); margin-inline: auto;
|
||||
padding: var(--x-page-pad);
|
||||
display: grid; gap: var(--x-page-gap); align-content: start; grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
.x-page__body--form { max-width: var(--x-page-form-max); }
|
||||
.x-page__top-inner.x-page__body--form { padding-top: 0; padding-bottom: 0; }
|
||||
.x-page__body--flush { padding: 0; }
|
||||
@media (max-width: 768px) {
|
||||
.x-page__body, .x-page__top-inner { padding-inline: var(--x-space-4); }
|
||||
.x-page__body { padding-block: var(--x-space-4); }
|
||||
.x-page__body--flush { padding: 0; }
|
||||
}
|
||||
|
||||
.x-page-header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-space-3); }
|
||||
.x-page-header__titles { flex: 1; min-width: 0; }
|
||||
.x-page-header__title { margin: 0; display: flex; align-items: center; gap: var(--x-space-1); font-size: var(--x-text-title); line-height: var(--x-leading-title); font-weight: var(--x-weight-semibold); color: var(--x-ink); }
|
||||
.x-page-header__subtitle { margin: var(--x-space-0-5) 0 0; font-size: var(--x-text-label); line-height: var(--x-leading-label); color: var(--x-ink-2); }
|
||||
.x-page-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-space-2); }
|
||||
|
||||
.x-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-space-2); }
|
||||
.x-toolbar > .x-search { flex: 1 1 16rem; }
|
||||
.x-toolbar__spacer { flex: 1; }
|
||||
|
||||
/* ── SearchInput ─────────────────────────────────────────────────────────── */
|
||||
.x-search { position: relative; display: block; min-width: 12rem; }
|
||||
.x-search__icon { position: absolute; left: var(--x-space-3); top: 50%; transform: translateY(-50%); display: flex; color: var(--x-ink-3); pointer-events: none; }
|
||||
.x-search__input { padding-left: var(--x-space-10); padding-right: var(--x-space-10); }
|
||||
.x-search__input::-webkit-search-cancel-button { display: none; }
|
||||
.x-search__clear {
|
||||
position: absolute; right: var(--x-space-2); top: 50%; transform: translateY(-50%);
|
||||
display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
|
||||
border: 0; border-radius: var(--x-radius-full); background: transparent; color: var(--x-ink-3); cursor: pointer;
|
||||
}
|
||||
.x-search__clear:hover { background: var(--x-surface-2); color: var(--x-ink); }
|
||||
.x-search__clear:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
||||
|
||||
/* ── Dropdown ────────────────────────────────────────────────────────────── */
|
||||
.x-dropdown {
|
||||
display: inline-flex; align-items: center; gap: var(--x-space-2);
|
||||
box-sizing: border-box; min-width: 10rem; max-width: 100%;
|
||||
min-height: var(--x-control-md); padding: 0 var(--x-space-3);
|
||||
background: var(--x-surface); color: var(--x-ink);
|
||||
border: var(--x-border-width) solid var(--x-line-strong); border-radius: var(--x-radius-control);
|
||||
font: inherit; font-size: var(--x-text-body); line-height: var(--x-leading-body); text-align: left;
|
||||
cursor: pointer; color-scheme: var(--x-color-scheme);
|
||||
transition: border-color var(--x-duration-fast) var(--x-ease), box-shadow var(--x-duration-fast) var(--x-ease);
|
||||
}
|
||||
.x-dropdown:hover:not(:disabled) { border-color: var(--x-ink-3); }
|
||||
.x-dropdown:focus-visible, .x-dropdown--open { outline: none; border-color: var(--x-accent); box-shadow: var(--x-focus-ring); }
|
||||
.x-dropdown:disabled { background: var(--x-surface-2); color: var(--x-ink-3); cursor: not-allowed; }
|
||||
.x-dropdown--sm { min-height: var(--x-control-sm); }
|
||||
.x-dropdown--lg { min-height: var(--x-control-lg); font-size: var(--x-text-body-lg); }
|
||||
.x-dropdown--filtered { border-color: var(--x-accent); background: var(--x-accent-soft); color: var(--x-accent-ink); }
|
||||
.x-dropdown__icon { display: flex; color: var(--x-ink-3); }
|
||||
.x-dropdown--filtered .x-dropdown__icon, .x-dropdown--filtered .x-dropdown__chevron { color: inherit; }
|
||||
.x-dropdown__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--x-weight-medium); }
|
||||
.x-dropdown__value--placeholder { color: var(--x-ink-3); font-weight: var(--x-weight-regular); }
|
||||
.x-dropdown__count { padding: 0 var(--x-space-1-5); border-radius: var(--x-radius-full); background: var(--x-accent); color: var(--x-accent-fg); font-size: var(--x-text-caption); font-weight: var(--x-weight-bold); }
|
||||
.x-dropdown__chevron { flex-shrink: 0; color: var(--x-ink-3); transition: transform var(--x-duration-fast) var(--x-ease); }
|
||||
.x-dropdown--open .x-dropdown__chevron { transform: rotate(180deg); }
|
||||
|
||||
.x-dropdown__menu {
|
||||
position: fixed; z-index: var(--x-z-popover); box-sizing: border-box;
|
||||
display: flex; flex-direction: column; max-width: min(420px, calc(100vw - 16px)); overflow: hidden;
|
||||
background: var(--x-surface); color: var(--x-ink);
|
||||
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 {
|
||||
display: flex; align-items: center; gap: var(--x-space-2-5);
|
||||
min-height: 38px; padding: var(--x-space-1-5) var(--x-space-3); border-radius: var(--x-radius-sm);
|
||||
font-size: var(--x-text-body); line-height: var(--x-leading-body); cursor: pointer; user-select: none;
|
||||
}
|
||||
.x-dropdown__option--active { background: var(--x-surface-2); }
|
||||
.x-dropdown__option--on { font-weight: var(--x-weight-semibold); }
|
||||
.x-dropdown__option--disabled { opacity: 0.45; cursor: not-allowed; }
|
||||
.x-dropdown__text { flex: 1; min-width: 0; display: grid; }
|
||||
.x-dropdown__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.x-dropdown__hint { font-size: var(--x-text-caption); line-height: var(--x-leading-caption); color: var(--x-ink-3); font-weight: var(--x-weight-regular); }
|
||||
.x-dropdown__tick { display: flex; color: var(--x-accent); }
|
||||
.x-dropdown__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
|
||||
.x-dropdown__box {
|
||||
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
|
||||
width: 18px; height: 18px; box-sizing: border-box;
|
||||
border: 1.5px solid var(--x-line-strong); border-radius: 5px; background: var(--x-surface); color: var(--x-accent-fg);
|
||||
}
|
||||
.x-dropdown__box--on { background: var(--x-accent); border-color: var(--x-accent); }
|
||||
.x-dropdown__none { padding: var(--x-space-3); font-size: var(--x-text-label); color: var(--x-ink-3); text-align: center; }
|
||||
.x-dropdown__foot { padding: var(--x-space-1-5) var(--x-space-2); border-top: var(--x-border-width) solid var(--x-line); }
|
||||
.x-dropdown__clear {
|
||||
width: 100%; padding: var(--x-space-1-5) var(--x-space-2); border: 0; border-radius: var(--x-radius-sm);
|
||||
background: transparent; color: var(--x-accent-ink); font: inherit; font-size: var(--x-text-label); font-weight: var(--x-weight-semibold); text-align: left; cursor: pointer;
|
||||
}
|
||||
.x-dropdown__clear:hover { background: var(--x-surface-2); }
|
||||
|
||||
/* ── FilterChip ──────────────────────────────────────────────────────────── */
|
||||
.x-chip {
|
||||
--x-chip-tone: var(--x-ink-3); --x-chip-soft: var(--x-surface-2); --x-chip-ink: var(--x-ink-2);
|
||||
display: inline-flex; align-items: center; gap: var(--x-space-2);
|
||||
box-sizing: border-box; min-height: var(--x-control-md); padding: 0 var(--x-space-4);
|
||||
border: var(--x-border-width) solid var(--x-line-strong); border-radius: var(--x-radius-full);
|
||||
background: var(--x-surface); color: var(--x-ink-2);
|
||||
font: inherit; font-size: var(--x-text-label); font-weight: var(--x-weight-semibold); white-space: nowrap; cursor: pointer;
|
||||
transition: background-color var(--x-duration-fast) var(--x-ease), border-color var(--x-duration-fast) var(--x-ease);
|
||||
}
|
||||
.x-chip--sm { min-height: var(--x-control-sm); padding: 0 var(--x-space-3); }
|
||||
.x-chip:hover { background: var(--x-surface-2); }
|
||||
.x-chip:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
||||
.x-chip__dot { width: 8px; height: 8px; border-radius: var(--x-radius-full); background: var(--x-chip-tone); }
|
||||
.x-chip__count { color: var(--x-ink); font-variant-numeric: tabular-nums; }
|
||||
.x-chip--on, .x-chip--on:hover { background: var(--x-chip-soft); color: var(--x-chip-ink); border-color: var(--x-chip-tone); }
|
||||
.x-chip--on .x-chip__count { color: inherit; }
|
||||
.x-chip--success { --x-chip-tone: var(--x-success); --x-chip-soft: var(--x-success-soft); --x-chip-ink: var(--x-success-ink); }
|
||||
.x-chip--info { --x-chip-tone: var(--x-info); --x-chip-soft: var(--x-info-soft); --x-chip-ink: var(--x-info-ink); }
|
||||
.x-chip--accent { --x-chip-tone: var(--x-accent); --x-chip-soft: var(--x-accent-soft); --x-chip-ink: var(--x-accent-ink); }
|
||||
.x-chip--warning { --x-chip-tone: var(--x-warning); --x-chip-soft: var(--x-warning-soft); --x-chip-ink: var(--x-warning-ink); }
|
||||
.x-chip--danger { --x-chip-tone: var(--x-danger); --x-chip-soft: var(--x-danger-soft); --x-chip-ink: var(--x-danger-ink); }
|
||||
|
||||
/* ── Segmented ───────────────────────────────────────────────────────────── */
|
||||
.x-segmented {
|
||||
display: inline-flex; box-sizing: border-box; min-height: var(--x-control-md); padding: 3px; gap: 2px;
|
||||
border: var(--x-border-width) solid var(--x-line-strong); border-radius: var(--x-radius-control); background: var(--x-surface-2);
|
||||
}
|
||||
.x-segmented--sm { min-height: var(--x-control-sm); }
|
||||
.x-segmented__item {
|
||||
display: inline-flex; align-items: center; gap: var(--x-space-1-5); padding: 0 var(--x-space-3);
|
||||
border: 0; border-radius: calc(var(--x-radius-control) - 3px); background: transparent; color: var(--x-ink-2);
|
||||
font: inherit; font-size: var(--x-text-label); font-weight: var(--x-weight-medium); cursor: pointer;
|
||||
}
|
||||
.x-segmented__item:hover { color: var(--x-ink); }
|
||||
.x-segmented__item:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
||||
.x-segmented__item--on, .x-segmented__item--on:hover { background: var(--x-surface); color: var(--x-ink); font-weight: var(--x-weight-semibold); box-shadow: var(--x-shadow-raised); }
|
||||
|
||||
/* ── Tabs ────────────────────────────────────────────────────────────────── */
|
||||
.x-tabs { display: flex; align-items: center; gap: var(--x-space-2); box-shadow: inset 0 calc(-1 * var(--x-border-width)) 0 var(--x-line); }
|
||||
.x-page__top .x-tabs { box-shadow: none; }
|
||||
.x-tabs__list { flex: 1; min-width: 0; display: flex; gap: var(--x-space-1); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
|
||||
.x-tabs__list::-webkit-scrollbar { display: none; }
|
||||
.x-tabs__tab {
|
||||
display: inline-flex; align-items: center; gap: var(--x-space-1-5); flex-shrink: 0;
|
||||
padding: var(--x-space-2-5) var(--x-space-3); border: 0; background: transparent;
|
||||
box-shadow: inset 0 -2px 0 transparent; color: var(--x-ink-2);
|
||||
font: inherit; font-size: var(--x-text-label); font-weight: var(--x-weight-medium); white-space: nowrap; cursor: pointer;
|
||||
transition: color var(--x-duration-fast) var(--x-ease), box-shadow var(--x-duration-fast) var(--x-ease);
|
||||
}
|
||||
.x-tabs--lg .x-tabs__tab { padding: var(--x-space-3) var(--x-space-4); font-size: var(--x-text-body); }
|
||||
.x-tabs__tab:hover { color: var(--x-ink); }
|
||||
.x-tabs__tab:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
|
||||
.x-tabs__tab--on, .x-tabs__tab--on:hover { color: var(--x-ink); font-weight: var(--x-weight-semibold); box-shadow: inset 0 -2px 0 var(--x-accent); }
|
||||
.x-tabs__badge { min-width: 18px; padding: 0 var(--x-space-1-5); box-sizing: border-box; border-radius: var(--x-radius-full); background: var(--x-surface-2); color: var(--x-ink-2); font-size: var(--x-text-caption); font-weight: var(--x-weight-bold); text-align: center; font-variant-numeric: tabular-nums; }
|
||||
.x-tabs__badge--warn { background: var(--x-danger-soft); color: var(--x-danger-ink); }
|
||||
.x-tabs__end { flex-shrink: 0; display: flex; align-items: center; gap: var(--x-space-2); }
|
||||
|
||||
Reference in New Issue
Block a user