hds-web 1.18.8 → 1.18.9
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
@@ -0,0 +1,50 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Typography } from "../../../foundation/Typography";
|
3
|
+
import { HDSColor } from "../../../foundation/ColorPalette";
|
4
|
+
import { Icon } from '../../../components/common-components/Icon';
|
5
|
+
|
6
|
+
const tagColorVariants = {
|
7
|
+
blue: 'bg-neutral-0 tb:bg-blue-500 text-blue-500 tb:text-neutral-0',
|
8
|
+
purple: 'bg-neutral-0 tb:bg-purple-500 text-purple-500 tb:text-neutral-0',
|
9
|
+
pink: 'bg-neutral-0 tb:bg-pink-500 text-pink-500 tb:text-neutral-0',
|
10
|
+
amber: 'bg-neutral-0 tb:bg-amber-500 text-amber-500 tb:text-neutral-0',
|
11
|
+
cyan: 'bg-neutral-0 tb:bg-cyan-500 text-cyan-500 tb:text-neutral-0',
|
12
|
+
green: 'bg-neutral-0 tb:bg-green-500 text-green-500 tb:text-neutral-0',
|
13
|
+
}
|
14
|
+
|
15
|
+
export default function AnnouncementMd(props) {
|
16
|
+
const [isBannerActive, toggleBanner] = useState(true);
|
17
|
+
const bgClass = props.bgColorClass ? HDSColor(props.bgColorClass) : 'bg-neutral-0';
|
18
|
+
const linkTextClass = props.linkTextColorClass ? HDSColor(props.linkTextColorClass) : 'text-neutral-600';
|
19
|
+
const tagClass = props.tagColor ? props.tagColor : 'purple';
|
20
|
+
if (isBannerActive) {
|
21
|
+
return (
|
22
|
+
<div className={`${bgClass} flex my-6 justify-between relative rounded-2xl tb:rounded-full shadow p-4 tb:justify-center items-center`}>
|
23
|
+
<div className="block items-center tb:flex tb:justify-center">
|
24
|
+
{
|
25
|
+
props.brandImg && (
|
26
|
+
<div className="pl-3 tb:pl-14">
|
27
|
+
<img className="max-h-[34px]" src={props.brandImg} alt={props.brandImgAlt} />
|
28
|
+
</div>
|
29
|
+
)
|
30
|
+
}
|
31
|
+
{
|
32
|
+
props.tagText && (
|
33
|
+
<Typography textStyle="body2-medium" className={`inline-flex py-1 px-3 ml-0 tb:ml-14 tb-m:ml-6 rounded-full mr-4 min-w-fit ${tagColorVariants[tagClass]}`}>{props.tagText}</Typography>
|
34
|
+
)
|
35
|
+
}
|
36
|
+
<a href={props.linkUrl} className="px-3 block tb:px-0 pb-1 tb:pb-0">
|
37
|
+
<Typography textStyle="body2-medium" className={`${linkTextClass} group flex items-center [&>div]:inline-block`}>
|
38
|
+
{props.linkText}
|
39
|
+
<Icon height={'block w-6 h-6 stroke-[2px] ml-3 transition ease-in-out group-hover:translate-x-[5px]'} variant='arrownarrowright' strokeClass='stroke-blue-500' />
|
40
|
+
</Typography>
|
41
|
+
</a>
|
42
|
+
</div>
|
43
|
+
<div className=" static mx-3 tb:mx-0 tb:absolute top-1/2 tb:-translate-y-1/2 tb:left-6 cursor-pointer w-8 min-w-[32px] h-8 rounded-full bg-neutral-100 flex items-center justify-center" onClick={()=>toggleBanner(false)}>
|
44
|
+
<Icon height={'block w-6 h-6 stroke-[2px] transition ease-in-out'} variant='xclose' strokeClass='stroke-neutral-800' />
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
)
|
48
|
+
}
|
49
|
+
return null;
|
50
|
+
}
|
@@ -1 +1,2 @@
|
|
1
|
-
export {default as AnnouncementSM} from './announcementSm';
|
1
|
+
export {default as AnnouncementSM} from './announcementSm';
|
2
|
+
export {default as AnnouncementMd} from './announcementMd';
|