@vtex/faststore 0.0.1
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 +18 -0
- package/LICENSE +21 -0
- package/README.md +95 -0
- package/dist/actions.json +334 -0
- package/dist/catalog.json +6615 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.js +8 -0
- package/dist/components.d.ts +87 -0
- package/dist/components.js +87 -0
- package/dist/content-types.json +684 -0
- package/dist/core/dist/actions/mock-action.d.ts +24 -0
- package/dist/core/dist/actions/mock-action.js +28 -0
- package/dist/core/dist/actions/mock-action.js.map +1 -0
- package/dist/core/dist/actions/registry.d.ts +24 -0
- package/dist/core/dist/actions/registry.js +28 -0
- package/dist/core/dist/actions/registry.js.map +1 -0
- package/dist/core/dist/define-component.d.ts +100 -0
- package/dist/core/dist/define-component.js +8 -0
- package/dist/core/dist/define-component.js.map +1 -0
- package/dist/core/dist/define-content-type.d.ts +95 -0
- package/dist/core/dist/define-content-type.js +283 -0
- package/dist/core/dist/define-content-type.js.map +1 -0
- package/dist/core/dist/index.d.ts +7 -0
- package/dist/core/dist/index.js +5 -0
- package/dist/core/dist/schema/generated/schema.d.ts +28 -0
- package/dist/core/dist/types.d.ts +1 -0
- package/dist/docs/access-code-field.md +100 -0
- package/dist/docs/access-code-sign-in.md +174 -0
- package/dist/docs/account-entry-point.md +155 -0
- package/dist/docs/address-summary.md +50 -0
- package/dist/docs/buy-button.md +162 -0
- package/dist/docs/carousel.md +105 -0
- package/dist/docs/cart-item.md +162 -0
- package/dist/docs/cart-totalizer.md +197 -0
- package/dist/docs/cart.md +495 -0
- package/dist/docs/client-preferences.md +184 -0
- package/dist/docs/client-profile-form.md +192 -0
- package/dist/docs/client-profile.md +117 -0
- package/dist/docs/container.md +97 -0
- package/dist/docs/document-field.md +97 -0
- package/dist/docs/email-field.md +93 -0
- package/dist/docs/email-identification.md +102 -0
- package/dist/docs/footer-copyright.md +112 -0
- package/dist/docs/footer-link-group.md +162 -0
- package/dist/docs/footer-root.md +145 -0
- package/dist/docs/footer-social.md +151 -0
- package/dist/docs/free-shipping-progress.md +87 -0
- package/dist/docs/gallery.md +84 -0
- package/dist/docs/header-root.md +150 -0
- package/dist/docs/identity-edit.md +88 -0
- package/dist/docs/identity-summary.md +106 -0
- package/dist/docs/incentives.md +151 -0
- package/dist/docs/logo.md +135 -0
- package/dist/docs/meter.md +67 -0
- package/dist/docs/navigation-link-list.md +171 -0
- package/dist/docs/navigation-link.md +163 -0
- package/dist/docs/navigation-menu.md +264 -0
- package/dist/docs/payment-methods.md +139 -0
- package/dist/docs/phone-field.md +106 -0
- package/dist/docs/postal-code-field.md +126 -0
- package/dist/docs/pricing.md +499 -0
- package/dist/docs/product-gallery.md +409 -0
- package/dist/docs/product-information.md +295 -0
- package/dist/docs/product-list.md +170 -0
- package/dist/docs/product-quantity.md +88 -0
- package/dist/docs/product-shelf.md +141 -0
- package/dist/docs/promotion.md +109 -0
- package/dist/docs/region.md +225 -0
- package/dist/docs/session.md +123 -0
- package/dist/docs/shipping-address.md +390 -0
- package/dist/docs/shipping-simulator.md +147 -0
- package/dist/docs/sign-in-form.md +117 -0
- package/dist/docs/tabs.md +176 -0
- package/dist/docs/toast.md +124 -0
- package/dist/docs/variant-selector.md +450 -0
- package/dist/graphql/define-subgraph.d.ts +12 -0
- package/dist/graphql/define-subgraph.js +15 -0
- package/dist/graphql/define-subgraph.js.map +1 -0
- package/dist/graphql/gql.d.ts +10 -0
- package/dist/graphql/gql.js +16 -0
- package/dist/graphql/gql.js.map +1 -0
- package/dist/graphql/types.d.ts +88 -0
- package/dist/graphql.d.ts +4 -0
- package/dist/graphql.js +3 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +5 -0
- package/dist/internal/client.d.ts +24 -0
- package/dist/internal/client.js +23 -0
- package/dist/internal/content.d.ts +2 -0
- package/dist/internal/content.js +2 -0
- package/dist/internal/server.d.ts +7 -0
- package/dist/internal/server.js +6 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +111 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +387 -0
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.d.ts +64 -0
- package/dist/matter/account-entry-point/account-entry-point.js +151 -0
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -0
- package/dist/matter/breadcrumb/breadcrumb.d.ts +40 -0
- package/dist/matter/breadcrumb/breadcrumb.js +155 -0
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/matter/buy-button/buy-button.d.ts +95 -0
- package/dist/matter/buy-button/buy-button.js +259 -0
- package/dist/matter/buy-button/buy-button.js.map +1 -0
- package/dist/matter/cart/cart-namespace.d.ts +48 -0
- package/dist/matter/cart/cart-namespace.js +50 -0
- package/dist/matter/cart/cart-namespace.js.map +1 -0
- package/dist/matter/cart/cart.d.ts +312 -0
- package/dist/matter/cart/cart.js +1034 -0
- package/dist/matter/cart/cart.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +103 -0
- package/dist/matter/cart-item/cart-item.js +672 -0
- package/dist/matter/cart-item/cart-item.js.map +1 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.d.ts +49 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +165 -0
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.d.ts +28 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +73 -0
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.d.ts +33 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +70 -0
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.d.ts +24 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +54 -0
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -0
- package/dist/matter/cart-item-variations/cart-item-variations.d.ts +27 -0
- package/dist/matter/cart-item-variations/cart-item-variations.js +69 -0
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -0
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +78 -0
- package/dist/matter/cart-totalizer/cart-totalizer.js +220 -0
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -0
- package/dist/matter/client-preferences/client-preferences.js +206 -0
- package/dist/matter/client-preferences/client-preferences.js.map +1 -0
- package/dist/matter/client-profile/client-profile.d.ts +59 -0
- package/dist/matter/client-profile/client-profile.js +185 -0
- package/dist/matter/client-profile/client-profile.js.map +1 -0
- package/dist/matter/client-profile-form/client-profile-form.d.ts +126 -0
- package/dist/matter/client-profile-form/client-profile-form.js +660 -0
- package/dist/matter/client-profile-form/client-profile-form.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +30 -0
- package/dist/matter/delivery-options/delivery-options-accordion.js +189 -0
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +49 -0
- package/dist/matter/delivery-options/delivery-options-controller.js +203 -0
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -0
- package/dist/matter/delivery-options/delivery-options.d.ts +31 -0
- package/dist/matter/delivery-options/delivery-options.js +103 -0
- package/dist/matter/delivery-options/delivery-options.js.map +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +9 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +76 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -0
- package/dist/matter/email-identification/email-identification.d.ts +37 -0
- package/dist/matter/email-identification/email-identification.js +111 -0
- package/dist/matter/email-identification/email-identification.js.map +1 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +44 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +170 -0
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -0
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -0
- package/dist/matter/identity-edit/identity-edit.js +148 -0
- package/dist/matter/identity-edit/identity-edit.js.map +1 -0
- package/dist/matter/identity-summary/identity-summary.d.ts +128 -0
- package/dist/matter/identity-summary/identity-summary.js +344 -0
- package/dist/matter/identity-summary/identity-summary.js.map +1 -0
- package/dist/matter/pricing/pricing.d.ts +162 -0
- package/dist/matter/pricing/pricing.js +793 -0
- package/dist/matter/pricing/pricing.js.map +1 -0
- package/dist/matter/product-gallery/product-gallery.d.ts +23 -0
- package/dist/matter/product-gallery/product-gallery.js +188 -0
- package/dist/matter/product-gallery/product-gallery.js.map +1 -0
- package/dist/matter/product-information/product-information.d.ts +61 -0
- package/dist/matter/product-information/product-information.js +355 -0
- package/dist/matter/product-information/product-information.js.map +1 -0
- package/dist/matter/product-list/product-list.d.ts +86 -0
- package/dist/matter/product-list/product-list.js +342 -0
- package/dist/matter/product-list/product-list.js.map +1 -0
- package/dist/matter/product-quantity/product-quantity.d.ts +50 -0
- package/dist/matter/product-quantity/product-quantity.js +111 -0
- package/dist/matter/product-quantity/product-quantity.js.map +1 -0
- package/dist/matter/product-shelf/product-shelf.d.ts +125 -0
- package/dist/matter/product-shelf/product-shelf.js +376 -0
- package/dist/matter/product-shelf/product-shelf.js.map +1 -0
- package/dist/matter/region/region.d.ts +211 -0
- package/dist/matter/region/region.js +579 -0
- package/dist/matter/region/region.js.map +1 -0
- package/dist/matter/session/session.d.ts +58 -0
- package/dist/matter/session/session.js +112 -0
- package/dist/matter/session/session.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +101 -0
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +284 -0
- package/dist/matter/shipping-address/shipping-address.js +1036 -0
- package/dist/matter/shipping-address/shipping-address.js.map +1 -0
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +143 -0
- package/dist/matter/shipping-simulator/shipping-simulator.js +644 -0
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +79 -0
- package/dist/matter/sign-in-form/sign-in-form.js +226 -0
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -0
- package/dist/matter/variant-selector/variant-selector.d.ts +183 -0
- package/dist/matter/variant-selector/variant-selector.js +840 -0
- package/dist/matter/variant-selector/variant-selector.js.map +1 -0
- package/dist/message-locales.json +7 -0
- package/dist/particles/access-code-field/access-code-field.d.ts +33 -0
- package/dist/particles/access-code-field/access-code-field.js +95 -0
- package/dist/particles/access-code-field/access-code-field.js.map +1 -0
- package/dist/particles/accordion/accordion.d.ts +45 -0
- package/dist/particles/accordion/accordion.js +156 -0
- package/dist/particles/accordion/accordion.js.map +1 -0
- package/dist/particles/address-summary/address-summary.d.ts +50 -0
- package/dist/particles/address-summary/address-summary.js +129 -0
- package/dist/particles/address-summary/address-summary.js.map +1 -0
- package/dist/particles/badge/badge.d.ts +10 -0
- package/dist/particles/badge/badge.js +27 -0
- package/dist/particles/badge/badge.js.map +1 -0
- package/dist/particles/button/button.d.ts +18 -0
- package/dist/particles/button/button.js +37 -0
- package/dist/particles/button/button.js.map +1 -0
- package/dist/particles/carousel/carousel.d.ts +60 -0
- package/dist/particles/carousel/carousel.js +335 -0
- package/dist/particles/carousel/carousel.js.map +1 -0
- package/dist/particles/checkbox/checkbox.d.ts +40 -0
- package/dist/particles/checkbox/checkbox.js +82 -0
- package/dist/particles/checkbox/checkbox.js.map +1 -0
- package/dist/particles/container/container.d.ts +20 -0
- package/dist/particles/container/container.js +36 -0
- package/dist/particles/container/container.js.map +1 -0
- package/dist/particles/dialog/dialog.d.ts +54 -0
- package/dist/particles/dialog/dialog.js +192 -0
- package/dist/particles/dialog/dialog.js.map +1 -0
- package/dist/particles/document-field/document-field.d.ts +61 -0
- package/dist/particles/document-field/document-field.js +146 -0
- package/dist/particles/document-field/document-field.js.map +1 -0
- package/dist/particles/drawer/drawer.d.ts +52 -0
- package/dist/particles/drawer/drawer.js +183 -0
- package/dist/particles/drawer/drawer.js.map +1 -0
- package/dist/particles/email-field/email-field.d.ts +37 -0
- package/dist/particles/email-field/email-field.js +106 -0
- package/dist/particles/email-field/email-field.js.map +1 -0
- package/dist/particles/field/field.d.ts +50 -0
- package/dist/particles/field/field.js +133 -0
- package/dist/particles/field/field.js.map +1 -0
- package/dist/particles/fieldset/fieldset.d.ts +16 -0
- package/dist/particles/fieldset/fieldset.js +52 -0
- package/dist/particles/fieldset/fieldset.js.map +1 -0
- package/dist/particles/footer-copyright/footer-copyright.d.ts +32 -0
- package/dist/particles/footer-copyright/footer-copyright.js +50 -0
- package/dist/particles/footer-copyright/footer-copyright.js.map +1 -0
- package/dist/particles/footer-link-group/footer-link-group.d.ts +66 -0
- package/dist/particles/footer-link-group/footer-link-group.js +154 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -0
- package/dist/particles/footer-root/footer-root.d.ts +21 -0
- package/dist/particles/footer-root/footer-root.js +38 -0
- package/dist/particles/footer-root/footer-root.js.map +1 -0
- package/dist/particles/footer-social/footer-social.d.ts +79 -0
- package/dist/particles/footer-social/footer-social.js +176 -0
- package/dist/particles/footer-social/footer-social.js.map +1 -0
- package/dist/particles/gallery/gallery.d.ts +181 -0
- package/dist/particles/gallery/gallery.js +920 -0
- package/dist/particles/gallery/gallery.js.map +1 -0
- package/dist/particles/header-root/header-root.d.ts +21 -0
- package/dist/particles/header-root/header-root.js +38 -0
- package/dist/particles/header-root/header-root.js.map +1 -0
- package/dist/particles/icon/icon.d.ts +22 -0
- package/dist/particles/icon/icon.js +48 -0
- package/dist/particles/icon/icon.js.map +1 -0
- package/dist/particles/image/image.d.ts +13 -0
- package/dist/particles/image/image.js +59 -0
- package/dist/particles/image/image.js.map +1 -0
- package/dist/particles/incentives/incentives.d.ts +85 -0
- package/dist/particles/incentives/incentives.js +200 -0
- package/dist/particles/incentives/incentives.js.map +1 -0
- package/dist/particles/input/input.d.ts +9 -0
- package/dist/particles/input/input.js +28 -0
- package/dist/particles/input/input.js.map +1 -0
- package/dist/particles/logo/logo.d.ts +55 -0
- package/dist/particles/logo/logo.js +96 -0
- package/dist/particles/logo/logo.js.map +1 -0
- package/dist/particles/menu/menu.d.ts +103 -0
- package/dist/particles/menu/menu.js +409 -0
- package/dist/particles/menu/menu.js.map +1 -0
- package/dist/particles/menubar/menubar.d.ts +18 -0
- package/dist/particles/menubar/menubar.js +42 -0
- package/dist/particles/menubar/menubar.js.map +1 -0
- package/dist/particles/meter/meter.d.ts +36 -0
- package/dist/particles/meter/meter.js +132 -0
- package/dist/particles/meter/meter.js.map +1 -0
- package/dist/particles/navigation-link/navigation-link.d.ts +43 -0
- package/dist/particles/navigation-link/navigation-link.js +82 -0
- package/dist/particles/navigation-link/navigation-link.js.map +1 -0
- package/dist/particles/navigation-link-list/navigation-link-list.d.ts +59 -0
- package/dist/particles/navigation-link-list/navigation-link-list.js +103 -0
- package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -0
- package/dist/particles/navigation-menu/navigation-menu.d.ts +78 -0
- package/dist/particles/navigation-menu/navigation-menu.js +295 -0
- package/dist/particles/navigation-menu/navigation-menu.js.map +1 -0
- package/dist/particles/number-field/number-field.d.ts +46 -0
- package/dist/particles/number-field/number-field.js +169 -0
- package/dist/particles/number-field/number-field.js.map +1 -0
- package/dist/particles/password-field/password-field.d.ts +31 -0
- package/dist/particles/password-field/password-field.js +109 -0
- package/dist/particles/password-field/password-field.js.map +1 -0
- package/dist/particles/payment-methods/payment-methods.d.ts +72 -0
- package/dist/particles/payment-methods/payment-methods.js +151 -0
- package/dist/particles/payment-methods/payment-methods.js.map +1 -0
- package/dist/particles/phone-field/phone-field.d.ts +67 -0
- package/dist/particles/phone-field/phone-field.js +250 -0
- package/dist/particles/phone-field/phone-field.js.map +1 -0
- package/dist/particles/popover/popover.d.ts +68 -0
- package/dist/particles/popover/popover.js +284 -0
- package/dist/particles/popover/popover.js.map +1 -0
- package/dist/particles/postal-code-field/postal-code-field.d.ts +75 -0
- package/dist/particles/postal-code-field/postal-code-field.js +169 -0
- package/dist/particles/postal-code-field/postal-code-field.js.map +1 -0
- package/dist/particles/promotion/promotion.d.ts +46 -0
- package/dist/particles/promotion/promotion.js +78 -0
- package/dist/particles/promotion/promotion.js.map +1 -0
- package/dist/particles/quantity-selector/quantity-selector.d.ts +30 -0
- package/dist/particles/quantity-selector/quantity-selector.js +116 -0
- package/dist/particles/quantity-selector/quantity-selector.js.map +1 -0
- package/dist/particles/radio/radio.d.ts +36 -0
- package/dist/particles/radio/radio.js +76 -0
- package/dist/particles/radio/radio.js.map +1 -0
- package/dist/particles/scroll-area/scroll-area.d.ts +36 -0
- package/dist/particles/scroll-area/scroll-area.js +145 -0
- package/dist/particles/scroll-area/scroll-area.js.map +1 -0
- package/dist/particles/select/select.d.ts +125 -0
- package/dist/particles/select/select.js +478 -0
- package/dist/particles/select/select.js.map +1 -0
- package/dist/particles/separator/separator.d.ts +12 -0
- package/dist/particles/separator/separator.js +33 -0
- package/dist/particles/separator/separator.js.map +1 -0
- package/dist/particles/shared/input-mask.d.ts +5 -0
- package/dist/particles/shared/input-mask.js +58 -0
- package/dist/particles/shared/input-mask.js.map +1 -0
- package/dist/particles/spinner/spinner.d.ts +13 -0
- package/dist/particles/spinner/spinner.js +31 -0
- package/dist/particles/spinner/spinner.js.map +1 -0
- package/dist/particles/switch/switch.d.ts +27 -0
- package/dist/particles/switch/switch.js +59 -0
- package/dist/particles/switch/switch.js.map +1 -0
- package/dist/particles/tabs/tabs.d.ts +45 -0
- package/dist/particles/tabs/tabs.js +164 -0
- package/dist/particles/tabs/tabs.js.map +1 -0
- package/dist/particles/text/text.d.ts +24 -0
- package/dist/particles/text/text.js +40 -0
- package/dist/particles/text/text.js.map +1 -0
- package/dist/particles/toast/toast.d.ts +83 -0
- package/dist/particles/toast/toast.js +194 -0
- package/dist/particles/toast/toast.js.map +1 -0
- package/dist/particles/toggle/toggle.d.ts +26 -0
- package/dist/particles/toggle/toggle.js +61 -0
- package/dist/particles/toggle/toggle.js.map +1 -0
- package/dist/particles/tooltip/tooltip.d.ts +61 -0
- package/dist/particles/tooltip/tooltip.js +240 -0
- package/dist/particles/tooltip/tooltip.js.map +1 -0
- package/dist/schema.graphql +2953 -0
- package/dist/sdk/actions/cart-action-provider.d.ts +19 -0
- package/dist/sdk/actions/cart-action-provider.js +23 -0
- package/dist/sdk/actions/cart-action-provider.js.map +1 -0
- package/dist/sdk/actions/identity-action-provider.d.ts +15 -0
- package/dist/sdk/actions/identity-action-provider.js +19 -0
- package/dist/sdk/actions/identity-action-provider.js.map +1 -0
- package/dist/sdk/actions/index.d.ts +7 -0
- package/dist/sdk/actions/index.js +6 -0
- package/dist/sdk/actions/inject-actions.d.ts +14 -0
- package/dist/sdk/actions/inject-actions.js +36 -0
- package/dist/sdk/actions/inject-actions.js.map +1 -0
- package/dist/sdk/actions/region-action-provider.d.ts +15 -0
- package/dist/sdk/actions/region-action-provider.js +19 -0
- package/dist/sdk/actions/region-action-provider.js.map +1 -0
- package/dist/sdk/actions/session-action-provider.d.ts +15 -0
- package/dist/sdk/actions/session-action-provider.js +19 -0
- package/dist/sdk/actions/session-action-provider.js.map +1 -0
- package/dist/sdk/actions/shipping-action-provider.d.ts +15 -0
- package/dist/sdk/actions/shipping-action-provider.js +19 -0
- package/dist/sdk/actions/shipping-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +21 -0
- package/dist/sdk/cache/storefront-cache.js +35 -0
- package/dist/sdk/cache/storefront-cache.js.map +1 -0
- package/dist/sdk/cart/operations.d.ts +31 -0
- package/dist/sdk/cart/operations.js +215 -0
- package/dist/sdk/cart/operations.js.map +1 -0
- package/dist/sdk/cart/optimistic.d.ts +24 -0
- package/dist/sdk/cart/optimistic.js +164 -0
- package/dist/sdk/cart/optimistic.js.map +1 -0
- package/dist/sdk/cart/use-cart-actions.d.ts +56 -0
- package/dist/sdk/cart/use-cart-actions.js +348 -0
- package/dist/sdk/cart/use-cart-actions.js.map +1 -0
- package/dist/sdk/cart/use-cart-validate-on-open.js +50 -0
- package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -0
- package/dist/sdk/cart/write-gate.js +54 -0
- package/dist/sdk/cart/write-gate.js.map +1 -0
- package/dist/sdk/client/assert-api-url.js +20 -0
- package/dist/sdk/client/assert-api-url.js.map +1 -0
- package/dist/sdk/client/create-client.d.ts +23 -0
- package/dist/sdk/client/create-client.js +46 -0
- package/dist/sdk/client/create-client.js.map +1 -0
- package/dist/sdk/client/fetch-page-data.d.ts +39 -0
- package/dist/sdk/client/fetch-page-data.js +33 -0
- package/dist/sdk/client/fetch-page-data.js.map +1 -0
- package/dist/sdk/client/register-preload-query.d.ts +24 -0
- package/dist/sdk/client/register-preload-query.js +33 -0
- package/dist/sdk/client/register-preload-query.js.map +1 -0
- package/dist/sdk/content/create-content-runtime.d.ts +68 -0
- package/dist/sdk/content/create-content-runtime.js +503 -0
- package/dist/sdk/content/create-content-runtime.js.map +1 -0
- package/dist/sdk/context/headers.d.ts +15 -0
- package/dist/sdk/context/headers.js +21 -0
- package/dist/sdk/context/headers.js.map +1 -0
- package/dist/sdk/context/storefront-context.d.ts +11 -0
- package/dist/sdk/context/storefront-context.js +29 -0
- package/dist/sdk/context/storefront-context.js.map +1 -0
- package/dist/sdk/data/data-override-context.d.ts +12 -0
- package/dist/sdk/data/data-override-context.js +19 -0
- package/dist/sdk/data/data-override-context.js.map +1 -0
- package/dist/sdk/data/entity-subscriber.js +28 -0
- package/dist/sdk/data/entity-subscriber.js.map +1 -0
- package/dist/sdk/data/hot-data-provider.d.ts +19 -0
- package/dist/sdk/data/hot-data-provider.js +33 -0
- package/dist/sdk/data/hot-data-provider.js.map +1 -0
- package/dist/sdk/data/index.d.ts +8 -0
- package/dist/sdk/data/index.js +8 -0
- package/dist/sdk/data/list-item-ref-context.d.ts +20 -0
- package/dist/sdk/data/list-item-ref-context.js +11 -0
- package/dist/sdk/data/list-item-ref-context.js.map +1 -0
- package/dist/sdk/data/multiple-reactive-data-provider.d.ts +32 -0
- package/dist/sdk/data/multiple-reactive-data-provider.js +20 -0
- package/dist/sdk/data/multiple-reactive-data-provider.js.map +1 -0
- package/dist/sdk/data/page-reactive-data-root.d.ts +53 -0
- package/dist/sdk/data/page-reactive-data-root.js +153 -0
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -0
- package/dist/sdk/data/reactive-data-provider.d.ts +25 -0
- package/dist/sdk/data/reactive-data-provider.js +24 -0
- package/dist/sdk/data/reactive-data-provider.js.map +1 -0
- package/dist/sdk/data/reactive-list-item-data-provider.d.ts +26 -0
- package/dist/sdk/data/reactive-list-item-data-provider.js +42 -0
- package/dist/sdk/data/reactive-list-item-data-provider.js.map +1 -0
- package/dist/sdk/data/use-reactive-entity.js +40 -0
- package/dist/sdk/data/use-reactive-entity.js.map +1 -0
- package/dist/sdk/format/client.d.ts +12 -0
- package/dist/sdk/format/client.js +20 -0
- package/dist/sdk/format/client.js.map +1 -0
- package/dist/sdk/format/formatters.d.ts +32 -0
- package/dist/sdk/format/formatters.js +45 -0
- package/dist/sdk/format/formatters.js.map +1 -0
- package/dist/sdk/generated/fragment-types.js +23 -0
- package/dist/sdk/generated/fragment-types.js.map +1 -0
- package/dist/sdk/generated/gql.js +51 -0
- package/dist/sdk/generated/gql.js.map +1 -0
- package/dist/sdk/generated/graphql.d.ts +622 -0
- package/dist/sdk/generated/graphql.js +11917 -0
- package/dist/sdk/generated/graphql.js.map +1 -0
- package/dist/sdk/graphql-tag.d.ts +10 -0
- package/dist/sdk/graphql-tag.js +21 -0
- package/dist/sdk/graphql-tag.js.map +1 -0
- package/dist/sdk/i18n/client.d.ts +4 -0
- package/dist/sdk/i18n/client.js +4 -0
- package/dist/sdk/i18n/locales.d.ts +8 -0
- package/dist/sdk/i18n/locales.js +57 -0
- package/dist/sdk/i18n/locales.js.map +1 -0
- package/dist/sdk/i18n/messages/en-US.js +24 -0
- package/dist/sdk/i18n/messages/en-US.js.map +1 -0
- package/dist/sdk/i18n/messages/en-US.json +19 -0
- package/dist/sdk/i18n/messages/en-US.json.d.ts +23 -0
- package/dist/sdk/i18n/messages/es-ES.js +24 -0
- package/dist/sdk/i18n/messages/es-ES.js.map +1 -0
- package/dist/sdk/i18n/messages/es-ES.json +19 -0
- package/dist/sdk/i18n/messages/pt-BR.js +24 -0
- package/dist/sdk/i18n/messages/pt-BR.js.map +1 -0
- package/dist/sdk/i18n/messages/pt-BR.json +19 -0
- package/dist/sdk/i18n/provider.d.ts +1 -0
- package/dist/sdk/i18n/provider.js +30 -0
- package/dist/sdk/i18n/provider.js.map +1 -0
- package/dist/sdk/i18n/server.d.ts +28 -0
- package/dist/sdk/i18n/server.js +59 -0
- package/dist/sdk/i18n/server.js.map +1 -0
- package/dist/sdk/identity/operations.d.ts +34 -0
- package/dist/sdk/identity/operations.js +78 -0
- package/dist/sdk/identity/operations.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.d.ts +62 -0
- package/dist/sdk/identity/use-identity-actions.js +180 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -0
- package/dist/sdk/provider/index.d.ts +2 -0
- package/dist/sdk/provider/index.js +2 -0
- package/dist/sdk/provider/storefront-provider.d.ts +32 -0
- package/dist/sdk/provider/storefront-provider.js +111 -0
- package/dist/sdk/provider/storefront-provider.js.map +1 -0
- package/dist/sdk/region/operations.d.ts +6 -0
- package/dist/sdk/region/region-operations.d.ts +30 -0
- package/dist/sdk/region/region-operations.js +23 -0
- package/dist/sdk/region/region-operations.js.map +1 -0
- package/dist/sdk/region/use-region-actions.d.ts +23 -0
- package/dist/sdk/region/use-region-actions.js +66 -0
- package/dist/sdk/region/use-region-actions.js.map +1 -0
- package/dist/sdk/seller.js +11 -0
- package/dist/sdk/seller.js.map +1 -0
- package/dist/sdk/session/auth-operations.d.ts +47 -0
- package/dist/sdk/session/auth-operations.js +79 -0
- package/dist/sdk/session/auth-operations.js.map +1 -0
- package/dist/sdk/session/operations.d.ts +6 -0
- package/dist/sdk/session/use-session-actions.d.ts +27 -0
- package/dist/sdk/session/use-session-actions.js +126 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -0
- package/dist/sdk/shipping/cart-operations.d.ts +3 -0
- package/dist/sdk/shipping/cart-operations.js +33 -0
- package/dist/sdk/shipping/cart-operations.js.map +1 -0
- package/dist/sdk/shipping/operations.d.ts +3 -0
- package/dist/sdk/shipping/operations.js +33 -0
- package/dist/sdk/shipping/operations.js.map +1 -0
- package/dist/sdk/shipping/option-select-operations.d.ts +24 -0
- package/dist/sdk/shipping/option-select-operations.js +45 -0
- package/dist/sdk/shipping/option-select-operations.js.map +1 -0
- package/dist/sdk/shipping/request-timeout.js +41 -0
- package/dist/sdk/shipping/request-timeout.js.map +1 -0
- package/dist/sdk/shipping/shipping-operations.d.ts +38 -0
- package/dist/sdk/shipping/shipping-operations.js +77 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.d.ts +7 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.js +72 -0
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -0
- package/dist/sdk/shipping/use-shipping-actions.d.ts +27 -0
- package/dist/sdk/shipping/use-shipping-actions.js +113 -0
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -0
- package/dist/sdk/shipping/use-shipping-simulation.d.ts +7 -0
- package/dist/sdk/shipping/use-shipping-simulation.js +72 -0
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -0
- package/dist/sdk/state/cart.d.ts +42 -0
- package/dist/sdk/state/cart.js +64 -0
- package/dist/sdk/state/cart.js.map +1 -0
- package/dist/sdk/state/index.js +3 -0
- package/dist/sdk/state/variant-selector.d.ts +17 -0
- package/dist/sdk/state/variant-selector.js +14 -0
- package/dist/sdk/state/variant-selector.js.map +1 -0
- package/dist/utils/safe-href.js +63 -0
- package/dist/utils/safe-href.js.map +1 -0
- package/package.json +84 -0
- package/src/styles/tailwind.css +32 -0
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { defineComponent } from "../../core/dist/define-component.js";
|
|
3
|
+
import { defineContentType } from "../../core/dist/define-content-type.js";
|
|
4
|
+
import "../../core/dist/index.js";
|
|
5
|
+
import { useIntl } from "../../sdk/i18n/client.js";
|
|
6
|
+
import { graphql } from "../../sdk/generated/gql.js";
|
|
7
|
+
import { useDataOverride } from "../../sdk/data/data-override-context.js";
|
|
8
|
+
import { resolveSafeHref } from "../../utils/safe-href.js";
|
|
9
|
+
import { ReactiveRootContext } from "../../sdk/data/page-reactive-data-root.js";
|
|
10
|
+
import { PostalCodeField } from "../../particles/postal-code-field/postal-code-field.js";
|
|
11
|
+
import { cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
//#region src/matter/region/region.tsx
|
|
14
|
+
const fragment = graphql(`
|
|
15
|
+
fragment RegionData on Query {
|
|
16
|
+
region {
|
|
17
|
+
...RegionFragment
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`);
|
|
21
|
+
const RegionTriggerContent = defineContentType({
|
|
22
|
+
id: "region-trigger",
|
|
23
|
+
title: "Region Trigger",
|
|
24
|
+
description: "Copy for the control that opens the region modal.",
|
|
25
|
+
schema: {
|
|
26
|
+
type: "object",
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
properties: {
|
|
29
|
+
unsetLabel: {
|
|
30
|
+
type: "string",
|
|
31
|
+
title: "Label when no region is set"
|
|
32
|
+
},
|
|
33
|
+
ariaLabel: {
|
|
34
|
+
type: "string",
|
|
35
|
+
title: "Accessible label"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const RegionSubmitContent = defineContentType({
|
|
41
|
+
id: "region-submit",
|
|
42
|
+
title: "Region Submit",
|
|
43
|
+
description: "Copy for the region submit control.",
|
|
44
|
+
schema: {
|
|
45
|
+
type: "object",
|
|
46
|
+
additionalProperties: false,
|
|
47
|
+
properties: {
|
|
48
|
+
label: {
|
|
49
|
+
type: "string",
|
|
50
|
+
title: "Button label"
|
|
51
|
+
},
|
|
52
|
+
pendingLabel: {
|
|
53
|
+
type: "string",
|
|
54
|
+
title: "Pending label"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const RegionUnknownLinkContent = defineContentType({
|
|
60
|
+
id: "region-unknown-link",
|
|
61
|
+
title: "Region \"I don't know my postal code\" Link",
|
|
62
|
+
description: "Copy and destination for the postal-code lookup link. Absent href omits the link.",
|
|
63
|
+
schema: {
|
|
64
|
+
type: "object",
|
|
65
|
+
additionalProperties: false,
|
|
66
|
+
properties: {
|
|
67
|
+
text: {
|
|
68
|
+
type: "string",
|
|
69
|
+
minLength: 1,
|
|
70
|
+
title: "Link text"
|
|
71
|
+
},
|
|
72
|
+
href: {
|
|
73
|
+
type: "string",
|
|
74
|
+
title: "Destination",
|
|
75
|
+
format: "uri-reference",
|
|
76
|
+
pattern: "^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const RegionErrorContent = defineContentType({
|
|
82
|
+
id: "region-error",
|
|
83
|
+
title: "Region Error",
|
|
84
|
+
description: "Fallback message shown when a write fails without a server message.",
|
|
85
|
+
schema: {
|
|
86
|
+
type: "object",
|
|
87
|
+
additionalProperties: false,
|
|
88
|
+
properties: { genericMessage: {
|
|
89
|
+
type: "string",
|
|
90
|
+
title: "Generic failure message"
|
|
91
|
+
} }
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const REGION_CONTEXT_UNSET = Symbol("RegionContextUnset");
|
|
95
|
+
const RegionContextInternal = createContext(REGION_CONTEXT_UNSET);
|
|
96
|
+
const RegionContext = RegionContextInternal;
|
|
97
|
+
/**
|
|
98
|
+
* Read the active region and the modal's write state from the nearest `RegionRoot`. Throws when
|
|
99
|
+
* called outside a `RegionRoot` subtree, mirroring `useSession()` and `useCart()`: a misplaced part
|
|
100
|
+
* is a composition bug the author should see immediately, not a silent degrade to "no region". The
|
|
101
|
+
* compiler catches the same mistake earlier through `requiresContext: 'region'` (ADR-0009).
|
|
102
|
+
*/
|
|
103
|
+
function useRegion() {
|
|
104
|
+
const ctx = useContext(RegionContextInternal);
|
|
105
|
+
if (ctx === REGION_CONTEXT_UNSET) throw new Error("Region components must be used inside a <RegionRoot> subtree.");
|
|
106
|
+
return ctx;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Whether a `RegionForm` encloses the subtree. `RegionSubmit` is independently placeable, so it
|
|
110
|
+
* cannot assume a form owner: with one it is a real submit button, which is what makes Enter in the
|
|
111
|
+
* field submit; without one a `type="submit"` button would have nothing to submit and its click
|
|
112
|
+
* would do nothing. Reading this keeps the form composable rather than load-bearing.
|
|
113
|
+
*/
|
|
114
|
+
const RegionFormContext = createContext(false);
|
|
115
|
+
const RegionRootDefinition = defineComponent({
|
|
116
|
+
name: "RegionRoot",
|
|
117
|
+
importPath: "@vtex/faststore/components",
|
|
118
|
+
component: RegionRoot,
|
|
119
|
+
fragment,
|
|
120
|
+
fetchStrategy: "reactive",
|
|
121
|
+
providesContext: "region",
|
|
122
|
+
actions: { region: ["setPostalCode"] },
|
|
123
|
+
editor: {
|
|
124
|
+
label: "Region Root",
|
|
125
|
+
category: "content"
|
|
126
|
+
},
|
|
127
|
+
schema: {},
|
|
128
|
+
guideline: "Provides region context and reads the active postal code and city reactively. Place it in the shared header layout and compose RegionTrigger, RegionValue, RegionLoading, and a RegionModalController inside it. Every Region* component must be a descendant. See region.md."
|
|
129
|
+
});
|
|
130
|
+
const RegionTriggerDefinition = defineComponent({
|
|
131
|
+
name: "RegionTrigger",
|
|
132
|
+
importPath: "@vtex/faststore/components",
|
|
133
|
+
component: RegionTrigger,
|
|
134
|
+
content: RegionTriggerContent,
|
|
135
|
+
requiresContext: "region",
|
|
136
|
+
editor: {
|
|
137
|
+
label: "Region Trigger",
|
|
138
|
+
category: "action"
|
|
139
|
+
},
|
|
140
|
+
schema: { unsetLabel: {
|
|
141
|
+
type: "string",
|
|
142
|
+
default: "Informe seu CEP",
|
|
143
|
+
label: "Label when no region is set"
|
|
144
|
+
} },
|
|
145
|
+
guideline: "Opens the region modal. Shows its unset label while no region is set; compose RegionValue as its child so the active region reads inside the control once one is. Its accessible name carries the active region, so a screen reader announces where the shopper is shopping. Must be inside RegionRoot."
|
|
146
|
+
});
|
|
147
|
+
const RegionValueDefinition = defineComponent({
|
|
148
|
+
name: "RegionValue",
|
|
149
|
+
importPath: "@vtex/faststore/components",
|
|
150
|
+
component: RegionValue,
|
|
151
|
+
requiresContext: "region",
|
|
152
|
+
editor: {
|
|
153
|
+
label: "Region Value",
|
|
154
|
+
category: "content"
|
|
155
|
+
},
|
|
156
|
+
schema: {},
|
|
157
|
+
guideline: "The active region, as city plus postal code. Renders nothing while the region is unresolved or unset, so it needs no visibility prop — place it inside RegionTrigger, or anywhere in the header that should echo the region. The city is wrapped in its own element (data-fs-region-value-city) so a store can style or hide it; when the contract resolves no city, the postal code renders alone with no separator. A plain space separates the two in the text, so the accessible name reads \"São Paulo 01310-100\"; a flex container strips it, so a gap swatch still sets the visible spacing. Must be inside RegionRoot."
|
|
158
|
+
});
|
|
159
|
+
const RegionLoadingDefinition = defineComponent({
|
|
160
|
+
name: "RegionLoading",
|
|
161
|
+
importPath: "@vtex/faststore/components",
|
|
162
|
+
component: RegionLoading,
|
|
163
|
+
requiresContext: "region",
|
|
164
|
+
editor: {
|
|
165
|
+
label: "Region Loading",
|
|
166
|
+
category: "content"
|
|
167
|
+
},
|
|
168
|
+
schema: {},
|
|
169
|
+
guideline: "Renders its children only while the region read has not resolved. Supply a skeleton placeholder as its child, sized like the resolved display so the header does not reflow when the region arrives. RegionValue renders nothing while this branch is showing, so the two never double up. Must be inside RegionRoot."
|
|
170
|
+
});
|
|
171
|
+
const RegionModalControllerDefinition = defineComponent({
|
|
172
|
+
name: "RegionModalController",
|
|
173
|
+
importPath: "@vtex/faststore/components",
|
|
174
|
+
component: RegionModalController,
|
|
175
|
+
requiresContext: "region",
|
|
176
|
+
editor: {
|
|
177
|
+
label: "Region Modal Controller",
|
|
178
|
+
category: "action"
|
|
179
|
+
},
|
|
180
|
+
schema: {},
|
|
181
|
+
guideline: "Wraps a single DialogRoot child (the region modal) and makes it controlled by the region state: RegionTrigger opens it, Escape and the backdrop close it, and a successful write closes it. Do not set raw open/onOpenChange on the wrapped DialogRoot. Compose DialogPortal, DialogBackdrop, DialogViewport and DialogPopup inside it, with DialogTitle and DialogDescription naming the dialog, and place a RegionForm holding RegionPostalCodeControl and RegionSubmit in the popup, alongside RegionError and RegionUnknownLink. Same pattern as CartOpenOnAdd wrapping the mini-cart DrawerRoot. Must be inside RegionRoot."
|
|
182
|
+
});
|
|
183
|
+
const RegionFormDefinition = defineComponent({
|
|
184
|
+
name: "RegionForm",
|
|
185
|
+
importPath: "@vtex/faststore/components",
|
|
186
|
+
component: RegionForm,
|
|
187
|
+
requiresContext: "region",
|
|
188
|
+
editor: {
|
|
189
|
+
label: "Region Form",
|
|
190
|
+
category: "action"
|
|
191
|
+
},
|
|
192
|
+
schema: {},
|
|
193
|
+
guideline: "Form wrapper holding RegionPostalCodeControl and RegionSubmit inside the region modal, so pressing Enter in the field submits. Same role as ShippingSimulatorForm. Compose it whenever both parts sit together; without it the shopper must reach the button, which still works but is not what a one-field form leads them to expect. Must be inside a RegionModalController dialog."
|
|
194
|
+
});
|
|
195
|
+
const RegionPostalCodeControlDefinition = defineComponent({
|
|
196
|
+
name: "RegionPostalCodeControl",
|
|
197
|
+
importPath: "@vtex/faststore/components",
|
|
198
|
+
component: RegionPostalCodeControl,
|
|
199
|
+
requiresContext: "region",
|
|
200
|
+
editor: {
|
|
201
|
+
label: "Region Postal Code Control",
|
|
202
|
+
category: "content"
|
|
203
|
+
},
|
|
204
|
+
schema: {
|
|
205
|
+
mask: {
|
|
206
|
+
type: "string",
|
|
207
|
+
default: "99999-999",
|
|
208
|
+
label: "Mask pattern"
|
|
209
|
+
},
|
|
210
|
+
label: {
|
|
211
|
+
type: "string",
|
|
212
|
+
label: "Label"
|
|
213
|
+
},
|
|
214
|
+
placeholder: {
|
|
215
|
+
type: "string",
|
|
216
|
+
label: "Placeholder"
|
|
217
|
+
},
|
|
218
|
+
errorMessage: {
|
|
219
|
+
type: "string",
|
|
220
|
+
label: "Incomplete-value message"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
guideline: "The postal-code input inside the region modal: a PostalCodeField bound to the region draft, seeded from the persisted value every time the modal opens. Set mask to the country format at build time (default 99999-999, BR CEP). Server rejections mark the field invalid and take focus back to it; their message is shown by RegionError, not repeated here, and the first keystroke after one clears it. Must be inside a RegionModalController dialog."
|
|
224
|
+
});
|
|
225
|
+
const RegionSubmitDefinition = defineComponent({
|
|
226
|
+
name: "RegionSubmit",
|
|
227
|
+
importPath: "@vtex/faststore/components",
|
|
228
|
+
component: RegionSubmit,
|
|
229
|
+
content: RegionSubmitContent,
|
|
230
|
+
requiresContext: "region",
|
|
231
|
+
editor: {
|
|
232
|
+
label: "Region Submit",
|
|
233
|
+
category: "action"
|
|
234
|
+
},
|
|
235
|
+
schema: {
|
|
236
|
+
label: {
|
|
237
|
+
type: "string",
|
|
238
|
+
default: "Aplicar",
|
|
239
|
+
label: "Button label"
|
|
240
|
+
},
|
|
241
|
+
pendingLabel: {
|
|
242
|
+
type: "string",
|
|
243
|
+
default: "Aplicando...",
|
|
244
|
+
label: "Pending label"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
guideline: "Submits the region draft. Inside a RegionForm it is the form's submit button, which is what makes Enter in the field work; on its own it dispatches directly. Inert while empty and while a write is in flight, so a double activation dispatches one mutation; the pending state is exposed as aria-busy with no built-in spinner. On success the modal closes; on a rejection it stays open and RegionError explains why. Must be inside a RegionModalController dialog."
|
|
248
|
+
});
|
|
249
|
+
const RegionErrorDefinition = defineComponent({
|
|
250
|
+
name: "RegionError",
|
|
251
|
+
importPath: "@vtex/faststore/components",
|
|
252
|
+
component: RegionError,
|
|
253
|
+
content: RegionErrorContent,
|
|
254
|
+
requiresContext: "region",
|
|
255
|
+
editor: {
|
|
256
|
+
label: "Region Error",
|
|
257
|
+
category: "content"
|
|
258
|
+
},
|
|
259
|
+
schema: {},
|
|
260
|
+
guideline: "Shows why the latest region write was refused, announced as an alert when it appears. Renders nothing when there is no error, so it needs no visibility prop. The server's own message is shown verbatim; the authored generic message covers a transport failure, where there is no server message to show. Must be inside a RegionModalController dialog."
|
|
261
|
+
});
|
|
262
|
+
const RegionUnknownLinkDefinition = defineComponent({
|
|
263
|
+
name: "RegionUnknownLink",
|
|
264
|
+
importPath: "@vtex/faststore/components",
|
|
265
|
+
component: RegionUnknownLink,
|
|
266
|
+
content: RegionUnknownLinkContent,
|
|
267
|
+
requiresContext: "region",
|
|
268
|
+
editor: {
|
|
269
|
+
label: "Region Unknown Postal Code Link",
|
|
270
|
+
category: "navigation"
|
|
271
|
+
},
|
|
272
|
+
schema: {
|
|
273
|
+
href: {
|
|
274
|
+
type: "string",
|
|
275
|
+
label: "Lookup service URL"
|
|
276
|
+
},
|
|
277
|
+
target: {
|
|
278
|
+
type: ["_self", "_blank"],
|
|
279
|
+
default: "_self",
|
|
280
|
+
label: "Open in"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
guideline: "The \"I don't know my postal code\" escape hatch, pointing at a postal-code lookup service. Renders nothing until a destination is set, so a store without a lookup service composes it and simply gets no link rather than a dead one. Its text comes from authored content or its children. Must be inside a RegionModalController dialog."
|
|
284
|
+
});
|
|
285
|
+
/**
|
|
286
|
+
* Reads the active region reactively and publishes it, the modal's draft, and the write state as
|
|
287
|
+
* `region` context.
|
|
288
|
+
*
|
|
289
|
+
* The resolved value is never copied into state: `RegionValue` renders only what the fragment
|
|
290
|
+
* resolves, and a successful write updates the display solely by the mutation payload normalizing
|
|
291
|
+
* into the Apollo cache (Decision 5). That is why a rejected write needs no rollback and cannot
|
|
292
|
+
* leave the header showing a postal code the server refused.
|
|
293
|
+
*/
|
|
294
|
+
function RegionRoot({ $data: $dataProp, $actions, className, children, ...props }) {
|
|
295
|
+
const region = useDataOverride($dataProp) ?? null;
|
|
296
|
+
const { loading: rootLoading } = useContext(ReactiveRootContext);
|
|
297
|
+
const loading = rootLoading && region == null;
|
|
298
|
+
const postalCode = region?.postalCode ?? null;
|
|
299
|
+
const [open, setOpenState] = useState(false);
|
|
300
|
+
const [draft, setDraftState] = useState("");
|
|
301
|
+
const [pending, setPending] = useState(false);
|
|
302
|
+
const [errors, setErrors] = useState([]);
|
|
303
|
+
const inFlightRef = useRef(false);
|
|
304
|
+
/**
|
|
305
|
+
* Seeds the draft from the persisted value on open and clears it on close (Decision 6), so a
|
|
306
|
+
* reopened modal always shows the truth rather than an abandoned edit.
|
|
307
|
+
*/
|
|
308
|
+
const setOpen = useCallback((next) => {
|
|
309
|
+
setOpenState(next);
|
|
310
|
+
setDraftState(next ? postalCode ?? "" : "");
|
|
311
|
+
setErrors([]);
|
|
312
|
+
}, [postalCode]);
|
|
313
|
+
/**
|
|
314
|
+
* Editing is the shopper's answer to a rejection, so the message and the invalid flag go with the
|
|
315
|
+
* first keystroke. Left standing, they describe a value that is no longer in the field — and
|
|
316
|
+
* `RegionPostalCodeControl`, which withholds its own incomplete-value copy while a rejection
|
|
317
|
+
* stands, would stay silent for the whole edit. Returns the same array when there is nothing to
|
|
318
|
+
* clear, so ordinary typing does not re-render the error subtree.
|
|
319
|
+
*/
|
|
320
|
+
const setDraft = useCallback((value) => {
|
|
321
|
+
setDraftState(value);
|
|
322
|
+
setErrors((current) => current.length === 0 ? current : []);
|
|
323
|
+
}, []);
|
|
324
|
+
const submit = useCallback(() => {
|
|
325
|
+
if (inFlightRef.current) return;
|
|
326
|
+
const setPostalCode = $actions?.region?.setPostalCode;
|
|
327
|
+
if (!setPostalCode) return;
|
|
328
|
+
inFlightRef.current = true;
|
|
329
|
+
setPending(true);
|
|
330
|
+
setErrors([]);
|
|
331
|
+
setPostalCode(draft).then((writeErrors) => {
|
|
332
|
+
if (writeErrors.length > 0) {
|
|
333
|
+
setErrors(writeErrors);
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
setOpenState(false);
|
|
337
|
+
setDraftState("");
|
|
338
|
+
}).finally(() => {
|
|
339
|
+
inFlightRef.current = false;
|
|
340
|
+
setPending(false);
|
|
341
|
+
});
|
|
342
|
+
}, [$actions, draft]);
|
|
343
|
+
const value = useMemo(() => ({
|
|
344
|
+
postalCode,
|
|
345
|
+
city: region?.city ?? null,
|
|
346
|
+
loading,
|
|
347
|
+
draft,
|
|
348
|
+
setDraft,
|
|
349
|
+
pending,
|
|
350
|
+
errors,
|
|
351
|
+
open,
|
|
352
|
+
setOpen,
|
|
353
|
+
submit
|
|
354
|
+
}), [
|
|
355
|
+
postalCode,
|
|
356
|
+
region?.city,
|
|
357
|
+
loading,
|
|
358
|
+
draft,
|
|
359
|
+
setDraft,
|
|
360
|
+
pending,
|
|
361
|
+
errors,
|
|
362
|
+
open,
|
|
363
|
+
setOpen,
|
|
364
|
+
submit
|
|
365
|
+
]);
|
|
366
|
+
return /* @__PURE__ */ jsx(RegionContextInternal, {
|
|
367
|
+
value,
|
|
368
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
369
|
+
...props,
|
|
370
|
+
className,
|
|
371
|
+
"data-fs-region-root": "",
|
|
372
|
+
children
|
|
373
|
+
})
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
function RegionTrigger({ unsetLabel = "Informe seu CEP", $content, className, children, ...props }) {
|
|
377
|
+
const { postalCode, city, loading, setOpen } = useRegion();
|
|
378
|
+
const isUnset = postalCode == null;
|
|
379
|
+
const resolvedUnsetLabel = $content?.unsetLabel?.trim() ? $content.unsetLabel : unsetLabel;
|
|
380
|
+
const authoredAriaLabel = $content?.ariaLabel?.trim() ? $content.ariaLabel : props["aria-label"];
|
|
381
|
+
/**
|
|
382
|
+
* WCAG 2.5.3 wants the accessible name to contain the visible label, so an authored label prefixes
|
|
383
|
+
* the text on screen rather than replacing it: a name of "Alterar região" over text reading
|
|
384
|
+
* "Informe seu CEP" leaves a voice-control user nothing to say. The region is spaced the way
|
|
385
|
+
* `RegionValue` spaces it, since the name has to carry that text verbatim. Empty while the region
|
|
386
|
+
* is unresolved, when the button reads nothing, and with no authored label the name falls back to
|
|
387
|
+
* the text itself, which already satisfies the rule.
|
|
388
|
+
*/
|
|
389
|
+
let visibleLabel = "";
|
|
390
|
+
if (!loading) visibleLabel = isUnset ? resolvedUnsetLabel : [city, postalCode].filter(Boolean).join(" ");
|
|
391
|
+
const ariaLabel = authoredAriaLabel && visibleLabel ? `${authoredAriaLabel}: ${visibleLabel}` : authoredAriaLabel;
|
|
392
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
393
|
+
...props,
|
|
394
|
+
type: "button",
|
|
395
|
+
onClick: () => setOpen(true),
|
|
396
|
+
disabled: loading || props.disabled,
|
|
397
|
+
"aria-label": ariaLabel,
|
|
398
|
+
className,
|
|
399
|
+
"data-fs-region-trigger": "",
|
|
400
|
+
...isUnset ? { "data-fs-region-trigger-unset": "" } : {},
|
|
401
|
+
children: [isUnset && !loading ? resolvedUnsetLabel : null, children]
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
function RegionValue({ className, ...props }) {
|
|
405
|
+
const { postalCode, city, loading } = useRegion();
|
|
406
|
+
if (loading || postalCode == null) return null;
|
|
407
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
408
|
+
...props,
|
|
409
|
+
className,
|
|
410
|
+
"data-fs-region-value": "",
|
|
411
|
+
children: [
|
|
412
|
+
city ? /* @__PURE__ */ jsx("span", {
|
|
413
|
+
"data-fs-region-value-city": "",
|
|
414
|
+
children: city
|
|
415
|
+
}) : null,
|
|
416
|
+
city ? " " : null,
|
|
417
|
+
postalCode
|
|
418
|
+
]
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function RegionLoading({ className, children, ...props }) {
|
|
422
|
+
const { loading } = useRegion();
|
|
423
|
+
if (!loading) return null;
|
|
424
|
+
return /* @__PURE__ */ jsx("div", {
|
|
425
|
+
...props,
|
|
426
|
+
className,
|
|
427
|
+
"data-fs-region-loading": "",
|
|
428
|
+
children
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Makes the wrapped `DialogRoot` controlled by the region state. Mirrors
|
|
433
|
+
* `ShippingAddressSavedAddressDrawerController`'s `cloneElement` mechanism; expects a single
|
|
434
|
+
* `DialogRoot` child. Dismissal is never blocked — the Phase 1 modal is always dismissible.
|
|
435
|
+
*/
|
|
436
|
+
function RegionModalController({ children }) {
|
|
437
|
+
const { open, setOpen } = useRegion();
|
|
438
|
+
if (!isValidElement(children)) return children;
|
|
439
|
+
return cloneElement(children, {
|
|
440
|
+
open,
|
|
441
|
+
onOpenChange: (next) => setOpen(next)
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Gives the field and the submit a form owner, so Enter in the postal code submits the way it does
|
|
446
|
+
* in every other short form in the repo. Mirrors `ShippingSimulatorForm`: the form's only job is to
|
|
447
|
+
* route native submission to the context's `submit()`.
|
|
448
|
+
*/
|
|
449
|
+
function RegionForm({ className, children, ...props }) {
|
|
450
|
+
const { submit } = useRegion();
|
|
451
|
+
return /* @__PURE__ */ jsx(RegionFormContext, {
|
|
452
|
+
value: true,
|
|
453
|
+
children: /* @__PURE__ */ jsx("form", {
|
|
454
|
+
...props,
|
|
455
|
+
className,
|
|
456
|
+
"data-fs-region-form": "",
|
|
457
|
+
onSubmit: (event) => {
|
|
458
|
+
event.preventDefault();
|
|
459
|
+
submit();
|
|
460
|
+
},
|
|
461
|
+
children
|
|
462
|
+
})
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
function RegionPostalCodeControl({ className, mask, label, placeholder, errorMessage }) {
|
|
466
|
+
const { draft, setDraft, errors, pending } = useRegion();
|
|
467
|
+
const rootRef = useRef(null);
|
|
468
|
+
const refused = errors.length > 0;
|
|
469
|
+
/**
|
|
470
|
+
* A refusal has to leave the shopper on the value they need to correct. Disabling the input while
|
|
471
|
+
* the write is in flight blurs it and the browser drops focus to the document body, so a rejection
|
|
472
|
+
* otherwise lands with nothing focused inside an open dialog — Enter does nothing and Tab restarts
|
|
473
|
+
* from the top. Waits for `pending` to clear, because focusing a still-disabled input is a no-op:
|
|
474
|
+
* the errors and the pending flag settle in separate microtasks, so there is a render in between
|
|
475
|
+
* where the rejection is known and the field is not yet editable. The field is reached through the
|
|
476
|
+
* root the way ClientProfileForm reaches its own fields.
|
|
477
|
+
*/
|
|
478
|
+
useEffect(() => {
|
|
479
|
+
if (!refused || pending) return;
|
|
480
|
+
rootRef.current?.querySelector("[data-fs-postal-code-field-input]")?.focus();
|
|
481
|
+
}, [refused, pending]);
|
|
482
|
+
return /* @__PURE__ */ jsx(PostalCodeField, {
|
|
483
|
+
ref: rootRef,
|
|
484
|
+
className,
|
|
485
|
+
"data-fs-region-postal-code-control": "",
|
|
486
|
+
mask,
|
|
487
|
+
label,
|
|
488
|
+
placeholder,
|
|
489
|
+
errorMessage: errors.length > 0 ? void 0 : errorMessage,
|
|
490
|
+
value: draft,
|
|
491
|
+
onValueChange: setDraft,
|
|
492
|
+
invalid: errors.length > 0,
|
|
493
|
+
disabled: pending
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
function RegionSubmit({ label = "Aplicar", pendingLabel = "Aplicando...", $content, className, children, ...props }) {
|
|
497
|
+
const { draft, pending, submit } = useRegion();
|
|
498
|
+
const inForm = useContext(RegionFormContext);
|
|
499
|
+
const resolvedLabel = $content?.label?.trim() ? $content.label : label;
|
|
500
|
+
const resolvedPendingLabel = $content?.pendingLabel?.trim() ? $content.pendingLabel : pendingLabel;
|
|
501
|
+
return /* @__PURE__ */ jsx("button", {
|
|
502
|
+
...props,
|
|
503
|
+
type: inForm ? "submit" : "button",
|
|
504
|
+
onClick: inForm ? props.onClick : submit,
|
|
505
|
+
disabled: pending || draft.trim() === "" || props.disabled,
|
|
506
|
+
"aria-busy": pending || void 0,
|
|
507
|
+
className,
|
|
508
|
+
"data-fs-region-submit": "",
|
|
509
|
+
...pending ? { "data-fs-region-submit-pending": "" } : {},
|
|
510
|
+
children: children ?? (pending ? resolvedPendingLabel : resolvedLabel)
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* The catalog copy for each rejection the client can name: the server's `RegionErrorCode` values plus
|
|
515
|
+
* the client-minted transport failure. The server's own `message` is English, so it is shown only for
|
|
516
|
+
* a code this map does not know — a newer server than this package.
|
|
517
|
+
*/
|
|
518
|
+
const REGION_ERROR_MESSAGE_IDS = {
|
|
519
|
+
INVALID_POSTAL_CODE: "fs/region.error.invalid-postal-code",
|
|
520
|
+
UNSERVED_POSTAL_CODE: "fs/region.error.unserved-postal-code",
|
|
521
|
+
NETWORK_ERROR: "fs/region.error.network"
|
|
522
|
+
};
|
|
523
|
+
function RegionError({ $content, className, ...props }) {
|
|
524
|
+
const { errors } = useRegion();
|
|
525
|
+
const intl = useIntl();
|
|
526
|
+
if (errors.length === 0) return null;
|
|
527
|
+
const genericMessage = $content?.genericMessage?.trim() ? $content.genericMessage : null;
|
|
528
|
+
function copyFor(error) {
|
|
529
|
+
if (error.code === "NETWORK_ERROR" && genericMessage) return genericMessage;
|
|
530
|
+
const id = error.code ? REGION_ERROR_MESSAGE_IDS[error.code] : void 0;
|
|
531
|
+
return id ? intl.formatMessage({ id }) : error.message;
|
|
532
|
+
}
|
|
533
|
+
return /* @__PURE__ */ jsx("div", {
|
|
534
|
+
...props,
|
|
535
|
+
role: "alert",
|
|
536
|
+
className,
|
|
537
|
+
"data-fs-region-error": "",
|
|
538
|
+
children: errors.map((error) => /* @__PURE__ */ jsx("div", { children: copyFor(error) }, `${error.code ?? ""}${error.message}`))
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
function RegionUnknownLink({ $content, className, children, href, rel, ...props }) {
|
|
542
|
+
useRegion();
|
|
543
|
+
const authoredHref = $content?.href?.trim() ? $content.href : href?.trim();
|
|
544
|
+
if (!authoredHref) return null;
|
|
545
|
+
const destination = resolveSafeHref(authoredHref);
|
|
546
|
+
if (!destination.safe) {
|
|
547
|
+
console.warn("[RegionUnknownLink] link destination rejected", { reason: destination.reason });
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
const text = $content?.text?.trim() ? $content.text : children;
|
|
551
|
+
if (!text) return null;
|
|
552
|
+
const relTokens = rel?.split(/\s+/).filter(Boolean) ?? [];
|
|
553
|
+
const present = new Set(relTokens.map((token) => token.toLowerCase()));
|
|
554
|
+
const safeRel = props.target?.toLowerCase() === "_blank" ? [...relTokens, ...["noopener", "noreferrer"].filter((token) => !present.has(token))].join(" ") : rel;
|
|
555
|
+
return /* @__PURE__ */ jsx("a", {
|
|
556
|
+
...props,
|
|
557
|
+
href: destination.href,
|
|
558
|
+
rel: safeRel,
|
|
559
|
+
className,
|
|
560
|
+
"data-fs-region-unknown-link": "",
|
|
561
|
+
children: text
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
const Region = {
|
|
565
|
+
Root: RegionRoot,
|
|
566
|
+
Trigger: RegionTrigger,
|
|
567
|
+
Value: RegionValue,
|
|
568
|
+
Loading: RegionLoading,
|
|
569
|
+
ModalController: RegionModalController,
|
|
570
|
+
Form: RegionForm,
|
|
571
|
+
PostalCodeControl: RegionPostalCodeControl,
|
|
572
|
+
Submit: RegionSubmit,
|
|
573
|
+
Error: RegionError,
|
|
574
|
+
UnknownLink: RegionUnknownLink
|
|
575
|
+
};
|
|
576
|
+
//#endregion
|
|
577
|
+
export { Region, RegionContext, RegionError, RegionErrorContent, RegionErrorDefinition, RegionForm, RegionFormDefinition, RegionLoading, RegionLoadingDefinition, RegionModalController, RegionModalControllerDefinition, RegionPostalCodeControl, RegionPostalCodeControlDefinition, RegionRoot, RegionRootDefinition, RegionSubmit, RegionSubmitContent, RegionSubmitDefinition, RegionTrigger, RegionTriggerContent, RegionTriggerDefinition, RegionUnknownLink, RegionUnknownLinkContent, RegionUnknownLinkDefinition, RegionValue, RegionValueDefinition, useRegion };
|
|
578
|
+
|
|
579
|
+
//# sourceMappingURL=region.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region.js","names":[],"sources":["../../../src/matter/region/region.tsx"],"sourcesContent":["'use client';\n\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport {\n type ComponentPropsWithRef,\n cloneElement,\n createContext,\n isValidElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { DialogRootProps } from '../../particles/dialog/dialog.js';\nimport { PostalCodeField } from '../../particles/postal-code-field/postal-code-field.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { ReactiveRootContext } from '../../sdk/data/page-reactive-data-root.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport { type MessageId, useIntl } from '../../sdk/i18n/client.js';\nimport type { RegionEntity } from '../../sdk/region/operations.js';\nimport type { RegionUserError } from '../../sdk/region/region-operations.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset\n// ---------------------------------------------------------------------------\n\nconst fragment = graphql(`\n fragment RegionData on Query {\n region {\n ...RegionFragment\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Content models — one per copy-bearing part (Decision 7)\n// ---------------------------------------------------------------------------\n\nexport const RegionTriggerContent = defineContentType({\n id: 'region-trigger',\n title: 'Region Trigger',\n description: 'Copy for the control that opens the region modal.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n unsetLabel: { type: 'string', title: 'Label when no region is set' },\n ariaLabel: { type: 'string', title: 'Accessible label' },\n },\n },\n});\n\nexport const RegionSubmitContent = defineContentType({\n id: 'region-submit',\n title: 'Region Submit',\n description: 'Copy for the region submit control.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: { type: 'string', title: 'Button label' },\n pendingLabel: { type: 'string', title: 'Pending label' },\n },\n },\n});\n\nexport const RegionUnknownLinkContent = defineContentType({\n id: 'region-unknown-link',\n title: 'Region \"I don\\'t know my postal code\" Link',\n description: 'Copy and destination for the postal-code lookup link. Absent href omits the link.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', minLength: 1, title: 'Link text' },\n href: {\n type: 'string',\n title: 'Destination',\n format: 'uri-reference',\n // The set `resolveSafeHref` admits, so the Admin form cannot reject a destination the render\n // gate would have kept. Author-time only and lookahead-free, as in the link-bearing particles.\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n },\n },\n});\n\nexport const RegionErrorContent = defineContentType({\n id: 'region-error',\n title: 'Region Error',\n description: 'Fallback message shown when a write fails without a server message.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n genericMessage: { type: 'string', title: 'Generic failure message' },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Region context\n// ---------------------------------------------------------------------------\n\nexport type RegionContextValue = Readonly<{\n /** Persisted postal code, formatted; null until a region is set. */\n postalCode: string | null;\n /** Persisted city; null when the contract does not resolve one. */\n city: string | null;\n /** The reactive read has not resolved and no cached value is available. */\n loading: boolean;\n /** The modal's draft value, masked as the shopper typed it. */\n draft: string;\n setDraft: (value: string) => void;\n /** A write is in flight. */\n pending: boolean;\n /** Errors from the latest write; empty when there are none. */\n errors: readonly RegionUserError[];\n open: boolean;\n setOpen: (open: boolean) => void;\n /** Dispatches setPostalCode with the current draft. No-op while pending. */\n submit: () => void;\n}>;\n\nconst REGION_CONTEXT_UNSET = Symbol('RegionContextUnset');\n\nconst RegionContextInternal = createContext<RegionContextValue | typeof REGION_CONTEXT_UNSET>(REGION_CONTEXT_UNSET);\n\nexport const RegionContext = RegionContextInternal as React.Context<RegionContextValue>;\n\n/**\n * Read the active region and the modal's write state from the nearest `RegionRoot`. Throws when\n * called outside a `RegionRoot` subtree, mirroring `useSession()` and `useCart()`: a misplaced part\n * is a composition bug the author should see immediately, not a silent degrade to \"no region\". The\n * compiler catches the same mistake earlier through `requiresContext: 'region'` (ADR-0009).\n */\nexport function useRegion(): RegionContextValue {\n const ctx = useContext(RegionContextInternal);\n if (ctx === REGION_CONTEXT_UNSET) {\n throw new Error('Region components must be used inside a <RegionRoot> subtree.');\n }\n return ctx;\n}\n\n/**\n * Whether a `RegionForm` encloses the subtree. `RegionSubmit` is independently placeable, so it\n * cannot assume a form owner: with one it is a real submit button, which is what makes Enter in the\n * field submit; without one a `type=\"submit\"` button would have nothing to submit and its click\n * would do nothing. Reading this keeps the form composable rather than load-bearing.\n */\nconst RegionFormContext = createContext(false);\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type RegionRootProps = ComponentPropsWithRef<'div'> & {\n /**\n * Region entity slice forwarded by the reactive runtime (`ReactiveDataProvider`) — the value of the\n * `region` top-level field on `RegionData on Query`, not the wrapping `{ region: … }` shape.\n * Receives `null` while the entity has not resolved and when no region is set.\n */\n $data?: RegionEntity | null;\n /** Injected by the compiler from `actions: { region: ['setPostalCode'] }`; the region write surface. */\n $actions?: ComponentActions;\n children?: ReactNode;\n};\n\nexport type RegionTriggerProps = ComponentPropsWithRef<'button'> & {\n /** Shown when no region is set. */\n unsetLabel?: string;\n /** Merchant-authored copy; wins over the props when present. */\n $content?: ContentValue<typeof RegionTriggerContent>;\n};\n\n/** Children are omitted: what this renders is the resolved region, never authored content. */\nexport type RegionValueProps = Omit<ComponentPropsWithRef<'span'>, 'children'>;\n\nexport type RegionLoadingProps = ComponentPropsWithRef<'div'>;\n\nexport type RegionModalControllerProps = {\n children?: ReactNode;\n};\n\nexport type RegionFormProps = ComponentPropsWithRef<'form'>;\n\nexport type RegionPostalCodeControlProps = {\n className?: string;\n /** Mask template forwarded to `PostalCodeField`; defaults to that particle's BR CEP mask. */\n mask?: string;\n label?: string;\n placeholder?: string;\n /** The field's own incomplete-value message. Server rejections surface through `RegionError`. */\n errorMessage?: string;\n};\n\nexport type RegionSubmitProps = ComponentPropsWithRef<'button'> & {\n label?: string;\n pendingLabel?: string;\n /** Merchant-authored copy; wins over the props when present. */\n $content?: ContentValue<typeof RegionSubmitContent>;\n};\n\n/** Children are omitted: what this renders is the write's own error, never authored content. */\nexport type RegionErrorProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {\n /** Merchant-authored fallback copy; wins over the prop when present. */\n $content?: ContentValue<typeof RegionErrorContent>;\n};\n\nexport type RegionUnknownLinkProps = ComponentPropsWithRef<'a'> & {\n /** Merchant-authored text and destination; each wins over its prop when present. */\n $content?: ContentValue<typeof RegionUnknownLinkContent>;\n};\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const RegionRootDefinition = defineComponent<RegionRootProps>({\n name: 'RegionRoot',\n importPath: '@vtex/faststore/components',\n component: RegionRoot,\n fragment,\n fetchStrategy: 'reactive',\n providesContext: 'region',\n actions: { region: ['setPostalCode'] },\n editor: { label: 'Region Root', category: 'content' },\n schema: {},\n guideline:\n 'Provides region context and reads the active postal code and city reactively. Place it in the shared header layout and compose RegionTrigger, RegionValue, RegionLoading, and a RegionModalController inside it. Every Region* component must be a descendant. See region.md.',\n});\n\nexport const RegionTriggerDefinition = defineComponent<RegionTriggerProps>({\n name: 'RegionTrigger',\n importPath: '@vtex/faststore/components',\n component: RegionTrigger,\n content: RegionTriggerContent,\n requiresContext: 'region',\n editor: { label: 'Region Trigger', category: 'action' },\n schema: {\n unsetLabel: { type: 'string', default: 'Informe seu CEP', label: 'Label when no region is set' },\n },\n guideline:\n 'Opens the region modal. Shows its unset label while no region is set; compose RegionValue as its child so the active region reads inside the control once one is. Its accessible name carries the active region, so a screen reader announces where the shopper is shopping. Must be inside RegionRoot.',\n});\n\nexport const RegionValueDefinition = defineComponent<RegionValueProps>({\n name: 'RegionValue',\n importPath: '@vtex/faststore/components',\n component: RegionValue,\n requiresContext: 'region',\n editor: { label: 'Region Value', category: 'content' },\n schema: {},\n guideline:\n 'The active region, as city plus postal code. Renders nothing while the region is unresolved or unset, so it needs no visibility prop — place it inside RegionTrigger, or anywhere in the header that should echo the region. The city is wrapped in its own element (data-fs-region-value-city) so a store can style or hide it; when the contract resolves no city, the postal code renders alone with no separator. A plain space separates the two in the text, so the accessible name reads \"São Paulo 01310-100\"; a flex container strips it, so a gap swatch still sets the visible spacing. Must be inside RegionRoot.',\n});\n\nexport const RegionLoadingDefinition = defineComponent<RegionLoadingProps>({\n name: 'RegionLoading',\n importPath: '@vtex/faststore/components',\n component: RegionLoading,\n requiresContext: 'region',\n editor: { label: 'Region Loading', category: 'content' },\n schema: {},\n guideline:\n 'Renders its children only while the region read has not resolved. Supply a skeleton placeholder as its child, sized like the resolved display so the header does not reflow when the region arrives. RegionValue renders nothing while this branch is showing, so the two never double up. Must be inside RegionRoot.',\n});\n\nexport const RegionModalControllerDefinition = defineComponent<RegionModalControllerProps>({\n name: 'RegionModalController',\n importPath: '@vtex/faststore/components',\n component: RegionModalController,\n requiresContext: 'region',\n editor: { label: 'Region Modal Controller', category: 'action' },\n schema: {},\n guideline:\n 'Wraps a single DialogRoot child (the region modal) and makes it controlled by the region state: RegionTrigger opens it, Escape and the backdrop close it, and a successful write closes it. Do not set raw open/onOpenChange on the wrapped DialogRoot. Compose DialogPortal, DialogBackdrop, DialogViewport and DialogPopup inside it, with DialogTitle and DialogDescription naming the dialog, and place a RegionForm holding RegionPostalCodeControl and RegionSubmit in the popup, alongside RegionError and RegionUnknownLink. Same pattern as CartOpenOnAdd wrapping the mini-cart DrawerRoot. Must be inside RegionRoot.',\n});\n\nexport const RegionFormDefinition = defineComponent<RegionFormProps>({\n name: 'RegionForm',\n importPath: '@vtex/faststore/components',\n component: RegionForm,\n requiresContext: 'region',\n editor: { label: 'Region Form', category: 'action' },\n schema: {},\n guideline:\n 'Form wrapper holding RegionPostalCodeControl and RegionSubmit inside the region modal, so pressing Enter in the field submits. Same role as ShippingSimulatorForm. Compose it whenever both parts sit together; without it the shopper must reach the button, which still works but is not what a one-field form leads them to expect. Must be inside a RegionModalController dialog.',\n});\n\nexport const RegionPostalCodeControlDefinition = defineComponent<RegionPostalCodeControlProps>({\n name: 'RegionPostalCodeControl',\n importPath: '@vtex/faststore/components',\n component: RegionPostalCodeControl,\n requiresContext: 'region',\n editor: { label: 'Region Postal Code Control', category: 'content' },\n schema: {\n mask: { type: 'string', default: '99999-999', label: 'Mask pattern' },\n label: { type: 'string', label: 'Label' },\n placeholder: { type: 'string', label: 'Placeholder' },\n errorMessage: { type: 'string', label: 'Incomplete-value message' },\n },\n guideline:\n 'The postal-code input inside the region modal: a PostalCodeField bound to the region draft, seeded from the persisted value every time the modal opens. Set mask to the country format at build time (default 99999-999, BR CEP). Server rejections mark the field invalid and take focus back to it; their message is shown by RegionError, not repeated here, and the first keystroke after one clears it. Must be inside a RegionModalController dialog.',\n});\n\nexport const RegionSubmitDefinition = defineComponent<RegionSubmitProps>({\n name: 'RegionSubmit',\n importPath: '@vtex/faststore/components',\n component: RegionSubmit,\n content: RegionSubmitContent,\n requiresContext: 'region',\n editor: { label: 'Region Submit', category: 'action' },\n schema: {\n label: { type: 'string', default: 'Aplicar', label: 'Button label' },\n pendingLabel: { type: 'string', default: 'Aplicando...', label: 'Pending label' },\n },\n guideline:\n \"Submits the region draft. Inside a RegionForm it is the form's submit button, which is what makes Enter in the field work; on its own it dispatches directly. Inert while empty and while a write is in flight, so a double activation dispatches one mutation; the pending state is exposed as aria-busy with no built-in spinner. On success the modal closes; on a rejection it stays open and RegionError explains why. Must be inside a RegionModalController dialog.\",\n});\n\nexport const RegionErrorDefinition = defineComponent<RegionErrorProps>({\n name: 'RegionError',\n importPath: '@vtex/faststore/components',\n component: RegionError,\n content: RegionErrorContent,\n requiresContext: 'region',\n editor: { label: 'Region Error', category: 'content' },\n schema: {},\n guideline:\n \"Shows why the latest region write was refused, announced as an alert when it appears. Renders nothing when there is no error, so it needs no visibility prop. The server's own message is shown verbatim; the authored generic message covers a transport failure, where there is no server message to show. Must be inside a RegionModalController dialog.\",\n});\n\nexport const RegionUnknownLinkDefinition = defineComponent<RegionUnknownLinkProps>({\n name: 'RegionUnknownLink',\n importPath: '@vtex/faststore/components',\n component: RegionUnknownLink,\n content: RegionUnknownLinkContent,\n requiresContext: 'region',\n editor: { label: 'Region Unknown Postal Code Link', category: 'navigation' },\n schema: {\n href: { type: 'string', label: 'Lookup service URL' },\n target: { type: ['_self', '_blank'] as const, default: '_self', label: 'Open in' },\n },\n guideline:\n 'The \"I don\\'t know my postal code\" escape hatch, pointing at a postal-code lookup service. Renders nothing until a destination is set, so a store without a lookup service composes it and simply gets no link rather than a dead one. Its text comes from authored content or its children. Must be inside a RegionModalController dialog.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\n/**\n * Reads the active region reactively and publishes it, the modal's draft, and the write state as\n * `region` context.\n *\n * The resolved value is never copied into state: `RegionValue` renders only what the fragment\n * resolves, and a successful write updates the display solely by the mutation payload normalizing\n * into the Apollo cache (Decision 5). That is why a rejected write needs no rollback and cannot\n * leave the header showing a postal code the server refused.\n */\nexport function RegionRoot({ $data: $dataProp, $actions, className, children, ...props }: RegionRootProps) {\n const $data = useDataOverride($dataProp);\n const region = $data ?? null;\n const { loading: rootLoading } = useContext(ReactiveRootContext);\n // A null region is ambiguous on its own — an unresolved read and a shopper who never set one look\n // the same — so the root query's in-flight flag is what separates \"loading\" from \"unset\". Without\n // it a first-time shopper would sit under a skeleton forever instead of seeing the unset prompt.\n const loading = rootLoading && region == null;\n\n const postalCode = region?.postalCode ?? null;\n\n const [open, setOpenState] = useState(false);\n const [draft, setDraftState] = useState('');\n const [pending, setPending] = useState(false);\n const [errors, setErrors] = useState<readonly RegionUserError[]>([]);\n // State is batched, so two activations in one tick would both pass a `pending` check. The ref is\n // what makes \"exactly one mutation per activation\" hold.\n const inFlightRef = useRef(false);\n\n /**\n * Seeds the draft from the persisted value on open and clears it on close (Decision 6), so a\n * reopened modal always shows the truth rather than an abandoned edit.\n */\n const setOpen = useCallback(\n (next: boolean) => {\n setOpenState(next);\n setDraftState(next ? (postalCode ?? '') : '');\n setErrors([]);\n },\n [postalCode],\n );\n\n /**\n * Editing is the shopper's answer to a rejection, so the message and the invalid flag go with the\n * first keystroke. Left standing, they describe a value that is no longer in the field — and\n * `RegionPostalCodeControl`, which withholds its own incomplete-value copy while a rejection\n * stands, would stay silent for the whole edit. Returns the same array when there is nothing to\n * clear, so ordinary typing does not re-render the error subtree.\n */\n const setDraft = useCallback((value: string) => {\n setDraftState(value);\n setErrors((current) => (current.length === 0 ? current : []));\n }, []);\n\n const submit = useCallback(() => {\n if (inFlightRef.current) return;\n const setPostalCode = $actions?.region?.setPostalCode;\n if (!setPostalCode) return;\n\n inFlightRef.current = true;\n setPending(true);\n setErrors([]);\n\n void setPostalCode(draft)\n .then((writeErrors) => {\n if (writeErrors.length > 0) {\n // A rejection keeps the modal open so the message has somewhere to show (US-3).\n setErrors(writeErrors);\n return;\n }\n setOpenState(false);\n setDraftState('');\n })\n .finally(() => {\n inFlightRef.current = false;\n setPending(false);\n });\n }, [$actions, draft]);\n\n const value: RegionContextValue = useMemo(\n () => ({\n postalCode,\n city: region?.city ?? null,\n loading,\n draft,\n setDraft,\n pending,\n errors,\n open,\n setOpen,\n submit,\n }),\n [postalCode, region?.city, loading, draft, setDraft, pending, errors, open, setOpen, submit],\n );\n\n return (\n <RegionContextInternal value={value}>\n <div {...props} className={className} data-fs-region-root=\"\">\n {children}\n </div>\n </RegionContextInternal>\n );\n}\n\nexport function RegionTrigger({\n unsetLabel = 'Informe seu CEP',\n $content,\n className,\n children,\n ...props\n}: RegionTriggerProps) {\n const { postalCode, city, loading, setOpen } = useRegion();\n const isUnset = postalCode == null;\n\n const resolvedUnsetLabel = $content?.unsetLabel?.trim() ? $content.unsetLabel : unsetLabel;\n const authoredAriaLabel = $content?.ariaLabel?.trim() ? $content.ariaLabel : props['aria-label'];\n\n /**\n * WCAG 2.5.3 wants the accessible name to contain the visible label, so an authored label prefixes\n * the text on screen rather than replacing it: a name of \"Alterar região\" over text reading\n * \"Informe seu CEP\" leaves a voice-control user nothing to say. The region is spaced the way\n * `RegionValue` spaces it, since the name has to carry that text verbatim. Empty while the region\n * is unresolved, when the button reads nothing, and with no authored label the name falls back to\n * the text itself, which already satisfies the rule.\n */\n let visibleLabel = '';\n if (!loading) {\n visibleLabel = isUnset ? resolvedUnsetLabel : [city, postalCode].filter(Boolean).join(' ');\n }\n\n const ariaLabel = authoredAriaLabel && visibleLabel ? `${authoredAriaLabel}: ${visibleLabel}` : authoredAriaLabel;\n\n return (\n <button\n {...props}\n type=\"button\"\n onClick={() => setOpen(true)}\n // Not yet interactive while the region is unresolved: activating it would seed the draft from a\n // value that has not arrived.\n disabled={loading || props.disabled}\n aria-label={ariaLabel}\n className={className}\n data-fs-region-trigger=\"\"\n {...(isUnset ? { 'data-fs-region-trigger-unset': '' } : {})}\n >\n {isUnset && !loading ? resolvedUnsetLabel : null}\n {children}\n </button>\n );\n}\n\nexport function RegionValue({ className, ...props }: RegionValueProps) {\n const { postalCode, city, loading } = useRegion();\n if (loading || postalCode == null) return null;\n\n return (\n <span {...props} className={className} data-fs-region-value=\"\">\n {city ? <span data-fs-region-value-city=\"\">{city}</span> : null}\n {/* A real text node, not a styling concern: it is what separates the two values in the\n accessible name — this is the trigger's name whenever no aria-label is authored — and in any\n non-flex placement. It must stay a plain space: a flex container strips it as leading\n whitespace, so a store's `gap` still governs the visible spacing, where an would\n survive and widen the row. Absent with no city, so the postal code never renders padded. */}\n {city ? ' ' : null}\n {postalCode}\n </span>\n );\n}\n\nexport function RegionLoading({ className, children, ...props }: RegionLoadingProps) {\n const { loading } = useRegion();\n if (!loading) return null;\n\n return (\n <div {...props} className={className} data-fs-region-loading=\"\">\n {children}\n </div>\n );\n}\n\n/**\n * Makes the wrapped `DialogRoot` controlled by the region state. Mirrors\n * `ShippingAddressSavedAddressDrawerController`'s `cloneElement` mechanism; expects a single\n * `DialogRoot` child. Dismissal is never blocked — the Phase 1 modal is always dismissible.\n */\nexport function RegionModalController({ children }: RegionModalControllerProps) {\n const { open, setOpen } = useRegion();\n\n if (!isValidElement<Pick<DialogRootProps, 'open' | 'onOpenChange'>>(children)) {\n return children;\n }\n\n return cloneElement(children, {\n open,\n onOpenChange: (next: boolean) => setOpen(next),\n });\n}\n\n/**\n * Gives the field and the submit a form owner, so Enter in the postal code submits the way it does\n * in every other short form in the repo. Mirrors `ShippingSimulatorForm`: the form's only job is to\n * route native submission to the context's `submit()`.\n */\nexport function RegionForm({ className, children, ...props }: RegionFormProps) {\n const { submit } = useRegion();\n\n return (\n <RegionFormContext value={true}>\n <form\n {...props}\n className={className}\n data-fs-region-form=\"\"\n onSubmit={(event) => {\n event.preventDefault();\n submit();\n }}\n >\n {children}\n </form>\n </RegionFormContext>\n );\n}\n\nexport function RegionPostalCodeControl({\n className,\n mask,\n label,\n placeholder,\n errorMessage,\n}: RegionPostalCodeControlProps) {\n const { draft, setDraft, errors, pending } = useRegion();\n const rootRef = useRef<HTMLDivElement>(null);\n const refused = errors.length > 0;\n\n /**\n * A refusal has to leave the shopper on the value they need to correct. Disabling the input while\n * the write is in flight blurs it and the browser drops focus to the document body, so a rejection\n * otherwise lands with nothing focused inside an open dialog — Enter does nothing and Tab restarts\n * from the top. Waits for `pending` to clear, because focusing a still-disabled input is a no-op:\n * the errors and the pending flag settle in separate microtasks, so there is a render in between\n * where the rejection is known and the field is not yet editable. The field is reached through the\n * root the way ClientProfileForm reaches its own fields.\n */\n useEffect(() => {\n if (!refused || pending) return;\n rootRef.current?.querySelector<HTMLInputElement>('[data-fs-postal-code-field-input]')?.focus();\n }, [refused, pending]);\n\n return (\n <PostalCodeField\n ref={rootRef}\n className={className}\n data-fs-region-postal-code-control=\"\"\n mask={mask}\n label={label}\n placeholder={placeholder}\n // The field renders this whenever it is invalid, from either source, so it is withheld while a\n // server rejection stands: that message is RegionError's, and the field's own copy describes an\n // incomplete value — wrong for a complete code the server refused, and contradictory stacked\n // under the real reason.\n errorMessage={errors.length > 0 ? undefined : errorMessage}\n value={draft}\n onValueChange={setDraft}\n // Still flagged invalid, so the refused value carries aria-invalid and the invalid styling.\n invalid={errors.length > 0}\n disabled={pending}\n />\n );\n}\n\nexport function RegionSubmit({\n label = 'Aplicar',\n pendingLabel = 'Aplicando...',\n $content,\n className,\n children,\n ...props\n}: RegionSubmitProps) {\n const { draft, pending, submit } = useRegion();\n const inForm = useContext(RegionFormContext);\n\n const resolvedLabel = $content?.label?.trim() ? $content.label : label;\n const resolvedPendingLabel = $content?.pendingLabel?.trim() ? $content.pendingLabel : pendingLabel;\n\n return (\n <button\n {...props}\n // The form routes native submission to the same submit(); alone there is no form to submit.\n type={inForm ? 'submit' : 'button'}\n onClick={inForm ? props.onClick : submit}\n disabled={pending || draft.trim() === '' || props.disabled}\n aria-busy={pending || undefined}\n className={className}\n data-fs-region-submit=\"\"\n {...(pending ? { 'data-fs-region-submit-pending': '' } : {})}\n >\n {children ?? (pending ? resolvedPendingLabel : resolvedLabel)}\n </button>\n );\n}\n\n/**\n * The catalog copy for each rejection the client can name: the server's `RegionErrorCode` values plus\n * the client-minted transport failure. The server's own `message` is English, so it is shown only for\n * a code this map does not know — a newer server than this package.\n */\nconst REGION_ERROR_MESSAGE_IDS: Readonly<Record<string, MessageId>> = {\n INVALID_POSTAL_CODE: 'fs/region.error.invalid-postal-code',\n UNSERVED_POSTAL_CODE: 'fs/region.error.unserved-postal-code',\n NETWORK_ERROR: 'fs/region.error.network',\n};\n\nexport function RegionError({ $content, className, ...props }: RegionErrorProps) {\n const { errors } = useRegion();\n const intl = useIntl();\n if (errors.length === 0) return null;\n\n const genericMessage = $content?.genericMessage?.trim() ? $content.genericMessage : null;\n\n function copyFor(error: RegionUserError): string {\n // A transport failure carries no server message worth showing a shopper, so the authored\n // generic copy wins there and only there. Every other code the catalog knows renders in the\n // store's language; a code it does not know falls back to the server's own message.\n if (error.code === 'NETWORK_ERROR' && genericMessage) return genericMessage;\n const id = error.code ? REGION_ERROR_MESSAGE_IDS[error.code] : undefined;\n return id ? intl.formatMessage({ id }) : error.message;\n }\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-region-error=\"\">\n {errors.map((error) => (\n <div key={`${error.code ?? ''}${error.message}`}>{copyFor(error)}</div>\n ))}\n </div>\n );\n}\n\nexport function RegionUnknownLink({ $content, className, children, href, rel, ...props }: RegionUnknownLinkProps) {\n // Called for its guard alone: a part placed outside a RegionRoot must fail here the way its\n // siblings do, even though this one reads nothing from the context.\n useRegion();\n\n const authoredHref = $content?.href?.trim() ? $content.href : href?.trim();\n // Absent is \"no link\", the ordinary shape for a store with no lookup service, so it never reaches\n // the allowlist or the log.\n if (!authoredHref) return null;\n\n // No read-time validator enforces the model's `format` or `pattern`, so this is the only gate on\n // the CMS value.\n const destination = resolveSafeHref(authoredHref);\n if (!destination.safe) {\n // A bounded reason and no authored value, the convention the content runtime's own log follows.\n console.warn('[RegionUnknownLink] link destination rejected', { reason: destination.reason });\n return null;\n }\n\n const text = $content?.text?.trim() ? $content.text : children;\n if (!text) return null;\n\n // A lookup service is a natural new-tab destination, so a store may pass target. The tab-nabbing\n // defense is then this component's responsibility, not the composer's — the same contract\n // NavigationLink states. Target keywords and link types are both ASCII case-insensitive per HTML,\n // so _BLANK opens a new tab and a caller-passed NOOPENER already counts.\n const relTokens = rel?.split(/\\s+/).filter(Boolean) ?? [];\n const present = new Set(relTokens.map((token) => token.toLowerCase()));\n const safeRel =\n props.target?.toLowerCase() === '_blank'\n ? [...relTokens, ...['noopener', 'noreferrer'].filter((token) => !present.has(token))].join(' ')\n : rel;\n\n return (\n <a {...props} href={destination.href} rel={safeRel} className={className} data-fs-region-unknown-link=\"\">\n {text}\n </a>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Namespace export\n// ---------------------------------------------------------------------------\n\nexport const Region = {\n Root: RegionRoot,\n Trigger: RegionTrigger,\n Value: RegionValue,\n Loading: RegionLoading,\n ModalController: RegionModalController,\n Form: RegionForm,\n PostalCodeControl: RegionPostalCodeControl,\n Submit: RegionSubmit,\n Error: RegionError,\n UnknownLink: RegionUnknownLink,\n};\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,WAAW,QAAQ;;;;;;CAMxB;AAMD,MAAa,uBAAuB,kBAAkB;CACpD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,YAAY;IAAE,MAAM;IAAU,OAAO;GAA8B;GACnE,WAAW;IAAE,MAAM;IAAU,OAAO;GAAmB;EACzD;CACF;AACF,CAAC;AAED,MAAa,sBAAsB,kBAAkB;CACnD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,OAAO;IAAE,MAAM;IAAU,OAAO;GAAe;GAC/C,cAAc;IAAE,MAAM;IAAU,OAAO;GAAgB;EACzD;CACF;AACF,CAAC;AAED,MAAa,2BAA2B,kBAAkB;CACxD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,MAAM;IAAE,MAAM;IAAU,WAAW;IAAG,OAAO;GAAY;GACzD,MAAM;IACJ,MAAM;IACN,OAAO;IACP,QAAQ;IAGR,SAAS;GACX;EACF;CACF;AACF,CAAC;AAED,MAAa,qBAAqB,kBAAkB;CAClD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YA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