kopia lustrzana https://github.com/wagtail/wagtail
Add more components to Storybook
rodzic
9325f7dd6f
commit
69eef34e56
|
@ -0,0 +1,21 @@
|
|||
import React from 'react';
|
||||
import { Pattern, generateDocs } from 'storybook-django/src/react';
|
||||
|
||||
import template from './whats_new_in_wagtail_version.html';
|
||||
|
||||
const { docs, argTypes } = generateDocs(template);
|
||||
|
||||
export default {
|
||||
title: 'Home / New in Wagtail',
|
||||
parameters: { docs },
|
||||
argTypes: { ...argTypes },
|
||||
};
|
||||
|
||||
const Template = (args) => <Pattern filename={__filename} context={args} />;
|
||||
|
||||
export const Base = Template.bind({});
|
||||
Base.args = {
|
||||
version: '99',
|
||||
dismissible_id: 'aabbcc',
|
||||
editor_guide_link: 'https://guide.wagtail.org/',
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
import React from 'react';
|
||||
import { Pattern, generateDocs } from 'storybook-django/src/react';
|
||||
|
||||
import template from './help_block.html';
|
||||
|
||||
const { docs, argTypes } = generateDocs(template);
|
||||
|
||||
export default {
|
||||
parameters: { docs },
|
||||
argTypes: { ...argTypes },
|
||||
};
|
||||
|
||||
const HelpBlock = (props) => <Pattern filename={__filename} context={props} />;
|
||||
|
||||
export const Base = () => (
|
||||
<>
|
||||
<HelpBlock status="info">Help block info message</HelpBlock>
|
||||
<HelpBlock status="warning">Help block warning message</HelpBlock>
|
||||
<HelpBlock status="critical">Help block critical message</HelpBlock>
|
||||
</>
|
||||
);
|
|
@ -18,7 +18,12 @@ PATTERN_LIBRARY = {
|
|||
# Groups of templates for the pattern library navigation. The keys
|
||||
# are the group titles and the values are lists of template name prefixes that will
|
||||
# be searched to populate the groups.
|
||||
"SECTIONS": (("components", ["wagtailadmin/shared", "wagtailadmin/panels"]),),
|
||||
"SECTIONS": (
|
||||
(
|
||||
"components",
|
||||
["wagtailadmin/shared", "wagtailadmin/panels", "wagtailadmin/home"],
|
||||
),
|
||||
),
|
||||
# Configure which files to detect as templates.
|
||||
"TEMPLATE_SUFFIX": ".html",
|
||||
"PATTERN_BASE_TEMPLATE_NAME": "",
|
||||
|
|
Ładowanie…
Reference in New Issue