@envive-ai/react-toolkit 0.2.4 → 0.2.6
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.d.cts +2 -2
- package/dist/AnimatedChevron/index.d.ts +2 -2
- package/dist/AppliedFiltersScrollbar/index.d.cts +2 -2
- package/dist/ButtonBase/index.d.cts +2 -2
- package/dist/ButtonBase/index.d.ts +2 -2
- package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
- package/dist/DynamicFiltersScrollbar/index.d.ts +2 -2
- package/dist/FilterScrollbar/index.d.cts +3 -3
- package/dist/FilterScrollbar/index.d.ts +3 -3
- package/dist/ImageWithFallback/index.d.cts +2 -2
- package/dist/ImageWithFallback/index.d.ts +2 -2
- package/dist/ModalSheet/index.d.cts +2 -2
- package/dist/ProductCard/index.d.cts +1 -1
- package/dist/ProductCard/index.d.ts +1 -1
- package/dist/ProductGrid/index.cjs +1 -1
- package/dist/ProductGrid/index.d.cts +3 -3
- package/dist/ProductGrid/index.d.ts +3 -3
- package/dist/ProductGrid/index.js +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-3t2kqSFA.cjs → RadioButtonGroup-BbVqccni.cjs} +1 -1
- package/dist/{RadioButtonGroup-DMbVgPQH.js → RadioButtonGroup-Dgt2ub6s.js} +1 -1
- package/dist/SearchAutocomplete/index.cjs +2 -1
- package/dist/SearchAutocomplete/index.d.cts +10 -2
- package/dist/SearchAutocomplete/index.d.ts +10 -2
- package/dist/SearchAutocomplete/index.js +2 -1
- package/dist/SearchAutocomplete-B690CIZB.js +69 -0
- package/dist/{SearchAutocomplete-TX8UTczp.cjs → SearchAutocomplete-DAEDHeqr.cjs} +26 -8
- package/dist/SearchFilter/index.cjs +4 -4
- package/dist/SearchFilter/index.d.cts +5 -5
- package/dist/SearchFilter/index.d.ts +5 -5
- package/dist/SearchFilter/index.js +4 -4
- package/dist/{SearchFilter-t9or-lnj.cjs → SearchFilter-BHFHWmpK.cjs} +2 -2
- package/dist/{SearchFilter-BQW4o3Xf.js → SearchFilter-DWii-Y_g.js} +2 -2
- package/dist/SearchInput/index.cjs +3 -4
- package/dist/SearchInput/index.d.ts +2 -2
- package/dist/SearchInput/index.js +3 -4
- package/dist/{SearchInput-CO1poiit.cjs → SearchInput-Bn6wD39s.cjs} +5 -23
- package/dist/{SearchInput-BaiWd0_O.js → SearchInput-DFoKyqJV.js} +4 -23
- package/dist/SearchInputForm/index.cjs +49 -30
- package/dist/SearchInputForm/index.d.cts +9 -7
- package/dist/SearchInputForm/index.d.ts +10 -8
- package/dist/SearchInputForm/index.js +48 -31
- package/dist/SearchResultsContent/index.cjs +5 -5
- package/dist/SearchResultsContent/index.d.cts +3 -3
- package/dist/SearchResultsContent/index.d.ts +4 -4
- package/dist/SearchResultsContent/index.js +5 -5
- package/dist/SearchResultsFilterSidebar/index.cjs +74 -8
- package/dist/SearchResultsFilterSidebar/index.d.ts +1 -1
- package/dist/SearchResultsFilterSidebar/index.js +73 -7
- package/dist/SearchResultsStates/index.cjs +5 -5
- package/dist/SearchResultsStates/index.d.cts +5 -5
- package/dist/SearchResultsStates/index.d.ts +6 -6
- package/dist/SearchResultsStates/index.js +5 -5
- package/dist/{SearchResultsStates-Bv5NyxPn.cjs → SearchResultsStates-BJPkHdXG.cjs} +3 -3
- package/dist/{SearchResultsStates-DUG-117h.js → SearchResultsStates-BiVIsfIe.js} +3 -3
- 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.d.cts +2 -2
- package/dist/Spinner/index.d.ts +2 -2
- package/dist/SuggestionButton/index.cjs +8 -0
- package/dist/SuggestionButton/index.d.cts +3 -3
- package/dist/SuggestionButton/index.d.ts +3 -3
- package/dist/SuggestionButton/index.js +8 -0
- package/dist/TextInput/index.cjs +1 -1
- package/dist/TextInput/index.d.ts +2 -2
- 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/Typography/index.d.ts +2 -2
- package/dist/{index-BcvJf9Sr.d.ts → index--SpI4Sdw.d.ts} +2 -2
- package/dist/{index-DDp-fLgm.d.cts → index-4oRWfY5a.d.cts} +4 -4
- package/dist/{index-B5p2z61Y.d.ts → index-DGfkVcQx.d.ts} +4 -4
- package/dist/{index-BH-QK27q.d.ts → index-Qtr26aUO.d.ts} +1 -1
- package/dist/{searchFilterSidebarVariants-DXabOauB.cjs → searchFilterSidebarVariants-B1P8YS86.cjs} +1 -1
- package/dist/{searchFilterSidebarVariants-BD4SYugF.js → searchFilterSidebarVariants-CN9_kzJ8.js} +1 -1
- package/package.json +1 -1
- package/src/components/SearchAutocomplete/SearchAutocomplete.tsx +51 -11
- package/src/components/SearchInput/SearchInput.tsx +1 -1
- package/src/components/SearchInputForm/SearchInputForm.tsx +52 -18
- package/src/components/SuggestionButton/SuggestionButton.tsx +15 -0
- package/src/components/SuggestionButton/types.ts +2 -1
- package/src/components/TextInput/TextInput.tsx +0 -4
- package/dist/SearchAutocomplete-obO19yzL.js +0 -51
- package/dist/SettingsVariant-BsBbdjV5.cjs +0 -63
- package/dist/SettingsVariant-CUSFlJEu.js +0 -55
- /package/dist/{ProductGrid-Cgkb4vNf.js → ProductGrid-BFFojT9P.js} +0 -0
- /package/dist/{ProductGrid-BeFeluHo.cjs → ProductGrid-BfgnDGUq.cjs} +0 -0
- /package/dist/{RadioButton-C_soBi7w.js → RadioButton-BYq1JQtD.js} +0 -0
- /package/dist/{RadioButton-DG0PgZbz.cjs → RadioButton-DT5srptW.cjs} +0 -0
- /package/dist/{SparkleAnimation-Bm3fk2FJ.cjs → SparkleAnimation-CvGlWUqv.cjs} +0 -0
- /package/dist/{SparkleAnimation-D1QjYho_.js → SparkleAnimation-paLhSu5E.js} +0 -0
- /package/dist/{TextInput-iAKCKHwT.cjs → TextInput-BTTG_drp.cjs} +0 -0
- /package/dist/{TextInput-B_4Bu2vf.js → TextInput-BfUhaQUc.js} +0 -0
- /package/dist/{ToggleButton-Br6MgjiG.js → ToggleButton-8P9eNKy1.js} +0 -0
- /package/dist/{ToggleButton-CJ74eu-N.cjs → ToggleButton-DCiR4sB5.cjs} +0 -0
- /package/dist/{colorsConfig-D-MZuBvt.cjs → colorsConfig-BjmNL7s7.cjs} +0 -0
- /package/dist/{colorsConfig-DEfiLHH0.js → colorsConfig-E7w6Ol6W.js} +0 -0
- /package/dist/{types-CGRog8XL.d.ts → types-DlqhqT_S.d.ts} +0 -0
- /package/dist/{typographyVariantClasses-COmQXqcN.d.ts → typographyVariantClasses-B6wiawat.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
3
3
|
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
4
4
|
import { ResponseCategory, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
|
|
5
5
|
|
|
@@ -261,7 +261,7 @@ declare const RatingSummary: ({
|
|
|
261
261
|
stars,
|
|
262
262
|
reviewCount,
|
|
263
263
|
className
|
|
264
|
-
}: RatingSummaryProps) =>
|
|
264
|
+
}: RatingSummaryProps) => react_jsx_runtime12.JSX.Element;
|
|
265
265
|
interface PriceSectionProps {
|
|
266
266
|
originalPrice?: string;
|
|
267
267
|
salePrice?: string;
|
|
@@ -271,7 +271,7 @@ declare const PriceSection: ({
|
|
|
271
271
|
originalPrice,
|
|
272
272
|
salePrice,
|
|
273
273
|
pricePrefix
|
|
274
|
-
}: PriceSectionProps) =>
|
|
274
|
+
}: PriceSectionProps) => react_jsx_runtime12.JSX.Element;
|
|
275
275
|
interface ProductCardProps extends TestProps {
|
|
276
276
|
productCardConfig?: ProductCardConfig;
|
|
277
277
|
merchantShortName: string;
|
|
@@ -308,7 +308,7 @@ declare const ProductCard: ({
|
|
|
308
308
|
aspectRatio,
|
|
309
309
|
growWithContainer,
|
|
310
310
|
handleClick
|
|
311
|
-
}: ProductCardProps) =>
|
|
311
|
+
}: ProductCardProps) => react_jsx_runtime12.JSX.Element;
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/components/ProductCard/ProductCardSkeleton.d.ts
|
|
314
314
|
declare const ProductCardSkeleton: FC<ProductCardSkeletonProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementTypes, TypographyVariantMap } from "./typographyVariantClasses-
|
|
1
|
+
import { ElementTypes, TypographyVariantMap } from "./typographyVariantClasses-B6wiawat.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Typography/Typography.d.ts
|
package/dist/{searchFilterSidebarVariants-DXabOauB.cjs → searchFilterSidebarVariants-B1P8YS86.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_colorsConfig = require('./colorsConfig-
|
|
1
|
+
const require_colorsConfig = require('./colorsConfig-BjmNL7s7.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts
|
|
4
4
|
const searchFilterSidebarVariantClasses = {
|
package/package.json
CHANGED
|
@@ -2,26 +2,70 @@ import React from 'react';
|
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import OutlinedStar from '@envive-ai/react-icons/OutlinedStar';
|
|
5
|
+
import { Typography } from '../Typography';
|
|
5
6
|
|
|
6
7
|
interface GlobalSearchAutocompleteProps {
|
|
7
8
|
id: string;
|
|
8
9
|
results: string[];
|
|
9
10
|
focusedIndex: number;
|
|
11
|
+
searchText?: string;
|
|
10
12
|
onSuggestionSelect: (suggestion: string, rankPosition: number) => void;
|
|
11
13
|
iconColor?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
export const SearchAutocomplete
|
|
16
|
+
export const SearchAutocomplete = ({
|
|
15
17
|
id,
|
|
16
18
|
results,
|
|
17
19
|
focusedIndex,
|
|
20
|
+
searchText = '',
|
|
18
21
|
onSuggestionSelect,
|
|
19
22
|
iconColor,
|
|
20
|
-
}) => {
|
|
23
|
+
}: GlobalSearchAutocompleteProps) => {
|
|
21
24
|
if (results.length === 0) {
|
|
22
25
|
return null;
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
const highlightMatchingText = (text: string, searchQuery: string) => {
|
|
29
|
+
if (!searchQuery.trim()) {
|
|
30
|
+
return <Typography variant="body3">{text}</Typography>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const escapedQuery = searchQuery.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
34
|
+
const regex = new RegExp(`(${escapedQuery})`, 'gi');
|
|
35
|
+
const parts = text.split(regex);
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Typography variant="body3">
|
|
39
|
+
{parts.map((part, index) => {
|
|
40
|
+
const isMatch = part.toLowerCase() === searchQuery.toLowerCase();
|
|
41
|
+
return isMatch ? (
|
|
42
|
+
<strong key={index} className="spiffy-tw-font-bold">
|
|
43
|
+
{part}
|
|
44
|
+
</strong>
|
|
45
|
+
) : (
|
|
46
|
+
<span key={index}>{part}</span>
|
|
47
|
+
);
|
|
48
|
+
})}
|
|
49
|
+
</Typography>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const containerClasses = classNames(
|
|
54
|
+
'spiffy-tw-mt-[16px]',
|
|
55
|
+
'spiffy-tw-mb-[8px]',
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const getListElementClasses = (index: number) => classNames(
|
|
59
|
+
'spiffy-tw-flex',
|
|
60
|
+
'spiffy-tw-items-center',
|
|
61
|
+
'spiffy-tw-cursor-pointer',
|
|
62
|
+
'spiffy-tw-py-[8px]',
|
|
63
|
+
'spiffy-tw-pl-[16px]',
|
|
64
|
+
'spiffy-tw-text-[--spiffy-colors-text-primary]',
|
|
65
|
+
'hover:spiffy-tw-bg-neutral-100',
|
|
66
|
+
{ 'spiffy-tw-bg-neutral-200': focusedIndex === index },
|
|
67
|
+
);
|
|
68
|
+
|
|
25
69
|
return (
|
|
26
70
|
<motion.div
|
|
27
71
|
className="spiffy-tw-h-full"
|
|
@@ -30,18 +74,14 @@ export const SearchAutocomplete: React.FC<GlobalSearchAutocompleteProps> = ({
|
|
|
30
74
|
exit={{ opacity: 0, y: -10 }}
|
|
31
75
|
transition={{ duration: 0.2 }}
|
|
32
76
|
>
|
|
33
|
-
<ul id={id} role="listbox" className=
|
|
77
|
+
<ul id={id} role="listbox" className={containerClasses}>
|
|
34
78
|
{results.map((result, index) => (
|
|
35
79
|
<li
|
|
36
80
|
key={index}
|
|
37
81
|
id={`option-${index}`}
|
|
38
82
|
role="option"
|
|
39
83
|
aria-selected={index === focusedIndex}
|
|
40
|
-
className={
|
|
41
|
-
'spiffy-tw-flex spiffy-tw-items-center spiffy-tw-cursor-pointer spiffy-tw-py-1',
|
|
42
|
-
{ 'spiffy-tw-bg-neutral-200': index === focusedIndex },
|
|
43
|
-
'hover:spiffy-tw-bg-neutral-100',
|
|
44
|
-
)}
|
|
84
|
+
className={getListElementClasses(index)}
|
|
45
85
|
onClick={() => onSuggestionSelect(result, index)}
|
|
46
86
|
onKeyDown={(event) => {
|
|
47
87
|
if (event.key === 'Enter' || event.keyCode === 13) {
|
|
@@ -50,13 +90,13 @@ export const SearchAutocomplete: React.FC<GlobalSearchAutocompleteProps> = ({
|
|
|
50
90
|
}}
|
|
51
91
|
>
|
|
52
92
|
<OutlinedStar
|
|
53
|
-
className="spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-
|
|
93
|
+
className="spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-[16px]"
|
|
54
94
|
fill={iconColor}
|
|
55
95
|
/>
|
|
56
|
-
|
|
96
|
+
{highlightMatchingText(result, searchText)}
|
|
57
97
|
</li>
|
|
58
98
|
))}
|
|
59
99
|
</ul>
|
|
60
100
|
</motion.div>
|
|
61
101
|
);
|
|
62
|
-
};
|
|
102
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useImperativeHandle } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import MagnifyingGlassStarVariant from '@envive-ai/react-icons/MagnifyingGlassStarVariant';
|
|
4
|
-
import
|
|
4
|
+
import IconClose from '@envive-ai/react-icons/IconClose';
|
|
5
5
|
import { SearchInputVariant } from '@envive-ai/react-hooks/contexts/types';
|
|
6
6
|
import { TextInput } from '../TextInput';
|
|
7
7
|
import { searchInputVariantClasses } from './searchInputVariants';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { SEARCH_INPUT_TESTID } from '@envive-ai/react-hooks/config/locators/components/search';
|
|
1
3
|
import { SearchAutocomplete } from '../SearchAutocomplete';
|
|
2
4
|
import { SearchInput } from '../SearchInput/SearchInput';
|
|
3
5
|
import { searchInputVariantClasses } from '../SearchInput/searchInputVariants';
|
|
@@ -9,13 +11,14 @@ interface SearchInputFormProps {
|
|
|
9
11
|
autocompleteResults: string[];
|
|
10
12
|
searchBoxPlaceholder: string;
|
|
11
13
|
focusedOptionId: string | undefined;
|
|
12
|
-
isDirty: boolean;
|
|
13
14
|
focusedIndex: number;
|
|
14
15
|
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
15
|
-
onAutocompleteSelect: (suggestion: string) => void;
|
|
16
|
+
onAutocompleteSelect: (suggestion: string, rankPosition?: number) => void;
|
|
16
17
|
onSearchInputChange: (value: string) => void;
|
|
17
18
|
onSearchSubmit: () => void;
|
|
18
|
-
|
|
19
|
+
onSearchInputFocus: () => void;
|
|
20
|
+
onSearchInputBlur: () => void;
|
|
21
|
+
shouldShowAutocomplete: boolean;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export const SearchInputForm = ({
|
|
@@ -24,24 +27,50 @@ export const SearchInputForm = ({
|
|
|
24
27
|
autocompleteResults,
|
|
25
28
|
searchBoxPlaceholder,
|
|
26
29
|
focusedOptionId,
|
|
27
|
-
|
|
30
|
+
shouldShowAutocomplete,
|
|
28
31
|
focusedIndex,
|
|
29
32
|
onKeyDown,
|
|
30
33
|
onAutocompleteSelect,
|
|
31
34
|
onSearchInputChange,
|
|
32
35
|
onSearchSubmit,
|
|
33
|
-
|
|
36
|
+
onSearchInputFocus,
|
|
37
|
+
onSearchInputBlur,
|
|
34
38
|
}: SearchInputFormProps) => {
|
|
35
|
-
const {
|
|
39
|
+
const { autocompleteIconColor } = searchInputVariantClasses[searchInputVariant];
|
|
40
|
+
|
|
41
|
+
const containerClasses = classNames(
|
|
42
|
+
'spiffy-tw-relative',
|
|
43
|
+
'spiffy-tw-w-full'
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const formClasses = classNames({
|
|
47
|
+
'spiffy-tw-grow': true,
|
|
48
|
+
'spiffy-tw-relative': true,
|
|
49
|
+
'spiffy-tw-z-20': shouldShowAutocomplete
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const autocompleteContainerClasses = classNames(
|
|
53
|
+
'spiffy-tw-absolute',
|
|
54
|
+
'spiffy-tw-top-1/2',
|
|
55
|
+
'spiffy-tw-z-10',
|
|
56
|
+
'spiffy-tw-left-0',
|
|
57
|
+
'spiffy-tw-right-0',
|
|
58
|
+
'spiffy-tw-bg-white',
|
|
59
|
+
'spiffy-tw-w-full',
|
|
60
|
+
'spiffy-tw-rounded-b-lg',
|
|
61
|
+
'spiffy-tw-border',
|
|
62
|
+
'spiffy-tw-border-t-0',
|
|
63
|
+
'spiffy-tw-pt-4'
|
|
64
|
+
);
|
|
36
65
|
|
|
37
66
|
return (
|
|
38
|
-
|
|
67
|
+
<div className={containerClasses}>
|
|
39
68
|
<form
|
|
40
69
|
onSubmit={(e) => {
|
|
41
70
|
e.preventDefault();
|
|
42
71
|
onSearchSubmit();
|
|
43
72
|
}}
|
|
44
|
-
className=
|
|
73
|
+
className={formClasses}
|
|
45
74
|
>
|
|
46
75
|
<SearchInput
|
|
47
76
|
value={searchText}
|
|
@@ -49,20 +78,25 @@ export const SearchInputForm = ({
|
|
|
49
78
|
suggestions={autocompleteResults}
|
|
50
79
|
ariaActivedescendant={focusedOptionId}
|
|
51
80
|
searchInputVariant={searchInputVariant}
|
|
52
|
-
dataTestId={
|
|
81
|
+
dataTestId={SEARCH_INPUT_TESTID}
|
|
53
82
|
onKeyDown={onKeyDown}
|
|
54
83
|
onChange={onSearchInputChange}
|
|
84
|
+
onFocus={onSearchInputFocus}
|
|
85
|
+
onBlur={onSearchInputBlur}
|
|
55
86
|
/>
|
|
56
87
|
</form>
|
|
57
|
-
{
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
88
|
+
{shouldShowAutocomplete && (
|
|
89
|
+
<div className={autocompleteContainerClasses}>
|
|
90
|
+
<SearchAutocomplete
|
|
91
|
+
id="autocomplete-results"
|
|
92
|
+
results={autocompleteResults}
|
|
93
|
+
focusedIndex={focusedIndex}
|
|
94
|
+
searchText={searchText}
|
|
95
|
+
iconColor={autocompleteIconColor}
|
|
96
|
+
onSuggestionSelect={onAutocompleteSelect}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
65
99
|
)}
|
|
66
|
-
|
|
100
|
+
</div>
|
|
67
101
|
);
|
|
68
102
|
};
|
|
@@ -105,6 +105,20 @@ const variantClassMap = new Map<SuggestionButtonVariant, string[]>([
|
|
|
105
105
|
BORDER_CLASS,
|
|
106
106
|
],
|
|
107
107
|
],
|
|
108
|
+
// dark accent appears to have been originally been made with the bg color text-accent
|
|
109
|
+
// instead of the design, acccent-primary. This is a correction to match the design without
|
|
110
|
+
// regressing intentional uses of the other styling. text-accent and accent-primary are often
|
|
111
|
+
// the same or very similar colors but in some cases, they are very different to deal with contrast correctly.
|
|
112
|
+
[
|
|
113
|
+
'darkAccentContrast',
|
|
114
|
+
[
|
|
115
|
+
...DARK_BACKGROUND_CLASSES,
|
|
116
|
+
'spiffy-tw-text-[--spiffy-colors-text-light]', // hover:spiffy-tw-text-[--spiffy-colors-text-light]
|
|
117
|
+
'spiffy-tw-fill-[--spiffy-colors-accent-primary]', // hover:spiffy-tw-fill-[--spiffy-colors-accent-primary]
|
|
118
|
+
'spiffy-tw-stroke-[--spiffy-colors-accent-primary]', // hover:spiffy-tw-stroke-[--spiffy-colors-accent-primary]
|
|
119
|
+
BORDER_CLASS,
|
|
120
|
+
],
|
|
121
|
+
],
|
|
108
122
|
[
|
|
109
123
|
'transparent',
|
|
110
124
|
[
|
|
@@ -169,6 +183,7 @@ const borderedVariants = [
|
|
|
169
183
|
'tertiary',
|
|
170
184
|
'dark',
|
|
171
185
|
'darkAccent',
|
|
186
|
+
'darkAccentContrast',
|
|
172
187
|
'darkPrimary',
|
|
173
188
|
'transparent',
|
|
174
189
|
'transparentDark',
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/* eslint-disable react/jsx-props-no-spreading */
|
|
2
|
-
// Disabling this prevents an otherwise simple wrapper around input
|
|
3
|
-
// from becoming needlessly verbose while maintaining flexibility.
|
|
4
|
-
// Keeping it enabled requires listing every possible prop.
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import classNames from 'classnames';
|
|
7
3
|
|
|
@@ -1,51 +0,0 @@
|
|
|
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";
|
|
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
|
|
51
|
-
export { SearchAutocomplete };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
let react = require("react");
|
|
3
|
-
react = require_chunk.__toESM(react);
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
6
|
-
|
|
7
|
-
//#region ../icons/src/SettingsVariant.tsx
|
|
8
|
-
const SvgSettingsVariant = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
width: 28,
|
|
11
|
-
height: 28,
|
|
12
|
-
fill: "none",
|
|
13
|
-
...props,
|
|
14
|
-
children: [
|
|
15
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
16
|
-
cx: 3.5,
|
|
17
|
-
cy: 3.5,
|
|
18
|
-
r: 3.033,
|
|
19
|
-
stroke: "#767676",
|
|
20
|
-
strokeWidth: .933,
|
|
21
|
-
transform: "matrix(-1 0 0 1 22.4 0)"
|
|
22
|
-
}),
|
|
23
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
24
|
-
stroke: "#767676",
|
|
25
|
-
strokeWidth: .933,
|
|
26
|
-
d: "M14 3.5H0M28 3.5h-4.5"
|
|
27
|
-
}),
|
|
28
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
29
|
-
cx: 9.1,
|
|
30
|
-
cy: 13.5,
|
|
31
|
-
r: 3.033,
|
|
32
|
-
stroke: "#767676",
|
|
33
|
-
strokeWidth: .933
|
|
34
|
-
}),
|
|
35
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
36
|
-
stroke: "#767676",
|
|
37
|
-
strokeWidth: .933,
|
|
38
|
-
d: "M14 13.5h14M0 13.5h4.5"
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
41
|
-
cx: 3.5,
|
|
42
|
-
cy: 3.5,
|
|
43
|
-
r: 3.033,
|
|
44
|
-
stroke: "#767676",
|
|
45
|
-
strokeWidth: .933,
|
|
46
|
-
transform: "matrix(-1 0 0 1 22.4 20)"
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
49
|
-
stroke: "#767676",
|
|
50
|
-
strokeWidth: .933,
|
|
51
|
-
d: "M14 23.5H0M28 23.5h-4.5"
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
var SettingsVariant_default = SvgSettingsVariant;
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
Object.defineProperty(exports, 'SettingsVariant_default', {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
get: function () {
|
|
61
|
-
return SettingsVariant_default;
|
|
62
|
-
}
|
|
63
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import "react";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region ../icons/src/SettingsVariant.tsx
|
|
5
|
-
const SvgSettingsVariant = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width: 28,
|
|
8
|
-
height: 28,
|
|
9
|
-
fill: "none",
|
|
10
|
-
...props,
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ jsx("circle", {
|
|
13
|
-
cx: 3.5,
|
|
14
|
-
cy: 3.5,
|
|
15
|
-
r: 3.033,
|
|
16
|
-
stroke: "#767676",
|
|
17
|
-
strokeWidth: .933,
|
|
18
|
-
transform: "matrix(-1 0 0 1 22.4 0)"
|
|
19
|
-
}),
|
|
20
|
-
/* @__PURE__ */ jsx("path", {
|
|
21
|
-
stroke: "#767676",
|
|
22
|
-
strokeWidth: .933,
|
|
23
|
-
d: "M14 3.5H0M28 3.5h-4.5"
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ jsx("circle", {
|
|
26
|
-
cx: 9.1,
|
|
27
|
-
cy: 13.5,
|
|
28
|
-
r: 3.033,
|
|
29
|
-
stroke: "#767676",
|
|
30
|
-
strokeWidth: .933
|
|
31
|
-
}),
|
|
32
|
-
/* @__PURE__ */ jsx("path", {
|
|
33
|
-
stroke: "#767676",
|
|
34
|
-
strokeWidth: .933,
|
|
35
|
-
d: "M14 13.5h14M0 13.5h4.5"
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */ jsx("circle", {
|
|
38
|
-
cx: 3.5,
|
|
39
|
-
cy: 3.5,
|
|
40
|
-
r: 3.033,
|
|
41
|
-
stroke: "#767676",
|
|
42
|
-
strokeWidth: .933,
|
|
43
|
-
transform: "matrix(-1 0 0 1 22.4 20)"
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ jsx("path", {
|
|
46
|
-
stroke: "#767676",
|
|
47
|
-
strokeWidth: .933,
|
|
48
|
-
d: "M14 23.5H0M28 23.5h-4.5"
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
var SettingsVariant_default = SvgSettingsVariant;
|
|
53
|
-
|
|
54
|
-
//#endregion
|
|
55
|
-
export { SettingsVariant_default };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{typographyVariantClasses-COmQXqcN.d.ts → typographyVariantClasses-B6wiawat.d.ts}
RENAMED
|
File without changes
|