/** * @file Preview of inspector form components for design verification */ import * as React from "react"; import { H2 } from "../../../../components/elements/Heading"; import { PropertySection } from "../../../../components/inspector/parts/PropertySection"; import { InspectorFieldRow } from "../../../../components/inspector/parts/InspectorFieldRow"; import { InspectorInput } from "../../../../components/inspector/parts/InspectorInput"; import { InspectorSelect } from "../../../../components/inspector/parts/InspectorSelect"; import { InspectorButtonGroup } from "../../../../components/inspector/parts/InspectorButtonGroup"; import { InspectorToggleGroup } from "../../../../components/inspector/parts/InspectorToggleGroup"; import { InspectorIconButton } from "../../../../components/inspector/parts/InspectorIconButton"; import { InspectorButton } from "../../../../components/inspector/parts/InspectorButton"; import classes from "./InspectorComponentsExample.module.css"; const AlignLeftIcon = () => ( ); const AlignCenterIcon = () => ( ); const AlignRightIcon = () => ( ); const ResizeWidthIcon = () => ( ); const ResizeHeightIcon = () => ( ); const ResizeBothIcon = () => ( ); const EyeIcon = () => ( ); const LockIcon = () => ( ); const SettingsIcon = () => ( ); const alignmentOptions = [ { value: "left", label: , "aria-label": "Align left" }, { value: "center", label: , "aria-label": "Align center" }, { value: "right", label: , "aria-label": "Align right" }, ]; const resizingOptions = [ { value: "width", label: , "aria-label": "Resize width" }, { value: "height", label: , "aria-label": "Resize height" }, { value: "both", label: , "aria-label": "Resize both" }, ]; /** * Showcase of inspector form components with interactive state */ export function InspectorComponentsExample(): React.ReactElement { const [alignment, setAlignment] = React.useState("left"); const [resizing, setResizing] = React.useState("width"); const [toggleValues, setToggleValues] = React.useState(["a"]); const [inputValue, setInputValue] = React.useState("100"); const [selectValue, setSelectValue] = React.useState("montserrat"); const [variant, setVariant] = React.useState<"default" | "outline" | "filled">("default"); return (

Inspector Form Components

Interactive preview of inspector-specific form controls. Switch themes to see how they adapt.

{}} /> {}} />
{}} /> {}} />
} aria-label="Lock" variant="ghost" /> } aria-label="Visible" variant="ghost" /> } >
{}} /> {}} />
} aria-label="Typography settings" variant="ghost" /> } >
setSelectValue(e.target.value)}>
setVariant(v as typeof variant)} aria-label="Input variant" />
These inputs should have identical heights
Normal (no label) {}} data-testid="input-normal" />
With Label {}} data-testid="input-with-label" />
Normal setInputValue(e.target.value)} />
With Label {}} />
Error {}} />
Disabled {}} />
Normal
Error
Disabled
setToggleValues(v as string[])} multiple aria-label="Multi-select options" /> Selected: {toggleValues.join(", ") || "none"}
} aria-label="Eye" /> Default
} aria-label="Eye" size="small" /> Small
} aria-label="Eye" active /> Active
} aria-label="Eye" disabled /> Disabled
Primary Secondary Ghost Danger
); }