feat(foundry): refine map application controls

This commit is contained in:
Codex
2026-08-09 14:24:18 +03:00
parent 7025fd20b5
commit beb84f6de6
18 changed files with 633 additions and 186 deletions
@@ -0,0 +1,55 @@
import type { HTMLAttributes, ReactNode } from "react";
import { cn } from "./cn.js";
import { Icon } from "./Icon.js";
export interface ApplicationSidePanelProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
eyebrow?: ReactNode;
title: ReactNode;
description?: ReactNode;
closeLabel?: string;
footer?: ReactNode;
onClose: () => void;
children: ReactNode;
}
/**
* Theme-aware trailing application panel paired with AdminNavigationPanel.
*
* The shell owns the separate end column; this component owns its matching
* surface, actions and right-to-left entrance animation.
*/
export function ApplicationSidePanel({
eyebrow = "NODE.DC",
title,
description,
closeLabel = "Закрыть панель",
footer,
onClose,
children,
className,
...props
}: ApplicationSidePanelProps) {
return (
<aside
className={cn("nodedc-admin-panel nodedc-application-side-panel", className)}
data-placement="end"
{...props}
>
<header className="nodedc-admin-panel__head">
<div>
<p>{eyebrow}</p>
<h2>{title}</h2>
{description ? <span className="nodedc-application-side-panel__description">{description}</span> : null}
</div>
<div className="nodedc-admin-panel__head-actions">
<button type="button" className="nodedc-admin-panel__close" aria-label={closeLabel} onClick={onClose}>
<Icon name="close" size={16} strokeWidth={1.6} />
</button>
</div>
</header>
<div className="nodedc-application-side-panel__body">{children}</div>
{footer ? <footer className="nodedc-admin-panel__footer">{footer}</footer> : null}
</aside>
);
}