/** * What a part owns, worked out from what it draws (Katerina's ruling B9, * 25 September). * * The plan's Gate 0 asked for "the behaviours it owns — derived from which Base * UI parts it imports". Until 0.36.0 only "is built on Base UI" was; the rest * was UIG-8's hand list of owners, which is right for the part that does the * work and silent for every part built from it: ConfirmDialog draws DialogShell, * whose page says it keeps focus inside, and the catalogue listed no focus for * ConfirmDialog. Every app entry listed nothing at all. * * Now a part owns: * * - what the Base UI parts it draws do, from UIG-8's enumeration (`baseUi` on * each behaviour, read from Base UI's source): all of it for a whole part * (`Menu.Root`), what it is for a piece (`Menu.Item`); * - what the whole of the part it **is** does (floating, focus, keys, scroll): * the part it hands back at its root, followed through parts inside parts, in * the package and in an app. ConfirmDialog returns a DialogShell, so it keeps * focus inside; a page with a menu somewhere in it does not float, and a * tooltip's floating stays the tooltip's; * - and, in the package, what UIG-8's list says (the floor: a part like `Link` * is reachable with Tab without any Base UI in it). * * Read from the code: a JSX tag inside the part's own declaration, or inside a * function of the same file it draws. A root on one branch of a condition * still counts, so the list says what a part can be, not what one screen shows. */ import ts from 'typescript'; import type { EntryBehaviour } from './schema'; /** `@base-ui/react`, its sub-paths, and the old `@base-ui-components/react` spelling. */ export declare const isBaseUi: (specifier: string) => boolean; /** * What drawing a Base UI part gives, by behaviour id. The whole part (`Menu.Root`, * or a part of one piece: ``, ``) does all UIG-8 lists for it; * a piece of one (`Menu.Item`, `Toolbar.Button`) only says what it is. */ export declare function baseUiBehaviours(part: string, piece?: string): string[]; /** * What a part hands on to the parts drawn around it: what the whole thing does. * Being built on Base UI, a role and a Tab stop stay the inner part's: a banner * with a button in it is not itself reachable with Tab. */ export declare const HANDED_ON: Set; /** A hint drawn beside a part: its floating is its own, never the part's. */ export declare const HINTS: Set; /** What a part drawn inside another hands on to it. */ export declare const handedOn: (name: string, owned: Iterable) => string[]; /** Behaviour ids as the catalogue writes them: in UIG-8's order, each once. */ export declare function asBehaviours(ids: Iterable): EntryBehaviour[]; /** A tag's name and its piece: `['Dialog', 'Popup']`, `['Button', undefined]`. */ export declare const splitTag: (tag: string) => [string, string | undefined]; /** * For each name a file declares at its top (a function, a `const`, a class): * the tags drawn inside it, with the file's own functions it draws followed, so * what is left are names the file imports or declares without a body. */ export declare function drawnIn(sf: ts.SourceFile): Map>; /** * For each function a file declares at its top: the parts it **is** — the tags it * hands back at its root, following the file's own functions it hands back. * `ConfirmDialog` returns a `DialogShell`, so it is one; a page with a menu * somewhere in it is not a menu. */ export declare function rootsIn(sf: ts.SourceFile): Map>; /** Each imported value name → where it came from. */ export declare function importsOf(sf: ts.SourceFile): Map; //# sourceMappingURL=behaviours.d.ts.map