feat(ui): standardize inspector spacing and compact level geometry

This commit is contained in:
Codex
2026-11-04 18:18:10 +03:00
parent 8ff33a6a17
commit be929f9d8e
10 changed files with 74 additions and 9 deletions
+7
View File
@@ -19,6 +19,9 @@ export interface InspectorSectionSpec {
export interface InspectorProps {
sections: InspectorSectionSpec[];
/** Spaced form fields above sections and centered actions below them. */
header?: ReactNode;
footer?: ReactNode;
defaultOpen?: string[];
openSections?: string[];
activeId?: string;
@@ -31,6 +34,8 @@ export interface InspectorProps {
export function Inspector({
sections,
header,
footer,
defaultOpen = [],
openSections,
activeId,
@@ -70,6 +75,7 @@ export function Inspector({
return (
<InspectorSelectPolicyContext.Provider value>
<div className={cn("nodedc-inspector", className)} data-variant={variant === "default" ? undefined : variant}>
{header ? <div className="nodedc-inspector__header">{header}</div> : null}
{groups.map((group, groupIndex) => (
<div className="nodedc-inspector__group" key={`${group.label ?? "root"}-${groupIndex}`}>
{group.sections.map((section) => {
@@ -107,6 +113,7 @@ export function Inspector({
})}
</div>
))}
{footer ? <div className="nodedc-inspector__footer">{footer}</div> : null}
</div>
</InspectorSelectPolicyContext.Provider>
);