@zonos/elements 1.3.158 → 1.3.160

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 (156) hide show
  1. package/dist/cjs/{cart-c6b42ee3.js → cart-934a8aef.js} +12 -8
  2. package/dist/cjs/{getBorderRadius-c4fed939.js → getBorderRadius-d184b623.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{isDarkColor-cd98fcb7.js → isDarkColor-08d92ed7.js} +1 -1
  5. package/dist/cjs/{paypal-bc98bcd3.js → paypal-dddeb76e.js} +3 -3
  6. package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
  7. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  8. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  10. package/dist/cjs/zonos-card.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +5 -5
  12. package/dist/cjs/zonos-checkout.cjs.entry.js +8 -5
  13. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
  15. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
  16. package/dist/cjs/zonos-country-select_4.cjs.entry.js +4 -4
  17. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +5 -5
  18. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
  19. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  21. package/dist/cjs/zonos-language-select_2.cjs.entry.js +4 -4
  22. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  24. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-toggle.cjs.entry.js +1 -1
  26. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  27. package/dist/cjs/{zonosStore-188d96be.js → zonosStore-7975e4b6.js} +3 -0
  28. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +3 -0
  29. package/dist/collection/components/store/checkout/cart.js +7 -3
  30. package/dist/collection/components/store/checkout/stripe.js +2 -2
  31. package/dist/collection/components/store/zonosStore.js +3 -0
  32. package/dist/collection/types/index.js +1 -0
  33. package/dist/collection/types/utils/ZonosSettings.js +1 -0
  34. package/dist/esm/{cart-74d92be2.js → cart-41bdd9fb.js} +12 -8
  35. package/dist/esm/{getBorderRadius-d2e68013.js → getBorderRadius-740610fb.js} +1 -1
  36. package/dist/esm/index.js +7 -7
  37. package/dist/esm/{isDarkColor-16e586a1.js → isDarkColor-2f59d721.js} +1 -1
  38. package/dist/esm/{paypal-459383ae.js → paypal-c81fb5ee.js} +3 -3
  39. package/dist/esm/zonos-address_8.entry.js +4 -4
  40. package/dist/esm/zonos-badge.entry.js +1 -1
  41. package/dist/esm/zonos-banner.entry.js +1 -1
  42. package/dist/esm/zonos-button_3.entry.js +3 -3
  43. package/dist/esm/zonos-card.entry.js +2 -2
  44. package/dist/esm/zonos-cart-items_13.entry.js +5 -5
  45. package/dist/esm/zonos-checkout.entry.js +8 -5
  46. package/dist/esm/zonos-collapse.entry.js +1 -1
  47. package/dist/esm/zonos-controller.entry.js +4 -4
  48. package/dist/esm/zonos-country-flag.entry.js +4 -4
  49. package/dist/esm/zonos-country-select_4.entry.js +4 -4
  50. package/dist/esm/zonos-empty-state-payment_4.entry.js +5 -5
  51. package/dist/esm/zonos-hello-dialog.entry.js +4 -4
  52. package/dist/esm/zonos-hello.entry.js +4 -4
  53. package/dist/esm/zonos-input.entry.js +2 -2
  54. package/dist/esm/zonos-language-select_2.entry.js +4 -4
  55. package/dist/esm/zonos-logo.entry.js +1 -1
  56. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  57. package/dist/esm/zonos-text.entry.js +1 -1
  58. package/dist/esm/zonos-toggle.entry.js +1 -1
  59. package/dist/esm/zonos-v-stack.entry.js +1 -1
  60. package/dist/esm/{zonosStore-4b574fcc.js → zonosStore-71d7e02f.js} +3 -0
  61. package/dist/esm-es5/{cart-74d92be2.js → cart-41bdd9fb.js} +1 -1
  62. package/dist/esm-es5/{getBorderRadius-d2e68013.js → getBorderRadius-740610fb.js} +1 -1
  63. package/dist/esm-es5/index.js +1 -1
  64. package/dist/esm-es5/{isDarkColor-16e586a1.js → isDarkColor-2f59d721.js} +1 -1
  65. package/dist/esm-es5/{paypal-459383ae.js → paypal-c81fb5ee.js} +1 -1
  66. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  67. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  68. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  69. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  70. package/dist/esm-es5/zonos-card.entry.js +1 -1
  71. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  72. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  73. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  74. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  75. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  76. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  77. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  78. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  79. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  80. package/dist/esm-es5/zonos-input.entry.js +1 -1
  81. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  82. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  83. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  84. package/dist/esm-es5/zonos-text.entry.js +1 -1
  85. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  86. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  87. package/dist/esm-es5/{zonosStore-4b574fcc.js → zonosStore-71d7e02f.js} +1 -1
  88. package/dist/scripts/index.d.ts +649 -649
  89. package/dist/scripts/index.js +1 -1
  90. package/dist/scripts/loadZonos.js +1 -1
  91. package/dist/scripts/zonos.js +1 -1
  92. package/dist/types/components/store/zonosStore.d.ts +4 -2
  93. package/dist/types/components/utils/api/getZonosSettings.d.ts +3 -3
  94. package/dist/types/types/index.d.ts +1 -0
  95. package/dist/types/types/utils/ZonosSettings.d.ts +10 -0
  96. package/dist/zonos-elements/index.esm.js +1 -1
  97. package/dist/zonos-elements/{p-ca216e7b.entry.js → p-073bc210.entry.js} +1 -1
  98. package/dist/zonos-elements/{p-a25e15a0.system.entry.js → p-09e4f412.system.entry.js} +1 -1
  99. package/dist/zonos-elements/{p-3a5348d9.system.entry.js → p-0febd074.system.entry.js} +1 -1
  100. package/dist/zonos-elements/{p-107bcbf5.entry.js → p-15971b78.entry.js} +1 -1
  101. package/dist/zonos-elements/{p-13070bc0.system.js → p-15d4d606.system.js} +1 -1
  102. package/dist/zonos-elements/{p-42e46be2.system.js → p-165dfe38.system.js} +1 -1
  103. package/dist/zonos-elements/{p-08b4bd71.entry.js → p-1921fe51.entry.js} +1 -1
  104. package/dist/zonos-elements/{p-62a790cb.system.entry.js → p-20ca31fd.system.entry.js} +1 -1
  105. package/dist/zonos-elements/{p-34cd2879.entry.js → p-22e190af.entry.js} +1 -1
  106. package/dist/zonos-elements/p-23021792.js +17 -0
  107. package/dist/zonos-elements/{p-9308d8ad.entry.js → p-2f6bbd3b.entry.js} +1 -1
  108. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  109. package/dist/zonos-elements/{p-25f0a3d0.entry.js → p-4968aa73.entry.js} +1 -1
  110. package/dist/zonos-elements/{p-3a4f77dd.system.entry.js → p-57281d6c.system.entry.js} +1 -1
  111. package/dist/zonos-elements/{p-61272f94.entry.js → p-6549915d.entry.js} +1 -1
  112. package/dist/zonos-elements/p-6658cc02.system.js +1 -0
  113. package/dist/zonos-elements/{p-05a4d995.js → p-672707ce.js} +1 -1
  114. package/dist/zonos-elements/{p-d705a5fb.entry.js → p-72319b4d.entry.js} +1 -1
  115. package/dist/zonos-elements/{p-2cfad1a2.entry.js → p-73e9a8f5.entry.js} +1 -1
  116. package/dist/zonos-elements/{p-b1424255.entry.js → p-75a8e67d.entry.js} +1 -1
  117. package/dist/zonos-elements/{p-43cb3e80.entry.js → p-77581c1c.entry.js} +1 -1
  118. package/dist/zonos-elements/{p-ac6816b3.system.entry.js → p-7b76c844.system.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-536c5a47.entry.js → p-7c028742.entry.js} +1 -1
  120. package/dist/zonos-elements/{p-1448b57a.system.entry.js → p-7c536f5a.system.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-c725a571.entry.js → p-7cb5e4b8.entry.js} +1 -1
  122. package/dist/zonos-elements/{p-dfc11974.system.entry.js → p-82166888.system.entry.js} +1 -1
  123. package/dist/zonos-elements/{p-e295baac.entry.js → p-83645bb4.entry.js} +1 -1
  124. package/dist/zonos-elements/{p-c6efea31.system.entry.js → p-85235fa0.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-7534ed11.system.entry.js → p-8addb07b.system.entry.js} +1 -1
  126. package/dist/zonos-elements/{p-290845c4.system.entry.js → p-95aa4518.system.entry.js} +1 -1
  127. package/dist/zonos-elements/{p-40fc4f98.entry.js → p-983c8c5f.entry.js} +1 -1
  128. package/dist/zonos-elements/p-98e9c9cf.js +1 -0
  129. package/dist/zonos-elements/{p-c84eb1e5.system.entry.js → p-9cbe0e06.system.entry.js} +1 -1
  130. package/dist/zonos-elements/{p-98fbd95f.js → p-a0efb02e.js} +1 -1
  131. package/dist/zonos-elements/{p-6b67039a.system.entry.js → p-a23fb562.system.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-28325d38.system.js → p-a9a29cf6.system.js} +1 -1
  133. package/dist/zonos-elements/{p-b4dcb658.system.js → p-a9a95fae.system.js} +1 -1
  134. package/dist/zonos-elements/{p-f674d15a.entry.js → p-acabfba5.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-0e436c9d.system.js → p-b6fdbbf4.system.js} +1 -1
  136. package/dist/zonos-elements/{p-b2f71850.entry.js → p-bbc11b58.entry.js} +1 -1
  137. package/dist/zonos-elements/p-c522ddf2.entry.js +1 -0
  138. package/dist/zonos-elements/{p-423a25ee.system.entry.js → p-c7219337.system.entry.js} +1 -1
  139. package/dist/zonos-elements/{p-2f17dd0a.system.entry.js → p-d8406c80.system.entry.js} +1 -1
  140. package/dist/zonos-elements/{p-0d30b20e.system.entry.js → p-d9940c47.system.entry.js} +1 -1
  141. package/dist/zonos-elements/{p-d68dd730.system.entry.js → p-daa0dcb4.system.entry.js} +1 -1
  142. package/dist/zonos-elements/{p-d29e8aaa.js → p-dd999b44.js} +1 -1
  143. package/dist/zonos-elements/{p-89b50f7d.system.entry.js → p-e174b37b.system.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-ed553eb2.entry.js → p-e300d1ed.entry.js} +1 -1
  145. package/dist/zonos-elements/{p-b0b4afdb.system.entry.js → p-e611b266.system.entry.js} +1 -1
  146. package/dist/zonos-elements/{p-4fb44ae1.system.entry.js → p-e6bbea1e.system.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-767527f6.system.entry.js → p-eb5835d1.system.entry.js} +1 -1
  148. package/dist/zonos-elements/{p-e7def9ea.system.entry.js → p-ed74742d.system.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-e9d7f9e7.entry.js → p-f06559c1.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-dd7a2d62.entry.js → p-fa15b9b5.entry.js} +1 -1
  151. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  152. package/package.json +1 -1
  153. package/dist/zonos-elements/p-000a41ab.js +0 -17
  154. package/dist/zonos-elements/p-82d5803d.system.js +0 -1
  155. package/dist/zonos-elements/p-83c9aae7.js +0 -1
  156. package/dist/zonos-elements/p-dd3201f2.entry.js +0 -1
@@ -3,6 +3,85 @@ 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";
@@ -965,6 +1044,153 @@ type GetOrderQuery = {
965
1044
  } | null;
966
1045
  };
967
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
+
968
1194
  type TabItem = {
969
1195
  index: number;
970
1196
  isDone: boolean;
@@ -1003,644 +1229,81 @@ type CartItem = {
1003
1229
  sku?: string;
1004
1230
  };
1005
1231
 
1006
- type CalculateLandedCostAdjustmentInput = {
1007
- amount: number;
1008
- name?: string | null;
1009
- productId: string | null;
1010
- promoCode?: string | null;
1011
- sku: string | null;
1012
- type: LandedCostAdjustmentType;
1013
- };
1014
- type Extensions = {
1015
- [key: string]: unknown;
1016
- } & {
1017
- rule?: {
1018
- description: string;
1019
- id: string;
1020
- name: string;
1021
- };
1022
- ruleMessageType?: 'CUSTOM' | 'DEFAULT';
1023
- };
1024
- type ApiError = {
1025
- extensions?: Extensions | null;
1232
+ type NotificationInit = {
1026
1233
  message: string;
1027
- };
1028
- type CalculateLandedCostRequest = {
1029
- billingAddress: {
1030
- addressLine1: string;
1031
- addressLine2?: string | undefined;
1032
- city: string;
1033
- country: CountryCode;
1034
- postalCode: string;
1035
- state: string;
1036
- };
1037
- billingContact: {
1038
- firstName: string;
1039
- lastName: string;
1040
- phone: string;
1041
- };
1042
- checkoutSessionId: string;
1043
- contact: {
1044
- email?: string;
1045
- firstName: string;
1046
- lastName: string;
1047
- phone: string;
1048
- };
1049
1234
  /**
1050
- * 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
1051
1237
  */
1052
- isTest?: boolean;
1053
- items: CartItem[];
1054
- landedCostAdjustments?: CalculateLandedCostAdjustmentInput[];
1055
- metadata?: {
1056
- key: string;
1057
- value: string;
1058
- }[];
1238
+ timeout?: number;
1059
1239
  /**
1060
- * TaxId that the some destination countries require for the shipment.
1240
+ * Type of notification
1241
+ * @default 'success'
1061
1242
  */
1062
- shipToTaxId?: string;
1063
- shippingAddress: {
1064
- addressLine1: string;
1065
- addressLine2?: string | undefined;
1066
- city: string;
1067
- country: CountryCode;
1068
- postalCode: string;
1069
- state: string;
1070
- };
1243
+ type?: 'error' | 'success' | 'warning';
1071
1244
  };
1072
1245
 
1073
- type BuildLandedCostParams = {
1074
- billingAddress: CalculateLandedCostRequest['billingAddress'];
1075
- billingContact: CalculateLandedCostRequest['billingContact'];
1076
- checkoutSessionId: string;
1077
- contact: CalculateLandedCostRequest['contact'];
1078
- landedCostAdjustments?: CalculateLandedCostRequest['landedCostAdjustments'];
1079
- publicCredential: string;
1080
- shippingAddress: CalculateLandedCostRequest['shippingAddress'];
1081
- 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";
1082
1267
  };
1083
- type BuildLandedCostResponse = (CalculateLandedCostMutation & {
1084
- errors: ApiError[];
1085
- }) | null;
1268
+ type Locale_ElementsSupportedLocationCode_Enum = (typeof localeElementsSupportedLocationCodeEnum)[keyof typeof localeElementsSupportedLocationCodeEnum];
1086
1269
 
1087
- 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
+ };
1088
1280
 
1089
- type BuildCardDetailParams = {
1090
- countryCode: CountryCode;
1091
- currencyCode: CurrencyCode;
1281
+ type Items = CheckItemRestrictionsMutation['itemRestrictionApply']['items'];
1282
+ type RestrictedItem = Items[number] & {
1283
+ name?: string;
1092
1284
  };
1093
- type PromiseOrValue<T> = T | Promise<T>;
1094
- type PrefillAddress = {
1095
- customerAddress1: string;
1096
- customerAddress2?: string;
1097
- customerCity?: string;
1098
- /**
1099
- * 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
1100
- */
1101
- customerCountry?: string;
1102
- customerEmail: string;
1103
- customerName: string;
1104
- customerPhone: string;
1105
- customerState?: string;
1106
- 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;
1107
1299
  };
1108
- type CreateCartIdObject = {
1109
- cartId: string;
1110
- shippingData?: PrefillAddress | null;
1111
- };
1112
- type CheckoutConfig = {
1113
- /**
1114
- * Validate address to allow specific character sets
1115
- * @default ALL
1116
- */
1117
- allowedCharacterSets?: 'ALL' | 'LATIN';
1118
- /**
1119
- * Enable settlement currencies to pay in USD
1120
- * @default LOCAL
1121
- */
1122
- allowedSettlementCurrencies: AllowedSettlementCurrencies;
1123
- analyticsProviders: Array<{
1124
- status: AnalyticsProviderStatus;
1125
- type: AnalyticsProviderType;
1126
- }>;
1127
- /**
1128
- * Duration (in seconds) for which the cart remains valid for checkout in hosted checkout.
1129
- * @default 3_600 (1 hour)
1130
- */
1131
- defaultCartExpiration?: number;
1132
- /**
1133
- * @default false - when false, the place order button will be disabled until the script is loaded
1134
- * @note if set to true, the place order button will not be enabled or disabled
1135
- */
1136
- disablePlaceOrderButtonActivation?: boolean;
1137
- externalPaymentMethods: Array<{
1138
- status: ExternalPaymentMethodStatus;
1139
- type: ExternalPaymentMethodType;
1140
- }> | null;
1141
- externalServiceTokens: {
1142
- token: string;
1143
- type: ExternalServiceTokenType;
1144
- }[];
1145
- /**
1146
- * Test mode for checkout (sandbox or production)
1147
- * @default TEST
1148
- */
1149
- mode: Mode;
1150
- orderNotifications: {
1151
- abandonedCart: {
1152
- delay: number;
1153
- discountPercent: number;
1154
- status: {
1155
- active: NotificationActiveStatus;
1156
- sendCopiesTo: Array<string>;
1157
- };
1158
- };
1159
- orderCancelled: {
1160
- active: NotificationActiveStatus;
1161
- sendCopiesTo: Array<string>;
1162
- };
1163
- orderShipped: {
1164
- active: NotificationActiveStatus;
1165
- sendCopiesTo: Array<string>;
1166
- };
1167
- };
1168
- organization: string;
1169
- placeOrderButtonSelector: string | null;
1170
- /**
1171
- * @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
1172
- *
1173
- * **NOTE: this value can't be overridden in Zonos.init**
1174
- */
1175
- subscriptionStatus: CheckoutSubscriptionStatus;
1176
- successBehavior: CheckoutSuccessBehavior;
1177
- /**
1178
- * The success page action text for checkout.
1179
- * @note Default text supports translation automatically, but any custom text will not be translated.
1180
- */
1181
- successPageActionText?: string;
1182
- /**
1183
- * The success page subtitle text for checkout. Each item in the array will appear on a new line.
1184
- * @note Default text supports translation automatically, but any custom text will not be translated.
1185
- */
1186
- successPageSubtitleText?: string[];
1187
- /**
1188
- * The success page title text for checkout.
1189
- * @note Default text supports translation automatically, but any custom text will not be translated.
1190
- */
1191
- successPageTitleText?: string;
1192
- successRedirectUrl: string;
1193
- visibilityStatus: CheckoutVisibilityStatus;
1194
- /**
1195
- * Cart info callback for checkout (optional),
1196
- * @deprecated This is deprecated in favor of the new callback `createCartId`. The new API would only need the cart ID to retrieve cart data.
1197
- * @note will attempt to use cart data if available
1198
- * User can dispatch an event 'zonos--init-cart-info' to update the cart
1199
- * @example
1200
- * const initEvent = new CustomEvent<CartItem[]>('zonos--init-cart-info', {
1201
- * detail: cartItems,
1202
- * });
1203
- * document.body.dispatchEvent(initEvent);
1204
- * @returns {object[]} - object with the the item info to be added to cart:
1205
- * - amount: number;
1206
- * - countryOfOrigin?: string;
1207
- * - currencyCode: string;
1208
- * - description?: string;
1209
- * - hsCode?: string;
1210
- * - imageUrl?: string;
1211
- * - name: string;
1212
- * - productId?: string;
1213
- * - quantity: number;
1214
- */
1215
- buildCartDetail?: (params: BuildCardDetailParams) => Promise<CartItem[]>;
1216
- /**
1217
- * Calculate landed cost callback for checkout (optional)
1218
- * @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.
1219
- * @note will attempt to use cart data if available
1220
- */
1221
- buildLandedCost?: (params: BuildLandedCostParams) => Promise<BuildLandedCostResponse>;
1222
- /**
1223
- * 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.
1224
- * @note
1225
- * The mutation `cartCreate` should be called on the server side
1226
- * @returns string - Cart ID
1227
- */
1228
- createCartId?: () => PromiseOrValue<string | CreateCartIdObject>;
1229
- /**
1230
- * Callback trigger when the checkout is closed
1231
- */
1232
- onClose?: () => void;
1233
- /**
1234
- * This callback is optional. If provided, it will be called right before the payment is processed.
1235
- * @param items - The cart items.
1236
- * @returns {string | null} - The error message to display to the user. If the message is empty or null, the payment will proceed.
1237
- * @example
1238
- * onInventoryCheck: async ({ items }) => {
1239
- * // 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.".
1240
- * const itemsInfo = await fetch('https://yourserver.com/api/get-available-items', {
1241
- * method: 'POST',
1242
- * body: JSON.stringify({ items }),
1243
- * });
1244
- * const items = await itemsInfo.json();
1245
- * // Filter out unavailable items.
1246
- * const unavailableItems = items.filter(item => !item.available);
1247
- * if (unavailableItems.length) {
1248
- * // Display an error message to the user.
1249
- * return `The following items are not available: ${unavailableItems.map(item => item.name).join(', ')}`;
1250
- * }
1251
- * // Proceed with the payment if you return an empty string or null.
1252
- * return '';
1253
- * }
1254
- */
1255
- onInventoryCheck?: (params: {
1256
- items: CartItem[];
1257
- }) => Promise<string | null>;
1258
- /**
1259
- * Callback trigger when payment succeeds
1260
- */
1261
- onOrderSuccess?: (props: {
1262
- zonosApiRoute: string;
1263
- zonosOrder: ZonosOrder;
1264
- }) => Promise<void>;
1265
- };
1266
-
1267
- type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
1268
- type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
1269
- type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
1270
- type HelloConfig = {
1271
- anchorElementSelector: string;
1272
- cartUrlPattern: string | null;
1273
- /**
1274
- * The behavior to use when determining the country to use for the user.
1275
- * @default 'URL_PARAM'
1276
- */
1277
- countryOverrideBehavior?: CountryOverrideBehavior;
1278
- currencyBehavior: HelloCurrencyBehavior;
1279
- currencyElementSelector: string;
1280
- desktopLocation?: HelloMobileLocation | null;
1281
- excludedUrlPatterns: Array<string>;
1282
- homepageUrlPattern: string | null;
1283
- mobileLocation: HelloMobileLocation | null;
1284
- mode: Mode;
1285
- /**
1286
- * Position of floating hello if `anchorElementSelector` is not found after 3 seconds
1287
- *
1288
- * null: don't render if not found
1289
- *
1290
- * @default null
1291
- */
1292
- notFoundElementFallback: HelloMobileLocation | null;
1293
- organization: string;
1294
- peekMessageBehavior: HelloPeekMessageBehavior;
1295
- peekMessageDelay: number;
1296
- productAddToCartElementSelector: string | null;
1297
- productDescriptionElementSelector: string | null;
1298
- productDetailUrlPattern: string | null;
1299
- productListUrlPattern: string | null;
1300
- productTitleElementSelector: string | null;
1301
- restrictionBehavior: HelloRestrictionBehavior;
1302
- /**
1303
- * The countries to include in the country list dropdown of the Hello widget.
1304
- * @default ONLY_SHIPPABLE
1305
- */
1306
- showCountryList?: ShowCountryList;
1307
- /**
1308
- * The countries to show the widget for.
1309
- * @default ONLY_SHIPPABLE
1310
- */
1311
- showForCountries?: ShowForCountries;
1312
- visibilityStatus?: 'ENABLED' | 'DISABLED';
1313
- /**
1314
- * Callback function to run after the Hello widget has been initialized. This should be triggered only once when hello is attached to the DOM.
1315
- * **Note**: If hello is detached from the DOM and reattached, this callback will be called again.
1316
- * @param params - The parameters containing the country code and currency code that hello is initialized with.
1317
- */
1318
- onInitSuccess?: (params: {
1319
- countryCode: CountryCode;
1320
- currencyCode: CurrencyCode;
1321
- }) => Promise<void>;
1322
- };
1323
-
1324
- type AppearanceConfig = {
1325
- colorPrimary?: string;
1326
- colorSecondary?: string;
1327
- fontFamily: string;
1328
- fontSize2XL?: number;
1329
- fontSize3XL?: number;
1330
- fontSizeBase?: number;
1331
- fontSizeInputLabel?: number;
1332
- fontSizeInputValue?: number;
1333
- fontSizeL?: number;
1334
- fontSizeS?: number;
1335
- fontSizeXL?: number;
1336
- fontSizeXS?: number;
1337
- logoUrl: string;
1338
- style: ElementsUiStyle;
1339
- theme: ElementsUiTheme;
1340
- zonosAttribution: ZonosAttribution | null;
1341
- };
1342
-
1343
- type CustomEventMap = {
1344
- legacyCheckoutError: string;
1345
- 'zonos-checkout-success': {
1346
- message: string;
1347
- };
1348
- };
1349
-
1350
- declare const _envClientSchema: z.ZodObject<{
1351
- NEXT_PUBLIC_FLAG_URL: z.ZodString;
1352
- NEXT_PUBLIC_RELEASE_DATE: z.ZodString;
1353
- NEXT_PUBLIC_ZONOS_API_KEY: z.ZodString;
1354
- NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: z.ZodString;
1355
- NEXT_PUBLIC_ZONOS_CDN_URL: z.ZodString;
1356
- NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: z.ZodString;
1357
- NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: z.ZodString;
1358
- NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: z.ZodString;
1359
- NEXT_PUBLIC_ZONOS_ROUTE_URL: z.ZodString;
1360
- NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: z.ZodString;
1361
- }, "strip", z.ZodTypeAny, {
1362
- NEXT_PUBLIC_FLAG_URL: string;
1363
- NEXT_PUBLIC_RELEASE_DATE: string;
1364
- NEXT_PUBLIC_ZONOS_API_KEY: string;
1365
- NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
1366
- NEXT_PUBLIC_ZONOS_CDN_URL: string;
1367
- NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
1368
- NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
1369
- NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
1370
- NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
1371
- NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
1372
- }, {
1373
- NEXT_PUBLIC_FLAG_URL: string;
1374
- NEXT_PUBLIC_RELEASE_DATE: string;
1375
- NEXT_PUBLIC_ZONOS_API_KEY: string;
1376
- NEXT_PUBLIC_ZONOS_CDNJS_CDN_URL: string;
1377
- NEXT_PUBLIC_ZONOS_CDN_URL: string;
1378
- NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: string;
1379
- NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: string;
1380
- NEXT_PUBLIC_ZONOS_PACKAGE_VERSION: string;
1381
- NEXT_PUBLIC_ZONOS_ROUTE_URL: string;
1382
- NEXT_PUBLIC_ZONOS_UNPKG_CDN_URL: string;
1383
- }>;
1384
- interface Env extends z.infer<typeof _envClientSchema> {
1385
- }
1386
-
1387
- /* eslint-disable no-relative-import-paths/no-relative-import-paths */
1388
-
1389
- declare global {
1390
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
1391
- interface Document {
1392
- addEventListener<K extends keyof CustomEventMap>(
1393
- type: K,
1394
- listener: (this: Document, ev: CustomEvent<CustomEventMap[K]>) => void,
1395
- ): void;
1396
- }
1397
-
1398
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
1399
- interface Window {
1400
- Stripe?: StripeConstructor;
1401
- Zonos: Zonos;
1402
- /**
1403
- * A flag to determine if the current page is a BigCommerce page
1404
- */
1405
- bcConfig?: unknown;
1406
- /**
1407
- * This flag would be set to true if zonosQaUrl is present in the query params and preview script loadZonos.js is injected to DOM
1408
- */
1409
- isZonosPreview?: boolean;
1410
- /**
1411
- * A flag to determine if the current page is a BigCommerce page
1412
- */
1413
- stencilBootstrap?: unknown;
1414
- }
1415
-
1416
- namespace NodeJS {
1417
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
1418
- interface ProcessEnv extends Env {}
1419
- }
1420
- }
1421
-
1422
- type TranslatedText = {
1423
- [key: string]: string;
1424
- };
1425
- type EnteredInfo = {
1426
- city: string;
1427
- country: CountryCode;
1428
- email: string;
1429
- line1: string;
1430
- line2: string;
1431
- name: string;
1432
- phone: string;
1433
- postal_code: string;
1434
- state: string;
1435
- };
1436
- type ValidateAddressFields = Omit<StripeAddressElementChangeEvent['value']['address'], 'country'> & {
1437
- name: string;
1438
- };
1439
- type TranslatedAddressObject = {
1440
- [key in keyof ValidateAddressFields]?: TranslatedText;
1441
- };
1442
-
1443
- type SubmitEventData = {
1444
- billingAddress: Record<keyof TranslatedAddressObject, string> | null;
1445
- shippingAddress: Record<keyof TranslatedAddressObject, string>;
1446
- };
1447
-
1448
- declare const colorPrefixes: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray", "glass"];
1449
- declare const colorContrasts: readonly ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"];
1450
- type ColorContrast = (typeof colorContrasts)[number];
1451
- type ColorPrefix = (typeof colorPrefixes)[number];
1452
- type Color = 'gray-0' | 'gray-50' | 'glass-0' | 'glass-50' | `${ColorPrefix}-${ColorContrast}` | 'gray-1000' | 'glass-1100' | 'glass-1200';
1453
- declare const checkboxColorPrefix: readonly ["blue", "cyan", "green", "orange", "purple", "red", "gray"];
1454
- type CheckboxColorPrefix = (typeof checkboxColorPrefix)[number];
1455
-
1456
- type BannerIntent = 'default' | 'error' | 'success' | 'warning' | 'info';
1457
-
1458
- declare const textOptions: {
1459
- readonly pageHeader: {
1460
- readonly label: "Page Header (3XL) · 34px (2.125rem)";
1461
- readonly size: "3xl";
1462
- readonly tag: "h2";
1463
- readonly weight: 900;
1464
- };
1465
- readonly secondaryPageHeader: {
1466
- readonly label: "Secondary Page Header (3XL) • 34px, 500 \"Medium\"";
1467
- readonly size: "3xl";
1468
- readonly tag: "h2";
1469
- readonly weight: 500;
1470
- };
1471
- readonly header: {
1472
- readonly label: "Header (2XL) · 28px (1.75rem)";
1473
- readonly size: "2xl";
1474
- readonly tag: "h3";
1475
- readonly weight: 700;
1476
- };
1477
- readonly descriptionHeader: {
1478
- readonly label: "Description Header (2XL) · 28px (1.75rem)";
1479
- readonly size: "2xl";
1480
- readonly tag: "h3";
1481
- readonly weight: 700;
1482
- };
1483
- readonly title: {
1484
- readonly label: "Title (XL) • 22px (1.375rem)";
1485
- readonly size: "xl";
1486
- readonly tag: "h4";
1487
- readonly weight: 600;
1488
- };
1489
- readonly boldSubheader: {
1490
- readonly label: "Bold Subheader (L) • 18px (1.125rem)";
1491
- readonly size: "l";
1492
- readonly tag: "h5";
1493
- readonly weight: 700;
1494
- };
1495
- readonly semiBoldSubheader: {
1496
- readonly label: "Semi Bold Subheader (L / H4) • 18px (1.125rem)";
1497
- readonly size: "l";
1498
- readonly tag: "h5";
1499
- readonly weight: 600;
1500
- };
1501
- readonly subheader: {
1502
- readonly label: "Subheader (L) • 18px (1.125rem)";
1503
- readonly size: "l";
1504
- readonly tag: "h5";
1505
- readonly weight: 500;
1506
- };
1507
- readonly boldLabel: {
1508
- readonly label: "Bold Label (Base) • 14px (.875rem)";
1509
- readonly size: "base";
1510
- readonly tag: "span";
1511
- readonly weight: 700;
1512
- };
1513
- readonly semiBoldLabel: {
1514
- readonly label: "Semi Bold Label (Base) • 14px (.875rem)";
1515
- readonly size: "base";
1516
- readonly tag: "span";
1517
- readonly weight: 600;
1518
- };
1519
- readonly label: {
1520
- readonly label: "Label (Base) • 14px (.875rem)";
1521
- readonly size: "base";
1522
- readonly tag: "span";
1523
- readonly weight: 500;
1524
- };
1525
- readonly body: {
1526
- readonly label: "Body (Base) • 14px (.875rem)";
1527
- readonly size: "base";
1528
- readonly tag: "span";
1529
- readonly weight: 400;
1530
- };
1531
- readonly smallHeader: {
1532
- readonly label: "Small header (S) • 12px (.75rem)";
1533
- readonly size: "s";
1534
- readonly tag: "span";
1535
- readonly weight: 600;
1536
- };
1537
- readonly caption: {
1538
- readonly label: "Caption (S) • 12px (.75rem)";
1539
- readonly size: "s";
1540
- readonly tag: "span";
1541
- readonly weight: 400;
1542
- };
1543
- readonly hintText: {
1544
- readonly label: "Hint text (XS) • 10px (.625rem)";
1545
- readonly size: "xs";
1546
- readonly tag: "span";
1547
- readonly weight: 400;
1548
- };
1549
- };
1550
- type TextOptions = typeof textOptions;
1551
- type Size = TextOptions[keyof TextOptions]['size'];
1552
- type Type = keyof TextOptions;
1553
- type FontWeight = TextOptions[keyof TextOptions]['weight'];
1554
-
1555
- type StripeStoreContactOption = {
1556
- address: {
1557
- city: string;
1558
- country: string;
1559
- line1: string;
1560
- line2?: string;
1561
- postal_code: string;
1562
- state: string;
1563
- };
1564
- email: string;
1565
- name: string;
1566
- phone?: string;
1567
- };
1568
-
1569
- type NotificationInit = {
1570
- message: string;
1571
- /**
1572
- * Time in milliseconds
1573
- * @default 4000
1574
- */
1575
- timeout?: number;
1576
- /**
1577
- * Type of notification
1578
- * @default 'success'
1579
- */
1580
- type?: 'error' | 'success' | 'warning';
1581
- };
1582
-
1583
- declare const localeElementsSupportedLocationCodeEnum: {
1584
- readonly Ar: "ar";
1585
- readonly Da: "da";
1586
- readonly De: "de";
1587
- readonly En: "en";
1588
- readonly Es: "es";
1589
- readonly Fr: "fr";
1590
- readonly He: "he";
1591
- readonly Id: "id";
1592
- readonly It: "it";
1593
- readonly Ja: "ja";
1594
- readonly Ko: "ko";
1595
- readonly Nl: "nl";
1596
- readonly No: "no";
1597
- readonly Pl: "pl";
1598
- readonly Pt: "pt";
1599
- readonly Ru: "ru";
1600
- readonly Sv: "sv";
1601
- readonly Tr: "tr";
1602
- readonly Vi: "vi";
1603
- readonly Zh: "zh";
1604
- };
1605
- type Locale_ElementsSupportedLocationCode_Enum = (typeof localeElementsSupportedLocationCodeEnum)[keyof typeof localeElementsSupportedLocationCodeEnum];
1606
-
1607
- type ICountry = {
1608
- bigcommerceDisplayName?: string;
1609
- code: CountryCode;
1610
- currencyCode: string;
1611
- displayName: string;
1612
- languageCode: Locale_ElementsSupportedLocationCode_Enum;
1613
- };
1614
- type ICountryJson = {
1615
- [countryCode: string]: ICountry;
1616
- };
1617
-
1618
- type Items = CheckItemRestrictionsMutation['itemRestrictionApply']['items'];
1619
- type RestrictedItem = Items[number] & {
1620
- name?: string;
1621
- };
1622
-
1623
- declare const restStateType: readonly ["Boxes", "Earth", "EmptyBox", "Lock", "PigBank", "Scribble", "Search", "Settings", "ShoppingCart", "SpilledCup", "Switch", "TaxId", "Truck", "Warning"];
1624
- type RestStateType = (typeof restStateType)[number];
1625
-
1626
- type ShippingRichRadioItem = {
1627
- amount: number;
1628
- caption?: string;
1629
- label: string;
1630
- landedCostId: string;
1631
- method: IncotermCode;
1632
- price: string;
1633
- shipmentRatingId: string;
1634
- sublabel?: string;
1635
- value: string | number;
1636
- };
1637
-
1638
- type SpinnerColor = 'primary' | 'info' | 'success' | 'danger' | 'warning' | 'black' | 'white';
1639
-
1640
- type ToggleItem<TValue> = {
1641
- isDisabled?: boolean;
1642
- label: string;
1643
- 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;
1644
1307
  };
1645
1308
 
1646
1309
  type GridSpacing = 0 | 4 | 8 | 12 | 16 | 20 | 24 | 32 | 40;
@@ -4538,6 +4201,73 @@ declare module "@stencil/core" {
4538
4201
  }
4539
4202
  }
4540
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
+
4541
4271
  type NormalizedItemAttribute = {
4542
4272
  key: string;
4543
4273
  value: string;
@@ -4556,31 +4286,301 @@ type NormalizedTempCartItem = {
4556
4286
  unitOfMeasure: ItemUnitOfMeasure;
4557
4287
  value: number;
4558
4288
  }[];
4559
- name: string | null;
4560
- productId: string | null;
4561
- quantity: number;
4562
- 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>;
4563
4508
  };
4564
- type NormalizedTempCart = {
4565
- adjustments: {
4566
- 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;
4567
4563
  currencyCode: CurrencyCode;
4568
- description: string | null;
4569
- productId: string | null;
4570
- promoCode?: string | null;
4571
- sku: string | null;
4572
- type: CartAdjustmentType;
4573
- }[];
4574
- createdAt: string;
4575
- credentialToken: string;
4576
- id: string;
4577
- items: NormalizedTempCartItem[];
4578
- metadata: {
4579
- key: string;
4580
- value: string;
4581
- }[];
4582
- storeBaseUrl: string;
4583
- 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;
4584
4584
  };
4585
4585
 
4586
4586
  /**