@wix/headless-stores 0.0.54 → 0.0.55

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.
@@ -249,7 +249,7 @@ export const SelectedVariantService = implementService.withConfig()(SelectedVari
249
249
  else if (prod?.compareAtPriceRange?.minValue?.amount) {
250
250
  rawAmount = prod.compareAtPriceRange.minValue.amount;
251
251
  }
252
- return rawAmount ? `$${rawAmount}` : null;
252
+ return rawAmount && rawAmount !== '0' ? `$${rawAmount}` : null;
253
253
  });
254
254
  const isInStock = signalsService.computed(() => {
255
255
  const variant = currentVariant.get();
@@ -188,6 +188,64 @@ export interface CompareAtPriceProps extends AsChildProps<{
188
188
  * ```
189
189
  */
190
190
  export declare const CompareAtPrice: React.ForwardRefExoticComponent<CompareAtPriceProps & React.RefAttributes<HTMLElement>>;
191
+ /**
192
+ * Props for Slug component
193
+ * @interface SlugProps
194
+ */
195
+ export interface SlugProps extends AsChildProps<{
196
+ slug: string;
197
+ }> {
198
+ }
199
+ /**
200
+ * Product Slug component that displays the product's slug
201
+ *
202
+ * @component
203
+ * @order 6
204
+ * @example
205
+ * ```tsx
206
+ * import { Product } from '@wix/stores/components';
207
+ *
208
+ * function ProductSlugLink() {
209
+ * return (
210
+ * <Product.Slug>
211
+ * {({ slug }) => (
212
+ * <a href={`/product/${slug}`}>
213
+ * View Product Details
214
+ * </a>
215
+ * )}
216
+ * </Product.Slug>
217
+ * );
218
+ * }
219
+ * ```
220
+ */
221
+ export declare const Slug: React.ForwardRefExoticComponent<SlugProps & React.RefAttributes<HTMLElement>>;
222
+ /**
223
+ * Props for Product Raw component
224
+ */
225
+ export interface RawProps extends AsChildProps<{
226
+ product: V3Product;
227
+ }> {
228
+ }
229
+ /**
230
+ * Provides access to the raw product data for advanced use cases.
231
+ * Similar to Category.Raw, this should only be used when you need custom access to product data.
232
+ *
233
+ * @component
234
+ * @example
235
+ * ```tsx
236
+ * // Custom rendering with forwardRef
237
+ * <Product.Raw asChild>
238
+ * {React.forwardRef(({product, ...props}, ref) => (
239
+ * <div ref={ref} {...props} className="product-debug">
240
+ * <span>Product ID: {product._id}</span>
241
+ * <span>SKU: {product.sku}</span>
242
+ * <span>Inventory: {product.inventory?.quantity}</span>
243
+ * </div>
244
+ * ))}
245
+ * </Product.Raw>
246
+ * ```
247
+ */
248
+ export declare const Raw: React.ForwardRefExoticComponent<RawProps & React.RefAttributes<HTMLElement>>;
191
249
  /**
192
250
  * Props for Product Variants container
193
251
  */
@@ -388,4 +446,47 @@ export interface ModifierOptionRepeaterProps {
388
446
  * @component
389
447
  */
390
448
  export declare const ModifierOptionRepeater: React.ForwardRefExoticComponent<ModifierOptionRepeaterProps & React.RefAttributes<HTMLElement>>;
391
- export {};
449
+ /**
450
+ * Props for Product MediaGallery component
451
+ */
452
+ export interface ProductMediaGalleryProps {
453
+ children: React.ReactNode;
454
+ infinite?: boolean;
455
+ autoPlay?: {
456
+ direction?: 'forward' | 'backward';
457
+ intervalMs?: number;
458
+ };
459
+ }
460
+ /**
461
+ * Container for product media gallery.
462
+ * Renders a MediaGallery.Root with the product media items.
463
+ *
464
+ * @component
465
+ * @example
466
+ * ```tsx
467
+ * // Default usage
468
+ * <Product.MediaGallery
469
+ * infinite={true}
470
+ * autoPlay={{ direction: "forward", intervalMs: 5000 }}
471
+ * >
472
+ * <MediaGallery.Viewport />
473
+ * <MediaGallery.Previous />
474
+ * <MediaGallery.Next />
475
+ * <MediaGallery.Thumbnails>
476
+ * <MediaGallery.ThumbnailRepeater>
477
+ * <MediaGallery.ThumbnailItem />
478
+ * </MediaGallery.ThumbnailRepeater>
479
+ * </MediaGallery.Thumbnails>
480
+ * </Product.MediaGallery>
481
+ *
482
+ * // Simple usage
483
+ * <Product.MediaGallery>
484
+ * <MediaGallery.Viewport className="rounded-lg" />
485
+ * </Product.MediaGallery>
486
+ * ```
487
+ */
488
+ export declare const ProductMediaGallery: React.ForwardRefExoticComponent<ProductMediaGalleryProps & React.RefAttributes<HTMLElement>>;
489
+ /**
490
+ * Alias for ProductMediaGallery to match the documented API
491
+ */
492
+ export { ProductMediaGallery as MediaGallery };
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { renderAsChild } from '../utils/index.js';
4
+ import { MediaGallery } from '@wix/headless-media/react';
4
5
  import * as CoreProduct from './core/Product.js';
5
6
  import * as ProductVariantSelector from './core/ProductVariantSelector.js';
6
7
  import * as ProductModifiers from './core/ProductModifiers.js';
@@ -36,12 +37,15 @@ var TestIds;
36
37
  TestIds["productDescription"] = "product-description";
37
38
  TestIds["productPrice"] = "product-price";
38
39
  TestIds["productCompareAtPrice"] = "product-compare-at-price";
40
+ TestIds["productSlug"] = "product-slug";
41
+ TestIds["productRaw"] = "product-raw";
39
42
  TestIds["productVariants"] = "product-variants";
40
43
  TestIds["productVariantOptions"] = "product-variant-options";
41
44
  TestIds["productVariantOption"] = "product-variant-option";
42
45
  TestIds["productModifiers"] = "product-modifiers";
43
46
  TestIds["productModifierOptions"] = "product-modifier-options";
44
47
  TestIds["productModifierOption"] = "product-modifier-option";
48
+ TestIds["productMediaGallery"] = "product-media-gallery";
45
49
  })(TestIds || (TestIds = {}));
46
50
  /**
47
51
  * Root component that provides all necessary service contexts for a complete product experience.
@@ -64,7 +68,9 @@ var TestIds;
64
68
  * ```
65
69
  */
66
70
  export function Root(props) {
67
- return (_jsx(CoreProduct.Root, { productServiceConfig: { product: props.product }, "data-testid": TestIds.productRoot, children: _jsx(ProductVariantSelector.Root, { children: _jsx(ProductModifiers.Root, { children: _jsx(SelectedVariant.Root, { children: props.children }) }) }) }));
71
+ return (_jsx(CoreProduct.Root, { productServiceConfig: { product: props.product }, "data-testid": TestIds.productRoot, children: _jsx(MediaGallery.Root, { mediaGalleryServiceConfig: {
72
+ media: props.product.media?.itemsInfo?.items ?? [],
73
+ }, children: _jsx(ProductVariantSelector.Root, { children: _jsx(ProductModifiers.Root, { children: _jsx(SelectedVariant.Root, { children: props.children }) }) }) }) }));
68
74
  }
69
75
  /**
70
76
  * Displays the product name with customizable rendering following the documented API.
@@ -281,6 +287,90 @@ export const CompareAtPrice = React.forwardRef((props, ref) => {
281
287
  return (_jsx("span", { className: className, ...attributes, ref: ref, children: compareAtPrice }));
282
288
  } }));
283
289
  });
290
+ /**
291
+ * Product Slug component that displays the product's slug
292
+ *
293
+ * @component
294
+ * @order 6
295
+ * @example
296
+ * ```tsx
297
+ * import { Product } from '@wix/stores/components';
298
+ *
299
+ * function ProductSlugLink() {
300
+ * return (
301
+ * <Product.Slug>
302
+ * {({ slug }) => (
303
+ * <a href={`/product/${slug}`}>
304
+ * View Product Details
305
+ * </a>
306
+ * )}
307
+ * </Product.Slug>
308
+ * );
309
+ * }
310
+ * ```
311
+ */
312
+ export const Slug = React.forwardRef((props, ref) => {
313
+ const { asChild, children } = props;
314
+ const testId = TestIds.productSlug;
315
+ return (_jsx(CoreProduct.Slug, { children: ({ slug }) => {
316
+ const attributes = {
317
+ 'data-testid': testId,
318
+ };
319
+ const slugData = { slug };
320
+ if (asChild) {
321
+ const rendered = renderAsChild({
322
+ children,
323
+ props: slugData,
324
+ ref,
325
+ content: slug,
326
+ attributes,
327
+ });
328
+ if (rendered)
329
+ return rendered;
330
+ }
331
+ return (_jsx("span", { ...attributes, ref: ref, children: slug }));
332
+ } }));
333
+ });
334
+ /**
335
+ * Provides access to the raw product data for advanced use cases.
336
+ * Similar to Category.Raw, this should only be used when you need custom access to product data.
337
+ *
338
+ * @component
339
+ * @example
340
+ * ```tsx
341
+ * // Custom rendering with forwardRef
342
+ * <Product.Raw asChild>
343
+ * {React.forwardRef(({product, ...props}, ref) => (
344
+ * <div ref={ref} {...props} className="product-debug">
345
+ * <span>Product ID: {product._id}</span>
346
+ * <span>SKU: {product.sku}</span>
347
+ * <span>Inventory: {product.inventory?.quantity}</span>
348
+ * </div>
349
+ * ))}
350
+ * </Product.Raw>
351
+ * ```
352
+ */
353
+ export const Raw = React.forwardRef((props, ref) => {
354
+ const { asChild, children } = props;
355
+ return (_jsx(CoreProduct.Content, { children: ({ product }) => {
356
+ const attributes = {
357
+ 'data-testid': TestIds.productRaw,
358
+ };
359
+ if (asChild) {
360
+ const rendered = renderAsChild({
361
+ children,
362
+ props: { product },
363
+ ref,
364
+ content: null,
365
+ attributes,
366
+ });
367
+ if (rendered)
368
+ return rendered;
369
+ }
370
+ // Raw component should not render anything by default when not using asChild
371
+ return null;
372
+ } }));
373
+ });
284
374
  /**
285
375
  * Container for product variant selection system.
286
376
  * Does not render when there are no variants.
@@ -537,3 +627,50 @@ export const ModifierOptionRepeater = React.forwardRef((props, _ref) => {
537
627
  }, allowedTypes: allowedTypes, children: children })) }, modifier._id));
538
628
  }) }));
539
629
  });
630
+ /**
631
+ * Container for product media gallery.
632
+ * Renders a MediaGallery.Root with the product media items.
633
+ *
634
+ * @component
635
+ * @example
636
+ * ```tsx
637
+ * // Default usage
638
+ * <Product.MediaGallery
639
+ * infinite={true}
640
+ * autoPlay={{ direction: "forward", intervalMs: 5000 }}
641
+ * >
642
+ * <MediaGallery.Viewport />
643
+ * <MediaGallery.Previous />
644
+ * <MediaGallery.Next />
645
+ * <MediaGallery.Thumbnails>
646
+ * <MediaGallery.ThumbnailRepeater>
647
+ * <MediaGallery.ThumbnailItem />
648
+ * </MediaGallery.ThumbnailRepeater>
649
+ * </MediaGallery.Thumbnails>
650
+ * </Product.MediaGallery>
651
+ *
652
+ * // Simple usage
653
+ * <Product.MediaGallery>
654
+ * <MediaGallery.Viewport className="rounded-lg" />
655
+ * </Product.MediaGallery>
656
+ * ```
657
+ */
658
+ export const ProductMediaGallery = React.forwardRef((props, ref) => {
659
+ const { children, infinite, autoPlay, ...otherProps } = props;
660
+ return (_jsx(CoreProduct.Media, { children: ({ mediaItems, mainMedia }) => {
661
+ const media = mediaItems.length > 0 ? mediaItems : mainMedia ? [mainMedia] : [];
662
+ const mediaGalleryServiceConfig = {
663
+ media,
664
+ infinite,
665
+ autoPlay,
666
+ };
667
+ const attributes = {
668
+ 'data-testid': TestIds.productMediaGallery,
669
+ };
670
+ return (_jsx("div", { ...attributes, ref: ref, ...otherProps, children: _jsx(MediaGallery.Root, { mediaGalleryServiceConfig: mediaGalleryServiceConfig, children: children }) }));
671
+ } }));
672
+ });
673
+ /**
674
+ * Alias for ProductMediaGallery to match the documented API
675
+ */
676
+ export { ProductMediaGallery as MediaGallery };
@@ -0,0 +1,116 @@
1
+ import type { V3Product } from '@wix/auto_sdk_stores_products-v-3';
2
+ import React from 'react';
3
+ import type { ProductsListSearchServiceConfig } from '../services/products-list-search-service.js';
4
+ import type { ProductsListServiceConfig } from '../services/products-list-service.js';
5
+ /**
6
+ * Props for the ProductList root component following the documented API
7
+ */
8
+ export interface ProductListRootProps {
9
+ children: React.ReactNode;
10
+ products?: V3Product[];
11
+ productsListConfig?: ProductsListServiceConfig;
12
+ productsListSearchConfig?: ProductsListSearchServiceConfig;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * Root component that provides the ProductList service context for rendering product lists.
17
+ *
18
+ * @order 1
19
+ * @component
20
+ * @example
21
+ * ```tsx
22
+ * import { ProductList } from '@wix/stores/components';
23
+ *
24
+ * function ProductListPage({ products }) {
25
+ * return (
26
+ * <ProductList.Root products={products}>
27
+ * <ProductList.Products>
28
+ * <ProductList.ProductRepeater>
29
+ * <Product.Name />
30
+ * <Product.Price />
31
+ * </ProductList.ProductRepeater>
32
+ * </ProductList.Products>
33
+ * </ProductList.Root>
34
+ * );
35
+ * }
36
+ * ```
37
+ */
38
+ export declare const Root: React.ForwardRefExoticComponent<ProductListRootProps & React.RefAttributes<HTMLElement>>;
39
+ /**
40
+ * Props for ProductList Raw component
41
+ */
42
+ export interface RawProps {
43
+ children: ((props: {
44
+ totalProducts: number;
45
+ displayedProducts: number;
46
+ isFiltered: boolean;
47
+ }) => React.ReactNode) | React.ReactNode;
48
+ }
49
+ /**
50
+ * Raw component that provides direct access to product list data.
51
+ * Similar to Product.Raw, this should only be used when you need custom access to list data.
52
+ *
53
+ * @component
54
+ * @example
55
+ * ```tsx
56
+ * <ProductList.Raw>
57
+ * {({ totalProducts, displayedProducts, isFiltered }) => (
58
+ * <div className="text-content-muted">
59
+ * Showing {displayedProducts} of {totalProducts} products
60
+ * {isFiltered && <span className="ml-2 text-brand-primary">(Filtered)</span>}
61
+ * </div>
62
+ * )}
63
+ * </ProductList.Raw>
64
+ * ```
65
+ */
66
+ export declare const Raw: React.ForwardRefExoticComponent<RawProps & React.RefAttributes<HTMLElement>>;
67
+ /**
68
+ * Props for ProductList Products component
69
+ */
70
+ export interface ProductsProps {
71
+ children: React.ReactNode;
72
+ emptyState?: React.ReactNode;
73
+ infiniteScroll?: boolean;
74
+ pageSize?: number;
75
+ className?: string;
76
+ }
77
+ /**
78
+ * Container for the product list with empty state support.
79
+ * Follows List Container Level pattern.
80
+ *
81
+ * @component
82
+ * @example
83
+ * ```tsx
84
+ * <ProductList.Products emptyState={<div>No products found</div>}>
85
+ * <ProductList.ProductRepeater>
86
+ * <Product.Name />
87
+ * <Product.Price />
88
+ * </ProductList.ProductRepeater>
89
+ * </ProductList.Products>
90
+ * ```
91
+ */
92
+ export declare const Products: React.ForwardRefExoticComponent<ProductsProps & React.RefAttributes<HTMLElement>>;
93
+ /**
94
+ * Props for ProductList ProductRepeater component
95
+ */
96
+ export interface ProductRepeaterProps {
97
+ children: React.ReactNode;
98
+ }
99
+ /**
100
+ * Repeater component that renders Product.Root for each product.
101
+ * Follows Repeater Level pattern.
102
+ * Note: Repeater components do NOT support asChild as per architecture rules.
103
+ *
104
+ * @component
105
+ * @example
106
+ * ```tsx
107
+ * <ProductList.ProductRepeater>
108
+ * <Product.Name />
109
+ * <Product.Price />
110
+ * <Product.MediaGallery>
111
+ * <MediaGallery.Viewport />
112
+ * </Product.MediaGallery>
113
+ * </ProductList.ProductRepeater>
114
+ * ```
115
+ */
116
+ export declare const ProductRepeater: React.ForwardRefExoticComponent<ProductRepeaterProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,156 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useService } from '@wix/services-manager-react';
3
+ import React from 'react';
4
+ import { ProductsListServiceDefinition } from '../services/products-list-service.js';
5
+ import * as CoreProductList from './core/ProductList.js';
6
+ import * as Product from './Product.js';
7
+ var TestIds;
8
+ (function (TestIds) {
9
+ TestIds["productListRoot"] = "product-list-root";
10
+ TestIds["productListProducts"] = "product-list-products";
11
+ TestIds["productListItem"] = "product-list-item";
12
+ })(TestIds || (TestIds = {}));
13
+ /**
14
+ * Root component that provides the ProductList service context for rendering product lists.
15
+ *
16
+ * @order 1
17
+ * @component
18
+ * @example
19
+ * ```tsx
20
+ * import { ProductList } from '@wix/stores/components';
21
+ *
22
+ * function ProductListPage({ products }) {
23
+ * return (
24
+ * <ProductList.Root products={products}>
25
+ * <ProductList.Products>
26
+ * <ProductList.ProductRepeater>
27
+ * <Product.Name />
28
+ * <Product.Price />
29
+ * </ProductList.ProductRepeater>
30
+ * </ProductList.Products>
31
+ * </ProductList.Root>
32
+ * );
33
+ * }
34
+ * ```
35
+ */
36
+ export const Root = React.forwardRef((props, ref) => {
37
+ const { children, products, productsListConfig, productsListSearchConfig, className, } = props;
38
+ const serviceConfig = productsListConfig || {
39
+ products: products || [],
40
+ searchOptions: {
41
+ cursorPaging: { limit: 10 },
42
+ },
43
+ pagingMetadata: {
44
+ count: products?.length || 0,
45
+ },
46
+ aggregations: {}, // Empty aggregation data
47
+ };
48
+ return (_jsx(CoreProductList.Root, { productsListConfig: serviceConfig, productsListSearchConfig: productsListSearchConfig, children: _jsx(RootContent, { children: children, className: className, ref: ref }) }));
49
+ });
50
+ /**
51
+ * Internal component to handle the Root content with service access
52
+ */
53
+ const RootContent = React.forwardRef((props, ref) => {
54
+ const { children, className } = props;
55
+ const productsListService = useService(ProductsListServiceDefinition);
56
+ const contextProducts = productsListService.products.get();
57
+ const pagingMetadata = productsListService.pagingMetadata.get();
58
+ const displayedProducts = contextProducts.length;
59
+ const totalProducts = pagingMetadata.count || contextProducts.length;
60
+ const isFiltered = false; // TODO: Implement filtering detection
61
+ const attributes = {
62
+ 'data-testid': TestIds.productListRoot,
63
+ 'data-total-products': totalProducts,
64
+ 'data-displayed-products': displayedProducts,
65
+ 'data-filtered': isFiltered,
66
+ className,
67
+ };
68
+ return (_jsx("div", { ...attributes, ref: ref, children: children }));
69
+ });
70
+ /**
71
+ * Raw component that provides direct access to product list data.
72
+ * Similar to Product.Raw, this should only be used when you need custom access to list data.
73
+ *
74
+ * @component
75
+ * @example
76
+ * ```tsx
77
+ * <ProductList.Raw>
78
+ * {({ totalProducts, displayedProducts, isFiltered }) => (
79
+ * <div className="text-content-muted">
80
+ * Showing {displayedProducts} of {totalProducts} products
81
+ * {isFiltered && <span className="ml-2 text-brand-primary">(Filtered)</span>}
82
+ * </div>
83
+ * )}
84
+ * </ProductList.Raw>
85
+ * ```
86
+ */
87
+ export const Raw = React.forwardRef((props, _ref) => {
88
+ const { children } = props;
89
+ const productsListService = useService(ProductsListServiceDefinition);
90
+ const products = productsListService.products.get();
91
+ const pagingMetadata = productsListService.pagingMetadata.get();
92
+ const displayedProducts = products.length;
93
+ const totalProducts = pagingMetadata.count || products.length;
94
+ const isFiltered = false; // TODO: Implement filtering detection
95
+ return typeof children === 'function'
96
+ ? children({ totalProducts, displayedProducts, isFiltered })
97
+ : children;
98
+ });
99
+ /**
100
+ * Container for the product list with empty state support.
101
+ * Follows List Container Level pattern.
102
+ *
103
+ * @component
104
+ * @example
105
+ * ```tsx
106
+ * <ProductList.Products emptyState={<div>No products found</div>}>
107
+ * <ProductList.ProductRepeater>
108
+ * <Product.Name />
109
+ * <Product.Price />
110
+ * </ProductList.ProductRepeater>
111
+ * </ProductList.Products>
112
+ * ```
113
+ */
114
+ export const Products = React.forwardRef((props, ref) => {
115
+ const { children, emptyState, infiniteScroll = true, pageSize = 0, className, } = props;
116
+ const productsListService = useService(ProductsListServiceDefinition);
117
+ const products = productsListService.products.get();
118
+ const hasProducts = products.length > 0;
119
+ if (!hasProducts) {
120
+ return emptyState || null;
121
+ }
122
+ const attributes = {
123
+ 'data-testid': TestIds.productListProducts,
124
+ 'data-empty': !hasProducts,
125
+ 'data-infinite-scroll': infiniteScroll,
126
+ 'data-page-size': pageSize,
127
+ className,
128
+ };
129
+ return (_jsx("div", { ...attributes, ref: ref, children: children }));
130
+ });
131
+ /**
132
+ * Repeater component that renders Product.Root for each product.
133
+ * Follows Repeater Level pattern.
134
+ * Note: Repeater components do NOT support asChild as per architecture rules.
135
+ *
136
+ * @component
137
+ * @example
138
+ * ```tsx
139
+ * <ProductList.ProductRepeater>
140
+ * <Product.Name />
141
+ * <Product.Price />
142
+ * <Product.MediaGallery>
143
+ * <MediaGallery.Viewport />
144
+ * </Product.MediaGallery>
145
+ * </ProductList.ProductRepeater>
146
+ * ```
147
+ */
148
+ export const ProductRepeater = React.forwardRef((props, _ref) => {
149
+ const { children } = props;
150
+ const productsListService = useService(ProductsListServiceDefinition);
151
+ const products = productsListService.products.get();
152
+ const hasProducts = products.length > 0;
153
+ if (!hasProducts)
154
+ return null;
155
+ return (_jsx(_Fragment, { children: products.map((product) => (_jsx(Product.Root, { product: product, "data-testid": TestIds.productListItem, "data-product-id": product._id, "data-product-available": true, children: children }, product._id))) }));
156
+ });
@@ -129,7 +129,8 @@ export interface ProductMediaProps {
129
129
  children: (props: ProductMediaRenderProps) => React.ReactNode;
130
130
  }
131
131
  export interface ProductMediaRenderProps {
132
- media: ProductMedia[];
132
+ mediaItems: ProductMedia[];
133
+ mainMedia?: ProductMedia;
133
134
  }
134
135
  export declare function Media(props: ProductMediaProps): import("react").ReactNode;
135
136
  export interface ProductProps {
@@ -146,3 +147,39 @@ export interface LoadingRenderProps {
146
147
  isLoading: boolean;
147
148
  }
148
149
  export declare function Loading(props: LoadingProps): import("react").ReactNode;
150
+ /**
151
+ * Props for ProductSlug headless component
152
+ */
153
+ export interface ProductSlugProps {
154
+ /** Render prop function that receives product slug data */
155
+ children: (props: ProductSlugRenderProps) => React.ReactNode;
156
+ }
157
+ /**
158
+ * Render props for ProductSlug component
159
+ */
160
+ export interface ProductSlugRenderProps {
161
+ /** Product slug */
162
+ slug: string;
163
+ }
164
+ /**
165
+ * Headless component for product slug display
166
+ *
167
+ * @component
168
+ * @example
169
+ * ```tsx
170
+ * import { Product } from '@wix/stores/components';
171
+ *
172
+ * function ProductSlugDisplay() {
173
+ * return (
174
+ * <Product.Slug>
175
+ * {({ slug }) => (
176
+ * <a href={`/product/${slug}`}>
177
+ * View Product
178
+ * </a>
179
+ * )}
180
+ * </Product.Slug>
181
+ * );
182
+ * }
183
+ * ```
184
+ */
185
+ export declare function Slug(props: ProductSlugProps): import("react").ReactNode;
@@ -105,9 +105,11 @@ export function Description(props) {
105
105
  export function Media(props) {
106
106
  const service = useService(ProductServiceDefinition);
107
107
  const product = service.product.get();
108
- const media = product.media?.itemsInfo?.items ?? [];
108
+ const mainMedia = product.media?.main;
109
+ const mediaItems = product.media?.itemsInfo?.items ?? [];
109
110
  return props.children({
110
- media,
111
+ mediaItems,
112
+ mainMedia,
111
113
  });
112
114
  }
113
115
  export function Content(props) {
@@ -124,3 +126,32 @@ export function Loading(props) {
124
126
  isLoading,
125
127
  });
126
128
  }
129
+ /**
130
+ * Headless component for product slug display
131
+ *
132
+ * @component
133
+ * @example
134
+ * ```tsx
135
+ * import { Product } from '@wix/stores/components';
136
+ *
137
+ * function ProductSlugDisplay() {
138
+ * return (
139
+ * <Product.Slug>
140
+ * {({ slug }) => (
141
+ * <a href={`/product/${slug}`}>
142
+ * View Product
143
+ * </a>
144
+ * )}
145
+ * </Product.Slug>
146
+ * );
147
+ * }
148
+ * ```
149
+ */
150
+ export function Slug(props) {
151
+ const service = useService(ProductServiceDefinition);
152
+ const product = service.product.get();
153
+ const slug = product.slug;
154
+ return props.children({
155
+ slug,
156
+ });
157
+ }
@@ -2,13 +2,14 @@ export * as CategoryListCore from './core/CategoryList.js';
2
2
  export * as CategoryCore from './core/Category.js';
3
3
  export * as ProductCore from './core/Product.js';
4
4
  export * as ProductModifiers from './core/ProductModifiers.js';
5
- export * as ProductList from './core/ProductList.js';
5
+ export * as ProductListCore from './core/ProductList.js';
6
6
  export * as ProductListFilters from './core/ProductListFilters.js';
7
7
  export * as ProductListPagination from './core/ProductListPagination.js';
8
8
  export * as ProductListSort from './core/ProductListSort.js';
9
9
  export * as ProductVariantSelector from './core/ProductVariantSelector.js';
10
10
  export * as SelectedVariant from './core/SelectedVariant.js';
11
11
  export * as Product from './Product.js';
12
+ export * as ProductList from './ProductList.js';
12
13
  export * as Option from './Option.js';
13
14
  export * as Choice from './Choice.js';
14
15
  export * as CategoryList from './CategoryList.js';