@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,139 @@
|
|
|
1
|
+
# PaymentMethods
|
|
2
|
+
|
|
3
|
+
**Category:** content
|
|
4
|
+
**Purpose:** The store's accepted payment methods, rendered as a strip of flags with an optional heading, both editable in the CMS. The content arrives through the compiler-injected `$content` prop, backed by the `payment-methods` content model declared next to the component; the `heading` and `methods` props are the authored fallback for stores with no CMS binding. One element renders the whole strip.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Visual cues (how to identify in an image)
|
|
9
|
+
|
|
10
|
+
The image is the source of truth for layout. A PaymentMethods strip is present when you see:
|
|
11
|
+
|
|
12
|
+
- A **horizontal row of small card flags** — Visa, Mastercard, Elo, Amex, the Pix logo, a Boleto mark — usually rounded rectangles of roughly uniform size.
|
|
13
|
+
- Often a **short heading above or beside them**: *Formas de pagamento*, *We accept*, *Payment methods*.
|
|
14
|
+
- The glyphs are **brand marks, not text links and not social icons**. Circular monochrome glyphs for Instagram or Facebook are a different component.
|
|
15
|
+
- Typically in a footer band, sometimes wrapping to a second line on a narrow screen.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## When to use
|
|
20
|
+
|
|
21
|
+
- The row of accepted payment brands in a footer or checkout reassurance band.
|
|
22
|
+
- One instance per strip. Every flag in the row is one item of this component's content, not its own element.
|
|
23
|
+
|
|
24
|
+
## When NOT to use
|
|
25
|
+
|
|
26
|
+
- A product's **installment plan or "in 12× of R$ 9,90"** copy → use `PricingPaymentMethodsList`, which reads commerce data for one product rather than store-level configuration.
|
|
27
|
+
- The shopper's **saved cards or payment selection** in checkout → that is a form, not this display strip.
|
|
28
|
+
- A row of **social network icons** → use [[footer-social]]; different content model and different glyph set, and every glyph is a link.
|
|
29
|
+
- A row of **trust or security seals** (SSL, Reclame Aqui) → not payment brands.
|
|
30
|
+
- The **value-proposition strip** (free shipping, secure purchase) → use [[incentives]]; those items pair an icon with a line or two of copy rather than a bare brand flag.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Composition
|
|
35
|
+
|
|
36
|
+
`PaymentMethods` is a leaf in the schema — it has no sub-components and takes no children. The flags come from content, not from child elements.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
FooterRoot
|
|
40
|
+
├─ FooterLinkGroup ← "Ajuda" (siblings; order is visual order)
|
|
41
|
+
├─ FooterLinkGroup ← "Institucional"
|
|
42
|
+
├─ PaymentMethods ← the flag strip
|
|
43
|
+
└─ FooterCopyright
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Content, then prop, per field.** The heading resolves from the CMS entry first and the `heading` prop second; the list resolves the same way, independently. The list is replaced whole rather than merged — an entry supplying an empty list wins over an authored list, because a merchant who cleared the methods cleared them. When no item survives the filter below, the component renders `null` (self-hide) and the footer omits the strip. Non-compiler hosts (Storybook, tests) pass a typed `$content` fixture directly.
|
|
47
|
+
|
|
48
|
+
**Nothing in the model is required, so a half-filled entry still renders.** An entry with only a heading keeps the authored `methods` prop under the merchant's heading, and vice versa. What the component drops is per item, never the whole strip: an item is skipped when its label is blank, or when it carries neither a `method` nor an `iconUrl` — an icon nobody can name is the one thing this must not ship.
|
|
49
|
+
|
|
50
|
+
**Every predefined name must be registered.** A `method` resolves to a sprite symbol the store's build has to include; the store's `global.json` writes the names out under `icons.include` — it is JSON, so it cannot import `PAYMENT_METHOD_NAMES`, and a test that derives the expected set from the exported constant is what keeps the two in step. A name the store never registered renders an empty `<svg>` — no build error and no runtime error, just a missing flag.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Components
|
|
55
|
+
|
|
56
|
+
### PaymentMethods
|
|
57
|
+
|
|
58
|
+
| Prop | Type | Required | Notes |
|
|
59
|
+
|-------|------|----------|-------|
|
|
60
|
+
| `heading` | string | no | Authored fallback. Ignored when a CMS entry supplies a heading |
|
|
61
|
+
| `methods` | array | no | Authored fallback list of `{ label, method?, iconUrl? }`. Ignored when a CMS entry supplies `methods` |
|
|
62
|
+
|
|
63
|
+
Content model (`payment-methods`) fields, edited in the CMS:
|
|
64
|
+
|
|
65
|
+
| Field | Type | Required | Notes |
|
|
66
|
+
|-------|------|----------|-------|
|
|
67
|
+
| `heading` | string | no | Optional strip heading. When set it also names the list for assistive tech; when blank or absent the list is left unnamed rather than given an invented English default |
|
|
68
|
+
| `methods` | array | no | Ordered flags. Reordering here reorders the strip with no deployment. Optional so a heading-only entry falls back to the authored list. Declares `minItems: 1` and no ceiling — Admin-form guidance only, unenforced on the read path, so an empty list still reaches the component and self-hides there |
|
|
69
|
+
| `methods[].method` | enum | no | One of `visa`, `amex`, `apple-pay`, `elo-card`, `diners`, `google-pay`, `mastercard`, `paypal`, `pix`, `stripe`. Renders the dialect glyph |
|
|
70
|
+
| `methods[].label` | string | yes | The method's name. Names the flag for assistive tech; a blank label drops the item |
|
|
71
|
+
| `methods[].iconUrl` | string | no | An uploaded image, for a brand the dialect has no glyph for (Boleto, a regional wallet). Wins over `method` when both are set |
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Canonical schema example
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"footer-payment-methods": {
|
|
80
|
+
"type": "PaymentMethods",
|
|
81
|
+
"style": ["flex", "flex-col", "gap-[12px]"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The element id is the content key, so name it for the section rather than its styling. Renaming it orphans the merchant's entry: the flags stay in the Content Platform while the component reads a key nobody writes.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Common mistakes
|
|
91
|
+
|
|
92
|
+
- **`PaymentMethodsList`, `PaymentIcons`, `PaymentFlags`, `AcceptedPayments`.** The correct name is `PaymentMethods`.
|
|
93
|
+
- **Confusing it with `PricingPaymentMethodsList`.** That one renders one product's installment plan from commerce data. This one renders the store's accepted brands from CMS content. The names are close and the components are unrelated.
|
|
94
|
+
- **One element per flag.** One element renders the whole strip; each flag is an item in its content.
|
|
95
|
+
- **Giving it children.** It is a leaf; the flags are content, which is what makes adding one a CMS save instead of a deployment.
|
|
96
|
+
- **Expecting a `boleto` method name.** The dialect has no Boleto glyph — upload one through `iconUrl` and give the item a `label`.
|
|
97
|
+
- **Setting `iconUrl` and `method` and expecting the glyph.** The upload wins; drop `iconUrl` to get the dialect glyph back.
|
|
98
|
+
- **Shipping without the icon size swatch.** Predefined glyphs default to 24×24 and uploaded images to their natural size, so a mixed strip renders ragged until `data-fs-payment-method-icon` is sized.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Styling
|
|
103
|
+
|
|
104
|
+
`PaymentMethods` renders one root you style directly, plus per-part hooks. The glyph hook covers both the `<svg>` and the `<img>` path, which is what makes a mixed strip line up.
|
|
105
|
+
|
|
106
|
+
| Component | What you style | Plausible classes |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `PaymentMethods` | Stacks the heading over the strip | `flex flex-col gap-[12px]` |
|
|
109
|
+
| `data-fs-payment-methods-heading` | The strip heading | `text-[14px] font-bold uppercase text-[#1a1a1a]` |
|
|
110
|
+
| `data-fs-payment-methods-list` | The flag row, wrapping on narrow screens | `flex flex-wrap items-center gap-[8px] list-none p-0 m-0` |
|
|
111
|
+
| `data-fs-payment-method` | The box one flag occupies | `flex items-center` |
|
|
112
|
+
| `data-fs-payment-method-icon` | Both glyph paths, sized to match | `w-[40px] h-[26px] object-contain` |
|
|
113
|
+
|
|
114
|
+
The list carries an explicit `role="list"`. Keep it: WebKit drops the implicit list role from a `<ul>` whose computed `list-style` is `none`, and `list-none` is exactly what the strip needs, so the attribute is what holds the semantics the named list was chosen for.
|
|
115
|
+
|
|
116
|
+
`data-fs-payment-method-name` carries the enum member on each predefined item — `[data-fs-payment-method-name="pix"]` targets one brand, for a flag that needs its own treatment. It is absent on items with no `method`.
|
|
117
|
+
|
|
118
|
+
Styled example:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"footer-payment-methods": {
|
|
123
|
+
"type": "PaymentMethods",
|
|
124
|
+
"style": ["flex", "flex-col", "gap-[12px]"]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Related
|
|
132
|
+
|
|
133
|
+
- [[footer-root]] — the `<footer>` landmark the strip usually sits inside.
|
|
134
|
+
- [[footer-link-group]] — the headed link columns beside it; same `$content` mechanics, text links instead of glyphs.
|
|
135
|
+
- [[footer-copyright]] — the legal line below it; same `$content` mechanics, plain text.
|
|
136
|
+
- [[incentives]] — the benefit strip usually above it; same `$content` mechanics, and the closest visual sibling — icon-and-copy blocks where these are bare brand marks.
|
|
137
|
+
- [[footer-social]] — the profile-icon row beside it; the same two glyph paths and the same shared icon hook, but every mark links out and the strip's flags do not.
|
|
138
|
+
- `PricingPaymentMethodsList` — one product's installment plan, from commerce data. Closest name in the library and the most common mix-up. It carries no `.md` of its own; read its schema from `catalog.json`.
|
|
139
|
+
- `Icon` — the particle each predefined flag renders. It carries no `.md` of its own; read its schema from `catalog.json`.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# PhoneField
|
|
2
|
+
|
|
3
|
+
**Category:** action
|
|
4
|
+
**Purpose:** A presentational, country-aware phone input that composes the `Field` and `Input` particles (label + masked `<input type="tel">` + inline error). It owns per-country masking (US / BR, US fallback) and validates the number on blur. It is data-agnostic — value flows through props; it consumes no GraphQL and no domain context.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Visual cues (how to identify in an image)
|
|
9
|
+
|
|
10
|
+
- A single-line input labelled **"Phone"**, **"Telefone"**, or similar, showing a masked number: `(123) 456-7890` (US) or `(11) 99999-9999` (BR).
|
|
11
|
+
- The mask formats digits as they are typed; a leading `+1` / `+55` appears for E.164 input.
|
|
12
|
+
- When invalid, an inline error message below the input (e.g. *"Invalid phone number"* or *"Phone number is required"*).
|
|
13
|
+
|
|
14
|
+
The image is the source of truth for layout. If the input is the profile phone of a checkout identity step (pre-filled, persisted), wrap it in `ClientProfilePhoneControl`; otherwise use `PhoneField` directly.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- A standalone, presentational phone input where the host owns the value and the persistence.
|
|
21
|
+
- As the field rendered by `ClientProfilePhoneControl` (the checkout-bound wrapper).
|
|
22
|
+
- Reused later in MyAccount / extensions — it carries no business logic.
|
|
23
|
+
|
|
24
|
+
## When NOT to use
|
|
25
|
+
|
|
26
|
+
- When the field must read/write the shopper profile → use `ClientProfilePhoneControl`, which wraps this particle.
|
|
27
|
+
- For a generic non-phone text field → use the `Field` particle directly.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Composition
|
|
32
|
+
|
|
33
|
+
`PhoneField` is a single leaf particle. Internally it renders:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
PhoneField (data-fs-phone-field-root + data-fs-phone-field-root-country)
|
|
37
|
+
├── Field.Label (data-fs-phone-field-label; the `label` prop)
|
|
38
|
+
├── Input (data-fs-phone-field-input; masked <input type="tel" inputMode="numeric">)
|
|
39
|
+
└── Field.Error (data-fs-phone-field-error; shown when invalid)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
With `requirement: 'hidden'` the particle renders `null` — no DOM node is emitted.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Props
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Default | Notes |
|
|
49
|
+
|------|------|---------|-------|
|
|
50
|
+
| `value` | string | — | Controlled raw (unmasked) value. Omit for uncontrolled use. |
|
|
51
|
+
| `defaultValue` | string | `''` | Uncontrolled initial raw value (pre-fill). |
|
|
52
|
+
| `onValueChange` | `(value: string) => void` | — | Fires on every change with the raw (unmasked) value. |
|
|
53
|
+
| `country` | `'US' \| 'BR'` | `'US'` | Selects the mask and validation rule; other codes fall back to US. |
|
|
54
|
+
| `label` | string | `'Phone'` | Accessible label. |
|
|
55
|
+
| `isDisabled` | boolean | `false` | Disables the input (e.g. while a write is in flight). |
|
|
56
|
+
| `placeholder` | string | — | Input placeholder. |
|
|
57
|
+
| `invalid` | boolean | — | Host-forced invalid state; overrides the internal blur validation when set. |
|
|
58
|
+
| `error` | string | — | Host-supplied error text; overrides the internal error string when set. |
|
|
59
|
+
| `errorInvalid` | string | `'Invalid phone number'` | Inline error for an invalid format. |
|
|
60
|
+
| `errorRequired` | string | `'Phone number is required'` | Inline error when a mandatory field is empty. |
|
|
61
|
+
| `requirement` | `'mandatory' \| 'optional' \| 'hidden'` | `'mandatory'` | `mandatory`: empty blocks; `optional`: empty allowed, format still checked when present; `hidden`: renders `null`. |
|
|
62
|
+
| `onBlur` | `() => void` | — | Fires on blur, after validation runs. |
|
|
63
|
+
|
|
64
|
+
**Validation:** the number is checked on blur/submit only — never per keystroke. A prior error clears while the shopper edits and is re-evaluated on the next blur. Changing `country` resets the local validation state.
|
|
65
|
+
|
|
66
|
+
**Known limitations:**
|
|
67
|
+
|
|
68
|
+
- Country coverage is US/BR only; every other ISO-2 code falls back to the US mask and validation (Gap-06 in the PhoneField spec).
|
|
69
|
+
- Cross-country values are not detected: a saved E.164 number from another country (e.g. `+5511999998888` rendered with `country="US"`) is masked and validated under the configured country's rules, so it displays badly formatted and blurs as invalid. The `country` prop must match the country of the stored number.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Accessibility
|
|
74
|
+
|
|
75
|
+
The label is associated with the input and the error is linked via `aria-describedby` automatically by the Base UI `Field` primitive (WCAG 2.1 AA). The input uses `type="tel"` and `inputMode="numeric"` for a numeric mobile keypad. Validation never blocks typing.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Styling
|
|
80
|
+
|
|
81
|
+
`PhoneField` owns no CSS. Style it via compound swatches / Tailwind targeting the `data-fs-*` attributes:
|
|
82
|
+
|
|
83
|
+
| Target | What you style |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `data-fs-phone-field-root` | The field container (stack the label, input, error). |
|
|
86
|
+
| `data-fs-phone-field-root-country` | Country variant selector (`US` / `BR`) for country-specific tweaks. |
|
|
87
|
+
| `data-fs-phone-field-label` | The label typography. |
|
|
88
|
+
| `data-fs-phone-field-input` | The input box; use `data-invalid:` for the error border. |
|
|
89
|
+
| `data-fs-phone-field-error` | The inline error text (small, red). |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Common mistakes
|
|
94
|
+
|
|
95
|
+
- **Validating on every keystroke.** Format validation runs on blur/submit only.
|
|
96
|
+
- **Wiring GraphQL into this particle.** It is data-agnostic; use `ClientProfilePhoneControl` for the checkout-bound binding.
|
|
97
|
+
- **Localizing via a message id.** There is no `react-intl`; pass `label` / `errorInvalid` / `errorRequired` as strings.
|
|
98
|
+
- **Reading the masked value.** `onValueChange` emits the raw (unmasked) value — persist that, not the display string.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Related
|
|
103
|
+
|
|
104
|
+
- [[client-profile]] — the checkout-bound matter that binds this particle to the shopper `ClientProfile` and persists the phone.
|
|
105
|
+
- [[email-field]] — the equivalent presentational identity particle for email.
|
|
106
|
+
- [[field]] — the underlying form-field particle this composes.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# PostalCodeField
|
|
2
|
+
|
|
3
|
+
**Category:** content
|
|
4
|
+
**Purpose:** A presentational postal-code input that composes the `Field` and `Input` particles (label + native `<input>` + inline error). It formats the value against a configured mask template as the shopper types (e.g. CEP `00000-000`) and flags an incomplete value on blur. It is country-agnostic — the pattern is a `mask` prop, not a country table — and data-agnostic: the value, the submit, and the server's verdict belong to the host.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Visual cues (how to identify in an image)
|
|
9
|
+
|
|
10
|
+
- A single-line text input labelled **"Postal code"**, **"CEP"**, **"ZIP code"**, or the local equivalent, usually with a submit button beside or below it.
|
|
11
|
+
- Shows a masked placeholder like `00000-000` and formats digits as they are typed.
|
|
12
|
+
- Often inside a region/delivery modal opened from a header control, or as one field of an address form.
|
|
13
|
+
- When invalid, an inline error below the input (e.g. *"Enter a complete postal code"*).
|
|
14
|
+
|
|
15
|
+
The image is the source of truth for layout.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## When to use
|
|
20
|
+
|
|
21
|
+
- Any postal-code entry where the host owns the value and the submit: a region modal, a delivery estimate, an address form.
|
|
22
|
+
- As the postal-code field of a larger form that batches its own write.
|
|
23
|
+
|
|
24
|
+
## When NOT to use
|
|
25
|
+
|
|
26
|
+
- For a generic text field → use the `Field` particle directly.
|
|
27
|
+
- For a tax document (CPF) → use `DocumentField`, which adds check-digit validation.
|
|
28
|
+
- To own the region write or the shipping estimate → those belong to the host; this particle performs no mutation.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Composition
|
|
33
|
+
|
|
34
|
+
`PostalCodeField` is a single leaf particle. Internally it renders:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
PostalCodeField (data-fs-postal-code-field + inherited data-fs-field-root)
|
|
38
|
+
├── Field.Label (data-fs-postal-code-field-label; the `label` prop, omitted when empty)
|
|
39
|
+
├── Input (data-fs-postal-code-field-input + data-fs-input; the masked control)
|
|
40
|
+
└── Field.Error (data-fs-postal-code-field-error; the `errorMessage`, shown when invalid)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Props
|
|
46
|
+
|
|
47
|
+
| Prop | Type | Default | Notes |
|
|
48
|
+
|------|------|---------|-------|
|
|
49
|
+
| `mask` | string | `'99999-999'` | Mask template: `9` digit, `A` alpha, `S` alphanumeric, `*` any, interleaved with literals. Pipe-delimited alternates (`99999\|99999-999`) cover formats of different lengths. Build-time configuration, not CMS-authored. |
|
|
50
|
+
| `label` | string | — | Accessible label. The `<label>` element is omitted when no label resolves. |
|
|
51
|
+
| `placeholder` | string | — | Input placeholder. |
|
|
52
|
+
| `errorMessage` | string | — | Inline error text, shown when the field is invalid. |
|
|
53
|
+
| `value` | string | — | Controlled value. Masked on render, so a raw value is accepted. |
|
|
54
|
+
| `defaultValue` | string | `''` | Uncontrolled initial value, masked on mount. |
|
|
55
|
+
| `onValueChange` | `(value: string) => void` | — | Fires on every change with the **masked** value. Use `stripPostalCodeMask` if the write path wants slot characters only. |
|
|
56
|
+
| `onBlur` | `(event) => void` | — | Fires on blur, after the completeness verdict runs. |
|
|
57
|
+
| `invalid` | boolean | `false` | Host-forced invalid state (e.g. a server rejection). ORs with the internal verdict — typing never clears it. |
|
|
58
|
+
| `required` | boolean | `false` | Sets the native `required` attribute. |
|
|
59
|
+
| `disabled` | boolean | `false` | Disables the field. |
|
|
60
|
+
| `name` | string | `'postalCode'` | Field/input name. |
|
|
61
|
+
| `aria-label` / `aria-labelledby` | string | — | Forwarded to the input, not to the wrapper. The way to name the control when no label resolves. |
|
|
62
|
+
| `$content` | content entry | — | Merchant-authored `label`, `placeholder`, and `errorMessage`, all optional; each present, non-blank field wins over its prop — a blank one keeps the prop. |
|
|
63
|
+
|
|
64
|
+
**Masking:** applied progressively on every change; input is never blocked, reordered, or rejected. Overflow past the mask's slot count is dropped. A mask whose slots are all `9` strips non-digits and hints `inputMode="numeric"`; one carrying any `A`, `S`, or `*` slot does neither. Masking is idempotent, so a raw pre-fill and an already-masked value display identically.
|
|
65
|
+
|
|
66
|
+
**Verdict:** on blur, a non-empty value that does not fill every mask slot marks the field invalid and renders `errorMessage`. An empty value produces no verdict — emptiness is the host's submit-gating concern. The verdict clears on the next keystroke and is re-evaluated on the next blur. Semantic correctness (does this postal code exist, does it match the city) is the server's; postal codes carry no check digit.
|
|
67
|
+
|
|
68
|
+
**Helpers:** `applyPostalCodeMask(value, mask)`, `stripPostalCodeMask(value, mask)`, and `isPostalCodeComplete(value, mask)` are exported so a host can gate its submit with the same rule instead of duplicating it.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Accessibility
|
|
73
|
+
|
|
74
|
+
The label is associated with the input and the error is linked via `aria-describedby` automatically by the Base UI `Field` primitive (WCAG 2.1 AA). `autocomplete="postal-code"` satisfies 1.3.5 Identify Input Purpose. Standard text-input keyboard editing: masking weaves literals into the value and never intercepts a key or moves the caret.
|
|
75
|
+
|
|
76
|
+
The control needs a name: with no `label` and no `$content.label` no `Field.Label` renders, and a placeholder is not an accessible name. Name it with `aria-label` or `aria-labelledby` — both are forwarded to the input rather than to the wrapper.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Canonical schema example
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"type": "PostalCodeField",
|
|
85
|
+
"id": "region-postal-code",
|
|
86
|
+
"props": {
|
|
87
|
+
"mask": "99999-999",
|
|
88
|
+
"label": "Postal code",
|
|
89
|
+
"placeholder": "00000-000",
|
|
90
|
+
"errorMessage": "Enter a complete postal code"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The element `id` is the durable content key for the `postal-code-field` entry slice, so renaming it orphans the authored copy.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Common mistakes
|
|
100
|
+
|
|
101
|
+
- **Using `ZipCodeField` or `CepField`.** The correct name is `PostalCodeField`.
|
|
102
|
+
- **Passing a country code instead of a pattern.** There is no `country` prop — set `mask` to the country's format.
|
|
103
|
+
- **Expecting server validation here.** The field only reports "this does not fill the pattern"; the host surfaces the server verdict through `invalid` + `errorMessage`.
|
|
104
|
+
- **Treating an empty field as invalid.** Empty produces no verdict; the host decides whether an empty submit is blocked.
|
|
105
|
+
- **Authoring the mask in the CMS.** Only `label`, `placeholder`, and `errorMessage` are content; the mask is a build-time prop.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Styling
|
|
110
|
+
|
|
111
|
+
`PostalCodeField` owns no CSS. Style it via compound swatches / Tailwind targeting the `data-fs-*` attributes:
|
|
112
|
+
|
|
113
|
+
| Target | What you style | Plausible classes |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| `data-fs-postal-code-field` | The field container (stacks label, input, error) | `flex flex-col gap-[8px]` |
|
|
116
|
+
| `data-fs-postal-code-field-label` | The label typography | `text-[13px] font-semibold text-[#1a1a1a]` |
|
|
117
|
+
| `data-fs-postal-code-field-input` | The input box; compose with `data-invalid`, `data-focused`, `data-disabled` | `h-11 rounded-lg border border-[#d4d4d4] px-4 text-[15px]` |
|
|
118
|
+
| `data-fs-postal-code-field-error` | The inline error text | `text-[12px] text-[#c1272d]` |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Related
|
|
123
|
+
|
|
124
|
+
- [[document-field]] — the sibling masked field for tax documents; shares this mask engine, adds check-digit validation.
|
|
125
|
+
- [[phone-field]] — the sibling masked field for phone numbers; selects its format by country instead of a pattern.
|
|
126
|
+
- [[field]] — the underlying form-field particle this composes.
|