From d88704a00983376c008d39c3f67ccc3f58abfbbe Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Fri, 31 Jul 2020 10:17:03 +0200 Subject: [PATCH] improve modal stories to show overflow bug on form elements --- .../src/modals/Modal.stories.tsx | 194 +++++++++++++++--- 1 file changed, 168 insertions(+), 26 deletions(-) diff --git a/scm-ui/ui-components/src/modals/Modal.stories.tsx b/scm-ui/ui-components/src/modals/Modal.stories.tsx index 711cc26129..3633d6ed00 100644 --- a/scm-ui/ui-components/src/modals/Modal.stories.tsx +++ b/scm-ui/ui-components/src/modals/Modal.stories.tsx @@ -24,52 +24,194 @@ import { storiesOf } from "@storybook/react"; import { MemoryRouter } from "react-router-dom"; -import * as React from "react"; -import { useState } from "react"; +import React, { useState, FC } from "react"; import Modal from "./Modal"; import Checkbox from "../forms/Checkbox"; import styled from "styled-components"; +import ExternalLink from "../navigation/ExternalLink"; +import { Radio, Textarea, InputField } from "../forms"; +import { ButtonGroup, Button } from "../buttons"; +import Notification from "../Notification"; const TopAndBottomMargin = styled.div` margin: 0.75rem 0; // only for aesthetic reasons `; -const body = ( -

- Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows +const RadioList = styled.div` + display: flex; + flex-direction: column; + > label:not(:last-child) { + margin-bottom: 0.6em; + } +`; + +const text = `Mind-paralyzing change needed improbability vortex machine sorts sought same theory upending job just allows hostess’s really oblong Infinite Improbability thing into the starship against which behavior accordance.with Kakrafoon humanoid undergarment ship powered by GPP-guided bowl of petunias nothing was frequently away incredibly - ordinary mob. -

-); + ordinary mob.`; -const checkboxBody = ( - <> -

This content should not cause a vertical scrollbar.

- - - - - -); +// eslint-disable-next-line @typescript-eslint/no-empty-function +const doNothing = () => {}; storiesOf("Modal|Modal", module) .addDecorator(story => {story()}) - .add("Default", () => ) - .add("With Checkbox with HelpText inside", () => ( - true} active={true} title={"Hitchhiker Modal"} /> + .add("Default", () => ( + +

{text}

+
+ )) + .add("Closeable", () => ( + +

{text}

+
+ )) + .add("With form elements", () => ( + + + + + +
+

{text}

+
+