feat(ui): standardize inspector spacing and compact level geometry
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user