-
Notifications
You must be signed in to change notification settings - Fork 836
/
accordion.ts
62 lines (59 loc) · 1.52 KB
/
accordion.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
57
58
59
60
61
62
import {Accordion, Panel} from 'baseui/accordion';
import {PropTypes} from 'react-view';
import {TConfig} from '../types';
const accordionProps = require('!!extract-react-types-loader!../../../../src/accordion/accordion.js');
const panelProps = require('!!extract-react-types-loader!../../../../src/accordion/panel.js');
const AccordionConfig: TConfig = {
imports: {
'baseui/accordion': {named: ['Accordion']},
},
scope: {
Accordion,
Panel,
},
theme: [],
props: {
children: {
value: `<Panel title="Panel 1">
Content 1
</Panel>
<Panel title="Panel 2">
Content 2
</Panel>
<Panel title="Panel 3">
Content 3
</Panel>`,
type: PropTypes.ReactNode,
description: `An array of Panel components.`,
imports: {
'baseui/accordion': {named: ['Panel']},
},
},
onChange: {
value: '({expanded}) => console.log(expanded)',
type: PropTypes.Function,
description: 'Called when a panel is expanded.',
},
disabled: {
value: false,
type: PropTypes.Boolean,
description: 'Renders component in disabled state.',
},
overrides: {
value: undefined,
type: PropTypes.Custom,
description: 'Lets you customize all aspects of the component.',
custom: {
names: ['Content', 'Header', 'PanelContainer', 'Root', 'ToggleIcon'],
sharedProps: {
$disabled: 'disabled',
},
},
},
},
mapTokensToProps: {
Accordion: accordionProps,
Panel: panelProps,
},
};
export default AccordionConfig;