feat(ui): add docking, viewport controls and composed settings
Add shared dock layouts, navigation cube, range bands, progress actions and comparison surfaces. Extend toolbar menus and loading composition, and align tokens, registry entries, documentation and the living catalog.
This commit is contained in:
@@ -3,6 +3,7 @@ import { InspectorSelectPolicyContext } from "./InspectorContext.js";
|
||||
import { Select, type SelectProps } from "./Select.js";
|
||||
import { cn } from "./cn.js";
|
||||
import { Icon } from "./Icon.js";
|
||||
import { IconButton } from "./Button.js";
|
||||
|
||||
export interface InspectorSectionSpec {
|
||||
id: string;
|
||||
@@ -13,6 +14,7 @@ export interface InspectorSectionSpec {
|
||||
disabled?: boolean;
|
||||
tone?: "default" | "accent";
|
||||
icon?: ReactNode;
|
||||
action?: { label: string; icon: ReactNode; onAction: () => void; disabled?: boolean };
|
||||
}
|
||||
|
||||
export interface InspectorProps {
|
||||
@@ -74,6 +76,7 @@ export function Inspector({
|
||||
const isOpen = openIds.has(section.id);
|
||||
return (
|
||||
<section className="nodedc-inspector__section" key={section.id}>
|
||||
<div className="nodedc-inspector__section-head" data-action={section.action ? "true" : undefined}>
|
||||
<button
|
||||
type="button"
|
||||
className="nodedc-inspector__section-trigger"
|
||||
@@ -91,8 +94,13 @@ export function Inspector({
|
||||
<span className="nodedc-inspector__section-description">{section.description}</span>
|
||||
) : null}
|
||||
</span>
|
||||
<span className="nodedc-inspector__section-chevron" aria-hidden="true"><Icon name="chevron-right" size={14} /></span>
|
||||
<span className="nodedc-inspector__section-chevron" aria-hidden="true"><Icon name={variant === "panel" ? "chevron-down" : "chevron-right"} size={14} /></span>
|
||||
</button>
|
||||
{section.action ? <IconButton className="nodedc-inspector__section-action" label={section.action.label}
|
||||
disabled={section.disabled || section.action.disabled} onClick={section.action.onAction}>
|
||||
{section.action.icon}
|
||||
</IconButton> : null}
|
||||
</div>
|
||||
{isOpen ? <div className="nodedc-inspector__section-content">{section.content}</div> : null}
|
||||
</section>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user