feat(ui): support storage settings, pinned copies and contextual window actions
This commit is contained in:
@@ -39,6 +39,8 @@ export interface WindowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title
|
||||
footer?: ReactNode;
|
||||
/** Context actions beside close, using canonical IconButton controls. */
|
||||
headerActions?: ReactNode;
|
||||
/** Keep contextual actions immediately before close when requested. */
|
||||
headerActionsPlacement?: "before-move" | "before-close";
|
||||
size?: WindowSize;
|
||||
placement?: WindowPlacement;
|
||||
closeLabel?: string;
|
||||
@@ -66,6 +68,7 @@ export function Window({
|
||||
children,
|
||||
footer,
|
||||
headerActions,
|
||||
headerActionsPlacement = "before-move",
|
||||
size = "md",
|
||||
placement = "center",
|
||||
closeLabel = "Закрыть",
|
||||
@@ -286,7 +289,7 @@ export function Window({
|
||||
{subtitle ? <p id={descriptionId} className="nodedc-window__subtitle">{subtitle}</p> : null}
|
||||
</div>
|
||||
<div className="nodedc-window__actions">
|
||||
{headerActions}
|
||||
{headerActionsPlacement === "before-move" && headerActions}
|
||||
{allowFloating && placement === "center" && <IconButton label={isFloating ? "Вернуть модальный режим" : "Свободное окно"} aria-pressed={isFloating} onClick={() => {
|
||||
dragRef.current = null; resizeRef.current = null;
|
||||
if (!isFloating) {
|
||||
@@ -295,6 +298,7 @@ export function Window({
|
||||
}
|
||||
setFloating(!isFloating);
|
||||
}}><Icon name="move" /></IconButton>}
|
||||
{headerActionsPlacement === "before-close" && headerActions}
|
||||
<button type="button" className="nodedc-window__close" aria-label={closeLabel} onClick={onClose}>
|
||||
<Icon name="close" size={16} strokeWidth={1.6} />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user