diff --git a/apps/catalog/src/CatalogApp.tsx b/apps/catalog/src/CatalogApp.tsx index a810c1c..26b2d8f 100644 --- a/apps/catalog/src/CatalogApp.tsx +++ b/apps/catalog/src/CatalogApp.tsx @@ -239,6 +239,7 @@ const iconLabels: Record = { camera: "Камера", check: "Готово", "chevron-down": "Раскрыть", + "chevron-up": "Свернуть", "chevron-left": "Назад", "chevron-right": "Вперёд", circle: "Маркер", @@ -2361,6 +2362,7 @@ export function CatalogApp() { setProjectName("Обновлено")}>} title="Создать проект" subtitle="Адаптивная форма" size="sm" diff --git a/docs/COMPONENTS.md b/docs/COMPONENTS.md index 7793edd..c279857 100644 --- a/docs/COMPONENTS.md +++ b/docs/COMPONENTS.md @@ -388,3 +388,5 @@ StatusBadge `variant="indicator"` отображает только одну л ## KeyButton Контурная клавиша удержания с контролируемым pressed-состоянием. [Контракт](KEY_BUTTON.md). + +`Window` и `FeatureSettingsWindow`: `headerActions` размещает обновление и другие контекстные IconButton рядом с закрытием; footer предназначен для завершения формы. diff --git a/docs/ICONS.md b/docs/ICONS.md index e151ca3..db6bf54 100644 --- a/docs/ICONS.md +++ b/docs/ICONS.md @@ -45,3 +45,5 @@ Это действие использует обычный `IconButton` с доступной подписью; состояния hover, focus, disabled и pending принадлежат кнопке. `activity` остаётся обозначением телеметрии и состояния, а не отправки команд. + +Раскрытие строки вниз: `chevron-down` в закрытом состоянии, `chevron-up` в открытом; кнопка сообщает `aria-expanded` и `aria-controls`. diff --git a/docs/WINDOWS_AND_LAYERS.md b/docs/WINDOWS_AND_LAYERS.md index d2cfe33..a126ced 100644 --- a/docs/WINDOWS_AND_LAYERS.md +++ b/docs/WINDOWS_AND_LAYERS.md @@ -115,3 +115,7 @@ map-glass дизайне, что Objects. Библиотека не создаёт глобальный store окон. Приложение владеет тем, какое окно открыто и какие данные в нём загружены. Библиотека владеет одинаковым поведением самого слоя. Stack workspace-окон остаётся контролируемым приложением: оно передаёт active-state и `zIndex`, а компонент отвечает только за одинаковую геометрию и взаимодействие. Глобальный stack viewport-level modeless-окон остаётся отдельным будущим контрактом. + +## Контекстные действия заголовка + +`Window.headerActions` и `FeatureSettingsWindow.headerActions` принимают канонические `IconButton`. Обновление содержимого находится рядом с закрытием; сохранение и отмена формы остаются в footer. Слот входит в focus trap окна, а клики по действиям не начинают перетаскивание. Pending/disabled задаёт владелец данных; закрытие остаётся доступным. diff --git a/packages/ui-core/styles.css b/packages/ui-core/styles.css index 4615fa1..f708241 100644 --- a/packages/ui-core/styles.css +++ b/packages/ui-core/styles.css @@ -2719,12 +2719,18 @@ textarea.nodedc-field__control { .nodedc-window__head { display: grid; min-height: 4.25rem; - grid-template-columns: minmax(0, 1fr) var(--nodedc-icon-button-size); + grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--nodedc-space-3); padding: 0.8rem 0.9rem 0.55rem 1.15rem; } +.nodedc-window__actions { + display: flex; + align-items: center; + gap: var(--nodedc-space-2); +} + .nodedc-window__titles { display: grid; min-width: 0; diff --git a/packages/ui-react/src/FeatureSettingsWindow.tsx b/packages/ui-react/src/FeatureSettingsWindow.tsx index e8db915..74b2189 100644 --- a/packages/ui-react/src/FeatureSettingsWindow.tsx +++ b/packages/ui-react/src/FeatureSettingsWindow.tsx @@ -27,6 +27,7 @@ export interface FeatureSettingsWindowProps { onClose: () => void; children: ReactNode; footer?: ReactNode; + headerActions?: ReactNode; } export function FeatureSettingsWindow({ @@ -40,6 +41,7 @@ export function FeatureSettingsWindow({ onClose, children, footer, + headerActions, }: FeatureSettingsWindowProps) { return ( ({ size="lg" className="nodedc-feature-settings-window" footer={footer} + headerActions={headerActions} closeOnBackdrop={false} onClose={onClose} > diff --git a/packages/ui-react/src/Icon.tsx b/packages/ui-react/src/Icon.tsx index 2b3f557..eb91faf 100644 --- a/packages/ui-react/src/Icon.tsx +++ b/packages/ui-react/src/Icon.tsx @@ -6,6 +6,7 @@ import { Camera, Check, ChevronDown, + ChevronUp, ChevronLeft, ChevronRight, Circle, @@ -63,6 +64,7 @@ const icons = { camera: Camera, check: Check, "chevron-down": ChevronDown, + "chevron-up": ChevronUp, "chevron-left": ChevronLeft, "chevron-right": ChevronRight, circle: Circle, diff --git a/packages/ui-react/src/Window.tsx b/packages/ui-react/src/Window.tsx index 6f9dd8b..8f4ec6d 100644 --- a/packages/ui-react/src/Window.tsx +++ b/packages/ui-react/src/Window.tsx @@ -30,6 +30,8 @@ export interface WindowProps extends Omit, "title subtitle?: ReactNode; children: ReactNode; footer?: ReactNode; + /** Context actions beside close, using canonical IconButton controls. */ + headerActions?: ReactNode; size?: WindowSize; placement?: WindowPlacement; closeLabel?: string; @@ -47,6 +49,7 @@ export function Window({ subtitle, children, footer, + headerActions, size = "md", placement = "center", closeLabel = "Закрыть", @@ -182,9 +185,12 @@ export function Window({

{title}

{subtitle ?

{subtitle}

: null} +
+ {headerActions} +
{children}
{footer ? : null} diff --git a/registry/components.json b/registry/components.json index 572eb8c..557dcc5 100644 --- a/registry/components.json +++ b/registry/components.json @@ -244,7 +244,7 @@ "domPackage": "@nodedc/ui-dom", "domExports": ["createModalController"], "domContract": ["nodedc-overlay", "nodedc-window"], - "summary": "Canonical controlled window for modal and right-side panel presentations.", + "summary": "Canonical controlled window for modal and right-side panel presentations, with optional headerActions beside close.", "behavior": ["portal to body", "focus entry", "modal-only focus trap", "focus restore", "Escape close", "backdrop close policy", "modal-only body scroll lock", "optional bounded dragging for modeless inspectors"], "rules": [ "WindowFooterActions aligns modal actions to the trailing edge, including a footer with only one action group; actions wrap within narrow windows.", @@ -373,7 +373,7 @@ "id": "feature-settings-window", "status": "baseline", "package": "@nodedc/ui-react", - "exports": ["FeatureSettingsWindow", "FeatureSettingsSection"], + "exports": ["FeatureSettingsWindow", "FeatureSettingsSection", "FeatureSettingsWindowProps"], "domContract": ["nodedc-feature-settings-window", "nodedc-feature-settings__navigation", "nodedc-feature-settings__content"], "summary": "Engine-derived large settings window with module identity, grouped feature navigation and application-owned content.", "behavior": ["canonical modal focus behavior", "controlled active section", "grouped navigation", "responsive single-column layout"], diff --git a/registry/icons.json b/registry/icons.json index 9cdc0b4..460c671 100644 --- a/registry/icons.json +++ b/registry/icons.json @@ -18,7 +18,7 @@ "id": "navigation", "label": "Навигация", "referenceSources": ["launcher", "engine", "bim-viewer"], - "names": ["chevron-left", "chevron-right", "chevron-down", "grid", "list", "sliders", "search"] + "names": ["chevron-left", "chevron-right", "chevron-down", "chevron-up", "grid", "list", "sliders", "search"] }, { "id": "editing",