@wix/headless-stores 0.0.35 → 0.0.37

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 (131) hide show
  1. package/cjs/dist/react/Category.d.ts +83 -31
  2. package/cjs/dist/react/Category.js +68 -35
  3. package/cjs/dist/react/CategoryList.d.ts +184 -0
  4. package/cjs/dist/react/CategoryList.js +174 -0
  5. package/cjs/dist/react/Product.d.ts +3 -3
  6. package/cjs/dist/react/Product.js +6 -6
  7. package/cjs/dist/react/ProductActions.d.ts +1 -1
  8. package/cjs/dist/react/ProductActions.js +2 -2
  9. package/{dist/react/ProductsList.d.ts → cjs/dist/react/ProductList.d.ts} +71 -38
  10. package/{dist/react/ProductsList.js → cjs/dist/react/ProductList.js} +30 -26
  11. package/cjs/dist/react/ProductListFilters.d.ts +244 -0
  12. package/cjs/dist/react/ProductListFilters.js +216 -0
  13. package/cjs/dist/react/ProductListPagination.d.ts +246 -0
  14. package/cjs/dist/react/ProductListPagination.js +207 -0
  15. package/cjs/dist/react/ProductListSort.d.ts +87 -0
  16. package/cjs/dist/react/ProductListSort.js +85 -0
  17. package/cjs/dist/react/ProductModifiers.d.ts +5 -5
  18. package/cjs/dist/react/ProductModifiers.js +10 -10
  19. package/cjs/dist/react/ProductVariantSelector.d.ts +5 -5
  20. package/cjs/dist/react/ProductVariantSelector.js +13 -10
  21. package/cjs/dist/react/SelectedVariant.d.ts +3 -3
  22. package/cjs/dist/react/SelectedVariant.js +6 -6
  23. package/cjs/dist/react/index.d.ts +7 -9
  24. package/cjs/dist/react/index.js +7 -9
  25. package/cjs/dist/services/buy-now-service.d.ts +208 -0
  26. package/cjs/dist/services/buy-now-service.js +132 -1
  27. package/cjs/dist/services/categories-list-service.d.ts +163 -0
  28. package/cjs/dist/services/categories-list-service.js +148 -0
  29. package/cjs/dist/services/category-service.d.ts +115 -70
  30. package/cjs/dist/services/category-service.js +101 -110
  31. package/cjs/dist/services/index.d.ts +6 -7
  32. package/cjs/dist/services/index.js +5 -16
  33. package/cjs/dist/services/pay-now-service.d.ts +146 -0
  34. package/cjs/dist/services/pay-now-service.js +112 -1
  35. package/cjs/dist/services/product-service.d.ts +71 -0
  36. package/cjs/dist/services/product-service.js +47 -0
  37. package/cjs/dist/services/products-list-filters-service.d.ts +292 -0
  38. package/cjs/dist/services/products-list-filters-service.js +446 -0
  39. package/cjs/dist/services/products-list-pagination-service.d.ts +186 -0
  40. package/cjs/dist/services/products-list-pagination-service.js +179 -0
  41. package/cjs/dist/services/products-list-service.d.ts +138 -52
  42. package/cjs/dist/services/products-list-service.js +98 -51
  43. package/cjs/dist/services/products-list-sort-service.d.ts +117 -0
  44. package/cjs/dist/services/products-list-sort-service.js +144 -0
  45. package/cjs/dist/services/selected-variant-service.js +0 -1
  46. package/cjs/dist/utils/url-params.d.ts +68 -0
  47. package/cjs/dist/utils/url-params.js +72 -4
  48. package/dist/react/Category.d.ts +83 -31
  49. package/dist/react/Category.js +68 -35
  50. package/dist/react/CategoryList.d.ts +184 -0
  51. package/dist/react/CategoryList.js +174 -0
  52. package/dist/react/Product.d.ts +3 -3
  53. package/dist/react/Product.js +6 -6
  54. package/dist/react/ProductActions.d.ts +1 -1
  55. package/dist/react/ProductActions.js +2 -2
  56. package/{cjs/dist/react/ProductsList.d.ts → dist/react/ProductList.d.ts} +71 -38
  57. package/{cjs/dist/react/ProductsList.js → dist/react/ProductList.js} +30 -26
  58. package/dist/react/ProductListFilters.d.ts +244 -0
  59. package/dist/react/ProductListFilters.js +216 -0
  60. package/dist/react/ProductListPagination.d.ts +246 -0
  61. package/dist/react/ProductListPagination.js +207 -0
  62. package/dist/react/ProductListSort.d.ts +87 -0
  63. package/dist/react/ProductListSort.js +85 -0
  64. package/dist/react/ProductModifiers.d.ts +5 -5
  65. package/dist/react/ProductModifiers.js +10 -10
  66. package/dist/react/ProductVariantSelector.d.ts +5 -5
  67. package/dist/react/ProductVariantSelector.js +13 -10
  68. package/dist/react/SelectedVariant.d.ts +3 -3
  69. package/dist/react/SelectedVariant.js +6 -6
  70. package/dist/react/index.d.ts +7 -9
  71. package/dist/react/index.js +7 -9
  72. package/dist/services/buy-now-service.d.ts +208 -0
  73. package/dist/services/buy-now-service.js +132 -1
  74. package/dist/services/categories-list-service.d.ts +163 -0
  75. package/dist/services/categories-list-service.js +148 -0
  76. package/dist/services/category-service.d.ts +115 -70
  77. package/dist/services/category-service.js +101 -110
  78. package/dist/services/index.d.ts +6 -7
  79. package/dist/services/index.js +5 -16
  80. package/dist/services/pay-now-service.d.ts +146 -0
  81. package/dist/services/pay-now-service.js +112 -1
  82. package/dist/services/product-service.d.ts +71 -0
  83. package/dist/services/product-service.js +47 -0
  84. package/dist/services/products-list-filters-service.d.ts +292 -0
  85. package/dist/services/products-list-filters-service.js +446 -0
  86. package/dist/services/products-list-pagination-service.d.ts +186 -0
  87. package/dist/services/products-list-pagination-service.js +179 -0
  88. package/dist/services/products-list-service.d.ts +138 -52
  89. package/dist/services/products-list-service.js +98 -51
  90. package/dist/services/products-list-sort-service.d.ts +117 -0
  91. package/dist/services/products-list-sort-service.js +144 -0
  92. package/dist/services/selected-variant-service.js +0 -1
  93. package/dist/utils/url-params.d.ts +68 -0
  94. package/dist/utils/url-params.js +72 -4
  95. package/package.json +3 -3
  96. package/cjs/dist/react/Collection.d.ts +0 -294
  97. package/cjs/dist/react/Collection.js +0 -345
  98. package/cjs/dist/react/FilteredCollection.d.ts +0 -216
  99. package/cjs/dist/react/FilteredCollection.js +0 -256
  100. package/cjs/dist/react/RelatedProducts.d.ts +0 -169
  101. package/cjs/dist/react/RelatedProducts.js +0 -180
  102. package/cjs/dist/react/Sort.d.ts +0 -37
  103. package/cjs/dist/react/Sort.js +0 -36
  104. package/cjs/dist/services/catalog-service.d.ts +0 -36
  105. package/cjs/dist/services/catalog-service.js +0 -193
  106. package/cjs/dist/services/collection-service.d.ts +0 -124
  107. package/cjs/dist/services/collection-service.js +0 -628
  108. package/cjs/dist/services/filter-service.d.ts +0 -35
  109. package/cjs/dist/services/filter-service.js +0 -119
  110. package/cjs/dist/services/related-products-service.d.ts +0 -100
  111. package/cjs/dist/services/related-products-service.js +0 -127
  112. package/cjs/dist/services/sort-service.d.ts +0 -20
  113. package/cjs/dist/services/sort-service.js +0 -27
  114. package/dist/react/Collection.d.ts +0 -294
  115. package/dist/react/Collection.js +0 -345
  116. package/dist/react/FilteredCollection.d.ts +0 -216
  117. package/dist/react/FilteredCollection.js +0 -256
  118. package/dist/react/RelatedProducts.d.ts +0 -169
  119. package/dist/react/RelatedProducts.js +0 -180
  120. package/dist/react/Sort.d.ts +0 -37
  121. package/dist/react/Sort.js +0 -36
  122. package/dist/services/catalog-service.d.ts +0 -36
  123. package/dist/services/catalog-service.js +0 -193
  124. package/dist/services/collection-service.d.ts +0 -124
  125. package/dist/services/collection-service.js +0 -628
  126. package/dist/services/filter-service.d.ts +0 -35
  127. package/dist/services/filter-service.js +0 -119
  128. package/dist/services/related-products-service.d.ts +0 -100
  129. package/dist/services/related-products-service.js +0 -127
  130. package/dist/services/sort-service.d.ts +0 -20
  131. package/dist/services/sort-service.js +0 -27
@@ -1,24 +1,27 @@
1
1
  import { type ProductsListServiceConfig } from "../services/products-list-service.js";
2
2
  import { productsV3 } from "@wix/stores";
3
+ /**
4
+ * Props for Root headless component
5
+ */
3
6
  export interface RootProps {
4
- /** Child components that will have access to the ProductsList service */
7
+ /** Child components that will have access to the ProductList service */
5
8
  children: React.ReactNode;
6
- /** Configuration for the ProductsList service */
9
+ /** Configuration for the ProductList service */
7
10
  productsListConfig: ProductsListServiceConfig;
8
11
  }
9
12
  /**
10
- * Root component that provides the ProductsList service context to its children.
13
+ * Root component that provides the ProductList service context to its children.
11
14
  * This component sets up the necessary services for managing products list state.
12
15
  *
13
16
  * @order 1
14
17
  * @component
15
18
  * @example
16
19
  * ```tsx
17
- * import { ProductsList } from '@wix/stores/components';
20
+ * import { ProductList } from '@wix/stores/components';
18
21
  *
19
- * function ProductsListPage() {
22
+ * function ProductListPage() {
20
23
  * return (
21
- * <ProductsList.Root
24
+ * <ProductList.Root
22
25
  * productsListConfig={{
23
26
  * products: myProducts,
24
27
  * searchOptions: { query: { search: 'searchTerm' } },
@@ -26,27 +29,30 @@ export interface RootProps {
26
29
  * aggregations: {}
27
30
  * }}
28
31
  * >
29
- * <ProductsList.Grid>
30
- * {({ products, isLoading, error }) => (
31
- * <div>
32
- * {isLoading && <div>Loading products...</div>}
33
- * {error && <div>Error: {error}</div>}
34
- * {products.map(product => (
35
- * <div key={product.id}>{product.name}</div>
36
- * ))}
32
+ * <ProductList.ItemContent>
33
+ * {({ product }) => (
34
+ * <div key={product._id}>
35
+ * <h3>{product.name}</h3>
36
+ * <p>{product.actualPriceRange?.minValue?.formattedAmount}</p>
37
37
  * </div>
38
38
  * )}
39
- * </ProductsList.Grid>
40
- * </ProductsList.Root>
39
+ * </ProductList.ItemContent>
40
+ * </ProductList.Root>
41
41
  * );
42
42
  * }
43
43
  * ```
44
44
  */
45
45
  export declare function Root(props: RootProps): React.ReactNode;
46
+ /**
47
+ * Props for EmptyState headless component
48
+ */
46
49
  export interface EmptyStateProps {
47
50
  /** Content to display when products list is empty (can be a render function or ReactNode) */
48
- children: (props: EmptyStateRenderProps) => React.ReactNode;
51
+ children: ((props: EmptyStateRenderProps) => React.ReactNode) | React.ReactNode;
49
52
  }
53
+ /**
54
+ * Render props for EmptyState component
55
+ */
50
56
  export interface EmptyStateRenderProps {
51
57
  }
52
58
  /**
@@ -56,11 +62,11 @@ export interface EmptyStateRenderProps {
56
62
  * @component
57
63
  * @example
58
64
  * ```tsx
59
- * import { ProductsList } from '@wix/stores/components';
65
+ * import { ProductList } from '@wix/stores/components';
60
66
  *
61
67
  * function EmptyProductsMessage() {
62
68
  * return (
63
- * <ProductsList.EmptyState>
69
+ * <ProductList.EmptyState>
64
70
  * {() => (
65
71
  * <div className="empty-state">
66
72
  * <h3>No products found</h3>
@@ -68,16 +74,22 @@ export interface EmptyStateRenderProps {
68
74
  * <button>Clear Filters</button>
69
75
  * </div>
70
76
  * )}
71
- * </ProductsList.EmptyState>
77
+ * </ProductList.EmptyState>
72
78
  * );
73
79
  * }
74
80
  * ```
75
81
  */
76
82
  export declare function EmptyState(props: EmptyStateProps): React.ReactNode;
83
+ /**
84
+ * Props for Loading headless component
85
+ */
77
86
  export interface LoadingProps {
78
87
  /** Content to display during loading (can be a render function or ReactNode) */
79
- children: (props: LoadingRenderProps) => React.ReactNode;
88
+ children: ((props: LoadingRenderProps) => React.ReactNode) | React.ReactNode;
80
89
  }
90
+ /**
91
+ * Render props for Loading component
92
+ */
81
93
  export interface LoadingRenderProps {
82
94
  }
83
95
  /**
@@ -87,29 +99,36 @@ export interface LoadingRenderProps {
87
99
  * @component
88
100
  * @example
89
101
  * ```tsx
90
- * import { ProductsList } from '@wix/stores/components';
102
+ * import { ProductList } from '@wix/stores/components';
91
103
  *
92
104
  * function ProductsLoading() {
93
105
  * return (
94
- * <ProductsList.Loading>
106
+ * <ProductList.Loading>
95
107
  * {() => (
96
108
  * <div className="loading-spinner">
97
109
  * <div>Loading products...</div>
98
110
  * <div className="spinner"></div>
99
111
  * </div>
100
112
  * )}
101
- * </ProductsList.Loading>
113
+ * </ProductList.Loading>
102
114
  * );
103
115
  * }
104
116
  * ```
105
117
  */
106
118
  export declare function Loading(props: LoadingProps): React.ReactNode;
107
- export interface ErrorRenderProps {
108
- error: string | null;
109
- }
119
+ /**
120
+ * Props for Error headless component
121
+ */
110
122
  export interface ErrorProps {
111
123
  /** Content to display during error state (can be a render function or ReactNode) */
112
- children: (props: ErrorRenderProps) => React.ReactNode;
124
+ children: ((props: ErrorRenderProps) => React.ReactNode) | React.ReactNode;
125
+ }
126
+ /**
127
+ * Render props for Error component
128
+ */
129
+ export interface ErrorRenderProps {
130
+ /** Error message */
131
+ error: string | null;
113
132
  }
114
133
  /**
115
134
  * Component that renders content when there's an error loading products.
@@ -118,11 +137,11 @@ export interface ErrorProps {
118
137
  * @component
119
138
  * @example
120
139
  * ```tsx
121
- * import { ProductsList } from '@wix/stores/components';
140
+ * import { ProductList } from '@wix/stores/components';
122
141
  *
123
142
  * function ProductsError() {
124
143
  * return (
125
- * <ProductsList.Error>
144
+ * <ProductList.Error>
126
145
  * {({ error }) => (
127
146
  * <div className="error-state">
128
147
  * <h3>Error loading products</h3>
@@ -132,18 +151,25 @@ export interface ErrorProps {
132
151
  * </button>
133
152
  * </div>
134
153
  * )}
135
- * </ProductsList.Error>
154
+ * </ProductList.Error>
136
155
  * );
137
156
  * }
138
157
  * ```
139
158
  */
140
159
  export declare function Error(props: ErrorProps): React.ReactNode;
141
- export interface ItemContentRenderProps {
142
- product: productsV3.V3Product;
143
- }
160
+ /**
161
+ * Props for ItemContent headless component
162
+ */
144
163
  export interface ItemContentProps {
145
164
  /** Content to display for each product (can be a render function receiving product data or ReactNode) */
146
- children: (props: ItemContentRenderProps) => React.ReactNode;
165
+ children: ((props: ItemContentRenderProps) => React.ReactNode) | React.ReactNode;
166
+ }
167
+ /**
168
+ * Render props for ItemContent component
169
+ */
170
+ export interface ItemContentRenderProps {
171
+ /** Product data */
172
+ product: productsV3.V3Product;
147
173
  }
148
174
  /**
149
175
  * Component that renders content for each product in the list.
@@ -153,11 +179,11 @@ export interface ItemContentProps {
153
179
  * @component
154
180
  * @example
155
181
  * ```tsx
156
- * import { ProductsList } from '@wix/stores/components';
182
+ * import { ProductList } from '@wix/stores/components';
157
183
  *
158
184
  * function ProductsGrid() {
159
185
  * return (
160
- * <ProductsList.ItemContent>
186
+ * <ProductList.ItemContent>
161
187
  * {({ product }) => (
162
188
  * <div className="product-card">
163
189
  * <img src={product.media?.main?.image} alt={product.name} />
@@ -166,9 +192,16 @@ export interface ItemContentProps {
166
192
  * <button>View Details</button>
167
193
  * </div>
168
194
  * )}
169
- * </ProductsList.ItemContent>
195
+ * </ProductList.ItemContent>
170
196
  * );
171
197
  * }
172
198
  * ```
173
199
  */
174
200
  export declare function ItemContent(props: ItemContentProps): React.ReactNode;
201
+ export type ItemsProps = {
202
+ children: ((props: ItemsRenderProps) => React.ReactNode) | React.ReactNode;
203
+ };
204
+ export type ItemsRenderProps = {
205
+ products: productsV3.V3Product[];
206
+ };
207
+ export declare function Items(props: ItemsProps): import("react").ReactNode;
@@ -4,18 +4,18 @@ import { createServicesMap } from "@wix/services-manager";
4
4
  import { ProductListService, ProductsListServiceDefinition, } from "../services/products-list-service.js";
5
5
  import { ProductService, ProductServiceDefinition, } from "@wix/headless-stores/services";
6
6
  /**
7
- * Root component that provides the ProductsList service context to its children.
7
+ * Root component that provides the ProductList service context to its children.
8
8
  * This component sets up the necessary services for managing products list state.
9
9
  *
10
10
  * @order 1
11
11
  * @component
12
12
  * @example
13
13
  * ```tsx
14
- * import { ProductsList } from '@wix/stores/components';
14
+ * import { ProductList } from '@wix/stores/components';
15
15
  *
16
- * function ProductsListPage() {
16
+ * function ProductListPage() {
17
17
  * return (
18
- * <ProductsList.Root
18
+ * <ProductList.Root
19
19
  * productsListConfig={{
20
20
  * products: myProducts,
21
21
  * searchOptions: { query: { search: 'searchTerm' } },
@@ -23,18 +23,15 @@ import { ProductService, ProductServiceDefinition, } from "@wix/headless-stores/
23
23
  * aggregations: {}
24
24
  * }}
25
25
  * >
26
- * <ProductsList.Grid>
27
- * {({ products, isLoading, error }) => (
28
- * <div>
29
- * {isLoading && <div>Loading products...</div>}
30
- * {error && <div>Error: {error}</div>}
31
- * {products.map(product => (
32
- * <div key={product.id}>{product.name}</div>
33
- * ))}
26
+ * <ProductList.ItemContent>
27
+ * {({ product }) => (
28
+ * <div key={product._id}>
29
+ * <h3>{product.name}</h3>
30
+ * <p>{product.actualPriceRange?.minValue?.formattedAmount}</p>
34
31
  * </div>
35
32
  * )}
36
- * </ProductsList.Grid>
37
- * </ProductsList.Root>
33
+ * </ProductList.ItemContent>
34
+ * </ProductList.Root>
38
35
  * );
39
36
  * }
40
37
  * ```
@@ -49,11 +46,11 @@ export function Root(props) {
49
46
  * @component
50
47
  * @example
51
48
  * ```tsx
52
- * import { ProductsList } from '@wix/stores/components';
49
+ * import { ProductList } from '@wix/stores/components';
53
50
  *
54
51
  * function EmptyProductsMessage() {
55
52
  * return (
56
- * <ProductsList.EmptyState>
53
+ * <ProductList.EmptyState>
57
54
  * {() => (
58
55
  * <div className="empty-state">
59
56
  * <h3>No products found</h3>
@@ -61,7 +58,7 @@ export function Root(props) {
61
58
  * <button>Clear Filters</button>
62
59
  * </div>
63
60
  * )}
64
- * </ProductsList.EmptyState>
61
+ * </ProductList.EmptyState>
65
62
  * );
66
63
  * }
67
64
  * ```
@@ -85,18 +82,18 @@ export function EmptyState(props) {
85
82
  * @component
86
83
  * @example
87
84
  * ```tsx
88
- * import { ProductsList } from '@wix/stores/components';
85
+ * import { ProductList } from '@wix/stores/components';
89
86
  *
90
87
  * function ProductsLoading() {
91
88
  * return (
92
- * <ProductsList.Loading>
89
+ * <ProductList.Loading>
93
90
  * {() => (
94
91
  * <div className="loading-spinner">
95
92
  * <div>Loading products...</div>
96
93
  * <div className="spinner"></div>
97
94
  * </div>
98
95
  * )}
99
- * </ProductsList.Loading>
96
+ * </ProductList.Loading>
100
97
  * );
101
98
  * }
102
99
  * ```
@@ -118,11 +115,11 @@ export function Loading(props) {
118
115
  * @component
119
116
  * @example
120
117
  * ```tsx
121
- * import { ProductsList } from '@wix/stores/components';
118
+ * import { ProductList } from '@wix/stores/components';
122
119
  *
123
120
  * function ProductsError() {
124
121
  * return (
125
- * <ProductsList.Error>
122
+ * <ProductList.Error>
126
123
  * {({ error }) => (
127
124
  * <div className="error-state">
128
125
  * <h3>Error loading products</h3>
@@ -132,7 +129,7 @@ export function Loading(props) {
132
129
  * </button>
133
130
  * </div>
134
131
  * )}
135
- * </ProductsList.Error>
132
+ * </ProductList.Error>
136
133
  * );
137
134
  * }
138
135
  * ```
@@ -155,11 +152,11 @@ export function Error(props) {
155
152
  * @component
156
153
  * @example
157
154
  * ```tsx
158
- * import { ProductsList } from '@wix/stores/components';
155
+ * import { ProductList } from '@wix/stores/components';
159
156
  *
160
157
  * function ProductsGrid() {
161
158
  * return (
162
- * <ProductsList.ItemContent>
159
+ * <ProductList.ItemContent>
163
160
  * {({ product }) => (
164
161
  * <div className="product-card">
165
162
  * <img src={product.media?.main?.image} alt={product.name} />
@@ -168,7 +165,7 @@ export function Error(props) {
168
165
  * <button>View Details</button>
169
166
  * </div>
170
167
  * )}
171
- * </ProductsList.ItemContent>
168
+ * </ProductList.ItemContent>
172
169
  * );
173
170
  * }
174
171
  * ```
@@ -183,3 +180,10 @@ export function ItemContent(props) {
183
180
  ? props.children({ product })
184
181
  : props.children }, product._id)));
185
182
  }
183
+ export function Items(props) {
184
+ const { products } = useService(ProductsListServiceDefinition);
185
+ const productsValue = products.get();
186
+ return typeof props.children === "function"
187
+ ? props.children({ products: productsValue })
188
+ : props.children;
189
+ }
@@ -0,0 +1,244 @@
1
+ import type { ReactNode } from "react";
2
+ import { InventoryStatusType, type ProductOption, ProductsListFiltersServiceConfig } from "../services/products-list-filters-service.js";
3
+ export interface RootProps {
4
+ /** Child components that will have access to the ProductListFilters service */
5
+ children: React.ReactNode;
6
+ /** Configuration for the ProductListFilters service */
7
+ productsListFiltersConfig: ProductsListFiltersServiceConfig;
8
+ }
9
+ /**
10
+ * Root component that provides the ProductListFilters service context to its children.
11
+ * This component sets up the necessary services for managing products list filters.
12
+ *
13
+ * @order 1
14
+ * @component
15
+ * @example
16
+ * ```tsx
17
+ * import { ProductListFilters } from '@wix/stores/components';
18
+ *
19
+ * function FiltersSection() {
20
+ * return (
21
+ * <ProductListFilters.Root
22
+ * productsListFiltersConfig={{
23
+ * minPrice: 0,
24
+ * maxPrice: 1000
25
+ * }}
26
+ * >
27
+ * <ProductListFilters.MinPrice>
28
+ * {({ minPrice, setMinPrice }) => (
29
+ * <input
30
+ * type="number"
31
+ * value={minPrice}
32
+ * onChange={(e) => setMinPrice(Number(e.target.value))}
33
+ * placeholder="Min price"
34
+ * />
35
+ * )}
36
+ * </ProductListFilters.MinPrice>
37
+ * </ProductListFilters.Root>
38
+ * );
39
+ * }
40
+ * ```
41
+ */
42
+ export declare function Root(props: RootProps): import("react/jsx-runtime").JSX.Element;
43
+ /**
44
+ * Props for InventoryStatus headless component
45
+ */
46
+ export interface InventoryStatusProps {
47
+ /** Content to display (can be a render function receiving inventory status controls or ReactNode) */
48
+ children: ((props: InventoryStatusRenderProps) => ReactNode) | ReactNode;
49
+ }
50
+ /**
51
+ * Render props for InventoryStatus component
52
+ */
53
+ export interface InventoryStatusRenderProps {
54
+ /** Available inventory status options */
55
+ availableInventoryStatuses: InventoryStatusType[];
56
+ /** Currently selected inventory statuses */
57
+ selectedInventoryStatuses: InventoryStatusType[];
58
+ /** Function to toggle an inventory status filter */
59
+ toggleInventoryStatus: (status: InventoryStatusType) => void;
60
+ }
61
+ /**
62
+ * Headless component for managing inventory status filters
63
+ *
64
+ * @component
65
+ * @example
66
+ * ```tsx
67
+ * import { ProductListFilters } from '@wix/stores/components';
68
+ *
69
+ * function InventoryStatusFilter() {
70
+ * return (
71
+ * <ProductListFilters.InventoryStatus>
72
+ * {({ availableInventoryStatuses, selectedInventoryStatuses, toggleInventoryStatus }) => (
73
+ * <div>
74
+ * <h4>Inventory Status:</h4>
75
+ * {availableInventoryStatuses.map(status => (
76
+ * <label key={status}>
77
+ * <input
78
+ * type="checkbox"
79
+ * checked={selectedInventoryStatuses.includes(status)}
80
+ * onChange={() => toggleInventoryStatus(status)}
81
+ * />
82
+ * {status}
83
+ * </label>
84
+ * ))}
85
+ * </div>
86
+ * )}
87
+ * </ProductListFilters.InventoryStatus>
88
+ * );
89
+ * }
90
+ * ```
91
+ */
92
+ export declare function InventoryStatus(props: InventoryStatusProps): ReactNode;
93
+ /**
94
+ * Props for ResetTrigger headless component
95
+ */
96
+ export interface ResetTriggerProps {
97
+ /** Content to display (can be a render function receiving reset controls or ReactNode) */
98
+ children: ((props: ResetTriggerRenderProps) => ReactNode) | ReactNode;
99
+ }
100
+ /**
101
+ * Render props for ResetTrigger component
102
+ */
103
+ export interface ResetTriggerRenderProps {
104
+ /** Function to reset all filters */
105
+ resetFilters: () => void;
106
+ /** Whether any filters are currently applied */
107
+ isFiltered: boolean;
108
+ }
109
+ /**
110
+ * Headless component for resetting all filters
111
+ *
112
+ * @component
113
+ * @example
114
+ * ```tsx
115
+ * import { ProductListFilters } from '@wix/stores/components';
116
+ *
117
+ * function ResetFiltersButton() {
118
+ * return (
119
+ * <ProductListFilters.ResetTrigger>
120
+ * {({ resetFilters, isFiltered }) => (
121
+ * <button
122
+ * onClick={resetFilters}
123
+ * disabled={!isFiltered}
124
+ * className={isFiltered ? 'active' : 'disabled'}
125
+ * >
126
+ * {isFiltered ? 'Clear Filters' : 'No Filters Applied'}
127
+ * </button>
128
+ * )}
129
+ * </ProductListFilters.ResetTrigger>
130
+ * );
131
+ * }
132
+ * ```
133
+ */
134
+ export declare function ResetTrigger(props: ResetTriggerProps): ReactNode;
135
+ /**
136
+ * Props for PriceRange headless component
137
+ */
138
+ export interface PriceRangeProps {
139
+ /** Content to display (can be a render function receiving price range controls or ReactNode) */
140
+ children: ((props: PriceRangeRenderProps) => ReactNode) | ReactNode;
141
+ }
142
+ /**
143
+ * Render props for PriceRange component
144
+ */
145
+ export interface PriceRangeRenderProps {
146
+ /** Current minimum price filter value */
147
+ minPrice: number;
148
+ /** Current maximum price filter value */
149
+ maxPrice: number;
150
+ /** Function to update the minimum price filter */
151
+ setMinPrice: (minPrice: number) => void;
152
+ /** Function to update the maximum price filter */
153
+ setMaxPrice: (maxPrice: number) => void;
154
+ }
155
+ /**
156
+ * Headless component for managing price range filters (combined min/max)
157
+ *
158
+ * @component
159
+ * @example
160
+ * ```tsx
161
+ * import { ProductListFilters } from '@wix/stores/components';
162
+ *
163
+ * function PriceRangeFilter() {
164
+ * return (
165
+ * <ProductListFilters.PriceRange>
166
+ * {({ minPrice, maxPrice, setMinPrice, setMaxPrice }) => (
167
+ * <div className="price-range">
168
+ * <h4>Price Range:</h4>
169
+ * <div className="price-inputs">
170
+ * <input
171
+ * type="number"
172
+ * value={minPrice}
173
+ * onChange={(e) => setMinPrice(Number(e.target.value))}
174
+ * placeholder="Min"
175
+ * />
176
+ * <span>to</span>
177
+ * <input
178
+ * type="number"
179
+ * value={maxPrice}
180
+ * onChange={(e) => setMaxPrice(Number(e.target.value))}
181
+ * placeholder="Max"
182
+ * />
183
+ * </div>
184
+ * </div>
185
+ * )}
186
+ * </ProductListFilters.PriceRange>
187
+ * );
188
+ * }
189
+ * ```
190
+ */
191
+ export declare function PriceRange(props: PriceRangeProps): ReactNode;
192
+ /**
193
+ * Props for ProductOptions headless component
194
+ */
195
+ export interface ProductOptionsProps {
196
+ /** Content to display (can be a render function receiving product option data or ReactNode) */
197
+ children: ((props: ProductOptionRenderProps) => ReactNode) | ReactNode;
198
+ }
199
+ /**
200
+ * Render props for ProductOption component
201
+ */
202
+ export interface ProductOptionRenderProps {
203
+ /** Product option data */
204
+ option: ProductOption;
205
+ /** Currently selected choice IDs for this option */
206
+ selectedChoices: string[];
207
+ /** Function to toggle a choice selection */
208
+ toggleChoice: (choiceId: string) => void;
209
+ }
210
+ /**
211
+ * Headless component that renders content for each product option in the list.
212
+ * Maps over all available product options and provides each option through a render prop.
213
+ * Only renders when options are available (not loading, no error, and has options).
214
+ * This follows the same collection pattern as ProductList.ItemContent and CategoryList.ItemContent.
215
+ *
216
+ * @component
217
+ * @example
218
+ * ```tsx
219
+ * import { ProductListFilters } from '@wix/stores/components';
220
+ *
221
+ * function ProductOptionsFilter() {
222
+ * return (
223
+ * <ProductListFilters.ProductOptions>
224
+ * {({ option, selectedChoices, toggleChoice }) => (
225
+ * <div key={option.id}>
226
+ * <h4>{option.name}</h4>
227
+ * {option.choices.map(choice => (
228
+ * <label key={choice.id}>
229
+ * <input
230
+ * type="checkbox"
231
+ * checked={selectedChoices.includes(choice.id)}
232
+ * onChange={() => toggleChoice(choice.id)}
233
+ * />
234
+ * {choice.name}
235
+ * </label>
236
+ * ))}
237
+ * </div>
238
+ * )}
239
+ * </ProductListFilters.ProductOptions>
240
+ * );
241
+ * }
242
+ * ```
243
+ */
244
+ export declare function ProductOptions(props: ProductOptionsProps): import("react/jsx-runtime").JSX.Element | null;