@zonos/elements 1.3.11-alpha.0 → 1.3.11-alpha.1
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.
- package/dist/cjs/{cart-7e28f026.js → cart-d9e9ecfc.js} +29 -25
- package/dist/cjs/{getBorderRadius-d795f526.js → getBorderRadius-9d619bf6.js} +1 -1
- package/dist/cjs/getContrastColor-af2386af.js +20 -0
- package/dist/cjs/{isColorVariable-41cacd82.js → isColorVariable-fff5e469.js} +1 -1
- package/dist/cjs/{isDarkColor-33fb96a7.js → isDarkColor-a68274cf.js} +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{submitGtag-586d3206.js → submitGtag-b7ef5d5b.js} +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +11 -11
- package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/{zonos-button_3.cjs.entry.js → zonos-button_2.cjs.entry.js} +34 -36
- package/dist/cjs/zonos-card_2.cjs.entry.js +8 -8
- package/dist/cjs/{zonos-cart-items_9.cjs.entry.js → zonos-cart-items_10.cjs.entry.js} +161 -48
- package/dist/cjs/zonos-checkout.cjs.entry.js +20 -22
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +9 -9
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
- package/dist/cjs/zonos-icon.cjs.entry.js +39 -0
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +3 -3
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +13 -4
- package/dist/cjs/zonos-text.cjs.entry.js +6 -2
- package/dist/cjs/{zonosStore-d3f0173b.js → zonosStore-21334303.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +32 -22
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +76 -16
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +2 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +15 -17
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +43 -24
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +1 -1
- package/dist/collection/components/common/zonos-button/zonos-button.js +18 -4
- package/dist/collection/components/common/zonos-card/zonos-card.js +2 -2
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/assets/TabCheckmark.svg +3 -0
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.css +102 -0
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +193 -0
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +1 -1
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +1 -1
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -28
- package/dist/collection/components/common/zonos-icon/zonos-icon.js +7 -3
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +4 -4
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +27 -1
- package/dist/collection/components/common/zonos-text/zonos-text.js +7 -3
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +1 -1
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +26 -0
- package/dist/collection/components/store/zonosStore.js +1 -1
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/getContrastColor.js +16 -0
- package/dist/collection/components/utils/isColorVariable.js +1 -1
- package/dist/collection/components/utils/styles.js +12 -0
- package/dist/components/getContrastColor.js +18 -0
- package/dist/components/isColorVariable.js +1 -1
- package/dist/components/isDarkColor.js +1 -1
- package/dist/components/stripe.js +27 -22
- package/dist/components/trackConversionEvent.js +1 -1
- package/dist/components/zonos-address2.js +1 -1
- package/dist/components/zonos-badge2.js +3 -3
- package/dist/components/zonos-button2.js +30 -4
- package/dist/components/zonos-card2.js +2 -2
- package/dist/components/zonos-checkbox2.js +3 -3
- package/dist/components/zonos-checkout-finish2.js +1 -1
- package/dist/components/zonos-checkout-footer2.js +33 -17
- package/dist/components/zonos-checkout-progress-tabs.d.ts +11 -0
- package/dist/components/zonos-checkout-progress-tabs.js +6 -0
- package/dist/components/zonos-checkout-progress-tabs2.js +122 -0
- package/dist/components/zonos-checkout.js +44 -40
- package/dist/components/zonos-collapse2.js +2 -2
- package/dist/components/zonos-component.js +1 -1
- package/dist/components/zonos-controller.js +2 -2
- package/dist/components/zonos-country-select2.js +2 -2
- package/dist/components/zonos-custom-message2.js +1 -1
- package/dist/components/zonos-dialog2.js +4 -6
- package/dist/components/zonos-hello-dialog-footer2.js +2 -2
- package/dist/components/zonos-hello-dialog2.js +2 -2
- package/dist/components/zonos-hello.js +1 -1
- package/dist/components/zonos-icon2.js +5 -1
- package/dist/components/zonos-language-select2.js +3 -3
- package/dist/components/zonos-link-authentication2.js +1 -1
- package/dist/components/zonos-link.js +1 -1
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-payment2.js +1 -1
- package/dist/components/zonos-review2.js +1 -1
- package/dist/components/zonos-select-dialog-header2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +11 -1
- package/dist/components/zonos-shipping2.js +44 -25
- package/dist/components/zonos-text2.js +5 -1
- package/dist/components/zonos-tooltip2.js +2 -2
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/components/zonosStore.js +1 -1
- package/dist/esm/{cart-5a88b4f3.js → cart-6cfd7560.js} +30 -25
- package/dist/esm/{getBorderRadius-5d750ab8.js → getBorderRadius-c5fb7746.js} +1 -1
- package/dist/esm/getContrastColor-a1a6f6aa.js +18 -0
- package/dist/esm/{isColorVariable-91c33804.js → isColorVariable-fbf2d80d.js} +1 -1
- package/dist/esm/{isDarkColor-c34dfed9.js → isDarkColor-810fcaa5.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{submitGtag-289ddd8b.js → submitGtag-acca574d.js} +2 -2
- package/dist/esm/zonos-address_4.entry.js +11 -11
- package/dist/esm/zonos-badge_2.entry.js +6 -6
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/{zonos-button_3.entry.js → zonos-button_2.entry.js} +35 -36
- package/dist/esm/zonos-card_2.entry.js +8 -8
- package/dist/esm/{zonos-cart-items_9.entry.js → zonos-cart-items_10.entry.js} +161 -49
- package/dist/esm/zonos-checkout.entry.js +20 -22
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +5 -5
- package/dist/esm/zonos-country-flag.entry.js +4 -4
- package/dist/esm/zonos-country-select_3.entry.js +9 -9
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +4 -4
- package/dist/esm/zonos-icon.entry.js +35 -0
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +3 -3
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +5 -5
- package/dist/esm/zonos-select-dialog-header_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +13 -4
- package/dist/esm/zonos-text.entry.js +6 -2
- package/dist/esm/{zonosStore-aac7c6ac.js → zonosStore-e5f3d4da.js} +1 -1
- package/dist/esm-es5/{cart-5a88b4f3.js → cart-6cfd7560.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-5d750ab8.js → getBorderRadius-c5fb7746.js} +1 -1
- package/dist/esm-es5/getContrastColor-a1a6f6aa.js +1 -0
- package/dist/esm-es5/isColorVariable-fbf2d80d.js +1 -0
- package/dist/esm-es5/{isDarkColor-c34dfed9.js → isDarkColor-810fcaa5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{submitGtag-289ddd8b.js → submitGtag-acca574d.js} +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_2.entry.js +1 -0
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -0
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-icon.entry.js +1 -0
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-aac7c6ac.js → zonosStore-e5f3d4da.js} +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.d.ts +14 -2
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +0 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.d.ts +7 -0
- package/dist/types/components/common/zonos-button/zonos-button.d.ts +1 -0
- package/dist/types/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.d.ts +29 -0
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +0 -5
- package/dist/types/components/common/zonos-icon/zonos-icon.d.ts +3 -1
- package/dist/types/components/common/zonos-logo/zonos-logo.d.ts +1 -1
- package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +5 -0
- package/dist/types/components/common/zonos-text/zonos-text.d.ts +3 -1
- package/dist/types/components/store/checkout/cart.d.ts +10 -1
- package/dist/types/components/utils/getContrastColor.d.ts +4 -0
- package/dist/types/components/utils/isColorVariable.d.ts +1 -1
- package/dist/types/components/utils/styles.d.ts +7 -0
- package/dist/types/components.d.ts +67 -14
- package/dist/zonos-elements/assets/TabCheckmark.svg +3 -0
- package/dist/zonos-elements/p-0b51de7b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d7690752.system.entry.js → p-0dfd549e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c1e54094.system.js → p-0f414d6a.system.js} +1 -1
- package/dist/zonos-elements/{p-723628b7.js → p-0f8acb62.js} +1 -1
- package/dist/zonos-elements/{p-27d57265.system.entry.js → p-20b080d1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7e355496.system.entry.js → p-212992ec.system.entry.js} +1 -1
- package/dist/zonos-elements/p-22db99c9.system.entry.js +1 -0
- package/dist/zonos-elements/{p-14bf3658.entry.js → p-26aee7a0.entry.js} +1 -1
- package/dist/zonos-elements/{p-c6de2e40.system.entry.js → p-2d5a6a7f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ca6b4c1e.system.entry.js → p-2fdec8bc.system.entry.js} +1 -1
- package/dist/zonos-elements/p-352ba771.system.js +1 -0
- package/dist/zonos-elements/p-4051a42d.js +1 -0
- package/dist/zonos-elements/p-5162f4cc.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d0d12a64.entry.js → p-51c32b3d.entry.js} +1 -1
- package/dist/zonos-elements/{p-4569bc92.js → p-55b8b98b.js} +1 -1
- package/dist/zonos-elements/p-59595553.entry.js +1 -0
- package/dist/zonos-elements/p-5a40684c.entry.js +1 -0
- package/dist/zonos-elements/{p-25fbcefe.system.entry.js → p-60ac5342.system.entry.js} +1 -1
- package/dist/zonos-elements/p-61e08de7.system.entry.js +1 -0
- package/dist/zonos-elements/{p-e969cec9.entry.js → p-65a877e2.entry.js} +1 -1
- package/dist/zonos-elements/{p-d2885590.system.js → p-66cc1554.system.js} +1 -1
- package/dist/zonos-elements/p-6a80f7f5.entry.js +1 -0
- package/dist/zonos-elements/{p-5f2cb4b6.entry.js → p-6daa64bf.entry.js} +1 -1
- package/dist/zonos-elements/{p-77727098.system.js → p-6db032ee.system.js} +1 -1
- package/dist/zonos-elements/{p-188ddbe2.entry.js → p-6dc606c6.entry.js} +1 -1
- package/dist/zonos-elements/p-6e81adba.system.js +1 -1
- package/dist/zonos-elements/{p-4ad5f307.system.entry.js → p-7e00a5dc.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a725946f.entry.js → p-817e7f8e.entry.js} +1 -1
- package/dist/zonos-elements/{p-dad00ad3.system.entry.js → p-824b8708.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-770384fa.system.entry.js → p-9a2c3874.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-edbea8df.system.js → p-9db2f9d1.system.js} +1 -1
- package/dist/zonos-elements/{p-77c54b83.js → p-a1a477c9.js} +1 -1
- package/dist/zonos-elements/{p-93e51987.system.entry.js → p-a398bc59.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-febddb45.entry.js → p-a641dfcd.entry.js} +1 -1
- package/dist/zonos-elements/p-a7bfe188.entry.js +1 -0
- package/dist/zonos-elements/{p-9db3028d.entry.js → p-ac7155d7.entry.js} +1 -1
- package/dist/zonos-elements/{p-6181f2d5.entry.js → p-ad499520.entry.js} +1 -1
- package/dist/zonos-elements/{p-a578facf.entry.js → p-b0e9226a.entry.js} +1 -1
- package/dist/zonos-elements/{p-d9c65636.system.js → p-b1ee44c6.system.js} +1 -1
- package/dist/zonos-elements/{p-e392e212.system.entry.js → p-b2c48954.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-315c1fc2.entry.js → p-b62aee3d.entry.js} +1 -1
- package/dist/zonos-elements/p-b76909ab.entry.js +1 -0
- package/dist/zonos-elements/{p-333da541.entry.js → p-b9cde0c3.entry.js} +1 -1
- package/dist/zonos-elements/{p-482371fb.system.entry.js → p-c4862aab.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c6e44a9b.entry.js +1 -0
- package/dist/zonos-elements/p-cde25873.js +1 -0
- package/dist/zonos-elements/p-d96f8d89.system.entry.js +1 -0
- package/dist/zonos-elements/p-e2131057.entry.js +1 -0
- package/dist/zonos-elements/p-e28ed57c.js +1 -0
- package/dist/zonos-elements/{p-49a5be72.js → p-e74f27da.js} +1 -1
- package/dist/zonos-elements/{p-afcded5d.system.js → p-ed4d8d71.system.js} +1 -1
- package/dist/zonos-elements/{p-0b4910fe.system.entry.js → p-f62b49aa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a87803b7.system.entry.js → p-f8b03017.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8445a084.system.entry.js → p-fac20c60.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e4e1ca2f.system.entry.js → p-fd8c50e8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d5a9dfc7.entry.js → p-ff17c03b.entry.js} +1 -1
- package/dist/zonos-elements/p-ff962844.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/isColorVariable-91c33804.js +0 -1
- package/dist/esm-es5/zonos-button_3.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +0 -1
- package/dist/zonos-elements/p-144f4d31.entry.js +0 -1
- package/dist/zonos-elements/p-4c414a92.js +0 -1
- package/dist/zonos-elements/p-5c991faa.system.entry.js +0 -1
- package/dist/zonos-elements/p-691d8075.entry.js +0 -1
- package/dist/zonos-elements/p-87c4ac09.system.entry.js +0 -1
- package/dist/zonos-elements/p-9f532a3f.entry.js +0 -1
- package/dist/zonos-elements/p-afc0460d.entry.js +0 -1
- package/dist/zonos-elements/p-dd153a4e.entry.js +0 -1
- package/dist/zonos-elements/p-def8823e.entry.js +0 -1
- package/dist/zonos-elements/p-e4749f19.js +0 -1
- package/dist/zonos-elements/p-e87e8c9c.system.entry.js +0 -1
- package/dist/zonos-elements/p-f1170e7b.entry.js +0 -1
- package/dist/zonos-elements/p-fe0930e4.system.entry.js +0 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { cartStore, } from "../../store/checkout/cart";
|
|
3
|
+
import { zonosStore } from "../../store/zonosStore";
|
|
4
|
+
import { classes } from "../../utils/classes";
|
|
5
|
+
import { getContrastColor } from "../../utils/getContrastColor";
|
|
6
|
+
import { isColorVariable } from "../../utils/isColorVariable";
|
|
7
|
+
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
8
|
+
import TabCheckmark from "./assets/TabCheckmark.svg";
|
|
9
|
+
export class ZonosCheckoutProgressTabs {
|
|
10
|
+
constructor() {
|
|
11
|
+
/**
|
|
12
|
+
* The total number of steps that's done
|
|
13
|
+
*/
|
|
14
|
+
this.getTotalSuccessStep = () => {
|
|
15
|
+
// include the finish step
|
|
16
|
+
const totalSteps = 4;
|
|
17
|
+
const stepDone = Object.values(cartStore.tabItems).filter(tab => tab.isDone).length + 1;
|
|
18
|
+
return `${(stepDone / totalSteps) * 100}%`;
|
|
19
|
+
};
|
|
20
|
+
this.isTabClickable = (tabValue) => {
|
|
21
|
+
const currentTab = cartStore.tabItems[tabValue];
|
|
22
|
+
if (!currentTab) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
// clickable if the tab state is done
|
|
26
|
+
if (currentTab.isDone) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
// if any of the previous tabs are not done, the tab is not clickable
|
|
30
|
+
return Object.values(cartStore.tabItems)
|
|
31
|
+
.slice(0, currentTab.index - 1)
|
|
32
|
+
.every(tab => tab.isDone);
|
|
33
|
+
};
|
|
34
|
+
this.tabColor = null;
|
|
35
|
+
this.backgroundColor = null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Set the tab items data. This is to be used in storybook
|
|
39
|
+
*/
|
|
40
|
+
async setTabItems(tabItems) {
|
|
41
|
+
cartStore.tabItems = tabItems;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Set selected tab. Only set the tab if it's clickable
|
|
45
|
+
*/
|
|
46
|
+
async setTabSelected(tabValue) {
|
|
47
|
+
if (this.isTabClickable(tabValue)) {
|
|
48
|
+
cartStore.step = tabValue;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const selectedStep = cartStore.step;
|
|
53
|
+
const labelSelectedColor = this.tabColor || zonosStore.appearance.colorSecondary;
|
|
54
|
+
// If the background color and the tab color are not contrat enough, increase the contrast of the label color
|
|
55
|
+
const contrastLabelColor = this.backgroundColor && labelSelectedColor
|
|
56
|
+
? getContrastColor({
|
|
57
|
+
backgroundColor: isColorVariable(this.backgroundColor)
|
|
58
|
+
? window
|
|
59
|
+
.getComputedStyle(this.ele)
|
|
60
|
+
.getPropertyValue(`--amino-${this.backgroundColor.replace('--amino-', '')}`)
|
|
61
|
+
: this.backgroundColor,
|
|
62
|
+
color: labelSelectedColor,
|
|
63
|
+
})
|
|
64
|
+
: labelSelectedColor;
|
|
65
|
+
return (h(Host, { key: '1fd6d6cb0f4e819f7e0a204fdc1bccbd2753154c', class: "zonos--elements", "data-theme": zonosStore.appearance.theme, style: {
|
|
66
|
+
'--color': contrastLabelColor,
|
|
67
|
+
'--progress-percent': this.getTotalSuccessStep(),
|
|
68
|
+
} }, h("div", { key: 'e7b0c9e9376461461286856553381d20bdd50bb6', class: "zonos--tab-wrapper" }, Object.values(cartStore.tabItems).map((tab, index) => {
|
|
69
|
+
const isSelected = tab.value === selectedStep;
|
|
70
|
+
return (h("button", { class: classes([
|
|
71
|
+
'zonos--tab-item',
|
|
72
|
+
tab.value === selectedStep && 'selected',
|
|
73
|
+
tab.isDone && 'done',
|
|
74
|
+
]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => (cartStore.step = tab.value) }, h("div", { class: "zonos--tab-index" }, h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1200', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1200' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1200', type: "label" }, tab.label)));
|
|
75
|
+
})), h("div", { key: 'e924379e523d61952e3db826daeb080917c5b468', class: "zonos--tab-progress" }, h("div", { key: '80d193a8f2099a6eb552c1c016be545b9120c6d1', class: "zonos--progress-bar-fill" }))));
|
|
76
|
+
}
|
|
77
|
+
static get is() { return "zonos-checkout-progress-tabs"; }
|
|
78
|
+
static get encapsulation() { return "shadow"; }
|
|
79
|
+
static get originalStyleUrls() {
|
|
80
|
+
return {
|
|
81
|
+
"$": ["zonos-checkout-progress-tabs.scss"]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
static get styleUrls() {
|
|
85
|
+
return {
|
|
86
|
+
"$": ["zonos-checkout-progress-tabs.css"]
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
static get assetsDirs() { return ["assets"]; }
|
|
90
|
+
static get properties() {
|
|
91
|
+
return {
|
|
92
|
+
"tabColor": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "string | null",
|
|
97
|
+
"resolved": "null | string | undefined",
|
|
98
|
+
"references": {}
|
|
99
|
+
},
|
|
100
|
+
"required": false,
|
|
101
|
+
"optional": true,
|
|
102
|
+
"docs": {
|
|
103
|
+
"tags": [],
|
|
104
|
+
"text": "Color of the tab progress bar and label, override the secondary color of the appearance settings"
|
|
105
|
+
},
|
|
106
|
+
"attribute": "tab-color",
|
|
107
|
+
"reflect": false,
|
|
108
|
+
"defaultValue": "null"
|
|
109
|
+
},
|
|
110
|
+
"backgroundColor": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "Color | (string & { _placeholder?: never }) | null",
|
|
115
|
+
"resolved": "Color | (string & { _placeholder?: undefined; }) | null | undefined",
|
|
116
|
+
"references": {
|
|
117
|
+
"Color": {
|
|
118
|
+
"location": "import",
|
|
119
|
+
"path": "src/types/styles/Color",
|
|
120
|
+
"id": "src/types/styles/Color.ts::Color"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"required": false,
|
|
125
|
+
"optional": true,
|
|
126
|
+
"docs": {
|
|
127
|
+
"tags": [],
|
|
128
|
+
"text": "Background color of the parent that's wrapped around the tab progress bar"
|
|
129
|
+
},
|
|
130
|
+
"attribute": "background-color",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "null"
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
static get methods() {
|
|
137
|
+
return {
|
|
138
|
+
"setTabItems": {
|
|
139
|
+
"complexType": {
|
|
140
|
+
"signature": "(tabItems: TabItems) => Promise<void>",
|
|
141
|
+
"parameters": [{
|
|
142
|
+
"name": "tabItems",
|
|
143
|
+
"type": "{ \"customer-info\": TabItem; shipping: TabItem; payment: TabItem; }",
|
|
144
|
+
"docs": ""
|
|
145
|
+
}],
|
|
146
|
+
"references": {
|
|
147
|
+
"Promise": {
|
|
148
|
+
"location": "global",
|
|
149
|
+
"id": "global::Promise"
|
|
150
|
+
},
|
|
151
|
+
"TabItems": {
|
|
152
|
+
"location": "import",
|
|
153
|
+
"path": "src/components/store/checkout/cart",
|
|
154
|
+
"id": "src/components/store/checkout/cart.ts::TabItems"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"return": "Promise<void>"
|
|
158
|
+
},
|
|
159
|
+
"docs": {
|
|
160
|
+
"text": "Set the tab items data. This is to be used in storybook",
|
|
161
|
+
"tags": []
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"setTabSelected": {
|
|
165
|
+
"complexType": {
|
|
166
|
+
"signature": "(tabValue: TabItem['value']) => Promise<void>",
|
|
167
|
+
"parameters": [{
|
|
168
|
+
"name": "tabValue",
|
|
169
|
+
"type": "\"customer-info\" | \"shipping\" | \"payment\"",
|
|
170
|
+
"docs": ""
|
|
171
|
+
}],
|
|
172
|
+
"references": {
|
|
173
|
+
"Promise": {
|
|
174
|
+
"location": "global",
|
|
175
|
+
"id": "global::Promise"
|
|
176
|
+
},
|
|
177
|
+
"TabItem": {
|
|
178
|
+
"location": "import",
|
|
179
|
+
"path": "src/components/store/checkout/cart",
|
|
180
|
+
"id": "src/components/store/checkout/cart.ts::TabItem"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"return": "Promise<void>"
|
|
184
|
+
},
|
|
185
|
+
"docs": {
|
|
186
|
+
"text": "Set selected tab. Only set the tab if it's clickable",
|
|
187
|
+
"tags": []
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
static get elementRef() { return "ele"; }
|
|
193
|
+
}
|
|
@@ -42,10 +42,10 @@ export class ZonosCollapse {
|
|
|
42
42
|
// set overflow to hidden to prevent content from showing when collapsed
|
|
43
43
|
this.el.style.overflow = 'hidden';
|
|
44
44
|
}
|
|
45
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '032f5818dd8394b5111927907c8fa135a55fef5c', class: 'zonos--elements zonos--collapse', style: {
|
|
46
46
|
'--font-family': zonosStoreFontFamily(),
|
|
47
47
|
height: this.getElementHeight(),
|
|
48
|
-
} }, h("div", { key: '
|
|
48
|
+
} }, h("div", { key: '5ddbf406c93f37c9e23375f11dd8439934c0d2a5' }, h("iframe", { key: 'b3efa8bc198918dbb3284e8ce658ffca6249eaa8', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: 'ffcd123c3a046e62855a650da9972cde94a7774c' }))));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "zonos-collapse"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -35,9 +35,9 @@ export class ZonosCountrySelect {
|
|
|
35
35
|
const filteredCountries = this.inputValue
|
|
36
36
|
? fuseObject.map(country => country.item)
|
|
37
37
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
38
|
-
return (h(Host, { key: '
|
|
38
|
+
return (h(Host, { key: '0024a7061a593cf3c92fd7f6b5916aaac3a835c9', class: "zonos--elements", style: {
|
|
39
39
|
'--font-family': zonosStoreFontFamily(),
|
|
40
|
-
} }, h("div", { key: '
|
|
40
|
+
} }, h("div", { key: 'e6ef5d8cc13e731c94ee5ef037c02eac36d9bce6', class: "zonos--country-select" }, h("zonos-v-stack", { key: 'f698da7688757b6728e99e0cecb21ac4ce586d30', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: 'd37801e6023262a582d3ecc6e3a39f505f7e82b8', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, h("input", { key: '6f053c963f5e25b5285a94070336650537bbdad3', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), h("div", { key: '3d3e180b204bf9fa0893fec7839f1d0d5c4740c1', class: "zonos--country-select-content" }, filteredCountries.map(country => (h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === localizationStore.selectedCountryCode && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 })))))))));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "zonos-country-select"; }
|
|
43
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -8,7 +8,7 @@ export class ZonosCustomMessage {
|
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
10
|
const messageWithLinks = formatStringWithLinks(this.message);
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: 'b09b7025fb55c4323aaa24ccb7e410d1638bed8a', class: "zonos--elements", style: {
|
|
12
12
|
'--font-family': zonosStoreFontFamily(),
|
|
13
13
|
} }, this.message && (h("zonos-card", { class: "zonos--custom-message", spacing: "12px" }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { innerHTML: messageWithLinks }))))));
|
|
14
14
|
}
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
justify-content: center;
|
|
61
61
|
z-index: 10002;
|
|
62
62
|
background: white;
|
|
63
|
+
border-radius: var(--border-radius, var(--amino-radius-10));
|
|
63
64
|
}
|
|
64
65
|
:host .zonos--dialog-layout {
|
|
65
66
|
width: 100vw;
|
|
@@ -86,7 +87,6 @@
|
|
|
86
87
|
outline: none;
|
|
87
88
|
box-shadow: var(--amino-v3-shadow-xxl);
|
|
88
89
|
border: var(--amino-border);
|
|
89
|
-
overflow: hidden;
|
|
90
90
|
display: flex;
|
|
91
91
|
flex-direction: column;
|
|
92
92
|
}
|
|
@@ -25,7 +25,6 @@ export class ZonosDialog {
|
|
|
25
25
|
this.noHeader = false;
|
|
26
26
|
this.noBodyPadding = false;
|
|
27
27
|
this.noBorder = false;
|
|
28
|
-
this.footerRightAction = null;
|
|
29
28
|
this.borderStyle = undefined;
|
|
30
29
|
this.noCloseButton = false;
|
|
31
30
|
this.noClickOutside = false;
|
|
@@ -48,7 +47,7 @@ export class ZonosDialog {
|
|
|
48
47
|
document.body.style.overflow = 'auto';
|
|
49
48
|
}
|
|
50
49
|
const borderStyle = getBorderRadius(this.borderStyle);
|
|
51
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: '6bda73bd75e6bc31e73ad53849a51752396ee42d', class: classes([
|
|
52
51
|
'zonos--elements',
|
|
53
52
|
this.open && 'open',
|
|
54
53
|
this.isLoading && 'is-loading',
|
|
@@ -59,10 +58,10 @@ export class ZonosDialog {
|
|
|
59
58
|
'--font-family': zonosStoreFontFamily(),
|
|
60
59
|
'--height': this.height || 'initial',
|
|
61
60
|
'--width': this.width,
|
|
62
|
-
} }, h("div", { key: '
|
|
61
|
+
} }, h("div", { key: 'cd3ff21820f95faee3f16e23a272e080bd7930c8', class: "zonos--backdrop" }), h("div", { key: '85af066de976e3b29505c8804e544ca0a1f8a012', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: '389491715fcb12f9c86b744e2e9c20930a2a9f25', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: 'a28ad12faab02ef30769a3234b24e749b38c46b4', class: classes([
|
|
63
62
|
'zonos--body',
|
|
64
63
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
65
|
-
]) }, h("slot", { key: '
|
|
64
|
+
]) }, h("slot", { key: '7da31d739197a17ae94df1909c93f70c1282da95' })), h("slot", { key: 'fe02670713895b786dfa6b0c30ad6553c32796cd', name: "dialog-footer" })))));
|
|
66
65
|
}
|
|
67
66
|
static get is() { return "zonos-dialog"; }
|
|
68
67
|
static get encapsulation() { return "shadow"; }
|
|
@@ -219,30 +218,6 @@ export class ZonosDialog {
|
|
|
219
218
|
"reflect": false,
|
|
220
219
|
"defaultValue": "false"
|
|
221
220
|
},
|
|
222
|
-
"footerRightAction": {
|
|
223
|
-
"type": "unknown",
|
|
224
|
-
"mutable": false,
|
|
225
|
-
"complexType": {
|
|
226
|
-
"original": "HTMLElement | null",
|
|
227
|
-
"resolved": "HTMLElement | null",
|
|
228
|
-
"references": {
|
|
229
|
-
"HTMLElement": {
|
|
230
|
-
"location": "global",
|
|
231
|
-
"id": "global::HTMLElement"
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
"required": false,
|
|
236
|
-
"optional": false,
|
|
237
|
-
"docs": {
|
|
238
|
-
"tags": [{
|
|
239
|
-
"name": "default",
|
|
240
|
-
"text": "null"
|
|
241
|
-
}],
|
|
242
|
-
"text": "The right area for the action in the footer"
|
|
243
|
-
},
|
|
244
|
-
"defaultValue": "null"
|
|
245
|
-
},
|
|
246
221
|
"borderStyle": {
|
|
247
222
|
"type": "string",
|
|
248
223
|
"mutable": false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { zonosStoreFontFamily } from "../../store/zonosStore";
|
|
3
|
+
import { isColorVariable } from "../../utils/isColorVariable";
|
|
3
4
|
export class ZonosIcon {
|
|
4
5
|
constructor() {
|
|
5
6
|
this.autoHeight = false;
|
|
@@ -11,9 +12,12 @@ export class ZonosIcon {
|
|
|
11
12
|
if (!this.content || !this.el.shadowRoot) {
|
|
12
13
|
return null;
|
|
13
14
|
}
|
|
15
|
+
const iconColor = isColorVariable(this.iconColor)
|
|
16
|
+
? `var(--amino-${this.iconColor})`
|
|
17
|
+
: this.iconColor;
|
|
14
18
|
this.el.shadowRoot.innerHTML = this.content;
|
|
15
19
|
return (h(Host, { class: "zonos--elements", style: {
|
|
16
|
-
'--color':
|
|
20
|
+
'--color': iconColor,
|
|
17
21
|
'--font-family': zonosStoreFontFamily(),
|
|
18
22
|
'--height': `${this.autoHeight ? 'auto' : `${this.size}px`}`,
|
|
19
23
|
'--width': `${this.size}px`,
|
|
@@ -58,8 +62,8 @@ export class ZonosIcon {
|
|
|
58
62
|
"type": "string",
|
|
59
63
|
"mutable": false,
|
|
60
64
|
"complexType": {
|
|
61
|
-
"original": "Color",
|
|
62
|
-
"resolved": "
|
|
65
|
+
"original": "Color | (string & { _placeholder?: never })",
|
|
66
|
+
"resolved": "Color | (string & { _placeholder?: undefined; })",
|
|
63
67
|
"references": {
|
|
64
68
|
"Color": {
|
|
65
69
|
"location": "import",
|
|
@@ -16,9 +16,9 @@ export class ZonosLanguageSelect {
|
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
18
|
const { selectedLocale } = localizationStore;
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '25e0e2be0bbac853efa9c26c1595a1d57461a1a1', class: "zonos--elements", style: {
|
|
20
20
|
'--font-family': zonosStoreFontFamily(),
|
|
21
|
-
} }, h("div", { key: '
|
|
21
|
+
} }, h("div", { key: 'b9f3a630f945570a9c0058bb0367e810b7650eb0', class: "zonos--language-select" }, h("zonos-select-dialog-header", { key: 'b30a41cc7f4eab57f15b48ffa3f7c0ad1e695e65', handleOnClose: () => this.handleOnClose(), label: translate('Select a language') }), h("div", { key: 'c6826b80ece54415befc388e57baa02d56472aef', class: "zonos--language-select-content" }, languages.map(language => (h("button", { class: "zonos--language-select-button", onClick: () => this.languageSelected(language.code) }, h("zonos-text", { textColor: "gray-800" }, language.translatedLabel), language.code === selectedLocale && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 16 })))))))));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "zonos-language-select"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,11 +10,11 @@ export class ZonosLogo {
|
|
|
10
10
|
const filterColor = this.theme === 'DARK'
|
|
11
11
|
? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'
|
|
12
12
|
: 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: '483016f5ffe43ea7742e895b5335212da6ec1d18', class: classes(['zonos--elements zonos--logo']), style: {
|
|
14
14
|
'--filter-color': filterColor,
|
|
15
15
|
'--font-family': zonosStoreFontFamily(),
|
|
16
16
|
'--width': this.width,
|
|
17
|
-
} }, h("img", { key: '
|
|
17
|
+
} }, h("img", { key: 'aed23717de194da43d48ee7b068f3e7568c0bbb3', alt: "Zonos Logo", src: getAssetPath('./assets/ZonosLogo.png') })));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "zonos-logo"; }
|
|
20
20
|
static get encapsulation() { return "shadow"; }
|
|
@@ -40,8 +40,8 @@ export class ZonosLogo {
|
|
|
40
40
|
"references": {
|
|
41
41
|
"ElementsUiTheme": {
|
|
42
42
|
"location": "import",
|
|
43
|
-
"path": "src/types",
|
|
44
|
-
"id": "src/types/
|
|
43
|
+
"path": "src/types/generated/graphql.customer.types",
|
|
44
|
+
"id": "src/types/generated/graphql.customer.types.ts::ElementsUiTheme"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
},
|
package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js
CHANGED
|
@@ -8,9 +8,9 @@ export class ZonosSelectDialogHeader {
|
|
|
8
8
|
this.label = '';
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: 'e7867deee86e4a155c21db2618eafd6f3c6cea3b', class: "zonos--elements", style: {
|
|
12
12
|
'--font-family': zonosStoreFontFamily(),
|
|
13
|
-
} }, h("zonos-v-stack", { key: '
|
|
13
|
+
} }, h("zonos-v-stack", { key: 'f7aedb0f819b61da26afd53add628bcddcca5d8a', class: "zonos--select-dialog-header-wrapper", spacing: 8 }, h("div", { key: '7ec77c24a440a5d42965f657502506c769d3098c', class: "zonos--select-dialog-header" }, h("zonos-text", { key: 'bab0ffc53edd20840438e82c0067c1eae8f13ec7', type: "boldLabel" }, this.label), h("zonos-button", { key: 'a85fc2b745b25c07bcccfe60eb1f1e722c7999c2', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close select dialog", content: RemoveIcon, size: 20 }), noBackground: true, onClick: () => this.handleOnClose() })), h("slot", { key: 'fe932e62edd5f679061c76a62650885d4337363c' }))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-select-dialog-header"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js
CHANGED
|
@@ -24,11 +24,20 @@ export class ZonosShippingRichRadio {
|
|
|
24
24
|
this.borderColor = undefined;
|
|
25
25
|
this.borderStyle = undefined;
|
|
26
26
|
this.theme = undefined;
|
|
27
|
+
this.initialSelectedValue = undefined;
|
|
27
28
|
this.selectedItem = null;
|
|
28
29
|
}
|
|
30
|
+
componentWillLoad() {
|
|
31
|
+
// Set initial selected item
|
|
32
|
+
if (this.initialSelectedValue) {
|
|
33
|
+
this.selectedItem =
|
|
34
|
+
this.items.find(item => item.value === this.initialSelectedValue) ||
|
|
35
|
+
null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
29
38
|
render() {
|
|
30
39
|
var _a;
|
|
31
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '3633e3be9f679c54647d475c9d1831428410302b', class: "zonos--shipping-rich-radio zonos--elements", "data-theme": this.theme, style: Object.assign(Object.assign({}, this.getRadioItemStyleVariables()), { '--font-family': zonosStoreFontFamily() }) }, (_a = this.items) === null || _a === void 0 ? void 0 : _a.map(item => {
|
|
32
41
|
var _a;
|
|
33
42
|
const selected = ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.value) === item.value;
|
|
34
43
|
return (h("div", { "aria-hidden": "true", class: classes([
|
|
@@ -140,6 +149,23 @@ export class ZonosShippingRichRadio {
|
|
|
140
149
|
},
|
|
141
150
|
"attribute": "theme",
|
|
142
151
|
"reflect": false
|
|
152
|
+
},
|
|
153
|
+
"initialSelectedValue": {
|
|
154
|
+
"type": "any",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string | number",
|
|
158
|
+
"resolved": "number | string | undefined",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": true,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "Initial selected value"
|
|
166
|
+
},
|
|
167
|
+
"attribute": "initial-selected-value",
|
|
168
|
+
"reflect": false
|
|
143
169
|
}
|
|
144
170
|
};
|
|
145
171
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { zonosStoreFontFamily } from "../../store/zonosStore";
|
|
3
3
|
import { classes } from "../../utils/classes";
|
|
4
|
+
import { isColorVariable } from "../../utils/isColorVariable";
|
|
4
5
|
import { textOptions, } from "../../../types/styles/Text";
|
|
5
6
|
export class ZonosText {
|
|
6
7
|
constructor() {
|
|
@@ -22,6 +23,9 @@ export class ZonosText {
|
|
|
22
23
|
const textSize = this.size || size || defaultSize;
|
|
23
24
|
const textWeight = this.weight || weight || defaultWeight;
|
|
24
25
|
const textTag = tag || defaultTag;
|
|
26
|
+
const actualTextColor = isColorVariable(this.textColor)
|
|
27
|
+
? `var(--amino-${this.textColor})`
|
|
28
|
+
: this.textColor;
|
|
25
29
|
const renderText = () => {
|
|
26
30
|
switch (textTag) {
|
|
27
31
|
case 'h2':
|
|
@@ -41,7 +45,7 @@ export class ZonosText {
|
|
|
41
45
|
`zonos--text-size-${textSize}`,
|
|
42
46
|
`zonos--text-weight-${textWeight}`,
|
|
43
47
|
]), style: {
|
|
44
|
-
'--color':
|
|
48
|
+
'--color': actualTextColor,
|
|
45
49
|
'--font-family': zonosStoreFontFamily(),
|
|
46
50
|
} }, renderText()));
|
|
47
51
|
}
|
|
@@ -63,8 +67,8 @@ export class ZonosText {
|
|
|
63
67
|
"type": "string",
|
|
64
68
|
"mutable": false,
|
|
65
69
|
"complexType": {
|
|
66
|
-
"original": "Color",
|
|
67
|
-
"resolved": "
|
|
70
|
+
"original": "Color | (string & { _placeholder?: never })",
|
|
71
|
+
"resolved": "Color | (string & { _placeholder?: undefined; })",
|
|
68
72
|
"references": {
|
|
69
73
|
"Color": {
|
|
70
74
|
"location": "import",
|
|
@@ -7,10 +7,10 @@ export class ZonosTooltip {
|
|
|
7
7
|
this.showTooltip = false;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'a23ad45e8f96b88b0feaf17690c6bdb75aacb12c', class: "zonos--elements" }, h("div", { key: 'b057f5ae304921f5fd50536cb5b7fb493120f1e7', class: "zonos--tooltip", onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, h("slot", { key: '396ac2ec3fcc8d49f8a346d1059cb096ef2e2874' }), h("div", { key: '4aa607dcc9c4c675224e9d7effd1e8ad2bdee097', class: classes([
|
|
11
11
|
this.showTooltip && 'zonos--show-tooltip',
|
|
12
12
|
'zonos--tooltip-content',
|
|
13
|
-
]) }, h("zonos-text", { key: '
|
|
13
|
+
]) }, h("zonos-text", { key: 'e69a1883f21f277be88e892a99ae6e66a9829a1c', size: "s", textColor: "gray-0", type: "boldLabel" }, this.label), h("zonos-text", { key: 'cb901c3cd7d0931f157eddef8fe4286fbd66b66b', size: "xs", textColor: "gray-0" }, this.subtitle)))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-tooltip"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,9 +7,9 @@ export class VStack {
|
|
|
7
7
|
this.spacing = 24;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '3d9977f4c55f7f1047ec94dcc3a3c40105559c00', style: {
|
|
11
11
|
'--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: 'aa910d4f9a11d3d1a66836aed442726241b73273', class: classes(['vstack']), style: { 'grid-row-gap': `${this.spacing}px` } }, h("slot", { key: 'ec50cc05f71018b4b6fef1288f1371ddde030a3a' }))));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "zonos-v-stack"; }
|
|
15
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,7 +10,7 @@ export class ZonosComponent {
|
|
|
10
10
|
return format(this.first, this.middle, this.last);
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return h("div", { key: '
|
|
13
|
+
return h("div", { key: '9a5547114b58b739fb5d783f551bc345f067779d' }, "Hello, World! I'm ", this.getText());
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-component"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -17,9 +17,9 @@ export class ZonosHelloDialogFooter {
|
|
|
17
17
|
const primaryColor = (_a = this.appearanceSettings) === null || _a === void 0 ? void 0 : _a.colorPrimary;
|
|
18
18
|
const footerTheme = primaryColor && isDarkColor(primaryColor) ? 'DARK' : 'LIGHT';
|
|
19
19
|
const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: 'ae185b9859f64fea077e093af2decc170f24170b', class: "zonos--elements" }, h("div", { key: 'c472973505ab6cde075af193df735d0524fc35a0', class: "zonos--hello-dialog-footer", "data-theme": footerTheme, style: {
|
|
21
21
|
'--primary-color': (_c = this.appearanceSettings) === null || _c === void 0 ? void 0 : _c.colorPrimary,
|
|
22
|
-
} }, h("a", { key: '
|
|
22
|
+
} }, h("a", { key: '95cb8c09a3a3f566365f0044d6fcdcf6a82facee', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: 'e11df129f087f9de259c2f24bd294f8d0a881e0d', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: "gray-1200", size: 108 })), h("div", { key: 'df26ef41d24395a2db6d8e3c9dc83a62e0e707ef', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: '9b1797c3fdd17044fecb6ae4526d3c053d1ab59a', buttonColor: "gray-1200", icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: "gray-1200" }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: 'eac17e7e84dc2a80abfcbaed3753512e6358f8db', buttonColor: "gray-1200", icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "zonos-hello-dialog-footer"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -97,7 +97,7 @@ export class ZonosHelloDialog {
|
|
|
97
97
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
98
98
|
const currentPage = this.getCurrentPageEnum();
|
|
99
99
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
100
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: 'a9e9d5946604f86ea0680af79ece9e079d4d00d7', class: "zonos--elements" }, h("div", { key: '47ed38de794c10b5689778257d134006c109c101', "aria-hidden": "true", class: classes([
|
|
101
101
|
'zonos--hello-dialog',
|
|
102
102
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
103
103
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
@@ -152,7 +152,7 @@ export class ZonosController {
|
|
|
152
152
|
zonosStore.organizationName = organizationName;
|
|
153
153
|
}
|
|
154
154
|
render() {
|
|
155
|
-
return h(Host, { key: '
|
|
155
|
+
return h(Host, { key: 'bd56d32009707ec9042ae5f8a87de7a7cedcca73', class: "zonos--elements" });
|
|
156
156
|
}
|
|
157
157
|
static get is() { return "zonos-controller"; }
|
|
158
158
|
static get encapsulation() { return "shadow"; }
|
|
@@ -9,6 +9,7 @@ import { logError } from "../../utils/logging/logError";
|
|
|
9
9
|
const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
10
10
|
checkoutSessionId: sessionStorage.getItem('zonos--checkout-session-id') || null,
|
|
11
11
|
currency: 'USD',
|
|
12
|
+
doneSteps: [],
|
|
12
13
|
dutiesTaxFees: 0,
|
|
13
14
|
error: null,
|
|
14
15
|
exchangeRate: null,
|
|
@@ -24,6 +25,27 @@ const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
|
24
25
|
shippingData: null,
|
|
25
26
|
step: 'customer-info',
|
|
26
27
|
subtotal: 0,
|
|
28
|
+
tabItems: {
|
|
29
|
+
'customer-info': {
|
|
30
|
+
index: 1,
|
|
31
|
+
isDone: false,
|
|
32
|
+
label: 'Customer',
|
|
33
|
+
value: 'customer-info',
|
|
34
|
+
},
|
|
35
|
+
shipping: {
|
|
36
|
+
index: 2,
|
|
37
|
+
isDone: false,
|
|
38
|
+
label: 'Delivery',
|
|
39
|
+
value: 'shipping',
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line sort-keys/sort-keys-fix
|
|
42
|
+
payment: {
|
|
43
|
+
index: 3,
|
|
44
|
+
isDone: false,
|
|
45
|
+
label: 'Payment',
|
|
46
|
+
value: 'payment',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
27
49
|
total: 0,
|
|
28
50
|
}));
|
|
29
51
|
/**
|
|
@@ -187,9 +209,13 @@ const cartStoreResetSelectedShippingOption = () => {
|
|
|
187
209
|
const cartStoreNextStep = () => {
|
|
188
210
|
if (cartStore.step === 'customer-info') {
|
|
189
211
|
cartStore.step = 'shipping';
|
|
212
|
+
// set customer-info step to done
|
|
213
|
+
cartStore.tabItems = Object.assign(Object.assign({}, cartStore.tabItems), { 'customer-info': Object.assign(Object.assign({}, cartStore.tabItems['customer-info']), { isDone: true }) });
|
|
190
214
|
}
|
|
191
215
|
else if (cartStore.step === 'shipping') {
|
|
192
216
|
cartStore.step = 'payment';
|
|
217
|
+
// set shipping step to done
|
|
218
|
+
cartStore.tabItems = Object.assign(Object.assign({}, cartStore.tabItems), { shipping: Object.assign(Object.assign({}, cartStore.tabItems.shipping), { isDone: true }) });
|
|
193
219
|
}
|
|
194
220
|
else if (cartStore.step === 'payment') {
|
|
195
221
|
cartStore.step = 'finish';
|