@liquidcommerce/elements-sdk 2.6.0-beta.10 → 2.6.0-beta.101

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 (262) hide show
  1. package/README.md +99 -2518
  2. package/dist/index.checkout.esm.js +17850 -0
  3. package/dist/index.esm.js +25821 -20795
  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 +2 -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 +19 -18
  21. package/dist/types/core/api/api-result.d.ts +19 -0
  22. package/dist/types/core/api/auth-client.service.d.ts +37 -13
  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 -74
  31. package/dist/types/core/client/client-config.service.d.ts +8 -5
  32. package/dist/types/core/google-tag-manager.service.d.ts +3 -1
  33. package/dist/types/core/logger/logger.service.d.ts +1 -1
  34. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
  35. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
  36. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
  37. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
  38. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  39. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  40. package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
  41. package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
  42. package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
  43. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  44. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  45. package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
  46. package/dist/types/core/store/store.constant.d.ts +5 -0
  47. package/dist/types/core/store/store.service.d.ts +1 -0
  48. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  49. package/dist/types/enums/core.enum.d.ts +39 -1
  50. package/dist/types/enums/index.d.ts +0 -1
  51. package/dist/types/index.checkout.d.ts +8 -0
  52. package/dist/types/index.checkout.umd.d.ts +4 -0
  53. package/dist/types/index.d.ts +8 -3
  54. package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
  55. package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
  56. package/dist/types/interfaces/api/index.d.ts +5 -0
  57. package/dist/types/interfaces/api/product-list.interface.d.ts +14 -5
  58. package/dist/types/interfaces/api/product.interface.d.ts +10 -4
  59. package/dist/types/interfaces/client.interface.d.ts +72 -0
  60. package/dist/types/interfaces/component.interface.d.ts +7 -0
  61. package/dist/types/interfaces/config.interface.d.ts +40 -0
  62. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  63. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  64. package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
  65. package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
  66. package/dist/types/interfaces/configs/index.d.ts +1 -0
  67. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  68. package/dist/types/interfaces/configs/product.interface.d.ts +3 -1
  69. package/dist/types/interfaces/injection.interface.d.ts +49 -0
  70. package/dist/types/modules/address/address-display.component.d.ts +3 -1
  71. package/dist/types/modules/address/address-input.component.d.ts +10 -1
  72. package/dist/types/modules/address/address.command.d.ts +2 -1
  73. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  74. package/dist/types/modules/cart/cart.commands.d.ts +4 -4
  75. package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
  76. package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
  77. package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
  78. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  79. package/dist/types/modules/checkout/checkout.commands.d.ts +27 -10
  80. package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
  81. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  82. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
  83. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  84. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
  85. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  86. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
  87. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
  88. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
  89. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  90. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
  91. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  92. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  93. package/dist/types/modules/checkout/constant.d.ts +3 -0
  94. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  95. package/dist/types/modules/product/components/components.d.ts +6 -1
  96. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
  97. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  98. package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
  99. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
  100. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  101. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +4 -0
  102. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +10 -2
  103. package/dist/types/modules/product/product.commands.d.ts +5 -5
  104. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  105. package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
  106. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  107. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  108. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
  109. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
  110. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
  111. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  112. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  113. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  114. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  115. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
  116. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
  117. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  118. package/dist/types/modules/product-list/components/index.d.ts +6 -2
  119. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  120. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -31
  121. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  122. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +56 -36
  123. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  124. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
  125. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  126. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
  127. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  128. package/dist/types/modules/product-list/product-list.commands.d.ts +22 -7
  129. package/dist/types/modules/product-list/product-list.component.d.ts +17 -47
  130. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  131. package/dist/types/modules/product-list/product-list.interface.d.ts +16 -28
  132. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  133. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  134. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  135. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  136. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  137. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  138. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  139. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  140. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  141. package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
  142. package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
  143. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
  144. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
  145. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
  146. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  147. package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
  148. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  149. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  150. package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
  151. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  152. package/dist/types/ssr/stub.d.ts +10 -0
  153. package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
  154. package/dist/types/static/icon/bag.icon.d.ts +1 -1
  155. package/dist/types/static/icon/check.icon.d.ts +2 -0
  156. package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
  157. package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
  158. package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
  159. package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
  160. package/dist/types/static/icon/close.icon.d.ts +1 -1
  161. package/dist/types/static/icon/error-info.icon.d.ts +1 -1
  162. package/dist/types/static/icon/filter.icon.d.ts +1 -1
  163. package/dist/types/static/icon/icon.a11y.d.ts +1 -0
  164. package/dist/types/static/icon/icon.types.d.ts +1 -0
  165. package/dist/types/static/icon/index.d.ts +2 -0
  166. package/dist/types/static/icon/info.icon.d.ts +1 -1
  167. package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
  168. package/dist/types/static/icon/search.icon.d.ts +1 -1
  169. package/dist/types/static/icon/success.icon.d.ts +1 -1
  170. package/dist/types/static/icon/trash.icon.d.ts +1 -1
  171. package/dist/types/static/icon/warning.icon.d.ts +1 -1
  172. package/dist/types/utils/dom-compat.d.ts +2 -0
  173. package/dist/types/utils/format.d.ts +5 -14
  174. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  175. package/dist/types/utils/product-selection.d.ts +16 -0
  176. package/dist/types/utils/product.d.ts +15 -0
  177. package/dist/types/utils/timezone.d.ts +6 -0
  178. package/docs/v1/README.md +213 -0
  179. package/docs/v1/api/actions/address-actions.md +286 -0
  180. package/docs/v1/api/actions/cart-actions.md +364 -0
  181. package/docs/v1/api/actions/checkout-actions.md +527 -0
  182. package/docs/v1/api/actions/product-actions.md +204 -0
  183. package/docs/v1/api/client.md +596 -0
  184. package/docs/v1/api/configuration.md +555 -0
  185. package/docs/v1/api/injection-methods.md +292 -0
  186. package/docs/v1/api/typescript-types.md +423 -0
  187. package/docs/v1/api/ui-helpers.md +200 -0
  188. package/docs/v1/examples/advanced-patterns.md +199 -0
  189. package/docs/v1/examples/checkout-flow.md +90 -0
  190. package/docs/v1/examples/custom-theming.md +63 -0
  191. package/docs/v1/examples/multi-product-page.md +90 -0
  192. package/docs/v1/examples/simple-product-page.md +89 -0
  193. package/docs/v1/getting-started/concepts.md +521 -0
  194. package/docs/v1/getting-started/installation.md +349 -0
  195. package/docs/v1/getting-started/quick-start.md +410 -0
  196. package/docs/v1/guides/accessibility.md +173 -0
  197. package/docs/v1/guides/address-component.md +435 -0
  198. package/docs/v1/guides/best-practices.md +365 -0
  199. package/docs/v1/guides/cart-component.md +757 -0
  200. package/docs/v1/guides/checkout-component.md +670 -0
  201. package/docs/v1/guides/events.md +939 -0
  202. package/docs/v1/guides/product-component.md +735 -0
  203. package/docs/v1/guides/product-list-component.md +630 -0
  204. package/docs/v1/guides/theming.md +228 -0
  205. package/docs/v1/integration/angular.md +39 -0
  206. package/docs/v1/integration/laravel.md +41 -0
  207. package/docs/v1/integration/nextjs.md +69 -0
  208. package/docs/v1/integration/proxy-setup.md +106 -0
  209. package/docs/v1/integration/react.md +64 -0
  210. package/docs/v1/integration/vanilla-js.md +84 -0
  211. package/docs/v1/integration/vue.md +58 -0
  212. package/docs/v1/reference/analytics.md +108 -0
  213. package/docs/v1/reference/browser-support.md +47 -0
  214. package/docs/v1/reference/error-handling.md +83 -0
  215. package/docs/v1/reference/performance.md +52 -0
  216. package/docs/v1/reference/telemetry.md +85 -0
  217. package/docs/v1/reference/troubleshooting.md +135 -0
  218. package/package.json +69 -44
  219. package/dist/types/elements-builder-client.d.ts +0 -2
  220. package/dist/types/elements-client.d.ts +0 -2
  221. package/dist/types/enums/cloud.enum.d.ts +0 -97
  222. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  223. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  224. package/dist/types/interfaces/cloud/index.d.ts +0 -3
  225. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  226. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  227. package/dist/types/interfaces/core.interface.d.ts +0 -111
  228. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  229. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  230. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  231. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  232. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  233. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  234. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  235. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  236. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  237. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  238. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  239. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  240. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  241. package/dist/types/utils/helper.d.ts +0 -28
  242. package/docs/ACTIONS.md +0 -1300
  243. package/docs/BROWSER_SUPPORT.md +0 -279
  244. package/docs/CONFIGURATION.md +0 -853
  245. package/docs/DOCUMENTATION_INDEX.md +0 -311
  246. package/docs/EVENTS.md +0 -798
  247. package/docs/PROXY.md +0 -228
  248. package/docs/THEMING.md +0 -592
  249. package/docs/TROUBLESHOOTING.md +0 -793
  250. package/umd/elements.js +0 -1
  251. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  252. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  253. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  254. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  255. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  256. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  257. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  258. /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
  259. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  260. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  261. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  262. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,410 @@
1
+ # Quick Start
2
+
3
+ Get a product display with add-to-cart functionality working on your page in under 5 minutes.
4
+
5
+ ## What You'll Build
6
+
7
+ A fully functional product page with:
8
+ - Product images and details
9
+ - Size selection
10
+ - Fulfillment options (shipping/on-demand delivery)
11
+ - Add to cart button
12
+ - Shopping cart drawer
13
+ - Complete checkout flow
14
+
15
+ ## Prerequisites
16
+
17
+ - A LiquidCommerce API key (contact your LiquidCommerce representative)
18
+ - A product identifier
19
+ - A web page or HTML file
20
+
21
+ ## Step 1: Add the SDK Script
22
+
23
+ Add the Elements SDK script tag to your HTML `<head>`:
24
+
25
+ ```html
26
+ <!DOCTYPE html>
27
+ <html>
28
+ <head>
29
+ <title>My Product Page</title>
30
+ <script
31
+ defer
32
+ data-liquid-commerce-elements
33
+ data-token="YOUR_API_KEY"
34
+ data-env="production"
35
+ type="text/javascript"
36
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
37
+ ></script>
38
+ </head>
39
+ <body>
40
+ <!-- We'll add the product here -->
41
+ </body>
42
+ </html>
43
+ ```
44
+
45
+ **Replace `YOUR_API_KEY`** with your actual API key.
46
+
47
+ ## Step 2: Add a Product Container
48
+
49
+ Create a container where the product will be displayed:
50
+
51
+ ```html
52
+ <body>
53
+ <h1>Our Premium Whiskey</h1>
54
+
55
+ <!-- Product will be injected here -->
56
+ <div id="product-display"></div>
57
+ </body>
58
+ ```
59
+
60
+ ## Step 3: Configure the Product (Declarative)
61
+
62
+ Add product configuration using HTML data attributes on the script tag:
63
+
64
+ ```html
65
+ <script
66
+ defer
67
+ data-liquid-commerce-elements
68
+ data-token="YOUR_API_KEY"
69
+ data-env="production"
70
+ data-container-1="product-display"
71
+ data-product-1="00619947000020"
72
+ type="text/javascript"
73
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
74
+ ></script>
75
+ ```
76
+
77
+ **New attributes:**
78
+ - `data-container-1="product-display"` - Points to the container ID
79
+ - `data-product-1="00619947000020"` - The product identifier
80
+
81
+ The numbers (1) connect the container to its product. For multiple products, increment the number:
82
+ - `data-container-2` with `data-product-2`
83
+ - `data-container-3` with `data-product-3`
84
+ - etc.
85
+
86
+ ## Complete Example
87
+
88
+ Here's the complete HTML for a working product page:
89
+
90
+ ```html
91
+ <!DOCTYPE html>
92
+ <html lang="en">
93
+ <head>
94
+ <meta charset="UTF-8">
95
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
96
+ <title>Premium Whiskey - Buy Online</title>
97
+
98
+ <script
99
+ defer
100
+ data-liquid-commerce-elements
101
+ data-token="YOUR_API_KEY"
102
+ data-env="production"
103
+ data-container-1="product-display"
104
+ data-product-1="00619947000020"
105
+ type="text/javascript"
106
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
107
+ ></script>
108
+
109
+ <style>
110
+ body {
111
+ font-family: Arial, sans-serif;
112
+ max-width: 1200px;
113
+ margin: 0 auto;
114
+ padding: 20px;
115
+ }
116
+ h1 {
117
+ text-align: center;
118
+ }
119
+ </style>
120
+ </head>
121
+ <body>
122
+ <h1>Our Premium Whiskey</h1>
123
+ <div id="product-display"></div>
124
+ </body>
125
+ </html>
126
+ ```
127
+
128
+ That's it! Save the file and open it in a browser. You should see:
129
+ 1. Product images in a carousel
130
+ 2. Product name and description
131
+ 3. Size selector
132
+ 4. Fulfillment type selector (shipping/delivery)
133
+ 5. Retailer selection
134
+ 6. Add to cart button
135
+
136
+ When you click "Add to Cart," a cart drawer slides in from the right with checkout functionality.
137
+
138
+ ## Alternative: Programmatic Setup
139
+
140
+ If you prefer JavaScript over HTML attributes:
141
+
142
+ ```html
143
+ <!DOCTYPE html>
144
+ <html>
145
+ <head>
146
+ <title>My Product Page</title>
147
+ <script
148
+ defer
149
+ data-liquid-commerce-elements
150
+ data-token="YOUR_API_KEY"
151
+ data-env="production"
152
+ type="text/javascript"
153
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
154
+ ></script>
155
+
156
+ <script defer>
157
+ // Wait for SDK to be ready
158
+ window.addEventListener('lce:actions.client_ready', async (event) => {
159
+ const client = window.LiquidCommerce.elements;
160
+
161
+ // Inject the product
162
+ await client.injectProductElement([
163
+ {
164
+ containerId: 'product-display',
165
+ identifier: '00619947000020'
166
+ }
167
+ ]);
168
+ }, { once: true });
169
+ </script>
170
+ </head>
171
+ <body>
172
+ <h1>Our Premium Whiskey</h1>
173
+ <div id="product-display"></div>
174
+ </body>
175
+ </html>
176
+ ```
177
+
178
+ Or with NPM:
179
+
180
+ ```javascript
181
+ import { Elements } from '@liquidcommerce/elements-sdk';
182
+
183
+ async function initProduct() {
184
+ // Elements() resolves to `null` if initialization fails — it never throws.
185
+ const client = await Elements('YOUR_API_KEY', {
186
+ env: 'production'
187
+ });
188
+
189
+ if (!client) {
190
+ return;
191
+ }
192
+
193
+ await client.injectProductElement([
194
+ {
195
+ containerId: 'product-display',
196
+ identifier: '00619947000020'
197
+ }
198
+ ]);
199
+ }
200
+
201
+ initProduct();
202
+ ```
203
+
204
+ ## Multiple Products
205
+
206
+ To display multiple products on one page:
207
+
208
+ ```html
209
+ <script
210
+ defer
211
+ data-liquid-commerce-elements
212
+
213
+ data-token="YOUR_API_KEY"
214
+ data-env="production"
215
+
216
+ data-container-1="product-1"
217
+ data-product-1="00619947000020"
218
+ data-container-2="product-2"
219
+ data-product-2="08504405135"
220
+ data-container-3="product-3"
221
+ data-product-3="08068660001"
222
+
223
+ type="text/javascript"
224
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
225
+ ></script>
226
+
227
+ <div id="product-1"></div>
228
+ <div id="product-2"></div>
229
+ <div id="product-3"></div>
230
+ ```
231
+
232
+ Or programmatically:
233
+
234
+ ```javascript
235
+ await client.injectProductElement([
236
+ { containerId: 'product-1', identifier: '00619947000020' },
237
+ { containerId: 'product-2', identifier: '08504405135' },
238
+ { containerId: 'product-3', identifier: '08068660001' }
239
+ ]);
240
+ ```
241
+
242
+ ## What Happens Automatically
243
+
244
+ The SDK handles everything for you:
245
+
246
+ 1. **Address Collection** - If needed, prompts for delivery location
247
+ 2. **Availability Check** - Shows only available fulfillment options
248
+ 3. **Cart Management** - Maintains cart across page refreshes and tabs
249
+ 4. **Checkout Flow** - Complete payment and order processing
250
+ 5. **Error Handling** - Graceful error messages and recovery
251
+ 6. **Mobile Responsiveness** - Works on all screen sizes
252
+
253
+ ## Customization
254
+
255
+ Want to customize the look, visit the Elements Builder in our [Partner Portal](https://app.liquidcommerce.co/)? Want to manually override your theme, you can pass a `customTheme: IClientCustomThemeConfig` configuration:
256
+
257
+ ```html
258
+ <script>
259
+ window.addEventListener('lce:actions.client_ready', async () => {
260
+ const client = window.LiquidCommerce.elements;
261
+
262
+ // You can customize after initialization
263
+ // See Theming Guide for more options
264
+ }, { once: true });
265
+ </script>
266
+ ```
267
+
268
+ Or with NPM:
269
+
270
+ ```javascript
271
+ const client = await Elements('YOUR_API_KEY', {
272
+ env: 'production',
273
+ customTheme: {
274
+ global: {
275
+ theme: {
276
+ primaryColor: '#007bff',
277
+ buttonCornerRadius: '8px',
278
+ headingFont: {
279
+ name: 'Poppins',
280
+ weights: [400, 600]
281
+ }
282
+ }
283
+ }
284
+ }
285
+ });
286
+ ```
287
+
288
+ ## Testing Different Products
289
+
290
+ To test with different products, simply change the product identifier:
291
+
292
+ ```html
293
+ <!-- Replace with your product UPC -->
294
+ data-product-1="YOUR_PRODUCT_IDENTIFIER"
295
+ ```
296
+
297
+ Contact your LiquidCommerce representative for available product identifiers.
298
+
299
+ ## Troubleshooting
300
+
301
+ ### Product Not Showing
302
+
303
+ 1. **Check the browser console** for errors
304
+ 2. **Verify your API key** is correct
305
+ 3. **Confirm the product identifier** exists in your catalog
306
+ 4. **Check the container ID** matches your HTML
307
+
308
+ ### Styling Issues
309
+
310
+ The product uses Shadow DOM for style encapsulation. To customize:
311
+
312
+ - Use the `customTheme` configuration option
313
+ - See [Theming Guide](../guides/theming.md) for detailed customization
314
+
315
+ ### Cart Not Opening
316
+
317
+ The cart should open automatically after adding a product. If it doesn't:
318
+
319
+ 1. Check browser console for JavaScript errors
320
+ 2. Verify no other scripts are conflicting
321
+ 3. Try manually opening: `window.LiquidCommerce.elements.actions.cart.openCart()`
322
+
323
+ ## Next Steps
324
+
325
+ Now that you have a basic product working:
326
+
327
+ - **[Core Concepts](./concepts.md)** - Understand how the SDK works
328
+ - **[Product Component Guide](../guides/product-component.md)** - Deep dive into product features
329
+ - **[Cart Component Guide](../guides/cart-component.md)** - Learn about cart functionality
330
+ - **[Checkout Component Guide](../guides/checkout-component.md)** - Customize the checkout experience
331
+ - **[Theming Guide](../guides/theming.md)** - Make it match your brand
332
+ - **[Events](../guides/events.md)** - React to user actions
333
+ - **[API Reference](../api/client.md)** - Explore all available methods
334
+
335
+ ## Complete Working Example
336
+
337
+ Try this complete example with your API key:
338
+
339
+ ```html
340
+ <!DOCTYPE html>
341
+ <html lang="en">
342
+ <head>
343
+ <meta charset="UTF-8">
344
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
345
+ <title>Whiskey Shop</title>
346
+
347
+ <script
348
+ defer
349
+ data-liquid-commerce-elements
350
+ data-token="YOUR_API_KEY"
351
+ data-env="production"
352
+ data-container-1="product"
353
+ data-product-1="00619947000020"
354
+ type="text/javascript"
355
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
356
+ ></script>
357
+
358
+ <style>
359
+ * {
360
+ margin: 0;
361
+ padding: 0;
362
+ box-sizing: border-box;
363
+ }
364
+
365
+ body {
366
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
367
+ background: #f5f5f5;
368
+ }
369
+
370
+ header {
371
+ background: white;
372
+ padding: 20px;
373
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
374
+ margin-bottom: 40px;
375
+ }
376
+
377
+ .container {
378
+ max-width: 1200px;
379
+ margin: 0 auto;
380
+ padding: 0 20px;
381
+ }
382
+
383
+ h1 {
384
+ text-align: center;
385
+ color: #333;
386
+ }
387
+
388
+ #product {
389
+ background: white;
390
+ border-radius: 8px;
391
+ padding: 20px;
392
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
393
+ }
394
+ </style>
395
+ </head>
396
+ <body>
397
+ <header>
398
+ <div class="container">
399
+ <h1>🥃 Premium Spirits Collection</h1>
400
+ </div>
401
+ </header>
402
+
403
+ <div class="container">
404
+ <div id="product"></div>
405
+ </div>
406
+ </body>
407
+ </html>
408
+ ```
409
+
410
+ Replace `YOUR_API_KEY` with your actual key and you're ready to go!
@@ -0,0 +1,173 @@
1
+ # Accessibility Guide
2
+
3
+ What the Elements SDK does for accessibility, what it needs from your page, and how to verify it.
4
+
5
+ ## Overview
6
+
7
+ Elements target **WCAG 2.1 Level AA**. Every element ships with keyboard support, screen-reader
8
+ announcements, managed focus and enforced colour contrast — there is nothing to switch on.
9
+
10
+ Accessibility is shared between the SDK and the host page:
11
+
12
+ | The SDK owns | Your page owns |
13
+ |---|---|
14
+ | Roles, names and states of everything inside an element | Page structure: landmarks, heading order, `<html lang>` |
15
+ | Keyboard operation of every control it renders | Contrast of your own content, and the surface you place elements on |
16
+ | Focus movement into and out of its overlays | A theme whose colours meet the WCAG contrast minimums (the SDK renders your colours as given) |
17
+ | Announcing its own content changes | Not hiding or `inert`-ing the element container |
18
+ | Reflow down to a 320px viewport | Layout around the element at 400% zoom |
19
+
20
+ ## Keyboard navigation
21
+
22
+ Every control is reachable and operable with a keyboard alone. Related controls are grouped into
23
+ a **single tab stop** with arrow keys inside it, so a long list of retailers or sizes is not a
24
+ tab-through slog.
25
+
26
+ | Widget | Keys |
27
+ |---|---|
28
+ | Size selector (product) | `Tab` to the group, `←` `→` to move, `Enter` / `Space` to choose, `Home` / `End` for the ends |
29
+ | Size dropdown (product list) | `Enter` / `Space` / `↓` opens, `↑` `↓` moves, `Enter` chooses, `Esc` closes |
30
+ | Delivery method tabs (Shipping / Same-Day) | `←` `→` switches method immediately; unavailable methods are skipped |
31
+ | Retailer / delivery-option lists | `↑` `↓` moves, `Enter` / `Space` chooses, `Home` / `End` for the ends |
32
+ | Retailer carousel | `←` `→` moves, `Enter` / `Space` chooses |
33
+ | Product image thumbnails | `←` `→` moves, `Enter` / `Space` shows the image |
34
+ | Quantity steppers | `Tab` to each button, `Enter` / `Space` to step |
35
+ | Address field | Type to search, `↑` `↓` through suggestions, `Enter` selects, `Esc` dismisses |
36
+ | Cart / checkout drawer, modals | `Tab` cycles inside the panel only, `Esc` closes |
37
+
38
+ Arrow keys change the selection immediately only where that is cheap and reversible (the delivery
39
+ method tabs). Where choosing has a side effect the user cannot navigate back out of — picking a
40
+ retailer closes the panel — arrow keys move focus and `Enter` commits.
41
+
42
+ ### Focus management
43
+
44
+ - **Opening an overlay** moves focus into it and remembers the control that opened it.
45
+ - **Closing** returns focus to that control, even when a re-render has replaced it.
46
+ - **While an overlay is open** focus is trapped inside it and the rest of the page is `inert` and
47
+ `aria-hidden`, so a screen reader cannot wander behind the dialog.
48
+ - **In-place content swaps** (Buy Now → address form, Add to Cart → personalize) re-seat focus on
49
+ the new view's heading; nothing is left focused on a destroyed node.
50
+ - **After a re-render** focus returns to the control that caused it — the quantity stepper you
51
+ pressed, the delivery-method tab you switched to.
52
+ - **Nothing hidden is focusable.** Collapsed panels are removed from the tab order and the
53
+ accessibility tree, and closed overlays have their content torn down.
54
+
55
+ ### Focus indicator
56
+
57
+ A 2px ring in `--focus-ring-color`, offset 2px from the control. Controls that span their
58
+ container's full width use an inset ring instead, because an outward ring on those is clipped by
59
+ the scrolling panel around them. On primary-coloured fills the ring switches to
60
+ `--selected-text-color`, the token already used for text on that fill — so setting the pair
61
+ `primaryColor` / `selectedTextColor` to a combination that clears 3:1 covers the ring too.
62
+
63
+ The ring targets `:focus` as well as `:focus-visible`, so browsers without `:focus-visible`
64
+ support still show it.
65
+
66
+ ## Screen reader support
67
+
68
+ Elements are Web Components inside a shadow root, which is fully visible to assistive technology.
69
+
70
+ ### Announcements
71
+
72
+ Content that appears or changes without navigation is announced through a shared live region
73
+ (`role="status"`, `aria-live="polite"`; `role="alert"` for errors) that lives at the end of
74
+ `document.body` and survives re-renders.
75
+
76
+ | What happened | What is announced |
77
+ |---|---|
78
+ | Buy Now pressed | "Enter delivery address" |
79
+ | Address saved | "Delivery address updated. Now delivering to …" |
80
+ | Delivery option chosen | "Delivery option updated. Shipping from …, $…" |
81
+ | Delivery method switched | "Shipping selected. 5 options available." |
82
+ | Size chosen | "Size 750 ML selected" |
83
+ | Quantity stepped | "Tito's Handmade Vodka, quantity 4" |
84
+ | Personalization saved / removed | "Personalization saved" / "Personalization removed" |
85
+ | Cart or checkout opened / closed | "Shopping cart opened" / "Shopping cart closed" |
86
+ | Panel closed (product) | "Closed. Back to product options." |
87
+ | Item added / removed, promo applied, totals changed | The new state, e.g. "Promo code SPRING applied, $5.00 off" |
88
+ | Product list filtered or searched | "12 products found, showing 12" |
89
+ | Validation failed | The field name and the error, interrupting (assertive) |
90
+ | Carousel image changed | "Image 2 of 4" |
91
+
92
+ Live regions are never written into a component template: components replace their whole subtree
93
+ on render, and a live region recreated with its text already in place is not announced. Use
94
+ `this.announcer.announce(message)` from a component instead.
95
+
96
+ ### Names, roles and states
97
+
98
+ - Dialogs carry `role="dialog"`, an accessible name, and `aria-modal` when they cover the page.
99
+ - Single-select groups are `listbox` / `radiogroup` with `option` / `radio` children carrying
100
+ `aria-selected` / `aria-checked` — not toggle buttons with `aria-pressed`, which would describe
101
+ each choice as an independent on/off switch.
102
+ - Unavailable controls are `aria-disabled` **and** genuinely inert: they cannot be activated.
103
+ - Icon-only buttons take their name from the button's `aria-label`.
104
+ - Visible label text is always contained in the accessible name (2.5.3 Label in Name), so speech
105
+ input works: saying "click See Delivery Options" activates the button that reads that way.
106
+ - Fields whose design has no room for a visible label (promo code, gift card) get an
107
+ `aria-label` instead — no rendered label, no layout change.
108
+
109
+ ### Images and icons
110
+
111
+ - Product photos use the product name as their alt text; a photo painted as a CSS background is
112
+ exposed with `role="img"` and the same name.
113
+ - Decorative images inside a named control use `alt=""` so the control is not announced twice.
114
+ - Every inline SVG icon renders `aria-hidden="true" focusable="false"`. Icons that carry meaning
115
+ on their own opt in to a name: `CloseIcon({ label: 'Close' })`.
116
+
117
+ ## Colour and contrast
118
+
119
+ Element colours come from your theme, and a brand palette chosen to look right often does not
120
+ clear WCAG: white on a mid-tone brand fill is around 3:1, well under the 4.5:1 body text needs.
121
+
122
+ **The SDK renders the colours you supply exactly as given — it does not adjust them.** Contrast is
123
+ therefore yours to get right: check each foreground token against the surface the Element sits on
124
+ and make sure it reaches 4.5:1 for text (WCAG 1.4.3) and 3:1 for borders, icons and the focus ring
125
+ (WCAG 1.4.11).
126
+
127
+ The tokens worth checking are `defaultTextColor`, `linkTextColor`, `warningColor`, `errorColor` and
128
+ `successColor` against `drawerBackgroundColor` (or whatever your page puts behind the Element), plus
129
+ `selectedTextColor` against `primaryColor` for text on brand-filled buttons and badges.
130
+
131
+ Every token ships with a default that already passes on a light surface. Two are easy to forget
132
+ because they are optional — leave them out to keep the compliant defaults, or set them explicitly to
133
+ keep those details on-brand:
134
+
135
+ ```javascript
136
+ customTheme: {
137
+ global: {
138
+ theme: {
139
+ inputBorderColor: '#767C85', // form field boundaries, needs 3:1 on your surface
140
+ focusRingColor: '#1D4ED8' // keyboard focus ring, needs 3:1 on your surface
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ ### Zoom, reflow and text spacing
147
+
148
+ Elements reflow down to a 320px CSS viewport (400% zoom on a 1280px screen) without horizontal
149
+ scrolling. Labels wrap instead of truncating, so they survive user text-spacing overrides.
150
+
151
+ ## Verifying it
152
+
153
+ **Keyboard:** unplug the mouse and complete a purchase. Every control must be reachable, every
154
+ focus ring visible, and focus must never land on `<body>`.
155
+
156
+ **Announcements** without a screen reader — the live regions are plain DOM:
157
+
158
+ ```javascript
159
+ for (const region of document.querySelectorAll('[data-lce-live-region]')) {
160
+ new MutationObserver(() => console.log('[SR]', region.textContent)).observe(region, {
161
+ childList: true, subtree: true, characterData: true,
162
+ });
163
+ }
164
+ ```
165
+
166
+ **Screen readers:** verify with VoiceOver (Safari/macOS), NVDA (Firefox/Windows) or TalkBack
167
+ (Chrome/Android) — the pairings that matter most for a storefront.
168
+
169
+ ## See Also
170
+
171
+ - [Theming Guide](./theming.md) — the colour tokens to check for contrast
172
+ - [Best Practices](./best-practices.md)
173
+ - [Browser Support](../reference/browser-support.md)