mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Storybook: Fix decorator height (#41468)
* 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
This commit is contained in:
parent
8adefa32fd
commit
cd5277befd
6
packages/grafana-ui/.storybook/preview-head.html
Normal file
6
packages/grafana-ui/.storybook/preview-head.html
Normal file
@ -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 { Story } from '@storybook/react';
|
||||||
import { Badge, BadgeProps } from '@grafana/ui';
|
import { Badge, BadgeProps } from '@grafana/ui';
|
||||||
import { iconOptions } from '../../utils/storybook/knobs';
|
import { iconOptions } from '../../utils/storybook/knobs';
|
||||||
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Data Display/Badge',
|
title: 'Data Display/Badge',
|
||||||
component: Badge,
|
component: Badge,
|
||||||
decorators: [],
|
decorators: [withCenteredStory],
|
||||||
parameters: {
|
parameters: {
|
||||||
docs: {},
|
docs: {},
|
||||||
},
|
},
|
||||||
|
@ -11,7 +11,7 @@ const PaddedStory: React.FunctionComponent<{}> = ({ children }) => {
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
padding: '20px',
|
padding: '20px',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
minHeight: '80vh',
|
minHeight: '100%',
|
||||||
background: `${theme.colors.background.primary}`,
|
background: `${theme.colors.background.primary}`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -5,7 +5,7 @@ const RightAlignedStory: React.FunctionComponent<{}> = ({ children }) => {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
height: '100vh ',
|
minHeight: '100%',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'flex-start',
|
alignItems: 'flex-start',
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
|
@ -21,7 +21,7 @@ const ThemeableStory: React.FunctionComponent<{ handleSassThemeChange: SassTheme
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
padding: '20px',
|
padding: '20px',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
minHeight: '80vh',
|
minHeight: '100%',
|
||||||
background: `${theme.colors.background.primary}`,
|
background: `${theme.colors.background.primary}`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user