mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
docs(uishell): replace with header
This commit is contained in:
parent
972bd338b1
commit
b79567f932
2 changed files with 65 additions and 37 deletions
|
@ -1,7 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
export let story = undefined;
|
export let story = undefined;
|
||||||
|
|
||||||
import UIShell from './UIShell.svelte';
|
|
||||||
import SettingsAdjust20 from 'carbon-icons-svelte/lib/SettingsAdjust20';
|
import SettingsAdjust20 from 'carbon-icons-svelte/lib/SettingsAdjust20';
|
||||||
import Help20 from 'carbon-icons-svelte/lib/Help20';
|
import Help20 from 'carbon-icons-svelte/lib/Help20';
|
||||||
import ChangeCatalog16 from 'carbon-icons-svelte/lib/ChangeCatalog16';
|
import ChangeCatalog16 from 'carbon-icons-svelte/lib/ChangeCatalog16';
|
||||||
|
@ -15,6 +14,7 @@
|
||||||
import SideNavMenu from './SideNav/SideNavMenu.svelte';
|
import SideNavMenu from './SideNav/SideNavMenu.svelte';
|
||||||
import SideNavMenuItem from './SideNav/SideNavMenuItem.svelte';
|
import SideNavMenuItem from './SideNav/SideNavMenuItem.svelte';
|
||||||
import SideNavLink from './SideNav/SideNavLink.svelte';
|
import SideNavLink from './SideNav/SideNavLink.svelte';
|
||||||
|
import Header from './GlobalHeader/Header.svelte';
|
||||||
import HeaderNav from './GlobalHeader/HeaderNav.svelte';
|
import HeaderNav from './GlobalHeader/HeaderNav.svelte';
|
||||||
import HeaderNavItem from './GlobalHeader/HeaderNavItem.svelte';
|
import HeaderNavItem from './GlobalHeader/HeaderNavItem.svelte';
|
||||||
import HeaderNavMenu from './GlobalHeader/HeaderNavMenu.svelte';
|
import HeaderNavMenu from './GlobalHeader/HeaderNavMenu.svelte';
|
||||||
|
@ -109,8 +109,10 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if story === 'with-nav'}
|
{#if story === 'base'}
|
||||||
<UIShell {...$$props}>
|
<Header {...$$props} />
|
||||||
|
{:else if story === 'with-header-and-nav'}
|
||||||
|
<Header {...$$props}>
|
||||||
<HeaderNav>
|
<HeaderNav>
|
||||||
<HeaderNavItem href="/" text="Link 1" />
|
<HeaderNavItem href="/" text="Link 1" />
|
||||||
<HeaderNavItem href="/" text="Link 2" />
|
<HeaderNavItem href="/" text="Link 2" />
|
||||||
|
@ -121,20 +123,29 @@
|
||||||
<HeaderNavItem href="/" text="Link 3" />
|
<HeaderNavItem href="/" text="Link 3" />
|
||||||
</HeaderNavMenu>
|
</HeaderNavMenu>
|
||||||
</HeaderNav>
|
</HeaderNav>
|
||||||
</UIShell>
|
</Header>
|
||||||
{:else if story === 'with-actions'}
|
{:else if story === 'with-utilities'}
|
||||||
<UIShell {...$$props}>
|
<Header {...$$props}>
|
||||||
<HeaderUtilities>
|
<HeaderUtilities>
|
||||||
<HeaderActionSearch />
|
<HeaderActionSearch />
|
||||||
<HeaderAction type="Settings" icon={iSettings}>
|
<HeaderAction type="Settings" icon={iSettings}>
|
||||||
<p>Settings</p>
|
<HeaderPanelLinks>
|
||||||
|
<HeaderPanelDivider>Settings</HeaderPanelDivider>
|
||||||
|
</HeaderPanelLinks>
|
||||||
</HeaderAction>
|
</HeaderAction>
|
||||||
<HeaderActionLink type="Help" icon={iHelp} />
|
<HeaderActionLink type="Help" icon={iHelp} />
|
||||||
<HeaderAction type="Notifications" icon={iNotifications}>
|
<HeaderAction type="Notifications" icon={iNotifications} isOpen={true}>
|
||||||
<p>Notifications</p>
|
<HeaderPanelLinks>
|
||||||
|
<HeaderPanelDivider>Notifications</HeaderPanelDivider>
|
||||||
|
</HeaderPanelLinks>
|
||||||
</HeaderAction>
|
</HeaderAction>
|
||||||
<HeaderActionLink type="Account" icon={iAccount} />
|
<HeaderActionLink type="Account" icon={iAccount} />
|
||||||
<HeaderAction type="Switcher" icon={iSwitcher}>
|
</HeaderUtilities>
|
||||||
|
</Header>
|
||||||
|
{:else if story === 'with-switcher'}
|
||||||
|
<Header {...$$props}>
|
||||||
|
<HeaderUtilities>
|
||||||
|
<HeaderAction type="Switcher" icon={iSwitcher} isOpen={true}>
|
||||||
<HeaderPanelLinks>
|
<HeaderPanelLinks>
|
||||||
<HeaderPanelDivider>Switcher subject 1</HeaderPanelDivider>
|
<HeaderPanelDivider>Switcher subject 1</HeaderPanelDivider>
|
||||||
<HeaderPanelLink>Switecher item 1</HeaderPanelLink>
|
<HeaderPanelLink>Switecher item 1</HeaderPanelLink>
|
||||||
|
@ -147,9 +158,9 @@
|
||||||
</HeaderPanelLinks>
|
</HeaderPanelLinks>
|
||||||
</HeaderAction>
|
</HeaderAction>
|
||||||
</HeaderUtilities>
|
</HeaderUtilities>
|
||||||
</UIShell>
|
</Header>
|
||||||
{:else if story === 'with-sidenav'}
|
{:else if story === 'with-sidenav'}
|
||||||
<UIShell bind:isSideNavOpen {...$$props}>
|
<Header bind:isSideNavOpen {...$$props} />
|
||||||
<SideNav isOpen={isSideNavOpen}>
|
<SideNav isOpen={isSideNavOpen}>
|
||||||
<SideNavItems>
|
<SideNavItems>
|
||||||
<SideNavMenu text="Menu 01" icon={iCatalog}>
|
<SideNavMenu text="Menu 01" icon={iCatalog}>
|
||||||
|
@ -167,7 +178,4 @@
|
||||||
<SideNavLink text="Menu 03" href="/" icon={iProtection} />
|
<SideNavLink text="Menu 03" href="/" icon={iProtection} />
|
||||||
</SideNavItems>
|
</SideNavItems>
|
||||||
</SideNav>
|
</SideNav>
|
||||||
</UIShell>
|
|
||||||
{:else}
|
|
||||||
<UIShell {...$$props} />
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -3,27 +3,47 @@ import Component from './UIShell.Story.svelte';
|
||||||
|
|
||||||
export default { title: 'UIShell', decorators: [withKnobs] };
|
export default { title: 'UIShell', decorators: [withKnobs] };
|
||||||
|
|
||||||
export const WithNav = () => ({
|
export const Base = () => ({
|
||||||
Component,
|
Component,
|
||||||
props: {
|
props: {
|
||||||
story: 'with-nav',
|
story: 'base',
|
||||||
href: text('The link href (href)', '#'),
|
href: text('The link href (href)', '#'),
|
||||||
company: text('Company name', 'IBM'),
|
company: text('Company name', 'IBM'),
|
||||||
platformName: text('Platform name', 'Platform Name')
|
platformName: text('Platform name', 'Platform Name')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const WithActions = () => ({
|
export const WithHeaderAndNav = () => ({
|
||||||
Component,
|
Component,
|
||||||
props: {
|
props: {
|
||||||
story: 'with-actions',
|
story: 'with-header-and-nav',
|
||||||
href: text('The link href (href)', '#'),
|
href: text('The link href (href)', '#'),
|
||||||
company: text('Company name', 'IBM'),
|
company: text('Company name', 'IBM'),
|
||||||
platformName: text('Platform name', 'Platform Name')
|
platformName: text('Platform name', 'Platform Name')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const WithActionsAndSidenav = () => ({
|
export const WithUtilities = () => ({
|
||||||
|
Component,
|
||||||
|
props: {
|
||||||
|
story: 'with-utilities',
|
||||||
|
href: text('The link href (href)', '#'),
|
||||||
|
company: text('Company name', 'IBM'),
|
||||||
|
platformName: text('Platform name', 'Platform Name')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const WithSwitcher = () => ({
|
||||||
|
Component,
|
||||||
|
props: {
|
||||||
|
story: 'with-switcher',
|
||||||
|
href: text('The link href (href)', '#'),
|
||||||
|
company: text('Company name', 'IBM'),
|
||||||
|
platformName: text('Platform name', 'Platform Name')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const WithSidenav = () => ({
|
||||||
Component,
|
Component,
|
||||||
props: {
|
props: {
|
||||||
story: 'with-sidenav',
|
story: 'with-sidenav',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue