@usereactify/search 5.0.0-beta.10 → 5.0.0-beta.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.
Files changed (127) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +3 -21
  3. package/dist/package.json +1 -1
  4. package/dist/src/components/Example/ExampleFilterList.js +1 -1
  5. package/dist/src/components/Example/ExampleFilterList.js.map +1 -1
  6. package/dist/src/components/Example/ExampleFilterRange.js +1 -1
  7. package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
  8. package/dist/src/components/Example/ExampleFilterSlider.js +1 -1
  9. package/dist/src/components/Example/ExampleFilterSlider.js.map +1 -1
  10. package/dist/src/components/Example/ExampleFilters.d.ts +4 -0
  11. package/dist/src/components/Example/{ExampleFilterStack.js → ExampleFilters.js} +6 -5
  12. package/dist/src/components/Example/ExampleFilters.js.map +1 -0
  13. package/dist/src/components/Example/ExampleResultCardCallout.js +1 -1
  14. package/dist/src/components/Example/ExampleResultCardCallout.js.map +1 -1
  15. package/dist/src/components/Example/ExampleResultCardProduct.js +1 -1
  16. package/dist/src/components/Example/ExampleResultCardProduct.js.map +1 -1
  17. package/dist/src/components/Example/ExampleSortBy.d.ts +4 -0
  18. package/dist/src/components/Example/{ExampleSortby.js → ExampleSortBy.js} +4 -4
  19. package/dist/src/components/Example/{ExampleSortby.js.map → ExampleSortBy.js.map} +1 -1
  20. package/dist/src/components/Example/index.d.ts +2 -2
  21. package/dist/src/components/Example/index.js +2 -2
  22. package/dist/src/components/Example/index.js.map +1 -1
  23. package/dist/src/components/Filter/Filter.js +7 -19
  24. package/dist/src/components/Filter/Filter.js.map +1 -1
  25. package/dist/src/components/Filter/{FilterStack.d.ts → Filters.d.ts} +2 -2
  26. package/dist/src/components/Filter/{FilterStack.js → Filters.js} +7 -7
  27. package/dist/src/components/Filter/Filters.js.map +1 -0
  28. package/dist/src/components/Filter/index.d.ts +1 -1
  29. package/dist/src/components/Filter/index.js +1 -1
  30. package/dist/src/components/Filter/index.js.map +1 -1
  31. package/dist/src/components/{ReactifySearchBase/ReactifySearchBase.d.ts → ReactifySearchProvider/ReactifySearchProvider.d.ts} +5 -9
  32. package/dist/src/components/{ReactifySearchBase/ReactifySearchBase.js → ReactifySearchProvider/ReactifySearchProvider.js} +24 -20
  33. package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -0
  34. package/dist/src/components/ReactifySearchProvider/index.d.ts +1 -0
  35. package/dist/src/components/{ReactifySearchBase → ReactifySearchProvider}/index.js +1 -1
  36. package/dist/src/components/ReactifySearchProvider/index.js.map +1 -0
  37. package/dist/src/components/Result/{ResultStack.d.ts → Results.d.ts} +2 -2
  38. package/dist/src/components/Result/{ResultStack.js → Results.js} +44 -27
  39. package/dist/src/components/Result/Results.js.map +1 -0
  40. package/dist/src/components/Result/index.d.ts +1 -1
  41. package/dist/src/components/Result/index.js +1 -1
  42. package/dist/src/components/Result/index.js.map +1 -1
  43. package/dist/src/components/Sensor/SensorCollection.js +2 -2
  44. package/dist/src/components/Sensor/SensorCollection.js.map +1 -1
  45. package/dist/src/components/Sensor/SensorInventoryAvailable.js +1 -1
  46. package/dist/src/components/Sensor/SensorInventoryAvailable.js.map +1 -1
  47. package/dist/src/components/Sensor/SensorSort.js +13 -13
  48. package/dist/src/components/Sensor/SensorSort.js.map +1 -1
  49. package/dist/src/components/Sensor/Sensors.d.ts +3 -0
  50. package/dist/src/components/Sensor/{SensorStack.js → Sensors.js} +4 -4
  51. package/dist/src/components/Sensor/Sensors.js.map +1 -0
  52. package/dist/src/components/Sensor/index.d.ts +1 -1
  53. package/dist/src/components/Sensor/index.js +1 -1
  54. package/dist/src/components/Sensor/index.js.map +1 -1
  55. package/dist/src/components/SortBy/SortBy.d.ts +7 -0
  56. package/dist/src/components/{Sortby/Sortby.js → SortBy/SortBy.js} +7 -7
  57. package/dist/src/components/SortBy/SortBy.js.map +1 -0
  58. package/dist/src/components/SortBy/index.d.ts +1 -0
  59. package/dist/src/components/{Sortby → SortBy}/index.js +1 -1
  60. package/dist/src/components/{Sortby → SortBy}/index.js.map +1 -1
  61. package/dist/src/components/index.d.ts +2 -2
  62. package/dist/src/components/index.js +2 -2
  63. package/dist/src/components/index.js.map +1 -1
  64. package/dist/src/hooks/index.d.ts +2 -3
  65. package/dist/src/hooks/index.js +2 -3
  66. package/dist/src/hooks/index.js.map +1 -1
  67. package/dist/src/hooks/reactivesearch/index.d.ts +3 -3
  68. package/dist/src/hooks/reactivesearch/index.js +3 -3
  69. package/dist/src/hooks/reactivesearch/index.js.map +1 -1
  70. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js +2 -1
  71. package/dist/src/hooks/reactivesearch/useReactiveBaseProps.js.map +1 -1
  72. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.d.ts +1 -1
  73. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +2 -1
  74. package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -1
  75. package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js +2 -1
  76. package/dist/src/hooks/reactivesearch/useReactiveFilterListProps.js.map +1 -1
  77. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js +2 -1
  78. package/dist/src/hooks/reactivesearch/useReactiveFilterRangeProps.js.map +1 -1
  79. package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js +2 -1
  80. package/dist/src/hooks/reactivesearch/useReactiveFilterSharedProps.js.map +1 -1
  81. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js +2 -1
  82. package/dist/src/hooks/reactivesearch/useReactiveFilterSliderProps.js.map +1 -1
  83. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js +4 -4
  84. package/dist/src/hooks/reactivesearch/useReactiveReactProp.js.map +1 -1
  85. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.d.ts +5 -0
  86. package/dist/src/hooks/reactivesearch/{useReactiveResultStackProps.js → useReactiveReactiveListProps.js} +7 -6
  87. package/dist/src/hooks/reactivesearch/useReactiveReactiveListProps.js.map +1 -0
  88. package/dist/src/hooks/useCuration.js +2 -6
  89. package/dist/src/hooks/useCuration.js.map +1 -1
  90. package/dist/src/hooks/useFilterListProps.js +36 -9
  91. package/dist/src/hooks/useFilterListProps.js.map +1 -1
  92. package/dist/src/hooks/useFilters.d.ts +3 -2
  93. package/dist/src/hooks/useFilters.js +45 -11
  94. package/dist/src/hooks/useFilters.js.map +1 -1
  95. package/dist/src/hooks/usePaginationLoadMore.js +1 -1
  96. package/dist/src/hooks/usePaginationLoadMore.js.map +1 -1
  97. package/dist/src/hooks/useReactifySearchContext.d.ts +4 -12
  98. package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
  99. package/dist/src/hooks/useSearch.d.ts +1 -1
  100. package/dist/src/hooks/useSearch.js +25 -5
  101. package/dist/src/hooks/useSearch.js.map +1 -1
  102. package/dist/src/hooks/{useSortby.d.ts → useSortBy.d.ts} +1 -1
  103. package/dist/src/hooks/{useSortby.js → useSortBy.js} +5 -7
  104. package/dist/src/hooks/useSortBy.js.map +1 -0
  105. package/dist/src/utility/debug.d.ts +3 -1
  106. package/dist/src/utility/debug.js +6 -2
  107. package/dist/src/utility/debug.js.map +1 -1
  108. package/package.json +1 -1
  109. package/dist/src/components/Example/ExampleFilterStack.d.ts +0 -4
  110. package/dist/src/components/Example/ExampleFilterStack.js.map +0 -1
  111. package/dist/src/components/Example/ExampleSortby.d.ts +0 -4
  112. package/dist/src/components/Filter/FilterStack.js.map +0 -1
  113. package/dist/src/components/ReactifySearchBase/ReactifySearchBase.js.map +0 -1
  114. package/dist/src/components/ReactifySearchBase/index.d.ts +0 -1
  115. package/dist/src/components/ReactifySearchBase/index.js.map +0 -1
  116. package/dist/src/components/Result/ResultStack.js.map +0 -1
  117. package/dist/src/components/Sensor/SensorStack.d.ts +0 -3
  118. package/dist/src/components/Sensor/SensorStack.js.map +0 -1
  119. package/dist/src/components/Sortby/Sortby.d.ts +0 -7
  120. package/dist/src/components/Sortby/Sortby.js.map +0 -1
  121. package/dist/src/components/Sortby/index.d.ts +0 -1
  122. package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.d.ts +0 -17
  123. package/dist/src/hooks/reactivesearch/useReactiveResultStackProps.js.map +0 -1
  124. package/dist/src/hooks/useFilterStack.d.ts +0 -4
  125. package/dist/src/hooks/useFilterStack.js +0 -52
  126. package/dist/src/hooks/useFilterStack.js.map +0 -1
  127. package/dist/src/hooks/useSortby.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,8 +2,40 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [5.0.0-beta.13](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.12...v5.0.0-beta.13) (2022-08-03)
6
+
7
+
8
+ ### Features
9
+
10
+ * add breadcrumb for ES search result errors ([22ae301](https://bitbucket.org/usereactify/reactify-search-ui/commit/22ae301bbb7618aec14499970ffd2578ab569a7a))
11
+ * add breadcrumb for search query update ([6a2e442](https://bitbucket.org/usereactify/reactify-search-ui/commit/6a2e44269396353fced1d597d48502ef5b1a6bb2))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * use correct names of components and imports ([e180a75](https://bitbucket.org/usereactify/reactify-search-ui/commit/e180a75b0c4be555a61d72e48a54434b7aa27960))
17
+
18
+ ## [5.0.0-beta.12](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.11...v5.0.0-beta.12) (2022-07-27)
19
+
20
+
21
+ ### Features
22
+
23
+ * improve performance when debugging by reusing debugger instances ([aa88917](https://bitbucket.org/usereactify/reactify-search-ui/commit/aa88917b0aedf2abe66439d430587f18dcb72aae))
24
+
25
+ ## [5.0.0-beta.11](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.10...v5.0.0-beta.11) (2022-07-27)
26
+
5
27
  ## [5.0.0-beta.10](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.9...v5.0.0-beta.10) (2022-07-27)
6
28
 
29
+
30
+ ### Features
31
+
32
+ * improve classnames ([19fcfa1](https://bitbucket.org/usereactify/reactify-search-ui/commit/19fcfa152c555cb2e78ec62371f1758e2d244557))
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * check that window is defined before accessing ([e1ec0aa](https://bitbucket.org/usereactify/reactify-search-ui/commit/e1ec0aae22cab7eb86363ed09d47e422d08ff5c1))
38
+
7
39
  ## [5.0.0-beta.9](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.8...v5.0.0-beta.9) (2022-07-27)
8
40
 
9
41
 
package/README.md CHANGED
@@ -4,25 +4,9 @@ This library provides React components and hooks for building UI's for the [Reac
4
4
 
5
5
  The aim of this library is not to build a search and filter interface from the ground up. The aim of this library is to abstract the complexities of Reactify Search, whilst providing the developer a wide range of approaches and escape hatches to build in the way they want to. To do this, we wrap a mature Elasticsearch UI library called [Reactivesearch](https://github.com/appbaseio/reactivesearch) (similar name, but completely unaffiliated with Reactify Search).
6
6
 
7
- ## Getting started
7
+ ## Documentation
8
8
 
9
- ```sh
10
- npm install @reactify-apps/search
11
- ```
12
-
13
- You should always begin with the `Provider` component, which you need to pass the Reactify Search config and index name, using whichever mechanism is most appropriate for your project. Within the provider, you can then begin to render components from the `@reactify-apps/search` package or ordinary [Reactivesearch](https://github.com/appbaseio/reactivesearch) components.
14
-
15
- ```tsx
16
- import { Provider } from "@reactify-apps/search";
17
-
18
- export const YourComponent: React.FC = () => {
19
- return (
20
- <Provider index="my-cool-shop" config={config}>
21
- <YourComponents />
22
- </Provider>
23
- );
24
- };
25
- ```
9
+ All end-user documentation is available at https://search.docs.reactify.com.au which is powered by GitBooks.
26
10
 
27
11
  ## Contributing
28
12
 
@@ -40,7 +24,5 @@ npm run storybook
40
24
  npm run release
41
25
 
42
26
  # release a beta version
43
- npm run release -- --prerelease beta
44
-
45
- npm publish --tag beta
27
+ npm run release:beta
46
28
  ```
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@usereactify/search",
3
3
  "description": "React UI library for Reactify Search",
4
- "version": "5.0.0-beta.9",
4
+ "version": "5.0.0-beta.13",
5
5
  "license": "MIT",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ExampleFilterList = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const ExampleFilterList = (props) => {
9
- return (react_1.default.createElement(react_1.default.Fragment, null,
9
+ return (react_1.default.createElement("div", { className: "rs__filter" },
10
10
  react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
11
11
  react_1.default.createElement("ul", { className: "rs__filter__list" }, props.filterListProps.options.map((option) => (react_1.default.createElement("li", { key: option.key, className: "rs__filter__list-item" },
12
12
  react_1.default.createElement("label", { className: "rs__filter__list-item-label" },
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;IAC3E,OAAO,CACL;QACE,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,sCAAI,SAAS,EAAC,kBAAkB,IAC7B,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7C,sCAAI,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,SAAS,EAAC,uBAAuB;YACpD,yCAAO,SAAS,EAAC,6BAA6B;gBAC5C,yCACE,SAAS,EAAC,6BAA6B,EACvC,KAAK,EAAE,MAAM,CAAC,GAAG,EACjB,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAClC,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,GAE3C;gBACF,wCAAM,SAAS,EAAC,2BAA2B,IAAE,MAAM,CAAC,GAAG,CAAQ;gBAC/D,wCAAM,SAAS,EAAC,6BAA6B;;oBACzC,MAAM,CAAC,SAAS;wBACb,CACD,CACL,CACN,CAAC,CACC,CACJ,CACJ,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,iBAAiB,qBA2B5B","sourcesContent":["import React from \"react\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterListProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterList\"]>\n>;\n\nexport const ExampleFilterList: React.FC<ExampleFilterListProps> = (props) => {\n return (\n <>\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li key={option.key} className=\"rs__filter__list-item\">\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"checkbox\"\n checked={option.checked}\n onChange={({ target: { value } }) =>\n props.filterListProps.handleChange(value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.key}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;IAC3E,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,sCAAI,SAAS,EAAC,kBAAkB,IAC7B,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7C,sCAAI,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,SAAS,EAAC,uBAAuB;YACpD,yCAAO,SAAS,EAAC,6BAA6B;gBAC5C,yCACE,SAAS,EAAC,6BAA6B,EACvC,KAAK,EAAE,MAAM,CAAC,GAAG,EACjB,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAClC,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,GAE3C;gBACF,wCAAM,SAAS,EAAC,2BAA2B,IAAE,MAAM,CAAC,GAAG,CAAQ;gBAC/D,wCAAM,SAAS,EAAC,6BAA6B;;oBACzC,MAAM,CAAC,SAAS;wBACb,CACD,CACL,CACN,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,iBAAiB,qBA2B5B","sourcesContent":["import React from \"react\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterListProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterList\"]>\n>;\n\nexport const ExampleFilterList: React.FC<ExampleFilterListProps> = (props) => {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li key={option.key} className=\"rs__filter__list-item\">\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"checkbox\"\n checked={option.checked}\n onChange={({ target: { value } }) =>\n props.filterListProps.handleChange(value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.key}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"]}
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
8
8
  const SingleRange_1 = __importDefault(require("@appbaseio/reactivesearch/lib/components/range/SingleRange"));
9
9
  const ExampleFilterRange = (props) => {
10
10
  if (props.filter.handle === "price") {
11
- return (react_1.default.createElement(react_1.default.Fragment, null,
11
+ return (react_1.default.createElement("div", { className: "rs__filter" },
12
12
  react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
13
13
  react_1.default.createElement(SingleRange_1.default, Object.assign({ data: [
14
14
  { start: "0", label: "All prices" },
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6GAAqF;AAQ9E,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL;YACE,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YACzD,8BAAC,qBAAW,kBACV,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;oBACnC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;oBAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC9C,IACG,KAAK,CAAC,wBAAwB,EAClC,CACD,CACJ,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B","sourcesContent":["import React from \"react\";\nimport SingleRange from \"@appbaseio/reactivesearch/lib/components/range/SingleRange\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterRangeProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterRange\"]>\n>;\n\nexport const ExampleFilterRange: React.FC<ExampleFilterRangeProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <>\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <SingleRange\n data={[\n { start: \"0\", label: \"All prices\" },\n { start: \"0\", end: \"99\", label: \"Under $100\" },\n { start: \"0\", end: \"49\", label: \"Under $50\" },\n ]}\n {...props.reactiveFilterRangeProps}\n />\n </>\n );\n }\n\n return null;\n};\n"]}
1
+ {"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,6GAAqF;AAQ9E,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;YACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YACzD,8BAAC,qBAAW,kBACV,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE;oBACnC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;oBAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;iBAC9C,IACG,KAAK,CAAC,wBAAwB,EAClC,CACE,CACP,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B","sourcesContent":["import React from \"react\";\nimport SingleRange from \"@appbaseio/reactivesearch/lib/components/range/SingleRange\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterRangeProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterRange\"]>\n>;\n\nexport const ExampleFilterRange: React.FC<ExampleFilterRangeProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <SingleRange\n data={[\n { start: \"0\", label: \"All prices\" },\n { start: \"0\", end: \"99\", label: \"Under $100\" },\n { start: \"0\", end: \"49\", label: \"Under $50\" },\n ]}\n {...props.reactiveFilterRangeProps}\n />\n </div>\n );\n }\n\n return null;\n};\n"]}
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
8
8
  const reactivesearch_1 = require("@appbaseio/reactivesearch");
9
9
  const ExampleFilterSlider = (props) => {
10
10
  if (props.filter.handle === "price") {
11
- return (react_1.default.createElement(react_1.default.Fragment, null,
11
+ return (react_1.default.createElement("div", { className: "rs__filter" },
12
12
  react_1.default.createElement("h3", { className: "rs__filter__name" }, props.filter.name),
13
13
  react_1.default.createElement(reactivesearch_1.RangeSlider, Object.assign({ range: {
14
14
  start: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAAwD;AAQjD,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL;YACE,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YACzD,8BAAC,4BAAW,kBACV,KAAK,EAAE;oBACL,KAAK,EAAE,CAAC;oBACR,GAAG,EAAE,GAAG;iBACT,IACG,KAAK,CAAC,yBAAyB,EACnC,CACD,CACJ,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnBW,QAAA,mBAAmB,uBAmB9B","sourcesContent":["import React from \"react\";\nimport { RangeSlider } from \"@appbaseio/reactivesearch\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterSliderProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterSlider\"]>\n>;\n\nexport const ExampleFilterSlider: React.FC<ExampleFilterSliderProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <>\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <RangeSlider\n range={{\n start: 0,\n end: 500,\n }}\n {...props.reactiveFilterSliderProps}\n />\n </>\n );\n }\n\n return null;\n};\n"]}
1
+ {"version":3,"file":"ExampleFilterSlider.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterSlider.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAAwD;AAQjD,MAAM,mBAAmB,GAAuC,CACrE,KAAK,EACL,EAAE;IACF,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE;QACnC,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;YACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;YACzD,8BAAC,4BAAW,kBACV,KAAK,EAAE;oBACL,KAAK,EAAE,CAAC;oBACR,GAAG,EAAE,GAAG;iBACT,IACG,KAAK,CAAC,yBAAyB,EACnC,CACE,CACP,CAAC;KACH;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAnBW,QAAA,mBAAmB,uBAmB9B","sourcesContent":["import React from \"react\";\nimport { RangeSlider } from \"@appbaseio/reactivesearch\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterSliderProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterSlider\"]>\n>;\n\nexport const ExampleFilterSlider: React.FC<ExampleFilterSliderProps> = (\n props\n) => {\n if (props.filter.handle === \"price\") {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <RangeSlider\n range={{\n start: 0,\n end: 500,\n }}\n {...props.reactiveFilterSliderProps}\n />\n </div>\n );\n }\n\n return null;\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { FiltersProps } from "../../components";
3
+ export declare type ExampleFiltersProps = React.ComponentProps<NonNullable<FiltersProps["renderFilters"]>>;
4
+ export declare const ExampleFilters: React.FC<ExampleFiltersProps>;
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExampleFilterStack = void 0;
6
+ exports.ExampleFilters = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const components_1 = require("../../components");
9
- const ExampleFilterStack = (props) => {
10
- return (react_1.default.createElement(react_1.default.Fragment, null, props.filters.map((filter) => (react_1.default.createElement(components_1.Filter, Object.assign({ key: filter.id, filter: filter }, props))))));
9
+ const ExampleFilters = (props) => {
10
+ var _a;
11
+ return (react_1.default.createElement(react_1.default.Fragment, null, (_a = props.filterStack) === null || _a === void 0 ? void 0 : _a.options.map((filter) => (react_1.default.createElement(components_1.Filter, Object.assign({ key: filter.id, filter: filter }, props))))));
11
12
  };
12
- exports.ExampleFilterStack = ExampleFilterStack;
13
- //# sourceMappingURL=ExampleFilterStack.js.map
13
+ exports.ExampleFilters = ExampleFilters;
14
+ //# sourceMappingURL=ExampleFilters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAAwD;AAMjD,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;;IACrE,OAAO,CACL,8DACG,MAAA,KAAK,CAAC,WAAW,0CAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC1C,8BAAC,mBAAM,kBAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,IAAM,KAAK,EAAI,CACtD,CAAC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB","sourcesContent":["import React from \"react\";\n\nimport { Filter, FiltersProps } from \"../../components\";\n\nexport type ExampleFiltersProps = React.ComponentProps<\n NonNullable<FiltersProps[\"renderFilters\"]>\n>;\n\nexport const ExampleFilters: React.FC<ExampleFiltersProps> = (props) => {\n return (\n <>\n {props.filterStack?.options.map((filter) => (\n <Filter key={filter.id} filter={filter} {...props} />\n ))}\n </>\n );\n};\n"]}
@@ -13,7 +13,7 @@ const ExampleResultCardCallout = (props) => {
13
13
  gridColumn: `span ${(_b = props.callout.displayColumns) !== null && _b !== void 0 ? _b : 1}`,
14
14
  });
15
15
  }, [props.callout]);
16
- return (react_1.default.createElement("div", { className: "rs__result-card-callout__wrapper", ref: props.itemRef, style: styleProp },
16
+ return (react_1.default.createElement("div", { className: "rs__result-card-callout", ref: props.itemRef, style: styleProp },
17
17
  react_1.default.createElement("a", { className: "rs__result-card-callout__link", href: props.callout.link, onClick: props.handleClick },
18
18
  props.callout.desktopImage && (react_1.default.createElement("img", { className: "rs__result-card-callout__image", src: props.callout.desktopImage, width: "100%" })),
19
19
  react_1.default.createElement("span", { className: "rs__result-card-callout__title" }, props.callout.title))));
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,SAAS,GAAG,eAAK,CAAC,OAAO,CAC7B,GAAG,EAAE;;QAAC,OAAA,CAAC;YACL,OAAO,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,WAAW,mCAAI,CAAC,EAAE;YACjD,UAAU,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,cAAc,mCAAI,CAAC,EAAE;SACxD,CAAC,CAAA;KAAA,EACF,CAAC,KAAK,CAAC,OAAO,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,uCACE,SAAS,EAAC,kCAAkC,EAC5C,GAAG,EAAE,KAAK,CAAC,OAAO,EAClB,KAAK,EAAE,SAAS;QAEhB,qCACE,SAAS,EAAC,+BAA+B,EACzC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EACxB,OAAO,EAAE,KAAK,CAAC,WAAW;YAEzB,KAAK,CAAC,OAAO,CAAC,YAAY,IAAI,CAC7B,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAC/B,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAlCS,QAAA,wBAAwB,4BAkCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardCalloutProps } from \"../../components\";\n\nexport type ExampleResultCardCalloutProps = React.ComponentProps<\n NonNullable<ResultCardCalloutProps[\"render\"]>\n>;\n\nexport const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps> =\n (props) => {\n const styleProp = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () => ({\n gridRow: `span ${props.callout.displayRows ?? 1}`,\n gridColumn: `span ${props.callout.displayColumns ?? 1}`,\n }),\n [props.callout]\n );\n\n return (\n <div\n className=\"rs__result-card-callout__wrapper\"\n ref={props.itemRef}\n style={styleProp}\n >\n <a\n className=\"rs__result-card-callout__link\"\n href={props.callout.link}\n onClick={props.handleClick}\n >\n {props.callout.desktopImage && (\n <img\n className=\"rs__result-card-callout__image\"\n src={props.callout.desktopImage}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-callout__title\">\n {props.callout.title}\n </span>\n </a>\n </div>\n );\n };\n"]}
1
+ {"version":3,"file":"ExampleResultCardCallout.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardCallout.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,SAAS,GAAG,eAAK,CAAC,OAAO,CAC7B,GAAG,EAAE;;QAAC,OAAA,CAAC;YACL,OAAO,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,WAAW,mCAAI,CAAC,EAAE;YACjD,UAAU,EAAE,QAAQ,MAAA,KAAK,CAAC,OAAO,CAAC,cAAc,mCAAI,CAAC,EAAE;SACxD,CAAC,CAAA;KAAA,EACF,CAAC,KAAK,CAAC,OAAO,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,uCACE,SAAS,EAAC,yBAAyB,EACnC,GAAG,EAAE,KAAK,CAAC,OAAO,EAClB,KAAK,EAAE,SAAS;QAEhB,qCACE,SAAS,EAAC,+BAA+B,EACzC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EACxB,OAAO,EAAE,KAAK,CAAC,WAAW;YAEzB,KAAK,CAAC,OAAO,CAAC,YAAY,IAAI,CAC7B,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAC/B,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAlCS,QAAA,wBAAwB,4BAkCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardCalloutProps } from \"../../components\";\n\nexport type ExampleResultCardCalloutProps = React.ComponentProps<\n NonNullable<ResultCardCalloutProps[\"render\"]>\n>;\n\nexport const ExampleResultCardCallout: React.FC<ExampleResultCardCalloutProps> =\n (props) => {\n const styleProp = React.useMemo<React.HTMLAttributes<HTMLElement>[\"style\"]>(\n () => ({\n gridRow: `span ${props.callout.displayRows ?? 1}`,\n gridColumn: `span ${props.callout.displayColumns ?? 1}`,\n }),\n [props.callout]\n );\n\n return (\n <div\n className=\"rs__result-card-callout\"\n ref={props.itemRef}\n style={styleProp}\n >\n <a\n className=\"rs__result-card-callout__link\"\n href={props.callout.link}\n onClick={props.handleClick}\n >\n {props.callout.desktopImage && (\n <img\n className=\"rs__result-card-callout__image\"\n src={props.callout.desktopImage}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-callout__title\">\n {props.callout.title}\n </span>\n </a>\n </div>\n );\n };\n"]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ExampleResultCardProduct = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const ExampleResultCardProduct = (props) => {
9
- return (react_1.default.createElement("div", { ref: props.itemRef, className: "rs__result-card-product__wrapper" },
9
+ return (react_1.default.createElement("div", { ref: props.itemRef, className: "rs__result-card-product" },
10
10
  react_1.default.createElement("a", { className: "rs__result-card-product__link", onClick: props.handleClick, href: `/products/${props.product.handle}` },
11
11
  props.product.image && (react_1.default.createElement("img", { className: "rs__result-card-product__image", src: props.product.image, width: "100%" })),
12
12
  react_1.default.createElement("span", { className: "rs__result-card-product__title" }, props.product.title)),
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,uCAAK,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAC,kCAAkC;QACnE,qCACE,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAE,KAAK,CAAC,WAAW,EAC1B,IAAI,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;YAExC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CACtB,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EACxB,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL;QACJ,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,cAAc,CAChB;QACN,KAAK,CAAC,MAAM,IAAI,CACf,wCACE,SAAS,EAAC,qCAAqC,EAC/C,KAAK,EAAE;gBACL,cAAc,EAAE,cAAc;aAC/B,IAEA,KAAK,CAAC,uBAAuB,CACzB,CACR,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAnCS,QAAA,wBAAwB,4BAmCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardProductProps } from \"../../components\";\n\nexport type ExampleResultCardProductProps = React.ComponentProps<\n NonNullable<ResultCardProductProps[\"render\"]>\n>;\n\nexport const ExampleResultCardProduct: React.FC<ExampleResultCardProductProps> =\n (props) => {\n return (\n <div ref={props.itemRef} className=\"rs__result-card-product__wrapper\">\n <a\n className=\"rs__result-card-product__link\"\n onClick={props.handleClick}\n href={`/products/${props.product.handle}`}\n >\n {props.product.image && (\n <img\n className=\"rs__result-card-product__image\"\n src={props.product.image}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-product__title\">\n {props.product.title}\n </span>\n </a>\n <span className=\"rs__result-card-product__price\">\n {props.formattedPrice}\n </span>\n {props.onSale && (\n <span\n className=\"rs__result-card-product__price-sale\"\n style={{\n textDecoration: \"line-through\",\n }}\n >\n {props.formattedCompareAtPrice}\n </span>\n )}\n </div>\n );\n };\n"]}
1
+ {"version":3,"file":"ExampleResultCardProduct.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResultCardProduct.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,wBAAwB,GACnC,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,CACL,uCAAK,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAC,yBAAyB;QAC1D,qCACE,SAAS,EAAC,+BAA+B,EACzC,OAAO,EAAE,KAAK,CAAC,WAAW,EAC1B,IAAI,EAAE,aAAa,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;YAExC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CACtB,uCACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EACxB,KAAK,EAAC,MAAM,GACZ,CACH;YACD,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CACf,CACL;QACJ,wCAAM,SAAS,EAAC,gCAAgC,IAC7C,KAAK,CAAC,cAAc,CAChB;QACN,KAAK,CAAC,MAAM,IAAI,CACf,wCACE,SAAS,EAAC,qCAAqC,EAC/C,KAAK,EAAE;gBACL,cAAc,EAAE,cAAc;aAC/B,IAEA,KAAK,CAAC,uBAAuB,CACzB,CACR,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAnCS,QAAA,wBAAwB,4BAmCjC","sourcesContent":["import React from \"react\";\n\nimport { ResultCardProductProps } from \"../../components\";\n\nexport type ExampleResultCardProductProps = React.ComponentProps<\n NonNullable<ResultCardProductProps[\"render\"]>\n>;\n\nexport const ExampleResultCardProduct: React.FC<ExampleResultCardProductProps> =\n (props) => {\n return (\n <div ref={props.itemRef} className=\"rs__result-card-product\">\n <a\n className=\"rs__result-card-product__link\"\n onClick={props.handleClick}\n href={`/products/${props.product.handle}`}\n >\n {props.product.image && (\n <img\n className=\"rs__result-card-product__image\"\n src={props.product.image}\n width=\"100%\"\n />\n )}\n <span className=\"rs__result-card-product__title\">\n {props.product.title}\n </span>\n </a>\n <span className=\"rs__result-card-product__price\">\n {props.formattedPrice}\n </span>\n {props.onSale && (\n <span\n className=\"rs__result-card-product__price-sale\"\n style={{\n textDecoration: \"line-through\",\n }}\n >\n {props.formattedCompareAtPrice}\n </span>\n )}\n </div>\n );\n };\n"]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { SortByProps } from "../../components";
3
+ export declare type ExampleSortByProps = React.ComponentProps<NonNullable<SortByProps["renderSortOptions"]>>;
4
+ export declare const ExampleSortBy: React.FC<ExampleSortByProps>;
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ExampleSortby = void 0;
6
+ exports.ExampleSortBy = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
- const ExampleSortby = (props) => {
8
+ const ExampleSortBy = (props) => {
9
9
  var _a;
10
10
  return (react_1.default.createElement("select", { className: "rs__sortby__select", value: (_a = props.sortOption) === null || _a === void 0 ? void 0 : _a.handle, onChange: (event) => props.setSortOption(event.target.value) }, props.sortOptions.map((sortOption) => (react_1.default.createElement("option", { key: sortOption.handle, className: "rs__sortby__option", value: sortOption.handle }, sortOption.name)))));
11
11
  };
12
- exports.ExampleSortby = ExampleSortby;
13
- //# sourceMappingURL=ExampleSortby.js.map
12
+ exports.ExampleSortBy = ExampleSortBy;
13
+ //# sourceMappingURL=ExampleSortBy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleSortby.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSortby.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;;IACnE,OAAO,CACL,0CACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAE3D,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACrC,0CACE,GAAG,EAAE,UAAU,CAAC,MAAM,EACtB,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,UAAU,CAAC,MAAM,IAEvB,UAAU,CAAC,IAAI,CACT,CACV,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB","sourcesContent":["import React from \"react\";\n\nimport { SortbyProps } from \"../../components\";\n\nexport type ExampleSortbyProps = React.ComponentProps<\n NonNullable<SortbyProps[\"renderSortOptions\"]>\n>;\n\nexport const ExampleSortby: React.FC<ExampleSortbyProps> = (props) => {\n return (\n <select\n className=\"rs__sortby__select\"\n value={props.sortOption?.handle}\n onChange={(event) => props.setSortOption(event.target.value)}\n >\n {props.sortOptions.map((sortOption) => (\n <option\n key={sortOption.handle}\n className=\"rs__sortby__option\"\n value={sortOption.handle}\n >\n {sortOption.name}\n </option>\n ))}\n </select>\n );\n};\n"]}
1
+ {"version":3,"file":"ExampleSortBy.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSortBy.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;;IACnE,OAAO,CACL,0CACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,MAAA,KAAK,CAAC,UAAU,0CAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAE3D,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACrC,0CACE,GAAG,EAAE,UAAU,CAAC,MAAM,EACtB,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,UAAU,CAAC,MAAM,IAEvB,UAAU,CAAC,IAAI,CACT,CACV,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB","sourcesContent":["import React from \"react\";\n\nimport { SortByProps } from \"../../components\";\n\nexport type ExampleSortByProps = React.ComponentProps<\n NonNullable<SortByProps[\"renderSortOptions\"]>\n>;\n\nexport const ExampleSortBy: React.FC<ExampleSortByProps> = (props) => {\n return (\n <select\n className=\"rs__sortby__select\"\n value={props.sortOption?.handle}\n onChange={(event) => props.setSortOption(event.target.value)}\n >\n {props.sortOptions.map((sortOption) => (\n <option\n key={sortOption.handle}\n className=\"rs__sortby__option\"\n value={sortOption.handle}\n >\n {sortOption.name}\n </option>\n ))}\n </select>\n );\n};\n"]}
@@ -1,10 +1,10 @@
1
1
  export * from "./ExampleFilterList";
2
2
  export * from "./ExampleFilterRange";
3
3
  export * from "./ExampleFilterSlider";
4
- export * from "./ExampleFilterStack";
4
+ export * from "./ExampleFilters";
5
5
  export * from "./ExampleResultCardCallout";
6
6
  export * from "./ExampleResultCardProduct";
7
7
  export * from "./ExampleResultPaginationNumbered";
8
8
  export * from "./ExampleResultPaginationLoadMore";
9
9
  export * from "./ExampleResultPaginationNextPrev";
10
- export * from "./ExampleSortby";
10
+ export * from "./ExampleSortBy";
@@ -13,11 +13,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./ExampleFilterList"), exports);
14
14
  __exportStar(require("./ExampleFilterRange"), exports);
15
15
  __exportStar(require("./ExampleFilterSlider"), exports);
16
- __exportStar(require("./ExampleFilterStack"), exports);
16
+ __exportStar(require("./ExampleFilters"), exports);
17
17
  __exportStar(require("./ExampleResultCardCallout"), exports);
18
18
  __exportStar(require("./ExampleResultCardProduct"), exports);
19
19
  __exportStar(require("./ExampleResultPaginationNumbered"), exports);
20
20
  __exportStar(require("./ExampleResultPaginationLoadMore"), exports);
21
21
  __exportStar(require("./ExampleResultPaginationNextPrev"), exports);
22
- __exportStar(require("./ExampleSortby"), exports);
22
+ __exportStar(require("./ExampleSortBy"), exports);
23
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,uDAAqC;AACrC,6DAA0C;AAC1C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,oEAAkD;AAClD,kDAAgC","sourcesContent":["export * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilterStack\";\nexport * from \"./ExampleResultCardCallout\"\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSortby\";"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Example/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,wDAAsC;AACtC,mDAAiC;AACjC,6DAA2C;AAC3C,6DAA2C;AAC3C,oEAAkD;AAClD,oEAAkD;AAClD,oEAAkD;AAClD,kDAAgC","sourcesContent":["export * from \"./ExampleFilterList\";\nexport * from \"./ExampleFilterRange\";\nexport * from \"./ExampleFilterSlider\";\nexport * from \"./ExampleFilters\";\nexport * from \"./ExampleResultCardCallout\";\nexport * from \"./ExampleResultCardProduct\";\nexport * from \"./ExampleResultPaginationNumbered\";\nexport * from \"./ExampleResultPaginationLoadMore\";\nexport * from \"./ExampleResultPaginationNextPrev\";\nexport * from \"./ExampleSortBy\";\n"]}
@@ -22,16 +22,16 @@ const hooks_1 = require("../../hooks");
22
22
  const components_1 = require("../../components");
23
23
  const Filter = (props) => {
24
24
  if ("single" === props.filter.displayType) {
25
- return (react_1.default.createElement(FilterSingleList, Object.assign({}, props)));
25
+ return react_1.default.createElement(FilterSingleList, Object.assign({}, props));
26
26
  }
27
27
  if ("multi" === props.filter.displayType) {
28
- return (react_1.default.createElement(FilterMultiList, Object.assign({}, props)));
28
+ return react_1.default.createElement(FilterMultiList, Object.assign({}, props));
29
29
  }
30
30
  if ("range" === props.filter.displayType) {
31
- return (react_1.default.createElement(FilterRange, Object.assign({}, props)));
31
+ return react_1.default.createElement(FilterRange, Object.assign({}, props));
32
32
  }
33
33
  if ("slider" === props.filter.displayType) {
34
- return (react_1.default.createElement(FilterSlider, Object.assign({}, props)));
34
+ return react_1.default.createElement(FilterSlider, Object.assign({}, props));
35
35
  }
36
36
  console.log(`filter with display type "${props.filter.displayType}" not yet supported`);
37
37
  return null;
@@ -64,27 +64,15 @@ const FilterSlider = (props) => {
64
64
  // inner component exists only so we can use memos in reactivesearch render functions
65
65
  const FilterListInner = (props) => {
66
66
  const { filter, renderFilterList, reactivesearchFilterProps } = props, otherProps = __rest(props, ["filter", "renderFilterList", "reactivesearchFilterProps"]);
67
- const { track } = (0, hooks_1.useAnalytics)();
68
- const _a = (0, hooks_1.useFilterListProps)(filter, reactivesearchFilterProps), { handleChange } = _a, filterListProps = __rest(_a, ["handleChange"]);
69
- const handleFilterChange = react_1.default.useCallback((value) => {
70
- handleChange(value);
71
- track({
72
- eventName: "filterChange",
73
- payload: {
74
- name: filter.name,
75
- value: value,
76
- },
77
- });
78
- }, [filterListProps]);
79
- const updatedFilterListProps = Object.assign(Object.assign({}, filterListProps), { handleChange: handleFilterChange });
67
+ const filterListProps = (0, hooks_1.useFilterListProps)(filter, reactivesearchFilterProps);
80
68
  // hide entire filter when no options available
81
69
  if (0 === filterListProps.options.length) {
82
70
  return null;
83
71
  }
84
72
  if (renderFilterList) {
85
73
  const Component = renderFilterList;
86
- return (react_1.default.createElement(Component, Object.assign({ filterListProps: updatedFilterListProps, filter: filter }, otherProps)));
74
+ return (react_1.default.createElement(Component, Object.assign({ filterListProps: filterListProps, filter: filter }, otherProps)));
87
75
  }
88
- return (react_1.default.createElement(components_1.ExampleFilterList, Object.assign({ filterListProps: updatedFilterListProps, filter: filter }, otherProps)));
76
+ return (react_1.default.createElement(components_1.ExampleFilterList, Object.assign({ filterListProps: filterListProps, filter: filter }, otherProps)));
89
77
  };
90
78
  //# sourceMappingURL=Filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":"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","sourcesContent":["import React from \"react\";\nimport MultiList from \"@appbaseio/reactivesearch/lib/components/list/MultiList\";\nimport SingleList from \"@appbaseio/reactivesearch/lib/components/list/SingleList\";\n\nimport type { ConfigFilterOption, ReactivesearchFilterProps } from \"../../types\";\nimport { useAnalytics, useFilterListProps, useReactiveFilterListProps, useReactiveFilterRangeProps, useReactiveFilterSliderProps } from \"../../hooks\";\nimport { ExampleFilterList } from \"../../components\";\n\n\nexport type FilterProps = {\n /** The filter option being rendered */\n filter: ConfigFilterOption;\n /** Render method for List filters */\n renderFilterList?: React.FC<Omit<FilterProps, \"renderFilterList\"> & {\n filterListProps: ReturnType<typeof useFilterListProps>;\n }>;\n /** Render method for Range filters */\n renderFilterRange?: React.FC<Omit<FilterProps, \"renderFilterRange\"> & {\n reactiveFilterRangeProps: ReturnType<typeof useReactiveFilterRangeProps>;\n }>;\n /** Render method for Slider filters */\n renderFilterSlider?: React.FC<Omit<FilterProps, \"renderFilterSlider\"> & {\n reactiveFilterSliderProps: ReturnType<typeof useReactiveFilterSliderProps>;\n }>;\n};\n\nexport const Filter: React.FC<FilterProps> = (props) => {\n if (\"single\" === props.filter.displayType) {\n return (\n <FilterSingleList {...props} />\n )\n }\n\n if (\"multi\" === props.filter.displayType) {\n return (\n <FilterMultiList {...props} />\n )\n }\n\n if (\"range\" === props.filter.displayType) {\n return (\n <FilterRange {...props} />\n )\n }\n\n if (\"slider\" === props.filter.displayType) {\n return (\n <FilterSlider {...props} />\n )\n }\n\n console.log(\n `filter with display type \"${props.filter.displayType}\" not yet supported`\n );\n\n return null;\n};\n\nconst FilterSingleList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <SingleList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n}\n\nconst FilterMultiList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <MultiList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n}\n\nconst FilterRange: React.FC<FilterProps> = (props) => {\n const reactiveFilterRangeProps = useReactiveFilterRangeProps(props.filter);\n\n if (props.renderFilterRange) {\n const Component = props.renderFilterRange;\n\n return (\n <Component\n {...props}\n reactiveFilterRangeProps={reactiveFilterRangeProps}\n />\n )\n }\n \n return null;\n}\n\nconst FilterSlider: React.FC<FilterProps> = (props) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n if (props.renderFilterSlider) {\n const Component = props.renderFilterSlider;\n\n return (\n <Component\n {...props}\n reactiveFilterSliderProps={reactiveFilterSliderProps}\n />\n )\n }\n\n return null;\n}\n\n// inner component exists only so we can use memos in reactivesearch render functions\nconst FilterListInner: React.FC<\n FilterProps & { reactivesearchFilterProps: ReactivesearchFilterProps }\n> = (props) => {\n const {\n filter,\n renderFilterList,\n reactivesearchFilterProps,\n ...otherProps\n } = props;\n\n const { track } = useAnalytics();\n\n const { handleChange, ...filterListProps } = useFilterListProps(\n filter,\n reactivesearchFilterProps\n );\n\n const handleFilterChange = React.useCallback(\n (value: string) => {\n handleChange(value);\n track({\n eventName: \"filterChange\",\n payload: {\n name: filter.name,\n value: value,\n },\n });\n },\n [filterListProps]\n );\n\n const updatedFilterListProps = {\n ...filterListProps,\n handleChange: handleFilterChange,\n };\n\n // hide entire filter when no options available\n if (0 === filterListProps.options.length) {\n return null;\n }\n\n if (renderFilterList) {\n const Component = renderFilterList;\n return (\n <Component\n filterListProps={updatedFilterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n }\n\n return (\n <ExampleFilterList\n filterListProps={updatedFilterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n};\n"]}
1
+ {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filter.tsx"],"names":[],"mappings":"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","sourcesContent":["import React from \"react\";\nimport MultiList from \"@appbaseio/reactivesearch/lib/components/list/MultiList\";\nimport SingleList from \"@appbaseio/reactivesearch/lib/components/list/SingleList\";\n\nimport type {\n ConfigFilterOption,\n ReactivesearchFilterProps,\n} from \"../../types\";\nimport {\n useAnalytics,\n useFilterListProps,\n useReactiveFilterListProps,\n useReactiveFilterRangeProps,\n useReactiveFilterSliderProps,\n} from \"../../hooks\";\nimport { ExampleFilterList } from \"../../components\";\nimport { debug } from \"../../utility\";\n\nexport type FilterProps = {\n /** The filter option being rendered */\n filter: ConfigFilterOption;\n /** Render method for List filters */\n renderFilterList?: React.FC<\n Omit<FilterProps, \"renderFilterList\"> & {\n filterListProps: ReturnType<typeof useFilterListProps>;\n }\n >;\n /** Render method for Range filters */\n renderFilterRange?: React.FC<\n Omit<FilterProps, \"renderFilterRange\"> & {\n reactiveFilterRangeProps: ReturnType<typeof useReactiveFilterRangeProps>;\n }\n >;\n /** Render method for Slider filters */\n renderFilterSlider?: React.FC<\n Omit<FilterProps, \"renderFilterSlider\"> & {\n reactiveFilterSliderProps: ReturnType<\n typeof useReactiveFilterSliderProps\n >;\n }\n >;\n};\n\nexport const Filter: React.FC<FilterProps> = (props) => {\n if (\"single\" === props.filter.displayType) {\n return <FilterSingleList {...props} />;\n }\n\n if (\"multi\" === props.filter.displayType) {\n return <FilterMultiList {...props} />;\n }\n\n if (\"range\" === props.filter.displayType) {\n return <FilterRange {...props} />;\n }\n\n if (\"slider\" === props.filter.displayType) {\n return <FilterSlider {...props} />;\n }\n\n console.log(\n `filter with display type \"${props.filter.displayType}\" not yet supported`\n );\n\n return null;\n};\n\nconst FilterSingleList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <SingleList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n};\n\nconst FilterMultiList: React.FC<FilterProps> = (props) => {\n const reactiveFilterListProps = useReactiveFilterListProps(props.filter);\n\n return (\n <MultiList\n {...reactiveFilterListProps}\n render={(reactivesearchFilterProps: ReactivesearchFilterProps) => (\n <FilterListInner\n {...props}\n reactivesearchFilterProps={reactivesearchFilterProps}\n />\n )}\n />\n );\n};\n\nconst FilterRange: React.FC<FilterProps> = (props) => {\n const reactiveFilterRangeProps = useReactiveFilterRangeProps(props.filter);\n\n if (props.renderFilterRange) {\n const Component = props.renderFilterRange;\n\n return (\n <Component\n {...props}\n reactiveFilterRangeProps={reactiveFilterRangeProps}\n />\n );\n }\n\n return null;\n};\n\nconst FilterSlider: React.FC<FilterProps> = (props) => {\n const reactiveFilterSliderProps = useReactiveFilterSliderProps(props.filter);\n\n if (props.renderFilterSlider) {\n const Component = props.renderFilterSlider;\n\n return (\n <Component\n {...props}\n reactiveFilterSliderProps={reactiveFilterSliderProps}\n />\n );\n }\n\n return null;\n};\n\n// inner component exists only so we can use memos in reactivesearch render functions\nconst FilterListInner: React.FC<\n FilterProps & { reactivesearchFilterProps: ReactivesearchFilterProps }\n> = (props) => {\n const { filter, renderFilterList, reactivesearchFilterProps, ...otherProps } =\n props;\n\n const filterListProps = useFilterListProps(filter, reactivesearchFilterProps);\n\n // hide entire filter when no options available\n if (0 === filterListProps.options.length) {\n return null;\n }\n\n if (renderFilterList) {\n const Component = renderFilterList;\n return (\n <Component\n filterListProps={filterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n }\n\n return (\n <ExampleFilterList\n filterListProps={filterListProps}\n filter={filter}\n {...otherProps}\n />\n );\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { useFilters } from "../../hooks";
3
- export declare type FilterStackProps = {
3
+ export declare type FiltersProps = {
4
4
  /** Render method called once for all filters */
5
5
  renderFilters?: React.FC<ReturnType<typeof useFilters>>;
6
6
  };
7
- export declare const FilterStack: React.FC<FilterStackProps>;
7
+ export declare const Filters: React.FC<FiltersProps>;
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FilterStack = void 0;
6
+ exports.Filters = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const hooks_1 = require("../../hooks");
9
9
  const components_1 = require("../../components");
10
- const FilterStack = (props) => {
10
+ const Filters = (props) => {
11
11
  var _a;
12
- const filtersHook = (0, hooks_1.useFilters)();
13
- const RenderFiltersComponent = (_a = props.renderFilters) !== null && _a !== void 0 ? _a : components_1.ExampleFilterStack;
14
- return (react_1.default.createElement(RenderFiltersComponent, Object.assign({}, filtersHook)));
12
+ const filterStackHook = (0, hooks_1.useFilters)();
13
+ const RenderFiltersComponent = (_a = props.renderFilters) !== null && _a !== void 0 ? _a : components_1.ExampleFilters;
14
+ return react_1.default.createElement(RenderFiltersComponent, Object.assign({}, filterStackHook));
15
15
  };
16
- exports.FilterStack = FilterStack;
17
- //# sourceMappingURL=FilterStack.js.map
16
+ exports.Filters = Filters;
17
+ //# sourceMappingURL=Filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Filters.js","sourceRoot":"","sources":["../../../../src/components/Filter/Filters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAAkD;AAO3C,MAAM,OAAO,GAA2B,CAAC,KAAK,EAAE,EAAE;;IACvD,MAAM,eAAe,GAAG,IAAA,kBAAU,GAAE,CAAC;IAErC,MAAM,sBAAsB,GAAG,MAAA,KAAK,CAAC,aAAa,mCAAI,2BAAc,CAAC;IAErE,OAAO,8BAAC,sBAAsB,oBAAK,eAAe,EAAI,CAAC;AACzD,CAAC,CAAC;AANW,QAAA,OAAO,WAMlB","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { ExampleFilters } from \"../../components\";\n\nexport type FiltersProps = {\n /** Render method called once for all filters */\n renderFilters?: React.FC<ReturnType<typeof useFilters>>;\n};\n\nexport const Filters: React.FC<FiltersProps> = (props) => {\n const filterStackHook = useFilters();\n\n const RenderFiltersComponent = props.renderFilters ?? ExampleFilters;\n\n return <RenderFiltersComponent {...filterStackHook} />;\n};\n"]}
@@ -1,2 +1,2 @@
1
1
  export * from "./Filter";
2
- export * from "./FilterStack";
2
+ export * from "./Filters";
@@ -11,5 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./Filter"), exports);
14
- __exportStar(require("./FilterStack"), exports);
14
+ __exportStar(require("./Filters"), exports);
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,gDAA8B","sourcesContent":["export * from \"./Filter\";\nexport * from \"./FilterStack\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B","sourcesContent":["export * from \"./Filter\";\nexport * from \"./Filters\";\n"]}
@@ -1,16 +1,16 @@
1
1
  import React from "react";
2
- export declare type ReactifySearchBaseProps = {
2
+ export declare type ReactifySearchProviderProps = {
3
3
  /** The search area the provider will be used in */
4
4
  mode: "search" | "collection" | "instant-search";
5
5
  /** Shopify store domain used to resolve the site configuration */
6
6
  shopifyPermanentDomain: string;
7
7
  /** Specific filter group handle, used to override automated logic */
8
- filterStackHandle?: string;
8
+ filtersHandle?: string;
9
9
  /** Callback function for redirects, suitable for headless sites to avoid full page refresh */
10
10
  onRedirect?: (type: "redirect" | "search", url: string) => void;
11
11
  /** Render method to display a component when the config is loading */
12
12
  renderBooting?: () => JSX.Element | null;
13
- /** Advanced usage: Allows you to wrap the ReactifySearchBase in your own ReactiveBase component */
13
+ /** Advanced usage: Allows you to wrap the ReactifySearchProvider in your own ReactiveBase component */
14
14
  noReactiveBase?: boolean;
15
15
  /** Advanced usage: Array of additional component IDs managed outside of Reactify Search */
16
16
  additionalComponentHandles?: string[];
@@ -31,12 +31,8 @@ export declare type ReactifySearchBaseProps = {
31
31
  } | {
32
32
  mode: "collection";
33
33
  /** Collection object that includes the handle, used to find curations */
34
- collection: {
35
- id: number;
36
- title: string;
37
- handle: string;
38
- };
34
+ collectionHandle: string;
39
35
  } | {
40
36
  mode: "instant-search";
41
37
  });
42
- export declare const ReactifySearchBase: React.FC<ReactifySearchBaseProps>;
38
+ export declare const ReactifySearchProvider: React.FC<ReactifySearchProviderProps>;