@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
|
@@ -3,17 +3,17 @@ import { defineComponent } from "../../core/dist/define-component.js";
|
|
|
3
3
|
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
4
4
|
import "../../core/dist/index.js";
|
|
5
5
|
import { signInTarget } from "../../utils/safe-href.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useStorefrontFormatters } from "../../sdk/format/client.js";
|
|
7
|
+
import { useMessageFormatter } from "../../sdk/i18n/use-message-formatter.js";
|
|
7
8
|
import { useStorefrontRoute } from "../../sdk/navigation/use-storefront-route.js";
|
|
8
9
|
import { graphql } from "../../sdk/generated/gql.js";
|
|
9
10
|
import { ActionsOverrideContext, useActionsOverride } from "../../sdk/actions/actions-override-context.js";
|
|
10
11
|
import { useDataOverride } from "../../sdk/data/data-override-context.js";
|
|
11
|
-
import { resolveAuthoredCopy } from "../../utils/resolve-authored-copy.js";
|
|
12
12
|
import { useSession } from "../session/session.js";
|
|
13
|
+
import { ReactiveRootContext } from "../../sdk/data/page-reactive-data-root.js";
|
|
13
14
|
import { NavigationLink } from "../../particles/navigation-link/navigation-link.js";
|
|
14
15
|
import { ListItemRefContext } from "../../sdk/data/list-item-ref-context.js";
|
|
15
|
-
import {
|
|
16
|
-
import { AlertDialogBackdrop, AlertDialogClose, AlertDialogDescription, AlertDialogPopup, AlertDialogPortal, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger, AlertDialogViewport } from "../../particles/alert-dialog/alert-dialog.js";
|
|
16
|
+
import { AlertDialogClose, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger } from "../../particles/alert-dialog/alert-dialog.js";
|
|
17
17
|
import { CardSummary, CardSummaryRoot, useCardSummary } from "../../particles/card-summary/card-summary.js";
|
|
18
18
|
import { cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
19
19
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -24,11 +24,11 @@ import { CombinedGraphQLErrors } from "@apollo/client/errors";
|
|
|
24
24
|
* The Root reads card ids only; each AccountSavedCardItem subscribes to its own CustomerSavedCard
|
|
25
25
|
* (ADR-0012) and provides `card-summary` and the row itself, so the schema arranges the CardSummary
|
|
26
26
|
* parts and AccountSavedCardExpiry in the row.
|
|
27
|
-
* Every text
|
|
28
|
-
*
|
|
27
|
+
* Every text is children or else the part's own `$content` message; the expiry line, repeated per row,
|
|
28
|
+
* takes no children.
|
|
29
29
|
* Removal state lives in the Root, because a successful removal unmounts the row it started from. The
|
|
30
|
-
* Root also declares the `savedCard.remove` write, so
|
|
31
|
-
*
|
|
30
|
+
* Root also declares the `savedCard.remove` write, so every remove control in the section reaches the
|
|
31
|
+
* provider.
|
|
32
32
|
*/
|
|
33
33
|
const fragment = graphql(`
|
|
34
34
|
fragment AccountSavedCardsData on Query {
|
|
@@ -71,7 +71,9 @@ const AccountSavedCardsHeadingContent = defineContentType({
|
|
|
71
71
|
properties: { text: {
|
|
72
72
|
type: "string",
|
|
73
73
|
minLength: 1,
|
|
74
|
-
title: "Heading"
|
|
74
|
+
title: "Heading",
|
|
75
|
+
format: "icu-message",
|
|
76
|
+
messageSource: "Saved cards"
|
|
75
77
|
} }
|
|
76
78
|
}
|
|
77
79
|
});
|
|
@@ -85,7 +87,9 @@ const AccountSavedCardsEmptyContent = defineContentType({
|
|
|
85
87
|
properties: { text: {
|
|
86
88
|
type: "string",
|
|
87
89
|
minLength: 1,
|
|
88
|
-
title: "Empty statement"
|
|
90
|
+
title: "Empty statement",
|
|
91
|
+
format: "icu-message",
|
|
92
|
+
messageSource: "You have no saved cards yet."
|
|
89
93
|
} }
|
|
90
94
|
}
|
|
91
95
|
});
|
|
@@ -99,7 +103,9 @@ const AccountSavedCardsLoadingContent = defineContentType({
|
|
|
99
103
|
properties: { text: {
|
|
100
104
|
type: "string",
|
|
101
105
|
minLength: 1,
|
|
102
|
-
title: "Loading announcement"
|
|
106
|
+
title: "Loading announcement",
|
|
107
|
+
format: "icu-message",
|
|
108
|
+
messageSource: "Loading your saved cards…"
|
|
103
109
|
} }
|
|
104
110
|
}
|
|
105
111
|
});
|
|
@@ -114,17 +120,23 @@ const AccountSavedCardsErrorContent = defineContentType({
|
|
|
114
120
|
text: {
|
|
115
121
|
type: "string",
|
|
116
122
|
minLength: 1,
|
|
117
|
-
title: "Load failure message"
|
|
123
|
+
title: "Load failure message",
|
|
124
|
+
format: "icu-message",
|
|
125
|
+
messageSource: "We couldn't load your saved cards. Please try again later."
|
|
118
126
|
},
|
|
119
127
|
sessionExpiredText: {
|
|
120
128
|
type: "string",
|
|
121
129
|
minLength: 1,
|
|
122
|
-
title: "Session expired message"
|
|
130
|
+
title: "Session expired message",
|
|
131
|
+
format: "icu-message",
|
|
132
|
+
messageSource: "Your session has expired."
|
|
123
133
|
},
|
|
124
134
|
signInLabel: {
|
|
125
135
|
type: "string",
|
|
126
136
|
minLength: 1,
|
|
127
|
-
title: "Sign-in link label"
|
|
137
|
+
title: "Sign-in link label",
|
|
138
|
+
format: "icu-message",
|
|
139
|
+
messageSource: "Sign in again"
|
|
128
140
|
}
|
|
129
141
|
}
|
|
130
142
|
}
|
|
@@ -140,22 +152,30 @@ const AccountSavedCardExpiryContent = defineContentType({
|
|
|
140
152
|
expiresLabel: {
|
|
141
153
|
type: "string",
|
|
142
154
|
minLength: 1,
|
|
143
|
-
title: "Label before a working card's date"
|
|
155
|
+
title: "Label before a working card's date",
|
|
156
|
+
format: "icu-message",
|
|
157
|
+
messageSource: "Expires"
|
|
144
158
|
},
|
|
145
159
|
expiredLabel: {
|
|
146
160
|
type: "string",
|
|
147
161
|
minLength: 1,
|
|
148
|
-
title: "Label before an expired card's date"
|
|
162
|
+
title: "Label before an expired card's date",
|
|
163
|
+
format: "icu-message",
|
|
164
|
+
messageSource: "Expired"
|
|
149
165
|
},
|
|
150
166
|
expiredText: {
|
|
151
167
|
type: "string",
|
|
152
168
|
minLength: 1,
|
|
153
|
-
title: "Expired card with no date"
|
|
169
|
+
title: "Expired card with no date",
|
|
170
|
+
format: "icu-message",
|
|
171
|
+
messageSource: "Expired"
|
|
154
172
|
},
|
|
155
173
|
unusableText: {
|
|
156
174
|
type: "string",
|
|
157
175
|
minLength: 1,
|
|
158
|
-
title: "Unusable card"
|
|
176
|
+
title: "Unusable card",
|
|
177
|
+
format: "icu-message",
|
|
178
|
+
messageSource: "This card can't be used"
|
|
159
179
|
}
|
|
160
180
|
}
|
|
161
181
|
}
|
|
@@ -163,15 +183,32 @@ const AccountSavedCardExpiryContent = defineContentType({
|
|
|
163
183
|
const AccountSavedCardRemoveTriggerContent = defineContentType({
|
|
164
184
|
id: "account-saved-card-remove-trigger",
|
|
165
185
|
title: "Account Saved Card Remove Trigger",
|
|
166
|
-
description: "Label of the control that opens a saved card's removal prompt.",
|
|
186
|
+
description: "Label of the control that opens a saved card's removal prompt, and the card's last digits read to assistive technology.",
|
|
167
187
|
schema: {
|
|
168
188
|
type: "object",
|
|
169
189
|
additionalProperties: false,
|
|
170
|
-
properties: {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
190
|
+
properties: {
|
|
191
|
+
text: {
|
|
192
|
+
type: "string",
|
|
193
|
+
minLength: 1,
|
|
194
|
+
title: "Trigger label",
|
|
195
|
+
format: "icu-message",
|
|
196
|
+
messageSource: "Remove"
|
|
197
|
+
},
|
|
198
|
+
cardEndingIn: {
|
|
199
|
+
type: "string",
|
|
200
|
+
minLength: 1,
|
|
201
|
+
title: "Card last digits",
|
|
202
|
+
description: "Read to assistive technology after the card name.",
|
|
203
|
+
format: "icu-message",
|
|
204
|
+
messageSource: "ending in {lastDigits}",
|
|
205
|
+
messageArguments: {
|
|
206
|
+
type: "object",
|
|
207
|
+
properties: { lastDigits: { type: "string" } }
|
|
208
|
+
},
|
|
209
|
+
messageExample: { lastDigits: "4242" }
|
|
210
|
+
}
|
|
211
|
+
}
|
|
175
212
|
}
|
|
176
213
|
});
|
|
177
214
|
const AccountSavedCardRemoveTitleContent = defineContentType({
|
|
@@ -184,22 +221,41 @@ const AccountSavedCardRemoveTitleContent = defineContentType({
|
|
|
184
221
|
properties: { text: {
|
|
185
222
|
type: "string",
|
|
186
223
|
minLength: 1,
|
|
187
|
-
title: "Prompt title"
|
|
224
|
+
title: "Prompt title",
|
|
225
|
+
format: "icu-message",
|
|
226
|
+
messageSource: "Remove this card?"
|
|
188
227
|
} }
|
|
189
228
|
}
|
|
190
229
|
});
|
|
191
230
|
const AccountSavedCardRemoveDescriptionContent = defineContentType({
|
|
192
|
-
id: "account-saved-card-remove-
|
|
231
|
+
id: "account-saved-card-remove-body",
|
|
193
232
|
title: "Account Saved Card Remove Description",
|
|
194
|
-
description: "What removing the card means, shown after the card in the removal prompt.",
|
|
233
|
+
description: "What removing the card means, shown after the card in the removal prompt, and the card's last digits read to assistive technology.",
|
|
195
234
|
schema: {
|
|
196
235
|
type: "object",
|
|
197
236
|
additionalProperties: false,
|
|
198
|
-
properties: {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
237
|
+
properties: {
|
|
238
|
+
text: {
|
|
239
|
+
type: "string",
|
|
240
|
+
minLength: 1,
|
|
241
|
+
title: "Consequence",
|
|
242
|
+
format: "icu-message",
|
|
243
|
+
messageSource: "It will no longer be offered when you pay. This can't be undone."
|
|
244
|
+
},
|
|
245
|
+
cardEndingIn: {
|
|
246
|
+
type: "string",
|
|
247
|
+
minLength: 1,
|
|
248
|
+
title: "Card last digits",
|
|
249
|
+
description: "Read to assistive technology after the card name.",
|
|
250
|
+
format: "icu-message",
|
|
251
|
+
messageSource: "ending in {lastDigits}",
|
|
252
|
+
messageArguments: {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: { lastDigits: { type: "string" } }
|
|
255
|
+
},
|
|
256
|
+
messageExample: { lastDigits: "4242" }
|
|
257
|
+
}
|
|
258
|
+
}
|
|
203
259
|
}
|
|
204
260
|
});
|
|
205
261
|
const AccountSavedCardRemoveCancelContent = defineContentType({
|
|
@@ -212,7 +268,9 @@ const AccountSavedCardRemoveCancelContent = defineContentType({
|
|
|
212
268
|
properties: { text: {
|
|
213
269
|
type: "string",
|
|
214
270
|
minLength: 1,
|
|
215
|
-
title: "Cancel label"
|
|
271
|
+
title: "Cancel label",
|
|
272
|
+
format: "icu-message",
|
|
273
|
+
messageSource: "Cancel"
|
|
216
274
|
} }
|
|
217
275
|
}
|
|
218
276
|
});
|
|
@@ -227,12 +285,16 @@ const AccountSavedCardRemoveConfirmContent = defineContentType({
|
|
|
227
285
|
text: {
|
|
228
286
|
type: "string",
|
|
229
287
|
minLength: 1,
|
|
230
|
-
title: "Confirm label"
|
|
288
|
+
title: "Confirm label",
|
|
289
|
+
format: "icu-message",
|
|
290
|
+
messageSource: "Remove card"
|
|
231
291
|
},
|
|
232
292
|
pendingText: {
|
|
233
293
|
type: "string",
|
|
234
294
|
minLength: 1,
|
|
235
|
-
title: "Label while removing"
|
|
295
|
+
title: "Label while removing",
|
|
296
|
+
format: "icu-message",
|
|
297
|
+
messageSource: "Removing…"
|
|
236
298
|
}
|
|
237
299
|
}
|
|
238
300
|
}
|
|
@@ -248,22 +310,30 @@ const AccountSavedCardsRemoveFeedbackContent = defineContentType({
|
|
|
248
310
|
successText: {
|
|
249
311
|
type: "string",
|
|
250
312
|
minLength: 1,
|
|
251
|
-
title: "Card removed"
|
|
313
|
+
title: "Card removed",
|
|
314
|
+
format: "icu-message",
|
|
315
|
+
messageSource: "The card was removed."
|
|
252
316
|
},
|
|
253
317
|
failureText: {
|
|
254
318
|
type: "string",
|
|
255
319
|
minLength: 1,
|
|
256
|
-
title: "Card not removed"
|
|
320
|
+
title: "Card not removed",
|
|
321
|
+
format: "icu-message",
|
|
322
|
+
messageSource: "We couldn't remove the card. Please try again."
|
|
257
323
|
},
|
|
258
324
|
sessionExpiredText: {
|
|
259
325
|
type: "string",
|
|
260
326
|
minLength: 1,
|
|
261
|
-
title: "Session expired message"
|
|
327
|
+
title: "Session expired message",
|
|
328
|
+
format: "icu-message",
|
|
329
|
+
messageSource: "Your session has expired."
|
|
262
330
|
},
|
|
263
331
|
signInLabel: {
|
|
264
332
|
type: "string",
|
|
265
333
|
minLength: 1,
|
|
266
|
-
title: "Sign-in link label"
|
|
334
|
+
title: "Sign-in link label",
|
|
335
|
+
format: "icu-message",
|
|
336
|
+
messageSource: "Sign in again"
|
|
267
337
|
}
|
|
268
338
|
}
|
|
269
339
|
}
|
|
@@ -353,7 +423,7 @@ const AccountSavedCardsRootDefinition = defineComponent({
|
|
|
353
423
|
category: "identity"
|
|
354
424
|
},
|
|
355
425
|
schema: {},
|
|
356
|
-
guideline: "The signed-in shopper's saved cards, read with no cart. Renders nothing unless the session is loggedIn, and no chrome of its own: compose AccountSavedCardsHeading, AccountSavedCardsRemoveFeedback, AccountSavedCardsLoading, AccountSavedCardsError, AccountSavedCardsEmpty, and AccountSavedCardsList (with an AccountSavedCardItem inside) as children. Exactly one of Loading, Error, Empty, or List renders at a time; the state is on data-fs-account-saved-cards-state. It owns the removal state and supplies the savedCard.remove write to every AccountSavedCardRemove inside,
|
|
426
|
+
guideline: "The signed-in shopper's saved cards, read with no cart. Renders nothing unless the session is loggedIn, and no chrome of its own: compose AccountSavedCardsHeading, AccountSavedCardsRemoveFeedback, AccountSavedCardsLoading, AccountSavedCardsError, AccountSavedCardsEmpty, and AccountSavedCardsList (with an AccountSavedCardItem inside) as children. Exactly one of Loading, Error, Empty, or List renders at a time; the state is on data-fs-account-saved-cards-state. It owns the removal state and supplies the savedCard.remove write to every AccountSavedCardRemove inside, so the write sits here rather than on the control that dispatches it; with no remove control composed the write is never called. Must be inside a SessionRoot, normally the my-account layout's. See account-saved-cards.md."
|
|
357
427
|
});
|
|
358
428
|
const AccountSavedCardsHeadingDefinition = defineComponent({
|
|
359
429
|
name: "AccountSavedCardsHeading",
|
|
@@ -376,7 +446,7 @@ const AccountSavedCardsHeadingDefinition = defineComponent({
|
|
|
376
446
|
default: "h2",
|
|
377
447
|
label: "Heading level"
|
|
378
448
|
} },
|
|
379
|
-
guideline: "The section heading, rendered in every state. `as` sets the level from h2 to h6 (default h2); there is no h1, because the page title belongs to the page shell — pick the level that fits where the section is nested, or omit the heading. Text
|
|
449
|
+
guideline: "The section heading, rendered in every state. `as` sets the level from h2 to h6 (default h2); there is no h1, because the page title belongs to the page shell — pick the level that fits where the section is nested, or omit the heading. Text is children, or else the text message. Must be inside AccountSavedCardsRoot."
|
|
380
450
|
});
|
|
381
451
|
const AccountSavedCardsListDefinition = defineComponent({
|
|
382
452
|
name: "AccountSavedCardsList",
|
|
@@ -404,7 +474,7 @@ const AccountSavedCardItemDefinition = defineComponent({
|
|
|
404
474
|
category: "identity"
|
|
405
475
|
},
|
|
406
476
|
schema: {},
|
|
407
|
-
guideline: "One saved card as a list row. It provides the card to the CardSummary parts, AccountSavedCardExpiry, and AccountSavedCardRemove.
|
|
477
|
+
guideline: "One saved card as a list row. It provides the card to the CardSummary parts, AccountSavedCardExpiry, and AccountSavedCardRemove. It renders only its children, so compose CardSummary, AccountSavedCardExpiry and AccountSavedCardRemove in it; keep AccountSavedCardExpiry in any row, and leave AccountSavedCardRemove out only for a read-only list. An expired row carries data-fs-account-saved-card-expired, an unusable one data-fs-account-saved-card-unusable, and a row whose removal is pending data-fs-account-saved-card-removing, for a swatch to dim. Never shows more than the last four digits. Must be inside AccountSavedCardsList."
|
|
408
478
|
});
|
|
409
479
|
const AccountSavedCardExpiryDefinition = defineComponent({
|
|
410
480
|
name: "AccountSavedCardExpiry",
|
|
@@ -417,7 +487,7 @@ const AccountSavedCardExpiryDefinition = defineComponent({
|
|
|
417
487
|
category: "identity"
|
|
418
488
|
},
|
|
419
489
|
schema: {},
|
|
420
|
-
guideline: "When a saved card expires: \"Expires 05/28\" for a working card, \"Expired 05/24\" (or \"Expired\" with no date) for an expired one, and \"This card can't be used\", with no date, for an unusable one. Renders nothing for a working card with no date. The label
|
|
490
|
+
guideline: "When a saved card expires: \"Expires 05/28\" for a working card, \"Expired 05/24\" (or \"Expired\" with no date) for an expired one, and \"This card can't be used\", with no date, for an unusable one. Renders nothing for a working card with no date. The label is the expiresLabel, expiredLabel, expiredText or unusableText message; the component always places the MM/YY date after it. The state is on data-fs-account-saved-card-expiry-status (usable, expired, unusable). Must be inside AccountSavedCardItem."
|
|
421
491
|
});
|
|
422
492
|
const AccountSavedCardsEmptyDefinition = defineComponent({
|
|
423
493
|
name: "AccountSavedCardsEmpty",
|
|
@@ -430,7 +500,7 @@ const AccountSavedCardsEmptyDefinition = defineComponent({
|
|
|
430
500
|
category: "identity"
|
|
431
501
|
},
|
|
432
502
|
schema: {},
|
|
433
|
-
guideline: "States that the shopper has no saved cards. Renders only once the read resolved with none — never while loading or after a failure. Text
|
|
503
|
+
guideline: "States that the shopper has no saved cards. Renders only once the read resolved with none — never while loading or after a failure. Text is children, or else the text message. Must be inside AccountSavedCardsRoot."
|
|
434
504
|
});
|
|
435
505
|
const AccountSavedCardsLoadingDefinition = defineComponent({
|
|
436
506
|
name: "AccountSavedCardsLoading",
|
|
@@ -447,7 +517,7 @@ const AccountSavedCardsLoadingDefinition = defineComponent({
|
|
|
447
517
|
default: 2,
|
|
448
518
|
label: "Placeholder rows"
|
|
449
519
|
} },
|
|
450
|
-
guideline: "Placeholder rows while the saved cards load, plus one polite live region that announces the wait (
|
|
520
|
+
guideline: "Placeholder rows while the saved cards load, plus one polite live region that announces the wait (the text message). The rows are hidden from assistive technology; style them through data-fs-account-saved-cards-loading-row. Without this part the section shows no loading look. Must be inside AccountSavedCardsRoot."
|
|
451
521
|
});
|
|
452
522
|
const AccountSavedCardsErrorDefinition = defineComponent({
|
|
453
523
|
name: "AccountSavedCardsError",
|
|
@@ -460,7 +530,7 @@ const AccountSavedCardsErrorDefinition = defineComponent({
|
|
|
460
530
|
category: "identity"
|
|
461
531
|
},
|
|
462
532
|
schema: {},
|
|
463
|
-
guideline: "An alert shown when the saved cards cannot be read. An expired session says so and links to sign-in, returning the shopper to this page; any other failure says the cards could not be loaded. The wording
|
|
533
|
+
guideline: "An alert shown when the saved cards cannot be read. An expired session says so and links to sign-in, returning the shopper to this page; any other failure says the cards could not be loaded. The wording is the sessionExpiredText, signInLabel and text messages, never from the server; children replace it for every failure and drop the link. Must be inside AccountSavedCardsRoot."
|
|
464
534
|
});
|
|
465
535
|
const AccountSavedCardRemoveDefinition = defineComponent({
|
|
466
536
|
name: "AccountSavedCardRemove",
|
|
@@ -473,7 +543,7 @@ const AccountSavedCardRemoveDefinition = defineComponent({
|
|
|
473
543
|
category: "identity"
|
|
474
544
|
},
|
|
475
545
|
schema: {},
|
|
476
|
-
guideline: "Lets the shopper remove the row's card after confirming. State-only controller: wrap one AlertDialogRoot and it becomes controlled, so never set open or onOpenChange on it. Compose AlertDialogRoot > (AccountSavedCardRemoveTrigger + AlertDialogPortal > (AlertDialogBackdrop + AlertDialogViewport > AlertDialogPopup > (AccountSavedCardRemoveTitle + AccountSavedCardRemoveDescription + AccountSavedCardRemoveCancel + AccountSavedCardRemoveConfirm))), Cancel before Confirm so the safe action takes focus. With no children it renders
|
|
546
|
+
guideline: "Lets the shopper remove the row's card after confirming. State-only controller: wrap one AlertDialogRoot and it becomes controlled, so never set open or onOpenChange on it. Compose AlertDialogRoot > (AccountSavedCardRemoveTrigger + AlertDialogPortal > (AlertDialogBackdrop + AlertDialogViewport > AlertDialogPopup > (AccountSavedCardRemoveTitle + AccountSavedCardRemoveDescription + AccountSavedCardRemoveCancel + AccountSavedCardRemoveConfirm))), Cancel before Confirm so the safe action takes focus. With no children it renders nothing. The prompt stays open while the removal runs and closes when it fails; on success the row leaves the list. AccountSavedCardsRoot supplies the savedCard.remove write, and the outcome goes unreported unless the section composes AccountSavedCardsRemoveFeedback. Must be inside AccountSavedCardItem."
|
|
477
547
|
});
|
|
478
548
|
const AccountSavedCardRemoveTriggerDefinition = defineComponent({
|
|
479
549
|
name: "AccountSavedCardRemoveTrigger",
|
|
@@ -486,7 +556,7 @@ const AccountSavedCardRemoveTriggerDefinition = defineComponent({
|
|
|
486
556
|
category: "identity"
|
|
487
557
|
},
|
|
488
558
|
schema: {},
|
|
489
|
-
guideline: "Opens the removal prompt. Its accessible name is its text followed by the card, e.g. \"Remove Visa ending in 1234\"; the card part is visually hidden. Disabled while any removal in the section is pending. Text
|
|
559
|
+
guideline: "Opens the removal prompt. Its accessible name is its text followed by the card, e.g. \"Remove Visa ending in 1234\"; the card part is visually hidden. Disabled while any removal in the section is pending. Text is children, or else the text message; the card part is the cardEndingIn message. Direct child of the AlertDialogRoot inside AccountSavedCardRemove."
|
|
490
560
|
});
|
|
491
561
|
const AccountSavedCardRemoveTitleDefinition = defineComponent({
|
|
492
562
|
name: "AccountSavedCardRemoveTitle",
|
|
@@ -499,7 +569,7 @@ const AccountSavedCardRemoveTitleDefinition = defineComponent({
|
|
|
499
569
|
category: "identity"
|
|
500
570
|
},
|
|
501
571
|
schema: {},
|
|
502
|
-
guideline: "The removal prompt's question and its accessible name. Required inside AlertDialogPopup. Text
|
|
572
|
+
guideline: "The removal prompt's question and its accessible name. Required inside AlertDialogPopup. Text is children, or else the text message. Must be inside AccountSavedCardRemove."
|
|
503
573
|
});
|
|
504
574
|
const AccountSavedCardRemoveDescriptionDefinition = defineComponent({
|
|
505
575
|
name: "AccountSavedCardRemoveDescription",
|
|
@@ -512,7 +582,7 @@ const AccountSavedCardRemoveDescriptionDefinition = defineComponent({
|
|
|
512
582
|
category: "identity"
|
|
513
583
|
},
|
|
514
584
|
schema: {},
|
|
515
|
-
guideline: "Names the card and states the consequence; screen readers announce it with the prompt. With no children it renders CardSummary
|
|
585
|
+
guideline: "Names the card and states the consequence; screen readers announce it with the prompt. With no children it renders CardSummary, which reads the cardEndingIn message of this part as its endingIn, and then the text message; children replace both, so keep a CardSummary in them for the prompt to name the card. Inside AlertDialogPopup, after AccountSavedCardRemoveTitle. Must be inside AccountSavedCardRemove."
|
|
516
586
|
});
|
|
517
587
|
const AccountSavedCardRemoveCancelDefinition = defineComponent({
|
|
518
588
|
name: "AccountSavedCardRemoveCancel",
|
|
@@ -525,7 +595,7 @@ const AccountSavedCardRemoveCancelDefinition = defineComponent({
|
|
|
525
595
|
category: "identity"
|
|
526
596
|
},
|
|
527
597
|
schema: {},
|
|
528
|
-
guideline: "Closes the removal prompt and keeps the card. Disabled while the removal runs. Place it before AccountSavedCardRemoveConfirm so it takes focus when the prompt opens. Text
|
|
598
|
+
guideline: "Closes the removal prompt and keeps the card. Disabled while the removal runs. Place it before AccountSavedCardRemoveConfirm so it takes focus when the prompt opens. Text is children, or else the text message. Must be inside AccountSavedCardRemove."
|
|
529
599
|
});
|
|
530
600
|
const AccountSavedCardRemoveConfirmDefinition = defineComponent({
|
|
531
601
|
name: "AccountSavedCardRemoveConfirm",
|
|
@@ -538,7 +608,7 @@ const AccountSavedCardRemoveConfirmDefinition = defineComponent({
|
|
|
538
608
|
category: "identity"
|
|
539
609
|
},
|
|
540
610
|
schema: {},
|
|
541
|
-
guideline: "Removes the card. It dispatches savedCard.remove through the write AccountSavedCardsRoot supplies and declares none of its own. While the removal runs it is busy and shows its pending text; one removal runs at a time in the section. Text
|
|
611
|
+
guideline: "Removes the card. It dispatches savedCard.remove through the write AccountSavedCardsRoot supplies and declares none of its own. While the removal runs it is busy and shows its pending text; one removal runs at a time in the section. Text is children, or else the text message; the pendingText message while removing. Must be inside AccountSavedCardRemove."
|
|
542
612
|
});
|
|
543
613
|
const AccountSavedCardsRemoveFeedbackDefinition = defineComponent({
|
|
544
614
|
name: "AccountSavedCardsRemoveFeedback",
|
|
@@ -551,7 +621,7 @@ const AccountSavedCardsRemoveFeedbackDefinition = defineComponent({
|
|
|
551
621
|
category: "identity"
|
|
552
622
|
},
|
|
553
623
|
schema: {},
|
|
554
|
-
guideline: "Tells the shopper how a card removal ended: a status message that takes focus when the card was removed, or an alert when it was not, with a sign-in link back to this page when the session expired. Renders in every state of the section, so the message outlives the removed row and an emptied list; it stays until the next removal starts. Without this part a removal's outcome goes unreported. The wording
|
|
624
|
+
guideline: "Tells the shopper how a card removal ended: a status message that takes focus when the card was removed, or an alert when it was not, with a sign-in link back to this page when the session expired. Renders in every state of the section, so the message outlives the removed row and an emptied list; it stays until the next removal starts. Without this part a removal's outcome goes unreported. The wording is the successText, failureText, sessionExpiredText and signInLabel messages, never the server's; the outcome is on data-fs-account-saved-cards-remove-feedback-outcome. Must be inside AccountSavedCardsRoot."
|
|
555
625
|
});
|
|
556
626
|
/**
|
|
557
627
|
* One removal at a time: each success replaces the whole cached list, so two in flight could land out
|
|
@@ -620,14 +690,14 @@ function AccountSavedCardsRoot({ $data: $dataProp, $actions: $actionsProp, class
|
|
|
620
690
|
})
|
|
621
691
|
});
|
|
622
692
|
}
|
|
623
|
-
function AccountSavedCardsHeading({ as: Tag = "h2", $content, className, children, ...props }) {
|
|
693
|
+
function AccountSavedCardsHeading({ as: Tag = "h2", $content, $locale, className, children, ...props }) {
|
|
624
694
|
useAccountSavedCards();
|
|
625
|
-
const
|
|
695
|
+
const { format } = useMessageFormatter(AccountSavedCardsHeadingContent, $content);
|
|
626
696
|
return /* @__PURE__ */ jsx(Tag, {
|
|
627
697
|
...props,
|
|
628
698
|
className,
|
|
629
699
|
"data-fs-account-saved-cards-heading": "",
|
|
630
|
-
children: children ??
|
|
700
|
+
children: children ?? format("text")
|
|
631
701
|
});
|
|
632
702
|
}
|
|
633
703
|
function AccountSavedCardsList({ className, children, ...props }) {
|
|
@@ -664,26 +734,23 @@ function AccountSavedCardItem({ $data: $dataProp, className, children, ...props
|
|
|
664
734
|
children: /* @__PURE__ */ jsx(CardSummaryRoot, {
|
|
665
735
|
network: card.network.name,
|
|
666
736
|
lastDigits: card.lastDigits,
|
|
667
|
-
children
|
|
668
|
-
/* @__PURE__ */ jsx(CardSummary, {}),
|
|
669
|
-
/* @__PURE__ */ jsx(AccountSavedCardExpiry, {}),
|
|
670
|
-
/* @__PURE__ */ jsx(AccountSavedCardRemove, {})
|
|
671
|
-
] })
|
|
737
|
+
children
|
|
672
738
|
})
|
|
673
739
|
})
|
|
674
740
|
});
|
|
675
741
|
}
|
|
676
|
-
function AccountSavedCardExpiry({ $content, className, ...props }) {
|
|
742
|
+
function AccountSavedCardExpiry({ $content, $locale, className, ...props }) {
|
|
677
743
|
const { status, expiry } = useAccountSavedCard();
|
|
678
|
-
const
|
|
744
|
+
const { format } = useMessageFormatter(AccountSavedCardExpiryContent, $content);
|
|
745
|
+
const { formatDate } = useStorefrontFormatters();
|
|
679
746
|
const state = savedCardState(status);
|
|
680
747
|
const date = state === "unusable" ? null : validExpiry(expiry);
|
|
681
748
|
if (state === "usable" && !date) return null;
|
|
682
749
|
let label;
|
|
683
|
-
if (state === "unusable") label =
|
|
684
|
-
else if (!date) label =
|
|
685
|
-
else if (state === "expired") label =
|
|
686
|
-
else label =
|
|
750
|
+
if (state === "unusable") label = format("unusableText");
|
|
751
|
+
else if (!date) label = format("expiredText");
|
|
752
|
+
else if (state === "expired") label = format("expiredLabel");
|
|
753
|
+
else label = format("expiresLabel");
|
|
687
754
|
const month = date ? String(date.month).padStart(2, "0") : "";
|
|
688
755
|
return /* @__PURE__ */ jsxs("p", {
|
|
689
756
|
...props,
|
|
@@ -705,7 +772,7 @@ function AccountSavedCardExpiry({ $content, className, ...props }) {
|
|
|
705
772
|
/* @__PURE__ */ jsx("span", {
|
|
706
773
|
"data-fs-sr-only": "",
|
|
707
774
|
className: "sr-only",
|
|
708
|
-
children:
|
|
775
|
+
children: formatDate(Date.UTC(date.year, date.month - 1, 1), {
|
|
709
776
|
month: "long",
|
|
710
777
|
year: "numeric",
|
|
711
778
|
timeZone: "UTC"
|
|
@@ -714,26 +781,25 @@ function AccountSavedCardExpiry({ $content, className, ...props }) {
|
|
|
714
781
|
] }) : null]
|
|
715
782
|
});
|
|
716
783
|
}
|
|
717
|
-
function AccountSavedCardsEmpty({ $content, className, children, ...props }) {
|
|
784
|
+
function AccountSavedCardsEmpty({ $content, $locale, className, children, ...props }) {
|
|
718
785
|
const { state } = useAccountSavedCards();
|
|
719
|
-
const
|
|
786
|
+
const { format } = useMessageFormatter(AccountSavedCardsEmptyContent, $content);
|
|
720
787
|
if (state !== "empty") return null;
|
|
721
788
|
return /* @__PURE__ */ jsx("p", {
|
|
722
789
|
...props,
|
|
723
790
|
className,
|
|
724
791
|
"data-fs-account-saved-cards-empty": "",
|
|
725
|
-
children: children ??
|
|
792
|
+
children: children ?? format("text")
|
|
726
793
|
});
|
|
727
794
|
}
|
|
728
795
|
const DEFAULT_SKELETON_COUNT = 2;
|
|
729
|
-
function AccountSavedCardsLoading({ skeletonCount = DEFAULT_SKELETON_COUNT, $content, className, ...props }) {
|
|
796
|
+
function AccountSavedCardsLoading({ skeletonCount = DEFAULT_SKELETON_COUNT, $content, $locale, className, ...props }) {
|
|
730
797
|
const { state } = useAccountSavedCards();
|
|
731
|
-
const
|
|
798
|
+
const { format } = useMessageFormatter(AccountSavedCardsLoadingContent, $content);
|
|
732
799
|
const loading = state === "loading";
|
|
733
|
-
const label = resolveAuthoredCopy($content?.text, intl.formatMessage({ id: "fs/saved-cards.loading" }));
|
|
734
800
|
const rows = Number.isFinite(skeletonCount) ? Math.max(1, Math.trunc(skeletonCount)) : DEFAULT_SKELETON_COUNT;
|
|
735
801
|
const [announcement, setAnnouncement] = useState("");
|
|
736
|
-
const pendingLabel = loading ?
|
|
802
|
+
const pendingLabel = loading ? format("text") : "";
|
|
737
803
|
useEffect(() => {
|
|
738
804
|
setAnnouncement(pendingLabel);
|
|
739
805
|
}, [pendingLabel]);
|
|
@@ -749,9 +815,9 @@ function AccountSavedCardsLoading({ skeletonCount = DEFAULT_SKELETON_COUNT, $con
|
|
|
749
815
|
children: announcement
|
|
750
816
|
})] });
|
|
751
817
|
}
|
|
752
|
-
function AccountSavedCardsError({ $content, className, children, ...props }) {
|
|
818
|
+
function AccountSavedCardsError({ $content, $locale, className, children, ...props }) {
|
|
753
819
|
const { state, errorCode } = useAccountSavedCards();
|
|
754
|
-
const
|
|
820
|
+
const { format } = useMessageFormatter(AccountSavedCardsErrorContent, $content);
|
|
755
821
|
const { path } = useStorefrontRoute();
|
|
756
822
|
if (state !== "error") return null;
|
|
757
823
|
const sessionExpired = errorCode === "UNAUTHORIZED";
|
|
@@ -762,15 +828,15 @@ function AccountSavedCardsError({ $content, className, children, ...props }) {
|
|
|
762
828
|
"data-fs-account-saved-cards-error": "",
|
|
763
829
|
"data-fs-account-saved-cards-error-code": sessionExpired ? "unauthorized" : "failed",
|
|
764
830
|
children: children ?? (sessionExpired ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
765
|
-
|
|
831
|
+
format("sessionExpiredText"),
|
|
766
832
|
" ",
|
|
767
833
|
/* @__PURE__ */ jsx(NavigationLink, {
|
|
768
834
|
href: signInTarget(path),
|
|
769
835
|
prefetch: false,
|
|
770
836
|
"data-fs-account-saved-cards-sign-in": "",
|
|
771
|
-
children:
|
|
837
|
+
children: format("signInLabel")
|
|
772
838
|
})
|
|
773
|
-
] }) :
|
|
839
|
+
] }) : format("text"))
|
|
774
840
|
});
|
|
775
841
|
}
|
|
776
842
|
function AccountSavedCardRemove({ children }) {
|
|
@@ -791,14 +857,13 @@ function AccountSavedCardRemove({ children }) {
|
|
|
791
857
|
blocked,
|
|
792
858
|
close
|
|
793
859
|
]);
|
|
794
|
-
|
|
795
|
-
if (!isValidElement(prompt)) return /* @__PURE__ */ jsx(AccountSavedCardRemoveContext, {
|
|
860
|
+
if (!isValidElement(children)) return /* @__PURE__ */ jsx(AccountSavedCardRemoveContext, {
|
|
796
861
|
value,
|
|
797
|
-
children
|
|
862
|
+
children
|
|
798
863
|
});
|
|
799
864
|
return /* @__PURE__ */ jsx(AccountSavedCardRemoveContext, {
|
|
800
865
|
value,
|
|
801
|
-
children: cloneElement(
|
|
866
|
+
children: cloneElement(children, {
|
|
802
867
|
open,
|
|
803
868
|
onOpenChange: (next) => {
|
|
804
869
|
if (next ? blocked : pending) return;
|
|
@@ -807,75 +872,65 @@ function AccountSavedCardRemove({ children }) {
|
|
|
807
872
|
})
|
|
808
873
|
});
|
|
809
874
|
}
|
|
810
|
-
function
|
|
811
|
-
return /* @__PURE__ */ jsxs(AlertDialogRoot, {
|
|
812
|
-
open,
|
|
813
|
-
onOpenChange,
|
|
814
|
-
children: [/* @__PURE__ */ jsx(AccountSavedCardRemoveTrigger, {}), /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogBackdrop, {}), /* @__PURE__ */ jsx(AlertDialogViewport, { children: /* @__PURE__ */ jsxs(AlertDialogPopup, { children: [
|
|
815
|
-
/* @__PURE__ */ jsx(AccountSavedCardRemoveTitle, {}),
|
|
816
|
-
/* @__PURE__ */ jsx(AccountSavedCardRemoveDescription, {}),
|
|
817
|
-
/* @__PURE__ */ jsx(AccountSavedCardRemoveCancel, {}),
|
|
818
|
-
/* @__PURE__ */ jsx(AccountSavedCardRemoveConfirm, {})
|
|
819
|
-
] }) })] })]
|
|
820
|
-
});
|
|
821
|
-
}
|
|
822
|
-
function AccountSavedCardRemoveTrigger({ $content, className, children, disabled, ...props }) {
|
|
875
|
+
function AccountSavedCardRemoveTrigger({ $content, $locale, className, children, disabled, ...props }) {
|
|
823
876
|
const { blocked } = useAccountSavedCardRemove();
|
|
824
877
|
const { name, lastFour } = useCardSummary();
|
|
825
|
-
const
|
|
826
|
-
const card = [name, lastFour ?
|
|
878
|
+
const { format } = useMessageFormatter(AccountSavedCardRemoveTriggerContent, $content);
|
|
879
|
+
const card = [name, lastFour ? format("cardEndingIn", { lastDigits: lastFour }) : null].filter(Boolean).join(" ");
|
|
827
880
|
return /* @__PURE__ */ jsxs(AlertDialogTrigger, {
|
|
828
881
|
...props,
|
|
829
882
|
className,
|
|
830
883
|
disabled: blocked || disabled,
|
|
831
884
|
"data-fs-account-saved-card-remove-trigger": "",
|
|
832
|
-
children: [children ??
|
|
885
|
+
children: [children ?? format("text"), card ? /* @__PURE__ */ jsxs(Fragment$1, { children: [" ", /* @__PURE__ */ jsx("span", {
|
|
833
886
|
"data-fs-sr-only": "",
|
|
834
887
|
className: "sr-only",
|
|
835
888
|
children: card
|
|
836
889
|
})] }) : null]
|
|
837
890
|
});
|
|
838
891
|
}
|
|
839
|
-
function AccountSavedCardRemoveTitle({ $content, className, children, ...props }) {
|
|
892
|
+
function AccountSavedCardRemoveTitle({ $content, $locale, className, children, ...props }) {
|
|
840
893
|
useAccountSavedCardRemove();
|
|
841
|
-
const
|
|
894
|
+
const { format } = useMessageFormatter(AccountSavedCardRemoveTitleContent, $content);
|
|
842
895
|
return /* @__PURE__ */ jsx(AlertDialogTitle, {
|
|
843
896
|
...props,
|
|
844
897
|
className,
|
|
845
898
|
"data-fs-account-saved-card-remove-title": "",
|
|
846
|
-
children: children ??
|
|
899
|
+
children: children ?? format("text")
|
|
847
900
|
});
|
|
848
901
|
}
|
|
849
|
-
function AccountSavedCardRemoveDescription({ $content, className, children, ...props }) {
|
|
902
|
+
function AccountSavedCardRemoveDescription({ $content, $locale, className, children, ...props }) {
|
|
850
903
|
useAccountSavedCardRemove();
|
|
851
|
-
const
|
|
904
|
+
const { format } = useMessageFormatter(AccountSavedCardRemoveDescriptionContent, $content);
|
|
905
|
+
const cardEndingIn = $content?.cardEndingIn;
|
|
906
|
+
const cardSummaryContent = useMemo(() => ({ endingIn: cardEndingIn }), [cardEndingIn]);
|
|
852
907
|
return /* @__PURE__ */ jsx(AlertDialogDescription, {
|
|
853
908
|
...props,
|
|
854
909
|
className,
|
|
855
910
|
"data-fs-account-saved-card-remove-description": "",
|
|
856
911
|
children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
857
|
-
/* @__PURE__ */ jsx(CardSummary, {}),
|
|
912
|
+
/* @__PURE__ */ jsx(CardSummary, { $content: cardSummaryContent }),
|
|
858
913
|
" ",
|
|
859
|
-
|
|
914
|
+
format("text")
|
|
860
915
|
] })
|
|
861
916
|
});
|
|
862
917
|
}
|
|
863
|
-
function AccountSavedCardRemoveCancel({ $content, className, children, disabled, ...props }) {
|
|
918
|
+
function AccountSavedCardRemoveCancel({ $content, $locale, className, children, disabled, ...props }) {
|
|
864
919
|
const { pending } = useAccountSavedCardRemove();
|
|
865
|
-
const
|
|
920
|
+
const { format } = useMessageFormatter(AccountSavedCardRemoveCancelContent, $content);
|
|
866
921
|
return /* @__PURE__ */ jsx(AlertDialogClose, {
|
|
867
922
|
...props,
|
|
868
923
|
className,
|
|
869
924
|
disabled: pending || disabled,
|
|
870
925
|
"data-fs-account-saved-card-remove-cancel": "",
|
|
871
|
-
children: children ??
|
|
926
|
+
children: children ?? format("text")
|
|
872
927
|
});
|
|
873
928
|
}
|
|
874
|
-
function AccountSavedCardRemoveConfirm({ $content, className, children, onClick, ...props }) {
|
|
929
|
+
function AccountSavedCardRemoveConfirm({ $content, $locale, className, children, onClick, ...props }) {
|
|
875
930
|
const { id, pending, close } = useAccountSavedCardRemove();
|
|
876
931
|
const { removal } = useAccountSavedCards();
|
|
877
932
|
const remove = useActionsOverride(void 0)?.savedCard?.remove;
|
|
878
|
-
const
|
|
933
|
+
const { format } = useMessageFormatter(AccountSavedCardRemoveConfirmContent, $content);
|
|
879
934
|
async function handleClick(event) {
|
|
880
935
|
onClick?.(event);
|
|
881
936
|
if (event.defaultPrevented || !remove || !removal.begin(id)) return;
|
|
@@ -897,7 +952,7 @@ function AccountSavedCardRemoveConfirm({ $content, className, children, onClick,
|
|
|
897
952
|
"data-fs-account-saved-card-remove-confirm": "",
|
|
898
953
|
...pending ? { "data-fs-account-saved-card-remove-confirm-pending": "" } : {},
|
|
899
954
|
onClick: handleClick,
|
|
900
|
-
children: pending ?
|
|
955
|
+
children: pending ? format("pendingText") : children ?? format("text")
|
|
901
956
|
});
|
|
902
957
|
}
|
|
903
958
|
function feedbackOutcome(outcome) {
|
|
@@ -905,19 +960,19 @@ function feedbackOutcome(outcome) {
|
|
|
905
960
|
if (outcome.kind === "removed") return "removed";
|
|
906
961
|
return outcome.code === "UNAUTHORIZED" ? "unauthorized" : "failed";
|
|
907
962
|
}
|
|
908
|
-
function AccountSavedCardsRemoveFeedback({ $content, className, ...props }) {
|
|
963
|
+
function AccountSavedCardsRemoveFeedback({ $content, $locale, className, ...props }) {
|
|
909
964
|
const { removal: { outcome } } = useAccountSavedCards();
|
|
910
|
-
const
|
|
965
|
+
const { format } = useMessageFormatter(AccountSavedCardsRemoveFeedbackContent, $content);
|
|
911
966
|
const { path } = useStorefrontRoute();
|
|
912
967
|
const statusRef = useRef(null);
|
|
913
968
|
const kind = feedbackOutcome(outcome);
|
|
914
|
-
const successText = resolveAuthoredCopy($content?.successText, intl.formatMessage({ id: "fs/saved-cards.remove.success" }));
|
|
915
969
|
const [announcement, setAnnouncement] = useState("");
|
|
970
|
+
const removed = outcome?.kind === "removed";
|
|
971
|
+
const successText = removed ? format("successText") : "";
|
|
916
972
|
useEffect(() => {
|
|
917
|
-
|
|
918
|
-
setAnnouncement(removed ? successText : "");
|
|
973
|
+
setAnnouncement(successText);
|
|
919
974
|
if (removed) statusRef.current?.focus();
|
|
920
|
-
}, [
|
|
975
|
+
}, [removed, successText]);
|
|
921
976
|
return /* @__PURE__ */ jsxs("div", {
|
|
922
977
|
...props,
|
|
923
978
|
className,
|
|
@@ -933,19 +988,19 @@ function AccountSavedCardsRemoveFeedback({ $content, className, ...props }) {
|
|
|
933
988
|
kind === "unauthorized" ? /* @__PURE__ */ jsxs("div", {
|
|
934
989
|
role: "alert",
|
|
935
990
|
children: [
|
|
936
|
-
|
|
991
|
+
format("sessionExpiredText"),
|
|
937
992
|
" ",
|
|
938
993
|
/* @__PURE__ */ jsx(NavigationLink, {
|
|
939
994
|
href: signInTarget(path),
|
|
940
995
|
prefetch: false,
|
|
941
996
|
"data-fs-account-saved-cards-remove-feedback-sign-in": "",
|
|
942
|
-
children:
|
|
997
|
+
children: format("signInLabel")
|
|
943
998
|
})
|
|
944
999
|
]
|
|
945
1000
|
}) : null,
|
|
946
1001
|
kind === "failed" ? /* @__PURE__ */ jsx("div", {
|
|
947
1002
|
role: "alert",
|
|
948
|
-
children:
|
|
1003
|
+
children: format("failureText")
|
|
949
1004
|
}) : null
|
|
950
1005
|
]
|
|
951
1006
|
});
|