redux-devtools/packages/redux-devtools-ui/src/Select/Select.stories.tsx
Nathan Bierema c52cfbe469
Upgrade to Storybook 7 (#1386)
* Migrate

* Config updates

* Remove

* No require-from-string

* Update lock file

* Fix types

* Doesn't work

* Update to CSF3
2023-04-06 21:39:14 -04:00

54 lines
980 B
TypeScript

import React from 'react';
import styled from 'styled-components';
import Select from './';
import { options } from './options';
import { Meta, StoryObj } from '@storybook/react';
const Container = styled.div`
display: flex;
height: 100%;
width: 100%;
justify-content: center;
align-items: center;
> div {
width: 90%;
}
`;
const meta: Meta = {
title: 'Select',
component: Select,
};
export default meta;
type Story = StoryObj<typeof Select>;
export const Default: Story = {
render: ({ value, ...args }) => (
<Container>
<Select
options={options}
value={options.filter((option) => option.value === value)}
{...args}
/>
</Container>
),
args: {
value: 'one',
maxMenuHeight: 300,
isClearable: false,
isDisabled: false,
isLoading: false,
isMulti: false,
isSearchable: true,
menuPlacement: 'bottom',
},
argTypes: {
onChange: {
action: 'selected',
},
},
};