@axos-web-dev/shared-components 0.0.6 → 0.0.8
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/dist/CallToActionBar/CallToActionBar.interface.d.ts +10 -11
- package/dist/CallToActionBar/index.js +81 -62
- package/dist/FooterDisclosure/FooterDisclosure.d.ts +10 -5
- package/dist/FooterDisclosure/FooterDisclosure.js +12 -4
- package/dist/Forms/RenderForm.d.ts +1 -1
- package/dist/Forms/RenderForm.js +1 -1
- package/dist/Forms/ScheduleCall.d.ts +2 -2
- package/dist/IconBillboard/IconBillboard.js +2 -1
- package/dist/IconBillboard/IconBillboardSet.js +54 -45
- package/dist/Modal/index.js +1 -1
- package/dist/assets/CallToActionBar/CallToActionBar.css +5 -2
- package/dist/assets/ImageBillboard/ImageBillboard.css +0 -1
- package/dist/utils/ctaOptions.d.ts +2 -1
- package/dist/utils/ctaOptions.js +14 -16
- package/package.json +1 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { ChevronProps } from '../Chevron/Chevron.interface';
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
export type large = "large" | "lg";
|
|
4
|
-
export type medium = "medium" | "md";
|
|
5
|
-
export type small = "small" | "sm";
|
|
6
3
|
export interface CallToActionBarInterface {
|
|
7
4
|
id?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
image: {
|
|
11
|
-
src: string;
|
|
12
|
-
alt?: string;
|
|
13
|
-
};
|
|
5
|
+
bannerSize: "Large" | "Medium" | "Small";
|
|
6
|
+
image: ImageInterface;
|
|
14
7
|
imageMobileView: boolean;
|
|
15
|
-
imagePlacement: "
|
|
16
|
-
bannerBehavior: "
|
|
8
|
+
imagePlacement: "Left" | "Right";
|
|
9
|
+
bannerBehavior: "Fixed" | "Fixed Overlap" | "Sticky" | "Scroll";
|
|
17
10
|
headline: string | ReactNode;
|
|
18
11
|
bodyCopy: string | ReactNode;
|
|
19
12
|
callToActionRow: ChevronProps[];
|
|
20
13
|
}
|
|
14
|
+
export interface ImageInterface {
|
|
15
|
+
src: string;
|
|
16
|
+
alt?: string;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}
|
|
@@ -3,16 +3,16 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import { Button } from "../Button/index.js";
|
|
4
4
|
import { Chevron } from "../Chevron/index.js";
|
|
5
5
|
import { getVariant } from "../utils/getVariant.js";
|
|
6
|
+
import clsx from "clsx";
|
|
6
7
|
import { useState, useEffect } from "react";
|
|
7
8
|
import { returnImageDimensions, imageOrientation, getBannerSizeClassName } from "../utils/ctaOptions.js";
|
|
8
9
|
import { sticky_banner, is_sticky, cta, cta_image_section, cta_image_overlap, cta_body_section, cta_text, ctas_section } from "./CallToActionBar.css.js";
|
|
9
10
|
const CallToActionBar = ({
|
|
10
|
-
image_overlap,
|
|
11
11
|
bannerSize,
|
|
12
12
|
image,
|
|
13
13
|
imageMobileView,
|
|
14
14
|
imagePlacement,
|
|
15
|
-
bannerBehavior = "
|
|
15
|
+
bannerBehavior = "Fixed",
|
|
16
16
|
headline,
|
|
17
17
|
bodyCopy,
|
|
18
18
|
callToActionRow,
|
|
@@ -22,16 +22,18 @@ const CallToActionBar = ({
|
|
|
22
22
|
const [imageSize, setImageSize] = useState({ width: "0px", height: "0px" });
|
|
23
23
|
const banner_size = bannerSize.toLowerCase();
|
|
24
24
|
const row_reverse = imagePlacement.toLowerCase() === "right" ? true : false;
|
|
25
|
+
const banner_behavior = bannerBehavior.toLocaleLowerCase();
|
|
26
|
+
const image_overlap = bannerBehavior.toLowerCase().includes("overlap");
|
|
25
27
|
useEffect(() => {
|
|
26
28
|
var _a;
|
|
27
29
|
const domRectStickyEl = (_a = document == null ? void 0 : document.querySelector(`.${sticky_banner}`)) == null ? void 0 : _a.getBoundingClientRect();
|
|
28
30
|
if (domRectStickyEl) {
|
|
29
31
|
setstickyTop(domRectStickyEl.top);
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
returnImageDimensions(banner_size, imageOrientation(image
|
|
33
|
-
|
|
34
|
-
}, [image
|
|
33
|
+
if (image) {
|
|
34
|
+
setImageSize(returnImageDimensions(banner_size, imageOrientation(image)));
|
|
35
|
+
}
|
|
36
|
+
}, [image, banner_size]);
|
|
35
37
|
useEffect(() => {
|
|
36
38
|
if (!stickyTop)
|
|
37
39
|
return;
|
|
@@ -59,63 +61,80 @@ const CallToActionBar = ({
|
|
|
59
61
|
className: `${cta} ${getBannerSizeClassName(
|
|
60
62
|
banner_size,
|
|
61
63
|
image_overlap
|
|
62
|
-
)} ${
|
|
63
|
-
children: /* @__PURE__ */ jsxs(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
banner_size
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
64
|
+
)} ${banner_behavior === "sticky" ? sticky_banner : ""} section_spacer`,
|
|
65
|
+
children: /* @__PURE__ */ jsxs(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: "containment flex middle",
|
|
69
|
+
style: !image || imageMobileView || banner_size === "small" ? { justifyContent: "center" } : {},
|
|
70
|
+
children: [
|
|
71
|
+
banner_size !== "small" && !imageMobileView && image ? /* @__PURE__ */ jsx("div", { className: `${cta_image_section}`, children: /* @__PURE__ */ jsx(
|
|
72
|
+
"img",
|
|
73
|
+
{
|
|
74
|
+
src: image.src,
|
|
75
|
+
alt: "",
|
|
76
|
+
style: { ...imageSize },
|
|
77
|
+
className: `${image_overlap ? `${cta_image_overlap}` : ""}`
|
|
78
|
+
}
|
|
79
|
+
) }) : null,
|
|
80
|
+
/* @__PURE__ */ jsxs(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: `${cta_body_section} ${banner_size !== "large" ? "flex middle" : ""}`,
|
|
84
|
+
style: row_reverse ? { flexDirection: "row-reverse" } : {},
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsxs(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: clsx(
|
|
90
|
+
cta_text,
|
|
91
|
+
"mb_0",
|
|
92
|
+
(imageMobileView || !image) && "text_center"
|
|
93
|
+
),
|
|
94
|
+
children: [
|
|
95
|
+
headline && /* @__PURE__ */ jsx("h2", { className: "header_3", children: headline }),
|
|
96
|
+
banner_size === "large" && bodyCopy && /* @__PURE__ */ jsx(Fragment, { children: bodyCopy })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: clsx(ctas_section, "flex", "text_center"),
|
|
104
|
+
style: banner_size === "small" ? {
|
|
105
|
+
flexShrink: 0,
|
|
106
|
+
marginRight: `${row_reverse ? "40px" : "20px"}`,
|
|
107
|
+
padding: 0
|
|
108
|
+
} : {},
|
|
109
|
+
children: callToActionRow.map(
|
|
110
|
+
({ id: id2, variant, displayText, targetUrl, type }) => type === "Button" ? /* @__PURE__ */ jsx(
|
|
111
|
+
Button,
|
|
112
|
+
{
|
|
113
|
+
targetUrl,
|
|
114
|
+
color: getVariant(variant),
|
|
115
|
+
size: "medium",
|
|
116
|
+
rounded: "medium",
|
|
117
|
+
children: displayText
|
|
118
|
+
},
|
|
119
|
+
id2
|
|
120
|
+
) : /* @__PURE__ */ jsx(
|
|
121
|
+
Chevron,
|
|
122
|
+
{
|
|
123
|
+
targetUrl,
|
|
124
|
+
variant: getVariant(variant),
|
|
125
|
+
children: displayText
|
|
126
|
+
},
|
|
127
|
+
id2
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
}
|
|
112
131
|
)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
)
|
|
119
138
|
},
|
|
120
139
|
id
|
|
121
140
|
);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { CSSProperties, PropsWithChildren } from "react";
|
|
2
|
+
type WithStyles = {
|
|
3
|
+
style?: CSSProperties;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const FooterContent: (props: PropsWithChildren & WithStyles) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const FooterParagraph: (props: PropsWithChildren & WithStyles) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const FooterIcons: (props: PropsWithChildren & WithStyles) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const FooterDisclosure: (props: PropsWithChildren & WithStyles) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
2
3
|
import { footerContent, footerParagraph, iconsContent, footerDisclosure } from "./FooterDisclosure.css.js";
|
|
3
4
|
const FooterContent = (props) => {
|
|
4
|
-
return /* @__PURE__ */ jsx("div", { className: footerContent, children: props.children });
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: clsx(footerContent, props.className), style: props.style, children: props.children });
|
|
5
6
|
};
|
|
6
7
|
const FooterParagraph = (props) => {
|
|
7
|
-
return /* @__PURE__ */ jsx("div", { className: footerParagraph, children: props.children });
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { className: clsx(footerParagraph, props.className), style: props.style, children: props.children });
|
|
8
9
|
};
|
|
9
10
|
const FooterIcons = (props) => {
|
|
10
|
-
return /* @__PURE__ */ jsx("div", { className: iconsContent, children: props.children });
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: clsx(iconsContent, props.className), style: props.style, children: props.children });
|
|
11
12
|
};
|
|
12
13
|
const FooterDisclosure = (props) => {
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"footer",
|
|
16
|
+
{
|
|
17
|
+
className: clsx(footerDisclosure(), props.className),
|
|
18
|
+
style: props.style,
|
|
19
|
+
children: props.children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
14
22
|
};
|
|
15
23
|
export {
|
|
16
24
|
FooterContent,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
import { FormProps } from ".";
|
|
3
3
|
export interface renderFormProps extends FormProps, PropsWithChildren {
|
|
4
|
-
|
|
4
|
+
form?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const renderSwitch: (form: string | undefined, props: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const RenderWebForm: (props: renderFormProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/Forms/RenderForm.js
CHANGED
|
@@ -11,7 +11,7 @@ const renderSwitch = (form = "Contact Form", props) => {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
const RenderWebForm = (props) => {
|
|
14
|
-
return /* @__PURE__ */ jsx(Fragment, { children: renderSwitch(props.
|
|
14
|
+
return /* @__PURE__ */ jsx(Fragment, { children: renderSwitch(props.form, props) });
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
17
|
RenderWebForm,
|
|
@@ -6,8 +6,8 @@ export interface FormProps extends PropsWithChildren {
|
|
|
6
6
|
[index: string]: string;
|
|
7
7
|
}) => void;
|
|
8
8
|
icon?: boolean;
|
|
9
|
-
headline?: ReactNode;
|
|
10
|
-
disclosure?: ReactNode;
|
|
9
|
+
headline?: ReactNode | string;
|
|
10
|
+
disclosure?: ReactNode | string;
|
|
11
11
|
variant?: QuaternaryTypes;
|
|
12
12
|
validateEmail: (email: string) => Promise<boolean>;
|
|
13
13
|
callToAction: Omit<ChevronProps, "targetUrl">;
|
|
@@ -7,12 +7,13 @@ import { containerIconBillboard, layout, billboard_icon, content, headerIconBill
|
|
|
7
7
|
const IconBillboard = (props) => {
|
|
8
8
|
const {
|
|
9
9
|
callToActionRow,
|
|
10
|
-
variant,
|
|
10
|
+
variant: fullVariant = "primary",
|
|
11
11
|
side = false,
|
|
12
12
|
items,
|
|
13
13
|
headline,
|
|
14
14
|
body
|
|
15
15
|
} = props;
|
|
16
|
+
const variant = getVariant(fullVariant);
|
|
16
17
|
return /* @__PURE__ */ jsxs("div", { className: containerIconBillboard({ variant }), children: [
|
|
17
18
|
/* @__PURE__ */ jsxs("div", { className: layout({ side }), children: [
|
|
18
19
|
/* @__PURE__ */ jsx("div", { className: billboard_icon, children: props.icon }),
|
|
@@ -25,52 +25,61 @@ const IconBillboardSet = ({
|
|
|
25
25
|
bodyCopy && /* @__PURE__ */ jsx(Fragment, { children: bodyCopy })
|
|
26
26
|
] }),
|
|
27
27
|
/* @__PURE__ */ jsx("div", { className: section_container, children: iconBillboards.map(
|
|
28
|
-
({ id, icon, headline: headline2, bodyCopy: bodyCopy2, bullets, callToActionRow }) => /* @__PURE__ */ jsxs(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
({ id, icon, headline: headline2, bodyCopy: bodyCopy2, bullets, callToActionRow }) => /* @__PURE__ */ jsxs(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: containerIconBillboard({
|
|
32
|
+
variant: getVariant(variant)
|
|
33
|
+
}),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: layout({ side }), children: [
|
|
36
|
+
icon && /* @__PURE__ */ jsx("div", { className: billboard_icon, children: /* @__PURE__ */ jsx(
|
|
37
|
+
"img",
|
|
38
|
+
{
|
|
39
|
+
src: icon == null ? void 0 : icon.src,
|
|
40
|
+
className: "img_fluid",
|
|
41
|
+
alt: icon == null ? void 0 : icon.alt
|
|
42
|
+
}
|
|
43
|
+
) }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: content, children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: headerIconBillboard, children: [
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: title({ variant }), children: headline2 }),
|
|
47
|
+
/* @__PURE__ */ jsx("div", { children: bodyCopy2 })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("ul", { className: list, children: bullets.map((item) => /* @__PURE__ */ jsx(BulletItem, { id: item.id, children: item.copy }, item.id)) }) })
|
|
50
|
+
] })
|
|
42
51
|
] }),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
callToActionRow && /* @__PURE__ */ jsx("div", { className: buttons, children: callToActionRow.map(
|
|
53
|
+
({
|
|
54
|
+
id: id2,
|
|
55
|
+
variant: variant2,
|
|
56
|
+
displayText,
|
|
57
|
+
targetUrl,
|
|
58
|
+
type
|
|
59
|
+
}) => type === "Button" ? /* @__PURE__ */ jsx(
|
|
60
|
+
Button,
|
|
61
|
+
{
|
|
62
|
+
targetUrl,
|
|
63
|
+
color: getVariant(variant2),
|
|
64
|
+
size: "medium",
|
|
65
|
+
rounded: "medium",
|
|
66
|
+
children: displayText
|
|
67
|
+
},
|
|
68
|
+
id2
|
|
69
|
+
) : /* @__PURE__ */ jsx(
|
|
70
|
+
Chevron,
|
|
71
|
+
{
|
|
72
|
+
targetUrl,
|
|
73
|
+
variant: getVariant(variant2),
|
|
74
|
+
children: displayText
|
|
75
|
+
},
|
|
76
|
+
id2
|
|
77
|
+
)
|
|
78
|
+
) })
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
id
|
|
82
|
+
)
|
|
74
83
|
) }),
|
|
75
84
|
additionalDetails && /* @__PURE__ */ jsx("div", { className: section_text, children: /* @__PURE__ */ jsx(Fragment, { children: additionalDetails }) })
|
|
76
85
|
] });
|
package/dist/Modal/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import "react";
|
|
|
14
14
|
import "../IconBillboard/IconBillboard.css.js";
|
|
15
15
|
/* empty css */
|
|
16
16
|
/* empty css */
|
|
17
|
+
import "clsx";
|
|
17
18
|
/* empty css */
|
|
18
19
|
import "../Carousel/index.js";
|
|
19
20
|
/* empty css */
|
|
@@ -26,7 +27,6 @@ import "../Forms/Forms.css.js";
|
|
|
26
27
|
import "../Forms/SalesforceFieldsForm.js";
|
|
27
28
|
import "@hookform/resolvers/zod";
|
|
28
29
|
import "../Input/index.js";
|
|
29
|
-
import "clsx";
|
|
30
30
|
import "react-hook-form";
|
|
31
31
|
/* empty css */
|
|
32
32
|
import "../ImageBillboard/ImageBillboard.css.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
color: var(--_1073cm8g);
|
|
5
5
|
}
|
|
6
6
|
._1tdyl740 .containment {
|
|
7
|
-
height:
|
|
7
|
+
height: 100%;
|
|
8
8
|
}
|
|
9
9
|
._1tdyl740 .flex {
|
|
10
10
|
align-items: center;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
}
|
|
53
53
|
._1tdyl74c {
|
|
54
54
|
position: relative;
|
|
55
|
-
top: -
|
|
55
|
+
top: -20px;
|
|
56
56
|
}
|
|
57
57
|
._1tdyl74d {
|
|
58
58
|
gap: 24px;
|
|
@@ -76,6 +76,9 @@
|
|
|
76
76
|
._1tdyl74g .sc__btn {
|
|
77
77
|
margin-left: 0;
|
|
78
78
|
}
|
|
79
|
+
._1tdyl746 ._1tdyl74g, ._1tdyl747 ._1tdyl74g {
|
|
80
|
+
margin-top: 24px;
|
|
81
|
+
}
|
|
79
82
|
@media screen and (max-width:1127px) {
|
|
80
83
|
[class*=cta_section_lg] {
|
|
81
84
|
max-height: 256px;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ImageInterface } from '../CallToActionBar/CallToActionBar.interface';
|
|
2
|
+
export declare const imageOrientation: (image: ImageInterface) => string;
|
|
2
3
|
export declare const getBannerSizeClassName: (size: string, overlap: boolean) => string;
|
|
3
4
|
export declare const returnImageDimensions: (size: string, image_orientation: string) => {
|
|
4
5
|
width: string;
|
package/dist/utils/ctaOptions.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { cta_section_lg, cta_section_lg_overlap, cta_section_md, cta_section_md_overlap } from "../CallToActionBar/CallToActionBar.css.js";
|
|
2
|
-
const imageOrientation = (
|
|
3
|
-
let orientation;
|
|
4
|
-
|
|
5
|
-
img.src = image_url;
|
|
6
|
-
if (img.naturalWidth > img.naturalHeight) {
|
|
1
|
+
import { cta_section_lg, cta_section_lg_overlap, cta_section_md, cta_section_md_overlap, cta_section_sm } from "../CallToActionBar/CallToActionBar.css.js";
|
|
2
|
+
const imageOrientation = (image) => {
|
|
3
|
+
let orientation = "landscape";
|
|
4
|
+
if (image.width > image.height) {
|
|
7
5
|
orientation = "landscape";
|
|
8
|
-
} else if (
|
|
6
|
+
} else if (image.width < image.height) {
|
|
9
7
|
orientation = "portrait";
|
|
10
8
|
} else {
|
|
11
9
|
orientation = "even";
|
|
@@ -13,31 +11,31 @@ const imageOrientation = (image_url) => {
|
|
|
13
11
|
return orientation;
|
|
14
12
|
};
|
|
15
13
|
const getBannerSizeClassName = (size, overlap) => {
|
|
16
|
-
if (size
|
|
14
|
+
if (size.includes("large") && !overlap) {
|
|
17
15
|
return cta_section_lg;
|
|
18
16
|
}
|
|
19
|
-
if (size
|
|
17
|
+
if (size.includes("large") && overlap) {
|
|
20
18
|
return cta_section_lg_overlap;
|
|
21
19
|
}
|
|
22
|
-
if (size
|
|
20
|
+
if (size.includes("medium") && !overlap) {
|
|
23
21
|
return cta_section_md;
|
|
24
22
|
}
|
|
25
|
-
if (size
|
|
23
|
+
if (size.includes("medium") && overlap) {
|
|
26
24
|
return cta_section_md_overlap;
|
|
27
25
|
}
|
|
28
|
-
return
|
|
26
|
+
return cta_section_sm;
|
|
29
27
|
};
|
|
30
28
|
const returnImageDimensions = (size, image_orientation) => {
|
|
31
|
-
if (image_orientation === "landscape" && size
|
|
29
|
+
if (image_orientation === "landscape" && size.includes("large")) {
|
|
32
30
|
return { width: "491px", height: "256px" };
|
|
33
31
|
}
|
|
34
|
-
if (image_orientation === "even" && size
|
|
32
|
+
if (image_orientation === "even" && size.includes("large")) {
|
|
35
33
|
return { width: "256px", height: "256px" };
|
|
36
34
|
}
|
|
37
|
-
if (image_orientation === "landscape" && size
|
|
35
|
+
if (image_orientation === "landscape" && size.includes("medium")) {
|
|
38
36
|
return { width: "306px", height: "160px" };
|
|
39
37
|
}
|
|
40
|
-
if (image_orientation === "even" && size
|
|
38
|
+
if (image_orientation === "even" && size.includes("medium")) {
|
|
41
39
|
return { width: "160px", height: "160px" };
|
|
42
40
|
}
|
|
43
41
|
return { width: "491px", height: "256px" };
|