Add more components to Storybook

pull/10354/head
Thibaud Colas 2023-04-19 06:48:19 +01:00
rodzic 9325f7dd6f
commit 69eef34e56
3 zmienionych plików z 48 dodań i 1 usunięć

Wyświetl plik

@ -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/',
};

Wyświetl plik

@ -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>
</>
);

Wyświetl plik

@ -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": "",