@digital-b2c/coreui-kit 0.11.13 → 0.11.14
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 +74 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +9 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.mjs +20 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var clsx15 = require('clsx');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var
|
|
5
|
+
var React66 = require('react');
|
|
6
6
|
var gsap = require('gsap');
|
|
7
7
|
var react = require('@gsap/react');
|
|
8
8
|
var ScrollTrigger = require('gsap/ScrollTrigger');
|
|
@@ -13,7 +13,7 @@ require('swiper/css');
|
|
|
13
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
|
|
15
15
|
var clsx15__default = /*#__PURE__*/_interopDefault(clsx15);
|
|
16
|
-
var
|
|
16
|
+
var React66__default = /*#__PURE__*/_interopDefault(React66);
|
|
17
17
|
var gsap__default = /*#__PURE__*/_interopDefault(gsap);
|
|
18
18
|
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
@@ -382,7 +382,7 @@ var svgs = {
|
|
|
382
382
|
xBlack: icon_x_black_default,
|
|
383
383
|
xWhite: icon_x_white_default
|
|
384
384
|
};
|
|
385
|
-
var Icon =
|
|
385
|
+
var Icon = React66__default.default.memo(
|
|
386
386
|
(_a) => {
|
|
387
387
|
var _b = _a, { type, size } = _b, props = __objRest(_b, ["type", "size"]);
|
|
388
388
|
if (type) {
|
|
@@ -495,21 +495,21 @@ var getDeviceType = (width) => {
|
|
|
495
495
|
return "desktop";
|
|
496
496
|
};
|
|
497
497
|
var useViewPort = () => {
|
|
498
|
-
const [device, setDevice] =
|
|
498
|
+
const [device, setDevice] = React66.useState(
|
|
499
499
|
() => typeof window !== "undefined" ? getDeviceType(window.innerWidth) : "desktop"
|
|
500
500
|
);
|
|
501
|
-
const getOtherDevices =
|
|
501
|
+
const getOtherDevices = React66.useCallback(
|
|
502
502
|
(list, what, includeSelf = false) => {
|
|
503
503
|
const deviceIndex = list.indexOf(what) + (!includeSelf ? 1 : 0);
|
|
504
504
|
return [...list].slice(deviceIndex);
|
|
505
505
|
},
|
|
506
506
|
[]
|
|
507
507
|
);
|
|
508
|
-
const onWindowResize =
|
|
508
|
+
const onWindowResize = React66.useCallback(() => {
|
|
509
509
|
setDevice(getDeviceType(window.innerWidth));
|
|
510
510
|
}, []);
|
|
511
511
|
const onWindowResizeDebounce = useDebounce_default(onWindowResize, 100);
|
|
512
|
-
|
|
512
|
+
React66.useEffect(() => {
|
|
513
513
|
window.addEventListener("resize", onWindowResizeDebounce);
|
|
514
514
|
return () => window.removeEventListener("resize", onWindowResizeDebounce);
|
|
515
515
|
}, [onWindowResizeDebounce]);
|
|
@@ -562,13 +562,13 @@ var BrandsStrip = ({
|
|
|
562
562
|
cta,
|
|
563
563
|
size
|
|
564
564
|
}) => {
|
|
565
|
-
const [show, setShow] =
|
|
566
|
-
const [shouldAnimate, setShouldAnimate] =
|
|
565
|
+
const [show, setShow] = React66.useState(false);
|
|
566
|
+
const [shouldAnimate, setShouldAnimate] = React66.useState(false);
|
|
567
567
|
const { is } = useViewPort_default();
|
|
568
568
|
const isTabletBelow = is("tablet", "below");
|
|
569
|
-
const containerRef =
|
|
570
|
-
const marqueeRef =
|
|
571
|
-
const timeline =
|
|
569
|
+
const containerRef = React66.useRef(null);
|
|
570
|
+
const marqueeRef = React66.useRef(null);
|
|
571
|
+
const timeline = React66.useRef(null);
|
|
572
572
|
const horizontalLoop = (items, config) => {
|
|
573
573
|
const itemsArray = gsap__default.default.utils.toArray(items);
|
|
574
574
|
const cfg = config || {};
|
|
@@ -662,7 +662,7 @@ var BrandsStrip = ({
|
|
|
662
662
|
timeline.current.play();
|
|
663
663
|
}
|
|
664
664
|
};
|
|
665
|
-
const duplicatedLogos =
|
|
665
|
+
const duplicatedLogos = React66.useMemo(() => {
|
|
666
666
|
if (logos.length === 0) return [];
|
|
667
667
|
if (!shouldAnimate) return [...logos];
|
|
668
668
|
return [...logos, ...logos];
|
|
@@ -715,8 +715,8 @@ var CardSubtitle = ({ children }) => {
|
|
|
715
715
|
};
|
|
716
716
|
function resolveCompoundSlots(children, slots) {
|
|
717
717
|
const resolved = {};
|
|
718
|
-
|
|
719
|
-
if (!
|
|
718
|
+
React66.Children.forEach(children, (child) => {
|
|
719
|
+
if (!React66.isValidElement(child)) return;
|
|
720
720
|
Object.entries(slots).forEach(([key, Component]) => {
|
|
721
721
|
if (child.type === Component) {
|
|
722
722
|
resolved[key] = child.props.children;
|
|
@@ -730,7 +730,7 @@ function resolveCompoundSlots(children, slots) {
|
|
|
730
730
|
var Container_module_default = {
|
|
731
731
|
container: "Container_module_container"
|
|
732
732
|
};
|
|
733
|
-
var Container =
|
|
733
|
+
var Container = React66.forwardRef(
|
|
734
734
|
(_a, ref) => {
|
|
735
735
|
var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
|
|
736
736
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({ ref, className: clsx15__default.default(Container_module_default.container, className) }, props), { children }));
|
|
@@ -871,11 +871,11 @@ function FilterBar({
|
|
|
871
871
|
searchValue,
|
|
872
872
|
onSearchChange
|
|
873
873
|
}) {
|
|
874
|
-
const [openDropdown, setOpenDropdown] =
|
|
875
|
-
const [searchState, setSearchState] =
|
|
876
|
-
const filterRef =
|
|
877
|
-
const sortRef =
|
|
878
|
-
const searchInputRef =
|
|
874
|
+
const [openDropdown, setOpenDropdown] = React66.useState(null);
|
|
875
|
+
const [searchState, setSearchState] = React66.useState("closed");
|
|
876
|
+
const filterRef = React66.useRef(null);
|
|
877
|
+
const sortRef = React66.useRef(null);
|
|
878
|
+
const searchInputRef = React66.useRef(null);
|
|
879
879
|
const closeSearch = () => {
|
|
880
880
|
setSearchState("closing");
|
|
881
881
|
onSearchChange("");
|
|
@@ -885,7 +885,7 @@ function FilterBar({
|
|
|
885
885
|
onSearchChange("");
|
|
886
886
|
(_a = searchInputRef.current) == null ? void 0 : _a.focus();
|
|
887
887
|
};
|
|
888
|
-
|
|
888
|
+
React66.useEffect(() => {
|
|
889
889
|
const handleMouseDown = (e) => {
|
|
890
890
|
var _a, _b;
|
|
891
891
|
const target = e.target;
|
|
@@ -895,7 +895,7 @@ function FilterBar({
|
|
|
895
895
|
document.addEventListener("mousedown", handleMouseDown);
|
|
896
896
|
return () => document.removeEventListener("mousedown", handleMouseDown);
|
|
897
897
|
}, []);
|
|
898
|
-
|
|
898
|
+
React66.useEffect(() => {
|
|
899
899
|
var _a;
|
|
900
900
|
if (searchState === "open") (_a = searchInputRef.current) == null ? void 0 : _a.focus();
|
|
901
901
|
}, [searchState]);
|
|
@@ -1140,7 +1140,7 @@ var Pagination = ({
|
|
|
1140
1140
|
onPageChange,
|
|
1141
1141
|
renderLink
|
|
1142
1142
|
}) => {
|
|
1143
|
-
const [activePage, setActivePage] =
|
|
1143
|
+
const [activePage, setActivePage] = React66.useState(currentPage);
|
|
1144
1144
|
const goToPage = (page) => {
|
|
1145
1145
|
if (page < 1 || page > totalPages) return;
|
|
1146
1146
|
setActivePage(page);
|
|
@@ -1194,7 +1194,7 @@ var Pagination = ({
|
|
|
1194
1194
|
[Pagination_module_default.active]: activePage === page,
|
|
1195
1195
|
[Pagination_module_default.number]: hasNumber
|
|
1196
1196
|
});
|
|
1197
|
-
return renderLink ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1197
|
+
return renderLink ? /* @__PURE__ */ jsxRuntime.jsx(React66.Fragment, { children: renderLink({
|
|
1198
1198
|
page,
|
|
1199
1199
|
className: pageClassName,
|
|
1200
1200
|
"aria-label": `Go to page ${page}`,
|
|
@@ -1471,7 +1471,7 @@ var Badge_module_default = {
|
|
|
1471
1471
|
icon: "Badge_module_icon",
|
|
1472
1472
|
iconOnly: "Badge_module_iconOnly"
|
|
1473
1473
|
};
|
|
1474
|
-
var Badge =
|
|
1474
|
+
var Badge = React66.forwardRef(
|
|
1475
1475
|
(_a, ref) => {
|
|
1476
1476
|
var _b = _a, {
|
|
1477
1477
|
children,
|
|
@@ -1545,7 +1545,7 @@ var Input_module_default = {
|
|
|
1545
1545
|
error: "Input_module_error",
|
|
1546
1546
|
"input-field--error": "Input_module_input-field--error",
|
|
1547
1547
|
"input-field--disabled": "Input_module_input-field--disabled"};
|
|
1548
|
-
var Input =
|
|
1548
|
+
var Input = React66.forwardRef(
|
|
1549
1549
|
(_a, ref) => {
|
|
1550
1550
|
var _b = _a, {
|
|
1551
1551
|
id,
|
|
@@ -1576,7 +1576,7 @@ var Input = React65.forwardRef(
|
|
|
1576
1576
|
"hideLabel",
|
|
1577
1577
|
"type"
|
|
1578
1578
|
]);
|
|
1579
|
-
const generatedId =
|
|
1579
|
+
const generatedId = React66.useId();
|
|
1580
1580
|
const inputId = id || generatedId;
|
|
1581
1581
|
const helperTextId = `${inputId}-helper`;
|
|
1582
1582
|
const errorId = `${inputId}-error`;
|
|
@@ -1781,10 +1781,10 @@ var CardCollection = ({
|
|
|
1781
1781
|
children
|
|
1782
1782
|
}) => {
|
|
1783
1783
|
var _a, _b;
|
|
1784
|
-
const container =
|
|
1785
|
-
const revealWrapper =
|
|
1786
|
-
const extraCard =
|
|
1787
|
-
const [isExpanded, setIsExpanded] =
|
|
1784
|
+
const container = React66.useRef(null);
|
|
1785
|
+
const revealWrapper = React66.useRef(null);
|
|
1786
|
+
const extraCard = React66.useRef(null);
|
|
1787
|
+
const [isExpanded, setIsExpanded] = React66.useState(false);
|
|
1788
1788
|
const slots = resolveCompoundSlots(children, {
|
|
1789
1789
|
title: CardCollectionTitle,
|
|
1790
1790
|
subtitle: CardCollectionSubtitle
|
|
@@ -1795,7 +1795,7 @@ var CardCollection = ({
|
|
|
1795
1795
|
const visibleCards = isExamCard ? cards.slice(0, 8) : cards;
|
|
1796
1796
|
const hiddenCards = isExamCard ? cards.slice(8) : [];
|
|
1797
1797
|
const { contextSafe } = react.useGSAP({ scope: container });
|
|
1798
|
-
const handleShowMore =
|
|
1798
|
+
const handleShowMore = React66.useCallback(() => {
|
|
1799
1799
|
contextSafe(() => {
|
|
1800
1800
|
setIsExpanded(true);
|
|
1801
1801
|
const tl = gsap__default.default.timeline({ defaults: { ease: "power3.inOut" } });
|
|
@@ -1899,8 +1899,8 @@ var ContactModule = ({
|
|
|
1899
1899
|
animateBlur = true
|
|
1900
1900
|
}) => {
|
|
1901
1901
|
var _a, _b;
|
|
1902
|
-
const containerRef =
|
|
1903
|
-
const blurRef =
|
|
1902
|
+
const containerRef = React66.useRef(null);
|
|
1903
|
+
const blurRef = React66.useRef(null);
|
|
1904
1904
|
const slots = resolveCompoundSlots(children, {
|
|
1905
1905
|
title: ContactModuleTitle,
|
|
1906
1906
|
subtitle: ContactModuleSubtitle
|
|
@@ -2239,8 +2239,8 @@ var HeroBannerCarousel = ({
|
|
|
2239
2239
|
}) => {
|
|
2240
2240
|
const { is } = useViewPort_default();
|
|
2241
2241
|
const isMobile = is("tablet", "below");
|
|
2242
|
-
const [swiperInstance, setSwiperInstance] =
|
|
2243
|
-
const [activeIndex, setActiveIndex] =
|
|
2242
|
+
const [swiperInstance, setSwiperInstance] = React66.useState(null);
|
|
2243
|
+
const [activeIndex, setActiveIndex] = React66.useState(0);
|
|
2244
2244
|
if (!items.length) return null;
|
|
2245
2245
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx15__default.default(HeroBannerCarousel_module_default.heroBannerCarousel, className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: HeroBannerCarousel_module_default.inner, children: [
|
|
2246
2246
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: HeroBannerCarousel_module_default.swiperContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2329,16 +2329,16 @@ var AccordionItem = ({
|
|
|
2329
2329
|
onToggle,
|
|
2330
2330
|
className
|
|
2331
2331
|
}) => {
|
|
2332
|
-
const contentRef =
|
|
2333
|
-
const contentInnerRef =
|
|
2334
|
-
const timelineRef =
|
|
2335
|
-
const [contentHeight, setContentHeight] =
|
|
2336
|
-
|
|
2332
|
+
const contentRef = React66.useRef(null);
|
|
2333
|
+
const contentInnerRef = React66.useRef(null);
|
|
2334
|
+
const timelineRef = React66.useRef(null);
|
|
2335
|
+
const [contentHeight, setContentHeight] = React66.useState(0);
|
|
2336
|
+
React66.useEffect(() => {
|
|
2337
2337
|
if (contentInnerRef.current) {
|
|
2338
2338
|
setContentHeight(contentInnerRef.current.scrollHeight);
|
|
2339
2339
|
}
|
|
2340
2340
|
}, [children]);
|
|
2341
|
-
|
|
2341
|
+
React66.useEffect(() => {
|
|
2342
2342
|
if (contentRef.current && contentHeight > 0) {
|
|
2343
2343
|
if (timelineRef.current) {
|
|
2344
2344
|
timelineRef.current.kill();
|
|
@@ -2423,7 +2423,7 @@ var Accordion = ({
|
|
|
2423
2423
|
allowMultiple = false,
|
|
2424
2424
|
onItemToggle
|
|
2425
2425
|
}) => {
|
|
2426
|
-
const [openIds, setOpenIds] =
|
|
2426
|
+
const [openIds, setOpenIds] = React66.useState(defaultOpenIds);
|
|
2427
2427
|
const handleToggle = (id) => {
|
|
2428
2428
|
setOpenIds((prev) => {
|
|
2429
2429
|
let newOpenIds;
|
|
@@ -2484,10 +2484,10 @@ var InternalBrandsTab_module_default = {
|
|
|
2484
2484
|
var InternalBrandsTab = (props) => {
|
|
2485
2485
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
2486
2486
|
const { title, subTitle, className, tabs } = props;
|
|
2487
|
-
const [activeIndex, setActiveIndex] =
|
|
2487
|
+
const [activeIndex, setActiveIndex] = React66.useState(0);
|
|
2488
2488
|
const { is } = useViewPort_default();
|
|
2489
2489
|
const isTabletBelow = is("tablet", "below");
|
|
2490
|
-
const accordionItems =
|
|
2490
|
+
const accordionItems = React66.useMemo(() => {
|
|
2491
2491
|
return (tabs == null ? void 0 : tabs.map((tab, index) => {
|
|
2492
2492
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2;
|
|
2493
2493
|
return {
|
|
@@ -2608,6 +2608,7 @@ var MiniBanner_module_default = {
|
|
|
2608
2608
|
logo: "MiniBanner_module_logo",
|
|
2609
2609
|
pretitle: "MiniBanner_module_pretitle",
|
|
2610
2610
|
headingWrapper: "MiniBanner_module_headingWrapper",
|
|
2611
|
+
"back-button": "MiniBanner_module_back-button",
|
|
2611
2612
|
title: "MiniBanner_module_title",
|
|
2612
2613
|
ctaContainer: "MiniBanner_module_ctaContainer",
|
|
2613
2614
|
miniBannerNoBG: "MiniBanner_module_miniBannerNoBG",
|
|
@@ -2616,6 +2617,9 @@ var MiniBanner_module_default = {
|
|
|
2616
2617
|
var MiniBannerPreTitle = ({ children }) => {
|
|
2617
2618
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
2618
2619
|
};
|
|
2620
|
+
var MiniBannerGoBack = ({ children }) => {
|
|
2621
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
2622
|
+
};
|
|
2619
2623
|
var MiniBanner = ({
|
|
2620
2624
|
className,
|
|
2621
2625
|
variant = "default",
|
|
@@ -2631,7 +2635,8 @@ var MiniBanner = ({
|
|
|
2631
2635
|
const slots = resolveCompoundSlots(children, {
|
|
2632
2636
|
pretitle: MiniBannerPreTitle,
|
|
2633
2637
|
title: MiniBannerTitle,
|
|
2634
|
-
subtitle: MiniBannerSubtitle
|
|
2638
|
+
subtitle: MiniBannerSubtitle,
|
|
2639
|
+
goBack: MiniBannerGoBack
|
|
2635
2640
|
});
|
|
2636
2641
|
const { is } = useViewPort_default();
|
|
2637
2642
|
const isTabletBelow = is("tablet", "below");
|
|
@@ -2640,13 +2645,19 @@ var MiniBanner = ({
|
|
|
2640
2645
|
const pretitleNode = (_a = slots.pretitle) != null ? _a : pretitle;
|
|
2641
2646
|
const titleNode = (_b = slots.title) != null ? _b : title;
|
|
2642
2647
|
const subtitleNode = (_c = slots.subtitle) != null ? _c : subtitle;
|
|
2648
|
+
const goBackNode = slots == null ? void 0 : slots.goBack;
|
|
2643
2649
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx15__default.default(MiniBanner_module_default.minibanner, MiniBanner_module_default[variant], className), children: [
|
|
2644
2650
|
((background == null ? void 0 : background.src) || ((_d = background == null ? void 0 : background.desktop) == null ? void 0 : _d.src) || ((_e = background == null ? void 0 : background.mobile) == null ? void 0 : _e.src)) && /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadValues({ className: MiniBanner_module_default.background }, background)),
|
|
2645
2651
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniBanner_module_default.wrapper, children: [
|
|
2646
2652
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniBanner_module_default.textContainer, children: [
|
|
2647
2653
|
(logo == null ? void 0 : logo.src) && /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadValues({ className: MiniBanner_module_default.logo }, logo)),
|
|
2648
2654
|
pretitleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx15__default.default(MiniBanner_module_default.pretitle, "small"), children: pretitleNode }),
|
|
2649
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2655
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: MiniBanner_module_default.headingWrapper, children: [
|
|
2656
|
+
goBackNode ? React66__default.default.cloneElement(goBackNode, {
|
|
2657
|
+
className: clsx15__default.default("back-button", MiniBanner_module_default["back-button"])
|
|
2658
|
+
}) : null,
|
|
2659
|
+
titleNode && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx15__default.default(MiniBanner_module_default.title, isMiniBannerTextLeft ? "h1" : "h4"), children: titleNode })
|
|
2660
|
+
] }),
|
|
2650
2661
|
subtitleNode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2651
2662
|
"div",
|
|
2652
2663
|
{
|
|
@@ -2679,7 +2690,8 @@ var MiniBanner = ({
|
|
|
2679
2690
|
// src/widgets/MiniBanner/index.ts
|
|
2680
2691
|
var MiniBanner2 = Object.assign(MiniBanner, {
|
|
2681
2692
|
Title: MiniBannerTitle,
|
|
2682
|
-
Subtitle: MiniBannerSubtitle
|
|
2693
|
+
Subtitle: MiniBannerSubtitle,
|
|
2694
|
+
GoBack: MiniBannerGoBack
|
|
2683
2695
|
});
|
|
2684
2696
|
var MiniSectionCtaTitle = ({ children }) => {
|
|
2685
2697
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
@@ -3270,13 +3282,13 @@ var ResourcesGridList = ({
|
|
|
3270
3282
|
defaultSort = "latest"
|
|
3271
3283
|
}) => {
|
|
3272
3284
|
var _a;
|
|
3273
|
-
const [view, setView] =
|
|
3274
|
-
const [isSidebarOpen, setIsSidebarOpen] =
|
|
3275
|
-
const [filterValue, setFilterValue] =
|
|
3276
|
-
const [sortValue, setSortValue] =
|
|
3277
|
-
const [searchQuery, setSearchQuery] =
|
|
3278
|
-
const [currentPage, setCurrentPage] =
|
|
3279
|
-
const [selectedCategory, setSelectedCategory] =
|
|
3285
|
+
const [view, setView] = React66.useState(defaultView);
|
|
3286
|
+
const [isSidebarOpen, setIsSidebarOpen] = React66.useState(false);
|
|
3287
|
+
const [filterValue, setFilterValue] = React66.useState(defaultFilter);
|
|
3288
|
+
const [sortValue, setSortValue] = React66.useState(defaultSort);
|
|
3289
|
+
const [searchQuery, setSearchQuery] = React66.useState("");
|
|
3290
|
+
const [currentPage, setCurrentPage] = React66.useState(1);
|
|
3291
|
+
const [selectedCategory, setSelectedCategory] = React66.useState(() => {
|
|
3280
3292
|
const activeIndex = categories.findIndex((cat) => cat.active);
|
|
3281
3293
|
return activeIndex === -1 ? 0 : activeIndex;
|
|
3282
3294
|
});
|
|
@@ -3733,7 +3745,7 @@ var NewsCardList = ({
|
|
|
3733
3745
|
/* @__PURE__ */ jsxRuntime.jsx(BlogCardGrid2, { items: cards, hasContainer: false, renderLink })
|
|
3734
3746
|
] })
|
|
3735
3747
|
] }),
|
|
3736
|
-
paginationNode ?
|
|
3748
|
+
paginationNode ? React66__default.default.cloneElement(paginationNode, {
|
|
3737
3749
|
className: clsx15__default.default("pagination", NewsCardList_module_default["pagination"])
|
|
3738
3750
|
}) : null
|
|
3739
3751
|
] })
|
|
@@ -3848,7 +3860,7 @@ var BlogSearchResultsList = ({
|
|
|
3848
3860
|
const searchNode = (_a = slots.search) != null ? _a : searchResult;
|
|
3849
3861
|
const paginationNode = slots.pagination;
|
|
3850
3862
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx15__default.default("search-results-list", BlogSearchResultsList_module_default["search-results-list"], className), children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { className: clsx15__default.default("container", BlogSearchResultsList_module_default["container"]), children: [
|
|
3851
|
-
typeof searchNode === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx15__default.default("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) :
|
|
3863
|
+
typeof searchNode === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx15__default.default("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) : React66__default.default.isValidElement(searchNode) ? React66__default.default.cloneElement(searchNode, {
|
|
3852
3864
|
className: clsx15__default.default("search-result", BlogSearchResultsList_module_default["search-result"])
|
|
3853
3865
|
}) : null,
|
|
3854
3866
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx15__default.default("wrapper", BlogSearchResultsList_module_default["wrapper"]), children: [
|
|
@@ -3876,7 +3888,7 @@ var BlogSearchResultsList = ({
|
|
|
3876
3888
|
),
|
|
3877
3889
|
/* @__PURE__ */ jsxRuntime.jsx(BlogCardGrid2, { items, hasContainer: false, renderLink })
|
|
3878
3890
|
] }),
|
|
3879
|
-
paginationNode ?
|
|
3891
|
+
paginationNode ? React66__default.default.cloneElement(paginationNode, {
|
|
3880
3892
|
className: clsx15__default.default("pagination", BlogSearchResultsList_module_default["pagination"])
|
|
3881
3893
|
}) : null
|
|
3882
3894
|
] }) });
|
|
@@ -3891,13 +3903,13 @@ function useIntersectionObserver({
|
|
|
3891
3903
|
animateOnce = false,
|
|
3892
3904
|
options = {}
|
|
3893
3905
|
} = {}) {
|
|
3894
|
-
const observeRef =
|
|
3895
|
-
const [isVisible, setIsVisible] =
|
|
3906
|
+
const observeRef = React66.useRef(null);
|
|
3907
|
+
const [isVisible, setIsVisible] = React66.useState(false);
|
|
3896
3908
|
if (typeof IntersectionObserver === "undefined") {
|
|
3897
3909
|
console.warn("IntersectionObserver is not supported in this browser.");
|
|
3898
3910
|
return { observeRef, isVisible: true };
|
|
3899
3911
|
}
|
|
3900
|
-
|
|
3912
|
+
React66.useEffect(() => {
|
|
3901
3913
|
const currentRef = observeRef.current;
|
|
3902
3914
|
if (!currentRef) return;
|
|
3903
3915
|
const observer = new IntersectionObserver((entries) => {
|