@digital-b2c/coreui-kit 0.11.12 → 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 +83 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +26 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.mjs +29 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -179,11 +179,10 @@ declare const CountingCard: (({ className, title, count, image, children }: Coun
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
type ResourceView = 'grid' | 'list';
|
|
182
|
-
type ResourceItemType = 'pdf' | '
|
|
182
|
+
type ResourceItemType = 'pdf' | 'externalLink';
|
|
183
183
|
interface ResourceItem {
|
|
184
184
|
title: string;
|
|
185
185
|
date: string;
|
|
186
|
-
image?: string;
|
|
187
186
|
type: ResourceItemType;
|
|
188
187
|
href: string;
|
|
189
188
|
hasNotification?: boolean;
|
|
@@ -558,6 +557,10 @@ interface InternalBrandsTabProps {
|
|
|
558
557
|
|
|
559
558
|
declare const InternalBrandsTab: (props: InternalBrandsTabProps) => react_jsx_runtime.JSX.Element;
|
|
560
559
|
|
|
560
|
+
type MiniBannerGoBackProps = {
|
|
561
|
+
children: ReactNode;
|
|
562
|
+
};
|
|
563
|
+
|
|
561
564
|
type MiniBannerSubtitleProps = {
|
|
562
565
|
children: ReactNode;
|
|
563
566
|
};
|
|
@@ -575,12 +578,24 @@ interface MiniBannerProps {
|
|
|
575
578
|
title?: ReactNode;
|
|
576
579
|
subtitle?: ReactNode;
|
|
577
580
|
cta?: ICtaLogo[];
|
|
581
|
+
goBackProps?: {
|
|
582
|
+
icon?: {
|
|
583
|
+
src: string;
|
|
584
|
+
alt: string;
|
|
585
|
+
};
|
|
586
|
+
link?: {
|
|
587
|
+
isExternal?: boolean;
|
|
588
|
+
href: string;
|
|
589
|
+
title?: string;
|
|
590
|
+
};
|
|
591
|
+
};
|
|
578
592
|
children?: ReactNode;
|
|
579
593
|
}
|
|
580
594
|
|
|
581
595
|
declare const MiniBanner: (({ className, variant, pretitle, title, subtitle, logo, background, cta, children, }: MiniBannerProps) => react_jsx_runtime.JSX.Element) & {
|
|
582
596
|
Title: ({ children }: MiniBannerTitleProps) => react_jsx_runtime.JSX.Element;
|
|
583
597
|
Subtitle: ({ children }: MiniBannerSubtitleProps) => react_jsx_runtime.JSX.Element;
|
|
598
|
+
GoBack: ({ children }: MiniBannerGoBackProps) => react_jsx_runtime.JSX.Element;
|
|
584
599
|
};
|
|
585
600
|
|
|
586
601
|
type MiniSectionCtaSubtitleProps = {
|
package/dist/index.d.ts
CHANGED
|
@@ -179,11 +179,10 @@ declare const CountingCard: (({ className, title, count, image, children }: Coun
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
type ResourceView = 'grid' | 'list';
|
|
182
|
-
type ResourceItemType = 'pdf' | '
|
|
182
|
+
type ResourceItemType = 'pdf' | 'externalLink';
|
|
183
183
|
interface ResourceItem {
|
|
184
184
|
title: string;
|
|
185
185
|
date: string;
|
|
186
|
-
image?: string;
|
|
187
186
|
type: ResourceItemType;
|
|
188
187
|
href: string;
|
|
189
188
|
hasNotification?: boolean;
|
|
@@ -558,6 +557,10 @@ interface InternalBrandsTabProps {
|
|
|
558
557
|
|
|
559
558
|
declare const InternalBrandsTab: (props: InternalBrandsTabProps) => react_jsx_runtime.JSX.Element;
|
|
560
559
|
|
|
560
|
+
type MiniBannerGoBackProps = {
|
|
561
|
+
children: ReactNode;
|
|
562
|
+
};
|
|
563
|
+
|
|
561
564
|
type MiniBannerSubtitleProps = {
|
|
562
565
|
children: ReactNode;
|
|
563
566
|
};
|
|
@@ -575,12 +578,24 @@ interface MiniBannerProps {
|
|
|
575
578
|
title?: ReactNode;
|
|
576
579
|
subtitle?: ReactNode;
|
|
577
580
|
cta?: ICtaLogo[];
|
|
581
|
+
goBackProps?: {
|
|
582
|
+
icon?: {
|
|
583
|
+
src: string;
|
|
584
|
+
alt: string;
|
|
585
|
+
};
|
|
586
|
+
link?: {
|
|
587
|
+
isExternal?: boolean;
|
|
588
|
+
href: string;
|
|
589
|
+
title?: string;
|
|
590
|
+
};
|
|
591
|
+
};
|
|
578
592
|
children?: ReactNode;
|
|
579
593
|
}
|
|
580
594
|
|
|
581
595
|
declare const MiniBanner: (({ className, variant, pretitle, title, subtitle, logo, background, cta, children, }: MiniBannerProps) => react_jsx_runtime.JSX.Element) & {
|
|
582
596
|
Title: ({ children }: MiniBannerTitleProps) => react_jsx_runtime.JSX.Element;
|
|
583
597
|
Subtitle: ({ children }: MiniBannerSubtitleProps) => react_jsx_runtime.JSX.Element;
|
|
598
|
+
GoBack: ({ children }: MiniBannerGoBackProps) => react_jsx_runtime.JSX.Element;
|
|
584
599
|
};
|
|
585
600
|
|
|
586
601
|
type MiniSectionCtaSubtitleProps = {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx15 from 'clsx';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React66, { forwardRef, useId, useRef, useState, useCallback, useMemo, Children, isValidElement, useEffect, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import gsap$1, { gsap } from 'gsap';
|
|
5
5
|
import { useGSAP } from '@gsap/react';
|
|
6
6
|
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
@@ -374,7 +374,7 @@ var svgs = {
|
|
|
374
374
|
xBlack: icon_x_black_default,
|
|
375
375
|
xWhite: icon_x_white_default
|
|
376
376
|
};
|
|
377
|
-
var Icon =
|
|
377
|
+
var Icon = React66.memo(
|
|
378
378
|
(_a) => {
|
|
379
379
|
var _b = _a, { type, size } = _b, props = __objRest(_b, ["type", "size"]);
|
|
380
380
|
if (type) {
|
|
@@ -1267,20 +1267,14 @@ var ResourceCardItem_module_default = {
|
|
|
1267
1267
|
cardList: "ResourceCardItem_module_cardList",
|
|
1268
1268
|
cardListLeft: "ResourceCardItem_module_cardListLeft",
|
|
1269
1269
|
cardListRight: "ResourceCardItem_module_cardListRight",
|
|
1270
|
-
notificationDot: "ResourceCardItem_module_notificationDot"
|
|
1271
|
-
iconWrapper: "ResourceCardItem_module_iconWrapper"
|
|
1272
|
-
};
|
|
1273
|
-
var ResourceIcon = ({ image, type }) => {
|
|
1274
|
-
if (!image) return null;
|
|
1275
|
-
return /* @__PURE__ */ jsx("div", { className: ResourceCardItem_module_default.iconWrapper, children: /* @__PURE__ */ jsx("img", { src: image, alt: type != null ? type : "", width: 32, height: 32 }) });
|
|
1276
|
-
};
|
|
1270
|
+
notificationDot: "ResourceCardItem_module_notificationDot"};
|
|
1277
1271
|
var ResourceCardItem = ({ item, view }) => {
|
|
1278
1272
|
const hasHref = Boolean(item.href);
|
|
1279
1273
|
const linkWrapper = ({ children }) => /* @__PURE__ */ jsx("a", { href: item.href, className: ResourceCardItem_module_default.cardLink, target: "_blank", rel: "noopener noreferrer", children });
|
|
1280
1274
|
if (view === "grid") {
|
|
1281
1275
|
return /* @__PURE__ */ jsx("article", { className: ResourceCardItem_module_default.cardGrid, children: /* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardBody, children: [
|
|
1282
1276
|
/* @__PURE__ */ jsx(ConditionalWrapper, { condition: hasHref, wrapper: linkWrapper, children: /* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardIconTitle, children: [
|
|
1283
|
-
/* @__PURE__ */ jsx(
|
|
1277
|
+
/* @__PURE__ */ jsx(Icon, { type: item.type === "pdf" ? "pdf" : "externalLink", size: 25 }),
|
|
1284
1278
|
/* @__PURE__ */ jsx("span", { className: ResourceCardItem_module_default.cardTitle, children: item.title })
|
|
1285
1279
|
] }) }),
|
|
1286
1280
|
/* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardMeta, children: [
|
|
@@ -1295,7 +1289,7 @@ var ResourceCardItem = ({ item, view }) => {
|
|
|
1295
1289
|
/* @__PURE__ */ jsx("span", { className: ResourceCardItem_module_default.cardDate, children: item.date })
|
|
1296
1290
|
] }),
|
|
1297
1291
|
/* @__PURE__ */ jsx(ConditionalWrapper, { condition: hasHref, wrapper: linkWrapper, children: /* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardListRight, children: [
|
|
1298
|
-
/* @__PURE__ */ jsx(
|
|
1292
|
+
/* @__PURE__ */ jsx(Icon, { type: item.type === "pdf" ? "pdf" : "externalLink", size: 25 }),
|
|
1299
1293
|
/* @__PURE__ */ jsx("span", { className: ResourceCardItem_module_default.cardTitle, children: item.title })
|
|
1300
1294
|
] }) })
|
|
1301
1295
|
] });
|
|
@@ -2606,6 +2600,7 @@ var MiniBanner_module_default = {
|
|
|
2606
2600
|
logo: "MiniBanner_module_logo",
|
|
2607
2601
|
pretitle: "MiniBanner_module_pretitle",
|
|
2608
2602
|
headingWrapper: "MiniBanner_module_headingWrapper",
|
|
2603
|
+
"back-button": "MiniBanner_module_back-button",
|
|
2609
2604
|
title: "MiniBanner_module_title",
|
|
2610
2605
|
ctaContainer: "MiniBanner_module_ctaContainer",
|
|
2611
2606
|
miniBannerNoBG: "MiniBanner_module_miniBannerNoBG",
|
|
@@ -2614,6 +2609,9 @@ var MiniBanner_module_default = {
|
|
|
2614
2609
|
var MiniBannerPreTitle = ({ children }) => {
|
|
2615
2610
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
2616
2611
|
};
|
|
2612
|
+
var MiniBannerGoBack = ({ children }) => {
|
|
2613
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
2614
|
+
};
|
|
2617
2615
|
var MiniBanner = ({
|
|
2618
2616
|
className,
|
|
2619
2617
|
variant = "default",
|
|
@@ -2629,7 +2627,8 @@ var MiniBanner = ({
|
|
|
2629
2627
|
const slots = resolveCompoundSlots(children, {
|
|
2630
2628
|
pretitle: MiniBannerPreTitle,
|
|
2631
2629
|
title: MiniBannerTitle,
|
|
2632
|
-
subtitle: MiniBannerSubtitle
|
|
2630
|
+
subtitle: MiniBannerSubtitle,
|
|
2631
|
+
goBack: MiniBannerGoBack
|
|
2633
2632
|
});
|
|
2634
2633
|
const { is } = useViewPort_default();
|
|
2635
2634
|
const isTabletBelow = is("tablet", "below");
|
|
@@ -2638,13 +2637,19 @@ var MiniBanner = ({
|
|
|
2638
2637
|
const pretitleNode = (_a = slots.pretitle) != null ? _a : pretitle;
|
|
2639
2638
|
const titleNode = (_b = slots.title) != null ? _b : title;
|
|
2640
2639
|
const subtitleNode = (_c = slots.subtitle) != null ? _c : subtitle;
|
|
2640
|
+
const goBackNode = slots == null ? void 0 : slots.goBack;
|
|
2641
2641
|
return /* @__PURE__ */ jsxs("div", { className: clsx15(MiniBanner_module_default.minibanner, MiniBanner_module_default[variant], className), children: [
|
|
2642
2642
|
((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__ */ jsx(Picture, __spreadValues({ className: MiniBanner_module_default.background }, background)),
|
|
2643
2643
|
/* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.wrapper, children: [
|
|
2644
2644
|
/* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.textContainer, children: [
|
|
2645
2645
|
(logo == null ? void 0 : logo.src) && /* @__PURE__ */ jsx(Picture, __spreadValues({ className: MiniBanner_module_default.logo }, logo)),
|
|
2646
2646
|
pretitleNode && /* @__PURE__ */ jsx("div", { className: clsx15(MiniBanner_module_default.pretitle, "small"), children: pretitleNode }),
|
|
2647
|
-
/* @__PURE__ */
|
|
2647
|
+
/* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.headingWrapper, children: [
|
|
2648
|
+
goBackNode ? React66.cloneElement(goBackNode, {
|
|
2649
|
+
className: clsx15("back-button", MiniBanner_module_default["back-button"])
|
|
2650
|
+
}) : null,
|
|
2651
|
+
titleNode && /* @__PURE__ */ jsx("div", { className: clsx15(MiniBanner_module_default.title, isMiniBannerTextLeft ? "h1" : "h4"), children: titleNode })
|
|
2652
|
+
] }),
|
|
2648
2653
|
subtitleNode && /* @__PURE__ */ jsx(
|
|
2649
2654
|
"div",
|
|
2650
2655
|
{
|
|
@@ -2677,7 +2682,8 @@ var MiniBanner = ({
|
|
|
2677
2682
|
// src/widgets/MiniBanner/index.ts
|
|
2678
2683
|
var MiniBanner2 = Object.assign(MiniBanner, {
|
|
2679
2684
|
Title: MiniBannerTitle,
|
|
2680
|
-
Subtitle: MiniBannerSubtitle
|
|
2685
|
+
Subtitle: MiniBannerSubtitle,
|
|
2686
|
+
GoBack: MiniBannerGoBack
|
|
2681
2687
|
});
|
|
2682
2688
|
var MiniSectionCtaTitle = ({ children }) => {
|
|
2683
2689
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
@@ -3282,8 +3288,14 @@ var ResourcesGridList = ({
|
|
|
3282
3288
|
const isMobile = is("tablet", "below");
|
|
3283
3289
|
const selectedValue = (_a = categories[selectedCategory]) == null ? void 0 : _a.value;
|
|
3284
3290
|
const handleSelectCategory = (index) => {
|
|
3291
|
+
var _a2, _b;
|
|
3285
3292
|
setSelectedCategory(index);
|
|
3286
3293
|
setCurrentPage(1);
|
|
3294
|
+
const categoryText = (_b = (_a2 = categories[index]) == null ? void 0 : _a2.label) == null ? void 0 : _b.replaceAll(" ", "-");
|
|
3295
|
+
if (typeof window !== "undefined" && categoryText) {
|
|
3296
|
+
const url = `${window.location.pathname}#${categoryText}`;
|
|
3297
|
+
window.history.replaceState(null, "", url);
|
|
3298
|
+
}
|
|
3287
3299
|
if (isMobile) setIsSidebarOpen(false);
|
|
3288
3300
|
};
|
|
3289
3301
|
const handleFilterChange = (value) => {
|
|
@@ -3725,7 +3737,7 @@ var NewsCardList = ({
|
|
|
3725
3737
|
/* @__PURE__ */ jsx(BlogCardGrid2, { items: cards, hasContainer: false, renderLink })
|
|
3726
3738
|
] })
|
|
3727
3739
|
] }),
|
|
3728
|
-
paginationNode ?
|
|
3740
|
+
paginationNode ? React66.cloneElement(paginationNode, {
|
|
3729
3741
|
className: clsx15("pagination", NewsCardList_module_default["pagination"])
|
|
3730
3742
|
}) : null
|
|
3731
3743
|
] })
|
|
@@ -3840,7 +3852,7 @@ var BlogSearchResultsList = ({
|
|
|
3840
3852
|
const searchNode = (_a = slots.search) != null ? _a : searchResult;
|
|
3841
3853
|
const paginationNode = slots.pagination;
|
|
3842
3854
|
return /* @__PURE__ */ jsx("div", { className: clsx15("search-results-list", BlogSearchResultsList_module_default["search-results-list"], className), children: /* @__PURE__ */ jsxs(Container, { className: clsx15("container", BlogSearchResultsList_module_default["container"]), children: [
|
|
3843
|
-
typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx15("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) :
|
|
3855
|
+
typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx15("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) : React66.isValidElement(searchNode) ? React66.cloneElement(searchNode, {
|
|
3844
3856
|
className: clsx15("search-result", BlogSearchResultsList_module_default["search-result"])
|
|
3845
3857
|
}) : null,
|
|
3846
3858
|
/* @__PURE__ */ jsxs("div", { className: clsx15("wrapper", BlogSearchResultsList_module_default["wrapper"]), children: [
|
|
@@ -3868,7 +3880,7 @@ var BlogSearchResultsList = ({
|
|
|
3868
3880
|
),
|
|
3869
3881
|
/* @__PURE__ */ jsx(BlogCardGrid2, { items, hasContainer: false, renderLink })
|
|
3870
3882
|
] }),
|
|
3871
|
-
paginationNode ?
|
|
3883
|
+
paginationNode ? React66.cloneElement(paginationNode, {
|
|
3872
3884
|
className: clsx15("pagination", BlogSearchResultsList_module_default["pagination"])
|
|
3873
3885
|
}) : null
|
|
3874
3886
|
] }) });
|