@asante-org/leybold-design-system 1.2.0
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/README.md +163 -0
- package/dist/.next/types/app/layout.d.ts +9 -0
- package/dist/.next/types/app/page.d.ts +9 -0
- package/dist/.storybook/algoliaProvider.d.ts +42 -0
- package/dist/assets/.gitkeep +2 -0
- package/dist/assets/ai-banner-desktop.png +0 -0
- package/dist/assets/ai-banner-mobile.png +0 -0
- package/dist/assets/carousel-card.png +0 -0
- package/dist/assets/desktop-layout-alt.svg +27 -0
- package/dist/assets/desktop-layout.svg +29 -0
- package/dist/assets/globe.svg +7 -0
- package/dist/assets/language-selector-bg.png +0 -0
- package/dist/assets/leybold-footer-logo.svg +19 -0
- package/dist/assets/leybold-white.svg +19 -0
- package/dist/assets/list-card-alt.png +0 -0
- package/dist/assets/list-card.png +0 -0
- package/dist/assets/list-link-a.png +0 -0
- package/dist/assets/list-link-b.png +0 -0
- package/dist/assets/list-link-c.png +0 -0
- package/dist/assets/list-product-overlay-tip-active.svg +3 -0
- package/dist/assets/list-product-overlay-tip.svg +3 -0
- package/dist/assets/list-product.png +0 -0
- package/dist/assets/logo-example.svg +9 -0
- package/dist/assets/logo.svg +19 -0
- package/dist/assets/phone-layout.svg +14 -0
- package/dist/assets/red-tip.svg +10 -0
- package/dist/assets/search-product.png +0 -0
- package/dist/assets/tablet-layout.svg +28 -0
- package/dist/fonts/calibri.ttf +0 -0
- package/dist/fonts/calibrib.ttf +0 -0
- package/dist/fonts/calibril.ttf +0 -0
- package/dist/index.esm.js +2859 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.esm.scss +5602 -0
- package/dist/index.js +2858 -0
- package/dist/index.js.map +1 -0
- package/dist/index.scss +5602 -0
- package/dist/src/app/layout.d.ts +9 -0
- package/dist/src/app/page.d.ts +2 -0
- package/dist/src/components/AIBanner/AIBanner.d.ts +15 -0
- package/dist/src/components/AIBanner/AIBanner.stories.d.ts +7 -0
- package/dist/src/components/AIBanner/index.d.ts +2 -0
- package/dist/src/components/Button/Button.d.ts +80 -0
- package/dist/src/components/Button/Button.stories.d.ts +25 -0
- package/dist/src/components/Button/index.d.ts +2 -0
- package/dist/src/components/ContentCardHorizontal/ContentCardHorizontal.d.ts +3 -0
- package/dist/src/components/ContentCardHorizontal/ContentCardHorizontal.stories.d.ts +10 -0
- package/dist/src/components/ContentCardHorizontal/index.d.ts +2 -0
- package/dist/src/components/Filters/AppliedFilterTag.d.ts +27 -0
- package/dist/src/components/Filters/AppliedFilters.d.ts +24 -0
- package/dist/src/components/Filters/Filter.types.d.ts +204 -0
- package/dist/src/components/Filters/FilterAccordion.d.ts +6 -0
- package/dist/src/components/Filters/FilterItem.d.ts +6 -0
- package/dist/src/components/Filters/FilterSearch.d.ts +6 -0
- package/dist/src/components/Filters/Filters.stories.d.ts +24 -0
- package/dist/src/components/Filters/FiltersPanel.d.ts +10 -0
- package/dist/src/components/Filters/index.d.ts +7 -0
- package/dist/src/components/Image/Image.d.ts +4 -0
- package/dist/src/components/Image/Image.stories.d.ts +16 -0
- package/dist/src/components/Image/Image.types.d.ts +34 -0
- package/dist/src/components/Image/index.d.ts +2 -0
- package/dist/src/components/InstantResults/FederatedInstantResultsLayout.d.ts +3 -0
- package/dist/src/components/InstantResults/FederatedInstantResultsLayout.stories.d.ts +13 -0
- package/dist/src/components/InstantResults/index.d.ts +9 -0
- package/dist/src/components/LanguageSelector/LanguageSelector.d.ts +7 -0
- package/dist/src/components/LanguageSelector/LanguageSelector.stories.d.ts +32 -0
- package/dist/src/components/LanguageSelector/LanguageSelector.types.d.ts +64 -0
- package/dist/src/components/LanguageSelector/LanguageSelectorLink.d.ts +20 -0
- package/dist/src/components/LanguageSelector/LocationDropdown.d.ts +6 -0
- package/dist/src/components/LanguageSelector/LocationSelectorLink.d.ts +20 -0
- package/dist/src/components/LanguageSelector/index.d.ts +7 -0
- package/dist/src/components/Pagination/Pagination.d.ts +3 -0
- package/dist/src/components/Pagination/Pagination.stories.d.ts +16 -0
- package/dist/src/components/Pagination/Pagination.types.d.ts +98 -0
- package/dist/src/components/Pagination/PaginationButton.d.ts +3 -0
- package/dist/src/components/Pagination/PaginationEllipsis.d.ts +3 -0
- package/dist/src/components/Pagination/PaginationItem.d.ts +3 -0
- package/dist/src/components/Pagination/index.d.ts +5 -0
- package/dist/src/components/ProductCardDetails/ProductCardDetails.d.ts +4 -0
- package/dist/src/components/ProductCardDetails/ProductCardDetails.stories.d.ts +10 -0
- package/dist/src/components/ProductCardDetails/index.d.ts +2 -0
- package/dist/src/components/ProductCardHorizontal/ProductCardHorizontal.d.ts +4 -0
- package/dist/src/components/ProductCardHorizontal/ProductCardHorizontal.stories.d.ts +11 -0
- package/dist/src/components/ProductCardHorizontal/index.d.ts +2 -0
- package/dist/src/components/ProductCardVertical/ProductCardVertical.d.ts +22 -0
- package/dist/src/components/ProductCardVertical/ProductCardVertical.types.d.ts +50 -0
- package/dist/src/components/ProductCardVertical/index.d.ts +2 -0
- package/dist/src/components/ResultsColumn/ResultsColumn.d.ts +3 -0
- package/dist/src/components/ResultsColumn/index.d.ts +2 -0
- package/dist/src/components/ResultsCount/ResultsCount.d.ts +7 -0
- package/dist/src/components/ResultsCount/index.d.ts +2 -0
- package/dist/src/components/ResultsView/FederatedResultsView.d.ts +3 -0
- package/dist/src/components/ResultsView/FederatedResultsView.stories.d.ts +11 -0
- package/dist/src/components/ResultsView/ResultsList.d.ts +3 -0
- package/dist/src/components/ResultsView/index.d.ts +3 -0
- package/dist/src/components/SearchBar/SearchBar.d.ts +3 -0
- package/dist/src/components/SearchBar/SearchBar.stories.d.ts +9 -0
- package/dist/src/components/SearchBar/SearchIcon.d.ts +5 -0
- package/dist/src/components/SearchBar/SearchInput.d.ts +10 -0
- package/dist/src/components/SearchBar/SearchSubmitButton.d.ts +10 -0
- package/dist/src/components/SearchBar/index.d.ts +8 -0
- package/dist/src/components/SearchModal/ModalCloseButton.d.ts +7 -0
- package/dist/src/components/SearchModal/SearchModal.d.ts +3 -0
- package/dist/src/components/SearchModal/SearchModal.stories.d.ts +8 -0
- package/dist/src/components/SearchModal/index.d.ts +4 -0
- package/dist/src/components/SearchTriggerButton/SearchTriggerButton.d.ts +3 -0
- package/dist/src/components/SearchTriggerButton/SearchTriggerButton.stories.d.ts +8 -0
- package/dist/src/components/SearchTriggerButton/index.d.ts +2 -0
- package/dist/src/components/SeeAllLinkButton/SeeAllLinkButton.d.ts +7 -0
- package/dist/src/components/SeeAllLinkButton/index.d.ts +2 -0
- package/dist/src/experience/Carousel/Carousel.d.ts +36 -0
- package/dist/src/experience/Carousel/Carousel.stories.d.ts +7 -0
- package/dist/src/experience/Carousel/index.d.ts +2 -0
- package/dist/src/experience/Footer/Footer.d.ts +201 -0
- package/dist/src/experience/Footer/Footer.stories.d.ts +28 -0
- package/dist/src/experience/Footer/icons/AtlasCopcoIcon.d.ts +10 -0
- package/dist/src/experience/Footer/icons/ExternalLinkIcon.d.ts +10 -0
- package/dist/src/experience/Footer/icons/index.d.ts +2 -0
- package/dist/src/experience/Footer/index.d.ts +2 -0
- package/dist/src/experience/GeneratedList/GeneratedList.d.ts +40 -0
- package/dist/src/experience/GeneratedList/GeneratedList.stories.d.ts +7 -0
- package/dist/src/experience/GeneratedList/GeneratedList.types.d.ts +131 -0
- package/dist/src/experience/GeneratedList/GeneratedListExternalLink.stories.d.ts +7 -0
- package/dist/src/experience/GeneratedList/GeneratedListList.stories.d.ts +9 -0
- package/dist/src/experience/GeneratedList/GeneratedListProduct.stories.d.ts +7 -0
- package/dist/src/experience/GeneratedList/_Card.d.ts +8 -0
- package/dist/src/experience/GeneratedList/_CardMobile.d.ts +8 -0
- package/dist/src/experience/GeneratedList/_ExternalLink.d.ts +8 -0
- package/dist/src/experience/GeneratedList/_List.d.ts +8 -0
- package/dist/src/experience/GeneratedList/_Product.d.ts +9 -0
- package/dist/src/experience/GeneratedList/index.d.ts +2 -0
- package/dist/src/experience/Header/Header.d.ts +20 -0
- package/dist/src/experience/Header/Header.stories.d.ts +9 -0
- package/dist/src/experience/Header/HeaderNavButton.d.ts +9 -0
- package/dist/src/experience/Header/MegaMenu.d.ts +10 -0
- package/dist/src/experience/Header/MenuLink.d.ts +8 -0
- package/dist/src/experience/Header/MobileHeader.stories.d.ts +6 -0
- package/dist/src/experience/Header/MobileMenu.d.ts +9 -0
- package/dist/src/experience/Header/MobileNavBar.d.ts +13 -0
- package/dist/src/experience/Header/index.d.ts +6 -0
- package/dist/src/experience/algolia-dynamic-search/AlgoliaDynamicSearch.d.ts +4 -0
- package/dist/src/experience/algolia-dynamic-search/AlgoliaDynamicSearch.stories.d.ts +7 -0
- package/dist/src/experience/algolia-dynamic-search/index.d.ts +3 -0
- package/dist/src/experience/federated-search/FederatedSearchExperience.d.ts +39 -0
- package/dist/src/experience/federated-search/FederatedSearchExperience.stories.d.ts +10 -0
- package/dist/src/experience/federated-search/FederatedSearchWithAlgolia.stories.d.ts +7 -0
- package/dist/src/experience/federated-search/components/AssistanceBanner/AssistanceBanner.d.ts +22 -0
- package/dist/src/experience/federated-search/components/AssistanceBanner/AssistanceBanner.types.d.ts +29 -0
- package/dist/src/experience/federated-search/components/AssistanceBanner/AssistanceIcon.d.ts +2 -0
- package/dist/src/experience/federated-search/components/AssistanceBanner/index.d.ts +3 -0
- package/dist/src/experience/federated-search/components/FilterDrawer/FilterDrawer.d.ts +24 -0
- package/dist/src/experience/federated-search/components/FilterDrawer/FilterDrawer.types.d.ts +22 -0
- package/dist/src/experience/federated-search/components/FilterDrawer/index.d.ts +2 -0
- package/dist/src/experience/federated-search/components/TabButton/TabButton.d.ts +31 -0
- package/dist/src/experience/federated-search/components/TabButton/TabButton.types.d.ts +32 -0
- package/dist/src/experience/federated-search/components/TabButton/index.d.ts +2 -0
- package/dist/src/experience/federated-search/index.d.ts +2 -0
- package/dist/src/experience/qr-form-journey/QrFormJourney.d.ts +3 -0
- package/dist/src/experience/qr-form-journey/QrFormJourney.stories.d.ts +8 -0
- package/dist/src/experience/qr-form-journey/index.d.ts +1 -0
- package/dist/src/hooks/useFederatedSearchMock.d.ts +36 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/stories/foundation/Buttons/ButtonComponents.d.ts +56 -0
- package/dist/src/stories/foundation/Typography/TypographyComponents.d.ts +46 -0
- package/dist/src/stories/foundation/_components/StoryLayout.d.ts +11 -0
- package/dist/src/types/buttons.d.ts +4 -0
- package/dist/src/types/cards.d.ts +50 -0
- package/dist/src/types/search.d.ts +139 -0
- package/dist/src/utils/styles/index.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +115 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AIBannerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Banner message text
|
|
5
|
+
*/
|
|
6
|
+
text?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Additional CSS classes
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* AI translation notification banner
|
|
14
|
+
*/
|
|
15
|
+
export declare const AIBanner: React.FC<AIBannerProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AIBanner } from './AIBanner';
|
|
3
|
+
declare const meta: Meta<typeof AIBanner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AIBanner>;
|
|
6
|
+
export declare const Desktop: Story;
|
|
7
|
+
export declare const Mobile: Story;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Button variant types
|
|
4
|
+
*/
|
|
5
|
+
export type ButtonVariant = "primary" | "secondary" | "solid-grey" | "solid-black" | "solid-white" | "outlined-grey" | "outlined-black" | "outlined-white" | "text" | "link-text" | "link-text-alt" | "external-link" | "carousel-arrow-left" | "carousel-arrow-right";
|
|
6
|
+
/**
|
|
7
|
+
* Icon types for button
|
|
8
|
+
*/
|
|
9
|
+
export type ButtonIcon = "arrow-right" | "external" | "chevron-left" | "chevron-right" | "none";
|
|
10
|
+
/**
|
|
11
|
+
* Icon position
|
|
12
|
+
*/
|
|
13
|
+
export type IconPosition = "left" | "right";
|
|
14
|
+
export interface ButtonProps {
|
|
15
|
+
/**
|
|
16
|
+
* Button content (text label)
|
|
17
|
+
*/
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Button variant - determines visual style
|
|
21
|
+
*/
|
|
22
|
+
variant?: ButtonVariant;
|
|
23
|
+
/**
|
|
24
|
+
* Button size
|
|
25
|
+
*/
|
|
26
|
+
size?: "extra-small" | "small" | "medium" | "large";
|
|
27
|
+
/**
|
|
28
|
+
* Is button disabled?
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Optional click handler
|
|
33
|
+
*/
|
|
34
|
+
onClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Button type attribute
|
|
37
|
+
*/
|
|
38
|
+
type?: "button" | "submit" | "reset";
|
|
39
|
+
/**
|
|
40
|
+
* Additional CSS classes
|
|
41
|
+
*/
|
|
42
|
+
className?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Icon to display
|
|
45
|
+
*/
|
|
46
|
+
icon?: ButtonIcon;
|
|
47
|
+
/**
|
|
48
|
+
* Icon position (left or right of text)
|
|
49
|
+
*/
|
|
50
|
+
iconPosition?: IconPosition;
|
|
51
|
+
/**
|
|
52
|
+
* Accessible label for icon-only buttons
|
|
53
|
+
*/
|
|
54
|
+
ariaLabel?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Opens link in new tab (for external links)
|
|
57
|
+
*/
|
|
58
|
+
opensInNewTab?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Inline styles
|
|
61
|
+
*/
|
|
62
|
+
style?: React.CSSProperties;
|
|
63
|
+
/**
|
|
64
|
+
* Force a specific state for documentation purposes
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
'data-force-state'?: 'hover' | 'focus';
|
|
68
|
+
/**
|
|
69
|
+
* Data attribute for page target
|
|
70
|
+
*/
|
|
71
|
+
'data-page_target'?: string | number;
|
|
72
|
+
/**
|
|
73
|
+
* Tab index for focus order
|
|
74
|
+
*/
|
|
75
|
+
tabIndex?: number;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Primary UI component for user interaction
|
|
79
|
+
*/
|
|
80
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Button } from "./Button";
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const SecondaryDesign: Story;
|
|
8
|
+
export declare const SolidWhite: Story;
|
|
9
|
+
export declare const SolidGrey: Story;
|
|
10
|
+
export declare const SolidBlack: Story;
|
|
11
|
+
export declare const OutlinedBlack: Story;
|
|
12
|
+
export declare const OutlinedGrey: Story;
|
|
13
|
+
export declare const OutlinedWhite: Story;
|
|
14
|
+
export declare const LinkText: Story;
|
|
15
|
+
export declare const LinkTextAlt: Story;
|
|
16
|
+
export declare const CarouselArrows: Story;
|
|
17
|
+
export declare const ExternalLink: Story;
|
|
18
|
+
export declare const Text: Story;
|
|
19
|
+
export declare const ExtraSmall: Story;
|
|
20
|
+
export declare const Small: Story;
|
|
21
|
+
export declare const Medium: Story;
|
|
22
|
+
export declare const Large: Story;
|
|
23
|
+
export declare const AllSizes: Story;
|
|
24
|
+
export declare const AllVariants: Story;
|
|
25
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ContentCardHorizontal } from "./ContentCardHorizontal";
|
|
3
|
+
declare const meta: Meta<typeof ContentCardHorizontal>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ContentCardHorizontal>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const BlogPost: Story;
|
|
8
|
+
export declare const WithoutExcerpt: Story;
|
|
9
|
+
export declare const WithoutCategory: Story;
|
|
10
|
+
export declare const LongTitle: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AppliedFilterTagProps {
|
|
3
|
+
/**
|
|
4
|
+
* Facet attribute (e.g., "category")
|
|
5
|
+
*/
|
|
6
|
+
attribute: string;
|
|
7
|
+
/**
|
|
8
|
+
* Facet value (e.g., "Kits")
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
/**
|
|
12
|
+
* Display label (optional, defaults to value)
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Callback when tag is removed
|
|
17
|
+
*/
|
|
18
|
+
onRemove: (attribute: string, value: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Additional CSS class
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* AppliedFilterTag - Individual removable filter tag/chip
|
|
26
|
+
*/
|
|
27
|
+
export declare const AppliedFilterTag: React.FC<AppliedFilterTagProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Facet } from "./Filter.types";
|
|
3
|
+
export interface AppliedFiltersProps {
|
|
4
|
+
/**
|
|
5
|
+
* List of facets with selected values
|
|
6
|
+
*/
|
|
7
|
+
facets: Facet[];
|
|
8
|
+
/**
|
|
9
|
+
* Callback when a filter is removed
|
|
10
|
+
*/
|
|
11
|
+
onRemove: (attribute: string, value: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Callback when all filters are cleared
|
|
14
|
+
*/
|
|
15
|
+
onClearAll?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Additional CSS class
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* AppliedFilters - Shows all active filters as removable tags
|
|
23
|
+
*/
|
|
24
|
+
export declare const AppliedFilters: React.FC<AppliedFiltersProps>;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single facet value with its count
|
|
3
|
+
*/
|
|
4
|
+
export interface FacetValue {
|
|
5
|
+
/**
|
|
6
|
+
* The value/label of the facet
|
|
7
|
+
*/
|
|
8
|
+
value: string;
|
|
9
|
+
/**
|
|
10
|
+
* Number of results with this facet value
|
|
11
|
+
*/
|
|
12
|
+
count: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether this facet is currently selected/refined
|
|
15
|
+
*/
|
|
16
|
+
isRefined: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Represents a facet category (e.g., "Category", "Brand")
|
|
20
|
+
*/
|
|
21
|
+
export interface Facet {
|
|
22
|
+
/**
|
|
23
|
+
* Unique identifier for the facet
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
/**
|
|
27
|
+
* Display label for the facet category
|
|
28
|
+
*/
|
|
29
|
+
label: string;
|
|
30
|
+
/**
|
|
31
|
+
* Algolia attribute name
|
|
32
|
+
*/
|
|
33
|
+
attribute: string;
|
|
34
|
+
/**
|
|
35
|
+
* List of facet values
|
|
36
|
+
*/
|
|
37
|
+
values: FacetValue[];
|
|
38
|
+
/**
|
|
39
|
+
* Whether to show search input for this facet
|
|
40
|
+
*/
|
|
41
|
+
searchable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether this facet is expanded by default
|
|
44
|
+
*/
|
|
45
|
+
defaultExpanded?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Filter display variant - desktop or mobile
|
|
49
|
+
*/
|
|
50
|
+
export type FilterVariant = 'desktop' | 'mobile';
|
|
51
|
+
/**
|
|
52
|
+
* Props for FilterItem component
|
|
53
|
+
*/
|
|
54
|
+
export interface FilterItemProps {
|
|
55
|
+
/**
|
|
56
|
+
* The facet value data
|
|
57
|
+
*/
|
|
58
|
+
value: FacetValue;
|
|
59
|
+
/**
|
|
60
|
+
* Callback when item is toggled
|
|
61
|
+
*/
|
|
62
|
+
onToggle: (value: string) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Additional CSS class
|
|
65
|
+
*/
|
|
66
|
+
className?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Display variant - controls mobile vs desktop rendering
|
|
69
|
+
*/
|
|
70
|
+
variant?: FilterVariant;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to show checkbox (Products tab) or plain button (Content tab)
|
|
73
|
+
*/
|
|
74
|
+
showCheckbox?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Props for FilterSearch component
|
|
78
|
+
*/
|
|
79
|
+
export interface FilterSearchProps {
|
|
80
|
+
/**
|
|
81
|
+
* Current search value
|
|
82
|
+
*/
|
|
83
|
+
value: string;
|
|
84
|
+
/**
|
|
85
|
+
* Callback when search value changes
|
|
86
|
+
*/
|
|
87
|
+
onChange: (value: string) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Placeholder text
|
|
90
|
+
*/
|
|
91
|
+
placeholder?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Additional CSS class
|
|
94
|
+
*/
|
|
95
|
+
className?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Props for FilterAccordion component
|
|
99
|
+
*/
|
|
100
|
+
export interface FilterAccordionProps {
|
|
101
|
+
/**
|
|
102
|
+
* The facet data
|
|
103
|
+
*/
|
|
104
|
+
facet: Facet;
|
|
105
|
+
/**
|
|
106
|
+
* Whether accordion is expanded
|
|
107
|
+
*/
|
|
108
|
+
isExpanded: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Callback when accordion is toggled
|
|
111
|
+
*/
|
|
112
|
+
onToggle: () => void;
|
|
113
|
+
/**
|
|
114
|
+
* Callback when facet value is selected
|
|
115
|
+
*/
|
|
116
|
+
onValueToggle: (attribute: string, value: string) => void;
|
|
117
|
+
/**
|
|
118
|
+
* Additional CSS class
|
|
119
|
+
*/
|
|
120
|
+
className?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Display variant - controls mobile vs desktop rendering
|
|
123
|
+
*/
|
|
124
|
+
variant?: FilterVariant;
|
|
125
|
+
/**
|
|
126
|
+
* Whether to show checkbox (Products tab) or plain button (Content tab)
|
|
127
|
+
*/
|
|
128
|
+
showCheckbox?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Props for FiltersPanel component
|
|
132
|
+
*/
|
|
133
|
+
export interface FiltersPanelProps {
|
|
134
|
+
/**
|
|
135
|
+
* List of facets to display
|
|
136
|
+
*/
|
|
137
|
+
facets: Facet[];
|
|
138
|
+
/**
|
|
139
|
+
* Callback when a facet value is toggled
|
|
140
|
+
*/
|
|
141
|
+
onFacetToggle: (attribute: string, value: string) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Loading state
|
|
144
|
+
*/
|
|
145
|
+
isLoading?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Additional CSS class
|
|
148
|
+
*/
|
|
149
|
+
className?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Display variant - controls mobile vs desktop rendering
|
|
152
|
+
*/
|
|
153
|
+
variant?: FilterVariant;
|
|
154
|
+
/**
|
|
155
|
+
* Whether to show checkbox (Products tab) or plain button (Content tab)
|
|
156
|
+
*/
|
|
157
|
+
showCheckbox?: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Props for AppliedFilters component
|
|
161
|
+
*/
|
|
162
|
+
export interface AppliedFiltersProps {
|
|
163
|
+
/**
|
|
164
|
+
* List of facets with selected values
|
|
165
|
+
*/
|
|
166
|
+
facets: Facet[];
|
|
167
|
+
/**
|
|
168
|
+
* Callback when a filter is removed
|
|
169
|
+
*/
|
|
170
|
+
onRemove: (attribute: string, value: string) => void;
|
|
171
|
+
/**
|
|
172
|
+
* Callback when all filters are cleared
|
|
173
|
+
*/
|
|
174
|
+
onClearAll?: () => void;
|
|
175
|
+
/**
|
|
176
|
+
* Additional CSS class
|
|
177
|
+
*/
|
|
178
|
+
className?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Props for AppliedFilterTag component
|
|
182
|
+
*/
|
|
183
|
+
export interface AppliedFilterTagProps {
|
|
184
|
+
/**
|
|
185
|
+
* Facet attribute
|
|
186
|
+
*/
|
|
187
|
+
attribute: string;
|
|
188
|
+
/**
|
|
189
|
+
* Facet value
|
|
190
|
+
*/
|
|
191
|
+
value: string;
|
|
192
|
+
/**
|
|
193
|
+
* Display label
|
|
194
|
+
*/
|
|
195
|
+
label?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Callback when tag is removed
|
|
198
|
+
*/
|
|
199
|
+
onRemove: (attribute: string, value: string) => void;
|
|
200
|
+
/**
|
|
201
|
+
* Additional CSS class
|
|
202
|
+
*/
|
|
203
|
+
className?: string;
|
|
204
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { FiltersPanel } from "./FiltersPanel";
|
|
3
|
+
import { FilterAccordion } from "./FilterAccordion";
|
|
4
|
+
import { FilterItem } from "./FilterItem";
|
|
5
|
+
import { FilterSearch } from "./FilterSearch";
|
|
6
|
+
import { AppliedFilters } from "./AppliedFilters";
|
|
7
|
+
import { AppliedFilterTag } from "./AppliedFilterTag";
|
|
8
|
+
declare const meta: Meta<typeof FiltersPanel>;
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof FiltersPanel>;
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
export declare const Loading: Story;
|
|
13
|
+
export declare const SingleFacet: Story;
|
|
14
|
+
export declare const NoFacets: Story;
|
|
15
|
+
export declare const AccordionDefault: StoryObj<typeof FilterAccordion>;
|
|
16
|
+
export declare const AccordionCollapsed: StoryObj<typeof FilterAccordion>;
|
|
17
|
+
export declare const ItemDefault: StoryObj<typeof FilterItem>;
|
|
18
|
+
export declare const ItemSelected: StoryObj<typeof FilterItem>;
|
|
19
|
+
export declare const SearchDefault: StoryObj<typeof FilterSearch>;
|
|
20
|
+
export declare const SearchWithValue: StoryObj<typeof FilterSearch>;
|
|
21
|
+
export declare const AppliedFiltersDefault: StoryObj<typeof AppliedFilters>;
|
|
22
|
+
export declare const AppliedFiltersEmpty: StoryObj<typeof AppliedFilters>;
|
|
23
|
+
export declare const AppliedTagDefault: StoryObj<typeof AppliedFilterTag>;
|
|
24
|
+
export declare const AppliedTagWithLabel: StoryObj<typeof AppliedFilterTag>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FiltersPanelProps } from "./Filter.types";
|
|
3
|
+
/**
|
|
4
|
+
* FiltersPanel - Main container for all filters
|
|
5
|
+
*
|
|
6
|
+
* Fully controlled component - renders based on facets prop.
|
|
7
|
+
* When facets change (e.g., after API refetch), component re-renders with new data.
|
|
8
|
+
* Accordion expansion state persists across refetches, with new facets respecting defaultExpanded.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FiltersPanel: React.FC<FiltersPanelProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FiltersPanel } from "./FiltersPanel";
|
|
2
|
+
export { FilterAccordion } from "./FilterAccordion";
|
|
3
|
+
export { FilterItem } from "./FilterItem";
|
|
4
|
+
export { FilterSearch } from "./FilterSearch";
|
|
5
|
+
export { AppliedFilters } from "./AppliedFilters";
|
|
6
|
+
export { AppliedFilterTag } from "./AppliedFilterTag";
|
|
7
|
+
export type { FiltersPanelProps, FilterAccordionProps, FilterItemProps, FilterSearchProps, AppliedFiltersProps, AppliedFilterTagProps, Facet, FacetValue, } from "./Filter.types";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Image } from "./Image";
|
|
3
|
+
declare const meta: Meta<typeof Image>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Image>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithAspectRatio: Story;
|
|
8
|
+
export declare const SquareImage: Story;
|
|
9
|
+
export declare const ObjectFitContain: Story;
|
|
10
|
+
export declare const ObjectFitCover: Story;
|
|
11
|
+
export declare const DecorativeImage: Story;
|
|
12
|
+
export declare const WithFallback: Story;
|
|
13
|
+
export declare const BrokenImage: Story;
|
|
14
|
+
export declare const LazyLoading: Story;
|
|
15
|
+
export declare const ResponsiveImage: Story;
|
|
16
|
+
export declare const ProductThumbnail: Story;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface ImageProps {
|
|
2
|
+
/** Image source URL */
|
|
3
|
+
src: string;
|
|
4
|
+
/** Alt text for accessibility - required for non-decorative images */
|
|
5
|
+
alt: string;
|
|
6
|
+
/** Optional width */
|
|
7
|
+
width?: number | string;
|
|
8
|
+
/** Optional height */
|
|
9
|
+
height?: number | string;
|
|
10
|
+
/** Loading strategy */
|
|
11
|
+
loading?: "lazy" | "eager";
|
|
12
|
+
/** Decoding hint */
|
|
13
|
+
decoding?: "async" | "sync" | "auto";
|
|
14
|
+
/** Object fit behavior */
|
|
15
|
+
objectFit?: "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
16
|
+
/** Object position */
|
|
17
|
+
objectPosition?: string;
|
|
18
|
+
/** Aspect ratio (e.g., "16/9", "4/3", "1/1") */
|
|
19
|
+
aspectRatio?: string;
|
|
20
|
+
/** Whether this is a decorative image (sets alt="" and aria-hidden) */
|
|
21
|
+
isDecorative?: boolean;
|
|
22
|
+
/** Fallback image URL if src fails to load */
|
|
23
|
+
fallbackSrc?: string;
|
|
24
|
+
/** Callback when image loads successfully */
|
|
25
|
+
onLoad?: () => void;
|
|
26
|
+
/** Callback when image fails to load */
|
|
27
|
+
onError?: () => void;
|
|
28
|
+
/** Additional CSS class */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Responsive image srcset */
|
|
31
|
+
srcSet?: string;
|
|
32
|
+
/** Responsive image sizes */
|
|
33
|
+
sizes?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FederatedInstantResultsLayout } from './FederatedInstantResultsLayout';
|
|
3
|
+
declare const meta: Meta<typeof FederatedInstantResultsLayout>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FederatedInstantResultsLayout>;
|
|
6
|
+
export declare const WithResults: Story;
|
|
7
|
+
export declare const Loading: Story;
|
|
8
|
+
export declare const ProductsOnly: Story;
|
|
9
|
+
export declare const ContentOnly: Story;
|
|
10
|
+
export declare const NoResults: Story;
|
|
11
|
+
export declare const ProductsError: Story;
|
|
12
|
+
export declare const ContentsError: Story;
|
|
13
|
+
export declare const BothErrors: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { FederatedInstantResultsLayout } from "./FederatedInstantResultsLayout";
|
|
2
|
+
export { ResultsColumn } from "../ResultsColumn";
|
|
3
|
+
export { ResultsCount } from "../ResultsCount";
|
|
4
|
+
export { SeeAllLinkButton } from "../SeeAllLinkButton";
|
|
5
|
+
export { ProductCardHorizontal } from "../ProductCardHorizontal";
|
|
6
|
+
export { ContentCardHorizontal } from "../ContentCardHorizontal";
|
|
7
|
+
export type { FederatedInstantResultsLayoutProps, ResultsColumnProps, ProductCardHorizontalProps, ContentCardHorizontalProps, } from "../../types/search";
|
|
8
|
+
export type { ResultsCountProps } from "../ResultsCount";
|
|
9
|
+
export type { SeeAllLinkButtonProps } from "../SeeAllLinkButton";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LanguageSelectorProps } from './LanguageSelector.types';
|
|
3
|
+
/**
|
|
4
|
+
* Language Selector component
|
|
5
|
+
* Responsive layout: Desktop shows two-column grid, Mobile shows dropdown + links
|
|
6
|
+
*/
|
|
7
|
+
export declare const LanguageSelector: React.FC<LanguageSelectorProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { LanguageSelector } from './LanguageSelector';
|
|
3
|
+
declare const meta: Meta<typeof LanguageSelector>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof LanguageSelector>;
|
|
6
|
+
/**
|
|
7
|
+
* Desktop layout with two-column location grid and "Go to the international sites" heading.
|
|
8
|
+
* Shown overlaid on the Leybold website hero for realistic context.
|
|
9
|
+
* Features proper single-selection behaviour for locations and languages.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Desktop: Story;
|
|
12
|
+
/**
|
|
13
|
+
* Mobile layout with location dropdown and "Language" heading.
|
|
14
|
+
* Best viewed in mobile viewport (<992px).
|
|
15
|
+
* Features proper single-selection behaviour for locations and languages.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Mobile: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Location dropdown component showing closed and open states.
|
|
20
|
+
* Used on mobile view for location selection.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LocationDropdownStory: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Location selector link showing all four states:
|
|
25
|
+
* Default, Hover, Focus, and Selected (black bold text with red checkmark).
|
|
26
|
+
*/
|
|
27
|
+
export declare const LocationSelectorLinkStory: Story;
|
|
28
|
+
/**
|
|
29
|
+
* Language selector link showing all four states:
|
|
30
|
+
* Default, Hover, Focus, and Selected (red background with white text and checkmark).
|
|
31
|
+
*/
|
|
32
|
+
export declare const LanguageSelectorLinkStory: Story;
|