hds-web 1.6.8 → 1.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/HDS/assets/icons/calendar-plus-01.svg +1 -1
- package/src/HDS/assets/icons/calendar-plus-02.svg +1 -1
- package/src/HDS/assets/icons/hasura-1.svg +3 -0
- package/src/HDS/assets/icons/hasura-2.svg +3 -0
- package/src/HDS/assets/icons/hasura-3.svg +3 -0
- package/src/HDS/components/Avatars/hasConAv.js +9 -10
- package/src/HDS/components/Avatars/profileAvatar.js +10 -29
- package/src/HDS/components/BadgesCaption/badges.js +7 -4
- package/src/HDS/components/Buttons/button.js +25 -14
- package/src/HDS/components/Cards/Dropdown/v3Dropdown.js +1 -1
- package/src/HDS/components/Cards/Feedback/feedback.js +1 -1
- package/src/HDS/components/Cards/ImageBox/imagebox.js +51 -0
- package/src/HDS/components/Cards/ImageBox/index.js +1 -0
- package/src/HDS/components/Cards/Link/link.js +19 -13
- package/src/HDS/components/Cards/Menu/flyout.js +5 -4
- package/src/HDS/components/Cards/Menu/flyoutA.js +5 -4
- package/src/HDS/components/Cards/Menu/flyoutFull.js +1 -0
- package/src/HDS/components/Cards/Misc/iconCard.js +71 -60
- package/src/HDS/components/Cards/Misc/index.js +1 -0
- package/src/HDS/components/Cards/Misc/talkCard.js +19 -18
- package/src/HDS/components/Cards/Misc/talkcard2.js +118 -0
- package/src/HDS/components/Cards/TalkDetailCard/talkDetailCard.js +83 -52
- package/src/HDS/components/Carousels/carouselCard.js +101 -90
- package/src/HDS/components/Headers/v3Header.js +111 -85
- package/src/HDS/components/Hero/h2.js +58 -36
- package/src/HDS/components/Hero/h3.js +413 -0
- package/src/HDS/components/Hero/index.js +2 -1
- package/src/HDS/components/Tables/index.js +2 -1
- package/src/HDS/components/Tables/tableB.js +10 -10
- package/src/HDS/components/Tables/tableC.js +20 -23
- package/src/HDS/components/Tables/tableD.js +326 -0
- package/src/HDS/components/Tabs/tab.js +47 -16
- package/src/HDS/components/common-components/Icon/IconMap.js +6 -0
- package/src/HDS/components/index.js +2 -1
- package/src/HDS/foundation/ColorPalette/color.js +193 -1
- package/src/HDS/foundation/Typography/Typography.js +2 -1
- package/src/HDS/helpers/Grid/grid.js +64 -0
- package/src/HDS/helpers/Grid/index.js +1 -0
- package/src/HDS/helpers/Media/index.js +1 -0
- package/src/HDS/helpers/Media/mediabox.js +75 -0
- package/src/HDS/helpers/index.js +2 -1
- package/src/HDS/modules/TextCard/textCard.js +8 -71
- package/src/HDS/modules/index.js +2 -1
- package/src/HDS/modules/navCard/index.js +1 -0
- package/src/HDS/modules/navCard/navCard.js +82 -0
- package/src/index.css +39 -1
- package/src/styles/tailwind.css +3104 -1848
- package/tailwind.config.js +6 -3
@@ -9,9 +9,7 @@ export default function TableA(props) {
|
|
9
9
|
children
|
10
10
|
|
11
11
|
} = props;
|
12
|
-
|
13
|
-
const tableLength = tableValue.length;
|
14
|
-
|
12
|
+
const firstObjectLength = Object.keys(tableValue[0]).length;
|
15
13
|
return (
|
16
14
|
<div className=" ">
|
17
15
|
<div className="sm:flex sm:items-center ">
|
@@ -19,51 +17,50 @@ export default function TableA(props) {
|
|
19
17
|
<h1 className="text-base font-semibold leading-6 text-gray-900">{head}</h1>
|
20
18
|
<p className="mt-2 text-sm text-gray-700">{description}</p>
|
21
19
|
</div>
|
22
|
-
|
23
|
-
</div>
|
24
20
|
|
21
|
+
</div>
|
25
22
|
<div>
|
26
|
-
<div className="border
|
23
|
+
<div className="border border-neutral-100 rounded-2xl">
|
27
24
|
<table className="min-w-full divide-y divide-neutral-100 ">
|
28
|
-
<div>
|
29
|
-
|
30
|
-
|
31
25
|
<thead>
|
32
26
|
<tr className='divide-x divide-neutral-100'>
|
33
|
-
{Object.keys(tableValue[0]).map((key) => (
|
27
|
+
{Object.keys(tableValue[0]).map((key, index) => (
|
34
28
|
<th
|
35
29
|
key={key}
|
36
30
|
scope="col"
|
37
|
-
className=
|
31
|
+
className={(index === 0) ? 'rounded-tl-2xl text-left sm:table-cell bg-neutral-50' : 'text-left sm:table-cell bg-neutral-50 rounded-tr-2xl'}
|
38
32
|
>
|
39
33
|
<Typography className='p-6' textStyle='body3c-bold'>{key}</Typography>
|
40
|
-
|
34
|
+
|
41
35
|
</th>
|
42
36
|
))}
|
37
|
+
|
43
38
|
</tr>
|
44
39
|
</thead>
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
<tr key={index} className='divide-x divide-neutral-100'>
|
40
|
+
<tbody className="divide-y rounded-b-3xl divide-neutral-100 ">
|
41
|
+
{tableValue.slice(1).map((value, index) => (
|
42
|
+
<tr key={index} className='divide-x divide-neutral-100 '>
|
49
43
|
{Object.keys(value).map((key, index2) => (
|
44
|
+
|
45
|
+
|
46
|
+
|
50
47
|
<td
|
51
|
-
|
48
|
+
key={index2 + index}
|
52
49
|
className={
|
53
|
-
'p-6
|
50
|
+
'p-6 ' + ((index == `${tableValue.length - 2}`) ? 'rounded-3xl' : '')
|
54
51
|
}
|
55
52
|
>
|
56
|
-
|
57
|
-
<Typography textStyle='body3c-bold' className='bg-transparent text-neutral-800'>{key}</Typography>
|
58
|
-
<Typography textStyle='body3' className='text-neutral-800 mt-2'>
|
53
|
+
|
54
|
+
<Typography textStyle='body3c-bold' className='bg-transparent text-neutral-800'>{key.toString()}</Typography>
|
55
|
+
<Typography textStyle='body3' className='text-neutral-800 mt-2'>{value[key].toString()}</Typography>
|
59
56
|
|
60
57
|
</td>
|
58
|
+
|
61
59
|
))}
|
62
60
|
</tr>
|
63
61
|
))}
|
64
62
|
</tbody>
|
65
|
-
|
66
|
-
</table>
|
63
|
+
</table>
|
67
64
|
</div>
|
68
65
|
</div>
|
69
66
|
</div>
|
@@ -0,0 +1,326 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Typography } from '../../foundation/Typography'
|
3
|
+
import { Icon } from '../common-components/Icon'
|
4
|
+
import { HDSColor } from '../../foundation/ColorPalette';
|
5
|
+
import ReactMarkdown from "react-markdown";
|
6
|
+
import { HDSButton } from "../Buttons"
|
7
|
+
|
8
|
+
export default function PricingTableB(props) {
|
9
|
+
const {
|
10
|
+
title,
|
11
|
+
title_color,
|
12
|
+
description,
|
13
|
+
desc_color,
|
14
|
+
TABLE_VALUE,
|
15
|
+
TABLE_HEADER,
|
16
|
+
} = props;
|
17
|
+
const tableValuesm = (section, keyIndex) => {
|
18
|
+
|
19
|
+
let columnSize = '';
|
20
|
+
let scrapData;
|
21
|
+
if (section[keyIndex][0]) {
|
22
|
+
scrapData = section[keyIndex][0];
|
23
|
+
}
|
24
|
+
|
25
|
+
const firstKeys = section[keyIndex].map(item => Object.keys(item)[0]);
|
26
|
+
const rowTitleKey = firstKeys[0];
|
27
|
+
if (section[keyIndex].length) {
|
28
|
+
columnSize = section[keyIndex].length;
|
29
|
+
}
|
30
|
+
return (
|
31
|
+
<>
|
32
|
+
{section[keyIndex].map((value, index) => (
|
33
|
+
<tr className='' key={index}>
|
34
|
+
{Object.keys(value).map((keyIndex) => (
|
35
|
+
<React.Fragment key={index + keyIndex}>
|
36
|
+
{keyIndex !== null
|
37
|
+
&& keyIndex === rowTitleKey
|
38
|
+
&& index != (columnSize - 1)
|
39
|
+
&& index != 0 && (
|
40
|
+
<td
|
41
|
+
|
42
|
+
className="pl-[30px] border-80 "
|
43
|
+
>
|
44
|
+
<div className=' '>
|
45
|
+
<Typography className='py-4 text-neutral-700' textStyle='body1c'>{value[keyIndex]}</Typography>
|
46
|
+
</div>
|
47
|
+
</td>)}
|
48
|
+
{keyIndex !== null
|
49
|
+
&& keyIndex === rowTitleKey
|
50
|
+
&& index != (columnSize - 1)
|
51
|
+
&& index == 0 && (
|
52
|
+
<td
|
53
|
+
className="pl-[30px] border-80 "
|
54
|
+
>
|
55
|
+
<div className=' '>
|
56
|
+
<Typography className='pb-4 pt-12 text-neutral-700' textStyle='body1c'>{value[keyIndex]}</Typography>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
|
60
|
+
</td>)}
|
61
|
+
|
62
|
+
{keyIndex !== null
|
63
|
+
&& keyIndex === rowTitleKey
|
64
|
+
&& index == (columnSize - 1) && (
|
65
|
+
<td
|
66
|
+
|
67
|
+
className="pl-[30px] border-80 "
|
68
|
+
>
|
69
|
+
<div className=' '>
|
70
|
+
<Typography className='pt-4 pb-12 text-neutral-700' textStyle='body1c'>{value[keyIndex]}</Typography>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
|
74
|
+
</td>)}
|
75
|
+
|
76
|
+
{keyIndex !== null && keyIndex !== rowTitleKey && value[keyIndex] !== null && index != 0 && index != (columnSize - 1) && (
|
77
|
+
<td
|
78
|
+
|
79
|
+
className="px-8 text-left ml-[30px] border-80 "
|
80
|
+
>
|
81
|
+
{value && keyIndex && value[keyIndex] && value[keyIndex]['text'] === null && !value[keyIndex]['iconVariant'] && value[keyIndex]['iconVariant'] === null && (
|
82
|
+
<div className=''></div>
|
83
|
+
|
84
|
+
)}
|
85
|
+
{value[keyIndex]['text'] !== null && value[keyIndex]['text'] && (
|
86
|
+
<div className=' '>
|
87
|
+
<Typography className='text-neutral-700 py-4' textStyle='body1c'>{value[keyIndex]['text']}</Typography>
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
)}
|
92
|
+
{(value[keyIndex]['text'] === null || !value[keyIndex]['text']) && value[keyIndex]['iconVariant'] && (
|
93
|
+
<div className='flex '>
|
94
|
+
<Icon height='h-5 w-5 stroke-[1.5px]' variant={value[keyIndex]['iconVariant']} strokeClass={HDSColor(value[keyIndex]['iconStrokeClass'])} />
|
95
|
+
</div>
|
96
|
+
)}
|
97
|
+
</td>)
|
98
|
+
}
|
99
|
+
{keyIndex !== null && keyIndex !== rowTitleKey && value[keyIndex] !== null && index == 0 && (
|
100
|
+
<td
|
101
|
+
|
102
|
+
className="px-8 text-left ml-[30px] border-80 "
|
103
|
+
>
|
104
|
+
{value && keyIndex && value[keyIndex] && value[keyIndex]['text'] === null && !value[keyIndex]['iconVariant'] && value[keyIndex]['iconVariant'] === null && (
|
105
|
+
<div className=''></div>
|
106
|
+
|
107
|
+
)}
|
108
|
+
{value[keyIndex]['text'] !== null && value[keyIndex]['text'] && (
|
109
|
+
<div className=' '>
|
110
|
+
<Typography className='text-neutral-700 pb-4 pt-12' textStyle='body1c'>{value[keyIndex]['text']}</Typography>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
|
114
|
+
)}
|
115
|
+
{(value[keyIndex]['text'] === null || !value[keyIndex]['text']) && value[keyIndex]['iconVariant'] && (
|
116
|
+
<div className='flex pb-4 pt-12'>
|
117
|
+
<Icon height='h-5 w-5 stroke-[1.5px]' variant={value[keyIndex]['iconVariant']} strokeClass={HDSColor(value[keyIndex]['iconStrokeClass'])} />
|
118
|
+
</div>
|
119
|
+
)}
|
120
|
+
</td>)
|
121
|
+
}
|
122
|
+
{keyIndex !== null && keyIndex !== rowTitleKey && value[keyIndex] !== null && index == (columnSize - 1) && (
|
123
|
+
<td
|
124
|
+
|
125
|
+
className="px-8 text-left ml-[30px] border-80 "
|
126
|
+
>
|
127
|
+
{value && keyIndex && value[keyIndex] && value[keyIndex]['text'] === null && !value[keyIndex]['iconVariant'] && value[keyIndex]['iconVariant'] === null && (
|
128
|
+
<div className=''></div>
|
129
|
+
|
130
|
+
)}
|
131
|
+
{value[keyIndex]['text'] !== null && value[keyIndex]['text'] && (
|
132
|
+
<div className=' '>
|
133
|
+
<Typography className='text-neutral-700 pt-4 pb-12' textStyle='body1c'>{value[keyIndex]['text']}</Typography>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
|
137
|
+
)}
|
138
|
+
{(value[keyIndex]['text'] === null || !value[keyIndex]['text']) && value[keyIndex]['iconVariant'] && (
|
139
|
+
<div className='flex pt-4 pb-12 '>
|
140
|
+
<Icon height='h-5 w-5 stroke-[1.5px]' variant={value[keyIndex]['iconVariant']} strokeClass={HDSColor(value[keyIndex]['iconStrokeClass'])} />
|
141
|
+
</div>
|
142
|
+
)}
|
143
|
+
</td>)
|
144
|
+
}
|
145
|
+
|
146
|
+
{keyIndex === null && (
|
147
|
+
<td
|
148
|
+
key={index}
|
149
|
+
className="px-8 py-7 border-table text-center"
|
150
|
+
>
|
151
|
+
</td>
|
152
|
+
)}
|
153
|
+
|
154
|
+
|
155
|
+
</React.Fragment>
|
156
|
+
))}
|
157
|
+
</tr>
|
158
|
+
))}
|
159
|
+
</>
|
160
|
+
)
|
161
|
+
}
|
162
|
+
return (
|
163
|
+
<div className='px-10'>
|
164
|
+
<div className=" flex justify-around ">
|
165
|
+
<div className="w-full flex-col items-center flex justify-around tb-l:flex tb-l:flex-col tb-l:items-center">
|
166
|
+
<div>
|
167
|
+
{title && (
|
168
|
+
<Typography
|
169
|
+
textStyle='h3'
|
170
|
+
className={HDSColor(title_color)}
|
171
|
+
>
|
172
|
+
{title}
|
173
|
+
</Typography>
|
174
|
+
)}
|
175
|
+
{description && (
|
176
|
+
<Typography
|
177
|
+
textStyle='body1c'
|
178
|
+
className={HDSColor(desc_color)}
|
179
|
+
>
|
180
|
+
{description}
|
181
|
+
</Typography>
|
182
|
+
)}
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
<div className='hidden tb:block' >
|
187
|
+
<div className=" mt-[70px] rounded-3xl ">
|
188
|
+
<table className="rounded-3xl w-full table-fixed ">
|
189
|
+
<thead>
|
190
|
+
<tr className=' text-left first:pr-20 '>
|
191
|
+
{Object.keys(TABLE_HEADER).map((key, index) => (
|
192
|
+
<th
|
193
|
+
key={index}
|
194
|
+
scope="col"
|
195
|
+
className="px-8 pb-[54px] sm:table-cell text-left"
|
196
|
+
>
|
197
|
+
<div className='flex text-left'>
|
198
|
+
<div className='flex flex-col text-center'>
|
199
|
+
<div className={'flex gap-2'}>
|
200
|
+
{TABLE_HEADER[key]['icon'] &&
|
201
|
+
(
|
202
|
+
<Icon
|
203
|
+
height='h-6 w-6 stroke-[1.5px]'
|
204
|
+
variant={TABLE_HEADER[key]['icon']}
|
205
|
+
strokeClass={HDSColor(TABLE_HEADER[key]['iconStrokeClass'])} />
|
206
|
+
)
|
207
|
+
}
|
208
|
+
{
|
209
|
+
TABLE_HEADER[key]['title'] && key == 0 && (
|
210
|
+
<Typography
|
211
|
+
textStyle='h3'
|
212
|
+
className={` w-1/2 text-left ${HDSColor(TABLE_HEADER[key]['title_text_color'])}`}>
|
213
|
+
{TABLE_HEADER[key]['title']}
|
214
|
+
</Typography>)
|
215
|
+
}
|
216
|
+
{
|
217
|
+
TABLE_HEADER[key]['title'] && key != 0 && (
|
218
|
+
<Typography
|
219
|
+
textStyle='h5'
|
220
|
+
className={` text-left ${HDSColor(TABLE_HEADER[key]['title_text_color'])}`}>
|
221
|
+
<ReactMarkdown>{TABLE_HEADER[key]['title']}</ReactMarkdown>
|
222
|
+
</Typography>)
|
223
|
+
}
|
224
|
+
</div>
|
225
|
+
<div className=''>
|
226
|
+
{TABLE_HEADER[key]['descr'] && (
|
227
|
+
<Typography
|
228
|
+
textStyle='body1'
|
229
|
+
className={` text-left ${HDSColor(TABLE_HEADER[key]['descr_text_color'])}`}>
|
230
|
+
{TABLE_HEADER[key]['descr']}
|
231
|
+
</Typography>)}
|
232
|
+
|
233
|
+
{TABLE_HEADER[key]['button_title'] &&
|
234
|
+
(
|
235
|
+
<a href={TABLE_HEADER[key]['button_link']}>
|
236
|
+
<HDSButton
|
237
|
+
label={TABLE_HEADER[key]['button_title']}
|
238
|
+
type='secondary'
|
239
|
+
leftIconVariant='none'
|
240
|
+
rightIconVariant='none'
|
241
|
+
state='default'
|
242
|
+
size='sm'
|
243
|
+
rightAnimatedArrow={true}
|
244
|
+
rightAnimatedArrowColor='#3970FD'
|
245
|
+
className='mt-4'
|
246
|
+
/>
|
247
|
+
</a>
|
248
|
+
|
249
|
+
)
|
250
|
+
|
251
|
+
}
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
</th>
|
256
|
+
))}
|
257
|
+
</tr>
|
258
|
+
</thead>
|
259
|
+
{TABLE_VALUE.map((section, index) => (
|
260
|
+
<tbody key={index} className="border-90">
|
261
|
+
{Object.keys(section).map((keyIndex) => (
|
262
|
+
<>
|
263
|
+
<tr key={index + keyIndex} className=''>
|
264
|
+
{Object.keys(section[keyIndex][0]).map((keyIndex2) => (
|
265
|
+
<React.Fragment key={keyIndex2 + keyIndex + index}>
|
266
|
+
{keyIndex2 !== null && (
|
267
|
+
<th
|
268
|
+
className='bg-neutral-100 first:rounded-l-full last:rounded-r-full px-8'
|
269
|
+
>
|
270
|
+
<Typography
|
271
|
+
textStyle='h5'
|
272
|
+
className='text-neutral-900 py-3.5 text-left'
|
273
|
+
>
|
274
|
+
{keyIndex2}
|
275
|
+
</Typography>
|
276
|
+
</th>
|
277
|
+
)}
|
278
|
+
</React.Fragment>
|
279
|
+
))}
|
280
|
+
</tr>
|
281
|
+
{tableValuesm(section, keyIndex)}
|
282
|
+
</>
|
283
|
+
))
|
284
|
+
}
|
285
|
+
</tbody>
|
286
|
+
))
|
287
|
+
}
|
288
|
+
{TABLE_HEADER && (
|
289
|
+
<>
|
290
|
+
<tbody>
|
291
|
+
<tr>
|
292
|
+
<td></td>
|
293
|
+
{TABLE_HEADER.map((value, index) => (
|
294
|
+
<React.Fragment key={index}>
|
295
|
+
{index != 0 && value['button_title'] &&
|
296
|
+
<td key={index} className='px-8'>
|
297
|
+
<a href={value['button_link']}>
|
298
|
+
<HDSButton
|
299
|
+
label={value['button_title']}
|
300
|
+
type='secondary'
|
301
|
+
leftIconVariant='none'
|
302
|
+
rightIconVariant='none'
|
303
|
+
state='default'
|
304
|
+
size='sm'
|
305
|
+
rightAnimatedArrow={true}
|
306
|
+
rightAnimatedArrowColor='#3970FD'
|
307
|
+
className='mt-4 mb-16'
|
308
|
+
/>
|
309
|
+
</a>
|
310
|
+
|
311
|
+
</td>}
|
312
|
+
</React.Fragment>
|
313
|
+
))
|
314
|
+
}
|
315
|
+
|
316
|
+
</tr>
|
317
|
+
</tbody>
|
318
|
+
</>
|
319
|
+
)}
|
320
|
+
</table>
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
</div>
|
324
|
+
)
|
325
|
+
}
|
326
|
+
|
@@ -1,11 +1,22 @@
|
|
1
1
|
import React, { useState, useRef } from 'react';
|
2
|
+
import { HDSColor } from '../../foundation/ColorPalette';
|
2
3
|
import { Typography } from '../../foundation/Typography'
|
4
|
+
import PropTypes from 'prop-types';
|
3
5
|
|
4
6
|
export default function Tab(props) {
|
5
|
-
const {
|
7
|
+
const {
|
8
|
+
tabs,
|
9
|
+
onTabClick,
|
10
|
+
pillColor,
|
11
|
+
} = props;
|
6
12
|
const [activeTab, setActiveTab] = useState(tabs.find(tab => tab.current) || tabs[0]);
|
7
13
|
const pillRef = useRef(null);
|
8
|
-
|
14
|
+
let pillColorClass = '';
|
15
|
+
if(pillColor){
|
16
|
+
pillColorClass = HDSColor(pillColor);
|
17
|
+
}
|
18
|
+
|
19
|
+
|
9
20
|
const handleTabClick = (event, clickedTab) => {
|
10
21
|
event.preventDefault();
|
11
22
|
setActiveTab(clickedTab);
|
@@ -19,35 +30,51 @@ export default function Tab(props) {
|
|
19
30
|
const pillWidth = event.currentTarget.offsetWidth;
|
20
31
|
const clickedTabOffset = event.currentTarget.offsetLeft;
|
21
32
|
const pillOffset = pill.parentElement.offsetLeft;
|
22
|
-
const translateX = clickedTabOffset
|
33
|
+
const translateX = clickedTabOffset;
|
23
34
|
|
24
35
|
pill.style.transform = `translateX(${translateX}px)`;
|
25
36
|
pill.style.width = `${pillWidth}px`;
|
26
37
|
}
|
27
38
|
};
|
39
|
+
let tabTextClass = '';
|
40
|
+
|
41
|
+
function tabClass(name) {
|
42
|
+
|
43
|
+
// console.log(currentTab['tabTextColorClass']);
|
44
|
+
|
45
|
+
if(activeTab['tabTextColorClass']){
|
46
|
+
tabTextClass = HDSColor(activeTab['tabTextColorClass']);
|
47
|
+
}
|
48
|
+
else tabTextClass = 'text-neutral-500'
|
28
49
|
|
50
|
+
let classActive = ' text-neutral-0 transition-all rounded-full ' + pillColorClass;
|
51
|
+
let clasnInActive = ' flex-nowrap rounded-full ' + tabTextClass;
|
52
|
+
if (activeTab.name === name) {
|
53
|
+
return classActive;
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
return clasnInActive;
|
57
|
+
}
|
58
|
+
}
|
29
59
|
return (
|
30
|
-
<div>
|
60
|
+
<div className=''>
|
31
61
|
<div className="block">
|
32
|
-
<nav className="relative inline-flex gap-2
|
62
|
+
<nav className="relative inline-flex gap-2 rounded-full" aria-label="Tabs">
|
33
63
|
{tabs.map(tab => (
|
34
|
-
<
|
64
|
+
<div
|
35
65
|
key={tab.name}
|
36
|
-
href="#"
|
37
|
-
className={`px-3 py-1 font-medium text-sm rounded-full ${
|
38
|
-
activeTab === tab
|
39
|
-
? ' first:bg-blue-500 text-neutral-0 transition-all delay-100 duration-100 '
|
40
|
-
: 'text-neutral-500 transition-all delay-200 flex-nowrap '
|
41
|
-
}`}
|
42
|
-
aria-current={activeTab === tab ? 'page' : undefined}
|
43
66
|
onClick={(event) => handleTabClick(event, tab)}
|
44
67
|
>
|
45
|
-
<Typography
|
46
|
-
|
68
|
+
<Typography
|
69
|
+
className={`${tabClass(tab.name)} cursor-pointer px-3 py-1 z-[2] relative whitespace-nowrap`}
|
70
|
+
textStyle='body3c-medium'>
|
71
|
+
{tab.name}
|
72
|
+
</Typography>
|
73
|
+
</div>
|
47
74
|
))}
|
48
75
|
<span
|
49
76
|
ref={pillRef}
|
50
|
-
className=
|
77
|
+
className={`absolute left-0 z-[1] ${pillColorClass} rounded-full transition-all ease-in duration-150`}
|
51
78
|
style={{
|
52
79
|
left: `${activeTab.index * 100}%`,
|
53
80
|
width: `${activeTab.width}px`, // Use the width of the clicked tab
|
@@ -59,3 +86,7 @@ export default function Tab(props) {
|
|
59
86
|
</div>
|
60
87
|
);
|
61
88
|
}
|
89
|
+
|
90
|
+
Tab.defaultProps = {
|
91
|
+
pillColor: 'bg-blue-500',
|
92
|
+
}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import {HDSColor} from '../../../foundation/ColorPalette';
|
3
3
|
import PropTypes from 'prop-types';
|
4
|
+
import {ReactComponent as Hasura1Icon } from "../../../assets/icons/hasura-1.svg"
|
5
|
+
import {ReactComponent as Hasura2Icon } from "../../../assets/icons/hasura-2.svg"
|
6
|
+
import {ReactComponent as Hasura3Icon } from "../../../assets/icons/hasura-3.svg"
|
4
7
|
import {ReactComponent as HasuraPrimaryIcon } from "../../../assets/icons/HasuraPrimary.svg"
|
5
8
|
import {ReactComponent as ClockrewindIcon } from "../../../assets/icons/clock-rewind.svg"
|
6
9
|
import {ReactComponent as PassportIcon } from "../../../assets/icons/passport.svg"
|
@@ -1177,6 +1180,9 @@ import {ReactComponent as Minus01Icon } from "../../../assets/icons/minus-01.svg
|
|
1177
1180
|
import {ReactComponent as HasuraIcon } from "../../../assets/icons/hasura.svg"
|
1178
1181
|
|
1179
1182
|
const iconReferenceMap = {
|
1183
|
+
hasura1: Hasura1Icon,
|
1184
|
+
hasura2: Hasura2Icon,
|
1185
|
+
hasura3: Hasura3Icon,
|
1180
1186
|
hasuraPrimary: HasuraPrimaryIcon,
|
1181
1187
|
hasura: HasuraIcon,
|
1182
1188
|
minus01: Minus01Icon,
|