@digital-b2c/coreui-kit 0.17.11 → 0.17.13
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/LICENSE.txt +21 -21
- package/README.md +52 -52
- package/dist/index.cjs +52 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +19 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.mjs +53 -34
- package/dist/index.mjs.map +1 -1
- package/dist/types/global.d.ts +25 -25
- package/package.json +100 -101
package/dist/index.d.cts
CHANGED
|
@@ -366,7 +366,9 @@ interface GridItemProps extends PropsWithChildren {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
interface NewsCardProps {
|
|
369
|
+
type?: 'restricted';
|
|
369
370
|
className?: string;
|
|
371
|
+
id?: string | number;
|
|
370
372
|
image?: IPicture;
|
|
371
373
|
tag: string;
|
|
372
374
|
date: {
|
|
@@ -382,7 +384,7 @@ interface NewsCardProps {
|
|
|
382
384
|
}) => React.ReactNode;
|
|
383
385
|
}
|
|
384
386
|
|
|
385
|
-
declare const NewsCard: ({ className, image, date, description, tag, title, cta, direction, renderLink, }: NewsCardProps) => react.JSX.Element;
|
|
387
|
+
declare const NewsCard: ({ type, className, image, date, description, tag, title, cta, direction, renderLink, }: NewsCardProps) => react.JSX.Element;
|
|
386
388
|
|
|
387
389
|
type BlogPostContentBodyProps = {
|
|
388
390
|
children: ReactNode;
|
|
@@ -706,6 +708,10 @@ declare const MiniSectionCta: (({ className, variant, theme, title, subtitle, ct
|
|
|
706
708
|
Subtitle: ({ children }: MiniSectionCtaSubtitleProps) => react.JSX.Element;
|
|
707
709
|
};
|
|
708
710
|
|
|
711
|
+
type NavigationUserMenuFallbackProps = {
|
|
712
|
+
children: ReactNode;
|
|
713
|
+
};
|
|
714
|
+
|
|
709
715
|
interface BaseNavItem {
|
|
710
716
|
title: string;
|
|
711
717
|
description: string;
|
|
@@ -736,7 +742,7 @@ interface NavigationBrandLogos {
|
|
|
736
742
|
optical?: IPicture;
|
|
737
743
|
pearleVision?: IPicture;
|
|
738
744
|
}
|
|
739
|
-
interface NavigationProps {
|
|
745
|
+
interface NavigationProps extends PropsWithChildren {
|
|
740
746
|
className?: string;
|
|
741
747
|
variant?: 'external' | 'internal' | '' | null;
|
|
742
748
|
transparent?: boolean;
|
|
@@ -755,7 +761,9 @@ interface NavigationProps {
|
|
|
755
761
|
brandLogos?: NavigationBrandLogos;
|
|
756
762
|
}
|
|
757
763
|
|
|
758
|
-
declare const Navigation: (props: NavigationProps) => react.JSX.Element
|
|
764
|
+
declare const Navigation: ((props: NavigationProps) => react.JSX.Element) & {
|
|
765
|
+
UserMenuFallback: ({ children }: NavigationUserMenuFallbackProps) => react.JSX.Element;
|
|
766
|
+
};
|
|
759
767
|
|
|
760
768
|
type PracticePathCardsFooterProps = {
|
|
761
769
|
children: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -366,7 +366,9 @@ interface GridItemProps extends PropsWithChildren {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
interface NewsCardProps {
|
|
369
|
+
type?: 'restricted';
|
|
369
370
|
className?: string;
|
|
371
|
+
id?: string | number;
|
|
370
372
|
image?: IPicture;
|
|
371
373
|
tag: string;
|
|
372
374
|
date: {
|
|
@@ -382,7 +384,7 @@ interface NewsCardProps {
|
|
|
382
384
|
}) => React.ReactNode;
|
|
383
385
|
}
|
|
384
386
|
|
|
385
|
-
declare const NewsCard: ({ className, image, date, description, tag, title, cta, direction, renderLink, }: NewsCardProps) => react.JSX.Element;
|
|
387
|
+
declare const NewsCard: ({ type, className, image, date, description, tag, title, cta, direction, renderLink, }: NewsCardProps) => react.JSX.Element;
|
|
386
388
|
|
|
387
389
|
type BlogPostContentBodyProps = {
|
|
388
390
|
children: ReactNode;
|
|
@@ -706,6 +708,10 @@ declare const MiniSectionCta: (({ className, variant, theme, title, subtitle, ct
|
|
|
706
708
|
Subtitle: ({ children }: MiniSectionCtaSubtitleProps) => react.JSX.Element;
|
|
707
709
|
};
|
|
708
710
|
|
|
711
|
+
type NavigationUserMenuFallbackProps = {
|
|
712
|
+
children: ReactNode;
|
|
713
|
+
};
|
|
714
|
+
|
|
709
715
|
interface BaseNavItem {
|
|
710
716
|
title: string;
|
|
711
717
|
description: string;
|
|
@@ -736,7 +742,7 @@ interface NavigationBrandLogos {
|
|
|
736
742
|
optical?: IPicture;
|
|
737
743
|
pearleVision?: IPicture;
|
|
738
744
|
}
|
|
739
|
-
interface NavigationProps {
|
|
745
|
+
interface NavigationProps extends PropsWithChildren {
|
|
740
746
|
className?: string;
|
|
741
747
|
variant?: 'external' | 'internal' | '' | null;
|
|
742
748
|
transparent?: boolean;
|
|
@@ -755,7 +761,9 @@ interface NavigationProps {
|
|
|
755
761
|
brandLogos?: NavigationBrandLogos;
|
|
756
762
|
}
|
|
757
763
|
|
|
758
|
-
declare const Navigation: (props: NavigationProps) => react.JSX.Element
|
|
764
|
+
declare const Navigation: ((props: NavigationProps) => react.JSX.Element) & {
|
|
765
|
+
UserMenuFallback: ({ children }: NavigationUserMenuFallbackProps) => react.JSX.Element;
|
|
766
|
+
};
|
|
759
767
|
|
|
760
768
|
type PracticePathCardsFooterProps = {
|
|
761
769
|
children: ReactNode;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx49 from 'clsx';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import React71, { forwardRef, useId, useRef, useState, useCallback, useMemo, useEffect, Children, isValidElement, Fragment as Fragment$1, useSyncExternalStore } from 'react';
|
|
3
|
+
import React71, { forwardRef, useId, useRef, useState, useCallback, useMemo, useEffect, cloneElement, Children, isValidElement, Fragment as Fragment$1, useSyncExternalStore } from 'react';
|
|
4
4
|
import gsap$1, { gsap } from 'gsap';
|
|
5
5
|
import { useGSAP } from '@gsap/react';
|
|
6
6
|
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
@@ -1789,9 +1789,11 @@ var NewsCard_module_default = {
|
|
|
1789
1789
|
"news-card-description": "NewsCard_module_news-card-description",
|
|
1790
1790
|
"news-card-cta-wrapper": "NewsCard_module_news-card-cta-wrapper",
|
|
1791
1791
|
"news-card--vertical": "NewsCard_module_news-card--vertical",
|
|
1792
|
-
"news-card--horizontal": "NewsCard_module_news-card--horizontal"
|
|
1792
|
+
"news-card--horizontal": "NewsCard_module_news-card--horizontal",
|
|
1793
|
+
restricted: "NewsCard_module_restricted"
|
|
1793
1794
|
};
|
|
1794
1795
|
var NewsCard = ({
|
|
1796
|
+
type,
|
|
1795
1797
|
className,
|
|
1796
1798
|
image,
|
|
1797
1799
|
date,
|
|
@@ -1802,13 +1804,19 @@ var NewsCard = ({
|
|
|
1802
1804
|
direction = "vertical",
|
|
1803
1805
|
renderLink
|
|
1804
1806
|
}) => {
|
|
1805
|
-
const
|
|
1807
|
+
const id = useId();
|
|
1808
|
+
const isRestricted = type === "restricted";
|
|
1809
|
+
const linkProps = cta && cta.url ? __spreadProps(__spreadValues({
|
|
1806
1810
|
href: cta.url,
|
|
1807
1811
|
target: cta.isExternal ? "_blank" : void 0,
|
|
1808
1812
|
rel: cta.isExternal ? "noopener noreferrer" : void 0,
|
|
1809
1813
|
className: clsx49("news-card-link", NewsCard_module_default["news-card-link"]),
|
|
1810
1814
|
"aria-label": `${title}${cta.label ? ` \u2014 ${cta.label}` : ""}`
|
|
1811
|
-
}
|
|
1815
|
+
}, isRestricted && {
|
|
1816
|
+
"aria-disabled": true
|
|
1817
|
+
}), {
|
|
1818
|
+
tabIndex: isRestricted ? -1 : 0
|
|
1819
|
+
}) : null;
|
|
1812
1820
|
const cardLink = linkProps ? renderLink ? renderLink(__spreadProps(__spreadValues({}, linkProps), { children: null })) : /* @__PURE__ */ jsx("a", __spreadValues({}, linkProps)) : null;
|
|
1813
1821
|
return /* @__PURE__ */ jsxs(
|
|
1814
1822
|
"article",
|
|
@@ -1816,9 +1824,12 @@ var NewsCard = ({
|
|
|
1816
1824
|
className: clsx49(
|
|
1817
1825
|
"news-card",
|
|
1818
1826
|
NewsCard_module_default["news-card"],
|
|
1827
|
+
type && NewsCard_module_default[type],
|
|
1819
1828
|
NewsCard_module_default[`news-card--${direction}`],
|
|
1820
1829
|
className
|
|
1821
1830
|
),
|
|
1831
|
+
"aria-labelledby": `title-${id}`,
|
|
1832
|
+
"aria-describedby": isRestricted ? `restricted-${id}` : void 0,
|
|
1822
1833
|
children: [
|
|
1823
1834
|
cardLink,
|
|
1824
1835
|
image && /* @__PURE__ */ jsx(Picture, __spreadProps(__spreadValues({}, image), { className: clsx49("news-card-image", NewsCard_module_default["news-card-image"]) })),
|
|
@@ -1836,7 +1847,8 @@ var NewsCard = ({
|
|
|
1836
1847
|
] }),
|
|
1837
1848
|
/* @__PURE__ */ jsxs("div", { className: clsx49("news-card-main-content", NewsCard_module_default["news-card-main-content"]), children: [
|
|
1838
1849
|
/* @__PURE__ */ jsx("h3", { className: clsx49("news-card-title", NewsCard_module_default["news-card-title"]), children: title }),
|
|
1839
|
-
typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: clsx49("news-card-description", NewsCard_module_default["news-card-description"]), children: description }) : description
|
|
1850
|
+
typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: clsx49("news-card-description", NewsCard_module_default["news-card-description"]), children: description }) : description,
|
|
1851
|
+
isRestricted && /* @__PURE__ */ jsx("p", { id: `restricted-${id}`, className: "sr-only", children: "This resource is restricted. You do not have permission to access it." })
|
|
1840
1852
|
] }),
|
|
1841
1853
|
cta && cta.url && /* @__PURE__ */ jsx("div", { className: clsx49("news-card-cta-wrapper", NewsCard_module_default["news-card-cta-wrapper"]), children: /* @__PURE__ */ jsx(
|
|
1842
1854
|
Button,
|
|
@@ -2639,7 +2651,7 @@ var HeroBanner = ({
|
|
|
2639
2651
|
__spreadValues({
|
|
2640
2652
|
className: HeroBanner_module_default.brandsStrip,
|
|
2641
2653
|
variant: "light",
|
|
2642
|
-
size: isTabletBelow
|
|
2654
|
+
size: !isTabletBelow && vMainHeroBanner ? void 0 : "small"
|
|
2643
2655
|
}, brands)
|
|
2644
2656
|
),
|
|
2645
2657
|
backgroundImage && !vBannerPodcast && /* @__PURE__ */ jsx(Picture, __spreadValues({ className: HeroBanner_module_default.backgroundImage }, backgroundImage))
|
|
@@ -3216,6 +3228,9 @@ var MiniSectionCta2 = Object.assign(MiniSectionCta, {
|
|
|
3216
3228
|
Title: MiniSectionCtaTitle,
|
|
3217
3229
|
Subtitle: MiniSectionCtaSubtitle
|
|
3218
3230
|
});
|
|
3231
|
+
var NavigationUserMenuFallback = ({ children }) => {
|
|
3232
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
3233
|
+
};
|
|
3219
3234
|
var useIsAtTop = () => {
|
|
3220
3235
|
const [isAtTop, setIsAtTop] = useState(true);
|
|
3221
3236
|
useEffect(() => {
|
|
@@ -3830,6 +3845,10 @@ var Navigation2 = (props) => {
|
|
|
3830
3845
|
brandLogos
|
|
3831
3846
|
} = props;
|
|
3832
3847
|
const isExternal = variant !== "internal";
|
|
3848
|
+
const slots = resolveCompoundSlots(props.children, {
|
|
3849
|
+
userMenuFallback: NavigationUserMenuFallback
|
|
3850
|
+
});
|
|
3851
|
+
const userMenuFallbackNode = slots.userMenuFallback;
|
|
3833
3852
|
const [isHovered, setIsHovered] = useState(false);
|
|
3834
3853
|
const [openIndex, setOpenIndex] = useState(null);
|
|
3835
3854
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
@@ -3974,7 +3993,9 @@ var Navigation2 = (props) => {
|
|
|
3974
3993
|
rightButton,
|
|
3975
3994
|
loginVariant: isTransparent ? "ghost" : "nofillblack"
|
|
3976
3995
|
}
|
|
3977
|
-
) : user
|
|
3996
|
+
) : user ? /* @__PURE__ */ jsx(UserMenu, { user }) : userMenuFallbackNode ? cloneElement(userMenuFallbackNode, {
|
|
3997
|
+
className: clsx49("userMenuFallback", Navigation_module_default["userMenuFallback"])
|
|
3998
|
+
}) : null
|
|
3978
3999
|
] }),
|
|
3979
4000
|
!isTabletBelow && /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.bottomRow, children: [
|
|
3980
4001
|
/* @__PURE__ */ jsx(
|
|
@@ -4042,6 +4063,11 @@ var Navigation2 = (props) => {
|
|
|
4042
4063
|
)
|
|
4043
4064
|
] });
|
|
4044
4065
|
};
|
|
4066
|
+
|
|
4067
|
+
// src/widgets/Navigation/index.ts
|
|
4068
|
+
var Navigation3 = Object.assign(Navigation2, {
|
|
4069
|
+
UserMenuFallback: NavigationUserMenuFallback
|
|
4070
|
+
});
|
|
4045
4071
|
var PracticePathCardsFooter = ({ children }) => {
|
|
4046
4072
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
4047
4073
|
};
|
|
@@ -4854,8 +4880,7 @@ var BlogCardGrid = ({
|
|
|
4854
4880
|
}
|
|
4855
4881
|
) })
|
|
4856
4882
|
] }),
|
|
4857
|
-
/* @__PURE__ */ jsx(Grid, __spreadProps(__spreadValues({ role: "list", columns: 3 }, gridProps), { children: items.map((item
|
|
4858
|
-
var _a2;
|
|
4883
|
+
/* @__PURE__ */ jsx(Grid, __spreadProps(__spreadValues({ role: "list", columns: 3 }, gridProps), { children: items.map((item) => {
|
|
4859
4884
|
return /* @__PURE__ */ jsx(
|
|
4860
4885
|
GridItem,
|
|
4861
4886
|
__spreadProps(__spreadValues({
|
|
@@ -4864,7 +4889,7 @@ var BlogCardGrid = ({
|
|
|
4864
4889
|
}, gridItemProps), {
|
|
4865
4890
|
children: /* @__PURE__ */ jsx(NewsCard, __spreadProps(__spreadValues({}, item), { renderLink }))
|
|
4866
4891
|
}),
|
|
4867
|
-
|
|
4892
|
+
`${item == null ? void 0 : item.title}-${item == null ? void 0 : item.id}`
|
|
4868
4893
|
);
|
|
4869
4894
|
}) }))
|
|
4870
4895
|
] });
|
|
@@ -4946,17 +4971,14 @@ var FeaturedNewsHighlights = ({
|
|
|
4946
4971
|
wrapperClass: clsx49(FeaturedNewsHighlights_module_default["carousel-wrapper"]),
|
|
4947
4972
|
slideClass: FeaturedNewsHighlights_module_default["carousel-list-item"],
|
|
4948
4973
|
spaceBetween: 16,
|
|
4949
|
-
slides: items.map((item
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
(_a2 = item == null ? void 0 : item.title) != null ? _a2 : index
|
|
4958
|
-
);
|
|
4959
|
-
})
|
|
4974
|
+
slides: items.map((item) => /* @__PURE__ */ jsx(
|
|
4975
|
+
NewsCard,
|
|
4976
|
+
__spreadProps(__spreadValues({}, item), {
|
|
4977
|
+
direction: "vertical",
|
|
4978
|
+
className: clsx49("carousel-news-card", FeaturedNewsHighlights_module_default["carousel-news-card"])
|
|
4979
|
+
}),
|
|
4980
|
+
`${item == null ? void 0 : item.title}-${item == null ? void 0 : item.id}`
|
|
4981
|
+
))
|
|
4960
4982
|
}
|
|
4961
4983
|
),
|
|
4962
4984
|
(!isVariantHome || isVariantHome && !isBelowTablet) && /* @__PURE__ */ jsxs("div", { className: clsx49("content-wrapper", FeaturedNewsHighlights_module_default["content-wrapper"]), children: [
|
|
@@ -4967,18 +4989,15 @@ var FeaturedNewsHighlights = ({
|
|
|
4967
4989
|
renderLink
|
|
4968
4990
|
})
|
|
4969
4991
|
),
|
|
4970
|
-
sideCards && sideCards.length > 0 && /* @__PURE__ */ jsx("div", { className: clsx49("side-content", FeaturedNewsHighlights_module_default["side-content"]), children: sideCards.map((card
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
(_a2 = card == null ? void 0 : card.title) != null ? _a2 : index
|
|
4980
|
-
);
|
|
4981
|
-
}) })
|
|
4992
|
+
sideCards && sideCards.length > 0 && /* @__PURE__ */ jsx("div", { className: clsx49("side-content", FeaturedNewsHighlights_module_default["side-content"]), children: sideCards.map((card) => /* @__PURE__ */ jsx(
|
|
4993
|
+
NewsCard,
|
|
4994
|
+
__spreadProps(__spreadValues({}, card), {
|
|
4995
|
+
className: clsx49("side-cards", FeaturedNewsHighlights_module_default["side-cards"]),
|
|
4996
|
+
direction: "horizontal",
|
|
4997
|
+
renderLink
|
|
4998
|
+
}),
|
|
4999
|
+
`${card == null ? void 0 : card.title}-${card == null ? void 0 : card.id}`
|
|
5000
|
+
)) })
|
|
4982
5001
|
] })
|
|
4983
5002
|
] });
|
|
4984
5003
|
return /* @__PURE__ */ jsx(
|
|
@@ -5530,6 +5549,6 @@ function useIntersectionObserver({
|
|
|
5530
5549
|
return { observeRef, isVisible };
|
|
5531
5550
|
}
|
|
5532
5551
|
|
|
5533
|
-
export { Anchor, Badge, BlogCardGrid2 as BlogCardGrid, BlogPost2 as BlogPost, BlogPostContent2 as BlogPostContent, BlogSearchResultsList2 as BlogSearchResultsList, BrandsStrip, Button, Card2 as Card, CardCollection2 as CardCollection, ColTextMenu, ConditionalWrapper, ContactModule2 as ContactModule, Container, CountingCard2 as CountingCard, EventList2 as EventList, FeaturedNewsHighlights2 as FeaturedNewsHighlights, FilterBar, Footer, GlobalSearchResultsList2 as GlobalSearchResultsList, HeroBanner2 as HeroBanner, HeroBannerCarousel, Icon, InfoCard2 as InfoCard, Input, InternalBrandsTab2 as InternalBrandsTab, Loader, MiniBanner2 as MiniBanner, MiniSectionCta2 as MiniSectionCta,
|
|
5552
|
+
export { Anchor, Badge, BlogCardGrid2 as BlogCardGrid, BlogPost2 as BlogPost, BlogPostContent2 as BlogPostContent, BlogSearchResultsList2 as BlogSearchResultsList, BrandsStrip, Button, Card2 as Card, CardCollection2 as CardCollection, ColTextMenu, ConditionalWrapper, ContactModule2 as ContactModule, Container, CountingCard2 as CountingCard, EventList2 as EventList, FeaturedNewsHighlights2 as FeaturedNewsHighlights, FilterBar, Footer, GlobalSearchResultsList2 as GlobalSearchResultsList, HeroBanner2 as HeroBanner, HeroBannerCarousel, Icon, InfoCard2 as InfoCard, Input, InternalBrandsTab2 as InternalBrandsTab, Loader, MiniBanner2 as MiniBanner, MiniSectionCta2 as MiniSectionCta, Navigation3 as Navigation, NewsCard, NewsCardList2 as NewsCardList, PageLoader2 as PageLoader, Pagination, Picture, PracticeCard, PracticePathCards2 as PracticePathCards, QuoteSectionBlock, ResourceCardItem, ResourcesGridList, Search, Sidebar, Teaser5050With3Text2 as Teaser5050With3Text, Teaser5050WithCta2 as Teaser5050WithCta, TextBody2 as TextBody, TextCenterCtaInBottom2 as TextCenterCtaInBottom, TextCenterWithMedia2 as TextCenterWithMedia, TextEvent2 as TextEvent, TwoColTextMenu, UpcomingEventCard, UserMenu, resolveCompoundSlots, svgs, useActivePath, useIntersectionObserver, useIsAtTop };
|
|
5534
5553
|
//# sourceMappingURL=index.mjs.map
|
|
5535
5554
|
//# sourceMappingURL=index.mjs.map
|