@liquidcommerce/elements-sdk 2.6.0-beta.1 → 2.6.0-beta.100

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 (274) hide show
  1. package/README.md +99 -2517
  2. package/dist/index.checkout.esm.js +17794 -0
  3. package/dist/index.esm.js +26010 -20601
  4. package/dist/ssr-stub.checkout.esm.js +18 -0
  5. package/dist/ssr-stub.esm.js +270 -0
  6. package/dist/types/auto-initialize/checkout.d.ts +2 -0
  7. package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
  8. package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
  9. package/dist/types/clients/builder.d.ts +3 -0
  10. package/dist/types/clients/checkout.d.ts +6 -0
  11. package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
  12. package/dist/types/clients/main.d.ts +3 -0
  13. package/dist/types/constants/core.constant.d.ts +13 -6
  14. package/dist/types/core/a11y/announcer.service.d.ts +16 -0
  15. package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
  16. package/dist/types/core/a11y/focusable.d.ts +5 -0
  17. package/dist/types/core/a11y/glyph-button.d.ts +8 -0
  18. package/dist/types/core/a11y/index.d.ts +5 -0
  19. package/dist/types/core/a11y/single-select.d.ts +16 -0
  20. package/dist/types/core/api/api-client.service.d.ts +23 -22
  21. package/dist/types/core/api/api-result.d.ts +19 -0
  22. package/dist/types/core/api/auth-client.service.d.ts +39 -26
  23. package/dist/types/core/api/http-client.service.d.ts +0 -8
  24. package/dist/types/core/base-component.service.d.ts +4 -1
  25. package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
  26. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  27. package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
  28. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
  29. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  30. package/dist/types/core/client/client-action.service.d.ts +6 -67
  31. package/dist/types/core/client/client-config.service.d.ts +9 -5
  32. package/dist/types/core/command/base-command.service.d.ts +2 -2
  33. package/dist/types/core/command/common-command.service.d.ts +2 -1
  34. package/dist/types/core/google-tag-manager.service.d.ts +15 -11
  35. package/dist/types/core/logger/logger.service.d.ts +1 -1
  36. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +6 -12
  37. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
  38. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -50
  39. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
  40. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
  41. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  42. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  43. package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
  44. package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -55
  45. package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
  46. package/dist/types/core/store/interfaces/core.interface.d.ts +16 -5
  47. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  48. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  49. package/dist/types/core/store/interfaces/product.interface.d.ts +13 -66
  50. package/dist/types/core/store/store.constant.d.ts +6 -1
  51. package/dist/types/core/store/store.service.d.ts +1 -0
  52. package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
  53. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  54. package/dist/types/enums/core.enum.d.ts +40 -1
  55. package/dist/types/enums/index.d.ts +0 -1
  56. package/dist/types/index.checkout.d.ts +8 -0
  57. package/dist/types/index.checkout.umd.d.ts +4 -0
  58. package/dist/types/index.d.ts +8 -3
  59. package/dist/types/interfaces/api/address.interface.d.ts +28 -0
  60. package/dist/types/interfaces/api/cart.interface.d.ts +96 -0
  61. package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
  62. package/dist/types/interfaces/{cloud → api}/index.d.ts +1 -3
  63. package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
  64. package/dist/types/interfaces/api/product.interface.d.ts +112 -0
  65. package/dist/types/interfaces/client.interface.d.ts +72 -0
  66. package/dist/types/interfaces/component.interface.d.ts +7 -0
  67. package/dist/types/interfaces/config.interface.d.ts +40 -0
  68. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  69. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  70. package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
  71. package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
  72. package/dist/types/interfaces/configs/global.interface.d.ts +10 -3
  73. package/dist/types/interfaces/configs/index.d.ts +1 -0
  74. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  75. package/dist/types/interfaces/configs/product.interface.d.ts +4 -1
  76. package/dist/types/interfaces/injection.interface.d.ts +49 -0
  77. package/dist/types/modules/address/address-display.component.d.ts +3 -1
  78. package/dist/types/modules/address/address-input.component.d.ts +10 -1
  79. package/dist/types/modules/address/address.command.d.ts +4 -4
  80. package/dist/types/modules/address/address.interface.d.ts +0 -7
  81. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  82. package/dist/types/modules/cart/cart.commands.d.ts +4 -5
  83. package/dist/types/modules/cart/components/cart-body.component.d.ts +3 -1
  84. package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
  85. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
  86. package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
  87. package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
  88. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  89. package/dist/types/modules/checkout/checkout.commands.d.ts +27 -10
  90. package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
  91. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  92. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
  93. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  94. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
  95. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  96. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
  97. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
  98. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  99. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  100. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
  101. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  102. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  103. package/dist/types/modules/checkout/constant.d.ts +3 -0
  104. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  105. package/dist/types/modules/product/components/components.d.ts +7 -4
  106. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
  107. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  108. package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
  109. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
  110. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  111. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +4 -0
  112. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +10 -2
  113. package/dist/types/modules/product/product.commands.d.ts +7 -7
  114. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  115. package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
  116. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  117. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  118. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
  119. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
  120. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
  121. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  122. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  123. package/dist/types/modules/product-list/components/filter-components/product-list-checkbox-filter.d.ts +7 -0
  124. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  125. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  126. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
  127. package/dist/types/modules/product-list/components/filter-components/product-list-price-filter.d.ts +22 -0
  128. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  129. package/dist/types/modules/product-list/components/index.d.ts +6 -0
  130. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  131. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -30
  132. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  133. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +56 -14
  134. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  135. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
  136. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  137. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
  138. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  139. package/dist/types/modules/product-list/product-list.commands.d.ts +23 -7
  140. package/dist/types/modules/product-list/product-list.component.d.ts +17 -39
  141. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  142. package/dist/types/modules/product-list/product-list.interface.d.ts +65 -0
  143. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  144. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  145. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  146. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  147. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  148. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  149. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  150. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  151. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  152. package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
  153. package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
  154. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
  155. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
  156. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
  157. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  158. package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
  159. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  160. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  161. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  162. package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
  163. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  164. package/dist/types/ssr/stub.d.ts +10 -0
  165. package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
  166. package/dist/types/static/icon/bag.icon.d.ts +1 -1
  167. package/dist/types/static/icon/check.icon.d.ts +2 -0
  168. package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
  169. package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
  170. package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
  171. package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
  172. package/dist/types/static/icon/close.icon.d.ts +1 -1
  173. package/dist/types/static/icon/error-info.icon.d.ts +1 -1
  174. package/dist/types/static/icon/filter.icon.d.ts +2 -0
  175. package/dist/types/static/icon/icon.a11y.d.ts +1 -0
  176. package/dist/types/static/icon/icon.types.d.ts +1 -0
  177. package/dist/types/static/icon/index.d.ts +3 -0
  178. package/dist/types/static/icon/info.icon.d.ts +1 -1
  179. package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
  180. package/dist/types/static/icon/search.icon.d.ts +1 -1
  181. package/dist/types/static/icon/success.icon.d.ts +1 -1
  182. package/dist/types/static/icon/trash.icon.d.ts +1 -1
  183. package/dist/types/static/icon/warning.icon.d.ts +1 -1
  184. package/dist/types/utils/dom-compat.d.ts +2 -0
  185. package/dist/types/utils/format.d.ts +4 -14
  186. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  187. package/dist/types/utils/product-selection.d.ts +16 -0
  188. package/dist/types/utils/product.d.ts +15 -0
  189. package/docs/v1/README.md +213 -0
  190. package/docs/v1/api/actions/address-actions.md +286 -0
  191. package/docs/v1/api/actions/cart-actions.md +364 -0
  192. package/docs/v1/api/actions/checkout-actions.md +527 -0
  193. package/docs/v1/api/actions/product-actions.md +204 -0
  194. package/docs/v1/api/client.md +596 -0
  195. package/docs/v1/api/configuration.md +555 -0
  196. package/docs/v1/api/injection-methods.md +292 -0
  197. package/docs/v1/api/typescript-types.md +423 -0
  198. package/docs/v1/api/ui-helpers.md +200 -0
  199. package/docs/v1/examples/advanced-patterns.md +199 -0
  200. package/docs/v1/examples/checkout-flow.md +90 -0
  201. package/docs/v1/examples/custom-theming.md +63 -0
  202. package/docs/v1/examples/multi-product-page.md +90 -0
  203. package/docs/v1/examples/simple-product-page.md +89 -0
  204. package/docs/v1/getting-started/concepts.md +521 -0
  205. package/docs/v1/getting-started/installation.md +349 -0
  206. package/docs/v1/getting-started/quick-start.md +410 -0
  207. package/docs/v1/guides/accessibility.md +173 -0
  208. package/docs/v1/guides/address-component.md +435 -0
  209. package/docs/v1/guides/best-practices.md +365 -0
  210. package/docs/v1/guides/cart-component.md +757 -0
  211. package/docs/v1/guides/checkout-component.md +670 -0
  212. package/docs/v1/guides/events.md +939 -0
  213. package/docs/v1/guides/product-component.md +735 -0
  214. package/docs/v1/guides/product-list-component.md +630 -0
  215. package/docs/v1/guides/theming.md +228 -0
  216. package/docs/v1/integration/angular.md +39 -0
  217. package/docs/v1/integration/laravel.md +41 -0
  218. package/docs/v1/integration/nextjs.md +69 -0
  219. package/docs/v1/integration/proxy-setup.md +106 -0
  220. package/docs/v1/integration/react.md +64 -0
  221. package/docs/v1/integration/vanilla-js.md +84 -0
  222. package/docs/v1/integration/vue.md +58 -0
  223. package/docs/v1/reference/analytics.md +108 -0
  224. package/docs/v1/reference/browser-support.md +47 -0
  225. package/docs/v1/reference/error-handling.md +83 -0
  226. package/docs/v1/reference/performance.md +52 -0
  227. package/docs/v1/reference/telemetry.md +85 -0
  228. package/docs/v1/reference/troubleshooting.md +135 -0
  229. package/package.json +69 -45
  230. package/dist/types/elements-builder-client.d.ts +0 -2
  231. package/dist/types/elements-client.d.ts +0 -2
  232. package/dist/types/enums/cloud.enum.d.ts +0 -77
  233. package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
  234. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  235. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  236. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
  237. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  238. package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
  239. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  240. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  241. package/dist/types/interfaces/core.interface.d.ts +0 -111
  242. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  243. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  244. package/dist/types/modules/product/utils/helpers.d.ts +0 -3
  245. package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
  246. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  247. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  248. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  249. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  250. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  251. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  252. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  253. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
  254. package/dist/types/utils/helper.d.ts +0 -27
  255. package/docs/ACTIONS.md +0 -1300
  256. package/docs/BROWSER_SUPPORT.md +0 -279
  257. package/docs/CONFIGURATION.md +0 -853
  258. package/docs/DOCUMENTATION_INDEX.md +0 -311
  259. package/docs/EVENTS.md +0 -798
  260. package/docs/PROXY.md +0 -228
  261. package/docs/THEMING.md +0 -589
  262. package/docs/TROUBLESHOOTING.md +0 -793
  263. package/umd/elements.js +0 -1
  264. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  265. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  266. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  267. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  268. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  269. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  270. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  271. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  272. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  273. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  274. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,630 @@
1
+ # Product List Component
2
+
3
+ The Product List component provides a filterable, searchable product catalog with infinite scroll for building category pages and search results.
4
+
5
+ ## Overview
6
+
7
+ The Product List component:
8
+ - Displays products in a responsive grid
9
+ - Supports infinite scroll pagination
10
+ - Provides search functionality
11
+ - Offers advanced filtering options
12
+ - Links to product detail pages
13
+ - Shows real-time availability
14
+ - Supports add-to-cart from list view
15
+
16
+ ## Basic Usage
17
+
18
+ ### Declarative Setup
19
+
20
+ Use data attributes to configure the product list:
21
+
22
+ ```html
23
+ <script
24
+ defer
25
+ data-liquid-commerce-elements
26
+ data-token="YOUR_API_KEY"
27
+ data-env="production"
28
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
29
+ ></script>
30
+
31
+ <div
32
+ data-liquid-commerce-elements-products-list="my-collection-slug"
33
+ data-rows="3"
34
+ data-columns="4"
35
+ data-filters="price,brands,categories"
36
+ data-product-url="/product/{grouping}"
37
+ ></div>
38
+ ```
39
+
40
+ **Attributes:**
41
+ - `data-liquid-commerce-elements-products-list`: Product list container; value is the collection slug
42
+ - `data-rows`: Number of rows to display (default: 4)
43
+ - `data-columns`: Number of columns (default: 4)
44
+ - `data-filters`: Comma-separated filter types
45
+ - `data-product-url`: URL pattern for product detail pages (optional)
46
+
47
+ `data-product-url` accepts a string template with one of two placeholders:
48
+ - `{grouping}` — replaced with the product's salsifyGrouping ID
49
+ - `{upc}` — replaced with the selected size's UPC
50
+
51
+ If your PDP URLs aren't derivable from a single placeholder (e.g. each
52
+ product has a hand-curated marketing slug), use the
53
+ [Product URL Map](#product-url-map) instead.
54
+
55
+ ### With Search and Filters
56
+
57
+ Separate containers for search and filters:
58
+
59
+ ```html
60
+ <!-- Search container -->
61
+ <div data-liquid-commerce-elements-products-list-search="my-collection-slug"></div>
62
+
63
+ <!-- Filters container -->
64
+ <div data-liquid-commerce-elements-products-list-filters="my-collection-slug" data-filters="price,brands,fulfillment"></div>
65
+
66
+ <!-- Product list -->
67
+ <div
68
+ data-liquid-commerce-elements-products-list="my-collection-slug"
69
+ data-rows="4"
70
+ data-columns="3"
71
+ data-product-url="/products/{grouping}"
72
+ ></div>
73
+ ```
74
+
75
+ ### Programmatic Setup
76
+
77
+ Use JavaScript for dynamic configuration:
78
+
79
+ ```javascript
80
+ const client = await Elements('YOUR_API_KEY', { env: 'production' });
81
+
82
+ // Inject product list
83
+ await client.injectProductList({
84
+ containerId: 'products',
85
+ slug: 'my-collection-slug',
86
+ rows: 3,
87
+ columns: 4,
88
+ filters: ['price', 'brands', 'categories', 'fulfillment'],
89
+ productUrl: '/product/{grouping}'
90
+ });
91
+
92
+ // Inject search (optional)
93
+ await client.injectProductListSearch({
94
+ containerId: 'search',
95
+ slug: 'my-collection-slug'
96
+ });
97
+
98
+ // Inject filters (optional)
99
+ await client.injectProductListFilters({
100
+ containerId: 'filters',
101
+ slug: 'my-collection-slug',
102
+ filters: ['price', 'brands']
103
+ });
104
+ ```
105
+
106
+ ## Available Filters
107
+
108
+ The following filter type values can be used in the `filters` array:
109
+
110
+ | Filter Value | Description |
111
+ |----------------|------------------------------------------|
112
+ | `'price'` | Price range slider with min/max values |
113
+ | `'brands'` | Checkboxes for available brands |
114
+ | `'categories'` | Category selection checkboxes |
115
+ | `'fulfillment'`| Shipping vs. on-demand delivery toggle |
116
+ | `'engraving'` | Filter by personalization support |
117
+ | `'sizes'` | Filter by product size/volume |
118
+ | `'flavor'` | Filter by flavor profile |
119
+ | `'region'` | Filter by region of origin |
120
+ | `'variety'` | Filter by product variety |
121
+ | `'vintage'` | Filter by vintage year |
122
+ | `'country'` | Filter by country of origin |
123
+ | `'appellation'`| Filter by appellation |
124
+ | `'materials'` | Filter by materials |
125
+
126
+ ```javascript
127
+ // Example: use multiple filters
128
+ filters: ['price', 'brands', 'categories', 'fulfillment', 'sizes']
129
+ ```
130
+
131
+ ## URL Query Param Filters
132
+
133
+ The product list auto-applies filters from the page URL on first load. Useful for category landing pages, "shop the look" links, marketing emails, or any flow where you want to deep-link into a pre-filtered list.
134
+
135
+ ### Whitelist
136
+
137
+ Only filter keys that are configured for the list are honored — anything else in the URL is silently ignored. The whitelist resolves in this priority order:
138
+
139
+ 1. `data-filters` on `<div data-liquid-commerce-elements-products-list>` (use this when the page does **not** mount a filters UI but you still want URL filtering — e.g. a curated category page).
140
+ 2. `data-filters` on the matching `<... -products-list-filters>` container (the common case when a filters panel is mounted).
141
+ 3. `filters` array passed to `injectProductList(...)` programmatically.
142
+ 4. `availableFilters` from the theme config for the list slug (fallback only).
143
+
144
+ ### Supported formats
145
+
146
+ | Filter | URL format | Example |
147
+ | --- | --- | --- |
148
+ | Multi-value (`brands`, `categories`, `flavor`, `region`, `variety`, `vintage`, `country`, `appellation`, `materials`, `sizes`) | Comma-separated **or** repeated keys | `?brands=Bacardi,Glenlivet` or `?brands=Bacardi&brands=Glenlivet` |
149
+ | `fulfillment` | Single value: `all`, `shipping`, or `onDemand` | `?fulfillment=shipping` |
150
+ | `engraving` | `true` or `false` | `?engraving=true` |
151
+ | `price` | `min-max` range; `min-` or `-max` are accepted | `?price=20-150`, `?price=20-`, `?price=-150` |
152
+
153
+ Invalid values are dropped (e.g. `?fulfillment=garbage`, `?price=abc` — no error, the filter just isn't applied). Combining params is supported:
154
+
155
+ ```
156
+ https://yoursite.com/best-sellers?brands=Bacardi&categories=Wine&price=20-150&fulfillment=shipping
157
+ ```
158
+
159
+ ### Behavior
160
+
161
+ - URL params win over any state persisted from a previous session.
162
+ - Once the list mounts, the filters panel (if present) reflects the seeded values, and the initial product fetch is filtered.
163
+ - Subsequent in-page interactions (toggling filters, scrolling, etc.) do not write back to the URL — the URL is read-only at load time.
164
+
165
+ ### Standalone use (no filters component)
166
+
167
+ URL filtering works without injecting a filters panel. Declare the whitelist on the products-list container itself:
168
+
169
+ ```html
170
+ <div
171
+ data-liquid-commerce-elements-products-list="curated-page"
172
+ data-filters="price,brands,categories"
173
+ data-rows="4"
174
+ data-columns="4"
175
+ ></div>
176
+ ```
177
+
178
+ Now `https://yoursite.com/curated-page?brands=Bacardi&price=20-150` filters the list on load even though no filters UI is present.
179
+
180
+ ## Search Functionality
181
+
182
+ ### Search Box
183
+
184
+ The search component provides full-text search across:
185
+ - Product names
186
+ - Descriptions
187
+ - Brand names
188
+ - Categories
189
+ - SKUs/UPCs
190
+
191
+ ### Search Behavior
192
+
193
+ - Real-time search as user types (500ms debounce; fires on any non-empty input — no minimum character count)
194
+ - Input is limited to 100 characters; allowed characters: letters, numbers, spaces, and `- _ ' . , & ( )`
195
+ - Server-side filtering by the search term
196
+ - "Clear search" button appears when active
197
+
198
+ ### Programmatic Search
199
+
200
+ Search is controlled through the injected search component. Use `injectProductListSearch()` to add a search box that automatically filters the associated product list.
201
+
202
+ ## Grid Layout
203
+
204
+ ### Responsive Grid
205
+
206
+ The grid automatically adjusts for screen sizes:
207
+
208
+ **Desktop** (> 1024px):
209
+ - Uses configured columns (e.g., 4 columns)
210
+
211
+ **Tablet** (768px - 1024px):
212
+ - Reduces to 3 or 2 columns
213
+
214
+ **Mobile** (< 768px):
215
+ - Single column or 2 columns depending on space
216
+
217
+ ### Configuring Layout
218
+
219
+ ```javascript
220
+ await client.injectProductList({
221
+ containerId: 'products',
222
+ slug: 'my-collection',
223
+ rows: 5, // Number of rows per page
224
+ columns: 4 // Columns in grid (desktop)
225
+ });
226
+ ```
227
+
228
+ Total products per page = rows × columns (e.g., 5 × 4 = 20 products)
229
+
230
+ ## Infinite Scroll
231
+
232
+ ### How It Works
233
+
234
+ 1. Initial products load (rows × columns)
235
+ 2. User scrolls to bottom
236
+ 3. Next page loads automatically
237
+ 4. Appends to existing products
238
+ 5. Continues until all products shown
239
+
240
+ ### Loading States
241
+
242
+ Shows loading indicator:
243
+ - On initial load
244
+ - When loading next page
245
+ - When applying filters
246
+ - When searching
247
+
248
+ ### End of Results
249
+
250
+ When all products are shown:
251
+ - Infinite scroll stops
252
+ - Shows "No more products" message
253
+ - Scroll to top button may appear
254
+
255
+ ## Product Cards
256
+
257
+ Each product card shows:
258
+
259
+ - Product image
260
+ - Product name
261
+ - Brand
262
+ - Price (or price range for multiple sizes)
263
+ - Clickable image/card linking to the product detail page (when `productUrl` is configured)
264
+ - "Add to Cart" button (optional)
265
+ - Availability indicator
266
+
267
+ Product card images automatically have their white/near-white backgrounds removed so the product blends into the surrounding card and page background. This treatment is applied at render time and is not host-configurable.
268
+
269
+ ### Card Interaction
270
+
271
+ **Click on card:** Navigate to product detail page (if `productUrl` configured — see [Product URL Map](#product-url-map) for partner-owned PDP URLs that aren't derivable from a token).
272
+
273
+ **Quick Add:** Add product to cart directly from list view (if enabled)
274
+
275
+ **Click on image:** Navigate to the configured `productUrl` (only when `productUrl` is set — otherwise the image is not a link)
276
+
277
+ ## Customization
278
+
279
+ ### Theme Configuration
280
+
281
+ Product list theming is applied per-list using the collection slug as a key:
282
+
283
+ ```javascript
284
+ const client = await Elements('YOUR_API_KEY', {
285
+ env: 'production',
286
+ customTheme: {
287
+ productList: {
288
+ theme: {
289
+ backgroundColor: '#ffffff'
290
+ },
291
+ layout: {
292
+ lists: {
293
+ 'my-collection-slug': {
294
+ productCard: {
295
+ style: 'card', // 'card' or 'ghost'
296
+ cornerRadius: '8px',
297
+ showPrice: true,
298
+ showSizes: true,
299
+ showRetailerName: true,
300
+ showFulfillmentOptions: true,
301
+ enableShippingFulfillment: true,
302
+ enableOnDemandFulfillment: true,
303
+ enablePersonalization: true,
304
+ showQuantityCounter: true,
305
+ enablePreCart: true,
306
+ showCollectionTags: false
307
+ },
308
+ presentationMode: 'drawer', // 'drawer' or 'modal'
309
+ rows: 4,
310
+ columns: 3
311
+ }
312
+ }
313
+ }
314
+ }
315
+ }
316
+ });
317
+ ```
318
+
319
+ See [Configuration Reference](../api/configuration.md#product-list-theme) for the complete list of options.
320
+
321
+ ## Use Cases
322
+
323
+ ### Category Page
324
+
325
+ ```html
326
+ <!DOCTYPE html>
327
+ <html>
328
+ <head>
329
+ <title>Whiskey Collection</title>
330
+ <script
331
+ defer
332
+ data-liquid-commerce-elements
333
+ data-token="YOUR_API_KEY"
334
+ data-env="production"
335
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
336
+ ></script>
337
+ </head>
338
+ <body>
339
+ <h1>Whiskey Collection</h1>
340
+
341
+ <!-- Search -->
342
+ <div data-liquid-commerce-elements-products-list-search="whiskey-collection"></div>
343
+
344
+ <div class="catalog">
345
+ <!-- Filters sidebar -->
346
+ <aside>
347
+ <div data-liquid-commerce-elements-products-list-filters="whiskey-collection" data-filters="price,brands,sizes"></div>
348
+ </aside>
349
+
350
+ <!-- Product grid -->
351
+ <main>
352
+ <div
353
+ data-liquid-commerce-elements-products-list="whiskey-collection"
354
+ data-rows="4"
355
+ data-columns="3"
356
+ data-product-url="/whiskey/{grouping}"
357
+ ></div>
358
+ </main>
359
+ </div>
360
+ </body>
361
+ </html>
362
+ ```
363
+
364
+ ### Search Results Page
365
+
366
+ ```javascript
367
+ import { Elements } from '@liquidcommerce/elements-sdk';
368
+
369
+ const client = await Elements('YOUR_API_KEY', { env: 'production' });
370
+
371
+ // Inject product list with search
372
+ await client.injectProductList({
373
+ containerId: 'search-results',
374
+ slug: 'all-products',
375
+ rows: 5,
376
+ columns: 4,
377
+ filters: ['price', 'brands', 'categories']
378
+ });
379
+
380
+ await client.injectProductListSearch({
381
+ containerId: 'search-box',
382
+ slug: 'all-products'
383
+ });
384
+ ```
385
+
386
+ ### Custom Product URL Patterns
387
+
388
+ Different URL patterns for different product types:
389
+
390
+ ```javascript
391
+ // Get product type from data
392
+ const productType = getProductTypeFromData();
393
+
394
+ let urlPattern;
395
+ switch (productType) {
396
+ case 'whiskey':
397
+ urlPattern = '/spirits/whiskey/{grouping}';
398
+ break;
399
+ case 'wine':
400
+ urlPattern = '/wine/{grouping}';
401
+ break;
402
+ default:
403
+ urlPattern = '/products/{grouping}';
404
+ }
405
+
406
+ await client.injectProductList({
407
+ containerId: 'products',
408
+ slug: 'all-products',
409
+ rows: 3,
410
+ columns: 4,
411
+ productUrl: urlPattern
412
+ });
413
+ ```
414
+
415
+ ### Product URL Map
416
+
417
+ For partners whose PDPs have hand-curated URLs that aren't derivable from a
418
+ single placeholder (e.g. dedicated marketing pages, Shopify handles, WordPress
419
+ slugs), pass a **map** instead of a string template. Keys are product
420
+ identifiers — either a UPC or a salsifyGrouping ID, the same identifier types
421
+ accepted by `injectProductElement`. The card looks up UPC first, then grouping
422
+ ID; products not in the map render without a link.
423
+
424
+ #### Declarative — JSON script tag
425
+
426
+ Drop a single `<script type="application/json">` tag anywhere on the page,
427
+ keyed by list slug → identifier → URL. Generate it server-side from your CMS.
428
+
429
+ ```html
430
+ <script data-liquid-commerce-elements-product-urls type="application/json">
431
+ {
432
+ "best-sellers": {
433
+ "GROUPING-33277": "/wines/macallan-12-special-edition",
434
+ "00832889005513": "/spirits/cabernet-2018-club-only"
435
+ },
436
+ "limited-releases": {
437
+ "GROUPING-78941": "/exclusive/pappy-23-allocation"
438
+ }
439
+ }
440
+ </script>
441
+
442
+ <div data-liquid-commerce-elements-products-list="best-sellers"></div>
443
+ ```
444
+
445
+ When both `data-product-url` and a slug entry in this script are present for
446
+ the same list, the **map wins** — it's the more specific intent.
447
+
448
+ ##### Shopify Liquid
449
+
450
+ ```liquid
451
+ <script data-liquid-commerce-elements-product-urls type="application/json">
452
+ {
453
+ "best-sellers": {
454
+ {% for p in collections.best-sellers.products %}
455
+ "{{ p.metafields.lc.grouping_id }}": "{{ p.url }}"{% unless forloop.last %},{% endunless %}
456
+ {% endfor %}
457
+ }
458
+ }
459
+ </script>
460
+ ```
461
+
462
+ ##### WordPress / WooCommerce (PHP)
463
+
464
+ ```php
465
+ <script data-liquid-commerce-elements-product-urls type="application/json">
466
+ <?= json_encode(['best-sellers' => $lc_identifier_to_pdp_url_map]) ?>
467
+ </script>
468
+ ```
469
+
470
+ #### Programmatic
471
+
472
+ ```javascript
473
+ await client.injectProductList({
474
+ containerId: 'products',
475
+ slug: 'best-sellers',
476
+ rows: 3,
477
+ columns: 4,
478
+ productUrl: {
479
+ 'GROUPING-33277': '/wines/macallan-12-special-edition',
480
+ '00832889005513': '/spirits/cabernet-2018-club-only',
481
+ },
482
+ });
483
+ ```
484
+
485
+ ## Events
486
+
487
+ While product list events are primarily internal, you can listen for cart events when users add products:
488
+
489
+ ```javascript
490
+ window.addEventListener('lce:actions.cart_item_added', (event) => {
491
+ const { itemId, quantity } = event.detail.data;
492
+ console.log(`Product added from list: ${itemId}`);
493
+ });
494
+ ```
495
+
496
+ ## Accessibility
497
+
498
+ The product list component includes:
499
+
500
+ - Keyboard navigation support
501
+ - Screen reader labels
502
+ - ARIA attributes for filters and search
503
+ - Focus management
504
+ - High contrast support
505
+
506
+ ### Keyboard Shortcuts
507
+
508
+ - `Tab`: Navigate between products and filters
509
+ - `Enter/Space`: Select product or toggle filter
510
+ - `Escape`: Clear search or close filters
511
+ - `Arrow keys`: Navigate grid (when focused)
512
+
513
+ ## Performance
514
+
515
+ ### Optimization Features
516
+
517
+ - **Image lazy loading**: Images load as they enter viewport
518
+ - **Progressive loading**: Products load in batches via an `IntersectionObserver` sentinel as you scroll — each page is appended to the grid and loaded cards remain in the DOM
519
+ - **Debounced search**: Reduces API calls during typing
520
+
521
+ ### Large Catalogs
522
+
523
+ For catalogs with thousands of products:
524
+
525
+ ```javascript
526
+ await client.injectProductList({
527
+ containerId: 'products',
528
+ slug: 'all-products',
529
+ rows: 3,
530
+ columns: 4,
531
+ filters: ['price', 'brands'], // Limit filters to most useful
532
+ // More rows = larger pages = fewer API calls
533
+ });
534
+ ```
535
+
536
+ ## Best Practices
537
+
538
+ ### Provide Clear Navigation
539
+
540
+ ```html
541
+ <nav class="breadcrumb">
542
+ <a href="/">Home</a> &gt;
543
+ <a href="/products">Products</a> &gt;
544
+ <span>Whiskey</span>
545
+ </nav>
546
+ ```
547
+
548
+ ### Show Result Counts
549
+
550
+ The product list component automatically displays the number of results. You can also track cart additions from the list using standard cart events:
551
+
552
+ ```javascript
553
+ window.addEventListener('lce:actions.cart_item_added', (event) => {
554
+ console.log('Item added from product list:', event.detail.data);
555
+ });
556
+ ```
557
+
558
+ ### Mobile-First Design
559
+
560
+ Ensure filters work well on mobile:
561
+
562
+ ```css
563
+ @media (max-width: 768px) {
564
+ .filters-sidebar {
565
+ position: fixed;
566
+ bottom: 0;
567
+ left: 0;
568
+ right: 0;
569
+ transform: translateY(100%);
570
+ transition: transform 0.3s;
571
+ }
572
+
573
+ .filters-sidebar.open {
574
+ transform: translateY(0);
575
+ }
576
+ }
577
+ ```
578
+
579
+ ### Default to Relevant Filters
580
+
581
+ For category pages, pre-select relevant filters:
582
+
583
+ ```javascript
584
+ // On whiskey category page
585
+ await client.injectProductList({
586
+ containerId: 'products',
587
+ slug: 'whiskey-collection',
588
+ rows: 4,
589
+ columns: 3,
590
+ filters: ['price', 'brands', 'sizes'] // Most relevant for whiskey
591
+ });
592
+ ```
593
+
594
+ ## Troubleshooting
595
+
596
+ ### Products Not Loading
597
+
598
+ 1. Check browser console for errors
599
+ 2. Verify API key is correct
600
+ 3. Ensure container ID exists
601
+ 4. Check network tab for API responses
602
+ 5. Verify products exist in catalog
603
+
604
+ ### Filters Not Working
605
+
606
+ 1. Ensure filter types are spelled correctly
607
+ 2. Check that products have filterable attributes
608
+ 3. Verify theme config allows filters
609
+ 4. Look for JavaScript errors
610
+
611
+ ### Infinite Scroll Not Triggering
612
+
613
+ 1. Check container has finite height
614
+ 2. Verify scroll event listeners are attached
615
+ 3. Ensure there are more products to load
616
+ 4. Check console for errors
617
+
618
+ ### Search Not Finding Products
619
+
620
+ 1. Verify the input uses allowed characters and is under the 100-character limit
621
+ 2. Check search is not case-sensitive (it shouldn't be)
622
+ 3. Ensure products have searchable text fields
623
+ 4. Look for API errors in network tab
624
+
625
+ ## See Also
626
+
627
+ - [Product Component](./product-component.md) - Individual product display
628
+ - [Cart Component](./cart-component.md) - Add products to cart
629
+ - [Theming](./theming.md) - Customize appearance
630
+ - [Events](./events.md) - Available events