hds-web 1.8.4 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hds-web",
3
- "version": "1.8.4",
3
+ "version": "1.8.6",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -18,8 +18,6 @@
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",
23
21
  "uuid": "^9.0.0",
24
22
  "web-vitals": "^2.1.4",
25
23
  "yarn": "^1.22.19"
@@ -14,11 +14,23 @@ const AvatarVariant = {
14
14
  'square': 'rounded-lg',
15
15
  }
16
16
 
17
- export default function ProfileAvatar({avatarBgColor, name, designation, size, imageUrl, avatarVariant }) {
17
+ const ProfileAvatarVariant = {
18
+ 'default': {
19
+ 'titleTextStyle': 'text-hds-m-body2c-bold tb:text-hds-t-body2c-bold db:text-hds-d-body2c-bold',
20
+ 'desgnTextStyle': 'text-hds-m-body3c tb:text-hds-t-body3c db:text-hds-d-body3c'
21
+ },
22
+ 'secondary': {
23
+ 'titleTextStyle': 'text-hds-m-sub2 tb:text-hds-t-sub2 db:text-hds-d-sub2',
24
+ 'desgnTextStyle': 'text-hds-m-body2 tb:text-hds-t-body2 db:text-hds-d-body2'
25
+ }
26
+ }
27
+
28
+ export default function ProfileAvatar({avatarBgColor, name, designation, size, imageUrl, avatarVariant, avatarType }) {
18
29
  const imgSizeClass = imgSizes[size] || imgSizes.md;
19
30
  const avatarVariantClass = AvatarVariant[avatarVariant] || AvatarVariant.circular;
20
31
  const defaultAvatarIcon = "user03";
21
32
  const hasImageUrl = imageUrl && imageUrl.length > 0;
33
+ const AvType = avatarType || 'default';
22
34
 
23
35
  return (
24
36
  <div className="group block flex-shrink-0">
@@ -28,6 +40,7 @@ export default function ProfileAvatar({avatarBgColor, name, designation, size, i
28
40
  <img
29
41
  className={`${imgSizeClass} ${avatarVariantClass} ${HDSColor(avatarBgColor)} rounded inline-block`}
30
42
  src={imageUrl}
43
+ alt={name}
31
44
  />
32
45
  ) : (
33
46
  <Icon
@@ -38,8 +51,8 @@ export default function ProfileAvatar({avatarBgColor, name, designation, size, i
38
51
  )}
39
52
  </div>
40
53
  <div className="ml-3">
41
- <Typography textStyle='body2c-bold' className={` text-neutral-800`}>{name}</Typography>
42
- <Typography textStyle='body3c' className={` text-neutral-500`}>{designation}</Typography>
54
+ <div className={`${ProfileAvatarVariant[AvType]['titleTextStyle']} text-neutral-800`}>{name}</div>
55
+ <div className={`${ProfileAvatarVariant[AvType]['desgnTextStyle']} text-neutral-600`}>{designation}</div>
43
56
  </div>
44
57
  </div>
45
58
  </div>
@@ -1,55 +1,54 @@
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";
1
+ // import React from "react";
2
+ // import Slider from "react-slick";
3
+ // import { HDSColor } from '../../../foundation/ColorPalette';
6
4
 
7
5
 
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
- }
6
+
7
+ // export default function ImageSlider(props) {
8
+ // // console.log(props.brands);
9
+ // const slideSettings = {
10
+ // infinite: true,
11
+ // slidesToShow: props.slidesToShow,
12
+ // slidesToScroll: 1,
13
+ // autoplay: true,
14
+ // speed: props.speed,
15
+ // autoplaySpeed: props.autoplaySpeed,
16
+ // cssEase: "linear",
17
+ // responsive: [
18
+ // {
19
+ // breakpoint: 1024,
20
+ // settings: {
21
+ // slidesToShow: 4,
22
+ // slidesToScroll: 1,
23
+ // },
24
+ // },
25
+ // {
26
+ // breakpoint: 767,
27
+ // settings: {
28
+ // slidesToShow: 3,
29
+ // slidesToScroll: 1,
30
+ // },
31
+ // },
32
+ // {
33
+ // breakpoint: 500,
34
+ // settings: {
35
+ // slidesToShow: 2,
36
+ // slidesToScroll: 1,
37
+ // },
38
+ // },
39
+ // ],
40
+ // };
41
+ // const gradientBgClass = HDSColor(props.gradientBgColor);
42
+ // return (
43
+ // <div>
44
+ // <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
45
+ // 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`}>
46
+ // {props.brands.map((brand, index) => (
47
+ // <div key={index} className="m-4">
48
+ // <img src={brand.imgUrl} alt={brand.imgAlt} />
49
+ // </div>
50
+ // ))}
51
+ // </Slider>
52
+ // </div>
53
+ // )
54
+ // }
@@ -1 +1 @@
1
- export {default as ImageSlider} from './imageSlider';
1
+ // export {default as ImageSlider} from './imageSlider';
@@ -0,0 +1,28 @@
1
+ import React, { useState } from 'react';
2
+
3
+ export default function HomeVC(props) {
4
+
5
+
6
+ return (
7
+ <>
8
+
9
+ <div className='carouselShadow'>
10
+ <div className='w-[643.51px] h-[472.64px] bg-base-1000 rounded-2xl flex flex-col items-center justify-center border-2 border-neutral-300'>
11
+ <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
12
+ <div className='relative bg-neutral-0 w-full h-full'></div>
13
+ <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
14
+ </div>
15
+ <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
16
+ <div className='relative bg-neutral-0 w-full h-full'></div>
17
+ <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
18
+ </div>
19
+ <div className='w-[598.55px] h-[449.94px] border-x-2 border-neutral-800 bg-base-1000 rounded-lg grid grid-cols-2 '>
20
+ <div className='relative bg-neutral-0 w-full h-full'></div>
21
+ <div className='relative bg-yellow-100 w-[221px] justify-self-end h-full'></div>
22
+ </div>
23
+
24
+ </div>
25
+ {/* <div className='relative mx-auto top-[442.72px] w-[151.7px] h-[3.1px] bg-neutral-0/20' /> */}
26
+ </div>
27
+ </>)
28
+ }
@@ -0,0 +1 @@
1
+ export { default as VideoCard } from './homeVC';
@@ -8,3 +8,4 @@ export * from './TalkDetailCard';
8
8
  export * from './ImageSlider';
9
9
  export * from './CommunityCard';
10
10
  export * from './Announcement';
11
+ export * from './VideoCard';
@@ -5,28 +5,8 @@ import { HDSButton } from "../Buttons";
5
5
  export default function HomePageCarousel(props) {
6
6
  const carouselRef = useRef(null); // Create a ref using useRef
7
7
  const [currentCard, setCurrentCard] = React.useState(0);
8
- const [touchStart, setTouchStart] = React.useState(0);
9
- const [touchEnd, setTouchEnd] = React.useState(0);
10
8
  const [showAllCards, setShowAllCards] = useState(false);
11
9
 
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
10
  const refs = props.cards.reduce((acc, val, i) => {
31
11
  acc[i] = React.createRef();
32
12
  return acc;
@@ -146,8 +126,8 @@ export default function HomePageCarousel(props) {
146
126
  </div>
147
127
 
148
128
 
149
- <div className="hidden tb:flex tb:flex-col">
150
- <div className="flex pb-12 items-center justify-end ">
129
+ <div className="hidden tb:flex tb:flex-col-reverse">
130
+ <div className="flex pt-10 justify-center items-center">
151
131
  {/* {slider()} */}
152
132
  <div className="flex">
153
133
  {sliderControl(true)}
@@ -155,19 +135,7 @@ export default function HomePageCarousel(props) {
155
135
  </div>
156
136
  </div>
157
137
  <div className="justify-center select-none items-center"
158
- onTouchStart={handleTouchStart}
159
- onTouchMove={handleTouchMove}
160
- onTouchEnd={handleTouchEnd}
161
- onMouseDown={e => setTouchStart(e.clientX)}
162
- onMouseUp={e => {
163
- if (touchStart - e.clientX > 50) {
164
- nextCard();
165
- }
166
-
167
- if (touchStart - e.clientX < -50) {
168
- previousCard();
169
- }
170
- }}
138
+
171
139
  >
172
140
  <div className="">
173
141
  <div className={`snap-x w-full inline-flex select-none overflow-x-hidden scrollbar-hide`}
@@ -175,7 +143,6 @@ export default function HomePageCarousel(props) {
175
143
  >
176
144
 
177
145
  {props.cards.map((item, i) => (
178
- // <div className="max-[1140px]:snap-always tb:snap-always mx-5 max-[1140px]:shrink-0" key={i} ref={refs[i]}>
179
146
  <div className=" db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={i} ref={refs[i]}>
180
147
  <div className="w-full select-none rounded-3xl object-contain">
181
148
  {React.createElement(props.component, item)}
@@ -183,6 +150,12 @@ export default function HomePageCarousel(props) {
183
150
 
184
151
  </div>
185
152
  ))}
153
+ <div className="db:snap-center snap-center tb-m:snap-start mx-5 shrink-0" key={totalCards}>
154
+ <div className="w-full select-none rounded-3xl object-contain">
155
+ {React.createElement(props.component, props.cards[0])}
156
+ </div>
157
+ </div>
158
+
186
159
 
187
160
  </div>
188
161
  </div>
@@ -0,0 +1 @@
1
+ export { default as ScrollSlider } from './scrollSlider';
@@ -0,0 +1,111 @@
1
+ import React, { useState } from 'react';
2
+ import { VideoCard } from "../../components/Cards/VideoCard";
3
+ import { HomepageCarousel } from '../../components';
4
+
5
+ const SideCard = () => (
6
+ <div className='bg-green-500 w-[300px] flex flex-col items-center justify-between rounded-3xl max-h-[338px]'>
7
+ <div className='w-[300px] flex justify-center'>
8
+ <img src='https://res.cloudinary.com/dh8fp23nd/image/upload/v1686737531/hasura-design-system/icons/optum_zn0bhw.png' alt='imgb' className='p-5 ' />
9
+ </div>
10
+ <div className='w-[300px] flex justify-center'>
11
+ <img src='https://res.cloudinary.com/dh8fp23nd/image/upload/v1685596743/website%20v3/capabilities-pre-footer_qxqlon.png' alt='imga' className='p-2 w-[194px]' />
12
+ </div>
13
+ </div>
14
+ )
15
+
16
+ const carouselItems = [
17
+ {
18
+ name: "John Smith",
19
+ designation: "CEO",
20
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
21
+ size: 'w-full'
22
+ },
23
+ {
24
+ name: "Jane Doe",
25
+ designation: "CTO",
26
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
27
+ size: 'w-full'
28
+ },
29
+ {
30
+ name: "Bob Johnson",
31
+ designation: "COO",
32
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
33
+ size: 'w-full'
34
+ },
35
+ {
36
+ name: "Gourav",
37
+ designation: "SDE",
38
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
39
+ size: 'w-full'
40
+ },
41
+ {
42
+ name: "Gourav",
43
+ designation: "SDE",
44
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
45
+ size: 'w-full'
46
+ },
47
+ {
48
+ name: "Gourav",
49
+ designation: "SDE",
50
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
51
+ size: 'w-full'
52
+ },
53
+ {
54
+ name: "Bob Johnson",
55
+ designation: "COO",
56
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
57
+ size: 'w-full'
58
+ },
59
+ {
60
+ name: "Gourav",
61
+ designation: "SDE",
62
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
63
+ size: 'w-full'
64
+ },
65
+ {
66
+ name: "Gourav",
67
+ designation: "SDE",
68
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
69
+ size: 'w-full'
70
+ },
71
+ {
72
+ name: "Gourav",
73
+ designation: "SDE",
74
+ imageUrl: "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8aHVtYW58ZW58MHx8MHx8&w=1000&q=80",
75
+ size: 'w-full'
76
+ }
77
+ ];
78
+
79
+ export default function ScrollSlider() {
80
+ const [isScrollActive, setScrollActive] = useState(false);
81
+
82
+ const handleMouseEnter = () => {
83
+ setScrollActive(true); // Mouse entered, scroll is active
84
+ };
85
+
86
+ const handleMouseLeave = () => {
87
+ setScrollActive(false); // Mouse left, scroll is inactive
88
+ };
89
+ return (
90
+ <div
91
+ className={`flex flex-row gap-4 w-screen h-screen items-center justify-center`}
92
+ onMouseEnter={handleMouseEnter}
93
+ onMouseLeave={handleMouseLeave}
94
+ >
95
+ <div className={`${isScrollActive ? 'translate-y-0' : ''} -translate-y-36 transition-all duration-[1500ms]`}>
96
+ <SideCard />
97
+ </div>
98
+ <div className='w-[643px] '>
99
+ <HomepageCarousel
100
+ cards={carouselItems}
101
+ component={VideoCard}
102
+ length={carouselItems.length}
103
+
104
+ />
105
+ </div>
106
+ <div className={`${isScrollActive ? '-translate-y-0' : ''} translate-y-36 transition-all duration-[1500ms]`}>
107
+ <SideCard />
108
+ </div>
109
+ </div>
110
+ );
111
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './Translations';
2
- export * from './Media';
2
+ export * from './Media';
3
+ export * from './Sliders'
package/src/index.css CHANGED
@@ -1,9 +1,11 @@
1
- /* @import url('https://fonts.googleapis.com/css2?family=Petrona:ital,wght@1,300&display=swap'); */
1
+ @import url('https://fonts.googleapis.com/css2?family=Petrona:ital,wght@1,300&display=swap');
2
2
  @tailwind base;
3
3
  @tailwind components;
4
4
  @tailwind utilities;
5
5
  /* Typography classes */
6
6
 
7
+
8
+
7
9
  .carouselShadow{
8
10
  filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)) drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
9
11
  }