@envive-ai/react-toolkit 0.1.13 → 0.2.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/Accordion/index.d.cts +2 -2
- package/dist/Accordion/index.d.ts +2 -2
- package/dist/AnimatedChevron/index.cjs +3 -0
- package/dist/AnimatedChevron/index.d.cts +11 -0
- package/dist/AnimatedChevron/index.d.ts +11 -0
- package/dist/AnimatedChevron/index.js +3 -0
- package/dist/AnimatedChevron-CwuXgR2r.js +29 -0
- package/dist/AnimatedChevron-e_UzWBl0.cjs +37 -0
- package/dist/AppliedFiltersScrollbar/index.d.cts +2 -2
- package/dist/AppliedFiltersScrollbar/index.d.ts +2 -2
- package/dist/ButtonBase/index.cjs +2 -2
- package/dist/ButtonBase/index.d.cts +3 -3
- package/dist/ButtonBase/index.d.ts +2 -2
- package/dist/ButtonBase/index.js +2 -2
- package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
- package/dist/DynamicFiltersScrollbar/index.d.ts +2 -2
- package/dist/FilterScrollbar/index.cjs +1 -1
- package/dist/FilterScrollbar/index.d.cts +3 -3
- package/dist/FilterScrollbar/index.d.ts +3 -3
- package/dist/FilterScrollbar/index.js +1 -1
- package/dist/Headline/index.cjs +1 -1
- package/dist/Headline/index.d.cts +2 -2
- package/dist/Headline/index.d.ts +2 -2
- package/dist/Headline/index.js +1 -1
- package/dist/ImageWithFallback/index.cjs +1 -1
- package/dist/ImageWithFallback/index.d.cts +2 -2
- package/dist/ImageWithFallback/index.d.ts +2 -2
- package/dist/ImageWithFallback/index.js +1 -1
- package/dist/ModalSheet/index.cjs +2 -1
- package/dist/ModalSheet/index.d.cts +2 -2
- package/dist/ModalSheet/index.d.ts +2 -2
- package/dist/ModalSheet/index.js +2 -1
- package/dist/{ModalSheet-Csz8HIxs.cjs → ModalSheet-DwnbbFh7.cjs} +2 -26
- package/dist/{ModalSheet-01pxpy_K.js → ModalSheet-sMg44OLz.js} +2 -26
- 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-EmdDy2af.cjs → ProductCard-BDz80MCQ.cjs} +3 -3
- package/dist/{ProductCard-CNwmHggx.js → ProductCard-CqhNJShq.js} +3 -3
- package/dist/ProductGrid/index.cjs +5 -5
- package/dist/ProductGrid/index.d.cts +3 -3
- package/dist/ProductGrid/index.d.ts +3 -3
- package/dist/ProductGrid/index.js +5 -5
- package/dist/{ProductGrid-nmWSp0qX.js → ProductGrid-8n4XgcMr.js} +1 -1
- package/dist/{ProductGrid-CMoomZLc.cjs → ProductGrid-RRcdkY5J.cjs} +1 -1
- package/dist/RadioButton/index.cjs +1 -1
- package/dist/RadioButton/index.d.cts +2 -2
- package/dist/RadioButton/index.d.ts +2 -2
- package/dist/RadioButton/index.js +1 -1
- package/dist/RadioButtonGroup/index.cjs +2 -2
- package/dist/RadioButtonGroup/index.d.cts +2 -2
- package/dist/RadioButtonGroup/index.d.ts +2 -2
- package/dist/RadioButtonGroup/index.js +2 -2
- package/dist/{RadioButtonGroup-BipNsoHL.js → RadioButtonGroup-B7EuiEP1.js} +1 -1
- package/dist/{RadioButtonGroup-TAJMA1j_.cjs → RadioButtonGroup-ReQqakpS.cjs} +1 -1
- package/dist/SearchAutocomplete/index.cjs +2 -56
- package/dist/SearchAutocomplete/index.js +1 -49
- package/dist/SearchAutocomplete-BMNYZiJL.js +51 -0
- package/dist/SearchAutocomplete-BmHdijOv.cjs +62 -0
- package/dist/SearchFilter/index.cjs +12 -8
- package/dist/SearchFilter/index.d.cts +20 -6
- package/dist/SearchFilter/index.d.ts +20 -6
- package/dist/SearchFilter/index.js +9 -8
- package/dist/{SearchFilter-w-0s2YVu.js → SearchFilter-C8mgj84o.js} +5 -5
- package/dist/{SearchFilter-BcLc0TMq.cjs → SearchFilter-FrdHPM5O.cjs} +22 -4
- package/dist/SearchInput/index.cjs +5 -95
- package/dist/SearchInput/index.d.cts +3 -2
- package/dist/SearchInput/index.d.ts +4 -3
- package/dist/SearchInput/index.js +3 -87
- package/dist/SearchInput--x9NTMTb.cjs +106 -0
- package/dist/SearchInput-IBq83nqF.js +89 -0
- package/dist/SearchInputForm/index.cjs +39 -0
- package/dist/SearchInputForm/index.d.cts +34 -2
- package/dist/SearchInputForm/index.d.ts +34 -2
- package/dist/SearchInputForm/index.js +37 -1
- package/dist/SearchResultsContent/index.cjs +10 -10
- package/dist/SearchResultsContent/index.d.cts +4 -4
- package/dist/SearchResultsContent/index.d.ts +4 -4
- package/dist/SearchResultsContent/index.js +10 -10
- package/dist/SearchResultsFilterSidebar/index.cjs +10 -9
- package/dist/SearchResultsFilterSidebar/index.d.cts +1 -1
- package/dist/SearchResultsFilterSidebar/index.d.ts +1 -1
- package/dist/SearchResultsFilterSidebar/index.js +10 -9
- package/dist/SearchResultsStates/index.cjs +10 -10
- package/dist/SearchResultsStates/index.d.cts +6 -6
- package/dist/SearchResultsStates/index.d.ts +6 -6
- package/dist/SearchResultsStates/index.js +10 -10
- package/dist/{SearchResultsStates-DlZz14yy.js → SearchResultsStates-D7dM35qq.js} +5 -5
- package/dist/{SearchResultsStates-DwcPrsdd.cjs → SearchResultsStates-nlaPbkj3.cjs} +5 -5
- 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/Spinner/index.cjs +1 -1
- package/dist/Spinner/index.d.cts +2 -2
- package/dist/Spinner/index.d.ts +2 -2
- package/dist/Spinner/index.js +1 -1
- package/dist/SuggestionButton/index.cjs +1 -1
- package/dist/SuggestionButton/index.d.cts +2 -2
- package/dist/SuggestionButton/index.d.ts +2 -2
- package/dist/SuggestionButton/index.js +1 -1
- package/dist/Text/index.d.cts +2 -2
- package/dist/Text/index.d.ts +3 -3
- package/dist/TextInput/index.cjs +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/ToggleButton/index.cjs +1 -1
- package/dist/ToggleButton/index.d.cts +2 -2
- package/dist/ToggleButton/index.d.ts +2 -2
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{index-DDp-fLgm.d.cts → index-B9WeFNlO.d.cts} +5 -5
- package/dist/{index-Dh8rcWev.d.ts → index-CLGe_Pam.d.cts} +2 -2
- package/dist/{index-Br1B7Jta.d.cts → index-PSzeHU2s.d.ts} +2 -2
- package/dist/{searchFilterSidebarVariants-J0FJ8pck.js → searchFilterSidebarVariants-B05f5SD5.js} +1 -1
- package/dist/{searchFilterSidebarVariants-kkTjYEIF.cjs → searchFilterSidebarVariants-NQhqq-NT.cjs} +1 -1
- package/dist/types-BhGjnuWx.d.cts +4 -0
- package/dist/types-CTOdb0G0.d.ts +4 -0
- package/package.json +6 -2
- package/src/atoms/search/types.ts +1 -5
- package/src/components/AnimatedChevron/index.ts +1 -0
- package/src/components/SearchFilter/index.ts +4 -2
- package/src/components/SearchInput/SearchInput.tsx +1 -1
- package/src/components/SearchInput/searchInputVariants.ts +1 -1
- package/src/components/SearchInputForm/SearchInputForm.tsx +1 -1
- package/src/components/SearchInputForm/index.ts +1 -1
- package/dist/index-BKvXn5sj.d.ts +0 -4
- package/dist/index-W1wCDiw_.d.cts +0 -4
- package/src/components/SearchInputForm/types.ts +0 -1
- /package/dist/{ButtonBase-DgRupM53.js → ButtonBase-BJ0qXMWD.js} +0 -0
- /package/dist/{ButtonBase-0NN6wmX-.js → ButtonBase-BktteD9c.js} +0 -0
- /package/dist/{ButtonBase-BIXx56hq.cjs → ButtonBase-Cb6Iec6f.cjs} +0 -0
- /package/dist/{ButtonBase-DrIwVGTR.cjs → ButtonBase-VIv-tn7H.cjs} +0 -0
- /package/dist/{DynamicFiltersScrollbar-B1j53y2q.cjs → DynamicFiltersScrollbar-HCYZjI14.cjs} +0 -0
- /package/dist/{DynamicFiltersScrollbar-D7WYp6x9.js → DynamicFiltersScrollbar-O0ai3cIG.js} +0 -0
- /package/dist/{Headline-Cp79THVF.cjs → Headline-CKJmd2w4.cjs} +0 -0
- /package/dist/{Headline-COv0Jbn8.js → Headline-DtjTB4xS.js} +0 -0
- /package/dist/{ImageWithFallback-DqxjwO3i.js → ImageWithFallback-CbYsD1_a.js} +0 -0
- /package/dist/{ImageWithFallback-Cx-KNi-D.cjs → ImageWithFallback-Km9h16Vz.cjs} +0 -0
- /package/dist/{RadioButton-BdKJRzLM.cjs → RadioButton-BWnaUI8o.cjs} +0 -0
- /package/dist/{RadioButton-S5dALI2f.js → RadioButton-CG8_M0hY.js} +0 -0
- /package/dist/{SparkleAnimation-CvGlWUqv.cjs → SparkleAnimation-D1aZE-7A.cjs} +0 -0
- /package/dist/{SparkleAnimation-paLhSu5E.js → SparkleAnimation-DtWkXmkN.js} +0 -0
- /package/dist/{Spinner-CjGLIRgs.js → Spinner-bg6jb_ks.js} +0 -0
- /package/dist/{Spinner-DFor2Szi.cjs → Spinner-rcWX566W.cjs} +0 -0
- /package/dist/{TextInput-DmsOxxPN.js → TextInput-BeHPlVHT.js} +0 -0
- /package/dist/{TextInput-HMW0hxLI.cjs → TextInput-CGs4BY1q.cjs} +0 -0
- /package/dist/{ToggleButton-r7Y7Kzzo.js → ToggleButton-CRiPqTCb.js} +0 -0
- /package/dist/{ToggleButton-DblAj4Cd.cjs → ToggleButton-DfJZ8POQ.cjs} +0 -0
- /package/dist/{colorsConfig-DZ-GSPWy.js → colorsConfig-Ck2jeqWe.js} +0 -0
- /package/dist/{colorsConfig-B3-SMUSx.cjs → colorsConfig-CqCKftuM.cjs} +0 -0
- /package/dist/{index-DADHwW6M.d.ts → index-CeECGrFM.d.ts} +0 -0
- /package/dist/{textVariantClasses-C8OCWZAw.d.ts → textVariantClasses-Bl8SAGwZ.d.ts} +0 -0
|
@@ -1,97 +1,7 @@
|
|
|
1
|
-
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
1
|
require('../textVariantClasses-CBre7vXv.cjs');
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
react = require_chunk.__toESM(react);
|
|
7
|
-
let classnames = require("classnames");
|
|
8
|
-
classnames = require_chunk.__toESM(classnames);
|
|
9
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
-
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
11
|
-
let __envive_ai_react_icons_MagnifyingGlassStarVariant = require("@envive-ai/react-icons/MagnifyingGlassStarVariant");
|
|
12
|
-
__envive_ai_react_icons_MagnifyingGlassStarVariant = require_chunk.__toESM(__envive_ai_react_icons_MagnifyingGlassStarVariant);
|
|
13
|
-
let __envive_ai_react_icons_src_index_js = require("@envive-ai/react-icons/src/index.js");
|
|
14
|
-
__envive_ai_react_icons_src_index_js = require_chunk.__toESM(__envive_ai_react_icons_src_index_js);
|
|
2
|
+
require('../TextInput-CGs4BY1q.cjs');
|
|
3
|
+
require('../colorsConfig-CqCKftuM.cjs');
|
|
4
|
+
const require_SearchInput = require('../SearchInput--x9NTMTb.cjs');
|
|
15
5
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
searchInputIconColor: "transparent",
|
|
19
|
-
searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
|
|
20
|
-
searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
|
|
21
|
-
searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
|
|
22
|
-
autocompleteIconColor: require_colorsConfig.colorVar(require_colorsConfig.ColorNames.BackgroundPrimary),
|
|
23
|
-
searchInputClasses: "spiffy-tw-text-[--spiffy-colors-text-primary] placeholder:spiffy-tw-text-[--spiffy-colors-text-secondary] spiffy-tw-text-[16px] spiffy-tw-font-normal spiffy-tw-leading-[148%] placeholder:spiffy-tw-font-medium placeholder:spiffy-tw-leading-[124%]",
|
|
24
|
-
placeholderVariant: "h2"
|
|
25
|
-
} };
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/components/SearchInput/SearchInput.tsx
|
|
29
|
-
const SearchInput = react.default.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
|
|
30
|
-
const localInputRef = (0, react.useRef)(null);
|
|
31
|
-
const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = searchInputVariantClasses[searchInputVariant];
|
|
32
|
-
(0, react.useImperativeHandle)(ref, () => localInputRef.current, []);
|
|
33
|
-
const magnifyingGlassClassesBase = [
|
|
34
|
-
"spiffy-tw-w-[24px]",
|
|
35
|
-
"spiffy-tw-h-[32px]",
|
|
36
|
-
"spiffy-tw-stroke-width-1",
|
|
37
|
-
"sm:spiffy-tw-w-[32px]"
|
|
38
|
-
];
|
|
39
|
-
const magnifyingGlassClassesInactive = (0, classnames.default)(magnifyingGlassClassesBase);
|
|
40
|
-
const magnifyingGlassClassesActive = (0, classnames.default)([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
|
|
41
|
-
const containerClasses = (0, classnames.default)("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
|
|
42
|
-
const inputClasses = (0, classnames.default)("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
|
|
43
|
-
const closeButtonIconClassName = (0, classnames.default)([
|
|
44
|
-
"spiffy-tw-w-[16px]",
|
|
45
|
-
"spiffy-tw-h-[16px]",
|
|
46
|
-
"sm:spiffy-tw-w-[24px]",
|
|
47
|
-
"sm:spiffy-tw-h-[24px]",
|
|
48
|
-
"spiffy-tw-cursor-pointer",
|
|
49
|
-
closeIconClasses
|
|
50
|
-
]);
|
|
51
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
52
|
-
className: containerClasses,
|
|
53
|
-
"data-testid": dataTestId,
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
56
|
-
className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
|
|
57
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_MagnifyingGlassStarVariant.default, {
|
|
58
|
-
className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
|
|
59
|
-
stroke: iconColor,
|
|
60
|
-
strokeWidth: "1px"
|
|
61
|
-
})
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TextInput.TextInput, {
|
|
64
|
-
value,
|
|
65
|
-
onChange: (event) => onChange(event.target.value),
|
|
66
|
-
onFocus,
|
|
67
|
-
onBlur,
|
|
68
|
-
onKeyDown,
|
|
69
|
-
placeholder,
|
|
70
|
-
className: inputClasses,
|
|
71
|
-
placeholderVariant,
|
|
72
|
-
"aria-label": "Search",
|
|
73
|
-
"aria-autocomplete": "list",
|
|
74
|
-
"aria-expanded": !!suggestions && suggestions.length > 0,
|
|
75
|
-
"aria-controls": "autocomplete-results",
|
|
76
|
-
"aria-activedescendant": ariaActivedescendant,
|
|
77
|
-
borderRadius: "xl",
|
|
78
|
-
borderColorClass: borderColor,
|
|
79
|
-
ref: localInputRef
|
|
80
|
-
}),
|
|
81
|
-
value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
82
|
-
onClick: () => {
|
|
83
|
-
onChange("");
|
|
84
|
-
localInputRef.current?.focus();
|
|
85
|
-
},
|
|
86
|
-
className: "spiffy-tw-absolute spiffy-tw-right-5 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2 spiffy-tw-text-neutral-500 hover:spiffy-tw-text-neutral-700",
|
|
87
|
-
"aria-label": "Clear search input",
|
|
88
|
-
type: "button",
|
|
89
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_index_js.IconClose, { className: closeButtonIconClassName })
|
|
90
|
-
})
|
|
91
|
-
]
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
//#endregion
|
|
96
|
-
exports.SearchInput = SearchInput;
|
|
97
|
-
exports.searchInputVariantClasses = searchInputVariantClasses;
|
|
6
|
+
exports.SearchInput = require_SearchInput.SearchInput;
|
|
7
|
+
exports.searchInputVariantClasses = require_SearchInput.searchInputVariantClasses;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { SearchInputVariant } from "../
|
|
1
|
+
import { SearchInputVariant as SearchInputVariant$1 } from "../types-BhGjnuWx.cjs";
|
|
2
2
|
import { TextStyleVariantMap } from "../textVariantClasses-B0gNjzl4.cjs";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { SearchInputVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
4
5
|
|
|
5
6
|
//#region src/components/SearchInput/SearchInput.d.ts
|
|
6
7
|
interface SearchInputProps {
|
|
@@ -28,6 +29,6 @@ type SearchInputVariantClasses = {
|
|
|
28
29
|
searchInputClasses: string;
|
|
29
30
|
placeholderVariant: keyof typeof TextStyleVariantMap;
|
|
30
31
|
};
|
|
31
|
-
declare const searchInputVariantClasses: Record<SearchInputVariant, SearchInputVariantClasses>;
|
|
32
|
+
declare const searchInputVariantClasses: Record<SearchInputVariant$1, SearchInputVariantClasses>;
|
|
32
33
|
//#endregion
|
|
33
34
|
export { SearchInput, searchInputVariantClasses };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { SearchInputVariant } from "../
|
|
2
|
-
import { TextStyleVariantMap } from "../textVariantClasses-
|
|
1
|
+
import { SearchInputVariant as SearchInputVariant$1 } from "../types-CTOdb0G0.js";
|
|
2
|
+
import { TextStyleVariantMap } from "../textVariantClasses-Bl8SAGwZ.js";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { SearchInputVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
4
5
|
|
|
5
6
|
//#region src/components/SearchInput/SearchInput.d.ts
|
|
6
7
|
interface SearchInputProps {
|
|
@@ -28,6 +29,6 @@ type SearchInputVariantClasses = {
|
|
|
28
29
|
searchInputClasses: string;
|
|
29
30
|
placeholderVariant: keyof typeof TextStyleVariantMap;
|
|
30
31
|
};
|
|
31
|
-
declare const searchInputVariantClasses: Record<SearchInputVariant, SearchInputVariantClasses>;
|
|
32
|
+
declare const searchInputVariantClasses: Record<SearchInputVariant$1, SearchInputVariantClasses>;
|
|
32
33
|
//#endregion
|
|
33
34
|
export { SearchInput, searchInputVariantClasses };
|
|
@@ -1,90 +1,6 @@
|
|
|
1
1
|
import "../textVariantClasses-CRrTb43V.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import MagnifyingGlassStarVariant from "@envive-ai/react-icons/MagnifyingGlassStarVariant";
|
|
8
|
-
import { IconClose } from "@envive-ai/react-icons/src/index.js";
|
|
2
|
+
import "../TextInput-BeHPlVHT.js";
|
|
3
|
+
import "../colorsConfig-Ck2jeqWe.js";
|
|
4
|
+
import { SearchInput, searchInputVariantClasses } from "../SearchInput-IBq83nqF.js";
|
|
9
5
|
|
|
10
|
-
//#region src/components/SearchInput/searchInputVariants.ts
|
|
11
|
-
const searchInputVariantClasses = { standard: {
|
|
12
|
-
searchInputIconColor: "transparent",
|
|
13
|
-
searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
|
|
14
|
-
searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
|
|
15
|
-
searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
|
|
16
|
-
autocompleteIconColor: colorVar(ColorNames.BackgroundPrimary),
|
|
17
|
-
searchInputClasses: "spiffy-tw-text-[--spiffy-colors-text-primary] placeholder:spiffy-tw-text-[--spiffy-colors-text-secondary] spiffy-tw-text-[16px] spiffy-tw-font-normal spiffy-tw-leading-[148%] placeholder:spiffy-tw-font-medium placeholder:spiffy-tw-leading-[124%]",
|
|
18
|
-
placeholderVariant: "h2"
|
|
19
|
-
} };
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/components/SearchInput/SearchInput.tsx
|
|
23
|
-
const SearchInput = React.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
|
|
24
|
-
const localInputRef = useRef(null);
|
|
25
|
-
const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = searchInputVariantClasses[searchInputVariant];
|
|
26
|
-
useImperativeHandle(ref, () => localInputRef.current, []);
|
|
27
|
-
const magnifyingGlassClassesBase = [
|
|
28
|
-
"spiffy-tw-w-[24px]",
|
|
29
|
-
"spiffy-tw-h-[32px]",
|
|
30
|
-
"spiffy-tw-stroke-width-1",
|
|
31
|
-
"sm:spiffy-tw-w-[32px]"
|
|
32
|
-
];
|
|
33
|
-
const magnifyingGlassClassesInactive = classNames(magnifyingGlassClassesBase);
|
|
34
|
-
const magnifyingGlassClassesActive = classNames([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
|
|
35
|
-
const containerClasses = classNames("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
|
|
36
|
-
const inputClasses = classNames("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
|
|
37
|
-
const closeButtonIconClassName = classNames([
|
|
38
|
-
"spiffy-tw-w-[16px]",
|
|
39
|
-
"spiffy-tw-h-[16px]",
|
|
40
|
-
"sm:spiffy-tw-w-[24px]",
|
|
41
|
-
"sm:spiffy-tw-h-[24px]",
|
|
42
|
-
"spiffy-tw-cursor-pointer",
|
|
43
|
-
closeIconClasses
|
|
44
|
-
]);
|
|
45
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
46
|
-
className: containerClasses,
|
|
47
|
-
"data-testid": dataTestId,
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsx("div", {
|
|
50
|
-
className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
|
|
51
|
-
children: /* @__PURE__ */ jsx(MagnifyingGlassStarVariant, {
|
|
52
|
-
className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
|
|
53
|
-
stroke: iconColor,
|
|
54
|
-
strokeWidth: "1px"
|
|
55
|
-
})
|
|
56
|
-
}),
|
|
57
|
-
/* @__PURE__ */ jsx(TextInput, {
|
|
58
|
-
value,
|
|
59
|
-
onChange: (event) => onChange(event.target.value),
|
|
60
|
-
onFocus,
|
|
61
|
-
onBlur,
|
|
62
|
-
onKeyDown,
|
|
63
|
-
placeholder,
|
|
64
|
-
className: inputClasses,
|
|
65
|
-
placeholderVariant,
|
|
66
|
-
"aria-label": "Search",
|
|
67
|
-
"aria-autocomplete": "list",
|
|
68
|
-
"aria-expanded": !!suggestions && suggestions.length > 0,
|
|
69
|
-
"aria-controls": "autocomplete-results",
|
|
70
|
-
"aria-activedescendant": ariaActivedescendant,
|
|
71
|
-
borderRadius: "xl",
|
|
72
|
-
borderColorClass: borderColor,
|
|
73
|
-
ref: localInputRef
|
|
74
|
-
}),
|
|
75
|
-
value && /* @__PURE__ */ jsx("button", {
|
|
76
|
-
onClick: () => {
|
|
77
|
-
onChange("");
|
|
78
|
-
localInputRef.current?.focus();
|
|
79
|
-
},
|
|
80
|
-
className: "spiffy-tw-absolute spiffy-tw-right-5 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2 spiffy-tw-text-neutral-500 hover:spiffy-tw-text-neutral-700",
|
|
81
|
-
"aria-label": "Clear search input",
|
|
82
|
-
type: "button",
|
|
83
|
-
children: /* @__PURE__ */ jsx(IconClose, { className: closeButtonIconClassName })
|
|
84
|
-
})
|
|
85
|
-
]
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
//#endregion
|
|
90
6
|
export { SearchInput, searchInputVariantClasses };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
const require_TextInput = require('./TextInput-CGs4BY1q.cjs');
|
|
3
|
+
const require_colorsConfig = require('./colorsConfig-CqCKftuM.cjs');
|
|
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_MagnifyingGlassStarVariant = require("@envive-ai/react-icons/MagnifyingGlassStarVariant");
|
|
11
|
+
__envive_ai_react_icons_MagnifyingGlassStarVariant = require_chunk.__toESM(__envive_ai_react_icons_MagnifyingGlassStarVariant);
|
|
12
|
+
let __envive_ai_react_icons_src_index_js = require("@envive-ai/react-icons/src/index.js");
|
|
13
|
+
__envive_ai_react_icons_src_index_js = require_chunk.__toESM(__envive_ai_react_icons_src_index_js);
|
|
14
|
+
|
|
15
|
+
//#region src/components/SearchInput/searchInputVariants.ts
|
|
16
|
+
const searchInputVariantClasses = { standard: {
|
|
17
|
+
searchInputIconColor: "transparent",
|
|
18
|
+
searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
|
|
19
|
+
searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
|
|
20
|
+
searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
|
|
21
|
+
autocompleteIconColor: require_colorsConfig.colorVar(require_colorsConfig.ColorNames.BackgroundPrimary),
|
|
22
|
+
searchInputClasses: "spiffy-tw-text-[--spiffy-colors-text-primary] placeholder:spiffy-tw-text-[--spiffy-colors-text-secondary] spiffy-tw-text-[16px] spiffy-tw-font-normal spiffy-tw-leading-[148%] placeholder:spiffy-tw-font-medium placeholder:spiffy-tw-leading-[124%]",
|
|
23
|
+
placeholderVariant: "h2"
|
|
24
|
+
} };
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/SearchInput/SearchInput.tsx
|
|
28
|
+
const SearchInput = react.default.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
|
|
29
|
+
const localInputRef = (0, react.useRef)(null);
|
|
30
|
+
const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = searchInputVariantClasses[searchInputVariant];
|
|
31
|
+
(0, react.useImperativeHandle)(ref, () => localInputRef.current, []);
|
|
32
|
+
const magnifyingGlassClassesBase = [
|
|
33
|
+
"spiffy-tw-w-[24px]",
|
|
34
|
+
"spiffy-tw-h-[32px]",
|
|
35
|
+
"spiffy-tw-stroke-width-1",
|
|
36
|
+
"sm:spiffy-tw-w-[32px]"
|
|
37
|
+
];
|
|
38
|
+
const magnifyingGlassClassesInactive = (0, classnames.default)(magnifyingGlassClassesBase);
|
|
39
|
+
const magnifyingGlassClassesActive = (0, classnames.default)([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
|
|
40
|
+
const containerClasses = (0, classnames.default)("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
|
|
41
|
+
const inputClasses = (0, classnames.default)("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
|
|
42
|
+
const closeButtonIconClassName = (0, classnames.default)([
|
|
43
|
+
"spiffy-tw-w-[16px]",
|
|
44
|
+
"spiffy-tw-h-[16px]",
|
|
45
|
+
"sm:spiffy-tw-w-[24px]",
|
|
46
|
+
"sm:spiffy-tw-h-[24px]",
|
|
47
|
+
"spiffy-tw-cursor-pointer",
|
|
48
|
+
closeIconClasses
|
|
49
|
+
]);
|
|
50
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
51
|
+
className: containerClasses,
|
|
52
|
+
"data-testid": dataTestId,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
55
|
+
className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
|
|
56
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_MagnifyingGlassStarVariant.default, {
|
|
57
|
+
className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
|
|
58
|
+
stroke: iconColor,
|
|
59
|
+
strokeWidth: "1px"
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TextInput.TextInput, {
|
|
63
|
+
value,
|
|
64
|
+
onChange: (event) => onChange(event.target.value),
|
|
65
|
+
onFocus,
|
|
66
|
+
onBlur,
|
|
67
|
+
onKeyDown,
|
|
68
|
+
placeholder,
|
|
69
|
+
className: inputClasses,
|
|
70
|
+
placeholderVariant,
|
|
71
|
+
"aria-label": "Search",
|
|
72
|
+
"aria-autocomplete": "list",
|
|
73
|
+
"aria-expanded": !!suggestions && suggestions.length > 0,
|
|
74
|
+
"aria-controls": "autocomplete-results",
|
|
75
|
+
"aria-activedescendant": ariaActivedescendant,
|
|
76
|
+
borderRadius: "xl",
|
|
77
|
+
borderColorClass: borderColor,
|
|
78
|
+
ref: localInputRef
|
|
79
|
+
}),
|
|
80
|
+
value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
81
|
+
onClick: () => {
|
|
82
|
+
onChange("");
|
|
83
|
+
localInputRef.current?.focus();
|
|
84
|
+
},
|
|
85
|
+
className: "spiffy-tw-absolute spiffy-tw-right-5 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2 spiffy-tw-text-neutral-500 hover:spiffy-tw-text-neutral-700",
|
|
86
|
+
"aria-label": "Clear search input",
|
|
87
|
+
type: "button",
|
|
88
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_index_js.IconClose, { className: closeButtonIconClassName })
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
//#endregion
|
|
95
|
+
Object.defineProperty(exports, 'SearchInput', {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: function () {
|
|
98
|
+
return SearchInput;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, 'searchInputVariantClasses', {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () {
|
|
104
|
+
return searchInputVariantClasses;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { TextInput } from "./TextInput-BeHPlVHT.js";
|
|
2
|
+
import { ColorNames, colorVar } from "./colorsConfig-Ck2jeqWe.js";
|
|
3
|
+
import React, { useImperativeHandle, useRef } from "react";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import MagnifyingGlassStarVariant from "@envive-ai/react-icons/MagnifyingGlassStarVariant";
|
|
7
|
+
import { IconClose } from "@envive-ai/react-icons/src/index.js";
|
|
8
|
+
|
|
9
|
+
//#region src/components/SearchInput/searchInputVariants.ts
|
|
10
|
+
const searchInputVariantClasses = { standard: {
|
|
11
|
+
searchInputIconColor: "transparent",
|
|
12
|
+
searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
|
|
13
|
+
searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
|
|
14
|
+
searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
|
|
15
|
+
autocompleteIconColor: colorVar(ColorNames.BackgroundPrimary),
|
|
16
|
+
searchInputClasses: "spiffy-tw-text-[--spiffy-colors-text-primary] placeholder:spiffy-tw-text-[--spiffy-colors-text-secondary] spiffy-tw-text-[16px] spiffy-tw-font-normal spiffy-tw-leading-[148%] placeholder:spiffy-tw-font-medium placeholder:spiffy-tw-leading-[124%]",
|
|
17
|
+
placeholderVariant: "h2"
|
|
18
|
+
} };
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/SearchInput/SearchInput.tsx
|
|
22
|
+
const SearchInput = React.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
|
|
23
|
+
const localInputRef = useRef(null);
|
|
24
|
+
const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = searchInputVariantClasses[searchInputVariant];
|
|
25
|
+
useImperativeHandle(ref, () => localInputRef.current, []);
|
|
26
|
+
const magnifyingGlassClassesBase = [
|
|
27
|
+
"spiffy-tw-w-[24px]",
|
|
28
|
+
"spiffy-tw-h-[32px]",
|
|
29
|
+
"spiffy-tw-stroke-width-1",
|
|
30
|
+
"sm:spiffy-tw-w-[32px]"
|
|
31
|
+
];
|
|
32
|
+
const magnifyingGlassClassesInactive = classNames(magnifyingGlassClassesBase);
|
|
33
|
+
const magnifyingGlassClassesActive = classNames([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
|
|
34
|
+
const containerClasses = classNames("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
|
|
35
|
+
const inputClasses = classNames("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
|
|
36
|
+
const closeButtonIconClassName = classNames([
|
|
37
|
+
"spiffy-tw-w-[16px]",
|
|
38
|
+
"spiffy-tw-h-[16px]",
|
|
39
|
+
"sm:spiffy-tw-w-[24px]",
|
|
40
|
+
"sm:spiffy-tw-h-[24px]",
|
|
41
|
+
"spiffy-tw-cursor-pointer",
|
|
42
|
+
closeIconClasses
|
|
43
|
+
]);
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: containerClasses,
|
|
46
|
+
"data-testid": dataTestId,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
|
|
50
|
+
children: /* @__PURE__ */ jsx(MagnifyingGlassStarVariant, {
|
|
51
|
+
className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
|
|
52
|
+
stroke: iconColor,
|
|
53
|
+
strokeWidth: "1px"
|
|
54
|
+
})
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ jsx(TextInput, {
|
|
57
|
+
value,
|
|
58
|
+
onChange: (event) => onChange(event.target.value),
|
|
59
|
+
onFocus,
|
|
60
|
+
onBlur,
|
|
61
|
+
onKeyDown,
|
|
62
|
+
placeholder,
|
|
63
|
+
className: inputClasses,
|
|
64
|
+
placeholderVariant,
|
|
65
|
+
"aria-label": "Search",
|
|
66
|
+
"aria-autocomplete": "list",
|
|
67
|
+
"aria-expanded": !!suggestions && suggestions.length > 0,
|
|
68
|
+
"aria-controls": "autocomplete-results",
|
|
69
|
+
"aria-activedescendant": ariaActivedescendant,
|
|
70
|
+
borderRadius: "xl",
|
|
71
|
+
borderColorClass: borderColor,
|
|
72
|
+
ref: localInputRef
|
|
73
|
+
}),
|
|
74
|
+
value && /* @__PURE__ */ jsx("button", {
|
|
75
|
+
onClick: () => {
|
|
76
|
+
onChange("");
|
|
77
|
+
localInputRef.current?.focus();
|
|
78
|
+
},
|
|
79
|
+
className: "spiffy-tw-absolute spiffy-tw-right-5 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2 spiffy-tw-text-neutral-500 hover:spiffy-tw-text-neutral-700",
|
|
80
|
+
"aria-label": "Clear search input",
|
|
81
|
+
type: "button",
|
|
82
|
+
children: /* @__PURE__ */ jsx(IconClose, { className: closeButtonIconClassName })
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
export { SearchInput, searchInputVariantClasses };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
+
require('../textVariantClasses-CBre7vXv.cjs');
|
|
3
|
+
const require_SearchAutocomplete = require('../SearchAutocomplete-BmHdijOv.cjs');
|
|
4
|
+
require('../TextInput-CGs4BY1q.cjs');
|
|
5
|
+
require('../colorsConfig-CqCKftuM.cjs');
|
|
6
|
+
const require_SearchInput = require('../SearchInput--x9NTMTb.cjs');
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
9
|
+
|
|
10
|
+
//#region src/components/SearchInputForm/SearchInputForm.tsx
|
|
11
|
+
const SearchInputForm = ({ searchInputVariant, searchText, autocompleteResults, searchBoxPlaceholder, focusedOptionId, isDirty, focusedIndex, onKeyDown, onAutocompleteSelect, onSearchInputChange, onSearchSubmit, searchInputDataTestId }) => {
|
|
12
|
+
const { searchInputIconColor } = require_SearchInput.searchInputVariantClasses[searchInputVariant];
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("form", {
|
|
14
|
+
onSubmit: (e) => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
onSearchSubmit();
|
|
17
|
+
},
|
|
18
|
+
className: "spiffy-tw-grow",
|
|
19
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchInput.SearchInput, {
|
|
20
|
+
value: searchText,
|
|
21
|
+
placeholder: searchBoxPlaceholder,
|
|
22
|
+
suggestions: autocompleteResults,
|
|
23
|
+
ariaActivedescendant: focusedOptionId,
|
|
24
|
+
searchInputVariant,
|
|
25
|
+
dataTestId: searchInputDataTestId,
|
|
26
|
+
onKeyDown,
|
|
27
|
+
onChange: onSearchInputChange
|
|
28
|
+
})
|
|
29
|
+
}), isDirty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchAutocomplete.SearchAutocomplete, {
|
|
30
|
+
id: "autocomplete-results",
|
|
31
|
+
results: autocompleteResults,
|
|
32
|
+
focusedIndex,
|
|
33
|
+
iconColor: searchInputIconColor,
|
|
34
|
+
onSuggestionSelect: onAutocompleteSelect
|
|
35
|
+
})] });
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.SearchInputForm = SearchInputForm;
|
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
import { SearchInputVariant } from "../
|
|
2
|
-
|
|
1
|
+
import { SearchInputVariant } from "../types-BhGjnuWx.cjs";
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/SearchInputForm/SearchInputForm.d.ts
|
|
5
|
+
interface SearchInputFormProps {
|
|
6
|
+
searchInputVariant: SearchInputVariant;
|
|
7
|
+
searchText: string;
|
|
8
|
+
autocompleteResults: string[];
|
|
9
|
+
searchBoxPlaceholder: string;
|
|
10
|
+
focusedOptionId: string | undefined;
|
|
11
|
+
isDirty: boolean;
|
|
12
|
+
focusedIndex: number;
|
|
13
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
14
|
+
onAutocompleteSelect: (suggestion: string) => void;
|
|
15
|
+
onSearchInputChange: (value: string) => void;
|
|
16
|
+
onSearchSubmit: () => void;
|
|
17
|
+
searchInputDataTestId?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const SearchInputForm: ({
|
|
20
|
+
searchInputVariant,
|
|
21
|
+
searchText,
|
|
22
|
+
autocompleteResults,
|
|
23
|
+
searchBoxPlaceholder,
|
|
24
|
+
focusedOptionId,
|
|
25
|
+
isDirty,
|
|
26
|
+
focusedIndex,
|
|
27
|
+
onKeyDown,
|
|
28
|
+
onAutocompleteSelect,
|
|
29
|
+
onSearchInputChange,
|
|
30
|
+
onSearchSubmit,
|
|
31
|
+
searchInputDataTestId
|
|
32
|
+
}: SearchInputFormProps) => react_jsx_runtime1.JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { SearchInputForm };
|
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
import { SearchInputVariant } from "../
|
|
2
|
-
|
|
1
|
+
import { SearchInputVariant } from "../types-CTOdb0G0.js";
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/SearchInputForm/SearchInputForm.d.ts
|
|
5
|
+
interface SearchInputFormProps {
|
|
6
|
+
searchInputVariant: SearchInputVariant;
|
|
7
|
+
searchText: string;
|
|
8
|
+
autocompleteResults: string[];
|
|
9
|
+
searchBoxPlaceholder: string;
|
|
10
|
+
focusedOptionId: string | undefined;
|
|
11
|
+
isDirty: boolean;
|
|
12
|
+
focusedIndex: number;
|
|
13
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
14
|
+
onAutocompleteSelect: (suggestion: string) => void;
|
|
15
|
+
onSearchInputChange: (value: string) => void;
|
|
16
|
+
onSearchSubmit: () => void;
|
|
17
|
+
searchInputDataTestId?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const SearchInputForm: ({
|
|
20
|
+
searchInputVariant,
|
|
21
|
+
searchText,
|
|
22
|
+
autocompleteResults,
|
|
23
|
+
searchBoxPlaceholder,
|
|
24
|
+
focusedOptionId,
|
|
25
|
+
isDirty,
|
|
26
|
+
focusedIndex,
|
|
27
|
+
onKeyDown,
|
|
28
|
+
onAutocompleteSelect,
|
|
29
|
+
onSearchInputChange,
|
|
30
|
+
onSearchSubmit,
|
|
31
|
+
searchInputDataTestId
|
|
32
|
+
}: SearchInputFormProps) => react_jsx_runtime1.JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { SearchInputForm };
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
import "../textVariantClasses-CRrTb43V.js";
|
|
2
|
+
import { SearchAutocomplete } from "../SearchAutocomplete-BMNYZiJL.js";
|
|
3
|
+
import "../TextInput-BeHPlVHT.js";
|
|
4
|
+
import "../colorsConfig-Ck2jeqWe.js";
|
|
5
|
+
import { SearchInput, searchInputVariantClasses } from "../SearchInput-IBq83nqF.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/SearchInputForm/SearchInputForm.tsx
|
|
9
|
+
const SearchInputForm = ({ searchInputVariant, searchText, autocompleteResults, searchBoxPlaceholder, focusedOptionId, isDirty, focusedIndex, onKeyDown, onAutocompleteSelect, onSearchInputChange, onSearchSubmit, searchInputDataTestId }) => {
|
|
10
|
+
const { searchInputIconColor } = searchInputVariantClasses[searchInputVariant];
|
|
11
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("form", {
|
|
12
|
+
onSubmit: (e) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
onSearchSubmit();
|
|
15
|
+
},
|
|
16
|
+
className: "spiffy-tw-grow",
|
|
17
|
+
children: /* @__PURE__ */ jsx(SearchInput, {
|
|
18
|
+
value: searchText,
|
|
19
|
+
placeholder: searchBoxPlaceholder,
|
|
20
|
+
suggestions: autocompleteResults,
|
|
21
|
+
ariaActivedescendant: focusedOptionId,
|
|
22
|
+
searchInputVariant,
|
|
23
|
+
dataTestId: searchInputDataTestId,
|
|
24
|
+
onKeyDown,
|
|
25
|
+
onChange: onSearchInputChange
|
|
26
|
+
})
|
|
27
|
+
}), isDirty && /* @__PURE__ */ jsx(SearchAutocomplete, {
|
|
28
|
+
id: "autocomplete-results",
|
|
29
|
+
results: autocompleteResults,
|
|
30
|
+
focusedIndex,
|
|
31
|
+
iconColor: searchInputIconColor,
|
|
32
|
+
onSuggestionSelect: onAutocompleteSelect
|
|
33
|
+
})] });
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { SearchInputForm };
|
|
@@ -2,16 +2,16 @@ const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
|
2
2
|
require('../textVariantClasses-CBre7vXv.cjs');
|
|
3
3
|
require('../Text-DllCE9_D.cjs');
|
|
4
4
|
require('../Text-C8t_iEj6.cjs');
|
|
5
|
-
require('../DynamicFiltersScrollbar-
|
|
6
|
-
require('../Headline-
|
|
7
|
-
require('../ImageWithFallback-
|
|
8
|
-
require('../ProductCard-
|
|
9
|
-
require('../Spinner-
|
|
10
|
-
require('../
|
|
11
|
-
|
|
12
|
-
require('../
|
|
13
|
-
require('../
|
|
14
|
-
require('../SparkleAnimation-
|
|
5
|
+
require('../DynamicFiltersScrollbar-HCYZjI14.cjs');
|
|
6
|
+
require('../Headline-CKJmd2w4.cjs');
|
|
7
|
+
require('../ImageWithFallback-Km9h16Vz.cjs');
|
|
8
|
+
require('../ProductCard-BDz80MCQ.cjs');
|
|
9
|
+
require('../Spinner-rcWX566W.cjs');
|
|
10
|
+
require('../ProductGrid-RRcdkY5J.cjs');
|
|
11
|
+
require('../colorsConfig-CqCKftuM.cjs');
|
|
12
|
+
const require_SearchResultsStates = require('../SearchResultsStates-nlaPbkj3.cjs');
|
|
13
|
+
require('../searchFilterSidebarVariants-NQhqq-NT.cjs');
|
|
14
|
+
require('../SparkleAnimation-D1aZE-7A.cjs');
|
|
15
15
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
16
|
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
17
17
|
let __envive_ai_react_hooks_hooks_utils = require("@envive-ai/react-hooks/hooks/utils");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProductCardConfig, ProductGridVariant, SearchResponseProductAttributes } from "../index-
|
|
2
|
-
import { SearchFilterSidebarVariant } from "../index-
|
|
3
|
-
import * as
|
|
1
|
+
import { ProductCardConfig, ProductGridVariant, SearchResponseProductAttributes } from "../index-B9WeFNlO.cjs";
|
|
2
|
+
import { SearchFilterSidebarVariant } from "../index-CLGe_Pam.cjs";
|
|
3
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
4
4
|
import { SelectedFilterOption } from "@envive-ai/react-hooks/atoms/search";
|
|
5
5
|
import { SearchResultsState } from "@envive-ai/react-hooks/hooks/utils";
|
|
6
6
|
|
|
@@ -43,6 +43,6 @@ declare const SearchResultsContent: ({
|
|
|
43
43
|
onRemoveFilter,
|
|
44
44
|
onToggleDynamicFilter,
|
|
45
45
|
noResultsFoundText
|
|
46
|
-
}: SearchResultsContentProps) =>
|
|
46
|
+
}: SearchResultsContentProps) => react_jsx_runtime12.JSX.Element;
|
|
47
47
|
//#endregion
|
|
48
48
|
export { SearchResultsContent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ProductCardConfig, ProductGridVariant, SearchResponseProductAttributes } from "../index-
|
|
2
|
-
import { SearchFilterSidebarVariant } from "../index-
|
|
3
|
-
import * as
|
|
1
|
+
import { ProductCardConfig, ProductGridVariant, SearchResponseProductAttributes } from "../index-CeECGrFM.js";
|
|
2
|
+
import { SearchFilterSidebarVariant } from "../index-PSzeHU2s.js";
|
|
3
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
4
4
|
import { SearchResultsState } from "@envive-ai/react-hooks/hooks/utils";
|
|
5
5
|
import { SelectedFilterOption } from "@envive-ai/react-hooks/atoms/search";
|
|
6
6
|
|
|
@@ -43,6 +43,6 @@ declare const SearchResultsContent: ({
|
|
|
43
43
|
onRemoveFilter,
|
|
44
44
|
onToggleDynamicFilter,
|
|
45
45
|
noResultsFoundText
|
|
46
|
-
}: SearchResultsContentProps) =>
|
|
46
|
+
}: SearchResultsContentProps) => react_jsx_runtime13.JSX.Element;
|
|
47
47
|
//#endregion
|
|
48
48
|
export { SearchResultsContent };
|