/** * @file Inspector input component with optional label (text or icon) */ import * as React from "react"; import styles from "./InspectorInput.module.css"; export type InspectorInputProps = { /** Label content - can be text or an icon */ label?: React.ReactNode; /** Error state */ error?: boolean; /** Visual variant */ variant?: "default" | "outline" | "filled"; /** Test ID for testing */ "data-testid"?: string; } & Omit, "label">; /** * An input component for inspector panels. * Supports optional label (text or icon) displayed inline. * Does not include external layout - layout should be controlled externally. */ export const InspectorInput = React.forwardRef( ({ label, error = false, variant = "default", className, disabled, "data-testid": dataTestId, ...props }, ref) => { const hasLabel = label !== undefined; const containerClasses = [hasLabel ? styles.inputWithLabel : styles.input, className].filter(Boolean).join(" "); if (hasLabel) { return (
{label}
); } return ( ); }, ); InspectorInput.displayName = "InspectorInput";