formica-ui-lib 1.0.225 → 1.0.229

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.
@@ -12,11 +12,13 @@ export interface InputProps {
12
12
  className?: string;
13
13
  inputClassName?: string;
14
14
  autoComplete?: string;
15
+ autoFocus?: boolean;
15
16
  leadingIcon?: React.ReactNode;
16
17
  trailingIcon?: React.ReactNode;
17
18
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
18
19
  onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
19
20
  onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
21
+ onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
20
22
  }
21
23
  export interface InputFieldProps extends InputProps {
22
24
  label?: string;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  export type ContentContainerMaxWidth = "sm" | "md" | "lg" | "xl" | "2xl" | "4xl" | "6xl";
3
- export type ContentContainerSpacing = "none" | "section" | "paddedSection" | "padded" | "preview" | "verticalPreview";
3
+ export type ContentContainerSpacing = "none" | "section" | "compactPaddedSection" | "paddedSection" | "padded" | "preview" | "verticalPreview";
4
4
  export type ContentContainerProps = {
5
5
  children?: React.ReactNode;
6
6
  className?: string;
@@ -1,5 +1,5 @@
1
1
  import type { SearchBarProps } from "../../searchbar/SearchBarProps";
2
- export type SearchFilterLayoutVariant = "default" | "category" | "wide";
2
+ export type SearchFilterLayoutVariant = "default" | "category" | "wide" | "full";
3
3
  export type SearchFilterProps = {
4
4
  searchBarProps: SearchBarProps;
5
5
  searchPlaceholder?: string;
@@ -8,10 +8,12 @@ export type FeaturedProductCarouselItem = {
8
8
  href?: string;
9
9
  rangeCode?: string;
10
10
  };
11
+ export type FeaturedProductsCarouselHeaderVariant = "default" | "compact";
11
12
  export type FeaturedProductsCarouselProps = {
12
13
  title?: string;
13
14
  body?: string;
14
15
  headerAlign?: "left" | "center";
16
+ headerVariant?: FeaturedProductsCarouselHeaderVariant;
15
17
  items: FeaturedProductCarouselItem[];
16
18
  onItemClick?: (item: FeaturedProductCarouselItem) => void;
17
19
  };
@@ -1,5 +1,7 @@
1
1
  import type { RecentArticleCardProps } from "../../../molecules/cards/recentarticlecard/RecentArticleCardProps";
2
+ export type RecentArticleCollectionHeaderVariant = "default" | "compact";
2
3
  export interface RecentArticleCollectionProps {
3
4
  title?: string;
5
+ headerVariant?: RecentArticleCollectionHeaderVariant;
4
6
  items: RecentArticleCardProps[];
5
7
  }
@@ -1,5 +1,6 @@
1
1
  import type { Country } from "../../molecules/selectors/countryselector/CountrySelectorProps";
2
- import type { TopNavLogin, TopNavCartSummary } from "./TopNavBarProps";
2
+ import type { TopNavLogin, TopNavCartSummary, TopNavSearchPayload } from "./TopNavBarProps";
3
+ import type { TopNavSearchResultClickPayload, TopNavSearchResultItem } from "./TopNavSearchResultsProps";
3
4
  export type TopNavActionsProps = {
4
5
  Countries?: Country[];
5
6
  countries?: Country[];
@@ -8,7 +9,13 @@ export type TopNavActionsProps = {
8
9
  Cart?: TopNavCartSummary;
9
10
  showFavorites?: boolean;
10
11
  showLogin?: boolean;
12
+ searchResultItems?: TopNavSearchResultItem[];
13
+ searchViewAllLabel?: string;
11
14
  onSearchClick?: () => void;
15
+ onSearchChange?: (payload: TopNavSearchPayload) => void;
16
+ onSearchSubmit?: (payload: TopNavSearchPayload) => void;
17
+ onSearchResultClick?: (payload: TopNavSearchResultClickPayload) => void;
18
+ onSearchViewAllClick?: (payload: TopNavSearchPayload) => void;
12
19
  onCartClick?: () => void;
13
20
  onLoginClick?: () => void;
14
21
  onFavoritesClick?: () => void;
@@ -1,4 +1,5 @@
1
1
  import { Country } from "../../molecules/selectors/countryselector/CountrySelectorProps";
2
+ import type { TopNavSearchResultClickPayload, TopNavSearchResultItem } from "./TopNavSearchResultsProps";
2
3
  export type NavLinkItem = {
3
4
  id: string;
4
5
  label: string;
@@ -38,6 +39,9 @@ export type TopNavLogo = {
38
39
  className?: string;
39
40
  containerClassName?: string;
40
41
  };
42
+ export type TopNavSearchPayload = {
43
+ query: string;
44
+ };
41
45
  export type TopNavBarProps = {
42
46
  NavMenuWithSubItems?: NavItem[];
43
47
  countries?: Country[];
@@ -47,10 +51,16 @@ export type TopNavBarProps = {
47
51
  showFavorites?: boolean;
48
52
  showLogin?: boolean;
49
53
  Logo?: TopNavLogo;
54
+ searchResultItems?: TopNavSearchResultItem[];
55
+ searchViewAllLabel?: string;
50
56
  onLogoClick?: () => void;
51
57
  onNavItemClick?: (item: NavItem) => void;
52
58
  onMegaMenuLinkClick?: (link: NavLinkItem) => void;
53
59
  onSearchClick?: () => void;
60
+ onSearchChange?: (payload: TopNavSearchPayload) => void;
61
+ onSearchSubmit?: (payload: TopNavSearchPayload) => void;
62
+ onSearchResultClick?: (payload: TopNavSearchResultClickPayload) => void;
63
+ onSearchViewAllClick?: (payload: TopNavSearchPayload) => void;
54
64
  onCartClick?: () => void;
55
65
  onLoginClick?: () => void;
56
66
  onFavoritesClick?: () => void;
@@ -0,0 +1,21 @@
1
+ export type TopNavSearchResultItemVariant = "product" | "article";
2
+ export type TopNavSearchResultItem = {
3
+ id: string;
4
+ variant: TopNavSearchResultItemVariant;
5
+ imageSrc?: string;
6
+ imageAlt?: string;
7
+ title: string;
8
+ subtitle?: string;
9
+ description?: string;
10
+ href?: string;
11
+ };
12
+ export type TopNavSearchResultClickPayload = {
13
+ item: TopNavSearchResultItem;
14
+ };
15
+ export type TopNavSearchResultsProps = {
16
+ id?: string;
17
+ items?: TopNavSearchResultItem[];
18
+ viewAllLabel?: string;
19
+ onResultClick?: (payload: TopNavSearchResultClickPayload) => void;
20
+ onViewAllClick?: () => void;
21
+ };
@@ -0,0 +1,24 @@
1
+ import type { SearchFilterProps } from "../../molecules/selectors/filterbar/SearchFilterProps";
2
+ import type { FeaturedProductCarouselItem } from "../../organisms/carousels/featureproductcarousel/FeaturedProductsCarouselProps";
3
+ import type { RecentArticleCardProps } from "../../molecules/cards/recentarticlecard/RecentArticleCardProps";
4
+ export type SearchResultsDecorResultsProps = {
5
+ title?: string;
6
+ items: FeaturedProductCarouselItem[];
7
+ visibleItemCount?: number;
8
+ viewMoreLabel?: string;
9
+ onItemClick?: (item: FeaturedProductCarouselItem) => void;
10
+ onViewMoreClick?: () => void;
11
+ };
12
+ export type SearchResultsResourceResultsProps = {
13
+ title?: string;
14
+ items: RecentArticleCardProps[];
15
+ visibleItemCount?: number;
16
+ viewMoreLabel?: string;
17
+ onViewMoreClick?: () => void;
18
+ };
19
+ export type SearchResultsTemplateProps = {
20
+ searchFilterProps: SearchFilterProps;
21
+ decorResultsProps?: SearchResultsDecorResultsProps;
22
+ resourceResultsProps?: SearchResultsResourceResultsProps;
23
+ noResultsMessage: string;
24
+ };