@envive-ai/react-toolkit 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -0
- package/dist/AppliedFiltersScrollbar-BlcyhZkZ.cjs +53 -0
- package/dist/AppliedFiltersScrollbar-DFGzRemu.js +44 -0
- package/dist/ButtonBase-C1rsL9gO.js +60 -0
- package/dist/ButtonBase-a8uj6c2f.cjs +69 -0
- package/dist/DynamicFiltersScrollbar-B2Rr1KnJ.cjs +41 -0
- package/dist/DynamicFiltersScrollbar-Dys6geP0.js +32 -0
- package/dist/Headline-L7w3BsBF.cjs +72 -0
- package/dist/Headline-ro_Nigw5.js +64 -0
- package/dist/ImageWithFallback-CfmkC58B.js +42 -0
- package/dist/ImageWithFallback-P3AjyL2Y.cjs +51 -0
- package/dist/ProductCard-Btg8tHGc.js +172 -0
- package/dist/ProductCard-CS6DZAwO.cjs +193 -0
- package/dist/ProductCardSkeleton-BPfp6IOp.js +38 -0
- package/dist/ProductCardSkeleton-BgvDlaty.cjs +46 -0
- package/dist/ProductGrid-B7QZfW-v.cjs +77 -0
- package/dist/ProductGrid-DB_Uq5F-.js +69 -0
- package/dist/SearchAutocomplete-C5FL82xC.js +51 -0
- package/dist/SearchAutocomplete-wr18dJ8L.cjs +62 -0
- package/dist/SearchFilter-D-2IdBKS.js +62 -0
- package/dist/SearchFilter-D0IzBlG5.cjs +70 -0
- package/dist/SearchFilterHeader-BQT0-ssS.js +37 -0
- package/dist/SearchFilterHeader-C3EklfoO.cjs +45 -0
- package/dist/SearchFilterItem-BodtWLoP.js +26 -0
- package/dist/SearchFilterItem-DmMkiqNC.cjs +34 -0
- package/dist/SearchInput-BrcAgcvI.js +89 -0
- package/dist/SearchInput-DSB9CwIq.cjs +106 -0
- package/dist/SparkleAnimation-BpLwrEqM.cjs +96 -0
- package/dist/SparkleAnimation-CXs58sFd.js +85 -0
- package/dist/Spinner-BZ-kTOpm.js +38 -0
- package/dist/Spinner-CfQ85Ajl.cjs +46 -0
- package/dist/Text-Bdv7F5-u.js +42 -0
- package/dist/Text-C04c4Z93.cjs +50 -0
- package/dist/TextInput-BO80ixsV.cjs +40 -0
- package/dist/TextInput-CEGWfdPC.js +31 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/colorsConfig-TCONYTQ7.cjs +38 -0
- package/dist/colorsConfig-l0ODUVhu.js +26 -0
- package/dist/common/ButtonBase/ButtonBase.cjs +5 -0
- package/dist/common/ButtonBase/ButtonBase.d.cts +35 -0
- package/dist/common/ButtonBase/ButtonBase.d.ts +35 -0
- package/dist/common/ButtonBase/ButtonBase.js +5 -0
- package/dist/common/Headline/Headline.cjs +4 -0
- package/dist/common/Headline/Headline.d.cts +21 -0
- package/dist/common/Headline/Headline.d.ts +21 -0
- package/dist/common/Headline/Headline.js +4 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.cjs +3 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.d.cts +26 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.d.ts +26 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.js +3 -0
- package/dist/common/ProductCard/ProductCard.cjs +11 -0
- package/dist/common/ProductCard/ProductCard.d.cts +91 -0
- package/dist/common/ProductCard/ProductCard.d.ts +91 -0
- package/dist/common/ProductCard/ProductCard.js +9 -0
- package/dist/common/ProductCard/ProductCardSkeleton.cjs +4 -0
- package/dist/common/ProductCard/ProductCardSkeleton.d.cts +12 -0
- package/dist/common/ProductCard/ProductCardSkeleton.d.ts +12 -0
- package/dist/common/ProductCard/ProductCardSkeleton.js +4 -0
- package/dist/common/ProductGrid/ProductGrid.cjs +11 -0
- package/dist/common/ProductGrid/ProductGrid.d.cts +26 -0
- package/dist/common/ProductGrid/ProductGrid.d.ts +26 -0
- package/dist/common/ProductGrid/ProductGrid.js +11 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.cjs +3 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.d.cts +15 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.d.ts +15 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.js +3 -0
- package/dist/common/Spinner/Spinner.cjs +3 -0
- package/dist/common/Spinner/Spinner.d.cts +11 -0
- package/dist/common/Spinner/Spinner.d.ts +11 -0
- package/dist/common/Spinner/Spinner.js +3 -0
- package/dist/common/SuggestionButton/SuggestionButton.cjs +188 -0
- package/dist/common/SuggestionButton/SuggestionButton.d.cts +35 -0
- package/dist/common/SuggestionButton/SuggestionButton.d.ts +35 -0
- package/dist/common/SuggestionButton/SuggestionButton.js +180 -0
- package/dist/common/Text/Text.cjs +4 -0
- package/dist/common/Text/Text.d.cts +28 -0
- package/dist/common/Text/Text.d.ts +28 -0
- package/dist/common/Text/Text.js +4 -0
- package/dist/common/TextInput/TextInput.cjs +4 -0
- package/dist/common/TextInput/TextInput.d.cts +98 -0
- package/dist/common/TextInput/TextInput.d.ts +98 -0
- package/dist/common/TextInput/TextInput.js +4 -0
- package/dist/productCardVariants-C_QIZ-KF.js +45 -0
- package/dist/productCardVariants-Dd-wrJKP.cjs +69 -0
- package/dist/productGridVariants-CxCKx5Fq.js +20 -0
- package/dist/productGridVariants-DVzvjK9i.cjs +26 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.cjs +5 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.cts +22 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +22 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.js +5 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.cjs +5 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.cts +28 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +28 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.js +5 -0
- package/dist/search/SearchFilter/SearchFilter.cjs +7 -0
- package/dist/search/SearchFilter/SearchFilter.d.cts +18 -0
- package/dist/search/SearchFilter/SearchFilter.d.ts +18 -0
- package/dist/search/SearchFilter/SearchFilter.js +7 -0
- package/dist/search/SearchFilter/SearchFilterHeader.cjs +5 -0
- package/dist/search/SearchFilter/SearchFilterHeader.d.cts +12 -0
- package/dist/search/SearchFilter/SearchFilterHeader.d.ts +12 -0
- package/dist/search/SearchFilter/SearchFilterHeader.js +5 -0
- package/dist/search/SearchFilter/SearchFilterItem.cjs +5 -0
- package/dist/search/SearchFilter/SearchFilterItem.d.cts +13 -0
- package/dist/search/SearchFilter/SearchFilterItem.d.ts +13 -0
- package/dist/search/SearchFilter/SearchFilterItem.js +5 -0
- package/dist/search/SearchInput/SearchInput.cjs +6 -0
- package/dist/search/SearchInput/SearchInput.d.cts +20 -0
- package/dist/search/SearchInput/SearchInput.d.ts +20 -0
- package/dist/search/SearchInput/SearchInput.js +6 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.cjs +3 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.cts +13 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +13 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.js +3 -0
- package/dist/search/SearchInputForm/SearchInputForm.cjs +38 -0
- package/dist/search/SearchInputForm/SearchInputForm.d.cts +32 -0
- package/dist/search/SearchInputForm/SearchInputForm.d.ts +32 -0
- package/dist/search/SearchInputForm/SearchInputForm.js +36 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.cjs +52 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +28 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +28 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.js +49 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.cjs +30 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.cts +17 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.ts +17 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.js +26 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.cjs +66 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.cts +41 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.ts +41 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.js +62 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.cts +15 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +15 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.js +49 -0
- package/dist/searchFilterSidebarVariants-GfFbQzGf.cjs +39 -0
- package/dist/searchFilterSidebarVariants-lJVVZT_2.js +34 -0
- package/dist/textVariantClasses-5t3OricK.js +101 -0
- package/dist/textVariantClasses-Bhf4VY5z.cjs +125 -0
- package/dist/types-53zIialA.d.ts +35 -0
- package/dist/types-B4BGZSlV.d.cts +4 -0
- package/dist/types-BQNqA5xL.d.ts +46 -0
- package/dist/types-BRLWwGMI.d.ts +4 -0
- package/dist/types-CImLkcNh.d.cts +46 -0
- package/dist/types-Cph97xkm.d.ts +6 -0
- package/dist/types-CpiJO5UH.d.ts +4 -0
- package/dist/types-DFetqNL2.d.ts +8 -0
- package/dist/types-DaSkJnT_.d.cts +8 -0
- package/dist/types-Dy4_w6Cf.d.cts +4 -0
- package/dist/types-TYhhwWZw.d.cts +6 -0
- package/dist/types-aa4flfRE.d.cts +35 -0
- package/package.json +8 -5
- package/src/atoms/search/types.ts +5 -0
- package/src/components/common/ButtonBase/ButtonBase.tsx +70 -0
- package/src/components/common/ButtonBase/types.ts +26 -0
- package/src/components/common/Headline/Headline.tsx +81 -0
- package/src/components/common/ImageWithFallback/ImageWithFallback.tsx +66 -0
- package/src/components/common/ProductCard/ProductCard.tsx +305 -0
- package/src/components/common/ProductCard/ProductCardSkeleton.tsx +83 -0
- package/src/components/common/ProductCard/productCardVariants.ts +63 -0
- package/src/components/common/ProductCard/types.ts +49 -0
- package/src/components/common/ProductGrid/ProductGrid.tsx +73 -0
- package/src/components/common/ProductGrid/productGridVariants.ts +31 -0
- package/src/components/common/SparkleAnimation/SparkleAnimation.tsx +105 -0
- package/src/components/common/SparkleAnimation/types.ts +6 -0
- package/src/components/common/Spinner/Spinner.tsx +30 -0
- package/src/components/common/SuggestionButton/SuggestionButton.tsx +258 -0
- package/src/components/common/SuggestionButton/types.ts +14 -0
- package/src/components/common/Text/Text.tsx +58 -0
- package/src/components/common/Text/textVariantClasses.ts +106 -0
- package/src/components/common/Text/types.ts +23 -0
- package/src/components/common/TextInput/TextInput.tsx +34 -0
- package/src/components/models/colorsConfig.ts +28 -0
- package/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.tsx +70 -0
- package/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.tsx +52 -0
- package/src/components/search/SearchFilter/SearchFilter.tsx +84 -0
- package/src/components/search/SearchFilter/SearchFilterHeader.tsx +42 -0
- package/src/components/search/SearchFilter/SearchFilterItem.tsx +42 -0
- package/src/components/search/SearchFilter/types.ts +48 -0
- package/src/components/search/SearchInput/SearchInput.tsx +135 -0
- package/src/components/search/SearchInput/searchInputVariants.ts +27 -0
- package/src/components/search/SearchInputAutocomplete/SearchAutocomplete.tsx +62 -0
- package/src/components/search/SearchInputForm/SearchInputForm.tsx +66 -0
- package/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.tsx +82 -0
- package/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +45 -0
- package/{dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.d.ts → src/components/search/SearchResultsFilterSidebar/types.ts} +1 -1
- package/src/components/search/SearchResultsStates/NoSearchResultsFound.tsx +41 -0
- package/src/components/search/SearchResultsStates/SearchResultsGrid.tsx +105 -0
- package/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.tsx +50 -0
- package/src/components/search/types.ts +5 -0
- package/{dist/packages/components/src/components/test/types.d.ts → src/components/test/types.ts} +1 -1
- package/src/config/chatElementDisplayLocation.ts +22 -0
- package/src/logging/logger.ts +21 -0
- package/src/types/external.ts +24 -0
- package/{dist/packages/components/src/util/camelCase.d.ts → src/util/camelCase.ts} +33 -11
- package/src/util/camelCasedPropertiesDeep.ts +81 -0
- package/src/util/formatPrice.ts +14 -0
- package/src/util/internal.ts +95 -0
- package/{dist/src/util/primitive.d.ts → src/util/primitive.ts} +2 -0
- package/src/util/splitWords.ts +72 -0
- package/{dist/src/util/trim.d.ts → src/util/trim.ts} +5 -1
- package/dist/packages/components/src/atoms/search/types.d.ts +0 -5
- package/dist/packages/components/src/atoms/search/types.js +0 -1
- package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
- package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.js +0 -41
- package/dist/packages/components/src/components/common/ButtonBase/types.d.ts +0 -24
- package/dist/packages/components/src/components/common/ButtonBase/types.js +0 -6
- package/dist/packages/components/src/components/common/Headline/Headline.d.ts +0 -10
- package/dist/packages/components/src/components/common/Headline/Headline.js +0 -34
- package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
- package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
- package/dist/packages/components/src/components/common/ProductCard/ProductCard.d.ts +0 -39
- package/dist/packages/components/src/components/common/ProductCard/ProductCard.js +0 -83
- package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
- package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
- package/dist/packages/components/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
- package/dist/packages/components/src/components/common/ProductCard/productCardVariants.js +0 -50
- package/dist/packages/components/src/components/common/ProductCard/types.d.ts +0 -39
- package/dist/packages/components/src/components/common/ProductCard/types.js +0 -10
- package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
- package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.js +0 -13
- package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
- package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.js +0 -16
- package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
- package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
- package/dist/packages/components/src/components/common/SparkleAnimation/types.d.ts +0 -6
- package/dist/packages/components/src/components/common/SparkleAnimation/types.js +0 -7
- package/dist/packages/components/src/components/common/Spinner/Spinner.d.ts +0 -5
- package/dist/packages/components/src/components/common/Spinner/Spinner.js +0 -16
- package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
- package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
- package/dist/packages/components/src/components/common/SuggestionButton/types.d.ts +0 -1
- package/dist/packages/components/src/components/common/SuggestionButton/types.js +0 -1
- package/dist/packages/components/src/components/common/Text/Text.d.ts +0 -12
- package/dist/packages/components/src/components/common/Text/Text.js +0 -26
- package/dist/packages/components/src/components/common/Text/textVariantClasses.d.ts +0 -171
- package/dist/packages/components/src/components/common/Text/textVariantClasses.js +0 -103
- package/dist/packages/components/src/components/common/Text/types.d.ts +0 -16
- package/dist/packages/components/src/components/common/Text/types.js +0 -6
- package/dist/packages/components/src/components/common/TextInput/TextInput.d.ts +0 -8
- package/dist/packages/components/src/components/common/TextInput/TextInput.js +0 -25
- package/dist/packages/components/src/components/models/colorsConfig.d.ts +0 -26
- package/dist/packages/components/src/components/models/colorsConfig.js +0 -23
- package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
- package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
- package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
- package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.js +0 -24
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
- package/dist/packages/components/src/components/search/SearchFilter/types.d.ts +0 -42
- package/dist/packages/components/src/components/search/SearchFilter/types.js +0 -1
- package/dist/packages/components/src/components/search/SearchInput/SearchInput.d.ts +0 -16
- package/dist/packages/components/src/components/search/SearchInput/SearchInput.js +0 -38
- package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
- package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.js +0 -12
- package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
- package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
- package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
- package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
- package/dist/packages/components/src/components/search/SearchInputForm/types.js +0 -1
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
- package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
- package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
- package/dist/packages/components/src/components/search/types.d.ts +0 -5
- package/dist/packages/components/src/components/search/types.js +0 -6
- package/dist/packages/components/src/components/test/types.js +0 -1
- package/dist/packages/components/src/config/chatElementDisplayLocation.d.ts +0 -21
- package/dist/packages/components/src/config/chatElementDisplayLocation.js +0 -23
- package/dist/packages/components/src/index.d.ts +0 -45
- package/dist/packages/components/src/index.js +0 -49
- package/dist/packages/components/src/logging/logger.d.ts +0 -7
- package/dist/packages/components/src/logging/logger.js +0 -16
- package/dist/packages/components/src/types/external.d.ts +0 -21
- package/dist/packages/components/src/types/external.js +0 -5
- package/dist/packages/components/src/util/camelCase.js +0 -2
- package/dist/packages/components/src/util/camelCasedPropertiesDeep.d.ts +0 -53
- package/dist/packages/components/src/util/camelCasedPropertiesDeep.js +0 -1
- package/dist/packages/components/src/util/formatPrice.d.ts +0 -1
- package/dist/packages/components/src/util/formatPrice.js +0 -11
- package/dist/packages/components/src/util/internal.d.ts +0 -27
- package/dist/packages/components/src/util/internal.js +0 -4
- package/dist/packages/components/src/util/primitive.d.ts +0 -6
- package/dist/packages/components/src/util/primitive.js +0 -2
- package/dist/packages/components/src/util/splitWords.d.ts +0 -55
- package/dist/packages/components/src/util/splitWords.js +0 -2
- package/dist/packages/components/src/util/trim.d.ts +0 -24
- package/dist/packages/components/src/util/trim.js +0 -2
- package/dist/packages/components/src/util/unknownArray.js +0 -1
- package/dist/src/atoms/search/types.d.ts +0 -5
- package/dist/src/atoms/search/types.js +0 -1
- package/dist/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
- package/dist/src/components/common/ButtonBase/ButtonBase.js +0 -41
- package/dist/src/components/common/ButtonBase/types.d.ts +0 -24
- package/dist/src/components/common/ButtonBase/types.js +0 -6
- package/dist/src/components/common/Headline/Headline.d.ts +0 -10
- package/dist/src/components/common/Headline/Headline.js +0 -34
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
- package/dist/src/components/common/ProductCard/ProductCard.d.ts +0 -39
- package/dist/src/components/common/ProductCard/ProductCard.js +0 -84
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
- package/dist/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
- package/dist/src/components/common/ProductCard/productCardVariants.js +0 -50
- package/dist/src/components/common/ProductCard/types.d.ts +0 -39
- package/dist/src/components/common/ProductCard/types.js +0 -10
- package/dist/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
- package/dist/src/components/common/ProductGrid/ProductGrid.js +0 -13
- package/dist/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
- package/dist/src/components/common/ProductGrid/productGridVariants.js +0 -16
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
- package/dist/src/components/common/SparkleAnimation/types.d.ts +0 -6
- package/dist/src/components/common/SparkleAnimation/types.js +0 -7
- package/dist/src/components/common/Spinner/Spinner.d.ts +0 -5
- package/dist/src/components/common/Spinner/Spinner.js +0 -16
- package/dist/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
- package/dist/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
- package/dist/src/components/common/SuggestionButton/types.d.ts +0 -1
- package/dist/src/components/common/SuggestionButton/types.js +0 -1
- package/dist/src/components/common/Text/Text.d.ts +0 -12
- package/dist/src/components/common/Text/Text.js +0 -26
- package/dist/src/components/common/Text/textVariantClasses.d.ts +0 -171
- package/dist/src/components/common/Text/textVariantClasses.js +0 -103
- package/dist/src/components/common/Text/types.d.ts +0 -16
- package/dist/src/components/common/Text/types.js +0 -6
- package/dist/src/components/common/TextInput/TextInput.d.ts +0 -8
- package/dist/src/components/common/TextInput/TextInput.js +0 -25
- package/dist/src/components/models/colorsConfig.d.ts +0 -26
- package/dist/src/components/models/colorsConfig.js +0 -23
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
- package/dist/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilter.js +0 -24
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
- package/dist/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
- package/dist/src/components/search/SearchFilter/types.d.ts +0 -42
- package/dist/src/components/search/SearchFilter/types.js +0 -1
- package/dist/src/components/search/SearchInput/SearchInput.d.ts +0 -16
- package/dist/src/components/search/SearchInput/SearchInput.js +0 -38
- package/dist/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
- package/dist/src/components/search/SearchInput/searchInputVariants.js +0 -12
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
- package/dist/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
- package/dist/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
- package/dist/src/components/search/SearchInputForm/types.d.ts +0 -1
- package/dist/src/components/search/SearchInputForm/types.js +0 -1
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
- package/dist/src/components/search/SearchResultsFilterSidebar/types.d.ts +0 -2
- package/dist/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
- package/dist/src/components/search/types.d.ts +0 -5
- package/dist/src/components/search/types.js +0 -6
- package/dist/src/components/test/types.d.ts +0 -3
- package/dist/src/components/test/types.js +0 -1
- package/dist/src/config/chatElementDisplayLocation.d.ts +0 -21
- package/dist/src/config/chatElementDisplayLocation.js +0 -23
- package/dist/src/index.d.ts +0 -45
- package/dist/src/index.js +0 -49
- package/dist/src/logging/logger.d.ts +0 -7
- package/dist/src/logging/logger.js +0 -16
- package/dist/src/types/external.d.ts +0 -21
- package/dist/src/types/external.js +0 -5
- package/dist/src/util/camelCase.d.ts +0 -65
- package/dist/src/util/camelCase.js +0 -2
- package/dist/src/util/camelCasedPropertiesDeep.d.ts +0 -53
- package/dist/src/util/camelCasedPropertiesDeep.js +0 -1
- package/dist/src/util/formatPrice.d.ts +0 -1
- package/dist/src/util/formatPrice.js +0 -11
- package/dist/src/util/internal.d.ts +0 -27
- package/dist/src/util/internal.js +0 -4
- package/dist/src/util/primitive.js +0 -2
- package/dist/src/util/splitWords.d.ts +0 -55
- package/dist/src/util/splitWords.js +0 -2
- package/dist/src/util/trim.js +0 -2
- package/dist/src/util/unknownArray.d.ts +0 -25
- package/dist/src/util/unknownArray.js +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/{dist/packages/components/src/components/search/SearchInputForm/types.d.ts → src/components/search/SearchInputForm/types.ts} +0 -0
- /package/{dist/packages/components/src/util/unknownArray.d.ts → src/util/unknownArray.ts} +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/components/common/Text/textVariantClasses.ts
|
|
3
|
+
const HeadlineVariantMap = {
|
|
4
|
+
t1: {
|
|
5
|
+
"spiffy-headline": true,
|
|
6
|
+
"spiffy-headline-1": true,
|
|
7
|
+
"spiffy-tw-text-[32px]": true,
|
|
8
|
+
"spiffy-tw-font-medium": true,
|
|
9
|
+
"spiffy-tw-leading-[124%]": true
|
|
10
|
+
},
|
|
11
|
+
t2: {
|
|
12
|
+
"spiffy-headline": true,
|
|
13
|
+
"spiffy-headline-1": true,
|
|
14
|
+
"spiffy-tw-text-[16px]": true,
|
|
15
|
+
"spiffy-tw-font-medium": true,
|
|
16
|
+
"spiffy-tw-leading-[124%]": true
|
|
17
|
+
},
|
|
18
|
+
t3: {
|
|
19
|
+
"spiffy-headline": true,
|
|
20
|
+
"spiffy-headline-1": true,
|
|
21
|
+
"spiffy-tw-text-[24px]": true,
|
|
22
|
+
"spiffy-tw-leading-[120%]": true
|
|
23
|
+
},
|
|
24
|
+
h1: {
|
|
25
|
+
"spiffy-headline": true,
|
|
26
|
+
"spiffy-headline-1": true,
|
|
27
|
+
"spiffy-tw-text-[20px]": true,
|
|
28
|
+
"spiffy-tw-font-normal": true,
|
|
29
|
+
"spiffy-tw-leading-[120%]": true
|
|
30
|
+
},
|
|
31
|
+
h2: {
|
|
32
|
+
"spiffy-headline": true,
|
|
33
|
+
"spiffy-headline-2": true,
|
|
34
|
+
"spiffy-tw-text-[16px]": true,
|
|
35
|
+
"spiffy-tw-font-normal": true,
|
|
36
|
+
"spiffy-tw-leading-[124%]": true
|
|
37
|
+
},
|
|
38
|
+
h3: {
|
|
39
|
+
"spiffy-headline": true,
|
|
40
|
+
"spiffy-headline-3": true,
|
|
41
|
+
"spiffy-tw-text-[15px]": true,
|
|
42
|
+
"spiffy-tw-font-medium": true,
|
|
43
|
+
"spiffy-tw-leading-[124%]": true
|
|
44
|
+
},
|
|
45
|
+
h4: {
|
|
46
|
+
"spiffy-headline": true,
|
|
47
|
+
"spiffy-headline-4": true,
|
|
48
|
+
"spiffy-tw-text-[14px]": true,
|
|
49
|
+
"spiffy-tw-font-medium": true,
|
|
50
|
+
"spiffy-tw-leading-[124%]": true
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const TextVariantMap = {
|
|
54
|
+
body1: {
|
|
55
|
+
"spiffy-body-text": true,
|
|
56
|
+
"spiffy-body-1": true,
|
|
57
|
+
"spiffy-tw-text-[20px]": true,
|
|
58
|
+
"spiffy-tw-font-normal": true,
|
|
59
|
+
"spiffy-tw-line-height-[120%]": true
|
|
60
|
+
},
|
|
61
|
+
body2: {
|
|
62
|
+
"spiffy-body-text": true,
|
|
63
|
+
"spiffy-body-2": true,
|
|
64
|
+
"spiffy-tw-text-[16px]": true,
|
|
65
|
+
"spiffy-tw-font-normal": true,
|
|
66
|
+
"spiffy-tw-line-height-[148%]": true
|
|
67
|
+
},
|
|
68
|
+
body3: {
|
|
69
|
+
"spiffy-body-text": true,
|
|
70
|
+
"spiffy-body-3": true,
|
|
71
|
+
"spiffy-tw-text-sm": true,
|
|
72
|
+
"spiffy-tw-font-normal": true,
|
|
73
|
+
"spiffy-tw-leading-[140%]": true
|
|
74
|
+
},
|
|
75
|
+
body4: {
|
|
76
|
+
"spiffy-body-text": true,
|
|
77
|
+
"spiffy-body-4": true,
|
|
78
|
+
"spiffy-tw-text-xs": true,
|
|
79
|
+
"spiffy-tw-font-medium": true,
|
|
80
|
+
"spiffy-tw-leading-[130%]": true
|
|
81
|
+
},
|
|
82
|
+
body5: {
|
|
83
|
+
"spiffy-body-text": true,
|
|
84
|
+
"spiffy-body-5": true,
|
|
85
|
+
"spiffy-tw-text-[10px]": true,
|
|
86
|
+
"spiffy-tw-font-normal": true
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const TextStyleVariantMap = {
|
|
90
|
+
...TextVariantMap,
|
|
91
|
+
...HeadlineVariantMap
|
|
92
|
+
};
|
|
93
|
+
const getVariantPlaceholderClassNames = (classes) => {
|
|
94
|
+
return Object.keys(classes).reduce((acc, key) => {
|
|
95
|
+
if (key.includes("spiffy-tw")) acc[`placeholder:${key}`] = classes[key];
|
|
96
|
+
else acc[`${key}-placeholder`] = classes[key];
|
|
97
|
+
return acc;
|
|
98
|
+
}, {});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
Object.defineProperty(exports, 'HeadlineVariantMap', {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return HeadlineVariantMap;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, 'TextStyleVariantMap', {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return TextStyleVariantMap;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, 'TextVariantMap', {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return TextVariantMap;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, 'getVariantPlaceholderClassNames', {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return getVariantPlaceholderClassNames;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/types/external.d.ts
|
|
2
|
+
|
|
3
|
+
interface SearchResponseProduct {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
price?: number;
|
|
8
|
+
currency?: string;
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
brand?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
availability?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
responseId?: string;
|
|
15
|
+
originalPrice?: number;
|
|
16
|
+
salePrice?: number;
|
|
17
|
+
averageRating?: number;
|
|
18
|
+
numberReviews?: number;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/common/ProductCard/types.d.ts
|
|
23
|
+
|
|
24
|
+
type ProductGridVariant = 'standard' | 'square';
|
|
25
|
+
type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
|
|
26
|
+
type ProductCardHoverVariant = 'backgroundDark' | 'none';
|
|
27
|
+
type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
|
|
28
|
+
interface ProductCardConfig {
|
|
29
|
+
variant: ProductCardVariant;
|
|
30
|
+
hoverVariant: ProductCardHoverVariant;
|
|
31
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
32
|
+
pricePrefix?: string;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ProductCardConfig, ProductCardHoverVariant, ProductCardLayoutVariant, ProductCardVariant, ProductGridVariant, SearchResponseProduct };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/search/SearchFilter/types.d.ts
|
|
4
|
+
type SearchFilterItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
value: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
};
|
|
10
|
+
type SearchFilter = {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
items: SearchFilterItem[];
|
|
14
|
+
};
|
|
15
|
+
type SelectFilterItem = (filterItem: SearchFilterItem) => void;
|
|
16
|
+
interface SearchFilterItemProps {
|
|
17
|
+
filterItem: SearchFilterItem;
|
|
18
|
+
onSelectFilterItem: SelectFilterItem;
|
|
19
|
+
radioButtonFillColor: string;
|
|
20
|
+
radioButtonHoverColor: string;
|
|
21
|
+
radioButtonUncheckedBorderColor: string;
|
|
22
|
+
}
|
|
23
|
+
interface SearchFilterHeaderProps {
|
|
24
|
+
closeModal: () => void;
|
|
25
|
+
productCount: number;
|
|
26
|
+
headerClassName: string;
|
|
27
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
28
|
+
}
|
|
29
|
+
interface SearchFilterProps {
|
|
30
|
+
isOpen: boolean;
|
|
31
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
32
|
+
filters: SearchFilter[];
|
|
33
|
+
productCount: number;
|
|
34
|
+
selectFilterItem: SelectFilterItem;
|
|
35
|
+
clearAllFilters: () => void;
|
|
36
|
+
applyFiltersUnchangedClasses: string;
|
|
37
|
+
applyFiltersChangedClasses: string;
|
|
38
|
+
filterButtonText: string;
|
|
39
|
+
radioButtonFillColor: string;
|
|
40
|
+
radioButtonHoverColor: string;
|
|
41
|
+
radioButtonUncheckedBorderColor: string;
|
|
42
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
43
|
+
headerContent: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { SearchFilter, SearchFilterHeaderProps, SearchFilterItemProps, SearchFilterProps, SelectFilterItem };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/search/SearchFilter/types.d.ts
|
|
4
|
+
type SearchFilterItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
value: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
};
|
|
10
|
+
type SearchFilter = {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
items: SearchFilterItem[];
|
|
14
|
+
};
|
|
15
|
+
type SelectFilterItem = (filterItem: SearchFilterItem) => void;
|
|
16
|
+
interface SearchFilterItemProps {
|
|
17
|
+
filterItem: SearchFilterItem;
|
|
18
|
+
onSelectFilterItem: SelectFilterItem;
|
|
19
|
+
radioButtonFillColor: string;
|
|
20
|
+
radioButtonHoverColor: string;
|
|
21
|
+
radioButtonUncheckedBorderColor: string;
|
|
22
|
+
}
|
|
23
|
+
interface SearchFilterHeaderProps {
|
|
24
|
+
closeModal: () => void;
|
|
25
|
+
productCount: number;
|
|
26
|
+
headerClassName: string;
|
|
27
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
28
|
+
}
|
|
29
|
+
interface SearchFilterProps {
|
|
30
|
+
isOpen: boolean;
|
|
31
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
32
|
+
filters: SearchFilter[];
|
|
33
|
+
productCount: number;
|
|
34
|
+
selectFilterItem: SelectFilterItem;
|
|
35
|
+
clearAllFilters: () => void;
|
|
36
|
+
applyFiltersUnchangedClasses: string;
|
|
37
|
+
applyFiltersChangedClasses: string;
|
|
38
|
+
filterButtonText: string;
|
|
39
|
+
radioButtonFillColor: string;
|
|
40
|
+
radioButtonHoverColor: string;
|
|
41
|
+
radioButtonUncheckedBorderColor: string;
|
|
42
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
43
|
+
headerContent: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { SearchFilter, SearchFilterHeaderProps, SearchFilterItemProps, SearchFilterProps, SelectFilterItem };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/types/external.d.ts
|
|
2
|
+
|
|
3
|
+
interface SearchResponseProduct {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
price?: number;
|
|
8
|
+
currency?: string;
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
brand?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
availability?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
responseId?: string;
|
|
15
|
+
originalPrice?: number;
|
|
16
|
+
salePrice?: number;
|
|
17
|
+
averageRating?: number;
|
|
18
|
+
numberReviews?: number;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/common/ProductCard/types.d.ts
|
|
23
|
+
|
|
24
|
+
type ProductGridVariant = 'standard' | 'square';
|
|
25
|
+
type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
|
|
26
|
+
type ProductCardHoverVariant = 'backgroundDark' | 'none';
|
|
27
|
+
type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
|
|
28
|
+
interface ProductCardConfig {
|
|
29
|
+
variant: ProductCardVariant;
|
|
30
|
+
hoverVariant: ProductCardHoverVariant;
|
|
31
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
32
|
+
pricePrefix?: string;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ProductCardConfig, ProductCardHoverVariant, ProductCardLayoutVariant, ProductCardVariant, ProductGridVariant, SearchResponseProduct };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "React component library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -11,17 +11,20 @@
|
|
|
11
11
|
"author": "Envive AI",
|
|
12
12
|
"license": "UNLICENSED",
|
|
13
13
|
"type": "module",
|
|
14
|
-
"main": "dist/index.
|
|
14
|
+
"main": "dist/index.cjs",
|
|
15
15
|
"module": "dist/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"files": [
|
|
18
|
-
"dist"
|
|
18
|
+
"dist",
|
|
19
|
+
"src",
|
|
20
|
+
"!**/*.tsbuildinfo"
|
|
19
21
|
],
|
|
20
22
|
"scripts": {
|
|
21
|
-
"build": "
|
|
23
|
+
"build": "tsdown",
|
|
22
24
|
"prepublish": "npm run build"
|
|
23
25
|
},
|
|
24
26
|
"dependencies": {
|
|
27
|
+
"@envive-ai/react-icons": "0.1.0",
|
|
25
28
|
"classnames": "^2.5.1",
|
|
26
29
|
"framer-motion": "^12.23.12",
|
|
27
30
|
"react-icons": "^5.0.1",
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
"devDependencies": {
|
|
36
39
|
"@svgr/cli": "^8.1.0",
|
|
37
40
|
"copyfiles": "^2.4.1",
|
|
38
|
-
"
|
|
41
|
+
"tsdown": "^0.14.2",
|
|
39
42
|
"typescript": "~5.8.3"
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { createElement, useEffect, useRef } from 'react';
|
|
3
|
+
import { ButtonBaseOverrides, ButtonBaseProps } from './types';
|
|
4
|
+
import { Text } from '../Text/Text';
|
|
5
|
+
|
|
6
|
+
export const ButtonBase = ({
|
|
7
|
+
type = 'button',
|
|
8
|
+
isDisabled = false,
|
|
9
|
+
dataAttributes,
|
|
10
|
+
buttonClass,
|
|
11
|
+
text,
|
|
12
|
+
textClass,
|
|
13
|
+
icon,
|
|
14
|
+
iconClass = 'spiffy-tw-w-[21px] spiffy-tw-h-[21px]',
|
|
15
|
+
dataTestId,
|
|
16
|
+
onClick,
|
|
17
|
+
disablePadding = false,
|
|
18
|
+
}: ButtonBaseProps) => {
|
|
19
|
+
const buttonRef = useRef<HTMLButtonElement | null>(null);
|
|
20
|
+
|
|
21
|
+
const buttonClassName = classNames({
|
|
22
|
+
[ButtonBaseOverrides.BUTTON]: true,
|
|
23
|
+
'spiffy-tw-flex': true,
|
|
24
|
+
'spiffy-tw-min-h-[36px]': true,
|
|
25
|
+
'spiffy-tw-cursor-pointer': true,
|
|
26
|
+
'spiffy-tw-items-center': true,
|
|
27
|
+
'spiffy-tw-gap-2': true,
|
|
28
|
+
'spiffy-tw-px-4': !disablePadding,
|
|
29
|
+
'spiffy-tw-transition-colors': true,
|
|
30
|
+
'spiffy-tw-opacity-40': isDisabled,
|
|
31
|
+
'spiffy-tw-cursor-not-allowed': isDisabled,
|
|
32
|
+
[`${buttonClass}`]: buttonClass != null,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const textClassName = classNames({
|
|
36
|
+
[ButtonBaseOverrides.BUTTON_TEXT]: true,
|
|
37
|
+
'spiffy-tw-whitespace-nowrap': true,
|
|
38
|
+
[`${textClass}`]: textClass != null,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const iconClassName = classNames({
|
|
42
|
+
[ButtonBaseOverrides.BUTTON_ICON]: true,
|
|
43
|
+
[`${iconClass}`]: iconClass != null,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (dataAttributes && buttonRef.current) {
|
|
48
|
+
Object.entries(dataAttributes).forEach(([key, value]) => {
|
|
49
|
+
buttonRef.current?.setAttribute(key, value as string);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, [dataAttributes]);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<button
|
|
56
|
+
type={type}
|
|
57
|
+
ref={buttonRef}
|
|
58
|
+
className={buttonClassName}
|
|
59
|
+
disabled={isDisabled}
|
|
60
|
+
data-testid={dataTestId}
|
|
61
|
+
onClick={onClick}
|
|
62
|
+
>
|
|
63
|
+
{icon &&
|
|
64
|
+
createElement(icon, {
|
|
65
|
+
className: iconClassName,
|
|
66
|
+
})}
|
|
67
|
+
<Text className={textClassName}>{text}</Text>
|
|
68
|
+
</button>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
+
import { TestProps } from 'src/components/test/types';
|
|
3
|
+
|
|
4
|
+
export interface ButtonHoverStyles extends CSSProperties {
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ButtonBaseProps extends TestProps {
|
|
10
|
+
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
dataAttributes?: Record<string, string>;
|
|
13
|
+
buttonClass?: string;
|
|
14
|
+
text: string;
|
|
15
|
+
textClass?: string;
|
|
16
|
+
icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
17
|
+
iconClass?: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
disablePadding?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum ButtonBaseOverrides {
|
|
23
|
+
BUTTON = 'spiffy-button-base-button',
|
|
24
|
+
BUTTON_TEXT = 'spiffy-button-base-button-text',
|
|
25
|
+
BUTTON_ICON = 'spiffy-button-base-button-icon',
|
|
26
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { HeadlineVariantMap } from '../Text/textVariantClasses';
|
|
3
|
+
|
|
4
|
+
export type HeadlineVariant = 't1' | 't2' | 't3' | 'h1' | 'h2' | 'h3' | 'h4';
|
|
5
|
+
|
|
6
|
+
export type HeadlineProps = {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
variant?: HeadlineVariant;
|
|
11
|
+
testId?: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Headline = ({ children, className, style, testId, variant = 'h1' }: HeadlineProps) => {
|
|
16
|
+
const variantClassNames = variant ? HeadlineVariantMap[variant] : {};
|
|
17
|
+
const textClassNames = classNames(className, variantClassNames, {
|
|
18
|
+
'spiffy-tw-font-[Poppins,sans-serif]': true,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const T1 = () => (
|
|
22
|
+
<h1 data-testid={testId} className={textClassNames} style={style}>
|
|
23
|
+
{children}
|
|
24
|
+
</h1>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const T2 = () => (
|
|
28
|
+
<h2 data-testid={testId} className={textClassNames} style={style}>
|
|
29
|
+
{children}
|
|
30
|
+
</h2>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const T3 = () => (
|
|
34
|
+
<h3 data-testid={testId} className={textClassNames} style={style}>
|
|
35
|
+
{children}
|
|
36
|
+
</h3>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const H1 = () => (
|
|
40
|
+
<h1 data-testid={testId} className={textClassNames} style={style}>
|
|
41
|
+
{children}
|
|
42
|
+
</h1>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const H2 = () => (
|
|
46
|
+
<h2 data-testid={testId} className={textClassNames} style={style}>
|
|
47
|
+
{children}
|
|
48
|
+
</h2>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const H3 = () => (
|
|
52
|
+
<h3 data-testid={testId} className={textClassNames} style={style}>
|
|
53
|
+
{children}
|
|
54
|
+
</h3>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const H4 = () => (
|
|
58
|
+
<h4 data-testid={testId} className={textClassNames} style={style}>
|
|
59
|
+
{children}
|
|
60
|
+
</h4>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
switch (variant) {
|
|
64
|
+
case 't1':
|
|
65
|
+
return T1();
|
|
66
|
+
case 't2':
|
|
67
|
+
return T2();
|
|
68
|
+
case 't3':
|
|
69
|
+
return T3();
|
|
70
|
+
case 'h1':
|
|
71
|
+
return H1();
|
|
72
|
+
case 'h2':
|
|
73
|
+
return H2();
|
|
74
|
+
case 'h3':
|
|
75
|
+
return H3();
|
|
76
|
+
case 'h4':
|
|
77
|
+
return H4();
|
|
78
|
+
default:
|
|
79
|
+
throw new Error(`Invalid variant: ${variant}`);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface ImageWithFallbackProps {
|
|
5
|
+
src: string | undefined;
|
|
6
|
+
alt: string;
|
|
7
|
+
fallbackClassnames?: string;
|
|
8
|
+
fallback: React.ReactNode;
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
imageClassnames: string;
|
|
11
|
+
onLoad?: () => void;
|
|
12
|
+
onError?: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const ImageWithFallback = ({
|
|
16
|
+
src,
|
|
17
|
+
alt,
|
|
18
|
+
dataTestId,
|
|
19
|
+
fallbackClassnames,
|
|
20
|
+
fallback,
|
|
21
|
+
imageClassnames,
|
|
22
|
+
onLoad,
|
|
23
|
+
onError,
|
|
24
|
+
}: ImageWithFallbackProps) => {
|
|
25
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
26
|
+
const [isError, setIsError] = useState(false);
|
|
27
|
+
|
|
28
|
+
const imageExtraClassnames = classNames(imageClassnames, {
|
|
29
|
+
'spiffy-tw-block': isLoaded,
|
|
30
|
+
'spiffy-tw-hidden': !isLoaded,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const fallbackMergedClassNames = classNames(
|
|
34
|
+
{
|
|
35
|
+
'spiffy-tw-flex': true,
|
|
36
|
+
'spiffy-tw-flex-col': true,
|
|
37
|
+
'spiffy-tw-items-center': true,
|
|
38
|
+
},
|
|
39
|
+
fallbackClassnames,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
if (isError) {
|
|
43
|
+
return <div className={fallbackMergedClassNames}>{fallback}</div>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
{!isLoaded && <div className={fallbackMergedClassNames}>{fallback}</div>}
|
|
49
|
+
|
|
50
|
+
<img
|
|
51
|
+
src={src}
|
|
52
|
+
className={imageExtraClassnames}
|
|
53
|
+
data-testid={dataTestId}
|
|
54
|
+
alt={alt}
|
|
55
|
+
onLoad={() => {
|
|
56
|
+
setIsLoaded(true);
|
|
57
|
+
onLoad?.();
|
|
58
|
+
}}
|
|
59
|
+
onError={() => {
|
|
60
|
+
setIsError(true);
|
|
61
|
+
onError?.();
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
};
|