@zonos/elements 1.3.11-alpha.0 → 1.3.11-alpha.2

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 (350) hide show
  1. package/dist/cjs/{cart-7e28f026.js → cart-b34c001b.js} +92 -28
  2. package/dist/cjs/{getBorderRadius-d795f526.js → getBorderRadius-4fa738c3.js} +1 -1
  3. package/dist/cjs/getContrastColor-c72796c6.js +20 -0
  4. package/dist/cjs/{isColorVariable-41cacd82.js → isColorVariable-fff5e469.js} +1 -1
  5. package/dist/cjs/{isDarkColor-33fb96a7.js → isDarkColor-7faf0a82.js} +2 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{submitGtag-586d3206.js → submitGtag-1f1fbe1c.js} +15 -2
  8. package/dist/cjs/zonos-address_4.cjs.entry.js +15 -12
  9. package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
  10. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  11. package/dist/cjs/{zonos-button_3.cjs.entry.js → zonos-button_2.cjs.entry.js} +34 -36
  12. package/dist/cjs/zonos-card_2.cjs.entry.js +8 -8
  13. package/dist/cjs/{zonos-cart-items_9.cjs.entry.js → zonos-cart-items_10.cjs.entry.js} +164 -53
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +249 -26
  15. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  16. package/dist/cjs/zonos-controller.cjs.entry.js +5 -5
  17. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-country-select_3.cjs.entry.js +9 -9
  19. package/dist/cjs/zonos-elements.cjs.js +1 -1
  20. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-hello.cjs.entry.js +16 -4
  22. package/dist/cjs/zonos-icon.cjs.entry.js +39 -0
  23. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-logo.cjs.entry.js +3 -3
  25. package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
  26. package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
  27. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +5 -5
  28. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +13 -4
  29. package/dist/cjs/zonos-text.cjs.entry.js +6 -2
  30. package/dist/cjs/{zonosStore-d3f0173b.js → zonosStore-bd2a0c59.js} +20 -2
  31. package/dist/collection/collection-manifest.json +1 -0
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -5
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +32 -22
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +76 -16
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +2 -4
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +102 -22
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +1 -1
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +43 -24
  39. package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
  40. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  41. package/dist/collection/components/common/zonos-button/zonos-button.css +1 -1
  42. package/dist/collection/components/common/zonos-button/zonos-button.js +18 -4
  43. package/dist/collection/components/common/zonos-card/zonos-card.js +2 -2
  44. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +5 -5
  45. package/dist/collection/components/common/zonos-checkout-progress-tabs/assets/TabCheckmark.svg +3 -0
  46. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.css +103 -0
  47. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +194 -0
  48. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  49. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
  50. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +1 -1
  51. package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +1 -1
  52. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +5 -30
  53. package/dist/collection/components/common/zonos-icon/zonos-icon.js +9 -5
  54. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  55. package/dist/collection/components/common/zonos-logo/zonos-logo.js +4 -4
  56. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  57. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +33 -7
  58. package/dist/collection/components/common/zonos-text/zonos-text.js +7 -3
  59. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  60. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  61. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  62. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +17 -2
  63. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  64. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +5 -5
  65. package/dist/collection/components/main/zonos-controller.js +1 -1
  66. package/dist/collection/components/store/checkout/cart.js +26 -0
  67. package/dist/collection/components/store/checkout/stripe.js +3 -0
  68. package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
  69. package/dist/collection/components/store/translationStore/strings.base.js +3 -0
  70. package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
  71. package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
  72. package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
  73. package/dist/collection/components/store/translationStore/strings.french.js +3 -0
  74. package/dist/collection/components/store/translationStore/strings.german.js +3 -0
  75. package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
  76. package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
  77. package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
  78. package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
  79. package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
  80. package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
  81. package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
  82. package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
  83. package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
  84. package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
  85. package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
  86. package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
  87. package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
  88. package/dist/collection/components/store/zonosStore.js +20 -3
  89. package/dist/collection/components/stripe/zonos-address/zonos-address.js +5 -2
  90. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  91. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  92. package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +24 -0
  93. package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +66 -0
  94. package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +58 -0
  95. package/dist/collection/components/utils/api/trackConversionEvent.js +2 -0
  96. package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -0
  97. package/dist/collection/components/utils/createCustomEvent.js +9 -0
  98. package/dist/collection/components/utils/getContrastColor.js +16 -0
  99. package/dist/collection/components/utils/isColorVariable.js +1 -1
  100. package/dist/collection/components/utils/styles.js +12 -0
  101. package/dist/collection/scripts/zonosBase.js +1 -0
  102. package/dist/collection/styles/stripe/addressRuleStyle.js +0 -3
  103. package/dist/collection/types/checkout/api/TempCart.js +1 -0
  104. package/dist/collection/types/generated/graphql.customer.types.js +73 -0
  105. package/dist/components/getContrastColor.js +18 -0
  106. package/dist/components/isColorVariable.js +1 -1
  107. package/dist/components/isDarkColor.js +1 -1
  108. package/dist/components/stripe.js +90 -25
  109. package/dist/components/trackConversionEvent.js +3 -1
  110. package/dist/components/zonos-address2.js +5 -2
  111. package/dist/components/zonos-badge2.js +3 -3
  112. package/dist/components/zonos-button2.js +30 -4
  113. package/dist/components/zonos-card2.js +2 -2
  114. package/dist/components/zonos-checkbox2.js +3 -3
  115. package/dist/components/zonos-checkout-finish2.js +15 -7
  116. package/dist/components/zonos-checkout-footer2.js +33 -17
  117. package/dist/components/zonos-checkout-progress-tabs.d.ts +11 -0
  118. package/dist/components/zonos-checkout-progress-tabs.js +6 -0
  119. package/dist/components/zonos-checkout-progress-tabs2.js +122 -0
  120. package/dist/components/zonos-checkout.js +277 -46
  121. package/dist/components/zonos-collapse2.js +2 -2
  122. package/dist/components/zonos-component.js +1 -1
  123. package/dist/components/zonos-controller.js +2 -2
  124. package/dist/components/zonos-country-select2.js +2 -2
  125. package/dist/components/zonos-custom-message2.js +1 -1
  126. package/dist/components/zonos-dialog2.js +4 -6
  127. package/dist/components/zonos-hello-dialog-footer2.js +2 -2
  128. package/dist/components/zonos-hello-dialog2.js +2 -2
  129. package/dist/components/zonos-hello.js +17 -3
  130. package/dist/components/zonos-icon2.js +5 -1
  131. package/dist/components/zonos-language-select2.js +3 -3
  132. package/dist/components/zonos-link-authentication2.js +1 -1
  133. package/dist/components/zonos-link.js +1 -1
  134. package/dist/components/zonos-logo.js +2 -2
  135. package/dist/components/zonos-payment2.js +1 -1
  136. package/dist/components/zonos-review2.js +1 -1
  137. package/dist/components/zonos-select-dialog-header2.js +2 -2
  138. package/dist/components/zonos-shipping-rich-radio2.js +11 -1
  139. package/dist/components/zonos-shipping2.js +44 -25
  140. package/dist/components/zonos-text2.js +5 -1
  141. package/dist/components/zonos-tooltip2.js +2 -2
  142. package/dist/components/zonos-v-stack2.js +2 -2
  143. package/dist/components/zonosStore.js +20 -3
  144. package/dist/esm/{cart-5a88b4f3.js → cart-cc09eaef.js} +93 -28
  145. package/dist/esm/{getBorderRadius-5d750ab8.js → getBorderRadius-a89e45fb.js} +1 -1
  146. package/dist/esm/getContrastColor-5fbc4746.js +18 -0
  147. package/dist/esm/{isColorVariable-91c33804.js → isColorVariable-fbf2d80d.js} +1 -1
  148. package/dist/esm/{isDarkColor-c34dfed9.js → isDarkColor-6bf71e51.js} +2 -2
  149. package/dist/esm/loader.js +1 -1
  150. package/dist/esm/{submitGtag-289ddd8b.js → submitGtag-2eedb117.js} +15 -3
  151. package/dist/esm/zonos-address_4.entry.js +15 -12
  152. package/dist/esm/zonos-badge_2.entry.js +6 -6
  153. package/dist/esm/zonos-banner.entry.js +1 -1
  154. package/dist/esm/{zonos-button_3.entry.js → zonos-button_2.entry.js} +35 -36
  155. package/dist/esm/zonos-card_2.entry.js +8 -8
  156. package/dist/esm/{zonos-cart-items_9.entry.js → zonos-cart-items_10.entry.js} +164 -54
  157. package/dist/esm/zonos-checkout.entry.js +249 -26
  158. package/dist/esm/zonos-component.entry.js +1 -1
  159. package/dist/esm/zonos-controller.entry.js +5 -5
  160. package/dist/esm/zonos-country-flag.entry.js +4 -4
  161. package/dist/esm/zonos-country-select_3.entry.js +9 -9
  162. package/dist/esm/zonos-elements.js +1 -1
  163. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  164. package/dist/esm/zonos-hello.entry.js +16 -4
  165. package/dist/esm/zonos-icon.entry.js +35 -0
  166. package/dist/esm/zonos-link.entry.js +1 -1
  167. package/dist/esm/zonos-logo.entry.js +3 -3
  168. package/dist/esm/zonos-notification.entry.js +1 -1
  169. package/dist/esm/zonos-payment.entry.js +5 -5
  170. package/dist/esm/zonos-select-dialog-header_2.entry.js +5 -5
  171. package/dist/esm/zonos-shipping-rich-radio.entry.js +13 -4
  172. package/dist/esm/zonos-text.entry.js +6 -2
  173. package/dist/esm/{zonosStore-aac7c6ac.js → zonosStore-c4c45591.js} +20 -3
  174. package/dist/esm-es5/cart-cc09eaef.js +1 -0
  175. package/dist/esm-es5/{getBorderRadius-5d750ab8.js → getBorderRadius-a89e45fb.js} +1 -1
  176. package/dist/esm-es5/getContrastColor-5fbc4746.js +1 -0
  177. package/dist/esm-es5/isColorVariable-fbf2d80d.js +1 -0
  178. package/dist/esm-es5/{isDarkColor-c34dfed9.js → isDarkColor-6bf71e51.js} +1 -1
  179. package/dist/esm-es5/loader.js +1 -1
  180. package/dist/esm-es5/submitGtag-2eedb117.js +1 -0
  181. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  182. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  183. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  184. package/dist/esm-es5/zonos-button_2.entry.js +1 -0
  185. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  186. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -0
  187. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  188. package/dist/esm-es5/zonos-component.entry.js +1 -1
  189. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  190. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  191. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  192. package/dist/esm-es5/zonos-elements.js +1 -1
  193. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  194. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  195. package/dist/esm-es5/zonos-icon.entry.js +1 -0
  196. package/dist/esm-es5/zonos-link.entry.js +1 -1
  197. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  198. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  199. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  200. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  201. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  202. package/dist/esm-es5/zonos-text.entry.js +1 -1
  203. package/dist/esm-es5/{zonosStore-aac7c6ac.js → zonosStore-c4c45591.js} +1 -1
  204. package/dist/scripts/getTempCartById.js +1 -0
  205. package/dist/scripts/loadZonos.js +1 -1
  206. package/dist/scripts/zonos.js +1 -1
  207. package/dist/scripts/zonosBase.js +1 -1
  208. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.d.ts +14 -2
  209. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +7 -1
  210. package/dist/types/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.d.ts +7 -0
  211. package/dist/types/components/common/zonos-button/zonos-button.d.ts +1 -0
  212. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -1
  213. package/dist/types/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.d.ts +29 -0
  214. package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +1 -6
  215. package/dist/types/components/common/zonos-icon/zonos-icon.d.ts +4 -2
  216. package/dist/types/components/common/zonos-logo/zonos-logo.d.ts +1 -1
  217. package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +7 -1
  218. package/dist/types/components/common/zonos-text/zonos-text.d.ts +3 -1
  219. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -0
  220. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +2 -1
  221. package/dist/types/components/store/checkout/cart.d.ts +19 -4
  222. package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
  223. package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
  224. package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
  225. package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
  226. package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
  227. package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
  228. package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
  229. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
  230. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
  231. package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
  232. package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
  233. package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
  234. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
  235. package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
  236. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
  237. package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
  238. package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
  239. package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
  240. package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
  241. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
  242. package/dist/types/components/store/zonosStore.d.ts +11 -2
  243. package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +7 -0
  244. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  245. package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +11 -0
  246. package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +7 -0
  247. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  248. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  249. package/dist/types/components/utils/createCustomEvent.d.ts +12 -0
  250. package/dist/types/components/utils/getBorderRadius.d.ts +1 -1
  251. package/dist/types/components/utils/getContrastColor.d.ts +4 -0
  252. package/dist/types/components/utils/handleFetch.d.ts +2 -1
  253. package/dist/types/components/utils/isColorVariable.d.ts +1 -1
  254. package/dist/types/components/utils/styles.d.ts +7 -0
  255. package/dist/types/components.d.ts +69 -18
  256. package/dist/types/scripts/zonosBase.d.ts +10 -1
  257. package/dist/types/styles/stripe/addressRuleStyle.d.ts +2 -1
  258. package/dist/types/types/checkout/CheckoutConfig.d.ts +6 -1
  259. package/dist/types/types/checkout/api/TempCart.d.ts +80 -0
  260. package/dist/types/types/generated/graphql.customer.types.d.ts +97 -0
  261. package/dist/types/types/generated/graphql.customer.types.ts +135 -1
  262. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  263. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  264. package/dist/types/types/global.d.ts +10 -0
  265. package/dist/types/types/utils/deep/IDeepKeyofAtIndex.d.ts +1 -1
  266. package/dist/zonos-elements/assets/TabCheckmark.svg +3 -0
  267. package/dist/zonos-elements/{p-4ad5f307.system.entry.js → p-001518eb.system.entry.js} +1 -1
  268. package/dist/zonos-elements/p-07022f11.js +1 -0
  269. package/dist/zonos-elements/p-0fe52bae.system.entry.js +1 -0
  270. package/dist/zonos-elements/{p-14bf3658.entry.js → p-105a2e51.entry.js} +1 -1
  271. package/dist/zonos-elements/{p-a87803b7.system.entry.js → p-15cd4a76.system.entry.js} +1 -1
  272. package/dist/zonos-elements/{p-482371fb.system.entry.js → p-160cdf4e.system.entry.js} +1 -1
  273. package/dist/zonos-elements/p-167b3369.system.js +1 -0
  274. package/dist/zonos-elements/p-171eb334.entry.js +1 -0
  275. package/dist/zonos-elements/p-1bbdfae5.js +1 -0
  276. package/dist/zonos-elements/p-1d833f22.system.entry.js +1 -0
  277. package/dist/zonos-elements/{p-dad00ad3.system.entry.js → p-1df9ab6a.system.entry.js} +1 -1
  278. package/dist/zonos-elements/p-1f54c83e.entry.js +1 -0
  279. package/dist/zonos-elements/{p-27d57265.system.entry.js → p-20b080d1.system.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-333da541.entry.js → p-215cd7ec.entry.js} +1 -1
  281. package/dist/zonos-elements/p-26e8f37a.entry.js +1 -0
  282. package/dist/zonos-elements/{p-77727098.system.js → p-41c2b1c5.system.js} +1 -1
  283. package/dist/zonos-elements/p-425865fd.system.entry.js +1 -0
  284. package/dist/zonos-elements/{p-5f2cb4b6.entry.js → p-43022147.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-188ddbe2.entry.js → p-4515ec7b.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-9db3028d.entry.js → p-470284a3.entry.js} +1 -1
  287. package/dist/zonos-elements/p-4c9367f1.entry.js +1 -0
  288. package/dist/zonos-elements/{p-770384fa.system.entry.js → p-4d7b27af.system.entry.js} +1 -1
  289. package/dist/zonos-elements/p-55519ef5.system.js +1 -0
  290. package/dist/zonos-elements/{p-8445a084.system.entry.js → p-5ba91f13.system.entry.js} +1 -1
  291. package/dist/zonos-elements/p-6484bf31.system.js +1 -0
  292. package/dist/zonos-elements/p-6a1b934d.system.entry.js +1 -0
  293. package/dist/zonos-elements/{p-a725946f.entry.js → p-6bd4b5e6.entry.js} +1 -1
  294. package/dist/zonos-elements/{p-7e355496.system.entry.js → p-6c5c5377.system.entry.js} +1 -1
  295. package/dist/zonos-elements/p-6e81adba.system.js +1 -1
  296. package/dist/zonos-elements/p-72c6bf0f.entry.js +1 -0
  297. package/dist/zonos-elements/p-7575a42a.js +1 -0
  298. package/dist/zonos-elements/p-7f9889bd.system.entry.js +1 -0
  299. package/dist/zonos-elements/{p-c1e54094.system.js → p-86034f1e.system.js} +1 -1
  300. package/dist/zonos-elements/p-9a1db995.entry.js +1 -0
  301. package/dist/zonos-elements/{p-77c54b83.js → p-9a90fb56.js} +1 -1
  302. package/dist/zonos-elements/{p-d5a9dfc7.entry.js → p-9bdcd7b6.entry.js} +1 -1
  303. package/dist/zonos-elements/{p-edbea8df.system.js → p-9db2f9d1.system.js} +1 -1
  304. package/dist/zonos-elements/p-a144d26a.system.entry.js +1 -0
  305. package/dist/zonos-elements/{p-93e51987.system.entry.js → p-a2f71e4f.system.entry.js} +1 -1
  306. package/dist/zonos-elements/{p-6181f2d5.entry.js → p-ad499520.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-e4e1ca2f.system.entry.js → p-b4c23bb5.system.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-315c1fc2.entry.js → p-b62aee3d.entry.js} +1 -1
  309. package/dist/zonos-elements/{p-e969cec9.entry.js → p-b8718429.entry.js} +1 -1
  310. package/dist/zonos-elements/{p-25fbcefe.system.entry.js → p-ba5596ae.system.entry.js} +1 -1
  311. package/dist/zonos-elements/p-beba218e.js +1 -0
  312. package/dist/zonos-elements/p-c7f11c60.entry.js +1 -0
  313. package/dist/zonos-elements/{p-febddb45.entry.js → p-d4222f1f.entry.js} +1 -1
  314. package/dist/zonos-elements/p-dde4c859.system.entry.js +1 -0
  315. package/dist/zonos-elements/p-e28ed57c.js +1 -0
  316. package/dist/zonos-elements/p-e3a3e376.entry.js +1 -0
  317. package/dist/zonos-elements/{p-a578facf.entry.js → p-e3de496a.entry.js} +1 -1
  318. package/dist/zonos-elements/{p-afcded5d.system.js → p-ed23a5df.system.js} +1 -1
  319. package/dist/zonos-elements/{p-e392e212.system.entry.js → p-ed597cc9.system.entry.js} +1 -1
  320. package/dist/zonos-elements/{p-d0d12a64.entry.js → p-f1037168.entry.js} +1 -1
  321. package/dist/zonos-elements/{p-c6de2e40.system.entry.js → p-f42bffad.system.entry.js} +1 -1
  322. package/dist/zonos-elements/{p-0b4910fe.system.entry.js → p-f62b49aa.system.entry.js} +1 -1
  323. package/dist/zonos-elements/p-fa3d0aea.js +1 -0
  324. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  325. package/package.json +1 -1
  326. package/dist/esm-es5/cart-5a88b4f3.js +0 -1
  327. package/dist/esm-es5/isColorVariable-91c33804.js +0 -1
  328. package/dist/esm-es5/submitGtag-289ddd8b.js +0 -1
  329. package/dist/esm-es5/zonos-button_3.entry.js +0 -1
  330. package/dist/esm-es5/zonos-cart-items_9.entry.js +0 -1
  331. package/dist/zonos-elements/p-144f4d31.entry.js +0 -1
  332. package/dist/zonos-elements/p-4569bc92.js +0 -1
  333. package/dist/zonos-elements/p-49a5be72.js +0 -1
  334. package/dist/zonos-elements/p-4c414a92.js +0 -1
  335. package/dist/zonos-elements/p-5c991faa.system.entry.js +0 -1
  336. package/dist/zonos-elements/p-691d8075.entry.js +0 -1
  337. package/dist/zonos-elements/p-723628b7.js +0 -1
  338. package/dist/zonos-elements/p-87c4ac09.system.entry.js +0 -1
  339. package/dist/zonos-elements/p-9f532a3f.entry.js +0 -1
  340. package/dist/zonos-elements/p-afc0460d.entry.js +0 -1
  341. package/dist/zonos-elements/p-ca6b4c1e.system.entry.js +0 -1
  342. package/dist/zonos-elements/p-d2885590.system.js +0 -1
  343. package/dist/zonos-elements/p-d7690752.system.entry.js +0 -1
  344. package/dist/zonos-elements/p-d9c65636.system.js +0 -1
  345. package/dist/zonos-elements/p-dd153a4e.entry.js +0 -1
  346. package/dist/zonos-elements/p-def8823e.entry.js +0 -1
  347. package/dist/zonos-elements/p-e4749f19.js +0 -1
  348. package/dist/zonos-elements/p-e87e8c9c.system.entry.js +0 -1
  349. package/dist/zonos-elements/p-f1170e7b.entry.js +0 -1
  350. package/dist/zonos-elements/p-fe0930e4.system.entry.js +0 -1
@@ -1,14 +1,16 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
- import { cartStore, cartStoreNextStep, cartStorePreviousStep, cartStoreReset, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
2
+ import { cartStore, cartStoreNextStep, cartStoreReset, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
3
3
  import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
4
4
  import { localizationStore } from "../../store/hello/localization";
5
5
  import { translate } from "../../store/translationStore";
6
- import { zonosStore, } from "../../store/zonosStore";
6
+ import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
7
+ import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
7
8
  import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
8
9
  import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
9
10
  import { isShippableCountry } from "../../utils/checkout/isShippableCountry";
10
11
  import { watchBigcommerceDomesticCheckout } from "../../utils/checkout/watchBigcommerceDomesticCheckout";
11
12
  import { classes } from "../../utils/classes";
13
+ import { createCustomEvent } from "../../utils/createCustomEvent";
12
14
  import { getBorderRadius } from "../../utils/getBorderRadius";
13
15
  import { isDarkColor } from "../../utils/isDarkColor";
14
16
  import { log } from "../../utils/logging/log";
@@ -17,8 +19,6 @@ import { mergeConfig } from "../../utils/mergeConfig";
17
19
  import { submitGtag } from "../../utils/submitGtag";
18
20
  /** These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */
19
21
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
20
- import LeftArrow from "./assets/LeftArrow.svg";
21
- // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
22
22
  import MessageIcon from "./assets/MessageIcon.svg";
23
23
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
24
24
  import RemoveIcon from "./assets/RemoveIcon.svg";
@@ -56,12 +56,14 @@ export class ZonosCheckout {
56
56
  this.stripe = window.Zonos.stripe;
57
57
  this.submitLoading = false;
58
58
  this.paymentError = false;
59
- this.collapseReviewMobile = false;
59
+ this.collapseReviewMobile = true;
60
60
  this.isAttachError = false;
61
61
  this.isMobile = false;
62
62
  this.zonosReviewRef = undefined;
63
63
  this.storybookPaymentStatusOverride = undefined;
64
64
  this.domesticRedirectedBtnSelector = '#zonos--domestic-redirected-checkout-button';
65
+ this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
66
+ this.isLegacyCheckout = false;
65
67
  }
66
68
  /**
67
69
  * Init cart info handler event
@@ -84,7 +86,12 @@ export class ZonosCheckout {
84
86
  cartStore.step = 'customer-info';
85
87
  }
86
88
  async buildCartAndInit() {
87
- if (zonosStore.checkoutSettings.buildCartDetail) {
89
+ // if tempCartUUID is provided, use it instead of buildCartDetail
90
+ if (window.Zonos.tempCartData) {
91
+ const tempCartData = buildCartItemsByTempCart(window.Zonos.tempCartData);
92
+ await cartStoreUpdateItems(tempCartData);
93
+ }
94
+ else if (zonosStore.checkoutSettings.buildCartDetail) {
88
95
  log('build cart detail');
89
96
  const cartItems = await zonosStore.checkoutSettings.buildCartDetail();
90
97
  await cartStoreUpdateItems(cartItems);
@@ -151,12 +158,18 @@ export class ZonosCheckout {
151
158
  button.setAttribute('data-zonos-checkout-attached', 'true');
152
159
  // if this button is the hidden button, trigger the click event
153
160
  if (button.matches(this.domesticRedirectedBtnSelector)) {
154
- button.dispatchEvent(new CustomEvent('click'));
161
+ button.dispatchEvent(createCustomEvent('click'));
155
162
  // cleanup shipping session after button is clicked
156
163
  stripeStoreCleanupDomesticShippingSession();
157
164
  // remove the button after it's clicked
158
165
  button.remove();
159
166
  }
167
+ if (button.matches(this.legacyCheckoutHiddenBtnSelector)) {
168
+ this.isLegacyCheckout = true;
169
+ // trigger the click event on the button
170
+ button.dispatchEvent(createCustomEvent('click'));
171
+ button.remove();
172
+ }
160
173
  });
161
174
  }
162
175
  appearanceSettingsOverrideChanged() {
@@ -166,6 +179,45 @@ export class ZonosCheckout {
166
179
  // apply theme to stripe elements
167
180
  void this.applyStripeTheme();
168
181
  }
182
+ /**
183
+ * Set default address from query param if it's valid
184
+ */
185
+ useLegacyQueryParam() {
186
+ const urlParams = new URLSearchParams(window.location.search);
187
+ const legacyShippingInfo = {
188
+ country: urlParams.get('country'),
189
+ customerAddress1: urlParams.get('customerAddress1'),
190
+ customerAddress2: urlParams.get('customerAddress2'),
191
+ customerCity: urlParams.get('customerCity'),
192
+ customerEmail: urlParams.get('customerEmail'),
193
+ customerName: urlParams.get('customerName'),
194
+ customerPhone: urlParams.get('customerPhone'),
195
+ customerState: urlParams.get('customerState'),
196
+ customerZip: urlParams.get('customerZip'),
197
+ };
198
+ // if one of the value is null, no need to preset the default address
199
+ if (!legacyShippingInfo.customerAddress1 ||
200
+ !legacyShippingInfo.customerCity ||
201
+ !legacyShippingInfo.customerName ||
202
+ !legacyShippingInfo.customerPhone ||
203
+ !legacyShippingInfo.customerState ||
204
+ !legacyShippingInfo.customerZip ||
205
+ !legacyShippingInfo.country) {
206
+ return;
207
+ }
208
+ this.defaultAddress = {
209
+ address: {
210
+ city: legacyShippingInfo.customerCity,
211
+ country: legacyShippingInfo.country,
212
+ line1: legacyShippingInfo.customerAddress1,
213
+ line2: legacyShippingInfo.customerAddress2 || '',
214
+ postal_code: legacyShippingInfo.customerZip,
215
+ state: legacyShippingInfo.customerState,
216
+ },
217
+ name: legacyShippingInfo.customerName,
218
+ phone: legacyShippingInfo.customerPhone,
219
+ };
220
+ }
169
221
  /**
170
222
  * Setup all of the event listeners for the component on first load
171
223
  */
@@ -191,6 +243,12 @@ export class ZonosCheckout {
191
243
  };
192
244
  },
193
245
  });
246
+ /**
247
+ * When temp cart data is available, set default address if exist
248
+ */
249
+ if (window.Zonos.tempCartData) {
250
+ this.useLegacyQueryParam();
251
+ }
194
252
  const hideInternationalOrderInterval = setInterval(() => {
195
253
  const internationalSelector = window.Zonos.internationalHideSelector;
196
254
  if (!internationalSelector) {
@@ -309,6 +367,12 @@ export class ZonosCheckout {
309
367
  }
310
368
  // reset cart store
311
369
  cartStoreReset();
370
+ // redirect to vendor store url if this is legacy checkout.
371
+ if (this.isLegacyCheckout && window.Zonos.tempCartData) {
372
+ const contShoppingUrl = window.Zonos.tempCartData.contShoppingURL;
373
+ window.location.href = contShoppingUrl;
374
+ return;
375
+ }
312
376
  // reset url
313
377
  const url = window.location.href;
314
378
  // Remove query parameters
@@ -319,14 +383,6 @@ export class ZonosCheckout {
319
383
  // Reload the page
320
384
  window.location.reload();
321
385
  }
322
- async handleBackClick() {
323
- // close the modal if back button is clicked on customer info step
324
- if (cartStore.step === 'customer-info') {
325
- await this.closeDialogHandler();
326
- return;
327
- }
328
- cartStorePreviousStep();
329
- }
330
386
  handleWindowResize() {
331
387
  this.isMobile = isCheckoutMobile(this.mobile);
332
388
  // apply theme to stripe elements
@@ -339,9 +395,18 @@ export class ZonosCheckout {
339
395
  void this.applyStripeTheme();
340
396
  log(`mobile: ${this.isMobile}`);
341
397
  }
398
+ handleAppearanceSettingsOverrideChange() {
399
+ var _a;
400
+ if ((_a = this.appearanceSettingsOverride) === null || _a === void 0 ? void 0 : _a.theme) {
401
+ // update theme to browser preference theme if appearance theme is system
402
+ this.appearanceSettingsOverride.theme = getZonosStoreTheme(this.appearanceSettingsOverride.theme);
403
+ }
404
+ }
342
405
  componentWillLoad() {
343
406
  void this.init();
344
407
  this.isMobile = isCheckoutMobile(this.mobile);
408
+ // update theme to browser preference theme if appearance theme is system
409
+ this.handleAppearanceSettingsOverrideChange();
345
410
  log(`mobile: ${this.isMobile}`);
346
411
  }
347
412
  // do clean up when component is unmounted
@@ -374,30 +439,40 @@ export class ZonosCheckout {
374
439
  const localePageEnum = this.getCurrentLocalePageEnum();
375
440
  const filteredMessages = customMessages.filter(x => x.pageName === localePageEnum);
376
441
  const renderLogo = () => (h("div", { class: "zonos--logo" }, logoUrl && (h("img", { alt: `${zonosStore.organizationName} logo`, src: logoUrl, width: 100 }))));
377
- const renderTopHeader = () => (h("zonos-v-stack", null, renderLogo(), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message }))), h("div", null, h("zonos-button", { class: "zonos--back-button", icon: h("zonos-icon", { "aria-label": "Back to previous step", content: LeftArrow }), noBackground: true, noPaddingLeft: true, noPaddingRight: true, onClick: () => this.handleBackClick(), theme: leftSideTheme }, translate('Back')))));
442
+ const renderTopHeader = () => {
443
+ return (h("zonos-v-stack", null, renderLogo(), h("zonos-checkout-progress-tabs", { backgroundColor:
444
+ // only use different contrast color when the secondary color is too off with the background in mobile
445
+ this.isMobile ? '--amino-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
446
+ };
378
447
  const renderContent = () => {
379
448
  return (h("div", { class: 'zonos--content', style: {
380
449
  '--border-radius': getBorderRadius(style),
381
450
  } }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
382
451
  '--primary-color': !this.isMobile ? colorPrimary : '',
383
- } }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isMobile && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
452
+ } }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
384
453
  // do nothing if it's not mobile
385
454
  if (!this.isMobile) {
386
455
  return;
387
456
  }
388
457
  this.collapseReviewMobile = !this.collapseReviewMobile;
389
458
  } }), h("zonos-collapse", {
390
- // only collapse on mobile
459
+ // only collapsible on mobile
391
460
  collapsed: this.collapseReviewMobile && this.isMobile
392
- }, h("zonos-cart-items", null))), h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", null), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage })))))), (cartStore.step === 'finish' || cartStore.step === 'error') && (h("div", { class: "zonos--done", "data-theme": rightSideTheme }, h("div", { class: "zonos--header" }, renderLogo(), h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.handleFinishClick(), theme: rightSideTheme })), h("zonos-checkout-finish", { borderRadius: style, onCloseClick: () => this.handleFinishClick(), overrideNotification: cartStore.step === 'error' && !!cartStore.error
393
- ? Object.assign(Object.assign({}, cartStore.error), { type: 'error' }) : undefined, storybookForceStatus: this.storybookPaymentStatusOverride }))), h("zonos-checkout-footer", null)));
461
+ }, h("zonos-cart-items", null), this.isMobile && (h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", null), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage }))))), !this.isMobile && (h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", null), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage }))))))), (cartStore.step === 'finish' || cartStore.step === 'error') && (h("div", { class: "zonos--done", "data-theme": rightSideTheme }, h("div", { class: "zonos--header" }, renderLogo(), h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.handleFinishClick(), theme: rightSideTheme })), h("zonos-checkout-finish", { borderRadius: style, onCloseClick: () => this.handleFinishClick(), overrideNotification: cartStore.step === 'error' && !!cartStore.error
462
+ ? Object.assign(Object.assign({}, cartStore.error), { type: 'error' }) : undefined, storybookForceStatus: this.storybookPaymentStatusOverride }))), h("zonos-checkout-footer", { "data-theme": rightSideTheme, mobile: this.isMobile,
463
+ /**
464
+ * For this component, use slot instead of passing JSX through prop of other component. Because
465
+ * the click outside event will be triggered on and targeted to whichever component that it's attached to.
466
+ * Move it into <slot /> would resolve the issue.
467
+ */
468
+ slot: !this.isMobile ? 'dialog-footer' : undefined })));
394
469
  };
395
470
  return (h(Host, { class: classes([
396
471
  'zonos--checkout zonos--elements',
397
472
  hasFooter && 'has-footer',
398
473
  this.preview && 'preview',
399
474
  this.isMobile && 'mobile',
400
- ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent()))));
475
+ ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent()))));
401
476
  }
402
477
  static get is() { return "zonos-checkout"; }
403
478
  static get encapsulation() { return "scoped"; }
@@ -528,7 +603,9 @@ export class ZonosCheckout {
528
603
  "isMobile": {},
529
604
  "zonosReviewRef": {},
530
605
  "storybookPaymentStatusOverride": {},
531
- "domesticRedirectedBtnSelector": {}
606
+ "domesticRedirectedBtnSelector": {},
607
+ "legacyCheckoutHiddenBtnSelector": {},
608
+ "isLegacyCheckout": {}
532
609
  };
533
610
  }
534
611
  static get methods() {
@@ -606,6 +683,9 @@ export class ZonosCheckout {
606
683
  }, {
607
684
  "propName": "mobile",
608
685
  "methodName": "handleMobileChange"
686
+ }, {
687
+ "propName": "appearanceSettingsOverride",
688
+ "methodName": "handleAppearanceSettingsOverrideChange"
609
689
  }];
610
690
  }
611
691
  static get listeners() {
@@ -38,7 +38,7 @@
38
38
  z-index: 1;
39
39
  }
40
40
  :host .zonos--total-pay {
41
- margin: var(--amino-space-16) 0 var(--amino-space-32);
41
+ margin: var(--amino-space-8) 0 var(--amino-space-24);
42
42
  }
43
43
 
44
44
  :host(.mobile) {
@@ -16,11 +16,13 @@ export class ZonosShipping {
16
16
  if (!selectedShippingOption) {
17
17
  return;
18
18
  }
19
+ this.isSelecting = true;
19
20
  // save selected shipping option to store
20
21
  const updateStatus = await cartStoreUpdateSelectedShippingOption(selectedShippingOption);
21
22
  if (!updateStatus) {
22
23
  return;
23
24
  }
25
+ this.isSelecting = false;
24
26
  this.disabled = false;
25
27
  };
26
28
  /**
@@ -29,11 +31,38 @@ export class ZonosShipping {
29
31
  this.continueClickHandler = () => {
30
32
  this.continueClicked.emit();
31
33
  };
34
+ this.initServiceLevels = () => {
35
+ var _a;
36
+ this.serviceLevels =
37
+ ((_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.flatMap((item) => {
38
+ var _a, _b;
39
+ const { expectedDate, maxTransit, minTransit } = cartStoreGetShippingTransitInfo(item);
40
+ const sublabel = expectedDate
41
+ ? `${translate('Expected delivery')} ${expectedDate}`
42
+ : '';
43
+ const caption = minTransit && maxTransit
44
+ ? `(${minTransit}-${maxTransit} ${translate('business days')})`
45
+ : '';
46
+ const shippingAmount = ((_b = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.find(landedCostItem => { var _a; return ((_a = landedCostItem.landedCost) === null || _a === void 0 ? void 0 : _a.shipmentRating.id) === item.id; })) === null || _b === void 0 ? void 0 : _b.subtotals.shipping) || 0;
47
+ return {
48
+ caption,
49
+ label: item.displayName,
50
+ price: formatCurrency({
51
+ amount: shippingAmount,
52
+ currency: cartStore.currency,
53
+ }),
54
+ sublabel,
55
+ value: item.id,
56
+ };
57
+ })) || [];
58
+ };
32
59
  this.continueLoading = false;
33
60
  this.submitBtnColor = undefined;
34
61
  this.submitBtnType = undefined;
35
62
  this.selectedShippingMethod = null;
63
+ this.isSelecting = false;
36
64
  this.disabled = true;
65
+ this.serviceLevels = [];
37
66
  }
38
67
  watchFormComplete() {
39
68
  var _a;
@@ -45,30 +74,18 @@ export class ZonosShipping {
45
74
  });
46
75
  }
47
76
  }
77
+ componentWillLoad() {
78
+ this.initServiceLevels();
79
+ const selectedServiceLevel = this.serviceLevels.find(item => { var _a; return item.value === ((_a = cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
80
+ if (selectedServiceLevel) {
81
+ this.selectedShippingMethod = selectedServiceLevel;
82
+ }
83
+ // enable continue button if there is a selected shipping option
84
+ this.disabled = !selectedServiceLevel;
85
+ }
48
86
  render() {
49
- var _a;
50
- const serviceLevels = (_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.flatMap((item) => {
51
- var _a, _b;
52
- const { expectedDate, maxTransit, minTransit } = cartStoreGetShippingTransitInfo(item);
53
- const sublabel = expectedDate
54
- ? `${translate('Expected delivery')} ${expectedDate}`
55
- : '';
56
- const caption = minTransit && maxTransit
57
- ? `(${minTransit}-${maxTransit} ${translate('business days')})`
58
- : '';
59
- const shippingAmount = ((_b = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.find(landedCostItem => { var _a; return ((_a = landedCostItem.landedCost) === null || _a === void 0 ? void 0 : _a.shipmentRating.id) === item.id; })) === null || _b === void 0 ? void 0 : _b.subtotals.shipping) || 0;
60
- return {
61
- caption,
62
- label: item.displayName,
63
- price: formatCurrency({
64
- amount: shippingAmount,
65
- currency: cartStore.currency,
66
- }),
67
- sublabel,
68
- value: item.id,
69
- };
70
- });
71
- return (h(Host, { class: "zonos--shipping zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !(serviceLevels === null || serviceLevels === void 0 ? void 0 : serviceLevels.length) ? (h("zonos-banner", { bannerTitle: "No shipping methods found - try editing your address or contacting support if the error persists", intent: "error" })) : (h("zonos-shipping-rich-radio", { items: serviceLevels || [], onRadioSelected: e => this.handleRadioSelected(e) })), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, isDisabled: this.disabled, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
87
+ var _a, _b;
88
+ return (h(Host, { key: 'ab881bdb575ac0177154ffa8a2d84d668151c46d', class: "zonos--shipping zonos--elements" }, h("div", { key: 'b8738e0fb5c32b329ae03ccd2cb2d1a178a05aa8', class: "zonos--group" }, h("zonos-text", { key: 'd942ab3f4e77631145a0a38dae95999454a92b56', class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { key: '6855f44cf3458891776b3c215417bec329de89dc', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !((_a = this.serviceLevels) === null || _a === void 0 ? void 0 : _a.length) ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), intent: "error" })) : (h("zonos-shipping-rich-radio", { initialSelectedValue: (_b = this.selectedShippingMethod) === null || _b === void 0 ? void 0 : _b.value, items: this.serviceLevels, onRadioSelected: e => this.handleRadioSelected(e) })), h("div", { key: 'f6398edeecd18c603680ad6c7c8e1aa5f5cebe4a', class: "zonos--group-btn" }, h("zonos-button", { key: 'a548fb385ed341308ff86e615d9088e7cd4ec34d', backgroundColor: this.submitBtnColor, isDisabled: this.disabled, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
72
89
  // use primary type when on mobile mode
73
90
  variant: this.submitBtnType }, translate('Go to payment'))))));
74
91
  }
@@ -148,7 +165,9 @@ export class ZonosShipping {
148
165
  static get states() {
149
166
  return {
150
167
  "selectedShippingMethod": {},
151
- "disabled": {}
168
+ "isSelecting": {},
169
+ "disabled": {},
170
+ "serviceLevels": {}
152
171
  };
153
172
  }
154
173
  static get events() {
@@ -7,7 +7,7 @@ export class ZonosLink {
7
7
  this.linkTitle = undefined;
8
8
  }
9
9
  render() {
10
- return (h(Host, { key: '99bf9ff46cf84f424739b76d3da8a8c770c0a88f', class: "zonos--elements" }, h("a", { key: 'bd3553a33f27b4815a7b0573a34862093242b456', href: this.href, rel: this.rel, target: this.target, title: this.linkTitle }, h("slot", { key: 'ad80829c1ca5cd9b0e2dd62542025eeecf436196' }))));
10
+ return (h(Host, { key: 'b4def20f1c697c437e98c35e7355e84bfea88be2', class: "zonos--elements" }, h("a", { key: '8bb78fc9f3a38256cc3e7cda104c7eec1c93d185', href: this.href, rel: this.rel, target: this.target, title: this.linkTitle }, h("slot", { key: '897301f324059f6917a71f9ed444ddae32535485' }))));
11
11
  }
12
12
  static get is() { return "zonos-link"; }
13
13
  static get encapsulation() { return "shadow"; }
@@ -11,16 +11,16 @@ export class ZonosBadge {
11
11
  this.rounded = false;
12
12
  }
13
13
  render() {
14
- return (h(Host, { key: '1cece57ce37e04873f625d05ad5a0bea6368b46b', class: classes(['zonos--elements zonos--badge']), style: {
14
+ return (h(Host, { key: '9e6c4ec2341f5ca076a3c54bcce347db9e83bb38', class: classes(['zonos--elements zonos--badge']), style: {
15
15
  '--font-family': zonosStoreFontFamily(),
16
- } }, h("div", { key: '8caf3f2ffb7deda215c44ad0c6c0892936d526c2', class: classes([
16
+ } }, h("div", { key: 'ad4d88e7ac5b8e8a617bb904faeaad73d426c271', class: classes([
17
17
  'zonos--badge-content',
18
18
  this.badgeColor,
19
19
  this.rounded && 'rounded',
20
20
  this.iconRight && 'icon-right',
21
21
  this.size,
22
22
  this.bold && 'bold',
23
- ]) }, this.icon, h("zonos-text", { key: 'fb8ac7f09675f9cfd829ecea54c61f5c699caa00' }, h("slot", { key: '978bc876e427d932662a0100043e04b105e9df8d' })))));
23
+ ]) }, this.icon, h("zonos-text", { key: 'd0709a3ffbcc65703933273f614bbb71792b8f61' }, h("slot", { key: '997537e7fd4102a35a1e16789fa7b5444ee85a5a' })))));
24
24
  }
25
25
  static get is() { return "zonos-badge"; }
26
26
  static get encapsulation() { return "shadow"; }
@@ -228,7 +228,7 @@
228
228
  outline: none;
229
229
  }
230
230
  :host button:not(.override-background).subtle:not([disabled]):hover {
231
- background: var(--amino-gray-100);
231
+ background: var(--subtle-hover-color, var(--amino-gray-100));
232
232
  }
233
233
  :host button:not(.override-background).subtle:not([disabled]):active {
234
234
  background: var(--amino-gray-200);
@@ -1,9 +1,11 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { h, Host, } from "@stencil/core";
2
2
  import { zonosStore, zonosStoreFontFamily, } from "../../store/zonosStore";
3
3
  import { classes } from "../../utils/classes";
4
4
  import { getBorderRadius } from "../../utils/getBorderRadius";
5
5
  import { getButtonTheme } from "../../utils/getButtonTheme";
6
+ import { getContrastColor } from "../../utils/getContrastColor";
6
7
  import { isColorVariable } from "../../utils/isColorVariable";
8
+ import { styles } from "../../utils/styles";
7
9
  export class ZonosButton {
8
10
  constructor() {
9
11
  /**
@@ -59,12 +61,23 @@ export class ZonosButton {
59
61
  const buttonTheme = variant === 'standard' ? getButtonTheme(overrideBackground) : undefined;
60
62
  const borderStyle = getBorderRadius(this.borderStyle);
61
63
  const spinnerColor = buttonTheme === 'LIGHT' ? 'black' : 'white';
62
- return (h(Host, { key: 'f3374eedd37ec6293260fba7b19d66aa013d3484', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: {
64
+ return (h(Host, { key: '75f5e6900c6e0eb468ea639460d55f251b580200', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
63
65
  '--background-color': overrideBackground,
64
66
  '--border-radius': borderStyle,
65
67
  '--color': color,
66
68
  '--font-family': zonosStoreFontFamily(),
67
- } }, h("button", { key: '352ce427591b20b8042dcd19ce159b77c1fc2faf', class: classes([
69
+ '--subtle-hover-color': this.buttonColor
70
+ ? // for the subtle variant, the hover background should contrast with the text color
71
+ getContrastColor({
72
+ backgroundColor: 'white',
73
+ color: isColorVariable(this.buttonColor)
74
+ ? window
75
+ .getComputedStyle(this.ele)
76
+ .getPropertyValue(`--amino-${this.buttonColor}`)
77
+ : this.buttonColor,
78
+ })
79
+ : undefined,
80
+ }) }, h("button", { key: 'fd1323ac24be622182f9b60d8b026fb0ea47fa40', class: classes([
68
81
  this.hasIcon && 'has-icon',
69
82
  this.hasContent && 'has-content',
70
83
  this.noBackground && 'no-background',
@@ -77,7 +90,7 @@ export class ZonosButton {
77
90
  overrideBackground &&
78
91
  variant === 'standard' &&
79
92
  'override-background',
80
- ]), disabled: disabled }, this.loading && (h("div", { class: "zonos--spinner-wrapper" }, h("zonos-spinner", { size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: '554cc1fd9bb58d833339ae21e837d586adc248c2', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
93
+ ]), disabled: disabled }, this.loading && (h("div", { class: "zonos--spinner-wrapper" }, h("zonos-spinner", { size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: '92706fef0545ba24e3f943d731bffa1e844ec154', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
81
94
  }
82
95
  static get is() { return "zonos-button"; }
83
96
  static get encapsulation() { return "shadow"; }
@@ -385,6 +398,7 @@ export class ZonosButton {
385
398
  "hasContent": {}
386
399
  };
387
400
  }
401
+ static get elementRef() { return "ele"; }
388
402
  static get watchers() {
389
403
  return [{
390
404
  "propName": "icon",
@@ -12,9 +12,9 @@ export class ZonosCard {
12
12
  this.spacing = '24px';
13
13
  }
14
14
  render() {
15
- return (h(Host, { key: 'b350f7a592ea35c3b6beaf5eefaa2ab0208975dd', style: {
15
+ return (h(Host, { key: 'c2f25ffa32920500b63702df35b9e30dcf28b47d', style: {
16
16
  '--font-family': zonosStoreFontFamily(),
17
- } }, h("div", { key: '125e8b550cd8f371e28a012536722f48402774f2', class: classes(['styled-card']), style: { padding: this.spacing } }, this.label && (h("header", { class: "card-header", style: { padding: this.spacing } }, h("zonos-text", { type: "subheader" }, this.label), h("h-stack", { spacing: 8 }, this.actions))), h("slot", { key: '3cf038c62910ebac736ed1c37ecf1a490c8e1d0e' }), (this.footerActions || this.footerContent) && (h("footer", { class: "card-footer", style: {
17
+ } }, h("div", { key: '30515451d4694d3fffffab4c23ac2b0ff0e37710', class: classes(['styled-card']), style: { padding: this.spacing } }, this.label && (h("header", { class: "card-header", style: { padding: this.spacing } }, h("zonos-text", { type: "subheader" }, this.label), h("h-stack", { spacing: 8 }, this.actions))), h("slot", { key: 'a1ced320f20a585c7201fc5c7b0729ce8e91a176' }), (this.footerActions || this.footerContent) && (h("footer", { class: "card-footer", style: {
18
18
  height: this.footerHeight ? `${this.footerHeight}px` : 'auto',
19
19
  padding: this.spacing,
20
20
  } }, h("div", null, this.footerContent), h("h-stack", { spacing: 8 }, this.footerActions))))));
@@ -27,14 +27,14 @@ export class ZonosCheckbox {
27
27
  ? 'var(--amino-gray-800)'
28
28
  : 'var(--amino-gray-0)';
29
29
  const borderStyle = getBorderRadius(this.borderStyle, '4px');
30
- return (h(Host, { key: '5f8516f5933b739cc3f21d901e50dec1c761fa58', class: classes(['zonos--elements zonos--checkbox']), style: {
30
+ return (h(Host, { key: '2ae2a0d33d34aafe96cc91e1cd7c7ee530dede4b', class: classes(['zonos--elements zonos--checkbox']), style: {
31
31
  '--background-color': backgroundColor,
32
32
  '--border-radius': borderStyle,
33
33
  '--font-family': zonosStoreFontFamily(),
34
34
  '--size': `${this.size}px`,
35
- } }, h("label", { key: '6544f51a8c892d616123ab4194d069b055e3dc86', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: '958e35bf16be575230748fccdb1a3916942c3a30', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
35
+ } }, h("label", { key: 'b9630027581a9f20374c2dfe88faa94cb50203c9', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: 'd1b2411d9f906692f18514a15df1bb290f662164', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
36
36
  this.checkboxSelected.emit(e.target.checked);
37
- }, type: "checkbox" }), h("span", { key: '2c55e0a190b092dd083c433c35143e253910f54f', class: "checkmark-container" }, h("svg", { key: '0aa1f705b728055835159a399173a170aee4f7c0', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'd526bbafde4d4399be3f3a0a7cc87e92634d9548', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { size: this.fontSize }, this.label)))));
37
+ }, type: "checkbox" }), h("span", { key: '8fc3cda232615f446aff5db71cd992de5327b8e7', class: "checkmark-container" }, h("svg", { key: '5b91a7a26abfd80850eb3c2bb2e045ef73abfd7a', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '2046a40a75da63ac288c5def90d82ab0d0e0523c', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { size: this.fontSize }, this.label)))));
38
38
  }
39
39
  static get is() { return "zonos-checkbox"; }
40
40
  static get encapsulation() { return "shadow"; }
@@ -178,8 +178,8 @@ export class ZonosCheckbox {
178
178
  "references": {
179
179
  "ElementsUiStyle": {
180
180
  "location": "import",
181
- "path": "src/types",
182
- "id": "src/types/index.ts::ElementsUiStyle"
181
+ "path": "src/types/generated/graphql.customer.types",
182
+ "id": "src/types/generated/graphql.customer.types.ts::ElementsUiStyle"
183
183
  }
184
184
  }
185
185
  },
@@ -0,0 +1,3 @@
1
+ <svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18.289 7.40424C18.618 7.65585 18.6808 8.12656 18.4291 8.4556L11.9291 16.9556C11.7978 17.1273 11.5988 17.234 11.383 17.2484C11.1673 17.2627 10.9559 17.1832 10.803 17.0303L6.80304 13.0303C6.51015 12.7374 6.51015 12.2626 6.80304 11.9697C7.09594 11.6768 7.57081 11.6768 7.8637 11.9697L11.258 15.3639L17.2376 7.54442C17.4892 7.21539 17.9599 7.15263 18.289 7.40424Z" fill="currentColor"/>
3
+ </svg>
@@ -0,0 +1,103 @@
1
+ :host {
2
+ font-family: var(--font-family, Inter), Inter;
3
+ display: block;
4
+ white-space: normal;
5
+ }
6
+ :host * {
7
+ font-family: var(--font-family, Inter), Inter;
8
+ }
9
+ :host img {
10
+ max-width: 100%;
11
+ }
12
+ :host dl,
13
+ :host dd,
14
+ :host h1,
15
+ :host h2,
16
+ :host h3,
17
+ :host h4,
18
+ :host h5,
19
+ :host h6,
20
+ :host hr,
21
+ :host figure,
22
+ :host p,
23
+ :host pre {
24
+ margin: 0;
25
+ }
26
+
27
+ /* All sets of variable are here */
28
+ /* smooth font rendering */
29
+ :host {
30
+ -moz-osx-font-smoothing: grayscale;
31
+ -webkit-font-smoothing: antialiased;
32
+ }
33
+
34
+ :host {
35
+ margin-bottom: var(--amino-space-32);
36
+ }
37
+ :host .zonos--tab-wrapper {
38
+ display: flex;
39
+ flex-direction: row;
40
+ justify-content: space-around;
41
+ }
42
+ :host .zonos--tab-index {
43
+ position: relative;
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: center;
47
+ justify-content: center;
48
+ font-size: 13px;
49
+ width: 24px;
50
+ height: 24px;
51
+ font-weight: bold;
52
+ }
53
+ :host .zonos--tab-index .zonos--tab-index-label,
54
+ :host .zonos--tab-index .zonos--tab-index-done-icon {
55
+ position: absolute;
56
+ top: 0;
57
+ width: 24px;
58
+ height: 24px;
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ transition: top 0.5s ease-in-out, opacity 0.5s ease-in-out;
63
+ }
64
+ :host .zonos--tab-index .zonos--tab-index-done-icon {
65
+ top: -50%;
66
+ opacity: 0;
67
+ }
68
+ :host .zonos--tab-item {
69
+ display: flex;
70
+ flex-direction: row;
71
+ align-items: center;
72
+ background: transparent;
73
+ border: 0;
74
+ cursor: pointer;
75
+ }
76
+ :host .zonos--tab-item.done .zonos--tab-index-done-icon {
77
+ top: 0;
78
+ opacity: 1;
79
+ }
80
+ :host .zonos--tab-item.done .zonos--tab-index-label {
81
+ opacity: 0;
82
+ top: 50%;
83
+ }
84
+ :host .zonos--tab-item.selected zonos-text {
85
+ color: var(--color);
86
+ }
87
+ :host .zonos--tab-progress {
88
+ width: 100%;
89
+ background-color: transparent;
90
+ border-radius: 10px;
91
+ box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4);
92
+ overflow: hidden;
93
+ position: relative;
94
+ padding: 1px;
95
+ height: 8px;
96
+ }
97
+ :host .zonos--tab-progress .zonos--progress-bar-fill {
98
+ border-radius: 10px;
99
+ background-color: var(--color);
100
+ height: 100%;
101
+ width: var(--progress-percent);
102
+ transition: width 0.5s ease-in-out;
103
+ }