@zonos/elements 1.3.157 → 1.3.159

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 (226) hide show
  1. package/dist/cjs/{cart-79deb872.js → cart-d9aa5af3.js} +287 -4
  2. package/dist/cjs/{getBorderRadius-d3032bda.js → getBorderRadius-d184b623.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{isDarkColor-9f6c3601.js → isDarkColor-08d92ed7.js} +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{paypal-e79ca280.js → paypal-9908b383.js} +3 -3
  7. package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
  8. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-button_3.cjs.entry.js +9 -7
  11. package/dist/cjs/zonos-card.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +33 -15
  13. package/dist/cjs/zonos-checkout.cjs.entry.js +56 -6
  14. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-controller.cjs.entry.js +12 -7
  16. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
  17. package/dist/cjs/zonos-country-select_4.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-elements.cjs.js +1 -1
  19. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +5 -5
  20. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
  21. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  22. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  23. package/dist/cjs/zonos-language-select_2.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-toggle.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  29. package/dist/cjs/{zonosStore-0b1d27df.js → zonosStore-7975e4b6.js} +4 -0
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -3
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +24 -5
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +54 -2
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +1 -1
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
  35. package/dist/collection/components/common/zonos-button/zonos-button.css +3 -9
  36. package/dist/collection/components/common/zonos-button/zonos-button.js +25 -3
  37. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +2 -2
  38. package/dist/collection/components/main/zonos-controller.js +8 -3
  39. package/dist/collection/components/store/checkout/cart.js +13 -1
  40. package/dist/collection/components/store/checkout/stripe.js +32 -1
  41. package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
  42. package/dist/collection/components/store/translationStore/strings.base.js +12 -0
  43. package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
  44. package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
  45. package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
  46. package/dist/collection/components/store/translationStore/strings.french.js +12 -0
  47. package/dist/collection/components/store/translationStore/strings.german.js +12 -0
  48. package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
  49. package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
  50. package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
  51. package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
  52. package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
  53. package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
  54. package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
  55. package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
  56. package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
  57. package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
  58. package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
  59. package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
  60. package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
  61. package/dist/collection/components/store/zonosStore.js +4 -0
  62. package/dist/collection/types/generated/graphql.internal.types.js +70 -4
  63. package/dist/collection/types/index.js +1 -0
  64. package/dist/collection/types/utils/ZonosSettings.js +1 -0
  65. package/dist/esm/{cart-aee97bf4.js → cart-8afb3277.js} +287 -5
  66. package/dist/esm/{getBorderRadius-9e3ea1de.js → getBorderRadius-740610fb.js} +1 -1
  67. package/dist/esm/index.js +7 -7
  68. package/dist/esm/{isDarkColor-95f3ef90.js → isDarkColor-2f59d721.js} +1 -1
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/esm/{paypal-4ed46f2f.js → paypal-02c4e5d3.js} +3 -3
  71. package/dist/esm/zonos-address_8.entry.js +4 -4
  72. package/dist/esm/zonos-badge.entry.js +1 -1
  73. package/dist/esm/zonos-banner.entry.js +1 -1
  74. package/dist/esm/zonos-button_3.entry.js +9 -7
  75. package/dist/esm/zonos-card.entry.js +2 -2
  76. package/dist/esm/zonos-cart-items_13.entry.js +33 -15
  77. package/dist/esm/zonos-checkout.entry.js +56 -6
  78. package/dist/esm/zonos-collapse.entry.js +1 -1
  79. package/dist/esm/zonos-controller.entry.js +12 -7
  80. package/dist/esm/zonos-country-flag.entry.js +4 -4
  81. package/dist/esm/zonos-country-select_4.entry.js +4 -4
  82. package/dist/esm/zonos-elements.js +1 -1
  83. package/dist/esm/zonos-empty-state-payment_4.entry.js +5 -5
  84. package/dist/esm/zonos-hello-dialog.entry.js +4 -4
  85. package/dist/esm/zonos-hello.entry.js +4 -4
  86. package/dist/esm/zonos-input.entry.js +2 -2
  87. package/dist/esm/zonos-language-select_2.entry.js +4 -4
  88. package/dist/esm/zonos-logo.entry.js +1 -1
  89. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  90. package/dist/esm/zonos-text.entry.js +1 -1
  91. package/dist/esm/zonos-toggle.entry.js +1 -1
  92. package/dist/esm/zonos-v-stack.entry.js +1 -1
  93. package/dist/esm/{zonosStore-82bb17e6.js → zonosStore-71d7e02f.js} +4 -0
  94. package/dist/esm-es5/cart-8afb3277.js +1 -0
  95. package/dist/esm-es5/{getBorderRadius-9e3ea1de.js → getBorderRadius-740610fb.js} +1 -1
  96. package/dist/esm-es5/index.js +1 -1
  97. package/dist/esm-es5/{isDarkColor-95f3ef90.js → isDarkColor-2f59d721.js} +1 -1
  98. package/dist/esm-es5/loader.js +1 -1
  99. package/dist/esm-es5/{paypal-4ed46f2f.js → paypal-02c4e5d3.js} +1 -1
  100. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  101. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  102. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  103. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  104. package/dist/esm-es5/zonos-card.entry.js +1 -1
  105. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  106. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  107. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  108. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  109. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  110. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  111. package/dist/esm-es5/zonos-elements.js +1 -1
  112. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  113. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  114. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  115. package/dist/esm-es5/zonos-input.entry.js +1 -1
  116. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  117. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  118. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  119. package/dist/esm-es5/zonos-text.entry.js +1 -1
  120. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  121. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  122. package/dist/esm-es5/{zonosStore-82bb17e6.js → zonosStore-71d7e02f.js} +1 -1
  123. package/dist/scripts/index.d.ts +665 -644
  124. package/dist/scripts/index.js +1 -1
  125. package/dist/scripts/loadZonos.js +1 -1
  126. package/dist/scripts/zonos.js +1 -1
  127. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +5 -0
  128. package/dist/types/components/common/zonos-button/zonos-button.d.ts +4 -0
  129. package/dist/types/components/store/checkout/stripe.d.ts +9 -2
  130. package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
  131. package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
  132. package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
  133. package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
  134. package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
  135. package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
  136. package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
  137. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
  138. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
  139. package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
  140. package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
  141. package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
  142. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
  143. package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
  144. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
  145. package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
  146. package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
  147. package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
  148. package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
  149. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
  150. package/dist/types/components/store/zonosStore.d.ts +4 -2
  151. package/dist/types/components/utils/api/getZonosSettings.d.ts +3 -3
  152. package/dist/types/components.d.ts +8 -0
  153. package/dist/types/types/checkout/CheckoutConfig.d.ts +6 -1
  154. package/dist/types/types/checkout/api/CheckoutSession.d.ts +6 -1
  155. package/dist/types/types/generated/graphql.internal.types.d.ts +109 -16
  156. package/dist/types/types/generated/graphql.internal.types.ts +147 -21
  157. package/dist/types/types/index.d.ts +1 -0
  158. package/dist/types/types/utils/ZonosSettings.d.ts +10 -0
  159. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  160. package/dist/zonos-elements/index.esm.js +1 -1
  161. package/dist/zonos-elements/{p-194bb37a.system.entry.js → p-04122105.system.entry.js} +1 -1
  162. package/dist/zonos-elements/{p-c071a4ca.entry.js → p-047b3313.entry.js} +1 -1
  163. package/dist/zonos-elements/p-062c81c9.js +1 -0
  164. package/dist/zonos-elements/{p-822600bd.entry.js → p-073bc210.entry.js} +1 -1
  165. package/dist/zonos-elements/{p-5e867a64.system.entry.js → p-09e4f412.system.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-9c845327.system.entry.js → p-0b178c5a.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-30852c16.system.entry.js → p-0febd074.system.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-77026d4a.entry.js → p-1570b95c.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-88fc9989.entry.js → p-15971b78.entry.js} +1 -1
  170. package/dist/zonos-elements/{p-28c3f736.system.entry.js → p-1f720612.system.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-75311708.system.entry.js → p-20ca31fd.system.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-2297c165.system.js → p-3a531aec.system.js} +1 -1
  173. package/dist/zonos-elements/{p-5892ce43.system.js → p-3e6e4646.system.js} +1 -1
  174. package/dist/zonos-elements/{p-7fe8c97d.entry.js → p-417b2afd.entry.js} +1 -1
  175. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  176. package/dist/zonos-elements/{p-78ea3d1e.system.entry.js → p-57281d6c.system.entry.js} +1 -1
  177. package/dist/zonos-elements/{p-c8fa08b8.entry.js → p-6549915d.entry.js} +1 -1
  178. package/dist/zonos-elements/p-6658cc02.system.js +1 -0
  179. package/dist/zonos-elements/{p-9fcf4d8c.js → p-672707ce.js} +1 -1
  180. package/dist/zonos-elements/{p-eefadc0d.system.entry.js → p-6b8b5fc5.system.entry.js} +1 -1
  181. package/dist/zonos-elements/{p-683d1598.entry.js → p-72319b4d.entry.js} +1 -1
  182. package/dist/zonos-elements/{p-d3be144d.entry.js → p-73e9a8f5.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-3cbac6c3.system.entry.js → p-748c7aca.system.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-bd1a2003.entry.js → p-75a8e67d.entry.js} +1 -1
  185. package/dist/zonos-elements/p-77581c1c.entry.js +1 -0
  186. package/dist/zonos-elements/{p-e1e17979.entry.js → p-7c028742.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-75b44616.entry.js → p-8213ee19.entry.js} +1 -1
  188. package/dist/zonos-elements/p-82166888.system.entry.js +1 -0
  189. package/dist/zonos-elements/{p-1262ad56.entry.js → p-83645bb4.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-5f761f09.system.entry.js → p-85235fa0.system.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-b4d04d26.system.entry.js → p-8addb07b.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-4bbf8931.entry.js → p-8f4bf7e6.entry.js} +1 -1
  193. package/dist/zonos-elements/p-98d0ff1b.system.entry.js +1 -0
  194. package/dist/zonos-elements/{p-86da894d.js → p-98e9c9cf.js} +1 -1
  195. package/dist/zonos-elements/{p-5b6c5d04.js → p-a349636e.js} +2 -2
  196. package/dist/zonos-elements/{p-baa22bb3.entry.js → p-a62d60d1.entry.js} +1 -1
  197. package/dist/zonos-elements/p-a9a95fae.system.js +1 -0
  198. package/dist/zonos-elements/{p-3a3a2f51.system.entry.js → p-aa5e39e8.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-da404f8f.entry.js → p-acabfba5.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-84f71520.system.entry.js → p-aced2fc6.system.entry.js} +1 -1
  201. package/dist/zonos-elements/p-b336b4ec.entry.js +1 -0
  202. package/dist/zonos-elements/{p-972261dc.system.js → p-b6fdbbf4.system.js} +1 -1
  203. package/dist/zonos-elements/{p-84b2efef.entry.js → p-c1f1818a.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-d3a452d4.system.entry.js → p-c5808c2d.system.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-c901ef48.system.entry.js → p-c7219337.system.entry.js} +1 -1
  206. package/dist/zonos-elements/p-d696a3c2.system.js +1 -0
  207. package/dist/zonos-elements/{p-c285d20c.js → p-dd999b44.js} +1 -1
  208. package/dist/zonos-elements/{p-e47ed595.entry.js → p-de23f355.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-38967d3a.system.entry.js → p-e174b37b.system.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-2c45f733.system.entry.js → p-eb5835d1.system.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-7448f4a6.system.entry.js → p-ed74742d.system.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-673d24f9.system.entry.js → p-f84593ad.system.entry.js} +1 -1
  213. package/dist/zonos-elements/p-f9789c28.entry.js +1 -0
  214. package/dist/zonos-elements/{p-0160281f.entry.js → p-fa15b9b5.entry.js} +1 -1
  215. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  216. package/package.json +1 -1
  217. package/dist/esm-es5/cart-aee97bf4.js +0 -1
  218. package/dist/zonos-elements/p-130a047c.entry.js +0 -1
  219. package/dist/zonos-elements/p-13579dba.entry.js +0 -1
  220. package/dist/zonos-elements/p-43b922bf.js +0 -1
  221. package/dist/zonos-elements/p-532afee0.system.js +0 -1
  222. package/dist/zonos-elements/p-6d7dc2a2.system.entry.js +0 -1
  223. package/dist/zonos-elements/p-bba01622.system.js +0 -1
  224. package/dist/zonos-elements/p-d1a57d82.system.entry.js +0 -1
  225. package/dist/zonos-elements/p-e477f1b1.entry.js +0 -1
  226. package/dist/zonos-elements/p-fb2a884f.system.js +0 -1
@@ -3,11 +3,95 @@ import { StripeConstructor, StripeAddressElementChangeEvent, ContactOption, Paym
3
3
  import { z } from 'zod';
4
4
  import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
5
5
 
6
+ type CustomEventMap = {
7
+ legacyCheckoutError: string;
8
+ 'zonos-checkout-success': {
9
+ message: string;
10
+ };
11
+ };
12
+
13
+ declare const _envClientSchema: z.ZodObject<{
14
+ NEXT_PUBLIC_FLAG_URL: z.ZodString;
15
+ NEXT_PUBLIC_RELEASE_DATE: z.ZodString;
16
+ NEXT_PUBLIC_ZONOS_API_KEY: z.ZodString;
17
+ NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: z.ZodString;
18
+ NEXT_PUBLIC_ZONOS_CDN_URL: z.ZodString;
19
+ NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: z.ZodString;
20
+ NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.ZodString;
21
+ NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.ZodString;
22
+ NEXT_PUBLIC_ZONOS_ROUTE_URL: z.ZodString;
23
+ NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ NEXT_PUBLIC_FLAG_URL: string;
26
+ NEXT_PUBLIC_RELEASE_DATE: string;
27
+ NEXT_PUBLIC_ZONOS_API_KEY: string;
28
+ NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
29
+ NEXT_PUBLIC_ZONOS_CDN_URL: string;
30
+ NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
31
+ NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
32
+ NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
33
+ NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
34
+ NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
35
+ }, {
36
+ NEXT_PUBLIC_FLAG_URL: string;
37
+ NEXT_PUBLIC_RELEASE_DATE: string;
38
+ NEXT_PUBLIC_ZONOS_API_KEY: string;
39
+ NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
40
+ NEXT_PUBLIC_ZONOS_CDN_URL: string;
41
+ NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
42
+ NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
43
+ NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
44
+ NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
45
+ NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
46
+ }>;
47
+ interface Env extends z.infer<typeof _envClientSchema> {
48
+ }
49
+
50
+ /* eslint-disable no-relative-import-paths/no-relative-import-paths */
51
+
52
+ declare global {
53
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
54
+ interface Document {
55
+ addEventListener<K extends keyof CustomEventMap>(
56
+ type: K,
57
+ listener: (this: Document, ev: CustomEvent<CustomEventMap[K]>) => void,
58
+ ): void;
59
+ }
60
+
61
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
62
+ interface Window {
63
+ Stripe?: StripeConstructor;
64
+ Zonos: Zonos;
65
+ /**
66
+ * A flag to determine if the current page is a BigCommerce page
67
+ */
68
+ bcConfig?: unknown;
69
+ /**
70
+ * This flag would be set to true if zonosQaUrl is present in the query params and preview script loadZonos.js is injected to DOM
71
+ */
72
+ isZonosPreview?: boolean;
73
+ /**
74
+ * A flag to determine if the current page is a BigCommerce page
75
+ */
76
+ stencilBootstrap?: unknown;
77
+ }
78
+
79
+ namespace NodeJS {
80
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
81
+ interface ProcessEnv extends Env {}
82
+ }
83
+ }
84
+
6
85
  declare const adjustmentSource: {
7
86
  readonly ApiRequest: "API_REQUEST";
8
87
  readonly PromoCode: "PROMO_CODE";
9
88
  };
10
89
  type AdjustmentSource = (typeof adjustmentSource)[keyof typeof adjustmentSource];
90
+ declare const allowedSettlementCurrencies: {
91
+ readonly Local: "LOCAL";
92
+ readonly LocalAndUsd: "LOCAL_AND_USD";
93
+ };
94
+ type AllowedSettlementCurrencies = (typeof allowedSettlementCurrencies)[keyof typeof allowedSettlementCurrencies];
11
95
  declare const analyticsProviderStatus: {
12
96
  readonly Disabled: "DISABLED";
13
97
  readonly Enabled: "ENABLED";
@@ -724,7 +808,10 @@ type CalculateLandedCostMutation = {
724
808
  }>;
725
809
  landedCostCalculateWorkflow: Array<{
726
810
  amountSubtotals: {
811
+ discounts: number | null;
812
+ items: number;
727
813
  landedCostTotal: number;
814
+ shipping: number;
728
815
  } | null;
729
816
  appliedAdjustments: Array<{
730
817
  adjustment: {
@@ -957,6 +1044,153 @@ type GetOrderQuery = {
957
1044
  } | null;
958
1045
  };
959
1046
 
1047
+ type TranslatedText = {
1048
+ [key: string]: string;
1049
+ };
1050
+ type EnteredInfo = {
1051
+ city: string;
1052
+ country: CountryCode;
1053
+ email: string;
1054
+ line1: string;
1055
+ line2: string;
1056
+ name: string;
1057
+ phone: string;
1058
+ postal_code: string;
1059
+ state: string;
1060
+ };
1061
+ type ValidateAddressFields = Omit<StripeAddressElementChangeEvent['value']['address'], 'country'> & {
1062
+ name: string;
1063
+ };
1064
+ type TranslatedAddressObject = {
1065
+ [key in keyof ValidateAddressFields]?: TranslatedText;
1066
+ };
1067
+
1068
+ type SubmitEventData = {
1069
+ billingAddress: Record<keyof TranslatedAddressObject, string> | null;
1070
+ shippingAddress: Record<keyof TranslatedAddressObject, string>;
1071
+ };
1072
+
1073
+ declare const colorPrefixes: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray", "glass"];
1074
+ declare const colorContrasts: readonly ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
1075
+ type ColorContrast = (typeof colorContrasts)[number];
1076
+ type ColorPrefix = (typeof colorPrefixes)[number];
1077
+ type Color = 'gray-0' | 'gray-50' | 'glass-0' | 'glass-50' | `${ColorPrefix}-${ColorContrast}` | 'gray-1000' | 'glass-1100' | 'glass-1200';
1078
+ declare const checkboxColorPrefix: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray"];
1079
+ type CheckboxColorPrefix = (typeof checkboxColorPrefix)[number];
1080
+
1081
+ type BannerIntent = 'default' | 'error' | 'success' | 'warning' | 'info';
1082
+
1083
+ declare const textOptions: {
1084
+ readonly pageHeader: {
1085
+ readonly label: "Page Header (3XL) · 34px (2.125rem)";
1086
+ readonly size: "3xl";
1087
+ readonly tag: "h2";
1088
+ readonly weight: 900;
1089
+ };
1090
+ readonly secondaryPageHeader: {
1091
+ readonly label: "Secondary Page Header (3XL) • 34px, 500 \"Medium\"";
1092
+ readonly size: "3xl";
1093
+ readonly tag: "h2";
1094
+ readonly weight: 500;
1095
+ };
1096
+ readonly header: {
1097
+ readonly label: "Header (2XL) · 28px (1.75rem)";
1098
+ readonly size: "2xl";
1099
+ readonly tag: "h3";
1100
+ readonly weight: 700;
1101
+ };
1102
+ readonly descriptionHeader: {
1103
+ readonly label: "Description Header (2XL) · 28px (1.75rem)";
1104
+ readonly size: "2xl";
1105
+ readonly tag: "h3";
1106
+ readonly weight: 700;
1107
+ };
1108
+ readonly title: {
1109
+ readonly label: "Title (XL) • 22px (1.375rem)";
1110
+ readonly size: "xl";
1111
+ readonly tag: "h4";
1112
+ readonly weight: 600;
1113
+ };
1114
+ readonly boldSubheader: {
1115
+ readonly label: "Bold Subheader (L) • 18px (1.125rem)";
1116
+ readonly size: "l";
1117
+ readonly tag: "h5";
1118
+ readonly weight: 700;
1119
+ };
1120
+ readonly semiBoldSubheader: {
1121
+ readonly label: "Semi Bold Subheader (L / H4) • 18px (1.125rem)";
1122
+ readonly size: "l";
1123
+ readonly tag: "h5";
1124
+ readonly weight: 600;
1125
+ };
1126
+ readonly subheader: {
1127
+ readonly label: "Subheader (L) • 18px (1.125rem)";
1128
+ readonly size: "l";
1129
+ readonly tag: "h5";
1130
+ readonly weight: 500;
1131
+ };
1132
+ readonly boldLabel: {
1133
+ readonly label: "Bold Label (Base) • 14px (.875rem)";
1134
+ readonly size: "base";
1135
+ readonly tag: "span";
1136
+ readonly weight: 700;
1137
+ };
1138
+ readonly semiBoldLabel: {
1139
+ readonly label: "Semi Bold Label (Base) • 14px (.875rem)";
1140
+ readonly size: "base";
1141
+ readonly tag: "span";
1142
+ readonly weight: 600;
1143
+ };
1144
+ readonly label: {
1145
+ readonly label: "Label (Base) • 14px (.875rem)";
1146
+ readonly size: "base";
1147
+ readonly tag: "span";
1148
+ readonly weight: 500;
1149
+ };
1150
+ readonly body: {
1151
+ readonly label: "Body (Base) • 14px (.875rem)";
1152
+ readonly size: "base";
1153
+ readonly tag: "span";
1154
+ readonly weight: 400;
1155
+ };
1156
+ readonly smallHeader: {
1157
+ readonly label: "Small header (S) • 12px (.75rem)";
1158
+ readonly size: "s";
1159
+ readonly tag: "span";
1160
+ readonly weight: 600;
1161
+ };
1162
+ readonly caption: {
1163
+ readonly label: "Caption (S) • 12px (.75rem)";
1164
+ readonly size: "s";
1165
+ readonly tag: "span";
1166
+ readonly weight: 400;
1167
+ };
1168
+ readonly hintText: {
1169
+ readonly label: "Hint text (XS) • 10px (.625rem)";
1170
+ readonly size: "xs";
1171
+ readonly tag: "span";
1172
+ readonly weight: 400;
1173
+ };
1174
+ };
1175
+ type TextOptions = typeof textOptions;
1176
+ type Size = TextOptions[keyof TextOptions]['size'];
1177
+ type Type = keyof TextOptions;
1178
+ type FontWeight = TextOptions[keyof TextOptions]['weight'];
1179
+
1180
+ type StripeStoreContactOption = {
1181
+ address: {
1182
+ city: string;
1183
+ country: string;
1184
+ line1: string;
1185
+ line2?: string;
1186
+ postal_code: string;
1187
+ state: string;
1188
+ };
1189
+ email: string;
1190
+ name: string;
1191
+ phone?: string;
1192
+ };
1193
+
960
1194
  type TabItem = {
961
1195
  index: number;
962
1196
  isDone: boolean;
@@ -995,639 +1229,81 @@ type CartItem = {
995
1229
  sku?: string;
996
1230
  };
997
1231
 
998
- type CalculateLandedCostAdjustmentInput = {
999
- amount: number;
1000
- name?: string | null;
1001
- productId: string | null;
1002
- promoCode?: string | null;
1003
- sku: string | null;
1004
- type: LandedCostAdjustmentType;
1005
- };
1006
- type Extensions = {
1007
- [key: string]: unknown;
1008
- } & {
1009
- rule?: {
1010
- description: string;
1011
- id: string;
1012
- name: string;
1013
- };
1014
- ruleMessageType?: 'CUSTOM' | 'DEFAULT';
1015
- };
1016
- type ApiError = {
1017
- extensions?: Extensions | null;
1232
+ type NotificationInit = {
1018
1233
  message: string;
1019
- };
1020
- type CalculateLandedCostRequest = {
1021
- billingAddress: {
1022
- addressLine1: string;
1023
- addressLine2?: string | undefined;
1024
- city: string;
1025
- country: CountryCode;
1026
- postalCode: string;
1027
- state: string;
1028
- };
1029
- billingContact: {
1030
- firstName: string;
1031
- lastName: string;
1032
- phone: string;
1033
- };
1034
- checkoutSessionId: string;
1035
- contact: {
1036
- email?: string;
1037
- firstName: string;
1038
- lastName: string;
1039
- phone: string;
1040
- };
1041
1234
  /**
1042
- * When this is set, the created quote will not be shown on the Quote List page in the Zonos Dashboard.
1235
+ * Time in milliseconds
1236
+ * @default 4000
1043
1237
  */
1044
- isTest?: boolean;
1045
- items: CartItem[];
1046
- landedCostAdjustments?: CalculateLandedCostAdjustmentInput[];
1047
- metadata?: {
1048
- key: string;
1049
- value: string;
1050
- }[];
1238
+ timeout?: number;
1051
1239
  /**
1052
- * TaxId that the some destination countries require for the shipment.
1240
+ * Type of notification
1241
+ * @default 'success'
1053
1242
  */
1054
- shipToTaxId?: string;
1055
- shippingAddress: {
1056
- addressLine1: string;
1057
- addressLine2?: string | undefined;
1058
- city: string;
1059
- country: CountryCode;
1060
- postalCode: string;
1061
- state: string;
1062
- };
1243
+ type?: 'error' | 'success' | 'warning';
1063
1244
  };
1064
1245
 
1065
- type BuildLandedCostParams = {
1066
- billingAddress: CalculateLandedCostRequest['billingAddress'];
1067
- billingContact: CalculateLandedCostRequest['billingContact'];
1068
- checkoutSessionId: string;
1069
- contact: CalculateLandedCostRequest['contact'];
1070
- landedCostAdjustments?: CalculateLandedCostRequest['landedCostAdjustments'];
1071
- publicCredential: string;
1072
- shippingAddress: CalculateLandedCostRequest['shippingAddress'];
1073
- zonosApiRoute: string;
1246
+ declare const localeElementsSupportedLocationCodeEnum: {
1247
+ readonly Ar: "ar";
1248
+ readonly Da: "da";
1249
+ readonly De: "de";
1250
+ readonly En: "en";
1251
+ readonly Es: "es";
1252
+ readonly Fr: "fr";
1253
+ readonly He: "he";
1254
+ readonly Id: "id";
1255
+ readonly It: "it";
1256
+ readonly Ja: "ja";
1257
+ readonly Ko: "ko";
1258
+ readonly Nl: "nl";
1259
+ readonly No: "no";
1260
+ readonly Pl: "pl";
1261
+ readonly Pt: "pt";
1262
+ readonly Ru: "ru";
1263
+ readonly Sv: "sv";
1264
+ readonly Tr: "tr";
1265
+ readonly Vi: "vi";
1266
+ readonly Zh: "zh";
1074
1267
  };
1075
- type BuildLandedCostResponse = (CalculateLandedCostMutation & {
1076
- errors: ApiError[];
1077
- }) | null;
1268
+ type Locale_ElementsSupportedLocationCode_Enum = (typeof localeElementsSupportedLocationCodeEnum)[keyof typeof localeElementsSupportedLocationCodeEnum];
1078
1269
 
1079
- type ZonosOrder = GetOrderQuery['order'];
1270
+ type ICountry = {
1271
+ bigcommerceDisplayName?: string;
1272
+ code: CountryCode;
1273
+ currencyCode: string;
1274
+ displayName: string;
1275
+ languageCode: Locale_ElementsSupportedLocationCode_Enum;
1276
+ };
1277
+ type ICountryJson = {
1278
+ [countryCode: string]: ICountry;
1279
+ };
1080
1280
 
1081
- type BuildCardDetailParams = {
1082
- countryCode: CountryCode;
1083
- currencyCode: CurrencyCode;
1281
+ type Items = CheckItemRestrictionsMutation['itemRestrictionApply']['items'];
1282
+ type RestrictedItem = Items[number] & {
1283
+ name?: string;
1084
1284
  };
1085
- type PromiseOrValue<T> = T | Promise<T>;
1086
- type PrefillAddress = {
1087
- customerAddress1: string;
1088
- customerAddress2?: string;
1089
- customerCity?: string;
1090
- /**
1091
- * If country is not provided, it will try to pull from query params `zCountry` or `country` or `customerCountry` in the URL or fallback to user's selected country
1092
- */
1093
- customerCountry?: string;
1094
- customerEmail: string;
1095
- customerName: string;
1096
- customerPhone: string;
1097
- customerState?: string;
1098
- customerZip: string;
1285
+
1286
+ declare const restStateType: readonly ["Boxes", "Earth", "EmptyBox", "Lock", "PigBank", "Scribble", "Search", "Settings", "ShoppingCart", "SpilledCup", "Switch", "TaxId", "Truck", "Warning"];
1287
+ type RestStateType = (typeof restStateType)[number];
1288
+
1289
+ type ShippingRichRadioItem = {
1290
+ amount: number;
1291
+ caption?: string;
1292
+ label: string;
1293
+ landedCostId: string;
1294
+ method: IncotermCode;
1295
+ price: string;
1296
+ shipmentRatingId: string;
1297
+ sublabel?: string;
1298
+ value: string | number;
1099
1299
  };
1100
- type CreateCartIdObject = {
1101
- cartId: string;
1102
- shippingData?: PrefillAddress | null;
1103
- };
1104
- type CheckoutConfig = {
1105
- /**
1106
- * Validate address to allow specific character sets
1107
- * @default ALL
1108
- */
1109
- allowedCharacterSets?: 'ALL' | 'LATIN';
1110
- analyticsProviders: Array<{
1111
- status: AnalyticsProviderStatus;
1112
- type: AnalyticsProviderType;
1113
- }>;
1114
- /**
1115
- * Duration (in seconds) for which the cart remains valid for checkout in hosted checkout.
1116
- * @default 3_600 (1 hour)
1117
- */
1118
- defaultCartExpiration?: number;
1119
- /**
1120
- * @default false - when false, the place order button will be disabled until the script is loaded
1121
- * @note if set to true, the place order button will not be enabled or disabled
1122
- */
1123
- disablePlaceOrderButtonActivation?: boolean;
1124
- externalPaymentMethods: Array<{
1125
- status: ExternalPaymentMethodStatus;
1126
- type: ExternalPaymentMethodType;
1127
- }> | null;
1128
- externalServiceTokens: {
1129
- token: string;
1130
- type: ExternalServiceTokenType;
1131
- }[];
1132
- /**
1133
- * Test mode for checkout (sandbox or production)
1134
- * @default TEST
1135
- */
1136
- mode: Mode;
1137
- orderNotifications: {
1138
- abandonedCart: {
1139
- delay: number;
1140
- discountPercent: number;
1141
- status: {
1142
- active: NotificationActiveStatus;
1143
- sendCopiesTo: Array<string>;
1144
- };
1145
- };
1146
- orderCancelled: {
1147
- active: NotificationActiveStatus;
1148
- sendCopiesTo: Array<string>;
1149
- };
1150
- orderShipped: {
1151
- active: NotificationActiveStatus;
1152
- sendCopiesTo: Array<string>;
1153
- };
1154
- };
1155
- organization: string;
1156
- placeOrderButtonSelector: string | null;
1157
- /**
1158
- * @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
1159
- *
1160
- * **NOTE: this value can't be overridden in Zonos.init**
1161
- */
1162
- subscriptionStatus: CheckoutSubscriptionStatus;
1163
- successBehavior: CheckoutSuccessBehavior;
1164
- /**
1165
- * The success page action text for checkout.
1166
- * @note Default text supports translation automatically, but any custom text will not be translated.
1167
- */
1168
- successPageActionText?: string;
1169
- /**
1170
- * The success page subtitle text for checkout. Each item in the array will appear on a new line.
1171
- * @note Default text supports translation automatically, but any custom text will not be translated.
1172
- */
1173
- successPageSubtitleText?: string[];
1174
- /**
1175
- * The success page title text for checkout.
1176
- * @note Default text supports translation automatically, but any custom text will not be translated.
1177
- */
1178
- successPageTitleText?: string;
1179
- successRedirectUrl: string;
1180
- visibilityStatus: CheckoutVisibilityStatus;
1181
- /**
1182
- * Cart info callback for checkout (optional),
1183
- * @deprecated This is deprecated in favor of the new callback `createCartId`. The new API would only need the cart ID to retrieve cart data.
1184
- * @note will attempt to use cart data if available
1185
- * User can dispatch an event 'zonos--init-cart-info' to update the cart
1186
- * @example
1187
- * const initEvent = new CustomEvent<CartItem[]>('zonos--init-cart-info', {
1188
- * detail: cartItems,
1189
- * });
1190
- * document.body.dispatchEvent(initEvent);
1191
- * @returns {object[]} - object with the the item info to be added to cart:
1192
- * - amount: number;
1193
- * - countryOfOrigin?: string;
1194
- * - currencyCode: string;
1195
- * - description?: string;
1196
- * - hsCode?: string;
1197
- * - imageUrl?: string;
1198
- * - name: string;
1199
- * - productId?: string;
1200
- * - quantity: number;
1201
- */
1202
- buildCartDetail?: (params: BuildCardDetailParams) => Promise<CartItem[]>;
1203
- /**
1204
- * Calculate landed cost callback for checkout (optional)
1205
- * @deprecated This is deprecated in favor of the new callback `createCartId`. When using the new callback, the cart details will be retrieved using the cart ID, so this callback would no longer be needed.
1206
- * @note will attempt to use cart data if available
1207
- */
1208
- buildLandedCost?: (params: BuildLandedCostParams) => Promise<BuildLandedCostResponse>;
1209
- /**
1210
- * A callback that returns the cart id from `cartCreate` mutation. You would use your cart data to call the `cartCreate` mutation and return the cart ID that was created.
1211
- * @note
1212
- * The mutation `cartCreate` should be called on the server side
1213
- * @returns string - Cart ID
1214
- */
1215
- createCartId?: () => PromiseOrValue<string | CreateCartIdObject>;
1216
- /**
1217
- * Callback trigger when the checkout is closed
1218
- */
1219
- onClose?: () => void;
1220
- /**
1221
- * This callback is optional. If provided, it will be called right before the payment is processed.
1222
- * @param items - The cart items.
1223
- * @returns {string | null} - The error message to display to the user. If the message is empty or null, the payment will proceed.
1224
- * @example
1225
- * onInventoryCheck: async ({ items }) => {
1226
- * // Check if all items are available from the server. If the fetch is throwing an error, show a generic error message "Unable to check inventory. Please try again.".
1227
- * const itemsInfo = await fetch('https://yourserver.com/api/get-available-items', {
1228
- * method: 'POST',
1229
- * body: JSON.stringify({ items }),
1230
- * });
1231
- * const items = await itemsInfo.json();
1232
- * // Filter out unavailable items.
1233
- * const unavailableItems = items.filter(item => !item.available);
1234
- * if (unavailableItems.length) {
1235
- * // Display an error message to the user.
1236
- * return `The following items are not available: ${unavailableItems.map(item => item.name).join(', ')}`;
1237
- * }
1238
- * // Proceed with the payment if you return an empty string or null.
1239
- * return '';
1240
- * }
1241
- */
1242
- onInventoryCheck?: (params: {
1243
- items: CartItem[];
1244
- }) => Promise<string | null>;
1245
- /**
1246
- * Callback trigger when payment succeeds
1247
- */
1248
- onOrderSuccess?: (props: {
1249
- zonosApiRoute: string;
1250
- zonosOrder: ZonosOrder;
1251
- }) => Promise<void>;
1252
- };
1253
-
1254
- type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
1255
- type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
1256
- type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
1257
- type HelloConfig = {
1258
- anchorElementSelector: string;
1259
- cartUrlPattern: string | null;
1260
- /**
1261
- * The behavior to use when determining the country to use for the user.
1262
- * @default 'URL_PARAM'
1263
- */
1264
- countryOverrideBehavior?: CountryOverrideBehavior;
1265
- currencyBehavior: HelloCurrencyBehavior;
1266
- currencyElementSelector: string;
1267
- desktopLocation?: HelloMobileLocation | null;
1268
- excludedUrlPatterns: Array<string>;
1269
- homepageUrlPattern: string | null;
1270
- mobileLocation: HelloMobileLocation | null;
1271
- mode: Mode;
1272
- /**
1273
- * Position of floating hello if `anchorElementSelector` is not found after 3 seconds
1274
- *
1275
- * null: don't render if not found
1276
- *
1277
- * @default null
1278
- */
1279
- notFoundElementFallback: HelloMobileLocation | null;
1280
- organization: string;
1281
- peekMessageBehavior: HelloPeekMessageBehavior;
1282
- peekMessageDelay: number;
1283
- productAddToCartElementSelector: string | null;
1284
- productDescriptionElementSelector: string | null;
1285
- productDetailUrlPattern: string | null;
1286
- productListUrlPattern: string | null;
1287
- productTitleElementSelector: string | null;
1288
- restrictionBehavior: HelloRestrictionBehavior;
1289
- /**
1290
- * The countries to include in the country list dropdown of the Hello widget.
1291
- * @default ONLY_SHIPPABLE
1292
- */
1293
- showCountryList?: ShowCountryList;
1294
- /**
1295
- * The countries to show the widget for.
1296
- * @default ONLY_SHIPPABLE
1297
- */
1298
- showForCountries?: ShowForCountries;
1299
- visibilityStatus?: 'ENABLED' | 'DISABLED';
1300
- /**
1301
- * Callback function to run after the Hello widget has been initialized. This should be triggered only once when hello is attached to the DOM.
1302
- * **Note**: If hello is detached from the DOM and reattached, this callback will be called again.
1303
- * @param params - The parameters containing the country code and currency code that hello is initialized with.
1304
- */
1305
- onInitSuccess?: (params: {
1306
- countryCode: CountryCode;
1307
- currencyCode: CurrencyCode;
1308
- }) => Promise<void>;
1309
- };
1310
-
1311
- type AppearanceConfig = {
1312
- colorPrimary?: string;
1313
- colorSecondary?: string;
1314
- fontFamily: string;
1315
- fontSize2XL?: number;
1316
- fontSize3XL?: number;
1317
- fontSizeBase?: number;
1318
- fontSizeInputLabel?: number;
1319
- fontSizeInputValue?: number;
1320
- fontSizeL?: number;
1321
- fontSizeS?: number;
1322
- fontSizeXL?: number;
1323
- fontSizeXS?: number;
1324
- logoUrl: string;
1325
- style: ElementsUiStyle;
1326
- theme: ElementsUiTheme;
1327
- zonosAttribution: ZonosAttribution | null;
1328
- };
1329
-
1330
- type CustomEventMap = {
1331
- legacyCheckoutError: string;
1332
- 'zonos-checkout-success': {
1333
- message: string;
1334
- };
1335
- };
1336
-
1337
- declare const _envClientSchema: z.ZodObject<{
1338
- NEXT_PUBLIC_FLAG_URL: z.ZodString;
1339
- NEXT_PUBLIC_RELEASE_DATE: z.ZodString;
1340
- NEXT_PUBLIC_ZONOS_API_KEY: z.ZodString;
1341
- NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: z.ZodString;
1342
- NEXT_PUBLIC_ZONOS_CDN_URL: z.ZodString;
1343
- NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: z.ZodString;
1344
- NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.ZodString;
1345
- NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.ZodString;
1346
- NEXT_PUBLIC_ZONOS_ROUTE_URL: z.ZodString;
1347
- NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: z.ZodString;
1348
- }, "strip", z.ZodTypeAny, {
1349
- NEXT_PUBLIC_FLAG_URL: string;
1350
- NEXT_PUBLIC_RELEASE_DATE: string;
1351
- NEXT_PUBLIC_ZONOS_API_KEY: string;
1352
- NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
1353
- NEXT_PUBLIC_ZONOS_CDN_URL: string;
1354
- NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
1355
- NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
1356
- NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
1357
- NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
1358
- NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
1359
- }, {
1360
- NEXT_PUBLIC_FLAG_URL: string;
1361
- NEXT_PUBLIC_RELEASE_DATE: string;
1362
- NEXT_PUBLIC_ZONOS_API_KEY: string;
1363
- NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
1364
- NEXT_PUBLIC_ZONOS_CDN_URL: string;
1365
- NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
1366
- NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
1367
- NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
1368
- NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
1369
- NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
1370
- }>;
1371
- interface Env extends z.infer<typeof _envClientSchema> {
1372
- }
1373
-
1374
- /* eslint-disable no-relative-import-paths/no-relative-import-paths */
1375
-
1376
- declare global {
1377
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
1378
- interface Document {
1379
- addEventListener<K extends keyof CustomEventMap>(
1380
- type: K,
1381
- listener: (this: Document, ev: CustomEvent<CustomEventMap[K]>) => void,
1382
- ): void;
1383
- }
1384
-
1385
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
1386
- interface Window {
1387
- Stripe?: StripeConstructor;
1388
- Zonos: Zonos;
1389
- /**
1390
- * A flag to determine if the current page is a BigCommerce page
1391
- */
1392
- bcConfig?: unknown;
1393
- /**
1394
- * This flag would be set to true if zonosQaUrl is present in the query params and preview script loadZonos.js is injected to DOM
1395
- */
1396
- isZonosPreview?: boolean;
1397
- /**
1398
- * A flag to determine if the current page is a BigCommerce page
1399
- */
1400
- stencilBootstrap?: unknown;
1401
- }
1402
-
1403
- namespace NodeJS {
1404
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
1405
- interface ProcessEnv extends Env {}
1406
- }
1407
- }
1408
-
1409
- type TranslatedText = {
1410
- [key: string]: string;
1411
- };
1412
- type EnteredInfo = {
1413
- city: string;
1414
- country: CountryCode;
1415
- email: string;
1416
- line1: string;
1417
- line2: string;
1418
- name: string;
1419
- phone: string;
1420
- postal_code: string;
1421
- state: string;
1422
- };
1423
- type ValidateAddressFields = Omit<StripeAddressElementChangeEvent['value']['address'], 'country'> & {
1424
- name: string;
1425
- };
1426
- type TranslatedAddressObject = {
1427
- [key in keyof ValidateAddressFields]?: TranslatedText;
1428
- };
1429
-
1430
- type SubmitEventData = {
1431
- billingAddress: Record<keyof TranslatedAddressObject, string> | null;
1432
- shippingAddress: Record<keyof TranslatedAddressObject, string>;
1433
- };
1434
-
1435
- declare const colorPrefixes: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray", "glass"];
1436
- declare const colorContrasts: readonly ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
1437
- type ColorContrast = (typeof colorContrasts)[number];
1438
- type ColorPrefix = (typeof colorPrefixes)[number];
1439
- type Color = 'gray-0' | 'gray-50' | 'glass-0' | 'glass-50' | `${ColorPrefix}-${ColorContrast}` | 'gray-1000' | 'glass-1100' | 'glass-1200';
1440
- declare const checkboxColorPrefix: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray"];
1441
- type CheckboxColorPrefix = (typeof checkboxColorPrefix)[number];
1442
-
1443
- type BannerIntent = 'default' | 'error' | 'success' | 'warning' | 'info';
1444
-
1445
- declare const textOptions: {
1446
- readonly pageHeader: {
1447
- readonly label: "Page Header (3XL) · 34px (2.125rem)";
1448
- readonly size: "3xl";
1449
- readonly tag: "h2";
1450
- readonly weight: 900;
1451
- };
1452
- readonly secondaryPageHeader: {
1453
- readonly label: "Secondary Page Header (3XL) • 34px, 500 \"Medium\"";
1454
- readonly size: "3xl";
1455
- readonly tag: "h2";
1456
- readonly weight: 500;
1457
- };
1458
- readonly header: {
1459
- readonly label: "Header (2XL) · 28px (1.75rem)";
1460
- readonly size: "2xl";
1461
- readonly tag: "h3";
1462
- readonly weight: 700;
1463
- };
1464
- readonly descriptionHeader: {
1465
- readonly label: "Description Header (2XL) · 28px (1.75rem)";
1466
- readonly size: "2xl";
1467
- readonly tag: "h3";
1468
- readonly weight: 700;
1469
- };
1470
- readonly title: {
1471
- readonly label: "Title (XL) • 22px (1.375rem)";
1472
- readonly size: "xl";
1473
- readonly tag: "h4";
1474
- readonly weight: 600;
1475
- };
1476
- readonly boldSubheader: {
1477
- readonly label: "Bold Subheader (L) • 18px (1.125rem)";
1478
- readonly size: "l";
1479
- readonly tag: "h5";
1480
- readonly weight: 700;
1481
- };
1482
- readonly semiBoldSubheader: {
1483
- readonly label: "Semi Bold Subheader (L / H4) • 18px (1.125rem)";
1484
- readonly size: "l";
1485
- readonly tag: "h5";
1486
- readonly weight: 600;
1487
- };
1488
- readonly subheader: {
1489
- readonly label: "Subheader (L) • 18px (1.125rem)";
1490
- readonly size: "l";
1491
- readonly tag: "h5";
1492
- readonly weight: 500;
1493
- };
1494
- readonly boldLabel: {
1495
- readonly label: "Bold Label (Base) • 14px (.875rem)";
1496
- readonly size: "base";
1497
- readonly tag: "span";
1498
- readonly weight: 700;
1499
- };
1500
- readonly semiBoldLabel: {
1501
- readonly label: "Semi Bold Label (Base) • 14px (.875rem)";
1502
- readonly size: "base";
1503
- readonly tag: "span";
1504
- readonly weight: 600;
1505
- };
1506
- readonly label: {
1507
- readonly label: "Label (Base) • 14px (.875rem)";
1508
- readonly size: "base";
1509
- readonly tag: "span";
1510
- readonly weight: 500;
1511
- };
1512
- readonly body: {
1513
- readonly label: "Body (Base) • 14px (.875rem)";
1514
- readonly size: "base";
1515
- readonly tag: "span";
1516
- readonly weight: 400;
1517
- };
1518
- readonly smallHeader: {
1519
- readonly label: "Small header (S) • 12px (.75rem)";
1520
- readonly size: "s";
1521
- readonly tag: "span";
1522
- readonly weight: 600;
1523
- };
1524
- readonly caption: {
1525
- readonly label: "Caption (S) • 12px (.75rem)";
1526
- readonly size: "s";
1527
- readonly tag: "span";
1528
- readonly weight: 400;
1529
- };
1530
- readonly hintText: {
1531
- readonly label: "Hint text (XS) • 10px (.625rem)";
1532
- readonly size: "xs";
1533
- readonly tag: "span";
1534
- readonly weight: 400;
1535
- };
1536
- };
1537
- type TextOptions = typeof textOptions;
1538
- type Size = TextOptions[keyof TextOptions]['size'];
1539
- type Type = keyof TextOptions;
1540
- type FontWeight = TextOptions[keyof TextOptions]['weight'];
1541
-
1542
- type StripeStoreContactOption = {
1543
- address: {
1544
- city: string;
1545
- country: string;
1546
- line1: string;
1547
- line2?: string;
1548
- postal_code: string;
1549
- state: string;
1550
- };
1551
- email: string;
1552
- name: string;
1553
- phone?: string;
1554
- };
1555
-
1556
- type NotificationInit = {
1557
- message: string;
1558
- /**
1559
- * Time in milliseconds
1560
- * @default 4000
1561
- */
1562
- timeout?: number;
1563
- /**
1564
- * Type of notification
1565
- * @default 'success'
1566
- */
1567
- type?: 'error' | 'success' | 'warning';
1568
- };
1569
-
1570
- declare const localeElementsSupportedLocationCodeEnum: {
1571
- readonly Ar: "ar";
1572
- readonly Da: "da";
1573
- readonly De: "de";
1574
- readonly En: "en";
1575
- readonly Es: "es";
1576
- readonly Fr: "fr";
1577
- readonly He: "he";
1578
- readonly Id: "id";
1579
- readonly It: "it";
1580
- readonly Ja: "ja";
1581
- readonly Ko: "ko";
1582
- readonly Nl: "nl";
1583
- readonly No: "no";
1584
- readonly Pl: "pl";
1585
- readonly Pt: "pt";
1586
- readonly Ru: "ru";
1587
- readonly Sv: "sv";
1588
- readonly Tr: "tr";
1589
- readonly Vi: "vi";
1590
- readonly Zh: "zh";
1591
- };
1592
- type Locale_ElementsSupportedLocationCode_Enum = (typeof localeElementsSupportedLocationCodeEnum)[keyof typeof localeElementsSupportedLocationCodeEnum];
1593
-
1594
- type ICountry = {
1595
- bigcommerceDisplayName?: string;
1596
- code: CountryCode;
1597
- currencyCode: string;
1598
- displayName: string;
1599
- languageCode: Locale_ElementsSupportedLocationCode_Enum;
1600
- };
1601
- type ICountryJson = {
1602
- [countryCode: string]: ICountry;
1603
- };
1604
-
1605
- type Items = CheckItemRestrictionsMutation['itemRestrictionApply']['items'];
1606
- type RestrictedItem = Items[number] & {
1607
- name?: string;
1608
- };
1609
-
1610
- declare const restStateType: readonly ["Boxes", "Earth", "EmptyBox", "Lock", "PigBank", "Scribble", "Search", "Settings", "ShoppingCart", "SpilledCup", "Switch", "TaxId", "Truck", "Warning"];
1611
- type RestStateType = (typeof restStateType)[number];
1612
-
1613
- type ShippingRichRadioItem = {
1614
- amount: number;
1615
- caption?: string;
1616
- label: string;
1617
- landedCostId: string;
1618
- method: IncotermCode;
1619
- price: string;
1620
- shipmentRatingId: string;
1621
- sublabel?: string;
1622
- value: string | number;
1623
- };
1624
-
1625
- type SpinnerColor = 'primary' | 'info' | 'success' | 'danger' | 'warning' | 'black' | 'white';
1626
-
1627
- type ToggleItem<TValue> = {
1628
- isDisabled?: boolean;
1629
- label: string;
1630
- value: TValue;
1300
+
1301
+ type SpinnerColor = 'primary' | 'info' | 'success' | 'danger' | 'warning' | 'black' | 'white';
1302
+
1303
+ type ToggleItem<TValue> = {
1304
+ isDisabled?: boolean;
1305
+ label: string;
1306
+ value: TValue;
1631
1307
  };
1632
1308
 
1633
1309
  type GridSpacing = 0 | 4 | 8 | 12 | 16 | 20 | 24 | 32 | 40;
@@ -1776,6 +1452,10 @@ declare namespace Components {
1776
1452
  * The color of the button **NOTE**: If the button `variant` is set to 'standard', backgroundColor will be disregarded
1777
1453
  */
1778
1454
  "backgroundColor"?: Color | (string & { _placeholder?: never });
1455
+ /**
1456
+ * Whether or not the button text color is bold
1457
+ */
1458
+ "bold": boolean;
1779
1459
  /**
1780
1460
  * The border style of the button
1781
1461
  * @default ROUNDED
@@ -3493,6 +3173,10 @@ declare namespace LocalJSX {
3493
3173
  * The color of the button **NOTE**: If the button `variant` is set to 'standard', backgroundColor will be disregarded
3494
3174
  */
3495
3175
  "backgroundColor"?: Color | (string & { _placeholder?: never });
3176
+ /**
3177
+ * Whether or not the button text color is bold
3178
+ */
3179
+ "bold"?: boolean;
3496
3180
  /**
3497
3181
  * The border style of the button
3498
3182
  * @default ROUNDED
@@ -4517,6 +4201,73 @@ declare module "@stencil/core" {
4517
4201
  }
4518
4202
  }
4519
4203
 
4204
+ type CalculateLandedCostAdjustmentInput = {
4205
+ amount: number;
4206
+ name?: string | null;
4207
+ productId: string | null;
4208
+ promoCode?: string | null;
4209
+ sku: string | null;
4210
+ type: LandedCostAdjustmentType;
4211
+ };
4212
+ type Extensions = {
4213
+ [key: string]: unknown;
4214
+ } & {
4215
+ rule?: {
4216
+ description: string;
4217
+ id: string;
4218
+ name: string;
4219
+ };
4220
+ ruleMessageType?: 'CUSTOM' | 'DEFAULT';
4221
+ };
4222
+ type ApiError = {
4223
+ extensions?: Extensions | null;
4224
+ message: string;
4225
+ };
4226
+ type CalculateLandedCostRequest = {
4227
+ billingAddress: {
4228
+ addressLine1: string;
4229
+ addressLine2?: string | undefined;
4230
+ city: string;
4231
+ country: CountryCode;
4232
+ postalCode: string;
4233
+ state: string;
4234
+ };
4235
+ billingContact: {
4236
+ firstName: string;
4237
+ lastName: string;
4238
+ phone: string;
4239
+ };
4240
+ checkoutSessionId: string;
4241
+ contact: {
4242
+ email?: string;
4243
+ firstName: string;
4244
+ lastName: string;
4245
+ phone: string;
4246
+ };
4247
+ /**
4248
+ * When this is set, the created quote will not be shown on the Quote List page in the Zonos Dashboard.
4249
+ */
4250
+ isTest?: boolean;
4251
+ items: CartItem[];
4252
+ landedCostAdjustments?: CalculateLandedCostAdjustmentInput[];
4253
+ metadata?: {
4254
+ key: string;
4255
+ value: string;
4256
+ }[];
4257
+ /**
4258
+ * TaxId that the some destination countries require for the shipment.
4259
+ */
4260
+ shipToTaxId?: string;
4261
+ shippingAddress: {
4262
+ addressLine1: string;
4263
+ addressLine2?: string | undefined;
4264
+ city: string;
4265
+ country: CountryCode;
4266
+ postalCode: string;
4267
+ state: string;
4268
+ };
4269
+ };
4270
+
4520
4271
  type NormalizedItemAttribute = {
4521
4272
  key: string;
4522
4273
  value: string;
@@ -4535,31 +4286,301 @@ type NormalizedTempCartItem = {
4535
4286
  unitOfMeasure: ItemUnitOfMeasure;
4536
4287
  value: number;
4537
4288
  }[];
4538
- name: string | null;
4539
- productId: string | null;
4540
- quantity: number;
4541
- sku: string | null;
4289
+ name: string | null;
4290
+ productId: string | null;
4291
+ quantity: number;
4292
+ sku: string | null;
4293
+ };
4294
+ type NormalizedTempCart = {
4295
+ adjustments: {
4296
+ amount: number;
4297
+ currencyCode: CurrencyCode;
4298
+ description: string | null;
4299
+ productId: string | null;
4300
+ promoCode?: string | null;
4301
+ sku: string | null;
4302
+ type: CartAdjustmentType;
4303
+ }[];
4304
+ createdAt: string;
4305
+ credentialToken: string;
4306
+ id: string;
4307
+ items: NormalizedTempCartItem[];
4308
+ metadata: {
4309
+ key: string;
4310
+ value: string;
4311
+ }[];
4312
+ storeBaseUrl: string;
4313
+ storeId: number;
4314
+ };
4315
+
4316
+ type BuildLandedCostParams = {
4317
+ billingAddress: CalculateLandedCostRequest['billingAddress'];
4318
+ billingContact: CalculateLandedCostRequest['billingContact'];
4319
+ checkoutSessionId: string;
4320
+ contact: CalculateLandedCostRequest['contact'];
4321
+ landedCostAdjustments?: CalculateLandedCostRequest['landedCostAdjustments'];
4322
+ publicCredential: string;
4323
+ shippingAddress: CalculateLandedCostRequest['shippingAddress'];
4324
+ zonosApiRoute: string;
4325
+ };
4326
+ type BuildLandedCostResponse = (CalculateLandedCostMutation & {
4327
+ errors: ApiError[];
4328
+ }) | null;
4329
+
4330
+ type ZonosOrder = GetOrderQuery['order'];
4331
+
4332
+ type BuildCardDetailParams = {
4333
+ countryCode: CountryCode;
4334
+ currencyCode: CurrencyCode;
4335
+ };
4336
+ type PromiseOrValue<T> = T | Promise<T>;
4337
+ type PrefillAddress = {
4338
+ customerAddress1: string;
4339
+ customerAddress2?: string;
4340
+ customerCity?: string;
4341
+ /**
4342
+ * If country is not provided, it will try to pull from query params `zCountry` or `country` or `customerCountry` in the URL or fallback to user's selected country
4343
+ */
4344
+ customerCountry?: string;
4345
+ customerEmail: string;
4346
+ customerName: string;
4347
+ customerPhone: string;
4348
+ customerState?: string;
4349
+ customerZip: string;
4350
+ };
4351
+ type CreateCartIdObject = {
4352
+ cartId: string;
4353
+ shippingData?: PrefillAddress | null;
4354
+ };
4355
+ type CheckoutConfig = {
4356
+ /**
4357
+ * Validate address to allow specific character sets
4358
+ * @default ALL
4359
+ */
4360
+ allowedCharacterSets?: 'ALL' | 'LATIN';
4361
+ /**
4362
+ * Enable settlement currencies to pay in USD
4363
+ * @default LOCAL
4364
+ */
4365
+ allowedSettlementCurrencies: AllowedSettlementCurrencies;
4366
+ analyticsProviders: Array<{
4367
+ status: AnalyticsProviderStatus;
4368
+ type: AnalyticsProviderType;
4369
+ }>;
4370
+ /**
4371
+ * Duration (in seconds) for which the cart remains valid for checkout in hosted checkout.
4372
+ * @default 3_600 (1 hour)
4373
+ */
4374
+ defaultCartExpiration?: number;
4375
+ /**
4376
+ * @default false - when false, the place order button will be disabled until the script is loaded
4377
+ * @note if set to true, the place order button will not be enabled or disabled
4378
+ */
4379
+ disablePlaceOrderButtonActivation?: boolean;
4380
+ externalPaymentMethods: Array<{
4381
+ status: ExternalPaymentMethodStatus;
4382
+ type: ExternalPaymentMethodType;
4383
+ }> | null;
4384
+ externalServiceTokens: {
4385
+ token: string;
4386
+ type: ExternalServiceTokenType;
4387
+ }[];
4388
+ /**
4389
+ * Test mode for checkout (sandbox or production)
4390
+ * @default TEST
4391
+ */
4392
+ mode: Mode;
4393
+ orderNotifications: {
4394
+ abandonedCart: {
4395
+ delay: number;
4396
+ discountPercent: number;
4397
+ status: {
4398
+ active: NotificationActiveStatus;
4399
+ sendCopiesTo: Array<string>;
4400
+ };
4401
+ };
4402
+ orderCancelled: {
4403
+ active: NotificationActiveStatus;
4404
+ sendCopiesTo: Array<string>;
4405
+ };
4406
+ orderShipped: {
4407
+ active: NotificationActiveStatus;
4408
+ sendCopiesTo: Array<string>;
4409
+ };
4410
+ };
4411
+ organization: string;
4412
+ placeOrderButtonSelector: string | null;
4413
+ /**
4414
+ * @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
4415
+ *
4416
+ * **NOTE: this value can't be overridden in Zonos.init**
4417
+ */
4418
+ subscriptionStatus: CheckoutSubscriptionStatus;
4419
+ successBehavior: CheckoutSuccessBehavior;
4420
+ /**
4421
+ * The success page action text for checkout.
4422
+ * @note Default text supports translation automatically, but any custom text will not be translated.
4423
+ */
4424
+ successPageActionText?: string;
4425
+ /**
4426
+ * The success page subtitle text for checkout. Each item in the array will appear on a new line.
4427
+ * @note Default text supports translation automatically, but any custom text will not be translated.
4428
+ */
4429
+ successPageSubtitleText?: string[];
4430
+ /**
4431
+ * The success page title text for checkout.
4432
+ * @note Default text supports translation automatically, but any custom text will not be translated.
4433
+ */
4434
+ successPageTitleText?: string;
4435
+ successRedirectUrl: string;
4436
+ visibilityStatus: CheckoutVisibilityStatus;
4437
+ /**
4438
+ * Cart info callback for checkout (optional),
4439
+ * @deprecated This is deprecated in favor of the new callback `createCartId`. The new API would only need the cart ID to retrieve cart data.
4440
+ * @note will attempt to use cart data if available
4441
+ * User can dispatch an event 'zonos--init-cart-info' to update the cart
4442
+ * @example
4443
+ * const initEvent = new CustomEvent<CartItem[]>('zonos--init-cart-info', {
4444
+ * detail: cartItems,
4445
+ * });
4446
+ * document.body.dispatchEvent(initEvent);
4447
+ * @returns {object[]} - object with the the item info to be added to cart:
4448
+ * - amount: number;
4449
+ * - countryOfOrigin?: string;
4450
+ * - currencyCode: string;
4451
+ * - description?: string;
4452
+ * - hsCode?: string;
4453
+ * - imageUrl?: string;
4454
+ * - name: string;
4455
+ * - productId?: string;
4456
+ * - quantity: number;
4457
+ */
4458
+ buildCartDetail?: (params: BuildCardDetailParams) => Promise<CartItem[]>;
4459
+ /**
4460
+ * Calculate landed cost callback for checkout (optional)
4461
+ * @deprecated This is deprecated in favor of the new callback `createCartId`. When using the new callback, the cart details will be retrieved using the cart ID, so this callback would no longer be needed.
4462
+ * @note will attempt to use cart data if available
4463
+ */
4464
+ buildLandedCost?: (params: BuildLandedCostParams) => Promise<BuildLandedCostResponse>;
4465
+ /**
4466
+ * A callback that returns the cart id from `cartCreate` mutation. You would use your cart data to call the `cartCreate` mutation and return the cart ID that was created.
4467
+ * @note
4468
+ * The mutation `cartCreate` should be called on the server side
4469
+ * @returns string - Cart ID
4470
+ */
4471
+ createCartId?: () => PromiseOrValue<string | CreateCartIdObject>;
4472
+ /**
4473
+ * Callback trigger when the checkout is closed
4474
+ */
4475
+ onClose?: () => void;
4476
+ /**
4477
+ * This callback is optional. If provided, it will be called right before the payment is processed.
4478
+ * @param items - The cart items.
4479
+ * @returns {string | null} - The error message to display to the user. If the message is empty or null, the payment will proceed.
4480
+ * @example
4481
+ * onInventoryCheck: async ({ items }) => {
4482
+ * // Check if all items are available from the server. If the fetch is throwing an error, show a generic error message "Unable to check inventory. Please try again.".
4483
+ * const itemsInfo = await fetch('https://yourserver.com/api/get-available-items', {
4484
+ * method: 'POST',
4485
+ * body: JSON.stringify({ items }),
4486
+ * });
4487
+ * const items = await itemsInfo.json();
4488
+ * // Filter out unavailable items.
4489
+ * const unavailableItems = items.filter(item => !item.available);
4490
+ * if (unavailableItems.length) {
4491
+ * // Display an error message to the user.
4492
+ * return `The following items are not available: ${unavailableItems.map(item => item.name).join(', ')}`;
4493
+ * }
4494
+ * // Proceed with the payment if you return an empty string or null.
4495
+ * return '';
4496
+ * }
4497
+ */
4498
+ onInventoryCheck?: (params: {
4499
+ items: CartItem[];
4500
+ }) => Promise<string | null>;
4501
+ /**
4502
+ * Callback trigger when payment succeeds
4503
+ */
4504
+ onOrderSuccess?: (props: {
4505
+ zonosApiRoute: string;
4506
+ zonosOrder: ZonosOrder;
4507
+ }) => Promise<void>;
4542
4508
  };
4543
- type NormalizedTempCart = {
4544
- adjustments: {
4545
- amount: number;
4509
+
4510
+ type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
4511
+ type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
4512
+ type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
4513
+ type HelloConfig = {
4514
+ anchorElementSelector: string;
4515
+ cartUrlPattern: string | null;
4516
+ /**
4517
+ * The behavior to use when determining the country to use for the user.
4518
+ * @default 'URL_PARAM'
4519
+ */
4520
+ countryOverrideBehavior?: CountryOverrideBehavior;
4521
+ currencyBehavior: HelloCurrencyBehavior;
4522
+ currencyElementSelector: string;
4523
+ desktopLocation?: HelloMobileLocation | null;
4524
+ excludedUrlPatterns: Array<string>;
4525
+ homepageUrlPattern: string | null;
4526
+ mobileLocation: HelloMobileLocation | null;
4527
+ mode: Mode;
4528
+ /**
4529
+ * Position of floating hello if `anchorElementSelector` is not found after 3 seconds
4530
+ *
4531
+ * null: don't render if not found
4532
+ *
4533
+ * @default null
4534
+ */
4535
+ notFoundElementFallback: HelloMobileLocation | null;
4536
+ organization: string;
4537
+ peekMessageBehavior: HelloPeekMessageBehavior;
4538
+ peekMessageDelay: number;
4539
+ productAddToCartElementSelector: string | null;
4540
+ productDescriptionElementSelector: string | null;
4541
+ productDetailUrlPattern: string | null;
4542
+ productListUrlPattern: string | null;
4543
+ productTitleElementSelector: string | null;
4544
+ restrictionBehavior: HelloRestrictionBehavior;
4545
+ /**
4546
+ * The countries to include in the country list dropdown of the Hello widget.
4547
+ * @default ONLY_SHIPPABLE
4548
+ */
4549
+ showCountryList?: ShowCountryList;
4550
+ /**
4551
+ * The countries to show the widget for.
4552
+ * @default ONLY_SHIPPABLE
4553
+ */
4554
+ showForCountries?: ShowForCountries;
4555
+ visibilityStatus?: 'ENABLED' | 'DISABLED';
4556
+ /**
4557
+ * Callback function to run after the Hello widget has been initialized. This should be triggered only once when hello is attached to the DOM.
4558
+ * **Note**: If hello is detached from the DOM and reattached, this callback will be called again.
4559
+ * @param params - The parameters containing the country code and currency code that hello is initialized with.
4560
+ */
4561
+ onInitSuccess?: (params: {
4562
+ countryCode: CountryCode;
4546
4563
  currencyCode: CurrencyCode;
4547
- description: string | null;
4548
- productId: string | null;
4549
- promoCode?: string | null;
4550
- sku: string | null;
4551
- type: CartAdjustmentType;
4552
- }[];
4553
- createdAt: string;
4554
- credentialToken: string;
4555
- id: string;
4556
- items: NormalizedTempCartItem[];
4557
- metadata: {
4558
- key: string;
4559
- value: string;
4560
- }[];
4561
- storeBaseUrl: string;
4562
- storeId: number;
4564
+ }) => Promise<void>;
4565
+ };
4566
+
4567
+ type AppearanceConfig = {
4568
+ colorPrimary?: string;
4569
+ colorSecondary?: string;
4570
+ fontFamily: string;
4571
+ fontSize2XL?: number;
4572
+ fontSize3XL?: number;
4573
+ fontSizeBase?: number;
4574
+ fontSizeInputLabel?: number;
4575
+ fontSizeInputValue?: number;
4576
+ fontSizeL?: number;
4577
+ fontSizeS?: number;
4578
+ fontSizeXL?: number;
4579
+ fontSizeXS?: number;
4580
+ logoUrl: string;
4581
+ style: ElementsUiStyle;
4582
+ theme: ElementsUiTheme;
4583
+ zonosAttribution: ZonosAttribution | null;
4563
4584
  };
4564
4585
 
4565
4586
  /**