@envive-ai/react-widgets 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SearchResults/SearchResults.cjs +8 -12
- package/dist/SearchResults/SearchResults.js +4 -8
- package/dist/SearchResults/SearchResultsWidget.cjs +1 -1
- package/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- 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 +10 -14
- package/dist/SearchZeroState/SearchZeroState.js +5 -9
- package/dist/SearchZeroState/SearchZeroStateWidget.cjs +1 -1
- package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- 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/SearchZeroState/index.d.cts +2 -1
- package/dist/SearchZeroState/index.d.ts +2 -1
- package/dist/SearchZeroState/types.d.cts +2 -2
- package/dist/SearchZeroState/types.d.ts +2 -2
- package/dist/SuggestionBar/SuggestionBar.cjs +1 -1
- package/dist/SuggestionBar/SuggestionBar.d.cts +1 -1
- package/dist/SuggestionBar/SuggestionBar.d.ts +3 -3
- package/dist/SuggestionBar/SuggestionBar.js +2 -2
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +6 -7
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.js +2 -3
- package/dist/SuggestionButtonContainer/types.d.cts +2 -2
- package/dist/SuggestionButtonContainer/types.d.ts +2 -2
- package/dist/hooks/dist/contexts/types.d.cts +52 -0
- package/dist/hooks/dist/types/test-types.d.cts +8 -0
- package/dist/packages/hooks/dist/contexts/types.d.ts +52 -0
- package/dist/packages/hooks/dist/types/test-types.d.ts +8 -0
- 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,74 +0,0 @@
|
|
|
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;
|
|
@@ -1,72 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const require_RadioButton = require('./RadioButton.cjs');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { RadioButton } from "./RadioButton.js";
|
|
@@ -1,42 +0,0 @@
|
|
|
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;
|
|
@@ -1,39 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const require_RadioButtonGroup = require('./RadioButtonGroup.cjs');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS } from "./RadioButtonGroup.js";
|
package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.cjs
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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;
|
|
@@ -1,51 +0,0 @@
|
|
|
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 };
|
|
@@ -1,72 +0,0 @@
|
|
|
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;
|
|
@@ -1,69 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const require_SearchAutocomplete = require('./SearchAutocomplete.cjs');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { SearchAutocomplete } from "./SearchAutocomplete.js";
|
|
@@ -1,134 +0,0 @@
|
|
|
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;
|