import type { ReactNode, CSSProperties } from 'react'; /** Pixel offsets for the four sides of a CSS box edge (padding/margin/border). */ export interface BoxEdges { top: number; right: number; bottom: number; left: number; } /** * Snapshot of everything the inspector reads off an element. Passed to * `on.hover`, `on.select`, and `bubble.render`. */ export interface ElementInfo { element: Element; /** Lowercased tag name, e.g. `"button"`. */ tag: string; /** A best-effort unique CSS selector — id, classes, data-attrs, or nth-of-type. */ selector: string; /** Viewport-relative bounding box at the moment the snapshot was taken. */ rect: DOMRect; font: { /** Computed `font-family` stack as authored. */ family: string; /** First family in the stack the browser actually has loaded. */ rendered: string; size: string; weight: string; lineHeight: string; }; /** Computed text color (`rgb(...)` / `rgba(...)`). */ color: string; /** Walks ancestors until a non-transparent background is found. */ backgroundColor: string; /** WCAG ratio between `color` and `backgroundColor`; `null` if indeterminate. */ contrastRatio: number | null; padding: BoxEdges; margin: BoxEdges; border: BoxEdges; a11y: A11yInfo; } /** Accessibility information derived from ARIA attributes and DOM state. */ export interface A11yInfo { /** Explicit `role` attribute, or an implicit role inferred from the tag. */ role: string | null; /** True when `role` came from the attribute, not the tag. */ explicitRole: boolean; /** `aria-labelledby` → `aria-label` → `alt` → `