@zonos/elements 1.3.83 → 1.3.85

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 (144) hide show
  1. package/dist/cjs/{cart-4de3faca.js → cart-fc426d98.js} +94 -144
  2. package/dist/cjs/{createCustomEvent-65331eae.js → createCustomEvent-354c8e63.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{paypal-370b3a10.js → paypal-1fe5ed0c.js} +1 -1
  5. package/dist/cjs/zonos-address_7.cjs.entry.js +3 -3
  6. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +30 -13
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
  8. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-notification_3.cjs.entry.js +4 -4
  15. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +3 -1
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +12 -3
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -3
  18. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +2 -1
  19. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -2
  20. package/dist/collection/components/store/checkout/cart.js +0 -1
  21. package/dist/collection/components/store/checkout/stripe.js +4 -2
  22. package/dist/collection/components/store/hello/localization.js +6 -2
  23. package/dist/collection/components/store/translationStore/strings.arabic.js +4 -7
  24. package/dist/collection/components/store/translationStore/strings.base.js +4 -7
  25. package/dist/collection/components/store/translationStore/strings.chinese.js +4 -7
  26. package/dist/collection/components/store/translationStore/strings.danish.js +4 -7
  27. package/dist/collection/components/store/translationStore/strings.dutch.js +4 -7
  28. package/dist/collection/components/store/translationStore/strings.french.js +4 -7
  29. package/dist/collection/components/store/translationStore/strings.german.js +4 -7
  30. package/dist/collection/components/store/translationStore/strings.hebrew.js +4 -7
  31. package/dist/collection/components/store/translationStore/strings.indonesian.js +4 -7
  32. package/dist/collection/components/store/translationStore/strings.italian.js +4 -7
  33. package/dist/collection/components/store/translationStore/strings.japanese.js +4 -7
  34. package/dist/collection/components/store/translationStore/strings.korean.js +4 -7
  35. package/dist/collection/components/store/translationStore/strings.norwegian.js +4 -7
  36. package/dist/collection/components/store/translationStore/strings.polish.js +4 -7
  37. package/dist/collection/components/store/translationStore/strings.portuguese.js +4 -7
  38. package/dist/collection/components/store/translationStore/strings.russian.js +4 -7
  39. package/dist/collection/components/store/translationStore/strings.spanish.js +4 -7
  40. package/dist/collection/components/store/translationStore/strings.swedish.js +4 -7
  41. package/dist/collection/components/store/translationStore/strings.turkish.js +4 -7
  42. package/dist/collection/components/store/translationStore/strings.vietnamese.js +4 -7
  43. package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -3
  44. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -2
  45. package/dist/collection/components/utils/checkout/isDisabledCountry.js +0 -2
  46. package/dist/collection/components/utils/checkout/isShippableCountry.js +0 -2
  47. package/dist/collection/components/utils/getContrastColor.js +8 -3
  48. package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
  49. package/dist/esm/{cart-bdc45f59.js → cart-6c44367a.js} +94 -145
  50. package/dist/esm/{createCustomEvent-4db13122.js → createCustomEvent-ec15a4a7.js} +1 -1
  51. package/dist/esm/index.js +7 -7
  52. package/dist/esm/{paypal-1b29d424.js → paypal-a562a640.js} +1 -1
  53. package/dist/esm/zonos-address_7.entry.js +3 -3
  54. package/dist/esm/zonos-cart-items_12.entry.js +30 -13
  55. package/dist/esm/zonos-checkout.entry.js +9 -7
  56. package/dist/esm/zonos-controller.entry.js +1 -1
  57. package/dist/esm/zonos-country-flag.entry.js +1 -1
  58. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  59. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  60. package/dist/esm/zonos-hello.entry.js +1 -1
  61. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  62. package/dist/esm/zonos-notification_3.entry.js +4 -4
  63. package/dist/esm-es5/cart-6c44367a.js +1 -0
  64. package/dist/esm-es5/{createCustomEvent-4db13122.js → createCustomEvent-ec15a4a7.js} +1 -1
  65. package/dist/esm-es5/index.js +1 -1
  66. package/dist/esm-es5/{paypal-1b29d424.js → paypal-a562a640.js} +1 -1
  67. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  68. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  69. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  70. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  71. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  72. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  73. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  74. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  75. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  76. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  77. package/dist/scripts/index.js +1 -1
  78. package/dist/scripts/loadZonos.js +1 -1
  79. package/dist/scripts/zonos.js +1 -1
  80. package/dist/types/components/store/hello/localization.d.ts +4 -0
  81. package/dist/types/components/store/translationStore/strings.arabic.d.ts +2 -5
  82. package/dist/types/components/store/translationStore/strings.base.d.ts +2 -5
  83. package/dist/types/components/store/translationStore/strings.chinese.d.ts +2 -5
  84. package/dist/types/components/store/translationStore/strings.danish.d.ts +2 -5
  85. package/dist/types/components/store/translationStore/strings.dutch.d.ts +2 -5
  86. package/dist/types/components/store/translationStore/strings.french.d.ts +2 -5
  87. package/dist/types/components/store/translationStore/strings.german.d.ts +2 -5
  88. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +2 -5
  89. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +2 -5
  90. package/dist/types/components/store/translationStore/strings.italian.d.ts +2 -5
  91. package/dist/types/components/store/translationStore/strings.japanese.d.ts +2 -5
  92. package/dist/types/components/store/translationStore/strings.korean.d.ts +2 -5
  93. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +2 -5
  94. package/dist/types/components/store/translationStore/strings.polish.d.ts +2 -5
  95. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +2 -5
  96. package/dist/types/components/store/translationStore/strings.russian.d.ts +2 -5
  97. package/dist/types/components/store/translationStore/strings.spanish.d.ts +2 -5
  98. package/dist/types/components/store/translationStore/strings.swedish.d.ts +2 -5
  99. package/dist/types/components/store/translationStore/strings.turkish.d.ts +2 -5
  100. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +2 -5
  101. package/dist/types/components/store/translationStore.d.ts +1 -1
  102. package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -23
  103. package/dist/zonos-elements/index.esm.js +1 -1
  104. package/dist/zonos-elements/{p-a34f0674.entry.js → p-01604d44.entry.js} +1 -1
  105. package/dist/zonos-elements/{p-a6cff57f.system.js → p-08fee913.system.js} +1 -1
  106. package/dist/zonos-elements/{p-4ec7afc5.system.js → p-092961f1.system.js} +1 -1
  107. package/dist/zonos-elements/{p-2140ccb4.system.entry.js → p-133595ff.system.entry.js} +1 -1
  108. package/dist/zonos-elements/{p-2183128a.system.entry.js → p-1eb59b7c.system.entry.js} +1 -1
  109. package/dist/zonos-elements/{p-3457c5e8.system.entry.js → p-35b6b151.system.entry.js} +1 -1
  110. package/dist/zonos-elements/{p-017bf338.entry.js → p-3b3cb2a4.entry.js} +1 -1
  111. package/dist/zonos-elements/p-51e2df70.entry.js +1 -0
  112. package/dist/zonos-elements/{p-b0303b0e.entry.js → p-5ba198b3.entry.js} +1 -1
  113. package/dist/zonos-elements/{p-e3df5ff6.system.entry.js → p-5ebde561.system.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-9cfa3736.system.entry.js → p-63a33354.system.entry.js} +1 -1
  115. package/dist/zonos-elements/p-64b67900.entry.js +1 -0
  116. package/dist/zonos-elements/p-6b7fa35e.system.js +1 -0
  117. package/dist/zonos-elements/p-710ac059.js +1 -0
  118. package/dist/zonos-elements/{p-01d11845.system.entry.js → p-76013796.system.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-f1d043ad.system.entry.js → p-7b4a5b9b.system.entry.js} +1 -1
  120. package/dist/zonos-elements/p-95241447.entry.js +1 -0
  121. package/dist/zonos-elements/p-a26a8ca5.system.entry.js +1 -0
  122. package/dist/zonos-elements/{p-9b911f6f.entry.js → p-a858a304.entry.js} +1 -1
  123. package/dist/zonos-elements/{p-6aa35f18.entry.js → p-b5316c2c.entry.js} +1 -1
  124. package/dist/zonos-elements/{p-a1fa0a1c.system.js → p-b9645c27.system.js} +1 -1
  125. package/dist/zonos-elements/p-c37b99dd.system.entry.js +1 -0
  126. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  127. package/dist/zonos-elements/{p-7cc5e325.js → p-cbb742ab.js} +1 -1
  128. package/dist/zonos-elements/p-d7b341e3.system.entry.js +1 -0
  129. package/dist/zonos-elements/p-de6c2a4a.entry.js +1 -0
  130. package/dist/zonos-elements/{p-771e2623.entry.js → p-e78c2429.entry.js} +1 -1
  131. package/dist/zonos-elements/p-ee8b5e53.js +1 -0
  132. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  133. package/package.json +1 -1
  134. package/dist/esm-es5/cart-bdc45f59.js +0 -1
  135. package/dist/zonos-elements/p-00bb8221.system.entry.js +0 -1
  136. package/dist/zonos-elements/p-0cc8c6a3.system.js +0 -1
  137. package/dist/zonos-elements/p-278d61ed.js +0 -1
  138. package/dist/zonos-elements/p-2b60faf8.entry.js +0 -1
  139. package/dist/zonos-elements/p-3347e142.entry.js +0 -1
  140. package/dist/zonos-elements/p-5fb337a0.entry.js +0 -1
  141. package/dist/zonos-elements/p-7f3aeb53.system.entry.js +0 -1
  142. package/dist/zonos-elements/p-844ec9f9.system.entry.js +0 -1
  143. package/dist/zonos-elements/p-c6350880.entry.js +0 -1
  144. package/dist/zonos-elements/p-ce41cbde.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { h, Host, } from "@stencil/core";
2
2
  import { stripeStore } from "../../store/checkout/stripe";
3
- import { localizationStore } from "../../store/hello/localization";
3
+ import { DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT, localizationStore, } from "../../store/hello/localization";
4
4
  import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
5
5
  import { logError } from "../../utils/logging/logError";
6
6
  /**
@@ -72,7 +72,7 @@ export class ZonosAddress {
72
72
  defaultValues: {
73
73
  address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
74
74
  localizationStore.selectedCountryCode ||
75
- 'AL' }),
75
+ DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
76
76
  firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
77
77
  lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
78
78
  phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
@@ -135,7 +135,7 @@ export class ZonosAddress {
135
135
  }
136
136
  render() {
137
137
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
138
- return (h(Host, { key: 'c8d513bc9890590db622ec8f26d4e9b0694c33e5', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '775b454620360bed4186a23371bc3867a5745155', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '4844b5379a33a3668cae0036c1a952cd42229efb', class: "zonos--address-component" })));
138
+ return (h(Host, { key: 'aa9a569b302099681082cd4219b553f9c70842ea', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '60050e9f8f0b80dde9acc9ffbd868333fdabf2b3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '5af7ee4f23d75fc877cdde7babe0edaefef14da8', class: "zonos--address-component" })));
139
139
  }
140
140
  static get is() { return "zonos-address"; }
141
141
  static get encapsulation() { return "scoped"; }
@@ -17,7 +17,7 @@ export class ZonosPayment {
17
17
  // Create and mount the Authentication Element in ${type} mode
18
18
  const paymentElement = stripeStore.stripePaymentElement ||
19
19
  this.stripeElements.create('payment', {
20
- layout: 'accordion',
20
+ layout: 'tabs',
21
21
  });
22
22
  const paymentElementContainer = this.el.querySelector('.zonos--payment-component');
23
23
  if (!paymentElementContainer) {
@@ -36,7 +36,7 @@ export class ZonosPayment {
36
36
  }
37
37
  render() {
38
38
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
39
- return (h(Host, { key: 'c461a967d00b2d96fa70aaaf1651b435cdcd84bd', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: '44da1d89ce19f7174cad1214ab9463f0b1174c0d', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: 'b9e3491b48d9ede19a5cdef639bd47e6bf0ba742', class: "zonos--payment-component" }), h("div", { key: '578516ce1ca1dc01eebb2268bb5449613e14298f', class: "zonos--payment-paypal-container" })));
39
+ return (h(Host, { key: 'cf616ec959fd1b7396ed86b23561f459e0da8722', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: 'e5564db71ba2c0d67d372cb1804d6d462cdf1b33', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '3ea47f2c0a541590210d181bc73ecb3fb27e7783', class: "zonos--payment-component" }), h("div", { key: 'd3a46a127448568caf4309806e88556594075c12', class: "zonos--payment-paypal-container" })));
40
40
  }
41
41
  static get is() { return "zonos-payment"; }
42
42
  static get encapsulation() { return "scoped"; }
@@ -1,12 +1,10 @@
1
1
  import { localizationStore } from "../../store/hello/localization";
2
- import { createCustomEvent } from "../createCustomEvent";
3
2
  import { log } from "../logging/log";
4
3
  export const isDisabledCountry = (showLog = true) => {
5
4
  if (!localizationStore.localizationLoaded) {
6
5
  return true;
7
6
  }
8
7
  if (localizationStore.isDisabledCountry) {
9
- document.dispatchEvent(createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country that has been disabled for checkout'));
10
8
  if (showLog) {
11
9
  log(`Checkout: disabled country`);
12
10
  }
@@ -1,5 +1,4 @@
1
1
  import { localizationStore } from "../../store/hello/localization";
2
- import { createCustomEvent } from "../createCustomEvent";
3
2
  import { log } from "../logging/log";
4
3
  export const isShippableCountry = (showLog = true) => {
5
4
  if (!localizationStore.localizationLoaded) {
@@ -7,7 +6,6 @@ export const isShippableCountry = (showLog = true) => {
7
6
  }
8
7
  // if localization is loaded and the localization is not a shippable country, keep the original click event
9
8
  if (!localizationStore.isShippableCountry) {
10
- document.dispatchEvent(createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country where shipping is not available'));
11
9
  if (showLog) {
12
10
  log(`Checkout: not shippable country`);
13
11
  }
@@ -14,7 +14,12 @@ export const getContrastColor = ({ backgroundColor, color, }) => {
14
14
  if (isDarkColor(color)) {
15
15
  return '#ffffff';
16
16
  }
17
- else {
18
- return tinycolor(color).darken(25).toHexString();
19
- }
17
+ const newDarkerColor = tinycolor(color).darken(25).toHexString();
18
+ const newLigherColor = tinycolor(color).lighten(25).toHexString();
19
+ // get readibility of the color
20
+ const isNewColorContrastEnough = isContrastColor({
21
+ backgroundColor1: backgroundColor,
22
+ backgroundColor2: newDarkerColor,
23
+ });
24
+ return isNewColorContrastEnough ? newDarkerColor : newLigherColor;
20
25
  };
@@ -29,6 +29,10 @@ export const addressRuleStyle = ({ theme, }) => {
29
29
  '.PickerItem--new': {
30
30
  color: 'var(--colorText)',
31
31
  },
32
+ '.Tab--selected': {
33
+ borderStyle: 'solid',
34
+ borderWidth: '1px',
35
+ },
32
36
  };
33
37
  switch (theme) {
34
38
  case 'DARK': {