-
Notifications
You must be signed in to change notification settings - Fork 836
/
menu.ts
56 lines (52 loc) · 1.25 KB
/
menu.ts
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
48
49
50
51
52
53
54
55
56
import {StatefulMenu} from 'baseui/menu';
import {PropTypes} from 'react-view';
import {TConfig} from '../types';
const menuProps = require('!!extract-react-types-loader!../../../../src/menu/stateful-menu.js');
const items = `[
{label: 'Item One'},
{label: 'Item Two'},
{label: 'Item Three'},
{label: 'Item Four'},
]`;
const MenuConfig: TConfig = {
imports: {
'baseui/menu': {
named: ['StatefulMenu'],
},
},
scope: {StatefulMenu},
theme: [
'menuFill',
'menuFillHover',
'menuFontDefault',
'menuFontDisabled',
'menuFontHighlighted',
'menuFontSelected',
],
props: {
items: {
value: items,
type: PropTypes.Array,
description: 'Array of items in the menu.',
},
onItemSelect: {
value: undefined,
type: PropTypes.Function,
description: 'Callback executed on menu item clicks.',
placeholder: '({item}) => console.log(item)',
},
overrides: {
value: undefined,
type: PropTypes.Custom,
description: 'Lets you customize all aspects of the component.',
custom: {
names: ['Option', 'List', 'EmptyState'],
sharedProps: {},
},
},
},
mapTokensToProps: {
StatefulMenu: menuProps,
},
};
export default MenuConfig;