@digital-b2c/coreui-kit 0.2.1 → 0.3.0
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/index.cjs +79 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +270 -34
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +80 -27
- package/dist/index.mjs.map +1 -1
- package/dist/instrument-sans-VYC4K7BH.woff2 +0 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -828,16 +828,47 @@ var ContactModuleTitle = ({ children }) => {
|
|
|
828
828
|
var ContactModuleSubtitle = ({ children }) => {
|
|
829
829
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
830
830
|
};
|
|
831
|
+
function useIntersectionObserver({
|
|
832
|
+
animateOnce = false,
|
|
833
|
+
options = {}
|
|
834
|
+
} = {}) {
|
|
835
|
+
const observeRef = React.useRef(null);
|
|
836
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
837
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
838
|
+
console.warn("IntersectionObserver is not supported in this browser.");
|
|
839
|
+
return { observeRef, isVisible: true };
|
|
840
|
+
}
|
|
841
|
+
React.useEffect(() => {
|
|
842
|
+
const currentRef = observeRef.current;
|
|
843
|
+
if (!currentRef) return;
|
|
844
|
+
const observer = new IntersectionObserver((entries) => {
|
|
845
|
+
const entry = entries[0];
|
|
846
|
+
if (!entry) return;
|
|
847
|
+
setIsVisible(entry.isIntersecting);
|
|
848
|
+
if (entry.isIntersecting && animateOnce) {
|
|
849
|
+
observer.disconnect();
|
|
850
|
+
}
|
|
851
|
+
}, options);
|
|
852
|
+
observer.observe(currentRef);
|
|
853
|
+
return () => {
|
|
854
|
+
observer.disconnect();
|
|
855
|
+
};
|
|
856
|
+
}, [observeRef, animateOnce, options]);
|
|
857
|
+
return { observeRef, isVisible };
|
|
858
|
+
}
|
|
831
859
|
|
|
832
860
|
// src/widgets/ContactModule/ContactModule.module.scss
|
|
833
861
|
var ContactModule_module_default = {
|
|
834
862
|
"contact-module": "ContactModule_module_contact-module",
|
|
863
|
+
blur: "ContactModule_module_blur",
|
|
864
|
+
"blur--hidden": "ContactModule_module_blur--hidden",
|
|
835
865
|
container: "ContactModule_module_container",
|
|
836
866
|
wrapper: "ContactModule_module_wrapper",
|
|
837
867
|
content: "ContactModule_module_content",
|
|
838
868
|
"cta-wrapper": "ContactModule_module_cta-wrapper",
|
|
839
869
|
cta: "ContactModule_module_cta",
|
|
840
870
|
title: "ContactModule_module_title",
|
|
871
|
+
subtitle: "ContactModule_module_subtitle",
|
|
841
872
|
image: "ContactModule_module_image"
|
|
842
873
|
};
|
|
843
874
|
var ContactModule = ({
|
|
@@ -847,35 +878,51 @@ var ContactModule = ({
|
|
|
847
878
|
subtitle,
|
|
848
879
|
ctas,
|
|
849
880
|
image,
|
|
850
|
-
blurred
|
|
881
|
+
blurred = true,
|
|
882
|
+
animateBlur = true
|
|
851
883
|
}) => {
|
|
852
884
|
var _a, _b;
|
|
885
|
+
const { observeRef, isVisible } = useIntersectionObserver({
|
|
886
|
+
animateOnce: true,
|
|
887
|
+
options: { threshold: 0.8 }
|
|
888
|
+
});
|
|
853
889
|
const slots = resolveCompoundSlots(children, {
|
|
854
890
|
title: ContactModuleTitle,
|
|
855
891
|
subtitle: ContactModuleSubtitle
|
|
856
892
|
});
|
|
857
893
|
const titleNode = (_a = slots.title) != null ? _a : title;
|
|
858
894
|
const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
|
|
859
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
860
|
-
/* @__PURE__ */ jsxRuntime.
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
895
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: observeRef, className: clsx3__default.default(ContactModule_module_default["contact-module"], className), children: [
|
|
896
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
897
|
+
"div",
|
|
898
|
+
{
|
|
899
|
+
className: clsx3__default.default({
|
|
900
|
+
[ContactModule_module_default.blur]: blurred,
|
|
901
|
+
[ContactModule_module_default["blur--hidden"]]: blurred && animateBlur && isVisible
|
|
902
|
+
})
|
|
903
|
+
}
|
|
904
|
+
),
|
|
905
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Container, { className: ContactModule_module_default.container, children: [
|
|
906
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ContactModule_module_default.wrapper, children: [
|
|
907
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ContactModule_module_default.content, children: [
|
|
908
|
+
titleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx3__default.default(ContactModule_module_default.title, "h1"), children: titleNode }),
|
|
909
|
+
subtitleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx3__default.default(ContactModule_module_default.subtitle, "subheading"), children: subtitleNode })
|
|
910
|
+
] }),
|
|
911
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: ContactModule_module_default["cta-wrapper"], children: ctas == null ? void 0 : ctas.map((cta, key) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
912
|
+
Button,
|
|
913
|
+
{
|
|
914
|
+
className: ContactModule_module_default.cta,
|
|
915
|
+
href: cta.url,
|
|
916
|
+
isExternal: cta.isExternal,
|
|
917
|
+
variant: key % 2 === 0 ? "secondary" : "primary",
|
|
918
|
+
children: cta.label
|
|
919
|
+
},
|
|
920
|
+
key
|
|
921
|
+
)) })
|
|
864
922
|
] }),
|
|
865
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
className: ContactModule_module_default.cta,
|
|
869
|
-
href: cta.url,
|
|
870
|
-
isExternal: cta.isExternal,
|
|
871
|
-
variant: key % 2 === 0 ? "secondary" : "primary",
|
|
872
|
-
children: cta.label
|
|
873
|
-
},
|
|
874
|
-
key
|
|
875
|
-
)) })
|
|
876
|
-
] }),
|
|
877
|
-
image && /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadValues({ className: ContactModule_module_default.image }, image))
|
|
878
|
-
] }) });
|
|
923
|
+
image && /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadValues({ className: ContactModule_module_default.image }, image))
|
|
924
|
+
] })
|
|
925
|
+
] });
|
|
879
926
|
};
|
|
880
927
|
|
|
881
928
|
// src/widgets/ContactModule/index.ts
|
|
@@ -1040,14 +1087,14 @@ var MiniSectionCtaSubtitle = ({ children }) => {
|
|
|
1040
1087
|
// src/widgets/MiniSectionCta/MiniSectionCta.module.scss
|
|
1041
1088
|
var MiniSectionCta_module_default = {
|
|
1042
1089
|
miniSectionCta: "MiniSectionCta_module_miniSectionCta",
|
|
1043
|
-
|
|
1090
|
+
wrapper: "MiniSectionCta_module_wrapper",
|
|
1044
1091
|
col: "MiniSectionCta_module_col",
|
|
1045
1092
|
BgColorBlack: "MiniSectionCta_module_BgColorBlack",
|
|
1046
1093
|
infoCallout: "MiniSectionCta_module_infoCallout",
|
|
1094
|
+
subtitle: "MiniSectionCta_module_subtitle",
|
|
1047
1095
|
miniTextCenterCta: "MiniSectionCta_module_miniTextCenterCta",
|
|
1048
1096
|
cta: "MiniSectionCta_module_cta",
|
|
1049
|
-
BgColorGrey: "MiniSectionCta_module_BgColorGrey"
|
|
1050
|
-
subtitle: "MiniSectionCta_module_subtitle"
|
|
1097
|
+
BgColorGrey: "MiniSectionCta_module_BgColorGrey"
|
|
1051
1098
|
};
|
|
1052
1099
|
var MiniSectionCta = ({
|
|
1053
1100
|
className,
|
|
@@ -1064,10 +1111,16 @@ var MiniSectionCta = ({
|
|
|
1064
1111
|
});
|
|
1065
1112
|
const titleNode = (_a = slots.title) != null ? _a : title;
|
|
1066
1113
|
const subtitleNode = (_b = slots.subtitle) != null ? _b : subtitle;
|
|
1067
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx3__default.default(MiniSectionCta_module_default.miniSectionCta, MiniSectionCta_module_default[variant], className), children: /* @__PURE__ */ jsxRuntime.
|
|
1114
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx3__default.default(MiniSectionCta_module_default.miniSectionCta, MiniSectionCta_module_default[variant], className), children: /* @__PURE__ */ jsxRuntime.jsx(Container, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniSectionCta_module_default.wrapper, children: [
|
|
1068
1115
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniSectionCta_module_default.col, children: [
|
|
1069
1116
|
titleNode && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: variant === "BgColorBlack" || variant === "BgColorGrey" ? "h3" : "h2", children: titleNode }),
|
|
1070
|
-
subtitleNode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1117
|
+
subtitleNode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1118
|
+
"div",
|
|
1119
|
+
{
|
|
1120
|
+
className: clsx3__default.default(MiniSectionCta_module_default.subtitle, variant === "infoCallout" ? "h4" : "subheading"),
|
|
1121
|
+
children: subtitleNode
|
|
1122
|
+
}
|
|
1123
|
+
)
|
|
1071
1124
|
] }),
|
|
1072
1125
|
cta && /* @__PURE__ */ jsxRuntime.jsx("div", { className: MiniSectionCta_module_default.col, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1073
1126
|
Button,
|
|
@@ -1080,7 +1133,7 @@ var MiniSectionCta = ({
|
|
|
1080
1133
|
children: cta.label
|
|
1081
1134
|
}
|
|
1082
1135
|
) })
|
|
1083
|
-
] }) });
|
|
1136
|
+
] }) }) });
|
|
1084
1137
|
};
|
|
1085
1138
|
|
|
1086
1139
|
// src/widgets/MiniSectionCta/index.ts
|