@digital-b2c/coreui-kit 0.14.7 → 0.15.1

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.d.cts CHANGED
@@ -84,6 +84,7 @@ declare const svgs: {
84
84
  tiltedRight: string;
85
85
  xBlack: string;
86
86
  xWhite: string;
87
+ user: string;
87
88
  };
88
89
  type IconType = keyof typeof svgs;
89
90
  interface IconProps extends react__default.ComponentPropsWithRef<'svg'> {
@@ -399,6 +400,61 @@ declare const BlogPostContent: (({ className, body, children }: BlogPostContentP
399
400
  Body: ({ children }: BlogPostContentBodyProps) => react.JSX.Element;
400
401
  };
401
402
 
403
+ interface SearchProps {
404
+ placeholder?: string;
405
+ /** Optional CTA. When it has a `url`, submitting navigates to `${url}?q=<query>`. */
406
+ searchCta?: ICta;
407
+ /** Called with the trimmed query when the search is submitted. */
408
+ onSearch?: (query: string) => void;
409
+ /**
410
+ * `pill` renders the persistent pill style; `expandable` (default) renders an
411
+ * icon button that expands into the input on click.
412
+ */
413
+ variant?: 'expandable' | 'pill';
414
+ className?: string;
415
+ }
416
+
417
+ declare const Search: ({ placeholder, searchCta, onSearch, variant, className, }: SearchProps) => react.JSX.Element;
418
+
419
+ interface UserMenuItem {
420
+ label: string;
421
+ /** Renders the item as a link. */
422
+ url?: string;
423
+ isExternal?: boolean;
424
+ /** Called when the item is activated. */
425
+ onClick?: () => void;
426
+ /** `danger` renders the item in the notification-red treatment (e.g. Log out). */
427
+ variant?: 'default' | 'danger';
428
+ }
429
+ interface UserMenuUser {
430
+ /** Display name shown next to the avatar. */
431
+ label: string;
432
+ /** Optional link the button navigates to (used when `menuItems` is empty). */
433
+ url?: string;
434
+ isExternal?: boolean;
435
+ /** Optional avatar image; falls back to a default user icon. */
436
+ avatar?: IPicture;
437
+ /** Items shown in the dropdown menu opened by the button. */
438
+ menuItems?: UserMenuItem[];
439
+ }
440
+ interface UserMenuProps {
441
+ user: UserMenuUser;
442
+ className?: string;
443
+ /** Opens the menu above the button instead of below (e.g. in a footer). */
444
+ dropUp?: boolean;
445
+ /** Stretches the button to fill the width of its container. */
446
+ fullWidth?: boolean;
447
+ }
448
+
449
+ /**
450
+ * Reusable user / account button.
451
+ *
452
+ * - With `menuItems`, renders a button that toggles a dropdown menu (closes on
453
+ * Escape or outside interaction).
454
+ * - Without `menuItems`, renders a plain link (when `url` is set) or button.
455
+ */
456
+ declare const UserMenu: ({ user, className, dropUp, fullWidth }: UserMenuProps) => react.JSX.Element;
457
+
402
458
  interface AnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
403
459
  isExternal?: boolean;
404
460
  renderLink?: (props: AnchorHTMLAttributes<HTMLAnchorElement> & {
@@ -638,23 +694,46 @@ interface BaseNavItem {
638
694
  interface NavLink {
639
695
  type: 'link';
640
696
  cta?: ICta;
697
+ /** Marks the item as the current page (adds the active treatment). */
698
+ isActive?: boolean;
699
+ variant?: 'subMenuSpacer';
641
700
  }
642
701
  interface NavDropdown extends BaseNavItem {
643
702
  type: 'dropdown';
644
703
  items: NavItem[];
645
704
  cta?: ICta;
705
+ /** Marks the item as the current page (adds the active treatment). */
706
+ isActive?: boolean;
646
707
  }
708
+ /** A single top-level navigation entry, shared by the external and internal navigation. */
647
709
  type NavItem = NavLink | NavDropdown;
710
+ /**
711
+ * Brand logos shown in the "unfolded" color bar at the top of the page.
712
+ * When omitted the color bars stay as thin 8px strips.
713
+ */
714
+ interface NavigationBrandLogos {
715
+ lenscrafters?: IPicture;
716
+ forEyes?: IPicture;
717
+ optical?: IPicture;
718
+ pearleVision?: IPicture;
719
+ }
648
720
  interface NavigationProps {
649
721
  className?: string;
650
- variant?: 'transparent';
722
+ variant?: 'external' | 'internal' | '' | null;
723
+ transparent?: boolean;
651
724
  mainLogo?: string;
725
+ logoAlt?: string;
652
726
  homeCta?: string;
653
727
  loginCta?: ICta;
654
728
  rightButton?: ICta;
655
729
  navigationItems?: {
656
730
  items: NavItem[];
657
731
  };
732
+ user?: UserMenuUser;
733
+ searchPlaceholder?: string;
734
+ searchCta?: ICta;
735
+ onSearch?: (query: string) => void;
736
+ brandLogos?: NavigationBrandLogos;
658
737
  }
659
738
 
660
739
  declare const Navigation: (props: NavigationProps) => react.JSX.Element;
@@ -978,6 +1057,21 @@ declare const TextCenterWithMedia: (({ className, title, thumbnail, videoUrl, lo
978
1057
  Title: ({ children }: TextCenterWithMediaTitleProps) => react.JSX.Element;
979
1058
  };
980
1059
 
1060
+ interface QuoteSectionBlockItem {
1061
+ quoteLogo: string;
1062
+ bodyText: ReactNode;
1063
+ displayPhoto: string;
1064
+ displayName: string;
1065
+ jobTitleLogo: string;
1066
+ }
1067
+ interface QuoteSectionBlockProps {
1068
+ className?: string;
1069
+ title?: string;
1070
+ items?: QuoteSectionBlockItem[];
1071
+ }
1072
+
1073
+ declare const QuoteSectionBlock: ({ className, title, items }: QuoteSectionBlockProps) => react.JSX.Element | null;
1074
+
981
1075
  type IntersectionObserverOptions = {
982
1076
  threshold?: number | number[];
983
1077
  rootMargin?: string;
@@ -1003,4 +1097,4 @@ type SlotMap = Record<string, SlotComponent>;
1003
1097
  */
1004
1098
  declare function resolveCompoundSlots(children: ReactNode, slots: SlotMap): Record<string, ReactNode>;
1005
1099
 
1006
- 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, 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 ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, Navigation, type NavigationProps, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, type TButtonVariant, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextCenterWithMedia, type TextCenterWithMediaProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
1100
+ 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, 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 ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, type UserMenuItem as InternalNavMenuItem, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, type NavItem, Navigation, type NavigationBrandLogos, type NavigationProps, type UserMenuUser as NavigationUser, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, 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, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextCenterWithMedia, type TextCenterWithMediaProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
package/dist/index.d.ts CHANGED
@@ -84,6 +84,7 @@ declare const svgs: {
84
84
  tiltedRight: string;
85
85
  xBlack: string;
86
86
  xWhite: string;
87
+ user: string;
87
88
  };
88
89
  type IconType = keyof typeof svgs;
89
90
  interface IconProps extends react__default.ComponentPropsWithRef<'svg'> {
@@ -399,6 +400,61 @@ declare const BlogPostContent: (({ className, body, children }: BlogPostContentP
399
400
  Body: ({ children }: BlogPostContentBodyProps) => react.JSX.Element;
400
401
  };
401
402
 
403
+ interface SearchProps {
404
+ placeholder?: string;
405
+ /** Optional CTA. When it has a `url`, submitting navigates to `${url}?q=<query>`. */
406
+ searchCta?: ICta;
407
+ /** Called with the trimmed query when the search is submitted. */
408
+ onSearch?: (query: string) => void;
409
+ /**
410
+ * `pill` renders the persistent pill style; `expandable` (default) renders an
411
+ * icon button that expands into the input on click.
412
+ */
413
+ variant?: 'expandable' | 'pill';
414
+ className?: string;
415
+ }
416
+
417
+ declare const Search: ({ placeholder, searchCta, onSearch, variant, className, }: SearchProps) => react.JSX.Element;
418
+
419
+ interface UserMenuItem {
420
+ label: string;
421
+ /** Renders the item as a link. */
422
+ url?: string;
423
+ isExternal?: boolean;
424
+ /** Called when the item is activated. */
425
+ onClick?: () => void;
426
+ /** `danger` renders the item in the notification-red treatment (e.g. Log out). */
427
+ variant?: 'default' | 'danger';
428
+ }
429
+ interface UserMenuUser {
430
+ /** Display name shown next to the avatar. */
431
+ label: string;
432
+ /** Optional link the button navigates to (used when `menuItems` is empty). */
433
+ url?: string;
434
+ isExternal?: boolean;
435
+ /** Optional avatar image; falls back to a default user icon. */
436
+ avatar?: IPicture;
437
+ /** Items shown in the dropdown menu opened by the button. */
438
+ menuItems?: UserMenuItem[];
439
+ }
440
+ interface UserMenuProps {
441
+ user: UserMenuUser;
442
+ className?: string;
443
+ /** Opens the menu above the button instead of below (e.g. in a footer). */
444
+ dropUp?: boolean;
445
+ /** Stretches the button to fill the width of its container. */
446
+ fullWidth?: boolean;
447
+ }
448
+
449
+ /**
450
+ * Reusable user / account button.
451
+ *
452
+ * - With `menuItems`, renders a button that toggles a dropdown menu (closes on
453
+ * Escape or outside interaction).
454
+ * - Without `menuItems`, renders a plain link (when `url` is set) or button.
455
+ */
456
+ declare const UserMenu: ({ user, className, dropUp, fullWidth }: UserMenuProps) => react.JSX.Element;
457
+
402
458
  interface AnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
403
459
  isExternal?: boolean;
404
460
  renderLink?: (props: AnchorHTMLAttributes<HTMLAnchorElement> & {
@@ -638,23 +694,46 @@ interface BaseNavItem {
638
694
  interface NavLink {
639
695
  type: 'link';
640
696
  cta?: ICta;
697
+ /** Marks the item as the current page (adds the active treatment). */
698
+ isActive?: boolean;
699
+ variant?: 'subMenuSpacer';
641
700
  }
642
701
  interface NavDropdown extends BaseNavItem {
643
702
  type: 'dropdown';
644
703
  items: NavItem[];
645
704
  cta?: ICta;
705
+ /** Marks the item as the current page (adds the active treatment). */
706
+ isActive?: boolean;
646
707
  }
708
+ /** A single top-level navigation entry, shared by the external and internal navigation. */
647
709
  type NavItem = NavLink | NavDropdown;
710
+ /**
711
+ * Brand logos shown in the "unfolded" color bar at the top of the page.
712
+ * When omitted the color bars stay as thin 8px strips.
713
+ */
714
+ interface NavigationBrandLogos {
715
+ lenscrafters?: IPicture;
716
+ forEyes?: IPicture;
717
+ optical?: IPicture;
718
+ pearleVision?: IPicture;
719
+ }
648
720
  interface NavigationProps {
649
721
  className?: string;
650
- variant?: 'transparent';
722
+ variant?: 'external' | 'internal' | '' | null;
723
+ transparent?: boolean;
651
724
  mainLogo?: string;
725
+ logoAlt?: string;
652
726
  homeCta?: string;
653
727
  loginCta?: ICta;
654
728
  rightButton?: ICta;
655
729
  navigationItems?: {
656
730
  items: NavItem[];
657
731
  };
732
+ user?: UserMenuUser;
733
+ searchPlaceholder?: string;
734
+ searchCta?: ICta;
735
+ onSearch?: (query: string) => void;
736
+ brandLogos?: NavigationBrandLogos;
658
737
  }
659
738
 
660
739
  declare const Navigation: (props: NavigationProps) => react.JSX.Element;
@@ -978,6 +1057,21 @@ declare const TextCenterWithMedia: (({ className, title, thumbnail, videoUrl, lo
978
1057
  Title: ({ children }: TextCenterWithMediaTitleProps) => react.JSX.Element;
979
1058
  };
980
1059
 
1060
+ interface QuoteSectionBlockItem {
1061
+ quoteLogo: string;
1062
+ bodyText: ReactNode;
1063
+ displayPhoto: string;
1064
+ displayName: string;
1065
+ jobTitleLogo: string;
1066
+ }
1067
+ interface QuoteSectionBlockProps {
1068
+ className?: string;
1069
+ title?: string;
1070
+ items?: QuoteSectionBlockItem[];
1071
+ }
1072
+
1073
+ declare const QuoteSectionBlock: ({ className, title, items }: QuoteSectionBlockProps) => react.JSX.Element | null;
1074
+
981
1075
  type IntersectionObserverOptions = {
982
1076
  threshold?: number | number[];
983
1077
  rootMargin?: string;
@@ -1003,4 +1097,4 @@ type SlotMap = Record<string, SlotComponent>;
1003
1097
  */
1004
1098
  declare function resolveCompoundSlots(children: ReactNode, slots: SlotMap): Record<string, ReactNode>;
1005
1099
 
1006
- 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, 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 ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, Navigation, type NavigationProps, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, Pagination, type PaginationProps, Picture, type PictureProps, PracticeCard, type PracticeCardProps, PracticePathCards, type PracticePathCardsProps, ResourceCardItem, type ResourceCardItemProps, type ResourceItem, type ResourceItemType, type ResourceView, ResourcesGridList, type ResourcesGridListProps, Sidebar, type SidebarCategory, type SidebarProps, type SortOption, type TButtonVariant, Teaser5050With3Text, type Teaser5050With3TextProps, Teaser5050WithCta, type Teaser5050WithCtaProps, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextCenterWithMedia, type TextCenterWithMediaProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };
1100
+ 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, 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 ICta, type ICtaHoverLogo, type ICtaIcon, type ICtaLogo, type IFooterSupportGroup, type IPicture, Icon, type IconType, InfoCard, type InfoCardProps, Input, type InputProps, InternalBrandsTab, type InternalBrandsTabProps, type UserMenuItem as InternalNavMenuItem, MiniBanner, type MiniBannerProps, MiniSectionCta, type MiniSectionCtaProps, type NavItem, Navigation, type NavigationBrandLogos, type NavigationProps, type UserMenuUser as NavigationUser, NewsCard, NewsCardList, type NewsCardListProps, type NewsCardProps, 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, TextBody, type TextBodyProps, TextCenterCtaInBottom, type TextCenterCtaInBottomProps, TextCenterWithMedia, type TextCenterWithMediaProps, TextEvent, type TextEventProps, UpcomingEventCard, type UpcomingEventCardProps, UserMenu, type UserMenuItem, type UserMenuProps, type UserMenuUser, resolveCompoundSlots, svgs, useIntersectionObserver, useIsAtTop };