@vtex/faststore 0.0.10 → 0.0.11
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/CHANGELOG.md +42 -0
- package/README.md +0 -1
- package/dist/actions.json +6 -1
- package/dist/catalog.json +789 -1701
- package/dist/cli/index.d.ts +66 -28
- package/dist/cli/index.js +7371 -512
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/server-runtime.js +41 -60
- package/dist/cli/server-runtime.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/components.d.ts +63 -57
- package/dist/components.js +60 -54
- package/dist/content-types.json +5785 -754
- package/dist/core/dist/define-component.d.ts +1 -1
- package/dist/core/dist/define-content-type.d.ts +50 -2
- package/dist/core/dist/define-content-type.js +107 -3
- package/dist/core/dist/define-content-type.js.map +1 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/access-code-field.md +1 -1
- package/dist/docs/access-code-sign-in.md +126 -77
- package/dist/docs/account-address-book.md +210 -95
- package/dist/docs/account-menu.md +14 -15
- package/dist/docs/account-saved-cards.md +44 -39
- package/dist/docs/alert-dialog.md +3 -1
- package/dist/docs/avatar.md +4 -2
- package/dist/docs/billing-address.md +99 -30
- package/dist/docs/binding-switcher.md +5 -2
- package/dist/docs/buy-button.md +7 -8
- package/dist/docs/card-entry.md +39 -26
- package/dist/docs/card-summary.md +18 -8
- package/dist/docs/cardholder-document.md +5 -3
- package/dist/docs/carousel.md +5 -4
- package/dist/docs/cart-destination.md +39 -26
- package/dist/docs/cart-item.md +29 -14
- package/dist/docs/cart-totalizer.md +7 -5
- package/dist/docs/cart.md +135 -41
- package/dist/docs/challenge-return.md +135 -0
- package/dist/docs/client-preferences-fieldset.md +10 -5
- package/dist/docs/client-preferences.md +31 -8
- package/dist/docs/client-profile-fieldset.md +20 -6
- package/dist/docs/client-profile.md +12 -3
- package/dist/docs/copy-text.md +9 -7
- package/dist/docs/document-field.md +1 -1
- package/dist/docs/email-field.md +2 -1
- package/dist/docs/email-identification.md +12 -2
- package/dist/docs/footer-copyright.md +4 -2
- package/dist/docs/form.md +54 -18
- package/dist/docs/free-shipping-progress.md +6 -5
- package/dist/docs/identity-edit.md +8 -2
- package/dist/docs/identity-summary.md +18 -5
- package/dist/docs/installments.md +46 -32
- package/dist/docs/my-account-profile.md +16 -11
- package/dist/docs/navigation-link.md +5 -3
- package/dist/docs/order-cancel.md +3 -1
- package/dist/docs/order-delivery-address.md +7 -5
- package/dist/docs/order-delivery-group.md +1 -3
- package/dist/docs/order-details-back.md +1 -1
- package/dist/docs/order-details-header.md +1 -4
- package/dist/docs/order-invoice-download.md +60 -0
- package/dist/docs/order-list-row.md +1 -1
- package/dist/docs/order-list-search.md +13 -20
- package/dist/docs/order-list-views.md +11 -17
- package/dist/docs/order-list.md +12 -5
- package/dist/docs/order-payment.md +9 -7
- package/dist/docs/order-placed-date.md +1 -1
- package/dist/docs/order-placed-payment-summary.md +28 -15
- package/dist/docs/order-placed.md +49 -14
- package/dist/docs/order-progress.md +1 -1
- package/dist/docs/order-status-badge.md +20 -9
- package/dist/docs/order-summary.md +2 -2
- package/dist/docs/order-tracking-link.md +58 -0
- package/dist/docs/payment-method-badges.md +30 -4
- package/dist/docs/payment-methods.md +1 -1
- package/dist/docs/payment.md +36 -17
- package/dist/docs/phone-field.md +4 -4
- package/dist/docs/place-order.md +84 -36
- package/dist/docs/postal-code-field.md +3 -1
- package/dist/docs/pricing.md +21 -23
- package/dist/docs/product-gallery.md +19 -20
- package/dist/docs/product-information.md +13 -9
- package/dist/docs/product-list.md +7 -6
- package/dist/docs/product-shelf.md +0 -1
- package/dist/docs/promotion.md +4 -2
- package/dist/docs/region.md +23 -15
- package/dist/docs/save-card.md +7 -6
- package/dist/docs/saved-cards.md +65 -36
- package/dist/docs/shipping-address.md +57 -21
- package/dist/docs/shipping-simulator.md +53 -15
- package/dist/docs/sign-in-disclosure.md +176 -0
- package/dist/docs/sign-in-form.md +78 -47
- package/dist/docs/sign-in-redirect.md +4 -2
- package/dist/docs/sign-in.md +173 -0
- package/dist/docs/toast.md +15 -4
- package/dist/docs/variant-selector.md +15 -11
- package/dist/graphql/types.d.ts +4 -14
- package/dist/index.d.ts +2 -2
- package/dist/internal/client.d.ts +1 -3
- package/dist/internal/client.js +1 -1
- package/dist/internal/server.d.ts +7 -4
- package/dist/internal/server.js +7 -4
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
- package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
- package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
- package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
- package/dist/matter/account-address-book/account-address-book.js +74 -33
- package/dist/matter/account-address-book/account-address-book.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
- package/dist/matter/account-address-book/account-address-country.js +83 -49
- package/dist/matter/account-address-book/account-address-country.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
- package/dist/matter/account-address-book/account-address-form.js +518 -155
- package/dist/matter/account-address-book/account-address-form.js.map +1 -1
- package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-record.js +32 -17
- package/dist/matter/account-address-book/account-address-record.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +34 -17
- package/dist/matter/account-menu/account-menu.js +46 -54
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +108 -28
- package/dist/matter/account-saved-cards/account-saved-cards.js +177 -122
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -1
- package/dist/matter/billing-address/billing-address.d.ts +156 -74
- package/dist/matter/billing-address/billing-address.js +227 -156
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
- package/dist/matter/breadcrumb/breadcrumb.js +24 -9
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/buy-button/buy-button.d.ts +8 -11
- package/dist/matter/buy-button/buy-button.js +10 -19
- package/dist/matter/buy-button/buy-button.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +12 -4
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +123 -32
- package/dist/matter/card-entry/card-entry.js +348 -221
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +7 -1
- package/dist/matter/cart/cart-namespace.js +7 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +402 -61
- package/dist/matter/cart/cart.js +624 -153
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +30 -19
- package/dist/matter/cart-destination/cart-destination.js +160 -70
- package/dist/matter/cart-destination/cart-destination.js.map +1 -1
- package/dist/matter/cart-item/cart-item.d.ts +144 -17
- package/dist/matter/cart-item/cart-item.js +166 -49
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
- package/dist/matter/cart-totalizer/cart-totalizer.js +46 -17
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
- package/dist/matter/challenge-return/challenge-return.js +241 -0
- package/dist/matter/challenge-return/challenge-return.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
- package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
- package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
- package/dist/matter/client-preferences/client-preferences.js +84 -15
- package/dist/matter/client-preferences/client-preferences.js.map +1 -1
- package/dist/matter/client-profile/client-profile.d.ts +44 -9
- package/dist/matter/client-profile/client-profile.js +64 -24
- package/dist/matter/client-profile/client-profile.js.map +1 -1
- package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
- package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
- package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
- package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
- package/dist/matter/delivery-options/delivery-options.js +75 -12
- package/dist/matter/delivery-options/delivery-options.js.map +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
- package/dist/matter/email-identification/email-identification.d.ts +25 -3
- package/dist/matter/email-identification/email-identification.js +49 -12
- package/dist/matter/email-identification/email-identification.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +79 -7
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +77 -20
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
- package/dist/matter/identity-edit/identity-edit.js +47 -19
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
- package/dist/matter/identity-summary/identity-summary.js +95 -45
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/installments/installments-select.d.ts +98 -16
- package/dist/matter/installments/installments-select.js +156 -48
- package/dist/matter/installments/installments-select.js.map +1 -1
- package/dist/matter/installments/installments.d.ts +96 -16
- package/dist/matter/installments/installments.js +115 -40
- package/dist/matter/installments/installments.js.map +1 -1
- package/dist/matter/installments/use-installments-selection.d.ts +1 -0
- package/dist/matter/installments/use-installments-selection.js +8 -3
- package/dist/matter/installments/use-installments-selection.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
- package/dist/matter/my-account-profile/my-account-profile.js +370 -174
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
- package/dist/matter/order-cancel/order-cancel.js +118 -51
- package/dist/matter/order-cancel/order-cancel.js.map +1 -1
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
- package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
- package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
- package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
- package/dist/matter/order-details-header/order-details-header.js +66 -58
- package/dist/matter/order-details-header/order-details-header.js.map +1 -1
- package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +164 -19
- package/dist/matter/order-list/order-list.js +229 -87
- package/dist/matter/order-list/order-list.js.map +1 -1
- package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
- package/dist/matter/order-list-row/order-list-row.js +3 -2
- package/dist/matter/order-list-row/order-list-row.js.map +1 -1
- package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
- package/dist/matter/order-list-search/order-list-search.js +30 -69
- package/dist/matter/order-list-search/order-list-search.js.map +1 -1
- package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
- package/dist/matter/order-list-views/order-list-views.js +22 -68
- package/dist/matter/order-list-views/order-list-views.js.map +1 -1
- package/dist/matter/order-payment/order-payment.d.ts +33 -10
- package/dist/matter/order-payment/order-payment.js +44 -39
- package/dist/matter/order-payment/order-payment.js.map +1 -1
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
- package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
- package/dist/matter/order-placed/order-placed.d.ts +198 -31
- package/dist/matter/order-placed/order-placed.js +230 -139
- package/dist/matter/order-placed/order-placed.js.map +1 -1
- package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
- package/dist/matter/order-placed-date/order-placed-date.js +7 -8
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +19 -8
- package/dist/matter/order-progress/order-progress.js +37 -45
- package/dist/matter/order-progress/order-progress.js.map +1 -1
- package/dist/matter/order-summary/order-summary.d.ts +19 -9
- package/dist/matter/order-summary/order-summary.js +38 -44
- package/dist/matter/order-summary/order-summary.js.map +1 -1
- package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +17 -10
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.d.ts +4 -2
- package/dist/matter/payment/payment-controller.js +30 -9
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +1 -1
- package/dist/matter/payment/payment.d.ts +69 -19
- package/dist/matter/payment/payment.js +101 -35
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
- package/dist/matter/payment/use-payment-method-selection.js +94 -32
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
- package/dist/matter/payment/use-payment-submit-gate.js +47 -8
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +171 -57
- package/dist/matter/place-order/place-order.js +376 -185
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.d.ts +152 -13
- package/dist/matter/pricing/pricing.js +153 -52
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-information/product-information.d.ts +27 -4
- package/dist/matter/product-information/product-information.js +32 -15
- package/dist/matter/product-information/product-information.js.map +1 -1
- package/dist/matter/product-list/product-list.d.ts +24 -6
- package/dist/matter/product-list/product-list.js +32 -26
- package/dist/matter/product-list/product-list.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +1 -3
- package/dist/matter/product-shelf/product-shelf.js +2 -15
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.d.ts +33 -16
- package/dist/matter/region/region.js +59 -52
- package/dist/matter/region/region.js.map +1 -1
- package/dist/matter/save-card/save-card.d.ts +43 -8
- package/dist/matter/save-card/save-card.js +61 -23
- package/dist/matter/save-card/save-card.js.map +1 -1
- package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
- package/dist/matter/saved-cards/saved-cards.js +349 -77
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/shipping-address/address-payload.js +25 -0
- package/dist/matter/shipping-address/address-payload.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +71 -71
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
- package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
- package/dist/matter/shipping-address/shipping-address.js +443 -188
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +250 -24
- package/dist/matter/shipping-simulator/shipping-simulator.js +257 -51
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in/sign-in.d.ts +108 -0
- package/dist/matter/sign-in/sign-in.js +285 -0
- package/dist/matter/sign-in/sign-in.js.map +1 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
- package/dist/matter/sign-in-form/sign-in-form.js +134 -144
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +29 -8
- package/dist/particles/binding-switcher/binding-switcher.js +37 -26
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -1
- package/dist/particles/card-summary/card-summary.d.ts +38 -8
- package/dist/particles/card-summary/card-summary.js +55 -22
- package/dist/particles/card-summary/card-summary.js.map +1 -1
- package/dist/particles/carousel/carousel.d.ts +99 -11
- package/dist/particles/carousel/carousel.js +103 -35
- package/dist/particles/carousel/carousel.js.map +1 -1
- package/dist/particles/copy-text/copy-text.js +5 -15
- package/dist/particles/copy-text/copy-text.js.map +1 -1
- package/dist/particles/dialog/dialog.d.ts +14 -6
- package/dist/particles/dialog/dialog.js +6 -3
- package/dist/particles/dialog/dialog.js.map +1 -1
- package/dist/particles/drawer/drawer.js +1 -1
- package/dist/particles/drawer/drawer.js.map +1 -1
- package/dist/particles/email-field/email-field.d.ts +2 -1
- package/dist/particles/email-field/email-field.js +2 -1
- package/dist/particles/email-field/email-field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.js +1 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/form/form.d.ts +85 -13
- package/dist/particles/form/form.js +91 -42
- package/dist/particles/form/form.js.map +1 -1
- package/dist/particles/gallery/gallery.d.ts +129 -12
- package/dist/particles/gallery/gallery.js +121 -34
- package/dist/particles/gallery/gallery.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
- package/dist/particles/order-details-back/order-details-back.js +8 -10
- package/dist/particles/order-details-back/order-details-back.js.map +1 -1
- package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
- package/dist/particles/order-status-badge/order-status-badge.js +4 -20
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
- package/dist/particles/password-field/password-field.d.ts +1 -1
- package/dist/particles/password-field/password-field.js +2 -4
- package/dist/particles/password-field/password-field.js.map +1 -1
- package/dist/particles/phone-field/phone-field.d.ts +4 -4
- package/dist/particles/phone-field/phone-field.js +8 -11
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/spinner/spinner.d.ts +24 -4
- package/dist/particles/spinner/spinner.js +25 -9
- package/dist/particles/spinner/spinner.js.map +1 -1
- package/dist/particles/switch/switch.d.ts +4 -1
- package/dist/particles/switch/switch.js +3 -1
- package/dist/particles/switch/switch.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +29 -3
- package/dist/particles/toast/toast.js +34 -10
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +164 -56
- package/dist/sdk/address/address-fields.js +4 -4
- package/dist/sdk/address/address-fields.js.map +1 -1
- package/dist/sdk/address/constants.js +1 -6
- package/dist/sdk/address/constants.js.map +1 -1
- package/dist/sdk/address/messages.js +44 -44
- package/dist/sdk/address/messages.js.map +1 -1
- package/dist/sdk/address/postal-code.js +15 -2
- package/dist/sdk/address/postal-code.js.map +1 -1
- package/dist/sdk/address/types.d.ts +5 -3
- package/dist/sdk/address/validate-address.js +3 -3
- package/dist/sdk/address/validate-address.js.map +1 -1
- package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/data/index.js +2 -2
- package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
- package/dist/sdk/generated/gql.js +1 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +20 -5
- package/dist/sdk/generated/graphql.js +6 -0
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/format-error-code.js +23 -0
- package/dist/sdk/i18n/format-error-code.js.map +1 -0
- package/dist/sdk/i18n/message-formatter.d.ts +22 -0
- package/dist/sdk/i18n/message-formatter.js +140 -0
- package/dist/sdk/i18n/message-formatter.js.map +1 -0
- package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
- package/dist/sdk/i18n/use-message-formatter.js +18 -0
- package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/navigation/redirect.d.ts +2 -0
- package/dist/sdk/navigation/redirect.js +19 -1
- package/dist/sdk/navigation/redirect.js.map +1 -1
- package/dist/sdk/navigation/types.d.ts +13 -0
- package/dist/sdk/payment/bin-format.js +20 -0
- package/dist/sdk/payment/bin-format.js.map +1 -0
- package/dist/sdk/payment/challenge-return.js +37 -0
- package/dist/sdk/payment/challenge-return.js.map +1 -0
- package/dist/sdk/payment/confirmation-last-four.js +39 -0
- package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
- package/dist/sdk/payment/gateway.d.ts +1 -1
- package/dist/sdk/payment/gateway.js +8 -2
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.d.ts +1 -0
- package/dist/sdk/payment/operations.js +28 -6
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
- package/dist/sdk/payment/resumed-purchase.js +119 -0
- package/dist/sdk/payment/resumed-purchase.js.map +1 -0
- package/dist/sdk/payment/security-code-mask.js +16 -23
- package/dist/sdk/payment/security-code-mask.js.map +1 -1
- package/dist/sdk/payment/submission-registry.js +6 -2
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
- package/dist/sdk/payment/use-payment-actions.js +23 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +10 -2
- package/dist/sdk/payment/use-place-order.js +138 -76
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/provider/storefront-provider.d.ts +1 -7
- package/dist/sdk/provider/storefront-provider.js +4 -11
- package/dist/sdk/provider/storefront-provider.js.map +1 -1
- package/dist/sdk/seo/entity-landing.d.ts +24 -0
- package/dist/sdk/seo/entity-landing.js +30 -0
- package/dist/sdk/seo/entity-landing.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +3 -2
- package/dist/sdk/seo/page-alternates.js +4 -2
- package/dist/sdk/seo/page-alternates.js.map +1 -1
- package/dist/sdk/seo/search-landing.d.ts +42 -0
- package/dist/sdk/seo/search-landing.js +85 -0
- package/dist/sdk/seo/search-landing.js.map +1 -0
- package/dist/sdk/session/mock-session.d.ts +9 -0
- package/dist/sdk/session/mock-session.js +31 -0
- package/dist/sdk/session/mock-session.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +3 -0
- package/dist/sdk/session/read-server-session.js +5 -0
- package/dist/sdk/session/read-server-session.js.map +1 -1
- package/dist/sdk/session/return-path-segment.d.ts +10 -0
- package/dist/sdk/session/return-path-segment.js +15 -0
- package/dist/sdk/session/return-path-segment.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
- package/dist/utils/safe-href.d.ts +2 -0
- package/package.json +4 -3
- package/skills/storefront-asset/SKILL.md +2 -2
- package/skills/storefront-asset/references/api-side.md +27 -14
- package/skills/storefront-asset/references/findings.md +5 -2
- package/src/styles/tailwind.css +8 -0
- package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
- package/dist/message-locales.json +0 -7
- package/dist/sdk/i18n/client.d.ts +0 -4
- package/dist/sdk/i18n/client.js +0 -4
- package/dist/sdk/i18n/locales.d.ts +0 -8
- package/dist/sdk/i18n/locales.js +0 -57
- package/dist/sdk/i18n/locales.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.js +0 -183
- package/dist/sdk/i18n/messages/en-US.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.json +0 -178
- package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -182
- package/dist/sdk/i18n/messages/es-ES.js +0 -183
- package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
- package/dist/sdk/i18n/messages/es-ES.json +0 -178
- package/dist/sdk/i18n/messages/pt-BR.js +0 -183
- package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
- package/dist/sdk/i18n/messages/pt-BR.json +0 -178
- package/dist/sdk/i18n/provider.d.ts +0 -1
- package/dist/sdk/i18n/provider.js +0 -30
- package/dist/sdk/i18n/provider.js.map +0 -1
- package/dist/sdk/i18n/server.d.ts +0 -28
- package/dist/sdk/i18n/server.js +0 -59
- package/dist/sdk/i18n/server.js.map +0 -1
- package/dist/utils/resolve-authored-copy.js +0 -18
- package/dist/utils/resolve-authored-copy.js.map +0 -1
- package/dist/utils/substitute-template.js +0 -33
- package/dist/utils/substitute-template.js.map +0 -1
|
@@ -1,17 +1,161 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
3
4
|
import "../../core/dist/index.js";
|
|
5
|
+
import { useMessageFormatter } from "../../sdk/i18n/use-message-formatter.js";
|
|
4
6
|
import { Field } from "../../particles/field/field.js";
|
|
7
|
+
import { ownValue } from "../../utils/own-value.js";
|
|
5
8
|
import { Icon } from "../../particles/icon/icon.js";
|
|
6
9
|
import { Fieldset } from "../../particles/fieldset/fieldset.js";
|
|
7
10
|
import { useCardCapture, useRegisterCardCapture } from "./card-capture.js";
|
|
8
11
|
import { applyMask } from "../../particles/shared/input-mask.js";
|
|
9
12
|
import "../../particles/document-field/document-field.js";
|
|
10
|
-
import { SECURITY_CODE_MASK_STYLE,
|
|
11
|
-
import { ownValue } from "../../utils/own-value.js";
|
|
13
|
+
import { SECURITY_CODE_MASK_STYLE, isSecurityCodeMasked } from "../../sdk/payment/security-code-mask.js";
|
|
12
14
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
13
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
16
|
//#region src/matter/card-entry/card-entry.tsx
|
|
17
|
+
/**
|
|
18
|
+
* The new-card entry matter (specs/card-entry.md, T7 of the Credit Card epic;
|
|
19
|
+
* docs/features/credit-card/rfc.md § D2). Composes the `Field`/`Fieldset` particles and reuses
|
|
20
|
+
* `document-field`'s `applyMask` progressive mask engine to capture a card number, holder name,
|
|
21
|
+
* expiration, and CVV, with masks/required-ness driven by the network's server-driven validator
|
|
22
|
+
* config (T1) rather than hardcoded per network.
|
|
23
|
+
*
|
|
24
|
+
* This is the PCI-critical core of the credit-card feature: it is the **only** component that ever
|
|
25
|
+
* holds a full card number or CVV, and both live only in this component's local state — never a
|
|
26
|
+
* schema prop, a fragment field, an action payload, or a value handed to another component. It reads
|
|
27
|
+
* only the `card-capture` context (card-capture.tsx), so the checkout and the account compose it
|
|
28
|
+
* alike: it registers a capture, builds the card *inside* that closure, and hands it to the target
|
|
29
|
+
* the provider passes in — `sendPayments` at checkout, `savedCard.tokenize` in the account.
|
|
30
|
+
*
|
|
31
|
+
* Network detection is a pure, local computation (never waits on a server round-trip): the typed
|
|
32
|
+
* digits are tested against every method's `validator.numberRegex` on every keystroke, first match
|
|
33
|
+
* wins. The selection waits for a complete BIN (T190): only once the field holds eight digits does a
|
|
34
|
+
* match — on a genuine transition, or once the engine has released the BIN (T174) — publish those
|
|
35
|
+
* eight digits as the BIN (`setDraftBin`) and dispatch `selectMethod` to persist the selection
|
|
36
|
+
* server-side — both through `card-capture`'s `selection` member, so only at checkout. Below eight digits nothing is published or sent — see specs/card-entry.md
|
|
37
|
+
* Decisions 1 and 3, and specs/send-the-typed-bin-to-the.md, which adds the gate — except that the
|
|
38
|
+
* first keystroke off the new-card path records that path locally with `selectNewCard()`
|
|
39
|
+
* (specs/collapse-the-card-form-when-a.md, FR-10).
|
|
40
|
+
*/
|
|
41
|
+
const CardEntryContent = defineContentType({
|
|
42
|
+
id: "card-entry",
|
|
43
|
+
title: "Card Entry",
|
|
44
|
+
description: "Copy for the new-card fields and their validation messages.",
|
|
45
|
+
schema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
properties: {
|
|
49
|
+
legend: {
|
|
50
|
+
type: "string",
|
|
51
|
+
title: "Legend",
|
|
52
|
+
format: "icu-message",
|
|
53
|
+
messageSource: "Card details"
|
|
54
|
+
},
|
|
55
|
+
numberLabel: {
|
|
56
|
+
type: "string",
|
|
57
|
+
title: "Number label",
|
|
58
|
+
format: "icu-message",
|
|
59
|
+
messageSource: "Card number"
|
|
60
|
+
},
|
|
61
|
+
holderNameLabel: {
|
|
62
|
+
type: "string",
|
|
63
|
+
title: "Holder name label",
|
|
64
|
+
format: "icu-message",
|
|
65
|
+
messageSource: "Cardholder name"
|
|
66
|
+
},
|
|
67
|
+
expirationLabel: {
|
|
68
|
+
type: "string",
|
|
69
|
+
title: "Expiration label",
|
|
70
|
+
format: "icu-message",
|
|
71
|
+
messageSource: "Expiration date"
|
|
72
|
+
},
|
|
73
|
+
expirationPlaceholder: {
|
|
74
|
+
type: "string",
|
|
75
|
+
title: "Expiration placeholder",
|
|
76
|
+
format: "icu-message",
|
|
77
|
+
messageSource: "MM/YY"
|
|
78
|
+
},
|
|
79
|
+
cvvLabel: {
|
|
80
|
+
type: "string",
|
|
81
|
+
title: "CVV label",
|
|
82
|
+
format: "icu-message",
|
|
83
|
+
messageSource: "Security code"
|
|
84
|
+
},
|
|
85
|
+
cvvDescription: {
|
|
86
|
+
type: "string",
|
|
87
|
+
title: "CVV description",
|
|
88
|
+
description: "Helper text under the CVV field, linked to the input; blank renders nothing.",
|
|
89
|
+
format: "icu-message",
|
|
90
|
+
messageSource: "The 3-4 digit number on your card",
|
|
91
|
+
messageOptional: true
|
|
92
|
+
},
|
|
93
|
+
numberRequiredMessage: {
|
|
94
|
+
type: "string",
|
|
95
|
+
title: "Number required message",
|
|
96
|
+
description: "Shown on the number field when it is left blank.",
|
|
97
|
+
format: "icu-message",
|
|
98
|
+
messageSource: "Card number is required"
|
|
99
|
+
},
|
|
100
|
+
numberInvalidMessage: {
|
|
101
|
+
type: "string",
|
|
102
|
+
title: "Number invalid message",
|
|
103
|
+
description: "Shown for a Luhn-invalid number, or one a configured network claims only as a prefix (the wrong length, or two networks at once).",
|
|
104
|
+
format: "icu-message",
|
|
105
|
+
messageSource: "Enter a valid card number"
|
|
106
|
+
},
|
|
107
|
+
networkNotAcceptedMessage: {
|
|
108
|
+
type: "string",
|
|
109
|
+
title: "Network not accepted message",
|
|
110
|
+
description: "Shown for a Luhn-valid number that no configured network claims at all.",
|
|
111
|
+
format: "icu-message",
|
|
112
|
+
messageSource: "This card is not from a network the store accepts"
|
|
113
|
+
},
|
|
114
|
+
holderNameRequiredMessage: {
|
|
115
|
+
type: "string",
|
|
116
|
+
title: "Holder name required message",
|
|
117
|
+
description: "Shown when the holder name is blank and the detected method requires it.",
|
|
118
|
+
format: "icu-message",
|
|
119
|
+
messageSource: "Cardholder name is required"
|
|
120
|
+
},
|
|
121
|
+
expirationRequiredMessage: {
|
|
122
|
+
type: "string",
|
|
123
|
+
title: "Expiration required message",
|
|
124
|
+
description: "Shown when the expiration is blank and the detected method requires it.",
|
|
125
|
+
format: "icu-message",
|
|
126
|
+
messageSource: "Expiration date is required"
|
|
127
|
+
},
|
|
128
|
+
expirationInvalidMessage: {
|
|
129
|
+
type: "string",
|
|
130
|
+
title: "Expiration invalid message",
|
|
131
|
+
description: "Shown for a malformed MM/YY.",
|
|
132
|
+
format: "icu-message",
|
|
133
|
+
messageSource: "Enter a valid expiration date"
|
|
134
|
+
},
|
|
135
|
+
expirationExpiredMessage: {
|
|
136
|
+
type: "string",
|
|
137
|
+
title: "Expiration expired message",
|
|
138
|
+
description: "Shown for a well-formed MM/YY that has already passed.",
|
|
139
|
+
format: "icu-message",
|
|
140
|
+
messageSource: "This card has expired"
|
|
141
|
+
},
|
|
142
|
+
cvvRequiredMessage: {
|
|
143
|
+
type: "string",
|
|
144
|
+
title: "CVV required message",
|
|
145
|
+
description: "Shown when the security code is blank and the detected method requires it.",
|
|
146
|
+
format: "icu-message",
|
|
147
|
+
messageSource: "Security code is required"
|
|
148
|
+
},
|
|
149
|
+
cvvInvalidMessage: {
|
|
150
|
+
type: "string",
|
|
151
|
+
title: "CVV invalid message",
|
|
152
|
+
description: "Shown for a security code that fails the detected method's format.",
|
|
153
|
+
format: "icu-message",
|
|
154
|
+
messageSource: "Enter a valid security code"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
15
159
|
/** Visual/attribute order used for first-invalid focus and the `data-fs-card-entry-field` values. */
|
|
16
160
|
const FIELD_ATTR = {
|
|
17
161
|
number: "number",
|
|
@@ -44,21 +188,6 @@ function countDigitSlots(mask) {
|
|
|
44
188
|
function maskCapacity(mask) {
|
|
45
189
|
return Math.max(...mask.split("|").map(countDigitSlots));
|
|
46
190
|
}
|
|
47
|
-
/**
|
|
48
|
-
* The narrowest alternative's slot count — `maskCapacity`'s floor, and the length at which a
|
|
49
|
-
* security code counts as fully typed (T173).
|
|
50
|
-
*
|
|
51
|
-
* The ceiling is the right answer for truncation (`maskDigits` must let the widest alternative's
|
|
52
|
-
* digits through) and the wrong one for masking: one method id can cover a 3-and-4-digit family with
|
|
53
|
-
* a single `'999|9999'` mask, and a shopper holding the 3-digit card of that family never reaches a
|
|
54
|
-
* fourth digit — so a ceiling-derived length leaves their complete, valid code legible for the rest
|
|
55
|
-
* of the flow. `SavedCardCvvField` errs on the same side for the same reason. A malformed
|
|
56
|
-
* alternative with no slots (`'999|'`) floors to zero, which masks from the first digit: early,
|
|
57
|
-
* never late.
|
|
58
|
-
*/
|
|
59
|
-
function narrowestMaskCapacity(mask) {
|
|
60
|
-
return Math.min(...mask.split("|").map(countDigitSlots));
|
|
61
|
-
}
|
|
62
191
|
function toDigits(value) {
|
|
63
192
|
return value.replace(/\D/g, "");
|
|
64
193
|
}
|
|
@@ -378,146 +507,164 @@ const CardEntryDefinition = defineComponent({
|
|
|
378
507
|
component: CardEntry,
|
|
379
508
|
requiresContext: "card-capture",
|
|
380
509
|
hardened: true,
|
|
510
|
+
content: CardEntryContent,
|
|
381
511
|
editor: {
|
|
382
512
|
label: "Card Entry",
|
|
383
513
|
category: "commerce"
|
|
384
514
|
},
|
|
385
515
|
schema: {
|
|
386
|
-
legend: {
|
|
387
|
-
type: "string",
|
|
388
|
-
default: "Card details",
|
|
389
|
-
label: "Legend"
|
|
390
|
-
},
|
|
391
|
-
numberLabel: {
|
|
392
|
-
type: "string",
|
|
393
|
-
default: "Card number",
|
|
394
|
-
label: "Number label"
|
|
395
|
-
},
|
|
396
516
|
numberPlaceholder: {
|
|
397
517
|
type: "string",
|
|
398
518
|
label: "Number placeholder"
|
|
399
519
|
},
|
|
400
|
-
holderNameLabel: {
|
|
401
|
-
type: "string",
|
|
402
|
-
default: "Cardholder name",
|
|
403
|
-
label: "Holder name label"
|
|
404
|
-
},
|
|
405
520
|
holderNamePlaceholder: {
|
|
406
521
|
type: "string",
|
|
407
522
|
label: "Holder name placeholder"
|
|
408
523
|
},
|
|
409
|
-
expirationLabel: {
|
|
410
|
-
type: "string",
|
|
411
|
-
default: "Expiration date",
|
|
412
|
-
label: "Expiration label"
|
|
413
|
-
},
|
|
414
|
-
expirationPlaceholder: {
|
|
415
|
-
type: "string",
|
|
416
|
-
default: "MM/YY",
|
|
417
|
-
label: "Expiration placeholder"
|
|
418
|
-
},
|
|
419
|
-
cvvLabel: {
|
|
420
|
-
type: "string",
|
|
421
|
-
default: "Security code",
|
|
422
|
-
label: "CVV label"
|
|
423
|
-
},
|
|
424
524
|
cvvPlaceholder: {
|
|
425
525
|
type: "string",
|
|
426
526
|
label: "CVV placeholder"
|
|
427
527
|
},
|
|
428
|
-
cvvDescription: {
|
|
429
|
-
type: "string",
|
|
430
|
-
default: "The 3-4 digit number on your card",
|
|
431
|
-
label: "CVV description"
|
|
432
|
-
},
|
|
433
|
-
numberRequiredMessage: {
|
|
434
|
-
type: "string",
|
|
435
|
-
default: "Card number is required",
|
|
436
|
-
label: "Number required message"
|
|
437
|
-
},
|
|
438
|
-
numberInvalidMessage: {
|
|
439
|
-
type: "string",
|
|
440
|
-
default: "Enter a valid card number",
|
|
441
|
-
label: "Number invalid message"
|
|
442
|
-
},
|
|
443
|
-
networkNotAcceptedMessage: {
|
|
444
|
-
type: "string",
|
|
445
|
-
default: "This card is not from a network the store accepts",
|
|
446
|
-
label: "Network not accepted message"
|
|
447
|
-
},
|
|
448
|
-
holderNameRequiredMessage: {
|
|
449
|
-
type: "string",
|
|
450
|
-
default: "Cardholder name is required",
|
|
451
|
-
label: "Holder name required message"
|
|
452
|
-
},
|
|
453
|
-
expirationRequiredMessage: {
|
|
454
|
-
type: "string",
|
|
455
|
-
default: "Expiration date is required",
|
|
456
|
-
label: "Expiration required message"
|
|
457
|
-
},
|
|
458
|
-
expirationInvalidMessage: {
|
|
459
|
-
type: "string",
|
|
460
|
-
default: "Enter a valid expiration date",
|
|
461
|
-
label: "Expiration invalid message"
|
|
462
|
-
},
|
|
463
|
-
expirationExpiredMessage: {
|
|
464
|
-
type: "string",
|
|
465
|
-
default: "This card has expired",
|
|
466
|
-
label: "Expiration expired message"
|
|
467
|
-
},
|
|
468
|
-
cvvRequiredMessage: {
|
|
469
|
-
type: "string",
|
|
470
|
-
default: "Security code is required",
|
|
471
|
-
label: "CVV required message"
|
|
472
|
-
},
|
|
473
|
-
cvvInvalidMessage: {
|
|
474
|
-
type: "string",
|
|
475
|
-
default: "Enter a valid security code",
|
|
476
|
-
label: "CVV invalid message"
|
|
477
|
-
},
|
|
478
528
|
disabled: {
|
|
479
529
|
type: "boolean",
|
|
480
530
|
default: false,
|
|
481
531
|
label: "Disabled"
|
|
482
532
|
}
|
|
483
533
|
},
|
|
484
|
-
guideline: "New-card entry: masked number with live network detection, holder name, expiration, and CVV, each shown and required per the detected network's validator config from the 'card-capture' context. Must be placed inside a card-capture provider: PaymentSectionRoot or PaymentSectionController at checkout. Owns the card values itself — it builds the card and hands it only to the submission target its provider supplies; no other component ever needs the card number or CVV. Card number and CVV are never schema props, fragment fields, or action payloads — do not add one. See card-entry.md."
|
|
534
|
+
guideline: "New-card entry: masked number with live network detection, holder name, expiration, and CVV, each shown and required per the detected network's validator config from the 'card-capture' context. Must be placed inside a card-capture provider: PaymentSectionRoot or PaymentSectionController at checkout. Owns the card values itself — it builds the card and hands it only to the submission target its provider supplies; no other component ever needs the card number or CVV. Card number and CVV are never schema props, fragment fields, or action payloads — do not add one. Labels and validation messages come from its $content fields. See card-entry.md."
|
|
485
535
|
});
|
|
486
|
-
function
|
|
536
|
+
function readSelectionFacts(selection) {
|
|
537
|
+
return {
|
|
538
|
+
draftPath: selection?.path ?? null,
|
|
539
|
+
draftBin: selection?.bin ?? null,
|
|
540
|
+
collapsed: selection?.collapsed ?? false,
|
|
541
|
+
cardModeActive: selection?.cardModeActive ?? false,
|
|
542
|
+
selectedMethodId: selection?.selectedMethodId ?? null,
|
|
543
|
+
selectionOutOfScope: selection?.selectionOutOfScope ?? false,
|
|
544
|
+
selectionNonCard: selection?.selectionNonCard ?? false
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function withoutFieldError(errors, key) {
|
|
548
|
+
if (!(key in errors)) return errors;
|
|
549
|
+
const next = { ...errors };
|
|
550
|
+
delete next[key];
|
|
551
|
+
return next;
|
|
552
|
+
}
|
|
553
|
+
function withFieldError(errors, key, message) {
|
|
554
|
+
const next = { ...errors };
|
|
555
|
+
if (message) next[key] = message;
|
|
556
|
+
else delete next[key];
|
|
557
|
+
return next;
|
|
558
|
+
}
|
|
559
|
+
/** Whether a keystroke that resolved a network publishes its complete BIN: not before eight digits, not twice. */
|
|
560
|
+
function isBinDispatchDue(bin, matchedId, last, draftBin) {
|
|
561
|
+
if (bin === null) return false;
|
|
562
|
+
return last?.methodId !== matchedId || last.bin !== bin || draftBin !== last.bin;
|
|
563
|
+
}
|
|
564
|
+
function redispatchOnReturnToNewCard({ draftPath, previousPath, revealedByCardMode, detectedMethod, digits, lastDispatchedRef, selectMethod }) {
|
|
565
|
+
if (draftPath !== "new-card") {
|
|
566
|
+
lastDispatchedRef.current = null;
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
if (!shouldRedispatchOnReturnToNewCard({
|
|
570
|
+
previousPath,
|
|
571
|
+
revealedByCardMode,
|
|
572
|
+
detectedMethod,
|
|
573
|
+
lastDispatched: lastDispatchedRef.current
|
|
574
|
+
}) || !detectedMethod) return;
|
|
575
|
+
const bin = resolveCompleteBin(digits);
|
|
576
|
+
if (bin === null) return;
|
|
577
|
+
lastDispatchedRef.current = {
|
|
578
|
+
methodId: detectedMethod.id,
|
|
579
|
+
bin
|
|
580
|
+
};
|
|
581
|
+
selectMethod?.({
|
|
582
|
+
methodId: detectedMethod.id,
|
|
583
|
+
bin
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
function isOtherNetwork(selectedMethodId, detectedMethod) {
|
|
587
|
+
return selectedMethodId !== null && detectedMethod !== null && detectedMethod.id !== selectedMethodId;
|
|
588
|
+
}
|
|
589
|
+
function refusalsForSelection({ selectionOutOfScope, selectionNonCard, selectionOtherNetwork }) {
|
|
590
|
+
return selectionOutOfScope || selectionNonCard || selectionOtherNetwork ? [CARD_ENTRY_COLLAPSED_ERROR] : [];
|
|
591
|
+
}
|
|
592
|
+
function refusalForInvalidDraft(methods, digits) {
|
|
593
|
+
return matchesNoConfiguredNetwork(methods, digits) ? UNSUPPORTED_NETWORK_ERROR : INVALID_CARD_DATA_ERROR;
|
|
594
|
+
}
|
|
595
|
+
function explainUnsupportedNetwork(collapsed, methods, digits) {
|
|
596
|
+
return !collapsed && matchesNoConfiguredNetwork(methods, digits) ? UNSUPPORTED_NETWORK_ERROR : null;
|
|
597
|
+
}
|
|
598
|
+
function publishMatchedBin({ selection, matched, bin, draftBin, lastDispatchedRef }) {
|
|
599
|
+
const last = lastDispatchedRef.current;
|
|
600
|
+
if (selection && isBinDispatchDue(bin, matched.id, last, draftBin)) {
|
|
601
|
+
selection.setDraftBin(bin);
|
|
602
|
+
lastDispatchedRef.current = {
|
|
603
|
+
methodId: matched.id,
|
|
604
|
+
bin
|
|
605
|
+
};
|
|
606
|
+
selection.selectMethod({
|
|
607
|
+
methodId: matched.id,
|
|
608
|
+
bin
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function securityCodeStyle(cvv, focused) {
|
|
613
|
+
return isSecurityCodeMasked(cvv, focused) ? SECURITY_CODE_MASK_STYLE : void 0;
|
|
614
|
+
}
|
|
615
|
+
function FieldErrorMessage({ message }) {
|
|
616
|
+
return message ? /* @__PURE__ */ jsx(Field.Error, {
|
|
617
|
+
match: true,
|
|
618
|
+
children: message
|
|
619
|
+
}) : null;
|
|
620
|
+
}
|
|
621
|
+
function DetectedNetworkMark({ method, icon }) {
|
|
622
|
+
return /* @__PURE__ */ jsx("div", {
|
|
623
|
+
"data-fs-card-entry-networks": "",
|
|
624
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
625
|
+
"data-fs-card-entry-network": "",
|
|
626
|
+
"data-fs-card-entry-network-id": method.id,
|
|
627
|
+
children: icon ? /* @__PURE__ */ jsx(Icon, {
|
|
628
|
+
name: icon,
|
|
629
|
+
"data-fs-card-entry-network-icon": ""
|
|
630
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
631
|
+
"data-fs-card-entry-network-fallback": "",
|
|
632
|
+
children: method.name
|
|
633
|
+
})
|
|
634
|
+
})
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
function rootStateAttributes({ placing, disabled, collapsed }) {
|
|
638
|
+
return {
|
|
639
|
+
...placing || collapsed ? { inert: true } : {},
|
|
640
|
+
"aria-disabled": placing || void 0,
|
|
641
|
+
...placing ? { "data-fs-card-entry-placing": "" } : {},
|
|
642
|
+
...disabled ? { "data-fs-card-entry-disabled": "" } : {},
|
|
643
|
+
...collapsed ? { "data-fs-card-entry-collapsed": "" } : {}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function CardEntry({ numberPlaceholder, holderNamePlaceholder, cvvPlaceholder, disabled = false, className, $content }) {
|
|
487
647
|
const { networks: methods, busy: placing, clearOn, onNetworkChange, selection } = useCardCapture();
|
|
488
|
-
const draftPath = selection
|
|
489
|
-
const draftBin = selection?.bin ?? null;
|
|
490
|
-
const collapsed = selection?.collapsed ?? false;
|
|
491
|
-
const cardModeActive = selection?.cardModeActive ?? false;
|
|
492
|
-
const selectedMethodId = selection?.selectedMethodId ?? null;
|
|
493
|
-
const selectionOutOfScope = selection?.selectionOutOfScope ?? false;
|
|
494
|
-
const selectionNonCard = selection?.selectionNonCard ?? false;
|
|
648
|
+
const { draftPath, draftBin, collapsed, cardModeActive, selectedMethodId, selectionOutOfScope, selectionNonCard } = readSelectionFacts(selection);
|
|
495
649
|
const selectMethod = selection?.selectMethod;
|
|
650
|
+
const setDraftEntryValid = selection?.setDraftEntryValid;
|
|
651
|
+
const { format } = useMessageFormatter(CardEntryContent, $content);
|
|
496
652
|
const validationMessages = useMemo(() => ({
|
|
497
|
-
numberRequired: numberRequiredMessage,
|
|
498
|
-
numberInvalid: numberInvalidMessage,
|
|
499
|
-
networkNotAccepted: networkNotAcceptedMessage,
|
|
500
|
-
holderNameRequired: holderNameRequiredMessage,
|
|
501
|
-
expirationRequired: expirationRequiredMessage,
|
|
502
|
-
expirationInvalid: expirationInvalidMessage,
|
|
503
|
-
expirationExpired: expirationExpiredMessage,
|
|
504
|
-
cvvRequired: cvvRequiredMessage,
|
|
505
|
-
cvvInvalid: cvvInvalidMessage
|
|
506
|
-
}), [
|
|
507
|
-
numberRequiredMessage,
|
|
508
|
-
numberInvalidMessage,
|
|
509
|
-
networkNotAcceptedMessage,
|
|
510
|
-
holderNameRequiredMessage,
|
|
511
|
-
expirationRequiredMessage,
|
|
512
|
-
expirationInvalidMessage,
|
|
513
|
-
expirationExpiredMessage,
|
|
514
|
-
cvvRequiredMessage,
|
|
515
|
-
cvvInvalidMessage
|
|
516
|
-
]);
|
|
653
|
+
numberRequired: format("numberRequiredMessage"),
|
|
654
|
+
numberInvalid: format("numberInvalidMessage"),
|
|
655
|
+
networkNotAccepted: format("networkNotAcceptedMessage"),
|
|
656
|
+
holderNameRequired: format("holderNameRequiredMessage"),
|
|
657
|
+
expirationRequired: format("expirationRequiredMessage"),
|
|
658
|
+
expirationInvalid: format("expirationInvalidMessage"),
|
|
659
|
+
expirationExpired: format("expirationExpiredMessage"),
|
|
660
|
+
cvvRequired: format("cvvRequiredMessage"),
|
|
661
|
+
cvvInvalid: format("cvvInvalidMessage")
|
|
662
|
+
}), [format]);
|
|
517
663
|
const [number, setNumber] = useState("");
|
|
518
664
|
const [holderName, setHolderName] = useState("");
|
|
519
665
|
const [expiration, setExpiration] = useState("");
|
|
520
666
|
const [cvv, setCvv] = useState("");
|
|
667
|
+
const [cvvFocused, setCvvFocused] = useState(false);
|
|
521
668
|
const [fieldErrors, setFieldErrors] = useState({});
|
|
522
669
|
const rootRef = useRef(null);
|
|
523
670
|
const lastDispatchedRef = useRef(null);
|
|
@@ -527,10 +674,30 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
527
674
|
const digits = toDigits(number);
|
|
528
675
|
const detectedMethod = useMemo(() => resolveNetworkMethod(methods, digits), [methods, digits]);
|
|
529
676
|
const validator = detectedMethod?.validator ?? DEFAULT_VALIDATOR;
|
|
530
|
-
const selectionOtherNetwork = selectedMethodId
|
|
677
|
+
const selectionOtherNetwork = isOtherNetwork(selectedMethodId, detectedMethod);
|
|
531
678
|
const detectedNetworkIcon = detectedMethod ? networkIconName(detectedMethod.name) : null;
|
|
532
|
-
const cvvComplete = isSecurityCodeComplete(cvv, narrowestMaskCapacity(validator.cvvMask ?? DEFAULT_CVV_MASK));
|
|
533
679
|
const detectedNetworkId = detectedMethod?.id ?? null;
|
|
680
|
+
const entryValid = useMemo(() => {
|
|
681
|
+
const errors = validateDraft({
|
|
682
|
+
number,
|
|
683
|
+
holderName,
|
|
684
|
+
expiration,
|
|
685
|
+
cvv
|
|
686
|
+
}, validator, methods, validationMessages);
|
|
687
|
+
return !errors.number && !errors.expiration && !errors.cvv;
|
|
688
|
+
}, [
|
|
689
|
+
number,
|
|
690
|
+
holderName,
|
|
691
|
+
expiration,
|
|
692
|
+
cvv,
|
|
693
|
+
validator,
|
|
694
|
+
methods,
|
|
695
|
+
validationMessages
|
|
696
|
+
]);
|
|
697
|
+
useEffect(() => {
|
|
698
|
+
setDraftEntryValid?.(entryValid);
|
|
699
|
+
}, [entryValid, setDraftEntryValid]);
|
|
700
|
+
useEffect(() => () => setDraftEntryValid?.(false), [setDraftEntryValid]);
|
|
534
701
|
useEffect(() => {
|
|
535
702
|
if (reportedNetworkIdRef.current === detectedNetworkId) return;
|
|
536
703
|
reportedNetworkIdRef.current = detectedNetworkId;
|
|
@@ -541,25 +708,14 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
541
708
|
previousDraftPathRef.current = draftPath;
|
|
542
709
|
const revealedByCardMode = previousCollapsedRef.current && !collapsed && cardModeActive;
|
|
543
710
|
previousCollapsedRef.current = collapsed;
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
if (!shouldRedispatchOnReturnToNewCard({
|
|
711
|
+
redispatchOnReturnToNewCard({
|
|
712
|
+
draftPath,
|
|
549
713
|
previousPath,
|
|
550
714
|
revealedByCardMode,
|
|
551
715
|
detectedMethod,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
if (bin === null) return;
|
|
556
|
-
lastDispatchedRef.current = {
|
|
557
|
-
methodId: detectedMethod.id,
|
|
558
|
-
bin
|
|
559
|
-
};
|
|
560
|
-
selectMethod?.({
|
|
561
|
-
methodId: detectedMethod.id,
|
|
562
|
-
bin
|
|
716
|
+
digits,
|
|
717
|
+
lastDispatchedRef,
|
|
718
|
+
selectMethod
|
|
563
719
|
});
|
|
564
720
|
}, [
|
|
565
721
|
draftPath,
|
|
@@ -572,34 +728,23 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
572
728
|
useEffect(() => {
|
|
573
729
|
if (collapsed) {
|
|
574
730
|
setCvv("");
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
const next = { ...prev };
|
|
578
|
-
delete next.cvv;
|
|
579
|
-
return next;
|
|
580
|
-
});
|
|
731
|
+
setCvvFocused(false);
|
|
732
|
+
setFieldErrors((prev) => withoutFieldError(prev, "cvv"));
|
|
581
733
|
lastDispatchedRef.current = null;
|
|
582
734
|
}
|
|
583
735
|
}, [collapsed]);
|
|
736
|
+
useEffect(() => {
|
|
737
|
+
if (!validator.cvvRequired) setCvvFocused(false);
|
|
738
|
+
}, [validator.cvvRequired]);
|
|
584
739
|
const focusField = useCallback((key) => {
|
|
585
740
|
(rootRef.current?.querySelector(`[data-fs-card-entry-field="${FIELD_ATTR[key]}"] input`))?.focus();
|
|
586
741
|
}, []);
|
|
587
742
|
function clearFieldError(key) {
|
|
588
|
-
setFieldErrors((prev) =>
|
|
589
|
-
if (!(key in prev)) return prev;
|
|
590
|
-
const next = { ...prev };
|
|
591
|
-
delete next[key];
|
|
592
|
-
return next;
|
|
593
|
-
});
|
|
743
|
+
setFieldErrors((prev) => withoutFieldError(prev, key));
|
|
594
744
|
}
|
|
595
745
|
function runFieldValidation(key, draftValue) {
|
|
596
746
|
const errors = validateDraft(draftValue, validator, methods, validationMessages);
|
|
597
|
-
setFieldErrors((prev) =>
|
|
598
|
-
const next = { ...prev };
|
|
599
|
-
if (errors[key]) next[key] = errors[key];
|
|
600
|
-
else delete next[key];
|
|
601
|
-
return next;
|
|
602
|
-
});
|
|
747
|
+
setFieldErrors((prev) => withFieldError(prev, key, errors[key]));
|
|
603
748
|
}
|
|
604
749
|
function handleNumberChange(event) {
|
|
605
750
|
const rawDigits = toDigits(event.target.value);
|
|
@@ -610,20 +755,14 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
610
755
|
const nextDigits = toDigits(masked);
|
|
611
756
|
if (nextDigits.length > 0 && draftPath !== "new-card") selection?.selectNewCard();
|
|
612
757
|
const bin = resolveCompleteBin(nextDigits);
|
|
613
|
-
if (matched) {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
selection.selectMethod({
|
|
622
|
-
methodId: matched.id,
|
|
623
|
-
bin
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
} else selection?.setDraftBin(null);
|
|
758
|
+
if (matched) publishMatchedBin({
|
|
759
|
+
selection,
|
|
760
|
+
matched,
|
|
761
|
+
bin,
|
|
762
|
+
draftBin,
|
|
763
|
+
lastDispatchedRef
|
|
764
|
+
});
|
|
765
|
+
else selection?.setDraftBin(null);
|
|
627
766
|
}
|
|
628
767
|
function handleNumberBlur() {
|
|
629
768
|
runFieldValidation("number", {
|
|
@@ -662,7 +801,11 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
662
801
|
setCvv(maskDigits(event.target.value, validator.cvvMask ?? DEFAULT_CVV_MASK));
|
|
663
802
|
clearFieldError("cvv");
|
|
664
803
|
}
|
|
804
|
+
function handleCvvFocus() {
|
|
805
|
+
setCvvFocused(true);
|
|
806
|
+
}
|
|
665
807
|
function handleCvvBlur() {
|
|
808
|
+
setCvvFocused(false);
|
|
666
809
|
runFieldValidation("cvv", {
|
|
667
810
|
number,
|
|
668
811
|
holderName,
|
|
@@ -678,11 +821,15 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
678
821
|
expiration,
|
|
679
822
|
cvv
|
|
680
823
|
}, validator, methods, validationMessages);
|
|
681
|
-
if (Object.keys(errors).length === 0) return
|
|
824
|
+
if (Object.keys(errors).length === 0) return refusalsForSelection({
|
|
825
|
+
selectionOutOfScope,
|
|
826
|
+
selectionNonCard,
|
|
827
|
+
selectionOtherNetwork
|
|
828
|
+
});
|
|
682
829
|
setFieldErrors(errors);
|
|
683
830
|
const firstInvalid = VALIDATION_ORDER.find((key) => errors[key]);
|
|
684
831
|
if (firstInvalid) focusField(firstInvalid);
|
|
685
|
-
return [
|
|
832
|
+
return [refusalForInvalidDraft(methods, digits)];
|
|
686
833
|
}, [
|
|
687
834
|
collapsed,
|
|
688
835
|
number,
|
|
@@ -731,29 +878,30 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
731
878
|
cvv,
|
|
732
879
|
clearOn
|
|
733
880
|
]);
|
|
734
|
-
const explainMissingMethod = useCallback(() =>
|
|
881
|
+
const explainMissingMethod = useCallback(() => explainUnsupportedNetwork(collapsed, methods, digits), [
|
|
735
882
|
collapsed,
|
|
736
883
|
methods,
|
|
737
884
|
digits
|
|
738
885
|
]);
|
|
739
886
|
useRegisterCardCapture(capture, checkDraft, explainMissingMethod);
|
|
887
|
+
const cvvDescription = validator.cvvRequired ? format("cvvDescription") : "";
|
|
740
888
|
return /* @__PURE__ */ jsx("div", {
|
|
741
889
|
hidden: collapsed,
|
|
742
890
|
"data-fs-card-entry-collapse-boundary": "",
|
|
743
891
|
children: /* @__PURE__ */ jsx("div", {
|
|
744
892
|
ref: rootRef,
|
|
745
893
|
className,
|
|
746
|
-
...
|
|
747
|
-
|
|
894
|
+
...rootStateAttributes({
|
|
895
|
+
placing,
|
|
896
|
+
disabled,
|
|
897
|
+
collapsed
|
|
898
|
+
}),
|
|
748
899
|
"data-fs-card-entry": "",
|
|
749
|
-
...placing ? { "data-fs-card-entry-placing": "" } : {},
|
|
750
|
-
...disabled ? { "data-fs-card-entry-disabled": "" } : {},
|
|
751
|
-
...collapsed ? { "data-fs-card-entry-collapsed": "" } : {},
|
|
752
900
|
children: /* @__PURE__ */ jsxs(Fieldset.Root, {
|
|
753
901
|
disabled: disabled || collapsed,
|
|
754
902
|
"data-fs-card-entry-fieldset": "",
|
|
755
903
|
children: [
|
|
756
|
-
/* @__PURE__ */ jsx(Fieldset.Legend, { children: legend }),
|
|
904
|
+
/* @__PURE__ */ jsx(Fieldset.Legend, { children: format("legend") }),
|
|
757
905
|
/* @__PURE__ */ jsx("div", {
|
|
758
906
|
"data-fs-card-entry-field": "number",
|
|
759
907
|
children: /* @__PURE__ */ jsxs(Field.Root, {
|
|
@@ -761,7 +909,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
761
909
|
disabled,
|
|
762
910
|
"data-fs-card-entry-number": "",
|
|
763
911
|
children: [
|
|
764
|
-
/* @__PURE__ */ jsx(Field.Label, { children: numberLabel }),
|
|
912
|
+
/* @__PURE__ */ jsx(Field.Label, { children: format("numberLabel") }),
|
|
765
913
|
/* @__PURE__ */ jsxs("div", {
|
|
766
914
|
"data-fs-card-entry-number-control": "",
|
|
767
915
|
children: [/* @__PURE__ */ jsx(Field.Control, {
|
|
@@ -773,25 +921,12 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
773
921
|
onChange: handleNumberChange,
|
|
774
922
|
onBlur: handleNumberBlur,
|
|
775
923
|
disabled
|
|
776
|
-
}), detectedMethod ? /* @__PURE__ */ jsx(
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
"data-fs-card-entry-network": "",
|
|
780
|
-
"data-fs-card-entry-network-id": detectedMethod.id,
|
|
781
|
-
children: detectedNetworkIcon ? /* @__PURE__ */ jsx(Icon, {
|
|
782
|
-
name: detectedNetworkIcon,
|
|
783
|
-
"data-fs-card-entry-network-icon": ""
|
|
784
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
785
|
-
"data-fs-card-entry-network-fallback": "",
|
|
786
|
-
children: detectedMethod.name
|
|
787
|
-
})
|
|
788
|
-
})
|
|
924
|
+
}), detectedMethod ? /* @__PURE__ */ jsx(DetectedNetworkMark, {
|
|
925
|
+
method: detectedMethod,
|
|
926
|
+
icon: detectedNetworkIcon
|
|
789
927
|
}) : null]
|
|
790
928
|
}),
|
|
791
|
-
|
|
792
|
-
match: true,
|
|
793
|
-
children: fieldErrors.number
|
|
794
|
-
}) : null
|
|
929
|
+
/* @__PURE__ */ jsx(FieldErrorMessage, { message: fieldErrors.number })
|
|
795
930
|
]
|
|
796
931
|
})
|
|
797
932
|
}),
|
|
@@ -801,7 +936,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
801
936
|
invalid: Boolean(fieldErrors.holderName),
|
|
802
937
|
disabled,
|
|
803
938
|
children: [
|
|
804
|
-
/* @__PURE__ */ jsx(Field.Label, { children: holderNameLabel }),
|
|
939
|
+
/* @__PURE__ */ jsx(Field.Label, { children: format("holderNameLabel") }),
|
|
805
940
|
/* @__PURE__ */ jsx(Field.Control, {
|
|
806
941
|
name: "holderName",
|
|
807
942
|
autoComplete: "cc-name",
|
|
@@ -811,10 +946,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
811
946
|
onBlur: handleHolderNameBlur,
|
|
812
947
|
disabled
|
|
813
948
|
}),
|
|
814
|
-
|
|
815
|
-
match: true,
|
|
816
|
-
children: fieldErrors.holderName
|
|
817
|
-
}) : null
|
|
949
|
+
/* @__PURE__ */ jsx(FieldErrorMessage, { message: fieldErrors.holderName })
|
|
818
950
|
]
|
|
819
951
|
})
|
|
820
952
|
}) : null,
|
|
@@ -824,21 +956,18 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
824
956
|
invalid: Boolean(fieldErrors.expiration),
|
|
825
957
|
disabled,
|
|
826
958
|
children: [
|
|
827
|
-
/* @__PURE__ */ jsx(Field.Label, { children: expirationLabel }),
|
|
959
|
+
/* @__PURE__ */ jsx(Field.Label, { children: format("expirationLabel") }),
|
|
828
960
|
/* @__PURE__ */ jsx(Field.Control, {
|
|
829
961
|
name: "expiration",
|
|
830
962
|
inputMode: "numeric",
|
|
831
963
|
autoComplete: "cc-exp",
|
|
832
|
-
placeholder: expirationPlaceholder,
|
|
964
|
+
placeholder: format("expirationPlaceholder"),
|
|
833
965
|
value: expiration,
|
|
834
966
|
onChange: handleExpirationChange,
|
|
835
967
|
onBlur: handleExpirationBlur,
|
|
836
968
|
disabled
|
|
837
969
|
}),
|
|
838
|
-
|
|
839
|
-
match: true,
|
|
840
|
-
children: fieldErrors.expiration
|
|
841
|
-
}) : null
|
|
970
|
+
/* @__PURE__ */ jsx(FieldErrorMessage, { message: fieldErrors.expiration })
|
|
842
971
|
]
|
|
843
972
|
})
|
|
844
973
|
}) : null,
|
|
@@ -848,7 +977,7 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
848
977
|
invalid: Boolean(fieldErrors.cvv),
|
|
849
978
|
disabled,
|
|
850
979
|
children: [
|
|
851
|
-
/* @__PURE__ */ jsx(Field.Label, { children: cvvLabel }),
|
|
980
|
+
/* @__PURE__ */ jsx(Field.Label, { children: format("cvvLabel") }),
|
|
852
981
|
/* @__PURE__ */ jsx(Field.Control, {
|
|
853
982
|
name: "cvv",
|
|
854
983
|
type: "text",
|
|
@@ -857,18 +986,16 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
857
986
|
placeholder: cvvPlaceholder,
|
|
858
987
|
value: cvv,
|
|
859
988
|
onChange: handleCvvChange,
|
|
989
|
+
onFocus: handleCvvFocus,
|
|
860
990
|
onBlur: handleCvvBlur,
|
|
861
991
|
disabled,
|
|
862
|
-
style:
|
|
992
|
+
style: securityCodeStyle(cvv, cvvFocused && !disabled)
|
|
863
993
|
}),
|
|
864
994
|
cvvDescription ? /* @__PURE__ */ jsx(Field.Description, {
|
|
865
995
|
"data-fs-card-entry-cvv-description": "",
|
|
866
996
|
children: cvvDescription
|
|
867
997
|
}) : null,
|
|
868
|
-
|
|
869
|
-
match: true,
|
|
870
|
-
children: fieldErrors.cvv
|
|
871
|
-
}) : null
|
|
998
|
+
/* @__PURE__ */ jsx(FieldErrorMessage, { message: fieldErrors.cvv })
|
|
872
999
|
]
|
|
873
1000
|
})
|
|
874
1001
|
}) : null
|
|
@@ -878,6 +1005,6 @@ function CardEntry({ legend = "Card details", numberLabel = "Card number", numbe
|
|
|
878
1005
|
});
|
|
879
1006
|
}
|
|
880
1007
|
//#endregion
|
|
881
|
-
export { CARD_ENTRY_COLLAPSED_CODE, CARD_ENTRY_INVALID_DATA_CODE, CARD_ENTRY_UNSUPPORTED_NETWORK_CODE, CardEntry, CardEntryDefinition, NETWORK_ICON_BY_KEY, detectNetworkMethod, isExpirationFormatValid, isExpirationInFuture, isValidLuhn, matchesNoConfiguredNetwork, resolveCompleteBin, resolveNetworkMethod, shouldRedispatchOnReturnToNewCard };
|
|
1008
|
+
export { CARD_ENTRY_COLLAPSED_CODE, CARD_ENTRY_INVALID_DATA_CODE, CARD_ENTRY_UNSUPPORTED_NETWORK_CODE, CardEntry, CardEntryContent, CardEntryDefinition, NETWORK_ICON_BY_KEY, detectNetworkMethod, isExpirationFormatValid, isExpirationInFuture, isValidLuhn, matchesNoConfiguredNetwork, networkIconName, resolveCompleteBin, resolveNetworkMethod, shouldRedispatchOnReturnToNewCard };
|
|
882
1009
|
|
|
883
1010
|
//# sourceMappingURL=card-entry.js.map
|