-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTabsCustom.tsx
More file actions
128 lines (124 loc) · 3.67 KB
/
TabsCustom.tsx
File metadata and controls
128 lines (124 loc) · 3.67 KB
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
import { Tab, TabGroup } from 'dd360-ds'
import { useState } from 'react'
const TabsCustom = ({ option }: { option: string }) => {
const [variant, setVariant] = useState<'primary' | 'secondary' | 'tertiary'>(
'primary'
)
const [orientation, setOrientation] = useState<'vertical' | 'horizontal'>(
'horizontal'
)
const [fontSize, setFontSize] = useState<'xs' | 'sm' | 'base' | 'lg' | 'xl'>(
'xs'
)
return (
<div>
<div>
<TabGroup
variant={variant}
orientation={orientation}
fontSize={fontSize}
>
<Tab label="Element First" />
<Tab label="Element Second" />
<Tab label="Element Third" />
<Tab label="Element Disabled" disabled />
</TabGroup>
</div>
<div className="mt-6 flex gap-x-4 text-sm items-center">
{option === 'isVariant' && (
<>
<input
checked={variant === 'primary'}
className="cursor-pointer"
name="variant"
onChange={() => setVariant('primary')}
type="radio"
/>
<label>Primary</label>
<input
checked={variant === 'secondary'}
className="cursor-pointer"
name="variant"
onChange={() => setVariant('secondary')}
type="radio"
/>
<label>Secondary</label>
<input
checked={variant === 'tertiary'}
className="cursor-pointer"
name="variant"
onChange={() => setVariant('tertiary')}
type="radio"
/>
<label>Tertiary</label>
</>
)}
{option === 'isOrientation' && (
<>
<input
checked={orientation === 'horizontal'}
className="cursor-pointer"
name="orientation"
onChange={() => setOrientation('horizontal')}
type="radio"
/>
<label>Horizontal</label>
<input
checked={orientation === 'vertical'}
className="cursor-pointer"
name="orientation"
onChange={() => setOrientation('vertical')}
type="radio"
/>
<label>Vertical</label>
</>
)}
{option === 'isFontSize' && (
<>
<input
checked={fontSize === 'xs'}
className="cursor-pointer"
name="size"
onChange={() => setFontSize('xs')}
type="radio"
/>
<label>xs</label>
<input
checked={fontSize === 'sm'}
className="cursor-pointer"
name="size"
onChange={() => setFontSize('sm')}
type="radio"
/>
<label>sm</label>
<input
checked={fontSize === 'base'}
className="cursor-pointer"
name="size"
onChange={() => setFontSize('base')}
type="radio"
/>
<label>base</label>
<input
checked={fontSize === 'lg'}
className="cursor-pointer"
name="size"
onChange={() => setFontSize('lg')}
type="radio"
/>
<label>lg</label>
<input
checked={fontSize === 'xl'}
className="cursor-pointer"
name="size"
onChange={() => setFontSize('xl')}
type="radio"
/>
<label>xl</label>
</>
)}
</div>
</div>
)
}
export default TabsCustom