feat(ui): add momentary keyboard control surface

This commit is contained in:
Codex
2026-09-25 16:35:14 +03:00
parent 8dd9190573
commit a5a73c8753
7 changed files with 74 additions and 0 deletions
+10
View File
@@ -4302,3 +4302,13 @@ textarea.nodedc-field__control {
}
}
.nodedc-landing-stage__eyebrow { color: var(--nodedc-text-muted); font-size: var(--nodedc-font-size-xs); font-weight: var(--nodedc-font-weight-strong); letter-spacing: .12em; }
/* Explicit key outline: approved momentary-input affordance, not a card rim. */
.nodedc-key-button { display:inline-grid; place-items:center; width:46px; height:46px;
border:1px solid var(--nodedc-text-secondary); border-radius:var(--nodedc-radius-sm, 8px);
background:transparent; color:var(--nodedc-text-primary); font:inherit; font-weight:600;
cursor:pointer; user-select:none; touch-action:none; }
.nodedc-key-button:hover:not(:disabled) { background:var(--nodedc-glass-control-hover); }
.nodedc-key-button[aria-pressed="true"]:not(:disabled) { background:#fff; color:#000; border-color:#fff; }
.nodedc-key-button:disabled { opacity:.4; cursor:not-allowed; }
.nodedc-key-button:focus-visible { outline:2px solid rgb(var(--nodedc-accent-rgb)); outline-offset:3px; }
+17
View File
@@ -0,0 +1,17 @@
import {forwardRef, type ButtonHTMLAttributes} from 'react';
import {cn} from './cn.js';
export interface KeyButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/** Controlled physical/pointer input indication; this is never a toggle. */
pressed?: boolean;
label: string;
}
/** A momentary key surface. The consumer owns input, focus scope and release policy. */
export const KeyButton = forwardRef<HTMLButtonElement, KeyButtonProps>(function KeyButton(
{pressed=false,label,children,className,type='button',disabled,...props},ref,
) {
return <button {...props} ref={ref} type={type} disabled={disabled}
aria-label={label} title={label} aria-pressed={pressed && !disabled}
className={cn('nodedc-key-button',className)}>{children}</button>;
});
+1
View File
@@ -35,3 +35,4 @@ export * from "./EnvironmentSettingsWindow.js";
export * from "./EnvironmentMediaPlaylistEditor.js";
export * from "./EnvironmentBackgroundMedia.js";
export * from "./LandingStage.js";
export {KeyButton, type KeyButtonProps} from './KeyButton.js';