Storybook: Fix decorator height (#41468) (#41519)

* fix(storybook): make sure story background fills available height

* fix(storybook): add decorator to prevent badge filling all available height

* docs(badge): use centered story

* revert(badge): remove obsolete Meta typing

(cherry picked from commit cd5277befd)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-11-10 11:24:19 +01:00
committed by GitHub
co-authored by Jack Westbrook
parent fff0da8fe9
commit 49aa3f8d4f
5 changed files with 11 additions and 4 deletions
@@ -0,0 +1,6 @@
<!-- Make sure iframe dom elements fill all available space for background consistency -->
<style>
#root {
height: 100%;
}
</style>
@@ -2,11 +2,12 @@ import React from 'react';
import { Story } from '@storybook/react';
import { Badge, BadgeProps } from '@grafana/ui';
import { iconOptions } from '../../utils/storybook/knobs';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
export default {
title: 'Data Display/Badge',
component: Badge,
decorators: [],
decorators: [withCenteredStory],
parameters: {
docs: {},
},
@@ -11,7 +11,7 @@ const PaddedStory: React.FunctionComponent<{}> = ({ children }) => {
width: '100%',
padding: '20px',
display: 'flex',
minHeight: '80vh',
minHeight: '100%',
background: `${theme.colors.background.primary}`,
}}
>
@@ -5,7 +5,7 @@ const RightAlignedStory: React.FunctionComponent<{}> = ({ children }) => {
return (
<div
style={{
height: '100vh ',
minHeight: '100%',
display: 'flex',
alignItems: 'flex-start',
justifyContent: 'flex-end',
@@ -21,7 +21,7 @@ const ThemeableStory: React.FunctionComponent<{ handleSassThemeChange: SassTheme
width: '100%',
padding: '20px',
display: 'flex',
minHeight: '80vh',
minHeight: '100%',
background: `${theme.colors.background.primary}`,
}}
>