-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
937 additions
and
868 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
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,51 +1,54 @@ | ||
import { PuikCard } from '@puik/components' | ||
import type { Story, Meta } from '@storybook/vue3' | ||
import type { StoryFn, StoryObj, Meta } from '@storybook/vue3' | ||
|
||
export default { | ||
title: 'Styles/Grid', | ||
} as Meta | ||
|
||
function generateStory(defaultViewport?: string) { | ||
const htmlTemplate = `<div class="puik-grid"> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card class="col-span-2">2 col</puik-card> | ||
<puik-card class="col-span-2">2 col</puik-card> | ||
<puik-card class="col-span-2">2 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-4">4 col</puik-card> | ||
<puik-card class="col-span-4">4 col</puik-card> | ||
<puik-card class="col-span-4">4 col</puik-card> | ||
</div>` | ||
const htmlTemplate = `<div class="puik-grid"> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card>1 col</puik-card> | ||
<puik-card class="col-span-2">2 col</puik-card> | ||
<puik-card class="col-span-2">2 col</puik-card> | ||
<puik-card class="col-span-2">2 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-3">3 col</puik-card> | ||
<puik-card class="col-span-4">4 col</puik-card> | ||
<puik-card class="col-span-4">4 col</puik-card> | ||
<puik-card class="col-span-4">4 col</puik-card> | ||
</div>` | ||
|
||
const Template: Story = () => ({ | ||
components: { PuikCard }, | ||
template: htmlTemplate, | ||
}) | ||
const Template: StoryFn = () => ({ | ||
components: { PuikCard }, | ||
template: htmlTemplate, | ||
}) | ||
|
||
const Story: Story = Template.bind({}) | ||
Story.parameters = { | ||
controls: { hideNoControlsWarning: true }, | ||
docs: { | ||
source: { | ||
code: htmlTemplate, | ||
language: 'html', | ||
function generateStory(defaultViewport?: string): StoryObj { | ||
const Story: StoryObj = { | ||
render: Template, | ||
parameters: { | ||
controls: { hideNoControlsWarning: true }, | ||
docs: { | ||
source: { | ||
code: htmlTemplate, | ||
language: 'html', | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
if (defaultViewport) Story.parameters.viewport = { defaultViewport } | ||
if (defaultViewport && Story.parameters) | ||
Story.parameters.viewport = { defaultViewport } | ||
|
||
return Story | ||
} | ||
|
||
export const Lg = generateStory() | ||
export const Lg = generateStory('lg') | ||
export const Md = generateStory('md') | ||
export const Sm = generateStory('sm') |
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
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
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
Oops, something went wrong.