-
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.
Merge pull request #148 from PrestaShopCorp/feat/update-storybook
Feat/update storybook
- Loading branch information
Showing
43 changed files
with
6,286 additions
and
9,477 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
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
2 changes: 1 addition & 1 deletion
2
docs/stories/TailwindPreset.stories.mdx → docs/stories/docs/TailwindPreset.mdx
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
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') |
Oops, something went wrong.