@envive-ai/react-widgets 0.1.3 → 0.3.1
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 +8 -12
- package/dist/SearchResults/SearchResults.js +4 -8
- package/dist/SearchResults/SearchResultsWidget.cjs +1 -1
- package/dist/SearchResults/SearchResultsWidget.js +1 -1
- package/dist/SearchResults/withSearchResults.cjs +1 -1
- package/dist/SearchResults/withSearchResults.js +1 -1
- package/dist/SearchZeroState/SearchIcon.cjs +2 -3
- package/dist/SearchZeroState/SearchIcon.js +1 -2
- package/dist/SearchZeroState/SearchZeroState.cjs +12 -16
- package/dist/SearchZeroState/SearchZeroState.js +7 -11
- package/dist/SearchZeroState/SearchZeroStateWidget.cjs +1 -1
- package/dist/SearchZeroState/SearchZeroStateWidget.js +1 -1
- package/dist/SearchZeroState/components/RecommendedProducts.cjs +5 -7
- package/dist/SearchZeroState/components/RecommendedProducts.js +3 -5
- package/dist/SuggestionBar/SuggestionBar.cjs +1 -1
- package/dist/SuggestionBar/SuggestionBar.js +2 -2
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +6 -7
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.js +2 -3
- package/package.json +3 -1
- package/dist/node_modules/react-icons/lib/iconBase.cjs +0 -121
- package/dist/node_modules/react-icons/lib/iconBase.js +0 -119
- package/dist/node_modules/react-icons/lib/iconContext.cjs +0 -17
- package/dist/node_modules/react-icons/lib/iconContext.js +0 -14
- package/dist/node_modules/react-icons/md/index.cjs +0 -35
- package/dist/node_modules/react-icons/md/index.js +0 -35
- package/dist/packages/components/dist/components/Accordion/Accordion.cjs +0 -80
- package/dist/packages/components/dist/components/Accordion/Accordion.js +0 -78
- package/dist/packages/components/dist/components/Accordion/index.cjs +0 -1
- package/dist/packages/components/dist/components/Accordion/index.js +0 -1
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.cjs +0 -30
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.js +0 -29
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.cjs +0 -56
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.js +0 -54
- package/dist/packages/components/dist/components/ButtonBase/index.cjs +0 -2
- package/dist/packages/components/dist/components/ButtonBase/index.js +0 -2
- package/dist/packages/components/dist/components/ButtonBase/types.cjs +0 -11
- package/dist/packages/components/dist/components/ButtonBase/types.js +0 -10
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.cjs +0 -45
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.js +0 -42
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.cjs +0 -33
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.js +0 -30
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.cjs +0 -45
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.js +0 -42
- package/dist/packages/components/dist/components/ImageWithFallback/index.cjs +0 -1
- package/dist/packages/components/dist/components/ImageWithFallback/index.js +0 -1
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.cjs +0 -30
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.js +0 -29
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.cjs +0 -26
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.js +0 -24
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.cjs +0 -122
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.js +0 -120
- package/dist/packages/components/dist/components/ModalSheet/index.cjs +0 -1
- package/dist/packages/components/dist/components/ModalSheet/index.js +0 -1
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.cjs +0 -116
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.js +0 -114
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.cjs +0 -38
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.js +0 -36
- package/dist/packages/components/dist/components/ProductCard/ProductCard.cjs +0 -153
- package/dist/packages/components/dist/components/ProductCard/ProductCard.js +0 -149
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.cjs +0 -33
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.js +0 -31
- package/dist/packages/components/dist/components/ProductCard/index.cjs +0 -4
- package/dist/packages/components/dist/components/ProductCard/index.js +0 -4
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.cjs +0 -49
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.js +0 -45
- package/dist/packages/components/dist/components/ProductCard/types.cjs +0 -10
- package/dist/packages/components/dist/components/ProductCard/types.js +0 -9
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.cjs +0 -43
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.js +0 -41
- package/dist/packages/components/dist/components/ProductGrid/index.cjs +0 -2
- package/dist/packages/components/dist/components/ProductGrid/index.js +0 -2
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.cjs +0 -21
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.js +0 -20
- package/dist/packages/components/dist/components/RadioButton/RadioButton.cjs +0 -74
- package/dist/packages/components/dist/components/RadioButton/RadioButton.js +0 -72
- package/dist/packages/components/dist/components/RadioButton/index.cjs +0 -1
- package/dist/packages/components/dist/components/RadioButton/index.js +0 -1
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.cjs +0 -42
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.js +0 -39
- package/dist/packages/components/dist/components/RadioButtonGroup/index.cjs +0 -1
- package/dist/packages/components/dist/components/RadioButtonGroup/index.js +0 -1
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.cjs +0 -53
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.js +0 -51
- package/dist/packages/components/dist/components/RecommendedProducts/index.cjs +0 -3
- package/dist/packages/components/dist/components/RecommendedProducts/index.js +0 -3
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.cjs +0 -72
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.js +0 -69
- package/dist/packages/components/dist/components/SearchAutocomplete/index.cjs +0 -1
- package/dist/packages/components/dist/components/SearchAutocomplete/index.js +0 -1
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.cjs +0 -134
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.js +0 -132
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.cjs +0 -48
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.js +0 -46
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.cjs +0 -42
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.js +0 -40
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.cjs +0 -6
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.js +0 -4
- package/dist/packages/components/dist/components/SearchFilter/index.cjs +0 -5
- package/dist/packages/components/dist/components/SearchFilter/index.js +0 -5
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.cjs +0 -27
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.js +0 -26
- package/dist/packages/components/dist/components/SearchFilter/utils.cjs +0 -11
- package/dist/packages/components/dist/components/SearchFilter/utils.js +0 -9
- package/dist/packages/components/dist/components/SearchInput/SearchInput.cjs +0 -81
- package/dist/packages/components/dist/components/SearchInput/SearchInput.js +0 -78
- package/dist/packages/components/dist/components/SearchInput/index.cjs +0 -2
- package/dist/packages/components/dist/components/SearchInput/index.js +0 -2
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.cjs +0 -15
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.js +0 -15
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.cjs +0 -57
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.js +0 -55
- package/dist/packages/components/dist/components/SearchInputForm/index.cjs +0 -1
- package/dist/packages/components/dist/components/SearchInputForm/index.js +0 -1
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs +0 -52
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.js +0 -50
- package/dist/packages/components/dist/components/SearchResultsContent/index.cjs +0 -1
- package/dist/packages/components/dist/components/SearchResultsContent/index.js +0 -1
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.cjs +0 -24
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.js +0 -23
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.js +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs +0 -36
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js +0 -35
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.js +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.cjs +0 -9
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -9
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.cjs +0 -2
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.js +0 -2
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.cjs +0 -34
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -34
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.cjs +0 -56
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.js +0 -54
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.cjs +0 -53
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.js +0 -51
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.cjs +0 -52
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.js +0 -51
- package/dist/packages/components/dist/components/SearchResultsStates/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsStates/index.js +0 -3
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs +0 -60
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js +0 -57
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.js +0 -3
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.cjs +0 -77
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.js +0 -75
- package/dist/packages/components/dist/components/SparkleAnimation/index.cjs +0 -2
- package/dist/packages/components/dist/components/SparkleAnimation/index.js +0 -2
- package/dist/packages/components/dist/components/SparkleAnimation/types.cjs +0 -12
- package/dist/packages/components/dist/components/SparkleAnimation/types.js +0 -11
- package/dist/packages/components/dist/components/Spinner/Spinner.cjs +0 -40
- package/dist/packages/components/dist/components/Spinner/Spinner.js +0 -38
- package/dist/packages/components/dist/components/Spinner/index.cjs +0 -1
- package/dist/packages/components/dist/components/Spinner/index.js +0 -1
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.cjs +0 -193
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.js +0 -188
- package/dist/packages/components/dist/components/SuggestionButton/index.cjs +0 -1
- package/dist/packages/components/dist/components/SuggestionButton/index.js +0 -1
- package/dist/packages/components/dist/components/TextInput/TextInput.cjs +0 -34
- package/dist/packages/components/dist/components/TextInput/TextInput.js +0 -31
- package/dist/packages/components/dist/components/TextInput/index.cjs +0 -1
- package/dist/packages/components/dist/components/TextInput/index.js +0 -1
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.cjs +0 -63
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.js +0 -61
- package/dist/packages/components/dist/components/ToggleButton/index.cjs +0 -1
- package/dist/packages/components/dist/components/ToggleButton/index.js +0 -1
- package/dist/packages/components/dist/components/Typography/Typography.cjs +0 -53
- package/dist/packages/components/dist/components/Typography/Typography.js +0 -50
- package/dist/packages/components/dist/components/Typography/index.cjs +0 -2
- package/dist/packages/components/dist/components/Typography/index.js +0 -2
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.cjs +0 -99
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.js +0 -96
- package/dist/packages/components/dist/components/Typography/util.cjs +0 -10
- package/dist/packages/components/dist/components/Typography/util.js +0 -10
- package/dist/packages/components/dist/logging/logger.cjs +0 -20
- package/dist/packages/components/dist/logging/logger.js +0 -19
- package/dist/packages/components/dist/models/colorsConfig.cjs +0 -28
- package/dist/packages/components/dist/models/colorsConfig.js +0 -26
- package/dist/packages/components/dist/util/formatPrice.cjs +0 -14
- package/dist/packages/components/dist/util/formatPrice.js +0 -13
- package/dist/packages/components/dist/util/index.cjs +0 -3
- package/dist/packages/components/dist/util/index.js +0 -3
- package/dist/packages/components/dist/util/useScrollDirection.cjs +0 -39
- package/dist/packages/components/dist/util/useScrollDirection.js +0 -38
- package/dist/packages/components/dist/util/useStickyVisibility.cjs +0 -38
- package/dist/packages/components/dist/util/useStickyVisibility.js +0 -37
- package/dist/packages/icons/dist/ChevronDown.cjs +0 -23
- package/dist/packages/icons/dist/ChevronDown.js +0 -23
- package/dist/packages/icons/dist/FourPointStar.cjs +0 -22
- package/dist/packages/icons/dist/FourPointStar.js +0 -22
- package/dist/packages/icons/dist/IconClose.cjs +0 -26
- package/dist/packages/icons/dist/IconClose.js +0 -26
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.cjs +0 -39
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.js +0 -39
- package/dist/packages/icons/dist/OutlinedStar.cjs +0 -22
- package/dist/packages/icons/dist/OutlinedStar.js +0 -22
- package/dist/packages/icons/dist/SettingsVariant.cjs +0 -72
- package/dist/packages/icons/dist/SettingsVariant.js +0 -72
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_SearchResultsContent = require('../packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs');
|
|
3
|
-
require('../packages/components/dist/components/SearchResultsContent/index.cjs');
|
|
4
|
-
const require_SearchResultsFilterModal = require('../packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs');
|
|
5
|
-
require('../packages/components/dist/components/SearchResultsFilterModal/index.cjs');
|
|
6
|
-
const require_SearchResultsToolbar = require('../packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs');
|
|
7
|
-
require('../packages/components/dist/components/SearchResultsToolbar/index.cjs');
|
|
8
|
-
const require_useStickyVisibility = require('../packages/components/dist/util/useStickyVisibility.cjs');
|
|
9
|
-
require('../packages/components/dist/util/index.cjs');
|
|
10
2
|
const require_withSearchResults = require('./withSearchResults.cjs');
|
|
11
3
|
let react = require("react");
|
|
12
4
|
let classnames = require("classnames");
|
|
13
5
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let __envive_ai_react_toolkit_SearchResultsContent = require("@envive-ai/react-toolkit/SearchResultsContent");
|
|
7
|
+
let __envive_ai_react_toolkit_SearchResultsFilterModal = require("@envive-ai/react-toolkit/SearchResultsFilterModal");
|
|
8
|
+
let __envive_ai_react_toolkit_SearchResultsToolbar = require("@envive-ai/react-toolkit/SearchResultsToolbar");
|
|
9
|
+
let __envive_ai_react_toolkit_util = require("@envive-ai/react-toolkit/util");
|
|
14
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
15
11
|
|
|
16
12
|
//#region src/SearchResults/SearchResults.tsx
|
|
17
13
|
const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShortName, productList, autocompleteResults, searchFilters, availableDynamicFilters, selectedFilterOptions, searchText, query, searchResultsState, isFilterOpen, shouldShowAutocomplete, focusedIndex, focusedOptionId, recommendedProducts, filterButtonText, onSearchInputChange, onSubmitSearch, onAutocompleteSelect, onKeyDown, onSearchInputFocus, onSearchInputBlur, onToggleDynamicFilter, onSelectFilterItem, onRemoveFilter, onClearAllFilters, setIsFilterOpen, searchResultsRef }) => {
|
|
18
14
|
const { searchInputVariant, searchFilterSidebarVariant, productGridVariant, searchBoxPlaceholder, noResultsFoundText, isSearchInputSticky = false } = widgetConfig;
|
|
19
|
-
const { toolbarRef: ref, isVisible, toolbarHeight: height } =
|
|
15
|
+
const { toolbarRef: ref, isVisible, toolbarHeight: height } = (0, __envive_ai_react_toolkit_util.useStickyVisibility)();
|
|
20
16
|
const toolbarRef = isSearchInputSticky ? ref : null;
|
|
21
17
|
const finalIsVisible = isSearchInputSticky ? isVisible : true;
|
|
22
18
|
const toolbarHeight = isSearchInputSticky ? height : 0;
|
|
@@ -29,7 +25,7 @@ const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShort
|
|
|
29
25
|
});
|
|
30
26
|
}, [productList]);
|
|
31
27
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
32
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
28
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchResultsFilterModal.SearchResultsFilterModal, {
|
|
33
29
|
isOpen: isFilterOpen,
|
|
34
30
|
setIsOpen: setIsFilterOpen,
|
|
35
31
|
searchFilters,
|
|
@@ -39,7 +35,7 @@ const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShort
|
|
|
39
35
|
searchFilterSidebarVariant,
|
|
40
36
|
filterButtonText
|
|
41
37
|
}),
|
|
42
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
38
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchResultsToolbar.SearchResultsToolbar, {
|
|
43
39
|
className: isSearchInputSticky ? stickyToolbarClasses : "spiffy-tw-py-[8px]",
|
|
44
40
|
toolbarRef,
|
|
45
41
|
searchInputVariant,
|
|
@@ -60,7 +56,7 @@ const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShort
|
|
|
60
56
|
containerXPaddingClasses,
|
|
61
57
|
isVisible: finalIsVisible
|
|
62
58
|
}),
|
|
63
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
59
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchResultsContent.SearchResultsContent, {
|
|
64
60
|
searchResultsState,
|
|
65
61
|
productList,
|
|
66
62
|
recommendedProducts,
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { SearchResultsContent } from "../packages/components/dist/components/SearchResultsContent/SearchResultsContent.js";
|
|
2
|
-
import "../packages/components/dist/components/SearchResultsContent/index.js";
|
|
3
|
-
import { SearchResultsFilterModal } from "../packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js";
|
|
4
|
-
import "../packages/components/dist/components/SearchResultsFilterModal/index.js";
|
|
5
|
-
import { SearchResultsToolbar } from "../packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js";
|
|
6
|
-
import "../packages/components/dist/components/SearchResultsToolbar/index.js";
|
|
7
|
-
import { useStickyVisibility } from "../packages/components/dist/util/useStickyVisibility.js";
|
|
8
|
-
import "../packages/components/dist/util/index.js";
|
|
9
1
|
import { withSearchResults } from "./withSearchResults.js";
|
|
10
2
|
import { useEffect } from "react";
|
|
11
3
|
import classNames from "classnames";
|
|
4
|
+
import { SearchResultsContent } from "@envive-ai/react-toolkit/SearchResultsContent";
|
|
5
|
+
import { SearchResultsFilterModal } from "@envive-ai/react-toolkit/SearchResultsFilterModal";
|
|
6
|
+
import { SearchResultsToolbar } from "@envive-ai/react-toolkit/SearchResultsToolbar";
|
|
7
|
+
import { useStickyVisibility } from "@envive-ai/react-toolkit/util";
|
|
12
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
9
|
|
|
14
10
|
//#region src/SearchResults/SearchResults.tsx
|
|
@@ -2,10 +2,10 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
const require_SearchResults = require('./SearchResults.cjs');
|
|
3
3
|
let react = require("react");
|
|
4
4
|
let jotai = require("jotai");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
5
|
let __envive_ai_react_hooks_atoms_globalSearch = require("@envive-ai/react-hooks/atoms/globalSearch");
|
|
7
6
|
let __envive_ai_react_hooks_atoms_search = require("@envive-ai/react-hooks/atoms/search");
|
|
8
7
|
let __envive_ai_react_hooks_hooks_NewOrgConfig = require("@envive-ai/react-hooks/hooks/NewOrgConfig");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
|
|
10
10
|
//#region src/SearchResults/SearchResultsWidget.tsx
|
|
11
11
|
const SearchResultsWidget = () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SearchResults } from "./SearchResults.js";
|
|
2
2
|
import { useEffect, useMemo } from "react";
|
|
3
3
|
import { useSetAtom } from "jotai";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import { isSearchResultsOpenAtom } from "@envive-ai/react-hooks/atoms/globalSearch";
|
|
6
5
|
import { searchSystemAtom } from "@envive-ai/react-hooks/atoms/search";
|
|
7
6
|
import { useNewOrgConfig } from "@envive-ai/react-hooks/hooks/NewOrgConfig";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/SearchResults/SearchResultsWidget.tsx
|
|
10
10
|
const SearchResultsWidget = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
2
|
let __envive_ai_react_hooks_hooks_Search = require("@envive-ai/react-hooks/hooks/Search");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
|
|
5
5
|
//#region src/SearchResults/withSearchResults.tsx
|
|
6
6
|
function withSearchResults(Component) {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_Typography = require('../packages/components/dist/components/Typography/Typography.cjs');
|
|
3
|
-
require('../packages/components/dist/components/Typography/index.cjs');
|
|
4
2
|
const require_AiSearchBold = require('../packages/icons/dist/AiSearchBold.cjs');
|
|
5
3
|
const require_AiSearchThin = require('../packages/icons/dist/AiSearchThin.cjs');
|
|
6
4
|
let react = require("react");
|
|
@@ -8,6 +6,7 @@ react = require_rolldown_runtime.__toESM(react);
|
|
|
8
6
|
let classnames = require("classnames");
|
|
9
7
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
10
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let __envive_ai_react_toolkit_Typography = require("@envive-ai/react-toolkit/Typography");
|
|
11
10
|
|
|
12
11
|
//#region src/SearchZeroState/SearchIcon.tsx
|
|
13
12
|
const SEARCH_ENTRYPOINT_BUTTON_TESTID = "spiffy-search-entrypoint-button";
|
|
@@ -36,7 +35,7 @@ const SearchIcon = ({ size = 22, variant = "thin", color = "currentColor", onCli
|
|
|
36
35
|
},
|
|
37
36
|
fill: color,
|
|
38
37
|
strokeWidth: iconStrokeWidth
|
|
39
|
-
}), label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
38
|
+
}), label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_Typography.Typography, {
|
|
40
39
|
variant: "body3",
|
|
41
40
|
className: "spiffy-global-search-text",
|
|
42
41
|
children: label
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Typography } from "../packages/components/dist/components/Typography/Typography.js";
|
|
2
|
-
import "../packages/components/dist/components/Typography/index.js";
|
|
3
1
|
import { AiSearchBold_default } from "../packages/icons/dist/AiSearchBold.js";
|
|
4
2
|
import { AiSearchThin_default } from "../packages/icons/dist/AiSearchThin.js";
|
|
5
3
|
import React from "react";
|
|
6
4
|
import classNames from "classnames";
|
|
7
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Typography } from "@envive-ai/react-toolkit/Typography";
|
|
8
7
|
|
|
9
8
|
//#region src/SearchZeroState/SearchIcon.tsx
|
|
10
9
|
const SEARCH_ENTRYPOINT_BUTTON_TESTID = "spiffy-search-entrypoint-button";
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_Typography = require('../packages/components/dist/components/Typography/Typography.cjs');
|
|
3
|
-
require('../packages/components/dist/components/Typography/index.cjs');
|
|
4
|
-
const require_SuggestionBar = require('../SuggestionBar/SuggestionBar.cjs');
|
|
5
|
-
require('../SuggestionBar/index.cjs');
|
|
6
2
|
const require_Sparkles = require('../packages/icons/dist/Sparkles.cjs');
|
|
7
|
-
const require_searchInputVariants = require('../packages/components/dist/components/SearchInput/searchInputVariants.cjs');
|
|
8
|
-
const require_SearchInput = require('../packages/components/dist/components/SearchInput/SearchInput.cjs');
|
|
9
|
-
const require_SearchInputForm = require('../packages/components/dist/components/SearchInputForm/SearchInputForm.cjs');
|
|
10
|
-
require('../packages/components/dist/components/SearchInputForm/index.cjs');
|
|
11
|
-
require('../packages/components/dist/components/SearchInput/index.cjs');
|
|
12
3
|
const require_IconCloseVariant = require('../packages/icons/dist/IconCloseVariant.cjs');
|
|
4
|
+
const require_SuggestionBar = require('../SuggestionBar/SuggestionBar.cjs');
|
|
5
|
+
require('../SuggestionBar/index.cjs');
|
|
13
6
|
const require_SearchOverlay = require('./SearchOverlay.cjs');
|
|
14
7
|
const require_zeroStateSearchVariants = require('./zeroStateSearchVariants.cjs');
|
|
15
8
|
const require_SearchIcon = require('./SearchIcon.cjs');
|
|
16
9
|
const require_RecommendedProducts = require('./components/RecommendedProducts.cjs');
|
|
17
10
|
let react = require("react");
|
|
18
11
|
react = require_rolldown_runtime.__toESM(react);
|
|
19
|
-
let
|
|
12
|
+
let __envive_ai_react_hooks_hooks_Search = require("@envive-ai/react-hooks/hooks/Search");
|
|
20
13
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
21
14
|
let framer_motion = require("framer-motion");
|
|
22
|
-
let __envive_ai_react_hooks_hooks_Search = require("@envive-ai/react-hooks/hooks/Search");
|
|
23
15
|
let __envive_ai_react_hooks_hooks_AmplitudeOperations = require("@envive-ai/react-hooks/hooks/AmplitudeOperations");
|
|
24
16
|
let __envive_ai_react_hooks_types = require("@envive-ai/react-hooks/types");
|
|
17
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
25
18
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
19
|
+
let __envive_ai_react_toolkit_SearchInputForm = require("@envive-ai/react-toolkit/SearchInputForm");
|
|
20
|
+
let __envive_ai_react_toolkit_SearchInput = require("@envive-ai/react-toolkit/SearchInput");
|
|
21
|
+
let __envive_ai_react_toolkit_Typography = require("@envive-ai/react-toolkit/Typography");
|
|
26
22
|
|
|
27
23
|
//#region src/SearchZeroState/SearchZeroState.tsx
|
|
28
24
|
const SEARCH_ENTRYPOINT_INPUT_TESTID = "spiffy-search-entrypoint-input";
|
|
@@ -36,7 +32,7 @@ const SearchZeroState = ({ widgetConfig, initialIsOpen, entryPointRef }) => {
|
|
|
36
32
|
const { track } = (0, __envive_ai_react_hooks_hooks_AmplitudeOperations.useAmplitudeTracking)();
|
|
37
33
|
const { recommendedProductsHeading, searchOverlayHeading, productCardConfig, merchantShortName, recommendedProducts, searchText, autocompleteResults, focusedIndex, focusedOptionId, shouldShowAutocomplete, onSearchInputChange, onSearchInputFocus, onSearchInputBlur, onKeyDown, onAutocompleteSelect, onSubmitSearch, resetSearch } = searchInput;
|
|
38
34
|
const { overlayBackgroundClasses, sparklesIconColor } = require_zeroStateSearchVariants.searchZeroStateVariantClasses[searchZeroStateVariant && require_zeroStateSearchVariants.searchZeroStateVariantClasses[searchZeroStateVariant] ? searchZeroStateVariant : "backgroundTertiary"];
|
|
39
|
-
const { searchInputIconColor } =
|
|
35
|
+
const { searchInputIconColor } = __envive_ai_react_toolkit_SearchInput.searchInputVariantClasses[searchInputVariant];
|
|
40
36
|
const handleOpen = () => setIsOpen(true);
|
|
41
37
|
const handleClose = () => setIsOpen(false);
|
|
42
38
|
(0, react.useEffect)(() => {
|
|
@@ -67,7 +63,7 @@ const SearchZeroState = ({ widgetConfig, initialIsOpen, entryPointRef }) => {
|
|
|
67
63
|
onClick: handleOpen,
|
|
68
64
|
color: searchInputIconColor
|
|
69
65
|
});
|
|
70
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
66
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchInput.SearchInput, {
|
|
71
67
|
value: "",
|
|
72
68
|
onChange: () => {},
|
|
73
69
|
placeholder: searchBoxPlaceholder,
|
|
@@ -88,7 +84,7 @@ const SearchZeroState = ({ widgetConfig, initialIsOpen, entryPointRef }) => {
|
|
|
88
84
|
className: "spiffy-tw-relative spiffy-tw-mb-4",
|
|
89
85
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
90
86
|
className: "spiffy-tw-flex spiffy-tw-items-center",
|
|
91
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
87
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_Typography.Typography, {
|
|
92
88
|
id: "global-search-title",
|
|
93
89
|
variant: "t3",
|
|
94
90
|
children: searchOverlayHeading
|
|
@@ -97,7 +93,7 @@ const SearchZeroState = ({ widgetConfig, initialIsOpen, entryPointRef }) => {
|
|
|
97
93
|
color: sparklesIconColor,
|
|
98
94
|
stroke: "2px"
|
|
99
95
|
})]
|
|
100
|
-
}), includeSubtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
96
|
+
}), includeSubtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_Typography.Typography, {
|
|
101
97
|
variant: "body2",
|
|
102
98
|
children: "Go ahead, get as specific as you like..."
|
|
103
99
|
})]
|
|
@@ -111,7 +107,7 @@ const SearchZeroState = ({ widgetConfig, initialIsOpen, entryPointRef }) => {
|
|
|
111
107
|
strokeWidth: "2px"
|
|
112
108
|
})
|
|
113
109
|
})] }),
|
|
114
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
110
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchInputForm.SearchInputForm, {
|
|
115
111
|
searchInputRef,
|
|
116
112
|
searchInputVariant,
|
|
117
113
|
searchText,
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import { Typography } from "../packages/components/dist/components/Typography/Typography.js";
|
|
2
|
-
import "../packages/components/dist/components/Typography/index.js";
|
|
3
|
-
import { SuggestionBar } from "../SuggestionBar/SuggestionBar.js";
|
|
4
|
-
import "../SuggestionBar/index.js";
|
|
5
1
|
import { Sparkles_default } from "../packages/icons/dist/Sparkles.js";
|
|
6
|
-
import { searchInputVariantClasses } from "../packages/components/dist/components/SearchInput/searchInputVariants.js";
|
|
7
|
-
import { SearchInput } from "../packages/components/dist/components/SearchInput/SearchInput.js";
|
|
8
|
-
import { SearchInputForm } from "../packages/components/dist/components/SearchInputForm/SearchInputForm.js";
|
|
9
|
-
import "../packages/components/dist/components/SearchInputForm/index.js";
|
|
10
|
-
import "../packages/components/dist/components/SearchInput/index.js";
|
|
11
2
|
import { IconCloseVariant_default } from "../packages/icons/dist/IconCloseVariant.js";
|
|
3
|
+
import { SuggestionBar } from "../SuggestionBar/SuggestionBar.js";
|
|
4
|
+
import "../SuggestionBar/index.js";
|
|
12
5
|
import { SearchOverlay } from "./SearchOverlay.js";
|
|
13
6
|
import { searchZeroStateVariantClasses } from "./zeroStateSearchVariants.js";
|
|
14
7
|
import { SearchIcon } from "./SearchIcon.js";
|
|
15
8
|
import { RecommendedProducts } from "./components/RecommendedProducts.js";
|
|
16
9
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
17
|
-
import {
|
|
10
|
+
import { useSearch } from "@envive-ai/react-hooks/hooks/Search";
|
|
18
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
12
|
import { AnimatePresence, motion } from "framer-motion";
|
|
20
|
-
import { useSearch } from "@envive-ai/react-hooks/hooks/Search";
|
|
21
13
|
import { useAmplitudeTracking } from "@envive-ai/react-hooks/hooks/AmplitudeOperations";
|
|
22
14
|
import { SuggestionBarLocationForMetrics } from "@envive-ai/react-hooks/types";
|
|
15
|
+
import { MessageType, SpiffyWidgets } from "@envive-ai/react-hooks/application/models";
|
|
23
16
|
import { SpiffyMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
17
|
+
import { SearchInputForm } from "@envive-ai/react-toolkit/SearchInputForm";
|
|
18
|
+
import { SearchInput, searchInputVariantClasses } from "@envive-ai/react-toolkit/SearchInput";
|
|
19
|
+
import { Typography } from "@envive-ai/react-toolkit/Typography";
|
|
24
20
|
|
|
25
21
|
//#region src/SearchZeroState/SearchZeroState.tsx
|
|
26
22
|
const SEARCH_ENTRYPOINT_INPUT_TESTID = "spiffy-search-entrypoint-input";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_SearchZeroState = require('./SearchZeroState.cjs');
|
|
3
3
|
let react = require("react");
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
4
|
let __envive_ai_react_hooks_hooks_NewOrgConfig = require("@envive-ai/react-hooks/hooks/NewOrgConfig");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
|
|
7
7
|
//#region src/SearchZeroState/SearchZeroStateWidget.tsx
|
|
8
8
|
const SearchZeroStateWidget = ({ initialIsOpen, widgetConfigId = "searchEntryPointIcon", entryPointRef }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SearchZeroState } from "./SearchZeroState.js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { useNewOrgConfig } from "@envive-ai/react-hooks/hooks/NewOrgConfig";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/SearchZeroState/SearchZeroStateWidget.tsx
|
|
7
7
|
const SearchZeroStateWidget = ({ initialIsOpen, widgetConfigId = "searchEntryPointIcon", entryPointRef }) => {
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_Typography = require('../../packages/components/dist/components/Typography/Typography.cjs');
|
|
3
|
-
require('../../packages/components/dist/components/Typography/index.cjs');
|
|
4
|
-
const require_ProductGrid = require('../../packages/components/dist/components/ProductGrid/ProductGrid.cjs');
|
|
5
|
-
require('../../packages/components/dist/components/ProductGrid/index.cjs');
|
|
6
|
-
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
7
2
|
let classnames = require("classnames");
|
|
8
3
|
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
9
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
5
|
let framer_motion = require("framer-motion");
|
|
11
6
|
let __envive_ai_react_hooks_hooks_AmplitudeOperations = require("@envive-ai/react-hooks/hooks/AmplitudeOperations");
|
|
7
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
12
8
|
let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
|
|
9
|
+
let __envive_ai_react_toolkit_Typography = require("@envive-ai/react-toolkit/Typography");
|
|
10
|
+
let __envive_ai_react_toolkit_ProductGrid = require("@envive-ai/react-toolkit/ProductGrid");
|
|
13
11
|
|
|
14
12
|
//#region src/SearchZeroState/components/RecommendedProducts.tsx
|
|
15
13
|
const RecommendedProducts = ({ retrievedProducts, merchantShortName, productCardConfig = {
|
|
@@ -54,12 +52,12 @@ const RecommendedProducts = ({ retrievedProducts, merchantShortName, productCard
|
|
|
54
52
|
},
|
|
55
53
|
children: [heading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
56
54
|
className: titleContainerClasses,
|
|
57
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
55
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_Typography.Typography, {
|
|
58
56
|
variant: "h1",
|
|
59
57
|
className: "spiffy-tw-text-[--spiffy-colors-text-accent]",
|
|
60
58
|
children: heading
|
|
61
59
|
})
|
|
62
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
60
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_ProductGrid.ProductGrid, {
|
|
63
61
|
productList: retrievedProducts,
|
|
64
62
|
productGridVariant,
|
|
65
63
|
productGridClasses,
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { Typography } from "../../packages/components/dist/components/Typography/Typography.js";
|
|
2
|
-
import "../../packages/components/dist/components/Typography/index.js";
|
|
3
|
-
import { ProductGrid } from "../../packages/components/dist/components/ProductGrid/ProductGrid.js";
|
|
4
|
-
import "../../packages/components/dist/components/ProductGrid/index.js";
|
|
5
|
-
import { ChatElementDisplayLocation } from "@envive-ai/react-hooks/application/models";
|
|
6
1
|
import classNames from "classnames";
|
|
7
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
3
|
import { motion } from "framer-motion";
|
|
9
4
|
import { useAmplitudeTracking } from "@envive-ai/react-hooks/hooks/AmplitudeOperations";
|
|
5
|
+
import { ChatElementDisplayLocation } from "@envive-ai/react-hooks/application/models";
|
|
10
6
|
import { SpiffyMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
|
|
7
|
+
import { Typography } from "@envive-ai/react-toolkit/Typography";
|
|
8
|
+
import { ProductGrid } from "@envive-ai/react-toolkit/ProductGrid";
|
|
11
9
|
|
|
12
10
|
//#region src/SearchZeroState/components/RecommendedProducts.tsx
|
|
13
11
|
const RecommendedProducts = ({ retrievedProducts, merchantShortName, productCardConfig = {
|
|
@@ -6,12 +6,12 @@ const require_SuggestionButtonContainer = require('../SuggestionButtonContainer/
|
|
|
6
6
|
require('../SuggestionButtonContainer/index.cjs');
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let jotai = require("jotai");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
10
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
11
|
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
11
12
|
let __envive_ai_react_hooks_config = require("@envive-ai/react-hooks/config");
|
|
12
13
|
let __envive_ai_react_hooks_hooks_IsSmallScreen = require("@envive-ai/react-hooks/hooks/IsSmallScreen");
|
|
13
14
|
let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
|
|
14
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
15
15
|
|
|
16
16
|
//#region src/SuggestionBar/SuggestionBar.tsx
|
|
17
17
|
var import_dist = require_index.default;
|
|
@@ -3,14 +3,14 @@ import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
|
3
3
|
import { SuggestionButtonContainer } from "../SuggestionButtonContainer/SuggestionButtonContainer.js";
|
|
4
4
|
import "../SuggestionButtonContainer/index.js";
|
|
5
5
|
import { useCallback, useRef } from "react";
|
|
6
|
-
import { useScrollContainer } from "react-indiana-drag-scroll";
|
|
7
6
|
import { useSetAtom } from "jotai";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { MessageRole, MessageType, SpiffyWidgets } from "@envive-ai/react-hooks/application/models";
|
|
9
|
+
import { useScrollContainer } from "react-indiana-drag-scroll";
|
|
9
10
|
import { PerfMetricsEvents, logPerfMetricAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
10
11
|
import { SUGGESTION_BAR_TESTID } from "@envive-ai/react-hooks/config";
|
|
11
12
|
import { useIsSmallScreen } from "@envive-ai/react-hooks/hooks/IsSmallScreen";
|
|
12
13
|
import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
|
|
15
15
|
//#region src/SuggestionBar/SuggestionBar.tsx
|
|
16
16
|
function SuggestionBar({ id, locationForMetrics, buttonTexts, buttonVariation, hoverButtonVariation, boldFirstButton = false, twoRowsOnMobile = false, animationSpeed = "none", buttonBorderRadius = "lg", handleReply, dataTestId }) {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_SuggestionButton = require('../packages/components/dist/components/SuggestionButton/SuggestionButton.cjs');
|
|
3
|
-
require('../packages/components/dist/components/SuggestionButton/index.cjs');
|
|
4
2
|
const require_useHorizontalScrollAnimation = require('../util/useHorizontalScrollAnimation.cjs');
|
|
5
3
|
let react = require("react");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
5
|
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
7
6
|
let __envive_ai_react_hooks_config = require("@envive-ai/react-hooks/config");
|
|
8
7
|
let __envive_ai_react_hooks_hooks_IsSmallScreen = require("@envive-ai/react-hooks/hooks/IsSmallScreen");
|
|
9
8
|
let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
|
|
10
|
-
let
|
|
9
|
+
let __envive_ai_react_toolkit_SuggestionButton = require("@envive-ai/react-toolkit/SuggestionButton");
|
|
11
10
|
|
|
12
11
|
//#region src/SuggestionButtonContainer/SuggestionButtonContainer.tsx
|
|
13
12
|
function ButtonContainer({ children }) {
|
|
@@ -29,7 +28,7 @@ const SuggestionButtonContainer = ({ buttonVariation, hoverButtonVariation, butt
|
|
|
29
28
|
const visibleButtonsSecondRow = buttonTexts.slice(Math.ceil((buttonTexts.length + 1) / 2), buttonTexts.length);
|
|
30
29
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
31
30
|
className: "spiffy-tw-no-scrollbar spiffy-tw-w-full spiffy-tw-overflow-x-scroll spiffy-tw-whitespace-nowrap",
|
|
32
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonContainer, { children: [visibleButtonsFirstRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
31
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonContainer, { children: [visibleButtonsFirstRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SuggestionButton.SuggestionButton, {
|
|
33
32
|
variant: buttonVariation,
|
|
34
33
|
hoverVariant: hoverButtonVariation,
|
|
35
34
|
isDisabled: false,
|
|
@@ -38,7 +37,7 @@ const SuggestionButtonContainer = ({ buttonVariation, hoverButtonVariation, butt
|
|
|
38
37
|
borderRadius: buttonBorderRadius,
|
|
39
38
|
onClick: () => onButtonClick(suggestion),
|
|
40
39
|
dataTestId: __envive_ai_react_hooks_config.SUGGESTION_BAR_BUTTON_TESTID
|
|
41
|
-
}, i)), isAnimated && buttonTexts.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
40
|
+
}, i)), isAnimated && buttonTexts.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SuggestionButton.SuggestionButton, {
|
|
42
41
|
variant: buttonVariation,
|
|
43
42
|
hoverVariant: hoverButtonVariation,
|
|
44
43
|
isDisabled: false,
|
|
@@ -49,7 +48,7 @@ const SuggestionButtonContainer = ({ buttonVariation, hoverButtonVariation, butt
|
|
|
49
48
|
dataTestId: __envive_ai_react_hooks_config.SUGGESTION_BAR_BUTTON_TESTID
|
|
50
49
|
}, `animation-dupe-${i}`))] }), twoRowsOnMobile && isSmallScreen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
51
50
|
className: "spiffy-tw-mt-1.5",
|
|
52
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonContainer, { children: [visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
51
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonContainer, { children: [visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SuggestionButton.SuggestionButton, {
|
|
53
52
|
variant: buttonVariation,
|
|
54
53
|
hoverVariant: hoverButtonVariation,
|
|
55
54
|
isDisabled: false,
|
|
@@ -58,7 +57,7 @@ const SuggestionButtonContainer = ({ buttonVariation, hoverButtonVariation, butt
|
|
|
58
57
|
borderRadius: buttonBorderRadius,
|
|
59
58
|
onClick: () => onButtonClick(suggestion),
|
|
60
59
|
dataTestId: __envive_ai_react_hooks_config.SUGGESTION_BAR_BUTTON_TESTID
|
|
61
|
-
}, i)), isAnimated && visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
60
|
+
}, i)), isAnimated && visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SuggestionButton.SuggestionButton, {
|
|
62
61
|
variant: buttonVariation,
|
|
63
62
|
hoverVariant: hoverButtonVariation,
|
|
64
63
|
isDisabled: false,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { SuggestionButton } from "../packages/components/dist/components/SuggestionButton/SuggestionButton.js";
|
|
2
|
-
import "../packages/components/dist/components/SuggestionButton/index.js";
|
|
3
1
|
import { useHorizontalScrollAnimation } from "../util/useHorizontalScrollAnimation.js";
|
|
4
2
|
import { useRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { SpiffyWidgets } from "@envive-ai/react-hooks/application/models";
|
|
6
5
|
import { SUGGESTION_BAR_BUTTON_TESTID } from "@envive-ai/react-hooks/config";
|
|
7
6
|
import { useIsSmallScreen } from "@envive-ai/react-hooks/hooks/IsSmallScreen";
|
|
8
7
|
import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
|
|
9
|
-
import {
|
|
8
|
+
import { SuggestionButton } from "@envive-ai/react-toolkit/SuggestionButton";
|
|
10
9
|
|
|
11
10
|
//#region src/SuggestionButtonContainer/SuggestionButtonContainer.tsx
|
|
12
11
|
function ButtonContainer({ children }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-widgets",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "React widget library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
"jotai": "^2.15.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
+
"@envive-ai/react-hooks": "*",
|
|
42
|
+
"@envive-ai/react-toolkit": "*",
|
|
41
43
|
"react": ">=18.3.1",
|
|
42
44
|
"react-dom": ">=18.3.1"
|
|
43
45
|
},
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_iconContext = require('./iconContext.cjs');
|
|
3
|
-
let react = require("react");
|
|
4
|
-
react = require_rolldown_runtime.__toESM(react);
|
|
5
|
-
|
|
6
|
-
//#region ../../node_modules/react-icons/lib/iconBase.mjs
|
|
7
|
-
var _excluded = [
|
|
8
|
-
"attr",
|
|
9
|
-
"size",
|
|
10
|
-
"title"
|
|
11
|
-
];
|
|
12
|
-
function _objectWithoutProperties(source, excluded) {
|
|
13
|
-
if (source == null) return {};
|
|
14
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
15
|
-
var key, i;
|
|
16
|
-
if (Object.getOwnPropertySymbols) {
|
|
17
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
18
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
19
|
-
key = sourceSymbolKeys[i];
|
|
20
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
21
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
22
|
-
target[key] = source[key];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return target;
|
|
26
|
-
}
|
|
27
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
28
|
-
if (source == null) return {};
|
|
29
|
-
var target = {};
|
|
30
|
-
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
31
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
32
|
-
target[key] = source[key];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
}
|
|
36
|
-
function _extends() {
|
|
37
|
-
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
38
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
39
|
-
var source = arguments[i];
|
|
40
|
-
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
41
|
-
}
|
|
42
|
-
return target;
|
|
43
|
-
};
|
|
44
|
-
return _extends.apply(this, arguments);
|
|
45
|
-
}
|
|
46
|
-
function ownKeys(e, r) {
|
|
47
|
-
var t = Object.keys(e);
|
|
48
|
-
if (Object.getOwnPropertySymbols) {
|
|
49
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
50
|
-
r && (o = o.filter(function(r$1) {
|
|
51
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
52
|
-
})), t.push.apply(t, o);
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
}
|
|
56
|
-
function _objectSpread(e) {
|
|
57
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
58
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
59
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
60
|
-
_defineProperty(e, r$1, t[r$1]);
|
|
61
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
62
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return e;
|
|
66
|
-
}
|
|
67
|
-
function _defineProperty(obj, key, value) {
|
|
68
|
-
key = _toPropertyKey(key);
|
|
69
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
70
|
-
value,
|
|
71
|
-
enumerable: true,
|
|
72
|
-
configurable: true,
|
|
73
|
-
writable: true
|
|
74
|
-
});
|
|
75
|
-
else obj[key] = value;
|
|
76
|
-
return obj;
|
|
77
|
-
}
|
|
78
|
-
function _toPropertyKey(t) {
|
|
79
|
-
var i = _toPrimitive(t, "string");
|
|
80
|
-
return "symbol" == typeof i ? i : i + "";
|
|
81
|
-
}
|
|
82
|
-
function _toPrimitive(t, r) {
|
|
83
|
-
if ("object" != typeof t || !t) return t;
|
|
84
|
-
var e = t[Symbol.toPrimitive];
|
|
85
|
-
if (void 0 !== e) {
|
|
86
|
-
var i = e.call(t, r || "default");
|
|
87
|
-
if ("object" != typeof i) return i;
|
|
88
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
89
|
-
}
|
|
90
|
-
return ("string" === r ? String : Number)(t);
|
|
91
|
-
}
|
|
92
|
-
function Tree2Element(tree) {
|
|
93
|
-
return tree && tree.map((node, i) => /* @__PURE__ */ react.default.createElement(node.tag, _objectSpread({ key: i }, node.attr), Tree2Element(node.child)));
|
|
94
|
-
}
|
|
95
|
-
function GenIcon(data) {
|
|
96
|
-
return (props) => /* @__PURE__ */ react.default.createElement(IconBase, _extends({ attr: _objectSpread({}, data.attr) }, props), Tree2Element(data.child));
|
|
97
|
-
}
|
|
98
|
-
function IconBase(props) {
|
|
99
|
-
var elem = (conf) => {
|
|
100
|
-
var { attr, size, title } = props, svgProps = _objectWithoutProperties(props, _excluded);
|
|
101
|
-
var computedSize = size || conf.size || "1em";
|
|
102
|
-
var className;
|
|
103
|
-
if (conf.className) className = conf.className;
|
|
104
|
-
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
105
|
-
return /* @__PURE__ */ react.default.createElement("svg", _extends({
|
|
106
|
-
stroke: "currentColor",
|
|
107
|
-
fill: "currentColor",
|
|
108
|
-
strokeWidth: "0"
|
|
109
|
-
}, conf.attr, attr, svgProps, {
|
|
110
|
-
className,
|
|
111
|
-
style: _objectSpread(_objectSpread({ color: props.color || conf.color }, conf.style), props.style),
|
|
112
|
-
height: computedSize,
|
|
113
|
-
width: computedSize,
|
|
114
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
115
|
-
}), title && /* @__PURE__ */ react.default.createElement("title", null, title), props.children);
|
|
116
|
-
};
|
|
117
|
-
return require_iconContext.IconContext !== void 0 ? /* @__PURE__ */ react.default.createElement(require_iconContext.IconContext.Consumer, null, (conf) => elem(conf)) : elem(require_iconContext.DefaultContext);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
//#endregion
|
|
121
|
-
exports.GenIcon = GenIcon;
|