/** * Recursively unwrap React Fragments AND Boxes into a flat list of leaf * element children. * * `React.Children.toArray` does NOT flatten Fragments — a Fragment with three * `` children is reported as a single Fragment element. That behavior * is fine for most React APIs (which then recurse themselves), but in * sidebar cards we want to wrap EACH child in a `│ … │` row. To do that * correctly across nested conditional Fragments AND Boxes (which callers * use to group their body rows), we need a real flattener that pulls the * children out at any depth. * * Box recursion: a `` with several Text rows * inside is treated as a group of separate children, not one block. The * reason is that the per-row `│ … │` wrapper paints the side bar on the * FIRST line of each child element — if the Box is treated as a single * child, only its first line gets a right `│` and the rest of the Box * overflows past the right edge, visually breaking the frame. Recursing * into Boxes costs us the inner Box's flex/width/padding context, but * callers use Boxes for "group my rows vertically" semantics, and the * per-row `│ … │` wrapper already controls width, padding, and background. * * Text/primitive nodes are skipped: we only return elements that the * caller asked to wrap in `│ … │`. */ import type { ReactElement, ReactNode } from 'react'; export declare function flattenChildren(node: ReactNode): ReactElement[]; //# sourceMappingURL=react-children-flatten.d.ts.map