hds-web 1.6.8 → 1.7.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.
Files changed (53) hide show
  1. package/dist/index.css +5 -2
  2. package/dist/index.es.css +5 -2
  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/assets/icons/hasura-1.svg +3 -0
  9. package/src/HDS/assets/icons/hasura-2.svg +3 -0
  10. package/src/HDS/assets/icons/hasura-3.svg +3 -0
  11. package/src/HDS/components/Avatars/hasConAv.js +9 -10
  12. package/src/HDS/components/Avatars/profileAvatar.js +10 -29
  13. package/src/HDS/components/BadgesCaption/badges.js +7 -4
  14. package/src/HDS/components/Buttons/button.js +25 -14
  15. package/src/HDS/components/Cards/Dropdown/v3Dropdown.js +1 -1
  16. package/src/HDS/components/Cards/Feedback/feedback.js +1 -1
  17. package/src/HDS/components/Cards/ImageBox/imagebox.js +51 -0
  18. package/src/HDS/components/Cards/ImageBox/index.js +1 -0
  19. package/src/HDS/components/Cards/Link/link.js +19 -13
  20. package/src/HDS/components/Cards/Menu/flyout.js +5 -4
  21. package/src/HDS/components/Cards/Menu/flyoutA.js +5 -4
  22. package/src/HDS/components/Cards/Menu/flyoutFull.js +1 -0
  23. package/src/HDS/components/Cards/Misc/iconCard.js +71 -60
  24. package/src/HDS/components/Cards/Misc/index.js +1 -0
  25. package/src/HDS/components/Cards/Misc/talkCard.js +19 -18
  26. package/src/HDS/components/Cards/Misc/talkcard2.js +118 -0
  27. package/src/HDS/components/Cards/TalkDetailCard/talkDetailCard.js +83 -52
  28. package/src/HDS/components/Carousels/carouselCard.js +101 -90
  29. package/src/HDS/components/Headers/v3Header.js +111 -85
  30. package/src/HDS/components/Hero/h2.js +58 -36
  31. package/src/HDS/components/Hero/h3.js +413 -0
  32. package/src/HDS/components/Hero/index.js +2 -1
  33. package/src/HDS/components/Tables/index.js +2 -1
  34. package/src/HDS/components/Tables/tableB.js +10 -10
  35. package/src/HDS/components/Tables/tableC.js +20 -23
  36. package/src/HDS/components/Tables/tableD.js +326 -0
  37. package/src/HDS/components/Tabs/tab.js +47 -16
  38. package/src/HDS/components/common-components/Icon/IconMap.js +6 -0
  39. package/src/HDS/components/index.js +2 -1
  40. package/src/HDS/foundation/ColorPalette/color.js +193 -1
  41. package/src/HDS/foundation/Typography/Typography.js +2 -1
  42. package/src/HDS/helpers/Grid/grid.js +64 -0
  43. package/src/HDS/helpers/Grid/index.js +1 -0
  44. package/src/HDS/helpers/Media/index.js +1 -0
  45. package/src/HDS/helpers/Media/mediabox.js +75 -0
  46. package/src/HDS/helpers/index.js +2 -1
  47. package/src/HDS/modules/TextCard/textCard.js +8 -71
  48. package/src/HDS/modules/index.js +2 -1
  49. package/src/HDS/modules/navCard/index.js +1 -0
  50. package/src/HDS/modules/navCard/navCard.js +82 -0
  51. package/src/index.css +39 -1
  52. package/src/styles/tailwind.css +3104 -1848
  53. package/tailwind.config.js +6 -3
@@ -574,7 +574,199 @@ const HDSColors = {
574
574
  "stroke-red-500": "stroke-red-500",
575
575
  "stroke-red-600": "stroke-red-600",
576
576
  "stroke-red-700": "stroke-red-700",
577
- "stroke-red-800": "stroke-red-800"
577
+ "stroke-red-800": "stroke-red-800",
578
+ "hover:bg-storybook-default-heading": "hover:bg-storybook-default-heading",
579
+ "hover:bg-base-0": "hover:bg-base-0",
580
+ "hover:bg-base-1000": "hover:bg-base-1000",
581
+ "hover:bg-neutral-0": "hover:bg-neutral-0",
582
+ "hover:bg-neutral-50": "hover:bg-neutral-50",
583
+ "hover:bg-neutral-100": "hover:bg-neutral-100",
584
+ "hover:bg-neutral-150": "hover:bg-neutral-150",
585
+ "hover:bg-neutral-200": "hover:bg-neutral-200",
586
+ "hover:bg-neutral-300": "hover:bg-neutral-300",
587
+ "hover:bg-neutral-400": "hover:bg-neutral-400",
588
+ "hover:bg-neutral-500": "hover:bg-neutral-500",
589
+ "hover:bg-neutral-600": "hover:bg-neutral-600",
590
+ "hover:bg-neutral-700": "hover:bg-neutral-700",
591
+ "hover:bg-neutral-800": "hover:bg-neutral-800",
592
+ "hover:bg-neutral-850": "hover:bg-neutral-850",
593
+ "hover:bg-neutral-900": "hover:bg-neutral-900",
594
+ "hover:bg-neutral-950": "hover:bg-neutral-950",
595
+ "hover:bg-neutral-1000": "hover:bg-neutral-1000",
596
+ "hover:bg-blue-100": "hover:bg-blue-100",
597
+ "hover:bg-blue-200": "hover:bg-blue-200",
598
+ "hover:bg-blue-300": "hover:bg-blue-300",
599
+ "hover:bg-blue-400": "hover:bg-blue-400",
600
+ "hover:bg-blue-500": "hover:bg-blue-500",
601
+ "hover:bg-blue-600": "hover:bg-blue-600",
602
+ "hover:bg-blue-700": "hover:bg-blue-700",
603
+ "hover:bg-blue-800": "hover:bg-blue-800",
604
+ "hover:bg-blue-900": "hover:bg-blue-900",
605
+ "hover:bg-purple-100": "hover:bg-purple-100",
606
+ "hover:bg-purple-200": "hover:bg-purple-200",
607
+ "hover:bg-purple-300": "hover:bg-purple-300",
608
+ "hover:bg-purple-400": "hover:bg-purple-400",
609
+ "hover:bg-purple-500": "hover:bg-purple-500",
610
+ "hover:bg-purple-600": "hover:bg-purple-600",
611
+ "hover:bg-purple-700": "hover:bg-purple-700",
612
+ "hover:bg-purple-800": "hover:bg-purple-800",
613
+ "hover:bg-purple-900": "hover:bg-purple-900",
614
+ "hover:bg-cyan-100": "hover:bg-cyan-100",
615
+ "hover:bg-cyan-200": "hover:bg-cyan-200",
616
+ "hover:bg-cyan-300": "hover:bg-cyan-300",
617
+ "hover:bg-cyan-400": "hover:bg-cyan-400",
618
+ "hover:bg-cyan-500": "hover:bg-cyan-500",
619
+ "hover:bg-cyan-600": "hover:bg-cyan-600",
620
+ "hover:bg-cyan-700": "hover:bg-cyan-700",
621
+ "hover:bg-cyan-800": "hover:bg-cyan-800",
622
+ "hover:bg-cyan-900": "hover:bg-cyan-900",
623
+ "hover:bg-green-100": "hover:bg-green-100",
624
+ "hover:bg-green-200": "hover:bg-green-200",
625
+ "hover:bg-green-300": "hover:bg-green-300",
626
+ "hover:bg-green-400": "hover:bg-green-400",
627
+ "hover:bg-green-500": "hover:bg-green-500",
628
+ "hover:bg-green-600": "hover:bg-green-600",
629
+ "hover:bg-green-700": "hover:bg-green-700",
630
+ "hover:bg-green-800": "hover:bg-green-800",
631
+ "hover:bg-green-900": "hover:bg-green-900",
632
+ "hover:bg-pink-100": "hover:bg-pink-100",
633
+ "hover:bg-pink-200": "hover:bg-pink-200",
634
+ "hover:bg-pink-300": "hover:bg-pink-300",
635
+ "hover:bg-pink-400": "hover:bg-pink-400",
636
+ "hover:bg-pink-500": "hover:bg-pink-500",
637
+ "hover:bg-pink-600": "hover:bg-pink-600",
638
+ "hover:bg-pink-700": "hover:bg-pink-700",
639
+ "hover:bg-pink-800": "hover:bg-pink-800",
640
+ "hover:bg-pink-900": "hover:bg-pink-900",
641
+ "hover:bg-amber-100": "hover:bg-amber-100",
642
+ "hover:bg-amber-200": "hover:bg-amber-200",
643
+ "hover:bg-amber-300": "hover:bg-amber-300",
644
+ "hover:bg-amber-400": "hover:bg-amber-400",
645
+ "hover:bg-amber-500": "hover:bg-amber-500",
646
+ "hover:bg-amber-600": "hover:bg-amber-600",
647
+ "hover:bg-amber-700": "hover:bg-amber-700",
648
+ "hover:bg-amber-800": "hover:bg-amber-800",
649
+ "hover:bg-amber-900": "hover:bg-amber-900",
650
+ "hover:bg-yellow-100": "hover:bg-yellow-100",
651
+ "hover:bg-yellow-200": "hover:bg-yellow-200",
652
+ "hover:bg-yellow-300": "hover:bg-yellow-300",
653
+ "hover:bg-yellow-400": "hover:bg-yellow-400",
654
+ "hover:bg-yellow-500": "hover:bg-yellow-500",
655
+ "hover:bg-yellow-600": "hover:bg-yellow-600",
656
+ "hover:bg-yellow-700": "hover:bg-yellow-700",
657
+ "hover:bg-yellow-800": "hover:bg-yellow-800",
658
+ "hover:bg-orange-100": "hover:bg-orange-100",
659
+ "hover:bg-orange-200": "hover:bg-orange-200",
660
+ "hover:bg-orange-300": "hover:bg-orange-300",
661
+ "hover:bg-orange-400": "hover:bg-orange-400",
662
+ "hover:bg-orange-500": "hover:bg-orange-500",
663
+ "hover:bg-orange-600": "hover:bg-orange-600",
664
+ "hover:bg-orange-700": "hover:bg-orange-700",
665
+ "hover:bg-orange-800": "hover:bg-orange-800",
666
+ "hover:bg-red-100": "hover:bg-red-100",
667
+ "hover:bg-red-200": "hover:bg-red-200",
668
+ "hover:bg-red-300": "hover:bg-red-300",
669
+ "hover:bg-red-400": "hover:bg-red-400",
670
+ "hover:bg-red-500": "hover:bg-red-500",
671
+ "hover:bg-red-600": "hover:bg-red-600",
672
+ "hover:bg-red-700": "hover:bg-red-700",
673
+ "hover:bg-red-800": "hover:bg-red-800",
674
+ "border-storybook-default-heading": "border-storybook-default-heading",
675
+ "border-base-0": "border-base-0",
676
+ "border-base-1000": "border-base-1000",
677
+ "border-neutral-0": "border-neutral-0",
678
+ "border-neutral-50": "border-neutral-50",
679
+ "border-neutral-100": "border-neutral-100",
680
+ "border-neutral-150": "border-neutral-150",
681
+ "border-neutral-200": "border-neutral-200",
682
+ "border-neutral-300": "border-neutral-300",
683
+ "border-neutral-400": "border-neutral-400",
684
+ "border-neutral-500": "border-neutral-500",
685
+ "border-neutral-600": "border-neutral-600",
686
+ "border-neutral-700": "border-neutral-700",
687
+ "border-neutral-800": "border-neutral-800",
688
+ "border-neutral-850": "border-neutral-850",
689
+ "border-neutral-900": "border-neutral-900",
690
+ "border-neutral-950": "border-neutral-950",
691
+ "border-neutral-1000": "border-neutral-1000",
692
+ "border-blue-100": "border-blue-100",
693
+ "border-blue-200": "border-blue-200",
694
+ "border-blue-300": "border-blue-300",
695
+ "border-blue-400": "border-blue-400",
696
+ "border-blue-500": "border-blue-500",
697
+ "border-blue-600": "border-blue-600",
698
+ "border-blue-700": "border-blue-700",
699
+ "border-blue-800": "border-blue-800",
700
+ "border-blue-900": "border-blue-900",
701
+ "border-purple-100": "border-purple-100",
702
+ "border-purple-200": "border-purple-200",
703
+ "border-purple-300": "border-purple-300",
704
+ "border-purple-400": "border-purple-400",
705
+ "border-purple-500": "border-purple-500",
706
+ "border-purple-600": "border-purple-600",
707
+ "border-purple-700": "border-purple-700",
708
+ "border-purple-800": "border-purple-800",
709
+ "border-purple-900": "border-purple-900",
710
+ "border-cyan-100": "border-cyan-100",
711
+ "border-cyan-200": "border-cyan-200",
712
+ "border-cyan-300": "border-cyan-300",
713
+ "border-cyan-400": "border-cyan-400",
714
+ "border-cyan-500": "border-cyan-500",
715
+ "border-cyan-600": "border-cyan-600",
716
+ "border-cyan-700": "border-cyan-700",
717
+ "border-cyan-800": "border-cyan-800",
718
+ "border-cyan-900": "border-cyan-900",
719
+ "border-green-100": "border-green-100",
720
+ "border-green-200": "border-green-200",
721
+ "border-green-300": "border-green-300",
722
+ "border-green-400": "border-green-400",
723
+ "border-green-500": "border-green-500",
724
+ "border-green-600": "border-green-600",
725
+ "border-green-700": "border-green-700",
726
+ "border-green-800": "border-green-800",
727
+ "border-green-900": "border-green-900",
728
+ "border-pink-100": "border-pink-100",
729
+ "border-pink-200": "border-pink-200",
730
+ "border-pink-300": "border-pink-300",
731
+ "border-pink-400": "border-pink-400",
732
+ "border-pink-500": "border-pink-500",
733
+ "border-pink-600": "border-pink-600",
734
+ "border-pink-700": "border-pink-700",
735
+ "border-pink-800": "border-pink-800",
736
+ "border-pink-900": "border-pink-900",
737
+ "border-amber-100": "border-amber-100",
738
+ "border-amber-200": "border-amber-200",
739
+ "border-amber-300": "border-amber-300",
740
+ "border-amber-400": "border-amber-400",
741
+ "border-amber-500": "border-amber-500",
742
+ "border-amber-600": "border-amber-600",
743
+ "border-amber-700": "border-amber-700",
744
+ "border-amber-800": "border-amber-800",
745
+ "border-amber-900": "border-amber-900",
746
+ "border-yellow-100": "border-yellow-100",
747
+ "border-yellow-200": "border-yellow-200",
748
+ "border-yellow-300": "border-yellow-300",
749
+ "border-yellow-400": "border-yellow-400",
750
+ "border-yellow-500": "border-yellow-500",
751
+ "border-yellow-600": "border-yellow-600",
752
+ "border-yellow-700": "border-yellow-700",
753
+ "border-yellow-800": "border-yellow-800",
754
+ "border-orange-100": "border-orange-100",
755
+ "border-orange-200": "border-orange-200",
756
+ "border-orange-300": "border-orange-300",
757
+ "border-orange-400": "border-orange-400",
758
+ "border-orange-500": "border-orange-500",
759
+ "border-orange-600": "border-orange-600",
760
+ "border-orange-700": "border-orange-700",
761
+ "border-orange-800": "border-orange-800",
762
+ "border-red-100": "border-red-100",
763
+ "border-red-200": "border-red-200",
764
+ "border-red-300": "border-red-300",
765
+ "border-red-400": "border-red-400",
766
+ "border-red-500": "border-red-500",
767
+ "border-red-600": "border-red-600",
768
+ "border-red-700": "border-red-700",
769
+ "border-red-800": "border-red-800",
578
770
  };
579
771
 
580
772
  export default function HDSColor(color = '') {
@@ -16,6 +16,7 @@ export default function Typography(props) {
16
16
  'h4': 'text-hds-m-h4 tb:text-hds-t-h4 db:text-hds-d-h4',
17
17
  'h5': 'text-hds-m-h5 tb:text-hds-t-h5 db:text-hds-d-h5',
18
18
  'h6': 'text-hds-m-h6 tb:text-hds-t-h6 db:text-hds-d-h6',
19
+ 'h7': 'text-hds-m-h7 tb:text-hds-t-h7 db:text-hds-d-h7',
19
20
  'sub1': 'text-hds-m-sub1 tb:text-hds-t-sub1 db:text-hds-d-sub1',
20
21
  'sub2': 'text-hds-m-sub2 tb:text-hds-t-sub2 db:text-hds-d-sub2',
21
22
  'body1': 'text-hds-m-body1 tb:text-hds-t-body1 db:text-hds-d-body1',
@@ -42,7 +43,7 @@ export default function Typography(props) {
42
43
  'body3c-medium': 'text-hds-m-body3c-medium tb:text-hds-t-body3c-medium db:text-hds-d-body3c-medium',
43
44
  'body3c-semi-bold': 'text-hds-m-body3c-semi-bold tb:text-hds-t-body3c-semi-bold db:text-hds-d-body3c-semi-bold',
44
45
  'body3c-bold': 'text-hds-m-body3c-bold tb:text-hds-t-body3c-bold db:text-hds-d-body3c-bold',
45
- 'quote': 'text-hds-m-quote tb:text-hds-t-quote db:text-hds-d-quote',
46
+ 'quote': 'font-petrona italic text-hds-m-quote tb:text-hds-t-quote db:text-hds-d-quote',
46
47
  'code1': 'text-hds-m-code1 tb:text-hds-t-code1 db:text-hds-d-code1',
47
48
  'code2': 'text-hds-m-code2 tb:text-hds-t-code2 db:text-hds-d-code2',
48
49
  }
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+
3
+ const GridComponent = ({ cards, gridSize }) => {
4
+ const numCards = cards.length;
5
+ const cardsLeftInLastRow = numCards % gridSize;
6
+ const renderCards = () => {
7
+ let cardClass = '';
8
+ if(cards.length === 4 ){
9
+ cardClass = 'grid grid-cols-2'
10
+ }
11
+ else cardClass = 'gridAutoClass';
12
+ return cards.map((card, index) => (
13
+ <div
14
+ className={cardClass}
15
+ key={index}
16
+ >
17
+ {/* Render card content */}
18
+ {card}
19
+ </div>
20
+ ));
21
+ };
22
+
23
+ return (
24
+ <div className='flex flex-wrap'>
25
+ {renderCards()}
26
+ </div>
27
+ );
28
+ };
29
+
30
+ export default GridComponent;
31
+
32
+
33
+
34
+
35
+ // 2x2, 3x3, 4x4
36
+ // odd even
37
+
38
+ //2x2 -odd grid grid-cols-2
39
+ //case 1: NOC = 3
40
+ // .... ....
41
+ // ......... colr-span-2
42
+
43
+
44
+ //3x3 -odd
45
+ //case 1: noc:5
46
+ /// ... ... ...
47
+ // ..... ..... col-span-1.5 col-span-1.5
48
+ //case 2: noc:4
49
+ /// ... ... ...
50
+ // ........... col-span-3
51
+
52
+
53
+
54
+ //4x4
55
+
56
+ // case1: noc 5:
57
+ // .. .. .. ..
58
+ // ........... col-span-4
59
+ // case2: noc 6:
60
+ // .. .. .. ..
61
+ // ..... ..... col-span-2 col span-2
62
+ // case1: noc 7:
63
+ // .. .. .. ..
64
+ // ... ... ... col-span-4/3 col-span-4/3 col-span-4/3
@@ -0,0 +1 @@
1
+ export {default as GridComponent} from './grid';
@@ -0,0 +1 @@
1
+ export {default as MediaBox} from './mediabox';
@@ -0,0 +1,75 @@
1
+ import React, { useState } from 'react';
2
+ import { Icon } from '../../components/common-components/Icon';
3
+
4
+ export default function MediaViewer ({ img_url, video_url, video_poster, width }){
5
+ const [isVideoPlaying, setIsVideoPlaying] = useState(false);
6
+
7
+ const handleVideoClick = () => {
8
+ setIsVideoPlaying(true);
9
+ };
10
+
11
+ const handleVideoClose = () => {
12
+ setIsVideoPlaying(false);
13
+ };
14
+
15
+ return (
16
+ <div>
17
+ {img_url && (
18
+ <div className='flex justify-center'>
19
+ <img src={img_url} alt="Image" className='rounded-2xl' onClick={handleVideoClick} />
20
+ </div>
21
+ )}
22
+
23
+ {video_url && !img_url && video_poster && (
24
+ <div>
25
+ {!isVideoPlaying ? (
26
+ <div className='relative flex justify-center'>
27
+ <div className='flex items-center'>
28
+
29
+ <a
30
+ className=" left-[45%] z-10 cursor-pointer absolute w-12 h-12 flex justify-center items-center rounded-full border border-neutral-0"
31
+ onClick={() => {
32
+ setIsVideoPlaying(true);
33
+ }}
34
+ >
35
+
36
+ <Icon variant='play' height='h-6 w-6' strokeClass='stroke-neutral-0' />
37
+ </a>
38
+ </div>
39
+ <div>
40
+ <img
41
+ src={video_poster}
42
+ alt="Video Poster"
43
+ onClick={handleVideoClick}
44
+ className="cursor-pointer rounded-2xl"
45
+ />
46
+ </div>
47
+ </div>
48
+ ) : (
49
+ <div className="fixed inset-0 flex justify-center items-center z-50">
50
+ <div className="relative w-screen h-screen flex items-start p-10">
51
+ <a
52
+ className=" z-10 cursor-pointer left-14 top-2 relative w-12 h-12 bg-neutral-0 flex justify-center items-center rounded-full"
53
+ onClick={handleVideoClose}
54
+ >
55
+ <Icon variant='xclose' height='h-6 w-6' strokeClass='stroke-neutral-800' />
56
+ </a>
57
+ <video
58
+ controls={false}
59
+ autoPlay
60
+ muted
61
+ className="object-contain max-w-full max-h-full"
62
+ >
63
+ <source src={video_url} type="video/mp4" />
64
+ </video>
65
+
66
+ </div>
67
+ </div>
68
+ )}
69
+ </div>
70
+ )}
71
+ </div>
72
+ );
73
+ };
74
+
75
+
@@ -1 +1,2 @@
1
- export * from './Translations';
1
+ export * from './Translations';
2
+ export * from './Media';
@@ -20,7 +20,7 @@ export default function TextCard(props) {
20
20
  }
21
21
  {
22
22
  props.descriptions && props.descriptions.map((desc, i) => (
23
- <Typography key={i} textStyle="body1" className="pb-6 pr-8">{desc.description}</Typography>
23
+ <Typography key={i} textStyle="body1" className="pb-6">{desc.description}</Typography>
24
24
  ))
25
25
  }
26
26
  {
@@ -57,7 +57,7 @@ export default function TextCard(props) {
57
57
  const imgBgColor = HDSColor(list.tab_img_bg_class)
58
58
  return (
59
59
  <div className='border-b border-b-neutral-150 last:border-b-0 cursor-pointer' onClick={()=>setImgActive(list.title)}>
60
- <div className={'m-2 p-0 tb:p-6 rounded-lg transition ease-in duration-200 hover:bg-neutral-50' + ((imgActive === list.title) ? " bg-neutral-150" : "")} key={i}>
60
+ <div className={'m-2 p-0 tb:p-6 rounded-lg transition-all ease-in duration-75 hover:bg-neutral-50' + ((imgActive === list.title) ? " bg-neutral-100" : "")} key={i}>
61
61
  <div className='flex items-center pb-4'>
62
62
  <Icon
63
63
  height={`w-6 h-6 mr-2 stroke-[1.5px]` }
@@ -106,7 +106,7 @@ export default function TextCard(props) {
106
106
  {
107
107
  list.tab_img_url && (
108
108
  <div className={`${imgBgColor} tb-l:hidden p-12 rounded-2xl mt-8`}>
109
- <img src={list.tab_img_url} alt={list.title} loading="lazy"/>
109
+ <img src={list.tab_img_url} alt={list.title} />
110
110
  </div>
111
111
  )
112
112
  }
@@ -143,31 +143,7 @@ export default function TextCard(props) {
143
143
  return (
144
144
  <Fragment key={i}>
145
145
  {
146
- imgActive === img.title && (
147
- <div className={`${imgBgColor} hidden h-full p-12 tb-l:flex items-center rounded-2xl tb-l:rounded-s-none`}>
148
- {
149
- img.tab_video_url ? (
150
- <video
151
- loading="lazy"
152
- controls={false}
153
- autoPlay
154
- loop
155
- muted
156
- poster={img.tab_video_poster}
157
- className=""
158
- >
159
- <source
160
- src={img.tab_video_url}
161
- type="video/mp4"
162
- />
163
- </video>
164
- ) : (
165
- <img src={img.tab_img_url} alt={img.title} loading="lazy"/>
166
- )
167
- }
168
-
169
- </div>
170
- )
146
+ imgActive === img.title && img.tab_img_url && (<div className={`${imgBgColor} hidden h-full p-12 tb-l:flex items-center rounded-2xl tb-l:rounded-s-none`}><img src={img.tab_img_url} alt={img.title} /></div>)
171
147
  }
172
148
  </Fragment>
173
149
  )
@@ -176,48 +152,9 @@ export default function TextCard(props) {
176
152
  </>
177
153
  ) : (
178
154
  <div>
179
- {
180
- props.iframe_url || props.video_url ? (
181
- <>
182
- {
183
- props.iframe_url ? (
184
- <div className="relative pb-[56.2%]">
185
- <iframe
186
- loading="lazy"
187
- title={props.title}
188
- src={props.iframe_url}
189
- frameBorder="0"
190
- allowFullScreen
191
- className="absolute w-full h-full"
192
- ></iframe>
193
- </div>
194
- ) : (
195
- <video
196
- loading="lazy"
197
- controls={false}
198
- autoPlay
199
- loop
200
- muted
201
- poster={props.video_poster}
202
- className=""
203
- >
204
- <source
205
- src={props.video_url}
206
- type="video/mp4"
207
- />
208
- </video>
209
- )
210
- }
211
- </>
212
- ) : (
213
- <>
214
- {props.img_url && (
215
- <img src={props.img_url} alt={props.title} loading="lazy" />
216
- )}
217
- </>
218
- )
219
- }
220
-
155
+ {props.img_url && (
156
+ <img src={props.img_url} alt={props.title} />
157
+ )}
221
158
  </div>
222
159
  )
223
160
  }
@@ -225,4 +162,4 @@ export default function TextCard(props) {
225
162
 
226
163
  </>
227
164
  )
228
- }
165
+ }
@@ -1 +1,2 @@
1
- export * from './TextCard';
1
+ export * from './TextCard';
2
+ export * from './navCard';
@@ -0,0 +1 @@
1
+ export {default as NavCard} from './navCard'
@@ -0,0 +1,82 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { MediaBox } from '../../helpers/Media';
3
+ import { Typography } from '../../foundation/Typography';
4
+ import { HDSButton } from '../../components/Buttons';
5
+ import { HDSColor } from '../../foundation/ColorPalette';
6
+ import { Tab } from '../../components/Tabs';
7
+ import PropTypes from 'prop-types';
8
+
9
+ const tabCard = (tabContent) => (
10
+ <>
11
+ <div className='px-3'>
12
+ {tabContent.title && <Typography textStyle='h4' className={HDSColor(tabContent.title_color)}>{tabContent.title}</Typography>}
13
+
14
+ {tabContent.sub_title && <Typography textStyle='body1c' className={HDSColor(tabContent.sub_title_color)}>{tabContent.sub_title}</Typography>}
15
+ </div>
16
+ {tabContent.btnLabel &&
17
+ <div className='flex pl-3 pt-6 pb-8'>
18
+ <HDSButton
19
+ label={tabContent.btnLabel}
20
+ type='secondaryLink'
21
+ leftIconVariant='none'
22
+ rightIconVariant='none'
23
+ state='default'
24
+ size='sm'
25
+ rightAnimatedArrow={true}
26
+ rightAnimatedArrowColor='#1E56E3'
27
+ animatedHoverStroke='group-hover:stroke-blue-600'
28
+ className='flex'
29
+ btnTextColorClass='text-blue-600'
30
+ />
31
+ </div>
32
+ }
33
+ <div className='mt-8'>
34
+ <MediaBox
35
+ img_url={tabContent.img_url}
36
+ video_url={tabContent.video_url}
37
+ video_poster={tabContent.video_poster}
38
+ />
39
+ </div>
40
+ </>
41
+ )
42
+
43
+ export default function NavCard(props) {
44
+ const [activeTab, setActiveTab] = useState('');
45
+
46
+ useEffect(() => {
47
+ if (props.tabContent) {
48
+ const tabNames = Object.keys(props.tabContent);
49
+ setActiveTab(tabNames[0]);
50
+ }
51
+ }, [props.tabContent]);
52
+
53
+ const handleTabClick = (tab) => {
54
+ if (tab.name) {
55
+ setActiveTab(tab.name);
56
+ }
57
+ else return;
58
+ // Perform any other actions based on the clicked tab
59
+ }
60
+
61
+ return (
62
+ <div>
63
+ {props.navTabs &&
64
+
65
+ <div className='max-w-[44.44rem] p-16 bg-neutral-0 shadow rounded-2xl'>
66
+
67
+ <div className='flex justify-center pb-8'>
68
+ <Tab
69
+ onTabClick={handleTabClick}
70
+ tabs={props.navTabs}
71
+ />
72
+ </div>
73
+ <div className=''>
74
+ {props.tabContent &&
75
+ props.tabContent[activeTab] &&
76
+ tabCard(props.tabContent[activeTab])}
77
+ </div>
78
+
79
+ </div>}
80
+ </div>
81
+ )
82
+ }
package/src/index.css CHANGED
@@ -3,6 +3,15 @@
3
3
  @tailwind utilities;
4
4
  /* Typography classes */
5
5
 
6
+ .gridAutoClass {
7
+ flex: 1 0 30%;
8
+ margin-top: 40px;
9
+ margin-right: 32px;
10
+ background: blue;
11
+ justify-content: center;
12
+ display: flex;
13
+ }
14
+
6
15
  @keyframes pill-move-left {
7
16
  0% {
8
17
  left: 0;
@@ -396,4 +405,33 @@
396
405
 
397
406
  .token.operator {
398
407
  background: none !important;
399
- }
408
+ }
409
+
410
+
411
+ .border-80 {
412
+ position: relative;
413
+ }
414
+
415
+ .border-80::after {
416
+ content: "";
417
+ position: absolute;
418
+ bottom: 0;
419
+ left: 8%;
420
+ width: 80%;
421
+ border-bottom: 1px solid #E5E7EB;
422
+ }
423
+
424
+ .border-90 {
425
+ position: relative;
426
+ }
427
+
428
+ .border-90::after {
429
+ content: "";
430
+ position: absolute;
431
+ bottom: 0;
432
+ left: 0;
433
+ width: 100%;
434
+ border-bottom: 1px solid rgb(255, 255, 255);
435
+ }
436
+
437
+