diff --git a/apps/catalog/src/CatalogApp.tsx b/apps/catalog/src/CatalogApp.tsx index 9bc6bfe..2452a7f 100644 --- a/apps/catalog/src/CatalogApp.tsx +++ b/apps/catalog/src/CatalogApp.tsx @@ -2162,9 +2162,8 @@ export function CatalogApp() { } right={ - - - } /> } diff --git a/docs/ADOPTION.md b/docs/ADOPTION.md index fca556c..7522ea4 100644 --- a/docs/ADOPTION.md +++ b/docs/ADOPTION.md @@ -112,3 +112,6 @@ 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 variant="header"`: profile label, menu icon, avatar. +The menu opens settings; the application does not add a fourth action. diff --git a/docs/COMPONENTS.md b/docs/COMPONENTS.md index daf717e..02d6173 100644 --- a/docs/COMPONENTS.md +++ b/docs/COMPONENTS.md @@ -527,6 +527,6 @@ Window: `rect` / `onRectCommit` — восстановление и фиксац ## 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.triggerIcon` accepts a canonical icon between the label and avatar; CMS uses `triggerLabel="Профиль"` and `triggerIcon="inbox"`, followed by a separate settings IconButton. +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 variant="header"` 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. diff --git a/packages/ui-react/src/UserProfileMenu.tsx b/packages/ui-react/src/UserProfileMenu.tsx index a6180b2..3361441 100644 --- a/packages/ui-react/src/UserProfileMenu.tsx +++ b/packages/ui-react/src/UserProfileMenu.tsx @@ -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,6 +16,8 @@ export interface UserProfileMenuAction { export interface UserProfileMenuProps { displayName: string; + /** Canonical profile label, independent menu icon, then avatar. Owns HeaderProfile. */ + variant?: "default" | "header"; subtitle?: string; avatarUrl?: string; coverImageUrl?: string; @@ -26,6 +29,7 @@ export interface UserProfileMenuProps { export function UserProfileMenu({ displayName, + variant = "default", subtitle, avatarUrl, coverImageUrl, @@ -40,7 +44,22 @@ 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" ? ( + + + {triggerLabel ?? "Профиль"} + + { setTriggerRef(node); setAnchorRef(node); }} + label={`Меню пользователя ${label}`} + aria-haspopup="menu" + aria-expanded={open} + aria-controls={surfaceId} + onClick={toggle} + > + + + ) : (