forked from coingaming/moon-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabs.tsx
137 lines (135 loc) · 4.13 KB
/
tabs.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import React from 'react';
import Preview from '../../components/codePreview/Preview';
import ComponentPageDescription from '../../components/ComponentPageDescription';
import PropsTable from '../../components/PropsTable';
import Default from '../../public/examples/tabs/Default';
import HorizontalVariants from '../../public/examples/tabs/HorizontalVariants';
import Small from '../../public/examples/tabs/Small';
import Variant from '../../public/examples/tabs/Variant';
import VerticalVariants from '../../public/examples/tabs/VerticalVariants';
import useExamples from '../../utils/useExamples';
const PageTabsNew = () => {
const examples = useExamples('tabs');
return (
<>
<ComponentPageDescription title="Tabs">
<p>
Use tabs to allow users to navigate easily between views within the
same context.
</p>
<p>
Each tab should contain content that is distinct from other tabs in a
set. For example, tabs can present different sections of news,
different genres of music, or different themes of documents.
</p>
</ComponentPageDescription>
<Preview
title="Default"
preview={<Default />}
code={examples ? examples.Default : 'Loading'}
/>
<Preview
title="Horizontal variants"
preview={<HorizontalVariants />}
code={examples ? examples.HorizontalVariants : 'Loading'}
/>
<Preview
title="Vertical variants"
preview={<VerticalVariants />}
code={examples ? examples.VerticalVariants : 'Loading'}
/>
<Preview
title="Size: 'small'"
preview={<Small />}
code={examples ? examples.Small : 'Loading'}
/>
<Preview
title="Tabs with additional elements"
preview={<Variant />}
code={examples ? examples.Variant : 'Loading'}
/>
<PropsTable
title="Props for Tabs component"
data={[
{
name: 'items',
type: 'React.ReactElement[]',
required: true,
default: '-',
description:
'TabLink/TabLinkFill or any other component provide the tab interaction',
},
{
name: 'size',
type: 'small | medium',
required: false,
default: 'medium',
description: 'Small/medium size for tab items',
},
{
name: 'dir',
type: 'ltr | rtl | auto',
required: false,
default: 'auto',
description: 'Support right to left languages',
},
{
name: 'isTop',
type: 'boolean',
required: false,
default: 'false',
description: 'Underline top view. Only for TabLink',
},
{
name: 'isContainer',
type: 'boolean',
required: false,
default: 'false',
description: 'Segment control view. Only for TabLinkFill',
},
]}
/>
<PropsTable
title="Props for TabsLink/TabsLinkFill components"
data={[
{
name: 'elementLeft',
type: 'React.ReactElement',
required: false,
default: '-',
description: 'Left icon element',
},
{
name: 'count',
type: 'string',
required: false,
default: '-',
description: 'Rigth text element',
},
{
name: 'href',
type: 'string',
required: false,
default: '-',
description: `The href attribute specifies the link's destination`,
},
{
name: 'isActive',
type: 'boolean',
required: false,
default: '-',
description: `Set item as active by default`,
},
{
name: 'onClick',
type: 'function',
required: false,
default: '-',
description: `Handler on click action`,
},
]}
/>
</>
);
};
export default PageTabsNew;