fix(ui): match Mission Core form grouping without recessed canvases
This commit is contained in:
@@ -7,17 +7,20 @@ export function MissionThemeExample() {
|
||||
const [name,setName]=useState('Mission Core');
|
||||
const [enabled,setEnabled]=useState(true);
|
||||
const [mode,setMode]=useState('review');
|
||||
const fields=<GlassSurface className="catalog-theme-fields" tone="soft" padding="md" materialRim={false}>
|
||||
const fields=<div className="catalog-theme-fields">
|
||||
<TextField label="Название" value={name} onChange={event=>setName(event.target.value)}/>
|
||||
<TextAreaField label="Описание" defaultValue="Панель, группа и поле сохраняют собственные поверхности."/>
|
||||
<Select label="Режим" value={mode} options={[{value:'review',label:'Просмотр'},{value:'edit',label:'Редактирование'}]} onChange={setMode}/>
|
||||
<TextField label="Недоступное поле" value="Только чтение" disabled/>
|
||||
</GlassSurface>;
|
||||
</div>;
|
||||
return <SettingsCard title="Фундамент Mission Core" description="Единая тёмная тема: поверхности, поля, действия и окна." actions={<Switch label="Включено" checked={enabled} onChange={setEnabled}/>}>
|
||||
{fields}
|
||||
<GlassSurface tone="group" padding="md" materialRim={false}>
|
||||
<TextField label="Элемент коллекции" defaultValue="Дополнительная ссылка"/>
|
||||
</GlassSurface>
|
||||
<StatusBadge tone="success">Сохранено</StatusBadge>
|
||||
<Button variant="primary" onClick={()=>setOpen(true)}>Открыть настройки</Button>
|
||||
<Description>Вложенные формы используют GlassSurface tone="soft"; поля остаются различимыми на любой глубине.</Description>
|
||||
<Description>Поля лежат прямо в SettingsCard; самостоятельный элемент коллекции использует тот же серый материал через GlassSurface tone="group".</Description>
|
||||
<FeatureSettingsWindow open={open} onClose={()=>setOpen(false)} title="Настройки темы" identity={{title:'Профиль',subtitle:'Mission Core',avatarLabel:'DC'}} sections={[{id:'appearance',label:'Оформление',group:'Общие'}]} activeSection="appearance" onSectionChange={()=>{}}>
|
||||
<SettingsCard title="Форма в окне" description="Тот же материал полей в портальном окне.">{fields}</SettingsCard>
|
||||
</FeatureSettingsWindow>
|
||||
|
||||
@@ -134,3 +134,14 @@ The complete Mission/flat preset now lives in tokens + ui-core, exported for Rea
|
||||
CMS consumes the immutable packages and retains only domain layout/event adapters.
|
||||
Nested forms use SettingsCard and opaque GlassSurface soft; no CMS palette.
|
||||
Mission Core itself remains on its existing local package state; its duplicated base overrides are recorded migration debt, not silently updated.
|
||||
|
||||
|
||||
### CMS form composition correction — 2026-11-05
|
||||
|
||||
Mission Core environment settings were verified in the running app: SettingsCard
|
||||
uses the neutral group material, its form grid is transparent, fields are opaque.
|
||||
CMS removes the extra field-grid surface and the card around the full list of
|
||||
content cards. Collection entries and native JSON disclosures adopt the shared
|
||||
GlassSurface group material. No local palette, field colors or business logic
|
||||
are introduced. The prior soft-canvas composition is superseded in THEMING and
|
||||
the living catalog; soft itself remains available for recessed non-form areas.
|
||||
|
||||
+3
-2
@@ -8,7 +8,8 @@
|
||||
|
||||
- `default` — обычная карточка/панель;
|
||||
- `strong` — dropdown, modal и поверхность над сложным фоном;
|
||||
- `soft` — вложенная или вторичная область.
|
||||
- `soft` — утопленная вторичная область / canvas, не подложка формы;
|
||||
- `group` — нейтральная группа как SettingsCard, для самостоятельного элемента коллекции.
|
||||
|
||||
`radius="pill"` задаёт каноническую капсульную геометрию через `--nodedc-radius-circle`. Она предназначена, в частности, для компактных вертикальных и горизонтальных реек из круглых действий: верхняя и нижняя части поверхности повторяют круг кнопок без прямых торцевых пролётов. Consumer не воспроизводит этот радиус локальным CSS.
|
||||
|
||||
@@ -541,4 +542,4 @@ The shared theme supports `edges: "flat"` for borderless surfaces, including por
|
||||
|
||||
## Mission Core theme foundation
|
||||
|
||||
`missionDarkTheme` и `missionLightTheme` — общий профиль из `@nodedc/ui-core` / `@nodedc/ui-dom`. `applyNodedcTheme` по умолчанию выбирает Mission и flat. Полный контракт цветов и композиции вложенных форм находится в [THEMING.md](THEMING.md). SettingsCard использует семантическую поверхность группы, GlassSurface tone="soft" — непрозрачную вложенную область. Ни CMS, ни другой потребитель не повторяет палитру локально. Living catalog содержит форму и её портальную версию.
|
||||
`missionDarkTheme` и `missionLightTheme` — общий профиль из `@nodedc/ui-core` / `@nodedc/ui-dom`. `applyNodedcTheme` по умолчанию выбирает Mission и flat. Полный контракт цветов и композиции вложенных форм находится в [THEMING.md](THEMING.md). SettingsCard использует семантическую поверхность группы; поля расположены непосредственно в его body, как в Mission Core. GlassSurface tone="group" использует тот же материал для элементов коллекций. tone="soft" не применяется к формам. Ни CMS, ни другой потребитель не повторяет палитру локально. Living catalog содержит форму и её портальную версию.
|
||||
|
||||
+12
-6
@@ -26,17 +26,23 @@ applyNodedcTheme(document.documentElement, missionDarkTheme);
|
||||
| Рабочая сцена | `#08090b` | доменный viewport, token `--nodedc-stage` |
|
||||
| Панель | `#151517` | ApplicationPanel, AdminNavigationPanel |
|
||||
| Группа | нейтральный слой `110 110 110 / .07` | SettingsCard |
|
||||
| Вложенная область | `#0d0d0f` | GlassSurface tone="soft" |
|
||||
| Элемент коллекции | нейтральный слой `110 110 110 / .07` | GlassSurface tone="group" |
|
||||
| Утопленная вторичная область | `#0d0d0f` | GlassSurface tone="soft", вне форм |
|
||||
| Поле | `#2a2a2c`, непрозрачное | TextField, TextAreaField, Select, MediaSourceField |
|
||||
| Модальное окно | `15 15 17 / .97` | FeatureSettingsWindow, Window |
|
||||
| Выпадающее меню | `15 15 17 / .98` | Dropdown, Select portal |
|
||||
| Основное действие | `247 248 244 / .96`; тёмный текст | Button |
|
||||
|
||||
ApplicationPanel → SettingsCard → GlassSurface tone="soft" → поля — общая
|
||||
композиция вложенной формы. Каждая роль выбирается компонентом, а не локальной
|
||||
заливкой. Не накладывать всё новые полупрозрачные карточки: на глубине их цвет
|
||||
приближается к полю. Вложенная область имеет непрозрачную подложку.
|
||||
Не помещать дополнительную карточку вокруг каждого отдельного поля.
|
||||
ApplicationPanel → SettingsCard → поля — композиция, проверенная в работающих
|
||||
настройках Mission Core. Сетка полей прозрачная, без отдельной подложки и отступов.
|
||||
Самостоятельный элемент коллекции может использовать GlassSurface tone="group":
|
||||
тот же нейтральный материал SettingsCard, а не почти чёрный canvas-soft.
|
||||
Не добавлять карточку вокруг списка карточек или вокруг каждого поля; максимум
|
||||
два уровня групп сохраняют отличие непрозрачного поля от подложки.
|
||||
|
||||
Исправление 2026-11-05: прежний пример с tone="soft" ошибочно переносил цвет
|
||||
вторичного canvas в формы. Значение soft сохранено для его исходной роли;
|
||||
приложения исправляют композицию, а не перекрашивают canvas локальным CSS.
|
||||
|
||||
Основной/вторичный/приглушённый/недоступный текст использует оттенок
|
||||
`247 248 244` с непрозрачностью `.96 / .72 / .48 / .34`. Состояния hover,
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
box-shadow: var(--nodedc-glass-control-shadow);
|
||||
}
|
||||
|
||||
/* Form collections share SettingsCard's neutral group, not the recessed canvas. */
|
||||
.nodedc-glass[data-tone="group"] {
|
||||
background: var(--nodedc-surface-group);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.nodedc-glass[data-radius="panel"] {
|
||||
border-radius: var(--nodedc-radius-panel);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createGlassMaterialVariables, type GlassMaterialSettings } from "@noded
|
||||
import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
||||
import { cn } from "./cn.js";
|
||||
|
||||
export type GlassTone = "default" | "strong" | "soft";
|
||||
export type GlassTone = "default" | "strong" | "soft" | "group";
|
||||
export type GlassRadius = "card" | "panel" | "modal" | "pill";
|
||||
export type GlassPadding = "none" | "sm" | "md" | "lg";
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"summary": "Canonical Mission Core theme foundation shared by React, DOM and body portals.",
|
||||
"rules": [
|
||||
"Colors belong to tokens/themes.css; applications select a preset and may provide an explicit user accent.",
|
||||
"ApplicationPanel → SettingsCard → GlassSurface tone=soft → field is the admitted nested form hierarchy. Never synthesize translucent app-local cards.",
|
||||
"ApplicationPanel → SettingsCard → fields matches Mission Core forms. Collection entries may use GlassSurface tone=group; never wrap field grids in recessed soft surfaces or add a card around a list of cards.",
|
||||
"No decorative outlines; keyboard focus, disabled states and semantic error/success indicators remain visible."
|
||||
],
|
||||
"documentation": "../docs/THEMING.md"
|
||||
@@ -134,7 +134,7 @@
|
||||
"The default Mission Core foundation supplies surfaces, avatars and dot statuses across portals without changing geometry.",
|
||||
"Compact rails of canonical round actions use the pill radius; consumers do not recreate it with a local border radius.",
|
||||
"A material rim is a glass highlight, not a hard product-colored border.",
|
||||
"Nested surfaces must use a softer tone to avoid card-inside-card noise.",
|
||||
"Form collections use tone=group, the same neutral material as SettingsCard. tone=soft is a recessed secondary canvas, never a form-grid background.",
|
||||
"GlassMaterialSurface supports modal/Inspector floating material and explicit context=scene telemetry overlays over rendered imagery; ordinary panels remain matte. Optional material and radiusPx apply appearance to one instance without changing the global theme.",
|
||||
"MapGlassSurface is restricted to overlays over Cesium/map imagery and must match the map Toolbar translucency.",
|
||||
"Theme edges=flat removes decorative rims and active outlines across portals; keyboard focus uses contrasting fill without changing geometry."
|
||||
@@ -950,7 +950,8 @@
|
||||
"Section and empty-state titles use the compact md token; descriptions use sm. Page/window title sizes and browser heading defaults are forbidden inside cards.",
|
||||
"Unclassed paragraphs in the body, including nested layout groups, share Description typography as a compatibility safeguard. New explanatory copy must use Description; headings and controls retain their own typography.",
|
||||
"Use Switch for compact visibility/enable states; use Checker for the Engine inspector treatment.",
|
||||
"Switch keeps its track width beside wrapped labels. The checked thumb uses on-accent contrast; the unchecked track follows theme text instead of a fixed white tint."
|
||||
"Switch keeps its track width beside wrapped labels. The checked thumb uses on-accent contrast; the unchecked track follows theme text instead of a fixed white tint.",
|
||||
"Fields sit directly in the card body, as in Mission Core. Layout grids are transparent; use at most one additional neutral group for a collection entry, not a card around the entire form."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user