@vtex/faststore 0.0.8 → 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 +101 -0
- package/README.md +0 -1
- package/dist/actions.json +48 -1
- package/dist/catalog.json +1397 -1594
- 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 +67 -56
- package/dist/components.js +64 -53
- package/dist/content-types.json +5886 -555
- package/dist/core/dist/define-component.d.ts +7 -2
- 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-entry-point.md +4 -4
- package/dist/docs/account-menu.md +16 -17
- package/dist/docs/account-saved-cards.md +306 -0
- 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 +157 -0
- package/dist/docs/buy-button.md +7 -8
- package/dist/docs/card-entry.md +42 -29
- package/dist/docs/card-summary.md +185 -0
- package/dist/docs/cardholder-document.md +5 -3
- package/dist/docs/carousel.md +5 -4
- package/dist/docs/cart-destination.md +251 -0
- package/dist/docs/cart-item.md +48 -15
- package/dist/docs/cart-totalizer.md +8 -6
- package/dist/docs/cart.md +240 -39
- 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/footer-social.md +1 -1
- package/dist/docs/form.md +54 -18
- package/dist/docs/free-shipping-progress.md +18 -13
- package/dist/docs/identity-edit.md +8 -2
- package/dist/docs/identity-summary.md +18 -5
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/installments.md +46 -32
- package/dist/docs/logo.md +1 -1
- 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 +32 -6
- package/dist/docs/payment-methods.md +2 -2
- 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 +14 -10
- package/dist/docs/product-list.md +7 -6
- package/dist/docs/product-shelf.md +7 -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/select.md +3 -4
- 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 +5 -3
- package/dist/docs/sign-in.md +173 -0
- package/dist/docs/toast.md +45 -16
- package/dist/docs/variant-selector.md +15 -11
- package/dist/graphql/types.d.ts +4 -14
- package/dist/index.d.ts +3 -2
- package/dist/internal/client.d.ts +4 -3
- package/dist/internal/client.js +5 -2
- package/dist/internal/server.d.ts +10 -5
- package/dist/internal/server.js +9 -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 +463 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js +1011 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
- 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 +11 -1
- package/dist/matter/cart/cart-namespace.js +11 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +416 -45
- package/dist/matter/cart/cart.js +782 -101
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +233 -0
- package/dist/matter/cart-destination/cart-destination.js +703 -0
- package/dist/matter/cart-destination/cart-destination.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +145 -16
- package/dist/matter/cart-item/cart-item.js +230 -54
- 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 +49 -19
- 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 +85 -10
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +153 -53
- 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 +8 -3
- package/dist/matter/product-shelf/product-shelf.js +111 -10
- 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 +251 -25
- package/dist/matter/shipping-simulator/shipping-simulator.js +261 -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 +59 -0
- package/dist/particles/binding-switcher/binding-switcher.js +194 -0
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
- package/dist/particles/card-summary/card-network.d.ts +17 -0
- package/dist/particles/card-summary/card-network.js +25 -0
- package/dist/particles/card-summary/card-network.js.map +1 -0
- package/dist/particles/card-summary/card-summary.d.ts +113 -0
- package/dist/particles/card-summary/card-summary.js +221 -0
- package/dist/particles/card-summary/card-summary.js.map +1 -0
- 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/footer-social/footer-social.d.ts +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/footer-social/footer-social.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/incentives/incentives.d.ts +1 -1
- package/dist/particles/incentives/incentives.js +1 -1
- package/dist/particles/incentives/incentives.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/payment-methods/payment-methods.d.ts +1 -1
- package/dist/particles/payment-methods/payment-methods.js +1 -1
- package/dist/particles/payment-methods/payment-methods.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 +49 -9
- package/dist/particles/toast/toast.js +81 -15
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +461 -89
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
- package/dist/sdk/actions/locale-action-provider.js +20 -0
- package/dist/sdk/actions/locale-action-provider.js.map +1 -0
- package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
- package/dist/sdk/actions/saved-card-action-provider.js +16 -0
- package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- 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/cache/storefront-cache.js +2 -1
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +2 -1
- package/dist/sdk/cart/operations.js +55 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.d.ts +30 -7
- package/dist/sdk/cart/optimistic.js +78 -41
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
- package/dist/sdk/cart/use-cart-actions.js +61 -15
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
- package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
- 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 +16 -12
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +197 -51
- package/dist/sdk/generated/graphql.js +2318 -91
- 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/locale/binding-switch-provider.d.ts +13 -0
- package/dist/sdk/locale/binding-switch-provider.js +20 -0
- package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
- package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
- package/dist/sdk/locale/use-locale-actions.js +70 -0
- package/dist/sdk/locale/use-locale-actions.js.map +1 -0
- package/dist/sdk/navigation/binding-switch.d.ts +39 -0
- package/dist/sdk/navigation/binding-switch.js +129 -0
- package/dist/sdk/navigation/binding-switch.js.map +1 -0
- package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
- package/dist/sdk/navigation/decode-route-params.js +32 -0
- package/dist/sdk/navigation/decode-route-params.js.map +1 -0
- 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/saved-cards/operations.d.ts +16 -0
- package/dist/sdk/saved-cards/operations.js +41 -0
- package/dist/sdk/saved-cards/operations.js.map +1 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
- 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 +8 -5
- package/dist/sdk/seo/page-alternates.js +11 -14
- 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/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js +13 -0
- package/dist/sdk/shipping/shipping-operations.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/sdk/state/cart.d.ts +9 -2
- package/dist/sdk/state/cart.js +9 -2
- package/dist/sdk/state/cart.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 +9 -2
- 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 -164
- package/dist/sdk/i18n/messages/en-US.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.json +0 -159
- package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -163
- package/dist/sdk/i18n/messages/es-ES.js +0 -164
- package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
- package/dist/sdk/i18n/messages/es-ES.json +0 -159
- package/dist/sdk/i18n/messages/pt-BR.js +0 -164
- package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
- package/dist/sdk/i18n/messages/pt-BR.json +0 -159
- 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
package/dist/docs/carousel.md
CHANGED
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
| `variant` | `'slide' \| 'scroll'` | `'slide'` | Transform slide vs. native overflow scroll |
|
|
36
36
|
| `itemsPerPage` | number | `1` | How many children are visible per page |
|
|
37
37
|
| `defaultPage` | number | `0` | Page selected on first render |
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
The region's `aria-label` comes from the `$content` field `label` (content type `carousel-root`).
|
|
39
40
|
|
|
40
41
|
### CarouselTrack
|
|
41
42
|
|
|
@@ -43,16 +44,16 @@ Lays out and counts the children. No props beyond standard `div` attributes. Pla
|
|
|
43
44
|
|
|
44
45
|
### CarouselPrevious / CarouselNext
|
|
45
46
|
|
|
46
|
-
Buttons that move one page. No props beyond standard `button` attributes; accept any children (Icon, text). Disabled at the respective end when `infiniteMode` is off.
|
|
47
|
+
Buttons that move one page. No props beyond standard `button` attributes; accept any children (Icon, text). Disabled at the respective end when `infiniteMode` is off. Their `aria-label` comes from the `$content` field `label` (content types `carousel-previous` and `carousel-next`).
|
|
47
48
|
|
|
48
49
|
### CarouselBullets
|
|
49
50
|
|
|
50
51
|
| Prop | Type | Default | Notes |
|
|
51
52
|
|------|------|---------|-------|
|
|
52
|
-
| `ariaLabel` | string | `'Choose page'` | Label for the bullets group |
|
|
53
|
-
| `bulletLabel` | string | `'Go to page {page}'` | Per-bullet label; `{page}` is the 1-based page number |
|
|
54
53
|
| `hideWhenSingle` | boolean | `true` | Render nothing when there is a single page |
|
|
55
54
|
|
|
55
|
+
The labels come from `$content` (content type `carousel-bullets`): `ariaLabel` names the bullets group, and `bulletLabel` names each bullet, an ICU message whose `{page}` argument is the 1-based page number.
|
|
56
|
+
|
|
56
57
|
Bullets support `ArrowLeft` / `ArrowRight` / `Home` / `End` keyboard navigation and mark the active page with `data-fs-carousel-bullet-selected="true"` and `aria-current`.
|
|
57
58
|
|
|
58
59
|
---
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# CartDestination
|
|
2
|
+
|
|
3
|
+
**Category:** content
|
|
4
|
+
**Purpose:** The Cart page's delivery location. `CartDestinationRoot` reads where the cart is delivered and writes a new destination from a postal code alone, so the free-shipping bar beside it follows. It has two modes: read ("Entregando em 01310-100 · São Paulo, SP" plus a change link) and edit (a postal code field with "Atualizar" and "Cancelar").
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Visual cues (how to identify in an image)
|
|
9
|
+
|
|
10
|
+
Look in the **top of the cart page's main column**, above the free-shipping bar and the line items:
|
|
11
|
+
|
|
12
|
+
- A single line reading **"Entregando em"** (or "Delivering to") followed by a **postal code and city, state**, beside a link such as **"Trocar localização?"**.
|
|
13
|
+
- With no destination yet, the bar shows just a prompt such as **"Informe seu CEP"**, often with a pin icon. Pressing it opens the field.
|
|
14
|
+
- Pressing the link (or the prompt) swaps the line for **one postal code field**, an **"Atualizar"** button and a **"Cancelar"** button.
|
|
15
|
+
|
|
16
|
+
The image is the source of truth for layout.
|
|
17
|
+
|
|
18
|
+
A postal code control in the **site header** is not this component: that is `RegionRoot`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## When to use
|
|
23
|
+
|
|
24
|
+
- On the **Cart page**, once, where the design shows where the cart is delivered and lets the shopper change it.
|
|
25
|
+
|
|
26
|
+
## When NOT to use
|
|
27
|
+
|
|
28
|
+
- **In the header** — that is `Region`, which only sets a cookie and never touches the cart.
|
|
29
|
+
- **For the full delivery address on checkout** — that is `ShippingAddressFieldset`.
|
|
30
|
+
- **For a shipping-cost quote on a product page or in the cart drawer** — that is `ShippingSimulator`; it quotes and writes nothing.
|
|
31
|
+
- More than once per page: two roots mean two drafts over the same destination.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Composition
|
|
36
|
+
|
|
37
|
+
`CartDestinationRoot` provides the `'cartDestination'` context; every other part declares `requiresContext: 'cartDestination'`.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
CartDestinationRoot (provides 'cartDestination'; starts in read mode)
|
|
41
|
+
├── CartDestinationRead (read mode only)
|
|
42
|
+
│ ├── CartDestinationValue (the destination, once set)
|
|
43
|
+
│ ├── CartDestinationUnset (button: the invitation, while none is set; opens edit mode)
|
|
44
|
+
│ │ ├── Icon (optional pin)
|
|
45
|
+
│ │ └── Text ("Informe seu CEP")
|
|
46
|
+
│ └── CartDestinationChange (opens edit mode)
|
|
47
|
+
└── CartDestinationForm (edit mode only)
|
|
48
|
+
├── CartDestinationPostalCodeControl
|
|
49
|
+
├── CartDestinationSubmit
|
|
50
|
+
├── CartDestinationCancel
|
|
51
|
+
└── CartDestinationError
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Child order reflects visual order. The store cannot open edit mode from outside: the mode is local to the root, and the destination shown always comes from the cart, never from what was typed.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Components
|
|
59
|
+
|
|
60
|
+
### CartDestinationRoot
|
|
61
|
+
|
|
62
|
+
Reads the cart destination reactively and broadcasts it, the edit-mode flag, the draft and the write state. Starts in read mode, also with no destination.
|
|
63
|
+
|
|
64
|
+
**Data:** declares `fragment CartDestinationData on Query` (`shipping { id address { postalCode country city state } }`) with `fetchStrategy: 'reactive'`. It selects no name and no street.
|
|
65
|
+
|
|
66
|
+
**Write:** declares `actions: { shipping: ['setAddress'] }`. A submit sends `{ postalCode, country }` and nothing else; the cart keeps its recipient name. The response updates the destination and the free-shipping bar through the cache.
|
|
67
|
+
|
|
68
|
+
| Prop | Type | Default | Notes |
|
|
69
|
+
|------|------|---------|-------|
|
|
70
|
+
| `defaultCountry` | string | `"BRA"` | Used while the cart has no address; the address country wins |
|
|
71
|
+
|
|
72
|
+
### CartDestinationRead
|
|
73
|
+
|
|
74
|
+
Renders its children only in read mode. No props.
|
|
75
|
+
|
|
76
|
+
### CartDestinationValue
|
|
77
|
+
|
|
78
|
+
The destination as prefix, postal code, city and state, each in its own element. Renders nothing while loading or when none is set.
|
|
79
|
+
|
|
80
|
+
| Prop | Type | Default | Notes |
|
|
81
|
+
|------|------|---------|-------|
|
|
82
|
+
| `prefix` | string | — | For example `"Entregando em"`; authored content wins |
|
|
83
|
+
|
|
84
|
+
**Content model** (`cart-destination-value`): `prefix`.
|
|
85
|
+
|
|
86
|
+
### CartDestinationUnset
|
|
87
|
+
|
|
88
|
+
A button that opens edit mode, with `aria-expanded` tied to the mode, exactly like `CartDestinationChange`. It renders only once the destination resolved and none is set. Its children are the invitation content (a `Text`, an `Icon`). Place it within `CartDestinationRead`. Its props are the props of a button; a consumer `onClick` runs before edit mode opens. When edit mode closes with no destination set, focus returns to this button. It ships no style of its own: like the change link, the store gives it a pointer cursor and an underline so it reads as clickable.
|
|
89
|
+
|
|
90
|
+
### CartDestinationChange
|
|
91
|
+
|
|
92
|
+
Button that opens edit mode, with `aria-expanded` tied to the mode. Styled as a link by the store.
|
|
93
|
+
|
|
94
|
+
| Prop | Type | Default | Notes |
|
|
95
|
+
|------|------|---------|-------|
|
|
96
|
+
| `label` | string | — | For example `"Trocar localização?"`; authored content wins |
|
|
97
|
+
|
|
98
|
+
**Content model** (`cart-destination-change`): `label`.
|
|
99
|
+
|
|
100
|
+
### CartDestinationForm
|
|
101
|
+
|
|
102
|
+
Renders only in edit mode. Enter in the field runs the submit, which flags an incomplete or unchanged draft instead of sending it. Opening it focuses the field; leaving it focuses `CartDestinationChange`.
|
|
103
|
+
|
|
104
|
+
### CartDestinationPostalCodeControl
|
|
105
|
+
|
|
106
|
+
A plain text field bound to the draft, empty every time edit mode opens. Its limits (`maxLength`, `inputMode`) and its placeholder, the country's example postal code (`01310-100` for BRA), come from the postal code rules of the cart's country (`@vtex/country-forms`), which load when edit mode opens. There is no input mask: the shopper types the code as they know it, and Submit validates it against the country's rules.
|
|
107
|
+
|
|
108
|
+
While the rules load, the field and `CartDestinationSubmit` are disabled, and the field takes focus once it is enabled. If the load fails, the field is enabled as free text and nothing validates it. A country the rules do not cover (anything but ARG, BRA, CAN, CHL, COL, DEU, ECU, ESP, FRA, GBR, IRL, ITA, MEX, PER and USA) is free text too: no mask, no limit and no validation beyond a non-blank value.
|
|
109
|
+
|
|
110
|
+
The component keeps no mask table and does not read the shared country descriptors that `BillingAddress` and `ShippingAddress` use, so a Canadian or Mexican cart address is judged by the library's own rules for those countries and never by the Brazilian `99999-999` mask. For `CAN` the field takes at most 7 characters, shows the example `K1A 0A9`, accepts `k1a0b1` and writes it as `K1A 0B1`; the library refuses a first letter of D, F, I, O, Q, U or W and is looser than Canada Post elsewhere (`Z1A 0A9` passes). For `MEX` the field takes at most 5 characters on a numeric keyboard and refuses `00999` and `6600`; there is no mask. No case in `cart-destination.test.tsx` uses `CAN` or `MEX`: the behaviour comes from the same `@vtex/country-forms` rules and `sdk/address` functions the billing and shipping suites pin for those countries.
|
|
111
|
+
|
|
112
|
+
Because the rules come from the library, the cart can disagree with the other two forms where their descriptor patterns differ from the library. A US ZIP+4 typed without the hyphen (`021011234`) is refused here (`cart-destination.test.tsx` pins it) and accepted by billing and shipping.
|
|
113
|
+
|
|
114
|
+
| Prop | Type | Default | Notes |
|
|
115
|
+
|------|------|---------|-------|
|
|
116
|
+
| `label` | string | — | Field label |
|
|
117
|
+
| `placeholder` | string | the country's example postal code | Field placeholder; wins over the example the rules give |
|
|
118
|
+
| `invalidMessage` | string | — | Shown for a typed code the country's rules refuse, once the field loses focus or Submit is attempted |
|
|
119
|
+
|
|
120
|
+
### CartDestinationSubmit
|
|
121
|
+
|
|
122
|
+
Writes the typed postal code. Disabled until the country's rules have loaded, the draft passes the country's postal code validation (any non-blank text when the rules failed to load or the country is not covered) and differs from the current postal code, and while a write is pending (`aria-busy`). The write sends the code in the country's own form (`04538132` becomes `04538-132`). A pending write also waits for any cart line write in flight.
|
|
123
|
+
|
|
124
|
+
| Prop | Type | Default | Notes |
|
|
125
|
+
|------|------|---------|-------|
|
|
126
|
+
| `label` | string | — | For example `"Atualizar"` |
|
|
127
|
+
| `pendingLabel` | string | — | Shown while the write is in flight |
|
|
128
|
+
|
|
129
|
+
**Content model** (`cart-destination-submit`): `label`, `pendingLabel`.
|
|
130
|
+
|
|
131
|
+
### CartDestinationCancel
|
|
132
|
+
|
|
133
|
+
Closes edit mode, discards the draft and any error, and writes nothing. Disabled while a write is pending.
|
|
134
|
+
|
|
135
|
+
| Prop | Type | Default | Notes |
|
|
136
|
+
|------|------|---------|-------|
|
|
137
|
+
| `label` | string | — | For example `"Cancelar"` |
|
|
138
|
+
|
|
139
|
+
**Content model** (`cart-destination-cancel`): `label`.
|
|
140
|
+
|
|
141
|
+
### CartDestinationError
|
|
142
|
+
|
|
143
|
+
An alert announcing a failed write; renders nothing otherwise. It words the error's `code` from its own content and never shows the server's text. A code it does not know (a newer server) shows `genericMessage` and logs `message.unknown-code`.
|
|
144
|
+
|
|
145
|
+
| Code | Message field |
|
|
146
|
+
|------|---------------|
|
|
147
|
+
| `INVALID_POSTAL_CODE` | `invalidPostalCodeMessage` |
|
|
148
|
+
| `NETWORK_ERROR` and every other `ShippingAddressUpdateErrorCode` | `genericMessage` |
|
|
149
|
+
|
|
150
|
+
A postal code the platform refuses upstream reaches the client as `NETWORK_ERROR` today, so write `genericMessage` to cover it.
|
|
151
|
+
|
|
152
|
+
**Content model** (`cart-destination-error`): `genericMessage`, `invalidPostalCodeMessage` (messages, no arguments).
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Canonical schema example
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"cart-destination": {
|
|
161
|
+
"type": "CartDestinationRoot",
|
|
162
|
+
"style": ["flex", "flex-col", "gap-2", "text-sm"],
|
|
163
|
+
"children": ["cart-destination-read", "cart-destination-form"]
|
|
164
|
+
},
|
|
165
|
+
"cart-destination-read": {
|
|
166
|
+
"type": "CartDestinationRead",
|
|
167
|
+
"style": ["flex", "items-center", "gap-2"],
|
|
168
|
+
"children": ["cart-destination-value", "cart-destination-unset", "cart-destination-change"]
|
|
169
|
+
},
|
|
170
|
+
"cart-destination-value": { "type": "CartDestinationValue", "props": { "prefix": "Entregando em" }, "style": ["flex", "gap-1"] },
|
|
171
|
+
"cart-destination-unset": {
|
|
172
|
+
"type": "CartDestinationUnset",
|
|
173
|
+
"style": ["flex", "items-center", "gap-1", "cursor-pointer", "underline"],
|
|
174
|
+
"children": ["cart-destination-unset-icon", "cart-destination-invitation"]
|
|
175
|
+
},
|
|
176
|
+
"cart-destination-unset-icon": { "type": "Icon", "props": { "name": "map-pin" } },
|
|
177
|
+
"cart-destination-invitation": { "type": "Text", "props": { "as": "span", "children": "Informe seu CEP" } },
|
|
178
|
+
"cart-destination-change": {
|
|
179
|
+
"type": "CartDestinationChange",
|
|
180
|
+
"props": { "label": "Trocar localização?" },
|
|
181
|
+
"style": ["text-[#2563eb]", "font-medium", "cursor-pointer"]
|
|
182
|
+
},
|
|
183
|
+
"cart-destination-form": {
|
|
184
|
+
"type": "CartDestinationForm",
|
|
185
|
+
"style": ["flex", "flex-col", "gap-2"],
|
|
186
|
+
"children": [
|
|
187
|
+
"cart-destination-control",
|
|
188
|
+
"cart-destination-submit",
|
|
189
|
+
"cart-destination-cancel",
|
|
190
|
+
"cart-destination-error"
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
"cart-destination-control": { "type": "CartDestinationPostalCodeControl", "props": { "label": "CEP" } },
|
|
194
|
+
"cart-destination-submit": { "type": "CartDestinationSubmit", "props": { "label": "Atualizar", "pendingLabel": "Atualizando…" } },
|
|
195
|
+
"cart-destination-cancel": { "type": "CartDestinationCancel", "props": { "label": "Cancelar" } },
|
|
196
|
+
"cart-destination-error": {
|
|
197
|
+
"type": "CartDestinationError",
|
|
198
|
+
"props": {
|
|
199
|
+
"genericMessage": "Não foi possível usar esse CEP. Confira o número e tente de novo.",
|
|
200
|
+
"invalidPostalCodeMessage": "CEP inválido. Confira o número e tente de novo."
|
|
201
|
+
},
|
|
202
|
+
"style": ["text-sm", "text-red-700"]
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Styling hooks
|
|
210
|
+
|
|
211
|
+
| Attribute | On | Present when |
|
|
212
|
+
|---|---|---|
|
|
213
|
+
| `data-fs-cart-destination` | `CartDestinationRoot` | Always |
|
|
214
|
+
| `data-fs-cart-destination-editing` | `CartDestinationRoot` | Edit mode is open |
|
|
215
|
+
| `data-fs-cart-destination-pending` | `CartDestinationRoot` | A write is in flight |
|
|
216
|
+
| `data-fs-cart-destination-read` | `CartDestinationRead` | Read mode |
|
|
217
|
+
| `data-fs-cart-destination-value` | `CartDestinationValue` | A destination is set |
|
|
218
|
+
| `data-fs-cart-destination-value-prefix`, `-postal-code`, `-city`, `-state` | The piece's element | The piece exists |
|
|
219
|
+
| `data-fs-cart-destination-unset` | `CartDestinationUnset` (a button) | No destination is set |
|
|
220
|
+
| `data-fs-cart-destination-change` | `CartDestinationChange` | Always |
|
|
221
|
+
| `data-fs-cart-destination-form` | `CartDestinationForm` | Edit mode |
|
|
222
|
+
| `data-fs-cart-destination-postal-code-control` | `CartDestinationPostalCodeControl` | Always |
|
|
223
|
+
| `data-fs-cart-destination-submit`, `-submit-pending` | `CartDestinationSubmit` | Always, and while a write is in flight |
|
|
224
|
+
| `data-fs-cart-destination-cancel` | `CartDestinationCancel` | Always |
|
|
225
|
+
| `data-fs-cart-destination-error` | `CartDestinationError` | The latest write failed |
|
|
226
|
+
|
|
227
|
+
No part ships CSS of its own. Spacing, the link look of the change control and the two modes' boxes are swatch decisions; use `data-fs-cart-destination-editing` to style them apart.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Common mistakes
|
|
232
|
+
|
|
233
|
+
- **Inventing `CartDestination` (without `Root`).** The provider is `CartDestinationRoot`.
|
|
234
|
+
- **Using `RegionRoot` on the cart page.** `Region` only sets the header cookie; it never changes the cart destination, so the free-shipping bar never moves.
|
|
235
|
+
- **Placing `CartDestinationValue` or `CartDestinationChange` outside `CartDestinationRead`.** They stay on screen while the form is open.
|
|
236
|
+
- **Placing the postal code control, `CartDestinationSubmit` or `CartDestinationCancel` outside `CartDestinationForm`.** Only the form is bound to edit mode: outside it they render in read mode too, and Enter in the field no longer reaches the submit.
|
|
237
|
+
- **Looking for an `open` prop or a controller.** The root owns edit mode; nothing outside it can open it.
|
|
238
|
+
- **Omitting `CartDestinationUnset`.** With no destination the page then shows only the change link and no invitation.
|
|
239
|
+
- **Leaving `CartDestinationUnset` unstyled.** It is a button with no style of its own, so without a pointer cursor and an underline the invitation does not read as clickable. Give it the same look as `CartDestinationChange`.
|
|
240
|
+
- **Placing `CartDestinationChange` inside `CartDestinationUnset`.** The invitation is already a button, and a button cannot hold another. With no destination the regular change link repeats the invitation, so the store usually hides it while unset (for example with a `[&:has([data-fs-cart-destination-unset])>[data-fs-cart-destination-change]]:hidden` rule on `CartDestinationRead`).
|
|
241
|
+
- **Expecting the Value to show what the shopper just typed.** It shows what the cart confirms.
|
|
242
|
+
- **Passing a `mask` to the postal code control.** There is none: the field is plain text and the country's rules validate it.
|
|
243
|
+
- **Authoring only `invalidPostalCodeMessage` for "CEP não encontrado".** A postal code the platform refuses upstream reaches the client as a network failure today, so `genericMessage` must cover it too.
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Related
|
|
248
|
+
|
|
249
|
+
- [[../free-shipping-progress/free-shipping-progress]] — the bar beside this component; it follows the destination write through the cache with no wiring.
|
|
250
|
+
- [[../region/region]] — the header's region control; it keeps the masked postal code field and sets a cookie, with no cart write.
|
|
251
|
+
- [[../shipping-address/shipping-address]] — the full delivery address on checkout, which this component's write shares with.
|
package/dist/docs/cart-item.md
CHANGED
|
@@ -15,10 +15,11 @@ A **cart line** — a repeated row in a cart or mini-cart list: a product thumbn
|
|
|
15
15
|
|
|
16
16
|
## Composition
|
|
17
17
|
|
|
18
|
-
**`CartItemRoot` wraps the line-item template inside `CartList`.** The nesting is always:
|
|
18
|
+
**`CartItemRoot` wraps the line-item template inside `CartList`, `CartAvailableItems` or `CartUnavailableItems`.** The nesting is always:
|
|
19
19
|
|
|
20
20
|
```text
|
|
21
|
-
CartList (iterator — renders its children once per cart line
|
|
21
|
+
CartList (iterator — renders its children once per cart line; CartAvailableItems and
|
|
22
|
+
CartUnavailableItems iterate the purchasable and the unavailable lines the same way)
|
|
22
23
|
└─ CartItemRoot (per-line data provider — owns the core slice)
|
|
23
24
|
├─ CartItemImage (optionally wrapped in CartItemProductLink; see below)
|
|
24
25
|
├─ CartItemName
|
|
@@ -37,7 +38,16 @@ CartList (iterator — renders its children once per cart line)
|
|
|
37
38
|
```
|
|
38
39
|
|
|
39
40
|
- **`CartItemRoot` is required.** Every `CartItem*` core particle reads its data from the nearest `CartItemRoot` (build-time `requiresContext: 'cart-item-data'`). Placing a core particle directly inside `CartList` with no `CartItemRoot` between them is a build error. When authoring a cart or mini-cart line template, always insert a `CartItemRoot` between the `CartList` and the row's particles — it carries no visible styling of its own, so put the row layout classes on it (or on a `Container` inside it).
|
|
40
|
-
- **`CartItemRoot` must be inside `CartList`.** It requires the `cart-item` iteration context that
|
|
41
|
+
- **`CartItemRoot` must be inside `CartList`, `CartAvailableItems` or `CartUnavailableItems`.** It requires the `cart-item` iteration context that each of the three provides.
|
|
42
|
+
|
|
43
|
+
## Image placeholder
|
|
44
|
+
|
|
45
|
+
`CartItemImage` renders the `<img>` while the line has a usable image. It renders a placeholder `span` in the same slot when:
|
|
46
|
+
|
|
47
|
+
- the line has no image, or its URL is blank; or
|
|
48
|
+
- the image fails to load, including a failure that happened before hydration (an image already settled with no pixels at mount is treated as failed).
|
|
49
|
+
|
|
50
|
+
The placeholder carries `data-fs-cart-item-image` and `data-fs-cart-item-image-broken`, and not `data-fs-image` because it is not an image element. It takes the image's `className` and `style`, so the slot keeps its size. It is hidden from assistive technology (`aria-hidden`, no role or name), so only a loaded image is announced. It has no built-in look: style it with a swatch keyed on the hook, for example `data-[fs-cart-item-image-broken]:bg-gray-100`. The placeholder keeps the image's display (`inline-block`, set inline) so the sizing classes keep working with no extra utility; a swatch overrides it only with an important utility, and the look stays the swatch's. A failure is remembered only for the URL that failed, so a line whose URL changes tries the new one. A consumer `onError` still runs when the browser delivers the `error` event; a failure found at mount is not reported through it. A `ref` reaches the `<img>` only.
|
|
41
51
|
|
|
42
52
|
## PDP link composition
|
|
43
53
|
|
|
@@ -46,18 +56,18 @@ CartList (iterator — renders its children once per cart line)
|
|
|
46
56
|
```text
|
|
47
57
|
CartItemRoot
|
|
48
58
|
└─ CartItemProductLink (anchor to this line's product page)
|
|
49
|
-
└─ CartItemImage (
|
|
59
|
+
└─ CartItemImage (the link names itself with aria-label; see below)
|
|
50
60
|
```
|
|
51
61
|
|
|
52
|
-
**Placing it is the switch.** There is no prop to turn the link on or off: a mini-cart line composes it, a checkout line omits it. That is why `CartItemImage` on its own
|
|
62
|
+
**Placing it is the switch.** There is no prop to turn the link on or off: a mini-cart line composes it, a checkout line omits it. That is why `CartItemImage` on its own renders the `<img>` (or, with no usable image, the placeholder described below) and never an anchor.
|
|
53
63
|
|
|
54
|
-
**It names itself
|
|
64
|
+
**It names itself.** The link sets `aria-label` to the image's alt text (`image.altText ?? variant.name`, trimmed), so it keeps that name when the wrapped image is replaced by the hidden placeholder (a load error, or a blank URL). A loaded image gives the same name as before. An `aria-label` passed to the link wins over it. On a line whose `variant.image` is `null`, or whose name is blank, the leaf still renders its children unwrapped instead of wrapping nothing, because an anchor with no accessible name is a keyboard focus stop.
|
|
55
65
|
|
|
56
66
|
**No usable product URL, no link.** The leaf runs `detailUrl` through `resolveSafeHref`, the same allowlist the navigation particle applies to CMS-authored destinations, and renders its children unwrapped when the destination is blank or refused: `javascript:`, `data:`, protocol-relative, or malformed. A safe `detailUrl` is a logical path: `NavigationLink` prefixes it for the current binding. The particle gates only `$content.href`, so a platform URL arriving on the `href` prop is this leaf's to validate. Either way the image still shows: the leaf never self-hides, unlike the data-bearing leaves below, because hiding a wrapper would take its content with it. A refusal logs its reason and never the value and still renders the children unwrapped; a blank URL is ordinary and stays quiet.
|
|
57
67
|
|
|
58
68
|
Navigation is client-side through the `NavigationLink` particle, which also owns `rel` hardening. The link is same-tab, and `target` is omitted from the props type rather than merely left out of the schema, because an image-only link cannot carry the "(opens in new tab)" cue a `_blank` destination needs.
|
|
59
69
|
|
|
60
|
-
**Known gap:** a mini-cart drawer does **not** dismiss itself when a client-side navigation leaves it, so the overlay stays open over the product page.
|
|
70
|
+
**Known gap:** a mini-cart drawer does **not** dismiss itself when a client-side navigation leaves it, so the overlay stays open over the product page. The product link behaves that way, and it belongs to the drawer composition, not to a line leaf. `CartGoCheckout` closes the drawer itself when it leaves for the checkout.
|
|
61
71
|
|
|
62
72
|
Renders `a[data-fs-cart-item-product-link]`, which also carries the particle's `data-fs-navigation-link`.
|
|
63
73
|
|
|
@@ -72,10 +82,19 @@ CartItemRoot
|
|
|
72
82
|
└─ CartItemRemove (removes this line from within its alert)
|
|
73
83
|
```
|
|
74
84
|
|
|
75
|
-
**Label-vs-children nuance:** passing children to `CartItemUnavailable` **replaces** its
|
|
85
|
+
**Label-vs-children nuance:** passing children to `CartItemUnavailable` **replaces** its state label, which is one `$content` message per state (`outOfStockLabel` for `OUT_OF_STOCK`, `cannotBeDeliveredLabel` for `UNAVAILABLE`, `unavailableLabel` for any other state; content type `cart-item-unavailable`), formatted only when no children are given. A remove-on-alert composition therefore renders the label as an explicit child (e.g. a `Text`) next to the `CartItemRemove`; nesting the remove control alone leaves the alert without a label. The whole subtree is availability-gated: when the line is `AVAILABLE`, neither the label nor the nested remove control renders.
|
|
76
86
|
|
|
77
87
|
For the cart-level counterparts (the "N items unavailable" summary and the bulk "remove all unavailable" button), see `cart.md` — Unavailable-item recovery.
|
|
78
88
|
|
|
89
|
+
## Removal feedback
|
|
90
|
+
|
|
91
|
+
`CartItemRemove` awaits the removal and tells the shopper when it went through:
|
|
92
|
+
|
|
93
|
+
- **Disabled while pending.** The button carries the native `disabled` attribute from the click until `removeItem` settles, so a second click sends no second request. A caller-passed `disabled` is kept.
|
|
94
|
+
- **Toast on a clean result only.** When `removeItem` resolves with an empty `userErrors` list, the button raises one `success` toast titled by the `removedMessage` message (content type `cart-item-remove`). A non-empty list, a missing `removeItem`, or a rejection raises no toast; failures keep surfacing through `CartError`.
|
|
95
|
+
- **`removedMessage`** is a `$content` field, not a prop. The toast carries the title alone: no description, no action.
|
|
96
|
+
- **Needs a `ToastProvider`.** The toast shows through the layout's `ToastList`. Without a `ToastProvider` above the line, no toast shows and the removal still works.
|
|
97
|
+
|
|
79
98
|
## Gift lines
|
|
80
99
|
|
|
81
100
|
A promotion can add a line the shopper never chose. `CartItem.gift` marks it, and three things follow from that one flag — none of them requiring a different template, because `CartList` renders the same children for every row:
|
|
@@ -83,17 +102,29 @@ A promotion can add a line the shopper never chose. `CartItem.gift` marks it, an
|
|
|
83
102
|
```text
|
|
84
103
|
CartItemRoot (row carries data-fs-cart-item-gift-line on a gift line)
|
|
85
104
|
├─ CartItemListPrice (renders: a gift's sellingPrice is 0, so listPrice > sellingPrice)
|
|
86
|
-
├─ CartItemGift (renders
|
|
105
|
+
├─ CartItemGift (renders its label message)
|
|
87
106
|
└─ CartItemRemove (renders nothing)
|
|
88
107
|
```
|
|
89
108
|
|
|
90
|
-
- **`CartItemGift`** is the free marker: a `span[data-fs-cart-item-gift][data-fs-text]` that renders **only** on a gift line, with the
|
|
109
|
+
- **`CartItemGift`** is the free marker: a `span[data-fs-cart-item-gift][data-fs-text]` that renders **only** on a gift line, with the `label` message (content type `cart-item-gift`). Passing children **replaces** the label, which is then not formatted, the same nuance `CartItemUnavailable` has. It is an **inline marker, not a wrapper** — its children are the label, so do not nest a block subtree in it. Place it beside `CartItemPrice`/`CartItemListPrice`.
|
|
91
110
|
- **`CartItemRemove` suppresses itself** on a gift line. A gift is not the shopper's to discard in this phase, and since one template serves every row, the rule lives in the component rather than in the composition. This covers the remove-on-alert composition too: an unavailable gift renders its alert with no remove control, and recovery is the cart-level `CartRemoveUnavailable` batch (which still batches gift lines) plus server-side cart validation.
|
|
92
111
|
- **`CartItemQuantity` suppresses itself** on a gift line too, the same way `CartItemRemove` does: a gift's quantity is promotion-controlled, and a `removeOnDecrement` stepper would otherwise let a shopper discard the gift by stepping it below the minimum — the one path the remove-control suppression did not cover. A store showing a gift's fixed quantity composes the read-only `CartItemQuantityValue`, which dispatches nothing.
|
|
93
112
|
- **The row is marked** with `data-fs-cart-item-gift-line`, so a swatch can restyle a gift row without a component per variation — that is how a store hides the `R$ 0,00` selling price on a gift row.
|
|
94
113
|
|
|
95
114
|
A gift whose `listPrice` is also 0 renders no list price (`CartItemListPrice`'s existing `listPrice <= sellingPrice` rule) and the marker carries the row alone.
|
|
96
115
|
|
|
116
|
+
## Copy
|
|
117
|
+
|
|
118
|
+
Every copy-bearing leaf reads its text only from its own `$content`, whose fields are ICU messages. An unauthored message renders empty and logs `message.missing`. A store without CMS authors the fields on the element; a CMS-bound store keeps them in content.
|
|
119
|
+
|
|
120
|
+
| Component | Content type | Fields |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `CartItemDiscountPercentage` | `cart-item-discount-percentage` | `template` (`percentage`, the integer percent) |
|
|
123
|
+
| `CartItemQuantity` | `cart-item-quantity` | `validationMessage` (`value`, the corrected amount) |
|
|
124
|
+
| `CartItemRemove` | `cart-item-remove` | `removedMessage` |
|
|
125
|
+
| `CartItemUnavailable` | `cart-item-unavailable` | `outOfStockLabel`, `cannotBeDeliveredLabel`, `unavailableLabel` |
|
|
126
|
+
| `CartItemGift` | `cart-item-gift` | `label` |
|
|
127
|
+
|
|
97
128
|
## Owned data
|
|
98
129
|
|
|
99
130
|
`CartItemRoot`'s core fragment owns each line's `id`, `quantity`, `price`/`listPrice`/`sellingPrice`, `gift`, `ownTotal`/`total`, `variant { variantId, sku, name, image, availability }`, and the `product` core. `variant.availability` stays here (not a sub-matter) because it is read cross-cuttingly: `CartItemAvailable`/`CartItemUnavailable` gate on it, and `CartCheckoutGuard` reads it across all lines. `gift` stays here for the same reason — `CartItemGift`, `CartItemRemove`'s suppression, and the row's state hook all read it.
|
|
@@ -119,7 +150,9 @@ The stepper shows the line's quantity **in the unit the merchant sells in**, not
|
|
|
119
150
|
|
|
120
151
|
Enforcement happens **on commit** — blur after typing, pointer release on the buttons, or a keyboard interaction — not per keystroke. A committed amount that is out of bounds or off the multiplier grid is clamped and snapped to the nearest valid amount (ties round up), then the remaining delta is dispatched as `increaseQuantity` / `decreaseQuantity` in purchasable units. No non-integer quantity can reach a mutation. Nothing is corrected at render time: a quantity already outside the authored bounds is displayed as-is and fires no write.
|
|
121
152
|
|
|
122
|
-
A snap renders a notice as the last child of the stepper: `div[role="alert"][data-fs-cart-item-quantity-validation]`, carrying the `validationMessage`
|
|
153
|
+
A snap renders a notice as the last child of the stepper: `div[role="alert"][data-fs-cart-item-quantity-validation]`, carrying the `validationMessage` message (content type `cart-item-quantity`), whose `value` argument is the corrected displayed amount, formatted in the locale. The root also carries `data-fs-cart-item-quantity-adjusted` plus `data-fs-cart-item-quantity-adjusted-reason="min" | "max" | "multiple" | "platform"` for per-reason styling, and `data-fs-cart-item-quantity-multiplier="<value>"` whenever the multiplier is not `1`, so a measured line can be styled differently from a counted one.
|
|
154
|
+
|
|
155
|
+
`"platform"` appears when the line lands below the amount the stepper asked for, after the write succeeds: the platform stores the quantity it has in stock (or the per-item limit) instead of the one requested. The notice reuses the `validationMessage` message and reports the quantity the line holds, replaces a local snap from the same commit, and goes away when the shopper types again, commits again, or the line reaches the requested amount. A write that fails (`userErrors`) raises no platform notice, though a local snap from the same commit still shows. The stepper remembers the requested amount until the next commit or typing, so a line the platform lowers on cart load shows none, but a line that later drops below an amount this stepper already asked for shows the notice again.
|
|
123
156
|
|
|
124
157
|
`removeOnDecrement`: a committed amount below the configured minimum removes the line instead of clamping, and no notice is raised. In that mode the decrement control is **not** disabled at the minimum — removal is the intended outcome there — and `data-fs-cart-item-at-min` still keys off the purchasable count. This never applies to a gift line: the stepper renders nothing there, so `removeOnDecrement` cannot discard a gift.
|
|
125
158
|
|
|
@@ -133,7 +166,7 @@ The measurement unit itself (`kg`, `un`) is not fetched, so a measured line rend
|
|
|
133
166
|
|
|
134
167
|
`CartItemDiscounts` is another **optional** per-line data owner: it owns the line's `discounts` subtree via its own `reactive-list-item` fragment and requires only `cart-item`, so its data is fetched **only** on pages that place it. It renders one labeled row per featured promotion applied to the current cart line — the promotion `name` plus its amount (e.g. `Black Friday −R$ 20,00`, `Cupom −10%`) — so a shopper sees *which* promotion took *how much* off *this* item. It is the itemized companion to the aggregated `Discounts` totalizer line in the footer.
|
|
135
168
|
|
|
136
|
-
Each row branches on `isPercentual`: a currency discount (`false`) formats the amount from the active storefront context; a percentual discount (`true`) renders `−N%` and is **not** currency-formatted. Every amount carries a presentational leading `−` — the source `value` is a positive amount. It **renders null when the line has no discounts** (empty or unresolved), so it appears only where a promotion actually fired. Place it under the line, near the price area. Must be inside `CartList`.
|
|
169
|
+
Each row branches on `isPercentual`: a currency discount (`false`) formats the amount from the active storefront context; a percentual discount (`true`) renders `−N%` and is **not** currency-formatted. Every amount carries a presentational leading `−` — the source `value` is a positive amount. It **renders null when the line has no discounts** (empty or unresolved), so it appears only where a promotion actually fired. Place it under the line, near the price area. Must be inside `CartList`, `CartAvailableItems` or `CartUnavailableItems`.
|
|
137
170
|
|
|
138
171
|
**Distinct from `CartItemDiscountPercentage`.** `CartItemDiscountPercentage` is a single derived `−N%` **badge** computed from `listPrice`/`sellingPrice` with **no** promotion name; `CartItemDiscounts` is the **named list** of promotions sourced from the line's `discounts` field. They cover different concerns and may coexist on a line — the badge next to the price, the named list beneath it.
|
|
139
172
|
|
|
@@ -141,7 +174,7 @@ Renders a `div[data-fs-cart-item-discounts]` container with one `span[data-fs-ca
|
|
|
141
174
|
|
|
142
175
|
### CartItemCustomizations
|
|
143
176
|
|
|
144
|
-
`CartItemCustomizations` is an **optional** per-line data owner: it owns the line's `customizations` subtree via its own `reactive-list-item` fragment and requires only `cart-item`, so its data is fetched **only** on pages that place it. It renders the form-based personalization a shopper applied to the line — engraving text, a size selection, an uploaded file's URL — as one group per assembly, each group listing its `entries` as `name` / `value` rows (e.g. `Text: MARIA`). It **renders null when the line has no customizations** (empty or unresolved). Must be inside `CartList`.
|
|
177
|
+
`CartItemCustomizations` is an **optional** per-line data owner: it owns the line's `customizations` subtree via its own `reactive-list-item` fragment and requires only `cart-item`, so its data is fetched **only** on pages that place it. It renders the form-based personalization a shopper applied to the line — engraving text, a size selection, an uploaded file's URL — as one group per assembly, each group listing its `entries` as `name` / `value` rows (e.g. `Text: MARIA`). It **renders null when the line has no customizations** (empty or unresolved). Must be inside `CartList`, `CartAvailableItems` or `CartUnavailableItems`.
|
|
145
178
|
|
|
146
179
|
The group heading is the raw assembly `id` (e.g. `Engraving`); pretty display names are deferred (836 Decision 2). An uploaded-file value surfaces as its URL string and is rendered verbatim — there is no file-preview/download widget in v0 (836 exposes no file metadata; at parity with fastcheckout).
|
|
147
180
|
|
|
@@ -149,7 +182,7 @@ Renders a `div[data-fs-cart-item-customizations]` container with one `div[data-f
|
|
|
149
182
|
|
|
150
183
|
### CartItemCompositions
|
|
151
184
|
|
|
152
|
-
`CartItemCompositions` is an **optional** per-line data owner: it owns the line's `compositions` subtree via its own `reactive-list-item` fragment and requires only `cart-item`, so its data is fetched **only** on pages that place it. It renders the nested bundle/assembly tree a shopper built under the line — each child row shows the child's `name`, `quantity` (`×N`), and formatted unit `price`. It **renders null when the line has no compositions** (empty or unresolved). Must be inside `CartList`.
|
|
185
|
+
`CartItemCompositions` is an **optional** per-line data owner: it owns the line's `compositions` subtree via its own `reactive-list-item` fragment and requires only `cart-item`, so its data is fetched **only** on pages that place it. It renders the nested bundle/assembly tree a shopper built under the line — each child row shows the child's `name`, `quantity` (`×N`), and formatted unit `price`. It **renders null when the line has no compositions** (empty or unresolved). Must be inside `CartList`, `CartAvailableItems` or `CartUnavailableItems`.
|
|
153
186
|
|
|
154
187
|
**Recursion.** A composition child is itself an order-form line, so it can carry its own nested `compositions` (a sub-bundle) and its own `customizations` (836 Decision 8). The matter recurses over the in-slice `compositions` array with an internal render function: each node renders its row, its own customization groups (using the same `name`/`value` anatomy as `CartItemCustomizations`, so one swatch styles both), then its nested children at `depth + 1`. Recursion is over finite data — the server guarantees acyclic compositions (836 visited-index) and depth is bounded by the assembly config. React keys use the node `id`.
|
|
155
188
|
|
|
@@ -157,6 +190,6 @@ Renders a `div[data-fs-cart-item-compositions]` container with one `div[data-fs-
|
|
|
157
190
|
|
|
158
191
|
### CartItemVariations
|
|
159
192
|
|
|
160
|
-
`CartItemVariations` is another **optional** per-line data owner: it owns the line's `variant.selectedOptions` subtree via its own `reactive-list-item` fragment and requires only `cart-item`, so its data is fetched **only** on pages that place it. It renders one labeled row per variation selected on the current cart line (e.g. `Cor: Vermelho`, `Tamanho: M`), so a shopper can tell two lines of the same product apart. It **renders null when the line has no selected options** (empty or unresolved), so it appears only where the SKU actually has variations. Place it near the product name. Must be inside `CartList`.
|
|
193
|
+
`CartItemVariations` is another **optional** per-line data owner: it owns the line's `variant.selectedOptions` subtree via its own `reactive-list-item` fragment and requires only `cart-item`, so its data is fetched **only** on pages that place it. It renders one labeled row per variation selected on the current cart line (e.g. `Cor: Vermelho`, `Tamanho: M`), so a shopper can tell two lines of the same product apart. It **renders null when the line has no selected options** (empty or unresolved), so it appears only where the SKU actually has variations. Place it near the product name. Must be inside `CartList`, `CartAvailableItems` or `CartUnavailableItems`.
|
|
161
194
|
|
|
162
195
|
Renders a `div[data-fs-cart-item-variations]` container with one `span[data-fs-cart-item-variation]` per option; each row wraps a `span[data-fs-cart-item-variation-name]` (e.g. `Cor`), a `span[data-fs-cart-item-variation-separator]` holding the `": "` delimiter, and a `span[data-fs-cart-item-variation-value]` (e.g. `Vermelho`). The separator is a hook of its own so a store can restyle or hide the delimiter without the punctuation riding along with the label; with no swatch applied a row still reads `Cor: Vermelho`. No props beyond the standard `div` attributes; the list is data-driven and `children` is not used to override it.
|
|
@@ -49,9 +49,9 @@ CartTotalizerRoot ← reactive data provider (totalizers + total)
|
|
|
49
49
|
| Component | Props | Notes |
|
|
50
50
|
|---|---|---|
|
|
51
51
|
| `CartTotalizerRoot` | `$data` | Provides `CartTotalizerContext` and `CartTotalValueContext`; lines format from the active storefront context |
|
|
52
|
-
| `CartTotalizerLine` | `totalizerId`, `label?`, `variant?`, `zeroLabel?` | `variant="discount"` auto-hides when
|
|
53
|
-
| `CartDiscountLine` | `
|
|
54
|
-
| `CartMarkdownLine` | `
|
|
52
|
+
| `CartTotalizerLine` | `totalizerId`, `label?`, `variant?`, `zeroLabel?` | `variant="discount"` auto-hides when the amount is numerically zero, whatever its wire form (`0`, `"0.00"`, `"-0.00"`); in any variant the line renders nothing when the amount is not a finite number |
|
|
53
|
+
| `CartDiscountLine` | `$content.otherLabel` | Itemized discount breakdown: one line per promotion/coupon plus the residual. Self-hides when empty. Owns its own `Cart.discounts` slice |
|
|
54
|
+
| `CartMarkdownLine` | `$content.label` | Aggregate item-level catalog markdown (`Σ listPrice − price`): a single negative line, self-hides at zero. Distinct money from the `Discounts` totalizer / `CartDiscountLine` — may be shown alongside them. Owns its own `Cart.itemMarkdownTotal` slice |
|
|
55
55
|
| `CartTotal` | `label?` | The single root-agnostic grand total; reads `CartTotalValueContext` provided by either root. Set `label` to render a labeled total row (e.g. "Total") |
|
|
56
56
|
|
|
57
57
|
---
|
|
@@ -75,8 +75,9 @@ storefront context wherever it renders.
|
|
|
75
75
|
single "Discounts" figure is enough.
|
|
76
76
|
|
|
77
77
|
The `name` a promotion or coupon carries comes from the platform; the API leaves the residual (and any
|
|
78
|
-
unnamed promotion) without a name, so `otherLabel`
|
|
79
|
-
|
|
78
|
+
unnamed promotion) without a name, so the `otherLabel` message (content type `cart-discount-line`)
|
|
79
|
+
supplies the label for those. It reads only from `$content`: an unauthored message renders empty and logs
|
|
80
|
+
`message.missing`. A store without CMS authors it on the element, as below.
|
|
80
81
|
|
|
81
82
|
Style hooks: `data-fs-cart-discount-lines` on the group, and per row
|
|
82
83
|
`data-fs-cart-discount-line` (with `data-fs-cart-discount-line-kind` = `promotion` / `coupon` / `other`),
|
|
@@ -125,7 +126,8 @@ from the running total. What you must not do is interleave it as a plain negativ
|
|
|
125
126
|
subtotal and the total, because it is not part of that sum. The `ItemMarkdown` story shows the
|
|
126
127
|
list-price framing.
|
|
127
128
|
|
|
128
|
-
The `label`
|
|
129
|
+
The `label` message (content type `cart-markdown-line`) words the row. It reads only from `$content`: an
|
|
130
|
+
unauthored message renders empty and logs `message.missing`.
|
|
129
131
|
|
|
130
132
|
Style hooks: `data-fs-cart-markdown-line` on the row (also `data-fs-text`), with
|
|
131
133
|
`data-fs-cart-markdown-line-label` and `data-fs-cart-markdown-line-value`.
|