@envive-ai/react-toolkit 0.1.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/dist/packages/components/src/atoms/search/types.d.ts +5 -0
- package/dist/packages/components/src/atoms/search/types.js +1 -0
- package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.d.ts +2 -0
- package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.js +41 -0
- package/dist/packages/components/src/components/common/ButtonBase/types.d.ts +24 -0
- package/dist/packages/components/src/components/common/ButtonBase/types.js +6 -0
- package/dist/packages/components/src/components/common/Headline/Headline.d.ts +10 -0
- package/dist/packages/components/src/components/common/Headline/Headline.js +34 -0
- package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +12 -0
- package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.js +26 -0
- package/dist/packages/components/src/components/common/ProductCard/ProductCard.d.ts +39 -0
- package/dist/packages/components/src/components/common/ProductCard/ProductCard.js +83 -0
- package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.d.ts +9 -0
- package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.js +15 -0
- package/dist/packages/components/src/components/common/ProductCard/productCardVariants.d.ts +8 -0
- package/dist/packages/components/src/components/common/ProductCard/productCardVariants.js +50 -0
- package/dist/packages/components/src/components/common/ProductCard/types.d.ts +39 -0
- package/dist/packages/components/src/components/common/ProductCard/types.js +10 -0
- package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.d.ts +14 -0
- package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.js +13 -0
- package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.d.ts +10 -0
- package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.js +16 -0
- package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +7 -0
- package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.js +40 -0
- package/dist/packages/components/src/components/common/SparkleAnimation/types.d.ts +6 -0
- package/dist/packages/components/src/components/common/SparkleAnimation/types.js +7 -0
- package/dist/packages/components/src/components/common/Spinner/Spinner.d.ts +5 -0
- package/dist/packages/components/src/components/common/Spinner/Spinner.js +16 -0
- package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.d.ts +18 -0
- package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.js +210 -0
- package/dist/packages/components/src/components/common/SuggestionButton/types.d.ts +1 -0
- package/dist/packages/components/src/components/common/SuggestionButton/types.js +1 -0
- package/dist/packages/components/src/components/common/Text/Text.d.ts +12 -0
- package/dist/packages/components/src/components/common/Text/Text.js +26 -0
- package/dist/packages/components/src/components/common/Text/textVariantClasses.d.ts +171 -0
- package/dist/packages/components/src/components/common/Text/textVariantClasses.js +103 -0
- package/dist/packages/components/src/components/common/Text/types.d.ts +16 -0
- package/dist/packages/components/src/components/common/Text/types.js +6 -0
- package/dist/packages/components/src/components/common/TextInput/TextInput.d.ts +8 -0
- package/dist/packages/components/src/components/common/TextInput/TextInput.js +25 -0
- package/dist/packages/components/src/components/models/colorsConfig.d.ts +26 -0
- package/dist/packages/components/src/components/models/colorsConfig.js +23 -0
- package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +11 -0
- package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +18 -0
- package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +15 -0
- package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +15 -0
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.d.ts +2 -0
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.js +24 -0
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.d.ts +2 -0
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.js +9 -0
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.d.ts +2 -0
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.js +13 -0
- package/dist/packages/components/src/components/search/SearchFilter/types.d.ts +42 -0
- package/dist/packages/components/src/components/search/SearchFilter/types.js +1 -0
- package/dist/packages/components/src/components/search/SearchInput/SearchInput.d.ts +16 -0
- package/dist/packages/components/src/components/search/SearchInput/SearchInput.js +38 -0
- package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.d.ts +13 -0
- package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.js +12 -0
- package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +10 -0
- package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +14 -0
- package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.d.ts +16 -0
- package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.js +13 -0
- package/dist/packages/components/src/components/search/SearchInputForm/types.d.ts +1 -0
- package/dist/packages/components/src/components/search/SearchInputForm/types.js +1 -0
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +14 -0
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +15 -0
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +16 -0
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +29 -0
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.d.ts +2 -0
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.js +1 -0
- package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +8 -0
- package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.js +10 -0
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +24 -0
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.js +19 -0
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +6 -0
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +10 -0
- package/dist/packages/components/src/components/search/types.d.ts +5 -0
- package/dist/packages/components/src/components/search/types.js +6 -0
- package/dist/packages/components/src/components/test/types.d.ts +3 -0
- package/dist/packages/components/src/components/test/types.js +1 -0
- package/dist/packages/components/src/config/chatElementDisplayLocation.d.ts +21 -0
- package/dist/packages/components/src/config/chatElementDisplayLocation.js +23 -0
- package/dist/packages/components/src/index.d.ts +45 -0
- package/dist/packages/components/src/index.js +49 -0
- package/dist/packages/components/src/logging/logger.d.ts +7 -0
- package/dist/packages/components/src/logging/logger.js +16 -0
- package/dist/packages/components/src/types/external.d.ts +21 -0
- package/dist/packages/components/src/types/external.js +5 -0
- package/dist/packages/components/src/util/camelCase.d.ts +65 -0
- package/dist/packages/components/src/util/camelCase.js +2 -0
- package/dist/packages/components/src/util/camelCasedPropertiesDeep.d.ts +53 -0
- package/dist/packages/components/src/util/camelCasedPropertiesDeep.js +1 -0
- package/dist/packages/components/src/util/formatPrice.d.ts +1 -0
- package/dist/packages/components/src/util/formatPrice.js +11 -0
- package/dist/packages/components/src/util/internal.d.ts +27 -0
- package/dist/packages/components/src/util/internal.js +4 -0
- package/dist/packages/components/src/util/primitive.d.ts +6 -0
- package/dist/packages/components/src/util/primitive.js +2 -0
- package/dist/packages/components/src/util/splitWords.d.ts +55 -0
- package/dist/packages/components/src/util/splitWords.js +2 -0
- package/dist/packages/components/src/util/trim.d.ts +24 -0
- package/dist/packages/components/src/util/trim.js +2 -0
- package/dist/packages/components/src/util/unknownArray.d.ts +25 -0
- package/dist/packages/components/src/util/unknownArray.js +1 -0
- package/dist/src/atoms/search/types.d.ts +5 -0
- package/dist/src/atoms/search/types.js +1 -0
- package/dist/src/components/common/ButtonBase/ButtonBase.d.ts +2 -0
- package/dist/src/components/common/ButtonBase/ButtonBase.js +41 -0
- package/dist/src/components/common/ButtonBase/types.d.ts +24 -0
- package/dist/src/components/common/ButtonBase/types.js +6 -0
- package/dist/src/components/common/Headline/Headline.d.ts +10 -0
- package/dist/src/components/common/Headline/Headline.js +34 -0
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +12 -0
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.js +26 -0
- package/dist/src/components/common/ProductCard/ProductCard.d.ts +39 -0
- package/dist/src/components/common/ProductCard/ProductCard.js +84 -0
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.d.ts +9 -0
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.js +15 -0
- package/dist/src/components/common/ProductCard/productCardVariants.d.ts +8 -0
- package/dist/src/components/common/ProductCard/productCardVariants.js +50 -0
- package/dist/src/components/common/ProductCard/types.d.ts +39 -0
- package/dist/src/components/common/ProductCard/types.js +10 -0
- package/dist/src/components/common/ProductGrid/ProductGrid.d.ts +14 -0
- package/dist/src/components/common/ProductGrid/ProductGrid.js +13 -0
- package/dist/src/components/common/ProductGrid/productGridVariants.d.ts +10 -0
- package/dist/src/components/common/ProductGrid/productGridVariants.js +16 -0
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +7 -0
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.js +40 -0
- package/dist/src/components/common/SparkleAnimation/types.d.ts +6 -0
- package/dist/src/components/common/SparkleAnimation/types.js +7 -0
- package/dist/src/components/common/Spinner/Spinner.d.ts +5 -0
- package/dist/src/components/common/Spinner/Spinner.js +16 -0
- package/dist/src/components/common/SuggestionButton/SuggestionButton.d.ts +18 -0
- package/dist/src/components/common/SuggestionButton/SuggestionButton.js +210 -0
- package/dist/src/components/common/SuggestionButton/types.d.ts +1 -0
- package/dist/src/components/common/SuggestionButton/types.js +1 -0
- package/dist/src/components/common/Text/Text.d.ts +12 -0
- package/dist/src/components/common/Text/Text.js +26 -0
- package/dist/src/components/common/Text/textVariantClasses.d.ts +171 -0
- package/dist/src/components/common/Text/textVariantClasses.js +103 -0
- package/dist/src/components/common/Text/types.d.ts +16 -0
- package/dist/src/components/common/Text/types.js +6 -0
- package/dist/src/components/common/TextInput/TextInput.d.ts +8 -0
- package/dist/src/components/common/TextInput/TextInput.js +25 -0
- package/dist/src/components/models/colorsConfig.d.ts +26 -0
- package/dist/src/components/models/colorsConfig.js +23 -0
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +11 -0
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +18 -0
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +15 -0
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +15 -0
- package/dist/src/components/search/SearchFilter/SearchFilter.d.ts +2 -0
- package/dist/src/components/search/SearchFilter/SearchFilter.js +24 -0
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.d.ts +2 -0
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.js +9 -0
- package/dist/src/components/search/SearchFilter/SearchFilterItem.d.ts +2 -0
- package/dist/src/components/search/SearchFilter/SearchFilterItem.js +13 -0
- package/dist/src/components/search/SearchFilter/types.d.ts +42 -0
- package/dist/src/components/search/SearchFilter/types.js +1 -0
- package/dist/src/components/search/SearchInput/SearchInput.d.ts +16 -0
- package/dist/src/components/search/SearchInput/SearchInput.js +38 -0
- package/dist/src/components/search/SearchInput/searchInputVariants.d.ts +13 -0
- package/dist/src/components/search/SearchInput/searchInputVariants.js +12 -0
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +10 -0
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +14 -0
- package/dist/src/components/search/SearchInputForm/SearchInputForm.d.ts +16 -0
- package/dist/src/components/search/SearchInputForm/SearchInputForm.js +13 -0
- package/dist/src/components/search/SearchInputForm/types.d.ts +1 -0
- package/dist/src/components/search/SearchInputForm/types.js +1 -0
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +14 -0
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +15 -0
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +16 -0
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +29 -0
- package/dist/src/components/search/SearchResultsFilterSidebar/types.d.ts +2 -0
- package/dist/src/components/search/SearchResultsFilterSidebar/types.js +1 -0
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +8 -0
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.js +10 -0
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +24 -0
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.js +19 -0
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +6 -0
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +10 -0
- package/dist/src/components/search/types.d.ts +5 -0
- package/dist/src/components/search/types.js +6 -0
- package/dist/src/components/test/types.d.ts +3 -0
- package/dist/src/components/test/types.js +1 -0
- package/dist/src/config/chatElementDisplayLocation.d.ts +21 -0
- package/dist/src/config/chatElementDisplayLocation.js +23 -0
- package/dist/src/index.d.ts +45 -0
- package/dist/src/index.js +49 -0
- package/dist/src/logging/logger.d.ts +7 -0
- package/dist/src/logging/logger.js +16 -0
- package/dist/src/types/external.d.ts +21 -0
- package/dist/src/types/external.js +5 -0
- package/dist/src/util/camelCase.d.ts +65 -0
- package/dist/src/util/camelCase.js +2 -0
- package/dist/src/util/camelCasedPropertiesDeep.d.ts +53 -0
- package/dist/src/util/camelCasedPropertiesDeep.js +1 -0
- package/dist/src/util/formatPrice.d.ts +1 -0
- package/dist/src/util/formatPrice.js +11 -0
- package/dist/src/util/internal.d.ts +27 -0
- package/dist/src/util/internal.js +4 -0
- package/dist/src/util/primitive.d.ts +6 -0
- package/dist/src/util/primitive.js +2 -0
- package/dist/src/util/splitWords.d.ts +55 -0
- package/dist/src/util/splitWords.js +2 -0
- package/dist/src/util/trim.d.ts +24 -0
- package/dist/src/util/trim.js +2 -0
- package/dist/src/util/unknownArray.d.ts +25 -0
- package/dist/src/util/unknownArray.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { ButtonBase } from './components/common/ButtonBase/ButtonBase';
|
|
2
|
+
export { Headline } from './components/common/Headline/Headline';
|
|
3
|
+
export { ImageWithFallback } from './components/common/ImageWithFallback/ImageWithFallback';
|
|
4
|
+
export { ProductCard } from './components/common/ProductCard/ProductCard';
|
|
5
|
+
export { ProductCardSkeleton } from './components/common/ProductCard/ProductCardSkeleton';
|
|
6
|
+
export { ProductGrid } from './components/common/ProductGrid/ProductGrid';
|
|
7
|
+
export { SparkleAnimation } from './components/common/SparkleAnimation/SparkleAnimation';
|
|
8
|
+
export { Spinner } from './components/common/Spinner/Spinner';
|
|
9
|
+
export { SuggestionButton } from './components/common/SuggestionButton/SuggestionButton';
|
|
10
|
+
export { Text } from './components/common/Text/Text';
|
|
11
|
+
export { TextInput } from './components/common/TextInput/TextInput';
|
|
12
|
+
export { AppliedFiltersScrollbar } from './components/search/FilterScrollbar/AppliedFiltersScrollbar';
|
|
13
|
+
export { DynamicFiltersScrollbar } from './components/search/FilterScrollbar/DynamicFiltersScrollbar';
|
|
14
|
+
export { SearchFilter } from './components/search/SearchFilter/SearchFilter';
|
|
15
|
+
export { SearchFilterHeader } from './components/search/SearchFilter/SearchFilterHeader';
|
|
16
|
+
export { SearchFilterItem } from './components/search/SearchFilter/SearchFilterItem';
|
|
17
|
+
export { SearchInput } from './components/search/SearchInput/SearchInput';
|
|
18
|
+
export { SearchAutocomplete } from './components/search/SearchInputAutocomplete/SearchAutocomplete';
|
|
19
|
+
export { SearchInputForm } from './components/search/SearchInputForm/SearchInputForm';
|
|
20
|
+
export { SearchResultsFilter } from './components/search/SearchResultsFilterSidebar/SearchResultsFilter';
|
|
21
|
+
export { NoSearchResultsFound } from './components/search/SearchResultsStates/NoSearchResultsFound';
|
|
22
|
+
export { SearchResultsGrid } from './components/search/SearchResultsStates/SearchResultsGrid';
|
|
23
|
+
export { SearchResultsLoadingGrid } from './components/search/SearchResultsStates/SearchResultsLoadingGrid';
|
|
24
|
+
export * from './util/camelCase';
|
|
25
|
+
export * from './util/camelCasedPropertiesDeep';
|
|
26
|
+
export * from './util/formatPrice';
|
|
27
|
+
export * from './util/internal';
|
|
28
|
+
export * from './util/primitive';
|
|
29
|
+
export * from './util/splitWords';
|
|
30
|
+
export * from './util/trim';
|
|
31
|
+
export * from './util/unknownArray';
|
|
32
|
+
export * from './components/common/ButtonBase/types';
|
|
33
|
+
export * from './components/common/ProductCard/types';
|
|
34
|
+
export * from './components/common/SparkleAnimation/types';
|
|
35
|
+
export * from './components/common/SuggestionButton/types';
|
|
36
|
+
export * from './components/common/Text/types';
|
|
37
|
+
export type { HeadlineProps, HeadlineVariant } from './components/common/Text/types';
|
|
38
|
+
export * from './components/search/types';
|
|
39
|
+
export * from './components/search/SearchFilter/types';
|
|
40
|
+
export * from './components/search/SearchInputForm/types';
|
|
41
|
+
export type { SearchFilterSidebarVariant, CloseIconVariant as CloseIconVariantType, } from './components/search/SearchResultsFilterSidebar/types';
|
|
42
|
+
export * from './atoms/search/types';
|
|
43
|
+
export { ChatElementDisplayLocation } from './config/chatElementDisplayLocation';
|
|
44
|
+
export { productGridVariantClasses } from './components/common/ProductGrid/productGridVariants';
|
|
45
|
+
export { searchFilterSidebarVariantClasses } from './components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Common Components
|
|
2
|
+
export { ButtonBase } from './components/common/ButtonBase/ButtonBase';
|
|
3
|
+
export { Headline } from './components/common/Headline/Headline';
|
|
4
|
+
export { ImageWithFallback } from './components/common/ImageWithFallback/ImageWithFallback';
|
|
5
|
+
export { ProductCard } from './components/common/ProductCard/ProductCard';
|
|
6
|
+
export { ProductCardSkeleton } from './components/common/ProductCard/ProductCardSkeleton';
|
|
7
|
+
export { ProductGrid } from './components/common/ProductGrid/ProductGrid';
|
|
8
|
+
export { SparkleAnimation } from './components/common/SparkleAnimation/SparkleAnimation';
|
|
9
|
+
export { Spinner } from './components/common/Spinner/Spinner';
|
|
10
|
+
export { SuggestionButton } from './components/common/SuggestionButton/SuggestionButton';
|
|
11
|
+
export { Text } from './components/common/Text/Text';
|
|
12
|
+
export { TextInput } from './components/common/TextInput/TextInput';
|
|
13
|
+
// Search Components
|
|
14
|
+
export { AppliedFiltersScrollbar } from './components/search/FilterScrollbar/AppliedFiltersScrollbar';
|
|
15
|
+
export { DynamicFiltersScrollbar } from './components/search/FilterScrollbar/DynamicFiltersScrollbar';
|
|
16
|
+
export { SearchFilter } from './components/search/SearchFilter/SearchFilter';
|
|
17
|
+
export { SearchFilterHeader } from './components/search/SearchFilter/SearchFilterHeader';
|
|
18
|
+
export { SearchFilterItem } from './components/search/SearchFilter/SearchFilterItem';
|
|
19
|
+
export { SearchInput } from './components/search/SearchInput/SearchInput';
|
|
20
|
+
export { SearchAutocomplete } from './components/search/SearchInputAutocomplete/SearchAutocomplete';
|
|
21
|
+
export { SearchInputForm } from './components/search/SearchInputForm/SearchInputForm';
|
|
22
|
+
export { SearchResultsFilter } from './components/search/SearchResultsFilterSidebar/SearchResultsFilter';
|
|
23
|
+
export { NoSearchResultsFound } from './components/search/SearchResultsStates/NoSearchResultsFound';
|
|
24
|
+
export { SearchResultsGrid } from './components/search/SearchResultsStates/SearchResultsGrid';
|
|
25
|
+
export { SearchResultsLoadingGrid } from './components/search/SearchResultsStates/SearchResultsLoadingGrid';
|
|
26
|
+
// Utilities
|
|
27
|
+
export * from './util/camelCase';
|
|
28
|
+
export * from './util/camelCasedPropertiesDeep';
|
|
29
|
+
export * from './util/formatPrice';
|
|
30
|
+
export * from './util/internal';
|
|
31
|
+
export * from './util/primitive';
|
|
32
|
+
export * from './util/splitWords';
|
|
33
|
+
export * from './util/trim';
|
|
34
|
+
export * from './util/unknownArray';
|
|
35
|
+
// Types
|
|
36
|
+
export * from './components/common/ButtonBase/types';
|
|
37
|
+
export * from './components/common/ProductCard/types';
|
|
38
|
+
export * from './components/common/SparkleAnimation/types';
|
|
39
|
+
export * from './components/common/SuggestionButton/types';
|
|
40
|
+
export * from './components/common/Text/types';
|
|
41
|
+
export * from './components/search/types';
|
|
42
|
+
export * from './components/search/SearchFilter/types';
|
|
43
|
+
export * from './components/search/SearchInputForm/types';
|
|
44
|
+
export * from './atoms/search/types';
|
|
45
|
+
// Config exports
|
|
46
|
+
export { ChatElementDisplayLocation } from './config/chatElementDisplayLocation';
|
|
47
|
+
// Variants
|
|
48
|
+
export { productGridVariantClasses } from './components/common/ProductGrid/productGridVariants';
|
|
49
|
+
export { searchFilterSidebarVariantClasses } from './components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare class Logger {
|
|
2
|
+
static logInfo(message: string, ...args: unknown[]): void;
|
|
3
|
+
static logDebug(message: string, ...args: unknown[]): void;
|
|
4
|
+
static logError(message: string, error: unknown | undefined, ...args: unknown[]): void;
|
|
5
|
+
static logWarn(message: string, error: unknown | undefined, ...args: unknown[]): void;
|
|
6
|
+
}
|
|
7
|
+
export default Logger;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
class Logger {
|
|
3
|
+
static logInfo(message, ...args) {
|
|
4
|
+
console.info(`INFO: ${message}`, ...args);
|
|
5
|
+
}
|
|
6
|
+
static logDebug(message, ...args) {
|
|
7
|
+
console.debug(`DEBUG: ${message}`, ...args);
|
|
8
|
+
}
|
|
9
|
+
static logError(message, error, ...args) {
|
|
10
|
+
console.error(`ERROR: ${message} error=${error}`, args);
|
|
11
|
+
}
|
|
12
|
+
static logWarn(message, error, ...args) {
|
|
13
|
+
console.warn(`WARN: ${message} error=${error}`, args);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export default Logger;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum ResponseCategory {
|
|
2
|
+
Product = "product"
|
|
3
|
+
}
|
|
4
|
+
export interface SearchResponseProduct {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
price?: number;
|
|
9
|
+
currency?: string;
|
|
10
|
+
imageUrl?: string;
|
|
11
|
+
brand?: string;
|
|
12
|
+
category?: string;
|
|
13
|
+
availability?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
responseId?: string;
|
|
16
|
+
originalPrice?: number;
|
|
17
|
+
salePrice?: number;
|
|
18
|
+
averageRating?: number;
|
|
19
|
+
numberReviews?: number;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SplitWords } from './splitWords';
|
|
2
|
+
/**
|
|
3
|
+
* CamelCase options.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link CamelCase}
|
|
6
|
+
*/
|
|
7
|
+
export type CamelCaseOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to preserved consecutive uppercase letter.
|
|
10
|
+
*
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
preserveConsecutiveUppercase?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Convert an array of words to camel-case.
|
|
17
|
+
*/
|
|
18
|
+
type CamelCaseFromArray<Words extends string[], Options extends CamelCaseOptions, OutputString extends string = ''> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]] ? Options['preserveConsecutiveUppercase'] extends true ? `${Capitalize<FirstWord>}${CamelCaseFromArray<RemainingWords, Options>}` : `${Capitalize<Lowercase<FirstWord>>}${CamelCaseFromArray<RemainingWords, Options>}` : OutputString;
|
|
19
|
+
/**
|
|
20
|
+
* Convert a string literal to camel-case.
|
|
21
|
+
*
|
|
22
|
+
* This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
|
|
23
|
+
*
|
|
24
|
+
* By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```
|
|
28
|
+
* import type {CamelCase} from 'type-fest';
|
|
29
|
+
*
|
|
30
|
+
* // Simple
|
|
31
|
+
*
|
|
32
|
+
* const someVariable: CamelCase<'foo-bar'> = 'fooBar';
|
|
33
|
+
*
|
|
34
|
+
* // Advanced
|
|
35
|
+
*
|
|
36
|
+
* type CamelCasedProperties<T> = {
|
|
37
|
+
* [K in keyof T as CamelCase<K>]: T[K]
|
|
38
|
+
* };
|
|
39
|
+
*
|
|
40
|
+
* interface RawOptions {
|
|
41
|
+
* 'dry-run': boolean;
|
|
42
|
+
* 'full_family_name': string;
|
|
43
|
+
* foo: number;
|
|
44
|
+
* BAR: string;
|
|
45
|
+
* QUZ_QUX: number;
|
|
46
|
+
* 'OTHER-FIELD': boolean;
|
|
47
|
+
* }
|
|
48
|
+
*
|
|
49
|
+
* const dbResult: CamelCasedProperties<RawOptions> = {
|
|
50
|
+
* dryRun: true,
|
|
51
|
+
* fullFamilyName: 'bar.js',
|
|
52
|
+
* foo: 123,
|
|
53
|
+
* bar: 'foo',
|
|
54
|
+
* quzQux: 6,
|
|
55
|
+
* otherField: false
|
|
56
|
+
* };
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @category Change case
|
|
60
|
+
* @category Template literal
|
|
61
|
+
*/
|
|
62
|
+
export type CamelCase<Type, Options extends CamelCaseOptions = {
|
|
63
|
+
preserveConsecutiveUppercase: true;
|
|
64
|
+
}> = Type extends string ? string extends Type ? Type : Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> : Type;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CamelCase, CamelCaseOptions } from './camelCase';
|
|
2
|
+
import type { UnknownArray } from './unknownArray';
|
|
3
|
+
/**
|
|
4
|
+
* Convert object properties to camel case recursively.
|
|
5
|
+
*
|
|
6
|
+
* This can be useful when, for example, converting some API types from a different style.
|
|
7
|
+
*
|
|
8
|
+
* @see CamelCasedProperties
|
|
9
|
+
* @see CamelCase
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```
|
|
13
|
+
* import type {CamelCasedPropertiesDeep} from 'type-fest';
|
|
14
|
+
*
|
|
15
|
+
* interface User {
|
|
16
|
+
* UserId: number;
|
|
17
|
+
* UserName: string;
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* interface UserWithFriends {
|
|
21
|
+
* UserInfo: User;
|
|
22
|
+
* UserFriends: User[];
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* const result: CamelCasedPropertiesDeep<UserWithFriends> = {
|
|
26
|
+
* userInfo: {
|
|
27
|
+
* userId: 1,
|
|
28
|
+
* userName: 'Tom',
|
|
29
|
+
* },
|
|
30
|
+
* userFriends: [
|
|
31
|
+
* {
|
|
32
|
+
* userId: 2,
|
|
33
|
+
* userName: 'Jerry',
|
|
34
|
+
* },
|
|
35
|
+
* {
|
|
36
|
+
* userId: 3,
|
|
37
|
+
* userName: 'Spike',
|
|
38
|
+
* },
|
|
39
|
+
* ],
|
|
40
|
+
* };
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @category Change case
|
|
44
|
+
* @category Template literal
|
|
45
|
+
* @category Object
|
|
46
|
+
*/
|
|
47
|
+
export type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
|
|
48
|
+
preserveConsecutiveUppercase: true;
|
|
49
|
+
}> = Value extends Function ? Value : Value extends UnknownArray ? CamelCasedPropertiesArrayDeep<Value> : Value extends Set<infer U> ? Set<CamelCasedPropertiesDeep<U, Options>> : {
|
|
50
|
+
[K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options>;
|
|
51
|
+
};
|
|
52
|
+
type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends [] ? [] : Value extends [infer U, ...infer V] ? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [infer U, ...infer V] ? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends Array<infer U> ? Array<CamelCasedPropertiesDeep<U>> : Value extends ReadonlyArray<infer U> ? ReadonlyArray<CamelCasedPropertiesDeep<U>> : never;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatPrice: (price?: number, currency?: string) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const formatPrice = (price, currency = '$') => {
|
|
2
|
+
if (price == null) {
|
|
3
|
+
return '';
|
|
4
|
+
}
|
|
5
|
+
const options = {};
|
|
6
|
+
if (!Number.isInteger(price)) {
|
|
7
|
+
options.minimumFractionDigits = 2;
|
|
8
|
+
options.maximumFractionDigits = 2;
|
|
9
|
+
}
|
|
10
|
+
return `${currency}${price.toLocaleString('en-US', options)}`;
|
|
11
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Primitive } from './primitive';
|
|
2
|
+
import type { Trim } from './trim';
|
|
3
|
+
/**
|
|
4
|
+
* Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
5
|
+
*/
|
|
6
|
+
export type BuiltIns = Primitive | void | Date | RegExp;
|
|
7
|
+
/**
|
|
8
|
+
* Matches non-recursive types.
|
|
9
|
+
*/
|
|
10
|
+
export type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown);
|
|
11
|
+
/**
|
|
12
|
+
* Returns a boolean for whether the string is numeric.
|
|
13
|
+
*
|
|
14
|
+
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
15
|
+
*/
|
|
16
|
+
export type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a boolean for whether the string is lowercased.
|
|
19
|
+
*/
|
|
20
|
+
export type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a boolean for whether the string is upper-cased.
|
|
23
|
+
*/
|
|
24
|
+
export type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
25
|
+
export type WordSeparators = '-' | '_' | Whitespace;
|
|
26
|
+
export type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
|
|
27
|
+
export type UpperCaseCharacters = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from './internal';
|
|
2
|
+
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
3
|
+
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
4
|
+
/**
|
|
5
|
+
* Split a string (almost) like Lodash's `_.words()` function.
|
|
6
|
+
*
|
|
7
|
+
* - Split on each word that begins with a capital letter.
|
|
8
|
+
* - Split on each {@link WordSeparators}.
|
|
9
|
+
* - Split on numeric sequence.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```
|
|
13
|
+
* type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
|
|
14
|
+
* type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
|
|
15
|
+
* type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
|
|
16
|
+
* type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
|
|
17
|
+
* type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
* @category Change case
|
|
22
|
+
* @category Template literal
|
|
23
|
+
*/
|
|
24
|
+
export type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [
|
|
25
|
+
...SkipEmptyWord<CurrentWord>,
|
|
26
|
+
...SplitWords<RemainingCharacters>
|
|
27
|
+
] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [
|
|
28
|
+
false,
|
|
29
|
+
true
|
|
30
|
+
] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [
|
|
31
|
+
...SkipEmptyWord<CurrentWord>,
|
|
32
|
+
...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
|
|
33
|
+
] : [
|
|
34
|
+
true,
|
|
35
|
+
false
|
|
36
|
+
] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [
|
|
37
|
+
...SkipEmptyWord<CurrentWord>,
|
|
38
|
+
...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
|
|
39
|
+
] : [
|
|
40
|
+
true,
|
|
41
|
+
true
|
|
42
|
+
] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [
|
|
43
|
+
true,
|
|
44
|
+
true
|
|
45
|
+
] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [
|
|
46
|
+
...SkipEmptyWord<CurrentWord>,
|
|
47
|
+
...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
|
|
48
|
+
] : [
|
|
49
|
+
true,
|
|
50
|
+
true
|
|
51
|
+
] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [
|
|
52
|
+
...RemoveLastCharacter<CurrentWord, LastCharacter>,
|
|
53
|
+
...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>
|
|
54
|
+
] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Whitespace } from './internal';
|
|
2
|
+
/**
|
|
3
|
+
* Remove spaces from the left side.
|
|
4
|
+
*/
|
|
5
|
+
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
6
|
+
/**
|
|
7
|
+
* Remove spaces from the right side.
|
|
8
|
+
*/
|
|
9
|
+
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
10
|
+
/**
|
|
11
|
+
* Remove leading and trailing spaces from a string.
|
|
12
|
+
* @example
|
|
13
|
+
* ```
|
|
14
|
+
* import type {Trim} from 'type-fest';
|
|
15
|
+
*
|
|
16
|
+
* Trim<' foo '>
|
|
17
|
+
* //=> 'foo'
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @category String
|
|
21
|
+
* @category Template literal
|
|
22
|
+
*/
|
|
23
|
+
export type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an array with `unknown` value.
|
|
3
|
+
*
|
|
4
|
+
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```
|
|
8
|
+
* import type {UnknownArray} from 'type-fest';
|
|
9
|
+
*
|
|
10
|
+
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
11
|
+
*
|
|
12
|
+
* type A = IsArray<['foo']>;
|
|
13
|
+
* //=> true
|
|
14
|
+
*
|
|
15
|
+
* type B = IsArray<readonly number[]>;
|
|
16
|
+
* //=> true
|
|
17
|
+
*
|
|
18
|
+
* type C = IsArray<string>;
|
|
19
|
+
* //=> false
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @category Type
|
|
23
|
+
* @category Array
|
|
24
|
+
*/
|
|
25
|
+
export type UnknownArray = readonly unknown[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { createElement, useEffect, useRef } from 'react';
|
|
4
|
+
import { ButtonBaseOverrides } from './types';
|
|
5
|
+
import { Text } from '../../../components/common/Text/Text';
|
|
6
|
+
export const ButtonBase = ({ type = 'button', isDisabled = false, dataAttributes, buttonClass, text, textClass, icon, iconClass = 'spiffy-tw-w-[21px] spiffy-tw-h-[21px]', dataTestId, onClick, disablePadding = false, }) => {
|
|
7
|
+
const buttonRef = useRef(null);
|
|
8
|
+
const buttonClassName = classNames({
|
|
9
|
+
[ButtonBaseOverrides.BUTTON]: true,
|
|
10
|
+
'spiffy-tw-flex': true,
|
|
11
|
+
'spiffy-tw-min-h-[36px]': true,
|
|
12
|
+
'spiffy-tw-cursor-pointer': true,
|
|
13
|
+
'spiffy-tw-items-center': true,
|
|
14
|
+
'spiffy-tw-gap-2': true,
|
|
15
|
+
'spiffy-tw-px-4': !disablePadding,
|
|
16
|
+
'spiffy-tw-transition-colors': true,
|
|
17
|
+
'spiffy-tw-opacity-40': isDisabled,
|
|
18
|
+
'spiffy-tw-cursor-not-allowed': isDisabled,
|
|
19
|
+
[`${buttonClass}`]: buttonClass != null,
|
|
20
|
+
});
|
|
21
|
+
const textClassName = classNames({
|
|
22
|
+
[ButtonBaseOverrides.BUTTON_TEXT]: true,
|
|
23
|
+
'spiffy-tw-whitespace-nowrap': true,
|
|
24
|
+
[`${textClass}`]: textClass != null,
|
|
25
|
+
});
|
|
26
|
+
const iconClassName = classNames({
|
|
27
|
+
[ButtonBaseOverrides.BUTTON_ICON]: true,
|
|
28
|
+
[`${iconClass}`]: iconClass != null,
|
|
29
|
+
});
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (dataAttributes && buttonRef.current) {
|
|
32
|
+
Object.entries(dataAttributes).forEach(([key, value]) => {
|
|
33
|
+
buttonRef.current?.setAttribute(key, value);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}, [dataAttributes]);
|
|
37
|
+
return (_jsxs("button", { type: type, ref: buttonRef, className: buttonClassName, disabled: isDisabled, "data-testid": dataTestId, onClick: onClick, children: [icon &&
|
|
38
|
+
createElement(icon, {
|
|
39
|
+
className: iconClassName,
|
|
40
|
+
}), _jsx(Text, { className: textClassName, children: text })] }));
|
|
41
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
+
import type { TestProps } from '../../../components/test/types';
|
|
3
|
+
export interface ButtonHoverStyles extends CSSProperties {
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ButtonBaseProps extends TestProps {
|
|
8
|
+
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
dataAttributes?: Record<string, string>;
|
|
11
|
+
buttonClass?: string;
|
|
12
|
+
text: string;
|
|
13
|
+
textClass?: string;
|
|
14
|
+
icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
15
|
+
iconClass?: string;
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
disablePadding?: boolean;
|
|
18
|
+
dataTestId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare enum ButtonBaseOverrides {
|
|
21
|
+
BUTTON = "spiffy-button-base-button",
|
|
22
|
+
BUTTON_TEXT = "spiffy-button-base-button-text",
|
|
23
|
+
BUTTON_ICON = "spiffy-button-base-button-icon"
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var ButtonBaseOverrides;
|
|
2
|
+
(function (ButtonBaseOverrides) {
|
|
3
|
+
ButtonBaseOverrides["BUTTON"] = "spiffy-button-base-button";
|
|
4
|
+
ButtonBaseOverrides["BUTTON_TEXT"] = "spiffy-button-base-button-text";
|
|
5
|
+
ButtonBaseOverrides["BUTTON_ICON"] = "spiffy-button-base-button-icon";
|
|
6
|
+
})(ButtonBaseOverrides || (ButtonBaseOverrides = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type HeadlineVariant = 't1' | 't2' | 't3' | 'h1' | 'h2' | 'h3' | 'h4';
|
|
2
|
+
export type HeadlineProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
variant?: HeadlineVariant;
|
|
7
|
+
testId?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const Headline: ({ children, className, style, testId, variant }: HeadlineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { HeadlineVariantMap } from '../Text/textVariantClasses';
|
|
4
|
+
export const Headline = ({ children, className, style, testId, variant = 'h1' }) => {
|
|
5
|
+
const variantClassNames = variant ? HeadlineVariantMap[variant] : {};
|
|
6
|
+
const textClassNames = classNames(className, variantClassNames, {
|
|
7
|
+
'spiffy-tw-font-[Poppins,sans-serif]': true,
|
|
8
|
+
});
|
|
9
|
+
const T1 = () => (_jsx("h1", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
10
|
+
const T2 = () => (_jsx("h2", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
11
|
+
const T3 = () => (_jsx("h3", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
12
|
+
const H1 = () => (_jsx("h1", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
13
|
+
const H2 = () => (_jsx("h2", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
14
|
+
const H3 = () => (_jsx("h3", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
15
|
+
const H4 = () => (_jsx("h4", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
16
|
+
switch (variant) {
|
|
17
|
+
case 't1':
|
|
18
|
+
return T1();
|
|
19
|
+
case 't2':
|
|
20
|
+
return T2();
|
|
21
|
+
case 't3':
|
|
22
|
+
return T3();
|
|
23
|
+
case 'h1':
|
|
24
|
+
return H1();
|
|
25
|
+
case 'h2':
|
|
26
|
+
return H2();
|
|
27
|
+
case 'h3':
|
|
28
|
+
return H3();
|
|
29
|
+
case 'h4':
|
|
30
|
+
return H4();
|
|
31
|
+
default:
|
|
32
|
+
throw new Error(`Invalid variant: ${variant}`);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ImageWithFallbackProps {
|
|
3
|
+
src: string | undefined;
|
|
4
|
+
alt: string;
|
|
5
|
+
fallbackClassnames?: string;
|
|
6
|
+
fallback: React.ReactNode;
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
imageClassnames: string;
|
|
9
|
+
onLoad?: () => void;
|
|
10
|
+
onError?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const ImageWithFallback: ({ src, alt, dataTestId, fallbackClassnames, fallback, imageClassnames, onLoad, onError, }: ImageWithFallbackProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
export const ImageWithFallback = ({ src, alt, dataTestId, fallbackClassnames, fallback, imageClassnames, onLoad, onError, }) => {
|
|
5
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
6
|
+
const [isError, setIsError] = useState(false);
|
|
7
|
+
const imageExtraClassnames = classNames(imageClassnames, {
|
|
8
|
+
'spiffy-tw-block': isLoaded,
|
|
9
|
+
'spiffy-tw-hidden': !isLoaded,
|
|
10
|
+
});
|
|
11
|
+
const fallbackMergedClassNames = classNames({
|
|
12
|
+
'spiffy-tw-flex': true,
|
|
13
|
+
'spiffy-tw-flex-col': true,
|
|
14
|
+
'spiffy-tw-items-center': true,
|
|
15
|
+
}, fallbackClassnames);
|
|
16
|
+
if (isError) {
|
|
17
|
+
return _jsx("div", { className: fallbackMergedClassNames, children: fallback });
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs(_Fragment, { children: [!isLoaded && _jsx("div", { className: fallbackMergedClassNames, children: fallback }), _jsx("img", { src: src, className: imageExtraClassnames, "data-testid": dataTestId, alt: alt, onLoad: () => {
|
|
20
|
+
setIsLoaded(true);
|
|
21
|
+
onLoad?.();
|
|
22
|
+
}, onError: () => {
|
|
23
|
+
setIsError(true);
|
|
24
|
+
onError?.();
|
|
25
|
+
} })] }));
|
|
26
|
+
};
|