@envive-ai/react-toolkit 0.2.8 → 0.2.10

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.
Files changed (84) hide show
  1. package/dist/Accordion/index.d.cts +2 -2
  2. package/dist/Accordion/index.d.ts +2 -2
  3. package/dist/AnimatedChevron/index.d.cts +2 -2
  4. package/dist/AnimatedChevron/index.d.ts +2 -2
  5. package/dist/AppliedFiltersScrollbar/index.d.cts +2 -2
  6. package/dist/AppliedFiltersScrollbar/index.d.ts +2 -2
  7. package/dist/ButtonBase/index.d.cts +2 -2
  8. package/dist/ButtonBase/index.d.ts +2 -2
  9. package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
  10. package/dist/FilterScrollbar/index.cjs +1 -1
  11. package/dist/FilterScrollbar/index.d.cts +3 -3
  12. package/dist/FilterScrollbar/index.d.ts +3 -3
  13. package/dist/FilterScrollbar/index.js +1 -1
  14. package/dist/ImageWithFallback/index.cjs +1 -1
  15. package/dist/ImageWithFallback/index.d.cts +2 -2
  16. package/dist/ImageWithFallback/index.d.ts +2 -2
  17. package/dist/ImageWithFallback/index.js +1 -1
  18. package/dist/ModalSheet/index.d.cts +2 -2
  19. package/dist/ModalSheet/index.d.ts +2 -2
  20. package/dist/ProductCard/index.cjs +2 -2
  21. package/dist/ProductCard/index.d.cts +1 -1
  22. package/dist/ProductCard/index.d.ts +1 -1
  23. package/dist/ProductCard/index.js +2 -2
  24. package/dist/{ProductCard-DksbHI3v.cjs → ProductCard-C-8ie9Lf.cjs} +1 -1
  25. package/dist/{ProductCard-DRczevG8.js → ProductCard-n-PAth5m.js} +1 -1
  26. package/dist/ProductGrid/index.cjs +3 -3
  27. package/dist/ProductGrid/index.d.cts +6 -4
  28. package/dist/ProductGrid/index.d.ts +6 -4
  29. package/dist/ProductGrid/index.js +3 -3
  30. package/dist/{ProductGrid-DxbFvnNs.cjs → ProductGrid-Ba2tUgmC.cjs} +5 -4
  31. package/dist/{ProductGrid-CGHDHthe.js → ProductGrid-xXkWzvR2.js} +5 -4
  32. package/dist/RadioButton/index.cjs +2 -1
  33. package/dist/RadioButton/index.d.cts +2 -2
  34. package/dist/RadioButton/index.d.ts +2 -2
  35. package/dist/RadioButton/index.js +2 -1
  36. package/dist/{RadioButton-BzZTrq-i.cjs → RadioButton-BBc1b5vX.cjs} +37 -33
  37. package/dist/{RadioButton-DRdlp-HC.js → RadioButton-gnFz0TWN.js} +38 -34
  38. package/dist/RadioButtonGroup/index.cjs +3 -2
  39. package/dist/RadioButtonGroup/index.d.cts +2 -2
  40. package/dist/RadioButtonGroup/index.d.ts +2 -2
  41. package/dist/RadioButtonGroup/index.js +3 -2
  42. package/dist/{RadioButtonGroup-BHfAwrH7.js → RadioButtonGroup-DLLleeDX.js} +1 -1
  43. package/dist/{RadioButtonGroup-DU4_ZMJ2.cjs → RadioButtonGroup-DxOtcIdO.cjs} +1 -1
  44. package/dist/SearchAutocomplete/index.d.cts +2 -2
  45. package/dist/SearchAutocomplete/index.d.ts +2 -2
  46. package/dist/SearchFilter/index.cjs +3 -3
  47. package/dist/SearchFilter/index.d.cts +5 -5
  48. package/dist/SearchFilter/index.d.ts +5 -5
  49. package/dist/SearchFilter/index.js +3 -3
  50. package/dist/{SearchFilter-wjDCnNiW.js → SearchFilter-Bi0zqO3-.js} +1 -1
  51. package/dist/{SearchFilter-y4vrVBUC.cjs → SearchFilter-ylBowO7T.cjs} +1 -1
  52. package/dist/SearchInputForm/index.d.cts +2 -2
  53. package/dist/SearchResultsContent/index.cjs +5 -5
  54. package/dist/SearchResultsContent/index.d.cts +4 -4
  55. package/dist/SearchResultsContent/index.d.ts +4 -4
  56. package/dist/SearchResultsContent/index.js +5 -5
  57. package/dist/SearchResultsFilterSidebar/index.cjs +3 -3
  58. package/dist/SearchResultsFilterSidebar/index.d.cts +1 -1
  59. package/dist/SearchResultsFilterSidebar/index.d.ts +1 -1
  60. package/dist/SearchResultsFilterSidebar/index.js +3 -3
  61. package/dist/SearchResultsStates/index.cjs +5 -5
  62. package/dist/SearchResultsStates/index.d.cts +6 -6
  63. package/dist/SearchResultsStates/index.d.ts +6 -6
  64. package/dist/SearchResultsStates/index.js +5 -5
  65. package/dist/{SearchResultsStates-CP3HKZao.cjs → SearchResultsStates-BjFB9Qo9.cjs} +3 -3
  66. package/dist/{SearchResultsStates-DUSTcTQK.js → SearchResultsStates-D8Uz39yp.js} +3 -3
  67. package/dist/SparkleAnimation/index.d.cts +2 -2
  68. package/dist/SparkleAnimation/index.d.ts +2 -2
  69. package/dist/Spinner/index.d.cts +2 -2
  70. package/dist/Spinner/index.d.ts +2 -2
  71. package/dist/SuggestionButton/index.d.cts +2 -2
  72. package/dist/SuggestionButton/index.d.ts +2 -2
  73. package/dist/ToggleButton/index.d.cts +2 -2
  74. package/dist/{index-CY3-7i6i.d.cts → index-BB4Qbpmg.d.ts} +5 -5
  75. package/dist/{index-DELwJODl.d.ts → index-BqARXvZ6.d.cts} +5 -5
  76. package/dist/{index-OpwPXBH6.d.ts → index-Dfe_lkL2.d.cts} +2 -2
  77. package/dist/{index-4KapT-qa.d.cts → index-DmvaMYbj.d.ts} +2 -2
  78. package/package.json +1 -1
  79. package/src/components/ProductGrid/ProductGrid.tsx +4 -1
  80. package/src/components/RadioButton/RadioButton.tsx +10 -11
  81. /package/dist/{DynamicFiltersScrollbar-AhyHehrB.js → DynamicFiltersScrollbar-CJG4K0PH.js} +0 -0
  82. /package/dist/{DynamicFiltersScrollbar-50i_InZz.cjs → DynamicFiltersScrollbar-DgS9gpdg.cjs} +0 -0
  83. /package/dist/{ImageWithFallback-1LqhQK1q.cjs → ImageWithFallback-Bx17VPmQ.cjs} +0 -0
  84. /package/dist/{ImageWithFallback-Ckwsmd8P.js → ImageWithFallback-c-DTsBH-.js} +0 -0
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/Spinner/Spinner.d.ts
4
4
  type SpinnerProps = {
@@ -6,6 +6,6 @@ type SpinnerProps = {
6
6
  };
7
7
  declare const Spinner: ({
8
8
  className
9
- }: SpinnerProps) => react_jsx_runtime5.JSX.Element;
9
+ }: SpinnerProps) => react_jsx_runtime0.JSX.Element;
10
10
  //#endregion
11
11
  export { Spinner };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime28 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime23 from "react/jsx-runtime";
2
2
  import { TestProps } from "@envive-ai/react-hooks/types";
3
3
 
4
4
  //#region src/components/SuggestionButton/types.d.ts
@@ -30,6 +30,6 @@ declare const SuggestionButton: ({
30
30
  dataAttributes,
31
31
  dataTestId,
32
32
  onClick
33
- }: SuggestionButtonProps) => react_jsx_runtime28.JSX.Element;
33
+ }: SuggestionButtonProps) => react_jsx_runtime23.JSX.Element;
34
34
  //#endregion
35
35
  export { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton, SuggestionButtonVariant };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
  import { TestProps } from "@envive-ai/react-hooks/types";
3
3
 
4
4
  //#region src/components/SuggestionButton/types.d.ts
@@ -30,6 +30,6 @@ declare const SuggestionButton: ({
30
30
  dataAttributes,
31
31
  dataTestId,
32
32
  onClick
33
- }: SuggestionButtonProps) => react_jsx_runtime0.JSX.Element;
33
+ }: SuggestionButtonProps) => react_jsx_runtime1.JSX.Element;
34
34
  //#endregion
35
35
  export { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton, SuggestionButtonVariant };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime27 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/ToggleButton/ToggleButton.d.ts
4
4
  type ToggleButtonProps = {
@@ -25,6 +25,6 @@ declare const ToggleButton: ({
25
25
  icon,
26
26
  iconClassName,
27
27
  variant
28
- }: ToggleButtonProps) => react_jsx_runtime27.JSX.Element;
28
+ }: ToggleButtonProps) => react_jsx_runtime8.JSX.Element;
29
29
  //#endregion
30
30
  export { ToggleButton, ToggleButtonProps, ToggleButtonVariant };
@@ -1,6 +1,6 @@
1
- import * as react_jsx_runtime22 from "react/jsx-runtime";
2
- import { TestProps } from "@envive-ai/react-hooks/types";
3
1
  import { FC } from "react";
2
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
3
+ import { TestProps } from "@envive-ai/react-hooks/types";
4
4
  import { ResponseCategory, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
5
5
 
6
6
  //#region src/util/trim.d.ts
@@ -261,7 +261,7 @@ declare const RatingSummary: ({
261
261
  stars,
262
262
  reviewCount,
263
263
  className
264
- }: RatingSummaryProps) => react_jsx_runtime22.JSX.Element;
264
+ }: RatingSummaryProps) => react_jsx_runtime18.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) => react_jsx_runtime22.JSX.Element;
274
+ }: PriceSectionProps) => react_jsx_runtime18.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
  onClick
311
- }: ProductCardProps) => react_jsx_runtime22.JSX.Element;
311
+ }: ProductCardProps) => react_jsx_runtime18.JSX.Element;
312
312
  //#endregion
313
313
  //#region src/components/ProductCard/ProductCardSkeleton.d.ts
314
314
  declare const ProductCardSkeleton: FC<ProductCardSkeletonProps>;
@@ -1,6 +1,6 @@
1
- import { FC } from "react";
2
- import * as react_jsx_runtime16 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
3
2
  import { TestProps } from "@envive-ai/react-hooks/types";
3
+ import { FC } from "react";
4
4
  import { ResponseCategory, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
5
5
 
6
6
  //#region src/util/trim.d.ts
@@ -261,7 +261,7 @@ declare const RatingSummary: ({
261
261
  stars,
262
262
  reviewCount,
263
263
  className
264
- }: RatingSummaryProps) => react_jsx_runtime16.JSX.Element;
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) => react_jsx_runtime16.JSX.Element;
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
  onClick
311
- }: ProductCardProps) => react_jsx_runtime16.JSX.Element;
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 * as react_jsx_runtime8 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
  import { SearchFilterDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
3
3
 
4
4
  //#region src/components/SearchResultsFilterSidebar/types.d.ts
@@ -41,6 +41,6 @@ declare const SearchResultsFilter: ({
41
41
  onSelectFilterItem,
42
42
  onClearAllFilters,
43
43
  filterButtonText
44
- }: SearchResultsFilterProps) => react_jsx_runtime8.JSX.Element;
44
+ }: SearchResultsFilterProps) => react_jsx_runtime1.JSX.Element;
45
45
  //#endregion
46
46
  export { CloseIconVariant$1 as CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime5 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
  import { SearchFilterDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
3
3
 
4
4
  //#region src/components/SearchResultsFilterSidebar/types.d.ts
@@ -41,6 +41,6 @@ declare const SearchResultsFilter: ({
41
41
  onSelectFilterItem,
42
42
  onClearAllFilters,
43
43
  filterButtonText
44
- }: SearchResultsFilterProps) => react_jsx_runtime5.JSX.Element;
44
+ }: SearchResultsFilterProps) => react_jsx_runtime3.JSX.Element;
45
45
  //#endregion
46
46
  export { CloseIconVariant$1 as CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-toolkit",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "React component library for Envive services.",
5
5
  "keywords": [
6
6
  "react",
@@ -10,6 +10,7 @@ interface ProductGridProps {
10
10
  productCardConfig: ProductCardConfig;
11
11
  merchantShortName: string;
12
12
  cardsGrowWithContainer?: boolean;
13
+ onProductClick?: (product: SearchResponseProductAttributes['attributes'], index: number) => void;
13
14
  }
14
15
 
15
16
  export const ProductGrid = ({
@@ -19,6 +20,7 @@ export const ProductGrid = ({
19
20
  productCardConfig,
20
21
  merchantShortName,
21
22
  cardsGrowWithContainer = true,
23
+ onProductClick,
22
24
  }: ProductGridProps) => {
23
25
  const {
24
26
  productCardVariant,
@@ -35,7 +37,7 @@ export const ProductGrid = ({
35
37
 
36
38
  return (
37
39
  <div className={productGridClasses}>
38
- {productList.map((product: (typeof productList)[0]) => (
40
+ {productList.map((product: (typeof productList)[0], index: number) => (
39
41
  <div key={product.id} className={cardContainerClasses}>
40
42
  <ProductCard
41
43
  productCardConfig={productCardConfig}
@@ -53,6 +55,7 @@ export const ProductGrid = ({
53
55
  zoomOnHover={zoomOnHover}
54
56
  aspectRatio={productCardImageAspectRatio}
55
57
  growWithContainer={cardsGrowWithContainer}
58
+ onClick={() => onProductClick?.(product, index)}
56
59
  />
57
60
  </div>
58
61
  ))}
@@ -1,6 +1,7 @@
1
1
  import classNames from 'classnames';
2
2
  import { useState } from 'react';
3
3
  import { TestProps } from '@envive-ai/react-hooks/types';
4
+ import { Typography } from '../Typography';
4
5
 
5
6
  interface RadioButtonProps extends TestProps {
6
7
  isDisabled?: boolean;
@@ -55,7 +56,13 @@ export const RadioButton = ({
55
56
  };
56
57
 
57
58
  return (
58
- <>
59
+ <label
60
+ className={containerClassName}
61
+ onMouseEnter={() => !isDisabled && setIsHovered(true)}
62
+ onMouseLeave={() => setIsHovered(false)}
63
+ aria-label={label}
64
+ htmlFor={id}
65
+ >
59
66
  <div className="spiffy-tw-relative">
60
67
  <input
61
68
  type="radio"
@@ -80,15 +87,7 @@ export const RadioButton = ({
80
87
  {checked && <circle cx="12" cy="12" r="9" fill={getFillColor()} />}
81
88
  </svg>
82
89
  </div>
83
- <label
84
- className={containerClassName}
85
- onMouseEnter={() => !isDisabled && setIsHovered(true)}
86
- onMouseLeave={() => setIsHovered(false)}
87
- aria-label={label}
88
- htmlFor={id}
89
- >
90
- {label}
91
- </label>
92
- </>
90
+ <Typography variant="body3">{label}</Typography>
91
+ </label>
93
92
  );
94
93
  };