|
| 1 | +import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks"; |
| 2 | +import { withKnobs } from "@storybook/addon-knobs"; |
| 3 | +import { ViewPort } from "../ViewPort"; |
| 4 | +import { Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../Space"; |
| 5 | +import { green, description, lorem } from "./Utils"; |
| 6 | + |
| 7 | +<Meta title="Components|Fill" component={Fill} /> |
| 8 | + |
| 9 | +# Default |
| 10 | + |
| 11 | +Space which fills all remaining space taken up by anchored spaces. |
| 12 | + |
| 13 | +<Preview> |
| 14 | + <Story name="With left space"> |
| 15 | + <ViewPort> |
| 16 | + <Left size="20%">{description("Left 20%")}</Left> |
| 17 | + <Fill style={green}>{description("Fill")}</Fill> |
| 18 | + </ViewPort> |
| 19 | + </Story> |
| 20 | + <Story name="With top space"> |
| 21 | + <ViewPort> |
| 22 | + <Top size="20%">{description("Top 20%")}</Top> |
| 23 | + <Fill style={green}>{description("Fill")}</Fill> |
| 24 | + </ViewPort> |
| 25 | + </Story> |
| 26 | + <Story name="With right space"> |
| 27 | + <ViewPort> |
| 28 | + <Right size="20%">{description("Right 20%")}</Right> |
| 29 | + <Fill style={green}>{description("Fill")}</Fill> |
| 30 | + </ViewPort> |
| 31 | + </Story> |
| 32 | + <Story name="With bottom space"> |
| 33 | + <ViewPort> |
| 34 | + <Bottom size="20%">{description("Bottom 20%")}</Bottom> |
| 35 | + <Fill style={green}>{description("Fill")}</Fill> |
| 36 | + </ViewPort> |
| 37 | + </Story> |
| 38 | + <Story name="With left resizable space"> |
| 39 | + <ViewPort> |
| 40 | + <LeftResizable size="20%" trackSize={true}> |
| 41 | + {description("Left resizable 20%")} |
| 42 | + </LeftResizable> |
| 43 | + <Fill style={green} trackSize={true}> |
| 44 | + {description("Fill")} |
| 45 | + </Fill> |
| 46 | + </ViewPort> |
| 47 | + </Story> |
| 48 | + <Story name="With top resizable space"> |
| 49 | + <ViewPort> |
| 50 | + <TopResizable size="20%" trackSize={true}> |
| 51 | + {description("Top resizable 20%")} |
| 52 | + </TopResizable> |
| 53 | + <Fill style={green} trackSize={true}> |
| 54 | + {description("Fill")} |
| 55 | + </Fill> |
| 56 | + </ViewPort> |
| 57 | + </Story> |
| 58 | + <Story name="With right resizable space"> |
| 59 | + <ViewPort> |
| 60 | + <RightResizable size="20%" trackSize={true}> |
| 61 | + {description("Right resizable 20%")} |
| 62 | + </RightResizable> |
| 63 | + <Fill style={green} trackSize={true}> |
| 64 | + {description("Fill")} |
| 65 | + </Fill> |
| 66 | + </ViewPort> |
| 67 | + </Story> |
| 68 | + <Story name="With bottom resizable space"> |
| 69 | + <ViewPort> |
| 70 | + <BottomResizable size="20%" trackSize={true}> |
| 71 | + {description("Bottom resizable 20%")} |
| 72 | + </BottomResizable> |
| 73 | + <Fill style={green} trackSize={true}> |
| 74 | + {description("Fill")} |
| 75 | + </Fill> |
| 76 | + </ViewPort> |
| 77 | + </Story> |
| 78 | + <Story name="Scrollable"> |
| 79 | + <ViewPort> |
| 80 | + <Fill style={green} scrollable={true}> |
| 81 | + {lorem} |
| 82 | + </Fill> |
| 83 | + </ViewPort> |
| 84 | + </Story> |
| 85 | +</Preview> |
| 86 | + |
| 87 | +# Properties |
| 88 | + |
| 89 | +<Props of={Fill} /> |
0 commit comments