@nuskin/foundation-ui-components 1.31.0 → 1.32.1-cdb-1.1
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 +2 -2
- package/src/common/autocomplete/NsAutocomplete.tsx +9 -2
- package/src/common/card/NsAwardCard.tsx +5 -3
- package/src/common/card/NsBrandCard.tsx +3 -1
- package/src/common/card/NsCheckoutCard.tsx +22 -8
- package/src/common/card/NsHeroCardLevel1.tsx +10 -2
- package/src/common/card/NsHeroCardLevel2.tsx +13 -5
- package/src/common/card/NsIconText.tsx +12 -5
- package/src/common/card/NsLargeCard.tsx +11 -3
- package/src/common/card/NsMediumCard.tsx +10 -2
- package/src/common/card/NsPost.tsx +9 -8
- package/src/common/card/NsSmallFullCard.tsx +17 -9
- package/src/common/card/NsXLargeCard.tsx +12 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/foundation-ui-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.1-cdb-1.1",
|
|
4
4
|
"description": "It is a foundation library written in react, that provides common components to all UI pages",
|
|
5
5
|
"main": "src/common/index.ts",
|
|
6
6
|
"repository": {
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"@types/react-dom": "^18.2.0",
|
|
52
52
|
"cliui": "^8.0.1",
|
|
53
53
|
"framer-motion": "^10.16.4",
|
|
54
|
-
"next": "13.5.6",
|
|
55
54
|
"notistack": "^3.0.1",
|
|
56
55
|
"react": "^18.2.0",
|
|
57
56
|
"react-dom": "^18.2.0",
|
|
@@ -67,6 +66,7 @@
|
|
|
67
66
|
"@babel/preset-react": "^7.22.15",
|
|
68
67
|
"@babel/preset-typescript": "^7.23.2",
|
|
69
68
|
"@emotion/jest": "^11.11.0",
|
|
69
|
+
"next": "13.5.6",
|
|
70
70
|
"@nuskin/eslint-config": "^1.0.0-setup.1",
|
|
71
71
|
"@storybook/addon-actions": "^7.5.1",
|
|
72
72
|
"@storybook/addon-essentials": "^7.5.1",
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React, { PropsWithChildren, ReactElement, useEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Autocomplete,
|
|
5
|
+
AutocompleteRenderInputParams,
|
|
6
|
+
ListSubheader,
|
|
7
|
+
Popper,
|
|
8
|
+
useMediaQuery,
|
|
9
|
+
useTheme,
|
|
10
|
+
} from '@mui/material';
|
|
4
11
|
|
|
5
12
|
import { LineLoader } from './helper/LineLoader';
|
|
6
13
|
import { RecentClearAll } from './helper/RecentClearAll';
|
|
@@ -33,7 +40,7 @@ const NsAutocomplete = ({
|
|
|
33
40
|
value,
|
|
34
41
|
isFilterEnabled = true,
|
|
35
42
|
fullWidth,
|
|
36
|
-
onKeypress
|
|
43
|
+
onKeypress,
|
|
37
44
|
}: PropsWithChildren<NsAutocompleteProps>): ReactElement => {
|
|
38
45
|
const listboxRef = useRef<any | null>(null);
|
|
39
46
|
const [scrollTopPosition, setScrollTopPosition] = useState(0);
|
|
@@ -13,6 +13,7 @@ type NsAwardCardProps = {
|
|
|
13
13
|
mediaOutlet: string;
|
|
14
14
|
backgroundImageDetail: BynderImageDataType;
|
|
15
15
|
className?: string;
|
|
16
|
+
fontColor?: 'primary' | 'secondary';
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
const CardContainer = styled(Box)`
|
|
@@ -49,18 +50,19 @@ export default function NsAwardCard({
|
|
|
49
50
|
mediaOutlet,
|
|
50
51
|
backgroundImageDetail,
|
|
51
52
|
className,
|
|
53
|
+
fontColor,
|
|
52
54
|
}: NsAwardCardProps): ReactElement {
|
|
53
55
|
return (
|
|
54
56
|
<CardContainer className={className} role="award-card" component="div" data-testid="award-card">
|
|
55
57
|
<BynderMedia className="image" imageDetail={backgroundImageDetail} />
|
|
56
58
|
<div className="content">
|
|
57
|
-
<NsTypography weight="normal" className="title" variant="h5">
|
|
59
|
+
<NsTypography weight="normal" className="title" variant="h5" color={fontColor}>
|
|
58
60
|
{title}
|
|
59
61
|
</NsTypography>
|
|
60
|
-
<NsTypography className="content-text" variant="body-l">
|
|
62
|
+
<NsTypography className="content-text" variant="body-l" color={fontColor}>
|
|
61
63
|
{awardName}
|
|
62
64
|
</NsTypography>
|
|
63
|
-
<NsTypography className="content-text" variant="body-l">
|
|
65
|
+
<NsTypography className="content-text" variant="body-l" color={fontColor}>
|
|
64
66
|
{mediaOutlet}
|
|
65
67
|
</NsTypography>
|
|
66
68
|
</div>
|
|
@@ -18,6 +18,7 @@ type NsBrandCardProps = {
|
|
|
18
18
|
size?: 'small' | 'large';
|
|
19
19
|
button?: NsCardButton;
|
|
20
20
|
className?: string;
|
|
21
|
+
fontColor?: 'primary' | 'secondary';
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const CardContainer = styled((props: any) => <Box {...props} />)(({ size }) => {
|
|
@@ -67,6 +68,7 @@ export default function NsBrandCard({
|
|
|
67
68
|
button,
|
|
68
69
|
size,
|
|
69
70
|
className,
|
|
71
|
+
fontColor,
|
|
70
72
|
}: NsBrandCardProps): ReactElement {
|
|
71
73
|
return (
|
|
72
74
|
<CardContainer className={className} role="brand-card" component="div" data-testid="brand-card" size={size}>
|
|
@@ -76,7 +78,7 @@ export default function NsBrandCard({
|
|
|
76
78
|
</NsBrandWrapper>
|
|
77
79
|
</NsBgCard>
|
|
78
80
|
{title ? (
|
|
79
|
-
<NsTypography variant="h3" className="brand-title">
|
|
81
|
+
<NsTypography variant="h3" className="brand-title" color={fontColor}>
|
|
80
82
|
{title}
|
|
81
83
|
</NsTypography>
|
|
82
84
|
) : null}
|
|
@@ -11,6 +11,7 @@ type NsCheckoutCardProps = {
|
|
|
11
11
|
linkText: string;
|
|
12
12
|
url: string;
|
|
13
13
|
className?: string;
|
|
14
|
+
fontColor?: 'primary' | 'secondary';
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
const CardContainer = styled(Box)`
|
|
@@ -18,12 +19,12 @@ const CardContainer = styled(Box)`
|
|
|
18
19
|
display: flex;
|
|
19
20
|
max-width: 345px;
|
|
20
21
|
height: auto;
|
|
21
|
-
border: 2px solid #
|
|
22
|
+
border: 2px solid #b2b2b2;
|
|
22
23
|
border-radius: 2px;
|
|
23
24
|
.left-bar {
|
|
24
25
|
width: 4px;
|
|
25
26
|
height: auto;
|
|
26
|
-
background-color: #
|
|
27
|
+
background-color: #22d55c;
|
|
27
28
|
}
|
|
28
29
|
.content {
|
|
29
30
|
display: flex;
|
|
@@ -44,7 +45,7 @@ const CardContainer = styled(Box)`
|
|
|
44
45
|
font-weight: 400;
|
|
45
46
|
}
|
|
46
47
|
.action-link {
|
|
47
|
-
color: #
|
|
48
|
+
color: #7123d9;
|
|
48
49
|
font-size: 14px;
|
|
49
50
|
font-weight: 700;
|
|
50
51
|
letter-spacing: 0.7;
|
|
@@ -57,9 +58,22 @@ const CardContainer = styled(Box)`
|
|
|
57
58
|
cursor: pointer;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
61
|
+
.primary {
|
|
62
|
+
color: #fff;
|
|
63
|
+
}
|
|
64
|
+
.secondary {
|
|
65
|
+
color: #000;
|
|
66
|
+
}
|
|
60
67
|
`;
|
|
61
|
-
|
|
62
|
-
export default function NsCheckoutCard({
|
|
68
|
+
|
|
69
|
+
export default function NsCheckoutCard({
|
|
70
|
+
title,
|
|
71
|
+
icon,
|
|
72
|
+
linkText,
|
|
73
|
+
url,
|
|
74
|
+
className,
|
|
75
|
+
fontColor,
|
|
76
|
+
}: NsCheckoutCardProps): ReactElement {
|
|
63
77
|
const [dropdownIcon, setDropdownIcon] = useState(false);
|
|
64
78
|
const handleClick = () => {
|
|
65
79
|
setDropdownIcon(!dropdownIcon);
|
|
@@ -73,9 +87,9 @@ export default function NsCheckoutCard({ title, icon, linkText, url, className }
|
|
|
73
87
|
<NsIcon name={icon} />
|
|
74
88
|
</span>
|
|
75
89
|
<div className="text-content">
|
|
76
|
-
<article className=
|
|
77
|
-
<article className=
|
|
78
|
-
<NsLink className=
|
|
90
|
+
<article className={`title ${fontColor}`}>{title}</article>
|
|
91
|
+
<article className={`address ${fontColor}`}>Address</article>
|
|
92
|
+
<NsLink className={`action-link ${fontColor}`} href={url}>
|
|
79
93
|
{linkText}
|
|
80
94
|
</NsLink>
|
|
81
95
|
</div>
|
|
@@ -15,6 +15,7 @@ type NsHeroCardLevel1Props = {
|
|
|
15
15
|
button?: NsCardButton;
|
|
16
16
|
className?: string;
|
|
17
17
|
imagePosition?: 'top' | 'bottom';
|
|
18
|
+
fontColor?: 'primary' | 'secondary';
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const CardContainer = styled((props: any) => <Box {...props} />)(({ imagePosition }) => {
|
|
@@ -54,6 +55,12 @@ const CardContainer = styled((props: any) => <Box {...props} />)(({ imagePositio
|
|
|
54
55
|
fontSize: '18px',
|
|
55
56
|
marginBottom: '20px',
|
|
56
57
|
},
|
|
58
|
+
'.primary': {
|
|
59
|
+
color: '#fff',
|
|
60
|
+
},
|
|
61
|
+
'.secondary': {
|
|
62
|
+
color: '#000',
|
|
63
|
+
},
|
|
57
64
|
'.action-link': {
|
|
58
65
|
marginTop: '10px',
|
|
59
66
|
},
|
|
@@ -83,13 +90,14 @@ export default function NsHeroCardLevel1({
|
|
|
83
90
|
button,
|
|
84
91
|
className,
|
|
85
92
|
imagePosition = 'top',
|
|
93
|
+
fontColor,
|
|
86
94
|
}: NsHeroCardLevel1Props): ReactElement {
|
|
87
95
|
return (
|
|
88
96
|
<CardContainer className={className} data-testid="hero-card-level-1" imagePosition={imagePosition}>
|
|
89
97
|
<BynderMedia className="bg-image" imageDetail={backgroundImageDetail} />
|
|
90
98
|
<div className="content">
|
|
91
|
-
<article className=
|
|
92
|
-
<article className=
|
|
99
|
+
<article className={`body-title ${fontColor}`}>{cardTitle}</article>
|
|
100
|
+
<article className={`body-text ${fontColor}`}>{cardDescription}</article>
|
|
93
101
|
{button ? <CardButton {...button} /> : null}
|
|
94
102
|
</div>
|
|
95
103
|
</CardContainer>
|
|
@@ -15,6 +15,7 @@ type NsHeroCardLevel2Props = {
|
|
|
15
15
|
backgroundImageDetail: BynderImageDataType;
|
|
16
16
|
button?: NsCardButton;
|
|
17
17
|
className?: string;
|
|
18
|
+
fontColor?: 'primary' | 'secondary';
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const CardContainer = styled(Box)`
|
|
@@ -55,12 +56,18 @@ const CardContainer = styled(Box)`
|
|
|
55
56
|
font-weight: 700;
|
|
56
57
|
margin-bottom: 5px;
|
|
57
58
|
}
|
|
58
|
-
|
|
59
|
+
.primary {
|
|
60
|
+
color: #fff;
|
|
61
|
+
}
|
|
62
|
+
.secondary {
|
|
63
|
+
color: #000;
|
|
64
|
+
}
|
|
65
|
+
@media (max-width: 768px) {
|
|
59
66
|
.content {
|
|
60
67
|
padding: 5%;
|
|
61
68
|
}
|
|
62
69
|
}
|
|
63
|
-
|
|
70
|
+
`;
|
|
64
71
|
|
|
65
72
|
const NsHeroCardLevel2 = ({
|
|
66
73
|
brandName,
|
|
@@ -69,16 +76,17 @@ const NsHeroCardLevel2 = ({
|
|
|
69
76
|
backgroundImageDetail,
|
|
70
77
|
button,
|
|
71
78
|
className,
|
|
79
|
+
fontColor,
|
|
72
80
|
}: NsHeroCardLevel2Props): ReactElement => {
|
|
73
81
|
return (
|
|
74
82
|
<CardContainer className={className} data-testid="hero-card-level-2">
|
|
75
83
|
<BynderMedia className="bg-image" imageDetail={backgroundImageDetail} />
|
|
76
84
|
<div className="content">
|
|
77
85
|
<div className="brand-container">
|
|
78
|
-
<article>{brandName}</article>
|
|
86
|
+
<article className={fontColor}>{brandName}</article>
|
|
79
87
|
</div>
|
|
80
|
-
<article className=
|
|
81
|
-
<article className=
|
|
88
|
+
<article className={`body-title ${fontColor}`}>{cardTitle}</article>
|
|
89
|
+
<article className={`body-text ${fontColor}`}>{cardDescription}</article>
|
|
82
90
|
<div>{button ? <CardButton {...button} /> : null}</div>
|
|
83
91
|
</div>
|
|
84
92
|
</CardContainer>
|
|
@@ -7,6 +7,7 @@ type NsIconTextProps = {
|
|
|
7
7
|
text: string;
|
|
8
8
|
body: string;
|
|
9
9
|
className?: string;
|
|
10
|
+
fontColor?: 'primary' | 'secondary';
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
const CardContainer = styled(Box)`
|
|
@@ -18,7 +19,7 @@ const CardContainer = styled(Box)`
|
|
|
18
19
|
overflow: hidden;
|
|
19
20
|
height: auto;
|
|
20
21
|
max-width: 222px;
|
|
21
|
-
background-color: #
|
|
22
|
+
background-color: #f5f5f5;
|
|
22
23
|
padding: 20px;
|
|
23
24
|
justify-content: center;
|
|
24
25
|
gap: 30px;
|
|
@@ -29,7 +30,7 @@ const CardContainer = styled(Box)`
|
|
|
29
30
|
.divider {
|
|
30
31
|
width: 182px;
|
|
31
32
|
height: 1px;
|
|
32
|
-
background: #
|
|
33
|
+
background: #b2b2b2;
|
|
33
34
|
}
|
|
34
35
|
.title {
|
|
35
36
|
font-size: 26px;
|
|
@@ -40,6 +41,12 @@ const CardContainer = styled(Box)`
|
|
|
40
41
|
font-weight: 400;
|
|
41
42
|
font-size: 14px;
|
|
42
43
|
}
|
|
44
|
+
.primary {
|
|
45
|
+
color: #fff;
|
|
46
|
+
}
|
|
47
|
+
.secondary {
|
|
48
|
+
color: #000;
|
|
49
|
+
}
|
|
43
50
|
`;
|
|
44
51
|
|
|
45
52
|
const Icon = (): ReactElement => {
|
|
@@ -145,13 +152,13 @@ const Icon = (): ReactElement => {
|
|
|
145
152
|
</div>
|
|
146
153
|
);
|
|
147
154
|
};
|
|
148
|
-
const NsIconText = ({ text, body, className }: NsIconTextProps) => {
|
|
155
|
+
const NsIconText = ({ text, body, className, fontColor }: NsIconTextProps) => {
|
|
149
156
|
return (
|
|
150
157
|
<CardContainer className={className} data-testid="icon-text-card">
|
|
151
158
|
<Icon />
|
|
152
|
-
<article className=
|
|
159
|
+
<article className={`title ${fontColor}`}>{text}</article>
|
|
153
160
|
<div className="divider"></div>
|
|
154
|
-
<article className=
|
|
161
|
+
<article className={`text ${fontColor}`}>{body}</article>
|
|
155
162
|
</CardContainer>
|
|
156
163
|
);
|
|
157
164
|
};
|
|
@@ -16,6 +16,7 @@ type NsLargeCardProps = {
|
|
|
16
16
|
isHorizontal?: boolean;
|
|
17
17
|
button?: NsCardButton;
|
|
18
18
|
className?: string;
|
|
19
|
+
fontColor?: 'primary' | 'secondary';
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
const CardContainer = styled((props: any) => <Box {...props} />)(({ isHorizontal, matches }) => {
|
|
@@ -62,6 +63,12 @@ const CardContainer = styled((props: any) => <Box {...props} />)(({ isHorizontal
|
|
|
62
63
|
fontWeight: '400',
|
|
63
64
|
marginTop: '10px',
|
|
64
65
|
},
|
|
66
|
+
'.primary': {
|
|
67
|
+
color: '#fff',
|
|
68
|
+
},
|
|
69
|
+
'.secondary': {
|
|
70
|
+
color: '#000',
|
|
71
|
+
},
|
|
65
72
|
'.cta': {
|
|
66
73
|
marginTop: '10px',
|
|
67
74
|
},
|
|
@@ -79,6 +86,7 @@ export default function NsLargeCard({
|
|
|
79
86
|
isHorizontal,
|
|
80
87
|
button,
|
|
81
88
|
className,
|
|
89
|
+
fontColor,
|
|
82
90
|
}: NsLargeCardProps): ReactElement {
|
|
83
91
|
return (
|
|
84
92
|
<CardContainer
|
|
@@ -90,9 +98,9 @@ export default function NsLargeCard({
|
|
|
90
98
|
>
|
|
91
99
|
<BynderMedia className="bg-image" imageDetail={backgroundImageDetail} />
|
|
92
100
|
<div className="content">
|
|
93
|
-
<article className=
|
|
94
|
-
<article className=
|
|
95
|
-
<article className=
|
|
101
|
+
<article className={`subtitle ${fontColor}`}>{subtitle}</article>
|
|
102
|
+
<article className={`title ${fontColor}`}>{title}</article>
|
|
103
|
+
<article className={`subtitle ${fontColor}`}>{intro}</article>
|
|
96
104
|
{button ? <CardButton {...button} /> : null}
|
|
97
105
|
</div>
|
|
98
106
|
</CardContainer>
|
|
@@ -18,6 +18,7 @@ type NsMediumCardProps = {
|
|
|
18
18
|
className?: string;
|
|
19
19
|
fluid?: boolean;
|
|
20
20
|
showArrowWithButtonText?: boolean;
|
|
21
|
+
fontColor?: 'primary' | 'secondary';
|
|
21
22
|
};
|
|
22
23
|
const textVariantButton = {
|
|
23
24
|
padding: '0 0 4px',
|
|
@@ -63,6 +64,12 @@ const CardContainer = styled(Box)<{ fluid: boolean; variant: string }>(({ fluid,
|
|
|
63
64
|
fontSize: '20px',
|
|
64
65
|
marginTop: '10px',
|
|
65
66
|
},
|
|
67
|
+
'.primary': {
|
|
68
|
+
color: '#fff',
|
|
69
|
+
},
|
|
70
|
+
'.secondary': {
|
|
71
|
+
color: '#000',
|
|
72
|
+
},
|
|
66
73
|
'.cta': {
|
|
67
74
|
marginTop: 'auto',
|
|
68
75
|
...textVariantCssModification,
|
|
@@ -79,6 +86,7 @@ export default function NsMediumCard({
|
|
|
79
86
|
className,
|
|
80
87
|
fluid,
|
|
81
88
|
showArrowWithButtonText = false,
|
|
89
|
+
fontColor,
|
|
82
90
|
}: NsMediumCardProps): ReactElement {
|
|
83
91
|
return (
|
|
84
92
|
<CardContainer
|
|
@@ -91,10 +99,10 @@ export default function NsMediumCard({
|
|
|
91
99
|
>
|
|
92
100
|
<BynderMedia className="image" imageDetail={backgroundImageDetail} />
|
|
93
101
|
<div className="content">
|
|
94
|
-
<NsTypography variant="h5" color=
|
|
102
|
+
<NsTypography variant="h5" color={fontColor} className="title" weight={titleFontWeight}>
|
|
95
103
|
{title}
|
|
96
104
|
</NsTypography>
|
|
97
|
-
<article className=
|
|
105
|
+
<article className={`subtitle mt-3 mb-5 ${fontColor}`}>{subtitle}</article>
|
|
98
106
|
{button ? <CardButton {...button} showArrowWithText={showArrowWithButtonText} /> : null}
|
|
99
107
|
</div>
|
|
100
108
|
</CardContainer>
|
|
@@ -11,6 +11,7 @@ type NsPostProps = {
|
|
|
11
11
|
body: string;
|
|
12
12
|
backgroundImageDetail: BynderImageDataType;
|
|
13
13
|
className?: string;
|
|
14
|
+
fontColor?: 'primary' | 'secondary';
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
const CardContainer = styled(Box)`
|
|
@@ -26,7 +27,7 @@ const CardContainer = styled(Box)`
|
|
|
26
27
|
.image {
|
|
27
28
|
height: 180px;
|
|
28
29
|
overflow: hidden;
|
|
29
|
-
object-fit: contain
|
|
30
|
+
object-fit: contain;
|
|
30
31
|
}
|
|
31
32
|
.content {
|
|
32
33
|
padding: 20px;
|
|
@@ -34,7 +35,7 @@ const CardContainer = styled(Box)`
|
|
|
34
35
|
flex-direction: column;
|
|
35
36
|
min-height: 92px;
|
|
36
37
|
max-height: 92px;
|
|
37
|
-
justify-content: space-around
|
|
38
|
+
justify-content: space-around;
|
|
38
39
|
}
|
|
39
40
|
.body-title {
|
|
40
41
|
font-size: 18px;
|
|
@@ -44,7 +45,7 @@ const CardContainer = styled(Box)`
|
|
|
44
45
|
-webkit-line-clamp: 1;
|
|
45
46
|
overflow: hidden;
|
|
46
47
|
text-overflow: ellipsis;
|
|
47
|
-
margin: 0
|
|
48
|
+
margin: 0;
|
|
48
49
|
}
|
|
49
50
|
.body-text {
|
|
50
51
|
font-size: 12px;
|
|
@@ -54,20 +55,20 @@ const CardContainer = styled(Box)`
|
|
|
54
55
|
-webkit-line-clamp: 1;
|
|
55
56
|
overflow: hidden;
|
|
56
57
|
text-overflow: ellipsis;
|
|
57
|
-
color: #
|
|
58
|
-
margin: 0
|
|
58
|
+
color: #8c8c8c;
|
|
59
|
+
margin: 0;
|
|
59
60
|
}
|
|
60
61
|
`;
|
|
61
62
|
|
|
62
|
-
const NsPost = ({ text, body, backgroundImageDetail, className }: NsPostProps): ReactElement => {
|
|
63
|
+
const NsPost = ({ text, body, backgroundImageDetail, className, fontColor }: NsPostProps): ReactElement => {
|
|
63
64
|
return (
|
|
64
65
|
<CardContainer className={className} data-testid="post-card">
|
|
65
66
|
<BynderMedia className="image" imageDetail={backgroundImageDetail} />
|
|
66
67
|
<article className="content">
|
|
67
|
-
<h2 className=
|
|
68
|
+
<h2 className={`body-title ${fontColor}`} title={text}>
|
|
68
69
|
{text}
|
|
69
70
|
</h2>
|
|
70
|
-
<p className=
|
|
71
|
+
<p className={`body-text ${fontColor}`} title={body?.substring(0, 80)}>
|
|
71
72
|
{body}
|
|
72
73
|
</p>
|
|
73
74
|
</article>
|
|
@@ -14,6 +14,7 @@ type NsSmallFullCardProps = {
|
|
|
14
14
|
backgroundImageDetail: BynderImageDataType;
|
|
15
15
|
button?: NsCardButton;
|
|
16
16
|
className?: string;
|
|
17
|
+
fontColor?: 'primary' | 'secondary';
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
const CardContainer = styled(Box)`
|
|
@@ -26,7 +27,7 @@ const CardContainer = styled(Box)`
|
|
|
26
27
|
.image {
|
|
27
28
|
width: 100%;
|
|
28
29
|
height: 100%;
|
|
29
|
-
object-fit: cover
|
|
30
|
+
object-fit: cover;
|
|
30
31
|
}
|
|
31
32
|
.gradientOverlay {
|
|
32
33
|
position: absolute;
|
|
@@ -34,7 +35,7 @@ const CardContainer = styled(Box)`
|
|
|
34
35
|
left: 0;
|
|
35
36
|
width: 100%;
|
|
36
37
|
height: 100%;
|
|
37
|
-
background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
|
|
38
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
|
|
38
39
|
}
|
|
39
40
|
.content {
|
|
40
41
|
position: absolute;
|
|
@@ -42,27 +43,33 @@ const CardContainer = styled(Box)`
|
|
|
42
43
|
width: 100%;
|
|
43
44
|
padding: 40px 40px 25px 30px;
|
|
44
45
|
display: flex;
|
|
45
|
-
flex-direction: column
|
|
46
|
+
flex-direction: column;
|
|
46
47
|
}
|
|
47
48
|
.subtitle {
|
|
48
49
|
color: #fff;
|
|
49
50
|
font-size: 11px;
|
|
50
51
|
font-weight: 400;
|
|
51
|
-
margin-top: auto
|
|
52
|
+
margin-top: auto;
|
|
52
53
|
}
|
|
53
54
|
.title {
|
|
54
55
|
color: #fff;
|
|
55
56
|
font-size: 26px;
|
|
56
57
|
font-weight: 400;
|
|
57
|
-
margin-top: 20px
|
|
58
|
+
margin-top: 20px;
|
|
58
59
|
}
|
|
59
60
|
.cta {
|
|
60
61
|
margin-top: 20px;
|
|
61
62
|
max-width: 208px;
|
|
62
63
|
border-radius: 4px;
|
|
63
|
-
overflow: hidden
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
}
|
|
66
|
+
.primary {
|
|
67
|
+
color: #fff;
|
|
68
|
+
}
|
|
69
|
+
.secondary {
|
|
70
|
+
color: #000;
|
|
64
71
|
}
|
|
65
|
-
|
|
72
|
+
`;
|
|
66
73
|
|
|
67
74
|
export default function NsSmallFullCard({
|
|
68
75
|
title,
|
|
@@ -70,14 +77,15 @@ export default function NsSmallFullCard({
|
|
|
70
77
|
backgroundImageDetail,
|
|
71
78
|
button,
|
|
72
79
|
className,
|
|
80
|
+
fontColor,
|
|
73
81
|
}: NsSmallFullCardProps): ReactElement {
|
|
74
82
|
return (
|
|
75
83
|
<CardContainer className={className} role="small-full-card" component="div" data-testid="small-full-card">
|
|
76
84
|
<BynderMedia className="image" imageDetail={backgroundImageDetail} />
|
|
77
85
|
<div className="gradientOverlay"></div>
|
|
78
86
|
<div className="content">
|
|
79
|
-
<article className=
|
|
80
|
-
<article className=
|
|
87
|
+
<article className={`subtitle ${fontColor}`}>{subtitle}</article>
|
|
88
|
+
<article className={`title ${fontColor}`}>{title}</article>
|
|
81
89
|
{button ? <CardButton {...button} /> : null}
|
|
82
90
|
</div>
|
|
83
91
|
</CardContainer>
|
|
@@ -14,6 +14,7 @@ type NsXLargeCardProps = {
|
|
|
14
14
|
backgroundImageDetail: BynderImageDataType;
|
|
15
15
|
button?: NsCardButton;
|
|
16
16
|
className?: string;
|
|
17
|
+
fontColor?: 'primary' | 'secondary';
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
const CardContainer = styled(Box)`
|
|
@@ -33,7 +34,7 @@ const CardContainer = styled(Box)`
|
|
|
33
34
|
left: 0;
|
|
34
35
|
width: 100%;
|
|
35
36
|
height: 100%;
|
|
36
|
-
background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
|
|
37
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
|
|
37
38
|
}
|
|
38
39
|
.content {
|
|
39
40
|
position: absolute;
|
|
@@ -55,10 +56,16 @@ const CardContainer = styled(Box)`
|
|
|
55
56
|
font-weight: 400;
|
|
56
57
|
margin-top: 20px;
|
|
57
58
|
}
|
|
59
|
+
.primary {
|
|
60
|
+
color: #fff;
|
|
61
|
+
}
|
|
62
|
+
.secondary {
|
|
63
|
+
color: #000;
|
|
64
|
+
}
|
|
58
65
|
.cta {
|
|
59
66
|
margin-top: 20px;
|
|
60
67
|
}
|
|
61
|
-
|
|
68
|
+
`;
|
|
62
69
|
|
|
63
70
|
export default function NsXLargeCard({
|
|
64
71
|
title,
|
|
@@ -66,14 +73,15 @@ export default function NsXLargeCard({
|
|
|
66
73
|
backgroundImageDetail,
|
|
67
74
|
button,
|
|
68
75
|
className,
|
|
76
|
+
fontColor,
|
|
69
77
|
}: NsXLargeCardProps): ReactElement {
|
|
70
78
|
return (
|
|
71
79
|
<CardContainer className={className} role="x-large-card" component="div" data-testid="x-large-card">
|
|
72
80
|
<BynderMedia className="image" imageDetail={backgroundImageDetail} />
|
|
73
81
|
<div className="gradientOverlay"></div>
|
|
74
82
|
<div className="content">
|
|
75
|
-
<article className=
|
|
76
|
-
<article className=
|
|
83
|
+
<article className={`subtitle ${fontColor}`}>{subtitle}</article>
|
|
84
|
+
<article className={`title ${fontColor}`}>{title}</article>
|
|
77
85
|
{button ? <CardButton {...button} /> : null}
|
|
78
86
|
</div>
|
|
79
87
|
</CardContainer>
|