hds-web 1.8.0 → 1.8.2
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 +3 -3
- package/dist/index.es.css +3 -3
- package/dist/index.es.js +6 -6
- package/dist/index.js +6 -6
- package/package.json +3 -1
- package/src/HDS/components/Buttons/button.js +4 -4
- package/src/HDS/components/Cards/Announcement/announcementSm.js +26 -0
- package/src/HDS/components/Cards/Announcement/index.js +1 -0
- package/src/HDS/components/Cards/CommunityCard/communityCard.js +14 -0
- package/src/HDS/components/Cards/CommunityCard/index.js +1 -0
- package/src/HDS/components/Cards/ImageBox/imagebox.js +6 -2
- package/src/HDS/components/Cards/ImageSlider/imageSlider.js +55 -0
- package/src/HDS/components/Cards/ImageSlider/index.js +1 -0
- package/src/HDS/components/Cards/Misc/imageCard.js +18 -0
- package/src/HDS/components/Cards/Misc/index.js +2 -1
- package/src/HDS/components/Cards/Testimonials/index.js +1 -0
- package/src/HDS/components/Cards/Testimonials/testimonial.js +120 -0
- package/src/HDS/components/Cards/index.js +4 -1
- package/src/HDS/components/Carousels/homepageCarousel.js +205 -0
- package/src/HDS/components/Carousels/index.js +2 -1
- package/src/HDS/components/Footers/index.js +1 -0
- package/src/HDS/components/Footers/v3Footer.js +120 -0
- package/src/HDS/components/index.js +2 -1
- package/src/HDS/modules/TextCard/index.js +2 -1
- package/src/HDS/modules/TextCard/textCard.js +2 -2
- package/src/HDS/modules/TextCard/textCard2.js +251 -0
- package/src/HDS/modules/TextCard/textIconCard.js +52 -0
- package/src/HDS/modules/navCard/navCard.js +1 -1
- package/src/index.css +4 -0
- package/src/styles/tailwind.css +365 -35
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hds-web",
|
3
|
-
"version": "1.8.
|
3
|
+
"version": "1.8.2",
|
4
4
|
"private": false,
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/index.es.js",
|
@@ -18,6 +18,8 @@
|
|
18
18
|
"react-dom": "^17.0.1",
|
19
19
|
"react-markdown": "^8.0.7",
|
20
20
|
"react-scripts": "5.0.1",
|
21
|
+
"react-slick": "^0.29.0",
|
22
|
+
"slick-carousel": "^1.8.1",
|
21
23
|
"uuid": "^9.0.0",
|
22
24
|
"web-vitals": "^2.1.4",
|
23
25
|
"yarn": "^1.22.19"
|
@@ -145,8 +145,8 @@ export default function Button(props) {
|
|
145
145
|
}
|
146
146
|
|
147
147
|
let sizeType = 'default';
|
148
|
-
if(type
|
149
|
-
if(type
|
148
|
+
if(type==='iconOnly'){sizeType='iconOnly'}
|
149
|
+
if(type==='secondaryLink' || type==='primaryLink' ){sizeType='links'}
|
150
150
|
|
151
151
|
|
152
152
|
const buttonClasses = [
|
@@ -217,12 +217,12 @@ Button.defaultProps = {
|
|
217
217
|
size: 'md',
|
218
218
|
type: 'primary',
|
219
219
|
leftIconVariant: 'none',
|
220
|
-
rightIconVariant: '
|
220
|
+
rightIconVariant: 'none',
|
221
221
|
rightIconColor: '#FFFFFF',
|
222
222
|
leftIconColor: '#FFFFFF',
|
223
223
|
state: 'default',
|
224
224
|
label: 'Button',
|
225
|
-
rightAnimatedArrow: '
|
225
|
+
rightAnimatedArrow: 'true' ,
|
226
226
|
rightAnimatedArrowColor: '#FFFFFF',
|
227
227
|
animatedHoverStroke: 'group-hover:stroke-neutral-0',
|
228
228
|
btnTextHoverClass: 'hover:text-neutral-0'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Typography } from "../../../foundation/Typography";
|
3
|
+
import { HDSColor } from "../../../foundation/ColorPalette";
|
4
|
+
import { Icon } from '../../../components/common-components/Icon';
|
5
|
+
|
6
|
+
export default function AnnouncementSM(props) {
|
7
|
+
const bgClass = props.bgColorClass ? HDSColor(props.bgColorClass) : 'bg-neutral-0';
|
8
|
+
const tagBgClass = props.tagBgColorClass ? HDSColor(props.tagBgColorClass) : 'bg-purple-500';
|
9
|
+
const tagTextClass = props.tagTextColorClass ? HDSColor(props.tagTextColorClass) : 'text-neutral-0';
|
10
|
+
const linkTextClass = props.linkTextColorClass ? HDSColor(props.linkTextColorClass) : 'text-neutral-600';
|
11
|
+
|
12
|
+
return (
|
13
|
+
<div className={`${bgClass} rounded-full shadow-md py-2 px-3 inline-flex items-center`}>
|
14
|
+
<div className={`${tagBgClass} hidden tb:block py-1 px-3 rounded-full mr-4`}>
|
15
|
+
<Typography textStyle="body2-medium" className={`${tagTextClass}`}>{props.tagText}</Typography>
|
16
|
+
</div>
|
17
|
+
<a href={props.linkUrl}>
|
18
|
+
<Typography textStyle="body2-medium" className={`${linkTextClass} group flex items-center`}>
|
19
|
+
{props.linkText}
|
20
|
+
<Icon height={'hidden tb:block w-6 h-6 stroke-[2px] ml-3 transition ease-in-out group-hover:translate-x-[5px]'} variant='arrownarrowright' strokeClass='stroke-blue-500' />
|
21
|
+
</Typography>
|
22
|
+
|
23
|
+
</a>
|
24
|
+
</div>
|
25
|
+
)
|
26
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {default as AnnouncementSM} from './announcementSm';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Typography } from '../../../foundation/Typography'
|
3
|
+
|
4
|
+
export default function CommunityCard(props) {
|
5
|
+
|
6
|
+
return (
|
7
|
+
<div className="p-5 tb:p-8 bg-neutral-0 shadow-sm rounded-3xl">
|
8
|
+
<Typography textStyle="h5" as="h5" className="text-neutral-1000">{props.name}</Typography>
|
9
|
+
<Typography textStyle="body1-medium" className="text-neutral-500 pb-4">{props.designation}</Typography>
|
10
|
+
<Typography textStyle="body1" className="text-neutral-500">{props.tweets}</Typography>
|
11
|
+
</div>
|
12
|
+
)
|
13
|
+
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {default as CommunityCard} from './communityCard';
|
@@ -8,6 +8,7 @@ export default function ImageBox(props) {
|
|
8
8
|
btnbutton,
|
9
9
|
title,
|
10
10
|
description,
|
11
|
+
subTitle,
|
11
12
|
className,
|
12
13
|
imgUrl,
|
13
14
|
imgAlt,
|
@@ -19,18 +20,21 @@ export default function ImageBox(props) {
|
|
19
20
|
<div className={className}>
|
20
21
|
{imgUrl &&
|
21
22
|
<div>
|
22
|
-
<img src={imgUrl} alt={imgAlt} className={imageClasses} />
|
23
|
+
<img src={imgUrl} alt={imgAlt} className={`${imageClasses} mb-4`} />
|
23
24
|
</div>}
|
24
25
|
{title && (
|
25
26
|
<Typography textStyle='h3' className={HDSColor(titleTextColor)}>{title}</Typography>
|
26
27
|
)
|
27
28
|
}
|
29
|
+
{subTitle && (
|
30
|
+
<Typography textStyle='sub2' className='text-neutral-600 pt-2 pb-6'>{subTitle}</Typography>
|
31
|
+
)}
|
28
32
|
{description && (
|
29
33
|
<Typography textStyle='body1'>{description}</Typography>
|
30
34
|
)
|
31
35
|
|
32
36
|
}
|
33
|
-
{btn.
|
37
|
+
{btn.cta_text && (
|
34
38
|
<a href={btn.cta_link}>
|
35
39
|
<HDSButton
|
36
40
|
label={btn.cta_text}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import Slider from "react-slick";
|
3
|
+
import { HDSColor } from '../../../foundation/ColorPalette';
|
4
|
+
import "slick-carousel/slick/slick.css";
|
5
|
+
import "slick-carousel/slick/slick-theme.css";
|
6
|
+
|
7
|
+
|
8
|
+
export default function ImageSlider(props) {
|
9
|
+
// console.log(props.brands);
|
10
|
+
const slideSettings = {
|
11
|
+
infinite: true,
|
12
|
+
slidesToShow: props.slidesToShow,
|
13
|
+
slidesToScroll: 1,
|
14
|
+
autoplay: true,
|
15
|
+
speed: props.speed,
|
16
|
+
autoplaySpeed: props.autoplaySpeed,
|
17
|
+
cssEase: "linear",
|
18
|
+
responsive: [
|
19
|
+
{
|
20
|
+
breakpoint: 1024,
|
21
|
+
settings: {
|
22
|
+
slidesToShow: 4,
|
23
|
+
slidesToScroll: 1,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
{
|
27
|
+
breakpoint: 767,
|
28
|
+
settings: {
|
29
|
+
slidesToShow: 3,
|
30
|
+
slidesToScroll: 1,
|
31
|
+
},
|
32
|
+
},
|
33
|
+
{
|
34
|
+
breakpoint: 500,
|
35
|
+
settings: {
|
36
|
+
slidesToShow: 2,
|
37
|
+
slidesToScroll: 1,
|
38
|
+
},
|
39
|
+
},
|
40
|
+
],
|
41
|
+
};
|
42
|
+
const gradientBgClass = HDSColor(props.gradientBgColor);
|
43
|
+
return (
|
44
|
+
<div>
|
45
|
+
<Slider {...slideSettings} className={`before:content-[''] before:w-[90px] before:h-full before:inline-block before:absolute before:top-0 before:left-0 before:z-[1] before:bg-gradient-to-r before:${gradientBgClass} before:to-transparent
|
46
|
+
after:content-[''] after:w-[90px] after:h-full after:inline-block after:absolute after:top-0 after:left-[unset] after:right-0 after:z-[1] after:bg-gradient-to-r after:${gradientBgClass} after:to-transparent after:rotate-180`}>
|
47
|
+
{props.brands.map((brand, index) => (
|
48
|
+
<div key={index} className="m-4">
|
49
|
+
<img src={brand.imgUrl} alt={brand.imgAlt} />
|
50
|
+
</div>
|
51
|
+
))}
|
52
|
+
</Slider>
|
53
|
+
</div>
|
54
|
+
)
|
55
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {default as ImageSlider} from './imageSlider';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Typography } from '../../../foundation/Typography'
|
3
|
+
|
4
|
+
export default function ImageCard(props) {
|
5
|
+
|
6
|
+
return (
|
7
|
+
<a href={props.linkUrl} className=" bg-neutral-0 rounded-3xl mb-s:flex items-center shadow-sm">
|
8
|
+
<div className="h-full w-full mb-s:max-w-[142px]">
|
9
|
+
<img className=" w-full rounded-t-3xl mb-s:rounded-tr-none mb-s:rounded-s-3xl h-full" src={props.imgUrl} alt={props.imgAlt} />
|
10
|
+
</div>
|
11
|
+
<div className="p-4 mb-m:p-6">
|
12
|
+
<Typography textStyle="h5" as="h5" className="text-neutral-1000 pb-2">{props.title}</Typography>
|
13
|
+
<Typography textStyle="body3" className=" text-neutral-600">{props.description}</Typography>
|
14
|
+
</div>
|
15
|
+
</a>
|
16
|
+
)
|
17
|
+
|
18
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as Testimonial } from './testimonial'
|
@@ -0,0 +1,120 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { Icon } from "../../common-components/Icon";
|
4
|
+
import { HDSColor } from '../../../foundation/ColorPalette'
|
5
|
+
import { Typography } from '../../../foundation/Typography'
|
6
|
+
import { HDSButton } from "../../Buttons";
|
7
|
+
|
8
|
+
|
9
|
+
export default function Testimonial(props) {
|
10
|
+
const {
|
11
|
+
card,
|
12
|
+
cardHover
|
13
|
+
} = props;
|
14
|
+
|
15
|
+
|
16
|
+
const [isHovered, setIsHovered] = useState(false);
|
17
|
+
|
18
|
+
const handleMouseEnter = () => {
|
19
|
+
setIsHovered(true);
|
20
|
+
};
|
21
|
+
|
22
|
+
const handleMouseLeave = () => {
|
23
|
+
setIsHovered(false);
|
24
|
+
};
|
25
|
+
const Card1 = () => {
|
26
|
+
return (
|
27
|
+
<>
|
28
|
+
<div className={`${HDSColor(card.cardBg)} max-w-[220px] flex flex-col `}>
|
29
|
+
<div className="mt-8">
|
30
|
+
<div className="max-w-[64px] pt-8 pl-6">
|
31
|
+
<img src="https://res.cloudinary.com/dh8fp23nd/image/upload/v1686737531/hasura-design-system/icons/optum_zn0bhw.png" alt="Card" className=" inline-block w-16 h-[18.52px]" />
|
32
|
+
</div>
|
33
|
+
<Typography textStyle='quote' className="mt-6 px-6">{card.subtitle}</Typography>
|
34
|
+
</div>
|
35
|
+
<div className="pl-6 pb-8">
|
36
|
+
<img
|
37
|
+
className={` w-14 h-14 shadow rounded-full ${HDSColor(card.avatar.avatarBgColor)} rounded inline-block`}
|
38
|
+
alt='avatar'
|
39
|
+
src={card.img_url}
|
40
|
+
/>
|
41
|
+
<div className=" pt-3">
|
42
|
+
<Typography textStyle='body2c-bold' className={` text-neutral-0`}>{card.avatar.name}</Typography>
|
43
|
+
<Typography textStyle='body3c' className={` text-neutral-0 mt-1`}>{card.avatar.designation}</Typography>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
</div>
|
48
|
+
</>
|
49
|
+
);
|
50
|
+
};
|
51
|
+
|
52
|
+
const Card2 = () => {
|
53
|
+
return (
|
54
|
+
<div className="">
|
55
|
+
<div className={`${HDSColor(cardHover.cardBg)} max-w-[221px] justify-between h-[442px] flex flex-col`}>
|
56
|
+
<div className=" ">
|
57
|
+
<div className="max-w-[148px] pt-8 pl-6 ">
|
58
|
+
<img src="https://res.cloudinary.com/dh8fp23nd/image/upload/v1685596743/website%20v3/capabilities-pre-footer_qxqlon.png" alt="Card" className=" inline-block max-w-[150px] h-[18.52px] pl-6 pr-12 pt-8" />
|
59
|
+
</div>
|
60
|
+
<Typography textStyle='quote' className="mt-6 px-6">{cardHover.title}</Typography>
|
61
|
+
|
62
|
+
</div>
|
63
|
+
<div className="flex pb-8 pl-6 pt-5">
|
64
|
+
<HDSButton
|
65
|
+
className='flex'
|
66
|
+
label={cardHover.button['cta_text']}
|
67
|
+
type="secondaryLink"
|
68
|
+
btnTextHoverClass="hover:text-neutral-0"
|
69
|
+
btnTextColorClass='text-neutral-0'
|
70
|
+
/>
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
|
74
|
+
|
75
|
+
</div>
|
76
|
+
);
|
77
|
+
};
|
78
|
+
|
79
|
+
|
80
|
+
return (
|
81
|
+
<div
|
82
|
+
className={` ${isHovered ? '' : ''} max-w-[221px]`}
|
83
|
+
onMouseEnter={handleMouseEnter}
|
84
|
+
onMouseLeave={handleMouseLeave}
|
85
|
+
>
|
86
|
+
<div className={`transition-all max-w-[220px] fixed ease-in-out duration-300 ${isHovered ? 'opacity-0 ' : 'opacity-100'}`}>
|
87
|
+
<Card1 />
|
88
|
+
</div>
|
89
|
+
<div className={`transition-al fixed ease-in-out duration-300 ${isHovered ? 'opacity-100' : 'opacity-0'}`}>
|
90
|
+
<Card2 />
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
);
|
94
|
+
}
|
95
|
+
|
96
|
+
Testimonial.defaultProps = {
|
97
|
+
card: {
|
98
|
+
cardBg: 'bg-green-400',
|
99
|
+
title_img: "Optum",
|
100
|
+
img_alt: 'optum',
|
101
|
+
subtitle: '“It took just 100 days to get our new clinical platform running… We don’t think we could have achieved this unbelievable speed without Hasura.”',
|
102
|
+
avatar: {
|
103
|
+
img_url: '',
|
104
|
+
name: 'Nagaraja Nayak',
|
105
|
+
designation: 'Optum',
|
106
|
+
avatarBgColor: 'bg-yellow-400'
|
107
|
+
}
|
108
|
+
},
|
109
|
+
cardHover: {
|
110
|
+
cardBg: 'bg-yellow-500',
|
111
|
+
img_url: '',
|
112
|
+
img_alt: '',
|
113
|
+
title: 'Optum goes from concept to production in 100 days with Hasura',
|
114
|
+
button: {
|
115
|
+
cta_text: 'Read the case Study'
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
}
|
120
|
+
};
|
@@ -4,4 +4,7 @@ export * from './BrandCard';
|
|
4
4
|
export * from './Dropdown';
|
5
5
|
export * from './Feedback';
|
6
6
|
export * from './Link';
|
7
|
-
export * from './TalkDetailCard';
|
7
|
+
export * from './TalkDetailCard';
|
8
|
+
export * from './ImageSlider';
|
9
|
+
export * from './CommunityCard';
|
10
|
+
export * from './Announcement';
|
@@ -0,0 +1,205 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { useRef, useState } from "react";
|
3
|
+
import { Icon } from "../common-components/Icon";
|
4
|
+
import { HDSButton } from "../Buttons";
|
5
|
+
export default function HomePageCarousel(props) {
|
6
|
+
const carouselRef = useRef(null); // Create a ref using useRef
|
7
|
+
const [currentCard, setCurrentCard] = React.useState(0);
|
8
|
+
const [touchStart, setTouchStart] = React.useState(0);
|
9
|
+
const [touchEnd, setTouchEnd] = React.useState(0);
|
10
|
+
const [showAllCards, setShowAllCards] = useState(false);
|
11
|
+
|
12
|
+
const handleTouchStart = e => {
|
13
|
+
setTouchStart(e.targetTouches[0].clientX);
|
14
|
+
};
|
15
|
+
|
16
|
+
const handleTouchMove = e => {
|
17
|
+
setTouchEnd(e.targetTouches[0].clientX);
|
18
|
+
};
|
19
|
+
|
20
|
+
const handleTouchEnd = () => {
|
21
|
+
if (touchStart - touchEnd > 150) {
|
22
|
+
nextCard();
|
23
|
+
}
|
24
|
+
|
25
|
+
if (touchStart - touchEnd < -150) {
|
26
|
+
previousCard();
|
27
|
+
}
|
28
|
+
};
|
29
|
+
|
30
|
+
const refs = props.cards.reduce((acc, val, i) => {
|
31
|
+
acc[i] = React.createRef();
|
32
|
+
return acc;
|
33
|
+
}, {});
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
const totalCards = props.cards.length;
|
38
|
+
|
39
|
+
const nextCard = () => {
|
40
|
+
let scrollByAmount = 1;
|
41
|
+
if (window.innerWidth > 800) {
|
42
|
+
scrollByAmount = 2;
|
43
|
+
}
|
44
|
+
if (window.innerWidth > 1140) {
|
45
|
+
scrollByAmount = 3;
|
46
|
+
}
|
47
|
+
|
48
|
+
if (currentCard < totalCards - scrollByAmount) {
|
49
|
+
setCurrentCard(currentCard + scrollByAmount);
|
50
|
+
carouselRef.current.scrollTo({
|
51
|
+
left: carouselRef.current.scrollLeft + carouselRef.current.children[0].offsetWidth * scrollByAmount,
|
52
|
+
behavior: "smooth",
|
53
|
+
});
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
setCurrentCard(0);
|
57
|
+
carouselRef.current.scrollTo({
|
58
|
+
left: 0,
|
59
|
+
behavior: "smooth",
|
60
|
+
});
|
61
|
+
}
|
62
|
+
};
|
63
|
+
|
64
|
+
const previousCard = () => {
|
65
|
+
let scrollByAmount = 1;
|
66
|
+
if (window.innerWidth > 800) {
|
67
|
+
scrollByAmount = 2;
|
68
|
+
}
|
69
|
+
if (window.innerWidth > 1140) {
|
70
|
+
scrollByAmount = 3;
|
71
|
+
}
|
72
|
+
|
73
|
+
if (currentCard > 0) {
|
74
|
+
setCurrentCard(currentCard - scrollByAmount);
|
75
|
+
carouselRef.current.scrollTo({
|
76
|
+
left: carouselRef.current.scrollLeft - carouselRef.current.children[0].offsetWidth * scrollByAmount,
|
77
|
+
behavior: "smooth",
|
78
|
+
});
|
79
|
+
} else {
|
80
|
+
const lastCardIndex = totalCards - 1;
|
81
|
+
const scrollLeft = carouselRef.current.scrollWidth - carouselRef.current.children[0].offsetWidth * scrollByAmount;
|
82
|
+
setCurrentCard(lastCardIndex);
|
83
|
+
carouselRef.current.scrollTo({
|
84
|
+
left: scrollLeft,
|
85
|
+
behavior: "smooth",
|
86
|
+
});
|
87
|
+
}
|
88
|
+
};
|
89
|
+
|
90
|
+
const maxVisibleCards = 6;
|
91
|
+
|
92
|
+
const arrowStyle = ' text-2xl z-10 bg-black h-10 ml-6 w-10 rounded-full bg-purple-200 hover:bg-neutral-0 flex items-center justify-center';
|
93
|
+
|
94
|
+
const sliderControl = isLeft => (
|
95
|
+
<button
|
96
|
+
type="button"
|
97
|
+
onClick={isLeft ? previousCard : nextCard}
|
98
|
+
className={`flex ${arrowStyle} ${isLeft ? '' : ''}`}
|
99
|
+
|
100
|
+
>
|
101
|
+
<span role="img" aria-label={`Arrow ${isLeft ? 'left' : 'right'}`}>
|
102
|
+
{isLeft ?
|
103
|
+
|
104
|
+
<Icon height={'h-6 w-6'} variant={'chevronleft'} strokeColor='#00288E' />
|
105
|
+
|
106
|
+
:
|
107
|
+
|
108
|
+
<Icon height={'h-6 w-6'} variant={'chevronright'} strokeColor='#00288E' />
|
109
|
+
|
110
|
+
}
|
111
|
+
</span>
|
112
|
+
</button>
|
113
|
+
);
|
114
|
+
return (
|
115
|
+
<div className="">
|
116
|
+
<div className="block tb:hidden">
|
117
|
+
{showAllCards
|
118
|
+
? props.cards.map((item, i) => (
|
119
|
+
<div className="my-5" key={i} ref={refs[i]}>
|
120
|
+
<div className="rounded-3xl overflow-hidden">
|
121
|
+
{React.createElement(props.component, item)}
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
))
|
125
|
+
: props.cards.slice(0, maxVisibleCards).map((item, i) => (
|
126
|
+
<div className="my-5" key={i} ref={refs[i]}>
|
127
|
+
<div className="rounded-3xl overflow-hidden">
|
128
|
+
{React.createElement(props.component, item)}
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
))}
|
132
|
+
{props.cards.length > maxVisibleCards && (
|
133
|
+
<div className="flex">
|
134
|
+
<HDSButton
|
135
|
+
label={showAllCards ? "View less" : "View more"}
|
136
|
+
type='secondary'
|
137
|
+
leftIconVariant='none'
|
138
|
+
rightIconVariant='none'
|
139
|
+
state='default'
|
140
|
+
size='sm'
|
141
|
+
rightAnimatedArrow={true}
|
142
|
+
rightAnimatedArrowColor='#1E56E3'
|
143
|
+
animatedHoverStroke='group-hover:stroke-neutral-0'
|
144
|
+
className='flex'
|
145
|
+
btnTextColorClass='text-blue-600'
|
146
|
+
btnBgColorClass=''
|
147
|
+
onClick={() => setShowAllCards(!showAllCards)}
|
148
|
+
/>
|
149
|
+
{/* <button
|
150
|
+
className="text-blue-500 mt-1 cursor-pointer"
|
151
|
+
onClick={() => setShowAllCards(!showAllCards)}
|
152
|
+
>
|
153
|
+
{showAllCards ? "View less" : "View more"}
|
154
|
+
</button> */}
|
155
|
+
</div>
|
156
|
+
)}
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
<div className="hidden tb:flex tb:flex-col">
|
161
|
+
<div className="flex pb-12 items-center justify-end ">
|
162
|
+
{/* {slider()} */}
|
163
|
+
<div className="flex">
|
164
|
+
{sliderControl(true)}
|
165
|
+
{sliderControl()}
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
<div className="justify-center select-none items-center"
|
169
|
+
onTouchStart={handleTouchStart}
|
170
|
+
onTouchMove={handleTouchMove}
|
171
|
+
onTouchEnd={handleTouchEnd}
|
172
|
+
onMouseDown={e => setTouchStart(e.clientX)}
|
173
|
+
onMouseUp={e => {
|
174
|
+
if (touchStart - e.clientX > 50) {
|
175
|
+
nextCard();
|
176
|
+
}
|
177
|
+
|
178
|
+
if (touchStart - e.clientX < -50) {
|
179
|
+
previousCard();
|
180
|
+
}
|
181
|
+
}}
|
182
|
+
>
|
183
|
+
<div className="">
|
184
|
+
<div className={`snap-x w-full inline-flex select-none overflow-x-hidden scrollbar-hide`}
|
185
|
+
ref={carouselRef}
|
186
|
+
>
|
187
|
+
|
188
|
+
{props.cards.map((item, i) => (
|
189
|
+
// <div className="max-[1140px]:snap-always tb:snap-always mx-5 max-[1140px]:shrink-0" key={i} ref={refs[i]}>
|
190
|
+
<div className=" db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={i} ref={refs[i]}>
|
191
|
+
<div className="w-full select-none rounded-3xl object-contain">
|
192
|
+
{React.createElement(props.component, item)}
|
193
|
+
</div>
|
194
|
+
|
195
|
+
</div>
|
196
|
+
))}
|
197
|
+
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
</div>
|
204
|
+
);
|
205
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {default as V3Footer} from './v3Footer';
|