@zonos/elements 1.3.18-alpha.1 → 1.3.18-alpha.3
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/README.md +341 -96
- package/dist/cjs/{cart-95209ae8.js → cart-5468dfd1.js} +284 -89
- package/dist/cjs/{getBorderRadius-44b3eca1.js → getBorderRadius-bcb309a8.js} +1 -1
- package/dist/cjs/{index-654a6001.js → index-b071017b.js} +4 -1
- package/dist/cjs/index.cjs.js +624 -0
- package/dist/cjs/{isDarkColor-01f45d3f.js → isDarkColor-b0393089.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/logError-4e2f2020.js +58 -0
- package/dist/cjs/{submitGtag-9d60f3bb.js → submitGtag-127a220f.js} +4 -3
- package/dist/cjs/zonos-address_8.cjs.entry.js +30 -18
- package/dist/cjs/zonos-badge_2.cjs.entry.js +7 -7
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_3.cjs.entry.js +22 -11
- package/dist/cjs/zonos-card_2.cjs.entry.js +11 -10
- package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_11.cjs.entry.js} +118 -11
- package/dist/cjs/zonos-checkout.cjs.entry.js +47 -20
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +29 -24
- package/dist/cjs/zonos-country-flag.cjs.entry.js +6 -5
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +12 -11
- package/dist/cjs/zonos-elements.cjs.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -8
- package/dist/cjs/zonos-hello.cjs.entry.js +14 -13
- package/dist/cjs/zonos-input.cjs.entry.js +7 -7
- 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 +2 -2
- package/dist/cjs/zonos-payment.cjs.entry.js +8 -7
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/{zonosStore-d8bb0bda.js → zonosStore-7c6205ca.js} +2 -1
- package/dist/collection/__mocks__/zonos-url/index.js +1 -0
- package/dist/collection/__tests__/build-utils/urlCheckOne.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -9
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +45 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +3 -3
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +12 -0
- package/dist/collection/components/common/zonos-button/zonos-button.js +43 -8
- package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- 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-confirm-dialog/assets/ExclamationMarkDuotoneIcon.svg +4 -0
- package/dist/collection/components/common/zonos-confirm-dialog/assets/HelpDuotoneIcon.svg +4 -0
- package/dist/collection/components/common/zonos-confirm-dialog/assets/WarningDuotoneIcon.svg +4 -0
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.css +125 -0
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +322 -0
- 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 +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +1 -4
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +38 -4
- package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/{component-template/zonos-link → zonos-link}/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- 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 +3 -3
- package/dist/collection/components/main/zonos-controller.js +12 -8
- package/dist/collection/components/store/hello/localization.js +12 -2
- package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
- package/dist/collection/components/store/translationStore/strings.base.js +12 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
- package/dist/collection/components/store/translationStore/strings.french.js +12 -0
- package/dist/collection/components/store/translationStore/strings.german.js +12 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
- package/dist/collection/components/store/zonosStore.js +1 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -3
- 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/environment.js +0 -2
- package/dist/collection/index.js +1 -0
- package/dist/collection/scripts/_extractZonosQaUrl.js +26 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +40 -0
- package/dist/collection/scripts/{loadStripe.js → _loadStripe.js} +1 -1
- package/dist/collection/scripts/{zonosBase.js → _zonosBase.js} +31 -7
- package/dist/collection/scripts/index.js +2 -0
- package/dist/collection/types/generated/graphql.customer.types.js +1 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +1 -0
- package/dist/esm/{cart-6448e883.js → cart-63d120e1.js} +257 -60
- package/dist/{components/getBorderRadius.js → esm/getBorderRadius-d244b4b1.js} +1 -1
- package/dist/esm/{index-e063389c.js → index-3b46f3c3.js} +4 -1
- package/dist/esm/index.js +621 -0
- package/dist/{components/isDarkColor.js → esm/isDarkColor-39a36e82.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/logError-c456c092.js +55 -0
- package/dist/esm/{submitGtag-b7d369cd.js → submitGtag-35bb3945.js} +3 -2
- package/dist/esm/zonos-address_8.entry.js +28 -16
- package/dist/esm/zonos-badge_2.entry.js +7 -7
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_3.entry.js +22 -11
- package/dist/esm/zonos-card_2.entry.js +11 -10
- package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_11.entry.js} +118 -12
- package/dist/esm/zonos-checkout.entry.js +35 -8
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +12 -7
- package/dist/esm/zonos-country-flag.entry.js +6 -5
- package/dist/esm/zonos-country-select_3.entry.js +12 -11
- package/dist/esm/zonos-elements.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +9 -8
- package/dist/esm/zonos-hello.entry.js +6 -5
- package/dist/esm/zonos-input.entry.js +7 -7
- 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 +2 -2
- package/dist/esm/zonos-payment.entry.js +7 -6
- package/dist/esm/zonos-select-dialog-header_2.entry.js +6 -6
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/{zonosStore-33ff08ff.js → zonosStore-32e33a45.js} +2 -1
- package/dist/esm-es5/cart-63d120e1.js +1 -0
- package/dist/esm-es5/{getBorderRadius-567f1786.js → getBorderRadius-d244b4b1.js} +1 -1
- package/dist/esm-es5/{index-e063389c.js → index-3b46f3c3.js} +1 -1
- package/dist/esm-es5/index.js +1 -0
- package/dist/esm-es5/{isDarkColor-7f62035a.js → isDarkColor-39a36e82.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/logError-c456c092.js +1 -0
- package/dist/esm-es5/submitGtag-35bb3945.js +1 -0
- package/dist/esm-es5/zonos-address_8.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_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_11.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 -1
- 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-33ff08ff.js → zonosStore-32e33a45.js} +1 -1
- package/dist/scripts/index.d.ts +3908 -0
- package/dist/scripts/index.js +1 -0
- package/dist/scripts/loadZonos.d.ts +3954 -0
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +5 -7
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +13 -3
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +2 -2
- package/dist/types/components/common/zonos-button/zonos-button.d.ts +7 -1
- package/dist/types/components/common/zonos-confirm-dialog/zonos-confirm-dialog.d.ts +60 -0
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +6 -1
- package/dist/types/components/main/zonos-controller.d.ts +1 -1
- package/dist/types/components/store/checkout/stripe.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +5 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -2
- package/dist/types/components/utils/styles.d.ts +1 -0
- package/dist/types/components.d.ts +164 -19
- package/dist/types/index.d.ts +1 -0
- package/dist/types/scripts/_extractZonosQaUrl.d.ts +11 -0
- package/dist/types/scripts/_getZonosQaUrl.d.ts +4 -0
- package/dist/types/scripts/{loadStripe.d.ts → _loadStripe.d.ts} +1 -1
- package/dist/types/scripts/{zonosBase.d.ts → _zonosBase.d.ts} +51 -3
- package/dist/types/scripts/index.d.ts +2 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +12 -0
- package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +9 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +1 -0
- package/dist/types/types/generated/graphql.customer.types.ts +3 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -0
- package/dist/types/types/global.d.ts +1 -1
- package/dist/zonos-elements/assets/ExclamationMarkDuotoneIcon.svg +4 -0
- package/dist/zonos-elements/assets/HelpDuotoneIcon.svg +4 -0
- package/dist/zonos-elements/assets/WarningDuotoneIcon.svg +4 -0
- package/dist/zonos-elements/index.esm.js +1 -0
- package/dist/zonos-elements/p-023c764c.system.entry.js +1 -0
- package/dist/zonos-elements/p-06b6ce37.system.entry.js +1 -0
- package/dist/zonos-elements/p-07c53d83.entry.js +1 -0
- package/dist/zonos-elements/{p-fe246229.system.entry.js → p-0d0f9694.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fd49d864.entry.js → p-0d5b5bcc.entry.js} +1 -1
- package/dist/zonos-elements/{p-771fbeb3.system.js → p-1b9442f6.system.js} +1 -1
- package/dist/zonos-elements/p-200b661c.entry.js +1 -0
- package/dist/zonos-elements/{p-835c8928.entry.js → p-281b8bdf.entry.js} +1 -1
- package/dist/zonos-elements/{p-a889c1bc.entry.js → p-2af19b63.entry.js} +1 -1
- package/dist/zonos-elements/{p-582d8b27.entry.js → p-2ced091f.entry.js} +1 -1
- package/dist/zonos-elements/{p-909a331c.js → p-2f759d82.js} +1 -1
- package/dist/zonos-elements/p-3b66df06.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d7acc81c.entry.js → p-3ba8838a.entry.js} +1 -1
- package/dist/zonos-elements/p-428c034a.entry.js +1 -0
- package/dist/zonos-elements/p-43b2d28d.system.entry.js +1 -0
- package/dist/zonos-elements/p-47a42a30.js +1 -0
- package/dist/zonos-elements/{p-9ec93319.entry.js → p-498a0e18.entry.js} +1 -1
- package/dist/zonos-elements/{p-f71489e5.system.entry.js → p-4f72bfee.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4fc1459c.entry.js +1 -0
- package/dist/zonos-elements/p-4fca8fd5.system.entry.js +1 -0
- package/dist/zonos-elements/{p-79f3c4f5.system.js → p-58e730b6.system.js} +1 -1
- package/dist/zonos-elements/{p-83fecb2a.entry.js → p-58fc8ec1.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7b4b756.entry.js → p-597b75f3.entry.js} +1 -1
- package/dist/zonos-elements/{p-87badea9.system.js → p-62ecfbcc.system.js} +1 -1
- package/dist/zonos-elements/p-63db40b9.system.js +1 -0
- package/dist/zonos-elements/p-693b9985.js +1 -0
- package/dist/zonos-elements/{p-ff403840.entry.js → p-6cb9812b.entry.js} +1 -1
- package/dist/zonos-elements/p-6df1fc3a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-bf32179a.system.entry.js → p-6eda6199.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6f6f160d.entry.js +1 -0
- package/dist/zonos-elements/p-7c78e340.entry.js +1 -0
- package/dist/zonos-elements/{p-305f27c7.entry.js → p-80442f16.entry.js} +1 -1
- package/dist/zonos-elements/p-808fa731.js +1 -0
- package/dist/zonos-elements/p-80f174b9.system.js +1 -0
- package/dist/zonos-elements/{p-679877b1.system.entry.js → p-8171d013.system.entry.js} +1 -1
- package/dist/zonos-elements/p-85f3d13f.system.js +1 -0
- package/dist/zonos-elements/p-8aeb0629.entry.js +1 -0
- package/dist/zonos-elements/{p-83cc2936.js → p-8c0b4a61.js} +1 -1
- package/dist/zonos-elements/{p-4dca5484.system.entry.js → p-8cd6633a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9288fd21.system.entry.js +1 -0
- package/dist/zonos-elements/p-98ad4ab3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ad088d46.system.entry.js → p-9e8d38f7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e108e5ed.system.entry.js → p-a47382ae.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b1567fa3.system.entry.js +1 -0
- package/dist/zonos-elements/p-b81562f5.entry.js +1 -0
- package/dist/zonos-elements/{p-3638e2ed.entry.js → p-bd9b2165.entry.js} +1 -1
- package/dist/zonos-elements/p-bdfa3705.system.entry.js +1 -0
- package/dist/zonos-elements/{p-13ddaf31.js → p-ce347974.js} +1 -1
- package/dist/zonos-elements/p-cfae51c1.system.js +1 -0
- package/dist/zonos-elements/p-d6eb260c.entry.js +1 -0
- package/dist/zonos-elements/{p-17e265c3.system.entry.js → p-d7a939df.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-163ff5b5.system.js → p-d99232c5.system.js} +1 -1
- package/dist/zonos-elements/p-dc40a60c.entry.js +1 -0
- package/dist/zonos-elements/{p-36a461a6.system.entry.js → p-dda78e8e.system.entry.js} +1 -1
- package/dist/zonos-elements/p-de405d7e.system.entry.js +1 -0
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -0
- package/dist/zonos-elements/p-eaa335e1.js +1 -0
- package/dist/zonos-elements/{p-b98bdbcc.system.entry.js → p-ed3524ae.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +5 -3
- package/dist/components/ILanguage.js +0 -24
- package/dist/components/classes.js +0 -12
- package/dist/components/containsNonLatinChars.js +0 -21
- package/dist/components/formatCurrency.js +0 -11
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -1
- package/dist/components/isCheckoutMobile.js +0 -6
- package/dist/components/isColorVariable.js +0 -14
- package/dist/components/stripe.js +0 -1681
- package/dist/components/submitGtag.js +0 -19
- package/dist/components/trackConversionEvent.js +0 -37
- package/dist/components/translationStore.js +0 -5371
- package/dist/components/zonos-address-display.d.ts +0 -11
- package/dist/components/zonos-address-display.js +0 -6
- package/dist/components/zonos-address-display2.js +0 -64
- package/dist/components/zonos-address-form.d.ts +0 -11
- package/dist/components/zonos-address-form.js +0 -6
- package/dist/components/zonos-address-form2.js +0 -84
- package/dist/components/zonos-address-update-dialog.d.ts +0 -11
- package/dist/components/zonos-address-update-dialog.js +0 -6
- package/dist/components/zonos-address-update-dialog2.js +0 -264
- package/dist/components/zonos-address.d.ts +0 -11
- package/dist/components/zonos-address.js +0 -6
- package/dist/components/zonos-address2.js +0 -176
- package/dist/components/zonos-badge.d.ts +0 -11
- package/dist/components/zonos-badge.js +0 -6
- package/dist/components/zonos-badge2.js +0 -61
- package/dist/components/zonos-banner.d.ts +0 -11
- package/dist/components/zonos-banner.js +0 -6
- package/dist/components/zonos-banner2.js +0 -95
- package/dist/components/zonos-button.d.ts +0 -11
- package/dist/components/zonos-button.js +0 -6
- package/dist/components/zonos-button2.js +0 -174
- package/dist/components/zonos-card.d.ts +0 -11
- package/dist/components/zonos-card.js +0 -6
- package/dist/components/zonos-card2.js +0 -57
- package/dist/components/zonos-cart-items.d.ts +0 -11
- package/dist/components/zonos-cart-items.js +0 -6
- package/dist/components/zonos-cart-items2.js +0 -57
- package/dist/components/zonos-cart-restricted-items.d.ts +0 -11
- package/dist/components/zonos-cart-restricted-items.js +0 -6
- package/dist/components/zonos-cart-restricted-items2.js +0 -135
- package/dist/components/zonos-cart-subtotal.d.ts +0 -11
- package/dist/components/zonos-cart-subtotal.js +0 -6
- package/dist/components/zonos-cart-subtotal2.js +0 -91
- package/dist/components/zonos-checkbox.d.ts +0 -11
- package/dist/components/zonos-checkbox.js +0 -6
- package/dist/components/zonos-checkbox2.js +0 -96
- package/dist/components/zonos-checkout-finish.d.ts +0 -11
- package/dist/components/zonos-checkout-finish.js +0 -6
- package/dist/components/zonos-checkout-finish2.js +0 -246
- package/dist/components/zonos-checkout-footer.d.ts +0 -11
- package/dist/components/zonos-checkout-footer.js +0 -6
- package/dist/components/zonos-checkout-footer2.js +0 -125
- package/dist/components/zonos-checkout-payment.d.ts +0 -11
- package/dist/components/zonos-checkout-payment.js +0 -6
- package/dist/components/zonos-checkout-payment2.js +0 -104
- package/dist/components/zonos-checkout-progress-tabs.d.ts +0 -11
- package/dist/components/zonos-checkout-progress-tabs.js +0 -6
- package/dist/components/zonos-checkout-progress-tabs2.js +0 -138
- package/dist/components/zonos-checkout.d.ts +0 -11
- package/dist/components/zonos-checkout.js +0 -1018
- package/dist/components/zonos-collapse.d.ts +0 -11
- package/dist/components/zonos-collapse.js +0 -6
- package/dist/components/zonos-collapse2.js +0 -78
- package/dist/components/zonos-component.d.ts +0 -11
- package/dist/components/zonos-component.js +0 -48
- package/dist/components/zonos-controller.d.ts +0 -11
- package/dist/components/zonos-controller.js +0 -309
- package/dist/components/zonos-country-flag.d.ts +0 -11
- package/dist/components/zonos-country-flag.js +0 -6
- package/dist/components/zonos-country-flag2.js +0 -54
- package/dist/components/zonos-country-select.d.ts +0 -11
- package/dist/components/zonos-country-select.js +0 -6
- package/dist/components/zonos-country-select2.js +0 -1891
- package/dist/components/zonos-custom-message.d.ts +0 -11
- package/dist/components/zonos-custom-message.js +0 -6
- package/dist/components/zonos-custom-message2.js +0 -72
- package/dist/components/zonos-customer-info.d.ts +0 -11
- package/dist/components/zonos-customer-info.js +0 -6
- package/dist/components/zonos-customer-info2.js +0 -316
- package/dist/components/zonos-dialog.d.ts +0 -11
- package/dist/components/zonos-dialog.js +0 -6
- package/dist/components/zonos-dialog2.js +0 -124
- package/dist/components/zonos-hello-dialog-footer.d.ts +0 -11
- package/dist/components/zonos-hello-dialog-footer.js +0 -6
- package/dist/components/zonos-hello-dialog-footer2.js +0 -83
- package/dist/components/zonos-hello-dialog.d.ts +0 -11
- package/dist/components/zonos-hello-dialog.js +0 -6
- package/dist/components/zonos-hello-dialog2.js +0 -305
- package/dist/components/zonos-hello.d.ts +0 -11
- package/dist/components/zonos-hello.js +0 -879
- package/dist/components/zonos-icon.d.ts +0 -11
- package/dist/components/zonos-icon.js +0 -6
- package/dist/components/zonos-icon2.js +0 -55
- package/dist/components/zonos-input.d.ts +0 -11
- package/dist/components/zonos-input.js +0 -6
- package/dist/components/zonos-input2.js +0 -78
- package/dist/components/zonos-language-select.d.ts +0 -11
- package/dist/components/zonos-language-select.js +0 -6
- package/dist/components/zonos-language-select2.js +0 -88
- package/dist/components/zonos-link-authentication.d.ts +0 -11
- package/dist/components/zonos-link-authentication.js +0 -6
- package/dist/components/zonos-link-authentication2.js +0 -80
- package/dist/components/zonos-link.d.ts +0 -11
- package/dist/components/zonos-link.js +0 -43
- package/dist/components/zonos-logo.d.ts +0 -11
- package/dist/components/zonos-logo.js +0 -49
- package/dist/components/zonos-notification.d.ts +0 -11
- package/dist/components/zonos-notification.js +0 -6
- package/dist/components/zonos-notification2.js +0 -92
- package/dist/components/zonos-payment.d.ts +0 -11
- package/dist/components/zonos-payment.js +0 -6
- package/dist/components/zonos-payment2.js +0 -77
- package/dist/components/zonos-review.d.ts +0 -11
- package/dist/components/zonos-review.js +0 -6
- package/dist/components/zonos-review2.js +0 -89
- package/dist/components/zonos-select-dialog-header.d.ts +0 -11
- package/dist/components/zonos-select-dialog-header.js +0 -6
- package/dist/components/zonos-select-dialog-header2.js +0 -71
- package/dist/components/zonos-shipping-rich-radio.d.ts +0 -11
- package/dist/components/zonos-shipping-rich-radio.js +0 -6
- package/dist/components/zonos-shipping-rich-radio2.js +0 -88
- package/dist/components/zonos-shipping.d.ts +0 -11
- package/dist/components/zonos-shipping.js +0 -6
- package/dist/components/zonos-shipping2.js +0 -159
- package/dist/components/zonos-spinner.d.ts +0 -11
- package/dist/components/zonos-spinner.js +0 -6
- package/dist/components/zonos-spinner2.js +0 -43
- package/dist/components/zonos-text.d.ts +0 -11
- package/dist/components/zonos-text.js +0 -6
- package/dist/components/zonos-text2.js +0 -182
- package/dist/components/zonos-tooltip.d.ts +0 -11
- package/dist/components/zonos-tooltip.js +0 -6
- package/dist/components/zonos-tooltip2.js +0 -48
- package/dist/components/zonos-v-stack.d.ts +0 -11
- package/dist/components/zonos-v-stack.js +0 -6
- package/dist/components/zonos-v-stack2.js +0 -38
- package/dist/components/zonosStore.js +0 -2880
- package/dist/esm/getBorderRadius-567f1786.js +0 -18
- package/dist/esm/isDarkColor-7f62035a.js +0 -1199
- package/dist/esm-es5/cart-6448e883.js +0 -1
- package/dist/esm-es5/submitGtag-b7d369cd.js +0 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
- package/dist/scripts/checkIfLoadVersionDomain.js +0 -1
- package/dist/scripts/extractZonosQaUrl.js +0 -1
- package/dist/scripts/getTempCartById.js +0 -1
- package/dist/scripts/loadStripe.js +0 -1
- package/dist/scripts/stripe.js +0 -1
- package/dist/scripts/zonosBase.js +0 -1
- package/dist/zonos-elements/p-0759a84d.system.entry.js +0 -1
- package/dist/zonos-elements/p-0ee61fba.system.entry.js +0 -1
- package/dist/zonos-elements/p-154aaf95.system.js +0 -1
- package/dist/zonos-elements/p-2fc561ac.system.entry.js +0 -1
- package/dist/zonos-elements/p-345503b7.entry.js +0 -1
- package/dist/zonos-elements/p-3be2e469.entry.js +0 -1
- package/dist/zonos-elements/p-47c75f81.system.entry.js +0 -1
- package/dist/zonos-elements/p-50ea2036.system.js +0 -1
- package/dist/zonos-elements/p-54004793.system.entry.js +0 -1
- package/dist/zonos-elements/p-58f8cee7.system.entry.js +0 -1
- package/dist/zonos-elements/p-61100d2e.system.entry.js +0 -1
- package/dist/zonos-elements/p-6ea746b9.entry.js +0 -1
- package/dist/zonos-elements/p-70c35519.system.entry.js +0 -1
- package/dist/zonos-elements/p-7b19cd96.entry.js +0 -1
- package/dist/zonos-elements/p-7cc730b0.js +0 -1
- package/dist/zonos-elements/p-7f48fafe.entry.js +0 -1
- package/dist/zonos-elements/p-9c575a18.system.entry.js +0 -1
- package/dist/zonos-elements/p-aaf1e517.system.js +0 -1
- package/dist/zonos-elements/p-aff5f4ca.js +0 -1
- package/dist/zonos-elements/p-beca252d.entry.js +0 -1
- package/dist/zonos-elements/p-c1f4bb4a.entry.js +0 -1
- package/dist/zonos-elements/p-c64eefdd.system.entry.js +0 -1
- package/dist/zonos-elements/p-ca621143.entry.js +0 -1
- package/dist/zonos-elements/p-dbee6587.entry.js +0 -1
- package/dist/zonos-elements/p-e0706108.system.entry.js +0 -1
- package/dist/zonos-elements/p-e3335228.entry.js +0 -1
- package/dist/zonos-elements/p-ef9cbb66.system.js +0 -1
- package/dist/zonos-elements/p-f1962041.js +0 -1
- /package/dist/collection/components/common/{component-template/zonos-link → zonos-link}/zonos-link.css +0 -0
- /package/dist/collection/scripts/{checkIfLoadVersionDomain.js → _checkIfLoadVersionDomain.js} +0 -0
- /package/dist/collection/scripts/{stripe.js → _stripe.js} +0 -0
- /package/dist/types/components/common/{component-template/zonos-link → zonos-link}/zonos-link.d.ts +0 -0
- /package/dist/types/scripts/{checkIfLoadVersionDomain.d.ts → _checkIfLoadVersionDomain.d.ts} +0 -0
- /package/dist/types/scripts/{stripe.d.ts → _stripe.d.ts} +0 -0
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { s as stripeStore, l as logError, a as localizationStore } from './stripe.js';
|
|
3
|
-
import { i as isCheckoutMobile } from './isCheckoutMobile.js';
|
|
4
|
-
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
5
|
-
|
|
6
|
-
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:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
|
|
7
|
-
const ZonosAddressStyle0 = zonosAddressCss;
|
|
8
|
-
|
|
9
|
-
const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends HTMLElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
this.invalidCharacters = createEvent(this, "invalidCharacters", 7);
|
|
14
|
-
this.type = undefined;
|
|
15
|
-
this.titleText = undefined;
|
|
16
|
-
this.defaultAddress = null;
|
|
17
|
-
this.stripe = window.Zonos.stripe;
|
|
18
|
-
this.isDirtyAddress = false;
|
|
19
|
-
}
|
|
20
|
-
getStripeAddressInstance() {
|
|
21
|
-
if (this.type === 'billing') {
|
|
22
|
-
return {
|
|
23
|
-
stripeAddressElement: stripeStore.stripeBillingAddressElement,
|
|
24
|
-
stripeAddressEventData: stripeStore.stripeBillingAddressEventData,
|
|
25
|
-
stripeElements: stripeStore.stripeElementsForBillingAddress,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
stripeAddressElement: stripeStore.stripeAddressElement,
|
|
30
|
-
stripeAddressEventData: stripeStore.stripeAddressEventData,
|
|
31
|
-
stripeElements: stripeStore.stripeElements,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
updateAddressEventData({ event, type, }) {
|
|
35
|
-
switch (type) {
|
|
36
|
-
case 'billing':
|
|
37
|
-
stripeStore.stripeBillingAddressEventData = event;
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
stripeStore.stripeAddressEventData = event;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
updateAddressElement({ stripeAddressElement, type, }) {
|
|
45
|
-
if (type === 'shipping') {
|
|
46
|
-
stripeStore.stripeAddressElement = stripeAddressElement;
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
stripeStore.stripeBillingAddressElement = stripeAddressElement;
|
|
50
|
-
}
|
|
51
|
-
async watchInitStripe() {
|
|
52
|
-
var _a, _b;
|
|
53
|
-
this.stripe = window.Zonos.stripe;
|
|
54
|
-
const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
|
|
55
|
-
if (!this.stripe || !stripeElements) {
|
|
56
|
-
logError("Stripe is not initialized. Couldn't load stripe element.");
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const phone = (_a = this.defaultAddress) === null || _a === void 0 ? void 0 : _a.phone;
|
|
60
|
-
if (!phone) {
|
|
61
|
-
// remove phone from default address if it's not provided, stripe
|
|
62
|
-
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
63
|
-
(_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
|
|
64
|
-
}
|
|
65
|
-
const shippableCountries = localizationStore.shippingZoneCountries;
|
|
66
|
-
const shippingZone = shippableCountries
|
|
67
|
-
? Object.values(shippableCountries).map(country => country.code)
|
|
68
|
-
: [];
|
|
69
|
-
const addressElement = stripeElements.create('address', {
|
|
70
|
-
allowedCountries: this.type === 'shipping' ? shippingZone : [],
|
|
71
|
-
// only show the default address if stripeAddressEventData is not provided
|
|
72
|
-
contacts: this.defaultAddress && !stripeAddressEventData
|
|
73
|
-
? [this.defaultAddress]
|
|
74
|
-
: [],
|
|
75
|
-
defaultValues: {
|
|
76
|
-
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) ||
|
|
77
|
-
localizationStore.selectedCountryCode ||
|
|
78
|
-
'AL' }),
|
|
79
|
-
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
80
|
-
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
81
|
-
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
82
|
-
},
|
|
83
|
-
display: {
|
|
84
|
-
name: 'split',
|
|
85
|
-
},
|
|
86
|
-
fields: {
|
|
87
|
-
phone: 'always',
|
|
88
|
-
},
|
|
89
|
-
mode: this.type,
|
|
90
|
-
validation: {
|
|
91
|
-
phone: {
|
|
92
|
-
required: 'always',
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
addressElement.mount(this.el.querySelector('.zonos--address-component'));
|
|
97
|
-
addressElement.on('change', event => {
|
|
98
|
-
const eventValue = event.value;
|
|
99
|
-
if (!this.isDirtyAddress && eventValue.address.line1.length >= 3) {
|
|
100
|
-
this.isDirtyAddress = true;
|
|
101
|
-
// stripe element started with just address line 1, so scroll bar is not yet available. Wait for a moment before scrolling
|
|
102
|
-
setTimeout(() => {
|
|
103
|
-
// scroll directly into view if it's mobile
|
|
104
|
-
if (isCheckoutMobile()) {
|
|
105
|
-
this.el.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
// scroll into the end of the page so the address placeholder won't be hidden
|
|
109
|
-
const yOffset = this.type === 'shipping' ? 100 : 600;
|
|
110
|
-
const parentWrapper = this.el.closest('.zonos--group');
|
|
111
|
-
const y = this.el.getBoundingClientRect().top + yOffset;
|
|
112
|
-
parentWrapper === null || parentWrapper === void 0 ? void 0 : parentWrapper.scrollTo({ behavior: 'smooth', top: y });
|
|
113
|
-
}
|
|
114
|
-
}, 600);
|
|
115
|
-
}
|
|
116
|
-
this.updateAddressEventData({
|
|
117
|
-
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] }) }),
|
|
118
|
-
type: this.type,
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
this.updateAddressElement({
|
|
122
|
-
stripeAddressElement: addressElement,
|
|
123
|
-
type: this.type,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
disconnectedCallback() {
|
|
127
|
-
// destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
|
|
128
|
-
const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
|
|
129
|
-
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
|
|
130
|
-
}
|
|
131
|
-
componentDidLoad() {
|
|
132
|
-
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
133
|
-
this.isDirtyAddress =
|
|
134
|
-
!!stripeAddressEventData &&
|
|
135
|
-
stripeAddressEventData.value.address.line1.length > 0;
|
|
136
|
-
// @Watch doesn't get trigger on initial load
|
|
137
|
-
void this.watchInitStripe();
|
|
138
|
-
}
|
|
139
|
-
render() {
|
|
140
|
-
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
141
|
-
return (h(Host, { key: 'f45a7bbe9d6b5ffac15671a862b3ad4f2eb4a87b', class: "zonos--address zonos--elements" }, h("zonos-text", { key: 'a9119e6e0c4e5c81a7d17ebe4d6bec925404a3dd', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '7dc12043c6e75ebabd646490c390bafdc2cd4a1d', class: "zonos--address-component" })));
|
|
142
|
-
}
|
|
143
|
-
get el() { return this; }
|
|
144
|
-
static get watchers() { return {
|
|
145
|
-
"stripe": ["watchInitStripe"]
|
|
146
|
-
}; }
|
|
147
|
-
static get style() { return ZonosAddressStyle0; }
|
|
148
|
-
}, [2, "zonos-address", {
|
|
149
|
-
"type": [1],
|
|
150
|
-
"titleText": [1, "title-text"],
|
|
151
|
-
"defaultAddress": [16],
|
|
152
|
-
"stripe": [32],
|
|
153
|
-
"isDirtyAddress": [32]
|
|
154
|
-
}, undefined, {
|
|
155
|
-
"stripe": ["watchInitStripe"]
|
|
156
|
-
}]);
|
|
157
|
-
function defineCustomElement() {
|
|
158
|
-
if (typeof customElements === "undefined") {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
const components = ["zonos-address", "zonos-text"];
|
|
162
|
-
components.forEach(tagName => { switch (tagName) {
|
|
163
|
-
case "zonos-address":
|
|
164
|
-
if (!customElements.get(tagName)) {
|
|
165
|
-
customElements.define(tagName, ZonosAddress);
|
|
166
|
-
}
|
|
167
|
-
break;
|
|
168
|
-
case "zonos-text":
|
|
169
|
-
if (!customElements.get(tagName)) {
|
|
170
|
-
defineCustomElement$1();
|
|
171
|
-
}
|
|
172
|
-
break;
|
|
173
|
-
} });
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export { ZonosAddress as Z, defineCustomElement as d };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface ZonosBadge extends Components.ZonosBadge, HTMLElement {}
|
|
4
|
-
export const ZonosBadge: {
|
|
5
|
-
prototype: ZonosBadge;
|
|
6
|
-
new (): ZonosBadge;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { a as zonosStoreFontFamily } from './zonosStore.js';
|
|
3
|
-
import { c as classes } from './classes.js';
|
|
4
|
-
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
5
|
-
|
|
6
|
-
const zonosBadgeCss = ":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 .zonos--badge-content{display:-ms-flexbox;display:flex;gap:8px;font-size:var(--zonos-elements-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--zonos-elements-radius-6);background-color:var(--zonos-elements-gray-100);color:var(--zonos-elements-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--zonos-elements-gray-600);color:var(--zonos-elements-gray-100)}:host .blue{background-color:var(--zonos-elements-blue-100);color:var(--zonos-elements-blue-800)}:host .blue.bold{background-color:var(--zonos-elements-blue-600);color:var(--zonos-elements-blue-100)}:host .green{background-color:var(--zonos-elements-green-100);color:var(--zonos-elements-green-800)}:host .green.bold{background-color:var(--zonos-elements-green-600);color:var(--zonos-elements-green-100)}:host .red{background-color:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800)}:host .red.bold{background-color:var(--zonos-elements-red-600);color:var(--zonos-elements-red-100)}:host .orange{background-color:var(--zonos-elements-orange-100);color:var(--zonos-elements-orange-800)}:host .orange.bold{background-color:var(--zonos-elements-orange-600);color:var(--zonos-elements-orange-100)}:host .purple{background-color:var(--zonos-elements-purple-100);color:var(--zonos-elements-purple-800)}:host .purple.bold{background-color:var(--zonos-elements-purple-600);color:var(--zonos-elements-purple-100)}:host .cyan{background-color:var(--zonos-elements-cyan-100);color:var(--zonos-elements-cyan-800)}:host .cyan.bold{background-color:var(--zonos-elements-cyan-600);color:var(--zonos-elements-cyan-100)}";
|
|
7
|
-
const ZonosBadgeStyle0 = zonosBadgeCss;
|
|
8
|
-
|
|
9
|
-
const ZonosBadge = /*@__PURE__*/ proxyCustomElement(class ZonosBadge extends HTMLElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
this.__attachShadow();
|
|
14
|
-
this.bold = false;
|
|
15
|
-
this.badgeColor = 'gray';
|
|
16
|
-
this.icon = undefined;
|
|
17
|
-
this.iconRight = false;
|
|
18
|
-
this.size = 'default';
|
|
19
|
-
this.rounded = false;
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return (h(Host, { key: 'c68ba6ef2bcb35c94ecf2b11379be748aa998198', class: classes(['zonos--elements zonos--badge']), style: {
|
|
23
|
-
'--font-family': zonosStoreFontFamily(),
|
|
24
|
-
} }, h("div", { key: '7f200effb42296a21829c292101ef3300b041327', class: classes([
|
|
25
|
-
'zonos--badge-content',
|
|
26
|
-
this.badgeColor,
|
|
27
|
-
this.rounded && 'rounded',
|
|
28
|
-
this.iconRight && 'icon-right',
|
|
29
|
-
this.size,
|
|
30
|
-
this.bold && 'bold',
|
|
31
|
-
]) }, this.icon, h("zonos-text", { key: '4358e95cb29ec6a82e32213b268612aadf8772c6' }, h("slot", { key: 'ab76831e3691a896179e06896d33ed771e4bbdf9' })))));
|
|
32
|
-
}
|
|
33
|
-
static get style() { return ZonosBadgeStyle0; }
|
|
34
|
-
}, [1, "zonos-badge", {
|
|
35
|
-
"bold": [4],
|
|
36
|
-
"badgeColor": [1, "badge-color"],
|
|
37
|
-
"icon": [16],
|
|
38
|
-
"iconRight": [4, "icon-right"],
|
|
39
|
-
"size": [1],
|
|
40
|
-
"rounded": [4]
|
|
41
|
-
}]);
|
|
42
|
-
function defineCustomElement() {
|
|
43
|
-
if (typeof customElements === "undefined") {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const components = ["zonos-badge", "zonos-text"];
|
|
47
|
-
components.forEach(tagName => { switch (tagName) {
|
|
48
|
-
case "zonos-badge":
|
|
49
|
-
if (!customElements.get(tagName)) {
|
|
50
|
-
customElements.define(tagName, ZonosBadge);
|
|
51
|
-
}
|
|
52
|
-
break;
|
|
53
|
-
case "zonos-text":
|
|
54
|
-
if (!customElements.get(tagName)) {
|
|
55
|
-
defineCustomElement$1();
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
} });
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { ZonosBadge as Z, defineCustomElement as d };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface ZonosBanner extends Components.ZonosBanner, HTMLElement {}
|
|
4
|
-
export const ZonosBanner: {
|
|
5
|
-
prototype: ZonosBanner;
|
|
6
|
-
new (): ZonosBanner;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { a as zonosStoreFontFamily } from './zonosStore.js';
|
|
3
|
-
import { c as classes } from './classes.js';
|
|
4
|
-
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
5
|
-
|
|
6
|
-
const zonosBannerCss = ":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{border-radius:var(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:\"icon header\" \". content\";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}";
|
|
7
|
-
const ZonosBannerStyle0 = zonosBannerCss;
|
|
8
|
-
|
|
9
|
-
const ZonosBanner = /*@__PURE__*/ proxyCustomElement(class ZonosBanner extends HTMLElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
this.__registerHost();
|
|
13
|
-
this.__attachShadow();
|
|
14
|
-
/**
|
|
15
|
-
* Detect if the button has an content
|
|
16
|
-
*/
|
|
17
|
-
this.handleSlotChange = () => {
|
|
18
|
-
this.hasContent = true;
|
|
19
|
-
};
|
|
20
|
-
this.bannerTitle = undefined;
|
|
21
|
-
this.intent = undefined;
|
|
22
|
-
this.hasContent = false;
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
const renderContent = ({ color }) => {
|
|
26
|
-
const primaryColor = `var(--zonos-elements-${color}-800)`;
|
|
27
|
-
const secondaryColor = `var(--zonos-elements-${color}-300)`;
|
|
28
|
-
const [header, content] = [
|
|
29
|
-
this.bannerTitle,
|
|
30
|
-
h("slot", { onSlotchange: this.handleSlotChange }),
|
|
31
|
-
].filter(Boolean);
|
|
32
|
-
const textColor = color === 'gray' ? 'gray-1200' : `${color}-800`;
|
|
33
|
-
return (h("div", { class: classes(['zonos--container']) }, h("div", { class: "zonos--icon-wrapper" }, h("svg", { color: primaryColor, fill: "none", height: "20", viewBox: "0 0 24 24", width: "20", xmlns: "https://www.w3.org/2000/svg" }, h("path", { "clip-rule": "evenodd", d: "M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z", "data-is-secondary-color": "true", fill: secondaryColor, "fill-rule": "evenodd" }), h("path", { "clip-rule": "evenodd", d: "M12 6.99a1 1 0 0 1 1 1V8a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1ZM12 11a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Z", fill: "currentColor", "fill-rule": "evenodd" }))), h("div", { class: "zonos--header-wrapper" }, h("zonos-text", { textColor: textColor, type: "label", weight: 600 }, header)), content && (h("div", { class: "zonos--content-wrapper" }, h("zonos-text", { textColor: textColor }, content)))));
|
|
34
|
-
};
|
|
35
|
-
const baseClass = classes(['zonos--elements zonos--banner', this.intent]);
|
|
36
|
-
const font = zonosStoreFontFamily();
|
|
37
|
-
switch (this.intent) {
|
|
38
|
-
case 'error':
|
|
39
|
-
return (h(Host, { class: baseClass, style: {
|
|
40
|
-
'--font-family': font,
|
|
41
|
-
} }, renderContent({
|
|
42
|
-
color: 'red',
|
|
43
|
-
})));
|
|
44
|
-
case 'info':
|
|
45
|
-
return (h(Host, { class: baseClass, style: {
|
|
46
|
-
'--font-family': font,
|
|
47
|
-
} }, renderContent({
|
|
48
|
-
color: 'blue',
|
|
49
|
-
})));
|
|
50
|
-
case 'success':
|
|
51
|
-
return (h(Host, { class: baseClass, style: {
|
|
52
|
-
'--font-family': font,
|
|
53
|
-
} }, renderContent({
|
|
54
|
-
color: 'green',
|
|
55
|
-
})));
|
|
56
|
-
case 'warning':
|
|
57
|
-
return (h(Host, { class: baseClass, style: {
|
|
58
|
-
'--font-family': font,
|
|
59
|
-
} }, renderContent({
|
|
60
|
-
color: 'orange',
|
|
61
|
-
})));
|
|
62
|
-
default:
|
|
63
|
-
return (h(Host, { class: baseClass, style: {
|
|
64
|
-
'--font-family': font,
|
|
65
|
-
} }, renderContent({
|
|
66
|
-
color: 'gray',
|
|
67
|
-
})));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
static get style() { return ZonosBannerStyle0; }
|
|
71
|
-
}, [1, "zonos-banner", {
|
|
72
|
-
"bannerTitle": [1, "banner-title"],
|
|
73
|
-
"intent": [1],
|
|
74
|
-
"hasContent": [32]
|
|
75
|
-
}]);
|
|
76
|
-
function defineCustomElement() {
|
|
77
|
-
if (typeof customElements === "undefined") {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const components = ["zonos-banner", "zonos-text"];
|
|
81
|
-
components.forEach(tagName => { switch (tagName) {
|
|
82
|
-
case "zonos-banner":
|
|
83
|
-
if (!customElements.get(tagName)) {
|
|
84
|
-
customElements.define(tagName, ZonosBanner);
|
|
85
|
-
}
|
|
86
|
-
break;
|
|
87
|
-
case "zonos-text":
|
|
88
|
-
if (!customElements.get(tagName)) {
|
|
89
|
-
defineCustomElement$1();
|
|
90
|
-
}
|
|
91
|
-
break;
|
|
92
|
-
} });
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export { ZonosBanner as Z, defineCustomElement as d };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface ZonosButton extends Components.ZonosButton, HTMLElement {}
|
|
4
|
-
export const ZonosButton: {
|
|
5
|
-
prototype: ZonosButton;
|
|
6
|
-
new (): ZonosButton;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { z as zonosStore, a as zonosStoreFontFamily } from './zonosStore.js';
|
|
3
|
-
import { c as classes } from './classes.js';
|
|
4
|
-
import { g as getBorderRadius } from './getBorderRadius.js';
|
|
5
|
-
import { i as isColorVariable } from './isColorVariable.js';
|
|
6
|
-
import { i as isDarkColor } from './isDarkColor.js';
|
|
7
|
-
import { d as defineCustomElement$1 } from './zonos-spinner2.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get theme for button text based on background color
|
|
11
|
-
*/
|
|
12
|
-
const getButtonTheme = (overrideBackground) => {
|
|
13
|
-
// use override background if it exists, otherwise use color from setting
|
|
14
|
-
const background = overrideBackground || zonosStore.appearance.colorSecondary;
|
|
15
|
-
const backgroundColor = background && isColorVariable(background)
|
|
16
|
-
? `var(--zonos-elements-${background})`
|
|
17
|
-
: background;
|
|
18
|
-
// determine theme based on background color (to change button text color if needed)
|
|
19
|
-
const buttonTheme = backgroundColor && isDarkColor(backgroundColor) ? 'DARK' : 'LIGHT';
|
|
20
|
-
return buttonTheme;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Filter out all of the undefined values from the object so we don't have undefined css variable values
|
|
25
|
-
*/
|
|
26
|
-
const styles = (props) => {
|
|
27
|
-
// loop through the object and filter out all of the underfined values
|
|
28
|
-
return Object.entries(props).reduce((acc, [key, value]) => {
|
|
29
|
-
if (value) {
|
|
30
|
-
acc[key] = value;
|
|
31
|
-
}
|
|
32
|
-
return acc;
|
|
33
|
-
}, {});
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
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(--zonos-elements-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(--zonos-elements-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--zonos-elements-radius-10);gap:8px}: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(--zonos-elements-surface-color);border:none;outline:1px solid var(--zonos-elements-surface-color);border-radius:var(--border-radius, var(--zonos-elements-radius-10));-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-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:8px 24px;color:var(--color, var(--zonos-elements-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(--zonos-elements-gray-200))}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--background-color, var(--zonos-elements-gray-200))}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button.sm{height:var(--zonos-elements-size-sm);line-height:var(--zonos-elements-size-sm);padding:4px 8px}:host button.sm:not(.has-content).has-icon{padding:0 4px}:host button.md{height:var(--zonos-elements-size-md);line-height:var(--zonos-elements-size-md);padding:8px 16px}:host button.md:not(.has-content).has-icon{padding:0 8px}:host button.lg{height:var(--zonos-elements-size-lg);line-height:var(--zonos-elements-size-lg);padding:12px 24px}:host button.lg:not(.has-content).has-icon{padding:0 16px}:host button:not(.only-icon).has-icon{gap:8px}@media (max-width: 400px){:host button:not(.only-icon).has-icon{font-size:var(--zonos-elements-font-size-s)}}:host button.override-background{background-color:var(--background-color, var(--zonos-elements-gray-0));color:var(--color, var(--zonos-elements-gray-1200));outline:1px solid var(--background-color, var(--zonos-elements-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(--zonos-elements-blue-600);outline:1px solid var(--zonos-elements-blue-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--zonos-elements-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--zonos-elements-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--zonos-elements-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--zonos-elements-blue-600)}:host button:not(.override-background).success{background:var(--zonos-elements-green-600);outline:1px solid var(--zonos-elements-green-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--zonos-elements-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--zonos-elements-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--zonos-elements-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-green-400)}:host button:not(.override-background).danger{background:var(--zonos-elements-red-600);outline:1px solid var(--zonos-elements-red-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--zonos-elements-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--zonos-elements-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--zonos-elements-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-red-400)}:host button:not(.override-background).warning{background:var(--zonos-elements-orange-600);outline:1px solid var(--zonos-elements-orange-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--zonos-elements-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--zonos-elements-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--zonos-elements-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-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(--zonos-elements-gray-500);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).subtle:not([disabled]):active{background:var(--zonos-elements-gray-200)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--zonos-elements-button-focus-ring);box-shadow:var(--zonos-elements-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(--zonos-elements-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--zonos-elements-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--zonos-elements-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--zonos-elements-gray-200)}:host .zonos--footer-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center;border-radius:var(--zonos-elements-radius-4);width:24px}";
|
|
37
|
-
const ZonosButtonStyle0 = zonosButtonCss;
|
|
38
|
-
|
|
39
|
-
const ZonosButton = /*@__PURE__*/ proxyCustomElement(class ZonosButton extends HTMLElement {
|
|
40
|
-
constructor() {
|
|
41
|
-
super();
|
|
42
|
-
this.__registerHost();
|
|
43
|
-
this.__attachShadow();
|
|
44
|
-
/**
|
|
45
|
-
* Detect if the button has an content
|
|
46
|
-
*/
|
|
47
|
-
this.handleSlotChange = () => {
|
|
48
|
-
this.hasContent = true;
|
|
49
|
-
};
|
|
50
|
-
this.buttonColor = undefined;
|
|
51
|
-
this.backgroundColor = undefined;
|
|
52
|
-
this.borderStyle = undefined;
|
|
53
|
-
this.isDisabled = false;
|
|
54
|
-
this.icon = null;
|
|
55
|
-
this.iconRight = false;
|
|
56
|
-
this.size = 'sm';
|
|
57
|
-
this.variant = 'standard';
|
|
58
|
-
this.noBackground = false;
|
|
59
|
-
this.noPaddingLeft = false;
|
|
60
|
-
this.noPaddingRight = false;
|
|
61
|
-
this.loading = false;
|
|
62
|
-
this.theme = undefined;
|
|
63
|
-
this.hasIcon = !!this.icon;
|
|
64
|
-
this.hasContent = false;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Detect if the icon changes and update the state accordingly
|
|
68
|
-
*/
|
|
69
|
-
iconChangeHandler() {
|
|
70
|
-
this.hasIcon = !!this.icon;
|
|
71
|
-
}
|
|
72
|
-
clickHandler(event) {
|
|
73
|
-
if (this.loading || this.isDisabled) {
|
|
74
|
-
event.preventDefault();
|
|
75
|
-
event.stopPropagation();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
componentWillLoad() {
|
|
79
|
-
this.iconChangeHandler();
|
|
80
|
-
}
|
|
81
|
-
render() {
|
|
82
|
-
const disabled = this.loading || this.isDisabled;
|
|
83
|
-
/**
|
|
84
|
-
* If the parent component pass in the variant prop with `undefined` value, it would not re-assign the `undefined` value with the default value.
|
|
85
|
-
* So need to re-assign the variant prop with the default value if the value is `undefined` here.
|
|
86
|
-
*/
|
|
87
|
-
const variant = this.variant || 'standard';
|
|
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({
|
|
93
|
-
overrideBorderStyle: this.borderStyle,
|
|
94
|
-
});
|
|
95
|
-
const backgroundActualColor = isColorVariable(overrideBackground) && overrideBackground
|
|
96
|
-
? window.getComputedStyle(this.ele).getPropertyValue(overrideBackground)
|
|
97
|
-
: overrideBackground;
|
|
98
|
-
// use the variable if it's a color variable, otherwise use the color
|
|
99
|
-
const color = this.buttonColor && isColorVariable(this.buttonColor)
|
|
100
|
-
? `var(--zonos-elements-${this.buttonColor})`
|
|
101
|
-
: this.buttonColor;
|
|
102
|
-
// set contrast color if background color is dark for all variants except subtle
|
|
103
|
-
const contrastColor = this.variant !== 'subtle' &&
|
|
104
|
-
backgroundActualColor &&
|
|
105
|
-
isDarkColor(backgroundActualColor)
|
|
106
|
-
? 'white'
|
|
107
|
-
: color;
|
|
108
|
-
const spinnerColor = backgroundActualColor && isDarkColor(backgroundActualColor)
|
|
109
|
-
? 'white'
|
|
110
|
-
: 'black';
|
|
111
|
-
return (h(Host, { key: 'f5fd039f9ceeacae2448a09228bacc1bd6476be7', class: classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
|
|
112
|
-
'--background-color': overrideBackground,
|
|
113
|
-
'--border-radius': borderStyle,
|
|
114
|
-
'--color': contrastColor,
|
|
115
|
-
'--font-family': zonosStoreFontFamily(),
|
|
116
|
-
}) }, h("button", { key: 'bcd3c7bf52464dd1e7485cdac6b0e3defbf63af3', class: classes([
|
|
117
|
-
this.hasIcon && 'has-icon',
|
|
118
|
-
this.hasContent && 'has-content',
|
|
119
|
-
this.noBackground && 'no-background',
|
|
120
|
-
this.noPaddingLeft && 'no-padding-left',
|
|
121
|
-
this.noPaddingRight && 'no-padding-right',
|
|
122
|
-
this.iconRight && 'icon-right',
|
|
123
|
-
variant,
|
|
124
|
-
this.size,
|
|
125
|
-
// only override background if variant is set to standard
|
|
126
|
-
overrideBackground &&
|
|
127
|
-
variant === 'standard' &&
|
|
128
|
-
'override-background',
|
|
129
|
-
]), disabled: disabled }, this.loading && (h("div", { key: 'ea73d8c4b4973f3a8ed6e5b85c2236c0f20b4c6f', class: "zonos--spinner-wrapper" }, h("zonos-spinner", { key: 'cdbe444e0aee0e64facd757a1b5ebd74208359e0', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, h("slot", { key: 'e7a46cced38d7916873e5dea8aff4c33e137cdf6', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
|
|
130
|
-
}
|
|
131
|
-
get ele() { return this; }
|
|
132
|
-
static get watchers() { return {
|
|
133
|
-
"icon": ["iconChangeHandler"]
|
|
134
|
-
}; }
|
|
135
|
-
static get style() { return ZonosButtonStyle0; }
|
|
136
|
-
}, [1, "zonos-button", {
|
|
137
|
-
"buttonColor": [1, "button-color"],
|
|
138
|
-
"backgroundColor": [1, "background-color"],
|
|
139
|
-
"borderStyle": [1, "border-style"],
|
|
140
|
-
"isDisabled": [4, "is-disabled"],
|
|
141
|
-
"icon": [16],
|
|
142
|
-
"iconRight": [4, "icon-right"],
|
|
143
|
-
"size": [1],
|
|
144
|
-
"variant": [1],
|
|
145
|
-
"noBackground": [4, "no-background"],
|
|
146
|
-
"noPaddingLeft": [4, "no-padding-left"],
|
|
147
|
-
"noPaddingRight": [4, "no-padding-right"],
|
|
148
|
-
"loading": [4],
|
|
149
|
-
"theme": [1],
|
|
150
|
-
"hasIcon": [32],
|
|
151
|
-
"hasContent": [32]
|
|
152
|
-
}, [[2, "click", "clickHandler"]], {
|
|
153
|
-
"icon": ["iconChangeHandler"]
|
|
154
|
-
}]);
|
|
155
|
-
function defineCustomElement() {
|
|
156
|
-
if (typeof customElements === "undefined") {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const components = ["zonos-button", "zonos-spinner"];
|
|
160
|
-
components.forEach(tagName => { switch (tagName) {
|
|
161
|
-
case "zonos-button":
|
|
162
|
-
if (!customElements.get(tagName)) {
|
|
163
|
-
customElements.define(tagName, ZonosButton);
|
|
164
|
-
}
|
|
165
|
-
break;
|
|
166
|
-
case "zonos-spinner":
|
|
167
|
-
if (!customElements.get(tagName)) {
|
|
168
|
-
defineCustomElement$1();
|
|
169
|
-
}
|
|
170
|
-
break;
|
|
171
|
-
} });
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export { ZonosButton as Z, defineCustomElement as d };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface ZonosCard extends Components.ZonosCard, HTMLElement {}
|
|
4
|
-
export const ZonosCard: {
|
|
5
|
-
prototype: ZonosCard;
|
|
6
|
-
new (): ZonosCard;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|