@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,409 @@
|
|
|
1
|
+
# ProductGallery
|
|
2
|
+
|
|
3
|
+
**Category:** commerce
|
|
4
|
+
**Purpose:** Product image/video gallery for PDPs. Fetches media from the active product and delegates rendering to the Gallery primitives. Supports thumbnails, fullscreen, zoom, and slider navigation.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Visual cues (how to identify in an image)
|
|
9
|
+
|
|
10
|
+
A ProductGallery block is present when you see:
|
|
11
|
+
|
|
12
|
+
- A **large main image or video** of the product — the focal visual element.
|
|
13
|
+
- A **thumbnail strip** (small clickable images below or beside the main image) showing alternate views.
|
|
14
|
+
- A **"+N" overflow badge** on the last thumbnail, indicating more images than are visible.
|
|
15
|
+
- **Previous/Next arrows** for navigating media.
|
|
16
|
+
- A **fullscreen trigger** (zoom icon, click-to-expand, or thumbnail overflow badge).
|
|
17
|
+
|
|
18
|
+
Presence of any of the above signals `ProductGalleryRoot`. The image is the source of truth for which sub-components to include.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## When to use
|
|
23
|
+
|
|
24
|
+
- PDP media block — the canonical use.
|
|
25
|
+
|
|
26
|
+
## When NOT to use
|
|
27
|
+
|
|
28
|
+
- Non-PDP contexts without a `productBySlug` query (use `GalleryRoot` directly with a `media` prop).
|
|
29
|
+
- Static image display unrelated to a product — use a plain `<img>` via a layout component.
|
|
30
|
+
- Product shelf / PLP cards — use a shelf-specific image component.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Composition
|
|
35
|
+
|
|
36
|
+
`ProductGalleryRoot` is the only entry point on PDPs. It wraps `GalleryRoot` internally and injects the product media. All Gallery sub-components must be descendants of it.
|
|
37
|
+
|
|
38
|
+
Child order reflects visual order — place sub-components in the same sequence they appear in the image.
|
|
39
|
+
|
|
40
|
+
### Interaction patterns
|
|
41
|
+
|
|
42
|
+
The gallery supports two distinct interaction modes, set by props on `ProductGalleryRoot`. Pick one up front:
|
|
43
|
+
|
|
44
|
+
- **Hover-to-preview + click-to-fullscreen** — `selectOnHover` + `thumbnailOpensFullscreen`. Hovering a thumbnail swaps the main media (no click), and clicking a thumbnail opens the fullscreen overlay. Common on marketplaces (e.g. Americanas-style).
|
|
45
|
+
- **Click-to-select (default)** — neither prop set. Clicking a thumbnail selects it in place; fullscreen, if present, is opened by `GalleryOverflowCount` or by `clickOpensFullscreen` on `GalleryMainMedia`.
|
|
46
|
+
|
|
47
|
+
These are independent toggles; the two named modes are the combinations agents should reach for, but each prop can be set on its own.
|
|
48
|
+
|
|
49
|
+
### Canonical PDP layout
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
ProductGalleryRoot
|
|
53
|
+
├── GalleryMainMedia ← large main image/video
|
|
54
|
+
└── GalleryThumbnails ← thumbnail strip
|
|
55
|
+
├── GalleryThumbnail ← one per media item
|
|
56
|
+
└── GalleryOverflowCount ← "+N" badge on last slot (optional)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### With fullscreen
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
ProductGalleryRoot
|
|
63
|
+
├── GalleryMainMedia
|
|
64
|
+
├── GalleryThumbnails
|
|
65
|
+
│ ├── GalleryThumbnail
|
|
66
|
+
│ └── GalleryOverflowCount
|
|
67
|
+
└── GalleryFullscreen ← modal overlay
|
|
68
|
+
├── GalleryFullscreenTitle ← sr-only a11y title (required)
|
|
69
|
+
├── GalleryFullscreenClose ← close button
|
|
70
|
+
├── GalleryPrevious ← previous arrow
|
|
71
|
+
├── GalleryMainMedia ← reused inside fullscreen
|
|
72
|
+
├── GalleryNext ← next arrow
|
|
73
|
+
└── GalleryThumbnails ← optional thumbnail strip in fullscreen
|
|
74
|
+
└── GalleryThumbnail
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### With zoom (hover magnification)
|
|
78
|
+
|
|
79
|
+
Replace `GalleryMainMedia` with `GalleryZoom` wrapping it:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
ProductGalleryRoot
|
|
83
|
+
├── GalleryZoom
|
|
84
|
+
│ ├── GalleryMainMedia
|
|
85
|
+
│ └── GalleryZoomLens
|
|
86
|
+
├── GalleryZoomResult ← place as sibling of GalleryZoom
|
|
87
|
+
└── GalleryThumbnails
|
|
88
|
+
└── GalleryThumbnail
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### With thumbnail slider and width alignment
|
|
92
|
+
|
|
93
|
+
When the thumbnail strip (with or without navigation arrows) visually spans the same width as the main image, wrap the entire thumbnail row in a `Container`. This keeps the strip and the arrows constrained to the same horizontal bound as `GalleryMainMedia`, regardless of how many thumbnails are visible.
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
ProductGalleryRoot
|
|
97
|
+
├── GalleryMainMedia
|
|
98
|
+
└── Container ← thumbnail row wrapper, same width as main image
|
|
99
|
+
├── GalleryThumbnailsPrevious ← sibling of GalleryThumbnails, not a child
|
|
100
|
+
├── GalleryThumbnails (slider=true, maxVisible=N)
|
|
101
|
+
│ └── GalleryThumbnail
|
|
102
|
+
└── GalleryThumbnailsNext ← sibling of GalleryThumbnails, not a child
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Without navigation arrows — the `Container` still aligns the strip to the main image width:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
ProductGalleryRoot
|
|
109
|
+
├── GalleryMainMedia
|
|
110
|
+
└── Container
|
|
111
|
+
└── GalleryThumbnails
|
|
112
|
+
├── GalleryThumbnail
|
|
113
|
+
└── GalleryOverflowCount
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The visual signal for this pattern: in the image, the left edge of the first thumbnail (or the left arrow) and the right edge of the last thumbnail (or the right arrow) align with the edges of the main image. When you see that alignment, add the `Container` wrapper.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Components
|
|
121
|
+
|
|
122
|
+
### ProductGalleryRoot
|
|
123
|
+
|
|
124
|
+
Entry point. Reads product media via GraphQL fragment and passes it to GalleryRoot.
|
|
125
|
+
|
|
126
|
+
| Prop | Type | Default | Notes |
|
|
127
|
+
|------|------|---------|-------|
|
|
128
|
+
| `defaultIndex` | number | `0` | Initially selected media index |
|
|
129
|
+
| `selectOnHover` | boolean | `false` | Hovering a thumbnail selects it without clicking |
|
|
130
|
+
| `thumbnailOpensFullscreen` | boolean | `false` | Clicking any thumbnail opens fullscreen instead of selecting |
|
|
131
|
+
| `selectedVariantId` | string | — | When set, lazy-fetches that variant's images and videos via the storefront API and shows them instead of the product-level media. On fetch failure or null payload, silently falls back to the product-level media. |
|
|
132
|
+
|
|
133
|
+
**Data:** declares `fragment ProductGalleryData on Query`. Fetches up to 20 product-level media items. When `selectedVariantId` is set, also runs `VariantGalleryQuery` to fetch variant-specific images and videos.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
### GalleryMainMedia
|
|
138
|
+
|
|
139
|
+
Renders the currently selected media item — `<img>` for images, `<video>` for videos. Supports swipe gestures (50 px threshold) to navigate.
|
|
140
|
+
|
|
141
|
+
| Prop | Type | Default | Notes |
|
|
142
|
+
|------|------|---------|-------|
|
|
143
|
+
| `objectFit` | `contain\|cover\|fill\|none` | `contain` | CSS object-fit for the media element |
|
|
144
|
+
| `aspectRatio` | string | — | A CSS `aspect-ratio` value — width and height separated by a space-padded slash. Use `'1 / 1'`, `'4 / 3'`, `'16 / 9'`. Write the spaces (`'16 / 9'`, not `'16/9'`). |
|
|
145
|
+
| `videoAutoPlay` | boolean | `false` | |
|
|
146
|
+
| `videoControls` | boolean | `true` | |
|
|
147
|
+
| `clickOpensFullscreen` | boolean | `false` | Click (not swipe) opens the fullscreen overlay |
|
|
148
|
+
|
|
149
|
+
Must be inside `ProductGalleryRoot` (or `GalleryZoom` which must itself be inside Root).
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### GalleryThumbnails
|
|
154
|
+
|
|
155
|
+
Iterates media items and renders its children once per item. Acts as the data provider for `GalleryThumbnail` and `GalleryOverflowCount`.
|
|
156
|
+
|
|
157
|
+
| Prop | Type | Default | Notes |
|
|
158
|
+
|------|------|---------|-------|
|
|
159
|
+
| `maxVisible` | number | — | Cap on visible thumbnails; last slot becomes overflow |
|
|
160
|
+
| `slider` | boolean | `false` | Enable windowed slider mode (needs `GalleryThumbnailsPrevious`/`Next`) |
|
|
161
|
+
| `animated` | boolean | `false` | Smooth scroll animation (requires `slider=true`) |
|
|
162
|
+
| `direction` | `horizontal\|vertical` | `horizontal` | Scroll axis — match to flex layout |
|
|
163
|
+
| `hideWhenSingle` | boolean | `true` | Hides the strip when `media.length <= 1`. Set `false` to force render even on single-image or empty galleries. |
|
|
164
|
+
|
|
165
|
+
Must be inside `ProductGalleryRoot`.
|
|
166
|
+
|
|
167
|
+
#### Layout combinations
|
|
168
|
+
|
|
169
|
+
The thumbnail strip is composed from three independent axes — **placement** (below vs. side), **scroll mode** (static vs. carousel), and **overflow** (plain strip vs. `+N` badge). All combinations below are already composable; this table is a discoverability aid, not new behavior.
|
|
170
|
+
|
|
171
|
+
| Goal | Placement | Scroll mode | Overflow | Props |
|
|
172
|
+
|---|---|---|---|---|
|
|
173
|
+
| Below, full strip | below | static | none | `direction="horizontal"` (default) + flex-col parent |
|
|
174
|
+
| Below, carousel | below | carousel | none | `direction="horizontal"` + `slider` + `animated` + `GalleryThumbnailsPrevious`/`Next` |
|
|
175
|
+
| Below, +N badge | below | static | `+N` | `maxVisible={N}` + `GalleryOverflowCount` |
|
|
176
|
+
| Side, full strip | side | static | none | `direction="vertical"` + flex-row parent |
|
|
177
|
+
| Side, carousel | side | carousel | none | `direction="vertical"` + `slider` + `animated` + `GalleryThumbnailsPrevious`/`Next` |
|
|
178
|
+
|
|
179
|
+
Notes: `direction` sets the scroll axis — match it to the parent flex direction (horizontal strip ⇒ `flex-row` parent that itself sits in a `flex-col` root; vertical strip ⇒ `flex-col` strip in a `flex-row` root). Carousel mode needs both `slider` and the `GalleryThumbnailsPrevious`/`Next` siblings; `animated` only adds smooth scrolling. Overflow (`+N`) and carousel are alternative ways to handle more items than fit — use one or the other, not both.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### GalleryThumbnail
|
|
184
|
+
|
|
185
|
+
Thumbnail button for a single media item. Reads from item context — must be a child of `GalleryThumbnails`.
|
|
186
|
+
|
|
187
|
+
| Prop | Type | Default | Notes |
|
|
188
|
+
|------|------|---------|-------|
|
|
189
|
+
| `objectFit` | `contain\|cover\|fill\|none` | `contain` | |
|
|
190
|
+
| `aspectRatio` | string | — | Same format as `GalleryMainMedia`: a CSS `aspect-ratio` string with a space-padded slash, e.g. `'1 / 1'`, `'4 / 3'`, `'16 / 9'`. |
|
|
191
|
+
|
|
192
|
+
Adds `data-fs-gallery-thumbnail-selected="true"` when active. For videos, renders the `previewImageUrl` as thumbnail src.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### GalleryOverflowCount
|
|
197
|
+
|
|
198
|
+
"+N" badge shown when there are more items than `maxVisible`. Only renders on the last thumbnail slot when overflow exists. Clicking opens fullscreen.
|
|
199
|
+
|
|
200
|
+
| Prop | Type | Default | Notes |
|
|
201
|
+
|------|------|---------|-------|
|
|
202
|
+
| `template` | string | `"+{count}"` | `{count}` = number of hidden items |
|
|
203
|
+
| `ariaLabel` | string | `"View all {total} images"` | Applied to the rendered `<button>` so screen readers announce the full action. `{total}` is replaced by the total media count. |
|
|
204
|
+
|
|
205
|
+
Must be a child of `GalleryThumbnails`, alongside `GalleryThumbnail`.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### GalleryFullscreen
|
|
210
|
+
|
|
211
|
+
Fullscreen overlay (Dialog). Opens via `GalleryOverflowCount`, `clickOpensFullscreen=true` on `GalleryMainMedia`, or `thumbnailOpensFullscreen=true` on Root. No props.
|
|
212
|
+
|
|
213
|
+
Must be inside `ProductGalleryRoot`. If you omit `GalleryFullscreenTitle`, a default sr-only `"Gallery"` title is rendered automatically so the dialog always has an accessible name.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### GalleryFullscreenTitle
|
|
218
|
+
|
|
219
|
+
Sets the accessible name for the fullscreen dialog. Optional — when absent, `GalleryFullscreen` renders a default sr-only `"Gallery"` title. No props — pass text as children. Add `className="sr-only"` to hide it visually.
|
|
220
|
+
|
|
221
|
+
Must be inside `GalleryFullscreen`.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### GalleryFullscreenClose
|
|
226
|
+
|
|
227
|
+
Button that closes the fullscreen overlay. Accepts any children (icon, text). No props beyond standard button attributes.
|
|
228
|
+
|
|
229
|
+
Must be inside `GalleryFullscreen`.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### GalleryPrevious / GalleryNext
|
|
234
|
+
|
|
235
|
+
Navigate to the previous/next media item. By default navigation wraps around (first → last, last → first). Accepts any children (icon, text).
|
|
236
|
+
|
|
237
|
+
| Prop | Type | Default | Notes |
|
|
238
|
+
|------|------|---------|-------|
|
|
239
|
+
| `wrap` | boolean | `true` | When `true`, clicking at a boundary wraps to the other end (carousel behavior). Set `false` to stop at the first/last item (linear, bounded list): at the boundary the button is `disabled` and the click is a no-op. Style the disabled state with the Tailwind `disabled:` variant, e.g. `disabled:opacity-30 disabled:cursor-not-allowed`. |
|
|
240
|
+
|
|
241
|
+
Use inside `GalleryFullscreen` for fullscreen slider navigation, or inline for carousel arrows in the main view. For a bounded (non-wrapping) gallery, set `wrap={false}` on both.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### GalleryMediaCount
|
|
246
|
+
|
|
247
|
+
Displays current position and total count.
|
|
248
|
+
|
|
249
|
+
| Prop | Type | Default | Notes |
|
|
250
|
+
|------|------|---------|-------|
|
|
251
|
+
| `template` | string | `"{current} / {total}"` | placeholders: `{current}`, `{total}` |
|
|
252
|
+
|
|
253
|
+
Place anywhere inside `ProductGalleryRoot` — typically inside `GalleryFullscreen` or above `GalleryMainMedia`.
|
|
254
|
+
|
|
255
|
+
#### Template token vocabulary
|
|
256
|
+
|
|
257
|
+
Both template-bearing components draw from one shared token vocabulary. Each token has exactly one meaning, and `{total}` means the same thing wherever it appears (including `GalleryOverflowCount.ariaLabel`):
|
|
258
|
+
|
|
259
|
+
| Token | Meaning | Used by |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| `{total}` | Total number of media items | `GalleryMediaCount.template`, `GalleryOverflowCount.ariaLabel` |
|
|
262
|
+
| `{current}` | Current 1-based position | `GalleryMediaCount.template` |
|
|
263
|
+
| `{count}` | Number of hidden items (overflow) | `GalleryOverflowCount.template` |
|
|
264
|
+
|
|
265
|
+
A token only interpolates in the components listed above; elsewhere it is rendered literally. Defaults render exactly as shipped — `GalleryOverflowCount` shows `"+N"` and `GalleryMediaCount` shows `"2 / 10"`.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
### GalleryZoom / GalleryZoomLens / GalleryZoomResult
|
|
270
|
+
|
|
271
|
+
Hover zoom for images (not videos). Wrap `GalleryMainMedia` inside `GalleryZoom`. Place `GalleryZoomLens` as a sibling of `GalleryMainMedia` inside `GalleryZoom`. Place `GalleryZoomResult` as a sibling of `GalleryZoom` (side-panel) or absolute inside it (on-image overlay).
|
|
272
|
+
|
|
273
|
+
Visual configuration lives on the parent `GalleryZoom` — `GalleryZoomLens` and `GalleryZoomResult` have no zoom props of their own (only `className`/`style`). Set `magnification` and `lensSize` on `GalleryZoom`; the lens and result read them from it.
|
|
274
|
+
|
|
275
|
+
| Component | Key Prop | Default |
|
|
276
|
+
|---|---|---|
|
|
277
|
+
| `GalleryZoom` | `magnification` (number) | `2` |
|
|
278
|
+
| `GalleryZoom` | `lensSize` (number, px) | `150` |
|
|
279
|
+
| `GalleryZoomLens` | — (styling only; config from `GalleryZoom`) | — |
|
|
280
|
+
| `GalleryZoomResult` | — (styling only; config from `GalleryZoom`) | — |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### GalleryThumbnailsPrevious / GalleryThumbnailsNext
|
|
285
|
+
|
|
286
|
+
Slider navigation for the thumbnail strip. Only active when `GalleryThumbnails` has `slider=true`. Place as **siblings** of `GalleryThumbnails`, not as children.
|
|
287
|
+
|
|
288
|
+
| Prop | Type | Default | Notes |
|
|
289
|
+
|------|------|---------|-------|
|
|
290
|
+
| `step` | number | `1` | Items to scroll per click; set to `maxVisible` to jump a full window |
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## Canonical schema example
|
|
295
|
+
|
|
296
|
+
Standard PDP gallery — main image + thumbnail strip with overflow:
|
|
297
|
+
|
|
298
|
+
```json
|
|
299
|
+
{
|
|
300
|
+
"gallery": {
|
|
301
|
+
"type": "ProductGalleryRoot",
|
|
302
|
+
"props": { "defaultIndex": 0, "thumbnailOpensFullscreen": true },
|
|
303
|
+
"children": ["gallery-main", "gallery-thumbnails"]
|
|
304
|
+
},
|
|
305
|
+
"gallery-main": {
|
|
306
|
+
"type": "GalleryMainMedia",
|
|
307
|
+
"props": { "objectFit": "contain", "aspectRatio": "1 / 1", "clickOpensFullscreen": true }
|
|
308
|
+
},
|
|
309
|
+
"gallery-thumbnails": {
|
|
310
|
+
"type": "GalleryThumbnails",
|
|
311
|
+
"props": { "maxVisible": 5 },
|
|
312
|
+
"children": ["gallery-thumbnail", "gallery-overflow"]
|
|
313
|
+
},
|
|
314
|
+
"gallery-thumbnail": {
|
|
315
|
+
"type": "GalleryThumbnail",
|
|
316
|
+
"props": { "objectFit": "contain", "aspectRatio": "1 / 1" }
|
|
317
|
+
},
|
|
318
|
+
"gallery-overflow": {
|
|
319
|
+
"type": "GalleryOverflowCount",
|
|
320
|
+
"props": { "template": "+{count}" }
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Minimal variant — main image only, no thumbnails:
|
|
326
|
+
|
|
327
|
+
```json
|
|
328
|
+
{
|
|
329
|
+
"gallery": {
|
|
330
|
+
"type": "ProductGalleryRoot",
|
|
331
|
+
"children": ["gallery-main"]
|
|
332
|
+
},
|
|
333
|
+
"gallery-main": {
|
|
334
|
+
"type": "GalleryMainMedia",
|
|
335
|
+
"props": { "objectFit": "contain", "aspectRatio": "1 / 1" }
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Common mistakes
|
|
343
|
+
|
|
344
|
+
- **Using `ProductImageGallery`.** That component does not exist. The correct name is `ProductGalleryRoot`.
|
|
345
|
+
- **Using `GalleryRoot` on a PDP.** `GalleryRoot` has no GraphQL fragment — it requires a static `media` prop. On PDPs, always use `ProductGalleryRoot`.
|
|
346
|
+
- **Putting `GalleryThumbnail` directly under `ProductGalleryRoot`.** It must be inside `GalleryThumbnails`, which provides the per-item context.
|
|
347
|
+
- **Putting `GalleryThumbnailsPrevious`/`Next` inside `GalleryThumbnails`.** They are siblings of `GalleryThumbnails`, not children.
|
|
348
|
+
- **Omitting the `Container` wrapper when the thumbnail strip aligns with the main image.** Without a wrapper, the strip and arrows will not share the same horizontal bound as `GalleryMainMedia`. If the image shows the thumbnail row edges aligned with the main image edges, always add a `Container` around the thumbnail row.
|
|
349
|
+
- **Omitting `GalleryFullscreenTitle`.** The fullscreen overlay is a Dialog — it requires an accessible title. Add it with `className="sr-only"` to hide it visually if needed.
|
|
350
|
+
- **Including `GalleryOverflowCount` without `maxVisible` on `GalleryThumbnails`.** Without `maxVisible`, no overflow slot is created and `GalleryOverflowCount` never renders.
|
|
351
|
+
- **Including `GalleryFullscreen` when no fullscreen is visible in the image.** Only add it if the image shows a fullscreen button or zoom icon.
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Styling
|
|
356
|
+
|
|
357
|
+
Fill each element's `style` array with Tailwind classes read off the image. Typical patterns:
|
|
358
|
+
|
|
359
|
+
| Component | What you style | Plausible classes |
|
|
360
|
+
|---|---|---|
|
|
361
|
+
| `ProductGalleryRoot` | Stacks the main media over the thumbnails | `flex flex-col gap-[12px] w-full` |
|
|
362
|
+
| `GalleryMainMedia` | Square framed media, contained, light border | `block w-full aspect-square bg-white border border-[#E5E5E5] rounded-[4px] object-contain p-[16px]` |
|
|
363
|
+
| `GalleryThumbnails` | Horizontal row of thumbnails | `flex flex-row items-center gap-[8px] w-full mt-[4px]` |
|
|
364
|
+
| `GalleryThumbnail` | Small square button; mark the selected one via its data attribute | `block w-[64px] h-[64px] bg-white border border-[#E5E5E5] rounded-[4px] object-contain p-[4px] cursor-pointer data-[fs-gallery-thumbnail-selected=true]:border-[#C8102E]` |
|
|
365
|
+
| `GalleryOverflowCount` | "+N" badge matching the thumbnail box | `flex items-center justify-center w-[64px] h-[64px] bg-[#F5F5F5] border border-[#E5E5E5] rounded-[4px] text-[13px] font-medium text-[#1A1A1A]` |
|
|
366
|
+
|
|
367
|
+
Read the border color, radius, and thumbnail size from the image; use arbitrary values (`w-[64px]`, `border-[#E5E5E5]`) to match it. The selected-thumbnail highlight uses the brand color via the `data-[fs-gallery-thumbnail-selected=true]:` variant.
|
|
368
|
+
|
|
369
|
+
Styled gallery example:
|
|
370
|
+
|
|
371
|
+
```json
|
|
372
|
+
{
|
|
373
|
+
"gallery": {
|
|
374
|
+
"type": "ProductGalleryRoot",
|
|
375
|
+
"props": { "defaultIndex": 0, "thumbnailOpensFullscreen": true },
|
|
376
|
+
"children": ["gallery-main", "gallery-thumbnails"],
|
|
377
|
+
"style": ["flex", "flex-col", "gap-[12px]", "w-full"]
|
|
378
|
+
},
|
|
379
|
+
"gallery-main": {
|
|
380
|
+
"type": "GalleryMainMedia",
|
|
381
|
+
"props": { "objectFit": "contain", "aspectRatio": "1 / 1", "clickOpensFullscreen": true },
|
|
382
|
+
"style": ["block", "w-full", "aspect-square", "bg-white", "border", "border-[#E5E5E5]", "rounded-[4px]", "object-contain", "p-[16px]"]
|
|
383
|
+
},
|
|
384
|
+
"gallery-thumbnails": {
|
|
385
|
+
"type": "GalleryThumbnails",
|
|
386
|
+
"props": { "maxVisible": 5 },
|
|
387
|
+
"children": ["gallery-thumbnail", "gallery-overflow"],
|
|
388
|
+
"style": ["flex", "flex-row", "items-center", "gap-[8px]", "w-full", "mt-[4px]"]
|
|
389
|
+
},
|
|
390
|
+
"gallery-thumbnail": {
|
|
391
|
+
"type": "GalleryThumbnail",
|
|
392
|
+
"props": { "objectFit": "contain", "aspectRatio": "1 / 1" },
|
|
393
|
+
"style": ["block", "w-[64px]", "h-[64px]", "bg-white", "border", "border-[#E5E5E5]", "rounded-[4px]", "object-contain", "p-[4px]", "cursor-pointer", "data-[fs-gallery-thumbnail-selected=true]:border-[#C8102E]"]
|
|
394
|
+
},
|
|
395
|
+
"gallery-overflow": {
|
|
396
|
+
"type": "GalleryOverflowCount",
|
|
397
|
+
"props": { "template": "+{count}" },
|
|
398
|
+
"style": ["flex", "items-center", "justify-center", "w-[64px]", "h-[64px]", "bg-[#F5F5F5]", "border", "border-[#E5E5E5]", "rounded-[4px]", "text-[13px]", "font-medium", "text-[#1A1A1A]"]
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Related
|
|
406
|
+
|
|
407
|
+
- [[pricing]] — price block, typically a sibling on a PDP.
|
|
408
|
+
- [[product-information]] — title and description block, typically a sibling on a PDP.
|
|
409
|
+
- [[gallery]] — generic gallery without product data; use when media comes from a custom source.
|