Enrich styleguide with new features, rules and changes

The styleguide for usage of visual elements has not been updated for a long time. In the course of this story it should be adapted to the current standards and rules. In addition, heavy violations were rectified directly.
This commit is contained in:
Florian Scholdei
2021-01-28 12:46:42 +01:00
committed by GitHub
parent 0046c78b40
commit 57c9484d41
12 changed files with 2530 additions and 1003 deletions

View File

@@ -52,6 +52,24 @@ const text = `Mind-paralyzing change needed improbability vortex machine sorts s
// eslint-disable-next-line @typescript-eslint/no-empty-function
const doNothing = () => {};
const withFormElementsBody = (
<>
<RadioList>
<Radio label="One" checked={true} helpText="The first one" />
<Radio label="Two" checked={false} helpText="The second one" />
</RadioList>
<hr />
<p>{text}</p>
<hr />
<Textarea label="Text" onChange={doNothing} />
</>
);
const withFormElementsFooter = (
<ButtonGroup>
<Button label="One" />
<Button label="Two" />
</ButtonGroup>
);
storiesOf("Modal|Modal", module)
.addDecorator(story => <MemoryRouter initialEntries={["/"]}>{story()}</MemoryRouter>)
@@ -66,21 +84,13 @@ storiesOf("Modal|Modal", module)
</CloseableModal>
))
.add("With form elements", () => (
<NonCloseableModal>
<RadioList>
<Radio label="One" checked={true} helpText="The first one" />
<Radio label="Two" checked={false} helpText="The second one" />
</RadioList>
<hr />
<p>{text}</p>
<hr />
<Textarea label="Text" onChange={doNothing} />
<hr />
<ButtonGroup>
<Button label="One" />
<Button label="Two" />
</ButtonGroup>
</NonCloseableModal>
<Modal
body={withFormElementsBody}
closeFunction={doNothing}
active={true}
title={"Hitchhiker Modal"}
footer={withFormElementsFooter}
/>
))
.add("With long tooltips", () => {
return (