@digital-b2c/coreui-kit 0.17.10 → 0.17.12
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 +54 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +18 -0
- 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 +55 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,
|
|
@@ -3060,7 +3072,8 @@ var MiniBanner_module_default = {
|
|
|
3060
3072
|
ctaContainer: "MiniBanner_module_ctaContainer",
|
|
3061
3073
|
miniBannerNoBG: "MiniBanner_module_miniBannerNoBG",
|
|
3062
3074
|
miniBannerTextLeft: "MiniBanner_module_miniBannerTextLeft",
|
|
3063
|
-
container: "MiniBanner_module_container"
|
|
3075
|
+
container: "MiniBanner_module_container",
|
|
3076
|
+
subtitle: "MiniBanner_module_subtitle"
|
|
3064
3077
|
};
|
|
3065
3078
|
var MiniBannerPreTitle = ({ children }) => {
|
|
3066
3079
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
@@ -3109,7 +3122,7 @@ var MiniBanner = ({
|
|
|
3109
3122
|
subtitleNode && /* @__PURE__ */ jsx(
|
|
3110
3123
|
"div",
|
|
3111
3124
|
{
|
|
3112
|
-
className: clsx49(MiniBanner_module_default.title, {
|
|
3125
|
+
className: clsx49(MiniBanner_module_default.title, MiniBanner_module_default.subtitle, {
|
|
3113
3126
|
subheading: isMiniBannerNoBG,
|
|
3114
3127
|
h1: !isMiniBannerNoBG && !isMiniBannerTextLeft,
|
|
3115
3128
|
h4: isMiniBannerTextLeft
|
|
@@ -3215,6 +3228,9 @@ var MiniSectionCta2 = Object.assign(MiniSectionCta, {
|
|
|
3215
3228
|
Title: MiniSectionCtaTitle,
|
|
3216
3229
|
Subtitle: MiniSectionCtaSubtitle
|
|
3217
3230
|
});
|
|
3231
|
+
var NavigationUserMenuFallback = ({ children }) => {
|
|
3232
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
3233
|
+
};
|
|
3218
3234
|
var useIsAtTop = () => {
|
|
3219
3235
|
const [isAtTop, setIsAtTop] = useState(true);
|
|
3220
3236
|
useEffect(() => {
|
|
@@ -3829,6 +3845,10 @@ var Navigation2 = (props) => {
|
|
|
3829
3845
|
brandLogos
|
|
3830
3846
|
} = props;
|
|
3831
3847
|
const isExternal = variant !== "internal";
|
|
3848
|
+
const slots = resolveCompoundSlots(props.children, {
|
|
3849
|
+
userMenuFallback: NavigationUserMenuFallback
|
|
3850
|
+
});
|
|
3851
|
+
const userMenuFallbackNode = slots.userMenuFallback;
|
|
3832
3852
|
const [isHovered, setIsHovered] = useState(false);
|
|
3833
3853
|
const [openIndex, setOpenIndex] = useState(null);
|
|
3834
3854
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
@@ -3973,7 +3993,9 @@ var Navigation2 = (props) => {
|
|
|
3973
3993
|
rightButton,
|
|
3974
3994
|
loginVariant: isTransparent ? "ghost" : "nofillblack"
|
|
3975
3995
|
}
|
|
3976
|
-
) : user
|
|
3996
|
+
) : user ? /* @__PURE__ */ jsx(UserMenu, { user }) : userMenuFallbackNode ? cloneElement(userMenuFallbackNode, {
|
|
3997
|
+
className: clsx49("userMenuFallback", Navigation_module_default["userMenuFallback"])
|
|
3998
|
+
}) : null
|
|
3977
3999
|
] }),
|
|
3978
4000
|
!isTabletBelow && /* @__PURE__ */ jsxs("div", { className: Navigation_module_default.bottomRow, children: [
|
|
3979
4001
|
/* @__PURE__ */ jsx(
|
|
@@ -4041,6 +4063,11 @@ var Navigation2 = (props) => {
|
|
|
4041
4063
|
)
|
|
4042
4064
|
] });
|
|
4043
4065
|
};
|
|
4066
|
+
|
|
4067
|
+
// src/widgets/Navigation/index.ts
|
|
4068
|
+
var Navigation3 = Object.assign(Navigation2, {
|
|
4069
|
+
UserMenuFallback: NavigationUserMenuFallback
|
|
4070
|
+
});
|
|
4044
4071
|
var PracticePathCardsFooter = ({ children }) => {
|
|
4045
4072
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
4046
4073
|
};
|
|
@@ -4853,8 +4880,7 @@ var BlogCardGrid = ({
|
|
|
4853
4880
|
}
|
|
4854
4881
|
) })
|
|
4855
4882
|
] }),
|
|
4856
|
-
/* @__PURE__ */ jsx(Grid, __spreadProps(__spreadValues({ role: "list", columns: 3 }, gridProps), { children: items.map((item
|
|
4857
|
-
var _a2;
|
|
4883
|
+
/* @__PURE__ */ jsx(Grid, __spreadProps(__spreadValues({ role: "list", columns: 3 }, gridProps), { children: items.map((item) => {
|
|
4858
4884
|
return /* @__PURE__ */ jsx(
|
|
4859
4885
|
GridItem,
|
|
4860
4886
|
__spreadProps(__spreadValues({
|
|
@@ -4863,7 +4889,7 @@ var BlogCardGrid = ({
|
|
|
4863
4889
|
}, gridItemProps), {
|
|
4864
4890
|
children: /* @__PURE__ */ jsx(NewsCard, __spreadProps(__spreadValues({}, item), { renderLink }))
|
|
4865
4891
|
}),
|
|
4866
|
-
|
|
4892
|
+
`${item == null ? void 0 : item.title}-${item == null ? void 0 : item.id}`
|
|
4867
4893
|
);
|
|
4868
4894
|
}) }))
|
|
4869
4895
|
] });
|
|
@@ -4945,17 +4971,14 @@ var FeaturedNewsHighlights = ({
|
|
|
4945
4971
|
wrapperClass: clsx49(FeaturedNewsHighlights_module_default["carousel-wrapper"]),
|
|
4946
4972
|
slideClass: FeaturedNewsHighlights_module_default["carousel-list-item"],
|
|
4947
4973
|
spaceBetween: 16,
|
|
4948
|
-
slides: items.map((item
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
(_a2 = item == null ? void 0 : item.title) != null ? _a2 : index
|
|
4957
|
-
);
|
|
4958
|
-
})
|
|
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
|
+
))
|
|
4959
4982
|
}
|
|
4960
4983
|
),
|
|
4961
4984
|
(!isVariantHome || isVariantHome && !isBelowTablet) && /* @__PURE__ */ jsxs("div", { className: clsx49("content-wrapper", FeaturedNewsHighlights_module_default["content-wrapper"]), children: [
|
|
@@ -4966,18 +4989,15 @@ var FeaturedNewsHighlights = ({
|
|
|
4966
4989
|
renderLink
|
|
4967
4990
|
})
|
|
4968
4991
|
),
|
|
4969
|
-
sideCards && sideCards.length > 0 && /* @__PURE__ */ jsx("div", { className: clsx49("side-content", FeaturedNewsHighlights_module_default["side-content"]), children: sideCards.map((card
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
(_a2 = card == null ? void 0 : card.title) != null ? _a2 : index
|
|
4979
|
-
);
|
|
4980
|
-
}) })
|
|
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
|
+
)) })
|
|
4981
5001
|
] })
|
|
4982
5002
|
] });
|
|
4983
5003
|
return /* @__PURE__ */ jsx(
|
|
@@ -5529,6 +5549,6 @@ function useIntersectionObserver({
|
|
|
5529
5549
|
return { observeRef, isVisible };
|
|
5530
5550
|
}
|
|
5531
5551
|
|
|
5532
|
-
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 };
|
|
5533
5553
|
//# sourceMappingURL=index.mjs.map
|
|
5534
5554
|
//# sourceMappingURL=index.mjs.map
|