hds-web 1.6.7 → 1.6.8

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.
Files changed (53) hide show
  1. package/dist/index.css +2 -5
  2. package/dist/index.es.css +2 -5
  3. package/dist/index.es.js +13 -13
  4. package/dist/index.js +13 -13
  5. package/package.json +1 -1
  6. package/src/HDS/assets/icons/calendar-plus-01.svg +1 -1
  7. package/src/HDS/assets/icons/calendar-plus-02.svg +1 -1
  8. package/src/HDS/components/Avatars/hasConAv.js +10 -9
  9. package/src/HDS/components/Avatars/profileAvatar.js +29 -10
  10. package/src/HDS/components/BadgesCaption/badges.js +4 -7
  11. package/src/HDS/components/Buttons/button.js +14 -25
  12. package/src/HDS/components/Cards/Dropdown/v3Dropdown.js +1 -1
  13. package/src/HDS/components/Cards/Feedback/feedback.js +1 -1
  14. package/src/HDS/components/Cards/Link/link.js +13 -19
  15. package/src/HDS/components/Cards/Menu/flyout.js +4 -5
  16. package/src/HDS/components/Cards/Menu/flyoutA.js +4 -5
  17. package/src/HDS/components/Cards/Menu/flyoutFull.js +0 -1
  18. package/src/HDS/components/Cards/Misc/iconCard.js +60 -71
  19. package/src/HDS/components/Cards/Misc/index.js +0 -1
  20. package/src/HDS/components/Cards/Misc/talkCard.js +18 -19
  21. package/src/HDS/components/Cards/TalkDetailCard/talkDetailCard.js +52 -83
  22. package/src/HDS/components/Carousels/carouselCard.js +90 -101
  23. package/src/HDS/components/Headers/v3Header.js +85 -111
  24. package/src/HDS/components/Hero/h2.js +36 -58
  25. package/src/HDS/components/Hero/index.js +1 -2
  26. package/src/HDS/components/Tables/index.js +1 -2
  27. package/src/HDS/components/Tables/tableB.js +10 -10
  28. package/src/HDS/components/Tables/tableC.js +23 -20
  29. package/src/HDS/components/Tabs/tab.js +16 -47
  30. package/src/HDS/components/common-components/Icon/IconMap.js +0 -6
  31. package/src/HDS/components/index.js +1 -2
  32. package/src/HDS/foundation/ColorPalette/color.js +1 -193
  33. package/src/HDS/foundation/Typography/Typography.js +1 -2
  34. package/src/HDS/helpers/index.js +1 -2
  35. package/src/HDS/modules/TextCard/textCard.js +71 -8
  36. package/src/HDS/modules/index.js +1 -2
  37. package/src/index.css +1 -39
  38. package/src/styles/tailwind.css +1842 -3151
  39. package/tailwind.config.js +3 -6
  40. package/src/HDS/assets/icons/hasura-1.svg +0 -3
  41. package/src/HDS/assets/icons/hasura-2.svg +0 -3
  42. package/src/HDS/assets/icons/hasura-3.svg +0 -3
  43. package/src/HDS/components/Cards/ImageBox/imagebox.js +0 -51
  44. package/src/HDS/components/Cards/ImageBox/index.js +0 -1
  45. package/src/HDS/components/Cards/Misc/talkcard2.js +0 -118
  46. package/src/HDS/components/Hero/h3.js +0 -413
  47. package/src/HDS/components/Tables/tableD.js +0 -326
  48. package/src/HDS/helpers/Grid/grid.js +0 -64
  49. package/src/HDS/helpers/Grid/index.js +0 -1
  50. package/src/HDS/helpers/Media/index.js +0 -1
  51. package/src/HDS/helpers/Media/mediabox.js +0 -75
  52. package/src/HDS/modules/navCard/index.js +0 -1
  53. package/src/HDS/modules/navCard/navCard.js +0 -82
@@ -4,19 +4,18 @@ import { Typography } from '../../../foundation/Typography'
4
4
  import { ProfileAvatar } from '../../Avatars'
5
5
  import { Time } from "../../../helpers/Time";
6
6
  import { HDSButton } from '../../Buttons'
7
- import ReactMarkdown from "react-markdown";
8
7
 
9
8
  export default function TalkCard(props) {
10
9
  let CardClass = ''
11
- if (props.speakerSet === undefined) {
10
+ if (props.speakerSet === undefined && props.eventTime === undefined) {
12
11
  CardClass = 'flex';
13
12
  }
14
- else CardClass = 'flex tb-l:flex-row flex-col';
13
+ else CardClass = 'grid shadow';
15
14
  return (
16
15
 
17
- <div className="grid w-full">
18
- <div className={`${CardClass} w-full max-w-[882px]`}>
19
- <div className={"px-8 py-6" + ((props.speakerSet) ? " border-b tb-l:w-[62%] border-b-neutral-150 tb:border-0 tb:border-r tb:border-r-neutral-150" : "")}>
16
+ <div className=" ">
17
+ <div className={`${CardClass} rounded-3xl bg-neutral-0 grid-cols-1 tb:grid-cols-2 border border-neutral-200 w-full max-w-[882px]`}>
18
+ <div className="px-8 py-6 border-b rounded-3xl border-b-neutral-150 tb:border-0 tb:border-r tb:border-r-neutral-150" >
20
19
  <Badges
21
20
  size={props.badges.size}
22
21
  color={props.badges.color}
@@ -25,19 +24,19 @@ export default function TalkCard(props) {
25
24
  children={props.badges.label}
26
25
  />
27
26
 
28
- <Typography className='my-2 text-blue-800' textStyle='h5'>{props.title}</Typography>
29
-
30
- {props.para &&
31
- <Typography
32
- className='line-clamp-3 text-neutral-700'
33
- textStyle='body1c'>
34
- {props.para}
35
- </Typography>}
36
-
27
+ <Typography
28
+ className='my-2 text-blue-800'
29
+ textStyle='h5'>{props.title}
30
+ </Typography>
31
+ <Typography
32
+ className='my-2 text-neutral-700'
33
+ textStyle='body1'>{props.para}</Typography>
37
34
  </div>
38
35
 
39
- {props.speakerSet && (
40
- <div className="flex flex-col tb-l:w-[38%] pt-0 tb:pt-[2.875rem] justify-between">
36
+ {props.speakerSet &&
37
+ props.eventTime &&
38
+
39
+ <div className="flex flex-col pt-0 tb:pt-[2.875rem] justify-between">
41
40
  {
42
41
  props.speakerSet && (
43
42
  <div className="pl-6 flex gap-6 mt-9 tb:mt-0 mb-9 flex-col ">
@@ -68,10 +67,10 @@ export default function TalkCard(props) {
68
67
  label=''
69
68
  />
70
69
  </div>
71
- </div>)}
70
+ </div>}
72
71
  </div>
73
72
  </div>
74
73
 
75
74
  )
76
75
 
77
- }
76
+ }
@@ -1,99 +1,68 @@
1
1
  import React from "react";
2
2
  import PropTypes from 'prop-types';
3
- import { HDSColor } from '../../../foundation/ColorPalette';
3
+ import {HDSColor} from '../../../foundation/ColorPalette';
4
4
  import { Badges } from '../../BadgesCaption';
5
5
  import { ProfileAvatar } from '../../Avatars'
6
6
  import { Typography } from "../../../foundation/Typography";
7
- import ReactMarkdown from "react-markdown";
8
7
 
9
8
 
10
9
  export default function TalkDetailCard(props) {
11
10
  const badgeLeftIconColor = HDSColor(props.badgeLeftIconColor);
12
11
  return (
13
- <div className="grid grid-cols-1 tb:grid-cols-2 gap-6 db:gap-28 tb:gap-16">
14
- <div>
15
- <div className="flex flex-row flex-wrap tb:gap-3 gap-2">
16
- {props.badges &&
17
- props.badges.map((value, index) => (
18
- <div key={index} className='flex whitespace-nowrap'>
19
- <Badges
20
- size={value.size}
21
- color={value.color}
22
- leftIconVariant={value.leftIconVariant}
23
- leftIconColor={value.leftIconColor}
24
- leftIconColorClass={HDSColor(value.leftIconColorClass)}
25
- children={value.label}
26
-
27
- />
28
-
29
- </div>
30
- ))
31
- }
32
- </div>
33
-
34
- {
35
- props.tag_line && (<Typography textStyle='h6' className='text-blue-600 uppercase pt-4 pb-2'>{props.tag_line}</Typography>)
36
- }
37
- {
38
- props.title && (<Typography textStyle='h3' as='h3' className='text-blue-900 pb-6 db:pb-0'>{props.title}</Typography>)
39
- }
40
- {
41
- props.social_share && (
42
- <div className='flex pb-6 tb:pt-0 tb:pb-0 items-center '>
43
- {
44
- props.social_share.map((socialShare, i) => (
45
- <a href={socialShare.share_url} className='mx-2 first:ml-0 last:mr-0'>
46
- <img src={socialShare.img_url} alt={socialShare.img_alt} />
47
- </a>
48
- ))
49
- }
50
- </div>
51
- )
52
- }
53
- {
54
- props.speaker_card && (
55
- <div className="border-t border-neutral-200 border-b pb-6 tb:border-0 tb:pb-0">
56
- <Typography textStyle='h6' as='h6' className='uppercase text-neutral-500 pb-6 pt-6 tb:pt-14'>speakers</Typography>
57
-
58
- {
59
- props.speaker_card.map((speaker, i) => (
60
- <div key={i} className='pb-4 last:pb-0'>
61
- <ProfileAvatar
62
- name={speaker.name}
63
- size='md'
64
- designation={speaker.designation}
65
- imageUrl={speaker.imageUrl}
66
- avatarVariant="circle"
67
- avatarBgColor={props.avatarBgColor}
68
- />
69
- </div>
70
- ))
71
- }
72
-
73
- </div>
74
- )
75
- }
76
- </div>
77
- <div>
78
- <Typography textStyle="h4" as="h4" className="text-neutral-800 pb-4">About the Talk</Typography>
79
- {
80
- props.description && (
81
- <Typography className='text-neutral-800 [&>p]:pb-2 last:[&>p]:pb-0 [&>ul]:ps-4 [&>ul>li]:list-disc [&>ul>li]:pb-2 last:[&>ul>li]:pb-0' textStyle='body1'>
82
- <ReactMarkdown>{props.description}</ReactMarkdown>
83
- </Typography>
84
- )
85
- }
86
- </div>
12
+ <div>
13
+ <Badges
14
+ color={props.badgeColor}
15
+ leftIconColor={badgeLeftIconColor}
16
+ leftIconVariant='home03'
17
+ size='default'
18
+ >
19
+ {props.talk_type}
20
+ </Badges>
21
+ <Typography textStyle='h6' className='text-blue-600 uppercase pt-4 pb-2'>{props.tag_line}</Typography>
22
+ <Typography textStyle='h3' as='h3' className='text-blue-900 pb-4'>{props.title}</Typography>
23
+ {
24
+ props.social_share && (
25
+ <div className='flex items-center pb-14'>
26
+ {
27
+ props.social_share.map((socialShare, i) => (
28
+ <div className='mx-2 first:ml-0 last:mr-0'>
29
+ <img src={socialShare.img_url} alt={socialShare.img_alt} />
30
+ </div>
31
+ ))
32
+ }
33
+ </div>
34
+ )
35
+ }
36
+ {
37
+ props.speaker_card && (
38
+ <div>
39
+ <Typography textStyle='h6' as='h6' className='uppercase text-neutral-500 pb-6'>speakers</Typography>
40
+ {
41
+ props.speaker_card.map((speaker, i) => (
42
+ <div className='pb-4 last:pb-0'>
43
+ <ProfileAvatar
44
+ name={speaker.name}
45
+ size='md'
46
+ designation={speaker.designation}
47
+ imageUrl={speaker.speakerImgUrl}
48
+ avatarVariant="circle"
49
+ />
50
+ </div>
51
+ ))
52
+ }
53
+ </div>
54
+ )
55
+ }
87
56
  </div>
88
57
  )
89
58
  }
90
59
 
91
60
  TalkDetailCard.defaultProps = {
92
- // badgeColor: 'green',
93
- // badgeLeftIconColor: 'stroke-neutral-0',
94
- // talk_type: 'Talk',
95
- // tag_line: 'June 20-22, 2023 | VIRTUAL | Free',
96
- // title: 'Deploying Hasura apps the fast way with the new Vercel integration',
97
- // social_share: '',
98
- // speaker_card: '',
61
+ badgeColor: 'green',
62
+ badgeLeftIconColor: 'stroke-neutral-0',
63
+ talk_type: 'Talk',
64
+ tag_line: 'June 20-22, 2023 | VIRTUAL | Free',
65
+ title: 'Deploying Hasura apps the fast way with the new Vercel integration',
66
+ social_share: '',
67
+ speaker_card: '',
99
68
  };
@@ -1,13 +1,37 @@
1
1
  import React from "react";
2
- import { useRef,useState } from "react";
3
2
  import { Icon } from "../common-components/Icon";
4
- import { HDSButton } from "../Buttons";
5
- export default function CarouselCard(props) {
6
- const carouselRef = useRef(null); // Create a ref using useRef
3
+ import { HasConAvatar } from "../Avatars";
4
+ export default function Carouseltest(props) {
7
5
  const [currentCard, setCurrentCard] = React.useState(0);
8
6
  const [touchStart, setTouchStart] = React.useState(0);
9
7
  const [touchEnd, setTouchEnd] = React.useState(0);
10
- const [showAllCards, setShowAllCards] = useState(false);
8
+ const [visibleCardsContainerWidth, setvisibleCardsContainerWidth] = React.useState(0);
9
+ const [cardWidth, setcardWidth] = React.useState(0);
10
+ const [totalContainerWidth, setTotalContainerWidth] = React.useState(0);
11
+ const [totalClick, setTotalClick] = React.useState(1);
12
+ const [totalCards, setTotalCards] = React.useState(0);
13
+ React.useEffect(() => {
14
+ const visibleCardsContainerWidth = refs[0]?.current?.parentNode?.offsetWidth;
15
+ setvisibleCardsContainerWidth(visibleCardsContainerWidth);
16
+ const cardWidth = refs[0]?.current?.getBoundingClientRect().width;
17
+ setcardWidth(cardWidth);
18
+
19
+ const totalCardsWidth = Object.values(refs).reduce((acc, ref) => {
20
+ const rect = ref.current.getBoundingClientRect();
21
+ return acc + rect.width + parseFloat(getComputedStyle(ref.current).marginLeft) + parseFloat(getComputedStyle(ref.current).marginRight);
22
+ }, 0);
23
+ setTotalContainerWidth(totalCardsWidth);
24
+ const noOfcardsinaview = (visibleCardsContainerWidth/cardWidth);
25
+
26
+ const cardLength = props.length;
27
+ setTotalCards(cardLength);
28
+
29
+ setTotalClick(2*(cardLength/noOfcardsinaview));
30
+
31
+
32
+
33
+ }, []);
34
+
11
35
 
12
36
  const handleTouchStart = e => {
13
37
  setTouchStart(e.targetTouches[0].clientX);
@@ -27,69 +51,70 @@ export default function CarouselCard(props) {
27
51
  }
28
52
  };
29
53
 
54
+
30
55
  const refs = props.cards.reduce((acc, val, i) => {
31
56
  acc[i] = React.createRef();
32
57
  return acc;
33
58
  }, {});
34
59
 
60
+ const scrollToCard = i => {
61
+ setCurrentCard(i);
35
62
 
36
-
37
- const totalCards = props.cards.length;
63
+ refs[i].current.scrollIntoView({
64
+ behavior: 'smooth',
65
+ block: 'nearest',
66
+ inline: 'start',
67
+ });
68
+ };
38
69
 
39
70
  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
- });
71
+
72
+ if (currentCard >= totalCards-1 || currentCard > totalClick+1) {
73
+ scrollToCard(0);
74
+ } else {
75
+ scrollToCard(currentCard + 1);
61
76
  }
62
77
  };
63
78
 
64
79
  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
- });
80
+ if (currentCard === 0) {
81
+ scrollToCard(totalCards - 1);
79
82
  } 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
- });
83
+ scrollToCard(currentCard - 1);
87
84
  }
88
85
  };
86
+ const slider = () => {
87
+
88
+ let x = visibleCardsContainerWidth;
89
+ let noOfcardsinaview = visibleCardsContainerWidth/cardWidth;
90
+
91
+ let y = 1;
92
+
93
+ // if((noOfcardsinaview*(currentCard+1))<=totalCards){
94
+ // let y = (totalContainerWidth/(noOfcardsinaview*visibleCardsContainerWidth))*(noOfcardsinaview*(currentCard+1));
95
+
96
+ // }
97
+
98
+ let slider1 = (384/(totalCards*cardWidth)) * (328)* (currentCard+noOfcardsinaview);
99
+ if(slider1>384){
100
+ slider1 = 384;
101
+ }
102
+ let roundOff = Math.floor(totalClick);
103
+ let slider2 = 384/(roundOff+Math.floor(noOfcardsinaview)+1);
104
+ let sliderWidth = 1;
105
+ sliderWidth = (slider2 * (currentCard+1))+ 'px';
106
+
107
+
108
+ return (
109
+ <div className=' '>
110
+ <div className='bg-pink-500 w-96 rounded-md content-center h-1'>
111
+ <div className={`bg-blue-600 transition-all ease-in duration-300 rounded-md h-1 `} style={{ width: `${sliderWidth}` }} />
112
+ </div>
113
+ </div>
114
+ )
115
+ };
89
116
 
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';
117
+ const arrowStyle = ' text-2xl z-10 bg-black h-10 w-10 rounded-full bg-neutral-0 flex items-center justify-center';
93
118
 
94
119
  const sliderControl = isLeft => (
95
120
  <button
@@ -101,11 +126,11 @@ export default function CarouselCard(props) {
101
126
  <span role="img" aria-label={`Arrow ${isLeft ? 'left' : 'right'}`}>
102
127
  {isLeft ?
103
128
 
104
- <Icon height={'h-6 w-6'} variant={'chevronleft'} strokeColor='#00288E' />
129
+ <Icon height={'h-6 w-6'} variant={'chevronleft'} strokeColor='#1F2A37' />
105
130
 
106
131
  :
107
132
 
108
- <Icon height={'h-6 w-6'} variant={'chevronright'} strokeColor='#00288E' />
133
+ <Icon height={'h-6 w-6'} variant={'chevronright'} strokeColor='#1F2A37' />
109
134
 
110
135
  }
111
136
  </span>
@@ -114,52 +139,19 @@ export default function CarouselCard(props) {
114
139
  return (
115
140
  <div className="">
116
141
  <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>
142
+ {props.cards.map((item, i) => (
143
+ <div className="my-5" key={i} ref={refs[i]}>
144
+ <div className="rounded-3xl ">
145
+ {React.createElement(props.component, item)}
130
146
  </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> */}
147
+
155
148
  </div>
156
- )}
149
+ ))}
157
150
  </div>
158
151
 
159
-
160
- <div className="hidden tb:flex tb:flex-col">
161
- <div className="flex pb-12 items-center justify-end ">
162
- {/* {slider()} */}
152
+ <div className="invisible flex flex-col-reverse tb:visible">
153
+ <div className="flex items-center justify-around mt-20 ">
154
+ {slider()}
163
155
  <div className="flex">
164
156
  {sliderControl(true)}
165
157
  {sliderControl()}
@@ -181,13 +173,10 @@ export default function CarouselCard(props) {
181
173
  }}
182
174
  >
183
175
  <div className="">
184
- <div className={`snap-x w-full inline-flex select-none overflow-x-hidden scrollbar-hide`}
185
- ref={carouselRef}
186
- >
176
+ <div className={`snap-x w-full inline-flex select-none overflow-x-hidden scrollbar-hide`}>
187
177
 
188
178
  {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]}>
179
+ <div className="snap-center mx-5 shrink-0" key={i} ref={refs[i]}>
191
180
  <div className="w-full select-none rounded-3xl object-contain">
192
181
  {React.createElement(props.component, item)}
193
182
  </div>