@digital-b2c/coreui-kit 0.14.3 → 0.14.5
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 +135 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +22 -1
- 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 +63 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -43,6 +43,7 @@ declare const svgs: {
|
|
|
43
43
|
externalLink: string;
|
|
44
44
|
newIcon: string;
|
|
45
45
|
play: string;
|
|
46
|
+
lock: string;
|
|
46
47
|
blankCheckbox: string;
|
|
47
48
|
blankCheckboxWhite: string;
|
|
48
49
|
checkedBox: string;
|
|
@@ -180,7 +181,7 @@ declare const CountingCard: (({ className, title, count, image, children }: Coun
|
|
|
180
181
|
};
|
|
181
182
|
|
|
182
183
|
type ResourceView = 'grid' | 'list';
|
|
183
|
-
type ResourceItemType = 'pdf' | 'externalLink';
|
|
184
|
+
type ResourceItemType = 'pdf' | 'externalLink' | 'restricted';
|
|
184
185
|
interface ResourceItem {
|
|
185
186
|
title: string;
|
|
186
187
|
bodyText?: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ declare const svgs: {
|
|
|
43
43
|
externalLink: string;
|
|
44
44
|
newIcon: string;
|
|
45
45
|
play: string;
|
|
46
|
+
lock: string;
|
|
46
47
|
blankCheckbox: string;
|
|
47
48
|
blankCheckboxWhite: string;
|
|
48
49
|
checkedBox: string;
|
|
@@ -180,7 +181,7 @@ declare const CountingCard: (({ className, title, count, image, children }: Coun
|
|
|
180
181
|
};
|
|
181
182
|
|
|
182
183
|
type ResourceView = 'grid' | 'list';
|
|
183
|
-
type ResourceItemType = 'pdf' | 'externalLink';
|
|
184
|
+
type ResourceItemType = 'pdf' | 'externalLink' | 'restricted';
|
|
184
185
|
interface ResourceItem {
|
|
185
186
|
title: string;
|
|
186
187
|
bodyText?: ReactNode;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx43 from 'clsx';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React69, { forwardRef, useId, useRef, useState, useCallback, useMemo, useEffect, Children, isValidElement, 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';
|
|
@@ -312,6 +312,11 @@ var SvgIconPlay = (props) => /* @__PURE__ */ jsxs("svg", __spreadProps(__spreadV
|
|
|
312
312
|
/* @__PURE__ */ jsx("path", { d: "M53.4617 90.7285L90.7305 66.9993L53.4617 43.2702V90.7285ZM67.0013 122.833C59.3707 122.833 52.1589 121.367 45.3659 118.436C38.5728 115.505 32.6405 111.503 27.569 106.432C22.4975 101.36 18.4961 95.4278 15.5648 88.6348C12.6336 81.8417 11.168 74.6299 11.168 66.9993C11.168 59.2757 12.6336 52.0174 15.5648 45.2243C18.4961 38.4313 22.4975 32.5223 27.569 27.4973C32.6405 22.4723 38.5728 18.4941 45.3659 15.5629C52.1589 12.6316 59.3707 11.166 67.0013 11.166C74.7249 11.166 81.9833 12.6316 88.7763 15.5629C95.5694 18.4941 101.478 22.4723 106.503 27.4973C111.528 32.5223 115.507 38.4313 118.438 45.2243C121.369 52.0174 122.835 59.2757 122.835 66.9993C122.835 74.6299 121.369 81.8417 118.438 88.6348C115.507 95.4278 111.528 101.36 106.503 106.432C101.478 111.503 95.5694 115.505 88.7763 118.436C81.9833 121.367 74.7249 122.833 67.0013 122.833Z", fill: "#080808" })
|
|
313
313
|
] }));
|
|
314
314
|
var icon_play_default = SvgIconPlay;
|
|
315
|
+
var SvgIconLock = (props) => /* @__PURE__ */ jsxs("svg", __spreadProps(__spreadValues({ width: 37, height: 38, viewBox: "0 0 37 38", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props), { children: [
|
|
316
|
+
/* @__PURE__ */ jsx("g", { clipPath: "url(#clip0_11156_23256)", children: /* @__PURE__ */ jsx("path", { d: "M9.24935 34.832C8.40143 34.832 7.67556 34.522 7.07174 33.9018C6.46793 33.2817 6.16602 32.5362 6.16602 31.6654V15.832C6.16602 14.9612 6.46793 14.2157 7.07174 13.5956C7.67556 12.9754 8.40143 12.6654 9.24935 12.6654H10.791V9.4987C10.791 7.30842 11.5426 5.44141 13.0457 3.89766C14.5488 2.35391 16.3667 1.58203 18.4993 1.58203C20.632 1.58203 22.4499 2.35391 23.953 3.89766C25.4561 5.44141 26.2077 7.30842 26.2077 9.4987V12.6654H27.7493C28.5973 12.6654 29.3231 12.9754 29.927 13.5956C30.5308 14.2157 30.8327 14.9612 30.8327 15.832V31.6654C30.8327 32.5362 30.5308 33.2817 29.927 33.9018C29.3231 34.522 28.5973 34.832 27.7493 34.832H9.24935ZM9.24935 31.6654H27.7493V15.832H9.24935V31.6654ZM20.677 25.9852C21.2808 25.365 21.5827 24.6195 21.5827 23.7487C21.5827 22.8779 21.2808 22.1324 20.677 21.5122C20.0731 20.8921 19.3473 20.582 18.4993 20.582C17.6514 20.582 16.9256 20.8921 16.3217 21.5122C15.7179 22.1324 15.416 22.8779 15.416 23.7487C15.416 24.6195 15.7179 25.365 16.3217 25.9852C16.9256 26.6053 17.6514 26.9154 18.4993 26.9154C19.3473 26.9154 20.0731 26.6053 20.677 25.9852ZM13.8743 12.6654H23.1243V9.4987C23.1243 8.17925 22.6747 7.05773 21.7754 6.13411C20.8761 5.2105 19.7841 4.7487 18.4993 4.7487C17.2146 4.7487 16.1226 5.2105 15.2233 6.13411C14.324 7.05773 13.8743 8.17925 13.8743 9.4987V12.6654Z", fill: "#DBDBDB" }) }),
|
|
317
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_11156_23256", children: /* @__PURE__ */ jsx("rect", { width: 37, height: 38, fill: "white" }) }) })
|
|
318
|
+
] }));
|
|
319
|
+
var icon_lock_default = SvgIconLock;
|
|
315
320
|
var svgs = {
|
|
316
321
|
/* Card */
|
|
317
322
|
ads: icon_ads_default,
|
|
@@ -336,6 +341,7 @@ var svgs = {
|
|
|
336
341
|
externalLink: icon_external_link_default,
|
|
337
342
|
newIcon: icon_new_default,
|
|
338
343
|
play: icon_play_default,
|
|
344
|
+
lock: icon_lock_default,
|
|
339
345
|
/* Button */
|
|
340
346
|
blankCheckbox: icon_blank_checkbox_default,
|
|
341
347
|
blankCheckboxWhite: icon_blank_checkbox_white_default,
|
|
@@ -381,7 +387,7 @@ var svgs = {
|
|
|
381
387
|
xBlack: icon_x_black_default,
|
|
382
388
|
xWhite: icon_x_white_default
|
|
383
389
|
};
|
|
384
|
-
var Icon =
|
|
390
|
+
var Icon = React69.memo(
|
|
385
391
|
(_a) => {
|
|
386
392
|
var _b = _a, { type, size } = _b, props = __objRest(_b, ["type", "size"]);
|
|
387
393
|
if (type) {
|
|
@@ -1304,6 +1310,7 @@ var ResourceCardItem_module_default = {
|
|
|
1304
1310
|
cardLink: "ResourceCardItem_module_cardLink",
|
|
1305
1311
|
"global-search": "ResourceCardItem_module_global-search",
|
|
1306
1312
|
cardGrid: "ResourceCardItem_module_cardGrid",
|
|
1313
|
+
restricted: "ResourceCardItem_module_restricted",
|
|
1307
1314
|
cardBody: "ResourceCardItem_module_cardBody",
|
|
1308
1315
|
cardIconTitle: "ResourceCardItem_module_cardIconTitle",
|
|
1309
1316
|
cardTitle: "ResourceCardItem_module_cardTitle",
|
|
@@ -1322,12 +1329,13 @@ var ResourceCardItem_module_default = {
|
|
|
1322
1329
|
var ResourceCardItem = ({ item, view, variant, renderLink }) => {
|
|
1323
1330
|
const hasHref = Boolean(item.href);
|
|
1324
1331
|
const isGlobalSearchVariant = variant === "global-search";
|
|
1332
|
+
const isRestricted = (item == null ? void 0 : item.type) === "restricted";
|
|
1325
1333
|
const linkProps = hasHref ? {
|
|
1326
1334
|
href: item.href,
|
|
1327
1335
|
target: "_blank",
|
|
1328
1336
|
rel: "noopener noreferrer",
|
|
1329
|
-
|
|
1330
|
-
"aria-
|
|
1337
|
+
"aria-label": item.title,
|
|
1338
|
+
"aria-disabled": isRestricted
|
|
1331
1339
|
} : null;
|
|
1332
1340
|
const cardLink = linkProps && isGlobalSearchVariant ? renderLink ? renderLink(__spreadProps(__spreadValues({}, linkProps), {
|
|
1333
1341
|
className: clsx43(ResourceCardItem_module_default.cardLink, isGlobalSearchVariant && ResourceCardItem_module_default[variant]),
|
|
@@ -1338,24 +1346,51 @@ var ResourceCardItem = ({ item, view, variant, renderLink }) => {
|
|
|
1338
1346
|
className: clsx43(ResourceCardItem_module_default.cardLink, isGlobalSearchVariant && ResourceCardItem_module_default[variant])
|
|
1339
1347
|
})
|
|
1340
1348
|
) : null;
|
|
1341
|
-
const linkWrapper = ({ children }) => /* @__PURE__ */ jsx("a", __spreadProps(__spreadValues({}, linkProps), { tabIndex: isGlobalSearchVariant ? -1 : 0, children }));
|
|
1349
|
+
const linkWrapper = ({ children }) => /* @__PURE__ */ jsx("a", __spreadProps(__spreadValues({}, linkProps), { tabIndex: isGlobalSearchVariant ? -1 : 0, className: clsx43(ResourceCardItem_module_default.cardLink), children }));
|
|
1350
|
+
function getIcon() {
|
|
1351
|
+
switch (item.type) {
|
|
1352
|
+
case "pdf":
|
|
1353
|
+
return "pdf";
|
|
1354
|
+
case "externalLink":
|
|
1355
|
+
return "externalLink";
|
|
1356
|
+
case "restricted":
|
|
1357
|
+
return "lock";
|
|
1358
|
+
default:
|
|
1359
|
+
return "externalLink";
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1342
1362
|
if (view === "grid") {
|
|
1343
|
-
return /* @__PURE__ */ jsxs(
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1363
|
+
return /* @__PURE__ */ jsxs(
|
|
1364
|
+
"article",
|
|
1365
|
+
{
|
|
1366
|
+
className: clsx43(
|
|
1367
|
+
ResourceCardItem_module_default.cardGrid,
|
|
1368
|
+
isGlobalSearchVariant && ResourceCardItem_module_default[variant],
|
|
1369
|
+
isGlobalSearchVariant && isRestricted ? ResourceCardItem_module_default["restricted"] : null
|
|
1370
|
+
),
|
|
1371
|
+
"aria-labelledby": `title-${item.id}`,
|
|
1372
|
+
"aria-describedby": isRestricted ? `restricted-${item.id}` : void 0,
|
|
1373
|
+
children: [
|
|
1374
|
+
cardLink,
|
|
1375
|
+
/* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardBody, children: [
|
|
1376
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1377
|
+
/* @__PURE__ */ jsx(ConditionalWrapper, { condition: hasHref, wrapper: linkWrapper, children: /* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardIconTitle, children: [
|
|
1378
|
+
/* @__PURE__ */ jsx(Icon, { type: getIcon(), size: 33 }),
|
|
1379
|
+
/* @__PURE__ */ jsx("span", { className: ResourceCardItem_module_default.cardTitle, id: `title-${item.id}`, children: item.title })
|
|
1380
|
+
] }) }),
|
|
1381
|
+
item.bodyText && /* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardBodyTextGrid, children: [
|
|
1382
|
+
/* @__PURE__ */ jsx("span", { className: ResourceCardItem_module_default.cardBodyText, children: item.bodyText }),
|
|
1383
|
+
isRestricted && /* @__PURE__ */ jsx("p", { id: `restricted-${item.id}`, className: "sr-only", children: "This resource is restricted. You do not have permission to access it." })
|
|
1384
|
+
] })
|
|
1385
|
+
] }),
|
|
1386
|
+
/* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardMeta, children: [
|
|
1387
|
+
/* @__PURE__ */ jsx("span", { className: ResourceCardItem_module_default.cardDate, children: item.date }),
|
|
1388
|
+
item.hasNotification && /* @__PURE__ */ jsx("span", { className: ResourceCardItem_module_default.notificationDot, "aria-label": "New" })
|
|
1389
|
+
] })
|
|
1390
|
+
] })
|
|
1391
|
+
]
|
|
1392
|
+
}
|
|
1393
|
+
);
|
|
1359
1394
|
}
|
|
1360
1395
|
return /* @__PURE__ */ jsxs("article", { className: ResourceCardItem_module_default.cardList, children: [
|
|
1361
1396
|
/* @__PURE__ */ jsxs("div", { className: ResourceCardItem_module_default.cardListLeft, children: [
|
|
@@ -2724,7 +2759,7 @@ var MiniBanner = ({
|
|
|
2724
2759
|
(logo == null ? void 0 : logo.src) && /* @__PURE__ */ jsx(Picture, __spreadValues({ className: MiniBanner_module_default.logo }, logo)),
|
|
2725
2760
|
pretitleNode && /* @__PURE__ */ jsx("div", { className: clsx43(MiniBanner_module_default.pretitle, "small"), children: pretitleNode }),
|
|
2726
2761
|
/* @__PURE__ */ jsxs("div", { className: MiniBanner_module_default.headingWrapper, children: [
|
|
2727
|
-
goBackNode ?
|
|
2762
|
+
goBackNode ? React69.cloneElement(goBackNode, {
|
|
2728
2763
|
className: clsx43("back-button", MiniBanner_module_default["back-button"])
|
|
2729
2764
|
}) : null,
|
|
2730
2765
|
titleNode && /* @__PURE__ */ jsx("div", { className: clsx43(MiniBanner_module_default.title, isMiniBannerTextLeft ? "h1" : "h4"), children: titleNode })
|
|
@@ -3606,7 +3641,7 @@ var EventList = ({
|
|
|
3606
3641
|
}
|
|
3607
3642
|
)
|
|
3608
3643
|
] }),
|
|
3609
|
-
!isNotEmpty && emptyNode ?
|
|
3644
|
+
!isNotEmpty && emptyNode ? React69.cloneElement(emptyNode, {
|
|
3610
3645
|
className: clsx43("empty-search-result", EventList_module_default["empty-search-result"])
|
|
3611
3646
|
}) : null
|
|
3612
3647
|
] })
|
|
@@ -4262,7 +4297,7 @@ var NewsCardList = ({
|
|
|
4262
4297
|
/* @__PURE__ */ jsx(BlogCardGrid2, { items: cards, hasContainer: false, renderLink })
|
|
4263
4298
|
] })
|
|
4264
4299
|
] }),
|
|
4265
|
-
paginationNode ?
|
|
4300
|
+
paginationNode ? React69.cloneElement(paginationNode, {
|
|
4266
4301
|
className: clsx43("pagination", NewsCardList_module_default["pagination"])
|
|
4267
4302
|
}) : null
|
|
4268
4303
|
] })
|
|
@@ -4378,7 +4413,7 @@ var BlogSearchResultsList = ({
|
|
|
4378
4413
|
const searchNode = (_a = slots.search) != null ? _a : searchResult;
|
|
4379
4414
|
const paginationNode = slots.pagination;
|
|
4380
4415
|
return /* @__PURE__ */ jsx("div", { className: clsx43("search-results-list", BlogSearchResultsList_module_default["search-results-list"], className), children: /* @__PURE__ */ jsxs(Container, { className: clsx43("container", BlogSearchResultsList_module_default["container"]), children: [
|
|
4381
|
-
typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) :
|
|
4416
|
+
typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"]), children: searchNode }) : React69.isValidElement(searchNode) ? React69.cloneElement(searchNode, {
|
|
4382
4417
|
className: clsx43("search-result", BlogSearchResultsList_module_default["search-result"])
|
|
4383
4418
|
}) : null,
|
|
4384
4419
|
/* @__PURE__ */ jsxs("div", { className: clsx43("wrapper", BlogSearchResultsList_module_default["wrapper"]), children: [
|
|
@@ -4406,7 +4441,7 @@ var BlogSearchResultsList = ({
|
|
|
4406
4441
|
),
|
|
4407
4442
|
/* @__PURE__ */ jsx(BlogCardGrid2, { items, hasContainer: false, renderLink })
|
|
4408
4443
|
] }),
|
|
4409
|
-
paginationNode ?
|
|
4444
|
+
paginationNode ? React69.cloneElement(paginationNode, {
|
|
4410
4445
|
className: clsx43("pagination", BlogSearchResultsList_module_default["pagination"])
|
|
4411
4446
|
}) : null
|
|
4412
4447
|
] }) });
|
|
@@ -4449,7 +4484,7 @@ var GlobalSearchResultsList = ({
|
|
|
4449
4484
|
const searchNode = (_a = slots.search) != null ? _a : searchResult;
|
|
4450
4485
|
const paginationNode = slots.pagination;
|
|
4451
4486
|
return /* @__PURE__ */ jsx("div", { className: clsx43("search-results-list", GlobalSearchResultsList_module_default["search-results-list"], className), children: /* @__PURE__ */ jsxs(Container, { className: clsx43("container", GlobalSearchResultsList_module_default["container"]), children: [
|
|
4452
|
-
typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"]), children: searchNode }) :
|
|
4487
|
+
typeof searchNode === "string" ? /* @__PURE__ */ jsx("span", { className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"]), children: searchNode }) : React69.isValidElement(searchNode) ? React69.cloneElement(searchNode, {
|
|
4453
4488
|
className: clsx43("search-result", GlobalSearchResultsList_module_default["search-result"])
|
|
4454
4489
|
}) : null,
|
|
4455
4490
|
/* @__PURE__ */ jsx("div", { className: clsx43("wrapper", GlobalSearchResultsList_module_default["wrapper"]), children: /* @__PURE__ */ jsx(Grid, { role: "list", columns: 3, children: items.map((item, index) => {
|
|
@@ -4464,7 +4499,7 @@ var GlobalSearchResultsList = ({
|
|
|
4464
4499
|
}
|
|
4465
4500
|
) }, (_a2 = item.title) != null ? _a2 : index);
|
|
4466
4501
|
}) }) }),
|
|
4467
|
-
paginationNode ?
|
|
4502
|
+
paginationNode ? React69.cloneElement(paginationNode, {
|
|
4468
4503
|
className: clsx43("pagination", GlobalSearchResultsList_module_default["pagination"])
|
|
4469
4504
|
}) : null
|
|
4470
4505
|
] }) });
|