@digital-b2c/coreui-kit 0.17.18 → 0.17.20
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 +16 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +8 -95
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +5 -9
- package/dist/index.d.ts +5 -9
- package/dist/index.mjs +16 -51
- 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
|
@@ -752,14 +752,10 @@ interface NavDropdown extends BaseNavItem {
|
|
|
752
752
|
/** A single top-level navigation entry, shared by the external and internal navigation. */
|
|
753
753
|
type NavItem = NavLink | NavDropdown;
|
|
754
754
|
/**
|
|
755
|
-
* Brand
|
|
756
|
-
* When omitted the color bars stay as thin 8px strips.
|
|
755
|
+
* Brand bar colors shown in the top strip of the navigation.
|
|
757
756
|
*/
|
|
758
|
-
interface
|
|
759
|
-
|
|
760
|
-
forEyes?: IPicture;
|
|
761
|
-
optical?: IPicture;
|
|
762
|
-
pearleVision?: IPicture;
|
|
757
|
+
interface NavigationBrandBar {
|
|
758
|
+
backgroundColor: string;
|
|
763
759
|
}
|
|
764
760
|
interface NavigationProps extends PropsWithChildren {
|
|
765
761
|
className?: string;
|
|
@@ -777,7 +773,7 @@ interface NavigationProps extends PropsWithChildren {
|
|
|
777
773
|
searchPlaceholder?: string;
|
|
778
774
|
searchCta?: ICta;
|
|
779
775
|
onSearch?: (query: string) => void;
|
|
780
|
-
|
|
776
|
+
brandBars?: NavigationBrandBar[];
|
|
781
777
|
}
|
|
782
778
|
|
|
783
779
|
declare const Navigation: ((props: NavigationProps) => react.JSX.Element) & {
|
|
@@ -1180,4 +1176,4 @@ type SlotMap = Record<string, SlotComponent>;
|
|
|
1180
1176
|
*/
|
|
1181
1177
|
declare function resolveCompoundSlots(children: ReactNode, slots: SlotMap): Record<string, ReactNode>;
|
|
1182
1178
|
|
|
1183
|
-
export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ColTextMenu, type ColTextMenuProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type IColTextMenuItem, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, type ITwoColTextMenuSection, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, type UserMenuItem as InternalNavMenuItem, Loader, type LoaderProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, type NavItem, Navigation, type
|
|
1179
|
+
export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ColTextMenu, type ColTextMenuProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type IColTextMenuItem, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, type ITwoColTextMenuSection, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, type UserMenuItem as InternalNavMenuItem, Loader, type LoaderProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, type NavItem, Navigation, type NavigationBrandBar, type NavigationProps, type UserMenuUser as NavigationUser, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, PageLoader, type PageLoaderProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, QuoteSectionBlock, type QuoteSectionBlockProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Search, type SearchProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, type TButtonVariant, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, Text, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextCenterWithMedia, type TextCenterWithMediaProps, TextEvent, type TextEventProps, type TextProps, TwoColTextMenu, type TwoColTextMenuProps, UpcomingEventCard, type UpcomingEventCardProps, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, resolveCompoundSlots, svgs, useActivePath, useIntersectionObserver, useIsAtTop };
|
package/dist/index.d.ts
CHANGED
|
@@ -752,14 +752,10 @@ interface NavDropdown extends BaseNavItem {
|
|
|
752
752
|
/** A single top-level navigation entry, shared by the external and internal navigation. */
|
|
753
753
|
type NavItem = NavLink | NavDropdown;
|
|
754
754
|
/**
|
|
755
|
-
* Brand
|
|
756
|
-
* When omitted the color bars stay as thin 8px strips.
|
|
755
|
+
* Brand bar colors shown in the top strip of the navigation.
|
|
757
756
|
*/
|
|
758
|
-
interface
|
|
759
|
-
|
|
760
|
-
forEyes?: IPicture;
|
|
761
|
-
optical?: IPicture;
|
|
762
|
-
pearleVision?: IPicture;
|
|
757
|
+
interface NavigationBrandBar {
|
|
758
|
+
backgroundColor: string;
|
|
763
759
|
}
|
|
764
760
|
interface NavigationProps extends PropsWithChildren {
|
|
765
761
|
className?: string;
|
|
@@ -777,7 +773,7 @@ interface NavigationProps extends PropsWithChildren {
|
|
|
777
773
|
searchPlaceholder?: string;
|
|
778
774
|
searchCta?: ICta;
|
|
779
775
|
onSearch?: (query: string) => void;
|
|
780
|
-
|
|
776
|
+
brandBars?: NavigationBrandBar[];
|
|
781
777
|
}
|
|
782
778
|
|
|
783
779
|
declare const Navigation: ((props: NavigationProps) => react.JSX.Element) & {
|
|
@@ -1180,4 +1176,4 @@ type SlotMap = Record<string, SlotComponent>;
|
|
|
1180
1176
|
*/
|
|
1181
1177
|
declare function resolveCompoundSlots(children: ReactNode, slots: SlotMap): Record<string, ReactNode>;
|
|
1182
1178
|
|
|
1183
|
-
export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ColTextMenu, type ColTextMenuProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type IColTextMenuItem, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, type ITwoColTextMenuSection, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, type UserMenuItem as InternalNavMenuItem, Loader, type LoaderProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, type NavItem, Navigation, type
|
|
1179
|
+
export { Anchor, type AnchorProps, Badge, type BadgeProps, BlogCardGrid, type BlogCardGridProps, BlogPost, BlogPostContent, type BlogPostContentProps, type BlogPostProps, BlogSearchResultsList, type BlogSearchResultsListProps, BrandsStrip, type BrandsStripProps, Button, type ButtonProps, Card, CardCollection, type CardCollectionProps, type CardProps, ColTextMenu, type ColTextMenuProps, ConditionalWrapper, type ConditionalWrapperProps, ContactModule, type ContactModuleProps, Container, type ContainerProps, CountingCard, type CountingCardProps, EventList, type EventListProps, FeaturedNewsHighlights, type FeaturedNewsHighlightsProps, FilterBar, type FilterBarProps, type FilterOption, Footer, type FooterProps, GlobalSearchResultsList, type GlobalSearchResultsListProps, type GridItemProps, type GridProps, HeroBanner, HeroBannerCarousel, type HeroBannerCarouselProps, type HeroBannerProps, type IColTextMenuItem, type ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, type ITwoColTextMenuSection, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, type UserMenuItem as InternalNavMenuItem, Loader, type LoaderProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, type NavItem, Navigation, type NavigationBrandBar, type NavigationProps, type UserMenuUser as NavigationUser, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, PageLoader, type PageLoaderProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, QuoteSectionBlock, type QuoteSectionBlockProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Search, type SearchProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, type TButtonVariant, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, Text, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextCenterWithMedia, type TextCenterWithMediaProps, TextEvent, type TextEventProps, type TextProps, TwoColTextMenu, type TwoColTextMenuProps, UpcomingEventCard, type UpcomingEventCardProps, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, resolveCompoundSlots, svgs, useActivePath, useIntersectionObserver, useIsAtTop };
|
package/dist/index.mjs
CHANGED
|
@@ -3286,39 +3286,18 @@ var NavigationCtas = ({
|
|
|
3286
3286
|
// src/widgets/Navigation/NavigationBrandBars.module.scss
|
|
3287
3287
|
var NavigationBrandBars_module_default = {
|
|
3288
3288
|
brandBars: "NavigationBrandBars_module_brandBars",
|
|
3289
|
-
brandBar: "NavigationBrandBars_module_brandBar"
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
pearleVision: "NavigationBrandBars_module_pearleVision"
|
|
3296
|
-
};
|
|
3297
|
-
var BRANDS = [
|
|
3298
|
-
{ key: "lenscrafters", className: NavigationBrandBars_module_default.lenscrafters, label: "LensCrafters" },
|
|
3299
|
-
{ key: "forEyes", className: NavigationBrandBars_module_default.forEyes, label: "For Eyes" },
|
|
3300
|
-
{ key: "optical", className: NavigationBrandBars_module_default.optical, label: "Target Optical" },
|
|
3301
|
-
{ key: "pearleVision", className: NavigationBrandBars_module_default.pearleVision, label: "Pearle Vision" }
|
|
3302
|
-
];
|
|
3303
|
-
var NavigationBrandBars = ({
|
|
3304
|
-
brandLogos,
|
|
3305
|
-
unfolded = false,
|
|
3306
|
-
className
|
|
3307
|
-
}) => {
|
|
3308
|
-
const hasLogos = !!brandLogos;
|
|
3309
|
-
const isUnfolded = hasLogos && unfolded;
|
|
3310
|
-
return /* @__PURE__ */ jsx(
|
|
3311
|
-
"div",
|
|
3289
|
+
brandBar: "NavigationBrandBars_module_brandBar"
|
|
3290
|
+
};
|
|
3291
|
+
var NavigationBrandBars = ({ brandBars, className }) => {
|
|
3292
|
+
if ((brandBars == null ? void 0 : brandBars.length) === 0) return;
|
|
3293
|
+
return /* @__PURE__ */ jsx("div", { className: clsx49(NavigationBrandBars_module_default.brandBars, className), "aria-hidden": "true", children: brandBars && brandBars.map((bar, index) => /* @__PURE__ */ jsx(
|
|
3294
|
+
"span",
|
|
3312
3295
|
{
|
|
3313
|
-
className:
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
return /* @__PURE__ */ jsx("span", { className: clsx49(NavigationBrandBars_module_default.brandBar, brand.className), children: logo && /* @__PURE__ */ jsx("img", { className: NavigationBrandBars_module_default.brandLogo, src: logo.src, alt: (_a = logo.alt) != null ? _a : brand.label }) }, brand.key);
|
|
3319
|
-
})
|
|
3320
|
-
}
|
|
3321
|
-
);
|
|
3296
|
+
className: NavigationBrandBars_module_default.brandBar,
|
|
3297
|
+
style: { backgroundColor: bar.backgroundColor }
|
|
3298
|
+
},
|
|
3299
|
+
`${bar.backgroundColor}-${index}`
|
|
3300
|
+
)) });
|
|
3322
3301
|
};
|
|
3323
3302
|
var getPathname = () => typeof window === "undefined" ? "" : window.location.pathname;
|
|
3324
3303
|
var useActivePath = () => {
|
|
@@ -3565,7 +3544,7 @@ var NavigationMobile = ({
|
|
|
3565
3544
|
searchPlaceholder,
|
|
3566
3545
|
searchCta,
|
|
3567
3546
|
onSearch,
|
|
3568
|
-
|
|
3547
|
+
brandBars,
|
|
3569
3548
|
isOpen,
|
|
3570
3549
|
onClose,
|
|
3571
3550
|
isExternal = false,
|
|
@@ -3720,14 +3699,7 @@ var NavigationMobile = ({
|
|
|
3720
3699
|
}
|
|
3721
3700
|
)
|
|
3722
3701
|
] }),
|
|
3723
|
-
/* @__PURE__ */ jsx(
|
|
3724
|
-
NavigationBrandBars,
|
|
3725
|
-
{
|
|
3726
|
-
brandLogos,
|
|
3727
|
-
unfolded: false,
|
|
3728
|
-
className: NavigationMobile_module_default.mobileBrandBars
|
|
3729
|
-
}
|
|
3730
|
-
),
|
|
3702
|
+
/* @__PURE__ */ jsx(NavigationBrandBars, { brandBars, className: NavigationMobile_module_default.mobileBrandBars }),
|
|
3731
3703
|
/* @__PURE__ */ jsx("ul", { className: NavigationMobile_module_default.mobileItems, children: navItems == null ? void 0 : navItems.map((item, index) => {
|
|
3732
3704
|
var _a, _b, _c, _d;
|
|
3733
3705
|
const subMenuId = `${baseId}-submenu-${index}`;
|
|
@@ -3855,7 +3827,7 @@ var Navigation2 = (props) => {
|
|
|
3855
3827
|
searchPlaceholder = "Search resources",
|
|
3856
3828
|
searchCta,
|
|
3857
3829
|
onSearch,
|
|
3858
|
-
|
|
3830
|
+
brandBars
|
|
3859
3831
|
} = props;
|
|
3860
3832
|
const isExternal = variant !== "internal";
|
|
3861
3833
|
const slots = resolveCompoundSlots(props.children, {
|
|
@@ -3875,7 +3847,6 @@ var Navigation2 = (props) => {
|
|
|
3875
3847
|
const dropdownOpen = openIndex !== null && !isTabletBelow;
|
|
3876
3848
|
const isTransparent = !!transparent && isAtTop && !isHovered && !dropdownOpen;
|
|
3877
3849
|
const openItem = openIndex !== null ? (_a = navigationItems == null ? void 0 : navigationItems.items) == null ? void 0 : _a[openIndex] : void 0;
|
|
3878
|
-
const showLogoUnfolded = !!brandLogos && isAtTop && !dropdownOpen;
|
|
3879
3850
|
const openDropdown = (index) => {
|
|
3880
3851
|
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
3881
3852
|
setOpenIndex(index);
|
|
@@ -4031,13 +4002,7 @@ var Navigation2 = (props) => {
|
|
|
4031
4002
|
)
|
|
4032
4003
|
] })
|
|
4033
4004
|
] }) }),
|
|
4034
|
-
!isExternal && /* @__PURE__ */ jsx(
|
|
4035
|
-
NavigationBrandBars,
|
|
4036
|
-
{
|
|
4037
|
-
brandLogos,
|
|
4038
|
-
unfolded: showLogoUnfolded && !isMobileMenuOpen
|
|
4039
|
-
}
|
|
4040
|
-
),
|
|
4005
|
+
!isExternal && /* @__PURE__ */ jsx(NavigationBrandBars, { brandBars }),
|
|
4041
4006
|
dropdownOpen && (openItem == null ? void 0 : openItem.type) === "dropdown" && /* @__PURE__ */ jsx(
|
|
4042
4007
|
NavigationDropdown,
|
|
4043
4008
|
{
|
|
@@ -4066,7 +4031,7 @@ var Navigation2 = (props) => {
|
|
|
4066
4031
|
searchPlaceholder,
|
|
4067
4032
|
searchCta,
|
|
4068
4033
|
onSearch,
|
|
4069
|
-
|
|
4034
|
+
brandBars,
|
|
4070
4035
|
isOpen: isMobileMenuOpen,
|
|
4071
4036
|
onClose: () => setIsMobileMenuOpen(false),
|
|
4072
4037
|
isExternal,
|