hds-web 1.0.0 → 1.0.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.
Files changed (48) hide show
  1. package/.github/workflows/chromatic.yml +26 -0
  2. package/dist/index.css +4 -2
  3. package/dist/index.es.css +4 -2
  4. package/dist/index.es.js +11 -3
  5. package/dist/index.js +11 -3
  6. package/package.json +7 -3
  7. package/src/HDS/assets/icons/HasuraPrimary.svg +10 -0
  8. package/src/HDS/components/Avatars/profileAvatar.js +26 -14
  9. package/src/HDS/components/BadgesCaption/badges.js +1 -1
  10. package/src/HDS/components/Buttons/button.js +25 -14
  11. package/src/HDS/components/Cards/Feedback/feedback.js +25 -0
  12. package/src/HDS/components/Cards/Feedback/index.js +1 -0
  13. package/src/HDS/components/Cards/Link/index.js +2 -0
  14. package/src/HDS/components/Cards/Link/link.js +86 -0
  15. package/src/HDS/components/Cards/Link/resources.js +53 -0
  16. package/src/HDS/components/Cards/Menu/flyoutB.js +64 -0
  17. package/src/HDS/components/Cards/Menu/index.js +2 -1
  18. package/src/HDS/components/Cards/Misc/iconCard.js +22 -0
  19. package/src/HDS/components/Cards/Misc/index.js +2 -1
  20. package/src/HDS/components/Cards/Misc/talkCard.js +48 -27
  21. package/src/HDS/components/Cards/TalkDetailCard/index.js +1 -0
  22. package/src/HDS/components/Cards/TalkDetailCard/talkDetailCard.js +68 -0
  23. package/src/HDS/components/Carousels/carouselCard.js +24 -13
  24. package/src/HDS/components/Headers/customHeader.js +50 -41
  25. package/src/HDS/components/Headers/v3Header.js +127 -100
  26. package/src/HDS/components/Hero/h1.js +189 -0
  27. package/src/HDS/components/Hero/h2.js +198 -0
  28. package/src/HDS/components/Hero/index.js +2 -0
  29. package/src/HDS/components/Snippet/CodeSnippet.js +58 -58
  30. package/src/HDS/components/Snippet/index.js +1 -1
  31. package/src/HDS/components/Tables/index.js +2 -1
  32. package/src/HDS/components/Tables/tableB.js +86 -0
  33. package/src/HDS/components/common-components/Icon/IconMap.js +11 -2
  34. package/src/HDS/components/index.js +2 -1
  35. package/src/HDS/foundation/Animations/featureCard.js +77 -0
  36. package/src/HDS/foundation/Animations/index.js +1 -0
  37. package/src/HDS/foundation/ColorPalette/color.js +96 -1
  38. package/src/HDS/index.js +2 -1
  39. package/src/HDS/modules/TextCard/index.js +1 -0
  40. package/src/HDS/modules/TextCard/textCard.js +132 -0
  41. package/src/HDS/modules/index.js +1 -0
  42. package/src/index.css +154 -0
  43. package/src/styles/tailwind.css +1533 -239
  44. package/tailwind.config.js +19 -0
  45. package/src/HDS/components/Avatars/selectors.js +0 -0
  46. package/src/HDS/components/Buttons/socialMediaButton.js +0 -78
  47. package/src/HDS/components/Cards/Misc/featureCard.js +0 -0
  48. package/src/HDS/foundation/Typography/translated.js +0 -20
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import { useRef, useEffect } from "react";
3
+ import { Typography } from "../Typography";
4
+ import { useState } from "react";
5
+ import PropTypes from 'prop-types';
6
+
7
+ export default function FeatureCard(props) {
8
+ const [cardHeight, setCardHeight] = useState('auto');
9
+ const wrapperRef = useRef(null);
10
+
11
+ useEffect(() => {
12
+ if (wrapperRef.current) {
13
+ // Calculate the max height among all cards
14
+ const cards = wrapperRef.current.querySelectorAll(".feature-card");
15
+ if (!cards) return;
16
+ const heights = Array.from(cards).map((card) => card.clientHeight);
17
+ const maxHeight = Math.max(...heights);
18
+
19
+ // Set the max height as a CSS variable
20
+ setCardHeight(`${maxHeight}px`);
21
+ }
22
+ }, [props.featureCards]);
23
+
24
+ return (
25
+ <div ref={wrapperRef} className="relative card-animation-wrapper max-h-[26.25] max-w-[15rem] tb:max-w-[25rem] tb:max-h-[25.25rem]">
26
+ {props.featureCards.map((feature, index) => (
27
+ <div
28
+ key={index}
29
+ style={{ height: cardHeight }}
30
+ className={
31
+ "feature-card max-w-[18rem] tb:max-w-[21rem] rounded-3xl absolute top-0 left-0 " +
32
+ (feature.card_bg_color || "")
33
+ }
34
+ >
35
+ <div className="flex justify-center px-6 pt-6 tb:px-8 tb:pt-8 ">
36
+ <img src={feature.img_url} className='rounded-2xl tb:max-w-[17rem]' alt={feature.title} />
37
+ </div>
38
+ <div className={`flex flex-col px-6 pb-6 mt-6 tb:mt-8 tb:px-8 tb:pb-8`}>
39
+ <Typography
40
+ textStyle="h5"
41
+ as="h5"
42
+ className="text-neutral-0"
43
+ >
44
+ {feature.title}
45
+ </Typography>
46
+ <Typography textStyle="body1c" className="text-neutral-0 mt-1">
47
+ {feature.description}
48
+ </Typography>
49
+ </div>
50
+ </div>
51
+ ))}
52
+ </div>
53
+ );
54
+ }
55
+
56
+ FeatureCard.defaultProps ={
57
+ featureCards : [
58
+ {
59
+ img_url: 'https://res.cloudinary.com/dh8fp23nd/image/upload/v1683015500/hasura-con-2023/engage_clgotb.png',
60
+ title: 'Feature 1',
61
+ description: 'With hands-on workshops and learning about new tools, tips and tricks from real-life use cases, grow your skill set at HasuraCon.',
62
+ card_bg_color: 'bg-blue-500',
63
+ },
64
+ {
65
+ img_url: 'https://res.cloudinary.com/dh8fp23nd/image/upload/v1683015500/hasura-con-2023/engage_clgotb.png',
66
+ title: 'Feature 2',
67
+ description: 'With hands-on workshops ',
68
+ card_bg_color: 'bg-red-500',
69
+ },
70
+ {
71
+ img_url: 'https://res.cloudinary.com/dh8fp23nd/image/upload/v1683015500/hasura-con-2023/engage_clgotb.png',
72
+ title: 'Feature 3',
73
+ description: 'With hands-on workshops and learning about new tools, tips and tricks from real-life use cases, grow your skill set at HasuraCon.',
74
+ card_bg_color: 'bg-green-500',
75
+ },
76
+ ]
77
+ }
@@ -0,0 +1 @@
1
+ export {default as FeatureCard} from './featureCard';
@@ -479,7 +479,102 @@ const HDSColors = {
479
479
  "to-red-500": "to-red-500",
480
480
  "to-red-600": "to-red-600",
481
481
  "to-red-700": "to-red-700",
482
- "to-red-800": "to-red-800"
482
+ "to-red-800": "to-red-800",
483
+ "stroke-base-0": "stroke-base-0",
484
+ "stroke-base-1000": "stroke-base-1000",
485
+ "stroke-neutral-0": "stroke-neutral-0",
486
+ "stroke-neutral-50": "stroke-neutral-50",
487
+ "stroke-neutral-100": "stroke-neutral-100",
488
+ "stroke-neutral-150": "stroke-neutral-150",
489
+ "stroke-neutral-200": "stroke-neutral-200",
490
+ "stroke-neutral-300": "stroke-neutral-300",
491
+ "stroke-neutral-400": "stroke-neutral-400",
492
+ "stroke-neutral-500": "stroke-neutral-500",
493
+ "stroke-neutral-600": "stroke-neutral-600",
494
+ "stroke-neutral-700": "stroke-neutral-700",
495
+ "stroke-neutral-800": "stroke-neutral-800",
496
+ "stroke-neutral-850": "stroke-neutral-850",
497
+ "stroke-neutral-900": "stroke-neutral-900",
498
+ "stroke-neutral-950": "stroke-neutral-950",
499
+ "stroke-neutral-1000": "stroke-neutral-1000",
500
+ "stroke-blue-100": "stroke-blue-100",
501
+ "stroke-blue-200": "stroke-blue-200",
502
+ "stroke-blue-300": "stroke-blue-300",
503
+ "stroke-blue-400": "stroke-blue-400",
504
+ "stroke-blue-500": "stroke-blue-500",
505
+ "stroke-blue-600": "stroke-blue-600",
506
+ "stroke-blue-700": "stroke-blue-700",
507
+ "stroke-blue-800": "stroke-blue-800",
508
+ "stroke-blue-900": "stroke-blue-900",
509
+ "stroke-purple-100": "stroke-purple-100",
510
+ "stroke-purple-200": "stroke-purple-200",
511
+ "stroke-purple-300": "stroke-purple-300",
512
+ "stroke-purple-400": "stroke-purple-400",
513
+ "stroke-purple-500": "stroke-purple-500",
514
+ "stroke-purple-600": "stroke-purple-600",
515
+ "stroke-purple-700": "stroke-purple-700",
516
+ "stroke-purple-800": "stroke-purple-800",
517
+ "stroke-purple-900": "stroke-purple-900",
518
+ "stroke-cyan-100": "stroke-cyan-100",
519
+ "stroke-cyan-200": "stroke-cyan-200",
520
+ "stroke-cyan-300": "stroke-cyan-300",
521
+ "stroke-cyan-400": "stroke-cyan-400",
522
+ "stroke-cyan-500": "stroke-cyan-500",
523
+ "stroke-cyan-600": "stroke-cyan-600",
524
+ "stroke-cyan-700": "stroke-cyan-700",
525
+ "stroke-cyan-800": "stroke-cyan-800",
526
+ "stroke-cyan-900": "stroke-cyan-900",
527
+ "stroke-green-100": "stroke-green-100",
528
+ "stroke-green-200": "stroke-green-200",
529
+ "stroke-green-300": "stroke-green-300",
530
+ "stroke-green-400": "stroke-green-400",
531
+ "stroke-green-500": "stroke-green-500",
532
+ "stroke-green-600": "stroke-green-600",
533
+ "stroke-green-700": "stroke-green-700",
534
+ "stroke-green-800": "stroke-green-800",
535
+ "stroke-green-900": "stroke-green-900",
536
+ "stroke-pink-100": "stroke-pink-100",
537
+ "stroke-pink-200": "stroke-pink-200",
538
+ "stroke-pink-300": "stroke-pink-300",
539
+ "stroke-pink-400": "stroke-pink-400",
540
+ "stroke-pink-500": "stroke-pink-500",
541
+ "stroke-pink-600": "stroke-pink-600",
542
+ "stroke-pink-700": "stroke-pink-700",
543
+ "stroke-pink-800": "stroke-pink-800",
544
+ "stroke-pink-900": "stroke-pink-900",
545
+ "stroke-amber-100": "stroke-amber-100",
546
+ "stroke-amber-200": "stroke-amber-200",
547
+ "stroke-amber-300": "stroke-amber-300",
548
+ "stroke-amber-400": "stroke-amber-400",
549
+ "stroke-amber-500": "stroke-amber-500",
550
+ "stroke-amber-600": "stroke-amber-600",
551
+ "stroke-amber-700": "stroke-amber-700",
552
+ "stroke-amber-800": "stroke-amber-800",
553
+ "stroke-amber-900": "stroke-amber-900",
554
+ "stroke-yellow-100": "stroke-yellow-100",
555
+ "stroke-yellow-200": "stroke-yellow-200",
556
+ "stroke-yellow-300": "stroke-yellow-300",
557
+ "stroke-yellow-400": "stroke-yellow-400",
558
+ "stroke-yellow-500": "stroke-yellow-500",
559
+ "stroke-yellow-600": "stroke-yellow-600",
560
+ "stroke-yellow-700": "stroke-yellow-700",
561
+ "stroke-yellow-800": "stroke-yellow-800",
562
+ "stroke-orange-100": "stroke-orange-100",
563
+ "stroke-orange-200": "stroke-orange-200",
564
+ "stroke-orange-300": "stroke-orange-300",
565
+ "stroke-orange-400": "stroke-orange-400",
566
+ "stroke-orange-500": "stroke-orange-500",
567
+ "stroke-orange-600": "stroke-orange-600",
568
+ "stroke-orange-700": "stroke-orange-700",
569
+ "stroke-orange-800": "stroke-orange-800",
570
+ "stroke-red-100": "stroke-red-100",
571
+ "stroke-red-200": "stroke-red-200",
572
+ "stroke-red-300": "stroke-red-300",
573
+ "stroke-red-400": "stroke-red-400",
574
+ "stroke-red-500": "stroke-red-500",
575
+ "stroke-red-600": "stroke-red-600",
576
+ "stroke-red-700": "stroke-red-700",
577
+ "stroke-red-800": "stroke-red-800"
483
578
  };
484
579
 
485
580
  export default function HDSColor(color = 'bg-blue-600') {
package/src/HDS/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './foundation';
2
2
  export * from './helpers';
3
- export * from './components';
3
+ export * from './components';
4
+ export * from './modules';
@@ -0,0 +1 @@
1
+ export {default as TextCard} from './textCard';
@@ -0,0 +1,132 @@
1
+ import React from "react";
2
+ import { Typography } from "../../foundation/Typography";
3
+ import { HDSColor } from "../../foundation/ColorPalette";
4
+ import { HDSButton } from '../../components/Buttons';
5
+ import { Icon } from '../../components/common-components/Icon';
6
+
7
+ export default function TextCard(props) {
8
+ const titleColor = HDSColor(props.title_color);
9
+ console.log(props.descriptions);
10
+ return (
11
+ <>
12
+ {
13
+ props.feature_cards_links && (<Typography textStyle="h3" as="h3" className={`${titleColor} pb-8 tb-l:w-1/2`}>{props.title}</Typography>)
14
+ }
15
+ <div className={'grid grid-cols-1 tb:grid-cols-2 gap-10' + ((props.feature_cards_links) ? ' tb:gap-0 tb-l:gap-0' : ' tb:gap-16 tb-l:gap-36')}>
16
+ <div>
17
+ {
18
+ !props.feature_cards_links && (<Typography textStyle="h3" as="h3" className={`${titleColor} pb-6`}>{props.title}</Typography>)
19
+ }
20
+ {
21
+ props.descriptions && props.descriptions.map((desc, i) => (
22
+ <Typography key={i} textStyle="body1" className="pb-6">{desc.description}</Typography>
23
+ ))
24
+ }
25
+ {
26
+ props.descriptions_list && (
27
+ <div className="pb-6">
28
+ {
29
+ props.descriptions_list && props.descriptions_list.map((descList, j) => {
30
+ const iconBgColor = HDSColor(descList.icon_bg_color);
31
+ const iconColor = HDSColor(descList.icon_color);
32
+ return (
33
+ <div className='flex items-start pb-4 last:pb-0' key={j}>
34
+ <div className={`${iconBgColor} w-6 h-6 rounded-full mr-2 flex items-center justify-center`}>
35
+ <Icon
36
+ height={`h-3 w-3 stroke-[1.5px]` }
37
+ variant={descList.icon_name}
38
+ strokeColor={iconColor}
39
+ />
40
+ </div>
41
+ <Typography textStyle='body1' className='text-neutral-1000'>{descList.description}</Typography>
42
+ </div>
43
+ )
44
+ })
45
+ }
46
+ </div>
47
+ )
48
+ }
49
+ {
50
+ props.feature_cards_links && (
51
+ <div className='border border-neutral-150 rounded-2xl tb:rounded-e-none'>
52
+ {
53
+ props.feature_cards_links.map((list, i) => {
54
+ const currentStrokeColor = HDSColor(list.icon_color)
55
+ return (
56
+ <div className='border-b border-b-neutral-150 last:border-b-0'>
57
+ <div className='m-2 p-6 rounded-lg hover:bg-neutral-100' key={i}>
58
+ <div className='flex items-center pb-4'>
59
+ <Icon
60
+ height={`w-6 h-6 mr-2 stroke-[1.5px]` }
61
+ variant={list.icon_name}
62
+ strokeColor={currentStrokeColor}
63
+ />
64
+ <Typography textStyle='h5' as='h5' className='text-neutral-1000'>{list.title}</Typography>
65
+ </div>
66
+ {list.description && <Typography textStyle='body3' className='pb-4 text-neutral-1000'>{list.description}</Typography>}
67
+ {
68
+ list.descriptions_list && list.descriptions_list.map((descList, j) => {
69
+ const iconBgColor = HDSColor(descList.icon_bg_color);
70
+ const iconColor = HDSColor(descList.icon_color);
71
+ return (
72
+ <div className='flex items-start pb-4 last:pb-0' key={j}>
73
+ <div className={`${iconBgColor} w-5 h-5 rounded-full mr-2 flex items-center justify-center`}>
74
+ <Icon
75
+ height={`h-3 w-3 stroke-[1.5px]` }
76
+ variant={descList.icon_name}
77
+ strokeColor={iconColor}
78
+ />
79
+ </div>
80
+ <Typography textStyle='body3' className='text-neutral-1000'>{descList.description}</Typography>
81
+ </div>
82
+ )
83
+ })
84
+ }
85
+ {
86
+ props.button && (
87
+ <HDSButton
88
+ label={props.button.cta_text}
89
+ type='primaryLink'
90
+ leftIconVariant='none'
91
+ rightIconVariant='none'
92
+ state='default'
93
+ size='md'
94
+ rightAnimatedArrow={true}
95
+ rightAnimatedArrowColor='#3970FD'
96
+ />
97
+ )
98
+ }
99
+ </div>
100
+ </div>
101
+ )
102
+ })
103
+ }
104
+ </div>
105
+ )
106
+ }
107
+ {
108
+ props.button && (
109
+ <HDSButton
110
+ label={props.button.cta_text}
111
+ type='secondary'
112
+ leftIconVariant='none'
113
+ rightIconVariant='none'
114
+ state='default'
115
+ size='md'
116
+ rightAnimatedArrow={true}
117
+ rightAnimatedArrowColor='#3970FD'
118
+ />
119
+ )
120
+ }
121
+ </div>
122
+ <div>
123
+ {
124
+ props.img_url && (
125
+ <img src={props.img_url} alt={props.title} />
126
+ )
127
+ }
128
+ </div>
129
+ </div>
130
+ </>
131
+ )
132
+ }
@@ -0,0 +1 @@
1
+ export * from './TextCard';
package/src/index.css CHANGED
@@ -3,6 +3,160 @@
3
3
  @tailwind utilities;
4
4
  /* Typography classes */
5
5
 
6
+ .card-animation-wrapper {
7
+ position: relative;
8
+ }
9
+
10
+ .card-animation-wrapper .feature-card {
11
+ transition: all;
12
+ }
13
+
14
+ .card-animation-wrapper .feature-card:first-child {
15
+ animation: card1 15s infinite;
16
+ }
17
+
18
+ .card-animation-wrapper .feature-card:nth-child(2) {
19
+ animation: card2 15s infinite;
20
+ }
21
+
22
+ .card-animation-wrapper .feature-card:nth-child(3) {
23
+ animation: card3 15s infinite;
24
+ }
25
+ @keyframes card1 {
26
+ 0% {
27
+ transform: translate(0, 0);
28
+ z-index: 3;
29
+ }
30
+ 0.1%,6.65% {
31
+ z-index: 3;
32
+ }
33
+ 6.66%, 26.64% {
34
+ transform: translate(4rem, 4rem);
35
+ z-index: 2;
36
+ }
37
+ 33.3%, 59.94% {
38
+ transform: translate(2rem, 2rem);
39
+ z-index: 1;
40
+ }
41
+ 66.6%, 100% {
42
+ transform: translate(0, 0);
43
+ z-index: 0;
44
+ }
45
+ }
46
+
47
+ @media (max-width: 600px) {
48
+ @keyframes card1 {
49
+ 0% {
50
+ transform: translate(0, 0);
51
+ z-index: 3;
52
+ }
53
+ 0.1%,6.65% {
54
+ z-index: 3;
55
+ }
56
+ 6.66%, 26.64% {
57
+ transform: translate(3rem, 3rem);
58
+ z-index: 2;
59
+ }
60
+ 33.3%, 59.94% {
61
+ transform: translate(1.5rem, 1.5rem);
62
+ z-index: 1;
63
+ }
64
+ 66.6%, 100% {
65
+ transform: translate(0, 0);
66
+ z-index: 0;
67
+ }
68
+ }
69
+ }
70
+ @keyframes card2 {
71
+ 0% {
72
+ transform: translate(2rem, 2rem);
73
+ z-index: 1;
74
+ }
75
+ 6.66%, 26.64% {
76
+ transform: translate(0px, 0px);
77
+ z-index: 0;
78
+ }
79
+ 26.65%,33.29% {
80
+ z-index: 2;
81
+ }
82
+ 33.3%, 59.94% {
83
+ transform: translate(4rem, 4rem);
84
+ z-index: 2;
85
+ }
86
+ 66.6%, 100% {
87
+ transform: translate(2rem, 2rem);
88
+ z-index: 1;
89
+ }
90
+ }
91
+
92
+ @media (max-width: 600px) {
93
+ @keyframes card2 {
94
+ 0% {
95
+ transform: translate(1.5rem, 1.5rem);
96
+ z-index: 1;
97
+ }
98
+ 6.66%, 26.64% {
99
+ transform: translate(0px, 0px);
100
+ z-index: 0;
101
+ }
102
+ 26.65%,33.29% {
103
+ z-index: 2;
104
+ }
105
+ 33.3%, 59.94% {
106
+ transform: translate(3rem, 3rem);
107
+ z-index: 2;
108
+ }
109
+ 66.6%, 100% {
110
+ transform: translate(1.5rem, 1.5rem);
111
+ z-index: 1;
112
+ }
113
+ }
114
+ }
115
+ @keyframes card3 {
116
+ 0% {
117
+ transform: translate(4rem, 4rem);
118
+ z-index: 2;
119
+ }
120
+ 6.66%, 26.64% {
121
+ transform: translate(2rem, 2rem);
122
+ z-index: 1;
123
+ }
124
+ 33.3%, 59.94% {
125
+ transform: translate(0px, 0px);
126
+ z-index: 0;
127
+ }
128
+ 59.95%,66.5% {
129
+ z-index: 2;
130
+ }
131
+ 66.6%, 100% {
132
+ transform: translate(4rem, 4rem);
133
+ z-index: 2;
134
+ }
135
+ }
136
+ @media (max-width: 600px) {
137
+ @keyframes card3 {
138
+ 0% {
139
+ transform: translate(3rem, 3rem);
140
+ z-index: 2;
141
+ }
142
+ 6.66%, 26.64% {
143
+ transform: translate(1.5rem, 1.5rem);
144
+ z-index: 1;
145
+ }
146
+ 33.3%, 59.94% {
147
+ transform: translate(0px, 0px);
148
+ z-index: 0;
149
+ }
150
+ 59.95%,66.5% {
151
+ z-index: 2;
152
+ }
153
+ 66.6%, 100% {
154
+ transform: translate(3rem, 3rem);
155
+ z-index: 2;
156
+ }
157
+ }
158
+ }
159
+
6
160
  .scrollbar-hide::-webkit-scrollbar {
7
161
  width: 0;
8
162
  height: 0;