# XWUIBarSiteHeader

Reusable site top bar: brand block (logo + optional title), primary nav row, slotted actions area, built-in mobile drawer.

## Updating data

- `setData(next)` - full replace, rebuilds the bar. Safe for slotted `actions`: it harvests live action nodes before tearing down and after, so a rebuild never drops a chip a consumer slotted in (`updateData()`'s `refresh()` path already did this; `setData()` now does too - this was the root cause behind consumer shells writing MutationObserver-based repair loops to detect and re-inject chips a `setData()` call had wiped).
- `updateData(patch)` - the lighter path. Patches `patch.brand`/`patch.menu`/`patch.links`/`patch.currentPath` in place (no `innerHTML` reset) and never touches `__actions`/`__drawer-actions`/`__mobile-settings`/`__drawer-settings` at all. Prefer this for translation swaps, brand changes, and route-driven relabeling.
- `getElement()` - direct access to the rendered `<header>` root.

## Brand

`data.brand` paints one of two things inside the brand anchor:

- `brand.logo` set - an `<xwui-logo>` built from that config. It renders its own wordmark from `brand.logo.title` (under `logoConfig: 'logo-title'`), so `brand.title` is ignored in this mode.
- `brand.logo` absent - a text wordmark from `brand.title`, with `brand.subtitle` as an optional second line. This is the path for a host that has a name but no mark: `XWUILogo`'s `logo` key indexes a built-in SVG registry with no runtime registration API, so a host with raster-only artwork cannot supply one (give it `brand.logo.src` / `brand.logo.svgPath` if it has vector or image artwork of its own). Before this existed the anchor rendered empty and measured 0x0.

Neither set leaves the anchor empty by design (a bare clickable home link). `config.uppercase` / `config.textTransform` and the Kashida fields apply to the text wordmark, same as nav labels.

## Migrating from XWUILayoutHeader

`XWUILayoutHeader` (the old 13-block `XWUIBarApp` wrapper) is deprecated and now a thin alias backed by this component - `block` maps onto a best-effort combination of `position`/`shadow`/`scrollTransparent`/`logoPosition`/`size` (see `power/XWUILayoutHeader/XWUILayoutHeader.ts` for the exact table), `navItems` maps onto `links`, and `actionItems` maps onto `data.actions`. Existing `<xwui-layout-header>` markup keeps working; switch to `<xwui-bar-site-header>` for full control (menu dropdowns, badges, the mobile drawer, `data.actions[].collapsePriority`, `brand.logo.svgPath`/`src`, ...).

## Basic Usage

Empty header with default config.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Basic Usage
description: Empty header with default config.
```

## Brand And Nav

Logo + nav links, active link highlighted via `currentPath`.

```example
file: examples/BrandAndNav.ts
html: examples/BrandAndNav.html
title: Brand And Nav
description: Logo + nav links, active link highlighted via `currentPath`.
```

## Sticky

Pinned to viewport top with translucent backdrop-blur (`position: sticky`, `blur: true`).

```example
file: examples/Sticky.ts
html: examples/Sticky.html
title: Sticky
description: Pinned to viewport top with translucent backdrop-blur (`position: sticky`, `blur: true`).
```

## Auto Sync Route

`autoSyncRoute` makes the active-link indicator follow the URL hash automatically.

```example
file: examples/AutoSyncRoute.ts
html: examples/AutoSyncRoute.html
title: Auto Sync Route
description: `autoSyncRoute` makes the active-link indicator follow the URL hash automatically.
```

## Declarative Actions

`data.actions` renders ordered action buttons with `collapsePriority` - no slotted markup required. Also demonstrates `brand.logo.svgPath`.

```example
file: examples/DeclarativeActions.ts
html: examples/DeclarativeActions.html
title: Declarative Actions
description: `data.actions` renders ordered action buttons with `collapsePriority` - no slotted markup required.
```

## Marketing Header

Fixed, scroll-transparent bar with the brand centered (`position: "fixed"`, `scrollTransparent: true`, `logoPosition: "middle"`) - ported from the merged XWUILayoutHeader's "marketing header" block.

```example
file: examples/MarketingHeader.ts
html: examples/MarketingHeader.html
title: Marketing Header
description: Fixed, scroll-transparent bar with the brand centered.
```

## Showcase

Flagship demo: menu model with dropdowns, `currentPath`/`setCurrentPath()`, size scale, surface treatments, `logoPosition`, uppercase labels, `setLinkBadge()`.

```example
file: examples/Showcase.ts
html: examples/Showcase.html
title: Showcase
description: Menu model, currentPath/setCurrentPath, size scale, surface treatments, logoPosition, uppercase labels, setLinkBadge.
```

```api
```
