Skip to content

Commit

Permalink
[fix](@svelteui/core): set fixed as true by default in AppShell and s…
Browse files Browse the repository at this point in the history
…tory
  • Loading branch information
BeeMargarida committed Aug 11, 2023
1 parent 6e29bad commit 138a23d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<script lang="ts">
import { Meta, Template, Story } from '@storybook/addon-svelte-csf';
import { Anchor } from '../Anchor';
import { Stack } from '../Stack';
import { Text } from '../Text';
import { Title } from '../Title';
import { AppShell, Header, Navbar, ShellSection } from './index';
</script>

<Meta title="Components/App Shell" component={AppShell} />

<Template>
<AppShell>
<Navbar slot="navbar" fixed width={{ sm: 200, lg: 300 }}>
<ShellSection grow>
<Stack>
<Text align="center">Navbar</Text>
<Anchor href="#">Home Page</Anchor>
<Anchor href="#">Test Page</Anchor>
</Stack>
</ShellSection>
</Navbar>
<Header slot="header" height={60}>
<Title>Header</Title>
</Header>
<div style="display: flex;">This is the main content</div>
</AppShell>
</Template>

<Story name="App Shell" id="appShellStory" />
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
className: $$Props['className'] = '',
override: $$Props['override'] = {},
zIndex: $$Props['zIndex'] = 100,
fixed: $$Props['fixed'] = false,
fixed: $$Props['fixed'] = true,
padding: $$Props['padding'] = 'md',
navbarOffsetBreakpoint: $$Props['navbarOffsetBreakpoint'] = undefined,
asideOffsetBreakpoint: $$Props['asideOffsetBreakpoint'] = undefined;
Expand All @@ -33,6 +33,7 @@
));
</script>

<!-- @TODO: Remove the AppShellProvider, since it's not being used for anything (react pattern) -->
<AppShellProvider {use} bind:element value={{ fixed, zIndex }} class={cx(className, classes.root)}>
<Box>
{#if $$slots.header}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
override: $$Props['override'] = {},
width: $$Props['width'] = undefined,
height: $$Props['height'] = undefined,
fixed: $$Props['fixed'] = false,
fixed: $$Props['fixed'] = true,
position: $$Props['position'] = { top: 0, left: 0 },
hiddenBreakpoint: $$Props['hiddenBreakpoint'] = 'md',
hidden: $$Props['hidden'] = false,
Expand Down

0 comments on commit 138a23d

Please sign in to comment.