dydx-v4-web/src/components/DropdownSelectMenu.stories.tsx
James Jia - Test 4b86068d8f
Initial commit
2023-09-08 13:52:13 -07:00

54 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useState } from 'react';
import type { Story } from '@ladle/react';
import { DropdownSelectMenu } from '@/components/DropdownSelectMenu';
import { StoryWrapper } from '.ladle/components';
const exampleItems = [
{
value: '1',
label: 'Item 1',
slotBefore: '1⃣',
},
{
value: '2',
label: 'Item 2',
slotBefore: '2⃣',
},
{
value: '3',
label: 'Item 3',
slotBefore: '3⃣',
},
{
value: '4',
label: 'Item 4',
slotBefore: '4⃣',
},
];
export const DropdownSelectMenuStory: Story<Parameters<typeof DropdownSelectMenu>> = (args) => {
const [item, setItem] = useState(exampleItems[0].value);
return (
<StoryWrapper>
<DropdownSelectMenu
items={exampleItems}
value={item}
onValueChange={(value) => setItem(value)}
{...args}
/>
</StoryWrapper>
);
};
DropdownSelectMenuStory.args = {};
DropdownSelectMenuStory.argTypes = {
align: {
options: ['start', 'center', 'end'],
control: { type: 'select' },
defaultValue: 'center',
},
};