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.
- package/.github/workflows/chromatic.yml +26 -0
- package/dist/index.css +4 -2
- package/dist/index.es.css +4 -2
- package/dist/index.es.js +11 -3
- package/dist/index.js +11 -3
- package/package.json +7 -3
- package/src/HDS/assets/icons/HasuraPrimary.svg +10 -0
- package/src/HDS/components/Avatars/profileAvatar.js +26 -14
- package/src/HDS/components/BadgesCaption/badges.js +1 -1
- package/src/HDS/components/Buttons/button.js +25 -14
- package/src/HDS/components/Cards/Feedback/feedback.js +25 -0
- package/src/HDS/components/Cards/Feedback/index.js +1 -0
- package/src/HDS/components/Cards/Link/index.js +2 -0
- package/src/HDS/components/Cards/Link/link.js +86 -0
- package/src/HDS/components/Cards/Link/resources.js +53 -0
- package/src/HDS/components/Cards/Menu/flyoutB.js +64 -0
- package/src/HDS/components/Cards/Menu/index.js +2 -1
- package/src/HDS/components/Cards/Misc/iconCard.js +22 -0
- package/src/HDS/components/Cards/Misc/index.js +2 -1
- package/src/HDS/components/Cards/Misc/talkCard.js +48 -27
- package/src/HDS/components/Cards/TalkDetailCard/index.js +1 -0
- package/src/HDS/components/Cards/TalkDetailCard/talkDetailCard.js +68 -0
- package/src/HDS/components/Carousels/carouselCard.js +24 -13
- package/src/HDS/components/Headers/customHeader.js +50 -41
- package/src/HDS/components/Headers/v3Header.js +127 -100
- package/src/HDS/components/Hero/h1.js +189 -0
- package/src/HDS/components/Hero/h2.js +198 -0
- package/src/HDS/components/Hero/index.js +2 -0
- package/src/HDS/components/Snippet/CodeSnippet.js +58 -58
- package/src/HDS/components/Snippet/index.js +1 -1
- package/src/HDS/components/Tables/index.js +2 -1
- package/src/HDS/components/Tables/tableB.js +86 -0
- package/src/HDS/components/common-components/Icon/IconMap.js +11 -2
- package/src/HDS/components/index.js +2 -1
- package/src/HDS/foundation/Animations/featureCard.js +77 -0
- package/src/HDS/foundation/Animations/index.js +1 -0
- package/src/HDS/foundation/ColorPalette/color.js +96 -1
- package/src/HDS/index.js +2 -1
- package/src/HDS/modules/TextCard/index.js +1 -0
- package/src/HDS/modules/TextCard/textCard.js +132 -0
- package/src/HDS/modules/index.js +1 -0
- package/src/index.css +154 -0
- package/src/styles/tailwind.css +1533 -239
- package/tailwind.config.js +19 -0
- package/src/HDS/components/Avatars/selectors.js +0 -0
- package/src/HDS/components/Buttons/socialMediaButton.js +0 -78
- package/src/HDS/components/Cards/Misc/featureCard.js +0 -0
- package/src/HDS/foundation/Typography/translated.js +0 -20
@@ -0,0 +1,189 @@
|
|
1
|
+
import { useState, useEffect } from "react";
|
2
|
+
import { Typography } from "../../foundation/Typography";
|
3
|
+
import { HDSButton } from "../Buttons";
|
4
|
+
import { HDSColor } from "../../foundation/ColorPalette";
|
5
|
+
import { Icon } from "../common-components";
|
6
|
+
|
7
|
+
export default function Hero({ heroData, logo, scrollArrow, fontSize }) {
|
8
|
+
const [valumeMuteIcon, setValumeMuteIcon] = useState("volumex");
|
9
|
+
const videoMute = () => {
|
10
|
+
if (heroData.video_url) {
|
11
|
+
const videoEle = document.getElementById("hero_vid");
|
12
|
+
if (videoEle?.muted) {
|
13
|
+
videoEle.muted = false;
|
14
|
+
setValumeMuteIcon("volumemax")
|
15
|
+
} else {
|
16
|
+
videoEle.muted = true;
|
17
|
+
setValumeMuteIcon("volumex")
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
const videoGradientBg = HDSColor(heroData.video_gradient_bg);
|
23
|
+
return (
|
24
|
+
<div className="db:pt-32 mb-10 db:mb-5 tb:mb-16 tb-l:mb-0">
|
25
|
+
<div className="tb:px-4">
|
26
|
+
<div className={"max-w-7xl mx-auto rounded-3xl overflow-hidden " + ((heroData.bg_color) ? heroData.bg_color : "")} >
|
27
|
+
<div className="w-full">
|
28
|
+
<div className={"db:flex db:w-full tb-l:flex block" + ((heroData.video_url) ? " tb:block" : " tb:flex")}>
|
29
|
+
<div className={"db:px-28 db:py-20 db:pr-0 tb-l:self-center tb-l:min-w-[400px] mx-auto db:ml-0 db:max-w-[625px] db:min-w-[625px] p-5 pt-10 z-[1] tb:p-16 tb-l:py-12" + ((heroData.video_url) ? " tb:max-w-[530px]" : " tb:ml-0 tb:max-w-[290px] tb:min-w-[310px] tb:pr-0")}
|
30
|
+
>
|
31
|
+
{
|
32
|
+
heroData.tag_line && (
|
33
|
+
<div
|
34
|
+
|
35
|
+
>
|
36
|
+
<Typography textStyle="h6" as="h6" className={"pb-6 uppercase text-center db:text-left font-normal tb-l:text-left " + ((heroData.tag_line_color) ? heroData.tag_line_color : "") + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}
|
37
|
+
>
|
38
|
+
{heroData.tag_line}
|
39
|
+
</Typography>
|
40
|
+
</div>
|
41
|
+
)
|
42
|
+
}
|
43
|
+
{
|
44
|
+
heroData.title && (
|
45
|
+
<div
|
46
|
+
|
47
|
+
>
|
48
|
+
{
|
49
|
+
logo ? (
|
50
|
+
<div className={"pb-4 db:text-left text-center tb-l:text-left" + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}>
|
51
|
+
<img className="w-[290px] inline-block" src={logo} alt="Brand" />
|
52
|
+
</div>
|
53
|
+
) : (
|
54
|
+
<Typography textStyle={fontSize ? fontSize : "h1"} as="h1" className={"pb-2 text-center break-words db:text-left tb-l:text-left " + ((heroData.title_color) ? heroData.title_color : "") + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}>{heroData.title}</Typography>
|
55
|
+
)
|
56
|
+
}
|
57
|
+
</div>
|
58
|
+
)
|
59
|
+
}
|
60
|
+
{
|
61
|
+
heroData.sub_title && (
|
62
|
+
<div
|
63
|
+
|
64
|
+
>
|
65
|
+
<Typography textStyle="sub1" className={"text-center db:text-left tb-l:text-left " + ((heroData.sub_title_color) ? heroData.sub_title_color : "") + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}>{heroData.sub_title}</Typography>
|
66
|
+
</div>
|
67
|
+
)
|
68
|
+
}
|
69
|
+
{
|
70
|
+
heroData.description && (
|
71
|
+
<div
|
72
|
+
|
73
|
+
>
|
74
|
+
<Typography textStyle="sub2" className="text-center tb:text-left db:text-left tb-l:text-left text-blue-700 [&>*]:mb-8 last:[&>*]:mb-0">{heroData.description}</Typography>
|
75
|
+
</div>
|
76
|
+
)
|
77
|
+
}
|
78
|
+
{
|
79
|
+
heroData.buttons && (
|
80
|
+
<div className={" gap-2 flex items-center justify-center tb-l:justify-start db:justify-start pt-6" + ((heroData.video_url) ? " tb:justify-center" : " tb:justify-start")}>
|
81
|
+
{
|
82
|
+
heroData.buttons.map((btn, index) => (
|
83
|
+
<HDSButton
|
84
|
+
leftIconVariant='none'
|
85
|
+
rightIconVariant='none'
|
86
|
+
label={btn.cta_text}
|
87
|
+
state='default'
|
88
|
+
size='lg'
|
89
|
+
rightAnimatedArrow='true'
|
90
|
+
rightAnimatedArrowColor='#ffffff'
|
91
|
+
/>
|
92
|
+
))
|
93
|
+
}
|
94
|
+
</div>
|
95
|
+
)
|
96
|
+
}
|
97
|
+
</div>
|
98
|
+
{
|
99
|
+
heroData.video_url ? (
|
100
|
+
<div className={"relative" + ((heroData.video_gradient_bg) ? "" : " p-4")}>
|
101
|
+
<div className="w-12 h-12 bg-neutral-0 rounded-full absolute right-8 bottom-8 shadow-md cursor-pointer z-[2] flex items-center justify-center" onClick={() => videoMute()}>
|
102
|
+
<Icon height={'w-6 h-6 stroke-neutral-800 stroke-[1.5px]'} variant={valumeMuteIcon} strokeColor="#1F2A37" />
|
103
|
+
</div>
|
104
|
+
<video
|
105
|
+
id="hero_vid"
|
106
|
+
controls={false}
|
107
|
+
// autoPlay
|
108
|
+
loop
|
109
|
+
muted
|
110
|
+
poster="https://res.cloudinary.com/dh8fp23nd/image/upload/v1683311269/hasura-con-2023/hascon23_fallback_homepage_tg5sgv.jpg"
|
111
|
+
width="500"
|
112
|
+
height="500"
|
113
|
+
className={"tb:w-full w-full db:max-w-[500px]" + ((heroData.video_gradient_bg) ? "" : " rounded-xl shadow-md")}
|
114
|
+
>
|
115
|
+
<source
|
116
|
+
src={heroData.video_url}
|
117
|
+
type="video/mp4"
|
118
|
+
/>
|
119
|
+
</video>
|
120
|
+
{
|
121
|
+
heroData.video_gradient_bg && (<div className={`tb-l:w-1/2 w-full h-1/2 tb:h-full absolute left-0 top-0 tb-l:ml-[-4px] tb-l:bg-gradient-to-r ${videoGradientBg} to-transparent bg-gradient-to-b tb:mt-[-4px] tb-l:mt-0`}></div>)
|
122
|
+
}
|
123
|
+
</div>
|
124
|
+
) : (
|
125
|
+
<div className="w-full"
|
126
|
+
variants={{
|
127
|
+
hidden: {
|
128
|
+
opacity: 0,
|
129
|
+
},
|
130
|
+
visible: {
|
131
|
+
opacity: 1,
|
132
|
+
transition: {
|
133
|
+
delay: .2,
|
134
|
+
duration: 1,
|
135
|
+
}
|
136
|
+
},
|
137
|
+
}}
|
138
|
+
>
|
139
|
+
{heroData.img_url && (
|
140
|
+
<div className="text-right pt-0 flex items-end justify-end h-full">
|
141
|
+
<img
|
142
|
+
src={heroData.img_url}
|
143
|
+
alt="Hero"
|
144
|
+
className="db:inline tb:w-[90%] tb-l:w-[70%] db:w-[75%] w-full rounded-b-3xl"
|
145
|
+
/>
|
146
|
+
</div>
|
147
|
+
)}
|
148
|
+
</div>
|
149
|
+
)
|
150
|
+
}
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
</div>
|
154
|
+
{
|
155
|
+
scrollArrow && (
|
156
|
+
<div className=" hidden tb-l:block translate-y-[-20px]">
|
157
|
+
<div className="px-6 flex justify-center pb-16 animate-bounce h-6 grid-cols-3">
|
158
|
+
<svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
159
|
+
<g filter="url(#filter0_dd_1052_3729)">
|
160
|
+
<circle cx="30" cy="26" r="24" fill="white" />
|
161
|
+
<path d="M25 27L30 32L35 27M25 20L30 25L35 20" stroke="#1F2A37" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
162
|
+
</g>
|
163
|
+
<defs>
|
164
|
+
<filter id="filter0_dd_1052_3729" x="0" y="0" width="60" height="60" filterUnits="userSpaceOnUse" colorInterpolationFilters="sRGB">
|
165
|
+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
166
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
|
167
|
+
<feMorphology radius="2" operator="erode" in="SourceAlpha" result="effect1_dropShadow_1052_3729" />
|
168
|
+
<feOffset dy="2" />
|
169
|
+
<feGaussianBlur stdDeviation="2" />
|
170
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.109804 0 0 0 0 0.14902 0 0 0 0 0.247059 0 0 0 0.06 0" />
|
171
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1052_3729" />
|
172
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
|
173
|
+
<feMorphology radius="2" operator="erode" in="SourceAlpha" result="effect2_dropShadow_1052_3729" />
|
174
|
+
<feOffset dy="4" />
|
175
|
+
<feGaussianBlur stdDeviation="4" />
|
176
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.109804 0 0 0 0 0.14902 0 0 0 0 0.247059 0 0 0 0.1 0" />
|
177
|
+
<feBlend mode="normal" in2="effect1_dropShadow_1052_3729" result="effect2_dropShadow_1052_3729" />
|
178
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_1052_3729" result="shape" />
|
179
|
+
</filter>
|
180
|
+
</defs>
|
181
|
+
</svg>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
)
|
185
|
+
}
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
);
|
189
|
+
}
|
@@ -0,0 +1,198 @@
|
|
1
|
+
import { useState, useEffect } from "react";
|
2
|
+
import { Typography } from "../../foundation/Typography";
|
3
|
+
import { HDSButton } from "../Buttons";
|
4
|
+
import { HDSColor } from "../../foundation/ColorPalette";
|
5
|
+
import { Icon } from "../common-components";
|
6
|
+
import { LinkCard } from '../Cards/Link';
|
7
|
+
import { v4 as uuidv4 } from 'uuid';
|
8
|
+
|
9
|
+
export default function HeroSecondary({ heroData, logo, scrollArrow, fontSize }) {
|
10
|
+
const [valumeMuteIcon, setValumeMuteIcon] = useState("volumex");
|
11
|
+
const videoMute = () => {
|
12
|
+
if (heroData.video_url) {
|
13
|
+
const videoEle = document.getElementById("hero_vid");
|
14
|
+
if (videoEle?.muted) {
|
15
|
+
videoEle.muted = false;
|
16
|
+
setValumeMuteIcon("volumemax")
|
17
|
+
} else {
|
18
|
+
videoEle.muted = true;
|
19
|
+
setValumeMuteIcon("volumex")
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
const videoComponent = (heroData) => (
|
25
|
+
heroData.video_url ? (
|
26
|
+
<div className={"relative" + ((heroData.video_gradient_bg) ? "" : " p-4")}>
|
27
|
+
<div className="w-12 h-12 bg-neutral-0 rounded-full absolute right-8 bottom-8 shadow-md cursor-pointer z-[2] flex items-center justify-center" onClick={() => videoMute()}>
|
28
|
+
<Icon height={'w-6 h-6 stroke-neutral-800 stroke-[1.5px]'} variant={valumeMuteIcon} strokeColor="#1F2A37" />
|
29
|
+
</div>
|
30
|
+
<video
|
31
|
+
id="hero_vid"
|
32
|
+
controls={false}
|
33
|
+
// autoPlay
|
34
|
+
loop
|
35
|
+
muted
|
36
|
+
poster="https://res.cloudinary.com/dh8fp23nd/image/upload/v1683015500/hasura-con-2023/engage_clgotb.png"
|
37
|
+
className={"tb:w-full w-full " + ((heroData.video_gradient_bg) ? "" : " rounded-xl shadow-md")}
|
38
|
+
>
|
39
|
+
<source
|
40
|
+
src={heroData.video_url}
|
41
|
+
type="video/mp4"
|
42
|
+
/>
|
43
|
+
</video>
|
44
|
+
{
|
45
|
+
heroData.video_gradient_bg && (<div className={`tb-l:w-1/2 w-full h-1/2 tb:h-full absolute left-0 top-0 tb-l:ml-[-4px] tb-l:bg-gradient-to-r ${videoGradientBg} to-transparent bg-gradient-to-b tb:mt-[-4px] tb-l:mt-0`}></div>)
|
46
|
+
}
|
47
|
+
</div>
|
48
|
+
) : (
|
49
|
+
<div className="w-full"
|
50
|
+
variants={{
|
51
|
+
hidden: {
|
52
|
+
opacity: 0,
|
53
|
+
},
|
54
|
+
visible: {
|
55
|
+
opacity: 1,
|
56
|
+
transition: {
|
57
|
+
delay: .2,
|
58
|
+
duration: 1,
|
59
|
+
}
|
60
|
+
},
|
61
|
+
}}
|
62
|
+
>
|
63
|
+
{heroData.img_url && (
|
64
|
+
<div className="text-right pt-0 flex items-end justify-end h-full">
|
65
|
+
<img
|
66
|
+
src={heroData.img_url}
|
67
|
+
alt="Hero"
|
68
|
+
className="db:inline tb:w-[90%] tb-l:w-[70%] db:w-[75%] w-full rounded-b-3xl"
|
69
|
+
/>
|
70
|
+
</div>
|
71
|
+
)}
|
72
|
+
</div>
|
73
|
+
)
|
74
|
+
)
|
75
|
+
|
76
|
+
const title = () => (
|
77
|
+
heroData.title && (
|
78
|
+
<div
|
79
|
+
|
80
|
+
>
|
81
|
+
{
|
82
|
+
logo ? (
|
83
|
+
<div className={"pb-4 db:text-left text-center tb-l:text-left" + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}>
|
84
|
+
<img className="w-[290px] inline-block" src={logo} alt="Brand" />
|
85
|
+
</div>
|
86
|
+
) : (
|
87
|
+
<Typography textStyle={fontSize ? fontSize : "h1"} as="h1" className={"pb-2 text-center break-words db:text-left tb-l:text-left " + ((heroData.title_color) ? heroData.title_color : "") + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}>{heroData.title}</Typography>
|
88
|
+
)
|
89
|
+
}
|
90
|
+
</div>
|
91
|
+
)
|
92
|
+
)
|
93
|
+
|
94
|
+
const heroButton = () => (
|
95
|
+
heroData.buttons && (
|
96
|
+
<div className={" gap-2 flex items-center justify-center tb-l:justify-start db:justify-start pt-6" + ((heroData.video_url) ? " tb:justify-center" : " tb:justify-start")}>
|
97
|
+
{
|
98
|
+
heroData.buttons.map((btn, index) => (
|
99
|
+
<HDSButton
|
100
|
+
leftIconVariant='none'
|
101
|
+
rightIconVariant='none'
|
102
|
+
label={btn.cta_text}
|
103
|
+
state='default'
|
104
|
+
size='lg'
|
105
|
+
rightAnimatedArrow='true'
|
106
|
+
rightAnimatedArrowColor='#ffffff'
|
107
|
+
/>
|
108
|
+
))
|
109
|
+
}
|
110
|
+
</div>
|
111
|
+
)
|
112
|
+
)
|
113
|
+
|
114
|
+
const LinkCardsFn = (heroData) => {
|
115
|
+
return (
|
116
|
+
heroData.linkCards && (
|
117
|
+
<div className="flex mt-16 px-20 pb-20 gap-6 justify-center">
|
118
|
+
{heroData.linkCards.map((card) => (
|
119
|
+
<div key={uuidv4()} className="w-full">
|
120
|
+
<LinkCard
|
121
|
+
linkUrl={card.linkUrl}
|
122
|
+
cardBgColor={card.cardBgColor}
|
123
|
+
cardHoverBg={card.cardHoverBg}
|
124
|
+
iconVariant={card.iconVariant}
|
125
|
+
iconStrokeColor={card.iconStrokeColor}
|
126
|
+
iconArrowVariant={card.iconArrowVariant}
|
127
|
+
iconArrowStrokeColor={card.iconArrowStrokeColor}
|
128
|
+
title={card.title}
|
129
|
+
description={card.description}
|
130
|
+
/>
|
131
|
+
</div>
|
132
|
+
))}
|
133
|
+
</div>
|
134
|
+
)
|
135
|
+
);
|
136
|
+
};
|
137
|
+
|
138
|
+
const imageCard = (heroData) => (
|
139
|
+
heroData.imageUrl && (
|
140
|
+
<div className="px-20 py-20">
|
141
|
+
<img src={heroData.imageUrl} alt={heroData.imageAlt} />
|
142
|
+
</div>
|
143
|
+
)
|
144
|
+
)
|
145
|
+
|
146
|
+
const videoGradientBg = HDSColor(heroData.video_gradient_bg);
|
147
|
+
return (
|
148
|
+
<div className="db:pt-32 mb-10 db:mb-5 tb:mb-16 tb-l:mb-0">
|
149
|
+
<div className="tb:px-4">
|
150
|
+
<div className={"max-w-7xl mx-auto rounded-3xl overflow-hidden " + ((heroData.bg_color) ? heroData.bg_color : "")} >
|
151
|
+
<div className="w-full">
|
152
|
+
<div className={"db:flex db:w-full tb-l:flex block" + ((heroData.video_url) ? " tb:block" : " tb:flex")}>
|
153
|
+
<div className={"db:px-20 db:py-20 db:pr-0 tb-l:self-center tb-l:min-w-[400px] mx-auto db:ml-0 db:max-w-[625px] db:min-w-[625px] p-5 pt-10 z-[1] tb:p-16 tb-l:py-12" + ((heroData.video_url) ? " tb:max-w-[530px]" : " tb:ml-0 tb:max-w-[290px] tb:min-w-[310px] tb:pr-0")}
|
154
|
+
>
|
155
|
+
{
|
156
|
+
heroData.tag_line && (
|
157
|
+
<div
|
158
|
+
>
|
159
|
+
<Typography textStyle="h6" as="h6" className={"pb-2 uppercase text-center db:text-left font-normal tb-l:text-left " + ((heroData.tag_line_color) ? heroData.tag_line_color : "") + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}
|
160
|
+
>
|
161
|
+
{heroData.tag_line}
|
162
|
+
</Typography>
|
163
|
+
</div>
|
164
|
+
)
|
165
|
+
}
|
166
|
+
{title(heroData)}
|
167
|
+
{
|
168
|
+
heroData.sub_title && (
|
169
|
+
<Typography textStyle="sub1" className={"text-center db:text-left tb-l:text-left " + ((heroData.sub_title_color) ? heroData.sub_title_color : "") + ((heroData.video_url) ? " tb:text-center" : " tb:text-left")}>{heroData.sub_title}</Typography>
|
170
|
+
)
|
171
|
+
}
|
172
|
+
|
173
|
+
{
|
174
|
+
heroData.description && (
|
175
|
+
<Typography textStyle="sub2" className="text-center tb:text-left db:text-left tb-l:text-left text-blue-700 [&>*]:mb-8 last:[&>*]:mb-0">{heroData.description}</Typography>
|
176
|
+
)
|
177
|
+
}
|
178
|
+
{heroButton(heroData)}
|
179
|
+
|
180
|
+
|
181
|
+
</div>
|
182
|
+
{imageCard(heroData)}
|
183
|
+
</div>
|
184
|
+
|
185
|
+
{LinkCardsFn(heroData)}
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
{
|
190
|
+
scrollArrow && (
|
191
|
+
<>
|
192
|
+
</>
|
193
|
+
)
|
194
|
+
}
|
195
|
+
</div>
|
196
|
+
</div>
|
197
|
+
);
|
198
|
+
}
|
@@ -1,70 +1,70 @@
|
|
1
|
-
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import Prism from 'prismjs';
|
4
|
+
import 'prismjs/themes/prism.css';
|
5
|
+
import 'prismjs/components/prism-javascript';
|
2
6
|
|
3
|
-
|
4
|
-
// import 'prismjs/themes/prism.css';
|
5
|
-
// import 'prismjs/components/prism-javascript';
|
7
|
+
function CodeSnippetWithCopy({ snippet, filename, backgroundColor }) {
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
// snippet='as'
|
11
|
-
// }
|
9
|
+
if(!snippet){
|
10
|
+
snippet='as'
|
11
|
+
}
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
const [isCopied, setIsCopied] = useState(false);
|
14
|
+
const preRef = useRef(null);
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
async function copyToClipboard() {
|
17
|
+
try {
|
18
|
+
await navigator.clipboard.writeText(snippet);
|
19
|
+
setIsCopied(true);
|
20
|
+
setTimeout(() => setIsCopied(false), 1500);
|
21
|
+
} catch (error) {
|
22
|
+
console.error('Failed to copy to clipboard', error);
|
23
|
+
}
|
24
|
+
}
|
25
25
|
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
useEffect(() => {
|
28
|
+
console.log(snippet)
|
29
|
+
if (preRef.current ) {
|
30
|
+
Prism.highlightAll();
|
31
|
+
}
|
32
|
+
}, [snippet, preRef.current]);
|
33
33
|
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
const lines = snippet.split('\n');
|
36
|
+
const lineCount = lines.length;
|
37
|
+
if(snippet){}
|
38
|
+
return (
|
39
|
+
<div className={`${backgroundColor} border border-neutral-100 rounded relative`}>
|
40
|
+
{filename ? (
|
41
|
+
<span className='bg-neutral-100 flex p-2 text-sm-medium text-neutral-900'>{filename}</span>
|
42
|
+
) : null}
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
44
|
+
<div className='my-6 mx-10'>
|
45
|
+
<pre style={{ whiteSpace: 'pre-wrap' }} ref={preRef} className='line-numbers'>
|
46
|
+
{lines.map((line, index) => (
|
47
|
+
<code className='language-javascript' key={index}>
|
48
|
+
<span className='text-sm text-neutral-500 mr-4'>{index + 1} </span>
|
49
|
+
{line}
|
50
|
+
{index < lineCount - 1 ? '\n' : null}
|
51
|
+
</code>
|
52
|
+
))}
|
53
|
+
</pre>
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
55
|
+
<button
|
56
|
+
className='border border-neutral-400 button-sm absolute bottom-0 right-0 mb-4 mr-4'
|
57
|
+
onClick={copyToClipboard}
|
58
|
+
>
|
59
|
+
{isCopied ? 'Copied!' : 'Copy to Clipboard'}
|
60
|
+
</button>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
);
|
64
|
+
}
|
65
65
|
|
66
|
-
//
|
67
|
-
//
|
68
|
-
//
|
66
|
+
// CodeSnippetWithCopy.propTypes = {
|
67
|
+
// snippet: PropTypes.string.isRequired,
|
68
|
+
// };
|
69
69
|
|
70
|
-
|
70
|
+
export default CodeSnippetWithCopy;
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
export {default as CodeSnippet} from './CodeSnippet';
|
@@ -1 +1,2 @@
|
|
1
|
-
export {default as TableA} from './tableA';
|
1
|
+
export {default as TableA} from './tableA';
|
2
|
+
export {default as TableB} from './tableB';
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
3
|
+
import { Typography } from '../../foundation/Typography'
|
4
|
+
|
5
|
+
const test = (TABLE_HEADER) => (
|
6
|
+
console.log(TABLE_HEADER[0]['title']),
|
7
|
+
Object.keys(TABLE_HEADER[0]).map((key, value) => (
|
8
|
+
|
9
|
+
<th
|
10
|
+
key={key}
|
11
|
+
scope="col"
|
12
|
+
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:table-cell"
|
13
|
+
>
|
14
|
+
{key}
|
15
|
+
</th>
|
16
|
+
))
|
17
|
+
)
|
18
|
+
|
19
|
+
export default function TableB(props) {
|
20
|
+
const {
|
21
|
+
title,
|
22
|
+
description,
|
23
|
+
TABLE_VALUE,
|
24
|
+
TABLE_HEADER,
|
25
|
+
children
|
26
|
+
|
27
|
+
} = props;
|
28
|
+
test(TABLE_HEADER);
|
29
|
+
return (
|
30
|
+
<div className="px-4 sm:px-6 lg:px-8 ">
|
31
|
+
<div className="sm:flex sm:items-center ">
|
32
|
+
<div className="sm:flex-auto flex flex-col items-center">
|
33
|
+
{title && (
|
34
|
+
<Typography
|
35
|
+
textStyle='h2'>
|
36
|
+
{title}
|
37
|
+
</Typography>
|
38
|
+
)
|
39
|
+
}
|
40
|
+
{description && (
|
41
|
+
<Typography
|
42
|
+
textStyle='body1c'>
|
43
|
+
{description}
|
44
|
+
</Typography>
|
45
|
+
)
|
46
|
+
}
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div>
|
51
|
+
<div className="-mx-4 mt-8 sm:-mx-0">
|
52
|
+
<table className="min-w-full divide-y divide-gray-300 border">
|
53
|
+
<thead>
|
54
|
+
<tr>
|
55
|
+
{Object.keys(TABLE_HEADER[0]).map((key, value) => (
|
56
|
+
<th
|
57
|
+
key={key}
|
58
|
+
scope="col"
|
59
|
+
className="px-3 py-3.5 text-left text-sm font-semibold text-gray-900 sm:table-cell"
|
60
|
+
>
|
61
|
+
{}
|
62
|
+
</th>
|
63
|
+
))}
|
64
|
+
</tr>
|
65
|
+
</thead>
|
66
|
+
<tbody className="divide-y divide-gray-200 bg-white">
|
67
|
+
{TABLE_VALUE.map((value) => (
|
68
|
+
<tr key={uuidv4()}>
|
69
|
+
{Object.keys(value).map((key) => (
|
70
|
+
<td
|
71
|
+
key={uuidv4()}
|
72
|
+
className=" py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-3"
|
73
|
+
>
|
74
|
+
{``}{value[key]}
|
75
|
+
|
76
|
+
</td>
|
77
|
+
))}
|
78
|
+
</tr>
|
79
|
+
))}
|
80
|
+
</tbody>
|
81
|
+
</table>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
)
|
86
|
+
}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import {HDSColor} from '../../../foundation/ColorPalette';
|
2
3
|
import PropTypes from 'prop-types';
|
4
|
+
import {ReactComponent as HasuraPrimaryIcon } from "../../../assets/icons/HasuraPrimary.svg"
|
3
5
|
import {ReactComponent as ClockrewindIcon } from "../../../assets/icons/clock-rewind.svg"
|
4
6
|
import {ReactComponent as PassportIcon } from "../../../assets/icons/passport.svg"
|
5
7
|
import {ReactComponent as Compass02Icon } from "../../../assets/icons/compass-02.svg"
|
@@ -1175,6 +1177,7 @@ import {ReactComponent as Minus01Icon } from "../../../assets/icons/minus-01.svg
|
|
1175
1177
|
import {ReactComponent as HasuraIcon } from "../../../assets/icons/hasura.svg"
|
1176
1178
|
|
1177
1179
|
const iconReferenceMap = {
|
1180
|
+
hasuraPrimary: HasuraPrimaryIcon,
|
1178
1181
|
hasura: HasuraIcon,
|
1179
1182
|
minus01: Minus01Icon,
|
1180
1183
|
clockrewind: ClockrewindIcon,
|
@@ -2349,12 +2352,13 @@ const iconReferenceMap = {
|
|
2349
2352
|
home03: Home03Icon,
|
2350
2353
|
HasuraBlueLogo: HasuraBlueLogoIcon,
|
2351
2354
|
};
|
2352
|
-
export default function Icon ({ variant, height, strokeColor, className }){
|
2355
|
+
export default function Icon ({ variant, height, strokeColor, strokeClass, className }){
|
2353
2356
|
const CurrentActiveIcon = iconReferenceMap[variant];
|
2357
|
+
const IconStrokeCLass = HDSColor(strokeClass);
|
2354
2358
|
return (
|
2355
2359
|
<div style={{ stroke: `${strokeColor}` }}>
|
2356
2360
|
<CurrentActiveIcon
|
2357
|
-
className={[`${height}`,
|
2361
|
+
className={[`${height}`, `${IconStrokeCLass}`, `${className}` ].join(' ')}
|
2358
2362
|
/>
|
2359
2363
|
</div>
|
2360
2364
|
);
|
@@ -2362,4 +2366,9 @@ export default function Icon ({ variant, height, strokeColor, className }){
|
|
2362
2366
|
Icon.propTypes = {
|
2363
2367
|
fillColor: PropTypes.string,
|
2364
2368
|
strokeColor: PropTypes.string,
|
2369
|
+
};
|
2370
|
+
|
2371
|
+
Icon.defaultProps = {
|
2372
|
+
strokeClass: 'stroke-neutral-0',
|
2373
|
+
height: 'h-6 w-6'
|
2365
2374
|
};
|