import * as React from "react";
import styled from "@emotion/styled";
import { Story, Meta } from "@storybook/react";
import Flex from "../components/Flex";
import FlexItem from "../components/FlexItem";
import { themeBrandPrimary } from "../../../../design-tokens/build/js/designTokens";
const SampleContainer = styled.div`
background-color: #f5f5f5;
> * {
height: 80px;
}
`;
const DemoChild = styled.div`
background-color: white;
border: 2px solid ${themeBrandPrimary};
height: 100%;
padding: 4px;
text-align: center;
`;
export default {
title: "Layout/FlexItem",
component: FlexItem,
argTypes: {
flex: {
options: ["shrink", "grow"]
},
growFactor: {
options: [1, 2]
},
order: {
options: [1, 2, 3, 4]
},
className: {
control: { disable: true }
}
}
} as Meta;
const flexChildren = [1, 2, 3, 4];
const Template: Story = args => (
The first flex item is `flex="shrink"` on narrower viewports and `flex="grow"` on wider viewports
The first flex item has a grow factor of 1 on narrower viewports, and a grow factor of 3 on wider viewports
The first flex-item has an order of 0 on narrower viewports, and an order of 3 on wider viewports