-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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 #19806 from storybookjs/jeppe/sb-898-blocks-descri…
…ption Blocks: Description stories
- Loading branch information
Showing
5 changed files
with
151 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Description } from './Description'; | ||
import { BooleanControl } from '../controls/Boolean'; | ||
|
||
const meta: Meta<typeof Description> = { | ||
component: Description, | ||
parameters: { | ||
relativeCsfPaths: ['../controls/Boolean.stories'], | ||
controls: { | ||
include: [], | ||
hideNoControlsWarning: true, | ||
}, | ||
}, | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const BooleanControlJSDoc: Story = { | ||
args: { | ||
of: BooleanControl, | ||
}, | ||
}; |
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
85 changes: 85 additions & 0 deletions
85
code/ui/blocks/src/blocks/internal/InternalDescription.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,85 @@ | ||
import React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Description, DescriptionType } from '../Description'; | ||
import { BooleanControl } from '../../controls/Boolean'; | ||
|
||
const meta: Meta<typeof Description> = { | ||
title: 'Blocks/Internal/Description', | ||
component: Description, | ||
parameters: { | ||
relativeCsfPaths: ['../controls/Boolean.stories'], | ||
}, | ||
args: { | ||
of: BooleanControl, | ||
}, | ||
}; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const InfoType: Story = { | ||
args: { | ||
type: DescriptionType.INFO, | ||
}, | ||
}; | ||
export const NotesType: Story = { | ||
args: { | ||
type: DescriptionType.NOTES, | ||
}, | ||
}; | ||
export const DocgenType: Story = { | ||
args: { | ||
type: DescriptionType.DOCGEN, | ||
}, | ||
}; | ||
export const AutoType: Story = { | ||
args: { | ||
type: DescriptionType.AUTO, | ||
}, | ||
}; | ||
export const Markdown: Story = { | ||
args: { | ||
markdown: `# My Example Markdown | ||
|
||
An \`inline\` codeblock | ||
|
||
\`\`\`tsx | ||
// TypeScript React code block | ||
export const MyStory = () => { | ||
return <Button>Click me</Button>; | ||
}; | ||
\`\`\` | ||
|
||
\`\`\` | ||
code block with with no language | ||
const a = fn({ | ||
b: 2, | ||
}); | ||
\`\`\` | ||
`, | ||
}, | ||
}; | ||
export const Children: Story = { | ||
render: (args) => ( | ||
<Description {...args}> | ||
{`# My Example Markdown | ||
|
||
An \`inline\` codeblock | ||
|
||
\`\`\`tsx | ||
// TypeScript React code block | ||
export const MyStory = () => { | ||
return <Button>Click me</Button>; | ||
}; | ||
\`\`\` | ||
|
||
\`\`\` | ||
code block with with no language | ||
const a = fn({ | ||
b: 2, | ||
}); | ||
\`\`\` | ||
`} | ||
</Description> | ||
), | ||
}; |
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