From 64797f1c2ce6b2f769c3d22d0fafa260296a99e1 Mon Sep 17 00:00:00 2001 From: Fabien Rassinier Date: Mon, 29 Jun 2020 17:56:58 +0200 Subject: [PATCH 01/13] fix(addon-docs): stories with min-height --- lib/components/package.json | 3 +- lib/components/src/blocks/Story.stories.tsx | 41 +++++++++++++++++++++ lib/components/src/blocks/Story.tsx | 16 +++++--- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/lib/components/package.json b/lib/components/package.json index c0bff2aa3c5f..cb5785442cc3 100644 --- a/lib/components/package.json +++ b/lib/components/package.json @@ -49,7 +49,8 @@ "react-popper-tooltip": "^3.1.0", "react-syntax-highlighter": "^13.5.0", "react-textarea-autosize": "^8.1.1", - "ts-dedent": "^1.1.1" + "ts-dedent": "^1.1.1", + "uuid": "^8.0.0" }, "devDependencies": { "css": "^3.0.0", diff --git a/lib/components/src/blocks/Story.stories.tsx b/lib/components/src/blocks/Story.stories.tsx index 3d2bacc90cec..8d4b60f94ca2 100644 --- a/lib/components/src/blocks/Story.stories.tsx +++ b/lib/components/src/blocks/Story.stories.tsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { styled } from '@storybook/theming'; import { Story, StoryError } from './Story'; import { Button } from '../Button/Button'; @@ -23,3 +24,43 @@ export const Inline = () => ; + +const FixedLayoutExample = styled.div(({ theme }) => ({ + '&, header, aside, main': { + position: 'fixed', + top: 0, + right: 0, + bottom: 0, + left: 0, + }, + header: { + height: '3rem', + background: theme.background.positive, + }, + 'aside, main': { + top: '3rem', + }, + aside: { + width: '10rem', + background: theme.background.warning, + }, + main: { + left: '10rem', + background: theme.background.negative, + }, +})); + +export const CustomHeight = () => ( + ( + +
+