@zonos/elements 1.3.18-alpha.0 → 1.3.18-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 (305) hide show
  1. package/dist/cjs/{cart-d25723e7.js → cart-941a31dd.js} +562 -12
  2. package/dist/cjs/{getBorderRadius-44b3eca1.js → getBorderRadius-bcb309a8.js} +1 -1
  3. package/dist/cjs/{index-654a6001.js → index-b071017b.js} +4 -1
  4. package/dist/cjs/{isDarkColor-01f45d3f.js → isDarkColor-b0393089.js} +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/{submitGtag-484eaf9d.js → submitGtag-9210b4fe.js} +2 -2
  7. package/dist/cjs/zonos-address_8.cjs.entry.js +22 -11
  8. package/dist/cjs/zonos-badge_2.cjs.entry.js +4 -4
  9. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  10. package/dist/cjs/zonos-button_3.cjs.entry.js +22 -11
  11. package/dist/cjs/zonos-card_2.cjs.entry.js +7 -7
  12. package/dist/cjs/{zonos-cart-items_9.cjs.entry.js → zonos-cart-items_11.cjs.entry.js} +224 -14
  13. package/dist/cjs/zonos-checkout.cjs.entry.js +36 -10
  14. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  15. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  16. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  17. package/dist/cjs/zonos-country-select_3.cjs.entry.js +11 -11
  18. package/dist/cjs/zonos-elements.cjs.js +2 -2
  19. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +8 -8
  20. package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-input.cjs.entry.js +7 -7
  22. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-notification.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
  26. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +6 -6
  27. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  28. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  29. package/dist/cjs/{zonosStore-d8bb0bda.js → zonosStore-7c6205ca.js} +2 -1
  30. package/dist/collection/collection-manifest.json +2 -0
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +2 -1
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/assets/ChevronUpIcon.svg +23 -0
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/assets/empty-item.jpeg +0 -0
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.css +105 -0
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +101 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +6 -3
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +1 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +43 -6
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +18 -2
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +3 -2
  42. package/dist/collection/components/common/zonos-button/zonos-button.css +12 -0
  43. package/dist/collection/components/common/zonos-button/zonos-button.js +43 -8
  44. package/dist/collection/components/common/zonos-confirm-dialog/assets/ExclamationMarkDuotoneIcon.svg +4 -0
  45. package/dist/collection/components/common/zonos-confirm-dialog/assets/HelpDuotoneIcon.svg +4 -0
  46. package/dist/collection/components/common/zonos-confirm-dialog/assets/WarningDuotoneIcon.svg +4 -0
  47. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.css +125 -0
  48. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +322 -0
  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 +2 -2
  51. package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +1 -4
  52. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +38 -4
  53. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  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 +2 -2
  56. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  57. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  58. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  59. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  60. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  61. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +3 -3
  62. package/dist/collection/components/main/zonos-controller.js +3 -3
  63. package/dist/collection/components/store/checkout/cart.js +55 -5
  64. package/dist/collection/components/store/checkout/stripe.js +6 -2
  65. package/dist/collection/components/store/hello/localization.js +12 -2
  66. package/dist/collection/components/store/translationStore/strings.arabic.js +24 -0
  67. package/dist/collection/components/store/translationStore/strings.base.js +24 -0
  68. package/dist/collection/components/store/translationStore/strings.chinese.js +24 -0
  69. package/dist/collection/components/store/translationStore/strings.danish.js +24 -0
  70. package/dist/collection/components/store/translationStore/strings.dutch.js +24 -0
  71. package/dist/collection/components/store/translationStore/strings.french.js +24 -0
  72. package/dist/collection/components/store/translationStore/strings.german.js +24 -0
  73. package/dist/collection/components/store/translationStore/strings.hebrew.js +24 -0
  74. package/dist/collection/components/store/translationStore/strings.indonesian.js +24 -0
  75. package/dist/collection/components/store/translationStore/strings.italian.js +24 -0
  76. package/dist/collection/components/store/translationStore/strings.japanese.js +24 -0
  77. package/dist/collection/components/store/translationStore/strings.korean.js +24 -0
  78. package/dist/collection/components/store/translationStore/strings.norwegian.js +24 -0
  79. package/dist/collection/components/store/translationStore/strings.polish.js +24 -0
  80. package/dist/collection/components/store/translationStore/strings.portuguese.js +24 -0
  81. package/dist/collection/components/store/translationStore/strings.russian.js +24 -0
  82. package/dist/collection/components/store/translationStore/strings.spanish.js +24 -0
  83. package/dist/collection/components/store/translationStore/strings.swedish.js +24 -0
  84. package/dist/collection/components/store/translationStore/strings.turkish.js +24 -0
  85. package/dist/collection/components/store/translationStore/strings.vietnamese.js +24 -0
  86. package/dist/collection/components/store/zonosStore.js +1 -0
  87. package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
  88. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  89. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  90. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +1 -1
  91. package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +6 -1
  92. package/dist/collection/scripts/zonosBase.js +2 -1
  93. package/dist/collection/types/checkout/RestrictProduct.js +1 -0
  94. package/dist/collection/types/generated/graphql.customer.types.js +40 -0
  95. package/dist/collection/types/generated/graphql.frontend.types.js +1 -0
  96. package/dist/components/stripe.js +79 -10
  97. package/dist/components/submitGtag.js +1 -1
  98. package/dist/components/trackConversionEvent.js +1 -1
  99. package/dist/components/translationStore.js +480 -0
  100. package/dist/components/zonos-address2.js +1 -1
  101. package/dist/components/zonos-button2.js +20 -8
  102. package/dist/components/zonos-cart-items2.js +2 -1
  103. package/dist/components/zonos-cart-restricted-items.d.ts +11 -0
  104. package/dist/components/zonos-cart-restricted-items.js +6 -0
  105. package/dist/components/zonos-cart-restricted-items2.js +135 -0
  106. package/dist/components/zonos-cart-subtotal2.js +6 -3
  107. package/dist/components/zonos-checkout-finish2.js +1 -1
  108. package/dist/components/zonos-checkout-payment2.js +1 -1
  109. package/dist/components/zonos-checkout.js +77 -38
  110. package/dist/components/zonos-component.js +1 -1
  111. package/dist/components/zonos-confirm-dialog.d.ts +11 -0
  112. package/dist/components/zonos-confirm-dialog.js +6 -0
  113. package/dist/components/zonos-confirm-dialog2.js +161 -0
  114. package/dist/components/zonos-controller.js +2 -2
  115. package/dist/components/zonos-country-select2.js +3 -3
  116. package/dist/components/zonos-custom-message2.js +2 -2
  117. package/dist/components/zonos-customer-info2.js +19 -3
  118. package/dist/components/zonos-dialog2.js +17 -5
  119. package/dist/components/zonos-hello-dialog-footer2.js +2 -2
  120. package/dist/components/zonos-hello-dialog2.js +4 -4
  121. package/dist/components/zonos-hello.js +1 -1
  122. package/dist/components/zonos-input2.js +4 -4
  123. package/dist/components/zonos-language-select2.js +3 -3
  124. package/dist/components/zonos-link-authentication2.js +1 -1
  125. package/dist/components/zonos-logo.js +2 -2
  126. package/dist/components/zonos-payment2.js +1 -1
  127. package/dist/components/zonos-review2.js +3 -2
  128. package/dist/components/zonos-select-dialog-header2.js +2 -2
  129. package/dist/components/zonos-shipping2.js +1 -1
  130. package/dist/components/zonos-tooltip2.js +2 -2
  131. package/dist/components/zonos-v-stack2.js +2 -2
  132. package/dist/components/zonosStore.js +1 -0
  133. package/dist/esm/{cart-02f5c2ea.js → cart-cc593c2b.js} +562 -13
  134. package/dist/esm/{getBorderRadius-567f1786.js → getBorderRadius-d244b4b1.js} +1 -1
  135. package/dist/esm/{index-e063389c.js → index-3b46f3c3.js} +4 -1
  136. package/dist/esm/{isDarkColor-7f62035a.js → isDarkColor-39a36e82.js} +1 -1
  137. package/dist/esm/loader.js +3 -3
  138. package/dist/esm/{submitGtag-ba38e1ac.js → submitGtag-e50f903f.js} +2 -2
  139. package/dist/esm/zonos-address_8.entry.js +22 -11
  140. package/dist/esm/zonos-badge_2.entry.js +4 -4
  141. package/dist/esm/zonos-banner.entry.js +2 -2
  142. package/dist/esm/zonos-button_3.entry.js +22 -11
  143. package/dist/esm/zonos-card_2.entry.js +7 -7
  144. package/dist/esm/{zonos-cart-items_9.entry.js → zonos-cart-items_11.entry.js} +223 -15
  145. package/dist/esm/zonos-checkout.entry.js +36 -10
  146. package/dist/esm/zonos-component.entry.js +2 -2
  147. package/dist/esm/zonos-controller.entry.js +6 -6
  148. package/dist/esm/zonos-country-flag.entry.js +5 -5
  149. package/dist/esm/zonos-country-select_3.entry.js +11 -11
  150. package/dist/esm/zonos-elements.js +3 -3
  151. package/dist/esm/zonos-hello-dialog.entry.js +8 -8
  152. package/dist/esm/zonos-hello.entry.js +5 -5
  153. package/dist/esm/zonos-input.entry.js +7 -7
  154. package/dist/esm/zonos-link.entry.js +1 -1
  155. package/dist/esm/zonos-logo.entry.js +4 -4
  156. package/dist/esm/zonos-notification.entry.js +2 -2
  157. package/dist/esm/zonos-payment.entry.js +6 -6
  158. package/dist/esm/zonos-select-dialog-header_2.entry.js +6 -6
  159. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  160. package/dist/esm/zonos-text.entry.js +2 -2
  161. package/dist/esm/{zonosStore-33ff08ff.js → zonosStore-32e33a45.js} +2 -1
  162. package/dist/esm-es5/cart-cc593c2b.js +1 -0
  163. package/dist/esm-es5/{getBorderRadius-567f1786.js → getBorderRadius-d244b4b1.js} +1 -1
  164. package/dist/esm-es5/{index-e063389c.js → index-3b46f3c3.js} +1 -1
  165. package/dist/esm-es5/{isDarkColor-7f62035a.js → isDarkColor-39a36e82.js} +1 -1
  166. package/dist/esm-es5/loader.js +1 -1
  167. package/dist/esm-es5/{submitGtag-ba38e1ac.js → submitGtag-e50f903f.js} +1 -1
  168. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  169. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  170. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  171. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  172. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  173. package/dist/esm-es5/zonos-cart-items_11.entry.js +1 -0
  174. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  175. package/dist/esm-es5/zonos-component.entry.js +1 -1
  176. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  177. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  178. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  179. package/dist/esm-es5/zonos-elements.js +1 -1
  180. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  181. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  182. package/dist/esm-es5/zonos-input.entry.js +1 -1
  183. package/dist/esm-es5/zonos-link.entry.js +1 -1
  184. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  185. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  186. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  187. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  188. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  189. package/dist/esm-es5/zonos-text.entry.js +1 -1
  190. package/dist/esm-es5/{zonosStore-33ff08ff.js → zonosStore-32e33a45.js} +1 -1
  191. package/dist/scripts/loadZonos.js +1 -1
  192. package/dist/scripts/zonos.js +1 -1
  193. package/dist/scripts/zonosBase.js +1 -1
  194. package/dist/types/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.d.ts +14 -0
  195. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +11 -1
  196. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +2 -0
  197. package/dist/types/components/common/zonos-button/zonos-button.d.ts +7 -1
  198. package/dist/types/components/common/zonos-confirm-dialog/zonos-confirm-dialog.d.ts +60 -0
  199. package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +6 -1
  200. package/dist/types/components/store/checkout/cart.d.ts +38 -4
  201. package/dist/types/components/store/translationStore/strings.arabic.d.ts +24 -0
  202. package/dist/types/components/store/translationStore/strings.base.d.ts +24 -0
  203. package/dist/types/components/store/translationStore/strings.chinese.d.ts +24 -0
  204. package/dist/types/components/store/translationStore/strings.danish.d.ts +24 -0
  205. package/dist/types/components/store/translationStore/strings.dutch.d.ts +24 -0
  206. package/dist/types/components/store/translationStore/strings.french.d.ts +24 -0
  207. package/dist/types/components/store/translationStore/strings.german.d.ts +24 -0
  208. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +24 -0
  209. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +24 -0
  210. package/dist/types/components/store/translationStore/strings.italian.d.ts +24 -0
  211. package/dist/types/components/store/translationStore/strings.japanese.d.ts +24 -0
  212. package/dist/types/components/store/translationStore/strings.korean.d.ts +24 -0
  213. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +24 -0
  214. package/dist/types/components/store/translationStore/strings.polish.d.ts +24 -0
  215. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +24 -0
  216. package/dist/types/components/store/translationStore/strings.russian.d.ts +24 -0
  217. package/dist/types/components/store/translationStore/strings.spanish.d.ts +24 -0
  218. package/dist/types/components/store/translationStore/strings.swedish.d.ts +24 -0
  219. package/dist/types/components/store/translationStore/strings.turkish.d.ts +24 -0
  220. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +24 -0
  221. package/dist/types/components/store/translationStore.d.ts +1 -1
  222. package/dist/types/components/store/zonosStore.d.ts +4 -0
  223. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  224. package/dist/types/components.d.ts +163 -5
  225. package/dist/types/scripts/zonosBase.d.ts +21 -2
  226. package/dist/types/types/checkout/CheckoutConfig.d.ts +7 -0
  227. package/dist/types/types/checkout/RestrictProduct.d.ts +7 -0
  228. package/dist/types/types/generated/graphql.customer.types.d.ts +54 -0
  229. package/dist/types/types/generated/graphql.customer.types.ts +66 -1
  230. package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -1
  231. package/dist/types/types/generated/graphql.frontend.types.ts +2 -1
  232. package/dist/zonos-elements/assets/ExclamationMarkDuotoneIcon.svg +4 -0
  233. package/dist/zonos-elements/assets/HelpDuotoneIcon.svg +4 -0
  234. package/dist/zonos-elements/assets/WarningDuotoneIcon.svg +4 -0
  235. package/dist/zonos-elements/{p-d7acc81c.entry.js → p-020a9b86.entry.js} +1 -1
  236. package/dist/zonos-elements/{p-905d842b.entry.js → p-04030a48.entry.js} +1 -1
  237. package/dist/zonos-elements/{p-fe246229.system.entry.js → p-0d0f9694.system.entry.js} +1 -1
  238. package/dist/zonos-elements/{p-0267a969.entry.js → p-0e892292.entry.js} +1 -1
  239. package/dist/zonos-elements/{p-57adc7f8.entry.js → p-0fac99e7.entry.js} +1 -1
  240. package/dist/zonos-elements/p-1795c760.system.entry.js +1 -0
  241. package/dist/zonos-elements/{p-771fbeb3.system.js → p-1b9442f6.system.js} +1 -1
  242. package/dist/zonos-elements/{p-1ba4cf64.entry.js → p-24ac1c6f.entry.js} +1 -1
  243. package/dist/zonos-elements/p-26a60a6e.entry.js +1 -0
  244. package/dist/zonos-elements/{p-835c8928.entry.js → p-281b8bdf.entry.js} +1 -1
  245. package/dist/zonos-elements/{p-a889c1bc.entry.js → p-2af19b63.entry.js} +1 -1
  246. package/dist/zonos-elements/{p-582d8b27.entry.js → p-2ced091f.entry.js} +1 -1
  247. package/dist/zonos-elements/{p-909a331c.js → p-2f759d82.js} +1 -1
  248. package/dist/zonos-elements/p-32744531.entry.js +1 -0
  249. package/dist/zonos-elements/{p-532995a4.system.entry.js → p-35ac375a.system.entry.js} +1 -1
  250. package/dist/zonos-elements/{p-9da0562e.system.entry.js → p-3bc88c3c.system.entry.js} +1 -1
  251. package/dist/zonos-elements/{p-36a461a6.system.entry.js → p-3e26d7b3.system.entry.js} +1 -1
  252. package/dist/zonos-elements/{p-9ec93319.entry.js → p-498a0e18.entry.js} +1 -1
  253. package/dist/zonos-elements/{p-572a4de2.system.entry.js → p-4caaaaeb.system.entry.js} +1 -1
  254. package/dist/zonos-elements/{p-79f3c4f5.system.js → p-58e730b6.system.js} +1 -1
  255. package/dist/zonos-elements/{p-e7b4b756.entry.js → p-597b75f3.entry.js} +1 -1
  256. package/dist/zonos-elements/{p-6ece23b9.entry.js → p-5e783394.entry.js} +1 -1
  257. package/dist/zonos-elements/{p-87badea9.system.js → p-62ecfbcc.system.js} +1 -1
  258. package/dist/zonos-elements/{p-f99eb5e7.entry.js → p-6366e7e3.entry.js} +1 -1
  259. package/dist/zonos-elements/p-693b9985.js +1 -0
  260. package/dist/zonos-elements/{p-bf32179a.system.entry.js → p-6eda6199.system.entry.js} +1 -1
  261. package/dist/zonos-elements/{p-6dec476d.system.entry.js → p-7c8ee4b9.system.entry.js} +1 -1
  262. package/dist/zonos-elements/{p-305f27c7.entry.js → p-80442f16.entry.js} +1 -1
  263. package/dist/zonos-elements/{p-cf0f8e32.entry.js → p-80ea85b8.entry.js} +1 -1
  264. package/dist/zonos-elements/{p-679877b1.system.entry.js → p-8171d013.system.entry.js} +1 -1
  265. package/dist/zonos-elements/{p-83cc2936.js → p-8c0b4a61.js} +1 -1
  266. package/dist/zonos-elements/{p-4dca5484.system.entry.js → p-8cd6633a.system.entry.js} +1 -1
  267. package/dist/zonos-elements/p-8da16d53.system.js +1 -0
  268. package/dist/zonos-elements/p-96b8c9ba.system.entry.js +1 -0
  269. package/dist/zonos-elements/{p-f124e659.system.entry.js → p-98a0b694.system.entry.js} +1 -1
  270. package/dist/zonos-elements/{p-fd49d864.entry.js → p-9aab3ad7.entry.js} +1 -1
  271. package/dist/zonos-elements/{p-ad088d46.system.entry.js → p-9e8d38f7.system.entry.js} +1 -1
  272. package/dist/zonos-elements/{p-83fecb2a.entry.js → p-9e9c318b.entry.js} +1 -1
  273. package/dist/zonos-elements/{p-e108e5ed.system.entry.js → p-a47382ae.system.entry.js} +1 -1
  274. package/dist/zonos-elements/{p-47e00966.system.entry.js → p-b98cdf39.system.entry.js} +1 -1
  275. package/dist/zonos-elements/{p-3638e2ed.entry.js → p-bd9b2165.entry.js} +1 -1
  276. package/dist/zonos-elements/{p-ff403840.entry.js → p-c20e5430.entry.js} +1 -1
  277. package/dist/zonos-elements/{p-13ddaf31.js → p-ce347974.js} +1 -1
  278. package/dist/zonos-elements/{p-f71489e5.system.entry.js → p-d0bc8902.system.entry.js} +1 -1
  279. package/dist/zonos-elements/{p-17e265c3.system.entry.js → p-d7a939df.system.entry.js} +1 -1
  280. package/dist/zonos-elements/p-d7b8c1c1.system.entry.js +1 -0
  281. package/dist/zonos-elements/{p-163ff5b5.system.js → p-d99232c5.system.js} +1 -1
  282. package/dist/zonos-elements/p-dd0fd351.entry.js +1 -0
  283. package/dist/zonos-elements/p-e015cb0e.js +1 -0
  284. package/dist/zonos-elements/p-e0bf9666.system.js +1 -0
  285. package/dist/zonos-elements/{p-b98bdbcc.system.entry.js → p-e13bfbda.system.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-239cc943.system.entry.js → p-e1fbd05d.system.entry.js} +1 -1
  287. package/dist/zonos-elements/{p-0265da6f.js → p-e553dd19.js} +1 -1
  288. package/dist/zonos-elements/p-e6fa0ebc.system.js +1 -0
  289. package/dist/zonos-elements/{p-5e33aab7.system.entry.js → p-f6546bf4.system.entry.js} +1 -1
  290. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  291. package/dist/zonos-elements/zonos-elements.js +1 -1
  292. package/package.json +13 -13
  293. package/dist/esm-es5/cart-02f5c2ea.js +0 -1
  294. package/dist/esm-es5/zonos-cart-items_9.entry.js +0 -1
  295. package/dist/zonos-elements/p-154aaf95.system.js +0 -1
  296. package/dist/zonos-elements/p-168e5b5f.system.js +0 -1
  297. package/dist/zonos-elements/p-1b8082dd.entry.js +0 -1
  298. package/dist/zonos-elements/p-246133d3.entry.js +0 -1
  299. package/dist/zonos-elements/p-54004793.system.entry.js +0 -1
  300. package/dist/zonos-elements/p-54a32fd7.entry.js +0 -1
  301. package/dist/zonos-elements/p-5d13795a.system.entry.js +0 -1
  302. package/dist/zonos-elements/p-981bf71a.js +0 -1
  303. package/dist/zonos-elements/p-e0e66004.system.js +0 -1
  304. package/dist/zonos-elements/p-ed7d251d.system.entry.js +0 -1
  305. package/dist/zonos-elements/p-f1962041.js +0 -1
@@ -0,0 +1,101 @@
1
+ import { getAssetPath, h, Host } from "@stencil/core";
2
+ import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout/cart";
3
+ import { translate } from "../../../store/translationStore";
4
+ import { classes } from "../../../utils/classes";
5
+ import { formatCurrency } from "../../../utils/formatCurrency";
6
+ // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
7
+ import ChevronUpIcon from "./assets/ChevronUpIcon.svg";
8
+ export class ZonosCartRestrictedItems {
9
+ constructor() {
10
+ this.hide = false;
11
+ this.errorImages = [];
12
+ this.internalCollapsed = true;
13
+ this.firstRender = true;
14
+ }
15
+ componentDidLoad() {
16
+ // Reset if it's first render
17
+ this.firstRender = true;
18
+ }
19
+ render() {
20
+ var _a;
21
+ const emptyItemImg = getAssetPath('./assets/empty-item.jpeg');
22
+ const rate = ((_a = cartStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.rate) || 1;
23
+ const restrictedItemTotal = cartStore.restrictedItems.length;
24
+ if (this.hide || restrictedItemTotal === 0) {
25
+ // show nothing if the parent is collapsed or no restricted items
26
+ return null;
27
+ }
28
+ if (this.firstRender) {
29
+ // Auto expand if all items are restricted
30
+ this.internalCollapsed = cartStoreHasOneEligibleItem();
31
+ this.firstRender = false;
32
+ }
33
+ return (h(Host, { class: classes([
34
+ 'zonos--cart-restricted-items',
35
+ 'zonos--elements',
36
+ this.internalCollapsed && 'collapsed',
37
+ ]) }, h("button", { class: classes([
38
+ 'zonos--cart-title-collapse-trigger',
39
+ this.internalCollapsed && 'collapsed',
40
+ ]), onClick: () => {
41
+ this.internalCollapsed = !this.internalCollapsed;
42
+ } }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { textColor: "red-600", type: "label" }, `${translate(this.internalCollapsed ? 'Show' : 'Hide')} ${restrictedItemTotal} ${translate('restricted items')}`), h("zonos-icon", { content: ChevronUpIcon, iconColor: "red-600" }))), h("zonos-collapse", { collapsed: this.internalCollapsed }, h("zonos-banner", { bannerTitle: translate('The following items are unable to be shipped to your country and are not included in your cart total.'), intent: "error" }), h("table", { class: "zonos--cart-table" }, h("tbody", null, cartStore.restrictedItems.map((item, index) => {
43
+ var _a, _b;
44
+ const itemImg = item.imageUrl;
45
+ return (h("tr", { class: "zonos--cart-item" }, h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (h("img", { alt:
46
+ // Use matched item name if available
47
+ ((_a = item.matchedItem) === null || _a === void 0 ? void 0 : _a.name) ||
48
+ item.name ||
49
+ `Restricted item ${index + 1}`, onError: () => {
50
+ this.errorImages = [...this.errorImages, itemImg];
51
+ }, src: itemImg, style: {
52
+ 'min-width': '40px',
53
+ }, width: 40 })) : (h("img", { alt: item.name || `Restricted item ${index + 1}`, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("zonos-text", { type: "label" }, ((_b = item.matchedItem) === null || _b === void 0 ? void 0 : _b.name) || item.name), h("zonos-text", { type: "caption" }, item.restriction.reason)), h("td", { class: "zonos--column zonos--cart-item-price" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
54
+ amount: item.amount * item.quantity * rate,
55
+ currency: cartStore.currency,
56
+ })))));
57
+ }))))));
58
+ }
59
+ static get is() { return "zonos-cart-restricted-items"; }
60
+ static get encapsulation() { return "shadow"; }
61
+ static get originalStyleUrls() {
62
+ return {
63
+ "$": ["zonos-cart-restricted-items.scss"]
64
+ };
65
+ }
66
+ static get styleUrls() {
67
+ return {
68
+ "$": ["zonos-cart-restricted-items.css"]
69
+ };
70
+ }
71
+ static get assetsDirs() { return ["assets"]; }
72
+ static get properties() {
73
+ return {
74
+ "hide": {
75
+ "type": "boolean",
76
+ "mutable": false,
77
+ "complexType": {
78
+ "original": "boolean",
79
+ "resolved": "boolean",
80
+ "references": {}
81
+ },
82
+ "required": false,
83
+ "optional": false,
84
+ "docs": {
85
+ "tags": [],
86
+ "text": "This is to hide the section when the parent collapse on mobile"
87
+ },
88
+ "attribute": "hide",
89
+ "reflect": false,
90
+ "defaultValue": "false"
91
+ }
92
+ };
93
+ }
94
+ static get states() {
95
+ return {
96
+ "errorImages": {},
97
+ "internalCollapsed": {},
98
+ "firstRender": {}
99
+ };
100
+ }
101
+ }
@@ -1,5 +1,5 @@
1
1
  import { Fragment, h, Host } from "@stencil/core";
2
- import { cartStore } from "../../../store/checkout/cart";
2
+ import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout/cart";
3
3
  import { translate } from "../../../store/translationStore";
4
4
  import { formatCurrency } from "../../../utils/formatCurrency";
5
5
  // These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested
@@ -8,6 +8,9 @@ import InfoIcon from "./assets/InfoIcon.svg";
8
8
  export class ZonosCartSubtotal {
9
9
  render() {
10
10
  const showDutyTaxesInfo = cartStore.step === 'payment' || cartStore.step === 'shipping';
11
+ // Show 0 for subtotal and total when all items are restricted
12
+ const total = cartStoreHasOneEligibleItem() ? cartStore.total : 0;
13
+ const subtotal = cartStoreHasOneEligibleItem() ? cartStore.subtotal : 0;
11
14
  const renderShippingInfo = () => {
12
15
  if (!cartStore.selectedShippingOption) {
13
16
  return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Shipping')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('No shipping method selected'))));
@@ -15,7 +18,7 @@ export class ZonosCartSubtotal {
15
18
  return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cartStore.selectedShippingOption.displayName), cartStore.selectedShippingOptionTransitTime && (h("zonos-text", { class: "zonos--caption", type: "caption" }, cartStore.selectedShippingOptionTransitTime, ' ', translate('business days')))));
16
19
  };
17
20
  return (h(Host, { class: "zonos--cart-subtotal zonos--elements" }, h("table", { class: "zonos--cart-table" }, h("tr", { class: "zonos--row zonos--cart-subtotal" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { type: "semiBoldLabel" }, translate('Cart subtotal'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
18
- amount: cartStore.subtotal,
21
+ amount: subtotal,
19
22
  currency: cartStore.currency,
20
23
  })))), h("tr", { class: "zonos--row zonos--cart-shipping" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, renderShippingInfo()), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, cartStore.shipping
21
24
  ? formatCurrency({
@@ -28,7 +31,7 @@ export class ZonosCartSubtotal {
28
31
  currency: cartStore.currency,
29
32
  })
30
33
  : '-', cartStore.isSelectedShippingGuarantee && (h("zonos-badge", null, translate('Guaranteed'))))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
31
- amount: cartStore.total,
34
+ amount: total,
32
35
  currency: cartStore.currency,
33
36
  })))))));
34
37
  }
@@ -68,6 +68,9 @@
68
68
  :host zonos-button {
69
69
  box-shadow: 0 0 1px 0 var(--zonos-elements-gray-600);
70
70
  }
71
+ :host zonos-button {
72
+ box-shadow: 0 0 1px 0 var(--zonos-elements-gray-600);
73
+ }
71
74
  :host .zonos--group-btn {
72
75
  position: sticky;
73
76
  display: flex;
@@ -161,7 +161,7 @@
161
161
  @media (max-width: 768px) {
162
162
  :host(.mobile) .zonos--content .zonos--left,
163
163
  :host(.mobile) .zonos--content .zonos--right {
164
- padding-bottom: 0px;
164
+ padding-bottom: 0;
165
165
  }
166
166
  }
167
167
  :host(.mobile) .zonos--content .zonos--left {
@@ -68,6 +68,7 @@ export class ZonosCheckout {
68
68
  this.domesticRedirectedBtnSelector = '#zonos--domestic-redirected-checkout-button';
69
69
  this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
70
70
  this.isLegacyCheckout = false;
71
+ this.confirmDialogOpen = false;
71
72
  }
72
73
  /**
73
74
  * Init cart info handler event
@@ -76,10 +77,27 @@ export class ZonosCheckout {
76
77
  const cartItems = e.detail;
77
78
  void cartStoreUpdateItems(cartItems);
78
79
  }
80
+ async handleKeyPress(e) {
81
+ if (e.key === 'Escape') {
82
+ void this.closeDialogHandler();
83
+ }
84
+ }
79
85
  /**
80
86
  * Close dialog action
81
87
  */
82
- async closeDialogHandler() {
88
+ async closeDialogHandler(props) {
89
+ var _a, _b;
90
+ if (!this.open) {
91
+ // Do nothing if the checkout is not even open
92
+ return;
93
+ }
94
+ // Only proceed when user select confirmed.
95
+ if (!(props === null || props === void 0 ? void 0 : props.confirmed)) {
96
+ this.confirmDialogOpen = true;
97
+ return;
98
+ }
99
+ // Close the confirm dialog
100
+ this.confirmDialogOpen = false;
83
101
  submitGtag('zonos-checkout-close');
84
102
  this.open = this.forceDialogOpen || false;
85
103
  if (!this.preview && cartStore.step === 'finish') {
@@ -90,6 +108,10 @@ export class ZonosCheckout {
90
108
  cartStore.step = 'customer-info';
91
109
  // reset the tab item, so that user needs to click on Continue button to re-quote the landed cost if needed.
92
110
  cartStoreResetTabItems();
111
+ /**
112
+ * Trigger callback when the checkout is closed
113
+ */
114
+ (_b = (_a = zonosStore.checkoutSettings).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
93
115
  }
94
116
  async buildCartAndInit() {
95
117
  // if tempCartUUID is provided, use it instead of buildCartDetail
@@ -480,7 +502,7 @@ export class ZonosCheckout {
480
502
  } }), h("zonos-collapse", {
481
503
  // only collapsible on mobile
482
504
  collapsed: this.collapseReviewMobile && this.isMobile
483
- }, 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
505
+ }, 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 }))))), h("zonos-cart-restricted-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 }))))))), (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
484
506
  ? Object.assign(Object.assign({}, cartStore.error), { type: 'error' }) : undefined, storybookForceStatus: this.storybookPaymentStatusOverride }))), h("zonos-checkout-footer", { "data-theme": rightSideTheme, mobile: this.isMobile,
485
507
  /**
486
508
  * For this component, use slot instead of passing JSX through prop of other component. Because
@@ -494,7 +516,11 @@ export class ZonosCheckout {
494
516
  hasFooter && 'has-footer',
495
517
  this.preview && 'preview',
496
518
  this.isMobile && 'mobile',
497
- ]) }, 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()))));
519
+ ]) }, 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())), h("zonos-confirm-dialog", { dialogCancelBtnText: translate("Don't close"), dialogConfirmBtnText: translate('Close'), dialogIntent: "warn", dialogOpen: this.confirmDialogOpen, dialogSubtitle: translate('Would you like to close checkout and return to the site?'), dialogTitle: translate('Are you sure?'), onCancelClicked: () => {
520
+ this.confirmDialogOpen = false;
521
+ },
522
+ // Mark user selected confirm to close the dialog
523
+ onConfirmClicked: () => this.closeDialogHandler({ confirmed: true }) })));
498
524
  }
499
525
  static get is() { return "zonos-checkout"; }
500
526
  static get encapsulation() { return "scoped"; }
@@ -627,15 +653,20 @@ export class ZonosCheckout {
627
653
  "storybookPaymentStatusOverride": {},
628
654
  "domesticRedirectedBtnSelector": {},
629
655
  "legacyCheckoutHiddenBtnSelector": {},
630
- "isLegacyCheckout": {}
656
+ "isLegacyCheckout": {},
657
+ "confirmDialogOpen": {}
631
658
  };
632
659
  }
633
660
  static get methods() {
634
661
  return {
635
662
  "closeDialogHandler": {
636
663
  "complexType": {
637
- "signature": "() => Promise<void>",
638
- "parameters": [],
664
+ "signature": "(props?: { confirmed: boolean; }) => Promise<void>",
665
+ "parameters": [{
666
+ "name": "props",
667
+ "type": "{ confirmed: boolean; } | undefined",
668
+ "docs": ""
669
+ }],
639
670
  "references": {
640
671
  "Promise": {
641
672
  "location": "global",
@@ -717,6 +748,12 @@ export class ZonosCheckout {
717
748
  "target": "body",
718
749
  "capture": false,
719
750
  "passive": false
751
+ }, {
752
+ "name": "keydown",
753
+ "method": "handleKeyPress",
754
+ "target": "document",
755
+ "capture": false,
756
+ "passive": false
720
757
  }, {
721
758
  "name": "resize",
722
759
  "method": "handleWindowResize",
@@ -115,6 +115,8 @@ export class ZonosCustomerInfo {
115
115
  this.isMobile = false;
116
116
  this.defaultAddress = null;
117
117
  this.showErrorBanner = false;
118
+ this.shippingCountry = '';
119
+ this.isCheckingForRestrictedItems = false;
118
120
  this.isValidatingAddress = false;
119
121
  this.invalidShippingCharacterList = null;
120
122
  this.invalidBillingCharacterList = null;
@@ -146,10 +148,22 @@ export class ZonosCustomerInfo {
146
148
  return invalidList;
147
149
  }
148
150
  render() {
149
- var _a;
151
+ var _a, _b;
150
152
  if (!stripeStore.stripeElements) {
151
153
  return null;
152
154
  }
155
+ // init the shipping country when shipping address is available
156
+ if (!this.shippingCountry && stripeStore.stripeAddressEventData) {
157
+ this.shippingCountry =
158
+ (_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.value.address.country;
159
+ }
160
+ if (stripeStore.stripeAddressEventData &&
161
+ this.shippingCountry !==
162
+ stripeStore.stripeAddressEventData.value.address.country) {
163
+ // reset the shipping country if it's different from the current shipping address
164
+ this.shippingCountry =
165
+ stripeStore.stripeAddressEventData.value.address.country;
166
+ }
153
167
  const showBilling = !stripeStore.stripeShippingSameAsBilling;
154
168
  // Get theme for the update dialog, inherit from the theme, no from this component theme
155
169
  const theme = getZonosStoreTheme(zonosStore.appearance.theme);
@@ -157,7 +171,7 @@ export class ZonosCustomerInfo {
157
171
  if (this.showErrorBanner) {
158
172
  this.showErrorBanner = !this.handleValidate();
159
173
  }
160
- return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), h("zonos-link-authentication", { defaultEmail: (_a = this.defaultAddress) === null || _a === void 0 ? void 0 : _a.email, titleText: translate('Contact') }), h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Address'), type: "shipping" }), h("zonos-checkbox", { class: "zonos--shipping-same-as-billing-cbx", isChecked: stripeStore.stripeShippingSameAsBilling, label: translate('Shipping address same as billing'), onCheckboxSelected: e => {
174
+ return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), h("zonos-link-authentication", { defaultEmail: (_b = this.defaultAddress) === null || _b === void 0 ? void 0 : _b.email, titleText: translate('Contact') }), h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Address'), type: "shipping" }), h("zonos-checkbox", { class: "zonos--shipping-same-as-billing-cbx", isChecked: stripeStore.stripeShippingSameAsBilling, label: translate('Shipping address same as billing'), onCheckboxSelected: e => {
161
175
  stripeStore.stripeShippingSameAsBilling = e.detail;
162
176
  } }), h("zonos-collapse", { collapsed: !showBilling }, h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Billing address'), type: "billing" })), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
163
177
  // use primary type when on mobile mode
@@ -288,6 +302,8 @@ export class ZonosCustomerInfo {
288
302
  static get states() {
289
303
  return {
290
304
  "showErrorBanner": {},
305
+ "shippingCountry": {},
306
+ "isCheckingForRestrictedItems": {},
291
307
  "isValidatingAddress": {},
292
308
  "invalidShippingCharacterList": {},
293
309
  "invalidBillingCharacterList": {},
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { cartStore } from "../../../store/checkout/cart";
2
+ import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout/cart";
3
3
  import { translate } from "../../../store/translationStore";
4
4
  import { zonosStore } from "../../../store/zonosStore";
5
5
  import { isCheckoutMobile } from "../../../utils/checkout/isCheckoutMobile";
@@ -23,6 +23,7 @@ export class ZonosReview {
23
23
  this.isMobile = isCheckoutMobile(this.mobile);
24
24
  }
25
25
  render() {
26
+ const total = cartStoreHasOneEligibleItem() ? cartStore.total : 0;
26
27
  const titleTextType = this.isMobile ? 'boldSubheader' : 'semiBoldLabel';
27
28
  const totalTextType = this.isMobile
28
29
  ? 'boldSubheader'
@@ -42,7 +43,7 @@ export class ZonosReview {
42
43
  'zonos--review zonos--elements',
43
44
  this.isMobile && 'mobile',
44
45
  ]) }, h("div", { class: "zonos--title" }, h("zonos-text", { textColor: titleTextColor, type: titleTextType }, translate('Pay'), " ", zonosStore.organizationName), renderCollapseIcon()), h("div", { class: "zonos--total-pay" }, h("zonos-text", { type: totalTextType }, formatCurrency({
45
- amount: cartStore.total,
46
+ amount: total,
46
47
  currency: cartStore.currency,
47
48
  })))));
48
49
  }
@@ -73,6 +73,18 @@
73
73
  margin: 1px;
74
74
  /** Button size */
75
75
  }
76
+ :host button:not([disabled]):hover {
77
+ background-image: var(--zonos-elements-button-standard-hover);
78
+ }
79
+ :host button:not([disabled]):active {
80
+ background: var(--zonos-elements-gray-700);
81
+ }
82
+ :host button:not([disabled]):focus {
83
+ box-shadow: var(--zonos-elements-focus-button);
84
+ }
85
+ :host button.with-box-shadow {
86
+ box-shadow: var(--zonos-elements-shadow-button-standard);
87
+ }
76
88
  :host button.sm.no-background, :host button.md.no-background, :host button.lg.no-background {
77
89
  background: none;
78
90
  outline: none;
@@ -14,6 +14,7 @@ export class ZonosButton {
14
14
  this.handleSlotChange = () => {
15
15
  this.hasContent = true;
16
16
  };
17
+ this.getColorVarProperty = (color) => color.replace('var(', '').replace(')', '');
17
18
  this.buttonColor = undefined;
18
19
  this.backgroundColor = undefined;
19
20
  this.borderStyle = undefined;
@@ -23,6 +24,7 @@ export class ZonosButton {
23
24
  this.size = 'sm';
24
25
  this.variant = 'standard';
25
26
  this.noBackground = false;
27
+ this.withBoxShadow = false;
26
28
  this.noPaddingLeft = false;
27
29
  this.noPaddingRight = false;
28
30
  this.loading = false;
@@ -52,15 +54,22 @@ export class ZonosButton {
52
54
  * So need to re-assign the variant prop with the default value if the value is `undefined` here.
53
55
  */
54
56
  const variant = this.variant || 'standard';
57
+ // use the variable if it's a color variable, otherwise use the color
58
+ const backgroundColor = this.backgroundColor && isColorVariable(this.backgroundColor)
59
+ ? `var(--zonos-elements-${this.backgroundColor})`
60
+ : this.backgroundColor;
55
61
  // use override background if it exists, otherwise use color from setting
56
- const overrideBackground = this.backgroundColor || zonosStore.appearance.colorSecondary;
62
+ const overrideBackground = backgroundColor || zonosStore.appearance.colorSecondary;
57
63
  // only set theme for button to change text color if variant is standard and override background is set
58
64
  const buttonTheme = variant === 'standard' ? getButtonTheme(overrideBackground) : undefined;
59
65
  const borderStyle = getBorderRadius({
60
66
  overrideBorderStyle: this.borderStyle,
61
67
  });
62
- const backgroundActualColor = isColorVariable(overrideBackground) && overrideBackground
63
- ? window.getComputedStyle(this.ele).getPropertyValue(overrideBackground)
68
+ const backgroundActualColor = overrideBackground &&
69
+ isColorVariable(this.getColorVarProperty(overrideBackground))
70
+ ? window
71
+ .getComputedStyle(this.ele)
72
+ .getPropertyValue(this.getColorVarProperty(overrideBackground))
64
73
  : overrideBackground;
65
74
  // use the variable if it's a color variable, otherwise use the color
66
75
  const color = this.buttonColor && isColorVariable(this.buttonColor)
@@ -75,28 +84,30 @@ export class ZonosButton {
75
84
  const spinnerColor = backgroundActualColor && isDarkColor(backgroundActualColor)
76
85
  ? 'white'
77
86
  : 'black';
78
- return (h(Host, { key: 'f5fd039f9ceeacae2448a09228bacc1bd6476be7', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
87
+ return (h(Host, { key: '6e361b1a80fd43a72a99a8201ca5d7cb86404656', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
79
88
  '--background-color': overrideBackground,
80
89
  '--border-radius': borderStyle,
81
90
  '--color': contrastColor,
82
91
  '--font-family': zonosStoreFontFamily(),
83
- }) }, h("button", { key: 'bcd3c7bf52464dd1e7485cdac6b0e3defbf63af3', class: classes([
92
+ }) }, h("button", { key: 'fd4335b2d9bfe74b509f1355fa620dc4c53f58c6', class: classes([
84
93
  this.hasIcon && 'has-icon',
85
94
  this.hasContent && 'has-content',
86
95
  this.noBackground && 'no-background',
87
96
  this.noPaddingLeft && 'no-padding-left',
88
97
  this.noPaddingRight && 'no-padding-right',
89
98
  this.iconRight && 'icon-right',
99
+ this.withBoxShadow && 'with-box-shadow',
90
100
  variant,
91
101
  this.size,
92
102
  // only override background if variant is set to standard
93
103
  overrideBackground &&
94
104
  variant === 'standard' &&
95
105
  'override-background',
96
- ]), disabled: disabled }, this.loading && (h("div", { key: 'ea73d8c4b4973f3a8ed6e5b85c2236c0f20b4c6f', class: "zonos--spinner-wrapper" }, h("zonos-spinner", { key: 'cdbe444e0aee0e64facd757a1b5ebd74208359e0', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: 'e7a46cced38d7916873e5dea8aff4c33e137cdf6', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
106
+ ]), disabled: disabled }, this.loading && (h("div", { key: '7b37a1d30604de0d9e1f5d07bf6034724dcd8875', class: "zonos--spinner-wrapper" }, h("zonos-spinner", { key: 'e4e3cbda9ae02c2ac9a7c17767bda93076ea67ad', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: 'e9b7287f2c4d9143f04103fe43d3f4dfd669341e', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
97
107
  }
98
108
  static get is() { return "zonos-button"; }
99
109
  static get encapsulation() { return "shadow"; }
110
+ static get delegatesFocus() { return true; }
100
111
  static get originalStyleUrls() {
101
112
  return {
102
113
  "$": ["zonos-button.scss"]
@@ -288,8 +299,14 @@ export class ZonosButton {
288
299
  "required": false,
289
300
  "optional": false,
290
301
  "docs": {
291
- "tags": [],
292
- "text": "The variance of the button\n**NOTE**: If the button `variant` is set to 'standard', backgroundColor will be disregarded"
302
+ "tags": [{
303
+ "name": "note",
304
+ "text": "If the button `variant` is set to 'standard', backgroundColor will be disregarded"
305
+ }, {
306
+ "name": "default",
307
+ "text": "standard"
308
+ }],
309
+ "text": "The variance of the button"
293
310
  },
294
311
  "attribute": "variant",
295
312
  "reflect": false,
@@ -316,6 +333,24 @@ export class ZonosButton {
316
333
  "reflect": false,
317
334
  "defaultValue": "false"
318
335
  },
336
+ "withBoxShadow": {
337
+ "type": "boolean",
338
+ "mutable": false,
339
+ "complexType": {
340
+ "original": "boolean",
341
+ "resolved": "boolean",
342
+ "references": {}
343
+ },
344
+ "required": false,
345
+ "optional": false,
346
+ "docs": {
347
+ "tags": [],
348
+ "text": "Whether or not the button has a box shadow"
349
+ },
350
+ "attribute": "with-box-shadow",
351
+ "reflect": false,
352
+ "defaultValue": "false"
353
+ },
319
354
  "noPaddingLeft": {
320
355
  "type": "boolean",
321
356
  "mutable": false,
@@ -0,0 +1,4 @@
1
+ <svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">
2
+ <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>
3
+ <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">
2
+ <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>
3
+ <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">
2
+ <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>
3
+ <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>
4
+ </svg>
@@ -0,0 +1,125 @@
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 .zonos--backdrop,
35
+ :host .zonos--confirm-layout {
36
+ opacity: 0;
37
+ z-index: -999;
38
+ visibility: hidden;
39
+ transition: opacity 0.3s, visibility 0.3s;
40
+ }
41
+ :host .zonos--backdrop {
42
+ width: 100vw;
43
+ height: 100vh;
44
+ left: 0;
45
+ top: 0;
46
+ background: var(--zonos-elements-backdrop-color);
47
+ position: fixed;
48
+ }
49
+ :host .zonos--confirm-layout {
50
+ width: 100vw;
51
+ height: 100vh;
52
+ left: 0;
53
+ top: 0;
54
+ position: fixed;
55
+ display: flex;
56
+ justify-content: center;
57
+ align-items: center;
58
+ color: var(--zonos-elements-text-color);
59
+ }
60
+ :host .zonos--confirm-dialog {
61
+ position: relative;
62
+ background: var(--zonos-elements-gray-0);
63
+ max-width: 90vw;
64
+ max-height: 90vh;
65
+ width: 350px;
66
+ border-radius: var(--border-radius, 10px);
67
+ outline: none;
68
+ box-shadow: var(--zonos-elements-v3-shadow-xxl);
69
+ border: var(--zonos-elements-border);
70
+ display: flex;
71
+ flex-direction: column;
72
+ }
73
+ :host .wrapper {
74
+ display: flex;
75
+ flex-direction: column;
76
+ align-items: center;
77
+ justify-content: center;
78
+ padding: 24px;
79
+ gap: 24px;
80
+ }
81
+ :host .icon-wrapper {
82
+ display: inline-flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ height: 40px;
86
+ width: 40px;
87
+ border-radius: 50%;
88
+ background: var(--zonos-elements-blue-100);
89
+ }
90
+ :host .warn .icon-wrapper {
91
+ background: var(--zonos-elements-orange-100);
92
+ }
93
+ :host .danger .icon-wrapper {
94
+ background: var(--zonos-elements-red-100);
95
+ }
96
+ :host .footer {
97
+ display: flex;
98
+ width: 100%;
99
+ gap: 8px;
100
+ }
101
+ :host .footer zonos-button {
102
+ flex: 1;
103
+ }
104
+ :host .content {
105
+ display: flex;
106
+ gap: 8px;
107
+ flex-direction: column;
108
+ }
109
+ :host .content zonos-text {
110
+ text-align: center;
111
+ }
112
+
113
+ :host(.open) .zonos--confirm-layout,
114
+ :host(.open) .zonos--backdrop {
115
+ visibility: visible;
116
+ }
117
+ :host(.open) .zonos--backdrop {
118
+ z-index: 10003;
119
+ opacity: 0.65;
120
+ }
121
+ :host(.open) .zonos--confirm-layout {
122
+ opacity: 1;
123
+ z-index: 10004;
124
+ transform: scale(1);
125
+ }