import React, { useState } from 'react';
import { storiesOf } from '@storybook/react';
import isChromatic from 'storybook-chromatic/isChromatic';
import {
Grommet,
Accordion,
AccordionPanel,
Anchor,
Box,
Button,
Calendar,
Chart,
CheckBox,
Clock,
DataTable,
Distribution,
FormField,
Grid,
Heading,
MaskedInput,
Menu,
Meter,
Paragraph,
RadioButtonGroup,
RangeInput,
RangeSelector,
Select,
Stack,
Tab,
Tabs,
Text,
TextArea,
TextInput,
Video,
} from 'grommet';
import { dark, generate, grommet } from 'grommet/themes';
import { deepMerge } from 'grommet/utils';
import { hpe } from 'grommet-theme-hpe';
import { aruba } from 'grommet-theme-aruba';
import { hp } from 'grommet-theme-hp';
import { dxc } from 'grommet-theme-dxc';
import { v1 } from 'grommet-theme-v1';
const Node = ({ id, ...rest }) => (
);
const themes = {
dark,
grommet,
hpe,
aruba,
hp,
dxc,
v1,
};
const daysInMonth = (month: number) => new Date(2019, month, 0).getDate();
const Components = () => {
const [baseSize, setBaseSize] = useState(24);
const [checkBox, setCheckBox] = useState(true);
const [radioButton, setRadioButton] = useState('RadioButton 1');
const [rangeSelector, setRangeSelector] = useState([1, 2]);
const [themeName] = useState('grommet');
const [background] = useState(undefined);
const [tabIndex, setTabIndex] = useState(0);
const [value, setValue] = useState('');
const [date, setDate] = useState('');
const [rangeInputValue, setRangeInputValue] = useState(24);
const [textAreaValue, setTextAreaValue] = useState('');
const [textInputValue, setTextInputValue] = useState('');
const theme = deepMerge(generate(baseSize), themes[themeName]);
const content = [
Heading
Paragraph
Text
Anchor
,
,
,
,
{value => (
{value.value}
)}
{[1, 2].map(id => (
))}
{[3, 4].map(id => (
))}
{/* */}
,
,
Accordion panel 1 content
Accordion panel 2 content
,
setTabIndex(index)}>
Tab 1 content
Tab 2 content
,
,
];
return (
setBaseSize(parseInt(event.target.value, 10))}
/>
{`${baseSize}px base spacing`}
{/* {Grid.available ? ( */}
{Grid ? (
{content}
) : (
{content}
)}
);
};
if (!isChromatic()) {
storiesOf('TypeScript/All', module).add('All', () => );
}