-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(documentation-v7): create snapshot story for collapsible
- Loading branch information
1 parent
de14cb1
commit b51881e
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...ages/documentation-v7/src/stories/components/collapsible/collapsible.snapshot.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { html } from 'lit'; | ||
import type { Args, StoryContext, StoryObj } from '@storybook/web-components'; | ||
import { bombArgs } from '../../../utils/bombArgs'; | ||
|
||
import meta, { Default } from './collapsible.stories'; | ||
|
||
export default { | ||
...meta, | ||
title: 'Snapshots', | ||
}; | ||
|
||
type Story = StoryObj<HTMLPostCollapsibleElement>; | ||
|
||
export const collapsible: Story = { | ||
render: (_args: Args, context: StoryContext<HTMLPostCollapsibleElement>) => { | ||
const templateVariants = bombArgs({ | ||
innerHTML: [ | ||
`<span slot="header">Titulum</span><p>Contentus momentus vero siteos et accusam iretea et justo.</p>`, | ||
`<p>Contentus momentus vero siteos et accusam iretea et justo.</p>`, | ||
], | ||
collapsed: [false, true], | ||
headingLevel: [1, 2, 3, 4, 5, 6], | ||
}).map((args: Args) => { | ||
return html` | ||
<div class="col-6 p-3"> | ||
${meta.render?.({ ...context.args, ...Default.args, ...args }, context)} | ||
</div> | ||
`; | ||
}); | ||
|
||
return html` | ||
<div> | ||
${['white', 'dark'].map( | ||
bg => html` | ||
<div class=${'row bg-' + bg}>${templateVariants}</div> | ||
`, | ||
)} | ||
</div> | ||
`; | ||
}, | ||
}; |