import "./size_boundary.css"; import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import { type SizeBuckets } from "./container_size"; import { type StyleProps } from "./style_props"; export interface SizeBoundaryProps extends StyleProps { children?: ReactNode; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * Declares the box that descendants size themselves against — to CSS as the * `lotics-boundary` container, and to JS through `useContainerSize()`. * * Mount one wherever a region's width stops tracking the window — beside a * dockable panel, inside a resizable rail, around an embedded surface — and * never per component. A table in a 600px column then stops laying itself out as * though it had the whole 1600px display. * * **Only around a box that OWNS its width** (`constitution.md` §10). Inline-size * containment makes the contents contribute nothing to the inline axis, so a * parent sized by them collapses: measured, a `width: max-content` popover panel * went from 180.6px to 18px. Such a panel publishes its width with * `ContainerSizeProvider` and declares no container. Which is why a component * mounts one only for a surface whose own sheet states its width — a `Dialog` * body, a `Drawer` panel — and never on a caller's behalf. * * Until the first measurement it reports the WINDOW's bucket, so the opening * paint matches what the same tree rendered before any boundary existed. * Seeding at zero instead would start every mount at "phone" and flash the * stacked layout on the way out of it. */ export declare function SizeBoundary(props: SizeBoundaryProps): React.ReactElement>; /** * How much room this component actually has: the nearest `SizeBoundary`, or the * window when nothing encloses it. * * For a component that renders a DIFFERENT TREE at the two widths. Anything a * class, an attribute or a length answers is a `@container lotics-boundary` * query paired with a `@media` one — the same two answers, with no hydration * seam (`constitution.md` §10). * * Falling back to the window is not a stand-in for a missing value — with no * boundary in the tree the window IS the container, which is also why an app * embedded in its own frame gets the right answer without mounting anything, and * why the paired `@media` block states that same answer. */ export declare function useContainerSize(): SizeBuckets;