import { type ComponentProps, type RefObject } from 'react'; /** * Unstyled Carbon UI Shell header, the behaviour of the styled Header without a single class: * - `Root`: the `
` (a banner landmark; `data-ui-header` lets a toaster start below it). * - `SkipToContent`: a link to `#main-content` that also finds its target inside a shadow root (a micro app). * - `MenuButton`: the hamburger (`aria-expanded`, `aria-controls`); inside a `Shell.Root` it opens and closes the side nav by itself. * - `Menu` (an `li`) with `MenuTrigger` and `MenuPopup`: a disclosure of links. Click / Enter / Space * toggle; Esc closes and focuses the trigger; a press outside or focus leaving closes; following * one of its `MenuItem`s closes it and focuses the trigger. * - `MenuItem`: a link (`aria-current="page"` when `current`) of the menu bar or of a `Menu`. * - `GlobalAction`: an icon button, a toggle (`active`: `aria-pressed`) or a disclosure (`expanded`: `aria-expanded`). * - `Panel` with `PanelContent`: the panel under the header. Esc (focus back to what opened it), * focus leaving it and a press outside it (not on its action, `aria-controls` = its `id`) ask to close. * * The name link, the menu bar `