hds-web 1.1.1 → 1.1.3
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/dist/index.css +2 -2
- package/dist/index.es.css +2 -2
- package/dist/index.es.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/HDS/components/Tables/tableB.js +30 -35
- package/src/HDS/components/Tabs/tab.js +4 -4
- package/src/HDS/modules/TextCard/textCard.js +1 -0
- package/src/index.css +0 -1
- package/src/styles/tailwind.css +38 -82
- package/src/HDS/components/Tabs/import React, { useState, useRef } from .js +0 -61
@@ -7,9 +7,9 @@ import { Tab } from '../Tabs'
|
|
7
7
|
import ReactMarkdown from "react-markdown";
|
8
8
|
|
9
9
|
const tabs = [
|
10
|
-
{ name: 'Level 1', href: '', current:
|
10
|
+
{ name: 'Level 1', href: '', current: true },
|
11
11
|
{ name: 'Level 2', href: '', current: false },
|
12
|
-
{ name: 'Level 3', href: '', current:
|
12
|
+
{ name: 'Level 3', href: '', current: false },
|
13
13
|
]
|
14
14
|
|
15
15
|
|
@@ -17,12 +17,11 @@ const tabs = [
|
|
17
17
|
const levelCalc = (arr, index) => {
|
18
18
|
|
19
19
|
const keyIndex = 'key' + `${index}`;
|
20
|
-
console.log(keyIndex);
|
21
20
|
if (arr[keyIndex] && arr[keyIndex]['text'] && arr[keyIndex]['text'] !== null) {
|
22
21
|
return (
|
23
22
|
<>
|
24
|
-
|
25
|
-
|
23
|
+
<Typography as='div' textStyle='bodyc' className='text-neutral-700 flex items-start gap-4'> {`${arr[keyIndex]['text']}`}</Typography>
|
24
|
+
|
26
25
|
|
27
26
|
</>
|
28
27
|
)
|
@@ -35,9 +34,6 @@ const levelCalc = (arr, index) => {
|
|
35
34
|
</>
|
36
35
|
)
|
37
36
|
}
|
38
|
-
else return(
|
39
|
-
<></>
|
40
|
-
) ;
|
41
37
|
}
|
42
38
|
|
43
39
|
export default function TableB(props) {
|
@@ -49,20 +45,18 @@ export default function TableB(props) {
|
|
49
45
|
TABLE_VALUE,
|
50
46
|
TABLE_HEADER,
|
51
47
|
} = props;
|
52
|
-
const [activeTab, setActiveTab] = useState(
|
48
|
+
const [activeTab, setActiveTab] = useState(1);
|
53
49
|
|
54
50
|
function handleTabClick(tab) {
|
55
51
|
if(tab.name === 'Level 1') setActiveTab(1);
|
56
52
|
if(tab.name === 'Level 2') setActiveTab(2);
|
57
53
|
if(tab.name === 'Level 3') setActiveTab(3);
|
58
|
-
|
59
|
-
console.log(`Tab "${tab.name}" updatedTabs`);
|
60
54
|
// Perform any other actions based on the clicked tab
|
61
55
|
}
|
62
56
|
|
63
57
|
return (
|
64
58
|
<div className=" max-w-7xl px-4 sm:px-6 lg:px-8 ">
|
65
|
-
<div className="
|
59
|
+
<div className=" flex justify-around ">
|
66
60
|
<div className="w-full flex-col items-center flex justify-around tb-l:flex tb-l:flex-col tb-l:items-center">
|
67
61
|
<div>
|
68
62
|
{title && (
|
@@ -93,7 +87,7 @@ export default function TableB(props) {
|
|
93
87
|
|
94
88
|
<div className='tb-l:hidden'>
|
95
89
|
<div className="mt-8 bg-neutral-0 rounded-3xl ">
|
96
|
-
<div className=" shadow rounded-3xl ">
|
90
|
+
<div className=" shadow rounded-3xl transition-opacity duration-200 ">
|
97
91
|
|
98
92
|
<div className='flex border-x px-8 py-[1.625rem] border-neutral-200 rounded-t-3xl flex-col justify-center items-center text-center'>
|
99
93
|
<div className={'flex items-center gap-2'}>
|
@@ -110,7 +104,7 @@ export default function TableB(props) {
|
|
110
104
|
<Typography
|
111
105
|
textStyle='h5'
|
112
106
|
className={TABLE_HEADER[activeTab]['title_text_color']}>
|
113
|
-
{TABLE_HEADER[activeTab]['title']}
|
107
|
+
{`${TABLE_HEADER[activeTab]['title']}`}
|
114
108
|
</Typography>)
|
115
109
|
}
|
116
110
|
{
|
@@ -118,7 +112,7 @@ export default function TableB(props) {
|
|
118
112
|
<Typography
|
119
113
|
textStyle='h5'
|
120
114
|
className={TABLE_HEADER[activeTab]['title_text_color']}>
|
121
|
-
{TABLE_HEADER[activeTab]['title']}
|
115
|
+
{`${TABLE_HEADER[activeTab]['title']}`}
|
122
116
|
</Typography>)
|
123
117
|
}
|
124
118
|
|
@@ -129,20 +123,19 @@ export default function TableB(props) {
|
|
129
123
|
<Typography
|
130
124
|
textStyle='body1'
|
131
125
|
className={TABLE_HEADER[activeTab]['descr_text_color']}>
|
132
|
-
{TABLE_HEADER[activeTab]['descr']}
|
126
|
+
{`${TABLE_HEADER[activeTab]['descr']}`}
|
133
127
|
</Typography>)}
|
134
128
|
</div>
|
135
129
|
</div>
|
136
|
-
|
137
|
-
|
130
|
+
|
138
131
|
<div className="divide-y divide-neutral-200 rounded-b-3xl">
|
139
132
|
<div className='flex flex-col border border-neutral-200 divide-y divide-neutral-200 rounded-b-3xl items-center'>
|
140
133
|
{TABLE_VALUE.map((key, index) => (
|
141
134
|
<React.Fragment key={index}>
|
142
|
-
<div className='flex w-full p-4 gap-
|
143
|
-
|
144
|
-
{levelCalc(key, activeTab)}
|
145
|
-
|
135
|
+
<div className='flex w-full p-4 gap-2 items-start'>
|
136
|
+
|
137
|
+
{levelCalc(key, activeTab)}{key['rowTitle']}
|
138
|
+
|
146
139
|
</div>
|
147
140
|
</React.Fragment>
|
148
141
|
))}
|
@@ -156,13 +149,13 @@ export default function TableB(props) {
|
|
156
149
|
{/* code for mobile */}
|
157
150
|
|
158
151
|
<div className='hidden tb-l:block' >
|
159
|
-
<div className="
|
160
|
-
<table className="min-w-full
|
152
|
+
<div className="mt-12 bg-neutral-0 rounded-3xl ">
|
153
|
+
<table className="min-w-full shadow tableclss rounded-3xl ">
|
161
154
|
<thead>
|
162
155
|
<tr className='divide-x divide-neutral-200 text-center rounded-t-3xl'>
|
163
|
-
{Object.keys(TABLE_HEADER).map((key,
|
156
|
+
{Object.keys(TABLE_HEADER).map((key, index) => (
|
164
157
|
<th
|
165
|
-
key={
|
158
|
+
key={index}
|
166
159
|
scope="col"
|
167
160
|
className="px-8 py-6 sm:table-cell"
|
168
161
|
>
|
@@ -208,27 +201,27 @@ export default function TableB(props) {
|
|
208
201
|
))}
|
209
202
|
</tr>
|
210
203
|
</thead>
|
211
|
-
<tbody className="divide-y divide-neutral-200
|
204
|
+
<tbody className="divide-y divide-neutral-200">
|
212
205
|
{TABLE_VALUE.map((value, index) => (
|
213
206
|
<tr className='divide-x divide-neutral-200' key={index}>
|
214
207
|
{Object.keys(value).map((keyIndex) => (
|
215
208
|
|
216
|
-
<React.Fragment key={index}>
|
209
|
+
<React.Fragment key={index+keyIndex}>
|
217
210
|
{keyIndex !== null && keyIndex === 'rowTitle' && (<td
|
218
|
-
|
211
|
+
|
219
212
|
className="px-8 py-7 w-[22.5rem]"
|
220
213
|
>
|
221
214
|
<Typography className='max-w-[22rem] text-neutral-700' textStyle='body1c'><ReactMarkdown>{value[keyIndex]}</ReactMarkdown></Typography>
|
222
215
|
|
223
216
|
</td>)}
|
224
|
-
|
217
|
+
|
225
218
|
{keyIndex !== null && keyIndex !== 'rowTitle' && value[keyIndex] !== null && (
|
226
219
|
<td
|
227
|
-
|
228
|
-
className="px-8 py-7 text-center"
|
220
|
+
|
221
|
+
className="px-8 py-7 border-table text-center "
|
229
222
|
>
|
230
223
|
{value && keyIndex && value[keyIndex] && value[keyIndex]['text'] === null && !value[keyIndex]['iconVariant'] && value[keyIndex]['iconVariant'] === null && (
|
231
|
-
|
224
|
+
<></>
|
232
225
|
|
233
226
|
)}
|
234
227
|
{value[keyIndex]['text'] !== null && value[keyIndex]['text'] && (
|
@@ -240,11 +233,13 @@ export default function TableB(props) {
|
|
240
233
|
<Icon height='h-5 w-5 stroke-[1.5px]' variant={value[keyIndex]['iconVariant']} strokeClass={HDSColor(value[keyIndex]['iconStrokeClass'])} />
|
241
234
|
</div>
|
242
235
|
)}
|
243
|
-
</td>)
|
236
|
+
</td>)
|
237
|
+
}
|
238
|
+
|
244
239
|
{keyIndex === null && (
|
245
240
|
<td
|
246
241
|
key={index}
|
247
|
-
className="px-8 py-7 text-center"
|
242
|
+
className="px-8 py-7 border-table text-center"
|
248
243
|
>
|
249
244
|
</td>
|
250
245
|
)}
|
@@ -36,18 +36,18 @@ export default function Tab(props) {
|
|
36
36
|
href="#"
|
37
37
|
className={`px-3 py-1 font-medium text-sm rounded-full ${
|
38
38
|
activeTab === tab
|
39
|
-
? 'bg-blue-500
|
40
|
-
: 'text-neutral-500
|
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
41
|
}`}
|
42
42
|
aria-current={activeTab === tab ? 'page' : undefined}
|
43
43
|
onClick={(event) => handleTabClick(event, tab)}
|
44
44
|
>
|
45
|
-
<Typography className='z-
|
45
|
+
<Typography className='z-[2] relative whitespace-nowrap' textStyle='body3c-medium'>{tab.name}</Typography>
|
46
46
|
</a>
|
47
47
|
))}
|
48
48
|
<span
|
49
49
|
ref={pillRef}
|
50
|
-
className="absolute left-0
|
50
|
+
className="absolute left-0 z-[1] bg-blue-500 rounded-full transition-all ease-in-out duration-700"
|
51
51
|
style={{
|
52
52
|
left: `${activeTab.index * 100}%`,
|
53
53
|
width: `${activeTab.width}px`, // Use the width of the clicked tab
|
package/src/index.css
CHANGED
package/src/styles/tailwind.css
CHANGED
@@ -923,10 +923,6 @@ select {
|
|
923
923
|
z-index: -10;
|
924
924
|
}
|
925
925
|
|
926
|
-
.z-0 {
|
927
|
-
z-index: 0;
|
928
|
-
}
|
929
|
-
|
930
926
|
.z-10 {
|
931
927
|
z-index: 10;
|
932
928
|
}
|
@@ -1113,10 +1109,6 @@ select {
|
|
1113
1109
|
margin-top: -1.5rem;
|
1114
1110
|
}
|
1115
1111
|
|
1116
|
-
.-mt-px {
|
1117
|
-
margin-top: -1px;
|
1118
|
-
}
|
1119
|
-
|
1120
1112
|
.mb-1 {
|
1121
1113
|
margin-bottom: 0.25rem;
|
1122
1114
|
}
|
@@ -1201,6 +1193,14 @@ select {
|
|
1201
1193
|
margin-top: 2.5rem;
|
1202
1194
|
}
|
1203
1195
|
|
1196
|
+
.mt-11 {
|
1197
|
+
margin-top: 2.75rem;
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
.mt-12 {
|
1201
|
+
margin-top: 3rem;
|
1202
|
+
}
|
1203
|
+
|
1204
1204
|
.mt-16 {
|
1205
1205
|
margin-top: 4rem;
|
1206
1206
|
}
|
@@ -1237,10 +1237,6 @@ select {
|
|
1237
1237
|
margin-top: 2.25rem;
|
1238
1238
|
}
|
1239
1239
|
|
1240
|
-
.mt-11 {
|
1241
|
-
margin-top: 2.75rem;
|
1242
|
-
}
|
1243
|
-
|
1244
1240
|
.block {
|
1245
1241
|
display: block;
|
1246
1242
|
}
|
@@ -1680,42 +1676,6 @@ select {
|
|
1680
1676
|
animation: bounce 1s infinite;
|
1681
1677
|
}
|
1682
1678
|
|
1683
|
-
@-webkit-keyframes pulse {
|
1684
|
-
50% {
|
1685
|
-
opacity: .5;
|
1686
|
-
}
|
1687
|
-
}
|
1688
|
-
|
1689
|
-
@keyframes pulse {
|
1690
|
-
50% {
|
1691
|
-
opacity: .5;
|
1692
|
-
}
|
1693
|
-
}
|
1694
|
-
|
1695
|
-
.animate-pulse {
|
1696
|
-
-webkit-animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
1697
|
-
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
1698
|
-
}
|
1699
|
-
|
1700
|
-
@-webkit-keyframes spin {
|
1701
|
-
to {
|
1702
|
-
-webkit-transform: rotate(360deg);
|
1703
|
-
transform: rotate(360deg);
|
1704
|
-
}
|
1705
|
-
}
|
1706
|
-
|
1707
|
-
@keyframes spin {
|
1708
|
-
to {
|
1709
|
-
-webkit-transform: rotate(360deg);
|
1710
|
-
transform: rotate(360deg);
|
1711
|
-
}
|
1712
|
-
}
|
1713
|
-
|
1714
|
-
.animate-spin {
|
1715
|
-
-webkit-animation: spin 1s linear infinite;
|
1716
|
-
animation: spin 1s linear infinite;
|
1717
|
-
}
|
1718
|
-
|
1719
1679
|
.cursor-pointer {
|
1720
1680
|
cursor: pointer;
|
1721
1681
|
}
|
@@ -1982,18 +1942,6 @@ select {
|
|
1982
1942
|
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
1983
1943
|
}
|
1984
1944
|
|
1985
|
-
.divide-x-2 > :not([hidden]) ~ :not([hidden]) {
|
1986
|
-
--tw-divide-x-reverse: 0;
|
1987
|
-
border-right-width: calc(2px * var(--tw-divide-x-reverse));
|
1988
|
-
border-left-width: calc(2px * calc(1 - var(--tw-divide-x-reverse)));
|
1989
|
-
}
|
1990
|
-
|
1991
|
-
.divide-y-2 > :not([hidden]) ~ :not([hidden]) {
|
1992
|
-
--tw-divide-y-reverse: 0;
|
1993
|
-
border-top-width: calc(2px * calc(1 - var(--tw-divide-y-reverse)));
|
1994
|
-
border-bottom-width: calc(2px * var(--tw-divide-y-reverse));
|
1995
|
-
}
|
1996
|
-
|
1997
1945
|
.divide-blue-600\/10 > :not([hidden]) ~ :not([hidden]) {
|
1998
1946
|
border-color: rgb(30 86 227 / 0.1);
|
1999
1947
|
}
|
@@ -5281,16 +5229,6 @@ select {
|
|
5281
5229
|
padding-bottom: 1.75rem;
|
5282
5230
|
}
|
5283
5231
|
|
5284
|
-
.py-\[26px\] {
|
5285
|
-
padding-top: 26px;
|
5286
|
-
padding-bottom: 26px;
|
5287
|
-
}
|
5288
|
-
|
5289
|
-
.py-\[1\.625\] {
|
5290
|
-
padding-top: 1.625;
|
5291
|
-
padding-bottom: 1.625;
|
5292
|
-
}
|
5293
|
-
|
5294
5232
|
.py-\[1\.625rem\] {
|
5295
5233
|
padding-top: 1.625rem;
|
5296
5234
|
padding-bottom: 1.625rem;
|
@@ -5428,10 +5366,6 @@ select {
|
|
5428
5366
|
padding-top: 1.5rem;
|
5429
5367
|
}
|
5430
5368
|
|
5431
|
-
.pt-11 {
|
5432
|
-
padding-top: 2.75rem;
|
5433
|
-
}
|
5434
|
-
|
5435
5369
|
.text-left {
|
5436
5370
|
text-align: left;
|
5437
5371
|
}
|
@@ -6405,6 +6339,14 @@ select {
|
|
6405
6339
|
transition-duration: 150ms;
|
6406
6340
|
}
|
6407
6341
|
|
6342
|
+
.delay-100 {
|
6343
|
+
transition-delay: 100ms;
|
6344
|
+
}
|
6345
|
+
|
6346
|
+
.delay-200 {
|
6347
|
+
transition-delay: 200ms;
|
6348
|
+
}
|
6349
|
+
|
6408
6350
|
.delay-300 {
|
6409
6351
|
transition-delay: 300ms;
|
6410
6352
|
}
|
@@ -6429,6 +6371,10 @@ select {
|
|
6429
6371
|
transition-duration: 500ms;
|
6430
6372
|
}
|
6431
6373
|
|
6374
|
+
.duration-700 {
|
6375
|
+
transition-duration: 700ms;
|
6376
|
+
}
|
6377
|
+
|
6432
6378
|
.ease-in {
|
6433
6379
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
6434
6380
|
}
|
@@ -6441,10 +6387,6 @@ select {
|
|
6441
6387
|
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
6442
6388
|
}
|
6443
6389
|
|
6444
|
-
.ease-linear {
|
6445
|
-
transition-timing-function: linear;
|
6446
|
-
}
|
6447
|
-
|
6448
6390
|
/* Typography classes */
|
6449
6391
|
|
6450
6392
|
@-webkit-keyframes pill-move-left {
|
@@ -7375,6 +7317,11 @@ select {
|
|
7375
7317
|
margin-left: 0px;
|
7376
7318
|
}
|
7377
7319
|
|
7320
|
+
.first\:bg-blue-500:first-child {
|
7321
|
+
--tw-bg-opacity: 1;
|
7322
|
+
background-color: rgb(57 112 253 / var(--tw-bg-opacity));
|
7323
|
+
}
|
7324
|
+
|
7378
7325
|
.last\:mr-0:last-child {
|
7379
7326
|
margin-right: 0px;
|
7380
7327
|
}
|
@@ -7471,6 +7418,12 @@ select {
|
|
7471
7418
|
animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
|
7472
7419
|
}
|
7473
7420
|
|
7421
|
+
@-webkit-keyframes pulse {
|
7422
|
+
50% {
|
7423
|
+
opacity: .5;
|
7424
|
+
}
|
7425
|
+
}
|
7426
|
+
|
7474
7427
|
@keyframes pulse {
|
7475
7428
|
50% {
|
7476
7429
|
opacity: .5;
|
@@ -7482,6 +7435,13 @@ select {
|
|
7482
7435
|
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
7483
7436
|
}
|
7484
7437
|
|
7438
|
+
@-webkit-keyframes spin {
|
7439
|
+
to {
|
7440
|
+
-webkit-transform: rotate(360deg);
|
7441
|
+
transform: rotate(360deg);
|
7442
|
+
}
|
7443
|
+
}
|
7444
|
+
|
7485
7445
|
@keyframes spin {
|
7486
7446
|
to {
|
7487
7447
|
-webkit-transform: rotate(360deg);
|
@@ -8534,10 +8494,6 @@ select {
|
|
8534
8494
|
margin-left: 3rem;
|
8535
8495
|
}
|
8536
8496
|
|
8537
|
-
.md\:block {
|
8538
|
-
display: block;
|
8539
|
-
}
|
8540
|
-
|
8541
8497
|
.md\:flex {
|
8542
8498
|
display: flex;
|
8543
8499
|
}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import React, { useState, useRef, useEffect } from 'react';
|
2
|
-
|
3
|
-
export default function Tab(props) {
|
4
|
-
const { tabs, onTabClick } = props;
|
5
|
-
const [activeTab, setActiveTab] = useState(tabs.find(tab => tab.current) || tabs[0]);
|
6
|
-
const pillRef = useRef(null);
|
7
|
-
const activeTabRef = useRef(null);
|
8
|
-
|
9
|
-
const handleTabClick = (event, clickedTab) => {
|
10
|
-
event.preventDefault();
|
11
|
-
setActiveTab(clickedTab);
|
12
|
-
if (onTabClick) {
|
13
|
-
onTabClick(clickedTab);
|
14
|
-
}
|
15
|
-
};
|
16
|
-
|
17
|
-
useEffect(() => {
|
18
|
-
// Update the pill position and height when activeTab changes
|
19
|
-
const pill = pillRef.current;
|
20
|
-
const activeTabElement = activeTabRef.current;
|
21
|
-
|
22
|
-
if (pill && activeTabElement) {
|
23
|
-
const pillWidth = activeTabElement.offsetWidth;
|
24
|
-
const pillHeight = activeTabElement.offsetHeight;
|
25
|
-
const pillOffset = activeTabElement.offsetLeft;
|
26
|
-
|
27
|
-
pill.style.transform = `translateX(${pillOffset}px)`;
|
28
|
-
pill.style.width = `${pillWidth}px`;
|
29
|
-
pill.style.height = `${pillHeight}px`;
|
30
|
-
}
|
31
|
-
}, [activeTab]);
|
32
|
-
|
33
|
-
return (
|
34
|
-
<div>
|
35
|
-
<div className="hidden md:block">
|
36
|
-
<nav className="relative inline-flex bg-neutral-0 p-2 rounded-full" aria-label="Tabs">
|
37
|
-
{tabs.map((tab, index) => (
|
38
|
-
<a
|
39
|
-
key={tab.name}
|
40
|
-
href="#"
|
41
|
-
className={`relative px-3 py-1 font-medium text-sm rounded-full ${
|
42
|
-
activeTab === tab
|
43
|
-
? 'bg-blue-600 text-neutral-0 z-10' // Increase z-index for active tab
|
44
|
-
: 'text-neutral-500 bg-neutral-0 hover:bg-neutral-100 flex-nowrap transition-all duration-500'
|
45
|
-
}`}
|
46
|
-
aria-current={activeTab === tab ? 'page' : undefined}
|
47
|
-
onClick={(event) => handleTabClick(event, tab)}
|
48
|
-
ref={activeTab === tab ? activeTabRef : null}
|
49
|
-
>
|
50
|
-
{tab.name}
|
51
|
-
</a>
|
52
|
-
))}
|
53
|
-
<span
|
54
|
-
ref={pillRef}
|
55
|
-
className="absolute bg-blue-600 rounded-full transition-all duration-500 z-0 -mt-px" // Add negative margin to counteract the gap
|
56
|
-
/>
|
57
|
-
</nav>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
);
|
61
|
-
}
|