mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
first commit on the UIShell
This commit is contained in:
parent
0bdae666c4
commit
d3c2732c4c
13 changed files with 492 additions and 0 deletions
32
src/components/UIShell/UIShell.svelte
Normal file
32
src/components/UIShell/UIShell.svelte
Normal file
|
@ -0,0 +1,32 @@
|
|||
<script>
|
||||
export let uiShellAriaLabel = undefined;
|
||||
export let href = undefined;
|
||||
export let company = undefined;
|
||||
export let platformName = undefined;
|
||||
export let navMenu = undefined;
|
||||
export let rightPanel = undefined;
|
||||
|
||||
import { cx } from '../../lib';
|
||||
import UIShellNavWrapper from './UIShellNav/UIShellNavWrapper.svelte';
|
||||
import UIShellNavItem from './UIShellNav/UIShellNavItem.svelte';
|
||||
import UIShellRightPanel from './UIShellRightPanel/UIShellRightPanel.svelte';
|
||||
|
||||
$: ariaLabel = 'IBM ' + (uiShellAriaLabel || $$props['aria-label'] || platformName);
|
||||
</script>
|
||||
|
||||
<header aria-label={ariaLabel} class={cx('--header')} role="banner">
|
||||
<a class={cx('--header__name')} {href}>
|
||||
<span class={cx('--header__name--prefix')}>{company}</span>
|
||||
{platformName}
|
||||
</a>
|
||||
{#if navMenu}
|
||||
<UIShellNavWrapper ariaLabel>
|
||||
{#each navMenu as itemMenu}
|
||||
<UIShellNavItem {...itemMenu} />
|
||||
{/each}
|
||||
</UIShellNavWrapper>
|
||||
{/if}
|
||||
{#if rightPanel}
|
||||
<UIShellRightPanel {rightPanel} />
|
||||
{/if}
|
||||
</header>
|
Loading…
Add table
Add a link
Reference in a new issue