merge: preserve compact typography alongside shared Mission theme updates

This commit is contained in:
Codex
2026-11-11 23:55:19 +03:00
22 changed files with 435 additions and 126 deletions
+2
View File
@@ -12,6 +12,8 @@ Before adding UI to a NODE.DC application:
Canonical source limits:
- Mission Core is the owner-approved dark-theme reference (2026-11-05). Its audited palette and shared operator presentation are maintained here; apps consume `missionDarkTheme`, not copied CSS.
- Launcher/Hub, CMS and SEO are the reference product family for application shell, headers, windows and common controls.
- From Engine, only the redesigned environment settings, shared glass controls and NDC agent inspector are approved reference sources.
- Legacy Engine inspectors and legacy Engine plates are explicitly non-canonical.
+16 -12
View File
@@ -2,6 +2,7 @@ import { OperationalTypographyDemo } from "./OperationalTypographyDemo";
import { useCallback, useEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from "react";
import { applyGlassMaterial, applyNodedcTheme, defaultGlassMaterial, type GlassMaterialSettings, type NodedcTheme, type RgbTuple } from "@nodedc/ui-core";
import { createTemplateFeatures, getPageTemplate, pageTemplates, type PageTemplateDefinition } from "@nodedc/page-patterns";
import {MissionThemeExample} from './MissionThemeExample';
import {EditorDockExample} from './EditorDockExample';
import {
ActivityIndicator,
@@ -37,7 +38,6 @@ import {
ResizableViewport,
SceneAnnotation,
HeaderNavigation,
HeaderProfile,
HeaderWorkspace,
Icon,
IconButton,
@@ -124,7 +124,8 @@ const designProfileDocumentPath = (reference: { id: string; version: string; sta
);
const accents: Array<{ label: string; value: RgbTuple; hex: string }> = [
{ label: "NODE.DC", value: [255, 47, 146], hex: "#ff2f92" },
{ label: "Mission Core", value: [247, 248, 244], hex: "#f7f8f4" },
{ label: "Rose", value: [255, 47, 146], hex: "#ff2f92" },
{ label: "Rose", value: [255, 62, 108], hex: "#ff3e6c" },
{ label: "Blush", value: [255, 108, 175], hex: "#ff6caf" },
{ label: "Magenta", value: [215, 70, 255], hex: "#d746ff" },
@@ -150,7 +151,7 @@ const materialDefaults: Record<NodedcTheme, MaterialDraft> = {
panelOpacity: 100,
fieldHex: "#2a2a2c",
fieldOpacity: 100,
nestedHex: "#0b0b0d",
nestedHex: "#0d0d0f",
},
light: {
panelHex: "#ffffff",
@@ -338,7 +339,7 @@ function Preview({ title, note, children, className }: {
export function CatalogApp() {
const [theme, setTheme] = useState<NodedcTheme>("dark");
const [accentHex, setAccentHex] = useState("#ff2f92");
const [accentHex, setAccentHex] = useState("#f7f8f4");
const [materialByTheme, setMaterialByTheme] = useState<Record<NodedcTheme, MaterialDraft>>(() => ({
dark: { ...materialDefaults.dark },
light: { ...materialDefaults.light },
@@ -391,7 +392,7 @@ export function CatalogApp() {
const [glowDistance, setGlowDistance] = useState(105);
const [usePortColors, setUsePortColors] = useState(false);
const [connectionType, setConnectionType] = useState("spline");
const [lightColor, setLightColor] = useState("#ff2f92");
const [lightColor, setLightColor] = useState("#f7f8f4");
const [connectionColor, setConnectionColor] = useState("#404040");
const [fillColor, setFillColor] = useState("#ff6caf");
const [fillOpacity, setFillOpacity] = useState(100);
@@ -412,7 +413,8 @@ export function CatalogApp() {
const [splitPaneDemoSize, setSplitPaneDemoSize] = useState(50);
const [sidePanelDemoOpen, setSidePanelDemoOpen] = useState(true);
const [createModalOpen, setCreateModalOpen] = useState(false);
const [missionAppearance, setMissionAppearance] = useState(false);
const [missionAppearance, setMissionAppearance] = useState(true);
const [flatEdges, setFlatEdges] = useState(true);
const [featureSettingsDemoOpen, setFeatureSettingsDemoOpen] = useState(false);
const [featureSettingsDemoSection, setFeatureSettingsDemoSection] = useState('general');
const [confirmOpen, setConfirmOpen] = useState(false);
@@ -552,6 +554,7 @@ export function CatalogApp() {
applyNodedcTheme(document.documentElement, {
theme,
appearance: missionAppearance ? "mission" : "default",
edges: flatEdges ? "flat" : "default",
accent,
material: {
panel: panelMaterial,
@@ -561,7 +564,7 @@ export function CatalogApp() {
},
});
document.documentElement.style.setProperty("--nodedc-canvas-soft", material.nestedHex);
}, [accent, fieldMaterial, material.fieldOpacity, material.nestedHex, material.panelOpacity, panelMaterial, theme, missionAppearance]);
}, [accent, fieldMaterial, material.fieldOpacity, material.nestedHex, material.panelOpacity, panelMaterial, theme, missionAppearance, flatEdges]);
useEffect(() => {
applyGlassMaterial(document.documentElement, glassMaterial);
@@ -1395,6 +1398,7 @@ export function CatalogApp() {
case "controls":
return (
<div className="catalog-grid">
<Preview title="Mission Core" note="canonical foundation / nested fields / portal" className="catalog-preview--wide"><MissionThemeExample/></Preview>
<Preview title="Navigation cube" note="faces / edges / corners"><NavigationCube edgeOpacity={cubeEdgeOpacity} size={cubeSize} quaternion={[.28,-.36,.12,.88]} onSelect={setCubeDirection}/><RangeControl label="Размер 3D-куба" value={cubeSize} min={48} max={160} step={1} onChange={setCubeSize} formatValue={v=>`${v} px`}/><RangeControl label="Прозрачность линий куба" value={1-cubeEdgeOpacity} min={0} max={1} step={.05} onChange={v=>setCubeEdgeOpacity(1-v)} formatValue={v=>`${Math.round(v*100)}%`}/><p>{cubeDirection.join(" · ")}</p></Preview>
<Preview title="Selection" note="integrated / split / inline">
<div className="catalog-form">
@@ -1411,7 +1415,7 @@ export function CatalogApp() {
</FieldFrame>
<FieldFrame label="Engine / split select">
<Select
variant="split"
variant="split" shape="pill"
label="Тип связи"
value={connectionType}
options={[
@@ -1798,7 +1802,7 @@ export function CatalogApp() {
<p className="catalog-preview__explanation">Destructive-цвет появляется только у подтверждения.</p>
<Button variant="danger" shape="pill" icon={<Icon name="trash" />} onClick={() => setConfirmOpen(true)}>Проверить удаление</Button>
</Preview>
<Preview title="Настройки модуля" note="адаптивное меню и форма" className="catalog-modal-preview"><Switch label="Визуальный профиль Mission Core" checked={missionAppearance} onChange={setMissionAppearance} />
<Preview title="Настройки модуля" note="адаптивное меню и форма" className="catalog-modal-preview"><Switch label="Без декоративных обводок" checked={flatEdges} onChange={setFlatEdges} /><Switch label="Визуальный профиль Mission Core" checked={missionAppearance} onChange={setMissionAppearance} />
<Button icon={<Icon name="settings" />} onClick={() => setFeatureSettingsDemoOpen(true)}>Открыть настройки модуля</Button>
</Preview>
<Preview title="Workflow sharing" note="ENGINE / access" className="catalog-modal-preview">
@@ -2170,10 +2174,11 @@ export function CatalogApp() {
/>
</>
}
// The shared profile owns its responsive label; consumers do not size it.
right={
<HeaderProfile>
<IconButton label="Уведомления"><Icon name="inbox" size={20} strokeWidth={1.7} /></IconButton>
<UserProfileMenu
triggerLabel="Профиль"
triggerIcon="inbox"
displayName={sessionProfile?.user?.displayName || "Профиль"}
subtitle={sessionProfile?.user?.email || "NODE.DC Foundry"}
avatarUrl={sessionProfile?.user?.avatarUrl || undefined}
@@ -2183,7 +2188,6 @@ export function CatalogApp() {
{ id: "logout", label: "Выйти", icon: "external", href: "/auth/logout" },
]}
/>
</HeaderProfile>
}
/>
}
+1 -1
View File
@@ -15,7 +15,7 @@ export function EnvironmentCatalogDemo() {
useEffect(() => () => urls.current.forEach(url => URL.revokeObjectURL(url)), []);
return <>
<div className="catalog-environment-actions">
<UserProfileMenu displayName="DC" subtitle="Каталог компонентов" triggerLabel={null}
<UserProfileMenu variant="default" displayName="DC" subtitle="Каталог компонентов" triggerLabel={null}
actions={[{ id: "settings", label: "Настройки", icon: "settings", onSelect: () => setOpen(true) }]} />
<Button variant="primary" tone="neutral" onClick={() => setOpen(true)}>Настройки окружения</Button>
<Button variant="primary" tone="neutral" disabled>Неактивное действие</Button>
+28
View File
@@ -0,0 +1,28 @@
import {useState} from 'react';
import {Button, Description, FeatureSettingsWindow, GlassSurface, Select, SettingsCard, StatusBadge, Switch, TextAreaField, TextField} from '@nodedc/ui-react';
/** Living acceptance fixture. All materials and control states come from the library. */
export function MissionThemeExample() {
const [open,setOpen]=useState(false);
const [name,setName]=useState('Mission Core');
const [enabled,setEnabled]=useState(true);
const [mode,setMode]=useState('review');
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/>
</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>Поля лежат прямо в 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>
</SettingsCard>;
}
+1
View File
@@ -2304,3 +2304,4 @@ textarea {
grid-template-columns: 1fr;
}
}
.catalog-theme-fields { display: grid; gap: var(--nodedc-space-4); }
+62 -3
View File
@@ -2,7 +2,7 @@
## Текущее состояние
Первый этап не меняет существующие приложения. Репозиторий фиксирует baseline и создаёт пакетный контракт. Это позволяет продолжать текущую разработку без одномоментной переделки Engine, Ops, BIM, CMS, SEO и Launcher.
Пакетный контракт действует: CMS использует общие tokens, ui-core, ui-dom и ui-react, включая принятую тему Mission Core; Device Core использует общую шапку. Точные consumer pins и границы приведены ниже. Остальные приложения переводятся по отдельным проверенным этапам; наличие общего компонента не означает автоматическую миграцию всех consumer.
## Рекомендуемый порядок
@@ -27,7 +27,7 @@
### 3. CMS и SEO
Используют те же компоненты и механику окон. CMS подключает DOM-layer, SEO — React-layer. Первым общим admin pattern подключается `MediaSourceField`/`createMediaSourceController`; storage API остаётся в приложении. Цветовые различия оформляются theme overrides.
Используют те же компоненты и механику окон. CMS уже подключает DOM-layer и контролируемые React islands; целевой слой SEO — React. Общий admin pattern `MediaSourceField`/`createMediaSourceController`; storage API остаётся в приложении. Цветовые сочетания определяются библиотечным theme preset, без локальных копий палитры.
### 4. Engine
@@ -62,7 +62,8 @@
| --- | --- | --- | --- |
| Launcher/Hub | React/local shared | React | header, button, dropdown, window |
| SEO | React/local overrides | React | theme, window, field, select |
| CMS | Vanilla DOM | DOM | theme, header, modal, select |
| CMS | Пакеты + тонкий DOM/React adapter | Подключено, domain UI остаётся в CMS | Mission theme, shell/header, forms, modal, controls |
| Device Core | Общий UserProfileMenu, pin 06cb8ad | Шапка подключена, формы без изменений | responsive profile, menu, avatar |
| Engine | React/mixed generations | React | new inspector and environment settings only |
| Ops | React/Plane packages | React | floating behavior and modal primitives |
| BIM Viewer | Vanilla JS | DOM | tokens, glass select, settings surfaces |
@@ -87,3 +88,61 @@ The component contract and catalog example are in `ENVIRONMENT_SETTINGS.md`.
## Mission Core loading (2026-09-08)
Core и Node используют общий sensor-ui/X4 frontend с Button.loading, IconButton.loading и LoadingRegion из Design Guideline. SDK/network semantics остаются в consumer, геометрия ожидания принадлежит DG. Этот локальный кандидат передаётся через source manifest с hashes вместе с Node installer; public npm release не публиковался, исходники компонентов в приложение не копируются.
## DC CMS package adoption (2026-11-05)
DC_CMS now consumes the immutable npm distributions of tokens, ui-core, ui-dom
and ui-react, pinned to a canonical source SHA plus package hashes in the
consumer's `ui/design-system.lock.json`. Its build renders AppHeader,
ApplicationShell, AdminNavigationPanel, ApplicationPanel and control templates
from exports. Select, Switch, RangeControl, ProgressBar, StatusBadge and Dropdown
run directly as controlled React islands. Core CSS and tokens are bundled once.
The thin compatibility adapter is `DC_CMS/ui/src/design-system.mjs`: it retains
native CMS form/model bindings and listeners, adopts generated field/card/button
anatomy, uses ui-dom modal/workspace controllers and connects MediaSourceField's
DOM contract to the existing CMS file manager. Folder columns, editable block
collections and knowledge content remain domain UI. No package source is copied
or maintained as a local component fork. Remove this adapter as those domain
renderers move to direct component composition. CMS CI rejects stale generated
assets; the existing Git-to-canonical-runner deployment foundation is unchanged.
CMS visual follow-up, 2026-11-05: flat theme edges, neutral white default accent,
UserProfileMenu with a session avatar and inbox glyph, FeatureSettingsWindow,
ColorField, pill-shaped split Select, and the canonical six-dot DragHandle.
UI preferences belong to browser-local storage; site content and deployment
credentials stay in the existing CMS model. Immutable npm snapshots retain
package semver and are identified by source commit plus archive SHA-256.
CMS uses `UserProfileMenu`: profile label, menu icon, avatar.
The menu opens settings; the application does not add a fourth action.
Device Core and CMS share the complete `UserProfileMenu` header, not local copies.
The reference composition is the existing rounded profile group in Launcher/Hub
and Engine (`EnginePlatformHeader.tsx` / `TopBar.tsx`); its reusable geometry is
already in AppHeader, HeaderProfileButton, IconButton and HeaderAvatar. The owner
confirmed the order profile → inbox → avatar and settings inside the middle
icon's menu on 2026-11-05. No application CSS overrides are needed.
Device Core retains session identity, profile URL, permissions and logout actions.
### 2026-11-05 — Mission dark foundation → CMS
Owner selected the running local Mission Core as the canonical dark reference.
Source audit: b0332fa, styles/base.css and main.tsx; uncommitted simulation changes excluded.
The complete Mission/flat preset now lives in tokens + ui-core, exported for React and DOM consumers.
CMS consumes the immutable packages and retains only domain layout/event adapters.
Nested forms use SettingsCard with a transparent layout grid and opaque fields; collection entries use GlassSurface group. The soft canvas is not a form-group material; 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.
+21 -2
View File
@@ -8,7 +8,8 @@
- `default` — обычная карточка/панель;
- `strong` — dropdown, modal и поверхность над сложным фоном;
- `soft` — вложенная или вторичная область.
- `soft` — утопленная вторичная область / canvas, не подложка формы;
- `group` — нейтральная группа как SettingsCard, для самостоятельного элемента коллекции.
`radius="pill"` задаёт каноническую капсульную геометрию через `--nodedc-radius-circle`. Она предназначена, в частности, для компактных вертикальных и горизонтальных реек из круглых действий: верхняя и нижняя части поверхности повторяют круг кнопок без прямых торцевых пролётов. Consumer не воспроизводит этот радиус локальным CSS.
@@ -228,7 +229,14 @@ Pill navigation для верхней панели и компактного п
## UserProfileMenu
Каноническая выпадашка профиля для правой группы `AppHeader`. Она использует
Каноническая правая группа `AppHeader`: «Профиль» → inbox → аватар.
`UserProfileMenu` владеет всей группой, включая `HeaderProfile`; приложение
передаёт только identity и действия. Настройки находятся в меню, отдельной
шестерёнки после аватара нет. Нельзя добавлять внешнюю обёртку или локальные
отступы. Все три элемента открывают меню; Escape возвращает фокус на вызвавшую кнопку.
На узком экране подпись скрывается по общей адаптивной механике; иконка и аватар остаются доступны.
Она использует
общий portal `Dropdown`, показывает identity cover с аватаром, именем и
подписью и принимает список application-owned действий.
@@ -539,3 +547,14 @@ Window header actions default to before the move toggle. `headerActionsPlacement
Window, WorkspaceWindow, ApplicationPanel and AdminPanel establish an independent compact md text base, including portals. Native semantic headings inside operational surfaces use md unless an explicit canonical title rule applies. Use Description for result/error/pending paragraphs. The living catalog includes a typography example with values, nested headings and a status dialog. See OPERATIONAL_TYPOGRAPHY.md and the exported build-time `@nodedc/ui-core/typography` contract.
## Flat surface profile and profile trigger
The shared theme supports `edges: "flat"` for borderless surfaces, including portal windows. Keyboard focus changes the fill and foreground instead of adding an outline. The living catalog exposes this alongside the Mission appearance switch. `UserProfileMenu` composes the canonical profile label, independent inbox/menu button and avatar. CMS puts settings inside that menu. No additional settings button or HeaderProfile wrapper is needed; spacing comes from existing HeaderProfileButton and IconButton geometry.
`Select variant="split" shape="pill"` aligns a compact workspace/site selector with adjacent round actions, preserving the shared dimensions and keyboard behavior.
## Mission Core theme foundation
`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 содержит форму и её портальную версию.
+66 -62
View File
@@ -1,78 +1,82 @@
# Темы и цвет приложения
## Основное правило
## Один фундамент
NODE.DC-приложения отличаются цветовой схемой, а не набором заново нарисованных компонентов. Тема задаёт значения CSS custom properties. Компоненты сохраняют геометрию, состояния и поведение.
С 2026-11-05 основа тёмной темы — проверенный локальный Mission Core
(`b0332fa`, `apps/control-station/src/styles/base.css`, работающий интерфейс
`127.0.0.1:8000`). Цвета находятся только в `@nodedc/tokens/themes.css`,
геометрия и состояния — в `@nodedc/ui-core`, компоненты — в `@nodedc/ui-react`.
Приложение выбирает тему, а не повторяет цвета, селекторы или устройство компонентов.
## Что меняет тема
```ts
import {applyNodedcTheme, missionDarkTheme} from '@nodedc/ui-core';
applyNodedcTheme(document.documentElement, missionDarkTheme);
```
- canvas/background;
- основной и вторичный текст;
- accent и автоматически вычисляемый on-accent;
- цвет непрозрачных application surfaces;
- field/control surfaces;
- overlay;
- тени controls и modal material;
- semantic success/warning/danger tones при необходимости.
Те же exports доступны из `@nodedc/ui-dom`. `applyNodedcTheme(root)` по умолчанию
выбирает `dark / mission / flat`. `missionLightTheme` сохраняет общую геометрию
и даёт светлую тему. Установка на `document.documentElement` обязательна для
приложения с порталами: меню и модальные окна получают тот же профиль.
## Что тема не меняет
## Роли поверхностей
- высоту контролов;
- радиусы по классам компонентов;
- положение логотипа;
- механику окна и dropdown;
- DOM anatomy;
- keyboard behavior;
- расположение footer actions;
- API React/DOM компонентов.
| Роль | Тёмная тема | Компонент |
| --- | --- | --- |
| Фон приложения | `#050506` | ApplicationShell |
| Рабочая сцена | `#08090b` | доменный viewport, token `--nodedc-stage` |
| Панель | `#151517` | ApplicationPanel, AdminNavigationPanel |
| Группа | нейтральный слой `110 110 110 / .07` | SettingsCard |
| Элемент коллекции | нейтральный слой `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 |
## Presets
ApplicationPanel → SettingsCard → поля — композиция, проверенная в работающих
настройках Mission Core. Сетка полей прозрачная, без отдельной подложки и отступов.
Самостоятельный элемент коллекции может использовать GlassSurface tone="group":
тот же нейтральный материал SettingsCard, а не почти чёрный canvas-soft.
Не добавлять карточку вокруг списка карточек или вокруг каждого поля; максимум
два уровня групп сохраняют отличие непрозрачного поля от подложки.
В baseline включены `dark` и `light`. Это не два отдельных продукта, а примеры одного контракта:
Исправление 2026-11-05: прежний пример с tone="soft" ошибочно переносил цвет
вторичного canvas в формы. Значение soft сохранено для его исходной роли;
приложения исправляют композицию, а не перекрашивают canvas локальным CSS.
- dark соответствует текущей основной семье Launcher/Hub/CMS;
- light воспроизводит SEO-поверхности: `#ececec` canvas, белые панели и поля, тёмный текст, чёрные primary actions и мягкую тень у белых secondary controls;
- конкретный продукт может поверх preset задать свой accent и surface variables.
Основной/вторичный/приглушённый/недоступный текст использует оттенок
`247 248 244` с непрозрачностью `.96 / .72 / .48 / .34`. Состояния hover,
active, focus, disabled задаёт библиотека; приложения не переопределяют их.
Hover поля использует собственный непрозрачный материал, а не полупрозрачную
заливку кнопки: поле не исчезает при наведении.
Декоративные рамки и контуры отсутствуют. Клавиатурный фокус остаётся видимым
через контрастную заливку. Success/warning/danger сохраняют смысловые цвета
индикаторов; цвет акцента не подменяет состояние ошибки.
## Accent
## Акцент и настройки
Accent задаётся RGB tuple. On-accent вычисляется по luminance и не должен вручную прописываться белым или чёрным в отдельном компоненте.
Базовый акцент тёмной темы — `247 248 244`, светлой — `24 25 28`.
Пользовательский `accent` остаётся допустимой настройкой активных контролов.
`on-accent` вычисляется библиотекой по яркости. Нейтральное основное действие
остаётся нейтральным. Возврат к теме вызывает `clearNodedcAccent(root)`, затем
`applyNodedcTheme`; удалять пользовательское значение без явного сброса нельзя.
Материалы можно исследовать в каталоге; приложения не должны хранить собственный
набор цветов для восстановления стандартной темы.
Default accent текущего NODE.DC shell — `#ff2f92`. `ColorField` открывает единый portal-picker с saturation/value plane, hue slider, HEX и быстрыми цветами — системный `input[type=color]` не является runtime UI. Изменение accent сразу меняет Environment Settings, active actions, range fill, media file action и theme-aware window states без создания новой темы или fork компонентов. Blur, gloss и material rim не наследуются application panels: это материал только для floating modal и portal-dropdown/select.
В светлой теме canvas — `#ececec`, панели и поля — белые, группы и вложенные
области — `#f4f4f4`. Белое поле различимо внутри группы.
Map-glass остаётся отдельным светлым полупрозрачным материалом над изображением;
он не заменяет обычную тему форм, панелей и портальных окон.
Semantic status не обязан совпадать с accent. Например, ошибка остаётся danger, даже если приложение использует красный брендовый accent.
## Проверка и совместимость
## Область применения
Living catalog: Controls → Mission Core. Проверяются вложенная форма, текст,
select, textarea, disabled, переключатель, статус и то же содержимое в портальном
окне; дополнительно проверяются клавиатура и обе темы. CMS использует этот же
профиль и immutable npm-пакеты, не копию исходников компонентов.
Тема может быть установлена:
- на корневом `html/body` для всего приложения;
- на контейнере embedded-модуля;
- на catalog preview для сравнения схем.
Portal-компоненты рендерятся в `document.body`, поэтому приложение должно либо задавать тему на `document.documentElement`, либо передавать согласованные переменные на body. Локальная тема глубоко внутри React subtree не сможет автоматически охватить portal без отдельного theme portal root.
Map-glass overlays являются отдельной, независимой от application theme
поверхностью поверх imagery. Их светлые translucent controls используют
`--nodedc-map-glass-text`, а непрозрачное светлое поле поиска обязано брать
тёмный foreground из `--nodedc-map-field-text` и placeholder из
`--nodedc-map-field-text-muted`. Светлый field не наследует белый текст
map-glass родителя. `ApplicationSidePanel`, напротив, находится вне imagery и
всегда наследует обычные theme-aware application panel/text tokens; при смене
dark/light она меняется синхронно с `AdminNavigationPanel`.
## Совместимость
Существующие `--nodedc-*` имена сохранены намеренно. Это уменьшает стоимость будущего подключения Launcher, Engine, Task Manager и BIM Viewer.
## Mission Core operator appearance
`applyNodedcTheme(document.documentElement, { theme, accent, appearance: "mission" })`
selects the shared visual profile qualified against Mission Core on 2026-09-30.
It covers body portals, dark modal/floating fills, plain avatar surfaces,
neutral actions and semantic dot statuses. `default` remains compatible with
other consumers. Light theme retains its legible light surfaces. Reapplying
`default` removes the profile through the data attribute, without CSS cleanup.
Feature settings use the same geometry, focus, scrolling and responsive behavior.
Application code owns section names and icons; tracker/VPS sections follow the
text-only Mission equipment menu. Environment settings may retain their icons.
`appearance: "default", edges: "default"` оставлены для явной совместимости
со старой презентацией компонентов. Новые потребители используют Mission.
Эта ревизия не меняет локальный Mission Core и его незакоммиченные эксперименты.
Его прежние локальные CSS-дубли зафиксированы как миграционный долг: перенос
зависимости требует отдельной проверки приложения, а не незаметной замены пакетов.
+4 -2
View File
@@ -11,7 +11,7 @@
"scripts": {
"build": "npm run build --workspace @nodedc/ui-core && npm run build --workspace @nodedc/ui-dom && npm run build --workspace @nodedc/ui-react && npm run build --workspace @nodedc/page-patterns && npm run build --workspace @nodedc/map-cesium-react && npm run build --workspace @nodedc/ui-catalog",
"build:packages": "npm run build --workspace @nodedc/ui-core && npm run build --workspace @nodedc/ui-dom && npm run build --workspace @nodedc/ui-react && npm run build --workspace @nodedc/page-patterns && npm run build --workspace @nodedc/map-cesium-react",
"check": "npm run test:typography && npm run build:packages && npm run typecheck --workspaces --if-present && npm run validate:registry && npm run test:spark-governance && npm run test:analysis-controls && npm run test:activity-indicator && npm run test:control-density && npm run test:icon-contract && npm run test:toast-contract && npm run test:floating-position && npm run test:inspector-select && npm run test:range-control && npm run test:split-pane && npm run test:dock-layout && npm run test:hgeozone-projection && npm run test:map-grid-lod && npm run test:map-filters && npm run test:map-object-layers && npm run test:map-inspector-overlay-state && npm run test:map-reference-stations && npm run test:map-search && npm run test:map-subject-card && npm run test:map-subject-detail-profile && npm run test:environment-settings && npm run test:settings-surfaces && npm run test:window-geometry && npm run test:editor-dock",
"check": "npm run test:typography && npm run build:packages && npm run typecheck --workspaces --if-present && npm run validate:registry && npm run test:spark-governance && npm run test:analysis-controls && npm run test:activity-indicator && npm run test:control-density && npm run test:icon-contract && npm run test:toast-contract && npm run test:floating-position && npm run test:inspector-select && npm run test:range-control && npm run test:split-pane && npm run test:dock-layout && npm run test:hgeozone-projection && npm run test:map-grid-lod && npm run test:map-filters && npm run test:map-object-layers && npm run test:map-inspector-overlay-state && npm run test:map-reference-stations && npm run test:map-search && npm run test:map-subject-card && npm run test:map-subject-detail-profile && npm run test:environment-settings && npm run test:settings-surfaces && npm run test:window-geometry && npm run test:editor-dock && npm run test:flat-theme && npm run test:mission-theme",
"dev": "npm run build:packages && npm run dev --workspace @nodedc/ui-catalog",
"serve": "node server/catalog-server.mjs",
"validate:registry": "node scripts/validate-registry.mjs",
@@ -47,7 +47,9 @@
"test:window-geometry": "node --test scripts/window-geometry.test.mjs",
"test:editor-dock": "node --test scripts/editor-dock.test.mjs",
"test:typography": "node --test scripts/operational-typography.test.mjs",
"prebuild": "npm run test:typography"
"prebuild": "npm run test:typography",
"test:flat-theme": "node --test scripts/flat-theme.test.mjs",
"test:mission-theme": "node --test scripts/mission-theme.test.mjs"
},
"engines": {
"node": ">=20"
+31 -5
View File
@@ -1,4 +1,5 @@
:root {
--nodedc-field-hover-bg: color-mix(in srgb, var(--nodedc-field-bg) 94%, var(--nodedc-text-primary));
--nodedc-neutral-action-bg: rgba(247, 248, 244, 0.96);
--nodedc-neutral-action-hover: #fff;
--nodedc-neutral-action-color: rgba(8, 8, 10, 0.96);
@@ -9,14 +10,16 @@
:root,
[data-nodedc-theme="dark"] {
color-scheme: dark;
--nodedc-accent-rgb: 255 47 146;
--nodedc-on-accent-rgb: 11 17 23;
--nodedc-accent-rgb: 247 248 244;
--nodedc-on-accent-rgb: 8 8 10;
--nodedc-danger-rgb: 255 116 116;
--nodedc-warning-rgb: 255 209 102;
--nodedc-success-rgb: 181 255 90;
--nodedc-canvas: #050506;
--nodedc-canvas-soft: #0b0b0d;
--nodedc-canvas-soft: #0d0d0f;
--nodedc-stage: #08090b;
--nodedc-surface-group: rgba(110, 110, 110, 0.07);
--nodedc-text-primary: rgba(247, 248, 244, 0.96);
--nodedc-text-secondary: rgba(247, 248, 244, 0.72);
--nodedc-text-muted: rgba(247, 248, 244, 0.48);
@@ -82,14 +85,16 @@
[data-nodedc-theme="light"] {
color-scheme: light;
--nodedc-accent-rgb: 255 47 146;
--nodedc-on-accent-rgb: 11 17 23;
--nodedc-accent-rgb: 24 25 28;
--nodedc-on-accent-rgb: 247 248 244;
--nodedc-danger-rgb: 205 47 67;
--nodedc-warning-rgb: 173 111 0;
--nodedc-success-rgb: 46 125 76;
--nodedc-canvas: #ececec;
--nodedc-canvas-soft: #f4f4f4;
--nodedc-stage: #ececec;
--nodedc-surface-group: #f4f4f4;
--nodedc-text-primary: rgba(18, 20, 22, 0.96);
--nodedc-text-secondary: rgba(18, 20, 22, 0.7);
--nodedc-text-muted: rgba(18, 20, 22, 0.48);
@@ -152,3 +157,24 @@
--nodedc-modal-shadow: 0 24px 72px rgb(0 0 0 / var(--nodedc-modal-glass-shadow-light-opacity)), inset 0 1px 0 rgba(255, 255, 255, 0.8);
--nodedc-floating-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.72)), rgba(255, 255, 255, 0.94);
}
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] {
--nodedc-modal-surface: rgb(15 15 17 / .97);
--nodedc-floating-surface: rgb(15 15 17 / .98);
--nodedc-primary-action-bg: rgb(247 248 244 / .96);
--nodedc-primary-action-hover: rgb(255 255 255);
--nodedc-primary-action-color: rgb(8 8 10 / .96);
--nodedc-primary-action-shadow: none;
--nodedc-focus-surface: rgb(255 255 255 / .09);
}
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] {
--nodedc-modal-surface: rgb(247 248 250 / .97);
--nodedc-floating-surface: rgb(247 248 250 / .98);
--nodedc-primary-action-bg: rgb(24 25 28 / .96);
--nodedc-primary-action-hover: rgb(8 8 10);
--nodedc-primary-action-color: rgb(247 248 244);
--nodedc-primary-action-shadow: none;
}
+14 -2
View File
@@ -15,12 +15,23 @@ export interface NodedcMaterial {
export interface ApplyThemeOptions {
theme?: NodedcTheme;
/** Operator UI qualified against Mission Core; opt-in across portals. */
/** Mission Core is the canonical foundation. `default` is legacy compatibility. */
appearance?: "default" | "mission";
/** Flat surfaces remove decorative edges; keyboard focus uses a contrasting fill. */
edges?: "default" | "flat";
accent?: RgbTuple;
material?: NodedcMaterial;
}
/** Complete shared foundation; colors live exclusively in @nodedc/tokens/themes.css. */
export const missionDarkTheme = Object.freeze({
theme: "dark", appearance: "mission", edges: "flat",
} as const satisfies ApplyThemeOptions);
export const missionLightTheme = Object.freeze({
theme: "light", appearance: "mission", edges: "flat",
} as const satisfies ApplyThemeOptions);
function formatRgb([red, green, blue]: RgbTuple): string {
return `${red} ${green} ${blue}`;
}
@@ -31,10 +42,11 @@ function clampOpacity(value: number): number {
export function applyNodedcTheme(
target: HTMLElement,
{ theme = "dark", accent, material, appearance = "default" }: ApplyThemeOptions = {},
{ theme = "dark", accent, material, appearance = "mission", edges = "flat" }: ApplyThemeOptions = {},
): void {
target.dataset.nodedcTheme = theme;
target.dataset.nodedcAppearance = appearance;
target.dataset.nodedcEdges = edges;
target.dataset.nodedcUi = "true";
if (accent) {
+40 -20
View File
@@ -77,6 +77,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);
}
@@ -434,7 +440,7 @@
}
.nodedc-field__control:hover:not(:disabled) {
background: var(--nodedc-glass-control-hover);
background: var(--nodedc-field-hover-bg);
}
.nodedc-field__control:focus-visible {
@@ -659,7 +665,7 @@ textarea.nodedc-field__control {
min-width: 0;
gap: 1rem;
border-radius: var(--nodedc-radius-card);
background: var(--nodedc-glass-control-bg);
background: var(--nodedc-surface-group);
padding: 1rem;
}
@@ -3929,6 +3935,7 @@ textarea.nodedc-field__control {
overflow: auto;
}
.nodedc-header__profile-button,
.nodedc-user-profile-menu__trigger-label {
display: none;
}
@@ -4391,26 +4398,11 @@ textarea.nodedc-field__control {
.nodedc-key-button:disabled { opacity:.4; cursor:not-allowed; }
.nodedc-key-button:focus-visible { outline:2px solid rgb(var(--nodedc-accent-rgb)); outline-offset:3px; }
/* Shared operator appearance, qualified against Mission Core 2026-09-30.
/* Canonical operator appearance, audited against Mission Core 2026-11-05.
Set on documentElement so modal and dropdown portals share the same profile. */
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] {
--nodedc-modal-surface: rgb(15 15 17 / .97);
--nodedc-floating-surface: rgb(15 15 17 / .98);
--nodedc-primary-action-bg: rgb(247 248 244 / .96);
--nodedc-primary-action-hover: rgb(255 255 255);
--nodedc-primary-action-color: rgb(8 8 10 / .96);
--nodedc-primary-action-shadow: none;
--nodedc-focus-surface: rgb(255 255 255 / .09);
}
[data-nodedc-appearance="mission"] .nodedc-glass-material::before { display: none; }
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] {
--nodedc-modal-surface: rgb(247 248 250 / .97);
--nodedc-floating-surface: rgb(247 248 250 / .98);
--nodedc-primary-action-bg: rgb(24 25 28 / .96);
--nodedc-primary-action-hover: rgb(8 8 10);
--nodedc-primary-action-color: rgb(247 248 244);
--nodedc-primary-action-shadow: none;
}
[data-nodedc-appearance="mission"] .nodedc-header__avatar { background: rgb(226 226 226); }
[data-nodedc-appearance="mission"][data-nodedc-theme="dark"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(247 248 244 / .14); }
[data-nodedc-appearance="mission"][data-nodedc-theme="light"] .nodedc-feature-settings__section[data-active="true"] { background: rgb(8 8 10 / .09); }
@@ -4705,3 +4697,31 @@ textarea.nodedc-field__control {
}
@keyframes nodedc-tooltip-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nodedc-tooltip { animation: none; } }
/* Opt-in flat material. Applies at the document root, including portal layers.
Focus remains visible through a high-contrast fill instead of a contour. */
[data-nodedc-edges="flat"] {
--nodedc-glass-outline: transparent;
--nodedc-glass-control-shadow: none;
--nodedc-panel-action-border: transparent;
--nodedc-panel-action-border-hover: transparent;
--nodedc-panel-action-shadow: none;
}
[data-nodedc-edges="flat"] .nodedc-material-rim::after,
[data-nodedc-edges="flat"] .nodedc-glass-material::before { display: none; }
[data-nodedc-edges="flat"] :is(.nodedc-admin-panel__nav-item, .nodedc-application-panel__action, .nodedc-admin-panel__close, .nodedc-media-source-button, .nodedc-media-preview, .nodedc-color-field__swatch) {
border: 0;
box-shadow: none;
}
[data-nodedc-edges="flat"] :is(button, input, textarea, [tabindex]):focus-visible {
outline: 0;
box-shadow: none;
background-color: var(--nodedc-text-primary);
color: var(--nodedc-canvas);
}
[data-nodedc-edges="flat"] .nodedc-admin-panel__nav-item:focus-visible .nodedc-admin-panel__nav-icon {
background: var(--nodedc-canvas);
color: var(--nodedc-text-primary);
}
.nodedc-select[data-shape="pill"] :is(.nodedc-select__value,.nodedc-select__toggle) { border-radius: var(--nodedc-radius-circle); }
+1 -1
View File
@@ -1,4 +1,4 @@
export { applyNodedcTheme, clearNodedcAccent, createAccentVariables, readableTextRgb } from "@nodedc/ui-core";
export { applyNodedcTheme, missionDarkTheme, missionLightTheme, clearNodedcAccent, createAccentVariables, readableTextRgb } from "@nodedc/ui-core";
export * from "./applicationWorkspace.js";
export * from "./floating.js";
export * from "./mediaSource.js";
+4 -3
View File
@@ -1,4 +1,4 @@
import type { ButtonHTMLAttributes, ReactNode } from "react";
import type { ButtonHTMLAttributes, ReactNode, Ref } from "react";
export interface AppHeaderProps {
brand: ReactNode;
@@ -74,10 +74,11 @@ export function HeaderNavigation<T extends string>({ label, value, items, onChan
export interface HeaderProfileProps {
children: ReactNode;
ref?: Ref<HTMLDivElement>;
}
export function HeaderProfile({ children }: HeaderProfileProps) {
return <div className="nodedc-header__profile">{children}</div>;
export function HeaderProfile({ children, ref }: HeaderProfileProps) {
return <div ref={ref} className="nodedc-header__profile">{children}</div>;
}
export interface HeaderProfileButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className" | "style"> {}
+1 -1
View File
@@ -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";
+4 -1
View File
@@ -29,6 +29,8 @@ export interface SelectProps<T extends string> {
menuWidth?: number | "anchor";
disabled?: boolean;
variant?: SelectVariant;
/** Split site/workspace selectors can align with adjacent circular actions. */
shape?: "default" | "pill";
className?: string;
triggerClassName?: string;
menuClassName?: string;
@@ -47,6 +49,7 @@ export function Select<T extends string>({
menuWidth = "anchor",
disabled = false,
variant = "integrated",
shape = "default",
className,
triggerClassName,
menuClassName,
@@ -88,7 +91,7 @@ export function Select<T extends string>({
};
if (resolvedVariant === "split") {
return (
<div className={cn("nodedc-select", triggerClassName)} data-disabled={disabled ? "true" : undefined}>
<div className={cn("nodedc-select", triggerClassName)} data-shape={shape === "pill" ? "pill" : undefined} data-disabled={disabled ? "true" : undefined}>
<div ref={setAnchorRef} className="nodedc-select__control">
<div className="nodedc-select__value">
{selected?.icon ? <span className="nodedc-select__value-icon">{selected.icon}</span> : null}
+28 -2
View File
@@ -1,6 +1,7 @@
import type { ReactNode } from "react";
import { Dropdown } from "./Dropdown.js";
import { HeaderAvatar } from "./AppHeader.js";
import { HeaderAvatar, HeaderProfile, HeaderProfileButton } from "./AppHeader.js";
import { IconButton } from "./Button.js";
import { Icon, type IconName } from "./Icon.js";
export interface UserProfileMenuAction {
@@ -15,19 +16,25 @@ export interface UserProfileMenuAction {
export interface UserProfileMenuProps {
displayName: string;
/** Header is canonical. "default" retains the legacy compact trigger outside headers. */
variant?: "default" | "header";
subtitle?: string;
avatarUrl?: string;
coverImageUrl?: string;
triggerLabel?: ReactNode;
/** Optional status glyph between the label and avatar. */
triggerIcon?: IconName;
actions: readonly UserProfileMenuAction[];
}
export function UserProfileMenu({
displayName,
variant = "header",
subtitle,
avatarUrl,
coverImageUrl,
triggerLabel,
triggerIcon,
actions,
}: UserProfileMenuProps) {
const label = displayName || "NODE.DC";
@@ -37,7 +44,25 @@ export function UserProfileMenu({
width={296}
offset={10}
surfaceClassName="nodedc-user-profile-menu"
trigger={({ open, toggle, setTriggerRef, surfaceId }) => (
trigger={({ open, toggle, setTriggerRef, setAnchorRef, surfaceId }) => variant === "header" ? (
<HeaderProfile ref={setAnchorRef}>
<HeaderProfileButton aria-haspopup="menu" aria-expanded={open} aria-controls={surfaceId} onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }}>
{triggerLabel ?? "Профиль"}
</HeaderProfileButton>
<IconButton
ref={setTriggerRef}
label={`Меню пользователя ${label}`}
aria-haspopup="menu"
aria-expanded={open}
aria-controls={surfaceId}
onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }}
><Icon name={triggerIcon ?? "inbox"} size={20} strokeWidth={1.7} /></IconButton>
<button type="button" className="nodedc-user-profile-menu__trigger" aria-label={`Профиль ${label}`} aria-haspopup="menu" aria-expanded={open} aria-controls={surfaceId}
onClick={(event) => { setTriggerRef(event.currentTarget); toggle(); }}>
<HeaderAvatar label={label} imageUrl={avatarUrl} />
</button>
</HeaderProfile>
) : (
<button
ref={setTriggerRef}
type="button"
@@ -49,6 +74,7 @@ export function UserProfileMenu({
onClick={toggle}
>
{triggerLabel === null ? null : <span className="nodedc-user-profile-menu__trigger-label">{triggerLabel ?? label}</span>}
{triggerIcon ? <Icon name={triggerIcon} size={18} /> : null}
<HeaderAvatar label={label} imageUrl={avatarUrl} />
</button>
)}
+34 -7
View File
@@ -1,6 +1,28 @@
{
"schemaVersion": "1.0.0",
"components": [
{
"id": "mission-theme",
"status": "baseline",
"package": "@nodedc/ui-core",
"exports": [
"applyNodedcTheme",
"missionDarkTheme",
"missionLightTheme"
],
"domContract": [
"data-nodedc-theme",
"data-nodedc-appearance",
"data-nodedc-edges"
],
"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 → 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"
},
{
"id": "progress-button",
"status": "baseline",
@@ -109,12 +131,13 @@
],
"rules": [
"Geometry is invariant across application themes.",
"Opt-in appearance=mission applies the qualified Mission Core operator surfaces, avatars and dot statuses across portals without changing geometry.",
"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."
"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."
]
},
{
@@ -382,7 +405,8 @@
"Split is the Engine form: a separate value surface and a 46 px toggle separated by an 8 px gap.",
"Inline is a compact label-only toolbar trigger without a persistent surface or chevron; its menu and keyboard behavior remain canonical.",
"Integrated Select is forbidden inside Inspector; use InspectorSelectField so the visible label is above a full-width split control.",
"The portal menu preserves its source-family row geometry instead of inheriting card radii."
"The portal menu preserves its source-family row geometry instead of inheriting card radii.",
"Split Select accepts shape=pill to align its separate toggle with circular workspace actions."
]
},
{
@@ -665,12 +689,14 @@
"profile identity card",
"theme-independent cover",
"action links and callbacks",
"outside pointer and Escape close"
"outside pointer and Escape close",
"responsive profile label hides with the shared mobile header layout"
],
"rules": [
"The component owns menu geometry and profile presentation; the application owns settings, profile and logout actions.",
"Use the existing Dropdown engine so the menu is never clipped by the fixed application header.",
"Do not embed product permissions or sharing rules in the visual menu."
"Do not embed product permissions or sharing rules in the visual menu.",
"The default header composes HeaderProfileButton, an independent menu IconButton and HeaderAvatar using the existing header geometry. Application settings belong inside this menu; do not add an adjacent settings button or another HeaderProfile wrapper."
]
},
{
@@ -928,7 +954,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."
]
},
{
+18 -2
View File
@@ -66,7 +66,23 @@
"mapSubjectDetailProfileRegistry": "map-subject-detail-profiles.json",
"operatingRule": "Check this registry before creating a NODE.DC interface element. Reuse or extend the canonical export instead of creating an application-local copy.",
"appearanceProfiles": {
"default": "Existing theme/material behavior",
"mission": "Opt-in operator appearance, qualified against live Mission Core 2026-09-30; shared modal/floating surfaces, neutral avatars and dot statuses"
"default": "Explicit legacy component presentation; no application-local overrides.",
"mission": "Canonical Mission Core foundation, audited on 2026-11-05: complete dark palette, surface hierarchy, neutral actions, portal materials, semantic dots and flat edges. Default for new applications."
},
"surfaceEdgeProfiles": {
"default": "Existing surface edges",
"flat": "No decorative borders or rims; contrasting keyboard focus fill"
},
"themePresets": {
"missionDarkTheme": {
"theme": "dark",
"appearance": "mission",
"edges": "flat"
},
"missionLightTheme": {
"theme": "light",
"appearance": "mission",
"edges": "flat"
}
}
}
+15
View File
@@ -108,6 +108,21 @@
"docs/ARCHITECTURE.md"
],
"policy": "architecture-context"
},
{
"id": "mission-core",
"repository": "https://git.dcserve.ru/SILVER/NODEDC_MISSION_CORE.git",
"auditedRevision": "b0332fa",
"role": "Owner-approved canonical dark theme and shared operator presentation, 2026-11-05; source and running canonical localhost:8000 audited.",
"approvedPaths": [
"apps/control-station/src/styles/base.css",
"apps/control-station/src/main.tsx"
],
"policy": "reference",
"excludedPaths": [
"domain scene renderers",
"uncommitted simulation work"
]
}
]
}
+21
View File
@@ -0,0 +1,21 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {createElement as h} from 'react';
import {renderToStaticMarkup} from 'react-dom/server';
import {applyNodedcTheme} from '../packages/ui-core/dist/index.js';
import {UserProfileMenu} from '../packages/ui-react/dist/index.js';
test('flat profile can be switched back and keeps legible white accent in both themes',()=>{
const values=new Map(); const element={dataset:{},style:{setProperty:(k,v)=>values.set(k,v)}};
for(const theme of ['dark','light']) {
applyNodedcTheme(element,{theme,edges:'flat',accent:[255,255,255]});
assert.equal(element.dataset.nodedcEdges,'flat'); assert.equal(element.dataset.nodedcTheme,theme);
assert.equal(values.get('--nodedc-on-accent-rgb'),'11 17 23');
}
applyNodedcTheme(element,{theme:'dark',appearance:'default',edges:'default'}); assert.equal(element.dataset.nodedcEdges,'default');
});
test('profile glyph stays between label and real session avatar',()=>{
const markup=renderToStaticMarkup(h(UserProfileMenu,{displayName:'Operator',triggerLabel:'Профиль',triggerIcon:'inbox',avatarUrl:'/avatar.png',actions:[]}));
assert.ok(markup.indexOf('Профиль')<markup.indexOf('<svg'));
assert.ok(markup.indexOf('<svg')<markup.indexOf('class="nodedc-header__avatar"'));
assert.match(markup,/src="\/avatar.png"/); assert.match(markup,/Меню пользователя Operator/);
});
+23
View File
@@ -0,0 +1,23 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {applyNodedcTheme, clearNodedcAccent, missionDarkTheme, missionLightTheme} from '../packages/ui-core/dist/index.js';
import * as dom from '../packages/ui-dom/dist/index.js';
test('React-independent and DOM consumers use one full preset, including portals at document root',()=>{
const values=new Map();
const root={dataset:{},style:{setProperty:(k,v)=>values.set(k,v),removeProperty:k=>values.delete(k)}};
assert.equal(dom.missionDarkTheme,missionDarkTheme);
assert.ok(Object.isFrozen(missionDarkTheme));
applyNodedcTheme(root);
assert.deepEqual(root.dataset,{nodedcTheme:'dark',nodedcAppearance:'mission',nodedcEdges:'flat',nodedcUi:'true'});
applyNodedcTheme(root,{...missionDarkTheme,accent:[255,255,255]});
assert.equal(values.get('--nodedc-on-accent-rgb'),'11 17 23');
clearNodedcAccent(root);
applyNodedcTheme(root,missionLightTheme);
assert.equal(root.dataset.nodedcTheme,'light');
assert.equal(root.dataset.nodedcAppearance,'mission');
assert.equal(values.size,0,'return to preset must not retain a previous custom accent');
applyNodedcTheme(root,{appearance:'default',edges:'default'});
assert.equal(root.dataset.nodedcAppearance,'default');
assert.equal(root.dataset.nodedcEdges,'default');
});