@envive-ai/react-widgets 0.1.2-arthur-3 → 0.1.3
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/SearchResults/SearchResults.cjs +86 -0
- package/dist/SearchResults/SearchResults.js +84 -0
- package/dist/SearchResults/SearchResultsWidget.cjs +34 -0
- package/dist/SearchResults/SearchResultsWidget.js +33 -0
- package/dist/SearchResults/index.cjs +2 -122
- package/dist/SearchResults/index.d.cts +2 -0
- package/dist/SearchResults/index.d.ts +2 -0
- package/dist/SearchResults/index.js +1 -119
- package/dist/SearchResults/withSearchResults.cjs +18 -0
- package/dist/SearchResults/withSearchResults.js +17 -0
- package/dist/SearchZeroState/SearchIcon.cjs +48 -0
- package/dist/SearchZeroState/SearchIcon.js +45 -0
- package/dist/SearchZeroState/SearchOverlay.cjs +42 -0
- package/dist/SearchZeroState/SearchOverlay.js +39 -0
- package/dist/SearchZeroState/SearchZeroState.cjs +173 -0
- package/dist/SearchZeroState/SearchZeroState.d.cts +7 -0
- package/dist/SearchZeroState/SearchZeroState.d.ts +7 -0
- package/dist/SearchZeroState/SearchZeroState.js +171 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.cjs +23 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +15 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.d.ts +15 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.js +22 -0
- package/dist/SearchZeroState/components/RecommendedProducts.cjs +74 -0
- package/dist/SearchZeroState/components/RecommendedProducts.js +72 -0
- package/dist/SearchZeroState/index.cjs +4 -2996
- package/dist/SearchZeroState/index.d.cts +4 -0
- package/dist/SearchZeroState/index.d.ts +4 -0
- package/dist/SearchZeroState/index.js +2 -2991
- package/dist/SearchZeroState/overlay/overlayHostLocator.cjs +21 -0
- package/dist/SearchZeroState/overlay/overlayHostLocator.js +20 -0
- package/dist/SearchZeroState/types.d.cts +10 -0
- package/dist/SearchZeroState/types.d.ts +10 -0
- package/dist/SearchZeroState/zeroStateSearchVariants.cjs +21 -0
- package/dist/SearchZeroState/zeroStateSearchVariants.js +20 -0
- package/dist/SuggestionBar/SuggestionBar.cjs +74 -0
- package/dist/SuggestionBar/{index-DZU9kbWS.d.cts → SuggestionBar.d.cts} +4 -9
- package/dist/SuggestionBar/{index-DyXd4-b7.d.ts → SuggestionBar.d.ts} +6 -11
- package/dist/SuggestionBar/SuggestionBar.js +72 -0
- package/dist/SuggestionBar/index.cjs +3 -3
- package/dist/SuggestionBar/index.d.cts +3 -0
- package/dist/SuggestionBar/index.d.ts +3 -0
- package/dist/SuggestionBar/index.js +2 -2
- package/dist/SuggestionBar/types.cjs +10 -0
- package/dist/SuggestionBar/types.d.cts +7 -0
- package/dist/SuggestionBar/types.d.ts +7 -0
- package/dist/SuggestionBar/types.js +9 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +76 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +6 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +6 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.js +75 -0
- package/dist/SuggestionButtonContainer/index.cjs +1 -1
- package/dist/SuggestionButtonContainer/index.d.cts +3 -0
- package/dist/SuggestionButtonContainer/index.d.ts +3 -0
- package/dist/SuggestionButtonContainer/index.js +1 -1
- package/dist/SuggestionButtonContainer/{index-B_X537jw.d.cts → types.d.cts} +1 -4
- package/dist/SuggestionButtonContainer/{index-vwelzDzM.d.ts → types.d.ts} +1 -4
- package/dist/_virtual/rolldown_runtime.cjs +33 -0
- package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
- package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
- package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
- package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
- package/dist/node_modules/react-icons/md/index.cjs +35 -0
- package/dist/node_modules/react-icons/md/index.js +35 -0
- package/dist/{SuggestionBar-BOThXJvJ.cjs → node_modules/react-indiana-drag-scroll/dist/index.cjs} +6 -139
- package/dist/node_modules/uuid/dist/native.js +6 -0
- package/dist/node_modules/uuid/dist/rng.js +13 -0
- package/dist/node_modules/uuid/dist/stringify.js +9 -0
- package/dist/node_modules/uuid/dist/v4.js +27 -0
- package/dist/node_modules/uuid/dist-node/native.cjs +8 -0
- package/dist/node_modules/uuid/dist-node/rng.cjs +16 -0
- package/dist/node_modules/uuid/dist-node/stringify.cjs +10 -0
- package/dist/node_modules/uuid/dist-node/v4.cjs +27 -0
- package/dist/packages/components/dist/components/Accordion/Accordion.cjs +80 -0
- package/dist/packages/components/dist/components/Accordion/Accordion.js +78 -0
- package/dist/packages/components/dist/components/Accordion/index.cjs +1 -0
- package/dist/packages/components/dist/components/Accordion/index.js +1 -0
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.cjs +30 -0
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.js +29 -0
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.cjs +56 -0
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.js +54 -0
- package/dist/packages/components/dist/components/ButtonBase/index.cjs +2 -0
- package/dist/packages/components/dist/components/ButtonBase/index.js +2 -0
- package/dist/packages/components/dist/components/ButtonBase/types.cjs +11 -0
- package/dist/packages/components/dist/components/ButtonBase/types.js +10 -0
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.cjs +45 -0
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.js +42 -0
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.cjs +33 -0
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.js +30 -0
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.cjs +45 -0
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.js +42 -0
- package/dist/packages/components/dist/components/ImageWithFallback/index.cjs +1 -0
- package/dist/packages/components/dist/components/ImageWithFallback/index.js +1 -0
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.cjs +30 -0
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.js +29 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.cjs +26 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.js +24 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.cjs +122 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.js +120 -0
- package/dist/packages/components/dist/components/ModalSheet/index.cjs +1 -0
- package/dist/packages/components/dist/components/ModalSheet/index.js +1 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.cjs +116 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.js +114 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.cjs +38 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.js +36 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCard.cjs +153 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCard.js +149 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.cjs +33 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.js +31 -0
- package/dist/packages/components/dist/components/ProductCard/index.cjs +4 -0
- package/dist/packages/components/dist/components/ProductCard/index.js +4 -0
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.cjs +49 -0
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.js +45 -0
- package/dist/packages/components/dist/components/ProductCard/types.cjs +10 -0
- package/dist/packages/components/dist/components/ProductCard/types.js +9 -0
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.cjs +43 -0
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.js +41 -0
- package/dist/packages/components/dist/components/ProductGrid/index.cjs +2 -0
- package/dist/packages/components/dist/components/ProductGrid/index.js +2 -0
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.cjs +21 -0
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.js +20 -0
- package/dist/packages/components/dist/components/RadioButton/RadioButton.cjs +74 -0
- package/dist/packages/components/dist/components/RadioButton/RadioButton.js +72 -0
- package/dist/packages/components/dist/components/RadioButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/RadioButton/index.js +1 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.cjs +42 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.js +39 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/index.cjs +1 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/index.js +1 -0
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.cjs +53 -0
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.js +51 -0
- package/dist/packages/components/dist/components/RecommendedProducts/index.cjs +3 -0
- package/dist/packages/components/dist/components/RecommendedProducts/index.js +3 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.cjs +72 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.js +69 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/index.js +1 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.cjs +134 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.js +132 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.cjs +48 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.js +46 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.cjs +42 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.js +40 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.cjs +6 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.js +4 -0
- package/dist/packages/components/dist/components/SearchFilter/index.cjs +5 -0
- package/dist/packages/components/dist/components/SearchFilter/index.js +5 -0
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.cjs +27 -0
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.js +26 -0
- package/dist/packages/components/dist/components/SearchFilter/utils.cjs +11 -0
- package/dist/packages/components/dist/components/SearchFilter/utils.js +9 -0
- package/dist/packages/components/dist/components/SearchInput/SearchInput.cjs +81 -0
- package/dist/packages/components/dist/components/SearchInput/SearchInput.js +78 -0
- package/dist/packages/components/dist/components/SearchInput/index.cjs +2 -0
- package/dist/packages/components/dist/components/SearchInput/index.js +2 -0
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.cjs +15 -0
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.js +15 -0
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.cjs +57 -0
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.js +55 -0
- package/dist/packages/components/dist/components/SearchInputForm/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchInputForm/index.js +1 -0
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs +52 -0
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.js +50 -0
- package/dist/packages/components/dist/components/SearchResultsContent/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchResultsContent/index.js +1 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.cjs +24 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.js +23 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs +36 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js +35 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.cjs +9 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.js +9 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.cjs +2 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.js +2 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.cjs +34 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +34 -0
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.cjs +56 -0
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.js +54 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.cjs +53 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.js +51 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.js +51 -0
- package/dist/packages/components/dist/components/SearchResultsStates/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsStates/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs +60 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js +57 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.js +3 -0
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.cjs +77 -0
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.js +75 -0
- package/dist/packages/components/dist/components/SparkleAnimation/index.cjs +2 -0
- package/dist/packages/components/dist/components/SparkleAnimation/index.js +2 -0
- package/dist/packages/components/dist/components/SparkleAnimation/types.cjs +12 -0
- package/dist/packages/components/dist/components/SparkleAnimation/types.js +11 -0
- package/dist/packages/components/dist/components/Spinner/Spinner.cjs +40 -0
- package/dist/packages/components/dist/components/Spinner/Spinner.js +38 -0
- package/dist/packages/components/dist/components/Spinner/index.cjs +1 -0
- package/dist/packages/components/dist/components/Spinner/index.js +1 -0
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.cjs +193 -0
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.js +188 -0
- package/dist/packages/components/dist/components/SuggestionButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/SuggestionButton/index.js +1 -0
- package/dist/packages/components/dist/components/TextInput/TextInput.cjs +34 -0
- package/dist/packages/components/dist/components/TextInput/TextInput.js +31 -0
- package/dist/packages/components/dist/components/TextInput/index.cjs +1 -0
- package/dist/packages/components/dist/components/TextInput/index.js +1 -0
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.cjs +63 -0
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.js +61 -0
- package/dist/packages/components/dist/components/ToggleButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/ToggleButton/index.js +1 -0
- package/dist/packages/components/dist/components/Typography/Typography.cjs +53 -0
- package/dist/packages/components/dist/components/Typography/Typography.js +50 -0
- package/dist/packages/components/dist/components/Typography/index.cjs +2 -0
- package/dist/packages/components/dist/components/Typography/index.js +2 -0
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.cjs +99 -0
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.js +96 -0
- package/dist/packages/components/dist/components/Typography/util.cjs +10 -0
- package/dist/packages/components/dist/components/Typography/util.js +10 -0
- package/dist/packages/components/dist/logging/logger.cjs +20 -0
- package/dist/packages/components/dist/logging/logger.js +19 -0
- package/dist/packages/components/dist/models/colorsConfig.cjs +28 -0
- package/dist/packages/components/dist/models/colorsConfig.js +26 -0
- package/dist/packages/components/dist/util/formatPrice.cjs +14 -0
- package/dist/packages/components/dist/util/formatPrice.js +13 -0
- package/dist/packages/components/dist/util/index.cjs +3 -0
- package/dist/packages/components/dist/util/index.js +3 -0
- package/dist/packages/components/dist/util/useScrollDirection.cjs +39 -0
- package/dist/packages/components/dist/util/useScrollDirection.js +38 -0
- package/dist/packages/components/dist/util/useStickyVisibility.cjs +38 -0
- package/dist/packages/components/dist/util/useStickyVisibility.js +37 -0
- package/dist/packages/icons/dist/AiSearchBold.cjs +38 -0
- package/dist/packages/icons/dist/AiSearchBold.js +38 -0
- package/dist/packages/icons/dist/AiSearchThin.cjs +35 -0
- package/dist/packages/icons/dist/AiSearchThin.js +35 -0
- package/dist/packages/icons/dist/ChevronDown.cjs +23 -0
- package/dist/packages/icons/dist/ChevronDown.js +23 -0
- package/dist/packages/icons/dist/FourPointStar.cjs +22 -0
- package/dist/packages/icons/dist/FourPointStar.js +22 -0
- package/dist/packages/icons/dist/IconClose.cjs +26 -0
- package/dist/packages/icons/dist/IconClose.js +26 -0
- package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
- package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.cjs +39 -0
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.js +39 -0
- package/dist/packages/icons/dist/OutlinedStar.cjs +22 -0
- package/dist/packages/icons/dist/OutlinedStar.js +22 -0
- package/dist/packages/icons/dist/SettingsVariant.cjs +72 -0
- package/dist/packages/icons/dist/SettingsVariant.js +72 -0
- package/dist/packages/icons/dist/Sparkles.cjs +43 -0
- package/dist/packages/icons/dist/Sparkles.js +43 -0
- package/dist/{chunk-DWy1uDak.cjs → packages/icons/dist/_virtual/rolldown_runtime.cjs} +4 -14
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +27 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
- package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
- package/dist/util/useHorizontalScrollAnimation.cjs +88 -0
- package/dist/util/useHorizontalScrollAnimation.js +87 -0
- package/dist/util/useReducedMotionWithOverride.cjs +15 -0
- package/dist/util/useReducedMotionWithOverride.js +14 -0
- package/package.json +14 -8
- package/src/SearchResults/SearchResults.tsx +2 -4
- package/src/SearchResults/SearchResultsWidget.tsx +1 -1
- package/src/SearchResults/types.ts +0 -3
- package/src/SearchZeroState/SearchIcon.tsx +16 -9
- package/src/SearchZeroState/SearchOverlay.tsx +3 -2
- package/src/SearchZeroState/SearchZeroState.tsx +15 -18
- package/src/SearchZeroState/SearchZeroStateWidget.tsx +17 -8
- package/src/SearchZeroState/components/RecommendedProducts.tsx +8 -3
- package/src/SearchZeroState/overlay/overlayHostLocator.ts +2 -4
- package/src/SearchZeroState/types.ts +4 -1
- package/src/SearchZeroState/zeroStateSearchVariants.ts +14 -5
- package/src/SuggestionBar/SuggestionBar.tsx +12 -20
- package/src/SuggestionBar/types.ts +3 -3
- package/src/SuggestionButtonContainer/SuggestionButtonContainer.tsx +8 -17
- package/src/SuggestionButtonContainer/types.ts +3 -4
- package/src/stories/SearchResults.stories.tsx +1 -1
- package/src/stories/SearchZeroState.stories.tsx +10 -2
- package/src/stories/SuggestionBar.stories.tsx +1 -2
- package/src/util/useHorizontalScrollAnimation.ts +1 -1
- package/dist/SearchZeroState/index-19CiYvee.d.cts +0 -27
- package/dist/SearchZeroState/index-6EaGWYP4.d.ts +0 -27
- package/dist/SuggestionBar-DeMmAK4M.js +0 -131
- package/dist/SuggestionButtonContainer-BeWPpeQk.cjs +0 -173
- package/dist/SuggestionButtonContainer-CZhOkZaJ.js +0 -167
- /package/dist/SearchResults/{index-D8nrHueo.d.ts → SearchResultsWidget.d.cts} +0 -0
- /package/dist/SearchResults/{index-D52sX_I2.d.cts → SearchResultsWidget.d.ts} +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { SearchFilterHeader } from "./SearchFilterHeader.js";
|
|
2
|
+
import { Accordion } from "../Accordion/Accordion.js";
|
|
3
|
+
import "../Accordion/index.js";
|
|
4
|
+
import { ModalSheet } from "../ModalSheet/ModalSheet.js";
|
|
5
|
+
import "../ModalSheet/index.js";
|
|
6
|
+
import { RadioButtonGroup } from "../RadioButtonGroup/RadioButtonGroup.js";
|
|
7
|
+
import "../RadioButtonGroup/index.js";
|
|
8
|
+
import { useHasFilterStateChanged } from "./useHasFilterStateChanged.js";
|
|
9
|
+
import { getSelectedFilterItemsCount, getTotalSelectedFilterItemsCount } from "./utils.js";
|
|
10
|
+
import { ToggleButton } from "../ToggleButton/ToggleButton.js";
|
|
11
|
+
import "../ToggleButton/index.js";
|
|
12
|
+
import { SearchFilterFooter } from "./SearchFilterFooter.js";
|
|
13
|
+
import { useCallback } from "react";
|
|
14
|
+
import classNames from "classnames";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
|
|
17
|
+
//#region ../components/dist/components/SearchFilter/SearchFilter.js
|
|
18
|
+
const SortFilter = ({ filter, selectFilterItem, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor }) => {
|
|
19
|
+
const filterTitle = filter.displayName;
|
|
20
|
+
return /* @__PURE__ */ jsx(Accordion, {
|
|
21
|
+
title: filterTitle,
|
|
22
|
+
content: /* @__PURE__ */ jsx(RadioButtonGroup, {
|
|
23
|
+
options: filter.items.map((item) => ({
|
|
24
|
+
label: item.displayName,
|
|
25
|
+
value: item.filterItemId,
|
|
26
|
+
isSelected: item.isSelected
|
|
27
|
+
})),
|
|
28
|
+
name: filterTitle,
|
|
29
|
+
onChange: (value) => {
|
|
30
|
+
const selectedItem = filter.items.find((item) => item.filterItemId === value);
|
|
31
|
+
selectFilterItem({
|
|
32
|
+
filterId: filter.filterId,
|
|
33
|
+
filterItemId: value,
|
|
34
|
+
isSelected: true,
|
|
35
|
+
displayName: selectedItem?.displayName || value
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
gap: "large",
|
|
39
|
+
textButtonGap: "large",
|
|
40
|
+
value: filter.items.find((item) => item.isSelected)?.filterItemId,
|
|
41
|
+
fillColor: radioButtonFillColor,
|
|
42
|
+
hoverColor: radioButtonHoverColor,
|
|
43
|
+
uncheckedBorderColor: radioButtonUncheckedBorderColor
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const FilterItem = ({ filterId, filterItem, selectFilterItem }) => /* @__PURE__ */ jsx(ToggleButton, {
|
|
48
|
+
label: filterItem.displayName,
|
|
49
|
+
secondaryLabel: `(${filterItem.productCount})`,
|
|
50
|
+
isSelected: filterItem.isSelected,
|
|
51
|
+
onClick: () => selectFilterItem({
|
|
52
|
+
filterId,
|
|
53
|
+
filterItemId: filterItem.filterItemId,
|
|
54
|
+
isSelected: !filterItem.isSelected,
|
|
55
|
+
displayName: filterItem.displayName
|
|
56
|
+
}),
|
|
57
|
+
variant: "default"
|
|
58
|
+
});
|
|
59
|
+
const Filter = ({ filter, selectFilterItem }) => {
|
|
60
|
+
const filterContentClassName = classNames({
|
|
61
|
+
"spiffy-tw-flex": true,
|
|
62
|
+
"spiffy-tw-flex-wrap": true,
|
|
63
|
+
"spiffy-tw-gap-[8px]": true,
|
|
64
|
+
"spiffy-tw-pb-[1px]": true
|
|
65
|
+
});
|
|
66
|
+
const selectedFilterItems = getSelectedFilterItemsCount(filter);
|
|
67
|
+
return /* @__PURE__ */ jsx(Accordion, {
|
|
68
|
+
title: selectedFilterItems > 0 ? `${filter.displayName} (${selectedFilterItems})` : filter.displayName,
|
|
69
|
+
content: /* @__PURE__ */ jsx("div", {
|
|
70
|
+
className: filterContentClassName,
|
|
71
|
+
children: filter.items.map((item) => /* @__PURE__ */ jsx(FilterItem, {
|
|
72
|
+
filterId: filter.filterId,
|
|
73
|
+
filterItem: item,
|
|
74
|
+
selectFilterItem
|
|
75
|
+
}, item.filterItemId))
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const SearchFilter = ({ filters, productCount, selectFilterItem, clearAllFilters, isOpen, setIsOpen, applyFiltersUnchangedClasses, applyFiltersChangedClasses, headerContent, footerContent, headerClassName, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, filterCloseIconVariant }) => {
|
|
80
|
+
const closeModal = useCallback(() => setIsOpen(false), [setIsOpen]);
|
|
81
|
+
const filterCount = getTotalSelectedFilterItemsCount(filters);
|
|
82
|
+
const hasFiltersChanged = useHasFilterStateChanged(filters, isOpen);
|
|
83
|
+
const filterWrapperClassName = classNames({
|
|
84
|
+
"spiffy-tw-flex": true,
|
|
85
|
+
"spiffy-tw-flex-col": true,
|
|
86
|
+
"spiffy-tw-gap-[16px]": true,
|
|
87
|
+
"spiffy-tw-px-[24px]": true,
|
|
88
|
+
"spiffy-tw-py-[16px]": true,
|
|
89
|
+
"spiffy-tw-max-h-screen": true,
|
|
90
|
+
"spiffy-tw-overflow-y-auto": true
|
|
91
|
+
});
|
|
92
|
+
return /* @__PURE__ */ jsx(ModalSheet, {
|
|
93
|
+
isOpen,
|
|
94
|
+
closeModal,
|
|
95
|
+
headerProps: {
|
|
96
|
+
headerContent: headerContent || /* @__PURE__ */ jsx(SearchFilterHeader, {
|
|
97
|
+
closeModal,
|
|
98
|
+
productCount,
|
|
99
|
+
headerClassName: headerClassName ?? "",
|
|
100
|
+
filterCloseIconVariant
|
|
101
|
+
}),
|
|
102
|
+
chevronColor: "#000"
|
|
103
|
+
},
|
|
104
|
+
footerProps: { footerContent: footerContent || /* @__PURE__ */ jsx(SearchFilterFooter, {
|
|
105
|
+
closeModal,
|
|
106
|
+
clearAllFilters,
|
|
107
|
+
filterCount,
|
|
108
|
+
hasFiltersChanged,
|
|
109
|
+
applyFiltersUnchangedClasses,
|
|
110
|
+
applyFiltersChangedClasses
|
|
111
|
+
}) },
|
|
112
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
113
|
+
className: filterWrapperClassName,
|
|
114
|
+
children: filters.filter((filter) => filter.displayName !== "").map((filter) => {
|
|
115
|
+
if (filter.filterId === "sort") return /* @__PURE__ */ jsx(SortFilter, {
|
|
116
|
+
filter,
|
|
117
|
+
selectFilterItem,
|
|
118
|
+
radioButtonFillColor,
|
|
119
|
+
radioButtonHoverColor,
|
|
120
|
+
radioButtonUncheckedBorderColor
|
|
121
|
+
}, filter.filterId);
|
|
122
|
+
return /* @__PURE__ */ jsx(Filter, {
|
|
123
|
+
filter,
|
|
124
|
+
selectFilterItem
|
|
125
|
+
}, filter.filterId);
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
export { SearchFilter };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_ButtonBase = require('../ButtonBase/ButtonBase.cjs');
|
|
3
|
+
require('../ButtonBase/index.cjs');
|
|
4
|
+
let classnames = require("classnames");
|
|
5
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
|
|
8
|
+
//#region ../components/dist/components/SearchFilter/SearchFilterFooter.js
|
|
9
|
+
const SearchFilterFooter = ({ closeModal, clearAllFilters, filterCount, applyFiltersUnchangedClasses, applyFiltersChangedClasses, hasFiltersChanged }) => {
|
|
10
|
+
const clearAllButtonEnabled = filterCount > 0;
|
|
11
|
+
const footerWrapperClassName = (0, classnames.default)({
|
|
12
|
+
"spiffy-tw-flex": true,
|
|
13
|
+
"spiffy-tw-flex-col": true,
|
|
14
|
+
"spiffy-tw-items-center": true,
|
|
15
|
+
"spiffy-tw-justify-between": true,
|
|
16
|
+
"spiffy-tw-w-full": true,
|
|
17
|
+
"spiffy-tw-border-t": true,
|
|
18
|
+
"spiffy-tw-border-t-[--spiffy-colors-border-light]": true,
|
|
19
|
+
"spiffy-tw-p-[16px]": true,
|
|
20
|
+
"spiffy-tw-gap-[16px]": true
|
|
21
|
+
});
|
|
22
|
+
const applyFilterButtonClassName = (0, classnames.default)("spiffy-tw-flex spiffy-tw-flex-row spiffy-tw-justify-center spiffy-tw-rounded-[8px] spiffy-tw-w-full", hasFiltersChanged ? applyFiltersChangedClasses : applyFiltersUnchangedClasses);
|
|
23
|
+
const clearAllButtonClassName = (0, classnames.default)({
|
|
24
|
+
"spiffy-tw-flex": true,
|
|
25
|
+
"spiffy-tw-flex-row": true,
|
|
26
|
+
"spiffy-tw-justify-center": true,
|
|
27
|
+
"spiffy-tw-w-full": true,
|
|
28
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]": clearAllButtonEnabled,
|
|
29
|
+
"spiffy-tw-text-[--spiffy-colors-text-secondary]": !clearAllButtonEnabled
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
32
|
+
className: footerWrapperClassName,
|
|
33
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ButtonBase.ButtonBase, {
|
|
34
|
+
isDisabled: !hasFiltersChanged,
|
|
35
|
+
buttonClass: applyFilterButtonClassName,
|
|
36
|
+
text: "Apply Filters",
|
|
37
|
+
onClick: closeModal
|
|
38
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ButtonBase.ButtonBase, {
|
|
39
|
+
isDisabled: !clearAllButtonEnabled,
|
|
40
|
+
buttonClass: clearAllButtonClassName,
|
|
41
|
+
text: "Clear All",
|
|
42
|
+
onClick: clearAllFilters
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
exports.SearchFilterFooter = SearchFilterFooter;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ButtonBase } from "../ButtonBase/ButtonBase.js";
|
|
2
|
+
import "../ButtonBase/index.js";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region ../components/dist/components/SearchFilter/SearchFilterFooter.js
|
|
7
|
+
const SearchFilterFooter = ({ closeModal, clearAllFilters, filterCount, applyFiltersUnchangedClasses, applyFiltersChangedClasses, hasFiltersChanged }) => {
|
|
8
|
+
const clearAllButtonEnabled = filterCount > 0;
|
|
9
|
+
const footerWrapperClassName = classNames({
|
|
10
|
+
"spiffy-tw-flex": true,
|
|
11
|
+
"spiffy-tw-flex-col": true,
|
|
12
|
+
"spiffy-tw-items-center": true,
|
|
13
|
+
"spiffy-tw-justify-between": true,
|
|
14
|
+
"spiffy-tw-w-full": true,
|
|
15
|
+
"spiffy-tw-border-t": true,
|
|
16
|
+
"spiffy-tw-border-t-[--spiffy-colors-border-light]": true,
|
|
17
|
+
"spiffy-tw-p-[16px]": true,
|
|
18
|
+
"spiffy-tw-gap-[16px]": true
|
|
19
|
+
});
|
|
20
|
+
const applyFilterButtonClassName = classNames("spiffy-tw-flex spiffy-tw-flex-row spiffy-tw-justify-center spiffy-tw-rounded-[8px] spiffy-tw-w-full", hasFiltersChanged ? applyFiltersChangedClasses : applyFiltersUnchangedClasses);
|
|
21
|
+
const clearAllButtonClassName = classNames({
|
|
22
|
+
"spiffy-tw-flex": true,
|
|
23
|
+
"spiffy-tw-flex-row": true,
|
|
24
|
+
"spiffy-tw-justify-center": true,
|
|
25
|
+
"spiffy-tw-w-full": true,
|
|
26
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]": clearAllButtonEnabled,
|
|
27
|
+
"spiffy-tw-text-[--spiffy-colors-text-secondary]": !clearAllButtonEnabled
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: footerWrapperClassName,
|
|
31
|
+
children: [/* @__PURE__ */ jsx(ButtonBase, {
|
|
32
|
+
isDisabled: !hasFiltersChanged,
|
|
33
|
+
buttonClass: applyFilterButtonClassName,
|
|
34
|
+
text: "Apply Filters",
|
|
35
|
+
onClick: closeModal
|
|
36
|
+
}), /* @__PURE__ */ jsx(ButtonBase, {
|
|
37
|
+
isDisabled: !clearAllButtonEnabled,
|
|
38
|
+
buttonClass: clearAllButtonClassName,
|
|
39
|
+
text: "Clear All",
|
|
40
|
+
onClick: clearAllFilters
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { SearchFilterFooter };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Typography = require('../Typography/Typography.cjs');
|
|
3
|
+
require('../Typography/index.cjs');
|
|
4
|
+
let classnames = require("classnames");
|
|
5
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
|
|
8
|
+
//#region ../components/dist/components/SearchFilter/SearchFilterHeader.js
|
|
9
|
+
const SearchFilterHeader = ({ closeModal, productCount, headerClassName, filterCloseIconVariant }) => {
|
|
10
|
+
const closeIconColor = filterCloseIconVariant === "dark" ? "var(--spiffy-colors-text-primary)" : "var(--spiffy-colors-text-light)";
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
12
|
+
className: (0, classnames.default)("spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-px-4 spiffy-tw-py-3", headerClassName),
|
|
13
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Typography.Typography, {
|
|
14
|
+
variant: "body2",
|
|
15
|
+
className: "spiffy-tw-font-medium",
|
|
16
|
+
children: [
|
|
17
|
+
"Filters (",
|
|
18
|
+
productCount,
|
|
19
|
+
")"
|
|
20
|
+
]
|
|
21
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
22
|
+
onClick: closeModal,
|
|
23
|
+
className: "spiffy-tw-p-2",
|
|
24
|
+
type: "button",
|
|
25
|
+
"aria-label": "Open Filter Menu",
|
|
26
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
width: "14",
|
|
29
|
+
height: "14",
|
|
30
|
+
viewBox: "0 0 14 14",
|
|
31
|
+
fill: "none",
|
|
32
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
33
|
+
d: "M13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L7 5.58579L1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976311 12.6834 -0.0976311 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711Z",
|
|
34
|
+
fill: closeIconColor
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
exports.SearchFilterHeader = SearchFilterHeader;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Typography } from "../Typography/Typography.js";
|
|
2
|
+
import "../Typography/index.js";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region ../components/dist/components/SearchFilter/SearchFilterHeader.js
|
|
7
|
+
const SearchFilterHeader = ({ closeModal, productCount, headerClassName, filterCloseIconVariant }) => {
|
|
8
|
+
const closeIconColor = filterCloseIconVariant === "dark" ? "var(--spiffy-colors-text-primary)" : "var(--spiffy-colors-text-light)";
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: classNames("spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-px-4 spiffy-tw-py-3", headerClassName),
|
|
11
|
+
children: [/* @__PURE__ */ jsxs(Typography, {
|
|
12
|
+
variant: "body2",
|
|
13
|
+
className: "spiffy-tw-font-medium",
|
|
14
|
+
children: [
|
|
15
|
+
"Filters (",
|
|
16
|
+
productCount,
|
|
17
|
+
")"
|
|
18
|
+
]
|
|
19
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
20
|
+
onClick: closeModal,
|
|
21
|
+
className: "spiffy-tw-p-2",
|
|
22
|
+
type: "button",
|
|
23
|
+
"aria-label": "Open Filter Menu",
|
|
24
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
25
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
+
width: "14",
|
|
27
|
+
height: "14",
|
|
28
|
+
viewBox: "0 0 14 14",
|
|
29
|
+
fill: "none",
|
|
30
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
31
|
+
d: "M13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L7 5.58579L1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976311 12.6834 -0.0976311 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711Z",
|
|
32
|
+
fill: closeIconColor
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { SearchFilterHeader };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
require('../Typography/Typography.cjs');
|
|
3
|
+
require('../Typography/index.cjs');
|
|
4
|
+
let classnames = require("classnames");
|
|
5
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const require_SearchFilterHeader = require('./SearchFilterHeader.cjs');
|
|
2
|
+
const require_utils = require('./utils.cjs');
|
|
3
|
+
const require_SearchFilterFooter = require('./SearchFilterFooter.cjs');
|
|
4
|
+
const require_SearchFilter = require('./SearchFilter.cjs');
|
|
5
|
+
require('./SearchFilterItem.cjs');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SearchFilterHeader } from "./SearchFilterHeader.js";
|
|
2
|
+
import { getSelectedFilterItemsCount, getTotalSelectedFilterItemsCount } from "./utils.js";
|
|
3
|
+
import { SearchFilterFooter } from "./SearchFilterFooter.js";
|
|
4
|
+
import { SearchFilter } from "./SearchFilter.js";
|
|
5
|
+
import "./SearchFilterItem.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
|
|
4
|
+
//#region ../components/dist/components/SearchFilter/useHasFilterStateChanged.js
|
|
5
|
+
const useHasFilterStateChanged = (filters, isOpen) => {
|
|
6
|
+
const [initialFilterStates, setInitialFilterStates] = (0, react.useState)({});
|
|
7
|
+
const currentFilterStates = (0, react.useMemo)(() => {
|
|
8
|
+
const states = {};
|
|
9
|
+
filters.forEach((filter) => {
|
|
10
|
+
filter.items.forEach((item) => {
|
|
11
|
+
states[`${filter.filterId}-${item.filterItemId}`] = item.isSelected;
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
return states;
|
|
15
|
+
}, [filters]);
|
|
16
|
+
const hasFiltersChanged = (0, react.useMemo)(() => {
|
|
17
|
+
if (Object.keys(initialFilterStates).length === 0) return false;
|
|
18
|
+
return Object.keys(currentFilterStates).some((key) => currentFilterStates[key] !== initialFilterStates[key]);
|
|
19
|
+
}, [currentFilterStates, initialFilterStates]);
|
|
20
|
+
(0, react.useEffect)(() => {
|
|
21
|
+
if (isOpen) setInitialFilterStates(currentFilterStates);
|
|
22
|
+
}, [isOpen]);
|
|
23
|
+
return hasFiltersChanged;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.useHasFilterStateChanged = useHasFilterStateChanged;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
//#region ../components/dist/components/SearchFilter/useHasFilterStateChanged.js
|
|
4
|
+
const useHasFilterStateChanged = (filters, isOpen) => {
|
|
5
|
+
const [initialFilterStates, setInitialFilterStates] = useState({});
|
|
6
|
+
const currentFilterStates = useMemo(() => {
|
|
7
|
+
const states = {};
|
|
8
|
+
filters.forEach((filter) => {
|
|
9
|
+
filter.items.forEach((item) => {
|
|
10
|
+
states[`${filter.filterId}-${item.filterItemId}`] = item.isSelected;
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
return states;
|
|
14
|
+
}, [filters]);
|
|
15
|
+
const hasFiltersChanged = useMemo(() => {
|
|
16
|
+
if (Object.keys(initialFilterStates).length === 0) return false;
|
|
17
|
+
return Object.keys(currentFilterStates).some((key) => currentFilterStates[key] !== initialFilterStates[key]);
|
|
18
|
+
}, [currentFilterStates, initialFilterStates]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (isOpen) setInitialFilterStates(currentFilterStates);
|
|
21
|
+
}, [isOpen]);
|
|
22
|
+
return hasFiltersChanged;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useHasFilterStateChanged };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
//#region ../components/dist/components/SearchFilter/utils.js
|
|
3
|
+
const getSelectedFilterItemsCount = (filter) => filter.items.filter((item) => item.isSelected).length;
|
|
4
|
+
const getTotalSelectedFilterItemsCount = (filters) => filters.reduce((acc, filter) => {
|
|
5
|
+
if (filter.filterId === "sort") return acc;
|
|
6
|
+
return acc + getSelectedFilterItemsCount(filter);
|
|
7
|
+
}, 0);
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.getSelectedFilterItemsCount = getSelectedFilterItemsCount;
|
|
11
|
+
exports.getTotalSelectedFilterItemsCount = getTotalSelectedFilterItemsCount;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../components/dist/components/SearchFilter/utils.js
|
|
2
|
+
const getSelectedFilterItemsCount = (filter) => filter.items.filter((item) => item.isSelected).length;
|
|
3
|
+
const getTotalSelectedFilterItemsCount = (filters) => filters.reduce((acc, filter) => {
|
|
4
|
+
if (filter.filterId === "sort") return acc;
|
|
5
|
+
return acc + getSelectedFilterItemsCount(filter);
|
|
6
|
+
}, 0);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { getSelectedFilterItemsCount, getTotalSelectedFilterItemsCount };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_searchInputVariants = require('./searchInputVariants.cjs');
|
|
3
|
+
const require_TextInput = require('../TextInput/TextInput.cjs');
|
|
4
|
+
require('../TextInput/index.cjs');
|
|
5
|
+
const require_MagnifyingGlassStarVariant = require('../../../../icons/dist/MagnifyingGlassStarVariant.cjs');
|
|
6
|
+
const require_IconClose = require('../../../../icons/dist/IconClose.cjs');
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
9
|
+
let classnames = require("classnames");
|
|
10
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
|
|
13
|
+
//#region ../components/dist/components/SearchInput/SearchInput.js
|
|
14
|
+
const SearchInput = react.default.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
|
|
15
|
+
const localInputRef = (0, react.useRef)(null);
|
|
16
|
+
const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = require_searchInputVariants.searchInputVariantClasses[searchInputVariant];
|
|
17
|
+
(0, react.useImperativeHandle)(ref, () => localInputRef.current, []);
|
|
18
|
+
const magnifyingGlassClassesBase = [
|
|
19
|
+
"spiffy-tw-w-[24px]",
|
|
20
|
+
"spiffy-tw-h-[32px]",
|
|
21
|
+
"spiffy-tw-stroke-width-1",
|
|
22
|
+
"sm:spiffy-tw-w-[32px]"
|
|
23
|
+
];
|
|
24
|
+
const magnifyingGlassClassesInactive = (0, classnames.default)(magnifyingGlassClassesBase);
|
|
25
|
+
const magnifyingGlassClassesActive = (0, classnames.default)([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
|
|
26
|
+
const containerClasses = (0, classnames.default)("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
|
|
27
|
+
const inputClasses = (0, classnames.default)("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
|
|
28
|
+
const closeButtonIconClassName = (0, classnames.default)([
|
|
29
|
+
"spiffy-tw-w-[16px]",
|
|
30
|
+
"spiffy-tw-h-[16px]",
|
|
31
|
+
"sm:spiffy-tw-w-[24px]",
|
|
32
|
+
"sm:spiffy-tw-h-[24px]",
|
|
33
|
+
"spiffy-tw-cursor-pointer",
|
|
34
|
+
closeIconClasses
|
|
35
|
+
]);
|
|
36
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
37
|
+
className: containerClasses,
|
|
38
|
+
"data-testid": dataTestId,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
41
|
+
className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
|
|
42
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MagnifyingGlassStarVariant.MagnifyingGlassStarVariant_default, {
|
|
43
|
+
className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
|
|
44
|
+
stroke: iconColor,
|
|
45
|
+
strokeWidth: "1px"
|
|
46
|
+
})
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TextInput.TextInput, {
|
|
49
|
+
value,
|
|
50
|
+
onChange: (event) => onChange(event.target.value),
|
|
51
|
+
onFocus,
|
|
52
|
+
onBlur,
|
|
53
|
+
onKeyDown,
|
|
54
|
+
placeholder,
|
|
55
|
+
className: inputClasses,
|
|
56
|
+
placeholderVariant,
|
|
57
|
+
"aria-label": "Search",
|
|
58
|
+
"aria-autocomplete": "list",
|
|
59
|
+
"aria-expanded": !!suggestions && suggestions.length > 0,
|
|
60
|
+
"aria-controls": "autocomplete-results",
|
|
61
|
+
"aria-activedescendant": ariaActivedescendant,
|
|
62
|
+
borderRadius: "xl",
|
|
63
|
+
borderColorClass: borderColor,
|
|
64
|
+
ref: localInputRef
|
|
65
|
+
}),
|
|
66
|
+
value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
67
|
+
onClick: () => {
|
|
68
|
+
onChange("");
|
|
69
|
+
localInputRef.current?.focus();
|
|
70
|
+
},
|
|
71
|
+
className: "spiffy-tw-absolute spiffy-tw-right-5 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2 spiffy-tw-text-neutral-500 hover:spiffy-tw-text-neutral-700",
|
|
72
|
+
"aria-label": "Clear search input",
|
|
73
|
+
type: "button",
|
|
74
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconClose.IconClose_default, { className: closeButtonIconClassName })
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.SearchInput = SearchInput;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { searchInputVariantClasses } from "./searchInputVariants.js";
|
|
2
|
+
import { TextInput } from "../TextInput/TextInput.js";
|
|
3
|
+
import "../TextInput/index.js";
|
|
4
|
+
import { MagnifyingGlassStarVariant_default } from "../../../../icons/dist/MagnifyingGlassStarVariant.js";
|
|
5
|
+
import { IconClose_default } from "../../../../icons/dist/IconClose.js";
|
|
6
|
+
import React, { useImperativeHandle, useRef } from "react";
|
|
7
|
+
import classNames from "classnames";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region ../components/dist/components/SearchInput/SearchInput.js
|
|
11
|
+
const SearchInput = React.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
|
|
12
|
+
const localInputRef = useRef(null);
|
|
13
|
+
const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = searchInputVariantClasses[searchInputVariant];
|
|
14
|
+
useImperativeHandle(ref, () => localInputRef.current, []);
|
|
15
|
+
const magnifyingGlassClassesBase = [
|
|
16
|
+
"spiffy-tw-w-[24px]",
|
|
17
|
+
"spiffy-tw-h-[32px]",
|
|
18
|
+
"spiffy-tw-stroke-width-1",
|
|
19
|
+
"sm:spiffy-tw-w-[32px]"
|
|
20
|
+
];
|
|
21
|
+
const magnifyingGlassClassesInactive = classNames(magnifyingGlassClassesBase);
|
|
22
|
+
const magnifyingGlassClassesActive = classNames([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
|
|
23
|
+
const containerClasses = classNames("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
|
|
24
|
+
const inputClasses = classNames("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
|
|
25
|
+
const closeButtonIconClassName = classNames([
|
|
26
|
+
"spiffy-tw-w-[16px]",
|
|
27
|
+
"spiffy-tw-h-[16px]",
|
|
28
|
+
"sm:spiffy-tw-w-[24px]",
|
|
29
|
+
"sm:spiffy-tw-h-[24px]",
|
|
30
|
+
"spiffy-tw-cursor-pointer",
|
|
31
|
+
closeIconClasses
|
|
32
|
+
]);
|
|
33
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: containerClasses,
|
|
35
|
+
"data-testid": dataTestId,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx("div", {
|
|
38
|
+
className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
|
|
39
|
+
children: /* @__PURE__ */ jsx(MagnifyingGlassStarVariant_default, {
|
|
40
|
+
className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
|
|
41
|
+
stroke: iconColor,
|
|
42
|
+
strokeWidth: "1px"
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx(TextInput, {
|
|
46
|
+
value,
|
|
47
|
+
onChange: (event) => onChange(event.target.value),
|
|
48
|
+
onFocus,
|
|
49
|
+
onBlur,
|
|
50
|
+
onKeyDown,
|
|
51
|
+
placeholder,
|
|
52
|
+
className: inputClasses,
|
|
53
|
+
placeholderVariant,
|
|
54
|
+
"aria-label": "Search",
|
|
55
|
+
"aria-autocomplete": "list",
|
|
56
|
+
"aria-expanded": !!suggestions && suggestions.length > 0,
|
|
57
|
+
"aria-controls": "autocomplete-results",
|
|
58
|
+
"aria-activedescendant": ariaActivedescendant,
|
|
59
|
+
borderRadius: "xl",
|
|
60
|
+
borderColorClass: borderColor,
|
|
61
|
+
ref: localInputRef
|
|
62
|
+
}),
|
|
63
|
+
value && /* @__PURE__ */ jsx("button", {
|
|
64
|
+
onClick: () => {
|
|
65
|
+
onChange("");
|
|
66
|
+
localInputRef.current?.focus();
|
|
67
|
+
},
|
|
68
|
+
className: "spiffy-tw-absolute spiffy-tw-right-5 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2 spiffy-tw-text-neutral-500 hover:spiffy-tw-text-neutral-700",
|
|
69
|
+
"aria-label": "Clear search input",
|
|
70
|
+
type: "button",
|
|
71
|
+
children: /* @__PURE__ */ jsx(IconClose_default, { className: closeButtonIconClassName })
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { SearchInput };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const require_colorsConfig = require('../../models/colorsConfig.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../components/dist/components/SearchInput/searchInputVariants.js
|
|
4
|
+
const searchInputVariantClasses = { standard: {
|
|
5
|
+
searchInputIconColor: "transparent",
|
|
6
|
+
searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
|
|
7
|
+
searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
|
|
8
|
+
searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
|
|
9
|
+
autocompleteIconColor: require_colorsConfig.colorVar(require_colorsConfig.ColorNames.BackgroundPrimary),
|
|
10
|
+
searchInputClasses: "spiffy-tw-text-[--spiffy-colors-text-primary] placeholder:spiffy-tw-text-[--spiffy-colors-text-secondary] spiffy-tw-text-[16px] spiffy-tw-font-normal spiffy-tw-leading-[148%] placeholder:spiffy-tw-font-medium placeholder:spiffy-tw-leading-[124%]",
|
|
11
|
+
placeholderVariant: "h2"
|
|
12
|
+
} };
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.searchInputVariantClasses = searchInputVariantClasses;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ColorNames, colorVar } from "../../models/colorsConfig.js";
|
|
2
|
+
|
|
3
|
+
//#region ../components/dist/components/SearchInput/searchInputVariants.js
|
|
4
|
+
const searchInputVariantClasses = { standard: {
|
|
5
|
+
searchInputIconColor: "transparent",
|
|
6
|
+
searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
|
|
7
|
+
searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
|
|
8
|
+
searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
|
|
9
|
+
autocompleteIconColor: colorVar(ColorNames.BackgroundPrimary),
|
|
10
|
+
searchInputClasses: "spiffy-tw-text-[--spiffy-colors-text-primary] placeholder:spiffy-tw-text-[--spiffy-colors-text-secondary] spiffy-tw-text-[16px] spiffy-tw-font-normal spiffy-tw-leading-[148%] placeholder:spiffy-tw-font-medium placeholder:spiffy-tw-leading-[124%]",
|
|
11
|
+
placeholderVariant: "h2"
|
|
12
|
+
} };
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { searchInputVariantClasses };
|