-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Container): rework container component
- Loading branch information
Showing
3 changed files
with
179 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,135 @@ | ||
import {Meta, Story} from '@storybook/vue3'; | ||
import VContainer from './VContainer.vue'; | ||
|
||
export default { | ||
title: 'Deprecated/Container', | ||
component: VContainer, | ||
argTypes: {}, | ||
args: { | ||
mini: false, | ||
fixed: false, | ||
}, | ||
} as Meta; | ||
|
||
const Template: Story = (args) => ({ | ||
// Components used in your story `template` are defined in the `components` object | ||
components: { | ||
VContainer, | ||
}, | ||
// The story's `args` need to be mapped into the template through the `setup()` method | ||
setup() { | ||
return {args}; | ||
}, | ||
// And then the `args` are bound to your component with `v-bind="args"` | ||
template: `<VContainer v-bind="args">Content</VContainer>`, | ||
}); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = {}; | ||
Default.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Mini = Template.bind({}); | ||
Mini.args = {mini: true}; | ||
Mini.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container mini> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Fixed = Template.bind({}); | ||
Fixed.args = {fixed: true}; | ||
Fixed.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container fixed> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
import { VBtn, VAppShell, VAppBar, VLogo, VList, VListItem } from '@morpheme/ui'; | ||
import {NavDrawer as VNavDrawer} from '@morpheme/nav-drawer' | ||
import {Meta, Story} from '@storybook/vue3'; | ||
import VContainer from './VContainer.vue'; | ||
import { ref } from 'vue'; | ||
|
||
export default { | ||
title: 'Components/Container', | ||
component: VContainer, | ||
argTypes: {}, | ||
args: { | ||
mini: false, | ||
fixed: false, | ||
}, | ||
} as Meta; | ||
|
||
const Template: Story = (args) => ({ | ||
components: { | ||
VContainer, | ||
}, | ||
setup() { | ||
return {args}; | ||
}, | ||
template: `<VContainer v-bind="args">Content</VContainer>`, | ||
}); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = {}; | ||
Default.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Mini = Template.bind({}); | ||
Mini.args = {mini: true}; | ||
Mini.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container mini> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Fixed = Template.bind({}); | ||
Fixed.args = {fixed: true}; | ||
Fixed.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container fixed> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Padded = Template.bind({}); | ||
Padded.args = {padded: true}; | ||
Padded.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container padded> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Fluid = Template.bind({}); | ||
Fluid.args = {fluid: true}; | ||
Fluid.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container fluid> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Centered = Template.bind({}); | ||
Centered.args = {centered: true}; | ||
Centered.parameters = { | ||
docs: { | ||
source: { | ||
code: `<v-container centered> Content </v-container>`, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Example: Story = (args) => ({ | ||
components: { | ||
VContainer, | ||
VAppBar, | ||
VNavDrawer, | ||
VLogo, | ||
VList, | ||
VListItem, | ||
VAppShell, | ||
VBtn | ||
}, | ||
setup() { | ||
const isDrawerOpen = ref(true) | ||
const isMini = ref(false) | ||
return {args, isMini, isDrawerOpen}; | ||
}, | ||
template: ` | ||
<VAppBar shadow> | ||
<VContainer centered> | ||
<VBtn fab text icon prefix-icon="ri:menu-line" | ||
@click="isDrawerOpen = !isDrawerOpen" | ||
/> | ||
<VBtn fab text icon prefix-icon="ri:side-bar-line" | ||
@click="isMini = !isMini" | ||
/> | ||
</VContainer> | ||
</VAppBar> | ||
<div class="flex mt-4"> | ||
<VNavDrawer | ||
v-model="isDrawerOpen" | ||
:mini="isMini" | ||
> | ||
<VList | ||
:mini="isMini" | ||
> | ||
<VListItem prepend-icon="ri:home-line">Home</VListItem> | ||
<VListItem prepend-icon="ri:settings-3-line">Settings</VListItem> | ||
<VListItem prepend-icon="ri:account-circle-line">Profile</VListItem> | ||
</VList> | ||
</VNavDrawer> | ||
<VContainer | ||
:mini="isMini" | ||
> | ||
Content | ||
</VContainer> | ||
</div> | ||
`, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters