@envive-ai/react-toolkit 0.1.11 → 0.1.13
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/Accordion/index.cjs +3 -3
- package/dist/Accordion/index.d.cts +2 -2
- package/dist/Accordion/index.d.ts +2 -2
- package/dist/Accordion/index.js +3 -3
- package/dist/{Accordion-DBZpiQe7.cjs → Accordion-D9gO9_y3.cjs} +1 -1
- package/dist/{Accordion-Cp3Hx2zm.js → Accordion-ZEdp99Ph.js} +1 -1
- package/dist/AppliedFiltersScrollbar/index.cjs +25 -27
- package/dist/AppliedFiltersScrollbar/index.d.cts +2 -2
- package/dist/AppliedFiltersScrollbar/index.d.ts +2 -2
- package/dist/AppliedFiltersScrollbar/index.js +25 -27
- package/dist/ButtonBase/index.cjs +3 -3
- package/dist/ButtonBase/index.d.cts +2 -3
- package/dist/ButtonBase/index.d.ts +2 -3
- package/dist/ButtonBase/index.js +3 -3
- package/dist/{ButtonBase-BAf-nlCm.js → ButtonBase-DgRupM53.js} +3 -3
- package/dist/{ButtonBase-Do88ndKa.cjs → ButtonBase-DrIwVGTR.cjs} +3 -3
- package/dist/DynamicFiltersScrollbar/index.cjs +23 -25
- package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
- package/dist/DynamicFiltersScrollbar/index.d.ts +2 -2
- package/dist/DynamicFiltersScrollbar/index.js +23 -25
- package/dist/DynamicFiltersScrollbar-B1j53y2q.cjs +81 -0
- package/dist/DynamicFiltersScrollbar-D7WYp6x9.js +66 -0
- package/dist/FilterScrollbar/index.cjs +3 -3
- package/dist/FilterScrollbar/index.d.cts +3 -3
- package/dist/FilterScrollbar/index.d.ts +3 -3
- package/dist/FilterScrollbar/index.js +3 -3
- package/dist/Headline/index.cjs +2 -2
- package/dist/Headline/index.d.cts +2 -2
- package/dist/Headline/index.d.ts +2 -2
- package/dist/Headline/index.js +2 -2
- package/dist/{Headline-DNEWF8ly.js → Headline-COv0Jbn8.js} +1 -1
- package/dist/{Headline-DTT4RSv2.cjs → Headline-Cp79THVF.cjs} +1 -1
- package/dist/ImageWithFallback/index.d.cts +2 -2
- package/dist/ImageWithFallback/index.d.ts +2 -2
- package/dist/ModalSheet/index.cjs +1 -1
- package/dist/ModalSheet/index.d.cts +2 -2
- package/dist/ModalSheet/index.d.ts +2 -2
- package/dist/ModalSheet/index.js +1 -1
- package/dist/{ModalSheet-CZd5pssv.js → ModalSheet-01pxpy_K.js} +5 -3
- package/dist/{ModalSheet-CXZgyZ4a.cjs → ModalSheet-Csz8HIxs.cjs} +7 -5
- package/dist/ProductCard/index.cjs +4 -4
- package/dist/ProductCard/index.d.cts +1 -1
- package/dist/ProductCard/index.d.ts +1 -1
- package/dist/ProductCard/index.js +4 -4
- package/dist/{ProductCard-D-lyh8uV.js → ProductCard-CNwmHggx.js} +33 -33
- package/dist/{ProductCard-F49krjHk.cjs → ProductCard-EmdDy2af.cjs} +35 -35
- package/dist/ProductGrid/index.cjs +5 -5
- package/dist/ProductGrid/index.d.cts +4 -8
- package/dist/ProductGrid/index.d.ts +4 -8
- package/dist/ProductGrid/index.js +5 -5
- package/dist/{ProductGrid-QeoaIfcq.cjs → ProductGrid-CMoomZLc.cjs} +3 -7
- package/dist/{ProductGrid-FIf5wFQx.js → ProductGrid-nmWSp0qX.js} +3 -7
- package/dist/RadioButton/index.cjs +3 -3
- package/dist/RadioButton/index.d.cts +5 -3
- package/dist/RadioButton/index.d.ts +5 -3
- package/dist/RadioButton/index.js +3 -3
- package/dist/{RadioButton-DZ6QXkrN.cjs → RadioButton-BdKJRzLM.cjs} +17 -10
- package/dist/{RadioButton-Bf68dZl7.js → RadioButton-S5dALI2f.js} +18 -11
- package/dist/RadioButtonGroup/index.cjs +4 -4
- package/dist/RadioButtonGroup/index.d.cts +2 -2
- package/dist/RadioButtonGroup/index.d.ts +2 -2
- package/dist/RadioButtonGroup/index.js +4 -4
- package/dist/{RadioButtonGroup-8k7hkJYB.js → RadioButtonGroup-BipNsoHL.js} +2 -1
- package/dist/{RadioButtonGroup-Dc_n5amh.cjs → RadioButtonGroup-TAJMA1j_.cjs} +2 -1
- package/dist/SearchAutocomplete/index.cjs +56 -2
- package/dist/SearchAutocomplete/index.js +49 -1
- package/dist/SearchFilter/index.cjs +9 -9
- package/dist/SearchFilter/index.d.cts +4 -4
- package/dist/SearchFilter/index.d.ts +4 -4
- package/dist/SearchFilter/index.js +9 -9
- package/dist/{SearchFilter-BtLKnFMm.cjs → SearchFilter-BcLc0TMq.cjs} +27 -17
- package/dist/{SearchFilter-BOwErEyI.js → SearchFilter-w-0s2YVu.js} +27 -17
- package/dist/SearchInput/index.cjs +96 -6
- package/dist/SearchInput/index.d.cts +1 -1
- package/dist/SearchInput/index.d.ts +2 -2
- package/dist/SearchInput/index.js +88 -4
- package/dist/SearchInputForm/index.cjs +0 -39
- package/dist/SearchInputForm/index.d.cts +2 -2
- package/dist/SearchInputForm/index.d.ts +2 -2
- package/dist/SearchInputForm/index.js +1 -37
- package/dist/SearchResultsContent/index.cjs +36 -39
- package/dist/SearchResultsContent/index.d.cts +5 -7
- package/dist/SearchResultsContent/index.d.ts +5 -7
- package/dist/SearchResultsContent/index.js +35 -38
- package/dist/SearchResultsFilterSidebar/index.cjs +11 -11
- package/dist/SearchResultsFilterSidebar/index.d.cts +1 -1
- package/dist/SearchResultsFilterSidebar/index.d.ts +1 -1
- package/dist/SearchResultsFilterSidebar/index.js +11 -11
- package/dist/SearchResultsStates/index.cjs +10 -10
- package/dist/SearchResultsStates/index.d.cts +6 -8
- package/dist/SearchResultsStates/index.d.ts +6 -8
- package/dist/SearchResultsStates/index.js +10 -10
- package/dist/{SearchResultsStates-CB5k1xkK.js → SearchResultsStates-DlZz14yy.js} +8 -10
- package/dist/{SearchResultsStates-DywK7vvp.cjs → SearchResultsStates-DwcPrsdd.cjs} +8 -10
- package/dist/SparkleAnimation/index.cjs +1 -1
- package/dist/SparkleAnimation/index.d.cts +2 -2
- package/dist/SparkleAnimation/index.d.ts +2 -2
- package/dist/SparkleAnimation/index.js +1 -1
- package/dist/{SparkleAnimation-Edzqyb48.cjs → SparkleAnimation-CvGlWUqv.cjs} +0 -1
- package/dist/{SparkleAnimation-AM4XoegD.js → SparkleAnimation-paLhSu5E.js} +0 -1
- package/dist/Spinner/index.d.cts +2 -2
- package/dist/Spinner/index.d.ts +2 -2
- package/dist/SuggestionButton/index.cjs +3 -3
- package/dist/SuggestionButton/index.d.cts +2 -2
- package/dist/SuggestionButton/index.d.ts +2 -2
- package/dist/SuggestionButton/index.js +3 -3
- package/dist/Text/index.cjs +2 -2
- package/dist/Text/index.d.cts +2 -2
- package/dist/Text/index.d.ts +3 -3
- package/dist/Text/index.js +2 -2
- package/dist/{Text-Bod4OMPk.js → Text-BLzNhX4H.js} +1 -1
- package/dist/{Text-MQjxqgZZ.cjs → Text-DllCE9_D.cjs} +1 -1
- package/dist/TextInput/index.cjs +2 -2
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +2 -2
- package/dist/{TextInput-BVPdz7e8.js → TextInput-DmsOxxPN.js} +1 -1
- package/dist/{TextInput-CnXhppYn.cjs → TextInput-HMW0hxLI.cjs} +1 -1
- package/dist/ToggleButton/index.cjs +3 -3
- package/dist/ToggleButton/index.d.cts +2 -2
- package/dist/ToggleButton/index.d.ts +2 -2
- package/dist/ToggleButton/index.js +3 -3
- package/dist/{ToggleButton-D90UO4qv.cjs → ToggleButton-DblAj4Cd.cjs} +1 -1
- package/dist/{ToggleButton-BKRR_-69.js → ToggleButton-r7Y7Kzzo.js} +1 -1
- package/dist/index-BKvXn5sj.d.ts +4 -0
- package/dist/{index-Cl4d_pDw.d.ts → index-Br1B7Jta.d.cts} +2 -3
- package/dist/{index-1x_hMlEf.d.cts → index-DADHwW6M.d.ts} +5 -9
- package/dist/{index-QMTPxKA9.d.ts → index-DDp-fLgm.d.cts} +5 -9
- package/dist/{index-CgjZdKpL.d.cts → index-Dh8rcWev.d.ts} +2 -3
- package/dist/index-W1wCDiw_.d.cts +4 -0
- package/dist/{searchFilterSidebarVariants-CDFCHVeZ.js → searchFilterSidebarVariants-J0FJ8pck.js} +1 -1
- package/dist/{searchFilterSidebarVariants-CtmuwSBQ.cjs → searchFilterSidebarVariants-kkTjYEIF.cjs} +1 -1
- package/dist/{textVariantClasses-Dgz7Zaql.cjs → textVariantClasses-CBre7vXv.cjs} +5 -7
- package/dist/{textVariantClasses-D77TGEy1.js → textVariantClasses-CRrTb43V.js} +5 -7
- package/package.json +3 -7
- package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +25 -27
- package/src/components/ButtonBase/ButtonBase.tsx +1 -2
- package/src/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.tsx +26 -28
- package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +25 -27
- package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +26 -28
- package/src/components/ModalSheet/ModalSheet.tsx +1 -1
- package/src/components/ModalSheet/common/closeIcon.tsx +2 -2
- package/src/components/ModalSheet/desktop/index.tsx +1 -0
- package/src/components/ModalSheet/mobile/index.tsx +1 -0
- package/src/components/ModalSheet/mobile/mobileHeader.tsx +1 -1
- package/src/components/ProductCard/ProductCard.tsx +5 -28
- package/src/components/ProductGrid/ProductGrid.tsx +3 -11
- package/src/components/RadioButton/RadioButton.tsx +15 -6
- package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +1 -0
- package/src/components/SearchFilter/SearchFilter.tsx +2 -2
- package/src/components/SearchFilter/SearchFilterFooter.tsx +1 -1
- package/src/components/SearchFilter/SearchFilterHeader.tsx +6 -1
- package/src/components/SearchFilter/SearchFilterItem.tsx +17 -3
- package/src/components/SearchFilter/useHasFilterStateChanged.tsx +1 -0
- package/src/components/SearchFilter/utils.ts +4 -6
- package/src/components/SearchInput/SearchInput.tsx +2 -2
- package/src/components/SearchInputForm/index.ts +0 -1
- package/src/components/SearchResultsContent/SearchResultsContent.tsx +33 -38
- package/src/components/SearchResultsFilterSidebar/SearchResultsFilter.tsx +2 -3
- package/src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +1 -1
- package/src/components/SearchResultsStates/SearchResultsGrid.tsx +4 -8
- package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +3 -3
- package/src/components/SparkleAnimation/SparkleAnimation.tsx +0 -1
- package/src/components/Spinner/Spinner.tsx +29 -14
- package/src/components/SuggestionButton/SuggestionButton.tsx +1 -1
- package/src/components/SuggestionButton/types.ts +1 -1
- package/src/components/Text/textVariantClasses.ts +12 -10
- package/src/components/TextInput/TextInput.tsx +1 -0
- package/src/util/camelCasedPropertiesDeep.ts +22 -22
- package/src/util/internal.ts +4 -2
- package/src/util/splitWords.ts +35 -31
- package/dist/DynamicFiltersScrollbar-C4kdNSJ9.js +0 -70
- package/dist/DynamicFiltersScrollbar-CVw1PINp.cjs +0 -85
- package/dist/SearchAutocomplete-C6omCGJp.js +0 -51
- package/dist/SearchAutocomplete-Cofuvwwp.cjs +0 -62
- package/dist/SearchInput-BBaYEwkR.js +0 -89
- package/dist/SearchInput-BTNvgrIa.cjs +0 -106
- package/dist/Styles/index.cjs +0 -274
- package/dist/Styles/index.d.cts +0 -258
- package/dist/Styles/index.d.ts +0 -258
- package/dist/Styles/index.js +0 -274
- package/dist/index-H_9LhS_1.d.cts +0 -36
- package/dist/index-gfYBM7Ul.d.ts +0 -36
- package/src/components/ModalSheet/common/enviveWatermark.tsx +0 -30
- package/src/components/Styles/EnviveTailwindPreset.ts +0 -285
- package/src/components/Styles/index.ts +0 -2
- package/tailwind-preset.js +0 -3
- /package/dist/{colorsConfig-DFL3mBwB.cjs → colorsConfig-B3-SMUSx.cjs} +0 -0
- /package/dist/{colorsConfig-5Yf4nrEe.js → colorsConfig-DZ-GSPWy.js} +0 -0
- /package/dist/{textVariantClasses-kyZtL8F5.d.ts → textVariantClasses-C8OCWZAw.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProductCard } from "./ProductCard-
|
|
1
|
+
import { ProductCard } from "./ProductCard-CNwmHggx.js";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@ const productGridVariantClasses = {
|
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/components/ProductGrid/ProductGrid.tsx
|
|
25
|
-
const ProductGrid = ({ productList, productGridVariant, productGridClasses, productCardConfig, merchantShortName,
|
|
25
|
+
const ProductGrid = ({ productList, productGridVariant, productGridClasses, productCardConfig, merchantShortName, cardsGrowWithContainer = true }) => {
|
|
26
26
|
const { productCardVariant, productCardHoverVariant, productCardLayoutVariant, productCardImageAspectRatio, zoomOnHover } = productGridVariantClasses[productGridVariant];
|
|
27
27
|
const cardContainerClasses = classNames({
|
|
28
28
|
"spiffy-tw-w-full": cardsGrowWithContainer,
|
|
@@ -30,7 +30,7 @@ const ProductGrid = ({ productList, productGridVariant, productGridClasses, prod
|
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ jsx("div", {
|
|
32
32
|
className: productGridClasses,
|
|
33
|
-
children: productList.map((product
|
|
33
|
+
children: productList.map((product) => {
|
|
34
34
|
const camelCasedProduct = product;
|
|
35
35
|
return /* @__PURE__ */ jsx("div", {
|
|
36
36
|
className: cardContainerClasses,
|
|
@@ -38,21 +38,17 @@ const ProductGrid = ({ productList, productGridVariant, productGridClasses, prod
|
|
|
38
38
|
productCardConfig,
|
|
39
39
|
merchantShortName,
|
|
40
40
|
imageUrl: camelCasedProduct.imageUrl,
|
|
41
|
-
searchResponseId,
|
|
42
|
-
productResponseId: camelCasedProduct.responseId,
|
|
43
41
|
title: camelCasedProduct.title,
|
|
44
42
|
url: camelCasedProduct.url,
|
|
45
43
|
originalPrice: camelCasedProduct.originalPrice,
|
|
46
44
|
salePrice: camelCasedProduct.salePrice,
|
|
47
45
|
averageRating: camelCasedProduct.averageRating,
|
|
48
46
|
numberReviews: camelCasedProduct.numberReviews,
|
|
49
|
-
cardDisplayLocation,
|
|
50
47
|
layoutVariant: productCardLayoutVariant,
|
|
51
48
|
variant: productCardVariant,
|
|
52
49
|
hoverVariant: productCardHoverVariant,
|
|
53
50
|
zoomOnHover,
|
|
54
51
|
aspectRatio: productCardImageAspectRatio,
|
|
55
|
-
clickPosition: index,
|
|
56
52
|
growWithContainer: cardsGrowWithContainer
|
|
57
53
|
}, camelCasedProduct.id)
|
|
58
54
|
}, camelCasedProduct.id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require('../textVariantClasses-
|
|
2
|
-
require('../Text-
|
|
1
|
+
require('../textVariantClasses-CBre7vXv.cjs');
|
|
2
|
+
require('../Text-DllCE9_D.cjs');
|
|
3
3
|
require('../Text-C8t_iEj6.cjs');
|
|
4
|
-
const require_RadioButton = require('../RadioButton-
|
|
4
|
+
const require_RadioButton = require('../RadioButton-BdKJRzLM.cjs');
|
|
5
5
|
|
|
6
6
|
exports.RadioButton = require_RadioButton.RadioButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
2
|
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/RadioButton/RadioButton.d.ts
|
|
@@ -13,6 +13,7 @@ interface RadioButtonProps extends TestProps {
|
|
|
13
13
|
uncheckedBorderColor?: string;
|
|
14
14
|
checked?: boolean;
|
|
15
15
|
onChange: (value: string) => void;
|
|
16
|
+
id: any;
|
|
16
17
|
}
|
|
17
18
|
declare const RadioButton: ({
|
|
18
19
|
isDisabled,
|
|
@@ -24,7 +25,8 @@ declare const RadioButton: ({
|
|
|
24
25
|
hoverColor,
|
|
25
26
|
uncheckedBorderColor,
|
|
26
27
|
checked,
|
|
27
|
-
onChange
|
|
28
|
-
|
|
28
|
+
onChange,
|
|
29
|
+
id
|
|
30
|
+
}: RadioButtonProps) => react_jsx_runtime18.JSX.Element;
|
|
29
31
|
//#endregion
|
|
30
32
|
export { RadioButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
2
2
|
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/RadioButton/RadioButton.d.ts
|
|
@@ -13,6 +13,7 @@ interface RadioButtonProps extends TestProps {
|
|
|
13
13
|
uncheckedBorderColor?: string;
|
|
14
14
|
checked?: boolean;
|
|
15
15
|
onChange: (value: string) => void;
|
|
16
|
+
id: any;
|
|
16
17
|
}
|
|
17
18
|
declare const RadioButton: ({
|
|
18
19
|
isDisabled,
|
|
@@ -24,7 +25,8 @@ declare const RadioButton: ({
|
|
|
24
25
|
hoverColor,
|
|
25
26
|
uncheckedBorderColor,
|
|
26
27
|
checked,
|
|
27
|
-
onChange
|
|
28
|
-
|
|
28
|
+
onChange,
|
|
29
|
+
id
|
|
30
|
+
}: RadioButtonProps) => react_jsx_runtime11.JSX.Element;
|
|
29
31
|
//#endregion
|
|
30
32
|
export { RadioButton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../textVariantClasses-
|
|
2
|
-
import "../Text-
|
|
1
|
+
import "../textVariantClasses-CRrTb43V.js";
|
|
2
|
+
import "../Text-BLzNhX4H.js";
|
|
3
3
|
import "../Text-BMsncrpY.js";
|
|
4
|
-
import { RadioButton } from "../RadioButton-
|
|
4
|
+
import { RadioButton } from "../RadioButton-S5dALI2f.js";
|
|
5
5
|
|
|
6
6
|
export { RadioButton };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_Text = require('./Text-
|
|
2
|
+
const require_Text = require('./Text-DllCE9_D.cjs');
|
|
3
3
|
let react = require("react");
|
|
4
4
|
react = require_chunk.__toESM(react);
|
|
5
5
|
let classnames = require("classnames");
|
|
@@ -8,7 +8,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
9
9
|
|
|
10
10
|
//#region src/components/RadioButton/RadioButton.tsx
|
|
11
|
-
const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "medium", fillColor, hoverColor, uncheckedBorderColor, checked = false, onChange }) => {
|
|
11
|
+
const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "medium", fillColor, hoverColor, uncheckedBorderColor, checked = false, onChange, id }) => {
|
|
12
12
|
const [isHovered, setIsHovered] = (0, react.useState)(false);
|
|
13
13
|
const containerClassName = (0, classnames.default)({
|
|
14
14
|
"spiffy-tw-flex": true,
|
|
@@ -28,14 +28,20 @@ const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "
|
|
|
28
28
|
const handleChange = () => {
|
|
29
29
|
if (!isDisabled) onChange(value);
|
|
30
30
|
};
|
|
31
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
33
|
+
className: containerClassName,
|
|
34
|
+
onMouseEnter: () => !isDisabled && setIsHovered(true),
|
|
35
|
+
onMouseLeave: () => setIsHovered(false),
|
|
36
|
+
"aria-label": label,
|
|
37
|
+
htmlFor: id,
|
|
38
|
+
children: label
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
36
41
|
className: "spiffy-tw-relative",
|
|
37
42
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
38
43
|
type: "radio",
|
|
44
|
+
id,
|
|
39
45
|
name,
|
|
40
46
|
value,
|
|
41
47
|
checked,
|
|
@@ -61,11 +67,12 @@ const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "
|
|
|
61
67
|
fill: getFillColor()
|
|
62
68
|
})]
|
|
63
69
|
})]
|
|
64
|
-
}),
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
65
72
|
variant: "body3",
|
|
66
73
|
children: label
|
|
67
|
-
})
|
|
68
|
-
});
|
|
74
|
+
})
|
|
75
|
+
] });
|
|
69
76
|
};
|
|
70
77
|
|
|
71
78
|
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Text } from "./Text-
|
|
1
|
+
import { Text } from "./Text-BLzNhX4H.js";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/RadioButton/RadioButton.tsx
|
|
7
|
-
const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "medium", fillColor, hoverColor, uncheckedBorderColor, checked = false, onChange }) => {
|
|
7
|
+
const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "medium", fillColor, hoverColor, uncheckedBorderColor, checked = false, onChange, id }) => {
|
|
8
8
|
const [isHovered, setIsHovered] = useState(false);
|
|
9
9
|
const containerClassName = classNames({
|
|
10
10
|
"spiffy-tw-flex": true,
|
|
@@ -24,14 +24,20 @@ const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "
|
|
|
24
24
|
const handleChange = () => {
|
|
25
25
|
if (!isDisabled) onChange(value);
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */ jsxs(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx("label", {
|
|
29
|
+
className: containerClassName,
|
|
30
|
+
onMouseEnter: () => !isDisabled && setIsHovered(true),
|
|
31
|
+
onMouseLeave: () => setIsHovered(false),
|
|
32
|
+
"aria-label": label,
|
|
33
|
+
htmlFor: id,
|
|
34
|
+
children: label
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ jsxs("div", {
|
|
32
37
|
className: "spiffy-tw-relative",
|
|
33
38
|
children: [/* @__PURE__ */ jsx("input", {
|
|
34
39
|
type: "radio",
|
|
40
|
+
id,
|
|
35
41
|
name,
|
|
36
42
|
value,
|
|
37
43
|
checked,
|
|
@@ -57,11 +63,12 @@ const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "
|
|
|
57
63
|
fill: getFillColor()
|
|
58
64
|
})]
|
|
59
65
|
})]
|
|
60
|
-
}),
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ jsx(Text, {
|
|
61
68
|
variant: "body3",
|
|
62
69
|
children: label
|
|
63
|
-
})
|
|
64
|
-
});
|
|
70
|
+
})
|
|
71
|
+
] });
|
|
65
72
|
};
|
|
66
73
|
|
|
67
74
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
require('../textVariantClasses-
|
|
2
|
-
require('../Text-
|
|
1
|
+
require('../textVariantClasses-CBre7vXv.cjs');
|
|
2
|
+
require('../Text-DllCE9_D.cjs');
|
|
3
3
|
require('../Text-C8t_iEj6.cjs');
|
|
4
|
-
require('../RadioButton-
|
|
5
|
-
const require_RadioButtonGroup = require('../RadioButtonGroup-
|
|
4
|
+
require('../RadioButton-BdKJRzLM.cjs');
|
|
5
|
+
const require_RadioButtonGroup = require('../RadioButtonGroup-TAJMA1j_.cjs');
|
|
6
6
|
|
|
7
7
|
exports.RadioButtonGroup = require_RadioButtonGroup.RadioButtonGroup;
|
|
8
8
|
exports.SPIFFY_RADIO_BUTTON_GROUP_CLASS = require_RadioButtonGroup.SPIFFY_RADIO_BUTTON_GROUP_CLASS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
2
|
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/RadioButtonGroup/RadioButtonGroup.d.ts
|
|
@@ -31,6 +31,6 @@ declare const RadioButtonGroup: ({
|
|
|
31
31
|
gap,
|
|
32
32
|
textButtonGap,
|
|
33
33
|
onChange
|
|
34
|
-
}: RadioButtonGroupProps) =>
|
|
34
|
+
}: RadioButtonGroupProps) => react_jsx_runtime10.JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/RadioButtonGroup/RadioButtonGroup.d.ts
|
|
@@ -31,6 +31,6 @@ declare const RadioButtonGroup: ({
|
|
|
31
31
|
gap,
|
|
32
32
|
textButtonGap,
|
|
33
33
|
onChange
|
|
34
|
-
}: RadioButtonGroupProps) =>
|
|
34
|
+
}: RadioButtonGroupProps) => react_jsx_runtime0.JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../textVariantClasses-
|
|
2
|
-
import "../Text-
|
|
1
|
+
import "../textVariantClasses-CRrTb43V.js";
|
|
2
|
+
import "../Text-BLzNhX4H.js";
|
|
3
3
|
import "../Text-BMsncrpY.js";
|
|
4
|
-
import "../RadioButton-
|
|
5
|
-
import { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS } from "../RadioButtonGroup-
|
|
4
|
+
import "../RadioButton-S5dALI2f.js";
|
|
5
|
+
import { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS } from "../RadioButtonGroup-BipNsoHL.js";
|
|
6
6
|
|
|
7
7
|
export { RadioButtonGroup, SPIFFY_RADIO_BUTTON_GROUP_CLASS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RadioButton } from "./RadioButton-
|
|
1
|
+
import { RadioButton } from "./RadioButton-S5dALI2f.js";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -19,6 +19,7 @@ const RadioButtonGroup = ({ name, options, fillColor, hoverColor, uncheckedBorde
|
|
|
19
19
|
return /* @__PURE__ */ jsx("div", {
|
|
20
20
|
className: groupClassName,
|
|
21
21
|
children: options.map((option) => /* @__PURE__ */ jsx(RadioButton, {
|
|
22
|
+
id: option.value,
|
|
22
23
|
name,
|
|
23
24
|
value: option.value,
|
|
24
25
|
fillColor,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_RadioButton = require('./RadioButton-
|
|
2
|
+
const require_RadioButton = require('./RadioButton-BdKJRzLM.cjs');
|
|
3
3
|
let classnames = require("classnames");
|
|
4
4
|
classnames = require_chunk.__toESM(classnames);
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -22,6 +22,7 @@ const RadioButtonGroup = ({ name, options, fillColor, hoverColor, uncheckedBorde
|
|
|
22
22
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23
23
|
className: groupClassName,
|
|
24
24
|
children: options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RadioButton.RadioButton, {
|
|
25
|
+
id: option.value,
|
|
25
26
|
name,
|
|
26
27
|
value: option.value,
|
|
27
28
|
fillColor,
|
|
@@ -1,3 +1,57 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
+
let framer_motion = require("framer-motion");
|
|
3
|
+
framer_motion = require_chunk.__toESM(framer_motion);
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_chunk.__toESM(react);
|
|
6
|
+
let classnames = require("classnames");
|
|
7
|
+
classnames = require_chunk.__toESM(classnames);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
10
|
+
let __envive_ai_react_icons_OutlinedStar = require("@envive-ai/react-icons/OutlinedStar");
|
|
11
|
+
__envive_ai_react_icons_OutlinedStar = require_chunk.__toESM(__envive_ai_react_icons_OutlinedStar);
|
|
2
12
|
|
|
3
|
-
|
|
13
|
+
//#region src/components/SearchAutocomplete/SearchAutocomplete.tsx
|
|
14
|
+
const SearchAutocomplete = ({ id, results, focusedIndex, onSuggestionSelect, iconColor }) => {
|
|
15
|
+
if (results.length === 0) return null;
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
|
|
17
|
+
className: "spiffy-tw-h-full",
|
|
18
|
+
initial: {
|
|
19
|
+
opacity: 0,
|
|
20
|
+
y: -10
|
|
21
|
+
},
|
|
22
|
+
animate: {
|
|
23
|
+
opacity: 1,
|
|
24
|
+
y: 0
|
|
25
|
+
},
|
|
26
|
+
exit: {
|
|
27
|
+
opacity: 0,
|
|
28
|
+
y: -10
|
|
29
|
+
},
|
|
30
|
+
transition: { duration: .2 },
|
|
31
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
32
|
+
id,
|
|
33
|
+
role: "listbox",
|
|
34
|
+
className: "spiffy-tw-mt-4 spiffy-tw-space-y-2",
|
|
35
|
+
children: results.map((result, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
36
|
+
id: `option-${index}`,
|
|
37
|
+
role: "option",
|
|
38
|
+
"aria-selected": index === focusedIndex,
|
|
39
|
+
className: (0, classnames.default)("spiffy-tw-flex spiffy-tw-items-center spiffy-tw-cursor-pointer spiffy-tw-py-1", { "spiffy-tw-bg-neutral-200": index === focusedIndex }, "hover:spiffy-tw-bg-neutral-100"),
|
|
40
|
+
onClick: () => onSuggestionSelect(result, index),
|
|
41
|
+
onKeyDown: (event) => {
|
|
42
|
+
if (event.key === "Enter" || event.keyCode === 13) onSuggestionSelect(result, index);
|
|
43
|
+
},
|
|
44
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_OutlinedStar.default, {
|
|
45
|
+
className: "spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-2",
|
|
46
|
+
fill: iconColor
|
|
47
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48
|
+
className: "spiffy-tw-font-bold",
|
|
49
|
+
children: result
|
|
50
|
+
})]
|
|
51
|
+
}, index))
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.SearchAutocomplete = SearchAutocomplete;
|
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { motion } from "framer-motion";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import OutlinedStar from "@envive-ai/react-icons/OutlinedStar";
|
|
2
6
|
|
|
7
|
+
//#region src/components/SearchAutocomplete/SearchAutocomplete.tsx
|
|
8
|
+
const SearchAutocomplete = ({ id, results, focusedIndex, onSuggestionSelect, iconColor }) => {
|
|
9
|
+
if (results.length === 0) return null;
|
|
10
|
+
return /* @__PURE__ */ jsx(motion.div, {
|
|
11
|
+
className: "spiffy-tw-h-full",
|
|
12
|
+
initial: {
|
|
13
|
+
opacity: 0,
|
|
14
|
+
y: -10
|
|
15
|
+
},
|
|
16
|
+
animate: {
|
|
17
|
+
opacity: 1,
|
|
18
|
+
y: 0
|
|
19
|
+
},
|
|
20
|
+
exit: {
|
|
21
|
+
opacity: 0,
|
|
22
|
+
y: -10
|
|
23
|
+
},
|
|
24
|
+
transition: { duration: .2 },
|
|
25
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
26
|
+
id,
|
|
27
|
+
role: "listbox",
|
|
28
|
+
className: "spiffy-tw-mt-4 spiffy-tw-space-y-2",
|
|
29
|
+
children: results.map((result, index) => /* @__PURE__ */ jsxs("li", {
|
|
30
|
+
id: `option-${index}`,
|
|
31
|
+
role: "option",
|
|
32
|
+
"aria-selected": index === focusedIndex,
|
|
33
|
+
className: classNames("spiffy-tw-flex spiffy-tw-items-center spiffy-tw-cursor-pointer spiffy-tw-py-1", { "spiffy-tw-bg-neutral-200": index === focusedIndex }, "hover:spiffy-tw-bg-neutral-100"),
|
|
34
|
+
onClick: () => onSuggestionSelect(result, index),
|
|
35
|
+
onKeyDown: (event) => {
|
|
36
|
+
if (event.key === "Enter" || event.keyCode === 13) onSuggestionSelect(result, index);
|
|
37
|
+
},
|
|
38
|
+
children: [/* @__PURE__ */ jsx(OutlinedStar, {
|
|
39
|
+
className: "spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-2",
|
|
40
|
+
fill: iconColor
|
|
41
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "spiffy-tw-font-bold",
|
|
43
|
+
children: result
|
|
44
|
+
})]
|
|
45
|
+
}, index))
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
3
51
|
export { SearchAutocomplete };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
require('../textVariantClasses-
|
|
2
|
-
require('../Text-
|
|
1
|
+
require('../textVariantClasses-CBre7vXv.cjs');
|
|
2
|
+
require('../Text-DllCE9_D.cjs');
|
|
3
3
|
require('../Text-C8t_iEj6.cjs');
|
|
4
|
-
require('../Accordion-
|
|
5
|
-
require('../ButtonBase-
|
|
4
|
+
require('../Accordion-D9gO9_y3.cjs');
|
|
5
|
+
require('../ButtonBase-DrIwVGTR.cjs');
|
|
6
6
|
require('../ButtonBase-BIXx56hq.cjs');
|
|
7
|
-
require('../ModalSheet-
|
|
8
|
-
require('../RadioButton-
|
|
9
|
-
require('../RadioButtonGroup-
|
|
10
|
-
const require_SearchFilter = require('../SearchFilter-
|
|
11
|
-
require('../ToggleButton-
|
|
7
|
+
require('../ModalSheet-Csz8HIxs.cjs');
|
|
8
|
+
require('../RadioButton-BdKJRzLM.cjs');
|
|
9
|
+
require('../RadioButtonGroup-TAJMA1j_.cjs');
|
|
10
|
+
const require_SearchFilter = require('../SearchFilter-BcLc0TMq.cjs');
|
|
11
|
+
require('../ToggleButton-DblAj4Cd.cjs');
|
|
12
12
|
|
|
13
13
|
exports.SearchFilter = require_SearchFilter.SearchFilter;
|
|
14
14
|
exports.SearchFilterHeader = require_SearchFilter.SearchFilterHeader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
2
2
|
import { CloseIconVariant, SearchFilterDatum, SearchFilterItemDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/SearchFilter/types.d.ts
|
|
@@ -55,7 +55,7 @@ declare const SearchFilter: ({
|
|
|
55
55
|
radioButtonHoverColor,
|
|
56
56
|
radioButtonUncheckedBorderColor,
|
|
57
57
|
filterCloseIconVariant
|
|
58
|
-
}: SearchFilterProps) =>
|
|
58
|
+
}: SearchFilterProps) => react_jsx_runtime6.JSX.Element;
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/components/SearchFilter/SearchFilterHeader.d.ts
|
|
61
61
|
declare const SearchFilterHeader: ({
|
|
@@ -63,7 +63,7 @@ declare const SearchFilterHeader: ({
|
|
|
63
63
|
productCount,
|
|
64
64
|
headerClassName,
|
|
65
65
|
filterCloseIconVariant
|
|
66
|
-
}: SearchFilterHeaderProps) =>
|
|
66
|
+
}: SearchFilterHeaderProps) => react_jsx_runtime6.JSX.Element;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/components/SearchFilter/SearchFilterItem.d.ts
|
|
69
69
|
declare const SearchFilterItem: ({
|
|
@@ -72,6 +72,6 @@ declare const SearchFilterItem: ({
|
|
|
72
72
|
radioButtonFillColor,
|
|
73
73
|
radioButtonHoverColor,
|
|
74
74
|
radioButtonUncheckedBorderColor
|
|
75
|
-
}: SearchFilterItemProps) =>
|
|
75
|
+
}: SearchFilterItemProps) => react_jsx_runtime6.JSX.Element;
|
|
76
76
|
//#endregion
|
|
77
77
|
export { SearchFilter, SearchFilterHeader, SearchFilterItem };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
2
|
import { CloseIconVariant, SearchFilterDatum, SearchFilterItemDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/SearchFilter/types.d.ts
|
|
@@ -55,7 +55,7 @@ declare const SearchFilter: ({
|
|
|
55
55
|
radioButtonHoverColor,
|
|
56
56
|
radioButtonUncheckedBorderColor,
|
|
57
57
|
filterCloseIconVariant
|
|
58
|
-
}: SearchFilterProps) =>
|
|
58
|
+
}: SearchFilterProps) => react_jsx_runtime18.JSX.Element;
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/components/SearchFilter/SearchFilterHeader.d.ts
|
|
61
61
|
declare const SearchFilterHeader: ({
|
|
@@ -63,7 +63,7 @@ declare const SearchFilterHeader: ({
|
|
|
63
63
|
productCount,
|
|
64
64
|
headerClassName,
|
|
65
65
|
filterCloseIconVariant
|
|
66
|
-
}: SearchFilterHeaderProps) =>
|
|
66
|
+
}: SearchFilterHeaderProps) => react_jsx_runtime18.JSX.Element;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/components/SearchFilter/SearchFilterItem.d.ts
|
|
69
69
|
declare const SearchFilterItem: ({
|
|
@@ -72,6 +72,6 @@ declare const SearchFilterItem: ({
|
|
|
72
72
|
radioButtonFillColor,
|
|
73
73
|
radioButtonHoverColor,
|
|
74
74
|
radioButtonUncheckedBorderColor
|
|
75
|
-
}: SearchFilterItemProps) =>
|
|
75
|
+
}: SearchFilterItemProps) => react_jsx_runtime18.JSX.Element;
|
|
76
76
|
//#endregion
|
|
77
77
|
export { SearchFilter, SearchFilterHeader, SearchFilterItem };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../textVariantClasses-
|
|
2
|
-
import "../Text-
|
|
1
|
+
import "../textVariantClasses-CRrTb43V.js";
|
|
2
|
+
import "../Text-BLzNhX4H.js";
|
|
3
3
|
import "../Text-BMsncrpY.js";
|
|
4
|
-
import "../Accordion-
|
|
5
|
-
import "../ButtonBase-
|
|
4
|
+
import "../Accordion-ZEdp99Ph.js";
|
|
5
|
+
import "../ButtonBase-DgRupM53.js";
|
|
6
6
|
import "../ButtonBase-0NN6wmX-.js";
|
|
7
|
-
import "../ModalSheet-
|
|
8
|
-
import "../RadioButton-
|
|
9
|
-
import "../RadioButtonGroup-
|
|
10
|
-
import { SearchFilter, SearchFilterHeader, SearchFilterItem } from "../SearchFilter-
|
|
11
|
-
import "../ToggleButton-
|
|
7
|
+
import "../ModalSheet-01pxpy_K.js";
|
|
8
|
+
import "../RadioButton-S5dALI2f.js";
|
|
9
|
+
import "../RadioButtonGroup-BipNsoHL.js";
|
|
10
|
+
import { SearchFilter, SearchFilterHeader, SearchFilterItem } from "../SearchFilter-w-0s2YVu.js";
|
|
11
|
+
import "../ToggleButton-r7Y7Kzzo.js";
|
|
12
12
|
|
|
13
13
|
export { SearchFilter, SearchFilterHeader, SearchFilterItem };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_Text = require('./Text-
|
|
3
|
-
const require_Accordion = require('./Accordion-
|
|
4
|
-
const require_ButtonBase = require('./ButtonBase-
|
|
5
|
-
const require_ModalSheet = require('./ModalSheet-
|
|
6
|
-
const require_RadioButtonGroup = require('./RadioButtonGroup-
|
|
7
|
-
const require_ToggleButton = require('./ToggleButton-
|
|
2
|
+
const require_Text = require('./Text-DllCE9_D.cjs');
|
|
3
|
+
const require_Accordion = require('./Accordion-D9gO9_y3.cjs');
|
|
4
|
+
const require_ButtonBase = require('./ButtonBase-DrIwVGTR.cjs');
|
|
5
|
+
const require_ModalSheet = require('./ModalSheet-Csz8HIxs.cjs');
|
|
6
|
+
const require_RadioButtonGroup = require('./RadioButtonGroup-TAJMA1j_.cjs');
|
|
7
|
+
const require_ToggleButton = require('./ToggleButton-DblAj4Cd.cjs');
|
|
8
8
|
let react = require("react");
|
|
9
9
|
react = require_chunk.__toESM(react);
|
|
10
10
|
let classnames = require("classnames");
|
|
@@ -28,6 +28,8 @@ const SearchFilterHeader = ({ closeModal, productCount, headerClassName, filterC
|
|
|
28
28
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
29
29
|
onClick: closeModal,
|
|
30
30
|
className: "spiffy-tw-p-2",
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-label": "Open Filter Menu",
|
|
31
33
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
32
34
|
xmlns: "http://www.w3.org/2000/svg",
|
|
33
35
|
width: "14",
|
|
@@ -68,15 +70,11 @@ const useHasFilterStateChanged = (filters, isOpen) => {
|
|
|
68
70
|
|
|
69
71
|
//#endregion
|
|
70
72
|
//#region src/components/SearchFilter/utils.ts
|
|
71
|
-
const getSelectedFilterItemsCount = (filter) =>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (filter.filterId === "sort") return acc;
|
|
77
|
-
return acc + getSelectedFilterItemsCount(filter);
|
|
78
|
-
}, 0);
|
|
79
|
-
};
|
|
73
|
+
const getSelectedFilterItemsCount = (filter) => filter.items.filter((item) => item.isSelected).length;
|
|
74
|
+
const getTotalSelectedFilterItemsCount = (filters) => filters.reduce((acc, filter) => {
|
|
75
|
+
if (filter.filterId === "sort") return acc;
|
|
76
|
+
return acc + getSelectedFilterItemsCount(filter);
|
|
77
|
+
}, 0);
|
|
80
78
|
|
|
81
79
|
//#endregion
|
|
82
80
|
//#region src/components/SearchFilter/SearchFilterFooter.tsx
|
|
@@ -242,9 +240,21 @@ const SearchFilter = ({ filters, productCount, selectFilterItem, clearAllFilters
|
|
|
242
240
|
const SearchFilterItem = ({ filterItem, onSelectFilterItem, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor }) => {
|
|
243
241
|
const { displayName, isSelected } = filterItem;
|
|
244
242
|
const radioClasses = (0, classnames.default)("spiffy-tw-w-4 spiffy-tw-h-4 spiffy-tw-rounded-full spiffy-tw-border-2", "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-center", radioButtonUncheckedBorderColor, radioButtonHoverColor, { [radioButtonFillColor]: isSelected });
|
|
245
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
246
|
-
|
|
243
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
244
|
+
type: "button",
|
|
245
|
+
role: "option",
|
|
246
|
+
"aria-selected": isSelected,
|
|
247
|
+
className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-py-2",
|
|
247
248
|
onClick: () => onSelectFilterItem(filterItem),
|
|
249
|
+
onKeyDown: (event) => {
|
|
250
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
onSelectFilterItem(filterItem);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
onKeyUp: (event) => {
|
|
256
|
+
if (event.key === " ") event.preventDefault();
|
|
257
|
+
},
|
|
248
258
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
249
259
|
variant: "body3",
|
|
250
260
|
children: displayName
|