@digital-b2c/coreui-kit 0.11.19 → 0.11.21

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 CHANGED
@@ -1270,6 +1270,9 @@ var ResourceCardItem_module_default = {
1270
1270
  cardBody: "ResourceCardItem_module_cardBody",
1271
1271
  cardIconTitle: "ResourceCardItem_module_cardIconTitle",
1272
1272
  cardTitle: "ResourceCardItem_module_cardTitle",
1273
+ cardBodyTextGrid: "ResourceCardItem_module_cardBodyTextGrid",
1274
+ cardBodyTextList: "ResourceCardItem_module_cardBodyTextList",
1275
+ cardBodyText: "ResourceCardItem_module_cardBodyText",
1273
1276
  cardMeta: "ResourceCardItem_module_cardMeta",
1274
1277
  cardDate: "ResourceCardItem_module_cardDate",
1275
1278
  cardList: "ResourceCardItem_module_cardList",
@@ -1281,10 +1284,13 @@ var ResourceCardItem = ({ item, view }) => {
1281
1284
  const linkWrapper = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, className: ResourceCardItem_module_default.cardLink, target: "_blank", rel: "noopener noreferrer", children });
1282
1285
  if (view === "grid") {
1283
1286
  return /* @__PURE__ */ jsxRuntime.jsx("article", { className: ResourceCardItem_module_default.cardGrid, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ResourceCardItem_module_default.cardBody, children: [
1284
- /* @__PURE__ */ jsxRuntime.jsx(ConditionalWrapper, { condition: hasHref, wrapper: linkWrapper, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ResourceCardItem_module_default.cardIconTitle, children: [
1285
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: item.type === "pdf" ? "pdf" : "externalLink", size: 25 }),
1286
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardTitle, children: item.title })
1287
- ] }) }),
1287
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1288
+ /* @__PURE__ */ jsxRuntime.jsx(ConditionalWrapper, { condition: hasHref, wrapper: linkWrapper, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ResourceCardItem_module_default.cardIconTitle, children: [
1289
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: item.type === "pdf" ? "pdf" : "externalLink", size: 33 }),
1290
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardTitle, children: item.title })
1291
+ ] }) }),
1292
+ item.bodyText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ResourceCardItem_module_default.cardBodyTextGrid, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardBodyText, children: item.bodyText }) })
1293
+ ] }),
1288
1294
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ResourceCardItem_module_default.cardMeta, children: [
1289
1295
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardDate, children: item.date }),
1290
1296
  item.hasNotification && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.notificationDot, "aria-label": "New" })
@@ -1296,10 +1302,13 @@ var ResourceCardItem = ({ item, view }) => {
1296
1302
  item.hasNotification && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.notificationDot, "aria-label": "New" }),
1297
1303
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardDate, children: item.date })
1298
1304
  ] }),
1299
- /* @__PURE__ */ jsxRuntime.jsx(ConditionalWrapper, { condition: hasHref, wrapper: linkWrapper, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ResourceCardItem_module_default.cardListRight, children: [
1300
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: item.type === "pdf" ? "pdf" : "externalLink", size: 25 }),
1301
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardTitle, children: item.title })
1302
- ] }) })
1305
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1306
+ /* @__PURE__ */ jsxRuntime.jsx(ConditionalWrapper, { condition: hasHref, wrapper: linkWrapper, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ResourceCardItem_module_default.cardListRight, children: [
1307
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { type: item.type === "pdf" ? "pdf" : "externalLink", size: 33 }),
1308
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardTitle, children: item.title })
1309
+ ] }) }),
1310
+ item.bodyText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ResourceCardItem_module_default.cardBodyTextList, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: ResourceCardItem_module_default.cardBodyText, children: item.bodyText }) })
1311
+ ] })
1303
1312
  ] });
1304
1313
  };
1305
1314
 
@@ -3292,6 +3301,7 @@ var ResourcesGridList = ({
3292
3301
  const activeIndex = categories.findIndex((cat) => cat.active);
3293
3302
  return activeIndex === -1 ? 0 : activeIndex;
3294
3303
  });
3304
+ const widgetRef = React66.useRef(null);
3295
3305
  const { is } = useViewPort_default();
3296
3306
  const isMobile = is("tablet", "below");
3297
3307
  const selectedValue = (_a = categories[selectedCategory]) == null ? void 0 : _a.value;
@@ -3307,6 +3317,10 @@ var ResourcesGridList = ({
3307
3317
  window.dispatchEvent(new HashChangeEvent("hashchange"));
3308
3318
  }
3309
3319
  if (isMobile) setIsSidebarOpen(false);
3320
+ setTimeout(() => {
3321
+ var _a3;
3322
+ (_a3 = widgetRef.current) == null ? void 0 : _a3.scrollIntoView({ behavior: "smooth" });
3323
+ }, 200);
3310
3324
  };
3311
3325
  const handleFilterChange = (value) => {
3312
3326
  setFilterValue(value);
@@ -3335,7 +3349,7 @@ var ResourcesGridList = ({
3335
3349
  const safeCurrentPage = Math.min(currentPage, totalPages);
3336
3350
  const pageStart = (safeCurrentPage - 1) * ITEMS_PER_PAGE;
3337
3351
  const paginatedItems = displayedItems.slice(pageStart, pageStart + ITEMS_PER_PAGE);
3338
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx15__default.default(ResourcesGridList_module_default.widget, className), children: [
3352
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: widgetRef, className: clsx15__default.default(ResourcesGridList_module_default.widget, className), children: [
3339
3353
  /* @__PURE__ */ jsxRuntime.jsx(
3340
3354
  FilterBar,
3341
3355
  {