@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,117 @@
|
|
|
1
|
+
# SignInForm
|
|
2
|
+
|
|
3
|
+
**Category:** identity
|
|
4
|
+
**Purpose:** Composes `EmailField` + `PasswordField` under one submit and dispatches `$actions.session.loginWithPassword({ email, password })`. It pre-fills the email from `clientProfile.email`, blocks the dispatch on client-side email/password validation, maps the resolved `userErrors` to one inline form-level message, and self-gates to `null` once `useSession()` reports `loggedIn`. It must sit inside a `SessionRoot`.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Visual cues (how to identify in an image)
|
|
9
|
+
|
|
10
|
+
- A **combined email + password login form** inside a checkout User Identity / sign-in step, with a single submit button (e.g. "Sign In").
|
|
11
|
+
- Distinct from `EmailIdentificationControl` (email-only, no password, no submit button) — `SignInForm` always has both fields and one submit.
|
|
12
|
+
- A form-level error banner (`role="alert"`) below the fields, separate from any per-field inline error — that banner is this component's own `data-fs-sign-in-form-error` region, not a page-level failure gate.
|
|
13
|
+
|
|
14
|
+
Use `SignInForm` (not a bare `EmailField` + `PasswordField` pair) whenever the shopper must authenticate with an existing password.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- The password sign-in step of the checkout User Identity flow, for a shopper who is `anonymous` or `identified` but not yet `loggedIn`.
|
|
21
|
+
- Anywhere a combined email+password credential submit is needed that writes through the `session` action namespace.
|
|
22
|
+
|
|
23
|
+
## When NOT to use
|
|
24
|
+
|
|
25
|
+
- Passwordless / access-code (two-step) sign-in → a separate component (FSPG-872), not a variant of this one.
|
|
26
|
+
- Email-only pre-fill/identification with no password → use `EmailIdentificationControl`.
|
|
27
|
+
- Logged-in summary, sign-out, or profile editing → out of scope (FSPG-867); `SignInForm` only self-gates to `null` once logged in, it renders no logged-in UI.
|
|
28
|
+
- Password recovery ("Forgot password?") → out of scope for this component; deferred.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Composition
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
SessionRoot (provides the session tri-state; required ancestor)
|
|
36
|
+
└── SignInForm (data-fs-sign-in-form)
|
|
37
|
+
├── EmailField (pre-filled from clientProfile.email; own inline format error)
|
|
38
|
+
├── PasswordField (presence-only validation owned by SignInForm)
|
|
39
|
+
├── form-level error (data-fs-sign-in-form-error, role="alert")
|
|
40
|
+
└── Button (submit) (data-fs-sign-in-form-submit)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`SignInForm` **must** have a `SessionRoot` ancestor — `useSession()` throws otherwise.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Notes |
|
|
50
|
+
|------|------|---------|-------|
|
|
51
|
+
| `emailLabel` / `emailPlaceholder` | string | `'Email'` / `'you@example.com'` | Passed to `EmailField`. |
|
|
52
|
+
| `passwordLabel` / `passwordPlaceholder` | string | `'Password'` / `''` | Passed to `PasswordField`. |
|
|
53
|
+
| `showPasswordLabel` / `hidePasswordLabel` | string | `'Show password'` / `'Hide password'` | Passed to `PasswordField`'s reveal toggle. |
|
|
54
|
+
| `submitLabel` | string | `'Sign In'` | Submit button text. |
|
|
55
|
+
| `invalidEmailMessage` | string | `'Enter a valid email address.'` | Shown on `EmailField` when the pre-submit format check fails. |
|
|
56
|
+
| `passwordRequiredMessage` | string | `'Enter your password.'` | Shown on `PasswordField` when submitted empty. |
|
|
57
|
+
| `invalidCredentialsMessage` | string | `'Incorrect email or password. Please try again.'` | Form-level error for `INVALID_CREDENTIALS`. |
|
|
58
|
+
| `blockedMessage` | string | `'This account has been blocked. Please contact support.'` | Form-level error for `BLOCKED`. |
|
|
59
|
+
| `networkErrorMessage` | string | `'Unable to complete the request. Please try again.'` | Form-level error for the synthetic `NETWORK_ERROR`. |
|
|
60
|
+
| `genericErrorMessage` | string | `'Unable to sign in. Please try again.'` | Fallback for any other/unrecognized `SessionErrorCode`. |
|
|
61
|
+
| `$data` | `{ email?: string \| null } \| null` | injected | `clientProfile` slice from the reactive runtime. Not authored in schema. |
|
|
62
|
+
| `$actions` | injected | — | Carries `session.loginWithPassword` (compiler-injected). |
|
|
63
|
+
|
|
64
|
+
**Data:** declares a colocated `fragment SignInFormData on Query { clientProfile { __typename id email } }` with `fetchStrategy: 'reactive'` — the minimal slice this matter owns (only `email`, for pre-fill).
|
|
65
|
+
|
|
66
|
+
**Write:** declares `actions: { session: ['loginWithPassword'] }`. The write is **pessimistic/async** — it awaits the resolved `userErrors` before doing anything. While in flight, the fields and submit button are disabled and the root carries `data-fs-sign-in-form-pending`, so a checkout-CTA guard can block on it the same way it does for `EmailIdentificationControl`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Behavior
|
|
71
|
+
|
|
72
|
+
- **Pre-fill:** the email field shows `clientProfile.email` (empty when unset) and remains editable; it re-syncs if the pre-fill resolves or changes later.
|
|
73
|
+
- **Client-side validation:** an invalid email format or an empty password blocks the dispatch entirely — no network round trip, the offending field shows its own inline error.
|
|
74
|
+
- **Happy path:** dispatches `$actions.session.loginWithPassword({ email, password })` exactly once; on `userErrors: []`, no local "logged in" flag is set — the next render reads the already-flipped `useSession().state` and self-gates to `null`.
|
|
75
|
+
- **Login errors:** a non-empty `userErrors[0]` maps through `mapSessionErrorMessage` to one of `invalidCredentialsMessage` / `blockedMessage` / `networkErrorMessage` / `genericErrorMessage`, rendered in the single `data-fs-sign-in-form-error` region — structurally distinct from any ancestor `UNAUTHORIZED` gate.
|
|
76
|
+
- **Retry:** after a failed attempt the password is cleared (credential hygiene) but the email is kept; a fresh submit clears the prior form-level error.
|
|
77
|
+
- **Self-gating:** renders the form for `anonymous`/`identified`, returns `null` for `loggedIn` — derived from `useSession()` on every render, never stored locally.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Canonical schema example
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"type": "SessionRoot",
|
|
86
|
+
"children": [
|
|
87
|
+
{
|
|
88
|
+
"type": "SignInForm",
|
|
89
|
+
"props": {
|
|
90
|
+
"emailLabel": "Email",
|
|
91
|
+
"passwordLabel": "Password",
|
|
92
|
+
"submitLabel": "Sign In",
|
|
93
|
+
"invalidCredentialsMessage": "Incorrect email or password. Please try again."
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Common mistakes
|
|
103
|
+
|
|
104
|
+
- **Rendering it outside `SessionRoot`.** `useSession()` throws; every identity page must host a `SessionRoot`.
|
|
105
|
+
- **Conflating the form-level error with the top-level `UNAUTHORIZED` gate.** They are different error classes (ADR-00007) rendered in different places; `SignInForm` never reads or reacts to the top-level gate.
|
|
106
|
+
- **Computing the logged-in state locally.** Read it from `useSession()`; `SignInForm` holds no local "am I logged in" flag.
|
|
107
|
+
- **Adding a second submit or a two-step email-then-password flow.** The password method is one combined form with a single submit; a two-step flow is the separate access-code component (FSPG-872).
|
|
108
|
+
- **Retaining the password after a failed attempt.** It is cleared from state immediately; only the email survives a failed attempt.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Related
|
|
113
|
+
|
|
114
|
+
- [[email-field]] — the presentational particle this composes for the email input.
|
|
115
|
+
- [[password-field]] — the presentational particle this composes for the password input; `SignInForm` owns its presence check.
|
|
116
|
+
- [[email-identification]] — the sibling matter this mirrors in shape (colocated fragment, `pending` convention), without a password or submit step.
|
|
117
|
+
- [[session]] — provides the identification tri-state and the required `SessionRoot` ancestor.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
**Category:** layout
|
|
4
|
+
**Purpose:** Generic tabbed UI primitive. Groups a row of tab buttons with matching content panels and lets the shopper switch between them with mouse, touch, or keyboard. Wraps Base UI's Tabs.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Visual cues (how to identify in an image)
|
|
9
|
+
|
|
10
|
+
A Tabs block is present when you see:
|
|
11
|
+
|
|
12
|
+
- A **row of labels** (often underlined or pill-shaped) at the top of a section, with one label visually highlighted as **active** (different color, underline, filled background, indicator bar).
|
|
13
|
+
- A **content area** below the labels that changes when the shopper clicks a different label.
|
|
14
|
+
|
|
15
|
+
Common storefront uses:
|
|
16
|
+
|
|
17
|
+
- Product detail sections (Description / Specs / Reviews / Shipping / FAQ).
|
|
18
|
+
- Account pages (Profile / Orders / Addresses / Saved Items).
|
|
19
|
+
- Cart drawer sections (Cart Items / Saved for Later).
|
|
20
|
+
- Payment-methods disclosure with **tabs per method** (see [[pricing]] for the Pricing-aware composition).
|
|
21
|
+
|
|
22
|
+
The image is the source of truth for layout. The labels can be horizontal or vertical.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## When to use
|
|
27
|
+
|
|
28
|
+
- Two or more peer content sections that share screen space and are mutually exclusive (one visible at a time).
|
|
29
|
+
- A disclosure panel that already groups data by category (e.g. payment methods, return policies by region).
|
|
30
|
+
|
|
31
|
+
## When NOT to use
|
|
32
|
+
|
|
33
|
+
- Sequential steps in a flow (use a stepper / wizard pattern instead).
|
|
34
|
+
- A single content section — use a plain container.
|
|
35
|
+
- Navigation between routes — use links (`NavigationLink` / `BreadcrumbLink`).
|
|
36
|
+
- Always-visible content that does not need a selector — render the sections directly.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Composition
|
|
41
|
+
|
|
42
|
+
`TabsRoot` is the entry point. Each `TabsTab` must have a matching `TabsPanel` with the same `value`.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
TabsRoot
|
|
46
|
+
├── TabsList
|
|
47
|
+
│ ├── TabsTab (one per panel; unique `value`)
|
|
48
|
+
│ └── TabsIndicator (optional; animated highlight for the active tab)
|
|
49
|
+
└── TabsPanel (one per tab; `value` matches a TabsTab)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Composition rules:**
|
|
53
|
+
|
|
54
|
+
- `TabsList` and `TabsPanel` are both children of `TabsRoot`. They are **siblings**, not nested in each other.
|
|
55
|
+
- `TabsTab` must be inside `TabsList`.
|
|
56
|
+
- `TabsTab.value` and `TabsPanel.value` must match exactly to pair a tab with its panel.
|
|
57
|
+
- Set `TabsRoot.defaultValue` to the `value` of the tab that should be active on first render. Without it, the first tab is selected.
|
|
58
|
+
- `TabsIndicator` is optional. When present, place it inside `TabsList`; Base UI exposes the active tab position via CSS custom properties for animation.
|
|
59
|
+
|
|
60
|
+
Child order reflects visual order.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Components
|
|
65
|
+
|
|
66
|
+
### TabsRoot
|
|
67
|
+
|
|
68
|
+
Root container. Manages the active tab state and the orientation.
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Notes |
|
|
71
|
+
|------|------|---------|-------|
|
|
72
|
+
| `defaultValue` | string | — | Value of the tab active on first render (uncontrolled mode) |
|
|
73
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `"horizontal"` | Controls arrow-key axis (Left/Right vs. Up/Down) |
|
|
74
|
+
|
|
75
|
+
`value` / `onValueChange` are also accepted for controlled mode but are not exposed as schema props.
|
|
76
|
+
|
|
77
|
+
### TabsList
|
|
78
|
+
|
|
79
|
+
Tab buttons container. Owns roving `tabindex` and arrow-key navigation.
|
|
80
|
+
|
|
81
|
+
| Prop | Type | Default | Notes |
|
|
82
|
+
|------|------|---------|-------|
|
|
83
|
+
| `loopFocus` | boolean | `true` | Wraps focus from last → first tab (and vice-versa) |
|
|
84
|
+
| `activateOnFocus` | boolean | `false` | Activate a tab as soon as it receives keyboard focus |
|
|
85
|
+
|
|
86
|
+
### TabsTab
|
|
87
|
+
|
|
88
|
+
Individual tab button. Requires a unique `value` within the enclosing `TabsRoot`.
|
|
89
|
+
|
|
90
|
+
| Prop | Type | Default | Notes |
|
|
91
|
+
|------|------|---------|-------|
|
|
92
|
+
| `value` | string | (required) | Identifier matched against `TabsPanel.value` |
|
|
93
|
+
| `disabled` | boolean | `false` | Disabled tab cannot be selected; keyboard navigation skips it |
|
|
94
|
+
|
|
95
|
+
Base UI sets `aria-selected`, `aria-controls`, `data-active=""` (on the active tab), and `data-disabled=""` (when disabled) automatically. Style the active state via the `data-[active]` CSS attribute selector.
|
|
96
|
+
|
|
97
|
+
### TabsPanel
|
|
98
|
+
|
|
99
|
+
Content panel matched to a tab by `value`.
|
|
100
|
+
|
|
101
|
+
| Prop | Type | Default | Notes |
|
|
102
|
+
|------|------|---------|-------|
|
|
103
|
+
| `value` | string | (required) | Identifier matched against `TabsTab.value` |
|
|
104
|
+
| `keepMounted` | boolean | `false` | Keep the panel in the DOM even when hidden (useful for forms that need to preserve state) |
|
|
105
|
+
|
|
106
|
+
When `keepMounted=false` (default), inactive panels are unmounted entirely. When `true`, they stay in the DOM with a `hidden` attribute.
|
|
107
|
+
|
|
108
|
+
### TabsIndicator
|
|
109
|
+
|
|
110
|
+
Optional `<span>` that visually marks the active tab (animated underline, pill background, etc.). Base UI exposes CSS variables for the active tab's position and size. No props.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Canonical schema example
|
|
115
|
+
|
|
116
|
+
Product detail sections (Description / Specs / Reviews):
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"tabs": {
|
|
121
|
+
"component": "TabsRoot",
|
|
122
|
+
"props": { "defaultValue": "description" },
|
|
123
|
+
"children": ["tabs-list", "panel-description", "panel-specs", "panel-reviews"]
|
|
124
|
+
},
|
|
125
|
+
"tabs-list": {
|
|
126
|
+
"component": "TabsList",
|
|
127
|
+
"children": ["tab-description", "tab-specs", "tab-reviews"]
|
|
128
|
+
},
|
|
129
|
+
"tab-description": { "component": "TabsTab", "props": { "value": "description", "children": "Description" } },
|
|
130
|
+
"tab-specs": { "component": "TabsTab", "props": { "value": "specs", "children": "Specs" } },
|
|
131
|
+
"tab-reviews": { "component": "TabsTab", "props": { "value": "reviews", "children": "Reviews" } },
|
|
132
|
+
"panel-description": { "component": "TabsPanel", "props": { "value": "description" }, "children": ["text-description"] },
|
|
133
|
+
"panel-specs": { "component": "TabsPanel", "props": { "value": "specs" }, "children": ["text-specs"] },
|
|
134
|
+
"panel-reviews": { "component": "TabsPanel", "props": { "value": "reviews" }, "children": ["text-reviews"] }
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Minimal variant (two tabs)
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"tabs": {
|
|
143
|
+
"component": "TabsRoot",
|
|
144
|
+
"props": { "defaultValue": "items" },
|
|
145
|
+
"children": ["tabs-list", "panel-items", "panel-saved"]
|
|
146
|
+
},
|
|
147
|
+
"tabs-list": {
|
|
148
|
+
"component": "TabsList",
|
|
149
|
+
"children": ["tab-items", "tab-saved"]
|
|
150
|
+
},
|
|
151
|
+
"tab-items": { "component": "TabsTab", "props": { "value": "items", "children": "Cart" } },
|
|
152
|
+
"tab-saved": { "component": "TabsTab", "props": { "value": "saved", "children": "Saved" } },
|
|
153
|
+
"panel-items": { "component": "TabsPanel", "props": { "value": "items" } },
|
|
154
|
+
"panel-saved": { "component": "TabsPanel", "props": { "value": "saved" } }
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Common mistakes
|
|
161
|
+
|
|
162
|
+
- **Putting `TabsTab` outside `TabsList`.** Base UI looks up the composite root on `TabsList`; tabs placed elsewhere do not receive keyboard navigation.
|
|
163
|
+
- **Mismatched `value` between tab and panel.** A tab with `value="reviews"` only activates a panel with `value="reviews"`. Typos silently hide the panel.
|
|
164
|
+
- **Duplicate `value` on tabs inside the same `TabsRoot`.** Selecting one activates both; behavior is undefined. Each tab needs a unique `value`.
|
|
165
|
+
- **Nesting `TabsPanel` inside `TabsList`.** They are siblings under `TabsRoot`, not parent/child.
|
|
166
|
+
- **Forgetting `defaultValue` and expecting "no tab active".** Without `defaultValue` or `value`, Base UI selects the first tab. To start with no selection, pass `value={null}` in controlled mode (advanced).
|
|
167
|
+
- **Using `Tabs` for sequential steps.** A stepper / wizard has order semantics and progress; Tabs is mutually-exclusive content of equal weight. Use a stepper component for ordered flows.
|
|
168
|
+
- **Inventing `Tab`, `TabPanel`, or `TabsContent`.** The names are `TabsTab` and `TabsPanel`. There is no `TabsContent`.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Related
|
|
173
|
+
|
|
174
|
+
- [[accordion]] — alternative pattern when multiple sections can be open at the same time, or when vertical stacking and find-in-page support matter more than tabbed UI.
|
|
175
|
+
- [[pricing]] — uses Tabs inside the payment-methods disclosure to group plans by method (Cartão de Crédito / Pix / etc.).
|
|
176
|
+
- [[popover]] — common host for a Tabs composition when the tabs live inside a disclosure panel.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Toast
|
|
2
|
+
|
|
3
|
+
**Category:** layout / action
|
|
4
|
+
**Purpose:** Ephemeral, non-blocking feedback ("Saved", "Added to cart", "Undo") queued from anywhere in the tree and rendered in a single fixed-position stack, without blocking the page.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
- Confirming an action succeeded or failed without interrupting the shopper's flow (save confirmations, cart mutations, form submission results).
|
|
11
|
+
- Offering a short, reversible undo window after a destructive action (e.g. "Removed from cart — Undo").
|
|
12
|
+
- Any transient system message that should announce itself to screen readers (`aria-live`) and disappear on its own.
|
|
13
|
+
|
|
14
|
+
## When NOT to use
|
|
15
|
+
|
|
16
|
+
- **Blocking confirmations that require a decision** (e.g. "Delete this address?") — use `[[dialog]]` instead. A toast auto-dismisses; it cannot wait for a yes/no.
|
|
17
|
+
- **Persistent inline validation** on a form field (e.g. "Email is required") — that is field-level error text, not a toast.
|
|
18
|
+
- **Content a merchant edits in the page schema** (a promo banner, a announcement bar) — a toast is triggered imperatively from code (`useToast().add(...)`), not composed as a static page element with editorial copy.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Composition
|
|
23
|
+
|
|
24
|
+
`Toast` is not authored as a static PageSchema tree the way most components are. Only the **stack scaffolding** is mounted once, near the layout root:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
ToastProvider
|
|
28
|
+
└── ToastPortal
|
|
29
|
+
└── ToastViewport
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Every `ToastRoot` inside `ToastViewport` is rendered **imperatively** by mapping over `useToast().toasts` — it does not appear as a `children` entry in any page schema. A typical per-toast render tree (authored in application code, not in a schema):
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
ToastRoot ← one per queued toast, keyed by toast.id
|
|
36
|
+
├── ToastTitle (optional — auto-renders toast.title with no children)
|
|
37
|
+
├── ToastDescription (optional — auto-renders toast.description with no children)
|
|
38
|
+
├── ToastAction (optional) ← reversible action, e.g. "Undo"
|
|
39
|
+
└── ToastClose (optional)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`Icon` (existing particle) may be composed as a plain sibling of `ToastTitle`/`ToastDescription` inside `ToastRoot` — there is no dedicated status-icon sub-component. Wrap it in a plain `<span data-fs-toast-icon-container="">` at the call site for a tinted background; `ToastRoot` does not inject this wrapper itself, since it renders `children` verbatim. Style both hooks off `data-fs-toast-root-type`.
|
|
43
|
+
|
|
44
|
+
## Components
|
|
45
|
+
|
|
46
|
+
### ToastProvider
|
|
47
|
+
|
|
48
|
+
Mounts the queue. Not styleable — context-only, no host element.
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Default | Notes |
|
|
51
|
+
|------|------|---------|-------|
|
|
52
|
+
| `limit` | `number` | `3` | Max concurrent toasts; the oldest is marked `data-fs-toast-root-limited` (not removed) past the limit. |
|
|
53
|
+
| `timeout` | `number` | `5000` | Default auto-dismiss delay in ms. `0` disables auto-dismiss. |
|
|
54
|
+
| `toastManager` | `ToastManager` | — | External manager for triggering toasts outside React (e.g. a non-component module). Rarely set from a schema. |
|
|
55
|
+
|
|
56
|
+
### ToastPortal
|
|
57
|
+
|
|
58
|
+
Renders `ToastViewport` into `document.body`. No props, context-only.
|
|
59
|
+
|
|
60
|
+
### ToastViewport
|
|
61
|
+
|
|
62
|
+
The fixed-position stack container. Renders a `<div>` — style it directly.
|
|
63
|
+
|
|
64
|
+
No props beyond standard `className`/HTML attributes.
|
|
65
|
+
|
|
66
|
+
### ToastRoot
|
|
67
|
+
|
|
68
|
+
One instance per active toast.
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Notes |
|
|
71
|
+
|------|------|---------|-------|
|
|
72
|
+
| `toast` | `ToastObject` | — | Required. One entry from `useToast().toasts`. |
|
|
73
|
+
| `swipeDirection` | `'up' \| 'down' \| 'left' \| 'right'` or an array of those | `['down', 'right']` | Directions the shopper can swipe to dismiss. |
|
|
74
|
+
|
|
75
|
+
### ToastTitle / ToastDescription
|
|
76
|
+
|
|
77
|
+
No props beyond standard HTML attributes. Render `toast.title` / `toast.description` automatically when composed with no children; pass explicit children to override.
|
|
78
|
+
|
|
79
|
+
### ToastAction / ToastClose
|
|
80
|
+
|
|
81
|
+
No props beyond standard HTML attributes. `ToastAction` auto-renders `toast.actionProps.children` and forwards `toast.actionProps.onClick` when composed with no children. `ToastClose` dismisses the nearest ancestor `ToastRoot` on click.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Triggering a toast
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { useToast } from '@vtex/faststore/components';
|
|
89
|
+
|
|
90
|
+
function SaveProfileButton() {
|
|
91
|
+
const { add } = useToast();
|
|
92
|
+
return (
|
|
93
|
+
<button onClick={() => add({ title: 'Saved', description: 'Your changes were saved.', type: 'success' })}>
|
|
94
|
+
Save
|
|
95
|
+
</button>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`useToast()` is Base UI's `useToastManager()` re-exported under the FastStore name — `toasts`, `add`, `close`, `update`, and `promise` all behave exactly as documented at [base-ui.com/react/components/toast](https://base-ui.com/react/components/toast).
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Styling
|
|
105
|
+
|
|
106
|
+
| Component | What you style | Plausible classes |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `ToastViewport` | Positions the stack on the screen | `fixed bottom-4 right-4 flex flex-col gap-2 w-[320px]` |
|
|
109
|
+
| `ToastRoot` | The toast card's surface; key off `data-fs-toast-root-type` for status color | `rounded-lg px-4 py-3 shadow-lg data-[fs-toast-root-type=error]:bg-red-50` |
|
|
110
|
+
| `ToastTitle` | Toast heading typography | `text-sm font-semibold` |
|
|
111
|
+
| `ToastDescription` | Toast body typography | `text-sm text-gray-600` |
|
|
112
|
+
| `ToastAction` | The reversible-action control (e.g. "Undo") | `text-sm font-semibold underline` |
|
|
113
|
+
| `ToastClose` | The dismiss control | `text-sm opacity-60 hover:opacity-100` |
|
|
114
|
+
|
|
115
|
+
`ToastProvider` and `ToastPortal` are context-only — they render no host element, so there is nothing to style directly on them.
|
|
116
|
+
|
|
117
|
+
`data-fs-toast-root` mirrors Base UI's own `data-swiping` (mid-drag) as `data-fs-toast-root-swiping`, and `data-limited` as `data-fs-toast-root-limited`, so a swatch can react to either without depending on Base UI's raw attribute names.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Related
|
|
122
|
+
|
|
123
|
+
- [[dialog]] — blocking, modal confirmation; use instead of Toast when a decision is required before the shopper can continue.
|
|
124
|
+
- [[drawer]] — persistent side panel for browsing content (e.g. a mini cart); not for transient feedback.
|