-
Notifications
You must be signed in to change notification settings - Fork 180
/
dropdown-menu.examples.tsx
47 lines (40 loc) · 1.42 KB
/
dropdown-menu.examples.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React from 'react';
import reactDecorator from '../../.storybook/react-decorator';
import DropdownMenu from './dropdown-menu';
export default {
title: 'Components/DropdownMenu',
decorators: [reactDecorator()],
parameters: {
notes: 'Displays a menu in a dropdown.',
hermione: {
actions: [
{type: 'click', selector: '[data-test~=ring-dropdown]'},
{
type: 'capture',
name: 'dropdown',
selector: ['[data-test~=ring-dropdown]', '[data-test~=ring-popup]']
}
]
},
a11y: {element: '*[data-test~=ring-dropdown]'}
}
};
export const basic = () => {
const data = [
{label: 'Item'},
{label: 'Link to jetbrains.com', href: 'http://www.jetbrains.com'},
{rgItemType: DropdownMenu.ListProps.Type.SEPARATOR},
{rgItemType: DropdownMenu.ListProps.Type.LINK, label: 'Link Item'},
{
rgItemType: DropdownMenu.ListProps.Type.LINK,
label: 'Link Item With Additional Class',
className: 'test'
},
{rgItemType: DropdownMenu.ListProps.Type.SEPARATOR, description: 'Separator With Description'},
{rgItemType: DropdownMenu.ListProps.Type.TITLE, label: 'Title'},
{rgItemType: DropdownMenu.ListProps.Type.ITEM, label: '1 Element in group'},
{rgItemType: DropdownMenu.ListProps.Type.ITEM, label: '2 Element in group'}
];
return <DropdownMenu data={data} anchor={'Click me!'}/>;
};
basic.storyName = 'DropdownMenu';