feat(ui): support window header actions and disclosure collapse icon

This commit is contained in:
Codex
2026-09-30 20:51:17 +03:00
parent 1b63366d2e
commit 77091fda98
10 changed files with 31 additions and 4 deletions
@@ -27,6 +27,7 @@ export interface FeatureSettingsWindowProps<T extends string = string> {
onClose: () => void;
children: ReactNode;
footer?: ReactNode;
headerActions?: ReactNode;
}
export function FeatureSettingsWindow<T extends string>({
@@ -40,6 +41,7 @@ export function FeatureSettingsWindow<T extends string>({
onClose,
children,
footer,
headerActions,
}: FeatureSettingsWindowProps<T>) {
return (
<Window
@@ -49,6 +51,7 @@ export function FeatureSettingsWindow<T extends string>({
size="lg"
className="nodedc-feature-settings-window"
footer={footer}
headerActions={headerActions}
closeOnBackdrop={false}
onClose={onClose}
>
+2
View File
@@ -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,
+6
View File
@@ -30,6 +30,8 @@ export interface WindowProps extends Omit<HTMLAttributes<HTMLDivElement>, "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({
<h2 id={titleId} className="nodedc-window__title">{title}</h2>
{subtitle ? <p id={descriptionId} className="nodedc-window__subtitle">{subtitle}</p> : null}
</div>
<div className="nodedc-window__actions">
{headerActions}
<button type="button" className="nodedc-window__close" aria-label={closeLabel} onClick={onClose}>
<Icon name="close" size={16} strokeWidth={1.6} />
</button>
</div>
</header>
<div className="nodedc-window__body">{children}</div>
{footer ? <footer className="nodedc-window__footer">{footer}</footer> : null}