hds-web 1.13.5 → 1.13.6
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 +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/HDS/components/Tables/tableD.js +31 -76
- package/src/index.css +9 -0
- package/src/styles/tailwind.css +16 -16
package/package.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, {useState, useRef, useEffect} from 'react';
|
2
2
|
import { Typography } from '../../foundation/Typography'
|
3
3
|
import { Icon } from '../common-components/Icon'
|
4
4
|
import { HDSColor } from '../../foundation/ColorPalette';
|
@@ -14,7 +14,26 @@ export default function PricingTableB(props) {
|
|
14
14
|
TABLE_VALUE,
|
15
15
|
TABLE_HEADER,
|
16
16
|
} = props;
|
17
|
+
|
18
|
+
const [isSticky, setIsSticky] = useState(false);
|
19
|
+
useEffect(() => {
|
20
|
+
const handleScroll = () => {
|
21
|
+
const tableHeader = stickyRef.current;
|
22
|
+
const tableHeaderRect = tableHeader.getBoundingClientRect();
|
23
|
+
const isSticky = tableHeaderRect.top <= 10; // Adjust this value if needed
|
24
|
+
|
25
|
+
setIsSticky(true);
|
26
|
+
};
|
27
|
+
|
28
|
+
window.addEventListener('scroll', handleScroll);
|
29
|
+
return () => {
|
30
|
+
window.removeEventListener('scroll', handleScroll);
|
31
|
+
};
|
32
|
+
}, []);
|
33
|
+
|
17
34
|
console.log(TABLE_VALUE)
|
35
|
+
|
36
|
+
const stickyRef = useRef(null);
|
18
37
|
const tableValuesm = (section, keyIndex) => {
|
19
38
|
|
20
39
|
let columnSize = '';
|
@@ -42,7 +61,7 @@ export default function PricingTableB(props) {
|
|
42
61
|
className="pl-[30px] border-80 "
|
43
62
|
>
|
44
63
|
<div className=' '>
|
45
|
-
<Typography className='py-4 text-neutral-700' textStyle='
|
64
|
+
<Typography className='py-4 text-neutral-700' textStyle='body1'>{value[keyIndex]}</Typography>
|
46
65
|
</div>
|
47
66
|
</td>)}
|
48
67
|
{keyIndex !== null
|
@@ -174,76 +193,7 @@ export default function PricingTableB(props) {
|
|
174
193
|
</Typography>
|
175
194
|
)}
|
176
195
|
<table className="rounded-3xl w-full table-fixed ">
|
177
|
-
|
178
|
-
<tr className=' text-left first:pr-20 '>
|
179
|
-
{Object.keys(TABLE_HEADER).map((key, index) => (
|
180
|
-
<th
|
181
|
-
key={index}
|
182
|
-
scope="col"
|
183
|
-
className="px-8 pb-[54px] sm:table-cell text-left"
|
184
|
-
>
|
185
|
-
<div className='flex text-left'>
|
186
|
-
<div className='flex flex-col text-center'>
|
187
|
-
<div className={'flex gap-2'}>
|
188
|
-
{TABLE_HEADER[key]['icon'] &&
|
189
|
-
(
|
190
|
-
<Icon
|
191
|
-
height='h-6 w-6 stroke-[1.5px]'
|
192
|
-
variant={TABLE_HEADER[key]['icon']}
|
193
|
-
strokeClass={HDSColor(TABLE_HEADER[key]['iconStrokeClass'])} />
|
194
|
-
)
|
195
|
-
}
|
196
|
-
{
|
197
|
-
TABLE_HEADER[key]['title'] && key == 0 && (
|
198
|
-
<Typography
|
199
|
-
textStyle='h3'
|
200
|
-
className={` w-1/2 text-left ${HDSColor(TABLE_HEADER[key]['title_text_color'])}`}>
|
201
|
-
{TABLE_HEADER[key]['title']}
|
202
|
-
</Typography>)
|
203
|
-
}
|
204
|
-
{
|
205
|
-
TABLE_HEADER[key]['title'] && key != 0 && (
|
206
|
-
<Typography
|
207
|
-
textStyle='h5'
|
208
|
-
className={` text-left ${HDSColor(TABLE_HEADER[key]['title_text_color'])}`}>
|
209
|
-
<ReactMarkdown>{TABLE_HEADER[key]['title']}</ReactMarkdown>
|
210
|
-
</Typography>)
|
211
|
-
}
|
212
|
-
</div>
|
213
|
-
<div className=''>
|
214
|
-
{TABLE_HEADER[key]['descr'] && (
|
215
|
-
<Typography
|
216
|
-
textStyle='body1'
|
217
|
-
className={` text-left ${HDSColor(TABLE_HEADER[key]['descr_text_color'])}`}>
|
218
|
-
{TABLE_HEADER[key]['descr']}
|
219
|
-
</Typography>)}
|
220
|
-
|
221
|
-
{TABLE_HEADER[key]['button_title'] &&
|
222
|
-
(
|
223
|
-
<a href={TABLE_HEADER[key]['button_link']}>
|
224
|
-
<HDSButton
|
225
|
-
label={TABLE_HEADER[key]['button_title']}
|
226
|
-
type='secondary'
|
227
|
-
leftIconVariant='none'
|
228
|
-
rightIconVariant='none'
|
229
|
-
state='default'
|
230
|
-
size='sm'
|
231
|
-
rightAnimatedArrow={true}
|
232
|
-
rightAnimatedArrowColor='#3970FD'
|
233
|
-
className='mt-4'
|
234
|
-
/>
|
235
|
-
</a>
|
236
|
-
|
237
|
-
)
|
238
|
-
|
239
|
-
}
|
240
|
-
</div>
|
241
|
-
</div>
|
242
|
-
</div>
|
243
|
-
</th>
|
244
|
-
))}
|
245
|
-
</tr>
|
246
|
-
</thead> */}
|
196
|
+
|
247
197
|
{TABLE_VALUE.map((section, index) => (
|
248
198
|
<tbody key={index} className="border-90 bg-neutral-0">
|
249
199
|
{Object.keys(section).map((keyIndex) => (
|
@@ -253,18 +203,22 @@ export default function PricingTableB(props) {
|
|
253
203
|
<React.Fragment key={keyIndex2 + keyIndex + index}>
|
254
204
|
{keyIndex2 !== null && (
|
255
205
|
<th
|
256
|
-
|
206
|
+
ref={stickyRef}
|
207
|
+
className={`first:rounded-l-full last:rounded-r-full px-8 ${isSticky ? ' sticky top-0 z-10 bg-neutral-100' : ''
|
208
|
+
}`}
|
257
209
|
>
|
258
210
|
<Typography
|
259
211
|
textStyle='h5'
|
260
|
-
className='text-neutral-900 py-3.5 text-left'
|
212
|
+
className='text-neutral-900 py-3.5 text-left whitespace-nowrap'
|
261
213
|
>
|
262
214
|
{keyIndex2}
|
215
|
+
|
263
216
|
|
264
217
|
</Typography>
|
265
|
-
|
218
|
+
{section[keyIndex][0][keyIndex2]['btn'] && section[keyIndex][0][keyIndex2]['btn_cta'] && <div className={`flex -mt-5`}>
|
219
|
+
<a href={section[keyIndex][0][keyIndex2]['btn_cta']}>
|
266
220
|
<HDSButton
|
267
|
-
label='
|
221
|
+
label={section[keyIndex][0][keyIndex2]['btn']}
|
268
222
|
type='secondaryLink'
|
269
223
|
leftIconVariant='none'
|
270
224
|
rightIconVariant='none'
|
@@ -277,6 +231,7 @@ export default function PricingTableB(props) {
|
|
277
231
|
btnTextHoverClass=''
|
278
232
|
className=' '
|
279
233
|
/>
|
234
|
+
</a>
|
280
235
|
</div>}
|
281
236
|
|
282
237
|
</th>
|
package/src/index.css
CHANGED
@@ -41,6 +41,15 @@
|
|
41
41
|
|
42
42
|
/*test*/
|
43
43
|
|
44
|
+
.myElement {
|
45
|
+
position: sticky;
|
46
|
+
top: 0px;
|
47
|
+
}
|
48
|
+
|
49
|
+
/* styles for when the header is in sticky mode */
|
50
|
+
.myElement.is-pinned {
|
51
|
+
color: red;
|
52
|
+
}
|
44
53
|
|
45
54
|
.carouselShadow{
|
46
55
|
filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)) drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
|
package/src/styles/tailwind.css
CHANGED
@@ -1217,6 +1217,10 @@ select{
|
|
1217
1217
|
margin-left: -1px;
|
1218
1218
|
}
|
1219
1219
|
|
1220
|
+
.-mt-2{
|
1221
|
+
margin-top: -0.5rem;
|
1222
|
+
}
|
1223
|
+
|
1220
1224
|
.-mt-4{
|
1221
1225
|
margin-top: -1rem;
|
1222
1226
|
}
|
@@ -1393,14 +1397,6 @@ select{
|
|
1393
1397
|
margin-top: 70px;
|
1394
1398
|
}
|
1395
1399
|
|
1396
|
-
.-mt-1{
|
1397
|
-
margin-top: -0.25rem;
|
1398
|
-
}
|
1399
|
-
|
1400
|
-
.-mt-2{
|
1401
|
-
margin-top: -0.5rem;
|
1402
|
-
}
|
1403
|
-
|
1404
1400
|
.line-clamp-3{
|
1405
1401
|
overflow: hidden;
|
1406
1402
|
display: -webkit-box;
|
@@ -6221,10 +6217,6 @@ select{
|
|
6221
6217
|
padding-bottom: 2rem;
|
6222
6218
|
}
|
6223
6219
|
|
6224
|
-
.pb-\[54px\]{
|
6225
|
-
padding-bottom: 54px;
|
6226
|
-
}
|
6227
|
-
|
6228
6220
|
.pb-\[56\.2\%\]{
|
6229
6221
|
padding-bottom: 56.2%;
|
6230
6222
|
}
|
@@ -7443,6 +7435,18 @@ select{
|
|
7443
7435
|
|
7444
7436
|
/*test*/
|
7445
7437
|
|
7438
|
+
.myElement {
|
7439
|
+
position: -webkit-sticky;
|
7440
|
+
position: sticky;
|
7441
|
+
top: 0px;
|
7442
|
+
}
|
7443
|
+
|
7444
|
+
/* styles for when the header is in sticky mode */
|
7445
|
+
|
7446
|
+
.myElement.is-pinned {
|
7447
|
+
color: red;
|
7448
|
+
}
|
7449
|
+
|
7446
7450
|
.carouselShadow{
|
7447
7451
|
-webkit-filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)) drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
|
7448
7452
|
filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)) drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
|
@@ -8677,10 +8681,6 @@ select{
|
|
8677
8681
|
border-bottom-left-radius: 9999px;
|
8678
8682
|
}
|
8679
8683
|
|
8680
|
-
.first\:pr-20:first-child{
|
8681
|
-
padding-right: 5rem;
|
8682
|
-
}
|
8683
|
-
|
8684
8684
|
.last\:mb-0:last-child{
|
8685
8685
|
margin-bottom: 0px;
|
8686
8686
|
}
|