hds-web 1.25.8 → 1.26.0

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.25.8",
3
+ "version": "1.26.0",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -11,51 +11,84 @@ export default function FeedbackCard(props) {
11
11
  logoBg = HDSColor(props.logoBg);
12
12
  }
13
13
  return (
14
- <a href={props.caseStudyUrl} className='group bg-neutral-0 rounded-3xl shadow p-6 tb-l:p-10 grid mb-6 db-s:mb-0 last:mb-0 flex-1 max-w-[920px] mx-auto flex-col transition-all duration-300 ease-in-out hover:shadow-lg hover:translate-y-0.5'>
14
+ <a
15
+ href={props.caseStudyUrl}
16
+ className="group bg-neutral-0 rounded-3xl shadow p-6 tb-l:p-10 grid mb-6 db-s:mb-0 last:mb-0 flex-1 max-w-[920px] mx-auto flex-col transition-all duration-300 ease-in-out hover:shadow-lg hover:translate-y-0.5"
17
+ >
15
18
  <div className=" self-start">
16
19
  <ProfileAvatar
17
20
  name={props.speakerName}
18
- size='xl'
21
+ size="xl"
19
22
  designation={props.speakerDesignation}
20
23
  imageUrl={props.speakerImgUrl}
21
24
  avatarVariant="circle"
22
25
  avatarType="secondary"
23
26
  />
24
- <div className={((props.dividerClass) ? "py-8" : "py-6")}>
25
- <Typography textStyle='sub2' className='text-neutral-600'>{props.description}</Typography>
27
+ <div className={props.dividerClass ? "py-8" : "py-6"}>
28
+ <Typography textStyle="sub2" className="text-neutral-600">
29
+ {props.description}
30
+ </Typography>
26
31
  </div>
27
32
  </div>
28
33
  <div className=" self-end">
29
- {
30
- props.dividerClass && (
31
- <div className={`${HDSColor(props.dividerClass)} mb-2`}></div>
32
- )
33
- }
34
- <div className={"mb-s:flex items-start" + ((props.dividerClass) ? " pt-6" : "mt-0")}>
35
- <div className={"border border-neutral-150 p-2 flex items-center justify-center rounded-2xl " + logoBg + ((props.dividerClass) ? " w-[72px] h-[56px] min-w-[72px]" : " w-[112px] h-[90px] min-w-[112px] ")}>
36
- <img className="max-h-[20px]" src={props.brandImgUrl} alt={props.brandImgAlt}/>
34
+ {props.dividerClass && (
35
+ <div className={`${HDSColor(props.dividerClass)} mb-2`}></div>
36
+ )}
37
+ <div
38
+ className={
39
+ "mb-s:flex items-start" + (props.dividerClass ? " pt-6" : "mt-0")
40
+ }
41
+ >
42
+ <div
43
+ className={
44
+ "border border-neutral-150 p-2 flex items-center justify-center rounded-2xl " +
45
+ logoBg +
46
+ (props.dividerClass
47
+ ? " w-[72px] h-[56px] min-w-[72px]"
48
+ : " w-[112px] h-[90px] min-w-[112px] ")
49
+ }
50
+ >
51
+ <img
52
+ className="max-h-[20px]"
53
+ src={props.brandImgUrl}
54
+ alt={props.brandImgAlt}
55
+ />
37
56
  </div>
38
- <div className={"pt-4 mb-s:pt-0 " + ((props.dividerClass) ? "mb-s:pl-6" : "mb-s:pl-8")}>
39
- <Typography textStyle={((props.dividerClass) ? "body2" : "body1")} className='text-neutral-600 pb-1'>{props.blurb}</Typography>
57
+ <div
58
+ className={
59
+ "pt-4 mb-s:pt-0 " +
60
+ (props.dividerClass ? "mb-s:pl-6" : "mb-s:pl-8")
61
+ }
62
+ >
63
+ <Typography
64
+ textStyle={props.dividerClass ? "body2" : "body1"}
65
+ className="text-neutral-600 pb-1"
66
+ >
67
+ {props.blurb}
68
+ </Typography>
40
69
  <div className="flex">
41
70
  <HDSButton
42
- label='Read the case study'
43
- type='secondaryLink'
44
- leftIconVariant='none'
45
- rightIconVariant='none'
46
- state='default'
47
- size='md'
71
+ label={props.ctaText}
72
+ type="secondaryLink"
73
+ leftIconVariant="none"
74
+ rightIconVariant="none"
75
+ state="default"
76
+ size="md"
48
77
  rightAnimatedArrow={true}
49
- rightAnimatedArrowColor='#3970FD'
50
- className='mt-0 justify-start'
51
- btnTextColorClass='text-blue-500'
52
- btnTextHoverClass= 'hover:text-blue-500'
53
- animatedHoverStroke= 'group-hover:stroke-blue-500'
78
+ rightAnimatedArrowColor="#3970FD"
79
+ className="mt-0 justify-start"
80
+ btnTextColorClass="text-blue-500"
81
+ btnTextHoverClass="hover:text-blue-500"
82
+ animatedHoverStroke="group-hover:stroke-blue-500"
54
83
  />
55
84
  </div>
56
85
  </div>
57
86
  </div>
58
87
  </div>
59
88
  </a>
60
- )
89
+ );
61
90
  }
91
+
92
+ FeedbackCard.defaultProps = {
93
+ ctaText: "Read the case study",
94
+ };
@@ -32,7 +32,7 @@ export default function V3Tab(props) {
32
32
  onClick={() => {
33
33
  handleTabClick(tab);
34
34
  }}
35
- className={`${activeTab === tab.name ? ' text-neutral-0 transition-all duration-300' : ' hover:bg-neutral-500/30 text-neutral-400'} relative px-3 py-1 whitespace-nowrap rounded-full hover:text-neutral-0`}
35
+ className={`${activeTab === tab.name ? ' text-neutral-0' : ' hover:bg-neutral-500/30 text-neutral-400'} relative px-3 py-1 whitespace-nowrap rounded-full hover:text-neutral-0`}
36
36
  >
37
37
  {activeTab === tab.name && (
38
38
  <motion.div
@@ -2,17 +2,14 @@ function buildInvertedIndex(data) {
2
2
  const invertedIndex = {};
3
3
 
4
4
  for (const item of data) {
5
- const attributes = item.attributes;
5
+ const key = Object.keys(item)[0];
6
+ const tags = item[key];
6
7
 
7
- if (attributes && attributes.hashtags) {
8
- const tags = attributes.hashtags.map(tag => tag.tag);
9
-
10
- for (const tag of tags) {
11
- if (!invertedIndex[tag]) {
12
- invertedIndex[tag] = new Set();
13
- }
14
- invertedIndex[tag].add(item);
8
+ for (const tag of tags) {
9
+ if (!invertedIndex[tag]) {
10
+ invertedIndex[tag] = new Set();
15
11
  }
12
+ invertedIndex[tag].add(key);
16
13
  }
17
14
  }
18
15
 
@@ -21,18 +18,17 @@ function buildInvertedIndex(data) {
21
18
 
22
19
  export default function getSimilarAndRemainingKeys(data, inputKey) {
23
20
  const invertedIndex = buildInvertedIndex(data);
24
- const inputTagsItem = data.find(item => item.attributes && item.attributes.slug === inputKey);
21
+ const inputTags = data.find(item => item[inputKey]);
25
22
  const similarKeys = new Set();
26
23
  const allKeys = new Set();
27
24
 
28
- if (inputTagsItem && inputTagsItem.attributes && inputTagsItem.attributes.hashtags) {
29
- const tags = inputTagsItem.attributes.hashtags.map(tag => tag.tag);
30
- for (const tag of tags) {
31
- const itemsWithSimilarTag = invertedIndex[tag];
32
- if (itemsWithSimilarTag) {
33
- itemsWithSimilarTag.forEach(item => {
34
- if (item.attributes.slug !== inputKey) {
35
- similarKeys.add(item.attributes.slug);
25
+ if (inputTags) {
26
+ for (const tag of inputTags[inputKey]) {
27
+ const keysWithSimilarTag = invertedIndex[tag];
28
+ if (keysWithSimilarTag) {
29
+ keysWithSimilarTag.forEach(key => {
30
+ if (key !== inputKey) {
31
+ similarKeys.add(key);
36
32
  }
37
33
  });
38
34
  }
@@ -40,10 +36,12 @@ export default function getSimilarAndRemainingKeys(data, inputKey) {
40
36
  }
41
37
 
42
38
  for (const item of data) {
43
- allKeys.add(item.attributes.slug);
39
+ const key = Object.keys(item)[0];
40
+ allKeys.add(key);
44
41
  }
45
42
 
46
43
  const remainingKeys = [...allKeys].filter(key => !similarKeys.has(key));
47
44
 
48
45
  return [...similarKeys, ...remainingKeys];
49
46
  }
47
+