@envive-ai/react-widgets 0.1.2 → 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 -3070
- package/dist/SearchZeroState/index.d.cts +4 -0
- package/dist/SearchZeroState/index.d.ts +4 -0
- package/dist/SearchZeroState/index.js +2 -3065
- 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-BHAXhgcd.js → SuggestionBar/SuggestionBar.js} +7 -59
- 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-s2e9YGW_.js → SuggestionButtonContainer/SuggestionButtonContainer.js} +6 -98
- 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/{chunk-DSlc6foC.cjs → _virtual/rolldown_runtime.cjs} +2 -12
- 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-CK5aU2bb.cjs → node_modules/react-indiana-drag-scroll/dist/index.cjs} +6 -132
- 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/packages/icons/dist/_virtual/rolldown_runtime.cjs +29 -0
- 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 +3 -5
- package/src/SearchZeroState/SearchZeroState.tsx +1 -1
- package/src/SuggestionBar/SuggestionBar.tsx +2 -2
- package/dist/SearchZeroState/index-DSFtalZR.d.ts +0 -27
- package/dist/SearchZeroState/index-bEcxYOSF.d.cts +0 -27
- package/dist/SuggestionButtonContainer-Dm38gJiJ.cjs +0 -173
- /package/dist/SearchResults/{index-DCTxvwmv.d.cts → SearchResultsWidget.d.cts} +0 -0
- /package/dist/SearchResults/{index-CYPV3XE0.d.ts → SearchResultsWidget.d.ts} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
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 react = require("react");
|
|
5
|
+
let classnames = require("classnames");
|
|
6
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
|
|
9
|
+
//#region ../components/dist/components/RadioButton/RadioButton.js
|
|
10
|
+
const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "medium", fillColor, hoverColor, uncheckedBorderColor, checked = false, onChange, id }) => {
|
|
11
|
+
const [isHovered, setIsHovered] = (0, react.useState)(false);
|
|
12
|
+
const containerClassName = (0, classnames.default)({
|
|
13
|
+
"spiffy-tw-flex": true,
|
|
14
|
+
"spiffy-tw-items-center": true,
|
|
15
|
+
"spiffy-tw-group": true,
|
|
16
|
+
"spiffy-tw-gap-1": textButtonGap === "small",
|
|
17
|
+
"spiffy-tw-gap-2": textButtonGap === "medium",
|
|
18
|
+
"spiffy-tw-gap-4": textButtonGap === "large",
|
|
19
|
+
"spiffy-tw-cursor-pointer": !isDisabled,
|
|
20
|
+
"spiffy-tw-opacity-40": isDisabled
|
|
21
|
+
});
|
|
22
|
+
const getFillColor = () => {
|
|
23
|
+
if (isHovered && hoverColor) return hoverColor;
|
|
24
|
+
if (checked) return fillColor;
|
|
25
|
+
return uncheckedBorderColor;
|
|
26
|
+
};
|
|
27
|
+
const handleChange = () => {
|
|
28
|
+
if (!isDisabled) onChange(value);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
31
|
+
className: containerClassName,
|
|
32
|
+
onMouseEnter: () => !isDisabled && setIsHovered(true),
|
|
33
|
+
onMouseLeave: () => setIsHovered(false),
|
|
34
|
+
"aria-label": label,
|
|
35
|
+
htmlFor: id,
|
|
36
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
37
|
+
className: "spiffy-tw-relative",
|
|
38
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
39
|
+
type: "radio",
|
|
40
|
+
id,
|
|
41
|
+
name,
|
|
42
|
+
value,
|
|
43
|
+
checked,
|
|
44
|
+
disabled: isDisabled,
|
|
45
|
+
onChange: handleChange,
|
|
46
|
+
className: "spiffy-tw-sr-only"
|
|
47
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
width: "24",
|
|
50
|
+
height: "24",
|
|
51
|
+
viewBox: "0 0 24 24",
|
|
52
|
+
fill: "none",
|
|
53
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
54
|
+
cx: "12",
|
|
55
|
+
cy: "12",
|
|
56
|
+
r: "11.5",
|
|
57
|
+
fill: "white",
|
|
58
|
+
stroke: getFillColor()
|
|
59
|
+
}), checked && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
60
|
+
cx: "12",
|
|
61
|
+
cy: "12",
|
|
62
|
+
r: "9",
|
|
63
|
+
fill: getFillColor()
|
|
64
|
+
})]
|
|
65
|
+
})]
|
|
66
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
67
|
+
variant: "body3",
|
|
68
|
+
children: label
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
exports.RadioButton = RadioButton;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Typography } from "../Typography/Typography.js";
|
|
2
|
+
import "../Typography/index.js";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region ../components/dist/components/RadioButton/RadioButton.js
|
|
8
|
+
const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "medium", fillColor, hoverColor, uncheckedBorderColor, checked = false, onChange, id }) => {
|
|
9
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
10
|
+
const containerClassName = classNames({
|
|
11
|
+
"spiffy-tw-flex": true,
|
|
12
|
+
"spiffy-tw-items-center": true,
|
|
13
|
+
"spiffy-tw-group": true,
|
|
14
|
+
"spiffy-tw-gap-1": textButtonGap === "small",
|
|
15
|
+
"spiffy-tw-gap-2": textButtonGap === "medium",
|
|
16
|
+
"spiffy-tw-gap-4": textButtonGap === "large",
|
|
17
|
+
"spiffy-tw-cursor-pointer": !isDisabled,
|
|
18
|
+
"spiffy-tw-opacity-40": isDisabled
|
|
19
|
+
});
|
|
20
|
+
const getFillColor = () => {
|
|
21
|
+
if (isHovered && hoverColor) return hoverColor;
|
|
22
|
+
if (checked) return fillColor;
|
|
23
|
+
return uncheckedBorderColor;
|
|
24
|
+
};
|
|
25
|
+
const handleChange = () => {
|
|
26
|
+
if (!isDisabled) onChange(value);
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
29
|
+
className: containerClassName,
|
|
30
|
+
onMouseEnter: () => !isDisabled && setIsHovered(true),
|
|
31
|
+
onMouseLeave: () => setIsHovered(false),
|
|
32
|
+
"aria-label": label,
|
|
33
|
+
htmlFor: id,
|
|
34
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "spiffy-tw-relative",
|
|
36
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
37
|
+
type: "radio",
|
|
38
|
+
id,
|
|
39
|
+
name,
|
|
40
|
+
value,
|
|
41
|
+
checked,
|
|
42
|
+
disabled: isDisabled,
|
|
43
|
+
onChange: handleChange,
|
|
44
|
+
className: "spiffy-tw-sr-only"
|
|
45
|
+
}), /* @__PURE__ */ jsxs("svg", {
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
width: "24",
|
|
48
|
+
height: "24",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
fill: "none",
|
|
51
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
52
|
+
cx: "12",
|
|
53
|
+
cy: "12",
|
|
54
|
+
r: "11.5",
|
|
55
|
+
fill: "white",
|
|
56
|
+
stroke: getFillColor()
|
|
57
|
+
}), checked && /* @__PURE__ */ jsx("circle", {
|
|
58
|
+
cx: "12",
|
|
59
|
+
cy: "12",
|
|
60
|
+
r: "9",
|
|
61
|
+
fill: getFillColor()
|
|
62
|
+
})]
|
|
63
|
+
})]
|
|
64
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
65
|
+
variant: "body3",
|
|
66
|
+
children: label
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { RadioButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const require_RadioButton = require('./RadioButton.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { RadioButton } from "./RadioButton.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_RadioButton = require('../RadioButton/RadioButton.cjs');
|
|
3
|
+
require('../RadioButton/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/RadioButtonGroup/RadioButtonGroup.js
|
|
9
|
+
const SPIFFY_RADIO_BUTTON_GROUP_CLASS = "spiffy-radio-button-group-class";
|
|
10
|
+
const RadioButtonGroup = ({ name, options, fillColor, hoverColor, uncheckedBorderColor, value, isDisabled = false, gap = "medium", textButtonGap = "medium", onChange }) => {
|
|
11
|
+
const groupClassName = (0, classnames.default)({
|
|
12
|
+
[SPIFFY_RADIO_BUTTON_GROUP_CLASS]: true,
|
|
13
|
+
"spiffy-tw-flex": true,
|
|
14
|
+
"spiffy-tw-flex-col": true,
|
|
15
|
+
"spiffy-tw-gap-1": gap === "small",
|
|
16
|
+
"spiffy-tw-gap-2": gap === "medium",
|
|
17
|
+
"spiffy-tw-gap-4": gap === "large"
|
|
18
|
+
});
|
|
19
|
+
const handleChange = (selectedValue) => {
|
|
20
|
+
if (!isDisabled) onChange(selectedValue);
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23
|
+
className: groupClassName,
|
|
24
|
+
children: options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RadioButton.RadioButton, {
|
|
25
|
+
id: option.value,
|
|
26
|
+
name,
|
|
27
|
+
value: option.value,
|
|
28
|
+
fillColor,
|
|
29
|
+
hoverColor,
|
|
30
|
+
uncheckedBorderColor,
|
|
31
|
+
label: option.label,
|
|
32
|
+
checked: value === option.value,
|
|
33
|
+
isDisabled: isDisabled || option.disabled,
|
|
34
|
+
onChange: handleChange,
|
|
35
|
+
textButtonGap
|
|
36
|
+
}, option.value))
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.RadioButtonGroup = RadioButtonGroup;
|
|
42
|
+
exports.SPIFFY_RADIO_BUTTON_GROUP_CLASS = SPIFFY_RADIO_BUTTON_GROUP_CLASS;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RadioButton } from "../RadioButton/RadioButton.js";
|
|
2
|
+
import "../RadioButton/index.js";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region ../components/dist/components/RadioButtonGroup/RadioButtonGroup.js
|
|
7
|
+
const SPIFFY_RADIO_BUTTON_GROUP_CLASS = "spiffy-radio-button-group-class";
|
|
8
|
+
const RadioButtonGroup = ({ name, options, fillColor, hoverColor, uncheckedBorderColor, value, isDisabled = false, gap = "medium", textButtonGap = "medium", onChange }) => {
|
|
9
|
+
const groupClassName = classNames({
|
|
10
|
+
[SPIFFY_RADIO_BUTTON_GROUP_CLASS]: true,
|
|
11
|
+
"spiffy-tw-flex": true,
|
|
12
|
+
"spiffy-tw-flex-col": true,
|
|
13
|
+
"spiffy-tw-gap-1": gap === "small",
|
|
14
|
+
"spiffy-tw-gap-2": gap === "medium",
|
|
15
|
+
"spiffy-tw-gap-4": gap === "large"
|
|
16
|
+
});
|
|
17
|
+
const handleChange = (selectedValue) => {
|
|
18
|
+
if (!isDisabled) onChange(selectedValue);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: groupClassName,
|
|
22
|
+
children: options.map((option) => /* @__PURE__ */ jsx(RadioButton, {
|
|
23
|
+
id: option.value,
|
|
24
|
+
name,
|
|
25
|
+
value: option.value,
|
|
26
|
+
fillColor,
|
|
27
|
+
hoverColor,
|
|
28
|
+
uncheckedBorderColor,
|
|
29
|
+
label: option.label,
|
|
30
|
+
checked: value === option.value,
|
|
31
|
+
isDisabled: isDisabled || option.disabled,
|
|
32
|
+
onChange: handleChange,
|
|
33
|
+
textButtonGap
|
|
34
|
+
}, option.value))
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const require_RadioButtonGroup = require('./RadioButtonGroup.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS } from "./RadioButtonGroup.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Typography = require('../Typography/Typography.cjs');
|
|
3
|
+
require('../Typography/index.cjs');
|
|
4
|
+
const require_ProductGrid = require('../ProductGrid/ProductGrid.cjs');
|
|
5
|
+
require('../ProductGrid/index.cjs');
|
|
6
|
+
let classnames = require("classnames");
|
|
7
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let framer_motion = require("framer-motion");
|
|
10
|
+
|
|
11
|
+
//#region ../components/dist/components/RecommendedProducts/RecommendedProducts.js
|
|
12
|
+
const RecommendedProducts = ({ retrievedProducts, merchantShortName, productCardConfig = {
|
|
13
|
+
variant: "minimal",
|
|
14
|
+
hoverVariant: "none",
|
|
15
|
+
layoutVariant: "square"
|
|
16
|
+
}, productGridVariant = "square", heading, onProductClick }) => {
|
|
17
|
+
const containerClasses = (0, classnames.default)("spiffy-tw-justify-center", "spiffy-tw-overflow-hidden", "spiffy-tw-bg-white", "spiffy-tw-relative", "spiffy-tw-px-[24px]", "spiffy-tw-py-[16px]", "sm:spiffy-tw-px-[41px]", "sm:spiffy-tw-py-[40px]");
|
|
18
|
+
const titleContainerClasses = (0, classnames.default)("spiffy-tw-w-full", "spiffy-tw-border-b", "spiffy-tw-border-solid", "spiffy-tw-border-b-[--spiffy-colors-text-accent]", "spiffy-tw-pb-[8px]", "spiffy-tw-mb-[16px]");
|
|
19
|
+
const productGridClasses = (0, classnames.default)("spiffy-tw-grid", "spiffy-tw-justify-items-stretch", "spiffy-tw-grid-cols-2", "md:spiffy-tw-grid-cols-3", "lg:spiffy-tw-grid-cols-4", "spiffy-tw-gap-x-[4px]", "spiffy-tw-gap-y-[24px]", "spiffy-tw-h-full", "spiffy-tw-w-full", "spiffy-tw-items-stretch");
|
|
20
|
+
if (retrievedProducts == null || retrievedProducts.length === 0) return null;
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
|
|
22
|
+
className: containerClasses,
|
|
23
|
+
initial: { opacity: 0 },
|
|
24
|
+
animate: { opacity: 1 },
|
|
25
|
+
exit: { opacity: 0 },
|
|
26
|
+
transition: { duration: .2 },
|
|
27
|
+
style: {
|
|
28
|
+
left: "50%",
|
|
29
|
+
right: "50%",
|
|
30
|
+
marginLeft: "-50vw",
|
|
31
|
+
marginRight: "-50vw",
|
|
32
|
+
width: "100vw"
|
|
33
|
+
},
|
|
34
|
+
children: [heading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
35
|
+
className: titleContainerClasses,
|
|
36
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
37
|
+
variant: "h1",
|
|
38
|
+
className: "spiffy-tw-text-[--spiffy-colors-text-accent]",
|
|
39
|
+
children: heading
|
|
40
|
+
})
|
|
41
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ProductGrid.ProductGrid, {
|
|
42
|
+
productList: retrievedProducts,
|
|
43
|
+
productGridVariant,
|
|
44
|
+
productGridClasses,
|
|
45
|
+
productCardConfig,
|
|
46
|
+
merchantShortName,
|
|
47
|
+
onProductClick
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.RecommendedProducts = RecommendedProducts;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Typography } from "../Typography/Typography.js";
|
|
2
|
+
import "../Typography/index.js";
|
|
3
|
+
import { ProductGrid } from "../ProductGrid/ProductGrid.js";
|
|
4
|
+
import "../ProductGrid/index.js";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { motion } from "framer-motion";
|
|
8
|
+
|
|
9
|
+
//#region ../components/dist/components/RecommendedProducts/RecommendedProducts.js
|
|
10
|
+
const RecommendedProducts = ({ retrievedProducts, merchantShortName, productCardConfig = {
|
|
11
|
+
variant: "minimal",
|
|
12
|
+
hoverVariant: "none",
|
|
13
|
+
layoutVariant: "square"
|
|
14
|
+
}, productGridVariant = "square", heading, onProductClick }) => {
|
|
15
|
+
const containerClasses = classNames("spiffy-tw-justify-center", "spiffy-tw-overflow-hidden", "spiffy-tw-bg-white", "spiffy-tw-relative", "spiffy-tw-px-[24px]", "spiffy-tw-py-[16px]", "sm:spiffy-tw-px-[41px]", "sm:spiffy-tw-py-[40px]");
|
|
16
|
+
const titleContainerClasses = classNames("spiffy-tw-w-full", "spiffy-tw-border-b", "spiffy-tw-border-solid", "spiffy-tw-border-b-[--spiffy-colors-text-accent]", "spiffy-tw-pb-[8px]", "spiffy-tw-mb-[16px]");
|
|
17
|
+
const productGridClasses = classNames("spiffy-tw-grid", "spiffy-tw-justify-items-stretch", "spiffy-tw-grid-cols-2", "md:spiffy-tw-grid-cols-3", "lg:spiffy-tw-grid-cols-4", "spiffy-tw-gap-x-[4px]", "spiffy-tw-gap-y-[24px]", "spiffy-tw-h-full", "spiffy-tw-w-full", "spiffy-tw-items-stretch");
|
|
18
|
+
if (retrievedProducts == null || retrievedProducts.length === 0) return null;
|
|
19
|
+
return /* @__PURE__ */ jsxs(motion.div, {
|
|
20
|
+
className: containerClasses,
|
|
21
|
+
initial: { opacity: 0 },
|
|
22
|
+
animate: { opacity: 1 },
|
|
23
|
+
exit: { opacity: 0 },
|
|
24
|
+
transition: { duration: .2 },
|
|
25
|
+
style: {
|
|
26
|
+
left: "50%",
|
|
27
|
+
right: "50%",
|
|
28
|
+
marginLeft: "-50vw",
|
|
29
|
+
marginRight: "-50vw",
|
|
30
|
+
width: "100vw"
|
|
31
|
+
},
|
|
32
|
+
children: [heading && /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: titleContainerClasses,
|
|
34
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
35
|
+
variant: "h1",
|
|
36
|
+
className: "spiffy-tw-text-[--spiffy-colors-text-accent]",
|
|
37
|
+
children: heading
|
|
38
|
+
})
|
|
39
|
+
}), /* @__PURE__ */ jsx(ProductGrid, {
|
|
40
|
+
productList: retrievedProducts,
|
|
41
|
+
productGridVariant,
|
|
42
|
+
productGridClasses,
|
|
43
|
+
productCardConfig,
|
|
44
|
+
merchantShortName,
|
|
45
|
+
onProductClick
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { RecommendedProducts };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Typography = require('../Typography/Typography.cjs');
|
|
3
|
+
require('../Typography/index.cjs');
|
|
4
|
+
const require_OutlinedStar = require('../../../../icons/dist/OutlinedStar.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
7
|
+
let classnames = require("classnames");
|
|
8
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let framer_motion = require("framer-motion");
|
|
11
|
+
|
|
12
|
+
//#region ../components/dist/components/SearchAutocomplete/SearchAutocomplete.js
|
|
13
|
+
const SearchAutocomplete = ({ id, results, focusedIndex, searchText = "", onSuggestionSelect, iconColor }) => {
|
|
14
|
+
if (results.length === 0) return null;
|
|
15
|
+
const highlightMatchingText = (text, searchQuery) => {
|
|
16
|
+
if (!searchQuery.trim()) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
17
|
+
variant: "body3",
|
|
18
|
+
children: text
|
|
19
|
+
});
|
|
20
|
+
const escapedQuery = searchQuery.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
21
|
+
const regex = new RegExp(`(${escapedQuery})`, "gi");
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
23
|
+
variant: "body3",
|
|
24
|
+
children: text.split(regex).map((part, index) => {
|
|
25
|
+
return part.toLowerCase() === searchQuery.toLowerCase() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
|
|
26
|
+
className: "spiffy-tw-font-bold",
|
|
27
|
+
children: part
|
|
28
|
+
}, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: part }, index);
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const containerClasses = (0, classnames.default)("spiffy-tw-mt-[16px]", "spiffy-tw-mb-[8px]");
|
|
33
|
+
const getListElementClasses = (index) => (0, classnames.default)("spiffy-tw-flex", "spiffy-tw-items-center", "spiffy-tw-cursor-pointer", "spiffy-tw-py-[8px]", "spiffy-tw-pl-[16px]", "spiffy-tw-text-[--spiffy-colors-text-primary]", "hover:spiffy-tw-bg-neutral-100", { "spiffy-tw-bg-neutral-200": focusedIndex === index });
|
|
34
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
|
|
35
|
+
className: "spiffy-tw-h-full",
|
|
36
|
+
initial: {
|
|
37
|
+
opacity: 0,
|
|
38
|
+
y: -10
|
|
39
|
+
},
|
|
40
|
+
animate: {
|
|
41
|
+
opacity: 1,
|
|
42
|
+
y: 0
|
|
43
|
+
},
|
|
44
|
+
exit: {
|
|
45
|
+
opacity: 0,
|
|
46
|
+
y: -10
|
|
47
|
+
},
|
|
48
|
+
transition: { duration: .2 },
|
|
49
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
50
|
+
id,
|
|
51
|
+
role: "listbox",
|
|
52
|
+
className: containerClasses,
|
|
53
|
+
children: results.map((result, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
54
|
+
id: `option-${index}`,
|
|
55
|
+
role: "option",
|
|
56
|
+
"aria-selected": index === focusedIndex,
|
|
57
|
+
className: getListElementClasses(index),
|
|
58
|
+
onClick: () => onSuggestionSelect(result, index),
|
|
59
|
+
onKeyDown: (event) => {
|
|
60
|
+
if (event.key === "Enter" || event.keyCode === 13) onSuggestionSelect(result, index);
|
|
61
|
+
},
|
|
62
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OutlinedStar.OutlinedStar_default, {
|
|
63
|
+
className: "spiffy-tw-mr-[16px] spiffy-tw-h-[16px] spiffy-tw-w-[16px]",
|
|
64
|
+
fill: iconColor
|
|
65
|
+
}), highlightMatchingText(result, searchText)]
|
|
66
|
+
}, index))
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.SearchAutocomplete = SearchAutocomplete;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Typography } from "../Typography/Typography.js";
|
|
2
|
+
import "../Typography/index.js";
|
|
3
|
+
import { OutlinedStar_default } from "../../../../icons/dist/OutlinedStar.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { motion } from "framer-motion";
|
|
8
|
+
|
|
9
|
+
//#region ../components/dist/components/SearchAutocomplete/SearchAutocomplete.js
|
|
10
|
+
const SearchAutocomplete = ({ id, results, focusedIndex, searchText = "", onSuggestionSelect, iconColor }) => {
|
|
11
|
+
if (results.length === 0) return null;
|
|
12
|
+
const highlightMatchingText = (text, searchQuery) => {
|
|
13
|
+
if (!searchQuery.trim()) return /* @__PURE__ */ jsx(Typography, {
|
|
14
|
+
variant: "body3",
|
|
15
|
+
children: text
|
|
16
|
+
});
|
|
17
|
+
const escapedQuery = searchQuery.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18
|
+
const regex = new RegExp(`(${escapedQuery})`, "gi");
|
|
19
|
+
return /* @__PURE__ */ jsx(Typography, {
|
|
20
|
+
variant: "body3",
|
|
21
|
+
children: text.split(regex).map((part, index) => {
|
|
22
|
+
return part.toLowerCase() === searchQuery.toLowerCase() ? /* @__PURE__ */ jsx("strong", {
|
|
23
|
+
className: "spiffy-tw-font-bold",
|
|
24
|
+
children: part
|
|
25
|
+
}, index) : /* @__PURE__ */ jsx("span", { children: part }, index);
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const containerClasses = classNames("spiffy-tw-mt-[16px]", "spiffy-tw-mb-[8px]");
|
|
30
|
+
const getListElementClasses = (index) => classNames("spiffy-tw-flex", "spiffy-tw-items-center", "spiffy-tw-cursor-pointer", "spiffy-tw-py-[8px]", "spiffy-tw-pl-[16px]", "spiffy-tw-text-[--spiffy-colors-text-primary]", "hover:spiffy-tw-bg-neutral-100", { "spiffy-tw-bg-neutral-200": focusedIndex === index });
|
|
31
|
+
return /* @__PURE__ */ jsx(motion.div, {
|
|
32
|
+
className: "spiffy-tw-h-full",
|
|
33
|
+
initial: {
|
|
34
|
+
opacity: 0,
|
|
35
|
+
y: -10
|
|
36
|
+
},
|
|
37
|
+
animate: {
|
|
38
|
+
opacity: 1,
|
|
39
|
+
y: 0
|
|
40
|
+
},
|
|
41
|
+
exit: {
|
|
42
|
+
opacity: 0,
|
|
43
|
+
y: -10
|
|
44
|
+
},
|
|
45
|
+
transition: { duration: .2 },
|
|
46
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
47
|
+
id,
|
|
48
|
+
role: "listbox",
|
|
49
|
+
className: containerClasses,
|
|
50
|
+
children: results.map((result, index) => /* @__PURE__ */ jsxs("li", {
|
|
51
|
+
id: `option-${index}`,
|
|
52
|
+
role: "option",
|
|
53
|
+
"aria-selected": index === focusedIndex,
|
|
54
|
+
className: getListElementClasses(index),
|
|
55
|
+
onClick: () => onSuggestionSelect(result, index),
|
|
56
|
+
onKeyDown: (event) => {
|
|
57
|
+
if (event.key === "Enter" || event.keyCode === 13) onSuggestionSelect(result, index);
|
|
58
|
+
},
|
|
59
|
+
children: [/* @__PURE__ */ jsx(OutlinedStar_default, {
|
|
60
|
+
className: "spiffy-tw-mr-[16px] spiffy-tw-h-[16px] spiffy-tw-w-[16px]",
|
|
61
|
+
fill: iconColor
|
|
62
|
+
}), highlightMatchingText(result, searchText)]
|
|
63
|
+
}, index))
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { SearchAutocomplete };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const require_SearchAutocomplete = require('./SearchAutocomplete.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { SearchAutocomplete } from "./SearchAutocomplete.js";
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_SearchFilterHeader = require('./SearchFilterHeader.cjs');
|
|
3
|
+
const require_Accordion = require('../Accordion/Accordion.cjs');
|
|
4
|
+
require('../Accordion/index.cjs');
|
|
5
|
+
const require_ModalSheet = require('../ModalSheet/ModalSheet.cjs');
|
|
6
|
+
require('../ModalSheet/index.cjs');
|
|
7
|
+
const require_RadioButtonGroup = require('../RadioButtonGroup/RadioButtonGroup.cjs');
|
|
8
|
+
require('../RadioButtonGroup/index.cjs');
|
|
9
|
+
const require_useHasFilterStateChanged = require('./useHasFilterStateChanged.cjs');
|
|
10
|
+
const require_utils = require('./utils.cjs');
|
|
11
|
+
const require_ToggleButton = require('../ToggleButton/ToggleButton.cjs');
|
|
12
|
+
require('../ToggleButton/index.cjs');
|
|
13
|
+
const require_SearchFilterFooter = require('./SearchFilterFooter.cjs');
|
|
14
|
+
let react = require("react");
|
|
15
|
+
let classnames = require("classnames");
|
|
16
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
17
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
18
|
+
|
|
19
|
+
//#region ../components/dist/components/SearchFilter/SearchFilter.js
|
|
20
|
+
const SortFilter = ({ filter, selectFilterItem, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor }) => {
|
|
21
|
+
const filterTitle = filter.displayName;
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Accordion.Accordion, {
|
|
23
|
+
title: filterTitle,
|
|
24
|
+
content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RadioButtonGroup.RadioButtonGroup, {
|
|
25
|
+
options: filter.items.map((item) => ({
|
|
26
|
+
label: item.displayName,
|
|
27
|
+
value: item.filterItemId,
|
|
28
|
+
isSelected: item.isSelected
|
|
29
|
+
})),
|
|
30
|
+
name: filterTitle,
|
|
31
|
+
onChange: (value) => {
|
|
32
|
+
const selectedItem = filter.items.find((item) => item.filterItemId === value);
|
|
33
|
+
selectFilterItem({
|
|
34
|
+
filterId: filter.filterId,
|
|
35
|
+
filterItemId: value,
|
|
36
|
+
isSelected: true,
|
|
37
|
+
displayName: selectedItem?.displayName || value
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
gap: "large",
|
|
41
|
+
textButtonGap: "large",
|
|
42
|
+
value: filter.items.find((item) => item.isSelected)?.filterItemId,
|
|
43
|
+
fillColor: radioButtonFillColor,
|
|
44
|
+
hoverColor: radioButtonHoverColor,
|
|
45
|
+
uncheckedBorderColor: radioButtonUncheckedBorderColor
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const FilterItem = ({ filterId, filterItem, selectFilterItem }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ToggleButton.ToggleButton, {
|
|
50
|
+
label: filterItem.displayName,
|
|
51
|
+
secondaryLabel: `(${filterItem.productCount})`,
|
|
52
|
+
isSelected: filterItem.isSelected,
|
|
53
|
+
onClick: () => selectFilterItem({
|
|
54
|
+
filterId,
|
|
55
|
+
filterItemId: filterItem.filterItemId,
|
|
56
|
+
isSelected: !filterItem.isSelected,
|
|
57
|
+
displayName: filterItem.displayName
|
|
58
|
+
}),
|
|
59
|
+
variant: "default"
|
|
60
|
+
});
|
|
61
|
+
const Filter = ({ filter, selectFilterItem }) => {
|
|
62
|
+
const filterContentClassName = (0, classnames.default)({
|
|
63
|
+
"spiffy-tw-flex": true,
|
|
64
|
+
"spiffy-tw-flex-wrap": true,
|
|
65
|
+
"spiffy-tw-gap-[8px]": true,
|
|
66
|
+
"spiffy-tw-pb-[1px]": true
|
|
67
|
+
});
|
|
68
|
+
const selectedFilterItems = require_utils.getSelectedFilterItemsCount(filter);
|
|
69
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Accordion.Accordion, {
|
|
70
|
+
title: selectedFilterItems > 0 ? `${filter.displayName} (${selectedFilterItems})` : filter.displayName,
|
|
71
|
+
content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
72
|
+
className: filterContentClassName,
|
|
73
|
+
children: filter.items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterItem, {
|
|
74
|
+
filterId: filter.filterId,
|
|
75
|
+
filterItem: item,
|
|
76
|
+
selectFilterItem
|
|
77
|
+
}, item.filterItemId))
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const SearchFilter = ({ filters, productCount, selectFilterItem, clearAllFilters, isOpen, setIsOpen, applyFiltersUnchangedClasses, applyFiltersChangedClasses, headerContent, footerContent, headerClassName, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, filterCloseIconVariant }) => {
|
|
82
|
+
const closeModal = (0, react.useCallback)(() => setIsOpen(false), [setIsOpen]);
|
|
83
|
+
const filterCount = require_utils.getTotalSelectedFilterItemsCount(filters);
|
|
84
|
+
const hasFiltersChanged = require_useHasFilterStateChanged.useHasFilterStateChanged(filters, isOpen);
|
|
85
|
+
const filterWrapperClassName = (0, classnames.default)({
|
|
86
|
+
"spiffy-tw-flex": true,
|
|
87
|
+
"spiffy-tw-flex-col": true,
|
|
88
|
+
"spiffy-tw-gap-[16px]": true,
|
|
89
|
+
"spiffy-tw-px-[24px]": true,
|
|
90
|
+
"spiffy-tw-py-[16px]": true,
|
|
91
|
+
"spiffy-tw-max-h-screen": true,
|
|
92
|
+
"spiffy-tw-overflow-y-auto": true
|
|
93
|
+
});
|
|
94
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ModalSheet.ModalSheet, {
|
|
95
|
+
isOpen,
|
|
96
|
+
closeModal,
|
|
97
|
+
headerProps: {
|
|
98
|
+
headerContent: headerContent || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchFilterHeader.SearchFilterHeader, {
|
|
99
|
+
closeModal,
|
|
100
|
+
productCount,
|
|
101
|
+
headerClassName: headerClassName ?? "",
|
|
102
|
+
filterCloseIconVariant
|
|
103
|
+
}),
|
|
104
|
+
chevronColor: "#000"
|
|
105
|
+
},
|
|
106
|
+
footerProps: { footerContent: footerContent || /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchFilterFooter.SearchFilterFooter, {
|
|
107
|
+
closeModal,
|
|
108
|
+
clearAllFilters,
|
|
109
|
+
filterCount,
|
|
110
|
+
hasFiltersChanged,
|
|
111
|
+
applyFiltersUnchangedClasses,
|
|
112
|
+
applyFiltersChangedClasses
|
|
113
|
+
}) },
|
|
114
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
115
|
+
className: filterWrapperClassName,
|
|
116
|
+
children: filters.filter((filter) => filter.displayName !== "").map((filter) => {
|
|
117
|
+
if (filter.filterId === "sort") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SortFilter, {
|
|
118
|
+
filter,
|
|
119
|
+
selectFilterItem,
|
|
120
|
+
radioButtonFillColor,
|
|
121
|
+
radioButtonHoverColor,
|
|
122
|
+
radioButtonUncheckedBorderColor
|
|
123
|
+
}, filter.filterId);
|
|
124
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Filter, {
|
|
125
|
+
filter,
|
|
126
|
+
selectFilterItem
|
|
127
|
+
}, filter.filterId);
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
exports.SearchFilter = SearchFilter;
|