mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
29 lines
847 B
Svelte
29 lines
847 B
Svelte
<script>
|
|
export let uiShellAriaLabel = undefined;
|
|
export let href = undefined;
|
|
export let company = undefined;
|
|
export let platformName = undefined;
|
|
|
|
import { cx } from '../../lib';
|
|
import HamburgerMenu from './SideNav/HamburgerMenu.svelte';
|
|
|
|
let isSideNavOpen = undefined;
|
|
let winWidth = undefined;
|
|
$: isSideNavOpen = winWidth >= 1056;
|
|
|
|
$: ariaLabel = company + (uiShellAriaLabel || $$props['aria-label'] || platformName);
|
|
</script>
|
|
|
|
<svelte:window bind:innerWidth={winWidth} />
|
|
|
|
<header aria-label={ariaLabel} class={cx('--header')} role="banner">
|
|
{#if winWidth < 1056}
|
|
<HamburgerMenu bind:isOpen={isSideNavOpen} />
|
|
{/if}
|
|
<a class={cx('--header__name')} {href}>
|
|
<span class={cx('--header__name--prefix')}>{company}</span>
|
|
{platformName}
|
|
</a>
|
|
<slot name="Nav" />
|
|
<slot name="SideNav" />
|
|
</header>
|