@zonos/elements 1.3.15-alpha.2 → 1.3.15
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/RemoveIcon-6c79a2a1.js +5 -0
- package/dist/cjs/{cart-1b1d39af.js → cart-db549f04.js} +976 -138
- package/dist/cjs/containsNonLatinChars-2be5129b.js +24 -0
- package/dist/cjs/{getBorderRadius-c8cc2bb3.js → getBorderRadius-44b3eca1.js} +4 -6
- package/dist/cjs/index-654a6001.js +1361 -0
- package/dist/cjs/isCheckoutMobile-f491ca7c.js +8 -0
- package/dist/cjs/{isDarkColor-f5473002.js → isDarkColor-01f45d3f.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{submitGtag-ab287a34.js → submitGtag-fd8acad5.js} +21 -2
- package/dist/cjs/zonos-address_8.cjs.entry.js +642 -0
- package/dist/cjs/zonos-badge_2.cjs.entry.js +9 -9
- package/dist/cjs/zonos-banner.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +192 -0
- package/dist/cjs/zonos-card_2.cjs.entry.js +12 -12
- package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +144 -118
- package/dist/cjs/zonos-checkout.cjs.entry.js +19 -18
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +14 -14
- package/dist/cjs/zonos-elements.cjs.js +10 -10
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
- package/dist/cjs/zonos-hello.cjs.entry.js +6 -6
- package/dist/cjs/zonos-input.cjs.entry.js +57 -0
- package/dist/cjs/zonos-link.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
- package/dist/cjs/zonos-notification.cjs.entry.js +5 -5
- package/dist/cjs/zonos-payment.cjs.entry.js +7 -7
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +7 -7
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +8 -6
- package/dist/cjs/zonos-text.cjs.entry.js +3 -2
- package/dist/cjs/{zonosStore-aee974e0.js → zonosStore-d8bb0bda.js} +1 -1
- package/dist/collection/collection-manifest.json +5 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +62 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +80 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.css +59 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +148 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +115 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +429 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.css +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +9 -9
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +5 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +16 -16
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +6 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +8 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +135 -20
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +5 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +7 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-badge/zonos-badge.css +1 -1
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-banner/zonos-banner.css +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +10 -9
- package/dist/collection/components/common/zonos-button/zonos-button.js +17 -8
- package/dist/collection/components/common/zonos-card/zonos-card.css +9 -9
- package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +2 -1
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +22 -4
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.css +1 -1
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +5 -5
- 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.css +1 -1
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +6 -6
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +6 -4
- package/dist/collection/components/common/zonos-input/zonos-input.css +176 -0
- package/dist/collection/components/common/zonos-input/zonos-input.js +193 -0
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.css +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-notification/zonos-notification.css +3 -3
- package/dist/collection/components/common/zonos-notification/zonos-notification.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.css +1 -1
- 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.css +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +4 -2
- package/dist/collection/components/common/zonos-text/zonos-text.js +1 -0
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +1 -1
- 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/zonos-hello.css +18 -18
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +10 -52
- 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.css +4 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +3 -3
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +153 -14
- package/dist/collection/components/store/translationStore/strings.arabic.js +36 -6
- package/dist/collection/components/store/translationStore/strings.base.js +36 -6
- package/dist/collection/components/store/translationStore/strings.chinese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.danish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.dutch.js +36 -6
- package/dist/collection/components/store/translationStore/strings.french.js +36 -6
- package/dist/collection/components/store/translationStore/strings.german.js +36 -6
- package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -6
- package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.italian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.japanese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.korean.js +36 -6
- package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.polish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.russian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.spanish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.swedish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.turkish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -6
- package/dist/collection/components/stripe/zonos-address/zonos-address.css +2 -2
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -71
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.css +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -5
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.css +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/buildTranslateRequestBody.js +98 -0
- package/dist/collection/components/utils/containsNonLatinChars.js +10 -8
- package/dist/collection/components/utils/getBorderRadius.js +3 -5
- package/dist/collection/styles/stripe/defaultVariable.js +2 -2
- package/dist/collection/types/checkout/TranslatedText.js +1 -0
- package/dist/collection/types/checkout/api/ValidateAddressRequest.js +1 -0
- package/dist/components/containsNonLatinChars.js +21 -0
- package/dist/components/getBorderRadius.js +3 -5
- package/dist/components/stripe.js +255 -4545
- package/dist/components/trackConversionEvent.js +1 -1
- package/dist/components/translationStore.js +5131 -0
- package/dist/components/zonos-address-display.d.ts +11 -0
- package/dist/components/zonos-address-display.js +6 -0
- package/dist/components/zonos-address-display2.js +64 -0
- package/dist/components/zonos-address-form.d.ts +11 -0
- package/dist/components/zonos-address-form.js +6 -0
- package/dist/components/zonos-address-form2.js +84 -0
- package/dist/components/zonos-address-update-dialog.d.ts +11 -0
- package/dist/components/zonos-address-update-dialog.js +6 -0
- package/dist/components/zonos-address-update-dialog2.js +264 -0
- package/dist/components/zonos-address2.js +4 -94
- package/dist/components/zonos-badge2.js +4 -4
- package/dist/components/zonos-banner2.js +1 -1
- package/dist/components/zonos-button2.js +18 -9
- package/dist/components/zonos-card2.js +4 -4
- package/dist/components/zonos-cart-items2.js +2 -2
- package/dist/components/zonos-cart-subtotal2.js +3 -2
- package/dist/components/zonos-checkbox2.js +15 -6
- package/dist/components/zonos-checkout-finish2.js +27 -7
- package/dist/components/zonos-checkout-footer2.js +3 -3
- package/dist/components/zonos-checkout-payment2.js +3 -2
- package/dist/components/zonos-checkout-progress-tabs2.js +6 -5
- package/dist/components/zonos-checkout.js +72 -42
- 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 +3 -3
- package/dist/components/zonos-custom-message2.js +3 -3
- package/dist/components/zonos-customer-info2.js +171 -30
- package/dist/components/zonos-dialog2.js +7 -5
- package/dist/components/zonos-hello-dialog-footer2.js +3 -3
- package/dist/components/zonos-hello-dialog2.js +6 -5
- package/dist/components/zonos-hello.js +3 -2
- package/dist/components/zonos-input.d.ts +11 -0
- package/dist/components/zonos-input.js +6 -0
- package/dist/components/zonos-input2.js +78 -0
- package/dist/components/zonos-language-select2.js +5 -4
- package/dist/components/zonos-link-authentication2.js +13 -6
- package/dist/components/zonos-link.js +1 -1
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-notification2.js +3 -3
- package/dist/components/zonos-payment2.js +2 -2
- package/dist/components/zonos-review2.js +3 -2
- package/dist/components/zonos-select-dialog-header2.js +3 -3
- package/dist/components/zonos-shipping-rich-radio2.js +5 -3
- package/dist/components/zonos-shipping2.js +4 -3
- package/dist/components/zonos-text2.js +1 -0
- package/dist/components/zonos-tooltip2.js +3 -3
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/esm/RemoveIcon-f6715b36.js +3 -0
- package/dist/esm/{cart-10bcd2e0.js → cart-462e89a6.js} +976 -139
- package/dist/esm/containsNonLatinChars-2d8810c3.js +21 -0
- package/dist/esm/{getBorderRadius-8129b0cb.js → getBorderRadius-567f1786.js} +4 -6
- package/dist/esm/index-e063389c.js +1328 -0
- package/dist/esm/isCheckoutMobile-8846dccb.js +6 -0
- package/dist/esm/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{submitGtag-84886899.js → submitGtag-ac7c3c89.js} +21 -3
- package/dist/esm/zonos-address_8.entry.js +631 -0
- package/dist/esm/zonos-badge_2.entry.js +9 -9
- package/dist/esm/zonos-banner.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +186 -0
- package/dist/esm/zonos-card_2.entry.js +12 -12
- package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +140 -113
- package/dist/esm/zonos-checkout.entry.js +14 -13
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_3.entry.js +14 -14
- package/dist/esm/zonos-elements.js +11 -11
- package/dist/esm/zonos-hello-dialog.entry.js +9 -9
- package/dist/esm/zonos-hello.entry.js +6 -6
- package/dist/esm/zonos-input.entry.js +53 -0
- package/dist/esm/zonos-link.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +4 -4
- package/dist/esm/zonos-notification.entry.js +5 -5
- package/dist/esm/zonos-payment.entry.js +7 -7
- package/dist/esm/zonos-select-dialog-header_2.entry.js +7 -7
- package/dist/esm/zonos-shipping-rich-radio.entry.js +8 -6
- package/dist/esm/zonos-text.entry.js +3 -2
- package/dist/esm/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
- package/dist/esm-es5/RemoveIcon-f6715b36.js +1 -0
- package/dist/esm-es5/cart-462e89a6.js +1 -0
- package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
- package/dist/esm-es5/getBorderRadius-567f1786.js +1 -0
- package/dist/esm-es5/index-e063389c.js +2 -0
- package/dist/esm-es5/isCheckoutMobile-8846dccb.js +1 -0
- package/dist/esm-es5/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-ac7c3c89.js +1 -0
- package/dist/esm-es5/zonos-address_8.entry.js +1 -0
- 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_3.entry.js +1 -0
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.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-input.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-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
- package/dist/scripts/loadStripe.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/stripe.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-address-update-dialog/zonos-address-display/zonos-address-display.d.ts +12 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.d.ts +28 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.d.ts +96 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +22 -2
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +0 -3
- package/dist/types/components/common/zonos-input/zonos-input.d.ts +35 -0
- package/dist/types/components/store/checkout/stripe.d.ts +25 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.base.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.danish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.french.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.german.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.italian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.korean.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.polish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.russian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +35 -5
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -10
- package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +4 -0
- package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
- package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
- package/dist/types/components/utils/checkout/buildTranslateRequestBody.d.ts +26 -0
- package/dist/types/components/utils/containsNonLatinChars.d.ts +1 -0
- package/dist/types/components/utils/getBorderRadius.d.ts +7 -1
- package/dist/types/components.d.ts +308 -6
- package/dist/types/types/checkout/TranslatedText.d.ts +23 -0
- package/dist/types/types/checkout/api/ValidateAddressRequest.d.ts +20 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +2 -0
- package/dist/types/types/generated/graphql.customer.types.ts +2 -0
- package/dist/zonos-elements/p-029f11dd.system.entry.js +1 -0
- package/dist/zonos-elements/{p-2ee0d779.entry.js → p-094c0ee8.entry.js} +1 -1
- package/dist/zonos-elements/p-0c64dbbb.js +1 -0
- package/dist/zonos-elements/p-11504442.entry.js +1 -0
- package/dist/zonos-elements/p-11bef836.system.entry.js +1 -0
- package/dist/zonos-elements/{p-bc3a0f7c.entry.js → p-11f1b78c.entry.js} +1 -1
- package/dist/zonos-elements/p-13ddaf31.js +2 -0
- package/dist/zonos-elements/p-154aaf95.system.js +1 -0
- package/dist/zonos-elements/p-163ff5b5.system.js +2 -0
- package/dist/zonos-elements/{p-32b4e9c3.entry.js → p-1e934274.entry.js} +1 -1
- package/dist/zonos-elements/p-20582e58.system.entry.js +1 -0
- package/dist/zonos-elements/p-2439c82f.system.entry.js +1 -0
- package/dist/zonos-elements/p-2670438c.system.js +1 -0
- package/dist/zonos-elements/p-321226b0.entry.js +1 -0
- package/dist/zonos-elements/p-3221530d.system.entry.js +1 -0
- package/dist/zonos-elements/{p-97534044.entry.js → p-32d27535.entry.js} +1 -1
- package/dist/zonos-elements/p-3d10866d.entry.js +1 -0
- package/dist/zonos-elements/{p-1a5f8df7.entry.js → p-3d8667a7.entry.js} +1 -1
- package/dist/zonos-elements/p-3f05d130.system.entry.js +1 -0
- package/dist/zonos-elements/p-430eefd4.entry.js +1 -0
- package/dist/zonos-elements/p-49825866.system.entry.js +1 -0
- package/dist/zonos-elements/p-5525b740.entry.js +1 -0
- package/dist/zonos-elements/p-578f0aad.system.js +1 -0
- package/dist/zonos-elements/p-58a8ef6c.entry.js +1 -0
- package/dist/zonos-elements/p-5d993965.js +1 -0
- package/dist/zonos-elements/{p-262b8e1e.system.entry.js → p-5f9c066d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-60e262f0.system.entry.js +1 -0
- package/dist/zonos-elements/p-64b594f4.js +1 -0
- package/dist/zonos-elements/p-66471df6.entry.js +1 -0
- package/dist/zonos-elements/{p-95c864ca.system.entry.js → p-679877b1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fc4da55c.system.js → p-771fbeb3.system.js} +1 -1
- package/dist/zonos-elements/p-79f3c4f5.system.js +1 -0
- package/dist/zonos-elements/{p-e1ac5b2a.system.entry.js → p-80d78980.system.entry.js} +1 -1
- package/dist/zonos-elements/p-81a54668.js +1 -0
- package/dist/zonos-elements/p-83cc2936.js +1 -0
- package/dist/zonos-elements/{p-520e8e63.system.js → p-87badea9.system.js} +1 -1
- package/dist/zonos-elements/p-8a61a04f.system.entry.js +1 -0
- package/dist/zonos-elements/p-8b32f560.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d01576d7.js → p-909a331c.js} +1 -1
- package/dist/zonos-elements/p-94b15a5e.system.entry.js +1 -0
- package/dist/zonos-elements/p-9a45fae5.system.entry.js +1 -0
- package/dist/zonos-elements/{p-24fee841.entry.js → p-9ec93319.entry.js} +1 -1
- package/dist/zonos-elements/p-a6d7ac46.js +1 -0
- package/dist/zonos-elements/p-a6eeb4bd.system.entry.js +1 -0
- package/dist/zonos-elements/p-a93f2e84.entry.js +1 -0
- package/dist/zonos-elements/p-aed0098c.system.js +1 -0
- package/dist/zonos-elements/p-b19d51e0.entry.js +1 -0
- package/dist/zonos-elements/{p-46f9c93e.system.entry.js → p-b9652402.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-13b55282.entry.js → p-baee62a4.entry.js} +1 -1
- package/dist/zonos-elements/{p-eff12c31.system.entry.js → p-bf32179a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cd1cc224.entry.js +1 -0
- package/dist/zonos-elements/p-d1b63cec.system.entry.js +1 -0
- package/dist/zonos-elements/p-d6b103d5.system.js +1 -0
- package/dist/zonos-elements/{p-376bdf70.entry.js → p-da6767d8.entry.js} +1 -1
- package/dist/zonos-elements/p-dde1383b.entry.js +1 -0
- package/dist/zonos-elements/p-df192668.system.js +1 -0
- package/dist/zonos-elements/{p-70ede197.system.entry.js → p-df24d548.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6743734f.entry.js → p-e7b4b756.entry.js} +1 -1
- package/dist/zonos-elements/{p-d41b5762.js → p-f1962041.js} +1 -1
- package/dist/zonos-elements/p-f3d3c754.system.entry.js +1 -0
- package/dist/zonos-elements/p-f79682b5.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.css +3 -3
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/index-3b4816ef.js +0 -2088
- package/dist/cjs/sendErrorLog-29e50f7e.js +0 -29
- package/dist/cjs/zonos-address_4.cjs.entry.js +0 -388
- package/dist/cjs/zonos-button_2.cjs.entry.js +0 -152
- package/dist/cjs/zonos-icon.cjs.entry.js +0 -39
- package/dist/components/sendErrorLog.js +0 -21
- package/dist/esm/index-0e31d804.js +0 -2055
- package/dist/esm/sendErrorLog-8642e94a.js +0 -26
- package/dist/esm/zonos-address_4.entry.js +0 -381
- package/dist/esm/zonos-button_2.entry.js +0 -147
- package/dist/esm/zonos-icon.entry.js +0 -35
- package/dist/esm-es5/cart-10bcd2e0.js +0 -1
- package/dist/esm-es5/getBorderRadius-8129b0cb.js +0 -1
- package/dist/esm-es5/index-0e31d804.js +0 -2
- package/dist/esm-es5/sendErrorLog-8642e94a.js +0 -1
- package/dist/esm-es5/submitGtag-84886899.js +0 -1
- package/dist/esm-es5/zonos-address_4.entry.js +0 -1
- package/dist/esm-es5/zonos-button_2.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
- package/dist/esm-es5/zonos-icon.entry.js +0 -1
- package/dist/scripts/insertTranslations.js +0 -1
- package/dist/zonos-elements/p-066b5ca3.entry.js +0 -1
- package/dist/zonos-elements/p-0a0d45e9.system.entry.js +0 -1
- package/dist/zonos-elements/p-2244534c.js +0 -2
- package/dist/zonos-elements/p-2693da50.system.entry.js +0 -1
- package/dist/zonos-elements/p-2825570c.system.js +0 -2
- package/dist/zonos-elements/p-33abdb30.js +0 -1
- package/dist/zonos-elements/p-450942a3.system.js +0 -1
- package/dist/zonos-elements/p-46b4010c.entry.js +0 -1
- package/dist/zonos-elements/p-509717bc.system.entry.js +0 -1
- package/dist/zonos-elements/p-5ca09163.entry.js +0 -1
- package/dist/zonos-elements/p-5ff27485.js +0 -1
- package/dist/zonos-elements/p-6f5761e8.js +0 -1
- package/dist/zonos-elements/p-6fb15797.system.entry.js +0 -1
- package/dist/zonos-elements/p-73acb3eb.system.entry.js +0 -1
- package/dist/zonos-elements/p-7432179a.system.entry.js +0 -1
- package/dist/zonos-elements/p-8126011d.entry.js +0 -1
- package/dist/zonos-elements/p-8b44e558.system.js +0 -1
- package/dist/zonos-elements/p-8c568b87.entry.js +0 -1
- package/dist/zonos-elements/p-92d85125.system.entry.js +0 -1
- package/dist/zonos-elements/p-9b385237.entry.js +0 -1
- package/dist/zonos-elements/p-9fc92940.entry.js +0 -1
- package/dist/zonos-elements/p-a6bbf6de.system.entry.js +0 -1
- package/dist/zonos-elements/p-ad0a2581.entry.js +0 -1
- package/dist/zonos-elements/p-b4c3dcda.entry.js +0 -1
- package/dist/zonos-elements/p-b8e8330b.system.js +0 -1
- package/dist/zonos-elements/p-be022d8e.entry.js +0 -1
- package/dist/zonos-elements/p-c6170bec.system.js +0 -1
- package/dist/zonos-elements/p-c9e137e1.system.entry.js +0 -1
- package/dist/zonos-elements/p-d0d78094.system.entry.js +0 -1
- package/dist/zonos-elements/p-d1ba7e52.system.entry.js +0 -1
- package/dist/zonos-elements/p-d29895ed.system.entry.js +0 -1
- package/dist/zonos-elements/p-dac861bb.entry.js +0 -1
- package/dist/zonos-elements/p-e010f227.system.entry.js +0 -1
- package/dist/zonos-elements/p-e703c902.entry.js +0 -1
- package/dist/zonos-elements/p-e8a41797.system.entry.js +0 -1
- package/dist/zonos-elements/p-ed2e94d2.js +0 -1
- package/dist/zonos-elements/p-f2b60329.system.entry.js +0 -1
- package/dist/zonos-elements/p-f4c38bfc.system.js +0 -1
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { u as handleFetch } from './cart-10bcd2e0.js';
|
|
2
|
-
|
|
3
|
-
const checkoutBreakpoint = 890;
|
|
4
|
-
const isCheckoutMobile = (isMobile) => {
|
|
5
|
-
return isMobile || window.innerWidth < checkoutBreakpoint;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const sendErrorLog = async ({ endpoint, errors, metadata }) => {
|
|
9
|
-
const userAgentData = 'userAgentData' in window.navigator
|
|
10
|
-
? // userAgentData is not yet supported in all browsers
|
|
11
|
-
window.navigator.userAgentData
|
|
12
|
-
: null;
|
|
13
|
-
const errorObject = {
|
|
14
|
-
endpoint,
|
|
15
|
-
errors,
|
|
16
|
-
metadata: Object.assign({ href: window.location.href, userAgent: userAgentData && userAgentData.brands.length > 0
|
|
17
|
-
? userAgentData
|
|
18
|
-
: window.navigator.userAgent }, metadata),
|
|
19
|
-
};
|
|
20
|
-
void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
|
|
21
|
-
body: errorObject,
|
|
22
|
-
method: 'POST',
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { isCheckoutMobile as i, sendErrorLog as s };
|
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-0e31d804.js';
|
|
2
|
-
import { k as stripeStore, d as logError, l as localizationStore, t as translate, o as stripeStorePrefetchLandedCost } from './cart-10bcd2e0.js';
|
|
3
|
-
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-f3eef64b.js';
|
|
4
|
-
import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-8642e94a.js';
|
|
5
|
-
import { c as classes } from './classes-0d95c529.js';
|
|
6
|
-
import { g as getBorderRadius } from './getBorderRadius-8129b0cb.js';
|
|
7
|
-
import { i as isDarkColor } from './isDarkColor-7a6d2d14.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Check if the given address object contains non-latin characters
|
|
11
|
-
* @returns an object with the same keys as the input object, and a boolean value indicating if the value contains non-latin characters
|
|
12
|
-
*/
|
|
13
|
-
const containsNonLatinChars = (params) => {
|
|
14
|
-
const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
|
|
15
|
-
/**
|
|
16
|
-
* This regex matches any character that is not a latin character, punctuation, symbol, number, separator, control, or mark
|
|
17
|
-
* I limited the character found to 1 in the regex, so that we can return early if we find any non-latin character
|
|
18
|
-
**/
|
|
19
|
-
const nonLatinRegex = /[^\p{Script=Latin}\p{P}\p{S}\p{N}\p{Z}\p{C}\p{M}]{1}/u;
|
|
20
|
-
const nonLatinValueList = Object.entries(params).reduce((prev, [key, value]) => nonLatinRegex.test(value) &&
|
|
21
|
-
// allow special characters like web apostrophe and quotation mark
|
|
22
|
-
!specialCharacters.test(value)
|
|
23
|
-
? Object.assign(Object.assign({}, prev), { [key]: true }) : prev, {});
|
|
24
|
-
return nonLatinValueList;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:var(--amino-space-16)}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:var(--amino-space-8)}";
|
|
28
|
-
const ZonosAddressStyle0 = zonosAddressCss;
|
|
29
|
-
|
|
30
|
-
const mappedFields = {
|
|
31
|
-
city: 'City',
|
|
32
|
-
country: 'Country',
|
|
33
|
-
line1: 'Address line 1',
|
|
34
|
-
line2: 'Address line 2',
|
|
35
|
-
name: 'Name',
|
|
36
|
-
postal_code: 'Postal code',
|
|
37
|
-
state: 'State',
|
|
38
|
-
};
|
|
39
|
-
const ZonosAddress = class {
|
|
40
|
-
constructor(hostRef) {
|
|
41
|
-
registerInstance(this, hostRef);
|
|
42
|
-
this.invalidCharacters = createEvent(this, "invalidCharacters", 7);
|
|
43
|
-
this.type = undefined;
|
|
44
|
-
this.titleText = undefined;
|
|
45
|
-
this.defaultAddress = null;
|
|
46
|
-
this.stripe = window.Zonos.stripe;
|
|
47
|
-
this.reportedInvalidCharacters = false;
|
|
48
|
-
this.invalidCharacterList = null;
|
|
49
|
-
this.isDirtyAddress = false;
|
|
50
|
-
}
|
|
51
|
-
getStripeAddressInstance() {
|
|
52
|
-
if (this.type === 'billing') {
|
|
53
|
-
return {
|
|
54
|
-
stripeAddressElement: stripeStore.stripeBillingAddressElement,
|
|
55
|
-
stripeAddressEventData: stripeStore.stripeBillingAddressEventData,
|
|
56
|
-
stripeElements: stripeStore.stripeElementsForBillingAddress,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
stripeAddressElement: stripeStore.stripeAddressElement,
|
|
61
|
-
stripeAddressEventData: stripeStore.stripeAddressEventData,
|
|
62
|
-
stripeElements: stripeStore.stripeElements,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
updateAddressEventData({ event, type, }) {
|
|
66
|
-
switch (type) {
|
|
67
|
-
case 'billing':
|
|
68
|
-
stripeStore.stripeBillingAddressEventData = event;
|
|
69
|
-
break;
|
|
70
|
-
default:
|
|
71
|
-
stripeStore.stripeAddressEventData = event;
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
const invalidCharacterList = this.checkInvalidCharacters(event);
|
|
75
|
-
this.invalidCharacterList = invalidCharacterList;
|
|
76
|
-
this.invalidCharacters.emit(!!invalidCharacterList);
|
|
77
|
-
}
|
|
78
|
-
updateAddressElement({ stripeAddressElement, type, }) {
|
|
79
|
-
if (type === 'shipping') {
|
|
80
|
-
stripeStore.stripeAddressElement = stripeAddressElement;
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
stripeStore.stripeBillingAddressElement = stripeAddressElement;
|
|
84
|
-
}
|
|
85
|
-
checkInvalidCharacters(address) {
|
|
86
|
-
// Do nothing if the allowed character sets is ALL or the address is incomplete
|
|
87
|
-
if (!address.complete ||
|
|
88
|
-
zonosStore.checkoutSettings.allowedCharacterSets === 'ALL') {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
const { address: addressValue, firstName, lastName, name } = address.value;
|
|
92
|
-
const { city, country, line1, line2, postal_code, state } = addressValue;
|
|
93
|
-
const invalidList = containsNonLatinChars({
|
|
94
|
-
city,
|
|
95
|
-
country,
|
|
96
|
-
line1,
|
|
97
|
-
line2: line2 || '',
|
|
98
|
-
name: name || `${firstName} ${lastName}`,
|
|
99
|
-
postal_code,
|
|
100
|
-
state,
|
|
101
|
-
});
|
|
102
|
-
if (!Object.keys(invalidList).length) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
// send error event only once so we know what value is invalid
|
|
106
|
-
if (!this.reportedInvalidCharacters) {
|
|
107
|
-
this.reportedInvalidCharacters = true;
|
|
108
|
-
void sendErrorLog({
|
|
109
|
-
endpoint: 'NonLatinInput',
|
|
110
|
-
errors: Object.keys(invalidList).map(fieldName => {
|
|
111
|
-
var _a;
|
|
112
|
-
if (fieldName !== 'name') {
|
|
113
|
-
// trim all number so we don't send sensitive information
|
|
114
|
-
const trimmedAddress = (_a = addressValue[fieldName]) === null || _a === void 0 ? void 0 : _a.replace(/[\d\w]+/g, '');
|
|
115
|
-
return `Invalid character found ${fieldName}: "${trimmedAddress}"`;
|
|
116
|
-
}
|
|
117
|
-
const customerName = name || `${firstName} ${lastName}`;
|
|
118
|
-
const trimmedName = customerName.replace(/[\d\w]+/g, '');
|
|
119
|
-
return `Invalid character found ${fieldName}: "${trimmedName}"`;
|
|
120
|
-
}),
|
|
121
|
-
metadata: {},
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
return invalidList;
|
|
125
|
-
}
|
|
126
|
-
async watchInitStripe() {
|
|
127
|
-
var _a, _b;
|
|
128
|
-
this.stripe = window.Zonos.stripe;
|
|
129
|
-
const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
|
|
130
|
-
if (!this.stripe || !stripeElements) {
|
|
131
|
-
logError("Stripe is not initialized. Couldn't load stripe element.");
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const phone = (_a = this.defaultAddress) === null || _a === void 0 ? void 0 : _a.phone;
|
|
135
|
-
if (!phone) {
|
|
136
|
-
// remove phone from default address if it's not provided, stripe
|
|
137
|
-
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
138
|
-
(_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
|
|
139
|
-
}
|
|
140
|
-
const shippableCountries = localizationStore.shippingZoneCountries;
|
|
141
|
-
const shippingZone = shippableCountries
|
|
142
|
-
? Object.values(shippableCountries).map(country => country.code)
|
|
143
|
-
: [];
|
|
144
|
-
const addressElement = stripeElements.create('address', {
|
|
145
|
-
allowedCountries: this.type === 'shipping' ? shippingZone : [],
|
|
146
|
-
// only show the default address if stripeAddressEventData is not provided
|
|
147
|
-
contacts: this.defaultAddress && !stripeAddressEventData
|
|
148
|
-
? [this.defaultAddress]
|
|
149
|
-
: [],
|
|
150
|
-
defaultValues: {
|
|
151
|
-
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) ||
|
|
152
|
-
localizationStore.selectedCountryCode ||
|
|
153
|
-
'AL' }),
|
|
154
|
-
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
155
|
-
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
156
|
-
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
157
|
-
},
|
|
158
|
-
display: {
|
|
159
|
-
name: 'split',
|
|
160
|
-
},
|
|
161
|
-
fields: {
|
|
162
|
-
phone: 'always',
|
|
163
|
-
},
|
|
164
|
-
mode: this.type,
|
|
165
|
-
validation: {
|
|
166
|
-
phone: {
|
|
167
|
-
required: 'always',
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
addressElement.mount(this.el.querySelector('.zonos--address-component'));
|
|
172
|
-
addressElement.on('change', event => {
|
|
173
|
-
const eventValue = event.value;
|
|
174
|
-
if (!this.isDirtyAddress && eventValue.address.line1.length >= 3) {
|
|
175
|
-
this.isDirtyAddress = true;
|
|
176
|
-
// stripe element started with just address line 1, so scroll bar is not yet available. Wait for a moment before scrolling
|
|
177
|
-
setTimeout(() => {
|
|
178
|
-
// scroll directly into view if it's mobile
|
|
179
|
-
if (isCheckoutMobile()) {
|
|
180
|
-
this.el.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
// scroll into the end of the page so the address placeholder won't be hidden
|
|
184
|
-
const yOffset = this.type === 'shipping' ? 100 : 600;
|
|
185
|
-
const parentWrapper = this.el.closest('.zonos--group');
|
|
186
|
-
const y = this.el.getBoundingClientRect().top + yOffset;
|
|
187
|
-
parentWrapper === null || parentWrapper === void 0 ? void 0 : parentWrapper.scrollTo({ behavior: 'smooth', top: y });
|
|
188
|
-
}
|
|
189
|
-
}, 600);
|
|
190
|
-
}
|
|
191
|
-
this.updateAddressEventData({
|
|
192
|
-
event: Object.assign(Object.assign({}, event), { elementMode: this.type, elementType: 'address', value: Object.assign(Object.assign({}, eventValue), { firstName: eventValue.firstName || eventValue.name.split(' ')[0], lastName: eventValue.lastName || eventValue.name.split(' ')[1] }) }),
|
|
193
|
-
type: this.type,
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
this.updateAddressElement({
|
|
197
|
-
stripeAddressElement: addressElement,
|
|
198
|
-
type: this.type,
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
disconnectedCallback() {
|
|
202
|
-
// destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
|
|
203
|
-
const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
|
|
204
|
-
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
|
|
205
|
-
}
|
|
206
|
-
componentDidLoad() {
|
|
207
|
-
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
208
|
-
this.isDirtyAddress =
|
|
209
|
-
!!stripeAddressEventData &&
|
|
210
|
-
stripeAddressEventData.value.address.line1.length > 0;
|
|
211
|
-
// @Watch doesn't get trigger on initial load
|
|
212
|
-
void this.watchInitStripe();
|
|
213
|
-
setTimeout(() => {
|
|
214
|
-
// check if the address contains invalid characters after address is loaded
|
|
215
|
-
const newStripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
216
|
-
if (newStripeAddressEventData) {
|
|
217
|
-
this.checkInvalidCharacters(newStripeAddressEventData);
|
|
218
|
-
}
|
|
219
|
-
}, 500);
|
|
220
|
-
}
|
|
221
|
-
render() {
|
|
222
|
-
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
223
|
-
return (h(Host, { key: 'd5100d824d84c5e5b238f4877d489ca1b3f7b886', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '0fd51ddf9b08b4f62aa75a5f2e919d40e52f6fc3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '3a53ec2a36e96639ec5437b928d4be4b84fb3aff', class: "zonos--address-component" }), this.invalidCharacterList && (h("zonos-banner", { key: '1141be407cff5b6741a40a06712a71e881d3a082', bannerTitle: translate('Please resolve the following errors:'), intent: "error" }, Object.keys(this.invalidCharacterList).map(fieldName => (h("zonos-text", null, `- ${translate(mappedFields[fieldName])}: ${translate('only supports Latin characters (A-Z, a-z)')}`)))))));
|
|
224
|
-
}
|
|
225
|
-
get el() { return getElement(this); }
|
|
226
|
-
static get watchers() { return {
|
|
227
|
-
"stripe": ["watchInitStripe"]
|
|
228
|
-
}; }
|
|
229
|
-
};
|
|
230
|
-
ZonosAddress.style = ZonosAddressStyle0;
|
|
231
|
-
|
|
232
|
-
const colorPrefixes = [
|
|
233
|
-
'blue',
|
|
234
|
-
'cyan',
|
|
235
|
-
'green',
|
|
236
|
-
'orange',
|
|
237
|
-
'purple',
|
|
238
|
-
'red',
|
|
239
|
-
'gray',
|
|
240
|
-
'glass',
|
|
241
|
-
];
|
|
242
|
-
|
|
243
|
-
const zonosCheckboxCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:var(--amino-space-8);-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--amino-gray-400);position:relative;border-radius:var(--border-radius, var(--amino-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--amino-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
|
|
244
|
-
const ZonosCheckboxStyle0 = zonosCheckboxCss;
|
|
245
|
-
|
|
246
|
-
const ZonosCheckbox = class {
|
|
247
|
-
constructor(hostRef) {
|
|
248
|
-
registerInstance(this, hostRef);
|
|
249
|
-
this.checkboxSelected = createEvent(this, "checkboxSelected", 7);
|
|
250
|
-
this.backgroundColor = 'blue';
|
|
251
|
-
this.label = undefined;
|
|
252
|
-
this.isChecked = false;
|
|
253
|
-
this.isDisabled = false;
|
|
254
|
-
this.size = 12;
|
|
255
|
-
this.fontSize = 'base';
|
|
256
|
-
this.borderStyle = undefined;
|
|
257
|
-
}
|
|
258
|
-
render() {
|
|
259
|
-
const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
|
|
260
|
-
const backgroundColor = isBackgroundVariable
|
|
261
|
-
? `var(--amino-${this.backgroundColor}-600)`
|
|
262
|
-
: this.backgroundColor;
|
|
263
|
-
const checkmarkColor = isBackgroundVariable
|
|
264
|
-
? // use lighter color if the color is amino variable
|
|
265
|
-
`var(--amino-${this.backgroundColor}-200)`
|
|
266
|
-
: // if it's not an amino variable, use white if the background is dark, and dark if the background is light
|
|
267
|
-
!isDarkColor(backgroundColor)
|
|
268
|
-
? 'var(--amino-gray-800)'
|
|
269
|
-
: 'var(--amino-gray-0)';
|
|
270
|
-
const borderStyle = getBorderRadius(this.borderStyle, '4px');
|
|
271
|
-
return (h(Host, { key: '1383262a5cca00ede5154fbdf37bbabb8cbcd501', class: classes(['zonos--elements zonos--checkbox']), style: {
|
|
272
|
-
'--background-color': backgroundColor,
|
|
273
|
-
'--border-radius': borderStyle,
|
|
274
|
-
'--font-family': zonosStoreFontFamily(),
|
|
275
|
-
'--size': `${this.size}px`,
|
|
276
|
-
} }, h("label", { key: 'aa01d0b1eebb53587f8d2d344e3b1d01a6a7a683', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: '166eef6010570137110f8548c9eb76f32e5616e9', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
|
|
277
|
-
this.checkboxSelected.emit(e.target.checked);
|
|
278
|
-
}, type: "checkbox" }), h("span", { key: 'd98289266cd4e78dd1e5c9b89019d0dd4927e4d0', class: "checkmark-container" }, h("svg", { key: 'e179fe12a77e0c7f1f48bc943ff472d0a75e05d5', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '147acf112b6d28fa30af8e8c7fe8d7f998a507ab', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { key: 'b83bb5bb1881580be3d0ab3ed83157a0c0ce3f8e', size: this.fontSize }, this.label)))));
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
ZonosCheckbox.style = ZonosCheckboxStyle0;
|
|
282
|
-
|
|
283
|
-
const zonosCollapseCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
|
|
284
|
-
const ZonosCollapseStyle0 = zonosCollapseCss;
|
|
285
|
-
|
|
286
|
-
const ZonosCollapse = class {
|
|
287
|
-
constructor(hostRef) {
|
|
288
|
-
registerInstance(this, hostRef);
|
|
289
|
-
this.collapsed = false;
|
|
290
|
-
this.collapseSize = 0;
|
|
291
|
-
this.height = this.el.scrollHeight;
|
|
292
|
-
this.iframe = null;
|
|
293
|
-
}
|
|
294
|
-
getElementHeight() {
|
|
295
|
-
const fullHeight = `${this.height}px`;
|
|
296
|
-
const collapsedHeight = `${this.collapseSize}px`;
|
|
297
|
-
return this.collapsed ? collapsedHeight : fullHeight;
|
|
298
|
-
}
|
|
299
|
-
componentDidLoad() {
|
|
300
|
-
this.height = this.el.scrollHeight;
|
|
301
|
-
}
|
|
302
|
-
componentDidRender() {
|
|
303
|
-
var _a, _b, _c;
|
|
304
|
-
this.iframe =
|
|
305
|
-
((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('iframe')) || null;
|
|
306
|
-
(_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.addEventListener('resize', () => {
|
|
307
|
-
if (!this.iframe) {
|
|
308
|
-
// this should never happen since it's inside of resize callback
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
this.height = parseFloat(getComputedStyle(this.iframe).height);
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
render() {
|
|
315
|
-
if (!this.collapsed) {
|
|
316
|
-
// wait for the collapse animation to finish, then set overflow to visible
|
|
317
|
-
setTimeout(() => {
|
|
318
|
-
// if the element collapsed state is still not changed, set overflow to visible
|
|
319
|
-
if (!this.collapsed) {
|
|
320
|
-
this.el.style.overflow = 'visible';
|
|
321
|
-
}
|
|
322
|
-
}, 300);
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
// set overflow to hidden to prevent content from showing when collapsed
|
|
326
|
-
this.el.style.overflow = 'hidden';
|
|
327
|
-
}
|
|
328
|
-
return (h(Host, { key: 'ec163c2c73f38e479ba22bb3bea5dbe2f156170b', class: 'zonos--elements zonos--collapse', style: {
|
|
329
|
-
'--font-family': zonosStoreFontFamily(),
|
|
330
|
-
height: this.getElementHeight(),
|
|
331
|
-
} }, h("div", { key: 'ab8b73ff44968d8e2f3dcf75439b09da36fdfb22' }, h("iframe", { key: '0b6d3518382c4c17a6eacb07c1617e84c7301c39', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: '752d9054dadf8905e22cfcca81bb966c2d3ce8d3' }))));
|
|
332
|
-
}
|
|
333
|
-
get el() { return getElement(this); }
|
|
334
|
-
};
|
|
335
|
-
ZonosCollapse.style = ZonosCollapseStyle0;
|
|
336
|
-
|
|
337
|
-
const zonosLinkAuthenticationCss = ".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:var(--amino-space-16)}";
|
|
338
|
-
const ZonosLinkAuthenticationStyle0 = zonosLinkAuthenticationCss;
|
|
339
|
-
|
|
340
|
-
const ZonosLinkAuthentication = class {
|
|
341
|
-
constructor(hostRef) {
|
|
342
|
-
registerInstance(this, hostRef);
|
|
343
|
-
this.titleText = undefined;
|
|
344
|
-
this.stripe = stripeStore.stripe;
|
|
345
|
-
}
|
|
346
|
-
watchInitStripe() {
|
|
347
|
-
if (!this.stripe || !stripeStore.stripeElements) {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
// Create and mount the Authentication Element in ${type} mode
|
|
351
|
-
const linkAuthenticationElement = stripeStore.stripeLinkElement ||
|
|
352
|
-
stripeStore.stripeElements.create('linkAuthentication');
|
|
353
|
-
const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
|
|
354
|
-
if (!linkAuthenticationElementContainer) {
|
|
355
|
-
logError('Cannot find container element for linkAuthenticationElement');
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
linkAuthenticationElement.mount(linkAuthenticationElementContainer);
|
|
359
|
-
linkAuthenticationElement.on('change', event => {
|
|
360
|
-
stripeStore.stripeLinkEventData = event;
|
|
361
|
-
// run prefetch landed cost when address is changed
|
|
362
|
-
void stripeStorePrefetchLandedCost();
|
|
363
|
-
});
|
|
364
|
-
stripeStore.stripeLinkElement = linkAuthenticationElement;
|
|
365
|
-
}
|
|
366
|
-
componentDidLoad() {
|
|
367
|
-
// @Watch doesn't get trigger on initial load
|
|
368
|
-
this.watchInitStripe();
|
|
369
|
-
}
|
|
370
|
-
render() {
|
|
371
|
-
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
372
|
-
return (h(Host, { key: '97c3c388d1a035e6a46ecdbd3bc66d80a589b19f', class: "zonos--link-authentication zonos--elements" }, h("zonos-text", { key: 'e799af821045b2c1792d2971843afa0c7d3ece5b', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'eaf9be27a11d279c13f261e1312ee8a46e4620f7', class: "zonos--link-authentication-component" })));
|
|
373
|
-
}
|
|
374
|
-
get el() { return getElement(this); }
|
|
375
|
-
static get watchers() { return {
|
|
376
|
-
"stripe": ["watchInitStripe"]
|
|
377
|
-
}; }
|
|
378
|
-
};
|
|
379
|
-
ZonosLinkAuthentication.style = ZonosLinkAuthenticationStyle0;
|
|
380
|
-
|
|
381
|
-
export { ZonosAddress as zonos_address, ZonosCheckbox as zonos_checkbox, ZonosCollapse as zonos_collapse, ZonosLinkAuthentication as zonos_link_authentication };
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, d as getElement } from './index-0e31d804.js';
|
|
2
|
-
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-f3eef64b.js';
|
|
3
|
-
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { g as getBorderRadius } from './getBorderRadius-8129b0cb.js';
|
|
5
|
-
import { i as isColorVariable } from './isColorVariable-fbf2d80d.js';
|
|
6
|
-
import { i as isDarkColor } from './isDarkColor-7a6d2d14.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Get theme for button text based on background color
|
|
10
|
-
*/
|
|
11
|
-
const getButtonTheme = (overrideBackground) => {
|
|
12
|
-
// use override background if it exists, otherwise use color from setting
|
|
13
|
-
const background = overrideBackground || zonosStore.appearance.colorSecondary;
|
|
14
|
-
const backgroundColor = background && isColorVariable(background)
|
|
15
|
-
? `var(--amino-${background})`
|
|
16
|
-
: background;
|
|
17
|
-
// determine theme based on background color (to change button text color if needed)
|
|
18
|
-
const buttonTheme = backgroundColor && isDarkColor(backgroundColor) ? 'DARK' : 'LIGHT';
|
|
19
|
-
return buttonTheme;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Filter out all of the undefined values from the object so we don't have undefined css variable values
|
|
24
|
-
*/
|
|
25
|
-
const styles = (props) => {
|
|
26
|
-
// loop through the object and filter out all of the underfined values
|
|
27
|
-
return Object.entries(props).reduce((acc, [key, value]) => {
|
|
28
|
-
if (value) {
|
|
29
|
-
acc[key] = value;
|
|
30
|
-
}
|
|
31
|
-
return acc;
|
|
32
|
-
}, {});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const zonosButtonCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;border-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--amino-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--amino-radius-10);gap:var(--amino-space-8)}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-surface-color);border:none;outline:1px solid var(--amino-surface-color);border-radius:var(--border-radius, var(--amino-radius-10));-webkit-transition:var(--amino-transition);transition:var(--amino-transition);font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:var(--amino-space-8) var(--amino-space-24);color:var(--color, var(--amino-gray-1200));margin:1px;}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--background-color, var(--amino-gray-200))}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--background-color, var(--amino-gray-200))}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button.sm{height:var(--amino-size-sm);line-height:var(--amino-size-sm);padding:var(--amino-space-4) var(--amino-space-8)}:host button.sm:not(.has-content).has-icon{padding:0 var(--amino-space-4)}:host button.md{height:var(--amino-size-md);line-height:var(--amino-size-md);padding:var(--amino-space-8) var(--amino-space-16)}:host button.md:not(.has-content).has-icon{padding:0 var(--amino-space-8)}:host button.lg{height:var(--amino-size-lg);line-height:var(--amino-size-lg);padding:var(--amino-space-12) var(--amino-space-24)}:host button.lg:not(.has-content).has-icon{padding:0 var(--amino-space-16)}:host button:not(.only-icon).has-icon{gap:var(--amino-space-8)}@media (max-width: 400px){:host button:not(.only-icon).has-icon{font-size:var(--amino-font-size-s)}}:host button.override-background{background-color:var(--background-color, var(--amino-gray-0));color:var(--color, var(--amino-gray-1200));outline:1px solid var(--background-color, var(--amino-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--amino-blue-600);outline:1px solid var(--amino-blue-600);color:var(--amino-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--amino-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--amino-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--amino-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--amino-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--amino-blue-600)}:host button:not(.override-background).success{background:var(--amino-green-600);outline:1px solid var(--amino-green-600);color:var(--amino-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--amino-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--amino-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--amino-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--amino-green-400)}:host button:not(.override-background).danger{background:var(--amino-red-600);outline:1px solid var(--amino-red-600);color:var(--amino-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--amino-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--amino-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--amino-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--amino-red-400)}:host button:not(.override-background).warning{background:var(--amino-orange-600);outline:1px solid var(--amino-orange-600);color:var(--amino-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--amino-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--amino-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--amino-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--amino-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--color);outline:none}:host button:not(.override-background).subtle:not([disabled]):hover{background:var(--amino-gray-500)}:host button:not(.override-background).subtle:not([disabled]):active{background:var(--amino-gray-200)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--amino-button-focus-ring);box-shadow:var(--amino-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--amino-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--amino-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--amino-gray-200)}:host .zonos--footer-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center;border-radius:var(--amino-radius-4);width:24px}";
|
|
36
|
-
const ZonosButtonStyle0 = zonosButtonCss;
|
|
37
|
-
|
|
38
|
-
const ZonosButton = class {
|
|
39
|
-
constructor(hostRef) {
|
|
40
|
-
registerInstance(this, hostRef);
|
|
41
|
-
/**
|
|
42
|
-
* Detect if the button has an content
|
|
43
|
-
*/
|
|
44
|
-
this.handleSlotChange = () => {
|
|
45
|
-
this.hasContent = true;
|
|
46
|
-
};
|
|
47
|
-
this.buttonColor = undefined;
|
|
48
|
-
this.backgroundColor = undefined;
|
|
49
|
-
this.borderStyle = undefined;
|
|
50
|
-
this.isDisabled = false;
|
|
51
|
-
this.icon = null;
|
|
52
|
-
this.iconRight = false;
|
|
53
|
-
this.size = 'sm';
|
|
54
|
-
this.variant = 'standard';
|
|
55
|
-
this.noBackground = false;
|
|
56
|
-
this.noPaddingLeft = false;
|
|
57
|
-
this.noPaddingRight = false;
|
|
58
|
-
this.loading = false;
|
|
59
|
-
this.theme = undefined;
|
|
60
|
-
this.hasIcon = !!this.icon;
|
|
61
|
-
this.hasContent = false;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Detect if the icon changes and update the state accordingly
|
|
65
|
-
*/
|
|
66
|
-
iconChangeHandler() {
|
|
67
|
-
this.hasIcon = !!this.icon;
|
|
68
|
-
}
|
|
69
|
-
clickHandler(event) {
|
|
70
|
-
if (this.loading || this.isDisabled) {
|
|
71
|
-
event.preventDefault();
|
|
72
|
-
event.stopPropagation();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
componentWillLoad() {
|
|
76
|
-
this.iconChangeHandler();
|
|
77
|
-
}
|
|
78
|
-
render() {
|
|
79
|
-
const disabled = this.loading || this.isDisabled;
|
|
80
|
-
/**
|
|
81
|
-
* If the parent component pass in the variant prop with `undefined` value, it would not re-assign the `undefined` value with the default value.
|
|
82
|
-
* So need to re-assign the variant prop with the default value if the value is `undefined` here.
|
|
83
|
-
*/
|
|
84
|
-
const variant = this.variant || 'standard';
|
|
85
|
-
const color = this.buttonColor && isColorVariable(this.buttonColor)
|
|
86
|
-
? `var(--amino-${this.buttonColor})`
|
|
87
|
-
: this.buttonColor;
|
|
88
|
-
// use override background if it exists, otherwise use color from setting
|
|
89
|
-
const overrideBackground = this.backgroundColor || zonosStore.appearance.colorSecondary;
|
|
90
|
-
// only set theme for button to change text color if variant is standard and override background is set
|
|
91
|
-
const buttonTheme = variant === 'standard' ? getButtonTheme(overrideBackground) : undefined;
|
|
92
|
-
const borderStyle = getBorderRadius(this.borderStyle);
|
|
93
|
-
const backgroundActualColor = isColorVariable(overrideBackground) && overrideBackground
|
|
94
|
-
? window.getComputedStyle(this.ele).getPropertyValue(overrideBackground)
|
|
95
|
-
: overrideBackground;
|
|
96
|
-
const spinnerColor = backgroundActualColor && isDarkColor(backgroundActualColor)
|
|
97
|
-
? 'white'
|
|
98
|
-
: 'black';
|
|
99
|
-
return (h(Host, { key: '105badc02dbdcd9c782942e2b71719cd0ae7444e', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
|
|
100
|
-
'--background-color': overrideBackground,
|
|
101
|
-
'--border-radius': borderStyle,
|
|
102
|
-
'--color': color,
|
|
103
|
-
'--font-family': zonosStoreFontFamily(),
|
|
104
|
-
}) }, h("button", { key: 'c817b0eec6a0649e48155f284965412beb89a5f6', class: classes([
|
|
105
|
-
this.hasIcon && 'has-icon',
|
|
106
|
-
this.hasContent && 'has-content',
|
|
107
|
-
this.noBackground && 'no-background',
|
|
108
|
-
this.noPaddingLeft && 'no-padding-left',
|
|
109
|
-
this.noPaddingRight && 'no-padding-right',
|
|
110
|
-
this.iconRight && 'icon-right',
|
|
111
|
-
variant,
|
|
112
|
-
this.size,
|
|
113
|
-
// only override background if variant is set to standard
|
|
114
|
-
overrideBackground &&
|
|
115
|
-
variant === 'standard' &&
|
|
116
|
-
'override-background',
|
|
117
|
-
]), disabled: disabled }, this.loading && (h("div", { key: '85d6175e728b87276b95e831560530a3f7424a7c', class: "zonos--spinner-wrapper" }, h("zonos-spinner", { key: 'c65d771ca5182ac27da1769884dd8a4060037a1b', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: 'e3c6b155c4eb0f22aa9378586563face84ef8c2d', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
|
|
118
|
-
}
|
|
119
|
-
get ele() { return getElement(this); }
|
|
120
|
-
static get watchers() { return {
|
|
121
|
-
"icon": ["iconChangeHandler"]
|
|
122
|
-
}; }
|
|
123
|
-
};
|
|
124
|
-
ZonosButton.style = ZonosButtonStyle0;
|
|
125
|
-
|
|
126
|
-
const zonosSpinnerCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:relative;overflow:hidden;width:var(--size);height:var(--size);display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--size);height:var(--size);stroke:var(--amino-blue-600);-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite}:host circle.track{stroke:var(--amino-gray-200)}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}:host circle:not(.track){stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}:host(.black) circle{stroke:var(--amino-spinner-stroke-black)}:host(.black) circle.track{stroke:var(--amino-spinner-track-black)}:host(.white) circle{stroke:var(--amino-spinner-stroke-white)}:host(.white) circle.track{stroke:var(--amino-spinner-track-white)}:host(.info) circle{stroke:var(--amino-blue-600)}:host(.info) circle.track{stroke:var(--amino-blue-100)}:host(.success) circle{stroke:var(--amino-green-600)}:host(.success) circle.track{stroke:var(--amino-green-100)}:host(.danger) circle{stroke:var(--amino-red-600)}:host(.danger) circle.track{stroke:var(--amino-red-100)}:host(.warning) circle{stroke:var(--amino-orange-600)}:host(.warning) circle.track{stroke:var(--amino-orange-100)}";
|
|
127
|
-
const ZonosSpinnerStyle0 = zonosSpinnerCss;
|
|
128
|
-
|
|
129
|
-
const ZonosSpinner = class {
|
|
130
|
-
constructor(hostRef) {
|
|
131
|
-
registerInstance(this, hostRef);
|
|
132
|
-
this.size = 32;
|
|
133
|
-
this.spinnerColor = undefined;
|
|
134
|
-
}
|
|
135
|
-
render() {
|
|
136
|
-
if (!this.el.shadowRoot) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
return (h(Host, { class: classes(['zonos--elements', this.spinnerColor]), style: {
|
|
140
|
-
'--size': `${this.size}px`,
|
|
141
|
-
} }, h("svg", { viewBox: "0 0 50 50" }, h("circle", { class: "track", cx: "25", cy: "25", fill: "none", id: "loading-spinner-circle", r: "20", "stroke-width": "5" }), h("circle", { cx: "25", cy: "25", fill: "none", id: "loading-spinner-circle", r: "20", "stroke-width": "5" }))));
|
|
142
|
-
}
|
|
143
|
-
get el() { return getElement(this); }
|
|
144
|
-
};
|
|
145
|
-
ZonosSpinner.style = ZonosSpinnerStyle0;
|
|
146
|
-
|
|
147
|
-
export { ZonosButton as zonos_button, ZonosSpinner as zonos_spinner };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, d as getElement, H as Host } from './index-0e31d804.js';
|
|
2
|
-
import { d as zonosStoreFontFamily } from './zonosStore-f3eef64b.js';
|
|
3
|
-
import { i as isColorVariable } from './isColorVariable-fbf2d80d.js';
|
|
4
|
-
|
|
5
|
-
const zonosIconCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--width);height:var(--height);fill:var(--color);color:var(--color)}";
|
|
6
|
-
const ZonosIconStyle0 = zonosIconCss;
|
|
7
|
-
|
|
8
|
-
const ZonosIcon = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.autoHeight = false;
|
|
12
|
-
this.iconColor = 'gray-1200';
|
|
13
|
-
this.content = undefined;
|
|
14
|
-
this.size = 24;
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
if (!this.content || !this.el.shadowRoot) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
const iconColor = isColorVariable(this.iconColor)
|
|
21
|
-
? `var(--amino-${this.iconColor})`
|
|
22
|
-
: this.iconColor;
|
|
23
|
-
this.el.shadowRoot.innerHTML = this.content;
|
|
24
|
-
return (h(Host, { class: "zonos--elements", style: {
|
|
25
|
-
'--color': iconColor,
|
|
26
|
-
'--font-family': zonosStoreFontFamily(),
|
|
27
|
-
'--height': `${this.autoHeight ? 'auto' : `${this.size}px`}`,
|
|
28
|
-
'--width': `${this.size}px`,
|
|
29
|
-
} }));
|
|
30
|
-
}
|
|
31
|
-
get el() { return getElement(this); }
|
|
32
|
-
};
|
|
33
|
-
ZonosIcon.style = ZonosIconStyle0;
|
|
34
|
-
|
|
35
|
-
export { ZonosIcon as zonos_icon };
|