import type { Rule } from 'eslint'; /** * Behaviour the package already owns, rebuilt by hand in an app (UIG-8, "forbid * the reach"). A hand-made dropdown, dialog, list or scrolling box does not look * wrong in review; it shows itself when somebody uses a keyboard, or has 81 * folders. Every message names the part that already does it. * * What it reads is derived from the package source: which `@base-ui/react` part * each component imports, and so what it owns (`OWNED_BEHAVIOURS`, printed in * docs/GATES.md and reused by UIG-12's registry). `no-rebuilt-behaviour.test.ts` * holds the tables to the source, so a new part cannot be added without them. * * What it deliberately does not read, and why: * * - **A box that should scroll and does not.** A class rule finds the scrolling * box built by hand; it cannot find the one that was never built. Peek's * Folders column (fixed in peek 3dc663b) had no overflow class at all. Only a * check that opens the page can find that. * - **Enter and Escape** compared by hand. In a field or an editor they are * typing, and `Form` and `EditableText` own the ones that send or cancel. * Escape and every other key taken for the whole page are read, through the * listener. * - **aria-expanded, aria-pressed and the other states** written on a package * component: the component is already the package's (UIG-14's usage rules). * - **Measuring arithmetic**, for the reason UIG-5 gave: `Popover` takes a * rectangle to hang from, and a rule that guessed at arithmetic would report it. * - A listener on a variable that happens to hold the document. * * A place that keeps one says why on the line above: `// @estiva-escape: `. * An escape above a statement, an element or an object property covers what the * rule found there. */ /** The part a message names, and where one behaviour has more owners, the others after it. `null`: no part yet. */ export interface OwnerPart { use: string; more?: string; } /** * Every Base UI module, and the package component built on it. Read from the * package's imports (`src/*.tsx`); the test fails if a component imports a * module this does not name, or names a component that does not import it. * A module no component uses has no part yet, and neither do Base UI's utilities. */ export declare const BASE_UI_PARTS: Record; /** * A role written by hand, and the part that sets it. Base UI's parts set most of * these; `tooltip` (Base UI's Tooltip sets none), `alert`, `status` and `link` are * the package's own. A role Base UI has a part for and this package has not got * yet is `null`. Not here, on purpose: `img`, `group`, `presentation`, `none`, * `region` and every landmark — they describe, they do not behave. */ export declare const ROLE_PARTS: Record; /** The keys a list, a menu, tabs and a toolbar move with. Enter and Escape are not here (see above). */ export declare const WALKING_KEYS: string[]; /** * A listener on the whole page, by what it is for. The events Base UI's own * parts listen to on the document (useDismiss, FloatingFocusManager, the * Positioner's autoUpdate): a floating part closes, holds focus and follows its * anchor with these. `focus`, `blur`, `visibilitychange` and `storage` are not * here: an app refreshing when the window comes back is not a floating part. */ export declare const PAGE_EVENTS: Record; /** Elements that are reachable with Tab by themselves; `tabIndex` on these is not a Tab stop made by hand. */ export declare const INTERACTIVE_ELEMENTS: Set; /** `overflow-auto`, `overflow-y-scroll`…: a box that scrolls with the browser's scrollbar. */ export declare const SCROLL_CLASS: RegExp; /** One row of the enumeration (UIG-8's acceptance; the shape UIG-12's registry reads). */ export interface OwnedBehaviour { id: string; /** What a person notices the part doing. */ behaviour: string; /** The Base UI parts that do it, read from their source (1.8.0). */ baseUi: string[]; /** The package components an error names. */ owners: string[]; /** What the rule reads in an app to find it rebuilt. */ reads: string; } export declare const OWNED_BEHAVIOURS: OwnedBehaviour[]; /** A class token's utility, past its variants: `[&_pre]:overflow-x-auto` → `overflow-x-auto`. */ export declare function utilityOf(token: string): string; /** The Base UI module an import names, or `undefined` when it is not Base UI. `''` is the package root. */ export declare function baseUiModule(source: string): string | undefined; export declare const noRebuiltBehaviour: Rule.RuleModule; //# sourceMappingURL=no-rebuilt-behaviour.d.ts.map